Skip to main content
1 of 5

Rendering image and then saving to a filepath

Need help solving how to render an image and then save to a filepath while in a loop.

The following takes a photo and exports; however it isn't rendered.

sce = bpy.context.scene.name
bpy.data.scenes[sce].render.filepath = 'filepath'+str(i+1)+'.png'
bpy.ops.render.opengl(write_still=True)

What needs to be changed?