- update MaterialEditor to use getValueAsString()
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7200 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
ff344c6a96
commit
a724165a33
@ -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;
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user