- 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 List<String> matDefEntries = new ArrayList<String>();
|
||||||
private ProjectAssetManager manager;
|
private ProjectAssetManager manager;
|
||||||
private FileSystem fs;
|
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) {
|
public EditableMaterialFile(FileObject material, ProjectAssetManager manager) {
|
||||||
this.material = material;
|
this.material = material;
|
||||||
|
@ -33,21 +33,7 @@ public class MaterialProperty {
|
|||||||
this.type = param.getVarType().name();
|
this.type = param.getVarType().name();
|
||||||
this.name = param.getName();
|
this.name = param.getName();
|
||||||
Object obj = param.getValue();
|
Object obj = param.getValue();
|
||||||
this.value = obj.toString();
|
this.value = param.getValueAsString();
|
||||||
//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");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user