Kaynağa Gözat

SDK:
- Add some more logging to ImportModel

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10221 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

nor..67 12 yıl önce
ebeveyn
işleme
8a063afafa

+ 13 - 9
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) {