Animated GLB Models

GLB/glTF 2.0 models with embedded animations now work on both platforms. Three animation systems are supported:

SystemDescription
Skeletal animationBone-driven character and creature rigs (single active animation at a time; layered/blended animations not yet supported)
Morph targetsBlend-shape facial animation and shape keys
SkinningVertex-weight deformation tied to a skeleton

No new props are required. Animations embedded in the file are automatically available as named clips via the existing animation prop or ViroAnimatedComponent.

<Viro3DObject
  source={require("./character.glb")}
  type="GLB"
  position={[0, 0, -2]}
  scale={[0.5, 0.5, 0.5]}
  animation={{
    name: "Walk",
    run: true,
    loop: true,
    onFinish: () => setAnimation("Idle"),
  }}
/>

Animation names are defined by the artist in the GLB file. Multiple animations can be embedded in a single file and switched at runtime by changing the name.