Reference a primitive attribute in VEX (attrib function)
1893
1
0
Nov. 25, 2016 4:13 p.m.
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
Enivob
Member
2537 posts
Joined: June 2008
Offline
Nov. 25, 2016 5:10 p.m.
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.