Bugfix: layers to be loaded are taken from the value set bu user in BlenderKey and not the value loaded from the blender file.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9853 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Kae..pl 12 years ago
parent a0ec19ee48
commit a5e9159149
  1. 10
      engine/src/blender/com/jme3/scene/plugins/blender/BlenderLoader.java

@ -209,21 +209,11 @@ public class BlenderLoader extends AbstractBlenderLoader {
blenderContext.putHelper(ParticlesHelper.class, new ParticlesHelper(inputStream.getVersionNumber(), blenderKey.isFixUpAxis())); blenderContext.putHelper(ParticlesHelper.class, new ParticlesHelper(inputStream.getVersionNumber(), blenderKey.isFixUpAxis()));
// reading the blocks (dna block is automatically saved in the blender context when found) // reading the blocks (dna block is automatically saved in the blender context when found)
FileBlockHeader sceneFileBlock = null;
do { do {
fileBlock = new FileBlockHeader(inputStream, blenderContext); fileBlock = new FileBlockHeader(inputStream, blenderContext);
if (!fileBlock.isDnaBlock()) { if (!fileBlock.isDnaBlock()) {
blocks.add(fileBlock); blocks.add(fileBlock);
// save the scene's file block
if (fileBlock.getCode() == FileBlockHeader.BLOCK_SC00 && blenderKey.getLayersToLoad() < 0) {
sceneFileBlock = fileBlock;
}
} }
} while (!fileBlock.isLastBlock()); } while (!fileBlock.isLastBlock());
// VERIFY LAYERS TO BE LOADED BEFORE LOADING FEATURES
if (sceneFileBlock != null) {
int lay = ((Number) sceneFileBlock.getStructure(blenderContext).getFieldValue("lay")).intValue();
blenderContext.getBlenderKey().setLayersToLoad(lay);// load only current layer
}
} }
} }

Loading…
Cancel
Save