Atom Posted September 1, 2016 Share Posted September 1, 2016 (edited) Hi All, I have a script that is setting function types on some keyframes. I want the keyframe slope to ease in, level off then ease out. After Effects EasyEase style. It seems that no matter what combination of function types I pass in to my keyframe generator I just can't get the curve shape I want. Does anyone know how to alter this code to get the channel shape shown in the image? node = hou.pwd() def assignKeyframe (passedParm, passedFrame, passedValue, passedFunctionType='bezier()'): if passedParm != None: setKey = hou.Keyframe() setKey.setFrame(passedFrame) setKey.setValue(passedValue) passedParm.setKeyframe(setKey) passedParm.setExpression(passedFunctionType, hou.exprLanguage.Hscript) def keyframeValue (): current_control = node.parm('ctl_value') current_control.deleteAllKeyframes() minimum_sustain = 4 frames = [1,285,296,356,366,428,438,499,509,572,582,643,654,716,727,786] for i in range(len(frames)-1): frame_start = frames[i] frame_end = frames[i+1]-1 sustain = frame_end-frame_start assignKeyframe(current_control, frame_start-int(minimum_sustain/2), 0.0, 'easeout()') assignKeyframe(current_control, frame_start, 1.0, 'bezier()') assignKeyframe(current_control, frame_end, 1.0, 'bezier()') assignKeyframe(current_control, frame_end+int(minimum_sustain/2), 0.0, 'easein()') ap_keyframe_ease_IN_OUT_issue.hiplc Edited September 1, 2016 by Atom Quote Link to comment Share on other sites More sharing options...
edward Posted September 2, 2016 Share Posted September 2, 2016 I think you're not setting the slope and accel values for use with the 'bezier()' expressions. Easiest to figure this out is to start a fresh channel on a new node, key it the way you want to look and then run print node.asCode(save_channels_only=True) 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.