0

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?

Marty Fouts
  • 33,070
  • 10
  • 35
  • 79
  • 3
    Hi and Welcome. Too many options... please edit your question, post the complete loop and add your actual requirements. For one, you can use the scene in context to set the path bpy.context.scene.render.filepath = "rndr_###.png", next you would have to set the frame using bpy.context.scene.frame_set(#) within the loop, see: What is the Python script to set the current frame and finally you might want to reset the output path. Also, I recommend take the tour to learn about how this site works: https://blender.stackexchange.com/tour thanks. – brockmann Oct 12 '21 at 06:18
  • Um, I think we've all been concentrating on the wrong part of the question and not "however it isn't rendered." If that's the real question, the answer is that the OP is choosing screenshot mode rather than rendering. Voting to reopen. – Marty Fouts Oct 12 '21 at 15:16
  • 3
    Editing the question the way it makes sense to you is slippery slope, I asked for clearification 10 hours ago, let's wait for the OP. @MartyFouts – brockmann Oct 12 '21 at 17:04
  • Undoing an edit that makes sense is more pretty far down the slope. Pretty clear "it isn't rendered" was part of the question. – Marty Fouts Oct 12 '21 at 17:07
  • There you go, a compromise. Emphasized a point we all missed but didn't add an interpretation. – Marty Fouts Oct 12 '21 at 17:11
  • @brockmann didn't you vote to close the question as a dup? That hardly sounds like waiting for the OP to me and strikes me as no less interpreting the question than my edit. – Marty Fouts Oct 12 '21 at 20:18

0 Answers0