Track frame progress in Python MoviePipelinePythonHostExecutor

Hi there.

I’m currently looking for a way to report progress from a custom MoviePipelineExecutor.
Especially spawned PIEExecutors.

I’m working on a renderfarm executor that works in editor mode (due to object IDs and some custom stuff).
I was taking the approach from the example Deadline plugin as that seamed like a reasonable way to start off.
So I implemented my custom Executor in which I spawn PIEExecutors to render my queue. (Actually one job per queue). Rendering is fine, on_finished delegates are working and everything is fine but the progress for the single job.

Seems like MoviePipelineLibrary’s get_completion_percentage would be the way to go but it seems that’s only feasible when rendering in -game mode. At least in my tests, Unreal threw errors when I tried to provide a loaded world.

edit: I’m using UnrealEditor-CMD which is launched with a python script to kick off the rendering.

So, is there any solution to get the progress from a PIEExecutor or should I take another, completely different approach?

The docs aren’t really helpful for this topic.

Appreciate any help on this!

mark。I got the shame issue as yours

Hi there,

I finally managed to solve this on my custom executor (PIE).

Here is my code snippet, feel free to modify or point out any issues I might have

    @unreal.ufunction(override=True)
    def on_begin_frame(self):
        super(<myCustomExecutor>, self).on_begin_frame()
        if self.pieExecutor and self.job:
            current_progress = self.job.get_status_progress() * 100
            
            # We only want to log progress if it has changed, otherwise we'll spam the log during every engine tick
            if not hasattr(self, 'last_logged_progress'):
                self.last_logged_progress = -1.0
            
            if current_progress != self.last_logged_progress:
                unreal.log(f"{prefix} Progress: {current_progress}")
                self.last_logged_progress = current_progress

output:

[2024.12.02-21.42.55:154][740]LogPython: [MRQ] Progress: 69.921875
[2024.12.02-21.42.55:784][741]LogPython: [MRQ] Progress: 70.05208134651184
[2024.12.02-21.42.56:333][742]LogPython: [MRQ] Progress: 70.18229365348816
[2024.12.02-21.42.57:606][743]LogPython: [MRQ] Progress: 70.3125
1 Like