Tk-maya read another config rather than uploaded config?

Hi, there:
Today I found another problem when I use my Maya. Although it still has some problems with my previs post topic here. but I met another one.
I used distributed config and uploaded my config content to shotgun website with workfile2 setting “allow_task_creation” set to false, but after I reloaded in Maya, and in the shotgun menu, file open, and then selected “New File” button, first time it was OK, but with twice operation(shotgun menu --> file open --> new file again),the workfile2 setting “allow_task_creation” jumped to true…
I don’t know where the config is in my cache folder on Mac(/library/caches/shotgun/app_store??), and I don’t know why desktop can’t read the config file(with workfile2 setting “allow_taks_creation: false”) that I already uploaded to shotgun website.
If you can help, thanks a lot.

3 Likes

Hi @johnnyzxt!

Checking the Cache

So first off this link can help you find your cache folder on mac.

What happens when using an uploaded config, is that you will have a cached pipeline_configuration.yml file stored in:

/Users/{UserName}/Library/Caches/Shotgun/{YourSiteName}/p{Project 
 ID}c{PipelineConfiguration ID}.basic.maya/cfg/config/core/install_location.yml

In that file it should have a line that looks a bit like this:

source_descriptor: {entity_type: PipelineConfiguration, field: uploaded_config, id: 859,
  type: shotgun, version: 5192}

This should confirm which version of the config your project is using from the bundle cache.
You can then check in:

/Users/{UserName}/Library/Caches/Shotgun/bundle_cache/sg/{YourSiteName}/v5192

To see that actual config it will use.

Checking cache location from Maya

Also in Maya when launched with Shotgun you could run the following in the Maya Python script editor:

import sgtk
engine = sgtk.platform.current_engine()

# Get the project cached config location.
engine.get_project_cache_location(engine.context.project["id"])
# Result: /Users/{username}/Library/Caches/Shotgun/{sg site name}/p89c859.basic.desktop/tk-maya


# Get the config location in the bundle cache.
engine.sgtk.configuration_descriptor.get_path()
# Result: /Users/{username}/Library/Caches/Shotgun/bundle_cache/sg/{sg site name}/v5192

Why it may not be working

By default, the tk-config-default2 will be cached when you select the project in SG Desktop. When you launch the software from Desktop it will not recache the config, and Maya for example will use the Desktop cache, so you will see that the cached folder is likely pointing to something like p89c859.basic.desktop rather than p89c859.basic.maya. In order for your changes to be pulled, you will need to jump out of the project in SG Desktop and back in again, and relaunch Maya.

If you’re making dev changes I would recommend using the dev descriptor to make rapid changes and then switch to uploaded config once you’re ready to deploy to production.

2 Likes

Great appreciate, @philip.scadding ,you help me a lot, not in this post only, I’ve read a lot of tutorials from you, greate thanks

3 Likes