Sorry if this sounds as a stupid question but i’m trying to use the ‘saveas_default_name’ setting inside of ‘tk-multi-workfiles2.yml’ so that Maya automatically fills the ‘name’ field with the asset name when trying to save for the first time.
When i add that setting, the Maya reference box shows that the setting is no longer by default and displays the string i used.
But the problem is that the ‘name’ field is always automatically populated with the string ‘scene’.
What am I doing wrong here? What do I need to do to get the asset name by default when trying to save?
I just tested this, and it worked for me. If I set a value for saveas_default_name, that’s what I get in the name field when I do a Shotgun-> File Save in Maya. There are a couple things to point out here:
I suspect that you set this value in the wrong environment – when you’re saving a file, for example, to a task an a pipeline step on an Asset, you’re in the asset_step environment. So, you’ll want to make sure you’re updating the correct settings – those that config/env/asset_step.yml includes.
In the Default Config, this would be the settings.tk-multi-workfiles2.asset_step block of config/env/includes/settings/tk-multi-workfiles2.yml (as seen below), but if your pipeline configuration is set up differently, this may vary.
Having said that, I don’t believe you can set saveas_default_name to a dynamic value – you can only use it with a static string.
What you might want to do is modify your templates in config/core/templates.yml so that instead of{name}, you’re using {Asset}. Note that if you don’t have a {name} field in your template, the text field in the File Save dialog will go away, and the file path will be fully automatically generated, with no input from the user.
I know this is fairly old, but this solution works like a charm, thanks so much @blaigneau!
I had no clue you could trick string config values to be resolved with a core hook. I wonder if anyone has found a way for the hooks to not be core hooks, ie .being able to specify {engine}{config}, etc…
I wonder how this can be used to set name based on the pipeline step.
Because the bundle_obj.context has step/task/entity None when saving a new scene - there is only valid context.project.
The step/task/entity are still None regardless the selection in save dialog.