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

refactoring_sandbox : Proxy shape local Prim changes remain even after delete/recreate or new scene #83

Closed
BigRoy opened this issue Oct 25, 2019 · 5 comments
Labels
bug Something isn't working proxy Related to base proxy shape reproduced Issue has been reproduced workflows Related to in-context workflows

Comments

@BigRoy
Copy link
Contributor

BigRoy commented Oct 25, 2019

Issue

If you create a USD Proxy shape and move Prims around using UFE these changes will persist as if stored globally. Deleting the proxy and loading the same USD scene will directly show the same changes. Even New Scene will have the local USD changes you did persist. Even if you unload the plug-in and reload the plug-in the change persists.

Only restarting Maya seems to resolve it.

Note that I'm create the proxy shapes with:

from maya import cmds

path = "path/to/Kitchen_set.usd"
node = cmds.createNode("mayaUsdProxyShape")
cmds.setAttr(node + ".filePath", path, type="string")

To reproduce

  1. Create a proxy shape and load USD file.
  2. Move Prims around in the USD Proxy.
  3. Delete the Proxy (or New Scene)
  4. Recreate the proxy shape and load the USD file.

Note how the changes done in Step 2 also still exist in the new shape with Step 4.

Specs

  • Windows 10
  • Maya 2019.2
  • refactoring_sandbox ( d0bb624 )
  • Pixar USD dev ( b85ddac2 )

Mentioned in #51

@BigRoy
Copy link
Contributor Author

BigRoy commented Nov 18, 2019

I can confirm this issue also happens in the latest state of the dev branch however the issue does not happen when using the AL_USDMayaPlugin through the USD > Proxy > Import menu. I believe this is due to the Stage cache Id being applied as -1, likely meaning it's forced to a new unique identifier.

However I can't seem to find that similar functionality for the mayaUsdProxyShape or how to exactly reproduce the behavior through code to create the nodes.

@BigRoy
Copy link
Contributor Author

BigRoy commented Nov 25, 2019

Just checking back in. Is there currently any way to force/set the Stage cache Id for the mayaUsdProxyShape, e.g. passing it -1 as described above to avoid this "shared state" even across scenes or throughout the whole maya session.

Also, with it currently being able to break like this, could this behavior turn out dangerous? For example, if you have a scene that has stage id 1 and 2. Then you open another file that was saved with two USD proxies with stage ids 2 and 3. What happens with the changes of stage id 2? Does it preserve them and try to apply them in the other scene?

@kxl-adsk
Copy link

kxl-adsk commented Dec 3, 2019

Indeed we have two different stage caches at this point. AL plugin is wrapping around UsdUtilsStageCache (https://github.com/PixarAnimationStudios/USD/blob/master/pxr/usd/lib/usdUtils/stageCache.h) and the base proxy has its own stage cache. Something to unify.

I do not have an answer to your question, maybe @mattyjams can chime in?

@mattyjams
Copy link
Contributor

At the USD level, if you have layers being held open by stage caches across Maya scene changes (File->Open, File->New, etc.), then that would probably explain it. You could check this in Maya by making some edits, then doing a File->New and checking whether there are still layers loaded in the layer registry:

Sdf.Layer.GetLoadedLayers()

If that returns any layers after switching to a new scene, then there is probably a stage cache not getting reset and holding those layers open. Re-opening one of those layers is going to return you the version in the stage cache.

We should hopefully be accounting for this in the pxr nodes and the mayaUsdProxyShape with a listener:

void OnSceneReset(const UsdMayaSceneResetNotice& notice)

pmolodo pushed a commit to LumaPictures/maya-usd that referenced this issue Jan 22, 2020
…Autodesk#83)

* MAYA-99646 Fix selection highlight issues

* Selection highlight for proxy selection from Outliner.
* Selection highlight for Xform prims from Outliner.
* Selection highlight for USD instancing objects.

* MAYA-99646 capitalize function name

* MAYA-99646 Differentiate the processing for "wasProxySelected" and "isProxySelected" case.
@cfmoore007 cfmoore007 added the bug Something isn't working label Feb 26, 2020
@kxl-adsk kxl-adsk added proxy Related to base proxy shape workflows Related to in-context workflows labels Mar 2, 2020
@santosg87 santosg87 added the reproduced Issue has been reproduced label Mar 23, 2020
@kxl-adsk
Copy link

kxl-adsk commented Nov 6, 2020

The issue has been fixed for a while - closing this ticket. @BigRoy please reopen if we missed something.

@kxl-adsk kxl-adsk closed this as completed Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working proxy Related to base proxy shape reproduced Issue has been reproduced workflows Related to in-context workflows
Projects
None yet
Development

No branches or pull requests

5 participants