Jump to content

Array values to points


Recommended Posts

While trying to create a point attribute based on array values from second input, I was expecting this to work:

v@Cd = v[]@opinput1_colors[@ptnum]; // only works on point 0

I also tried getcomp(), but it seems I am missing something.

vector a = getcomp(v[]@opinput1_colors, @ptnum); // uses first array value on all points
addpointattrib(0, "Cd", a);

 

camera_to_screen.hiplc

Edited by konstantin magnus
Here is an simplified example
Link to comment
Share on other sites

im not familiar with @opinput1_"variable" syntax, but it seems like i points to the same pointnumber as itself. So since you only have one point i input number two, the only point that finds anything is point number one on your mesh.

I dont know the endgoal here, but if you want to access the "colors" array on point 0 on all your points, you can write it like this.

vector array[] = point(1,"colors",0);
@Cd = array[@ptnum];

 

  • Like 1
Link to comment
Share on other sites

Yes. I found for myself that the key F1 is most useful  key when you learn some soft.

And one tip, in case if you didn't know that yet. If you put cursor at function's name in wrangle and press F1 then pop-up Help Browser with help for this function. It works for expressions in Edit Expression window also. Very helpful sometimes.

Link to comment
Share on other sites

Well, I usually read the documentation where needed. But I ignored the attribwrangle page thinking everything is done inside VEX code.

I dont find the idea of setting "invisible" match attributes particularly elegant, either, as they dont show up in the code. But it seems to be the most straight forward way to access arrays fro other nodes in Houdini, so thank you again for the hint!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...