Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#264 Removal of ogrexml. Unsure of whether I've caught everything, bu… #309

Merged
merged 1 commit into from
Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
import com.jme3.material.MaterialList;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import com.jme3.scene.plugins.ogre.OgreMeshKey;
import com.jme3.scene.plugins.ogre.matext.MaterialExtension;
import com.jme3.scene.plugins.ogre.matext.MaterialExtensionSet;
import com.jme3.scene.plugins.ogre.matext.OgreMaterialKey;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
Expand Down Expand Up @@ -115,61 +111,7 @@ private static Spatial loadSingleMesh(Element fileElement, NodeList fileNodeList
if ("".equals(materialName)) {
materialName = null;
}

//PREPARE MATEXT
MaterialExtensionSet matExts = new MaterialExtensionSet();
/**
* /base/simple
* /base/normalmap
*/
MaterialExtension baseLightExt = new MaterialExtension("/base/normalmap/specular",
"Common/MatDefs/Light/Lighting.j3md");
baseLightExt.setTextureMapping("DiffuseMap", "DiffuseMap");
baseLightExt.setTextureMapping("NormalHeightMap", "NormalMap");
baseLightExt.setTextureMapping("SpecularMap", "SpecularMap");
matExts.addMaterialExtension(baseLightExt);

MaterialExtension baseLightExt2 = new MaterialExtension("/base/normalmap",
"Common/MatDefs/Light/Lighting.j3md");
baseLightExt2.setTextureMapping("DiffuseMap", "DiffuseMap");
baseLightExt2.setTextureMapping("NormalHeightMap", "NormalMap");
baseLightExt2.setTextureMapping("SpecularMap", "SpecularMap");
matExts.addMaterialExtension(baseLightExt2);

MaterialExtension baseLightExt3 = new MaterialExtension("/base/simple",
"Common/MatDefs/Light/Lighting.j3md");
baseLightExt3.setTextureMapping("DiffuseMap", "DiffuseMap");
baseLightExt3.setTextureMapping("NormalHeightMap", "NormalMap");
baseLightExt3.setTextureMapping("SpecularMap", "SpecularMap");
matExts.addMaterialExtension(baseLightExt3);

//TODO: mesh.xml!!
if (hasExtension(name, "xml") || hasExtension(name, "scene")) {
for (int i = 0; i < fileNodeList.getLength(); i++) {
Element fileElem = (Element) fileNodeList.item(i);
String type = fileElem.getAttribute("type");
String path = fileElem.getAttribute("path");
if ("material".equals(type) && (materialName == null || materialName.equals(path))) {
if (hasExtension(path, "j3m")) {
mat = pm.loadMaterial(path);
} else if (hasExtension(path, "material")) {
if (matList == null) {
Logger.getLogger(AssetPackLoader.class.getName()).log(Level.INFO, "Load Ogre Material");
OgreMaterialKey matKey = new OgreMaterialKey(path);
matKey.setMaterialExtensionSet(matExts);
matList = pm.loadAsset(matKey);
key = new OgreMeshKey(name, matList);
} else {
Logger.getLogger(AssetPackLoader.class.getName()).log(Level.INFO, "Add Ogre Material");
OgreMaterialKey matKey = new OgreMaterialKey(path);
matKey.setMaterialExtensionSet(matExts);
MaterialList newMatList = pm.loadAsset(matKey);
matList.putAll(newMatList);
}
}
}
}
} else if (hasExtension(name, "obj")) {
if (hasExtension(name, "obj")) {
for (int i = 0; i < fileNodeList.getLength(); i++) {
Element fileElem = (Element) fileNodeList.item(i);
String type = fileElem.getAttribute("type");
Expand All @@ -194,19 +136,7 @@ private static Spatial loadSingleMesh(Element fileElement, NodeList fileNodeList
if (hasExtension(path, "j3m")) {
mat = pm.loadMaterial(path);
} else if (hasExtension(path, "material")) {
if (matList == null) {
Logger.getLogger(AssetPackLoader.class.getName()).log(Level.INFO, "Load Ogre Material");
OgreMaterialKey matKey = new OgreMaterialKey(path);
matKey.setMaterialExtensionSet(matExts);
matList = pm.loadAsset(matKey);
key = new OgreMeshKey(name, matList);
} else {
Logger.getLogger(AssetPackLoader.class.getName()).log(Level.INFO, "Add Ogre Material");
OgreMaterialKey matKey = new OgreMaterialKey(path);
matKey.setMaterialExtensionSet(matExts);
MaterialList newMatList = pm.loadAsset(matKey);
matList.putAll(newMatList);
}
Logger.getLogger(AssetPackLoader.class.getName()).log(Level.WARNING, "Ogre Material not supported.");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import com.jme3.gde.assetpack.browser.nodes.AssetPackBrowserFolder;
import com.jme3.gde.assetpack.project.actions.CleanupProjectAction;
import com.jme3.gde.assetpack.project.actions.ConvertOgreBinaryMeshesAction;
import com.jme3.gde.assetpack.project.actions.ImportWorldForgeAction;
import com.jme3.gde.assetpack.project.actions.PublishAssetPackAction;
import java.awt.Image;
import java.util.LinkedList;
Expand Down Expand Up @@ -61,14 +59,12 @@ public ProjectNode(AssetPackProject project) throws DataObjectNotFoundException
public Action[] getActions(boolean arg0) {
Action[] nodeActions = new Action[9];
nodeActions[0] = new PublishAssetPackAction(project);
nodeActions[1] = new ConvertOgreBinaryMeshesAction(project);
nodeActions[2] = new ImportWorldForgeAction(project);
nodeActions[3] = new CleanupProjectAction(project);
nodeActions[4] = CommonProjectActions.copyProjectAction();
nodeActions[5] = CommonProjectActions.deleteProjectAction();
nodeActions[6] = CommonProjectActions.setAsMainProjectAction();
nodeActions[7] = CommonProjectActions.closeProjectAction();
nodeActions[8] = CommonProjectActions.customizeProjectAction();
nodeActions[1] = new CleanupProjectAction(project);
nodeActions[2] = CommonProjectActions.copyProjectAction();
nodeActions[3] = CommonProjectActions.deleteProjectAction();
nodeActions[4] = CommonProjectActions.setAsMainProjectAction();
nodeActions[5] = CommonProjectActions.closeProjectAction();
nodeActions[6] = CommonProjectActions.customizeProjectAction();
return nodeActions;
}

Expand Down

This file was deleted.

Loading