mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
Re-enables reimport of assets if there's no external originalFilePath defined(such as due to in-place import, or file path differs from original importing machine)
This commit is contained in:
parent
8d8a4b2534
commit
b3c8e0707d
1 changed files with 15 additions and 3 deletions
|
|
@ -1023,8 +1023,20 @@ function AssetBrowser::reImportAsset(%this)
|
||||||
|
|
||||||
%reimportingPath = %assetDef.originalFilePath;
|
%reimportingPath = %assetDef.originalFilePath;
|
||||||
|
|
||||||
|
if(%reimportingPath $= "" || !isFile(%reimportingPath))
|
||||||
|
{
|
||||||
|
//if we have no defined original file path, attempt to re-import the
|
||||||
|
//current loosefile
|
||||||
|
if(%assetType $= "ShapeAsset")
|
||||||
|
%reimportingPath = %assetDef.getShapePath();
|
||||||
|
else if(%assetType $= "ImageAsset")
|
||||||
|
%reimportingPath = %assetDef.getImagePath();
|
||||||
|
else if(%assetType $= "SoundAsset")
|
||||||
|
%reimportingPath = %assetDef.getSoundPath();
|
||||||
|
}
|
||||||
|
|
||||||
//first, double-check we have an originating file. if we don't then we need to basically go out looking for it
|
//first, double-check we have an originating file. if we don't then we need to basically go out looking for it
|
||||||
if(!isFile(%assetDef.originalFilePath))
|
if(!isFile(%reimportingPath))
|
||||||
{
|
{
|
||||||
//if(%assetType $= "ImageAsset")
|
//if(%assetType $= "ImageAsset")
|
||||||
// %filters = "";
|
// %filters = "";
|
||||||
|
|
@ -1089,7 +1101,7 @@ function AssetBrowserPreviewButton::onRightClick(%this)
|
||||||
EditAssetPopup.enableItem(9, false);
|
EditAssetPopup.enableItem(9, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(AssetDatabase.acquireAsset(EditAssetPopup.assetId))
|
/*if(AssetDatabase.acquireAsset(EditAssetPopup.assetId))
|
||||||
{
|
{
|
||||||
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
|
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
|
||||||
if(%assetDef.originalFilePath $= "" || !isFile(%assetDef.originalFilePath))
|
if(%assetDef.originalFilePath $= "" || !isFile(%assetDef.originalFilePath))
|
||||||
|
|
@ -1099,7 +1111,7 @@ function AssetBrowserPreviewButton::onRightClick(%this)
|
||||||
EditAssetPopup.enableItem(9, false);
|
EditAssetPopup.enableItem(9, false);
|
||||||
}
|
}
|
||||||
AssetDatabase.releaseAsset(EditAssetPopup.assetId);
|
AssetDatabase.releaseAsset(EditAssetPopup.assetId);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
if(%assetType $= "LevelAsset")
|
if(%assetType $= "LevelAsset")
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue