Primvars and Relationships

Hi!
I have a Renderman shader on which i’m reading a mesh int primvar ( using PxrPrimvar ) to switch between different textures.
This works nicely, but if i create a Relationship on my mesh instead of creating a primvar, it’s not working
Are there any limitations to this workflow?
Thanks a ton!

Hi @dietchmatch. I believe primvars must be attributes.

There is a mechanism which allows a primvar’s value to be delegated to a relationship by nesting an idFrom relationship within the primvar’s namespace. See Universal Scene Description: UsdGeomPrimvar Class Reference. Search for “Id attribute API” for more info.

checked, but not sure how to implement it :smiley:

and actually i don’t think it’s what i need.
Maybe the issue of not getting the value from the relationship lays in renderman and not in usd

having this works


which is actually a primvar called MAPS defined on the “geometry” prim and travelling down

but if set that via a relationship like this


on which i’m creating a relationship called primvars:MAPS pointing to a primvar that’s called MAPScoat_c_geo living on my geometry prim, it doesn’t

any hints on how to achieve something like that?
Thanks!

I think the short answer is “no”.

Creating a relationship with a “primvars” prefix is not “dereferenced” to pull the target primvar up to the prim that defines the relationship. It’s a cool idea, but nothing in the USD code or Hydra code makes this interpretation of relationships in the “primvars” namespace.

2 Likes

Thanks a ton Mark!
i’ll try to have a primvar for getting the primvar name … a bit cumbersome i know but let’s try out :smiley: