Skip to main content

Animation

Partially supported from v0.44.

Animation

VRM specification does not include the Animation.

Export does not work in Runtime

Export will not work because Runtime cannot retrieve AnimationClip information.

Support Status

channel.pathtypeimportexport
translationvec3
rotationquaternion
scalevec3
weights(morphTarget)float[]
interpolationimportexport
LINEAR
STEP
CUBICSPLINELINEAR

Export

How to Export an Animator

  1. Add an Animator component to a root GameObject
  2. Create an AnimatorController and set it in the Controller box (Animator->Controller) in the Inspector window
  3. From the UnityEditor's toolbar, select Windows->Animation->Animation to open the Animation window
  4. Make sure the root GameObject is selected and click the Create button in the center of the Animation window for creating AnimationClip
  5. Add animation keys to this clip
  6. Export as the glb file from UniGLTF->Export

How to Export an Animation

  1. Add an Animation component to a root GameObject
  2. Open the Animation window by selecting Window>Animation from the UnityEditor toolbar.
  3. Make sure that the root GameObject is selected and press the Create button displayed in the center of the Animation window to create an AnimationClip.
  4. Set the Inspector settings to Debug mode and turn on the Legacy flag of AnimationClip
Interpolation
Interpolation
  1. Set the created AnimationClip in the Animation item of the Animation component
  2. Add animation keys to this clip
  3. Output glb from UniGLTF>Export

Notes

  1. Please set the Interpolation of RotationKey to either Quaternion or Euler Angles (Quaternion)
Interpolation
Interpolation
  1. For the Animator, all edited clips can be exported. However, the Animator states are not saved
  2. Though a created Animator goes through multiple animations (Animation State Machine), the UniGLTF Importer (UniGLTF-1.25) will only import the first one

export properties

Assets/UniGLTF/Editor/Animation/AnimationExporter.cs

property
m_LocalPositionvec3
localEulerAnglesRawUnimplemented
m_LocalRotationquaternion
m_LocalScalevec3
blendShapefloat[] Record the state of all blendShapes together

interpolation

Assets/UniGLTF/Editor/Animation/AnimationExporter.cs

unityexport
AnimationUtility.TangentMode.LinearglTFAnimationTarget.Interpolations.LINEAR
AnimationUtility.TangentMode.ConstantglTFAnimationTarget.Interpolations.STEP
その他glTFAnimationTarget.Interpolations.LINEAR

glTF: CUBICSPLINE == AnimationUtility.TangentMode.Free