I'm trying to make a python script that searches for an existing camera data-block in the scene and creates it if not found.
I've gone with a rather simple code:
for dcam in bpy.data.cameras:
if dcam.name == "PERSP.Camera":
However, what I've written will keep creating increments of "PERSP.Camera" despite the condition checking if there isn't already a camera with this name.
I'm relatively new to python. Am I missing something about data-blocks where their names cannot be accessed if they're within a loop/not linked to an object in the scene?