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,10 +236,12 @@ public class ArmatureHelper extends AbstractBlenderHelper {
|
||||
if (!p.isNull()) {
|
||||
Structure ipoStructure = p.fetchData(blenderContext.getInputStream()).get(0);
|
||||
Ipo ipo = ipoHelper.fromIpoStructure(ipoStructure, blenderContext);
|
||||
if(ipo != null) {
|
||||
tracks.add((BoneTrack) ipo.calculateTrack(boneIndex, 0, ipo.getLastFrame(), fps, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return tracks.toArray(new BoneTrack[tracks.size()]);
|
||||
}
|
||||
|
||||
|
@ -325,7 +325,6 @@ import com.jme3.util.BufferUtils;
|
||||
if (boneIndex != null) {
|
||||
float weight = ((Number) deformWeight.getFieldValue("weight")).floatValue();
|
||||
if (weight == 0.0f) {
|
||||
weight = 1;
|
||||
boneIndex = Integer.valueOf(0);
|
||||
}
|
||||
// we apply the weight to all referenced vertices
|
||||
|
@ -149,9 +149,11 @@ public class ModifierHelper extends AbstractBlenderHelper {
|
||||
IpoHelper ipoHelper = blenderContext.getHelper(IpoHelper.class);
|
||||
Structure ipoStructure = pIpo.fetchData(blenderContext.getInputStream()).get(0);
|
||||
Ipo ipo = ipoHelper.fromIpoStructure(ipoStructure, blenderContext);
|
||||
if(ipo != null) {
|
||||
result = new ObjectAnimationModifier(ipo, objectStructure.getName(), objectStructure.getOldMemoryAddress(), blenderContext);
|
||||
blenderContext.addModifier(objectStructure.getOldMemoryAddress(), result);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user