How do I change color of an specific object with OBJLoader

So I have a object loaded with OBJLoader and now I want to change the color of a part of it. Its a avatar with 5 parts, the head, torso, arms, and legs.
Suppose I want to change the color of the torso, how do I do that?

  1. Add names / labels to meshes (eg. in Blender.)
  2. After loading the mesh, in the callback, traverse through the children (probably the east with Object3D.traverse((mesh) => ...)).
  3. Each child object has a name property. Find the corresponding one and update it’s material prop. (Mind, if your model is animated and you change it’s material, be sure to set skinning = true in the new material.)
1 Like