|
|
@ -790,36 +790,36 @@ public class MeshLoader extends DefaultHandler implements AssetLoader { |
|
|
|
} |
|
|
|
} |
|
|
|
assetManager = info.getManager(); |
|
|
|
assetManager = info.getManager(); |
|
|
|
|
|
|
|
|
|
|
|
OgreMeshKey meshKey = null; |
|
|
|
|
|
|
|
if (key instanceof OgreMeshKey) { |
|
|
|
if (key instanceof OgreMeshKey) { |
|
|
|
meshKey = (OgreMeshKey) key; |
|
|
|
// OgreMeshKey is being used, try getting the material list
|
|
|
|
|
|
|
|
// from it
|
|
|
|
|
|
|
|
OgreMeshKey meshKey = (OgreMeshKey) key; |
|
|
|
materialList = meshKey.getMaterialList(); |
|
|
|
materialList = meshKey.getMaterialList(); |
|
|
|
String materialName = meshKey.getMaterialName(); |
|
|
|
String materialName = meshKey.getMaterialName(); |
|
|
|
if (materialList == null) { |
|
|
|
|
|
|
|
if (materialName != null) { |
|
|
|
// Material list not set but material name is available
|
|
|
|
try { |
|
|
|
if (materialList == null && materialName != null) { |
|
|
|
materialList = (MaterialList) assetManager.loadAsset(new OgreMaterialKey(folderName + materialName + ".material")); |
|
|
|
OgreMaterialKey materialKey = new OgreMaterialKey(folderName + materialName + ".material"); |
|
|
|
} catch (AssetNotFoundException e) { |
|
|
|
try { |
|
|
|
logger.log(Level.WARNING, "Cannot locate {0}{1}.material for model {2}{3}.{4}", new Object[]{folderName, materialName, folderName, meshName, ext}); |
|
|
|
materialList = (MaterialList) assetManager.loadAsset(materialKey); |
|
|
|
logger.log(Level.WARNING, "", e); |
|
|
|
} catch (AssetNotFoundException e) { |
|
|
|
} |
|
|
|
logger.log(Level.WARNING, "Cannot locate {0} for model {1}", new Object[]{materialKey, key}); |
|
|
|
} else { |
|
|
|
logger.log(Level.WARNING, "", e); |
|
|
|
try { |
|
|
|
|
|
|
|
materialList = (MaterialList) assetManager.loadAsset(new OgreMaterialKey(folderName + meshName + ".material")); |
|
|
|
|
|
|
|
} catch (AssetNotFoundException e) { |
|
|
|
|
|
|
|
logger.log(Level.WARNING, "Cannot locate {0}{1}.material for model {2}{3}.{4}", new Object[]{folderName, meshName, folderName, meshName, ext}); |
|
|
|
|
|
|
|
logger.log(Level.WARNING, "", e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// If for some reason material list could not be found through
|
|
|
|
|
|
|
|
// OgreMeshKey, or if regular ModelKey specified, load using
|
|
|
|
|
|
|
|
// default method.
|
|
|
|
|
|
|
|
if (materialList == null){ |
|
|
|
|
|
|
|
OgreMaterialKey materialKey = new OgreMaterialKey(folderName + meshName + ".material"); |
|
|
|
try { |
|
|
|
try { |
|
|
|
materialList = (MaterialList) assetManager.loadAsset(new OgreMaterialKey(folderName + meshName + ".material")); |
|
|
|
materialList = (MaterialList) assetManager.loadAsset(materialKey); |
|
|
|
} catch (AssetNotFoundException e) { |
|
|
|
} catch (AssetNotFoundException e) { |
|
|
|
logger.log(Level.WARNING, "Cannot locate {0}{1}.material for model {2}{3}.{4}", new Object[]{folderName, meshName, folderName, meshName, ext}); |
|
|
|
logger.log(Level.WARNING, "Cannot locate {0} for model {1}", new Object[]{ materialKey, key }); |
|
|
|
logger.log(Level.WARNING, "", e); |
|
|
|
logger.log(Level.WARNING, "", e); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Added by larynx 25.06.2011
|
|
|
|
// Added by larynx 25.06.2011
|
|
|
|