diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionDistLimit.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionDistLimit.java index 5185d1646..cc4852cca 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionDistLimit.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionDistLimit.java @@ -34,6 +34,9 @@ import com.jme3.scene.plugins.blender.file.Structure; // distance limit does not work on bones who are connected to their parent return; } + if(influence == 0 || targetTransform == null) { + return ;// no need to do anything + } Transform ownerTransform = this.getOwnerTransform(ownerSpace); diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionIK.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionIK.java index d25e61b3b..615291999 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionIK.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionIK.java @@ -53,12 +53,15 @@ public class ConstraintDefinitionIK extends ConstraintDefinition { @Override public void bake(Space ownerSpace, Space targetSpace, Transform targetTransform, float influence) { - if (influence == 0 || !needToCompute) { + if (influence == 0 || !needToCompute || targetTransform == null) { return;// no need to do anything } Quaternion q = new Quaternion(); Vector3f t = targetTransform.getTranslation(); List bones = this.loadBones(); + if(bones.size() == 0) { + return;// no need to do anything + } float distanceFromTarget = Float.MAX_VALUE; int iterations = this.iterations; diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionLocLike.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionLocLike.java index e2516e658..0e2c4d63d 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionLocLike.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionLocLike.java @@ -49,6 +49,9 @@ import com.jme3.scene.plugins.blender.file.Structure; // location copy does not work on bones who are connected to their parent return; } + if(influence == 0 || targetTransform == null) { + return ;// no need to do anything + } Transform ownerTransform = this.getOwnerTransform(ownerSpace); diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionRotLike.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionRotLike.java index 24a91bfb9..3a363cb4d 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionRotLike.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionRotLike.java @@ -29,6 +29,9 @@ import com.jme3.scene.plugins.blender.file.Structure; @Override public void bake(Space ownerSpace, Space targetSpace, Transform targetTransform, float influence) { + if(influence == 0 || targetTransform == null) { + return ;// no need to do anything + } Transform ownerTransform = this.getOwnerTransform(ownerSpace); Quaternion ownerRotation = ownerTransform.getRotation(); diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionSizeLike.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionSizeLike.java index 2b86a5c86..046801526 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionSizeLike.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionSizeLike.java @@ -32,6 +32,9 @@ import com.jme3.scene.plugins.blender.file.Structure; @Override public void bake(Space ownerSpace, Space targetSpace, Transform targetTransform, float influence) { + if(influence == 0 || targetTransform == null) { + return;// no need to do anything + } Transform ownerTransform = this.getOwnerTransform(ownerSpace); Vector3f ownerScale = ownerTransform.getScale(); diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionTransLike.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionTransLike.java index d58907ea9..5b171b97f 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionTransLike.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionTransLike.java @@ -35,6 +35,9 @@ public class ConstraintDefinitionTransLike extends ConstraintDefinition { @Override public void bake(Space ownerSpace, Space targetSpace, Transform targetTransform, float influence) { + if(influence == 0 || targetTransform == null) { + return ;// no need to do anything + } Object target = this.getTarget();// Bone or Node Object owner = this.getOwner();// Bone or Node if (!target.getClass().equals(owner.getClass())) {