USD variants from alembic 'name' or 'path' attributes

   3303   6   5
User Avatar
Member
52 posts
Joined:
Offline
Hi all,

been looking at creating usd variants from the following, thinking on using this to create a model with variants from a kitbash type asset:

1- sopimport an object into LOPS with ‘path’ or ‘name’ prim attributes.
2- create an add variant to existing primitive block
3- done

Any ideas on how to iterate through each of the ‘path’ or ‘name’ primitive attributes to create this variants? In a way using attributes to define geometry pieces without having to create a hundred prune nodes..

Thanks in advance!
User Avatar
Member
12427 posts
Joined: 7月 2005
Offline
It might help to post a hip file of the kind of setup you're after. It may be that a ForEach LOP can be configured to do it – perhaps look at the Create LOD LOP internals.
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
User Avatar
Member
52 posts
Joined:
Offline
Ah of course!

Adding a hip example. Im very much a newbie on all this, and Im having issues with how to reference some of this data back and forth.
the example includes a simple sphere object with 2 prim groups colored for convenience and a LOPS network where Im pulling this and trying to figure out a way to loop through each group and turn it into a variant.

Attachments:
usdvariants_from_groups.hipnc (142.6 KB)

User Avatar
Member
52 posts
Joined:
Offline
jason_iversen
It might help to post a hip file of the kind of setup you're after. It may be that a ForEach LOP can be configured to do it – perhaps look at the Create LOD LOP internals.

adding file just in case someone has a moment to have a look. Thanks in advance!
User Avatar
Member
5 posts
Joined: 9月 2015
Offline
Don't think it's correct but the best I could find was to put it in a add variant block in a for each loop with everything but the thing you want to be a new variant deleted (pack, delete everything else with a removepoint in a wrangle, unpack) using the contextoption("ITERATIONVALUE") to select the correct one.
Load as reference seemed to be required for me to get it to work, don't know USD enough to know why unfortunately. It's nearly procedural with the main value that has to be hand done is the total iteration number.
It's really a mess though, hopefully we get a node that takes packed prims and turns them to variants or from a sop attribute. Would be glad to see a better way than what I've kludged too.







if (@ptnum!=`contextoption("ITERATIONVALUE")`){
    removepoint(0,@ptnum);
}

Attachments:
Temp1.png (55.2 KB)
Temp2.png (37.0 KB)
Temp3.png (30.6 KB)
Temp4.png (29.6 KB)

User Avatar
Member
2 posts
Joined: 5月 2023
Offline
user1111
Don't think it's correct but the best I could find was to put it in a add variant block in a for each loop with everything but the thing you want to be a new variant deleted (pack, delete everything else with a removepoint in a wrangle, unpack) using the contextoption("ITERATIONVALUE") to select the correct one.
Load as reference seemed to be required for me to get it to work, don't know USD enough to know why unfortunately. It's nearly procedural with the main value that has to be hand done is the total iteration number.
It's really a mess though, hopefully we get a node that takes packed prims and turns them to variants or from a sop attribute. Would be glad to see a better way than what I've kludged too.

Image Not Found

Image Not Found

Image Not Found

Image Not Found



if (@ptnum!=`contextoption("ITERATIONVALUE")`){
    removepoint(0,@ptnum);
}
Hi, I seem to have the same issue with trying to create variants from multiple SOP geometry. Could you post this hip file so we can have a look?
User Avatar
Member
3 posts
Joined: 10月 2019
Offline
I am facing the same problem with H20.
Is there any way to create a USD variant from name attribute?
  • Quick Links