Version: 2023.1
Language : English
Human Template window
Euler curve resampling

Animation tab

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 MachinesA graph within an Animator Controller that controls the interaction of Animation States. Each state references an Animation Blend Tree or a single Animation Clip. More info
See in Glossary
, Animator ControllerControls animation through Animation Layers with Animation State Machines and Animation Blend Trees, controlled by Animation Parameters. The same Animator Controller can be referenced by multiple models with Animator components. More info
See in Glossary
, or Blend Trees). You can select Animation Clips from imported FBX data.

When you click on the model containing animation clips, these properties appear:

The Animation Clip Inspector
The Animation Clip Inspector

There are five areas on the Animation tab of the InspectorA Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. More info
See in Glossary
window:

(A) Asset-specific properties. These settings define import options for the entire Asset.

(B) Clip selection list. You can select any item from this list to display its properties and preview its animation. You can also define new clips.

(C) Clip-specific properties. These settings define import options for the selected Animation Clip.

(D) Clip properties. These settings define import options for all Animation clips.

(E) Animation preview. You can playback the animation and select specific frames here.

Asset-specific properties

Import options for the entire Asset
Import options for the entire Asset

These properties apply to all animation clips and constraints defined within this Asset:

Property: Function:
Import Constraints Import constraintsSettings on Joint components which limit movement or rotation. The type and number of constraints vary depending on the type of Joint. More info
See in Glossary
from this asset.
Import Animation Import animation from this asset.

Note: If disabled, all other options on this page are hidden and no animation is imported.
Bake Animations Bake animations created using IK or Simulation to forward kinematic keyframes.

Only available for Autodesk® Maya®, Autodesk® 3ds Max® and Cinema 4D files.
Resample Curves Resample animation curves as Quaternion values and generate a new Quaternion keyframe for every frame in the animation.

This option only appears if the import file contains Euler curves. This option is enabled by default.

Disable this option to keep animation curves as they were originally authored. You should only disable this option if there are interpolation issues in the resampled animation when compared with your original animation.
Anim. Compression The type of compressionA method of storing data that reduces the amount of storage space it requires. See Texture Compression, Animation Compression, Audio Compression, Build Compression.
See in Glossary
to use when importing the animation.
Off Disable animation compressionThe method of compressing animation data to significantly reduce file sizes without causing a noticeable reduction in motion quality. Animation compression is a trade off between saving on memory and image quality. More info
See in Glossary
. This means that Unity doesn’t reduce keyframeA frame that marks the start or end point of a transition in an animation. Frames in between the keyframes are called inbetweens.
See in Glossary
count on import. Disabling animation compression leads to the highest precision animations, but slower performance and bigger file and runtime memory size. It is generally not advisable to use this option - if you need higher precision animation, you should enable keyframe reduction and lower allowed Animation Compression Error values instead.
Keyframe ReductionA process that removes redundant keyframes. More info
See in Glossary
Reduce redundant keyframes on import. If enabled, the Inspector displays Animation Compression Errors options. This affects both file size (runtime memory) and how curves are evaluated.

Applies to Legacy, Generic, and Humanoid Animation Type rigs.
Keyframe Reduction and Compression Reduce keyframes on import and compress keyframes when storing animations in files. This affects only file size: the runtime memory size is the same as Keyframe Reduction. If enabled, the Inspector displays Animation Compression Errors options.

Only for Legacy Animation Type rigs.
Optimal Let Unity decide how to compress, either by keyframe reduction or by using dense format. If enabled, the Inspector displays Animation Compression Errors options.

Only for Generic and Humanoid Animation Type rigs.
Animation Compression Errors Only available when Keyframe Reduction or Optimal compression is enabled.
Rotation Error Set the error tolerance (as an angle in degrees) for rotation curve compression. Unity uses this to determine whether or not it can remove a key on a rotation curve.

This represents the minimum angle between the original rotation value and the reduced value:

Angle(value, reduced) < RotationError
Position Error Set the error tolerance (as a percentage) for position curve compression. Unity uses this to determine whether or not it can remove a key on a position curve. For more information, see Setting error tolerance for key reduction on position and scale curves.
Scale Error Set the error tolerance (as a percentage) for scale curve compression. Unity uses this to determine whether or not it can remove a key on a scale curve. For more information, see Setting error tolerance for key reduction on position and scale curves.
Animated Custom Properties Import any FBX properties that you designated as custom user properties.

