Blender Importer: Don't crash when a packed texture couldn't be loaded
This commit is contained in:
parent
5d729af1c4
commit
1b76160410
@ -251,7 +251,13 @@ public class TextureHelper extends AbstractBlenderHelper {
|
|||||||
blenderContext.getInputStream().setPosition(dataFileBlock.getBlockPosition());
|
blenderContext.getInputStream().setPosition(dataFileBlock.getBlockPosition());
|
||||||
|
|
||||||
// Should the texture be flipped? It works for sinbad ..
|
// 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 {
|
//} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user