After successfully adding the camera exporter plugin to tk-multi-publish2 for Maya, I am trying to adapt it to export multiple file formats, in this case, FBX and alembic.
I have tried adding a plugin for each export/publish but tk-multi-publish2 appears to always use the second defined plugin. I assume I have missed something but can’t see what. Any thoughts would be greatly appreciated! Thank you
# The location of published maya alembic cameras
maya_alembic_camera_publish:
definition: '@shot_root/publish/cameras/{Shot}_{task_name}_{name}.v{version}.abc'
root_name: 'primary'
# The location of published maya fbx cameras
maya_fbx_camera_publish:
definition: '@shot_root/publish/cameras/{Shot}_{task_name}_{name}.v{version}.fbx'
root_name: 'primary'
Can you test your template?
Create a dict with the fields from your context, and attempt to create a path from the template.
Can you share the publish hooks you’re referencing too?
I think if you change the class of your plugin it works, but not if the class is the same.
For example I had one item that needs multiple publish locations and a post_phase hook and indeed it would only keep one of the publish paths.
I hacked my way around it for now but it’s annoying.
Each Publish plugin, regardless of its class name should be an instance with its own isolated properties. It doesnt seem like that is the case.
For me I always get tripped up by setting properties in item.properties because those are global to the collected item and can affect other plugins processing that item. You’ll want to use item.local_properties whenever possible.
For example this affects other plugins using the collected item: item.properties["publish_template"] = publish_template
This sets it only for the current plugin processing that item: item.local_properties["publish_template"] = publish_template