Browse Source

- show correct material j3m in SceneExplorer

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7184 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
nor..67 14 years ago
parent
commit
b66569b6f1

+ 8 - 2
jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/properties/MaterialPropertyEditor.java

@@ -81,7 +81,11 @@ public class MaterialPropertyEditor implements PropertyEditor {
     }
     }
 
 
     public String getAsText() {
     public String getAsText() {
-        return material.toString();
+        String name = material.getAssetName();
+        if (name == null) {
+            name = "stored in file";
+        }
+        return name;
     }
     }
 
 
     public void setAsText(final String text) throws IllegalArgumentException {
     public void setAsText(final String text) throws IllegalArgumentException {
@@ -109,7 +113,9 @@ public class MaterialPropertyEditor implements PropertyEditor {
 
 
     public String[] getTags() {
     public String[] getTags() {
         SceneRequest request = SceneApplication.getApplication().getCurrentSceneRequest();
         SceneRequest request = SceneApplication.getApplication().getCurrentSceneRequest();
-        if(request==null) return new String[]{};
+        if (request == null) {
+            return new String[]{};
+        }
         String[] mats = request.getManager().getMaterials();
         String[] mats = request.getManager().getMaterials();
         return mats;
         return mats;
     }
     }