Tk-multi-publish2 - Different styles of item collection in standalone vs DCC

Hello!

I’ve been tinkering with the publisher inside of Maya, building a setup that I’m sure is possibly wrong and a bit outside of how it was intended.

The setup allows you to publish objects that are grouped by Sets in Maya.
Simply exporting those objects to a file and publishing that. Ie, avoiding the scene publishing.

I’ve hit a small issue with the item hierarchy in this setup, where I seem to be forced to create 2 items, 1 “parent” item, and 1 “child” before I’m able to get a Context Widget to show.

For example:
In the collector hook, when building items, I need to create an item under the parent_item, then another underneath that (that the plugin hook attaches to) in order to get a Context widget (which appears on the first item created).

If I only create 1 item under the parent_item, I get no Context widget, only the Thumbnail and Description widgets.

However, when I look at the standalone publisher and select a bunch of single files. I get a cleaner setup:
1 item, with a context widget that my publish plugin connects to.

I’m assuming this is the difference between the “process_current_session” and “process_file”?

Is it possible to match the standalone hierarchy inside a DCC session? Or am I just doing something wrong entirely here?

Here’s some side-by-side images that might make it more clear.

Any help is much appreciated, thank you!

1 Like

I ran into the same issue, you’ll have to fork publisher to fix it.
I added a context_widget property and slot to the api item.
Then in the dialog I changed it to see if the items parent is root or if that property is set.

5 Likes

Here is a pull request that has what I did.


On your item set

item.context_widget = True
4 Likes

This is great, thank you mate! I’ll try this.

Cheers!

2 Likes

Hey @jake0 welcome to the forums!

You shouldn’t need to modify the app to enable this.

Basically you need to set the context_change_allowed on the item, and then the context picker will show up.

However you also need to watch out for these two lines:

If you are running the default maya publish accept, then this will disable context change again if a publish template is set, so you may need to implement your own accept method if you were inheriting from the base Maya one.

5 Likes

Hey @philip.scadding ahh yes this worked! I was missing setting that on the item.
Thanks for the heads up on that. All working perfectly now.

Cheers!

2 Likes