["publish_template"] dict key is overwritten by another plugin during Publish (tk-multi-publish2)

In the Maya publish process I have one item with 2 plugins acting on it. Each plugin needs to save a unique file to a unique path, (they both have their own template paths). Everything works, but the problem comes in during the Publish process, between the accept() and validate() methods. During accept() the path value in[“publish_template”] is correct. Once the process moves to validate() the same value for the same item is overwritten to the above plugin value.

To clarify, there are 2 plugins, the plugin that is called first by the publisher will override the dict value of the plugin that is called after it, during validate() .

I have checked to see if the same item is being passed into validate(), and it is correct.

Currently my solution to the problem is to just create another dictionary entry for the 2nd plugin, one that won’t be accessed by the first. But I did want to know why after processing the correct value in accept(), would it then be overwritten in validate()? It seems to be something that is happening on the publisher’s side, I just haven’t nailed down what yet.


Hi what an awesome profile picture!

So what I wanted to check here is if the two plugins on the item are the same plugin script simply configured differently or if they are two different plugin scripts?

If they are two different plugin scripts then yes they should store their data under a different key in the item properties, so that they don’t overwrite each other.

The reason for this is most likely that your first plugin defines the value in the accept method and then your second plugin redefines the value in its accept method. So when you get to the validate method it will have the value for whichever plugin ran the accept method last and overwrote the value.

Hope that makes sense?