Activity › Forums › Adobe After Effects Expressions › Natural Type-On Expression
-
Adam Haas
October 23, 2018 at 11:48 pmHow can I do this so it starts at the beginning of the layer and not the composition?
-
Kalleheikki Kannisto
October 25, 2018 at 8:42 amFrom earlier in this thread:
I think you just need to change this line:
t = 0;
to this:
t = inPoint;
Dan
Kalleheikki Kannisto
Senior Graphic Designer -
John Crump
October 6, 2020 at 6:44 pmThis works very well Dan, but is there a solution to make this work per word instead of per character? Thank you
-
Filip Vandueren
October 6, 2020 at 7:55 pmI think this should work for words:
words=value.match(/([^\s\u0003]*[\s+|\u0003]?)/g);
minRate = 10; // frames per character
maxRate = 20;
wordCount = 0;
t = inPoint;
seedRandom(index,true);
while (t < time){
wordCount++;
t += framesToTime(random(minRate,maxRate));
}
words.slice(0,wordCount).join(""); -
Jeff Franko
May 29, 2024 at 12:57 amHey Dan -Thank you for your incredible support to the community over the years.I have one question around this expression. What you created works perfectly, but I’m wondering how I can get more control over the start and end times (when the animation fully types out).Screenshot of code : https://share.zight.com/7KuZpxLnI thought using start and end layer markers could work, but it seems like there is an issue with how the frame rate is working and then the duration between markers but maybe there is a better way to get this level of control?
-
Dan Ebberts
May 29, 2024 at 3:07 pmYou 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) -
Jeff Franko
May 29, 2024 at 3:31 pmUnreal. Thank you so much, Dan! That works exactly as intended! Can’t thank you enough.
🤗
Reply to this Discussion! Login or Sign Up