-
Notifications
You must be signed in to change notification settings - Fork 202
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
[MAYA-127817] mayaUsdProxyShape fails to load the stage when reopening the previous saved maya file with stage loaded by mayaUsdProxyShape via stageID. #2872
Comments
@NickWu thanks for reporting this. I am also able to reproduce this on our side. I logged it internally as MAYA-127817 as we investigate more and figure out the next steps on this issue. |
@NickWu we are trying to understand the usage on this workflow a bit better. using the stageCache to load a stage is not quite recommended, since nothing gets written to disk - would you be able to give us a bit more info on the usage for you guys? we have an internal issue to track any work needed for this, but it is not a high priority issue for the time being. Cheers! |
Hey @santosg87 , thank you for taking a look. At Animal Logic, before creating a proxy shape, our pipeline would load a stage with Load Rule set to SC = UsdUtils.StageCache.Get()
with Usd.StageCacheContext(SC):
cachedStage = Usd.Stage.Open(usdfilePath, load=Usd.Stage.LoadNone) This way, our tool can show loaded prims in a GUI and artists can select which prims they want to load into the proxy shape before loading any heavy payloads as sometimes artists don't want to see everything in a stage. Once artists have decided, our pipeline tool would build the stage (load the payloads, only the ones artists want to work with, by calling Hope that makes sense. |
@NickWu Is there any reason why you could not provide the stage via the proxy shape Also, the MayaUSD proxy shape has a |
Hi @pierrebai-adsk , at first, I thought I could use the following approach to use SC = UsdUtils.StageCache.Get()
with Usd.StageCacheContext(SC):
shapeNode = cmds.createNode('mayaUsdProxyShape')
cmds.setAttr('{}.filePath'.format(shapeNode), cachedStage.GetRootLayer().identifier, type='string')
print(SC.GetAllStages()) # we would have two stages But it didn't work as the proxy shape still opened another new stage judging from the SC.GetAllStages() call. Also, I tried the second approach: SC = UsdUtils.StageCache.Get()
with Usd.StageCacheContext(SC):
shapeNode = cmds.createNode('mayaUsdProxyShape')
cmds.setAttr('{}.stageCacheId'.format(shapeNode), stageId)
cmds.setAttr('{}.filePath'.format(shapeNode), cachedStage.GetRootLayer().identifier, type='string')
print(SC.GetAllStages()) # we would have two stages We still got two stages, which is not ideal, but we are now using the stage we previously opened in the cache. |
Hi @pierrebai-adsk , I notice this PR #3010 has been merged which address the issue related to the conversation here. Therefor, I'll close this issue now. Thank you for looking into it. |
Describe the bug
Hi, I found mayaUsdProxyShape fails to load the stage when opening the previous saved maya file with stage loaded by mayaUsdProxyShape via stageID.
Steps to reproduce
Steps to reproduce the behavior:
code:
I think the root cause for this maybe because when mayaUsdProxyShape opens a stage via stageID, so the maya file is saved with mayaUsdProxyShape only has stageID. When reopening the saved maya file, the stageID that mayaUsdProxyShape has would become invalid.
I found AL_usdmaya_ProxyShape doesn't have this issue because it sets the filePath attribute when the stage is opened via stageID:
maya-usd/plugin/al/lib/AL_USDMaya/AL/usdmaya/nodes/ProxyShape.cpp
Line 1245 in d462ff2
When reopening the saved maya file, AL_usdmaya_ProxyShape would then be able to load the stage via filePath attribute.
Expected behavior
mayaUsdProxyShape should be able to load the stage when reopening from the saved maya file again even the stage was loaded via stageID.
Attachments
sphere.usda file:
Specs (if applicable):
The text was updated successfully, but these errors were encountered: