GLTF Model Animations problem after subdivision modifier

Good day!

I’ve got an issue with model animation after applying SubdivisionMidifier. Animation stops (not working without any errors in console.log), but modifier it self works (model looks smoother). WIthout applying modifier animation works fine.

Is this a bug or I’ve missed something?

p.s. the code:

var loaderGLTF = new GLTFLoader().setPath( 'models/' );
loaderGLTF.load( 'model.gltf', function ( gltf ) {
	let model = gltf.scene;
	let animations = gltf.animations;

	model.traverse( function ( node ) {

		if ( !node.isSkinnedMesh ) return;

		var modifier = new SubdivisionModifier( 2 );
		var smoothGeometry = modifier.modify( node.geometry );
		if ( node.geometry ) node.geometry.dispose();
		node.geometry = new THREE.BufferGeometry().fromGeometry( smoothGeometry );
	} );

	mixer = new THREE.AnimationMixer( model );
	mixer.clipAction( animations[0] ).play();

} );

Hey @lolovo1, welcome to the forum.

Looks like skinning information is missing. I’m not sure exactly why. Possibly you have to copy that manually, or possibly modifier doesn’t produce skinning information in the first place.


It seems like all is fine inside of a skinned mesh… at least I can’t figure it out where the issue is. I’m quite new in threejs, so I don’t know how exactly this (i.e. subdivision modifier) affects on an animationclip.

SubdivisionModifier converts BufferGeometry to Geometry (which is deprecated), dropping the skinning information at that step. I think SubdivisionModifier needs to be updated to support BufferGeometry.

EDIT: Related –