diff --git a/sdk/jme3-blender/src/com/jme3/gde/blender/filetypes/AbstractBlenderImportDataObject.java b/sdk/jme3-blender/src/com/jme3/gde/blender/filetypes/AbstractBlenderImportDataObject.java index b476d9784..307293653 100644 --- a/sdk/jme3-blender/src/com/jme3/gde/blender/filetypes/AbstractBlenderImportDataObject.java +++ b/sdk/jme3-blender/src/com/jme3/gde/blender/filetypes/AbstractBlenderImportDataObject.java @@ -74,9 +74,7 @@ public abstract class AbstractBlenderImportDataObject extends SpatialAssetDataOb String assetKeyName = mgr.getRelativeAssetPath(outFile.getPath()); BlenderKey key = new BlenderKey(assetKeyName); Beans.copyProperties(key, getAssetKey()); - FileLock lock = null; try { - lock = getPrimaryFile().lock(); listListener.start(); Spatial spatial = mgr.loadModel(key); replaceFiles(); @@ -85,12 +83,9 @@ public abstract class AbstractBlenderImportDataObject extends SpatialAssetDataOb savable = spatial; logger.log(Level.INFO, "Loaded asset {0}", getName()); return spatial; - } catch (IOException ex) { + } catch (Exception ex) { Exceptions.printStackTrace(ex); } finally { - if (lock != null) { - lock.releaseLock(); - } try { outFile.delete(); } catch (IOException ex) { diff --git a/sdk/jme3-core/src/com/jme3/gde/core/assets/AssetDataObject.java b/sdk/jme3-core/src/com/jme3/gde/core/assets/AssetDataObject.java index c00089ff5..cdffcc7b0 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/assets/AssetDataObject.java +++ b/sdk/jme3-core/src/com/jme3/gde/core/assets/AssetDataObject.java @@ -220,7 +220,7 @@ public class AssetDataObject extends MultiDataObject { ProgressHandle progressHandle = ProgressHandleFactory.createHandle("Saving File.."); progressHandle.start(); BinaryExporter exp = BinaryExporter.getInstance(); - FileLock lock = null; +// FileLock lock = null; OutputStream out = null; try { if (saveExtension == null) { @@ -235,16 +235,16 @@ public class AssetDataObject extends MultiDataObject { } exp.save(savable, out); } finally { - if (lock != null) { - lock.releaseLock(); - } +// if (lock != null) { +// lock.releaseLock(); +// } if (out != null) { out.close(); } } progressHandle.finish(); setModified(false); - logger.log(LogLevel.USERINFO, "File {0} saved successfully", getPrimaryFile().getNameExt()); + logger.log(Level.INFO, "File {0} saved successfully", getPrimaryFile().getNameExt()); } /** diff --git a/sdk/jme3-core/src/com/jme3/gde/core/assets/SpatialAssetDataObject.java b/sdk/jme3-core/src/com/jme3/gde/core/assets/SpatialAssetDataObject.java index 4a66878a2..3942c9960 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/assets/SpatialAssetDataObject.java +++ b/sdk/jme3-core/src/com/jme3/gde/core/assets/SpatialAssetDataObject.java @@ -89,25 +89,18 @@ public class SpatialAssetDataObject extends AssetDataObject { } //make sure its actually closed and all data gets reloaded closeAsset(); - FileLock lock = null; try { - lock = getPrimaryFile().lock(); listListener.start(); Spatial spatial = mgr.loadModel(getAssetKey()); listListener.stop(); if (!(this instanceof BinaryModelDataObject)) { SpatialUtil.storeOriginalPathUserData(spatial); } - lock.releaseLock(); savable = spatial; logger.log(Level.INFO, "Loaded asset {0}", getName()); return spatial; } catch (Exception ex) { Exceptions.printStackTrace(ex); - } finally { - if (lock != null) { - lock.releaseLock(); - } } return null; } diff --git a/sdk/jme3-ogretools/src/com/jme3/gde/ogretools/OgreBinaryMeshDataObject.java b/sdk/jme3-ogretools/src/com/jme3/gde/ogretools/OgreBinaryMeshDataObject.java index 0723003d3..d92c98687 100644 --- a/sdk/jme3-ogretools/src/com/jme3/gde/ogretools/OgreBinaryMeshDataObject.java +++ b/sdk/jme3-ogretools/src/com/jme3/gde/ogretools/OgreBinaryMeshDataObject.java @@ -42,47 +42,36 @@ public class OgreBinaryMeshDataObject extends SpatialAssetDataObject { } //make sure its actually closed and all data gets reloaded closeAsset(); - ProgressHandle handle = ProgressHandleFactory.createHandle("Converting OgreBinary"); - handle.start(); //mesh OgreXMLConvertOptions options = new OgreXMLConvertOptions(getPrimaryFile().getPath()); options.setBinaryFile(true); OgreXMLConvert conv = new OgreXMLConvert(); - conv.doConvert(options, handle); + conv.doConvert(options, null); //try skeleton if (getPrimaryFile().existsExt("skeleton")) { OgreXMLConvertOptions options2 = new OgreXMLConvertOptions(getPrimaryFile().getParent().getFileObject(getPrimaryFile().getName(), "skeleton").getPath()); options2.setBinaryFile(true); OgreXMLConvert conv2 = new OgreXMLConvert(); - conv2.doConvert(options2, handle); + conv2.doConvert(options2, null); } - handle.progress("Convert Model"); String assetKey = mgr.getRelativeAssetPath(options.getDestFile()); - FileLock lock = null; try { - lock = getPrimaryFile().lock(); listListener.start(); Spatial spatial = mgr.loadModel(assetKey); //replace transient xml files in list of assets for this model replaceXmlFiles(mgr); listListener.stop(); SpatialUtil.storeOriginalPathUserData(spatial); - lock.releaseLock(); File deleteFile = new File(options.getDestFile()); deleteFile.delete(); - handle.finish(); savable = spatial; logger.log(Level.INFO, "Loaded asset {0}", getName()); return spatial; - } catch (IOException ex) { + } catch (Exception ex) { Exceptions.printStackTrace(ex); - if (lock != null) { - lock.releaseLock(); - } } File deleteFile = new File(options.getDestFile()); deleteFile.delete(); - handle.finish(); return null; }