Tk-multi-workfiles - 'saveas_default_name' setting

Hi there,

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?

Thanks a lot in advance!
Francois

2 Likes

Hey @Debatty_Francois! A quick heads up I’ve moved this to the #pipeline category to get the right :eyes: on it.

2 Likes

Hi François –

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.

Some relevant docs:

5 Likes

Hi Tannaz,

Thank you so much for the quick answer!

You’re right, I was setting the value in the wrong environment.
And modifying config/core/templates.yml gives me exactly what i was looking for!

Thank you again for your help and for the useful links.

Francois

3 Likes

I just thought I’d share this link, as Barbara provided a suggestion that allowed her to dynamically set the default save name:
https://groups.google.com/a/shotgunsoftware.com/forum/#!searchin/shotgun-dev/workfiles$20name|sort:date/shotgun-dev/RcbThuYFQuk/OmqQVZNJBAAJ

4 Likes

Hi Philip,

This solution looks pretty neat! I’ll give it a try :wink:

Thanks,
Francois

2 Likes

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…

3 Likes

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.