Kornelius
I was trying to use some kind of state retention into the pyExpression node, because I needed to create a random weight PP.
Moreover, that random weight had to be persistent through saving.

Please correct me if I'm wrong, but there is no chance to create a global variable or some kind of function inside the pyExpression node.

So what I've done was using a fractal texture to generate semi random value and then use as many locators as weights I needed, to pick the alpha value out of it.

What I've done is working and I'm happy with it.

What I've noticed tho is that the TA array has got the same value for the first 100 indexes or so (on 300), if I move the locator slightly the weight changes, and pickups the real value of the texture, so no problem.

Attached the example.

win 7 maya 2014 x64
Reply 0 0
pshipkov
I do not see textureToArray node in your scene.
But you are right in general - using procedural textures is the better way of getting random stuff.
Reply 0 0
Kornelius
Oops, I must have deleted it while cleaning the scene. I'll check it tomorrow from work!
win 7 maya 2014 x64
Reply 0 0
Reply