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

Unable to get all USD stages from mayaUsd.lib.StageCache #3480

Closed
BigRoy opened this issue Nov 24, 2023 · 2 comments
Closed

Unable to get all USD stages from mayaUsd.lib.StageCache #3480

BigRoy opened this issue Nov 24, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@BigRoy
Copy link
Contributor

BigRoy commented Nov 24, 2023

Describe the bug

When running this code:

import mayaUsd
cache = mayaUsd.lib.StageCache.Get(True, True)
stages = cache.GetAllStages()
print(stages)

I get an empty list; no matter whether I have active mayaUsdProxyShape instances in my scene or not.
However, asking around on ASWF slack wg-usd channel others were able make this work.

In their case, maya 2024.0 + maya usd 0.23.0, getting wit the same code e.g. the following result :

[Usd.Stage.Open(rootLayer=Sdf.Find('anon:000001A25196DE40:anonymousLayer1'), sessionLayer=Sdf.Find('anon:000001A25196D1E0:anonymousLayer1-session.usda'), pathResolverContext=Ar.ResolverContext(Ar.DefaultResolverContext())), Usd.Stage.Open(rootLayer=Sdf.Find('d:/588/scene.usda'), sessionLayer=Sdf.Find('anon:000001A25196E680:scene-session.usda'), pathResolverContext=Ar.ResolverContext(Ar.DefaultResolverContext(['D:\\588\\'])))]

Is this a regression?

Steps to reproduce
Steps to reproduce the behavior:

  1. Launch Maya
  2. Create some proxies
  3. Run the example code

Expected behavior

Be able to retrieve any of the current session's Usd.Stage from the cache.
I expect the code snippet to list all used stages by Maya's plugin.

Specs (if applicable):

  • OS & version: Windows 10
  • Maya version: 2024.2
  • Maya USD commit: 0.26.0 (release)

Additional context

I'm not entirely sure whether this cache is intended to be accessible, but since others did get output in an older version I figured it'd be good to report that I was unable to get any results from it.

@BigRoy BigRoy added the bug Something isn't working label Nov 24, 2023
@BigRoy BigRoy changed the title Unable to get all USD stages from cachce Unable to get all USD stages from mayaUsd.lib.StageCache Nov 24, 2023
@pierrebai-adsk
Copy link
Collaborator

I think it comes down to a change in our internal implementation. You now have to passs False, True to get the cache:

import mayaUsd
cache = mayaUsd.lib.StageCache.Get(False, True)
stages = cache.GetAllStages()
print(stages)

@github-project-automation github-project-automation bot moved this to Needs triage in maya-usd Dec 15, 2023
@BigRoy
Copy link
Contributor Author

BigRoy commented Feb 15, 2024

I think it comes down to a change in our internal implementation. You now have to passs False, True to get the cache:

import mayaUsd
cache = mayaUsd.lib.StageCache.Get(False, True)
stages = cache.GetAllStages()
print(stages)

This does indeed work.

@BigRoy BigRoy closed this as completed Feb 15, 2024
@github-project-automation github-project-automation bot moved this from Needs triage to Done in maya-usd Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

3 participants