Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Add keyframe on current Time

  • Add keyframe on current Time

    Posted by Sebastian Moreno on June 7, 2016 at 6:58 pm

    Simple but weird. I can’t get to use addKey where the Current time indicator stands. I just want to add a key frame to the shape layer:

    opaCity = shapeLayer.property(“Transform”).property(“Opacity”).setValue(0);

    btn6.onClick = function(){

    shapeLayer.property(“Transform”).property(“Opacity”).addKey(KeyframeTime);

    }

    ////I tried this and other couple of things for this” KeyframeTime”:

    KeyframeTime = app.project.items.testComp.layers.shapeLayer.keyTime(1). — and isnt working

    Sebastian Moreno replied 9 years, 10 months ago 2 Members · 2 Replies
  • 2 Replies
  • Mike Sevigny

    July 4, 2016 at 6:17 pm

    You need to identify where the timeline indicator is currently positioned in time
    activeComp = app.project.activeItem; // Collect the active composition
    keyTime = activeComp.time; // Identify the current position of the timeline indicator

    opaCity = shapeLayer.property("Transform").property("Opacity"); // Identify your opacity parameter
    opaCity.addKey(keyTime); // Add keyframe
    opaCity.setValueAtTime(keyTime, 50); // Set the keyframe's value to 50

    Mike Sevigny

  • Sebastian Moreno

    July 7, 2016 at 5:43 pm

    Ohhh Mike thank you
    I didn’t know about this active syntax and the combination of addKey and setValue.

    Brilliant.
    Thanks again

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