ThreeJS / Problems with animation of a Blender Object
Im a beginner with Three.js and im trying to use animation of a simple object. But after 3 days on this problem, i really dont know how resolve it.
loader2.load('./test1.json',function(geometry, materials){
var material = materials[0];
for(var i = 0;i<materials.length;i++){
materials[i].morphTargets = true;
}
var model = new THREE.SkinnedMesh(geometry, material);
model.scale.set(0.15,0.15,0.15);
scene.add(model);
var clips = model;
var mixer = new THREE.AnimationMixer(model);
var action1 = clips.geometry.animations[1];
mixer.clipAction(action1, model).play();
console.log(action1);
console.log(mixer.clipAction(action1, model).play());
}); With this code i've 0 errors but my animation doesn't work. If someone can help me it would be great. Thanks
loader2.load('./test1.json',function(geometry, materials){
var material = materials[0];
for(var i = 0;i<materials.length;i++){
materials[i].morphTargets = true;
}
var model = new THREE.SkinnedMesh(geometry, material);
model.scale.set(0.15,0.15,0.15);
scene.add(model);
var clips = model;
var mixer = new THREE.AnimationMixer(model);
var action1 = clips.geometry.animations[1];
mixer.clipAction(action1, model).play();
console.log(action1);
console.log(mixer.clipAction(action1, model).play());
}); With this code i've 0 errors but my animation doesn't work. If someone can help me it would be great. Thanks
Комментарии
Отправить комментарий