Reference a primitive attribute in VEX (attrib function)

   1893   1   0
User Avatar
Member
177 posts
Joined: Nov. 2015
Offline
Hi,

OK, I've created a primitive attribute called ‘parent’ that holds a string value.

In a primitive wrangle, I'm attempting to delete all primitives whose parent = “piece_1”

I've tried this, but it's giving me an error:

if(@parent == "piece0" && @Frame > 2){
    removeprim(0, @primnum, 1);
}

I'm thinking I need to use the attrib() function, but can't figure out how to make it work.

Any help would be appreciated.

Jim
Reel Inpsirations
Houdini Work in Progress [vimeo.com]
User Avatar
Member
2537 posts
Joined: June 2008
Offline
Sometimes VEX can not determine what type to use so you have to help it out by explicitly telling it what type your attribute comparison is supposed to use.

if(s@parent == "piece_1" && f@Frame > 2){
    removeprim(0, @primnum, 1);
}
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
  • Quick Links