Bones - Freeze transformations

@Evgeni_Popov that’s easy!
Check out this one.

The interesting lines are

hips.rotationQuaternion = new BABYLON.Quaternion.FromEulerAngles(0, Math.PI, 0);

// Freze somehow?
//hips.freezeTransformations();

// If frozen correctly, this should not reset the skeleton.
hips.rotationQuaternion.set(0, 0, 0, 1);

UPDATE 1
Maybe it’s possible with setRestPose. I will do some tests…

UPDATE 2
I would have thought the following should work.

  1. Orient bone as desired.
  2. Get current local matrix.
  3. Use matrix to update rest pose.
  4. Set all rotations to zero.

Expected result: Bone oriented as desired in new rest pose.

But it doesn’t seem to work that way:

    hips.rotationQuaternion = new BABYLON.Quaternion.FromEulerAngles(0, Math.PI, 0);

    var m = hips.getLocalMatrix();
    hips.setRestPose(m);

    hips.rotationQuaternion.set(0, 0, 0, 1);