Version: 2017.3 (switch to 2017.4)
Animation Reference
Animator Component
Other Versions

Animation Clip

Switch to Scripting

Animation Clips are the smallest building blocks of animation in Unity. They represent an isolated piece of motion, such as RunLeft, Jump, or Crawl, and can be manipulated and combined in various ways to produce lively end results (see Animation State Machines, Animator Controller, or Blend Trees). Animation clips can be selected from imported FBX data (see FBXImporter settings for Animations), and when you click on the set of available animation clips you will see the following set of properties:

The Animation Clip Inspector
The Animation Clip Inspector

Asset-specific properties

(These properties apply to all animation clips defined within this asset).

Property: Function:
Import Animation Should any animation be imported from this asset?. If un-checked, all other options on this page are hidden and no animation is imported.
Bake Animations Animations created using IK or Simulation will be baked to forward kinematic keyframes. This option is only available for Maya, 3dsMax and Cinema4D files.
Resample Curves When enabled, animation curves will be resampled on every frame. You should enable this if you’re having issues with the interpolation between keys in your original animation. Disable this to keep animation curves as they were originally authored. This option is only available for Generic animtions, not Humanoid animations.
Import Animation Should any animation be imported from this asset?. If un-checked, all other options on this page are hidden and no animation is imported.
Anim. Compression The type of compression to use when importing the animation
- Off No Compression
- Keyframe Reduction Removes redundant keyframes
- Optimal Let unity decide how to compress. Either by keyframe reduction or by using dense format. Unity will pick the most optimal of the two.

Clip-specific properties

(These properties are set separately for each animation clip defined within this asset).

Property: Function:
Name The name of the clip.
Source Take The take in the source file to use as a source for this animation clip. (This option will not show up if there’s only one take). This is what defines a set of animation as separated in Motionbuilder, Maya and other 3D packages. Unity can import these takes as individual clips or you can create them from the whole file or a take.
Start Start frame of the clip.
End End frame of the clip.
Loop Time Enable this option to make the animation clip play through and restart when the end is reached.
        Loop Pose Enable to make the motion loop seamlessly.
        Cycle Offset Offset to the cycle of a looping animation, if we want to start it at a different time.
Root Transform Rotation
        Bake into Pose Enable to make root rotation be baked into the movement of the bones. Disable to make root rotation be stored as root motion.
        Based Upon What the root rotation is based upon.
         - Original Keeps the rotation as it is authored in the source file.
         - Body Orientation Keeps the upper body pointing forward.
        Offset Offset to the root rotation (in degrees).
Root Transform Position (Y)
        Bake into Pose Enable to make vertical root motion be baked into the movement of the bones. Disable to make vertical root motion be stored as root motion.
        Based Upon What the vertical root position is based upon.
         - Original Keeps the vertical position as it is authored in the source file.
         - Center of Mass Keeps the center of mass aligned with root transform position.
         - Feet Keeps the feet aligned with the root transform position.
        Offset Offset to the vertical root position.
Root Transform Position (XZ)
        Bake into Pose Enable to make horizontal root motion be baked into the movement of the bones. Disable to make horizontal root motion be stored as root motion.
        Based Upon What the horizontal root position is based upon.
         - Original Keeps the horizontal position as it is authored in the source file.
         - Center of Mass Keeps the center of mass aligned with the root transform position.
        Offset Offset to the horizontal root position.
Mirror Mirror left and right in this clip. (Only available for Humanoid Animations)
Additive Reference Pose When enabled, allows you to define the reference pose used as the base for the additive animation. Also, a blue marker becomes visible in the Start/End timeline editor: . You can specify the reference pose by entering a frame number in the “Pose Frame” field, or by dragging the blue marker in the timeline.
Mask The Body mask and Transform mask applied to this animation clip (see section on avatar masks).
Curves Parameter-related curves (see Curves in Mecanim).
Events Used to create a new Event on a clip (see Using Animation Events).
Motion Allows you to define a custom root motion node (see Selecting a Root Motion Node).
Import Messages Gives you information about how your animation was imported, including an optional ‘Retargeting Quality Report’.

Creating clips is essentially defining the start and end points for segments of animation. In order for these clips to loop, they should be trimmed in such a way to match the first and last frame as best as possible for the desired loop. For more on this, see the section on Looping animation clips

Animation Import Warnings

If any problems occured during the animation import process, a warning will be displayed at the top of the Animations Import inspector, like this:

The warnings do not necessarily mean your animation has not imported or will not work. It may just mean that the imported animation could look slightly different to the source animation. The detail of the warnings, if any, are displayed further down the inspector under the “Import Messages” section. The animation import warnings that you might recieve are as follows:

  • Default bone length found in this file is different from the one found in the source avatar.
  • Inbetween bone default rotation found in this file is different from the one found in the source avatar.
  • Source avatar hierarchy doesn’t match one found in this model.
  • This animation has Has translation animation that will be discarded.
  • Humanoid animation has inbetween transforms and rotation that will be discarded.
  • Has scale animation that will be discarded.

All these messages indicate that some data present in your original file was omitted when Unity imported and converted your animation to its own internal format. These warnings essentially tell you that the retargeted animation may not exactly match the source animation.

Note: Pre and post-extrapolate modes (also known as pre and post-infinity modes) other than constant are not supported by Unity, and are converted to constant when imported.

对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答