Blender Importer: Don't crash when a packed texture couldn't be loaded

empirephoenix-patch-1
MeFisto94 7 years ago committed by Rémy Bouquet
parent 5d729af1c4
commit 1b76160410
  1. 8
      jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/TextureHelper.java

@ -251,7 +251,13 @@ public class TextureHelper extends AbstractBlenderHelper {
blenderContext.getInputStream().setPosition(dataFileBlock.getBlockPosition());
// Should the texture be flipped? It works for sinbad ..
result = new Texture2D(new ImageLoader().loadImage(blenderContext.getInputStream(), dataFileBlock.getBlockPosition(), true));
Image img = new ImageLoader().loadImage(blenderContext.getInputStream(), dataFileBlock.getBlockPosition(), true);
if (img != null) {
result = new Texture2D(img);
} else {
LOGGER.fine("ImageLoader returned null. It probably failed to load the packed texture");
}
}
}
//} else {

Loading…
Cancel
Save