Animation

v0.44 から部分的に対応しています。

VRM のアニメーション

VRM は、Animation を使わないという仕様です。

Export は Runtime では動作しません

Runtime では AnimationClip の情報を取得できないため、Export は動作しません。

Support Status

channel.path

type

import

export

translation

vec3

rotation

quaternion

scale

vec3

weights(morphTarget)

float[]

interpolation

import

export

LINEAR

STEP

CUBICSPLINE

LINEAR

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. From the UnityEditor’s toolbar, select Windows->Animation->Animation to open the Animation window

  3. Make sure the root GameObject is selected and click the Create button in the center of the Animation window for creating AnimationClip

  4. Inspectorの設定をDebugモードにしてAnimationClipのLegacyフラグをONにする

../_images/LegacyClip.png

Interpolation

  1. Set the created AnimationClip in the Animation box (Animation->Animation) in the Inspector window

  2. Add animation keys to this clip

  3. Export as the glb file from UniGLTF->Export

Notes

  1. RotationKeyのInterpolation設定をQuaternionかまたはEulerAngles(Quaternion)にすること

../_images/Interpolation.png

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_LocalPosition

vec3

localEulerAnglesRaw

未実装

m_LocalRotation

quaternion

m_LocalScale

vec3

blendShape

float[] すべての blendShape の状態をまとめて記録する

interpolation

Assets/UniGLTF/Editor/Animation/AnimationExporter.cs

unity

export

AnimationUtility.TangentMode.Linear

glTFAnimationTarget.Interpolations.LINEAR

AnimationUtility.TangentMode.Constant

glTFAnimationTarget.Interpolations.STEP

その他

glTFAnimationTarget.Interpolations.LINEAR

glTF: CUBICSPLINE == AnimationUtility.TangentMode.Free