From ab8af2545513d7f097637642f45c5fbf70edfd64 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Mon, 28 Jan 2013 03:19:24 +0000 Subject: [PATCH] SDK: - Add some more logging to ImportModel git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10221 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../jme3/gde/modelimporter/ImportModel.java | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/sdk/jme3-model-importer/src/com/jme3/gde/modelimporter/ImportModel.java b/sdk/jme3-model-importer/src/com/jme3/gde/modelimporter/ImportModel.java index d0928d864..66e39a391 100644 --- a/sdk/jme3-model-importer/src/com/jme3/gde/modelimporter/ImportModel.java +++ b/sdk/jme3-model-importer/src/com/jme3/gde/modelimporter/ImportModel.java @@ -265,16 +265,20 @@ public final class ImportModel implements ActionListener { AssetKey curKey = tex.getKey(); UberAssetInfo newInfo = UberAssetLocator.getInfo(curKey); if (newInfo != null) { - logger.log(Level.INFO, "Create new key with name {0}", newInfo.getNewAssetName()); - TextureKey newKey = new TextureKey(newInfo.getNewAssetName()); - Beans.copyProperties(curKey, newKey); - Texture texture = mgr.loadTexture(newKey); - if (texture != null) { - mat.setTextureParam(paramName, paramType, texture); - geom.setMaterial(mat); - logger.log(Level.INFO, "Apply relocated texture {0} for {1}", new Object[]{geom, newKey.getName()}); + if (newInfo.getNewAssetName() != null) { + logger.log(Level.INFO, "Create new key with name {0}", newInfo.getNewAssetName()); + TextureKey newKey = new TextureKey(newInfo.getNewAssetName()); + Beans.copyProperties(curKey, newKey); + Texture texture = mgr.loadTexture(newKey); + if (texture != null) { + mat.setTextureParam(paramName, paramType, texture); + geom.setMaterial(mat); + logger.log(Level.INFO, "Apply relocated texture {0} for {1}", new Object[]{geom, newKey.getName()}); + } else { + logger.log(Level.WARNING, "Could not find relocated texture!"); + } } else { - logger.log(Level.WARNING, "Could not find relocated texture!"); + logger.log(Level.SEVERE, "Don't have name for previously relocated asset {0}, something went wrong!", curKey); } } } catch (Exception ex) {