I'm trying to render a timeline (or some specified frames) with a plugin. I set the active camera I want with

context.scene.camera = mycamera

but there are markers in the timeline with different cameras and I end up with the wrong camera rendered.

How can I ignore those markers while rendering or, at least, change them to my intended camera?


1 Answer 1


A quick easy way without scripting is to use the Outliner to disable render from cameras you do not wish to use.

If you specifically want to do it in script, you'll need to run through all objects of type 'camera' then set the value for those you wish to not to render.


Render your scene then return the cameras.

Below seems to work fine but be sure to have your camera selected.

import bpy

list_of_all_scenes = bpy.data.scenes

if bpy.data.is_saved:
    for y in list_of_all_scenes:
        bpy.context.screen.scene = y
        selected = bpy.context.selected_objects
        objs = y.objects
        for x in objs:
            if x.type == 'CAMERA':
                x.hide_render = True
        objs.active.hide_render = False

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .