Download

Sequencer scripting (4.22): use on_finished_callback to call python function with arguments?

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…

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?

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?