Hscript get prim attribute for each prim

   501   2   1
User Avatar
Member
11 posts
Joined: 7月 2015
Offline
Sorry this is a super easy question but I need to get a primitive attribute value from geo primitives to drive a parameter in a node.

All examples are like
prim("path to attribute",0,"attributename",0)


but I really want it to look at every primitive not just the 0. So why doesnt this work?
prim("../attribrandomize2/",@primnum,"Speed",0)

It says local variable @primnum not found. I just cant remember for the life of me how this goes.

Attachments:
Hscript.jpg (7.3 KB)

User Avatar
Member
4516 posts
Joined: 2月 2012
Offline
Hi,

You can't break up the execution of nodes per element like that. That's why SideFX added new parameters to do exactly that, called First/Second U Attrib.
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
User Avatar
Member
11 posts
Joined: 7月 2015
Offline
Ok so I just put it into a for each loop and it worked
  • Quick Links