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.
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.
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:
Global Environment Variables: ayon+settings://core/environments
Per application group environment variables. e.g. maya: ayon+settings://applications/applications/maya/environment
Per application version environment variables, e.g. maya 2025: ayon+settings://applications/applications/maya/variants/0/environment
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 ?
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
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.
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.