Custom Publish Camera Pluggin - Pipeline Tutorial

Hi

I am following the tutorial of publishing a camera in Maya. I think I did everything in this page

But when I launch publish Panel, none of the camera has been collected. Debug is showing the following.

// Debug: Shotgun manager: Checking plugin: <PublishPluginInstance: {self}/publish_file.py:{config}/tk-multi-publish2/maya/publish_camera.py> //
// Debug: Shotgun manager: Item All Session Geometry (Geometry) with spec ‘maya.session.geometry’ does not match any plugin filters: ‘[‘maya.session.camera’]’ //

3 Likes

Hey

I would add some debugging to check that the camera is being collected correctly.
On the guide the collector should be creating an item with "maya.session.camera", which the plugin should act upon. The log line you highlighted is it rejecting the scene file, which I would expect, but it should be accepting the camera item if it’s been collected.

I would add some logging to this section of your collector:

...
           # these camera items to perform other actions
           cam_item = parent_item.create_item(
               "maya.session.camera",
               "Camera",
               camera_name
           )
...

Thanks
Phil

2 Likes

I added, debug line at the bottom, it appears nothing has been collected.

          cam_item = parent_item.create_item(
               "maya.session.camera",
               "Camera",
               camera_name
           )

           # set the icon for the item
           cam_item.set_icon_from_path(icon_path)

           # store the camera name so that any attached plugin knows which
           # camera this item represents!
           cam_item.properties["camera_name"] = camera_name
           cam_item.properties["camera_shape"] = camera_shape

           self.logger.debug("Collected camera: " + camera_name)
1 Like

In which case I would probably add a log line a the top of the method just to make sure the method is being called.

Also I would perhaps check that this line is actually finding cameras in the scene, by testing it in a Maya python console.

for camera_shape in cmds.ls(cameras=True):

It appears the function isn’t being called at all. Don’t really know why tho. I have set shot step to
“{self}/collector.py:{config}/tk-multi-publish2/maya/collector.py”.

It sounds like perhaps you missed this bit?

Open your custom collector hook and add the following method call at the bottom of the process_current_session method where you added the call to collect meshes in the surfacing section:

self._collect_cameras(item)

It should be added here:

1 Like

Yes, that fixed it. Thank you very much.

I am now working on the loader :
when I add this line in tk-multi-loader2.yml,

actions_hook: ‘{config}/tk-multi-loader2/tk-maya_actions.py’

the loader… disappeared from the Shotgun Menue in Maya.

1 Like

Can the script be found in config/hooks/tk-multi-loader2/tk-maya_actions.py

I would search for “It will not be loaded” in your tk-maya.log.

You may have a line that looks a bit like:

App configuration Error for tk-multi-loader2 (configured in environment ‘/sg_toolkit/greyhounddev.shotgunstudio.com/configs/my_project/env/asset_step.yml’). It will not be loaded: Invalid configuration setting ‘actions_hook’ for tk-multi-loader2: The specified hook file ‘/sg_toolkit/greyhounddev.shotgunstudio.com/configs/my_project/hooks/tk-multi-loader2/tk-maya_actions.py’ does not exist.

2 Likes