I have this code that runs the animation on the page.
new THREE.ObjectLoader().load( url, function ( loadedObject ) { loadedObject.traverse( function ( child ) { if ( child instanceof THREE.SkinnedMesh ) { mesh = child; } } ); scene.add( mesh ); skeleton = new THREE.SkeletonHelper( mesh ); skeleton.visible = false; scene.add( skeleton ); mixer = new THREE.AnimationMixer( mesh ); idleAction = mixer.clipAction( 'idle' ); walkAction = mixer.clipAction( 'walk' ); runAction = mixer.clipAction( 'run' ); actions = [ idleAction, walkAction, runAction ]; actions.forEach( function ( action ) {action.play();} ); json() }); function animated() { var mixerUpdateDelta = clock.getDelta(); mixer.update( mixerUpdateDelta ); } function json(){ requestAnimationFrame( json_end_scene ); animated() renderer.render( scene, camera ); } But there is a small problem in that for a normal conclusion it is necessary to know the exact name of the action. Which is extremely uncomfortable
idleAction = mixer.clipAction( 'idle' ); I tried to insert as in most examples
var action = mixer.clipAction( child.animations[0] ) I still do not understand what it is necessary to hook on ".animations [0]" so that it would work normally. Does anyone have any idea how to do this?