-
-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
default generated tsx code problems #273
Comments
I need reuse loaded gltf model and play animations of each of them at same time, default generated detail jsx component will cause warning like THREE.PropertyBinding: No target node found for track: somebone.position and stop animation use following code solve my problems const group = useRef<THREE.Group>(null) const { scene, animations } = useGLTF('url') const clone = useMemo(() => SkeletonUtils.clone(scene), [scene]) const { nodes, materials } = useGraph(clone) as GLTFResult const mixer = new THREE.AnimationMixer(clone) const actions = useAnimations(animations, group) // console.log('actions:', actions) const playClipName = 'Track' for (let index = 0; index < actions.clips.length; index++) { useFrame((_state, delta) => { return ( |
const group = React.useRef<THREE.Group>()
const { scene, animations } = useGLTF('/autonomous_robot_sweeper-transformed.glb')
const clone = React.useMemo(() => SkeletonUtils.clone(scene), [scene])
const { nodes, materials } = useGraph(clone) as GLTFResult
// actions is empty
const { actions } = useAnimations(animations, group)
// this way get correct result
const actions = useAnimations(animations, group)
maybe useAnimations version problem? tested with "@react-three/drei": "^9.106.0",
The text was updated successfully, but these errors were encountered: