unreal.MoviePipelineExecutorBase

class unreal.MoviePipelineExecutorBase(outer=None, name='None')

Bases: unreal.Object

A Movie Pipeline Executor is responsible for executing an array of Movie Pipelines, and (optionally) reporting progress back for the movie pipelines. The entire array is passed at once to allow the implementations to choose how to split up the work. By default we provide a local execution (UMoviePipelineLocalExecutor) which works on them serially, but you can create an implementation of this class, change the default in the Project Settings and use your own distribution logic. For example, you may want to distribute the work to multiple computers over a network, which may involve running command line options on each machine to sync the latest content from the project before the execution starts.

C++ Source:

  • Plugin: MovieRenderPipeline

  • Module: MovieRenderPipelineCore

  • File: MoviePipelineExecutor.h

Editor Properties: (see get_editor_property/set_editor_property)

  • debug_widget_class (type(Class)): [Read-Write] Optional widget for feedback during render

  • http_response_recieved_delegate (MoviePipelineHttpResponseRecieved): [Read-Write] If an HTTP Request has been made and a response returned, the returned response will be broadcast on this event.

  • on_executor_errored_delegate (OnMoviePipelineExecutorErrored): [Read-Write] Called when an individual job reports a warning/error. Jobs are considered fatal if the severity was bad enough to abort the job (missing sequence, write failure, etc.)

    Exposed for Blueprints/Python. Called at the same time as the native one.

  • on_executor_finished_delegate (OnMoviePipelineExecutorFinished): [Read-Write] Called when the Executor has finished all jobs. Reports success if no jobs had fatal errors. Subscribe to the error delegate for more information about any errors.

    Exposed for Blueprints/Python. Called at the same time as the native one.

  • socket_message_recieved_delegate (MoviePipelineSocketMessageRecieved): [Read-Write] If this executor has been configured to connect to a socket, this event will be called each time the socket recieves something. The message response expected from the server should have a 4 byte (int32) size prefix for the string to specify how much data we should expect. This delegate will not get invoked until we recieve that many bytes from the socket connection to avoid broadcasting partial messages.

  • target_pipeline_class (type(Class)): [Read-Write] Which Pipeline Class should be created by this Executor. May be null.

  • user_data (str): [Read-Write] Arbitrary data that can be associated with the executor. Not used by default implementations, nor read. This can be used to attach third party metadata such as job ids from remote farms.

cancel_all_jobs()None

Abort the currently executing job and skip all other jobs.

cancel_current_job()None

Abort the currently executing job.

connect_socket(host_name, port)bool

Attempts to connect a socket to the specified host and port. This is a blocking call.

Parameters
  • host_name (str) – The host name as to connect to such as “127.0.0.1”

  • port (int32) – The port to attempt to connect to the host on.

Returns

True if the socket was succesfully connected to the given host and port.

Return type

bool

property debug_widget_class

[Read-Write] Optional widget for feedback during render

Type

(type(Class))

disconnect_socket()None
  • Disconnects the socket (if currently connected.)

execute(pipeline_queue)None

Execute the provided Queue. You are responsible for deciding how to handle each job in the queue and processing them. OnExecutorFinished should be called when all jobs are completed, which can report both success, warning, cancel, or error.

For C++ implementations override virtual void Execute_Implementation() const override For Python/BP implementations override unreal.ufunction(override=True): def execute(self):

Parameters

pipeline_queue (MoviePipelineQueue) – The queue that this should process all jobs for. This can be null when using certain combination of command line render flags/scripting.

get_status_message()str

Get the current status message for this job. May be an empty string.

For C++ implementations override virtual FString GetStatusMessage_Implementation() override For Python/BP implementations override unreal.ufunction(override=True): def get_status_message(self): return ?

Returns

Return type

str

get_status_progress()float

Get the current progress as last set by SetStatusProgress. 0 by default.

For C++ implementations override virtual float GetStatusProgress_Implementation() override For Python/BP implementations override unreal.ufunction(override=True): def get_status_progress(self): return ?

Returns

Return type

float

property http_response_recieved_delegate

[Read-Write] If an HTTP Request has been made and a response returned, the returned response will be broadcast on this event.

Type

(MoviePipelineHttpResponseRecieved)

is_rendering()bool

Report the current state of the executor. This is used to know if we can call Execute again.

For C++ implementations override virtual bool IsRendering_Implementation() const override For Python/BP implementations override unreal.ufunction(override=True): def is_rendering(self): return ?

Returns

