* 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
3.0
Sha..om 14 years ago
parent a4e97bd2d5
commit e5400e38b8
  1. 8
      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(); folderName = info.getKey().getFolder();
sceneName = sceneName.substring(0, sceneName.length() - ext.length() - 1); sceneName = sceneName.substring(0, sceneName.length() - ext.length() - 1);
materialList = (MaterialList) try {
assetManager.loadAsset(new AssetKey(sceneName+".material")); 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(); XMLReader xr = XMLReaderFactory.createXMLReader();
xr.setContentHandler(this); xr.setContentHandler(this);

Loading…
Cancel
Save