Version:

动画编辑器入门

请参阅以下程序,开始使用 ** 动画编辑器**。

在此过程中,您需要执行以下操作:

  • 导入Actor文件并创建动作集,为角色指定所需的动作。
  • 使用节点创建基本动画图。
  • 创建一个混合树来组合动作,并使用滑块控制角色从空闲到行走再到奔跑的运动。

第 1 步: 创建一个动作集

在以下步骤中,您将导入角色、为机器人插孔、选择所需的动作,然后将这些动作添加到动作集中。

创建一个动作集

  1. 在 O3DE 编辑器,选择 Tools, Animation Editor

  2. 在动画编辑器中,选择 Layouts, AnimGraph

  3. Animation Editor 中,选择 File, Open Actor 并导航到 AnimationSamples\Simple_JackLocomotion 目录。

  4. 选择 JackBind_ZUp.fbx 文件,然后点击 OK

    您的角色 Jack 将出现在动画编辑器中。

    Import the JackBind_ZUp.fbx file into the Animation Editor.

  5. Motion Sets 标签页上,在 Motion Set Management下,点击 + 图标添加动作集。

  6. 选择 MotionSet0 节点。

  7. Motion Set 面板中,点击文件夹图标添加动作。

  8. 导航到 AnimationSamples/Simple_JackLocomotion 目录。并选择以下文件:

    • Jack_Idle_ZUp.fbx
    • Jack_Strafe_Run_Forwards_ZUp.fbx
    • Jack_Strafe_Walk_Forwards_ZUp.fbx
  9. 点击 OK

  10. Motion Set Management面板中,点击Save图标。

  11. 导航到/SamplesProject/AnimationSamples/Simple_JackLocomotion目录。对于文件名,输入quickstart,然后点击Save 保存 quickstart.motionset 文件。

Create a motion set and add motion files in the Animation Editor.

第 2 步: 创建一个Animation Graph

在以下步骤中,创建动画图形和节点。

创建一个Animation Graph

  1. Anim Graph标签页上,点击 + 图标创建一个Animation Graph。

  2. 点击 Save 图标。

  3. 导航到 /SamplesProject/AnimationSamples/Simple_JackLocomotion 目录。对于文件名,输入 quickstart ,然后点击 Save 保存 quickstart.animgraph 文件。

  4. Anim Graph 标签页中,右击网格,然后选择 Create Node, Sources, Motion

Create a motion node in the animation graph.

  1. 选择Motion0节点,在Attributes窗格中单击Select motions。在对话框中选择 “Jack_Idle_ZUp.fbx”,然后选择 “OK”。

  2. 右键单击网格,然后选择Create NodeSourcesBlend Tree

  3. Motion0 节点,单击并拖动一条线到 BlendTree0 节点。一条带有箭头的过渡线将节点连接起来。

  4. BlendTree0 节点,单击并拖动一条线到 Motion0 节点。

Connect the motion and blend tree nodes in the animation graph.

  1. Parameters面板中,点击 + 图标创建一个参数。

    1. Value type 参数保留为默认值,Float (slider)

    2. 对于 Name,重命名 Parameter0speed

    3. 点击 Create

  2. 在动画图表中,选择从Motion0节点连接到BlendTree0节点的过渡线。

    1. Attributes面板中,点击Add condition

    2. Select a Condition对话框中,选择Parameter Condition,然后点击Add Condition

    3. Attributes面板中,在 Parameter Condition下,点击 Select parameter 并选择 speed

    4. 对于 Test Function,保留param > testValue的默认值。这意味着,如果速度大于零,空闲运动就会过渡到混合树,角色就会开始移动。

    Add parameter conditions to specify when the character starts moving.

  3. 在动画图形中,选择从 BlendTree0 节点开始并连接到 Motion0 节点的过渡线。在动画图形中,选择从 BlendTree0 节点开始并连接到 Motion0 节点的过渡线。

    1. Attributes窗格中,单击Add condition

    2. Select a Condition对话框中,选择Parameter Condition,然后单击Add Condition

    3. Attributes窗格中,在Parameter Condition下,单击Select parameter。选择speed,然后单击OK

    4. Test Function中,选择param == testValue。这意味着,如果速度等于零,运动将转回空闲状态,角色停止运动。

      Add parameter conditions to specify when the character stops moving.

第 3 步: 混合动画

在以下步骤中,您将使用混合树节点构建混合树,将行走和运行动画混合在一起。

混合动画

  1. 在动画图形中,双击 BlendTree0 节点。

  2. 右键单击网格并选择 Create NodeSourcesMotion

  3. 选择 Motion1 节点。

    1. Attributes 面板,选择 Select motions

    2. Motion Selection Window中,选择jack_strafe_walk_forwards_zup,然后点击 OK

      Motion1 节点的属性应如下所示:

      Add the walk motion file to the Motion1 node.

  4. 在动画图形中,右键单击网格,选择Create NodeSourcesMotion

  5. 选择 Motion2 节点。

    1. Attributes面板中,点击Select motions

    2. 在对话框中,选择 jack_strafe_run_forwards_zup ,然后点击 OK

      Motion2 节点的属性应如下所示:

      Add the run motion file to the Motion2 node.

  6. 右键单击网格,选择 Create NodeBlendingBlend Two

  7. 选择 BlendTwo0 节点。

  8. Attributes 窗格中的Sync Mode,选择Full Clip Based

  9. 对于 Motion1 节点,选择 Output Pose 框,然后将连接器拖到 BlendTwo0 节点的 Pose 1 输入端。

  10. 对于Motion2节点,选择Output Pose框并将连接器拖到BlendTwo0节点的Pose 2输入端。

  11. 对于 BlendTwo0 节点,选择 Output Pose 框,然后将连接器拖到 FinalNode0 节点的 Input Pose 上。

    您的混合树应该如下所示:

    Create your blend tree in the animation graph.

  12. 右键单击网格,选择 Create NodeSourcesParameters

  13. 右键单击网格并选择 Create NodeMathSmoothing

  14. 对于 Parameters0 节点,选择 speed 输出框,并将连接器拖到 Smoothing0 节点的 Dest 输入框。

  15. 对于 Smoothing0 节点,选择 Result 输出框,并将连接器拖至 BlendTwo0 节点的 Weight 输入框。

    您的混合树应该如下所示:

    Create a blend tree for your animation graph.

  16. 动画编辑器中,选择FileSave All。然后在对话框中点击OK

  17. 导航至/SamplesProject/AnimationSamples/Simple_JackLocomotion目录。在文件名中输入 quickstart,然后单击Save保存工作区。

  18. Anim Graph选项卡中,单击Play按钮。现在角色应在空闲模式下显示动画。

  19. Parameters窗格中,将speed滑动控制向右移动,使杰克行走。再向右移动滑块,使杰克跑起来。