True if the executor is currently working on a queue to produce a render.

Return type

bool

is_socket_connected()bool

Returns true if the socket is currently connected, false otherwise. Call ConnectSocket to attempt a connection.

Returns

Return type

bool

on_begin_frame()None

Called once at the beginning of each engine frame.

For C++ implementations override virtual bool OnBeginFrame_Implementation() override For Python/BP implementations override unreal.ufunction(override=True): def on_begin_frame(self): super().on_begin_frame()

property on_executor_errored_delegate

[Read-Write] Called when an individual job reports a warning/error. Jobs are considered fatal if the severity was bad enough to abort the job (missing sequence, write failure, etc.)

Exposed for Blueprints/Python. Called at the same time as the native one.

Type

(OnMoviePipelineExecutorErrored)

on_executor_errored_impl(errored_pipeline, fatal, error_reason)None

On Executor Errored Impl

Parameters
property on_executor_finished_delegate

[Read-Write] Called when the Executor has finished all jobs. Reports success if no jobs had fatal errors. Subscribe to the error delegate for more information about any errors.

Exposed for Blueprints/Python. Called at the same time as the native one.

Type

(OnMoviePipelineExecutorFinished)

on_executor_finished_impl()None

This should be called when the Executor has finished executing all of the things it has been asked to execute. This should be called in the event of a failure as well, and passing in false for success to allow the caller to know failure. Errors should be broadcast on the error delegate, so this is just a handy way to know at the end without having to track it yourself.

send_http_request(url, verb, message, headers)int32

Sends a asynchronous HTTP request. Responses will be returned in the the OnHTTPResponseRecieved event.

Parameters
  • url (str) – The URL to send the request to.

  • verb (str) – The HTTP verb for the request. GET, PUT, POST, etc.

  • message (str) – The content of the request.

  • headers (Map(str, str)) – Headers that should be set on the request.

Returns

Returns an index for the request. This index will be provided in the OnHTTPResponseRecieved event so you can make multiple HTTP requests at once and tell them apart when you recieve them, even if they come out of order.

Return type

int32

send_socket_message(message)bool

Sends a socket message if the socket is currently connected. Messages back will happen in the OnSocketMessageRecieved event.

Parameters

message (str) – The message to send. This will be sent over the socket (if connected) with a 4 byte (int32) size prefix on the message so the recieving end knows how much data to recieve before considering it done. This prevents accidentally chopping json strings in half.

Returns

True if the message was sent succesfully.

Return type

bool

set_movie_pipeline_class(pipeline_class)None

Specify which MoviePipeline class type should be created by this executor when processing jobs.

Parameters

pipeline_class (type(Class)) –

set_status_message(status)None

Set the status of this Executor. Does nothing in default implementations, but a useful shorthand for implementations to broadcast status updates, ie: You can call SetStatusMessage as your executor changes state, and override the SetStatusMessage function to make it actually do something (such as printing to a log or updating a third party API).

For C++ implementations override virtual bool SetStatusMessage_Implementation() override For Python/BP implementations override unreal.ufunction(override=True): def set_status_message(self, inStatus):

Parameters

status (str) – The status message you wish the executor to have.

set_status_progress(progress)None

Set the progress of this Executor. Does nothing in default implementations, but a useful shorthand for implementations to broadcast progress updates, ie: You can call SetStatusProgress as your executor changes progress, and override the SetStatusProgress function to make it actually do something (such as printing to a log or updating a third party API).

Does not necessairly reflect the overall progress of the work, it is an arbitrary 0-1 value that can be used to indicate different things (depending on implementation).

For C++ implementations override virtual bool SetStatusProgress_Implementation() override For Python/BP implementations override unreal.ufunction(override=True): def set_status_progress(self, inStatus):

Parameters

progress (float) – The progress (0-1 range) the executor should have.

property socket_message_recieved_delegate

[Read-Write] If this executor has been configured to connect to a socket, this event will be called each time the socket recieves something. The message response expected from the server should have a 4 byte (int32) size prefix for the string to specify how much data we should expect. This delegate will not get invoked until we recieve that many bytes from the socket connection to avoid broadcasting partial messages.

Type

(MoviePipelineSocketMessageRecieved)

property target_pipeline_class

[Read-Write] Which Pipeline Class should be created by this Executor. May be null.

Type

(type(Class))

property user_data

[Read-Write] Arbitrary data that can be associated with the executor. Not used by default implementations, nor read. This can be used to attach third party metadata such as job ids from remote farms.

Type

(str)