From ed001d4e3378a7b20acc4dc986d81da373c8268d Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Sun, 27 Jan 2013 02:37:05 +0000 Subject: [PATCH] Blender Loader: - try locating textures without causing AssetNotFoundExceptions git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10196 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../scene/plugins/blender/textures/TextureHelper.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/textures/TextureHelper.java b/engine/src/blender/com/jme3/scene/plugins/blender/textures/TextureHelper.java index 48a94e3ef..cdcab257c 100644 --- a/engine/src/blender/com/jme3/scene/plugins/blender/textures/TextureHelper.java +++ b/engine/src/blender/com/jme3/scene/plugins/blender/textures/TextureHelper.java @@ -31,6 +31,7 @@ */ package com.jme3.scene.plugins.blender.textures; +import com.jme3.asset.AssetInfo; import java.awt.color.ColorSpace; import java.awt.geom.AffineTransform; import java.awt.image.BufferedImage; @@ -715,9 +716,12 @@ public class TextureHelper extends AbstractBlenderHelper { TextureKey key = new TextureKey(assetName); key.setGenerateMips(true); key.setAsCube(false); - result = assetManager.loadTexture(key); - break;// if no exception is thrown then accept the located asset - // and break the loop + AssetInfo info = assetManager.locateAsset(key); + if(info != null){ + result = assetManager.loadTexture(key); + break;// if no exception is thrown then accept the located asset + // and break the loop + } } catch (AssetNotFoundException e) { LOGGER.fine(e.getLocalizedMessage()); }