Forum Replies Created

Page 21 of 1081
  • So in this scenario, the keyframes would all be moved to the right so that there is time before the first keyframe, is that correct?

  • Dan Ebberts

    June 16, 2024 at 4:03 pm in reply to: Change color per character of text

    That expression will only work with an Expression Selector, not a Range Selector.

  • Not sure this is exactly what you’re looking for, but you could try this instead of loopOut():

    t = time%key(numKeys).time;
    first = key(2).value;
    second = key(3).value;
    newValue = effect("Length 25-80")("Slider");
    linear(valueAtTime(t), first, second, first, newValue);
  • Dan Ebberts

    June 11, 2024 at 3:50 am in reply to: sourceText is changing paragraph alignment

    I’m curious how you have things set up. I just ran a test, grabbing the source text from a left-aligned text box into a right-aligned text box and only the text is effected, not the paragraph alignment, using this simple expression:

    thisComp.layer("left aligned").text.sourceText
  • There isn’t any way to externally access an expression’s internal local variables. The only way an expression can communicate with the outside world is by altering the value of property hosting the expression. However, it seems like your other expressions could get the value of b the same way your posted expression does (from the csv layer).

  • Dan Ebberts

    June 5, 2024 at 8:12 pm in reply to: Bounce expression on eased keyframes

    It depends on the expression. The bounce may depend on the velocity coming into the keyframe, which for an eased keyframe would be zero.

  • Dan Ebberts

    June 4, 2024 at 10:50 pm in reply to: Image Sequence frame based on Trace Null position?

    If you used the Trace Path action on the Create Nulls From Paths script, the Rotation property of the Null probably has the info you need. You’d end up with something similar to this:

    angle = thisComp.layer("Null 1").transform.rotation + 180;
    framesToTime(angle)
  • Dan Ebberts

    May 31, 2024 at 3:10 pm in reply to: Hundreds of isometric characters walking around !

    I think you’re on the right track, except that the time remapping part has to figure out how long the animation has been moving in the current direction. I haven’t tested any of this (so there may be typos), but here’s how I’d do the slider:

    v = position.velocity;
    if (v[0] == 0 && v[1] == 0){
    n = 0;
    }else{
    a = radiansToDegrees(Math.atan2(v[1],v[0])) + 180;
    if (a < 22.5){
    n = 3;
    }else if (a < 67.5){
    n = 5;
    }else if (a < 112.5){
    n = 1;
    }else if (a < 157.5){
    n = 6;
    }else if (a < 202.5){
    n = 4;
    }else if (a < 247.5){
    n = 8;
    }else if (a < 292.5){
    n = 2;
    }else if (a < 337.5){
    n = 7;
    }else{
    n = 3;
    }
    }
    n

    And here’s an attempt at the time remapping:

    s = effect("Direction")("Slider");
    timeMap = [0, 1, 2, 3, 4, 5, 6, 7, 8];
    n = Math.round(s.value);
    f = timeToFrames(time-thisComp.frameDuration);
    while (f >= 0 ){
    nPrev = s.valueAtTime(framesToTime(f));
    if (nPrev != n) break;
    f--;
    }
    t = time - framesToTime(f+1);
    timeMap[n] + t;

  • Dan Ebberts

    May 30, 2024 at 4:35 pm in reply to: Hundreds of isometric characters walking around !

    >Can you use expressions to detect what direction a layer is traveling and then switch its precomp animation to match that?

    In general, yes. If you’re generating the movement by animating the position property, for example, you can look at the position property’s velocity and determine which quadrant the direction of the movement is in by the sign of the x and y components: upper right (+, -), lower right (+, +), lower left (-, +) or upper left (-, -). That could be used to determine which section of a time remapped walk cycle plays (or which layer in a pre-comp is visible). Definitely do-able, with a number of options.

  • Dan Ebberts

    May 29, 2024 at 3:07 pm in reply to: Natural Type-On Expression

    You could try something like this (the end time will be approximate, because of the randomness):

    m = marker;
    t1 = m.key("start").time;
    t2 = m.key("end").time;
    n = value.length;
    rate = (t2 - t1)/n;
    charCount = 0;
    t = t1;
    seedRandom(index,true);
    while (t < time){
    charCount++;
    t += random(rate/2,rate*1.5);
    }
    value.substr(0,charCount)
Page 21 of 1081

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