Noob Question - What is the proper syntax for accessing an point attribute int array index value in a parameter expression?

   2831   3   1
User Avatar
Member
34 posts
Joined: Nov. 2007
Offline
I feel stupid for not being able to get this figured out, but what is the proper syntax for accessing a single value from an attribute that is an array on some geo? I looked through a bunch of the docs other websites and it seems straightforward, but I can't get it to work.

My point attr of “sourceprim” has a value of "". Shouldn't I be able to do this in a parameter expression?:
@sourceprim

and get “1”?

so if I wanted to test for values on points with an expression to decide to delete I could do:
@sourceprim == 1

I can do it via a point() call but I would rather understand how to properly access it with the @ call.

Thanks for help ahead of time for anyone who schools me on this! Sample file below.

Attachments:
array.hiplc (62.7 KB)

User Avatar
Member
2627 posts
Joined: June 2008
Offline
Houdini has multiple expression languages and the Delete that does not work is supplying a VEX based expression in an Hscript field. Switch the Operation from Delete By Expression to Delete By Pattern and @sourceprim==1 works.

Basically for VEX work, just use a wrangle. Not all parameter fields support attribute processing.
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
34 posts
Joined: Nov. 2007
Offline
Thanks Enivob! "@sourceprim == 1;" also works in pattern! Just glad to know that syntax works, I was pulling my hair out. I am not as familiar with VEX, I am python guy… but I am trying to learn to solve some my problems in vex and not always just fall back to python… trying to use vex for speed and the ability to compile it.

Feels like they should make it clearer visually which fields support VEX and which don't, like how python and hscript change the color. It makes an awesome piece of software feel less reliable. I should use wrangles more.

Anyone know if there is any collection/site of wrangle recipes besides what is in the wrangle nodes themselves?

Thanks for the help!
User Avatar
Member
2627 posts
Joined: June 2008
Offline
Here is a good site to check out.
http://www.tokeru.com/cgwiki/index.php?title=HoudiniVex [www.tokeru.com]
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
  • Quick Links