Blender Loader:
- try locating textures without causing AssetNotFoundExceptions git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10196 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
6bc4b2131a
commit
ed001d4e33
@ -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…
x
Reference in New Issue
Block a user