From 42feb50b7640cfda8e4f2ee1ebf2a21d349606c3 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Thu, 30 Jun 2011 15:09:19 +0000 Subject: [PATCH] - use OgreMaterialKey in ogre mesh and scene loader so one can add MaterialExtensionSets via an AssetEventListener git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7790 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/ogre/com/jme3/scene/plugins/ogre/MeshLoader.java | 4 ++-- .../src/ogre/com/jme3/scene/plugins/ogre/SceneLoader.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) 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 d3b62149a..d15b5aba6 100644 --- a/engine/src/ogre/com/jme3/scene/plugins/ogre/MeshLoader.java +++ b/engine/src/ogre/com/jme3/scene/plugins/ogre/MeshLoader.java @@ -31,6 +31,7 @@ */ package com.jme3.scene.plugins.ogre; +import com.jme3.scene.plugins.ogre.matext.OgreMaterialKey; import com.jme3.animation.AnimControl; import com.jme3.animation.BoneAnimation; import com.jme3.animation.SkeletonControl; @@ -46,7 +47,6 @@ import com.jme3.renderer.queue.RenderQueue.Bucket; import com.jme3.scene.Geometry; import com.jme3.scene.Mesh; import com.jme3.scene.Node; -import com.jme3.scene.Spatial.CullHint; import com.jme3.scene.UserData; import com.jme3.scene.VertexBuffer; import com.jme3.scene.VertexBuffer.Format; @@ -788,7 +788,7 @@ public class MeshLoader extends DefaultHandler implements AssetLoader { materialList = meshKey.getMaterialList(); } else { try { - materialList = (MaterialList) assetManager.loadAsset(folderName + meshName + ".material"); + materialList = (MaterialList) assetManager.loadAsset(new OgreMaterialKey(folderName + meshName + ".material")); } catch (AssetNotFoundException e) { logger.log(Level.WARNING, "Cannot locate {0}{1}.material for model {2}{3}.{4}", new Object[]{folderName, meshName, folderName, meshName, ext}); } 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 39da3c283..3a0808870 100644 --- a/engine/src/ogre/com/jme3/scene/plugins/ogre/SceneLoader.java +++ b/engine/src/ogre/com/jme3/scene/plugins/ogre/SceneLoader.java @@ -32,9 +32,9 @@ package com.jme3.scene.plugins.ogre; +import com.jme3.scene.plugins.ogre.matext.OgreMaterialKey; import com.jme3.material.MaterialList; import com.jme3.asset.AssetInfo; -import com.jme3.asset.AssetKey; import com.jme3.asset.AssetLoader; import com.jme3.asset.AssetManager; import com.jme3.asset.AssetNotFoundException; @@ -215,7 +215,7 @@ public class SceneLoader extends DefaultHandler implements AssetLoader { assert elementStack.peek().equals("item"); String matFile = folderName+attribs.getValue("name"); try { - materialList = (MaterialList) assetManager.loadAsset(matFile); + materialList = (MaterialList) assetManager.loadAsset(new OgreMaterialKey(matFile)); } catch (AssetNotFoundException ex){ materialList = null; logger.log(Level.WARNING, "Cannot locate material file: {0}", matFile); @@ -350,7 +350,7 @@ public class SceneLoader extends DefaultHandler implements AssetLoader { try { materialList = (MaterialList) - assetManager.loadAsset(new AssetKey(sceneName+".material")); + assetManager.loadAsset(new OgreMaterialKey(sceneName+".material")); } catch (AssetNotFoundException ex){ logger.log(Level.WARNING, "Cannot locate material file {0}", ex.getMessage()); }