Skip to content

Commit 0731b0a

Browse files
committed
jMonkeyEngine#264 Removal of ogrexml. Unsure of whether I've caught everything, but it builds and loads.
1 parent 8cc4c2a commit 0731b0a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+10
-11108
lines changed

jme3-assetpack-support/src/com/jme3/gde/assetpack/AssetPackLoader.java

+2-72
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
import com.jme3.material.MaterialList;
1414
import com.jme3.scene.Node;
1515
import com.jme3.scene.Spatial;
16-
import com.jme3.scene.plugins.ogre.OgreMeshKey;
17-
import com.jme3.scene.plugins.ogre.matext.MaterialExtension;
18-
import com.jme3.scene.plugins.ogre.matext.MaterialExtensionSet;
19-
import com.jme3.scene.plugins.ogre.matext.OgreMaterialKey;
2016
import java.io.File;
2117
import java.io.IOException;
2218
import java.util.ArrayList;
@@ -115,61 +111,7 @@ private static Spatial loadSingleMesh(Element fileElement, NodeList fileNodeList
115111
if ("".equals(materialName)) {
116112
materialName = null;
117113
}
118-
119-
//PREPARE MATEXT
120-
MaterialExtensionSet matExts = new MaterialExtensionSet();
121-
/**
122-
* /base/simple
123-
* /base/normalmap
124-
*/
125-
MaterialExtension baseLightExt = new MaterialExtension("/base/normalmap/specular",
126-
"Common/MatDefs/Light/Lighting.j3md");
127-
baseLightExt.setTextureMapping("DiffuseMap", "DiffuseMap");
128-
baseLightExt.setTextureMapping("NormalHeightMap", "NormalMap");
129-
baseLightExt.setTextureMapping("SpecularMap", "SpecularMap");
130-
matExts.addMaterialExtension(baseLightExt);
131-
132-
MaterialExtension baseLightExt2 = new MaterialExtension("/base/normalmap",
133-
"Common/MatDefs/Light/Lighting.j3md");
134-
baseLightExt2.setTextureMapping("DiffuseMap", "DiffuseMap");
135-
baseLightExt2.setTextureMapping("NormalHeightMap", "NormalMap");
136-
baseLightExt2.setTextureMapping("SpecularMap", "SpecularMap");
137-
matExts.addMaterialExtension(baseLightExt2);
138-
139-
MaterialExtension baseLightExt3 = new MaterialExtension("/base/simple",
140-
"Common/MatDefs/Light/Lighting.j3md");
141-
baseLightExt3.setTextureMapping("DiffuseMap", "DiffuseMap");
142-
baseLightExt3.setTextureMapping("NormalHeightMap", "NormalMap");
143-
baseLightExt3.setTextureMapping("SpecularMap", "SpecularMap");
144-
matExts.addMaterialExtension(baseLightExt3);
145-
146-
//TODO: mesh.xml!!
147-
if (hasExtension(name, "xml") || hasExtension(name, "scene")) {
148-
for (int i = 0; i < fileNodeList.getLength(); i++) {
149-
Element fileElem = (Element) fileNodeList.item(i);
150-
String type = fileElem.getAttribute("type");
151-
String path = fileElem.getAttribute("path");
152-
if ("material".equals(type) && (materialName == null || materialName.equals(path))) {
153-
if (hasExtension(path, "j3m")) {
154-
mat = pm.loadMaterial(path);
155-
} else if (hasExtension(path, "material")) {
156-
if (matList == null) {
157-
Logger.getLogger(AssetPackLoader.class.getName()).log(Level.INFO, "Load Ogre Material");
158-
OgreMaterialKey matKey = new OgreMaterialKey(path);
159-
matKey.setMaterialExtensionSet(matExts);
160-
matList = pm.loadAsset(matKey);
161-
key = new OgreMeshKey(name, matList);
162-
} else {
163-
Logger.getLogger(AssetPackLoader.class.getName()).log(Level.INFO, "Add Ogre Material");
164-
OgreMaterialKey matKey = new OgreMaterialKey(path);
165-
matKey.setMaterialExtensionSet(matExts);
166-
MaterialList newMatList = pm.loadAsset(matKey);
167-
matList.putAll(newMatList);
168-
}
169-
}
170-
}
171-
}
172-
} else if (hasExtension(name, "obj")) {
114+
if (hasExtension(name, "obj")) {
173115
for (int i = 0; i < fileNodeList.getLength(); i++) {
174116
Element fileElem = (Element) fileNodeList.item(i);
175117
String type = fileElem.getAttribute("type");
@@ -194,19 +136,7 @@ private static Spatial loadSingleMesh(Element fileElement, NodeList fileNodeList
194136
if (hasExtension(path, "j3m")) {
195137
mat = pm.loadMaterial(path);
196138
} else if (hasExtension(path, "material")) {
197-
if (matList == null) {
198-
Logger.getLogger(AssetPackLoader.class.getName()).log(Level.INFO, "Load Ogre Material");
199-
OgreMaterialKey matKey = new OgreMaterialKey(path);
200-
matKey.setMaterialExtensionSet(matExts);
201-
matList = pm.loadAsset(matKey);
202-
key = new OgreMeshKey(name, matList);
203-
} else {
204-
Logger.getLogger(AssetPackLoader.class.getName()).log(Level.INFO, "Add Ogre Material");
205-
OgreMaterialKey matKey = new OgreMaterialKey(path);
206-
matKey.setMaterialExtensionSet(matExts);
207-
MaterialList newMatList = pm.loadAsset(matKey);
208-
matList.putAll(newMatList);
209-
}
139+
Logger.getLogger(AssetPackLoader.class.getName()).log(Level.WARNING, "Ogre Material not supported.");
210140
}
211141
}
212142
}

jme3-assetpack-support/src/com/jme3/gde/assetpack/project/AssetPackProjectLogicalView.java

+6-10
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
import com.jme3.gde.assetpack.browser.nodes.AssetPackBrowserFolder;
44
import com.jme3.gde.assetpack.project.actions.CleanupProjectAction;
5-
import com.jme3.gde.assetpack.project.actions.ConvertOgreBinaryMeshesAction;
6-
import com.jme3.gde.assetpack.project.actions.ImportWorldForgeAction;
75
import com.jme3.gde.assetpack.project.actions.PublishAssetPackAction;
86
import java.awt.Image;
97
import java.util.LinkedList;
@@ -61,14 +59,12 @@ public ProjectNode(AssetPackProject project) throws DataObjectNotFoundException
6159
public Action[] getActions(boolean arg0) {
6260
Action[] nodeActions = new Action[9];
6361
nodeActions[0] = new PublishAssetPackAction(project);
64-
nodeActions[1] = new ConvertOgreBinaryMeshesAction(project);
65-
nodeActions[2] = new ImportWorldForgeAction(project);
66-
nodeActions[3] = new CleanupProjectAction(project);
67-
nodeActions[4] = CommonProjectActions.copyProjectAction();
68-
nodeActions[5] = CommonProjectActions.deleteProjectAction();
69-
nodeActions[6] = CommonProjectActions.setAsMainProjectAction();
70-
nodeActions[7] = CommonProjectActions.closeProjectAction();
71-
nodeActions[8] = CommonProjectActions.customizeProjectAction();
62+
nodeActions[1] = new CleanupProjectAction(project);
63+
nodeActions[2] = CommonProjectActions.copyProjectAction();
64+
nodeActions[3] = CommonProjectActions.deleteProjectAction();
65+
nodeActions[4] = CommonProjectActions.setAsMainProjectAction();
66+
nodeActions[5] = CommonProjectActions.closeProjectAction();
67+
nodeActions[6] = CommonProjectActions.customizeProjectAction();
7268
return nodeActions;
7369
}
7470

jme3-assetpack-support/src/com/jme3/gde/assetpack/project/actions/ConvertOgreBinaryMeshesAction.java

-154
This file was deleted.

0 commit comments

Comments
 (0)