mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +00:00
Fixes the re-import behavior in the Asset Browser to properly prompt the reimport window with the indicated asset in the AB
Also fixes how the shapeConstructor is searched/parsed when doing reimports vs new import creations Fixes incorrect assetId usage in some of the prototyping shape constructors so they match now
This commit is contained in:
parent
8407fa360c
commit
b54865aa74
13 changed files with 160 additions and 144 deletions
|
|
@ -1213,13 +1213,16 @@ function AssetBrowser::changeAsset(%this)
|
|||
function AssetBrowser::reImportAsset(%this)
|
||||
{
|
||||
//Find out what type it is
|
||||
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
|
||||
%assetType = AssetDatabase.getAssetType(EditAssetPopup.assetId);
|
||||
%assetDef = AssetDatabase.acquireAsset(%this.popupMenu.objectData);
|
||||
%assetType = %this.popupMenu.objectType;
|
||||
|
||||
if(%assetType $= "ShapeAsset" || %assetType $= "ImageAsset" || %assetType $= "SoundAsset")
|
||||
{
|
||||
AssetBrowser.isAssetReImport = true;
|
||||
AssetBrowser.reImportingAssetId = EditAssetPopup.assetId;
|
||||
%this.isAssetReImport = true;
|
||||
%this.reImportingAssetId = %assetDef.getAssetId();
|
||||
|
||||
//just to force it to be fully loaded and prepped on the off chance the asset isn't yet
|
||||
%assetDef.load();
|
||||
|
||||
%reimportingPath = %assetDef.originalFilePath;
|
||||
|
||||
|
|
@ -1262,14 +1265,15 @@ function AssetBrowser::reImportAsset(%this)
|
|||
%dlg.delete();
|
||||
}
|
||||
|
||||
AssetBrowser.onBeginDropFiles();
|
||||
AssetBrowser.onDropFile(%reimportingPath);
|
||||
AssetBrowser.onEndDropFiles();
|
||||
ImportAssetWindow.importer.isReimport = true;
|
||||
%this.onBeginDropFiles();
|
||||
%this.onDropFile(%reimportingPath);
|
||||
%this.onEndDropFiles();
|
||||
|
||||
%module = AssetDatabase.getAssetModule(EditAssetPopup.assetId);
|
||||
%module = AssetDatabase.getAssetModule(%this.reImportingAssetId);
|
||||
|
||||
//get the selected module data
|
||||
ImportAssetModuleList.setText(%module.ModuleId);
|
||||
AssetImportTargetModule.setText(%module.ModuleId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ function ImportAssetWindow::Close(%this)
|
|||
if(ImportAssetWindow.isAwake())
|
||||
ImportAssetWindow.refresh();
|
||||
|
||||
//ImportAssetItems.empty();
|
||||
ImportAssetWindow.importer.isReimport = false;
|
||||
|
||||
Canvas.popDialog();
|
||||
}
|
||||
|
|
@ -336,8 +336,8 @@ function AssetBrowser::addImportingAsset( %this, %assetType, %filePath, %parentA
|
|||
if(%filePath !$= "")
|
||||
%filePath = filePath(%filePath) @ "/" @ fileBase(%filePath) @ fileExt(%filePath);
|
||||
|
||||
%moduleName = AssetBrowser.SelectedModule;
|
||||
ImportAssetModuleList.text = %moduleName;
|
||||
%moduleName = %this.SelectedModule;
|
||||
AssetImportTargetModule.text = %moduleName;
|
||||
|
||||
%assetName = strreplace( %assetName, " ", "_" );
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue