Animation only works if model wrapped with an empty Mesh?

I’m working on some open source code and this is working version. There is a comment says parent the Blender mesh to an empty so it can be moved around. Basically wrapped with an empty Mesh.

What I’m trying to do is - not wrapping with an empty mesh just directly add the model to the scene and play animation on it. With my version animation does NOT work. I’d like to understand why it does not work.

Working version;

// parent the Blender mesh to an empty so it can be moved around
function animator( gltf, scene, meshName ) {
	const container = new THREE.Mesh();
	const model = gltf.scene;
	const mesh = model.getObjectByName( meshName ).clone();
	const mixer = new THREE.AnimationMixer( model );
	container.add( mesh );
	container.mixer = mixer;
	scene.add( container );
	return container;
}

My version;

function animator( gltf, scene, meshName ) {
	const model = gltf.scene;
	const mesh = model.getObjectByName( meshName ).clone();
	const mixer = new THREE.AnimationMixer( model );
	mesh.mixer = mixer;
	scene.add( mesh );
	return mesh;
}

I found the proble, since I’m using model.getObjectByName which gets a model (there is too many models inside the asset file). It turns out I had to provide the value not the whole scene. so change is;

new THREE.AnimationMixer( model );new THREE.AnimationMixer( mesh );

Hi,
I don’t see your recursion(animation) part but it needs something like this:

if ( mixers.length > 0 ) 
	{
		for ( var i = 0; i < mixers.length; i ++ ) 
		{
			mixers[ i ].update( clock.getDelta());
		}
	}

Usually the clock is declared at the beginning as one instance of THREE.Clock