Issue 540: NullPointerException when loading blender model
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9998 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
6573b87bf0
commit
5e2c814086
@ -236,7 +236,9 @@ public class ArmatureHelper extends AbstractBlenderHelper {
|
|||||||
if (!p.isNull()) {
|
if (!p.isNull()) {
|
||||||
Structure ipoStructure = p.fetchData(blenderContext.getInputStream()).get(0);
|
Structure ipoStructure = p.fetchData(blenderContext.getInputStream()).get(0);
|
||||||
Ipo ipo = ipoHelper.fromIpoStructure(ipoStructure, blenderContext);
|
Ipo ipo = ipoHelper.fromIpoStructure(ipoStructure, blenderContext);
|
||||||
tracks.add((BoneTrack) ipo.calculateTrack(boneIndex, 0, ipo.getLastFrame(), fps, false));
|
if(ipo != null) {
|
||||||
|
tracks.add((BoneTrack) ipo.calculateTrack(boneIndex, 0, ipo.getLastFrame(), fps, false));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -325,7 +325,6 @@ import com.jme3.util.BufferUtils;
|
|||||||
if (boneIndex != null) {
|
if (boneIndex != null) {
|
||||||
float weight = ((Number) deformWeight.getFieldValue("weight")).floatValue();
|
float weight = ((Number) deformWeight.getFieldValue("weight")).floatValue();
|
||||||
if (weight == 0.0f) {
|
if (weight == 0.0f) {
|
||||||
weight = 1;
|
|
||||||
boneIndex = Integer.valueOf(0);
|
boneIndex = Integer.valueOf(0);
|
||||||
}
|
}
|
||||||
// we apply the weight to all referenced vertices
|
// we apply the weight to all referenced vertices
|
||||||
|
@ -149,8 +149,10 @@ public class ModifierHelper extends AbstractBlenderHelper {
|
|||||||
IpoHelper ipoHelper = blenderContext.getHelper(IpoHelper.class);
|
IpoHelper ipoHelper = blenderContext.getHelper(IpoHelper.class);
|
||||||
Structure ipoStructure = pIpo.fetchData(blenderContext.getInputStream()).get(0);
|
Structure ipoStructure = pIpo.fetchData(blenderContext.getInputStream()).get(0);
|
||||||
Ipo ipo = ipoHelper.fromIpoStructure(ipoStructure, blenderContext);
|
Ipo ipo = ipoHelper.fromIpoStructure(ipoStructure, blenderContext);
|
||||||
result = new ObjectAnimationModifier(ipo, objectStructure.getName(), objectStructure.getOldMemoryAddress(), blenderContext);
|
if(ipo != null) {
|
||||||
blenderContext.addModifier(objectStructure.getOldMemoryAddress(), result);
|
result = new ObjectAnimationModifier(ipo, objectStructure.getName(), objectStructure.getOldMemoryAddress(), blenderContext);
|
||||||
|
blenderContext.addModifier(objectStructure.getOldMemoryAddress(), result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user