Customizing Publish based on Pipeline Step

How do I customize the options for tk-multi-publish2 based on the current pipeline step? Do I need to have separate statements in my tk-maya.yml?

What other parts of the config need to know about all of this? How would any of this work?

I would like to have several different sets of plugins available based on the current Pipeline Step or Task rather than have them all always on.

Also, on a related note. How do I make one of the publish_plugins off/unchecked by default? For example, the below plugin is on by default. How do I change it so it is off by default?

  • name: Publish FBX to Shotgun
    hook: “{self}/{engine}/tk-multi-publish2/basic/”
    Publish Template: proxy_model_fbx



Hi Daniel

Option 1

Your suggestion is a valid approach. To branch your environment structure based upon the step, you would need to modify your hook to return back a different environment file name based on the step. Then you would need different environment YAML files for each step. This could get a bit messy.

Option 2

Another approach would be to take over the publish plugin hook, at least just the accept method, and query the item’s context to check the step, and accept only if it was the right one. You could then add configurations for the same plugin but for each step all to the same settings block:
In the accept method, you would need to query somehow to check which step you were supposed to be accepting. You might even want to add an additional setting to the plugin to allow you to set the step in the environment settings.

Option 3

You could maybe use the template hook to define the settings in the environment yaml.

Personally I think option 2 would be the best approach and give you the most control.
Also, the accept method is where you can return the default checked state of the plugin.



Option #2 was the winner. Thanks again!



The way we accomplished this is to have a collector hook that differentiates between each pipeline step, so it only collects those things that are needed for the publish for that particular pipeline step. So for animation, we would collect the assets that have been animated so they can be alembic cached (we have a plugin to do this); in lighting we would collect the render layers defined in the Maya scene and submit each one to our render farm (a separate plugin for this too); etc etc.