ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Natural Type-On Expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Navarro Parker
Natural Type-On Expression
on Jul 16, 2013 at 8:22:14 pm

The old text animator Typewriter preset is great. However, it types at a constant cadence like a dot matrix printer.

Is there a way to make a more natural type-on that emulates a human typing? Maybe something with variable micro-pauses between letters and a different variable micro-pause between words?


Return to posts index


Dan Ebberts
Re: Natural Type-On Expression
on Jul 16, 2013 at 10:07:33 pm

Here's a Source Text expression you could play around with:


minRate = 3; // frames per character
maxRate = 6;

charCount = 0;
t = 0;
seedRandom(index,true);
while (t < time){
charCount++;
t += framesToTime(random(minRate,maxRate));
}
value.substr(0,charCount)


Dan



Return to posts index

Mitch Mann
Re: Natural Type-On Expression
on Jul 17, 2013 at 10:41:06 am

I was thinking of some kind of wiggle expression for this. I tried your solution, Dan, and its great!


Return to posts index


Navarro Parker
Re: Natural Type-On Expression
on Jul 17, 2013 at 4:09:27 pm

As usual, works great Dan!


Return to posts index

Dovi Shraga
Re: Natural Type-On Expression
on Dec 20, 2013 at 2:09:09 pm

Hi Dan!

This looks just like what I'm looking for. The problem is I can't figure out where this code goes (Range Selector 1 -> Strat?). I'd be happy if you're willing to elaborate on that a little.

Thanks!
Dovi


Return to posts index

Dan Ebberts
Re: Natural Type-On Expression
on Dec 20, 2013 at 5:23:43 pm

It's an expression for the Source Text property.

Dan



Return to posts index


Dovi Shraga
Re: Natural Type-On Expression
on Dec 20, 2013 at 11:14:36 pm

I got that, but couldn't get it to work. What I did was alt+click on the stopwatch near "Source Text" and then pasted your code. When I moved the cursor to see what's happening, I saw nothing. I've also tried to disable the Typewriter effect but that didn't help either.


Return to posts index

Dan Ebberts
Re: Natural Type-On Expression
on Dec 20, 2013 at 11:20:26 pm

1. Create a new text layer with your desired text.
2. Alt+click the Source Text stopwatch.
3. Paste this in:


minRate = 3;
maxRate = 6;
charCount = 0;
t = 0;
seedRandom(index,true);
while (t < time){
charCount++;
t += framesToTime(random(minRate,maxRate));
}
value.substr(0,charCount)


That should do it. No Typewriter effect necessary.


Dan



Return to posts index

Lance Clayton
Re: Natural Type-On Expression
on May 10, 2016 at 4:29:45 am

Thanks Dan.

However, this does seem to only work when the layer starts at the beginning of the comp. When further down the timeline all letters appear at once.

Is there some parameters that can be added to allow the expression to start at the beginning of the layer no matter how far down the timeline it is? (or will I have to precomp).

Thanks

Lance


Return to posts index


Dan Ebberts
Re: Natural Type-On Expression
on May 10, 2016 at 5:27:32 am

I think you just need to change this line:

t = 0;

to this:

t = inPoint;


Dan



Return to posts index

Marcelo Cabral
Re: Natural Type-On Expression
on Oct 1, 2017 at 3:11:43 pm

Hi Dan
This expression works awesome as type on effect. I have a text with this expression inside a composition ("text") nested in another composition ("chat"). In this composition, I have an adjustment layer with a mark called "start". I was wondering if there is some way to make this text expression start with that mark. Thank you in advance

minRate = 1;
maxRate = 2;

charCount = 0;
t = inPoint;
seedRandom(index,true);
while (t &lt; time){
charCount++;
t += framesToTime(random(minRate,maxRate));
}
value.substr(0,charCount)


Return to posts index

Dan Ebberts
Re: Natural Type-On Expression
on Oct 1, 2017 at 5:05:18 pm

Something like this probably:


minRate = 1;
maxRate = 2;

C = comp("chat");
L = C.layer("Adjustment Layer 1");
t = L.marker.key("start").time - C.layer(thisComp.name).startTime;
charCount = 0;
seedRandom(index,true);
while (t < time){
charCount++;
t += framesToTime(random(minRate,maxRate));
}
value.substr(0,charCount)



Dan



Return to posts index


Marcelo Cabral
Re: Natural Type-On Expression
on Oct 1, 2017 at 6:26:32 pm

Hi Dan, It works perfectly. Unfortunately, I have to change some stuff. Instead of referring a name mark I have to refer to several marks in the layer without numbers or names because I have to place several text layers in the final composition all referring to the same layer marks in the outside composition. Is that possible? Thank you, I appreciate your support, Dan.

Marcelo


Return to posts index

Dan Ebberts
Re: Natural Type-On Expression
on Oct 1, 2017 at 6:37:07 pm

Sorry, I'm not understanding what you're describing.

Dan



Return to posts index

Marcelo Cabral
Re: Natural Type-On Expression
on Oct 1, 2017 at 6:58:40 pm

Hi Dan
This part of the expression
t = L.marker.key("start").time - C.layer(thisComp.name).startTime;
is referring one named mark in a layer of an external composition.



What I need is the expression works without using a "name" of the mark, just the mark. So that way I can use several text layers with the expression and they will be activated when I add more marks to the layer.

Thank you again


Return to posts index


Dan Ebberts
Re: Natural Type-On Expression
on Oct 1, 2017 at 7:02:51 pm

How does the expression know which marker to use?

Dan



Return to posts index

Marcelo Cabral
Re: Natural Type-On Expression
on Oct 1, 2017 at 7:09:16 pm

You completely right, Dan. I will use mark names, that will be better. Thank you again.
Marcelo


Return to posts index

Dan Ebberts
Re: Natural Type-On Expression
on Oct 1, 2017 at 7:21:55 pm

If you're going to modify each expression, you could also just use the marker index, like this:

t = L.marker.key(3).time - C.layer(thisComp.name).startTime;

for example.

Dan



Return to posts index


Marcelo Cabral
Re: Natural Type-On Expression
on Oct 1, 2017 at 7:45:50 pm

That will better Dan. Thank you.


Return to posts index

Marcelo Cabral
Re: Natural Type-On Expression
on Oct 1, 2017 at 7:23:21 pm

Last question Dan.
In the same way, how can I set up the opacity of a layer (100/0 or on-off) using a named mark in a layer of an external composition. The same like the text but only for opacity property. Thank you.

Marcelo


Return to posts index

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