Forum Replies Created

Page 89 of 1081
  • When I use your expression, it only brings across the text, not the style elements. I’m not sure why that’s not the case for you.

  • Try this:

    m = marker;

    acc = 0;

    if (m.numKeys > 0){

    n = m.nearestKey(time).index;

    if (time < m.key(n).time) n--;

    if (n > 0){

    if (n%2){

    acc = time - m.key(n).time;

    }

    for (i = 1; i < n; i += 2){

    acc += m.key(i+1).time - m.key(i).time;

    }

    }

    }

    valueAtTime(time - acc)

    BTW, it does just the opposite (runs the animation between marker pairs) if you change the last line to this:

    valueAtTime(acc)

  • I think you just need to stick the result of your loop calculation into a variable and use that instead of value in the other part of your expression, like this:

    val = loopIn() + loopOut() - value;

    x = val[0];

    xFactor = (100 - x);

    y = 100 + xFactor;

    [x, y];

  • Dan Ebberts

    May 15, 2022 at 2:57 pm in reply to: Lock keyframe value to be either 0 or 100

    This should help illustrate what I mean. I went into your “torso and arms – slider controls” comp and added a Dropdown Menu Control to the “body control” layer. I edited the control to have five entries with these names : “left”, “left 3/4”, “front”, “right 3/4”, “right”.

    Then I add this expression to the first Slider Control:

    ddm = effect("Dropdown Menu Control")("Menu").value;

    ddm == 2 ? 100 : 0

    this to Slider Control 2:

    ddm = effect("Dropdown Menu Control")("Menu").value;

    ddm == 3 ? 100 : 0

    this to Slider Control 3:

    ddm = effect("Dropdown Menu Control")("Menu").value;

    ddm == 4 ? 100 : 0

    and this to Slider Control 4:

    ddm = effect("Dropdown Menu Control")("Menu").value;

    ddm == 5 ? 100 : 0

    Then, whichever position you select with the dropdown, all the pieces move into place.

    I hope that’s helpful.

  • Dan Ebberts

    May 15, 2022 at 1:05 pm in reply to: Lock keyframe value to be either 0 or 100

    Without really seeing the details, my guess is “probably”, but I’m wondering if you wouldn’t be better off with a dropdown menu control that lists your 5 poses and then all your expressions reference that control. Then you’d just keyframe the control (hold keyframes happen automatically) and everything should snap into place via the expressions.

  • Dan Ebberts

    May 14, 2022 at 3:20 pm in reply to: Lock keyframe value to be either 0 or 100

    I think we need more info. What determines whether the value is 0 or 100? What happens to the values between the keyframes? A before-and-after example would be helpful.

  • Dan Ebberts

    May 12, 2022 at 1:11 pm in reply to: Keyframes Creation by Scripting

    The only tip that comes to mind when generating a lot of keyframes, is to, whenever possible, create time and value arrays and use setValuesAtTimes() instead of looping through and doing individual setValueAtTime() operations.

  • Like this, I think:

    if(myLayer.property("Transform").property("Position").dimensionsSeparated){

    // do something

    }else{

    // do something different

    }

  • Dan Ebberts

    May 11, 2022 at 5:25 pm in reply to: Fit to Comp Width

    I guess it depends on what you’re after exactly. If you just want to scale the text so that its width matches the comp width, a scale expression like this should work:

    s = (thisComp.width/sourceRectAtTime(time,false).width)*100;

    [s,s]

  • Dan Ebberts

    May 11, 2022 at 3:55 pm in reply to: timeRemap play

    It will probably look something like this (assumes that opening animation starts at time = 0 and closing animation starts at time = 5):

    open = 1965;

    close = 2012;

    closeAnimStart = 5;

    year = thisComp.layer("controller").effect("year")("Slider");

    frame = timeToFrames(time);

    t = time;

    if (year >= close){

    while (year.valueAtTime(t) >= close){

    frame--;

    t = framesToTime(frame);

    }

    t += thisComp.frameDuration;

    closeAnimStart + time - t;

    }else if (year >= open){

    while (year.valueAtTime(t) >= open){

    frame--;

    t = framesToTime(frame);

    }

    t += thisComp.frameDuration;

    time - t;

    }else{

    0;

    }

Page 89 of 1081

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