Fix OgreXML loading crash when no material specified for geometry
This commit is contained in:
parent
809092c236
commit
badefdf4e4
@ -212,7 +212,10 @@ public class MeshLoader extends DefaultHandler implements AssetLoader {
|
|||||||
|
|
||||||
private void applyMaterial(Geometry geom, String matName) {
|
private void applyMaterial(Geometry geom, String matName) {
|
||||||
Material mat = null;
|
Material mat = null;
|
||||||
if (matName.endsWith(".j3m")) {
|
if (matName == null) {
|
||||||
|
// no material specified. use placeholder.
|
||||||
|
mat = null;
|
||||||
|
} else if (matName.endsWith(".j3m")) {
|
||||||
// load as native jme3 material instance
|
// load as native jme3 material instance
|
||||||
try {
|
try {
|
||||||
mat = assetManager.loadMaterial(matName);
|
mat = assetManager.loadMaterial(matName);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user