Animation

Animation Slicing

Animation Clip (AnimationClip) is a combination of animations on a timeline, which can include rotations, translations, scaling, and weight animations of multiple objects. For example, walking, running, and jumping can be exported as 3 separate animation clips. The Galacean engine can choose which animation clip to play, provided that the FBX or glTF exported from the modeling software contains multiple animation clips.

To reduce communication costs, this article lists several common methods for animation slicing and exporting glTF for direct use by the Galacean engine. You can also perform functional verification through the glTF Preview page.

Blender's animation editing interface is very user-friendly, clearly visualizing the nodes affected by the animation and displaying keyframes on the timeline. Therefore, it is recommended to use Blender for animation slicing.

Blender

  1. Open Blender, import a model format supported by Blender, and then switch to the Animation Editing window:
  1. Using the "New Animation Clip" button shown above, you can quickly copy the current animation clip and then perform unique operations. If the button is not displayed, make sure the "Action Editor" is open:

For example, a new animation clip named animation_copy is created, and only the last 5 frames of the animation are retained:

image.png
image.png
image.png

The exported clip timeline must be consistent, which can be configured in two places: the bottom right corner or the output properties:

image.png
image.png
  1. Since the timeline must be consistent, you need to move the animation clips just sliced to the starting frame by dragging them:
image.png
image.png
  1. At this point, the animation slices are ready. Export them as glTF or FBX and integrate them into the Galacean engine:
image.png
image.png

Unity can also export animation slices, but it is less efficient.

Unity

Plugin: AntG-Unity-Plugin.unitypackage.zip

  1. Download the plugin.

  2. Open Unity.

  3. Double-click the plugin and Import the default selected options:

image.png

If the installation is successful, you will see an AntG option in the menu bar:

image.png
  1. Drag the FBX file that needs slicing into the asset panel:
image.png
  1. Click on the asset to bring up the animation debugging preview box. Add animation slices and adjust the timeline start and end for each slice as needed. If the animation preview appears abnormal, ensure that the Resample Curves option, which is enabled by default, is unchecked. After slicing is complete, remember to click the Apply button in the lower right corner to confirm.
image.png
image.png
  1. At this point, the animation slice resource has been created. Next, we will introduce how to export it. First, drag the resource into the node tree:
image.png
  1. Then add the Animator Component to the node:
image.png
  1. You can see that the Animator component needs to be bound to an Animator Controller resource, so we need to create a new Animator Controller resource in the resource bar:
image.png
  1. Double-click the controller resource and drag our previously created animation slice into it:
image.png
  1. The Animator Controller resource is now complete and can be bound to the Component we just created:
image.png
  1. Right-click the node and select Export AntG:
image.png
  1. At this point, the created animation slice glTF file has been exported. You can visit Galacean's glTF Viewer for functionality verification.

Was this page helpful?

On this page