Hello friends. i have a hard question))
I make model in Blender (fbx), then i load this model to mixamo.com and did the animation. Then i save this file on PC (fbx). In my project i load model:
var loader = new THREE.FBXLoader();
loader.load( 'models/new/robot.fbx', addObj)
function addObj(object) {
object.mixer = new THREE.AnimationMixer( object );
mixers.push( object.mixer );
playerRun = object.mixer.clipAction( object.animations[ 0 ] );
playerRun.play();
scene.add( object );
}
function anim() {
var deltaAnim = clockAnim.getDelta();
if ( mixers.length > 0 ) {
for ( var i = 0; i < mixers.length; i ++ ) {
mixers[ i ].update( deltaAnim );
}
}
}
Its OK, but this only one animation in 1 object. How to make many animations in one object.
For example this my object width one animation
This object i find in WEB and in this many animations
This object i find in WEB and in this many animation
What object? Was it an FBX file?
In general FBX files only store a single animation. Some programs such as MotionBuilder can export FBX files with multiple animations but Mixamo cannot. As far as I know blender cannot either.
var model = gltf.scene;
var mixer = new THREE.AnimationMixer( model );
var action = mixer.clipAction( gltf.animations[0] );
// Play one animation
action.play();
// Play all animations
gltf.animations.forEach( function ( clip ) {
mixer.clipAction( clip ).play();
} );