- fix OgreXML material loading when using OgreMeshKey

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8110 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 14 years ago
parent b569d2e0ef
commit 1fba65668b
  1. 11
      engine/src/ogre/com/jme3/scene/plugins/ogre/MeshLoader.java
  2. 4
      sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/actions/PreviewAssetAction.java
  3. 1
      sdk/jme3-core/src/com/jme3/gde/core/assets/actions/OpenModel.java

@ -782,11 +782,12 @@ public class MeshLoader extends DefaultHandler implements AssetLoader {
meshKey = (OgreMeshKey) key; meshKey = (OgreMeshKey) key;
materialList = meshKey.getMaterialList(); materialList = meshKey.getMaterialList();
String materialName = meshKey.getMaterialName(); String materialName = meshKey.getMaterialName();
if (materialList == null && materialName != null) { if (materialList == null) {
materialList = (MaterialList) assetManager.loadAsset(new OgreMaterialKey(folderName + materialName + ".material")); if (materialName != null) {
} materialList = (MaterialList) assetManager.loadAsset(new OgreMaterialKey(folderName + materialName + ".material"));
else{ } else {
materialList = (MaterialList) assetManager.loadAsset(new OgreMaterialKey(folderName + meshName + ".material")); materialList = (MaterialList) assetManager.loadAsset(new OgreMaterialKey(folderName + meshName + ".material"));
}
} }
} else { } else {
try { try {

@ -17,6 +17,7 @@ import java.beans.PropertyChangeListener;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.swing.Action; import javax.swing.Action;
import org.openide.loaders.DataObject;
import org.openide.nodes.Node; import org.openide.nodes.Node;
import org.w3c.dom.Element; import org.w3c.dom.Element;
@ -42,7 +43,8 @@ public final class PreviewAssetAction implements Action {
JmeNode jmeNode = NodeUtility.createNode(node); JmeNode jmeNode = NodeUtility.createNode(node);
SceneApplication app = SceneApplication.getApplication(); SceneApplication app = SceneApplication.getApplication();
SceneRequest request = new SceneRequest(app, jmeNode, pm); SceneRequest request = new SceneRequest(app, jmeNode, pm);
request.setWindowTitle("SceneViewer - PreView AssetPack Model"); request.setDataObject(context.getLookup().lookup(DataObject.class));
request.setWindowTitle("AssetPack - PreView Model");
app.requestScene(request); app.requestScene(request);
} }

@ -82,6 +82,7 @@ public final class OpenModel implements ActionListener {
JmeNode jmeNode = NodeUtility.createNode(node); JmeNode jmeNode = NodeUtility.createNode(node);
SceneApplication app = SceneApplication.getApplication(); SceneApplication app = SceneApplication.getApplication();
SceneRequest request = new SceneRequest(app, jmeNode, manager); SceneRequest request = new SceneRequest(app, jmeNode, manager);
request.setDataObject(context);
request.setWindowTitle("OpenGL Window - View Model"); request.setWindowTitle("OpenGL Window - View Model");
app.requestScene(request); app.requestScene(request);
} else { } else {

Loading…
Cancel
Save