
2.1.5 制作背景切换交互动画效果
界面背景图片的滚动切换是最基础的一种动画效果表现形式,在实现过程中只需要通过背景图片的位置移动即可实现,在本节中将带领读者完成一个界面背景切换的动画效果,通过该动画效果的制作掌握基础属性的设置和操作方法。
☆实战 制作背景切换交互动画效果☆

微视频
源文件:第2章\2-1-5.aep 视频:第2章\2-1-5.mp4

素材
Step 01 打开After Effects软件,新建一个空白的项目,执行“文件→导入→文件”命令,在弹出的“导入文件”对话框中选择“素材\21501.psd”,如图2-8所示,弹出如图2-9所示的设置对话框,设置相关选项。

图2-8 选择需要导入的素材文件

图2-9 设置对话框
Step 02 单击“确定”按钮,导入PSD素材自动生成的合成,如图2-10所示。执行“文件→导入→文件”命令,在弹出的“导入文件”对话框中选择多个需要导入的素材图像,如图2-11所示。

图2-10 导入PSD素材生成的“项目”面板

图2-11 选择多个需要导入的素材文件
Step 03 单击“导入”按钮,将选中的多个素材同时导入“项目”面板中,如图2-12所示。双击“项目”面板中自动生成的合成,在“合成”窗口中打开该合成,如图2-13所示。

图2-12 选中多个素材同时导入“项目”面板

图2-13 “合成”窗口
Step 04 在“时间轴”面板可以看到该合成中相应的图层,如图2-14所示。将除“背景”图层以外的其他图层锁定,选择“背景”图层,按快捷键P,显示该图层的“位置”属性,如图2-15所示。

图2-14 “时间轴”面板

图2-15 显示“位置”属性
Step 05 将“时间指示器”移至2秒位置,单击“位置”属性前的“秒表”图标,插入该属性关键帧,如图2-16所示。将“时间指示器”移至3秒位置,在“合成”窗口中将该图层中的图像向右移至合适的位置,如图2-17所示。

图2-16 插入“位置”属性关键帧

图2-17 移动图像位置
☆提示
在“时间轴”面板中可以直接拖动“时间指示器”,从而调整时间的位置,但这种方法很难精确调整时间位置。如果需要精确调整时间位置,可以通过“时间轴”面板上的“当前时间”选项或者“合成”窗口中的“预览时间”选项,输入精确的时间,即可在“时间轴”面板中跳转到所输入的时间位置。
Step 06 在“时间轴”面板上3秒位置自动插入“位置”属性关键帧,如图2-18所示。将“时间指示器”移至2秒位置,在“项目”面板将21502.jpg素材拖入“时间轴”面板中的“背景”图层上方,在“合成”窗口中将该素材调整至合适的位置,如图2-19所示。

图2-18 在“时间轴”面板插入“位置”属性关键帧

图2-19 拖入素材图像
Step 07 选择21502.jpg图层,按快捷键P,显示该图层的“位置”属性,单击该属性前的“秒表”图标,插入该属性关键帧,如图2-20所示。将“时间指示器”移至3秒位置,在“合成”窗口将该图层中的图像向右移至合适的位置,如图2-21所示。

图2-20 插入“位置”属性关键帧

图2-21 移动图像位置
Step 08 将“时间指示器”移至5秒位置,在“时间轴”面板上单击“位置”属性前的“添加关键帧”按钮,在该时间位置添加“位置”属性关键帧,如图2-22所示。将“时间指示器”移至6秒位置,在“合成”窗口将该图层中的图像向右移至合适的位置,如图2-23所示。

图2-22 添加“位置”属性关键帧

图2-23 移动图像位置
Step 09 在6秒位置自动插入“位置”属性关键帧,如图2-24所示。将“时间指示器”移至5秒位置,在“项目”面板中将21503.jpg素材拖入“时间轴”面板的21502.jpg图层上方,在“合成”窗口中将该素材调整至合适的位置,如图2-25所示。

图2-24 “时间轴”面板

图2-25 拖入素材图像
Step 10 选择21503.jpg图层,按快捷键P,显示该图层的“位置”属性,单击该属性前的“秒表”图标,插入该属性关键帧,如图2-26所示。将“时间指示器”移至6秒位置,在“合成”窗口将该图层中的图像向右移至合适的位置,如图2-27所示。

图2-26 插入“位置”属性关键帧

图2-27 移动图像位置
Step 11 将“时间指示器”移至8秒位置,在“时间轴”面板上单击“位置”属性前的“添加关键帧”按钮,在该时间位置添加“位置”属性关键帧,如图2-28所示。将“时间指示器”移至9秒位置,在“合成”窗口将该图层中的图像向右移至合适的位置,如图2-29所示。

图2-28 添加“位置”属性关键帧

图2-29 移动图像位置
Step 12 将“时间指示器”移至8秒位置,在“项目”面板将“21501个图层”文件夹的“背景”素材拖入“时间轴”面板的21503.jpg图层上方,在“合成”窗口中将该素材调整至合适的位置,如图2-30所示。选择“背景/21501.psd”图层,按快捷键P,显示该图层的“位置”属性,单击“位置”属性前的“秒表”图标,插入该属性关键帧,如图2-31所示。

图2-30 拖入素材图像

图2-31 插入“位置”属性关键帧
Step 13 将“时间指示器”移至9秒位置,在“合成”窗口将该图层中的图像向右移至合适的位置,如图2-32所示。在“项目”面板上的21501合成上右击,在弹出的快捷菜单中选择“合成设置”选项,在弹出的对话框中设置“持续时间”为9秒,如图2-33所示。

图2-32 移动图像位置

图2-33 “合成设置”对话框
☆提示
因为时间轴动画默认是循环播放的,当播放完9秒时就会跳转到0秒位置继续播放,为了使背景图片的切换形成一个完整的连续循环,所以需要在时间轴的最后制作第一张背景图片从右侧位移入场的动画,从而实现与0秒位置的动画形成连贯性。
Step 14 单击“确定”按钮,完成“合成设置”对话框的设置。在“时间轴”面板中可以看到为相应图层制作的位置移动动画的关键帧效果,如图2-34所示。

图2-34 “时间轴”面板
Step 15 完成该背景图片切换动画效果的制作,执行“文件→保存”命令,将文件保存为“源文件\第2章\2-1-5.aep”。单击“预览”面板上的“播放/停止”按钮,可以在“合成”窗口中预览动画效果,如图2-35所示。

图2-35 预览动画效果