Browse Source

- update MaterialEditor to use getValueAsString()

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

+ 1 - 1
jme3-materialeditor/src/com/jme3/gde/materials/EditableMaterialFile.java

@@ -42,7 +42,7 @@ public class EditableMaterialFile {
     private List<String> matDefEntries = new ArrayList<String>();
     private ProjectAssetManager manager;
     private FileSystem fs;
-    public static final String[] variableTypes = new String[]{"Int", "Boolean", "Float", "Vector2", "Vector3", "Vector4", "Color", "Texture2D", "TextureCubeMap"};
+    public static final String[] variableTypes = new String[]{"Int", "Boolean", "Float", "Vector2", "Vector3", "Vector4", "Color", "Texture2D", "Texture3D", "TextureArray", "TextureBuffer", "TextureCubeMap"};
 
     public EditableMaterialFile(FileObject material, ProjectAssetManager manager) {
         this.material = material;

+ 1 - 15
jme3-materialeditor/src/com/jme3/gde/materials/MaterialProperty.java

@@ -33,21 +33,7 @@ public class MaterialProperty {
         this.type = param.getVarType().name();
         this.name = param.getName();
         Object obj = param.getValue();
-        this.value = obj.toString();
-        //TODO: change to correct string
-        if (obj instanceof ColorRGBA) {
-            value = value.replaceAll("Color\\[([^\\]]*)\\]", "$1");
-            value = value.replaceAll(",", "");
-        } else if (obj instanceof Texture2D) {
-            AssetKey key = ((Texture2D) obj).getKey();
-            String flip = "";
-            if (key instanceof TextureKey) {
-                if (((TextureKey) key).isFlipY()) {
-                    flip = "Flip ";
-                }
-            }
-            value = value.replaceAll("Texture2D\\[name=([^,]*)\\,([^\\]]*)]", flip + "$1");
-        }
+        this.value = param.getValueAsString();
     }
 
     /**