本教程由ChinaVFX.NET翻译整理
动画部分
点击这里下载场景文件

1.上一节我们做了带变形贴图的履带模型,接下来,我们将要在 Layout 中使用 morphmixer 和表达式来制作动画。将模型导入 Layout。

2.首先我们来测试一下物体的变形是否能够正常执行。选择履带物体,按"p"键打开它的 Object Properties 窗口,在Deformations 面板中添加一个 Morphmixer。

4.现在测试一下变形:双击"mixing 1 MORPHs in 1 group",弹出 endomorph mixer 对话框,慢慢拖动控制变形的滑竿,你可以看到履带在场景中转动。

测试OK,接下来我们要做的,是通过表达式工具,让履带物体在向前移动的同时不断的重复这个变形,就好像在向前行走一样。
5.在上一节中我们测量了两个履带板的间距为253.8378mm,也就是说,履带完成一个变形过程将向前移动253.8378mm。
表达式将编写为:
(A/0.2538) % 1.0
A = move_null.pos(Time).x - master_null.pos(Time).x
表达式的含义是:
A:履带移动的距离
0.2538:履带板的间距
%1.0:将数值转换成百分比
从表达式中可看出 A 函数是通过两个空物体的差来得到履带移动的数值,下面我们来钱夹着两个空物体
6.通过"add/add null"添加一个空物体名为"master_null"(位于坐标原点的空物体,作为参照物)。
同理添加另一个名为"move_null"的空物体,选择履带物体,按"m"键打开"motion options"面板,在"Parent Item"下拉条中选择"move_null"作为父物体。

7.现在我们来为履带加入表达式。选择履带物体,再次打开"properties/deformation/morphmixer",点击面板下方的 graph 按钮打开 Motion graph editor。面板左上的 Channel 中显示的为我们将要使用表达式进行控制的通道。如图在 modifier 子面板中添加一个 LW_Expression 表达式修改器。

8.双击 LW_Expression 弹出表达式输入对话框。如图输入在教程第5步时编写的表达式,点击"test expression"按钮检查表达式的正确性,点击 continue 按钮关闭对话框。
9.关闭所有面板,选择 move_null,沿 x 轴移动它,你可以看到履带跟随着空物体转动前进。
点击这里观看动画效果
