import { AnimationMixer } from 'three' import { Ref } from 'vue' export function useAnimationMixer() { const mixer: Ref = ref(null) function generateActionsFromAnimations(animations: Animation[]) { return animations.reduce((prev, animation) => { prev[animation.name.toLowerCase()] = mixer.value.clipAction(animation) return prev }, {}) } return { mixer, generateActionsFromAnimations, } }