diff --git a/engine/src/core-plugins/com/jme3/material/plugins/J3MLoader.java b/engine/src/core-plugins/com/jme3/material/plugins/J3MLoader.java index ca9847542..b125b8414 100644 --- a/engine/src/core-plugins/com/jme3/material/plugins/J3MLoader.java +++ b/engine/src/core-plugins/com/jme3/material/plugins/J3MLoader.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{ diff --git a/engine/src/core-plugins/com/jme3/scene/plugins/MTLLoader.java b/engine/src/core-plugins/com/jme3/scene/plugins/MTLLoader.java index 1c38b971e..375405b7f 100644 --- a/engine/src/core-plugins/com/jme3/scene/plugins/MTLLoader.java +++ b/engine/src/core-plugins/com/jme3/scene/plugins/MTLLoader.java @@ -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; } 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 a3ad48785..686c66bcc 100644 --- a/engine/src/ogre/com/jme3/scene/plugins/ogre/MeshLoader.java +++ b/engine/src/ogre/com/jme3/scene/plugins/ogre/MeshLoader.java @@ -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()) { 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 6340883fb..a15104e1b 100644 --- a/engine/src/ogre/com/jme3/scene/plugins/ogre/SceneLoader.java +++ b/engine/src/ogre/com/jme3/scene/plugins/ogre/SceneLoader.java @@ -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; } diff --git a/engine/src/ogre/com/jme3/scene/plugins/ogre/matext/MaterialExtensionLoader.java b/engine/src/ogre/com/jme3/scene/plugins/ogre/matext/MaterialExtensionLoader.java index 60cda8df8..da13751d8 100644 --- a/engine/src/ogre/com/jme3/scene/plugins/ogre/matext/MaterialExtensionLoader.java +++ b/engine/src/ogre/com/jme3/scene/plugins/ogre/matext/MaterialExtensionLoader.java @@ -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);