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

mayaUsd.ufe.getAllStages cannot see stage after mayaUsdProxyShape was renamed (on the first execution) #3860

Closed
p0las opened this issue Jul 22, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@p0las
Copy link

p0las commented Jul 22, 2024

Describe the bug
when mayaUsdProxyShape is renamed then mayaUsd.ufe.getAllStages is not returning the stage from it in on the first run. It has to be executed twice to work.

Steps to reproduce
Steps to reproduce the behavior:

from maya import cmds
import mayaUsd

n = cmds.createNode('mayaUsdProxyShape')
cmds.connectAttr('time1.outTime', n + '.time')

maya_stage = cmds.listRelatives(n, pa=True, parent=True, ni=True)

stages_before = mayaUsd.ufe.getAllStages()

renamed_stage = cmds.rename(maya_stage, 'fooBar')

# mayaUsd.ufe.getAllStages() #without this line the assertion is going to fail

assert mayaUsd.ufe.getAllStages() == stages_before

Expected behavior
mayaUsdProxyShape should return the same stages everytime

Specs (if applicable):

  • Windows 10
  • Maya 2024
  • maya USD plugin 0.28.0
@p0las p0las added the bug Something isn't working label Jul 22, 2024
@santosd santosd assigned santosd and unassigned santosg87 Jul 22, 2024
@santosd
Copy link
Collaborator

santosd commented Jul 22, 2024

Hello @p0las, I gave this a try on my end in Maya 2024.2 using 0.28.0 and I was not able to reproduce the error you are seeing. When I run your code the Assertion doesn't fail, it always passes regardless of whether I have line 13 commented out or not. The output of my get all stages is always the same:

print(stages_before)
[Usd.Stage.Open(rootLayer=Sdf.Find('anon:00000267FF108010:anonymousLayer1'), sessionLayer=Sdf.Find('anon:00000267FF10A530:anonymousLayer1-session.usda'))]
print(mayaUsd.ufe.getAllStages())
[Usd.Stage.Open(rootLayer=Sdf.Find('anon:00000267FF108010:anonymousLayer1'), sessionLayer=Sdf.Find('anon:00000267FF10A530:anonymousLayer1-session.usda'))]

I am curious if you print on your end how does your .getAllStages() look before and after?

@p0las
Copy link
Author

p0las commented Jul 22, 2024

you are right. I executed it on another machine running the same versions and it works fine. I have two machines that are meant to run the same pipeline yet the results are different. I will investigate this further. Thank you for taking the time to test it.

@p0las p0las closed this as completed Jul 22, 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
None yet
Development

No branches or pull requests

3 participants