diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/MaterialPropertyEditor.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/MaterialPropertyEditor.java index d8afcf913..4b40e098d 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/MaterialPropertyEditor.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/MaterialPropertyEditor.java @@ -109,13 +109,13 @@ public class MaterialPropertyEditor implements PropertyEditor, SceneExplorerProp FileObject currentFile = obj.getPrimaryFile(); FileObject currentFolder = currentFile.getParent(); try { - int i = 1; - FileObject newFile = currentFolder.getFileObject(currentFile.getName() + "_" + i, "j3m"); + int i = 0; + FileObject newFile = currentFolder.getFileObject(currentFile.getName(), "j3m"); while (newFile != null) { i++; - newFile = currentFolder.getFileObject(currentFile.getName() + "_" + i, "j3m"); + newFile = currentFolder.getFileObject(currentFile.getName() + "-" + i, "j3m"); } - newFile = currentFolder.createData(currentFile.getName() + "_" + i, "j3m"); + newFile = currentFolder.createData(currentFile.getName() + "-" + i, "j3m"); EditableMaterialFile properties = new EditableMaterialFile(newFile, pm); material.setKey(new MaterialKey(pm.getRelativeAssetPath(newFile.getPath()))); properties.setAsMaterial(material);