Camera selection in dumb

I know I’m doing this all wrong but please bear with me… has lines like:

Scenename = 'SCENE_NAME'[Scenename].render.resolution_x = 1920[Scenename].render.resolution_y = 1080
bpy.context.scene.render.layers[0].cycles.use_denoising = False is a bash shell that does some stuff and ends with:

blender -S "$SCENE" -noaudio -b $FILE.blend -P config_$ >> $LOGFILE 2>&1

Tonight I find I need to select one of multiple cameras in a single scene (way up from similar scenes with one camera each). This fails:[Scenename].camera = "Camera2"

TypeError: bpy_struct: item.attr = val: expected a Object type, not str

Looking into it, the error makes sense to me and I think this crude way of rendering in batch might be too limited. Is there any way to select a camera in a simple If so, how?


you can select cam

obj =[0].objects[‘Camera’]

hope it helps

happy bl

Bingo @RickyBlender

obj =[0].objects['Camnext'][Scenename].camera = obj

Cheers mate!