Cannot move skinned mesh

collada-format
geometry

#1

Hi!

I am getting a SkinnedMesh from a Collada scene (in the callback) and setting translation and rotation on it has no effect. Adding it to a dedicated scene object does not work neither.

class RobotClass extends Object3D {

public loadingCompleted(collada: ColladaModel) {
    const scene = new Scene();
    this.add(scene);
    scene.rotateX(-1.57); // affects all other objects added manually to the scene later but the robot
    const robot = colladaScene.getObjectByName(this.params.name) as SkinnedMesh; // object is indeed a skinned mesh
    robot.rotateX(.57)
   // updateMatrix/updateMatrixWorld have not effects
    scene.add(robot);
}
}

Any idea how I can resolve this issue? When I add the whole collada.scene all objects are placed correctly (as in the scene in Blender).

PS: I am using Typescript bindings


#2

That’s because the skeleton is a child of collada.scene and not of the skinned mesh itself. If you just add a specific skinned mesh from collada.scene to your scene graph, the missing bones will mess up the transformation.

The easiest and most reliable way to solve the problem is to always work with collada.scene. If you can’t does this for some reason, you have to add at least the skeleton to the scene.


#3

^To expand on one part of this, when the skeleton isn’t a child of the mesh itself (e.g. attached to a separate armature) you need to move the mesh by moving its skeleton – not the mesh itself. Animations will typically just affect the skeleton. The easiest way to move both is to move collada.scene instead.