From e5400e38b8ae4f763293117cd426d26c6ec70c14 Mon Sep 17 00:00:00 2001 From: "Sha..om" Date: Wed, 4 May 2011 15:54:37 +0000 Subject: [PATCH] * SceneLoader will no longer crash if material file cannot be found git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7438 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../src/ogre/com/jme3/scene/plugins/ogre/SceneLoader.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/engine/src/ogre/com/jme3/scene/plugins/ogre/SceneLoader.java b/engine/src/ogre/com/jme3/scene/plugins/ogre/SceneLoader.java index 72c56a6f8..6f83f5f0f 100644 --- a/engine/src/ogre/com/jme3/scene/plugins/ogre/SceneLoader.java +++ b/engine/src/ogre/com/jme3/scene/plugins/ogre/SceneLoader.java @@ -335,8 +335,12 @@ public class SceneLoader extends DefaultHandler implements AssetLoader { folderName = info.getKey().getFolder(); sceneName = sceneName.substring(0, sceneName.length() - ext.length() - 1); - materialList = (MaterialList) - assetManager.loadAsset(new AssetKey(sceneName+".material")); + try { + materialList = (MaterialList) + assetManager.loadAsset(new AssetKey(sceneName+".material")); + } catch (AssetNotFoundException ex){ + logger.log(Level.WARNING, "Cannot locate material file {0}", ex.getMessage()); + } XMLReader xr = XMLReaderFactory.createXMLReader(); xr.setContentHandler(this);