Blender Loader:

- try locating textures without causing AssetNotFoundExceptions

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10196 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 12 years ago
parent 6bc4b2131a
commit ed001d4e33
  1. 4
      engine/src/blender/com/jme3/scene/plugins/blender/textures/TextureHelper.java

@ -31,6 +31,7 @@
*/ */
package com.jme3.scene.plugins.blender.textures; package com.jme3.scene.plugins.blender.textures;
import com.jme3.asset.AssetInfo;
import java.awt.color.ColorSpace; import java.awt.color.ColorSpace;
import java.awt.geom.AffineTransform; import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
@ -715,9 +716,12 @@ public class TextureHelper extends AbstractBlenderHelper {
TextureKey key = new TextureKey(assetName); TextureKey key = new TextureKey(assetName);
key.setGenerateMips(true); key.setGenerateMips(true);
key.setAsCube(false); key.setAsCube(false);
AssetInfo info = assetManager.locateAsset(key);
if(info != null){
result = assetManager.loadTexture(key); result = assetManager.loadTexture(key);
break;// if no exception is thrown then accept the located asset break;// if no exception is thrown then accept the located asset
// and break the loop // and break the loop
}
} catch (AssetNotFoundException e) { } catch (AssetNotFoundException e) {
LOGGER.fine(e.getLocalizedMessage()); LOGGER.fine(e.getLocalizedMessage());
} }

Loading…
Cancel
Save