Bugfix: fixed a bug that caused NPE to be raised when object had armature but bones were not attached to vertices (now every skeleton that is defined in the blender file is loaded).

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10852 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
experimental
Kae..pl 11 years ago
parent 2ccadb7a7a
commit e148d0e01a
  1. 6
      engine/src/blender/com/jme3/scene/plugins/blender/modifiers/ArmatureModifier.java

@ -70,11 +70,7 @@ import com.jme3.util.BufferUtils;
*/
public ArmatureModifier(Structure objectStructure, Structure modifierStructure, BlenderContext blenderContext) throws BlenderFileException {
Structure meshStructure = ((Pointer) objectStructure.getFieldValue("data")).fetchData(blenderContext.getInputStream()).get(0);
Pointer pDvert = (Pointer) meshStructure.getFieldValue("dvert");// dvert = DeformVERTices
// if pDvert==null then there are not vertex groups and no need to load
// skeleton (untill bone envelopes are supported)
if (this.validate(modifierStructure, blenderContext) && pDvert.isNotNull()) {
if (this.validate(modifierStructure, blenderContext)) {
Pointer pArmatureObject = (Pointer) modifierStructure.getFieldValue("object");
if (pArmatureObject.isNotNull()) {
ArmatureHelper armatureHelper = blenderContext.getHelper(ArmatureHelper.class);

Loading…
Cancel
Save