LIBRARY: Tutorials Reviews Interviews Editorials Features Business Authors RSS Feed

How to make a Text Stream using Expressions

COW Library : Adobe After Effects Tutorials : Joe Chao : How to make a Text Stream using Expressions
How to make a Text Stream using Expressions
Adobe After Effects Tutorial


How to make a Text Stream in After Effects 6.5 by Joe Chao

Joe Chao (Cao Jun) Joe Chao,
Jiangsu, China
©2006 Joe Chao and CreativeCow.net.

Article Focus:
In this tutorial CreativeCOW's Joe Chao demonstrates using expressions to create a text stream wrapping around a pillar. The pillar and its background are all completely made in AfterEffects.

Now, please download the project file and get started.




A little more than a month ago, I saw a post seeking some ideas about making a kind of "text stream" in Creative Cow's AE forum. The person posting said that he tried to make it with Particle Playground, but failed because the shape of the stream was too complex. I think it seems that this task is too hard for AE's particular system. I have not found any filter of AE can create a particular system warping through a certain path. Although we can bend the particulars with a boundary wall or gravity force, or distort filters, we can not make a complex-shaped stream. Later, I found that expressions might work better in creating such a stream. After making up such an effect, I felt that maybe I could write a simple tutorial and share my experience with you.

Before we get started, I want to show my gratitude to Dan Ebberts. His help was critical to my project, I couldn't have made it without him. Dan, if you are reading this tutorial, please accept my cordial thanks.

The whole scene looks like this:


Text stream


Because we mainly focus on expressions, I don't want to spend too much time on making up this scene. So just download the project file, open it, and go to the comp "textstream". I have prepared everything for you.

My main idea is to create a "guide layer". It flies through a path, which we can adjust very easily. Then, create a Text layer, it imitates the guide layer, but it often makes some random "mistakes" in imitating. Such as: speed, size, position, in point, and so on. All these mistakes can be controlled through a null layer. Thus, every time I duplicate it, it make different mistakes. When I duplicate it for tens or even hundreds of times, I can get a stream of titles!

So my job is to apply some expressions to different properties of the text layer. The expressions can make the text go after the guide layer and made some random mistakes.

First of all, we have to make a "guide". Create a solid layer, set its size as 20*20. Then, I get a problem: how can I get it to fling in a helix path from the bottom of the scene and out at top?

Adjusting its motion manually is not a bad idea, but in fact we can make it by developing some expressions. Before that let's observe a helix from different view angles:

Helix from different angles


In this chart, I identified some variables, and they have been marked in the charts above:

Vel1: outward velocity
Vel2: rotation velocity
Vel3: upward velocity
Radius: Radius of the helix's bottom
Angletemp: angle at a certain time
Radiustemp: Radius at a certain time

With little trigonometry we can get the position of the guide layer at any time:

X position: -Math.cos(angletemp)* radtemp
Y position: -vel3*time
Z position: Math.sin(angletemp)* radtemp

That's it! Now we can develop the expressions of the path, add these expressions to position property of "guide":

vel1=20; // outward velocity
vel2=40; // rotation velocity
vel3=50; // upward velocity
radius=30; // Radius of the helix's bottom
radtemp=radius+vel2*time; // Radius at a certain time
angletemp=vel1*time; // angle at a certain time
a= -Math.cos(angletemp)* radtemp; // X position
b= -vel3*time; // Y position
c=Math.sin(angletemp)* radtemp; // Z position
[a,b,c] //output the position


These expressions are based on the requirement that the bottom center of the helix is at (0,0,0), but it is not the truth. So I created a solid layer, named it "center", converted it into 3D layer. Then, adjust the last line of the expression to:

[a,b,c]+thisComp.layer("center").position //output the position

Now we can control the motion of the guide layer by moving the "center" layer and adjusting the variables. Adjust them until you feel satisfied with the motion path.

Convert the expressions to keyframes by the menu "animation/keyframe assistant/convert expression to keyframes".

Change the expressions to: loopOut(type = "cycle", numKeyframes = 0). Now, our guide layer has been able to work perfectly. It flies around the pillar again and again. That's just what we want.

Since the guide layer is ready, our next step is to create the text.

Create a text layer, input any text you like, that doesn't matter. (I inputted "title"). Convert it into a 3D layer. Adjust its size & font.

Secondly, we are going to develop some expressions to make the titles be able to imitate the guide layer. Go to the position property of the title layer, and try adding this expression:

thisComp.layer("guide").position.valueAtTime(time)

It works well. Then we will have to let it make mistakes.

  1. Random speed:
    Suppose that one layer has a new speed and it takes the layer certain time (new time) to cover the distance on which the guide spends certain time (original time).
    Thus: timerate = new time/original time
    If the current time is "time", where should our title be? The position must equal to the position of "guide" at "timerate*original time".
    Then, the expression for position has been developed to:
    when=time*timerate
    thisComp.layer("guide").position.valueAtTime(when)
    Thus, as long as we set the variable "timerate" a random value, the title layer can have a random speed. So add this line for it:
    timerate=random(0.2,5)

  2. Random start time
    Suppose the all the titles are "latetime"'s later, and the time variable "latetime" have random values, than we can adjust the expression above into:
    n=index;
    seedRandom(n, timeless = true); //make different layers have different seed
    timerate=random(0.8,1.25); //add a random factor in speed
    latetime= random(0,10); // add a random factor in emitting the particulars
    when= (time-latetime)*timerate;
    thisComp.layer("guide").position.valueAtTime(when) //out put the position
    now, select the title, set its auto-rotation property to "orient along path".

    Try duplicating the title about 100 times. Yes, or 50~100 times. Then you will be able see such a result.

    Text Wrapping


    Interesting? The titles are moving along the path in random speed & order. Next we are going to add more random factors into their motions.

  3. Random offset:
    Create these expressions:
    xoffset=random(-20, 20);
    yoffset= random(-20, 20);
    zoffset= random(-20, 20); //these offsets can affect the thickness of the stream
    adjust the last line into:
    thisComp.layer("guide").position.valueAtTime(when)+[xoffset, yoffset, zoffset]

  4. Random path
    To let different titles have different paths, I think the expression wiggle can work in this case. But unfortunately, it seems that "wiggle. thisComp.layer("guide").position.valueAtTime(when)" can't work well. Dan advised me to appeal to "wiggle" itself. With his help, I got this expression for position property:
    thisComp.layer("guide").position.wiggle(amp, freq, 1, .5, when)+ [xoffset, yoffset, zoffset]

  5. Scale
    Add these expressions to Scale property:
    n=index;
    seedRandom(n, timeless = true);
    temp=random(min, max);
    [temp,temp,temp]

  6. Etc
    In the paragraph about random start time, I added some random factors into the start time of the titles. Since the guide are making a looping animation. I think the length of the guide's animation can work well as the maximal value of "latetime". So if we let expressions control the maximal value of the random "latetime" is better. Thus, we can develop this line into:

    looptime=thisComp.layer("guide").position.key(thisComp.layer("guide").position.numKeys).time;
    latetime= random(0,looptime);
    Thus, the data of maximal random value can get updated automatically.

    Similar as the "freq" in "Random path". "Freq" means "how many times every second", if we replaced it with "freq/looptime", it would become "how many times every cycle". It might make our work simple if we have to adjust the path again and again.

  7. Text
    Apply these expressions to "source text" property:
    n=index;
    seedRandom(n, timeless = true); //make different layers have different seed
    myText = ["After Effects",
    "Encore DVD",
    "Photoshop",
    "Premiere Pro",
    "Final Cut Pro",
    "Motion",
    "Broadcast",
    "Commotion",
    "Cinema 4D",
    "Particle Illusion"]; // make up a list of titles
    myIndex = Math.floor(random(myText.length)); //count the number of the titles in the list
    myText[myIndex] // random pick up a title


  8. Control
    With all expressions above, we have been able to create a stream of titles. What we need to do is just to duplicate the title layer for 50~100 times. But if you need to adjust the factor after that, you might have trouble in opening all the layers and update the variables' values. So we need something to administrate all these factors.

    My idea is create a Null layer and apply "expression controls" filters to control them. Let's take the max & min value of Scale property for example.

    Create a null layer named "control". Apply effects/expression controls/slider control to it. Rename the filter as "scalemin", change the slider range into 0~100. Duplicate this filter and rename it as "scalemax", Go to the expressions of scale property. Adjust them into:
    n=index;
    seedRandom(n, timeless = true);
    scalemin =thisComp.layer("control").effect("scalemin")("Slider");
    scalemax =thisComp.layer("control").effect("scalemax")("Slider");
    temp=random(scalemin, scalemax);
    [temp,temp,temp]

    Now, we can adjust the scale of all the titles with this slider at any time. We can also adjust all other factors in the same way. In my project file, I made a lot of sliders to take control of many other factors.

  9. Random color
    Add text animation for the title, apply these expressions to fill color property:
    n=index;
    seedRandom(n, timeless = true);
    r=random(0,1);
    g=random(0,1);
    b=random(0,1);
    [r,g,b,1]

    BTW, you can also add some other text animations for the titles.

  10. Orient along path
    In my case, I found an odd thing, that sometimes "orient along path" could work well. I think it might because there are some little jags along the path. Sometimes, the title, which should "orient along path", rotates like mad! So, I developed these expressions for orientation property:

    lookAt(position.valueAtTime(time), position.valueAtTime(time+1/25))

    BTW, if your "orient along path" worked well, these expressions are not necessary.


At last, after finishing all the steps above, we have only one thing to do: duplicate, duplicate, duplicate, duplicate, duplicate, duplicate, duplicate, duplicate………keep duplicating until you get enough titles. If there is anything you are unsatisfied with, just adjust the responsible sliders.

Here are my results:


Results!


Amazing animation


Nice? We at last go through so much trouble for this effect, but I think if we use these techniques for more animations, we can surely get more amazing animations.

Feel free to ask questions or make comments in the After Effects forum at CreativeCOW.



If you found this page from a direct link, please visit our forums or read other articles at CreativeCOW.net







Related Articles / Tutorials:
Adobe After Effects
What Are Adobe Motion Graphics Templates?

What Are Adobe Motion Graphics Templates?

A Motion Graphics Template, referred to as a MOGRT, is an animated sequence that is self-contained and can be used in Adobe Premiere Pro, Adobe Premiere Rush and Adobe After Effects, combining graphics, text, audio and video files, as well as vector or still images (including logos), to create a still or animation that can then be customized by the MOGRT user. The result is a dynamic creative tool that provides design freedom and is consistent to its users across apps and devices. Reuse, share, and even sell them!


Rod Harlan
Adobe After Effects
Compositing Secrets Everyone Can Use Pt. 4 - Advanced Alphas

Compositing Secrets Everyone Can Use Pt. 4 - Advanced Alphas

When most people hear the words "alpha channels", they think "transparency", but that's not exactly accurate. The truth is more complex, and a quite bit more interesting! Join longtime VFX artist, editor, software developer, and business owner Simon Ubsdell for Part 4 of the best look behind the technology of compositing that you've ever seen, packed with practical advice for applying the secrets of alpha channels that's simply not possible before understanding these underlying principles. No matter which applications you're using for editing, compositing, or visual effects, this one is a must-see!

Tutorial
Simon Ubsdell
Adobe After Effects
Compositing Secrets Everyone Can Use: Pt. 3 - Alpha Channels

Compositing Secrets Everyone Can Use: Pt. 3 - Alpha Channels

When most people hear the words "alpha channels", they think "transparency", but that's not exactly accurate. The truth is more complex, and a quite bit more interesting! Join longtime VFX artist, editor, software developer, and business owner Simon Ubsdell for Part 3 of the best look behind the technology of compositing that you've ever seen, packed with practical advice for applying the secrets of alpha channels that's simply not possible before understanding these underlying principles. No matter which applications you're using for editing, compositing, or visual effects, this one is a must-see!

Tutorial
Simon Ubsdell
Adobe After Effects
Compositing Secrets Everyone Can Use 2: Advanced Blend Modes

Compositing Secrets Everyone Can Use 2: Advanced Blend Modes

Whether you're a full-time compositor and VFX artist, an editor working in one of the many NLEs that supports Blend Modes (including Adobe Premiere, Apple FCP and FCPX, Avid Media Composer, DaVinci Rsolve, and VEGAS Pro), or whether you just want the additional graphics power that comes with insight into the secret world of pixels, this is the tutorial for you! Join longtime VFX artist, editor, software developer, and business owner Simon Ubsdell for Part 2 of the best look behind the technology of blend modes that you've ever seen, with some practical steps you can start taking today to make your work look better than ever.

Tutorial
Simon Ubsdell
Adobe After Effects
Compositing Secrets Everyone Can Use: Pt. 1 - Blend Modes

Compositing Secrets Everyone Can Use: Pt. 1 - Blend Modes

Join longtime VFX artist, editor, software developer, and business owner Simon Ubsdell for the best look behind the technology of blend modes that you've ever seen. This isn't just for graphics and VFX, but for video editors too -- anyone who puts anything together, and wants to learn more about HOW images combine at the most basic level, in a way that applies to every application you might use, whether Adobe Premiere Pro, Apple FCPX, Avid Media Composer, DaVinci Resolve, VEGAS Pro, and yes, graphics and VFX programs like After Effects, Motion, Fusion, Nuke, Scratch, and many more.

Tutorial
Simon Ubsdell
Adobe After Effects
Disintegration VFX in Adobe After Effects

Disintegration VFX in Adobe After Effects

Join VFX guru Tobias Gleissenberger of Surfaced Studio for a classically energetic Adobe After Effects tutorial combining difference mattes, displacement maps, edge glows, and compositing tricks to dissolve (or explode!) one element in your frame while leaving the rest alone.

Tutorial
Tobias Gleissenberger
Adobe After Effects
Adobe After Effects: Common QT & Export Problems & Solutions

Adobe After Effects: Common QT & Export Problems & Solutions

Problems with Adobe After Effects? Can't import or export QuickTime videos? Exports too big? Missing codecs? AE guru and VFX whiz Tobias Gleissenberger of Surfaced Studio has the answers you're looking for to make every project come to completion more smoothly, including a comparison of exported file sizes for common codecs.

Tutorial
Tobias Gleissenberger
Adobe After Effects
Fancy Title Animations In Adobe After Effects -- FAST!

Fancy Title Animations In Adobe After Effects -- FAST!

Follow along as VFX guru Tobias Gleissenberger shows you how how to quickly create professional-looking animated text elements using the free presets that are included with Adobe After Effects, customizing them to suit your needs. Tobias will also show you how to apply masks to your text layers to have them appear from behind other elements.

Tutorial
Tobias Gleissenberger
Adobe After Effects
Remove People from Moving Video in After Effects with Mocha

Remove People from Moving Video in After Effects with Mocha

Learn how to remove a person from a moving video using the Remove module of the Mocha Pro plug-in for Adobe After Effects! In one of his most epic tutorial's yet, Surfaced Studio's Tobias Gleissenberger then adds a bonus Beam Up effect using some of the great filters from the Boris Continuum and Sapphire collections.

Tutorial
Tobias Gleissenberger
Adobe After Effects
Basic Clone Effect Interaction - After Effects Tutorial

Basic Clone Effect Interaction - After Effects Tutorial

Want to take your CLONE EFFECT to the next level? Want to know how to make your clones INTERACT? Tobias Gleissenberger shows you how.

Tutorial
Tobias Gleissenberger
MORE
© 2019 CreativeCOW.net All Rights Reserved
[TOP]