As see in image, shotgrid app prevents me from adding underscore to file name.
I did search and find threads on shotgrid forum on this topic. It is not clear what specifically to do.to allow underscore in file names ( generally extending it for any dcc )
Can I add any random text to filename seperated by underscore. If this requires modification to
tk-core ( as seen in some thread ), then I am afraid I do not see tk-core app in the config installation folder.
I did try to dissuade the team from not using underscore as it may break the pipeline somewhere. However I cannot push it on them so on a flip side after implementing if it breaks
that will be most established way for us avoid using an underscore in file names
Underscores are used by SG to infer different fields from a filename.The ânameâ field here, isnât the full filename, but the ânameâ field of the filename defined in the templates.yml of your pipeline configuration.
Can you explain more about the reason you need underscores in the name? What information are you trying to include in the name that needs separated with underscores?
Ok, are you using a custom pipeline config?
If you take a look at templates.yml you can find the templates, in your case look for the maya ones, where the filenames are defined.
You can see that the filenames are built from individual fields.
eg your examples would need templates configured as follows. You may need to customise the app or hooks logic to support some of these fields.
project_seq001_sh0010_dept_version.ma. @shot_root/work/maya/{name}.v{version}.{maya_extension} would need updated to something like :- @shot_root/work/maya/{project}_{sequence}_{shot}_{department}_{version}.ma
project_prop_walkingChair_model_v001 @asset_root/work/maya/{name}.v{version}.{maya_extension} would need updated to something like :- @asset_root/work/maya/{project}_{asset_type}_{asset}_{name}_v{version}
Itâs worth noting that including all the fields you want here may result in you exceeding the max character limit in winows filesystems, so normally workfiles do not include the project-code. The Shot code should include the sequence code, so you wouldnât want to explicitly include both the sequence and shot code. Another reason for including the sequence code in the shot code is so the drop-downs in the web ui give you the full context of the shots listed; eg if you have 3 sequences each with shots 010, 020, 030. If you type 010, 3 010âs would appear and you wouldnât know which sequences shot you want.
I would recommend starting by learning how this system works before making large changes to your templates. They are hard to debug for beginners if you break the config.
If anything breaks, I know you will help to bring the system back to running . As for the requirement, I need to go with what the management requires. I have highlighted to them the restrains but they need it this way. I will go ahead step by step.
@Patrick , Thank you for your replies. While I have a need to add underscore to filename, I need to also remove {name} from the definition. How to remove {name} without getting error
âmissing keys required for the publish template: [ânameâ]â
Youâll need to add some debug logging here to see what fields you have at this point. Also which template is being queried. Can you confirm the name of the work and publish templates being queried at this point in the code?
Also, verify the publish template you have defined in your tk-multi-publish2 settings is maya_asset_publish.
SG is expecting to find a ânameâ field as itâs specified in a template being used for the publish. The odd thing is your maya_asset_publish template doesnât have a name field, so Iâm wondering if youâre not in an Asset task or the publisher has a different publish template defined?
Whatâs the filepath of the maya file youâre attempting to publish from?
@Patrick , I had close and open shotgun desktop to the changes to be reflected. Solved.
Thank you for your efforts. Last question in this thread is how to add project to filename ?
Just add the project field to the template. It should pass through from the work template. If not, then youâll need to customise the publish hook to get the project tankname from your context.
Thank you for your quick response.
Including {project} in template is giving an error so I presume it is not passing through work template. How to customise the publish hook to get the project tankname from the context.
Where does this publish hook reside ?.
Do you mean tk-multi-publish2 app. Where specifically ?