I've set my timeline's Start and End frame to $1$. For some reason bpy.ops.render.render(animation=True)
works but not when animation=False
. Why does it not work? No errors. When I press Run Script it seems to be rendering but there is no output image generated.
def render(image_name):
scene.frame_current = 1
scene.frame_set(1)
scene.render.filepath = f'/path/to/file/{image_name}.png'
scene.render.image_settings.file_format = 'PNG'
bpy.ops.render.render(animation=True)
render("myimage")