Fix to texture loading: catching asset's manager AssetNotFoundException.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7690 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Kae..pl 14 years ago
parent f230997d93
commit c30288febf
  1. 9
      engine/src/blender/com/jme3/scene/plugins/blender/helpers/v249/TextureHelper.java

@ -40,6 +40,7 @@ import java.nio.ByteBuffer;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import com.jme3.asset.AssetNotFoundException;
import com.jme3.asset.TextureKey; import com.jme3.asset.TextureKey;
import com.jme3.math.FastMath; import com.jme3.math.FastMath;
import com.jme3.scene.plugins.blender.data.FileBlockHeader; import com.jme3.scene.plugins.blender.data.FileBlockHeader;
@ -1614,8 +1615,12 @@ public class TextureHelper extends AbstractBlenderHelper {
} }
TextureKey texKey = new TextureKey(name, false); TextureKey texKey = new TextureKey(name, false);
Texture tex = dataRepository.getAssetManager().loadTexture(texKey); try {
image = tex.getImage(); Texture tex = dataRepository.getAssetManager().loadTexture(texKey);
image = tex.getImage();
} catch (AssetNotFoundException e) {
LOGGER.warning("Asset nof found: " + e.getLocalizedMessage());
}
} }
// 2. Try using the direct path from the blender file // 2. Try using the direct path from the blender file

Loading…
Cancel
Save