Skip to main content

Module animator

Module animator 

Source
Expand description

Unity’s Animator side as typed data: an Avatar (the skeleton Mecanim animates, and for a humanoid the compiled muscle axes and the HumanDescription it was built from), an AnimatorController (layers, state machines, states with their blend trees and transitions, parameters). Nothing here is evaluated: it is what the files hold, in Unity’s frame (rotations as [x, y, z, w]), with the names Unity keeps only as CRC-32 hashes resolved through the object’s own name table (tos) where it has one.

Structs§

AvatarAxes
One bone’s muscle axes (Axes): its pre- and post-rotation, the sign of each axis, the limits of its rotation in radians, its length and its type.
AvatarHuman
A humanoid’s compiled data (Human): the human skeleton with its pose and axes, which skeleton bone each human bone is (bone_index, -1 for none), the proportions the retargeting uses.
AvatarSkeleton
A skeleton (Skeleton): per node its parent (-1 for a root) and its axes index (-1 for none), the CRC-32 of each node’s path, and the axes the nodes index.
BlendNode
One node of a blend tree (BlendTreeNodeConstant): its kind (0 1D, 1 simple 2D, 2 freeform directional, 3 freeform cartesian, 4 direct, as Unity numbers them), the parameters it blends by, its children and thresholds or positions, and for a leaf the clip (clip: an index of the controller’s clips, u32::MAX for none).
Condition
A transition condition (ConditionConstant): its mode (1 true, 2 false, 3 greater, 4 less, 6 equals, 7 not equal, as Unity numbers them), the CRC-32 of its parameter’s name, its threshold and, for an exit-time condition, the time.
HumanBone
One human bone of the HumanDescription: the skeleton bone it names, the human bone it is and its stated limits.
HumanDescription
What the avatar was built from (HumanDescription).
Layer
A layer (LayerConstant): the state machine it runs, the body and skeleton masks, how it blends in.
Parameter
A controller parameter (ValueConstant): the CRC-32 of its name, its kind (1 float, 3 int, 4 bool, 9 trigger, as Unity numbers them) and its place in the default values of that kind.
SelectorState
An entry or exit node of a state machine (SelectorStateConstant).
SelectorTransition
A transition out of an entry or exit selector (SelectorTransitionConstant).
SkeletonBone
One bone of the HumanDescription’s skeleton: its name, its parent’s, and its local transform.
State
A state (StateConstant): its transitions, its blend trees (one per motion set; a plain clip is a tree of one leaf), the CRC-32 of its name and path and the parameters that drive its speed, mirror, offset and time.
StateMachine
A state machine (StateMachineConstant).
Transition
A transition (TransitionConstant) of a state or from any state.
UnityAnimatorController
An AnimatorController object as stored (the compiled ControllerConstant).
UnityAvatar
An Avatar object as stored: the skeleton Mecanim animates and, for a humanoid, its muscle axes.
Xform
A transform as Mecanim stores it (xform): translation, rotation as a quaternion [x, y, z, w] and scale.

Constants§

NO_DESTINATION
What a selector transition’s stored m_Destination holds when it leads nowhere (0xFFFFFFFF, an invalid index): SelectorTransition::destination is None for it.
SELECTOR_BASE
What a destination at or above this is: a transition’s destination (and a selector transition’s) below it names a state of its machine, SELECTOR_BASE + n the selector node n (an entry or an exit).

Functions§

name_hash
The hash Unity’s Animator data names things by (a state, a layer, a parameter, a binding’s path): the CRC-32 (the zlib one) of the name’s bytes.