Vex expressions with Usd ?

   5728   8   1
User Avatar
Member
52 posts
Joined:
オフライン
How I can target primitives with a certain attribute value for a collection? Or in other words, how to use attributes a Vexpression for something in lops?

I want to create a collection for that includes primitives given the value of an attribute they have.
Image Not Found


Any help is appreciated !

Thanks

Attachments:
924D7F91-C2D3-4291-98E8-ADB1934EF6F8.jpeg (51.9 KB)

User Avatar
スタッフ
4558 posts
Joined: 7月 2005
オフライン
It's the same format as the VEXpressions you can put in any Primitive Pattern field in LOPs, described here: https://www.sidefx.com/docs/houdini/solaris/pattern.html [www.sidefx.com]

All the USD related VEX functions start with “usd_”, so they're easy to find in the VEX documentation.
User Avatar
Member
8173 posts
Joined: 9月 2011
オフライン
How would one make a VEXpression that compares a primvar value?

I attempted to do
v[]@primvars:displayColor[0].r > 0.5;
and it hanged so bad I did't even get a core file when I killed it.
Edited by jsmack - 2020年4月21日 18:06:48
User Avatar
スタッフ
443 posts
Joined: 2月 2008
オフライン
try

vector(usd_primvarelement(0, s@primpath, "displayColor", 0)).r > 0.5
User Avatar
Member
8173 posts
Joined: 9月 2011
オフライン
npetit
try

vector(usd_primvarelement(0, s@primpath, "displayColor", 0)).r > 0.5

okay. That sounds equivalent though.
User Avatar
Member
12986 posts
Joined: 7月 2005
オフライン
jsmack
That sounds equivalent though.

I haven't looked into it but I think your would requires that primvar is, or assume all primvars are, bound to a VEX variable. Using the query function as per Nick's example doesn't have that requirement.
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
User Avatar
Member
8173 posts
Joined: 9月 2011
オフライン
jason_iversen
jsmack
That sounds equivalent though.

I haven't looked into it but I think your would requires that primvar is, or assume all primvars are, bound to a VEX variable. Using the query function as per Nick's example doesn't have that requirement.

Right, I guess I assumed they would be, but maybe not. Maybe they are only bound in the context of wrangles?
User Avatar
スタッフ
1470 posts
Joined: 7月 2005
オフライン
jsmack
I attempted to do
v[]@primvars:displayColor[0].r > 0.5;
and it hanged so bad I did't even get a core file when I killed it.
This should be fixed in tomorrow's H18.0.446.
User Avatar
Member
52 posts
Joined:
オフライン
Awesome!
Thanks
  • Quick Links