Forum Replies Created

Page 51 of 1081
  • I think you have to iterate through the parent chain, so it would be like this:

    L = thisComp.layer("Layer Control");
    s = L.scale;
    while (L.hasParent){
    L = L.parent;
    s = [s[0]*L.scale[0]/100,s[1]*L.scale[1]/100];
    }
    s
  • Dan Ebberts

    March 23, 2023 at 9:12 pm in reply to: Keyframe slider control

    Something like this maybe:

    s = thisComp.layer("Null 1").effect("Slider Control")("Slider");
    if (numKeys > 0){
    idx = clamp(Math.round(s),1,numKeys);
    valueAtTime(key(idx).time);
    }else
    value;
  • Dan Ebberts

    March 23, 2023 at 6:13 pm in reply to: “Bunny Ears Wobble” expression – help needed

    See if this works any better:

    P = parent.rotation; 
    n = 0;
    if (P.numKeys > 0){
    n = P.nearestKey(time).index;
    if (P.key(n).time > time){
    n--;
    }
    }
    if (n == 0){
    t = 0;
    }else{
    t = time - P.key(n).time;
    }
    if (n > 0){
    v = P.velocityAtTime(P.key(n).time - thisComp.frameDuration/10);
    amp = 1.0;
    freq = 1.0;
    decay = 1.0;
    w = freq*Math.PI*2;
    P + v*amp*Math.sin(t*w)/Math.exp(decay*t)/w;
    }else{
    P;
    }
  • Dan Ebberts

    March 22, 2023 at 11:43 pm in reply to: Retain Layer Sizes script

    Did you try:

    ImportAsType.COMP_CROPPED_LAYERS;
  • I’m guessing that you either have an old version of AE or you have File > Project Settings > Expressions > Expression Engine set to Legacy ExtendScript instead of JavaScript.

  • Dan Ebberts

    March 14, 2023 at 12:52 am in reply to: Null Object’s position

    It’s too bad that there aren’t expression-like layer space transform equivalents in the scripting language, because what you really need here is toComp(). What I’d do is have the script temporarily add a point control to the selected layer, add a toComp() expression to it to calculate the layer’s left edge, harvest the result with the script, and delete the point control. The specifics depend on how you have things set up, but in general, that should work.

  • Dan Ebberts

    March 11, 2023 at 12:03 am in reply to: Audio levels triggered by markers

    It looks like when n is 0 (before the first marker) L1 is not defined so this line will fail:

    }else{[L1,L1]}

  • Something like this maybe:

    dur = 1;
    numSegs = 10;
    seedRandom(Math.floor(time/dur),true);
    segIdx = Math.floor(random(numSegs));
    t = time%dur;
    segIdx*dur + t
  • Try it like this:

    C = comp("Infinity");
    ctrl = C.layer("Head Rotation").effect("x Position")("Slider");
    L = C.layer(thisComp.name);
    ctrl.valueAtTime(time + L.startTime)
  • Dan Ebberts

    March 9, 2023 at 9:37 pm in reply to: Count number of line breaks?

    Ah. Try it this way (a trick I learned from Filip):

    text.sourceText.value.replace(/[\r\3]/g,"").length
Page 51 of 1081

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