From c6c50eea31012060915c512a8f366bd5c0ddbe1d Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Wed, 30 Jan 2013 03:48:33 +0000 Subject: [PATCH] SDK: - delete blender backup files when importing git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10238 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../filetypes/AbstractBlenderAssetDataObject.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sdk/jme3-blender/src/com/jme3/gde/blender/filetypes/AbstractBlenderAssetDataObject.java b/sdk/jme3-blender/src/com/jme3/gde/blender/filetypes/AbstractBlenderAssetDataObject.java index 1d6db7f23..5160e3964 100644 --- a/sdk/jme3-blender/src/com/jme3/gde/blender/filetypes/AbstractBlenderAssetDataObject.java +++ b/sdk/jme3-blender/src/com/jme3/gde/blender/filetypes/AbstractBlenderAssetDataObject.java @@ -46,11 +46,23 @@ public abstract class AbstractBlenderAssetDataObject extends SpatialAssetDataObj } FileObject mainFile = getPrimaryFile(); BlenderTool.runConversionScript(SUFFIX, mainFile); + mainFile.getParent().refresh(); FileObject outFile = FileUtil.findBrother(mainFile, BlenderTool.TEMP_SUFFIX); if (outFile == null) { logger.log(Level.SEVERE, "Failed to create model, blend file cannot be found"); return null; } + int i = 1; + FileObject blend1File = FileUtil.findBrother(mainFile, BlenderTool.TEMP_SUFFIX + i); + while (blend1File != null) { + try { + blend1File.delete(); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + i++; + blend1File = FileUtil.findBrother(mainFile, BlenderTool.TEMP_SUFFIX + i); + } String assetKey = mgr.getRelativeAssetPath(outFile.getPath()); FileLock lock = null; try {