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!

I’m new(ish) to environment variables, but is there a way to make a key / variable for the project? I’m trying to define a Project level environment variable for custom shaders that would be saved within the projects folder structure. I’ve been able to hardcode it with

{
 "ARNOLD_PLUGIN_PATH": "Z:/randomProject003/pipeline/shaders"
}

And that works totally fine, but would like to be a variable for the project path like

{
"ROOT": "Z:/",
"PROJECT": "something here",
 "ARNOLD_PLUGIN_PATH": "{ROOT}/{PROJECT}/pipeline/shaders"
}

Any suggestions?

hmm…not sure if this is the proper way of going about it, and maybe not exactly what you’re looking for…

My hack would be to add a new variant of Maya and call it something specific to your project like Maya-2025-MyProject01

then add any specific project environment variables there.

After that, only add that variant of Maya to the project’s launcher.

Hey,
This is possible via adding your environment variable to core settings.

  • In studio settings: make it available for all projects
  • In project settings: make it available for the selected project

you may check

Per project overrides?

Custom tool configuration

I think I’d more likely recommend just adding a custom tool for this. That way, any project that wants the shelf can just add that tool to the project and it can be maintained separately from the maya versions.

So, you’re basically defining your own tool/plugin of sorts.

See Tool Definitions in the documentation.

Per project, for all projects?

If you just want a project-specific shelf or whatever then most likely I’d find a to reference the project path from the environment variables, e.g. {project_root}/resources/maya/shelves and if {project_root} is then always set to the active project that’d automatically resolve per project.

However, I don’t believe currently project or task related env vars like that are exposed to the launching process so may need a new feature.