Forum Replies Created

Page 57 of 1081
  • Probably something similar to this:

    m = marker;
    n = m.nearestKey(time).index;
    if (time < m.key(n).time) n--;
    r = 0;
    if (n > 0){
    n = (n -1)%4;
    if (n == 1)
    r = -5
    else if (n == 3)
    r = 5;
    }
    r
  • Dan Ebberts

    February 2, 2023 at 7:07 am in reply to: parenting expression

    It should work either way, but the target has to animated, either by keyframes or an expression applied to the layer itself or its parent. If you just drag it around, nothing will happen.

  • Dan Ebberts

    January 31, 2023 at 10:07 pm in reply to: parenting expression

    Hmmm…. It works for me. The child will mimic the movement of the target, even if the target has no movement of its own and is only animated by the motion of its parent. I must be missing something…

  • Dan Ebberts

    January 31, 2023 at 6:38 pm in reply to: Random intervals between LoopOut (‘pingpong’)

    I think it will look something like this:

    minHold = .1;
    maxHold = .75;
    t1 = key(1).time;
    t2 = key(2).time;
    d = t2 - t1;
    if (time >= t1){
    t = tPrev = t1;
    while (t <= time){
    tPrev = t;
    seedRandom(tPrev,true);
    h1 = random(minHold,maxHold);
    h2 = random(minHold,maxHold);
    t += d*2 + h1 + h2;
    }
    tDiff = time - tPrev;
    if (tDiff < d)
    valueAtTime (t1 + tDiff)
    else if (tDiff < d + h1)
    key(2).value
    else if (tDiff < 2*d + h1)
    valueAtTime(t2 - (tDiff - (d + h1)))
    else
    key(1).value;
    }else
    value
  • Dan Ebberts

    January 31, 2023 at 12:45 am in reply to: parenting expression

    Try it like this:

    target = thisComp.layer("Target");
    offset = target.toComp(target.anchorPoint) - target.toComp(target.anchorPoint,0);
    value + offset
  • Dan Ebberts

    January 30, 2023 at 8:10 pm in reply to: control mask keyframes with slider?

    Try this:

    s = effect("Slider Control")("Slider");
    t = linear(s,0,100,key(1).time,key(2).time);
    valueAtTime(t)
  • Try this for Start:

    (thisProperty.propertyGroup(3).propertyIndex - 1)*2

    and this for End:

    (thisProperty.propertyGroup(3).propertyIndex - 1)*2 + 1
  • Try this for the first one:

    words = text.sourceText.split(/\s+/);
    words[textIndex-1][0] == "@" ? 100 : 0
  • Dan Ebberts

    January 25, 2023 at 12:13 am in reply to: Randomize Position Offset

    Maybe like this:

    seedRandom(index, true);
    offset = random([-50,-50],[50,50]);
    value + offset
  • Dan Ebberts

    January 24, 2023 at 8:32 am in reply to: Set a keyframe on every frame between 2 keyframes

    You could run a little script like this:

    var comp = app.project.activeItem;
    var layer = comp.selectedLayers[0];
    var props = layer.selectedProperties;
    for (var i = 0; i < props.length; i++){
    if (props[i].canVaryOverTime && props[i].numKeys >= 2){
    var t1 = props[i].keyTime(1) + comp.frameDuration;
    var t2 = props[i].keyTime(2) - comp.frameDuration/2;
    var t = t1;
    while (t < t2){
    props[i].addKey(t);
    t+= comp.frameDuration;
    }
    }
    }
Page 57 of 1081

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