SG Asset name vs Maya Asset file name discrepancy

Sorry for the newb questions, but I’m just getting my feet wet in SG TK.

I don’t understand why a Maya asset file name cannot contain any underscores or dashes. I have a SG Asset named HOU_PRI and I want to save a Maya file named HOU_PRI.*.mb but TK says it contains illegal characters. It allows me to name it HouPri but that’s not my first choice and it’s different than the Asset name. What’s the best practice for this scenario?

Also, is it not possible or desirable for SG TK to impose file names based on the context? For my example above I’d like to name it HOU_PRI..mb based on the context, and not have an artist just arbitrarily name it something like houstonAstrosPrimaryLogo..mb


1 Like

Hello @bkirchdoerfer

You need to check what is inside your pipeline tk-config template.yml file. This files is the one that handles how your files get named when publishing.

If you are using the toolkit by default this is the template that is used so your Maya files will get named like followed in your work area on asset context:
definition: ‘@asset_root/work/maya/{name}.v{version}.{maya_extension}’

Hopes this helps.

Thank you, @Jerome_Drese, that worked. We found the “filter_by” variables in the doc below and added the desired variables to our project’s templates.yml file as you suggested. Now we simply need to make a project-create template derived from this altered one.

Regarding my other question… I suppose SG will not impose/force app file names? (as does another pipeline management software we tested) i.e. if an artist is working in HOU_PRI asset, force them to name it HOU_PRI, not ATL_PRI by mistake.

Hi @bkirchdoerfer

For your second questions I can only say that it depends what tools you are using inside Maya or Houdini (or other DDC app) to save your working files or publish your files. If you are fully committing to Sg Tk and the using the file save and the publisher provided by the toolkit then the answer is YES, Shotgun will force the names of your files by using what is specified in the template.yml file.

Lets take the default config example and mimic an example for saving an asset Maya file.

The following is what is define on the template.yml

asset_root: assets/{sg_asset_type}/{Asset}/{Step}
definition: ‘@asset_root/work/maya/{name}.v{version}.{maya_extension}’

So if you are working on a "character "asset called “DummyBear” for the task “modeling” inside Maya then your work file saved by using Maya’s save file…

Your file name will be: /srvpath/projectname/assets/characters/DummyBear/modeling/work/maya/

I hope this is clear enough and that I am not saying anything stupid @philip.scadding, @tannaz will proably correct me if I am wrong.

I would say that if you are setting up a project with the ToolKit to take your time explore the tk-config2 files in depth. Check the Schema folders and modify their order/structure as you like but keep in mind that all the config starts there so if you move one single thing you need to cascade those changes to your template.yml file then check the settings folders and update everything that would be impacted by it.


1 Like

I’d recommend reading this for the underscore:

As for your second question, @Jerome_Drese is mostly correct!
The templates are what Toolkit uses to figure out the path and name of a file.
These templates are referenced by the apps in the environment files.
For example, the tk-multi-workfiles2 app is the app that provides the save dialog and the template it uses to save a file when working on assets is defined here.

So as you can see we can use a different template for the save app depending on the engine and environment (Which you can think of as context), as there can be separate setting blocks defined for these. I’d recommend reading this guide for more info on how this works.

Beyond that, the {name} key in the template is looked out for by the workfiles app, and if it is present in the template, it will provide an input box in the save dialog for the user to enter a name.

If the {name} key is not present in the template, then it won’t show a name field in the dialog. If for example, you wanted the file to be always named after the asset, and not allow your user’s to input a name, then you could do:


Or if you wanted the Asset name and the user input: