If the object you need is located in a hidden collection, it can be difficult to find it in large scenes.
To find out in which collection the desired object is located by its type, we need to execute the following. For example for cameras:
1 2 3 |
[(obj.name, obj.users_collection) for obj in bpy.data.objects if obj.type=='CAMERA'] # [('Camera', (bpy.data.collections['camera'],))] |
This code will return a list of cameras and collections in which they are located.