Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Keyframes in scipts question

  • Keyframes in scipts question

    Posted by Damien Lehm on August 20, 2021 at 9:16 pm

    Hello everyone !

    I’m currently working on a script that imports keyframes into after effects.

    I figured out how to create a keyframe, set its interpolation to bezier, how easeIn and easeOut works, but there is one last thing that i can’t understand.

    Right now i’m doing this to add and set eases :

    var easeTestIn = new KeyframeEase( 2000, 20 )
    var easeTestOut = new KeyframeEase( 2000, 20 )
    var keyFrameIndex = transfoNullObject.transform.scale.addKey( posX/framerate )
    transfoNullObject.transform.scale.setValueAtKey( keyFrameIndex, [ xValue, yValue ] )
    transfoNullObject.transform.scale.setInterpolationTypeAtKey( keyFrameIndex, KeyframeInterpolationType.BEZIER, KeyframeInterpolationType.BEZIER )
    transfoNullObject.transform.scale.setTemporalEaseAtKey( keyFrameIndex, easeIn=[easeTestIn,easeTestIn,easeTestIn], easeOut=[easeTestOut,easeTestOut,easeTestOut] )

    This indeed sets easeIn’s speed, but not easeOut’s. It only sets the influence, speed is always 0 no matter what i do.

    Can someone see what i’m doing wrong ? Or missing when creating my keyframe ?

    Thanks.

     

    Damien Lehm replied 5 years ago 2 Members · 2 Replies
  • 2 Replies
  • Andrei Popa

    August 21, 2021 at 5:08 pm

    Hi Damien. I tested this and I notice that you can only set the speed if you have any keyframe on that side. If this keyframe is the first, you can’t set in speed. If it is the last, you can’t set out speed.

  • Damien Lehm

    August 21, 2021 at 9:51 pm

    Hi

    Indeed, but in my case, i do have keyframes before and after the one i’m trying to set.

    When i look at the result in graph editor, i see the keyframe with a correct easeIn, the easeOut is flat (speed = 0), but its influence is good (length between current keyframe and the next one is ok)

    I actually implemented this for xPosition, yPosition and rotation, which are 1D properties, unlike scale which is 2/3D and it works well.

    Only speed from outgoing tangents can’t be set, which is weird.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy