
Effect 14 弹跳文字
学习目的
掌握After Effects的script:void(0)表达式的设定与使用。
案例描述
本例主要讲解使用表达式制作文字动画。通过本例的学习,读者可以掌握使用表达式来模拟物体的弹跳效果,如图1-203所示。
学习资源路径
多媒体教学:
多媒体教学>第1章>弹跳文字.flv
案例源文件:
案例源文件>第1章>1.14>弹跳文字.aep
本例难易指数:★★★★☆

图1-203
操作流程
1 执行“合成>新建合成”菜单命令,创建一个预设的PAL D1/DV合成,然后设置“持续时间”为3秒,并将其命名为“弹跳文字特效”,如图1-204所示。

图1-204
2 执行“文件>导入>文件”菜单命令,打开本书学习资源中的“案例源文件>第1章>1.14>素材”文件,然后将素材拖曳到“时间线”上,如图1-205所示。预览效果如图1-206所示。

图1-205

图1-206
3 选择“美”图层,然后执行“图层>预合成”菜单命令,并将其命名为“美合成1”,如图1-207所示。


图1-207
4 使用“轴心点工具”将“美合成1”图层的轴心点调节到“美”字的中心点处,如图1-208所示。

图1-208
5 使用同样的方式,完成“妙”图层、“人”图层和“生”图层的合并以及轴心点的调整工作,如图1-209所示。

图1-209
6 选择“美”字图层,按P键调出其“位置”属性,为该属性添加表达式,表达式的具体内容如下。
p=10;
f=20;
m=2;
t=0.25;
Tantiao=f*Math.cos(p*time);
Weizhi=2/Math.exp(m*Math.log(time+t));y=-Math.abs(Tantiao*Weizhi);
position+[0,y]
提示
P代表的是频率的倍数,用来控制文字图层弹跳的频率。
F代表的是幅度的倍数,用来控制文字图层弹跳的高、低幅度。
M代表的是乘方,用来控制幂的数值大小。
Tantiao=f*Math.cos(p*time)代表的是一个循环变化的弹跳数值。
Weizhi=2/Math.exp(m*Math.log(time+t))代表文字图层的位置是按照次方递增值的倒数。
y=-Math.abs(Tantiao*Weizhi)代表文字图层Y轴的位置可以得到一个递减的数值;abs代表的是绝对值。(Tantiao*Weizhi)得到的数值添加一个绝对值,即正数。然后添加一个负号,这样文字从屏幕上方掉下来时会保持在画面中心且偏上的位置。
Position+[0,y]代表的是文字图层在保持X轴向不变的情况下,Y轴加上-Math.abs(Tantiao*Weizhi)的数值,使文字产生弹跳。
7 使用同样的方法,完成“妙”图层、“人”图层和“生”图层中的“位置”属性的表达式的创建。选择“美合成1”图层,执行“图层>预合成”菜单命令,如图1-210所示,最后使用同样的方法完成其他文字图层的合并。


图1-210
8 设置“妙”图层、“人”图层和“生”图层的入点。“妙”图层的入点在第5帧处,“人”图层的入点在第10帧处,“生”图层的入点在第15帧处,如图1-211所示。

图1-211
9 选择“图层1”和“背景”图层,执行“图层>预合成”菜单命令,然后把合并后的图层命名为“背景”,如图1-212所示。

图1-212
10 设置“背景”图层的“位置”和“缩放”属性的关键帧动画。在第0帧处,设置“位置”的值为(360,318);在第3秒处,设置“位置”的值为(360,288);在第0帧处,设置“缩放”的值为(118,118%);在第3秒处,设置“缩放”的值为(100,100%),如图1-213所示。

图1-213
11 选择“光01”图层,设置“缩放”和“不透明度”属性的关键帧动画。在第0帧处,设置“缩放”为(0,0%);在第6帧处,设置“缩放”为(110,110%);在第15帧处,设置“缩放”为(80,80%);在第20帧处,设置“缩放”为(0,0%)。在第0帧处,设置“不透明度”为(0,0%);在第3帧处,设置“不透明度”为(100,100%);在第12帧处,设置“不透明度”为(100,100%);在第20帧处,设置“不透明度”为(0,0%),如图1-214所示。

图1-214
12 使用同样的方式完成“光02”图层、“光03”图层和“光04”图层的“缩放”和“不透明度”属性的关键帧动画设置,如图1-215所示。

图1-215
13 设置“光01”图层、“光02”图层、“光03”图层和“光04”图层的入点。“光01”图层的入点在第1秒10帧处,“光02”图层的入点在第1秒15帧处,“光03”图层的入点在第1秒20帧处,“光04”图层的入点在第2秒处,如图1-216所示。

图1-216
14 按小键盘上的数字键0,预览最终效果,如图1-217所示。

图1-217