Maya - User prefs and studio prefs

Hi there,

I’m trying to set Ayon up for an environment where people will have their own preferences located on a different drive than the standard MAYA_APP_DIR, plus I want to have specific Environment variables set for production scripts etc…

What’s the best approach for this?

I was thinking of forcing everyone to map their prefs dir to the same letter drive ie - Z:\

then in the applications addon - map the following -
MAYA_APP_DIR= Z:
then point my other environment variables ie- MAYA_SCRIPT_PATH, MAYA_SHELF_PATH, etc…to the studio locations.

Is there a better way to go about this?

Feel free to correct me.

Traditional way

To my understanding, configuring environment variables within AYON settings does not prevent the application from loading user preferences (on Windows, they are typically found in the Documents folder).

AYONish way

As you have mentioned:

  • Use standard paths in AYON settings:
    • e.g. Paths that are found by default on different platforms. e.g. C:\
    • e.g. Ask users to map their prefs to some path. e.g. Z:\ (Creating the letter drive is done outside of AYON)
  • There’s a Maya addon specific feature Multiplatform path mapping that might help. I don’t know much about it. But, it mentions some directory mapping.

Also, reading through your post, I had that feeling that you are looking for user environment variables feature in AYON.
It was mentioned couple of times on Discord.

1 Like

Configuring Maya environment variables in AYON

The way I understand is that all you want to do is specify some extra environment variables for your Maya application.

This can be done in the applications addon settings for Maya application: ayon+settings://applications/applications/maya/environment

.

One variable can ‘refer’ to another to include the path if you want:

{
    "VARIABLE": "HELLO_WORLD",
    "OTHER_VARIABLE": "{VARIABLE}"
}

The full application environments are then build using acre which may help identifying some of the JSON syntax and its possibilities. But this is maybe a better starting point: Ayon Env Vars and Tools Configuration Explained

Does that help?

It didn’t sound like that, per site, you currently need a unique environment variable configuration - correct? (I’m not sure if there are currently means to do that in environment settings in AYON.)


Granularity of environment variables in AYON

So, what does AYON offer to customize the application environments. There’s a few steps:

  1. Global Environment Variables: ayon+settings://core/environments
  2. Per application group environment variables. e.g. maya: ayon+settings://applications/applications/maya/environment
  3. Per application version environment variables, e.g. maya 2025: ayon+settings://applications/applications/maya/variants/0/environment
  4. Tools environment variables.

Tools are special in that you can set tools to apply to only to certain contexts, e.g. only certain assets or shots instead of project-wide. This is a good guide however caveat there is a recent PR which re-designs completely how this works: Chore: Applications settings by iLLiCiTiT · Pull Request #16 · ynput/ayon-applications · GitHub - which may mean that configuring tools for specific contexts may work differently in the most recent versions based on that PR. I believe documentation still needs to be updated, right @mustafa_jafar ?

2 Likes

Yes. I’ll update when the PR is made.

The PR is merged - but I suspect you mean the ayon-applications release is made? :slight_smile:

I mean the docs PR that adds the documentation for the mentioned feature.

1 Like

Thanks Roy, this is really helpful!