Atom Posted August 25, 2016 Share Posted August 25, 2016 (edited) Hi All, I am looking for a python or Houdini function that will give me a pulse to 1.0 with a decay every so many frames. So it would kind of be like a modulus integrated with a decay. Does anyone know how to code something like this? A typical output might look like this... 0.0 0.0 0.0 0.0 0.0 1.0 0.8 0.6 0.4 0.2 0.0 0.0 0.0 0.0 Edited August 25, 2016 by Atom Quote Link to comment Share on other sites More sharing options...
stevegh Posted August 25, 2016 Share Posted August 25, 2016 Why not just write your own? Give it a couple of parameters like start frame, decay amount/time, maybe add a type like linear/quadratic etc. Or you could use SciPy. Quote Link to comment Share on other sites More sharing options...
f1480187 Posted August 25, 2016 Share Posted August 25, 2016 @P.y = chramp("ramp", @Time); Use a ramp. It will give you an absolute control over the pulse shape. pulse.hipnc Quote Link to comment Share on other sites More sharing options...
Atom Posted August 25, 2016 Author Share Posted August 25, 2016 My goal is control the eye blink on a character. The ramp is an interesting idea, but I still need to feed it a lookup value between 0.0 and 1.0 which needs to be the percentage along the modulus of the blink rate in frames. node = hou.pwd() geo = node.geometry() my_ramp = node.parm("ramp").eval() n = my_ramp.lookup(0.5) print n Quote Link to comment Share on other sites More sharing options...
Atom Posted August 25, 2016 Author Share Posted August 25, 2016 (edited) I guess with a little fixup I think this kind of approach works and I can still use the ramp for shaping the decay of the eye blink. node = hou.pwd() geo = node.geometry() def returnFramesPastLastModulus(current_frame, current_modulus): cf = current_frame while(cf > current_modulus): cf -=current_modulus return cf frame_current = hou.frame() blink_rate = 120 #Blink every 120 frames. f = returnFramesPastLastModulus(frame_current, blink_rate) v = float(f)/float(blink_rate) my_ramp = node.parm("ramp").eval() n = my_ramp.lookup(v) print n Thanks for the insight. Edited August 25, 2016 by Atom 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.