Add actions in the builder template

Please describe the feature you have in mind and explain what the current shortcomings are?

Add the ability to perform actions during construction with workfile template builder.

What is an action

An action is a plugin (like a loader) that is used to execute code.

Actions Type

Workfile Template Builder Actions

This Plugin/Code is executed at the build moment, two possibilities pre or post build.

Placeholder Actions

This plugin/Code is executed when processing a placeholder, the only possibility after processing.

Example

Workfile Template Builder Actions

The keep_placeholder option in the workfile template builder would be a post build action. It will remove placeholders like today. These actions would be listed in the settings of workfile template builder to enable them.

Workfile Template Builder Actions

In a scene with two placeholders, the first loads the model of an asset and the second loads the look of the asset. In this case the look is not applied. An action added to the placeholder will add the look to the model.

I think the post-build actions is basically what we want to do with the connector plugins.

Pre-build actions might need their own category. It would be great to find more use cases of pre-build actions outside of workfile building, so we can figure out if there is a need for a more universal actions.

I couldn’t find a use case for prebuild, one comes to mind now. Maybe to download files published with sitesync?

Maybe we can get the use-cases from the workfile builder and eventually spin out the pre-build actions to their own category. Pre-build actions might need to initially be specific to workfile builder then.

So, I have actually been playing with some ideas and prototypes of changing the workfile template building. I might be able to push a draft some time next week, maybe Wednesday?

Would love to get some testers by then! :wink:

  • Added a build template action in the Loader so that any published workfile could be used as a template.
    • Todo is to allow settings themselves to point to a publish entity to have the profile automatically load it lik the current system does as well, including allowing loading from say a library project.
  • Redesigned the get template builder plugins to use a similar discovery system as other plugins like loaders, creators, etc. It makes it possible for Addons to easily add builder plugins without changing the core code plus makes development easier because plugins always get reloaded (much easier to iterate plugin development)
  • Currently testing with an Event System where placeholder plugins can register to to run actions at specific moments, e.g. end of depth iteration and end of build finished. It works but feels a bit more cumbersome for the plugin than I had hoped, might redesign it slightly.
  • An example run script builder. It places a placeholder that runs at the given order. It’s also capable to register itself some callback events to run the script at the end of every depth iteration and a way to run the script at the end of the build process.

Regarding the Actions. From the user standpoint creating the actions to run on a particular template, how would you envision them doing so? Is it just a placeholder of its own that runs, but runs just after the others? (This is basically how I designed the event/callbacks now)

Actually - I’ve just created a Draft PR that implements the above. Feedback welcome! :slight_smile: