I require a way to select certain cameras in a scene. My plan is to get all camera objects in a scene, and then based on their names get the ones that I need.
Currently I’m selecting all cameras like this:
all_cams = [ob for ob in list(bpy.context.scene.objects) if ob.type == ‘CAMERA’]
But i think there should be a better way to do this, without iterating through all objects in a scene.
There is the
D.cameras collection and from there I can get all data-block names. But how I can go from data-block names to the object name?
Or at least how do I select the cameras using their data-block name? ( then I can work further based on selected objects)
Do you have any ideas how I can achieve this? Thank you!