PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
6.14k stars 1.22k forks source link

Instanceable prim and visibility #2998

Open jaiipaul opened 8 months ago

jaiipaul commented 8 months ago

Description of Issue

Hello !

I am currently working on usd instances and I am facing an issue when changing the visibility of instanceable prims that contain PointInstancers in their sub hierarchy specifically. Let's say I have an asset with its geometry containing meshes and a PointInstancer (like a tree, with instantiated leaves). Now, I want to build an assembly with it. I create a new stage with some Xform prims referencing the tree, instanceable set to true and with transforms applied. I can save this stage into its own usd file, open it in usdView or other DCCs and hide any instance without any problem.

The actual issue appears when the assembly is referenced elsewhere, in a shot breakdown for example. At this point, when I open the shot breakdown stage, I am still able to hide the instances in the assembly but there will always be one (usually the first instance) that will hide the PointInstancer for every other instances. The condition for all the PointInstancers to reappear can vary depending on the software used to open the stage:

In the last scenario, the issue seems to be fixed until the stage is reloaded.

I know the stage uses the one of the instanceable prim of a same group as the source to create a prototype which will be shared by all the instanceable prims with the same arcs. Could edits on this selected instance change the prototype and therefore other instances ?

I also noticed that setting instanceable to false and back to true on all instances right after i opened the breakdown fixes the issue. If I am right, those edits are added to the session layer which is created when the stage is opened.

Steps to Reproduce

I made a simple package for anyone who would like to reproduce the issue. You will find the asset.usda file which describe an asset with a cube (in blue) and smaller cubes instantiated using a PointInstancer (in green). The instances.usda builds the assembly, creating three instances of the asset. Finally, breakdown.usda references instances.usda as it would be done to bring the assembly in higher levels of hierarchy like in a shot. instance_visibility_example.zip

In usdview:

System Information (OS, Hardware)

Linux Rocky 8.7

Package Versions

Issue seen with usd 22.11 and 23.11

jesschimein commented 8 months ago

Filed as internal issue #USD-9415