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:
JeffR 2026-05-02 11:35:20 -05:00
parent 8407fa360c
commit b54865aa74
13 changed files with 160 additions and 144 deletions

View file

@ -1,6 +1,6 @@
//--- OBJECT WRITE BEGIN ---
new TSShapeConstructor(ConePrimitive_fbx) {
baseShapeAsset = "Prototyping:ConePrimitive";
baseShapeAsset = "Prototyping:ConePrimitive_shape";
upAxis = "DEFAULT";
unit = "-1";
LODType = "TrailingNumber";

View file

@ -1,6 +1,6 @@
//--- OBJECT WRITE BEGIN ---
new TSShapeConstructor(CubePrimitive_fbx) {
baseShapeAsset = "Prototyping:CubePrimitive";
baseShapeAsset = "Prototyping:CubePrimitive_shape";
upAxis = "DEFAULT";
unit = "-1";
LODType = "TrailingNumber";

View file

@ -1,6 +1,6 @@
//--- OBJECT WRITE BEGIN ---
new TSShapeConstructor(CylinderPrimitive_fbx) {
baseShapeAsset = "Prototyping:CylinderPrimitive";
baseShapeAsset = "Prototyping:CylinderPrimitive_shape";
upAxis = "DEFAULT";
unit = "-1";
LODType = "TrailingNumber";

View file

@ -1,6 +1,6 @@
//--- OBJECT WRITE BEGIN ---
new TSShapeConstructor(SpherePrimitive_fbx) {
baseShapeAsset = "Prototyping:SpherePrimitive";
baseShapeAsset = "Prototyping:SpherePrimitive_shape";
upAxis = "DEFAULT";
unit = "-1";
LODType = "TrailingNumber";

View file

@ -1,6 +1,6 @@
//--- OBJECT WRITE BEGIN ---
new TSShapeConstructor(TorusPrimitive_fbx) {
baseShapeAsset = "Prototyping:TorusPrimitive";
baseShapeAsset = "Prototyping:TorusPrimitive_shape";
upAxis = "DEFAULT";
unit = "-1";
LODType = "TrailingNumber";

View file

@ -1,6 +1,6 @@
//--- OBJECT WRITE BEGIN ---
new TSShapeConstructor(TubePrimitive_fbx) {
baseShapeAsset = "Prototyping:TubePrimitive";
baseShapeAsset = "Prototyping:TubePrimitive_shape";
upAxis = "DEFAULT";
unit = "-1";
LODType = "TrailingNumber";

View file

@ -1,7 +1,7 @@
singleton TSShapeConstructor(cardae)
{
baseShapeAsset = "./car.dae";
baseShapeAsset = "Prototyping:car_shape";
singleDetailSize = "0";
flipUVCoords = "0";
JoinIdenticalVerts = "0";

View file

@ -1,7 +1,7 @@
singleton TSShapeConstructor(carwheeldae)
{
baseShapeAsset = "./carwheel.dae";
baseShapeAsset = "Prototyping:carwheel_shape";
singleDetailSize = "0";
flipUVCoords = "0";
JoinIdenticalVerts = "0";

View file

@ -1,7 +1,7 @@
singleton TSShapeConstructor(flierdae)
{
baseShapeAsset = "./flier.dae";
baseShapeAsset = "Prototyping:flier_shape";
singleDetailSize = "0";
flipUVCoords = "0";
JoinIdenticalVerts = "0";

View file

@ -1,7 +1,7 @@
singleton TSShapeConstructor(hoverboatdae)
{
baseShapeAsset = "./hoverboat.dae";
baseShapeAsset = "Prototyping:hoverboat_shape";
singleDetailSize = "0";
flipUVCoords = "0";
JoinIdenticalVerts = "0";

View file

@ -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);
}
}

View file

@ -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, " ", "_" );