Update SkinnedMesh if the bones are changed

I am trying to move different parts of a human figure which is rigged. The problem is that even though the bones are moving correctly, the skinnedmesh don’t get updated. I am aware that it is not supported out of the box.

Don told me that a workaround will be to add mesh to all bones and update the skinnedmesh on every change. https://twitter.com/donrmccurdy/status/1257350425042399234?s=20

Though I was able to add a mesh and move it with bone, the changes in the skinnedmesh don’t reflect.

Here’s the code: https://github.com/ritz078/mannequin.

This can be run by using yarn && yarn dev

1 Like

I was able to use a hack to achieve this. I attached a pivot to all the rootBones and made them transformable.

I had the same problem yesterday.
In my case, I solved it by remove traverse.
I set the Material Color in Blender and it was OK.

const loader = new GLTFLoader();
loader.load(GLTF_PATH, (gltf) => {
  const character = gltf.scene;
  // character.traverse((mesh) => {
  //   if (mesh instanceof THREE.SkinnedMesh) {
  //     mesh.material = new THREE.MeshLambertMaterial({
  //       color: 0x00ff00,
  //       side: THREE.DoubleSide,
  //     });
  //   }
  // });
  scene.add(character);
});