Fix to constraint's influence loading (if IPO of the influence was not present then NPE was raised).

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7697 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Kae..pl 14 years ago
parent d1b0ff04d1
commit f1c1bc70e9
  1. 3
      engine/src/blender/com/jme3/scene/plugins/blender/helpers/v249/ConstraintHelper.java

@ -662,7 +662,8 @@ public class ConstraintHelper extends AbstractBlenderHelper {
for (Structure constraint : constraints) {
int type = ((Number) constraint.getFieldValue("type")).intValue();
String constraintName = constraint.getFieldValue("name").toString();
Ipo ipo = constraintsIpos.get(name).get(constraintName);
Map<String, Ipo> ipoMap = constraintsIpos.get(name);
Ipo ipo = ipoMap==null ? null : ipoMap.get(constraintName);
if (ipo == null) {
float enforce = ((Number) constraint.getFieldValue("enforce")).floatValue();
ipo = ipoHelper.createIpo(enforce);

Loading…
Cancel
Save