# Sequencer scripting (4.22): use on\_finished\_callback to call python function with arguments?

**URL:** <https://forums.unrealengine.com/t/sequencer-scripting-4-22-use-on_finished_callback-to-call-python-function-with-arguments/123955>\
**Category:** Editor Scripting\
**Tags:** unreal-engine\
**Created:** [March 23, 2019, 10:14pm UTC](https://forums.unrealengine.com/t/sequencer-scripting-4-22-use-on_finished_callback-to-call-python-function-with-arguments/123955 "2019-03-23T22:14:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cyaoeu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cyaoeu](https://forums.unrealengine.com/u/cyaoeu)\
**Post date:** [March 23, 2019, 10:14pm UTC](https://forums.unrealengine.com/t/sequencer-scripting-4-22-use-on_finished_callback-to-call-python-function-with-arguments/123955/1 "2019-03-23T22:14:47Z")

</div>

I noticed that 4.22 has a callback for the movie render which seems useful but I don’t really know how to use it. I would like to have the callback call a function with arguments so I could make a batch renderer. Something like this:  
batch\_render(sequence\_index):  
sequences = unreal.EditorAssetLibrary.list\_assets("/Game/Cinematics/Sequences/  
render\_sequence\_to\_movie(sequences[sequence\_index])

def on\_render\_movie\_finished(success, sequence\_index):  
sequence\_index += 1  
batch\_render(sequence\_index)

This doesn’t work though because on\_finished\_callback.bind\_callable(on\_render\_movie\_finished) only takes a single argument. Is there another way to accomplish this?

Edit: for now I made a global variable with the sequence index, kind of ugly but works I guess…

---

<div class="post-metadata">

**Author:** ![Sengunbanba](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sengunbanba](https://forums.unrealengine.com/u/Sengunbanba)\
**Post date:** [May 16, 2019, 9:30am UTC](https://forums.unrealengine.com/t/sequencer-scripting-4-22-use-on_finished_callback-to-call-python-function-with-arguments/123955/2 "2019-05-16T09:30:43Z")

</div>

I want to shoot different sequences in batches with commands. Now I can get sequence in the scene, but I can’t locate capture in sequence. Can you tell me what commands to use?

---

<div class="post-metadata">

**Author:** ![vito0719](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vito0719](https://forums.unrealengine.com/u/vito0719)\
**Post date:** [July 30, 2019, 5:44am UTC](https://forums.unrealengine.com/t/sequencer-scripting-4-22-use-on_finished_callback-to-call-python-function-with-arguments/123955/3 "2019-07-30T05:44:57Z")

</div>

Are you referring to the function included in the SequencerTools plugin? I’ve been trying to get the BP function RenderMovie to work bu no luck so far… It requires a UMovieSceneCapture object but I can’t find a way to get it in BP… I’ve gone to the cpp department to get this batch rendering thing solved…

Does your python code work for at least rendering a movie out? Do you just pass the level sequence actor to it?
