Closed frankzhang11 closed 3 years ago
Filed as internal issue #USD-6664
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.
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.
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.