Bugfix: fixed an issue that could cause NPE when lamp that is not supported in JME ('Hemi' light for example) had children nodes attached.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/branches/gradle-restructure@11062 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
experimental
Kae..pl 11 years ago
parent f3457c2f52
commit 7d6ea02b90
  1. 4
      jme3-blender/src/main/java/com/jme3/scene/plugins/blender/objects/ObjectHelper.java

@ -190,6 +190,10 @@ public class ObjectHelper extends AbstractBlenderHelper {
LightHelper lightHelper = blenderContext.getHelper(LightHelper.class); LightHelper lightHelper = blenderContext.getHelper(LightHelper.class);
List<Structure> lampsArray = pLamp.fetchData(); List<Structure> lampsArray = pLamp.fetchData();
result = lightHelper.toLight(lampsArray.get(0), blenderContext); result = lightHelper.toLight(lampsArray.get(0), blenderContext);
if(result == null) {
//probably some light type is not supported, just create a node so that we can maintain child-parent relationship for nodes
result = new Node(name);
}
} }
break; break;
case CAMERA: case CAMERA:

Loading…
Cancel
Save