Version:

使用变形目标使角色变形

变形目标是以一系列顶点位置存储的变形网格。变形目标也称为混合形状或顶点级变形。您可以使用变形目标对角色的面部进行变形,以制作面部表情动画,也可以使用变形目标对角色的身体部位进行变形,以修正不想要的皮肤变形。您还可以模拟角色身上衣服的变形。

动画编辑器中,您可以将变形目标与下列节点之一结合使用:

  • Motion节点–播放变形目标动画与骨骼动画类似。
  • Motion Target 节点 - 播放变形目标动画,与骨骼动画类似。

先决条件

要在动画编辑器中使用变形目标,您必须执行以下操作:

主题

导入 Morph Targets

当您将.fbx文件导入 O3DE 时,该文件中的所有变形目标和变形目标动作都将作为Actor的一部分导入。这样您就可以在动画编辑器中打开Actor文件,而无需额外的步骤。

您还可以改变形态目标的导入方式。

更改变形目标的导入方式

  1. Asset Browser中,右键单击您的.fbx文件并选择Edit Settings

Choose the Edit Settings option for your .fbx file in the Asset Browser.

  1. FBX 设置窗口中,单击 “Actors”选项卡。

    此时会出现一个修饰符,表示将导入变形目标。

  2. 单击Select morph targets字段旁边的按钮。

Click the Select morph targets button on the Actors tab in the FBX Settings window.

  1. Select nodes窗口中,选择要导入的变形目标,然后点击Select

Select the morph targets to import in the Select nodes window.

  1. FBX Settings窗口中,单击Update保存更改。

更改目标动作的导入方式

  1. 资产浏览器中,右键单击您的.fbx文件并选择Edit Settings

  2. FBX Settings窗口中,单击Motions选项卡。

    注意:
    如果您的 .fbx文件中有变形目标动画,则会出现一个修饰符,表示将导入变形目标动作。如果您不希望在.motion文件中包含变形目标动画,可以移除该修饰符。

Motions tab in the FBX Settings window.

  1. 点击 Update 保存更改。

打开 Actor 文件

动画编辑器中打开Actor文件时,默认情况下会导入所有变形目标和变形目标动作。要改变形态目标的导入方式,请参阅 导入变形目标

打开Actor文件

  1. 在 O3DE 编辑器中,选择ToolsAnimation Editor

  2. 动画编辑器中,选择FileOpen Actor

  3. Pick EMotion FX Actor窗口中,选择一个要导入的Actor,然后单击OK

Choose an actor to import in the Pick EMotion FX Actor window.

预览Actor的变形目标

您可以预览Actor身上的变形目标。

预览变形目标

  1. 在 O3DE 编辑器中,选择ToolsAnimation Editor

  2. 动画编辑器中,选择ViewMorph Targets

  3. Morph Targets窗口中,通过以下操作预览Actor身上的变形目标形状:

  4. 选择Select All复选框。

    如果启用,变形目标滑块将覆盖Actor身上的变形目标动作。

  5. 移动变形目标名称旁边的滑块,查看Actor的网格变形。

Preview morph target shapes on your actor in the Morph Targets window.

  1. 点击变形目标旁边的Edit,根据需要调整滑块的范围。默认范围为01

Adjust the minimum and maximum value range for the morph target.

  1. 预览完变形目标后,清除Select All复选框并关闭Morph Targets窗口。

使用变形目标创建动作节点

使用变形目标创建动作节点与其他生成动作节点的方法类似。

使用变形目标创建动作节点

  1. 动画编辑器中,在Motion Sets选项卡的Motion Set Management下,执行以下操作之一:
  • 单击 + 图标创建动作集。
  • 单击文件夹图标,打开Pick EMotion FX Motion Set 窗口,选择要导入的动作集。单击OK

Choose a motion set to import in the Pick EMotion FX Motion Set window.

  1. Anim Graphs窗格中,单击**+**图标创建动画图表。

Create an animation graph in the Anim Graphs pane.

  1. Anim Graph PaletteSources选项卡中的Motion节点拖动到动画图形中。

Drag the Motion node to the animation graph.

  1. 在动画图形中,选择已添加的 Motion 节点。

Anim Graph tab in the middle pane of the Animation Editor.

  1. Attributes窗格中,单击Select motions

Select motions button in the Attributes pane of the Animation Editor.

  1. Motion Selection窗口中,选择要导入的带有变形目标的动作,然后点击OK

创建变形目标节点

除了创建带有变形目标的动作节点外,您还可以使用Morph Target节点来直接对动画图形中的变形目标进行动画操作。

创建变形目标节点*

  1. 动画编辑器中,将Blend Tree节点从Anim Graph PaletteSources选项卡拖到动画图中。

  2. 在动画图中,双击Blend Tree节点。您应该会在Anim Graph Palette中看到一个Final Node节点和其他节点。

Blend Tree node and additional nodes in the Anim Graph Palette.

  1. Anim Graph PaletteBlending选项卡中拖动Morph Target节点到动画图形中。

  2. 执行以下操作添加一个绑定姿势作为输入姿势:

  3. Anim Graph PaletteSources选项卡中拖动Bind Pose节点到动画图。

  4. Bind Pose节点的Output Pose连接到Morph Target节点的Input Pose

  5. 执行以下操作以添加参数来控制变形目标的权重:

  6. Anim Graph PaletteSources选项卡上的Parameters节点拖动到动画图上。

  7. Parameters窗格中,单击 + 图标创建参数。

Parameters pane in the Animation Editor.

  1. Create Parameter 窗口中,完成以下事项:

    1. 对于 Value Type,选择 FloatSlider

    2. 对于 MinimumMaximum,使用默认值。

    3. 点击 Create

    Create Parameter window in the Animation Editor.

  2. 在动画图形中,执行以下操作:

    1. Parameter节点的ParameterMorph Target节点的Morph Weight相连。

    2. Morph Target节点的Output Pose连接到Final Node节点的Input Pose

    Example animation graph that shows the connection between the Parameter node, Morph Target node, and Final Node node.

  3. 在动画图表中,选择 Morph Target 节点,如果还没有被选择。

  4. Attributes面板中,点击select morph targets

Click the select morph targets button in the Attributes pane.

  1. Morph target selection 窗口,选择要导入的变形目标,然后点击 OK

Morph target selection window to import a morph target.

变形目标会在动画图中的Morph Target节点和Attributes窗格中更新。

Morph target updated in the Morph Target node and Attributes pane.

  1. Anim Graphs 窗格,双击名称激活动画图形。

  2. Parameters 窗格,移动滑块播放动画。

Move the parameter slider to play the morph target animation.