Can I get a list of attributes in VEX or VOPs?
I have an attribute wrangle node that is making new geometry and none of those points inherit the attributes from the point that is being processed when that geometry is being created.
I'd like to loop over the attributes on the source geometry and copy them to the new points, but I can't find a vex function to provides a list of attributes or a way to get attributes by something other than its name. I was thinking I could do an import attribute by index (if such a thing existed) until it started failing. But I don't see how to do that either.
Thanks!
list of attributes
15883 11 4-
- ben-andersen
- Member
- 47 posts
- Joined: Jan. 2014
- Offline
-
- eetu
- Member
- 606 posts
- Joined: May 2007
- Offline
-
- mark
- Staff
- 2655 posts
- Joined: July 2005
- Offline
Ben Andersen
Can I get a list of attributes in VEX or VOPs?
I have an attribute wrangle node that is making new geometry and none of those points inherit the attributes from the point that is being processed when that geometry is being created.
I'd like to loop over the attributes on the source geometry and copy them to the new points, but I can't find a vex function to provides a list of attributes or a way to get attributes by something other than its name. I was thinking I could do an import attribute by index (if such a thing existed) until it started failing. But I don't see how to do that either.
Thanks!
There are detail intrinsic attributes: “pointattributes”, “vertexattributes”, “primitiveattributes” and “detailattributes”.
However, in VEX it seems that you can only get the first entry from the attribute, so I'm not sure that you can do this in a wrangler. You might be able to use a Python SOP to build a string which is handled by the wrangler (you can access intrinsics in Python too).
-
- ben-andersen
- Member
- 47 posts
- Joined: Jan. 2014
- Offline
-
- jonogibbs
- Member
- 2 posts
- Joined: March 2015
- Offline
-
- tamte
- Member
- 9101 posts
- Joined: July 2007
- Offline
no limitation anymore, you can do all of them as arrays:
s@vertexattribs = detailintrinsic(0, “vertexattributes”);
s@pointattribs = detailintrinsic(0, “pointattributes”);
s@primattribs = detailintrinsic(0, “primitiveattributes”);
s@detailattribs = detailintrinsic(0, “detailattributes”);
s@vertexattribs = detailintrinsic(0, “vertexattributes”);
s@pointattribs = detailintrinsic(0, “pointattributes”);
s@primattribs = detailintrinsic(0, “primitiveattributes”);
s@detailattribs = detailintrinsic(0, “detailattributes”);
Tomas Slancik
CG Supervisor
Framestore, NY
CG Supervisor
Framestore, NY
-
- bonsak
- Member
- 459 posts
- Joined: Oct. 2011
- Offline
-
- tamte
- Member
- 9101 posts
- Joined: July 2007
- Offline
-
- bonsak
- Member
- 459 posts
- Joined: Oct. 2011
- Offline
-
- tony_a
- Member
- 87 posts
- Joined: Jan. 2009
- Offline
Just stumbled across this topic and firstly I wanted to say thanks, it saved me a load of time searching through the docs.
Secondly, just to be pedantic, the syntax should be:
Secondly, just to be pedantic, the syntax should be:
s[]@pointattribs = detailintrinsic(0,"pointattributes"); s[]@primattribs = detailintrinsic(0,"primitiveattributes"); s[]@vertexattribs = detailintrinsic(0,"vertexattributes"); s[]@detailattribs = detailintrinsic(0,"detailattributes");
Edited by tony_a - Nov. 15, 2016 05:52:57
-
- OdFotan
- Member
- 192 posts
- Joined: April 2015
- Offline
-
- animatrix_
- Member
- 4832 posts
- Joined: Feb. 2012
- Offline
Hi,
You can use the regular Import Attribute VOPs and use this syntax as the attribute name:
For example:
You can use the regular Import Attribute VOPs and use this syntax as the attribute name:
intrinsic:attribname
For example:
intrinsic:precision intrinsic:globaltokens
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]

-
- Quick Links