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 460ee4321..35e705535 100644 --- a/engine/src/ogre/com/jme3/scene/plugins/ogre/MeshLoader.java +++ b/engine/src/ogre/com/jme3/scene/plugins/ogre/MeshLoader.java @@ -782,11 +782,12 @@ public class MeshLoader extends DefaultHandler implements AssetLoader { meshKey = (OgreMeshKey) key; materialList = meshKey.getMaterialList(); String materialName = meshKey.getMaterialName(); - if (materialList == null && materialName != null) { - materialList = (MaterialList) assetManager.loadAsset(new OgreMaterialKey(folderName + materialName + ".material")); - } - else{ - materialList = (MaterialList) assetManager.loadAsset(new OgreMaterialKey(folderName + meshName + ".material")); + if (materialList == null) { + if (materialName != null) { + materialList = (MaterialList) assetManager.loadAsset(new OgreMaterialKey(folderName + materialName + ".material")); + } else { + materialList = (MaterialList) assetManager.loadAsset(new OgreMaterialKey(folderName + meshName + ".material")); + } } } else { try { diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/actions/PreviewAssetAction.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/actions/PreviewAssetAction.java index ab48084b6..c2da90272 100644 --- a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/actions/PreviewAssetAction.java +++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/actions/PreviewAssetAction.java @@ -17,6 +17,7 @@ import java.beans.PropertyChangeListener; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.Action; +import org.openide.loaders.DataObject; import org.openide.nodes.Node; import org.w3c.dom.Element; @@ -42,7 +43,8 @@ public final class PreviewAssetAction implements Action { JmeNode jmeNode = NodeUtility.createNode(node); SceneApplication app = SceneApplication.getApplication(); 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); } diff --git a/sdk/jme3-core/src/com/jme3/gde/core/assets/actions/OpenModel.java b/sdk/jme3-core/src/com/jme3/gde/core/assets/actions/OpenModel.java index d2c6cdd66..b1ea9bbbb 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/assets/actions/OpenModel.java +++ b/sdk/jme3-core/src/com/jme3/gde/core/assets/actions/OpenModel.java @@ -82,6 +82,7 @@ public final class OpenModel implements ActionListener { JmeNode jmeNode = NodeUtility.createNode(node); SceneApplication app = SceneApplication.getApplication(); SceneRequest request = new SceneRequest(app, jmeNode, manager); + request.setDataObject(context); request.setWindowTitle("OpenGL Window - View Model"); app.requestScene(request); } else {