@@ -1023,8 +1023,20 @@ function AssetBrowser::reImportAsset(%this)
10231023
10241024 %reimportingPath = %assetDef.originalFilePath;
10251025
1026+ if(%reimportingPath $= "" || !isFile(%reimportingPath))
1027+ {
1028+ //if we have no defined original file path, attempt to re-import the
1029+ //current loosefile
1030+ if(%assetType $= "ShapeAsset")
1031+ %reimportingPath = %assetDef.getShapePath();
1032+ else if(%assetType $= "ImageAsset")
1033+ %reimportingPath = %assetDef.getImagePath();
1034+ else if(%assetType $= "SoundAsset")
1035+ %reimportingPath = %assetDef.getSoundPath();
1036+ }
1037+
10261038 //first, double-check we have an originating file. if we don't then we need to basically go out looking for it
1027- if(!isFile(%assetDef.originalFilePath ))
1039+ if(!isFile(%reimportingPath ))
10281040 {
10291041 //if(%assetType $= "ImageAsset")
10301042 // %filters = "";
@@ -1089,7 +1101,7 @@ function AssetBrowserPreviewButton::onRightClick(%this)
10891101 EditAssetPopup.enableItem(9, false);
10901102 }
10911103
1092- if(AssetDatabase.acquireAsset(EditAssetPopup.assetId))
1104+ /* if(AssetDatabase.acquireAsset(EditAssetPopup.assetId))
10931105 {
10941106 %assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
10951107 if(%assetDef.originalFilePath $= "" || !isFile(%assetDef.originalFilePath))
@@ -1099,7 +1111,7 @@ function AssetBrowserPreviewButton::onRightClick(%this)
10991111 EditAssetPopup.enableItem(9, false);
11001112 }
11011113 AssetDatabase.releaseAsset(EditAssetPopup.assetId);
1102- }
1114+ }*/
11031115
11041116 if(%assetType $= "LevelAsset")
11051117 {
0 commit comments