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

Add empty sublayer will invalidate the 3 attribute queries in UsdSkelAnimQuery #1500

Closed
frankzhang11 opened this issue Apr 20, 2021 · 2 comments

Comments

@frankzhang11
Copy link

Description of Issue

Add empty sublayer will invalidate the 3 attribute queries in UsdSkelAnimQuery. LayerStack in resolveinfo is not updated.

Steps to Reproduce

sublayer_resync.zip
1 decompress this zip file. The folder "UsdSkelExamples" is almost empty (it is too big and unneccesary to upload), put pixar UsdSkelExample here.
2. use usdview to run with the Scene.usda, which is an empty scene as rootlayer.
3. run the first part of Script_PixarUsdSkelExample.py in interpreter to load the "HumanFemale.walk.usd" as sublayer.
You'll see the animation plays well.
4 run the second part of Script_PixarUsdSkelExample.py in interpreter to load the "Empty.usda" as sublayer.
The animation will be broken.

System Information (OS, Hardware)

Win10 (doesn't matter)

Package Versions

21.05 and before.

Build Flags

We actually have some debug on the reason. It is because this line.
https://github.com/PixarAnimationStudios/USD/blob/2b38362e4a0d93d4741ca4dd89cbdb9e59f2abcd/pxr/usd/pcp/changes.cpp#L1794
If the sublayer is empty, this line will stop the scene from doing a full resync. which makes the 3 attributeQuery in UsdSkelAnimQuery(implementation) invalid.
https://github.com/PixarAnimationStudios/USD/blob/dev/pxr/usd/usdSkel/animQueryImpl.cpp#L99

The easy fix is to remove the !sublayer->IsEmpty() check, and full scene can be retriggered (this behavior is the same as you add a scene with any prim(s) as sublayer). And skelAnimationQuery will be normal.

I understand that add a layer literally should resync the full scene since any data might change, but add a sublayer means that only attribute layerstack might change, it will be expensive to resync the whole scene, only the layerstack update is required. I wonder if Pixar already have any ideas for sparsely invalidating/updating the attributeQuery in usdimaging, especailly for UsdSkelImaging? Thanks.

@jtran56
Copy link

jtran56 commented Apr 20, 2021

Filed as internal issue #USD-6664

@spiffmon
Copy link
Member

Thanks, @onamiforest , we're having a look. The line you identified in Pcp was an explicit optimization added in response to performance concerns in Solaris; however, we hadn't realized it would invalidate UsdAttributeQuery objects.

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

4 participants