* Made all placeholder assets loaded have correct asset keys (based on the key that was used to load them)

* Also made the placeholder texture use repeat mode if the original was supposed to use it 

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10207 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
sha..RD 12 years ago
parent f31c1395e8
commit fd0c0fc0a1
  1. 4
      engine/src/core-plugins/com/jme3/material/plugins/J3MLoader.java
  2. 2
      engine/src/core-plugins/com/jme3/scene/plugins/MTLLoader.java
  3. 1
      engine/src/ogre/com/jme3/scene/plugins/ogre/MeshLoader.java
  4. 4
      engine/src/ogre/com/jme3/scene/plugins/ogre/SceneLoader.java
  5. 2
      engine/src/ogre/com/jme3/scene/plugins/ogre/matext/MaterialExtensionLoader.java

@ -159,6 +159,10 @@ public class J3MLoader implements AssetLoader {
}
}else{
tex = new Texture2D(PlaceholderAssets.getPlaceholderImage());
if (repeat){
tex.setWrap(WrapMode.Repeat);
}
tex.setKey(texKey);
}
return tex;
}else{

@ -183,6 +183,8 @@ public class MTLLoader implements AssetLoader {
} catch (AssetNotFoundException ex){
logger.log(Level.WARNING, "Cannot locate {0} for material {1}", new Object[]{texKey, key});
texture = new Texture2D(PlaceholderAssets.getPlaceholderImage());
texture.setWrap(WrapMode.Repeat);
texture.setKey(key);
}
return texture;
}

@ -233,6 +233,7 @@ public class MeshLoader extends DefaultHandler implements AssetLoader {
if (mat == null) {
logger.log(Level.WARNING, "Cannot locate {0} for model {1}", new Object[]{matName, key});
mat = PlaceholderAssets.getPlaceholderMaterial(assetManager);
mat.setKey(key);
}
if (mat.isTransparent()) {

@ -305,7 +305,9 @@ public class SceneLoader extends DefaultHandler implements AssetLoader {
if (ex.getMessage().equals(meshFile)) {
logger.log(Level.WARNING, "Cannot locate {0} for scene {1}", new Object[]{meshKey, key});
// Attach placeholder asset.
entityNode.attachChild(PlaceholderAssets.getPlaceholderModel(assetManager));
Spatial model = PlaceholderAssets.getPlaceholderModel(assetManager);
model.setKey(key);
entityNode.attachChild(model);
} else {
throw ex;
}

@ -83,6 +83,8 @@ public class MaterialExtensionLoader {
} catch (AssetNotFoundException ex){
logger.log(Level.WARNING, "Cannot locate {0} for material {1}", new Object[]{texKey, key});
tex = new Texture2D( PlaceholderAssets.getPlaceholderImage() );
tex.setWrap(WrapMode.Repeat);
tex.setKey(texKey);
}
material.setTexture(jmeParamName, tex);

Loading…
Cancel
Save