* SceneLoader will no longer crash on missing material

* Compressed ManyLights texture 

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7206 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
sha..rd 14 years ago
parent 36c51e12c6
commit 2effd8cc25
  1. 11
      engine/src/ogre/com/jme3/scene/plugins/ogre/SceneLoader.java
  2. BIN
      engine/src/test-data/Scenes/ManyLights/AO.jpg
  3. 2
      engine/src/test-data/Scenes/ManyLights/Main.material

@ -37,6 +37,7 @@ import com.jme3.asset.AssetInfo;
import com.jme3.asset.AssetKey; import com.jme3.asset.AssetKey;
import com.jme3.asset.AssetLoader; import com.jme3.asset.AssetLoader;
import com.jme3.asset.AssetManager; import com.jme3.asset.AssetManager;
import com.jme3.asset.AssetNotFoundException;
import com.jme3.light.DirectionalLight; import com.jme3.light.DirectionalLight;
import com.jme3.light.Light; import com.jme3.light.Light;
import com.jme3.light.PointLight; import com.jme3.light.PointLight;
@ -206,9 +207,13 @@ public class SceneLoader extends DefaultHandler implements AssetLoader {
assert elementStack.peek().equals("externals"); assert elementStack.peek().equals("externals");
}else if (qName.equals("file")){ }else if (qName.equals("file")){
assert elementStack.peek().equals("item"); assert elementStack.peek().equals("item");
materialList = (MaterialList) String matFile = folderName+attribs.getValue("name");
assetManager.loadAsset(folderName+attribs.getValue("name")); try {
materialList = (MaterialList) assetManager.loadAsset(matFile);
} catch (AssetNotFoundException ex){
materialList = null;
logger.log(Level.WARNING, "Cannot locate material file: {0}", matFile);
}
}else if (qName.equals("node")){ }else if (qName.equals("node")){
String curElement = elementStack.peek(); String curElement = elementStack.peek();
assert curElement.equals("nodes") || curElement.equals("node"); assert curElement.equals("nodes") || curElement.equals("node");

Binary file not shown.

Before

Width:  |  Height:  |  Size: 462 KiB

After

Width:  |  Height:  |  Size: 105 KiB

@ -11,7 +11,7 @@ material Material
emissive 0.000000 0.000000 0.000000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000
texture_unit texture_unit
{ {
texture AO.tga texture AO.jpg
tex_address_mode wrap tex_address_mode wrap
filtering trilinear filtering trilinear
} }

Loading…
Cancel
Save