Publish2 custom plugin UI example

I thought I would share an example of a Publish custom plugin UI.
publish_file.py

The example extends the standalone publish_file.py hook, to add options for setting the task’s status to “pending review”, and adding a reviewer.

It dynamically lists people as reviewers who are on the same project and are in a “Review” group.
People

For example “Jim the bad reviewer” is not appearing in the list as no one will let him work on any projects!

To use the plugin download this publish_file.py script, and place it in your config’s hooks/tk-multipublish2/ directory (you may need to create the `tk-multi-publish2 folder inside hooks.)

Then open env/includes/settings/tk-multi-publish2.yml and modify the standalone publish settings to add :{config}/tk-multi-publish2/publish_file.py" to the Publish to Shotgun hook:

settings.tk-multi-publish2.standalone:
  collector: "{self}/collector.py"
  publish_plugins:
    - name: Publish to Shotgun
      hook: "{self}/publish_file.py:{config}/tk-multi-publish2/publish_file.py"
      settings: {}
    - name: Upload for review
      hook: "{self}/upload_version.py"
      settings: {}
  help_url: *help_url
  location: "@apps.tk-multi-publish2.location"

You must make sure to select a Task for your publish item, otherwise it will not be able to set the status or reviewer.
Note this is NOT intended to be a production ready plugin, it is merely here as an example.

The three key methods used to generate a custom UI are:

8 Likes