list of attributes

   14257   11   3
User Avatar
Member
47 posts
Joined: Jan. 2014
Offline
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!
User Avatar
Member
606 posts
Joined: May 2007
Offline
A way to sidestep your problem would be to have an id attribute on your geometry which you could copy over to your new points, and after your wrangle have an AttribCopy SOP with Attribute to Match set to “id” and Attribute to Copy set to “*”.
User Avatar
Staff
2591 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).
User Avatar
Member
47 posts
Joined: Jan. 2014
Offline
Ah, okay. That attribcopy work around will do fine for now.

Thanks! It would be cool to be able to loop through a list of them in VEX in the future, Mark :-)
User Avatar
Member
2 posts
Joined: March 2015
Offline
Hey Mark-

Is this still a VEX limitation? I tried a few things in my wrangle and I don't seem to be able to see any values for those magic attributes….

–jono
User Avatar
Member
8548 posts
Joined: July 2007
Online
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”);
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
Thank's Tomas! Since when was this possible? 15?

-b
http://www.racecar.no [www.racecar.no]
User Avatar
Member
8548 posts
Joined: July 2007
Online
bonsak
Thank's Tomas! Since when was this possible? 15?..
14
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
Thanks

-b
http://www.racecar.no [www.racecar.no]
User Avatar
Member
86 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:
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
User Avatar
Member
192 posts
Joined: April 2015
Offline
What about VOPs?
Only way right now is via Inline Code VOP?
User Avatar
Member
4512 posts
Joined: Feb. 2012
Offline
Hi,

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]

youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
  • Quick Links