diff --git a/engine/src/core/com/jme3/animation/Animation.java b/engine/src/core/com/jme3/animation/Animation.java index 330a5c885..ef1af1299 100644 --- a/engine/src/core/com/jme3/animation/Animation.java +++ b/engine/src/core/com/jme3/animation/Animation.java @@ -106,6 +106,9 @@ public class Animation implements Savable, Cloneable { * @param channel the animation channel */ void setTime(float time, float blendAmount, AnimControl control, AnimChannel channel, TempVars vars) { + if (tracks == null) + return; + for (int i = 0; i < tracks.length; i++){ tracks[i].setTime(time, blendAmount, control, channel, vars); } diff --git a/engine/src/ogre/com/jme3/scene/plugins/ogre/MaterialLoader.java b/engine/src/ogre/com/jme3/scene/plugins/ogre/MaterialLoader.java index dbeaa2d33..4b4f115a9 100644 --- a/engine/src/ogre/com/jme3/scene/plugins/ogre/MaterialLoader.java +++ b/engine/src/ogre/com/jme3/scene/plugins/ogre/MaterialLoader.java @@ -36,6 +36,7 @@ import com.jme3.asset.AssetInfo; import com.jme3.asset.AssetKey; import com.jme3.asset.AssetLoader; import com.jme3.asset.AssetManager; +import com.jme3.asset.AssetNotFoundException; import com.jme3.asset.TextureKey; import com.jme3.material.Material; import com.jme3.material.MaterialList; @@ -140,7 +141,13 @@ public class MaterialLoader implements AssetLoader { key.setGenerateMips(genMips); key.setAsCube(cubic); - Texture loadedTexture = assetManager.loadTexture(key); + Texture loadedTexture; + try { + loadedTexture = assetManager.loadTexture(key); + } catch (AssetNotFoundException ex){ + logger.log(Level.WARNING, "Failed to load texture " + key + " for material " + matName, ex); + loadedTexture = null; + } if (loadedTexture == null){ ByteBuffer tempData = BufferUtils.createByteBuffer(3); tempData.put((byte)0xFF).put((byte)0x00).put((byte)0x00); diff --git a/engine/src/ogre/com/jme3/scene/plugins/ogre/MeshLoader.java b/engine/src/ogre/com/jme3/scene/plugins/ogre/MeshLoader.java index 812858f26..db5eba180 100644 --- a/engine/src/ogre/com/jme3/scene/plugins/ogre/MeshLoader.java +++ b/engine/src/ogre/com/jme3/scene/plugins/ogre/MeshLoader.java @@ -785,12 +785,14 @@ public class MeshLoader extends DefaultHandler implements AssetLoader { materialList = (MaterialList) assetManager.loadAsset(new OgreMaterialKey(folderName + materialName + ".material")); } catch (AssetNotFoundException e) { logger.log(Level.WARNING, "Cannot locate {0}{1}.material for model {2}{3}.{4}", new Object[]{folderName, materialName, folderName, meshName, ext}); + logger.log(Level.WARNING, "", e); } } else { try { materialList = (MaterialList) assetManager.loadAsset(new OgreMaterialKey(folderName + meshName + ".material")); } catch (AssetNotFoundException e) { logger.log(Level.WARNING, "Cannot locate {0}{1}.material for model {2}{3}.{4}", new Object[]{folderName, meshName, folderName, meshName, ext}); + logger.log(Level.WARNING, "", e); } } } @@ -799,7 +801,8 @@ public class MeshLoader extends DefaultHandler implements AssetLoader { materialList = (MaterialList) assetManager.loadAsset(new OgreMaterialKey(folderName + meshName + ".material")); } catch (AssetNotFoundException e) { logger.log(Level.WARNING, "Cannot locate {0}{1}.material for model {2}{3}.{4}", new Object[]{folderName, meshName, folderName, meshName, ext}); - } + logger.log(Level.WARNING, "", e); + } }