0
$\begingroup$

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?

$\endgroup$
6
  • 3
    $\begingroup$ 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: blender.stackexchange.com/tour thanks. $\endgroup$
    – brockmann
    Commented Oct 12, 2021 at 6:18
  • $\begingroup$ 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. $\endgroup$ Commented Oct 12, 2021 at 15:16
  • 3
    $\begingroup$ 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 $\endgroup$
    – brockmann
    Commented Oct 12, 2021 at 17:04
  • $\begingroup$ Undoing an edit that makes sense is more pretty far down the slope. Pretty clear "it isn't rendered" was part of the question. $\endgroup$ Commented Oct 12, 2021 at 17:07
  • $\begingroup$ There you go, a compromise. Emphasized a point we all missed but didn't add an interpretation. $\endgroup$ Commented Oct 12, 2021 at 17:11

0

You must log in to answer this question.

Browse other questions tagged .