ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Text writes on after it changes via markers on the comp

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
David Cabestany
Text writes on after it changes via markers on the comp
on Jan 15, 2020 at 9:06:39 pm

I'm using the expression below to have a long text change each time a marker is passed, the text is written in each marker comment.

In the same layer I have a text animator that writes the text on, much like the typewriter preset, but also driven with by an expression (expression below).

The problem is the text only writes on at the very beginning and after it only changes to what the marker has in it but without any animation

Is there a way to have it write on each time it changes without having to create different layers for it? The expression that writes on does it based on the in point of the layer.

Thanks in advance.

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;
--------

topVal=100
fadeDur = thisComp.layer("xp").effect("fadeDur")("Slider");
if (time &lt; (inPoint+outPoint)/2)
ease(time,inPoint,inPoint+fadeDur,0,topVal)
else
ease(time,outPoint-fadeDur,outPoint,topVal,0)


Return to posts index

Dan Ebberts
Re: Text writes on after it changes via markers on the comp
on Jan 15, 2020 at 9:36:27 pm

Try this for your range selector Start parameter:


spd = 10; // 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



Dan



Return to posts index

David Cabestany
Re: Text writes on after it changes via markers on the comp
on Jan 15, 2020 at 9:40:24 pm

As usual, this is perfect. All I had to do was speed it up so my sentences can complete before the next marker hits.


Thanks a lot Dan!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]