How would you get the index value of a vector array from another point?

   3078   2   0
User Avatar
Member
23 posts
Joined: Oct. 2015
Offline
Hello,

Trying to read a vector array from another point at a certain index.

From my understanding of Houdini something like this should work.

vector tempArray[] = point(0,"vectorArrayAttrib",pointToReadFrom);
vector v = tempArray[index];

Unfortunately this method is returning an empty array from the point() function. If this is not the right way to go about doing this please let me know.

Any help welcomed.

Thanks.
Edited by trzanko - Dec. 12, 2016 18:58:18
Tighe Rzankowski

trzankofx@gmail.com
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
Hi
Hard to know when I don't know how you have declared “vectorArrayAttribute”.
With two connected points wranglers I would do it like this:
Wrangle 1. Declare the array attribute
v[]@vectorArrayAttrib[0] = set(0,0,1);
v[]@vectorArrayAttrib[1] = set(0,1,0);
v[]@vectorArrayAttrib[2] = set(1,0,0);
Wrangle 2. Read the array attribute from point 0:
vector tempArray[] = point(0,"vectorArrayAttrib",0);
v[]@debug1 = tempArray;
vector v = tempArray[0];
v@debug2 = v;

Hope this helps

-b
Edited by bonsak - Dec. 12, 2016 19:27:39
http://www.racecar.no [www.racecar.no]
User Avatar
Member
23 posts
Joined: Oct. 2015
Offline
Hi Bonsak,

Thanks for the reply, your proof has helped me clear up my confusion.

The array “vectorArrayAttrib” was properly initialized, though a problem occurred because of where I was trying to call the point() function. I should have mentioned that I was attempting to perform the point() function within an if statement.

I now realize I can do the if logic on an integer and perform the point() function after the if with the now determined integer.

Thank you for the help.
Tighe Rzankowski

trzankofx@gmail.com
  • Quick Links