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 );
} );
scene.add(model);
mixer = new THREE.AnimationMixer( model );
mixer.clipAction( animations[0] ).play();
} );