Unity only supports a small subset of properties when importing FBX files (such as translation, rotation, scale and visibility). However, you can treat standard FBX properties like user properties by naming them in your importer script via the extraUserProperties member. During import, Unity then passes any named properties to the Asset postprocessor just like ‘real’ user properties.

Setting error tolerance for key reduction on position and scale curves

Set the error tolerance percentage to determine whether or not Unity can remove a key on a position or scale curve as a strategy for animation compression.

When you set the Anim. Compression property to “Keyframe Reduction” or “Optimal”, Unity compares the original curve to what the curve looks like after removing a specific keyframe and applies this test:

OriginalValue - ReducedValue > OriginalValue * percentageOfError

Unity removes a keyframe if the delta between the original value and the reduced value is less than the original value multiplied by the error tolerance percentage.

Note that the Unity compares the distances between the three curve components (that is, it compares distance(x,y,z) ), and also per component ( distance(x), distance(y), and then distance(z) ).

This example demonstrates how Unity evaluates a reduction on the y-axis using an error tolerance of 10%:

Define a position error of 10% on a simple animation of a translation on the y-axis
Define a position error of 10% on a simple animation of a translation on the y-axis

Keyframe A has a value of 11.2:

Keyframe A has a value of 11.2
Keyframe A has a value of 11.2

Keyframe B has a value of 11.1:

Keyframe B has a value of 11.1
Keyframe B has a value of 11.1

The resulting reduced curve looks like this:

The resulting reduced curve
The resulting reduced curve

Keyframe A is not reduced because:

  • The distance between the original and reduced value is D = 11.2 - 10 = 1.2.
  • The error margin is E = 10% * 11.2 = 1.12
  • D > E

Keyframe B is reduced because 11.1 - 10 < 10% * 11.1:

  • The distance between the original and reduced value is D = 11.1 - 10 = 1.11
  • The error margin is E = 10% * 11.1 = 1.11
  • D = E

Note that this method has a limitation when using high values that vary only slightly. Moving the SceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
1000 units away results in essentially the same animation but located far from 0.

High values with small variance
High values with small variance

In this case, both keyframes are reduced.

Keyframe A is reduced because:

  • The distance between the original and reduced value is D = 1011.2 - 1010 = 1.2
  • The error margin is E = 10% * 1011.2 = 101.12

Keyframe B is reduced because 11.1 - 10 < 10% * 11.1:

  • The distance between the original and reduced value is D = 11.1 - 10 = 1.11
  • The error margin is E = 10% * 1011.1 = 101.11

Higher values require a much larger difference between the original and reduced values for keyframes to remain in the reduced curve. Keyframe A has a value of 1100 and is discarded; keyframe B has a value of 1112 and remains:

Higher values require a much larger difference
Higher values require a much larger difference

Clip selection list

List of clips defined in this file
List of clips defined in this file

You can perform these tasks in this area of the Animation tab:

If you manually change properties of imported clips, Unity does not import new animation clips when the source Asset changes. For example, if you create a new clip or change a clip timing on the Animation tab, the clip list does not update even if you add clips to the FBX file from outside Unity. To view new and changed animation clips, you must add a new source take to the clip list.

Clip-specific properties

Import options for the selected Animation clip
Import options for the selected Animation clip

This area of the Animation tab displays these features:

(A) The editable name of the selected clip.

(B) The animation clip timeline.

(C) Clip properties to control looping, root motionMotion of character’s root node, whether it’s controlled by the animation itself or externally. More info
See in Glossary
extraction, curves, events and AvatarAn interface for retargeting animation from one rig to another. More info
See in Glossary
masks.

You can set these properties separately for each animation clip defined within this asset:

Property: Function:
Area A
The name of the source take
Take name
The name of the source take in the source file. Source files contain a set of source takes that are created in external 3D applications such as Motionbuilder or Autodesk® Maya®.

You can import source takes as individual Animation clips. You can also create Animation clips from a subset of frames.
Area B
The timeline editor Drag the start and end indicators on the animation timeline to define frame ranges for each clip.

Creating clips is essentially defining the start and end points for segments of animation. To define a looping clip, trim the start and end points so that the first and last frames match as best as possible. You can also zoom and scroll the timeline to be more precise.
Start Start frame of the clip.
End End frame of the clip.
Area C
Loop Time Play the animation clip through and restart when the end is reached.
Loop Pose Loop the motion seamlessly.
Cycle Offset Offset to the cycle of a looping animation, if it starts at a different time.
Root Transform Rotation
Bake into Pose Bake root rotation into the movement of the bones. Disable to store as root motion.
Based Upon Basis of root rotation.
Original Keep the original rotation from the source file.
Root Node Rotation Use the rotation of the root node.

