useAnimation
en un composable que desvuelve un shallowReactive
con todas las acciones de los modelos en base de las animaciones proveídas. Es un wrapper sobre la clase AnimationMixer.
import { useAnimations } from '@tresjs/cientos'
const { scene: model, animations } = await useGLTF('/models/ugly-naked-bunny.gltf')
// Animations [ { name: 'Greeting'}, { name: 'Idle' } ]
const { actions, mixer } = useAnimations(animations, model)
let currentAction = actions.Greeting
currentAction.play()