On finished render callback issue

Hello,

Using your Python API, I would like to know what is the proper way of passing a callback function to an OnRenderMovieStopped object.
I wrote a python script that renders a level sequence, and pass in a function to run as a callback once the render is done. And I am puzzled why my callback does not kickoff when my rendering script is wrapped in a function (Otherwise, the callback runs well if you run the raw body of my function into the Output Log terminal). Please see my script in attachment below.

Thank you.

Simon Z.

1 Like

I stumbled upon the same issue with UE-4.25.4. Surprisingly, delegate works if I declare it in global scope (as in Engine/Plugins/MovieScene/SequencerScripting/Content/Python/sequencer_examples.py) but doesn’t work if I create it inside some function body. Very unpythonish behavior.

Think it is because the garbage collector will kill the callable unless it was declared as a startup object