Solaris: Material Assign with CVEX and prim userProperties

   1604   4   1
User Avatar
Member
15 posts
Joined: March 2014
Offline
Hi,

How can I automate material assignments based on primitive userProperties in the incoming alembic or usd stages?

I need to do something like this:
Assigning the "skin" material to all primitives that have (userProperties:mat == "skin")

Is this currently possible in Solaris? I couldn't find a node to use to loop over the primitives and access their properties in stage.
User Avatar
Member
8646 posts
Joined: July 2007
Offline
I believe Assign Material LOP can o this
you can use it to assign any material based on any VEXpression
and also override parameters further

or you can keep it simple and just specify a pattern based on desired property if all you need to do is assign only a handful of materials
Edited by tamte - Oct. 3, 2021 14:53:13
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
15 posts
Joined: March 2014
Offline
Thanks for your reply Tamte, but the point here is to see if we can access the USD primvars and userProperties through the shading interface in an attempt to maintain our pipeline methodology where we have lots of advantages based on this method.
User Avatar
Member
8646 posts
Joined: July 2007
Offline
you can access both in VEX either in the VEXpression of Assign Material
or in any of the Primitive Pattern parameters
both will allow you to do what you mention in the first post
Belal
Assigning the "skin" material to all primitives that have (userProperties:mat == "skin")
but I may be missing your point if that's not what you want

regardless, here is a file showing both options

Attachments:
ts_assign_material_by_property.hip (376.9 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
15 posts
Joined: March 2014
Offline
Thanks Tamte for sharing...
What I meant is the option of assigning the material based on pattern using 'mat' usd properties (in usd this is userProperties:mat).

the file you shared works awesome as long as the property 'mat' is there since you created it houdini, but it doesn't when mat is on a usd primvitive because houdini didn't import it! it could be that there is something we have to do to tell Houdini that we want to import the userProperties.

There two issues actually:
1. Houdini didn't import the userProperties:* found in the usd (even when requested this in the Import data fields of SOP import)
2. Houdini imported the primvars only (where in this case, s@mat == "skin" didn't work because the 'mat' primvar will be in form of array of string not string (in the usd, mat is not "skin"), trying something like s@mat == "skin" didn't work either
Edited by Belal - Oct. 6, 2021 04:18:21

Attachments:
test_primvar_houdini.usda (7.9 KB)
ts_assign_material_by_USD_property.hip (403.0 KB)

  • Quick Links