Problem URL: https://viniciusfxavier.github.io/threejs/learning-3-test/dist/index.html
Source Code: https://github.com/ViniciusFXavier/threejs/blob/e5605428da908a1c1534c7f93af96c09de90f436/learning-3-test/src/index.ts#L33
If I scale down my model below 1 the animation breaks:
This break the animation -> object.scale.multiplyScalar(0.1);
Using object.scale.multiplyScalar
to change model size below 1 break the animation.
object.scale.multiplyScalar(0.1); // Problem
It works -> object.scale.multiplyScalar(1);
const loader = new FBXLoader().setPath('https://viniciusfxavier.github.io/threejs/learning-3-test/src/models/');
loader.load('SillyDancing.fbx', (object: any) => {
object.scale.multiplyScalar(0.1); // Problem
object.mixer = new THREE.AnimationMixer(object);
mixers.push(object.mixer);
var action = object.mixer.clipAction(object.animations[0]);
action.play();
object.traverse((child: any) => {
if (child.type === 'SkinnedMesh') {
if (child.name !== 'Character_Dummy_Male_01') {
child.visible = false;
}
child.material = new THREE.MeshLambertMaterial({ color: 0xdddddd, skinning: true });
}
});
const skeletonHelper = new THREE.SkeletonHelper(object);
skeletonHelper.visible = true;
scene.add(skeletonHelper);
scene.add(object);
render();
});
Animation from https://www.mixamo.com/#/
- Name: Silly Dancing