Solaris: setting or renaming primvars

   727   1   0
User Avatar
Member
40 posts
Joined: 9月 2014
Offline
Heya, I'm trying to process some assets and found that the uv primvar is called "UVMap" and when I unpack to polygons in a sop modify I can see that "UVMap" is set to a vertex attribute. I tried looking around to see if there was a way to rename the primvar but haven't found any answers or methods to do this. Instead, I'm creating a primvar called "uv" and I'm setting the value of "UVMap" onto my "uv" primvar. But when I look at my created "uv" primvar in the sop modify node, I see that it created the "uv" primvar attribute as a point attribute instead of a vertex one. I've not seen anything obvious in the documentation to control or choose where the primvar data should be set too, if it should be a point, prim, vertex or detail attribute. I've tried to create the uv vertex attribute before creating and setting the primvar. But it renames the uv vertex attribute to "st" and sets the uv attribute back to point.

string primPath = chs("primPath");

usd_addprimvar(0, primPath, "uv", "texCoord2f[]", "vertex");

vector2 uvVal[] = usd_primvar(0, primPath, "UVMap");

usd_setprimvar(0, primPath, "uv", uvVal);
User Avatar
Member
335 posts
Joined: 11月 2013
Offline
try changing
usd_addprimvar(0, primPath, "uv", "texCoord2f[]", "vertex");
to
usd_addprimvar(0, primPath, "uv", "texCoord2f[]", "faceVarying");

The USD interpolation terminology aligns with RenderMan, not SOPs. So "vertex" in USD is equivalent to "point" in SOPs, and "faceVarying" in USD is equivalent to "vertex" in SOPs.

See https://www.sidefx.com/docs/houdini//solaris/usd.html#interp [www.sidefx.com]
  • Quick Links