Bugfix: only rotation is used to transform node to its parent armature transformation when computing bone positions.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10512 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Kae..pl 12 years ago
parent 06f5cab5ba
commit a1fd0272d4
  1. 5
      engine/src/blender/com/jme3/scene/plugins/blender/modifiers/ArmatureModifier.java

@ -17,7 +17,9 @@ import com.jme3.animation.Bone;
import com.jme3.animation.BoneTrack;
import com.jme3.animation.Skeleton;
import com.jme3.animation.SkeletonControl;
import com.jme3.math.Matrix3f;
import com.jme3.math.Matrix4f;
import com.jme3.math.Quaternion;
import com.jme3.scene.Geometry;
import com.jme3.scene.Mesh;
import com.jme3.scene.Node;
@ -101,6 +103,9 @@ import com.jme3.util.BufferUtils;
Matrix4f armatureObjectMatrix = objectHelper.getMatrix(armatureObject, "obmat", blenderContext.getBlenderKey().isFixUpAxis());
Matrix4f inverseMeshObjectMatrix = objectHelper.getMatrix(objectStructure, "obmat", true).invertLocal();
objectToArmatureTransformation = armatureObjectMatrix.multLocal(inverseMeshObjectMatrix);
Matrix3f rot = objectToArmatureTransformation.toRotationMatrix();
objectToArmatureTransformation = new Matrix4f();
objectToArmatureTransformation.setRotationQuaternion(new Quaternion().fromRotationMatrix(rot));
}
List<Structure> bonebase = ((Structure) armatureStructure.getFieldValue("bonebase")).evaluateListBase(blenderContext);

Loading…
Cancel
Save