I have customized the SG Publish window in Maya to have two buttons for render range in and render range out. I updated the item class in tk-multi-publish2 and I am able to print the values of item.render_range_in and item.render_range_out correctly.
The question is: when publishing from Maya, how do I get these values updated in the custom fields “Render Range In” and “Render Range Out” in SG Published Files page (please see attached image)?
Hey @aitrdae—welcome to the community! Your question is better suited for the #pipeline category, so I’ve moved it over there so it gets the right eyes.
When you say you customized the Item class, did you actually modify the app, or did you just take over the collector hook and then add the property?
If you’re using the default publish plugin, then all you need to do is set the publish_fields property on the item I think, since this is pulled into the register_publish call.
This is where the default plugin would extract the value
ShotgunPublishError: Unable to complete publishing because of the following error: API create() PublishedFile.render_range_out doesn’t exist:
{“field_name”=>“render_range_out”, “value”=>“200”}.
You can modify the publish plugin UI, here is an example, but for anything else you would need to take over the app. However I would still make use of the item properties to store your settings as this will mean you then don’t need to modify the publish plugin at all, as it already looks for the publish_fields property.
From the error you are getting is looks like you are providing incorrect field names. They look like custom fields, so I would expect them to start with sg_ at least. I would check that you are providing the correct PublishedFile field names.
I am happy that the tool is working but I am still not sure how the variable "“sg_render_range_in” was mapped to custom field “Render Range In”. Obviously the “sg_” and all special characters are removed and it is not case sensitive.
Is there is a naming convention for custom fields for this mapping to work??
Hi @aitrdae – there’s not a procedural mapping between display names and API names for fields in Shotgun. If, on an Info page, you open “Configure important info”, you can see the API name by hovering your mouse over a field name in the list: