From 939a0b03cac30f0a75d30e1e8be89d61d80d2249 Mon Sep 17 00:00:00 2001 From: jmekaelthas <76w1dxnh> Date: Wed, 28 May 2014 16:27:33 +0200 Subject: [PATCH] Bugfix: fixed a bug that caused importer to fail when mesh had armature modifier and no vertex groups nor bone envelopes defined. --- .../scene/plugins/blender/modifiers/ArmatureModifier.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/modifiers/ArmatureModifier.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/modifiers/ArmatureModifier.java index 610711afa..94e289dde 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/modifiers/ArmatureModifier.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/modifiers/ArmatureModifier.java @@ -282,6 +282,11 @@ import com.jme3.util.BufferUtils; } } + if(maximumWeightsPerVertex == 0) { + LOGGER.fine("No vertex group data nor bone envelopes found to attach vertices to bones!"); + return null; + } + LOGGER.fine("Preparing buffers for the mesh."); FloatBuffer weightsFloatData = BufferUtils.createFloatBuffer(vertexListSize * MAXIMUM_WEIGHTS_PER_VERTEX); ByteBuffer indicesData = BufferUtils.createByteBuffer(vertexListSize * MAXIMUM_WEIGHTS_PER_VERTEX);