From e282db0f7fe598bd11925e5532924b2a7d29f8e1 Mon Sep 17 00:00:00 2001 From: "Kae..pl" Date: Mon, 8 Apr 2013 12:06:57 +0000 Subject: [PATCH] Minor fixes to armature loading. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10528 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../jme3/scene/plugins/blender/animations/BoneContext.java | 6 +----- .../scene/plugins/blender/modifiers/ArmatureModifier.java | 5 +++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/animations/BoneContext.java b/engine/src/blender/com/jme3/scene/plugins/blender/animations/BoneContext.java index b5e08721e..196d6a634 100644 --- a/engine/src/blender/com/jme3/scene/plugins/blender/animations/BoneContext.java +++ b/engine/src/blender/com/jme3/scene/plugins/blender/animations/BoneContext.java @@ -89,7 +89,7 @@ public class BoneContext { boneName = boneStructure.getFieldValue("name").toString(); length = ((Number) boneStructure.getFieldValue("length")).floatValue(); ObjectHelper objectHelper = blenderContext.getHelper(ObjectHelper.class); - armatureMatrix = objectHelper.getMatrix(boneStructure, "arm_mat", true); + armatureMatrix = objectHelper.getMatrix(boneStructure, "arm_mat", blenderContext.getBlenderKey().isFixUpAxis()); this.computeRestMatrix(objectToArmatureMatrix); List childbase = ((Structure) boneStructure.getFieldValue("childbase")).evaluateListBase(blenderContext); @@ -117,10 +117,6 @@ public class BoneContext { inverseTotalTransformation = restMatrix.invert(); restMatrix = inverseParentMatrix.mult(restMatrix); - - for (BoneContext child : this.children) { - child.computeRestMatrix(objectToArmatureMatrix); - } } /** diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/modifiers/ArmatureModifier.java b/engine/src/blender/com/jme3/scene/plugins/blender/modifiers/ArmatureModifier.java index b4672f0b7..761f1da8b 100644 --- a/engine/src/blender/com/jme3/scene/plugins/blender/modifiers/ArmatureModifier.java +++ b/engine/src/blender/com/jme3/scene/plugins/blender/modifiers/ArmatureModifier.java @@ -100,8 +100,9 @@ import com.jme3.util.BufferUtils; ObjectHelper objectHelper = blenderContext.getHelper(ObjectHelper.class); if(objectHelper.isLineage(armatureObject, objectStructure, blenderContext)) { - Matrix4f armatureObjectMatrix = objectHelper.getMatrix(armatureObject, "obmat", blenderContext.getBlenderKey().isFixUpAxis()); - Matrix4f inverseMeshObjectMatrix = objectHelper.getMatrix(objectStructure, "obmat", true).invertLocal(); + boolean fixUpAxis = blenderContext.getBlenderKey().isFixUpAxis(); + Matrix4f armatureObjectMatrix = objectHelper.getMatrix(armatureObject, "obmat", fixUpAxis); + Matrix4f inverseMeshObjectMatrix = objectHelper.getMatrix(objectStructure, "imat", fixUpAxis); objectToArmatureTransformation = armatureObjectMatrix.multLocal(inverseMeshObjectMatrix); Matrix3f rot = objectToArmatureTransformation.toRotationMatrix(); objectToArmatureTransformation = new Matrix4f();