Bugfix: fixed a bug that caused NPE during vertex groups loading when

mesh block was saved without its parent.
cleanup_build_scripts
jmekaelthas 9 years ago
parent 32be69f3e6
commit be3dc06e28
  1. 3
      jme3-blender/src/main/java/com/jme3/scene/plugins/blender/meshes/MeshHelper.java

@ -286,6 +286,8 @@ public class MeshHelper extends AbstractBlenderHelper {
List<Map<String, Float>> result = new ArrayList<Map<String, Float>>(); List<Map<String, Float>> result = new ArrayList<Map<String, Float>>();
Structure parent = blenderContext.peekParent(); Structure parent = blenderContext.peekParent();
if(parent != null) {
// the mesh might be saved without its parent (it is then unused)
Structure defbase = (Structure) parent.getFieldValue("defbase"); Structure defbase = (Structure) parent.getFieldValue("defbase");
List<String> groupNames = new ArrayList<String>(); List<String> groupNames = new ArrayList<String>();
List<Structure> defs = defbase.evaluateListBase(); List<Structure> defs = defbase.evaluateListBase();
@ -312,6 +314,7 @@ public class MeshHelper extends AbstractBlenderHelper {
result.add(weightsForVertex); result.add(weightsForVertex);
} }
} }
}
return result; return result;
} }

Loading…
Cancel
Save