Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How do I avoid a small jump in the first line when using a text animator?

  • How do I avoid a small jump in the first line when using a text animator?

    Posted by David Cabestany on February 11, 2020 at 11:00 pm

    I have a text layer in which the text on the 1st line writes on automatically each time a marker is passed via an expression, the text on the 2nd appears as a single line by moving from below into its final position. That is also controlled by an expression and the animation repeats itself each time a marker is passed.

    My problem is that depending on the length of the first line a small jump is noticeable in some of the lines, you can watch an example of this here:

    https://www.dropbox.com/s/nhfp7xgfp1y52o4/bumpSample.mp4?dl=0

    The 3rd text, at :04 seconds moves slightly upwards.

    The problem there is a bunch of small texts in this layer and the issue happens on some of them not all.

    So my question is is there something I can add to the expression that will compensate and prevent that slight jump?

    Below are the expressions I’m using, I think the problem lies in the offset, which because I only have two lines it stands around 50%

    Thanks in advance for your help,
    D.

    For the text source:
    txt = value;
    n = 0;
    if (thisComp.marker.numKeys > 0){n = thisComp.marker.nearestKey(time).index;
    if (thisComp.marker.key(n).time > time) n--;
    if (n > 0) txt = thisComp.marker.key(n).comment;
    }
    txt;

    1st animator, write on the 1st line of text: spd = 65; // characters per second
    n = 0;
    if (thisComp.marker.numKeys > 0){
    n = thisComp.marker.nearestKey(time).index;
    if (thisComp.marker.key(n).time > time) n--;
    }
    if (n > 0){
    t = time - thisComp.marker.key(n).time;
    dur = text.sourceText.length/spd;
    linear(t,0,dur,0,100);
    }else
    0

    2nd animator, 2nd line moving up:

    spd = 65; // characters per second
    n = 0;
    if (thisComp.marker.numKeys > 0){
    n = thisComp.marker.nearestKey(time).index;
    if (thisComp.marker.key(n).time > time) n--;
    }
    if (n > 0){
    t = time - thisComp.marker.key(n).time;
    dur = text.sourceText.length/spd;
    linear(t,0,dur,100,0);
    }else
    0

    David Cabestany replied 6 years, 3 months ago 1 Member · 1 Reply
  • 1 Reply

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