You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I prepared 2 mesh (1 mesh sliced into 2 parts) in blender with shape keys and animation for shape keys (NLA). The animation was prepared and exported from marvelus designer (simulation). I exported mesh to .glb and load into the scene with GLTFLoader.
Loaded geometry of second mesh is looking deformed. For 3 days I was searching to find what could be the reason but don't have much only feeling that file could be wrongly interpreted by the three.js - probably there are references to the shapekeys which shouldn't be?
When importing .glb file to blender it works perfectly as expected
What I tried so far but all gave same result: deformed 2-nd loaded mesh geometry:
Load 2 models separately
Export to .FBX and change influence manually (exported file does not contain animation for shape keys)
I prepared a scripts for blender to create a new mesh based on original and "copy" positions to prevent "referring" one mesh to another (I fought blend or mesh was broken - sometimes happens)
Remove animations form .glb's and manually change influences
Change shape key's names
Sometimes when influences are set to 0 second mesh is deformed anyway
Reproduction steps
Load 2 .glb files with shape keys into scene
Change 1'st model morph target influence to for instance 1
Check the result of deforming 2'nd geometry model
Code
import{OrbitControls}from'three/addons/controls/OrbitControls.js';import{GLTFLoader}from'three/addons/loaders/GLTFLoader.js';import*asTHREEfrom'three';letcamera,scene,renderer;init();render();functioninit(){camera=newTHREE.PerspectiveCamera(45,window.innerWidth/window.innerHeight,0.25,20);camera.position.set(-1.8,0.6,2.7);scene=newTHREE.Scene();// Lightconstlight=newTHREE.AmbientLight('#FFFFFF',0.55);scene.add(light);constdirLight=newTHREE.DirectionalLight(0x8888ff,10);dirLight.position.set(0,3,0);scene.add(dirLight);constpointLight=newTHREE.PointLight(0x8888ff,10);pointLight.position.set(3,0,0);scene.add(pointLight);///////////////////----------------------------------------------constloader=newGLTFLoader().setPath('/assets/');// Load model 1loader.load('back_outside 1.glb',function(gltf){scene.add(gltf.scene);gltf.scene.traverse((child)=>{if(child.isMesh){child.material=newTHREE.MeshStandardMaterial({color: 'red',});}});console.log(gltf);render();});// Load model 2loader.load('front_outside 1.glb',function(gltf){scene.add(gltf.scene);gltf.scene.traverse((child)=>{if(child.isMesh){child.material=newTHREE.MeshStandardMaterial({color: 'green',});}});console.log(gltf);render();});///////////////////----------------------------------------------/// Renderer and default configsrenderer=newTHREE.WebGPURenderer({antialias: true});renderer.setPixelRatio(window.devicePixelRatio);renderer.setSize(window.innerWidth,window.innerHeight);renderer.toneMapping=THREE.ACESFilmicToneMapping;document.body.appendChild(renderer.domElement);constcontrols=newOrbitControls(camera,renderer.domElement);controls.addEventListener('change',render);// use if there is no animation loopcontrols.minDistance=1;controls.maxDistance=10;controls.target.set(0,0,-0.2);controls.update();window.addEventListener('resize',onWindowResize);}functiononWindowResize(){camera.aspect=window.innerWidth/window.innerHeight;camera.updateProjectionMatrix();renderer.setSize(window.innerWidth,window.innerHeight);render();}//functionrender(){renderer.renderAsync(scene,camera);}
Edit:
Just checked how the model is loading in babylon.js and also is working perfectly good as expected (even with animation) nothing is deformed I used same .glb files provided in repo didn't edited it
The text was updated successfully, but these errors were encountered:
@donmccurdy Just cheeked models with WebGLRenderer and with it works properly as expected (also shape keys animation is working), so it looks like issue comes with WebGPURenderer
donmccurdy
changed the title
Mesh shapekeys deforming different geometry mesh
WebGPURenderer: Mesh shapekeys deforming different geometry mesh
Dec 24, 2024
Description
I prepared 2 mesh (1 mesh sliced into 2 parts) in blender with shape keys and animation for shape keys (NLA). The animation was prepared and exported from marvelus designer (simulation). I exported mesh to .glb and load into the scene with GLTFLoader.
Loaded geometry of second mesh is looking deformed. For 3 days I was searching to find what could be the reason but don't have much only feeling that file could be wrongly interpreted by the three.js - probably there are references to the shapekeys which shouldn't be?
When importing .glb file to blender it works perfectly as expected
What I tried so far but all gave same result: deformed 2-nd loaded mesh geometry:
Reproduction steps
Code
Live example
Screenshots
Version
r0.171.0
Device
Desktop, Mobile
Browser
Chrome
OS
Windows
Edit:
Just checked how the model is loading in babylon.js and also is working perfectly good as expected (even with animation) nothing is deformed I used same .glb files provided in repo didn't edited it
The text was updated successfully, but these errors were encountered: