Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling the Ar.DefaultResolver.SetDefaultSearchPath() function again does not work after using Ar.GetResolver() #2925

Closed
bazhutkin opened this issue Jan 29, 2024 · 2 comments

Comments

@bazhutkin
Copy link

bazhutkin commented Jan 29, 2024

Description of Issue

There is no way to update default resolver search paths without restarting Maya.

Steps to Reproduce

from pxr import Ar
Ar.DefaultResolver.SetDefaultSearchPath(['//server/projects/test_1'])
print(Ar.GetResolver().Resolve('assets/props/asset/asset.usd').GetPathString())

\\server\projects\test_1\assets\props\asset\asset.usd

Ar.DefaultResolver.SetDefaultSearchPath(['//server/projects/test_2'])
Ar.GetResolver().Resolve('assets/props/asset/asset.usd').GetPathString()

\\server\projects\test_1\assets\props\asset\asset.usd

If this is not a bug, then tell me how I can update the resolver search paths without rebooting Maya?

System Information (OS, Hardware)

Windows 11, macOS 14

Package Versions

MayaUSD 0.26.0 (OpenUSD 22.11) for Maya 2024

@jesschimein
Copy link
Contributor

Filed as internal issue #USD-9214

@spiffmon
Copy link
Member

Hi @bazhutkin ! The way we intend for this to happen is that you don't change the paths configured on the Resolver itself (which is a global thing used by all open Stages (and other entities)), but rather to "refresh" the ArResolverContext with which the stage was opened (the context gets "attached" to the Stage. This would require some retooling on Maya's part to facilitate the workflow, but it should also be empowering, especially for "multi shot" workflows and other cases.

Unfortunately, we discovered that we have not yet implemented a RefreshContext() method for ArDefaultResolver(), which will be needed for this pattern to work. We will prioritize getting that done for the 24.05 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants