Added clear information about bugged blender file. Rarely a pointer appears whose block cannot be found. This is cerainly a bug of blender and we cannot do anything but properly inform user about the situation.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10124 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Kae..pl 12 years ago
parent 8a6849b40c
commit 071581ad30
  1. 4
      engine/src/blender/com/jme3/scene/plugins/blender/file/Pointer.java

@ -90,6 +90,10 @@ public class Pointer {
} }
List<Structure> structures = null; List<Structure> structures = null;
FileBlockHeader dataFileBlock = blenderContext.getFileBlock(oldMemoryAddress); FileBlockHeader dataFileBlock = blenderContext.getFileBlock(oldMemoryAddress);
if(dataFileBlock == null) {
throw new BlenderFileException("No data stored for address: " +oldMemoryAddress +
". Rarely blender makes mistakes when storing data. Try resaving the model after making minor changes. This usually helps.");
}
if (pointerLevel > 1) { if (pointerLevel > 1) {
int pointersAmount = dataFileBlock.getSize() / inputStream.getPointerSize() * dataFileBlock.getCount(); int pointersAmount = dataFileBlock.getSize() / inputStream.getPointerSize() * dataFileBlock.getCount();
for (int i = 0; i < pointersAmount; ++i) { for (int i = 0; i < pointersAmount; ++i) {

Loading…
Cancel
Save