* Ogre3D models exported from blender2ogre / Blender 2.63 now work by avoiding submeshname DTD violation
* Small grammer fix in FileLocator exception git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9441 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
95fb3eabbd
commit
4ee09fa52e
@ -51,7 +51,7 @@ public class FileLocator implements AssetLocator {
|
|||||||
try {
|
try {
|
||||||
root = new File(rootPath).getCanonicalFile();
|
root = new File(rootPath).getCanonicalFile();
|
||||||
if (!root.isDirectory()){
|
if (!root.isDirectory()){
|
||||||
throw new IllegalArgumentException("Given root path \"" + root + "\" not a directory");
|
throw new IllegalArgumentException("Given root path \"" + root + "\" is not a directory");
|
||||||
}
|
}
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
throw new AssetLoadException("Root path is invalid", ex);
|
throw new AssetLoadException("Root path is invalid", ex);
|
||||||
|
@ -101,6 +101,7 @@ public class MeshLoader extends DefaultHandler implements AssetLoader {
|
|||||||
private int vertCount;
|
private int vertCount;
|
||||||
private boolean usesSharedVerts;
|
private boolean usesSharedVerts;
|
||||||
private boolean usesBigIndices;
|
private boolean usesBigIndices;
|
||||||
|
private boolean submeshNamesHack;
|
||||||
// Global data
|
// Global data
|
||||||
private Mesh sharedMesh;
|
private Mesh sharedMesh;
|
||||||
private int meshIndex = 0;
|
private int meshIndex = 0;
|
||||||
@ -138,6 +139,7 @@ public class MeshLoader extends DefaultHandler implements AssetLoader {
|
|||||||
animData = null;
|
animData = null;
|
||||||
|
|
||||||
actuallyHasWeights = false;
|
actuallyHasWeights = false;
|
||||||
|
submeshNamesHack = false;
|
||||||
indicesData = null;
|
indicesData = null;
|
||||||
weightsFloatData = null;
|
weightsFloatData = null;
|
||||||
}
|
}
|
||||||
@ -649,10 +651,15 @@ public class MeshLoader extends DefaultHandler implements AssetLoader {
|
|||||||
} else if (qName.equals("boneassignments")) {
|
} else if (qName.equals("boneassignments")) {
|
||||||
startBoneAssigns();
|
startBoneAssigns();
|
||||||
} else if (qName.equals("submesh")) {
|
} else if (qName.equals("submesh")) {
|
||||||
startSubMesh(attribs.getValue("material"),
|
if (submeshNamesHack) {
|
||||||
attribs.getValue("usesharedvertices"),
|
// Hack for blender2ogre only
|
||||||
attribs.getValue("use32bitindexes"),
|
startSubmeshName(attribs.getValue("index"), attribs.getValue("name"));
|
||||||
attribs.getValue("operationtype"));
|
} else {
|
||||||
|
startSubMesh(attribs.getValue("material"),
|
||||||
|
attribs.getValue("usesharedvertices"),
|
||||||
|
attribs.getValue("use32bitindexes"),
|
||||||
|
attribs.getValue("operationtype"));
|
||||||
|
}
|
||||||
} else if (qName.equals("sharedgeometry")) {
|
} else if (qName.equals("sharedgeometry")) {
|
||||||
String count = attribs.getValue("vertexcount");
|
String count = attribs.getValue("vertexcount");
|
||||||
if (count == null) {
|
if (count == null) {
|
||||||
@ -668,6 +675,9 @@ public class MeshLoader extends DefaultHandler implements AssetLoader {
|
|||||||
startSkeleton(attribs.getValue("name"));
|
startSkeleton(attribs.getValue("name"));
|
||||||
} else if (qName.equals("submeshnames")) {
|
} else if (qName.equals("submeshnames")) {
|
||||||
// ok
|
// ok
|
||||||
|
// setting submeshNamesHack to true will make "submesh" tag be interpreted
|
||||||
|
// as a "submeshname" tag.
|
||||||
|
submeshNamesHack = true;
|
||||||
} else if (qName.equals("submeshname")) {
|
} else if (qName.equals("submeshname")) {
|
||||||
startSubmeshName(attribs.getValue("index"), attribs.getValue("name"));
|
startSubmeshName(attribs.getValue("index"), attribs.getValue("name"));
|
||||||
} else if (qName.equals("mesh")) {
|
} else if (qName.equals("mesh")) {
|
||||||
@ -733,6 +743,9 @@ public class MeshLoader extends DefaultHandler implements AssetLoader {
|
|||||||
endLevelOfDetail();
|
endLevelOfDetail();
|
||||||
} else if (qName.equals("boneassignments")) {
|
} else if (qName.equals("boneassignments")) {
|
||||||
endBoneAssigns();
|
endBoneAssigns();
|
||||||
|
} else if (qName.equals("submeshnames")) {
|
||||||
|
// Restore default handling for "submesh" tag.
|
||||||
|
submeshNamesHack = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user