Can an animated armature1 play an animation clip of another animated armature2?

How to I need to change my code in order to have armature2 play an animation clip of armature 1?

loader.load( 'armature1.fbx', function ( object1 ) {	
					object1.mixer = new THREE.AnimationMixer( object1 );
					mixers.push( object1.mixer );
					object1.scale.set(1.0,1.0,1.0);
	
			  	       var action = object1.mixer.clipAction( object1.animations[ 3 ] );
					action.play();
				  	scene.add( object1 );
		}, onProgress2, onError ); 

loader.load( 'armature2.fbx', function ( object2 ) {	
					object2.mixer = new THREE.AnimationMixer( object2 );
					mixers.push( object2.mixer );
					object2.scale.set(1.0,1.0,1.0);
	
			  	       var action = object1.mixer.clipAction( object2.animations[ 5 ] );
					action.play();
				  	scene.add( object1 );
		}, onProgress2, onError );

Yes, but this may require the skeletons in each object to match exactly. For example:

var object1, object2;

var manager = new THREE.LoadingManager();
manager.onLoad = function () {
  var action = object1.mixer.clipAction( object2.animations[ 0 ] );
  action.play();
  object1.scale.set(1,1,1);
  mixers.push( object1.mixer );
  scene.add(object1);
};

var loader = new THREE.FBXLoader( manager );
loader.load ( 'armature1.fbx', function (o) { object1 = o; }, undefined, onError);
loader.load ( 'armature2.fbx', function (o) { object2 = o; }, undefined, onError);

See: https://threejs.org/docs/#api/loaders/managers/LoadingManager

1 Like

Similarly, you can bring both FBX files into Blender, apply the animations to a single armature, and export to glTF (which can more easily include multiple animations in the same file). See https://www.donmccurdy.com/2017/11/06/creating-animated-gltf-characters-with-mixamo-and-blender/.