rolfcoppter
Hey guys so im trying to find a way to create an array with a bunch of random values between 1-3.

I have made a create array node and have the size plugged into an attribute.(array of int)
I then plug the output array into an array expression.
"$E = rand(0,4);" is the expression i am using.

The problem i am having if the values of the array change every frame so say myArray[0]
is 1 on the first frame then 2 on the next then 1 again on the next and keeps changing. is there an expression or node i can use to make sure that once the int is assigned then it keeps its value forever???

any help really appreciated thank you in advance!
Reply 0 0
David l
Not in front of maya but you could try with
seed($ID);
In your expression. (This works in the pointnode, haven't tried it in the array expression node though).
Otherwise go for mesh2arrays it has support for randomgeneration of both scalar and vector arrays.
Hope it helps :)
//
David
Reply 0 0
rolfcoppter
Hey david,
Thanks for the reply

The Mesh to arrays node worked perfectly! 

Really appreciate the help,
Jordan
Reply 0 0
Reply