Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects setTemporalEaseAtKey Script

  • setTemporalEaseAtKey Script

     Timur Solomon updated 1 month ago 1 Member · 2 Posts
  • Timur Solomon

    May 23, 2022 at 9:40 am

    Hi, could you tell me what I am doing wrong when writing the script?

    I’m trying to create a script that will transfer keys from a layer scale transformation to a Transfrom – Scale effect, but I’m getting an error.

    I can’t figure out what’s wrong? What is my mistake, what am I not understanding?

    var comp = app.project.activeItem;
    var layer = comp.selectedLayers[0];
    function replaceScale(layer){
    var transScale = layer.transform.scale;
    var fxLayer = layer.Effects;
    if(transScale.numKeys > 0){
    var fx = fxLayer.addProperty("ADBE Geometry2");
    fx(3).setValue(0);
    for (var i = 1; i <= transScale.numKeys; i++) {
    var tScaleKey = transScale.keyTime(i);
    var tScaleValue = transScale.keyValue(i);
    setKey = fx(4).setValuesAtTimes([tScaleKey], [tScaleValue[1]]);
    setKey = fx(5).setValuesAtTimes([tScaleKey], [tScaleValue[0]]);
    var inInfluence = transScale.keyInTemporalEase(i);
    var outInfluence = transScale.keyOutTemporalEase(i);
    setInfluence = fx(4).setTemporalEaseAtKey(i, inInfluence, outInfluence); // Where is the mistake?
    var InInterpolation = transScale.keyInInterpolationType(i);
    var OutInterpolation = transScale.keyOutInterpolationType(i);
    setInterpolation = fx(4).setInterpolationTypeAtKey(i, InInterpolation, OutInterpolation);
    setInterpolation = fx(5).setInterpolationTypeAtKey(i, InInterpolation, OutInterpolation);
    };
    };
    };
    try {
    replaceScale(layer);
    } catch (e) {
    alert(e);
    }
  • Timur Solomon

    May 23, 2022 at 10:50 am

    The solution is the following:

     setInfluence = fx(4).setTemporalEaseAtKey(i, [inInfluence[0]], [outInfluence[0]]);

    The keys of the layer transformation parameter contain several objects, planes, width, height.

    And for the transform effect, these parameters are decoupled. Therefore, it is necessary to specify the part of the array with key data

Viewing 1 - 2 of 2 posts

Log in to reply.

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