Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Command to select and permanently smooth layer keyframes?

  • Command to select and permanently smooth layer keyframes?

    Posted by Nick Fox-gieg on May 7, 2012 at 12:40 am

    I’ve got a script (autogenerated from a Java app) that generates hundreds of layers and a position keyframe for each frame of each layer. I’d like to be able to get rid of unnecessary keyframes by selecting all of them and applying a permanent smooth effect, like you can get from the Smoother palette in the GUI. Does anybody know the command for this?

    Thanks!
    Nick Fox-Gieg

    fox-gieg.com

    var solid = myComp.layers.addSolid([1.0, 1.0, 0], "my square", 50, 50, 1);
    solid.motionBlur = true;
    var myEffect = solid.property("Effects").addProperty("Fast Blur")("Blurriness").setValue(61);

    var p = solid.property("position");

    p.setValueAtTime(0.0, [ 727.9377, 549.09705]);
    p.setValueAtTime(0.041666668, [ 758.467, 579.49365]);
    p.setValueAtTime(0.083333336, [ 789.2609, 610.0887]);
    p.setValueAtTime(0.125, [ 820.3195, 640.88196]);
    p.setValueAtTime(0.16666667, [ 851.64276, 671.87366]);

    //...etc

    Dan Fredley replied 14 years, 1 month ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Fredley

    June 12, 2012 at 6:08 am

    You can set an expression on the property:
    p.expression = """smooth(.2,5)""";
    p.selected = true;
    app.executeCommand(app.findMenuCommandId("Convert Expression to Keyframes")); //technically unsupported scripting feature
    p.selected = false;

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