Only available for the Generic Animation Type.
Body Orientation Keep the upper body pointing forward.

Only available for the Humanoid Animation Type.
Offset Offset to the root rotation (in degrees).
Root Transform Position (Y)
Bake into Pose Bake vertical root motion into the movement of the bones. Disable to store as root motion.
Based Upon (at Start) Basis of vertical root position.
Original Keep the vertical position from the source file.
Root Node Position Use the vertical root position.

Only available for the Generic Animation Type.
Center of MassRepresents the average position of all mass in a Rigidbody for the purposes of physics calculations. By default it is computed from all colliders belonging to the Rigidbody, but can be modified via script. More info
See in Glossary
Keep center of mass aligned with the root transform position.

Only available for the Humanoid Animation Type.
Feet Keep feet aligned with the root transform position.

Only available for the Humanoid Animation Type.
Offset Offset to the vertical root position.
Root Transform Position (XZ)
Bake into Pose Bake horizontal root motion into the movement of the bones. Disable to store as root motion.
Based Upon Basis of horizontal root position.
Original Keep the horizontal position from the source file.
Root Node Position Use the horizontal root transform position.

Only available for the Generic Animation Type.
Center of Mass Keep aligned with the root transform position.

Only available for the Humanoid Animation Type.
Offset Offset to the horizontal root position.
Mirror Mirror left and right in this clip.

Only appears if the Animation Type is set to Humanoid.
Additive Reference Pose Enable to set frame for the reference pose used as the base for the additive animation layer. A blue marker becomes visible in the timeline editor:
Pose Frame Enter a frame number to use as the reference pose. You can also drag the blue marker in the timeline to update this value.

Only available if Additive Reference Pose is enabled.
Curves Expand this section to manage animation curves for this animation clip.
Events Expand this section to manage animation events for this animation clip.
MaskCan refer to a Sprite Mask, a UI Mask, or a Layer Mask More info
See in Glossary
Expand this section to manage Avatar masking for this animation clip.

Properties for all clips

These expandable properties apply to all Animation clips being imported.

Import options for all Animation clips
Import options for all Animation clips
Property: Function:
Motion Expand this section to manage the root motion node for all imported clips.
Import Messages Expand this section to see detailed information about how your animation was imported, including an optional RetargetingApplying animations created for one model to another. More info
See in Glossary
Quality Report
.

Animation import warnings

If any problems occur during the animation import process, a warning appears at the top of the Animations Import inspector:

Animation import warning messages
Animation import warning messages

The warnings do not necessarily mean your animation has not imported or doesn’t work. It may just mean that the imported animation looks slightly different from the source animation.

To see more information, expand the Import Messages section:

Animation import warning messages
Animation import warning messages

In this case, Unity has provided a Generate Retargeting Quality Report option which you can enable to see more specific information on the retargeting problems.

Other warning details you may see include the following:

  • 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 animationAn animation using humanoid skeletons. Humanoid models generally have the same basic structure, representing the major articulate parts of the body, head and limbs. This makes it easy to map animations from one humanoid skeleton to another, allowing retargeting and inverse kinematics. More info
    See in Glossary
    has inbetween transforms and rotation that will be discarded.
  • Has scale animation that will be discarded.

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: Unity does not support pre- and post-extrapolate modes (also known as pre- and post-infinity modes) other than constant, and converts these to constant when imported.

Animation preview

Animation clip preview
Animation clip preview

The preview area of the Animation tab provides these features:

(A) The name of the selected clip.

(B) The 2D preview mode button (switches between orthographic and perspective camera).

(C) The pivot and mass center display button (switches between displaying and hiding the gizmos).

(D) The Avatar selector (change which GameObject will preview the action).

(E) The play/pause button.

(F) The playback head on the preview timeline (allows scrubbing back and forth).

(G) The animation preview speed slider (move left to slow down; right to speed up).

(H) The playback status indicator (displays the location of the playback in seconds, percentage, and frame number).

(I) The TagA reference word which you can assign to one or more GameObjects to help you identify GameObjects for scripting purposes. For example, you might define and “Edible” Tag for any item the player can eat in your game. More info
See in Glossary
bar, where you can define and apply Tags to your clip.

(J) The AssetBundles bar, where you can define AssetBundles and Variants.


AnimationClip

Human Template window
Euler curve resampling
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961