ruchitinfushion Posted March 30, 2016 Share Posted March 30, 2016 Hi, in carve Node (secondU parameter) inside forEach i added bellow code to get random animation for each curve. But problem is it gives random value between 35-50 only at first frame, if frame is greater than one thn it gives 5 so how to store first frame random value for rest of animation ?? from numpy import interp import random currentFrame = intFrame() jitter = 5 if currentFrame == 1: jitter = random.uniform(35,50) return(jitter) return(interp(currentFrame,[1,jitter], [0,1])) Quote Link to comment Share on other sites More sharing options...
Atom Posted March 30, 2016 Share Posted March 30, 2016 (edited) Storage is typically done by using a solver. But you might be able to simply reference the initial random value from outside the loop. Store a random number on the primitive attribute of each curve. I guess I'd have to see the network. Edited March 30, 2016 by Atom Quote Link to comment Share on other sites More sharing options...
rafaelfs Posted March 30, 2016 Share Posted March 30, 2016 I'm not sure I got your question right, but if you meant to animate the carving of curves based on a random end frames between 35 and 50, here's a possible answer. The trick is that there's no storing of script variables in SOPs, the script is evaluated and that's all you get at the end of it so your jitter variable is reset every time. Instead I used the primitive number as a seed for the random value (so I get the same random value for each curve) and then you just interpolate based on the current frame. Cheers random_carve.hip Quote Link to comment Share on other sites More sharing options...
ruchitinfushion Posted March 31, 2016 Author Share Posted March 31, 2016 (edited) See this Edited March 31, 2016 by ruchitinfushion Quote Link to comment Share on other sites More sharing options...
ruchitinfushion Posted April 1, 2016 Author Share Posted April 1, 2016 Any Solution ?? Quote Link to comment Share on other sites More sharing options...
rafaelfs Posted April 1, 2016 Share Posted April 1, 2016 Sorry, I can't make sense of that... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.