Set AyonUsdResolver as the preferred resolver for Maya - #132
Set AyonUsdResolver as the preferred resolver for Maya#132tadeas-hejnic wants to merge 10 commits into
Conversation
Co-authored-by: Roy Nieterau <roy_nieterau@hotmail.com>
Co-authored-by: Roy Nieterau <roy_nieterau@hotmail.com>
BigRoy
left a comment
There was a problem hiding this comment.
Some small remarks. After that, can you update the testing notes to include some small Python snippet for Maya so we know what to test for.
Then let's see if @MustafaJafar can review.
There was a problem hiding this comment.
Pull request overview
This PR aims to ensure Maya prefers the AyonUsdResolver (instead of falling back to Autodesk’s default resolver) by injecting an AYON USD Maya startup script via a pre-launch hook, and setting Ar.SetPreferredResolver("AyonUsdResolver") during Maya startup.
Changes:
- Add a Maya
userSetup.pystartup script that setsAyonUsdResolveras the preferred USD resolver. - Add a Maya-specific pre-launch hook to add the startup directory to
PYTHONPATH. - Add explicit hook ordering and a shared
ayon_usd_resolver_initializedflag to coordinate hook execution.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| client/ayon_usd/startup/maya/userSetup.py | Adds a Maya startup entry point that sets the preferred USD resolver. |
| client/ayon_usd/hooks/pre_resolver_init.py | Adds hook order and a shared data flag to indicate resolver init success. |
| client/ayon_usd/hooks/pre_maya_launch.py | Adds a Maya pre-launch hook that injects the startup script location into PYTHONPATH. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
BigRoy
left a comment
There was a problem hiding this comment.
LGTM. @MustafaJafar can you review? @antirotor if you have time, can you give your thoughts on approach?
Changelog Description
This PR adds a prelaunch hook that is responsible for setting the
AyonUsdResolveras the preferred one. This functionality can be enabled/disabled in settings.The reason of this is to avoid issues with loading only the default Autodesk resolver, which is technically disabling the AYON one.
Testing notes:
usdaddon, test if the resolver was loaded and run this code from the issue: