0

i'm try to make an add-on that can render animation sequences.

If I just use a for loop to render every frame in sequence blender freezes completely until the job is finished.

bpy.ops.render.render("INVOKE_DEFAULT")

renders responsively but the script thinks it happened within a millisecond and the loop moves on to the next frame.

The

bpy.app.handlers.render_post

can detect when a render finishes, but I can't figure out how to use it in a loop with a user definable sequence length.

Operations are being done during rendering between the frames, updating values, so using

(animation=True)

won't work

Or if that's completely impossible, could I at least force UI updates to the add-on panel during rendering with

EXEC_DEFAULT

(I mainly want this so that my addon can show the progress percentage in a UI panel. Doing this from the console is not very pretty)

Robin Betts
  • 76,260
  • 8
  • 77
  • 190
Walter
  • 329
  • 2
  • 10

1 Answers1

0

If you render an image sequence, all you have to do is set your start/end frames as you need, and then use bpy.ops.render.render(animation=True).

L0Lock
  • 15,965
  • 1
  • 20
  • 44
  • hmm that sounds like i wouldnt be able to calculate the progress and estimated time remaining for every frame rendered for my ui panel. – Walter Oct 21 '23 at 20:22
  • Sure but you already have all the progress info you need in the render view already. What would be the purpose of performing a render in a less efficient way to show the info differently? – L0Lock Oct 22 '23 at 04:49
  • estimated time until the sequence is done rendering, as well as a feature i made that can resume interrupted renders due to crashes where the frame left off – Walter Oct 22 '23 at 10:19