How can I script action made by setting keyframe handle type for bezier f-curve in Graph Editor to AUTO_CLAMPED?

o = bpy.data.objects['jet-1.1']
fc = o.animation_data.action.fcurves[1]  # Y Euler Rotaion
kfs = fc.keyframe_points
for frame, value in DATA:
    kf = kfs.insert(frame, value, {'FAST'})
    kf.interpolation = 'BEZIER'
    kf.handle_left_type = 'AUTO_CLAMPED'
    kf.handle_right_type = 'AUTO_CLAMPED'

When I try to do it this way, curve doesn't get smoothed. How can it be achived?

This picture shows the result of the script from above: enter image description here

But I want to have the result like this: enter image description here

  • $\begingroup$ try fc.update() after you inserted the keyframes $\endgroup$ Jul 10 '15 at 9:38
  • $\begingroup$ thank you very much, it works! sorry for being accidently unable to upvote your comment. $\endgroup$ Jul 10 '15 at 9:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.