|
|
@ -107,7 +107,6 @@ public class MaterialPropertyEditor implements PropertyEditor, SceneExplorerProp |
|
|
|
FileObject currentFile = obj.getPrimaryFile(); |
|
|
|
FileObject currentFile = obj.getPrimaryFile(); |
|
|
|
FileObject currentFolder = currentFile.getParent(); |
|
|
|
FileObject currentFolder = currentFile.getParent(); |
|
|
|
try { |
|
|
|
try { |
|
|
|
Material old = material.clone(); |
|
|
|
|
|
|
|
int i = 1; |
|
|
|
int i = 1; |
|
|
|
FileObject newFile = currentFolder.getFileObject(currentFile.getName() + "_" + i, "j3m"); |
|
|
|
FileObject newFile = currentFolder.getFileObject(currentFile.getName() + "_" + i, "j3m"); |
|
|
|
while (newFile != null) { |
|
|
|
while (newFile != null) { |
|
|
@ -118,14 +117,18 @@ public class MaterialPropertyEditor implements PropertyEditor, SceneExplorerProp |
|
|
|
MaterialProperties properties = new MaterialProperties(newFile, pm); |
|
|
|
MaterialProperties properties = new MaterialProperties(newFile, pm); |
|
|
|
material.setAssetName(pm.getRelativeAssetPath(newFile.getPath())); |
|
|
|
material.setAssetName(pm.getRelativeAssetPath(newFile.getPath())); |
|
|
|
properties.setAsMaterial(material); |
|
|
|
properties.setAsMaterial(material); |
|
|
|
notifyListeners(old, material); |
|
|
|
|
|
|
|
currentFolder.refresh(); |
|
|
|
currentFolder.refresh(); |
|
|
|
|
|
|
|
applyMaterial(material.getAssetName()); |
|
|
|
} catch (IOException ex) { |
|
|
|
} catch (IOException ex) { |
|
|
|
Exceptions.printStackTrace(ex); |
|
|
|
Exceptions.printStackTrace(ex); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
}else{ |
|
|
|
|
|
|
|
applyMaterial(text); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void applyMaterial(final String text) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
Material old = material; |
|
|
|
Material old = material; |
|
|
|
SceneApplication.getApplication().enqueue(new Callable<Void>() { |
|
|
|
SceneApplication.getApplication().enqueue(new Callable<Void>() { |
|
|
|