Filter Prims by Attribute After Unpacking in SOPS

   560   1   1
User Avatar
Member
15 posts
Joined: Sept. 2023
Offline
I want to be able to group/filter unpacked USD geometry based on prim attributes.

Here's the example:
I have 3 groups in a LOP network: cubes, terrain, and spheres. The mesh prim of each object has an "identity" attribute which helps identify them, and an additional USD Asset Identifier.

When I unpack the LOP network into SOP using Unpack USD node, I kind of lose these attributes. Unpack USD gives me 2 options:
Option 1: Output as Polygons
In the Import Attributes field, I can put "identity". And the "terrain", "cube", "sphere" attributes transfer to each prim.

Option 2: Output as Packed Prims
Each prim is nice represented as PackedUSD prims. However, Import Data is grayed out and I lose the "identity" attribute.

I've attached an example file. Without modifying what's inside lopnet1 ideally, is there a way to filter prims by USD attribute using Option 2? I'd appreciate any advice/discussions!
Edited by nd_sliu - Nov. 2, 2023 19:08:00

Attachments:
network.png (38.3 KB)
lopnet.png (158.7 KB)
demo.hip (247.4 KB)

User Avatar
Member
15 posts
Joined: Sept. 2023
Offline
I found a way to do this via Attribute Wrangle SOP. Since we get the prim path on each primitive, I queried the "identity" attribute at each prim's path. It would still be nice to build the feature into the USD Unpack node, but this way is simple enough.

I attached the solution
Edited by nd_sliu - Nov. 3, 2023 00:07:02

Attachments:
solution.png (53.8 KB)
demo-solved.hip (267.1 KB)

  • Quick Links