I am always confused about this and it is difficult to find an answer on the vex docs page.
When I run over Primitives in Vex, what does @P here mean?
for example, if I use the following on three connected lines with four points
int closept = nearpoint(1, @P);
I tried to printf the P attribute and saw three vectors which seems to mean that @P has nothing to do with the points but probably belongs to each line. It's not vertex otherwise 6 values will get print out.
But from middle mouse click there is no @P prim attribute but only the point attribute.
Is this @P prim attribute a hidden attribute?
And how is it calculated? Is it the middle point of the line and the centroid of a face?
Thanks
What does @P when run over Primitives mean?
1255 5 1- aaoc1
- Member
- 11 posts
- Joined: 1月 2021
- Offline
- animatrix_
- Member
- 4461 posts
- Joined: 2月 2012
- Online
Hi,
It's the bounding box center of the primitive.
It's the bounding box center of the primitive.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
- aaoc1
- Member
- 11 posts
- Joined: 1月 2021
- Offline
- animatrix_
- Member
- 4461 posts
- Joined: 2月 2012
- Online
lmnoc1animatrix_
Hi,
It's the bounding box center of the primitive.
Thanks. So I assume its some kind of hidden attribute then?
Do you might know in that case is there anyway to invoke access to this prim@P value easily if the wrangle is run over points?
I would say it's a special attribute that Houdini recognizes and computes on the fly, just like how it recognizes N.
You can get the same value using the prim or primuv function. For primuv make sure to use a UVW value of 0.5:
primuv ( 0, "P", @primnum, 0.5 );
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
- Andr
- Member
- 900 posts
- Joined: 2月 2016
- Offline
- jsmack
- Member
- 7659 posts
- Joined: 9月 2011
- Online
animatrix_
Hi,
It's the bounding box center of the primitive.
Not the bounding box center, but the average value of points of the primitive. For some primitives the two might be the same.
primuv of coord (0.5, 0.5, 0.5) is not always the same as average of P. For polygons of 5+ sides, (0.5, 1) is the center, and for tetrahedrons, (0.25, 0.25, 0.25) is the center.
-
- Quick Links