浏览代码

SDK:
- do not overwrite "ORIGINAL_PATH" AssetData property when saving a j3o file another time

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10229 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

nor..67 12 年之前
父节点
当前提交
095d94ceb5
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      jme3-core/src/com/jme3/gde/core/assets/SpatialAssetDataObject.java

+ 4 - 2
jme3-core/src/com/jme3/gde/core/assets/SpatialAssetDataObject.java

@@ -65,7 +65,7 @@ public class SpatialAssetDataObject extends AssetDataObject {
     public synchronized ModelKey getAssetKey() {
     public synchronized ModelKey getAssetKey() {
         AssetKey superKey = super.getAssetKey();
         AssetKey superKey = super.getAssetKey();
         if (superKey instanceof ModelKey) {
         if (superKey instanceof ModelKey) {
-            return (ModelKey)superKey;
+            return (ModelKey) superKey;
         } else {
         } else {
             ProjectAssetManager mgr = getLookup().lookup(ProjectAssetManager.class);
             ProjectAssetManager mgr = getLookup().lookup(ProjectAssetManager.class);
             if (mgr == null) {
             if (mgr == null) {
@@ -128,7 +128,9 @@ public class SpatialAssetDataObject extends AssetDataObject {
             DataObject targetModel = DataObject.find(outFile);
             DataObject targetModel = DataObject.find(outFile);
             AssetData properties = targetModel.getLookup().lookup(AssetData.class);
             AssetData properties = targetModel.getLookup().lookup(AssetData.class);
             if (properties != null) {
             if (properties != null) {
-                properties.setProperty("ORIGINAL_PATH", mgr.getRelativeAssetPath(outFile.getPath()));
+                if (properties.getProperty("ORIGINAL_PATH") == null) {
+                    properties.setProperty("ORIGINAL_PATH", mgr.getRelativeAssetPath(outFile.getPath()));
+                }
             }
             }
         } catch (Exception ex) {
         } catch (Exception ex) {
             Exceptions.printStackTrace(ex);
             Exceptions.printStackTrace(ex);