How do I target a specific scene to render?

I note from the nodes button that the path is as follows:

bpy.ops.render.render(layer="RenderLayer", scene="Van")

Can anyone tell me how I would apply this to a button?


This question,in relation to setting operator properties in a draw method, is a duplicate, but can never find it.

Here is a sample draw method that adds a button to render the layer "RenderLayer" of all scenes in blend.

def draw(self, context):
    layout = self.layout
    for scene in bpy.data.scenes:
        op = layout.operator("render.render", text=scene.name)
        op.layer = "RenderLayer"
        op.scene = scene.name
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.