From 976c0bca7915623e764a050da0eb0166db09c335 Mon Sep 17 00:00:00 2001 From: JeffR Date: Wed, 6 Apr 2022 01:08:20 -0500 Subject: [PATCH] Fixed uninitialized values for renderMeshExample and renderShapeExample which would cause a crash on creation Added utility method to prefab to be able to get the internal simGroup that contains it's children Adjusted logic for mounting items in GuiShapeEdPreview to utilize assetIds for the shapes Moved the Asset and AssetBrowser editor settings populate functions to the AssetBrowser script to better organize things Fixed command usage for General, Player and Observer spawn point creator entries to use the correct callback commands Fixed logic for creator callback commands that don't just route through the class name based structure Added RMB context menu actions for opening asset file or folder locations in OS file explorer Fixed lookup of animation assets when editing a shape's animations in the shape editor so it provides the assetId of the anim if it exists Fixes handling of mounting in the shape editor so it utilizes assets and the asset browser like everything else --- .../source/T3D/examples/renderMeshExample.cpp | 1 + .../T3D/examples/renderShapeExample.cpp | 1 + Engine/source/T3D/prefab.cpp | 6 ++ Engine/source/T3D/prefab.h | 7 ++ .../source/gui/editor/guiShapeEdPreview.cpp | 20 +++-- .../assetBrowser/scripts/assetBrowser.tscript | 80 +++++++++++++++++++ .../assetBrowser/scripts/creator.tscript | 15 ++-- .../assetBrowser/scripts/editAsset.tscript | 50 ++++++++++++ .../assetBrowser/scripts/popupMenus.tscript | 29 ++++--- .../tools/gui/editorSettingsWindow.ed.tscript | 77 ------------------ .../scripts/shapeEditor.ed.tscript | 31 ++++--- .../scripts/shapeEditorActions.ed.tscript | 1 - 12 files changed, 207 insertions(+), 111 deletions(-) diff --git a/Engine/source/T3D/examples/renderMeshExample.cpp b/Engine/source/T3D/examples/renderMeshExample.cpp index fe1d099eb..343075358 100644 --- a/Engine/source/T3D/examples/renderMeshExample.cpp +++ b/Engine/source/T3D/examples/renderMeshExample.cpp @@ -60,6 +60,7 @@ RenderMeshExample::RenderMeshExample() mTypeMask |= StaticObjectType | StaticShapeObjectType; INIT_ASSET(Material); + mMaterialInst = NULL; } RenderMeshExample::~RenderMeshExample() diff --git a/Engine/source/T3D/examples/renderShapeExample.cpp b/Engine/source/T3D/examples/renderShapeExample.cpp index b8aad1ebf..a4a92d572 100644 --- a/Engine/source/T3D/examples/renderShapeExample.cpp +++ b/Engine/source/T3D/examples/renderShapeExample.cpp @@ -59,6 +59,7 @@ RenderShapeExample::RenderShapeExample() mTypeMask |= StaticObjectType | StaticShapeObjectType; // Make sure to initialize our TSShapeInstance to NULL + INIT_ASSET(Shape); mShapeInstance = NULL; } diff --git a/Engine/source/T3D/prefab.cpp b/Engine/source/T3D/prefab.cpp index 0bebb443f..a211a41e5 100644 --- a/Engine/source/T3D/prefab.cpp +++ b/Engine/source/T3D/prefab.cpp @@ -616,3 +616,9 @@ void ExplodePrefabUndoAction::redo() name = Sim::getUniqueName( name ); mGroup->assignName( name ); } + +DefineEngineMethod(Prefab, getChildGroup, S32, (),, + "") +{ + return object->getChildGroup(); +} diff --git a/Engine/source/T3D/prefab.h b/Engine/source/T3D/prefab.h index def70857e..d6cde3e69 100644 --- a/Engine/source/T3D/prefab.h +++ b/Engine/source/T3D/prefab.h @@ -102,6 +102,13 @@ public: virtual void getUtilizedAssets(Vector* usedAssetsList); + S32 getChildGroup() { + if (mChildGroup.isValid()) + return mChildGroup->getId(); + + return 0; + } + protected: void _closeFile( bool removeFileNotify ); diff --git a/Engine/source/gui/editor/guiShapeEdPreview.cpp b/Engine/source/gui/editor/guiShapeEdPreview.cpp index eba775edb..d5dc8c5bf 100644 --- a/Engine/source/gui/editor/guiShapeEdPreview.cpp +++ b/Engine/source/gui/editor/guiShapeEdPreview.cpp @@ -557,16 +557,20 @@ void GuiShapeEdPreview::refreshThreadSequences() //----------------------------------------------------------------------------- // MOUNTING -bool GuiShapeEdPreview::mountShape(const char* modelName, const char* nodeName, const char* mountType, S32 slot) +bool GuiShapeEdPreview::mountShape(const char* shapeAssetId, const char* nodeName, const char* mountType, S32 slot) { - if ( !modelName || !modelName[0] ) + if ( !shapeAssetId || !shapeAssetId[0] ) return false; - Resource model = ResourceManager::get().load( modelName ); - if ( !bool( model ) ) + if (!AssetDatabase.isDeclaredAsset(shapeAssetId)) return false; - TSShapeInstance* tsi = new TSShapeInstance( model, true ); + ShapeAsset* model = AssetDatabase.acquireAsset(shapeAssetId); + + if (model == nullptr || !model->getShapeResource()) + return false; + + TSShapeInstance* tsi = new TSShapeInstance(model->getShapeResource(), true ); if ( slot == -1 ) { @@ -1864,14 +1868,14 @@ DefineEngineMethod( GuiShapeEdPreview, refreshThreadSequences, void, (),, //----------------------------------------------------------------------------- // Mounting -DefineEngineMethod( GuiShapeEdPreview, mountShape, bool, ( const char* shapePath, const char* nodeName, const char* type, S32 slot ),, +DefineEngineMethod( GuiShapeEdPreview, mountShape, bool, ( const char* shapeAssetId, const char* nodeName, const char* type, S32 slot ),, "Mount a shape onto the main shape at the specified node\n\n" - "@param shapePath path to the shape to mount\n" + "@param shapeAssetId AssetId of the shape to mount\n" "@param nodeName name of the node on the main shape to mount to\n" "@param type type of mounting to use (Object, Image or Wheel)\n" "@param slot mount slot\n" ) { - return object->mountShape( shapePath, nodeName, type, slot ); + return object->mountShape(shapeAssetId, nodeName, type, slot ); } DefineEngineMethod( GuiShapeEdPreview, setMountNode, void, ( S32 slot, const char* nodeName ),, diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript index eca3729f7..fd3a7b213 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript @@ -1212,6 +1212,86 @@ function AssetBrowser::openAssetSettings(%this) ESettingsWindowList.setSelectedRow( %assetEditIndex ); } +function ESettingsWindow::getAssetManagementSettings(%this) +{ + SettingsInspector.startGroup("Modules"); + SettingsInspector.addSettingsField("AssetManagement/Modules/coreModulePath", "Core Module Path", "string", ""); + SettingsInspector.addSettingsField("AssetManagement/Modules/gameDataModulePath", "Game Data Module Path", "string", ""); + SettingsInspector.addSettingsField("AssetManagement/Modules/moduleExtension", "Module Extension", "string", ""); + + %moduleList = ModuleDatabase.findModules(true); + %moduleList = strreplace(%moduleList, " ", ","); + + SettingsInspector.addSettingsField("AssetManagement/Modules/DefaultModule", "Default Module", "list", %moduleList); + SettingsInspector.endGroup(); + + SettingsInspector.startGroup("Assets"); + SettingsInspector.addSettingsField("AssetManagement/Assets/assetExtension", "Asset Extension", "string", ""); + SettingsInspector.addSettingsField("AssetManagement/Assets/datablockCaching", "Cache Datablocks", "bool", ""); + //SettingsInspector.addSettingsField("AssetManagement/Assets/moduleExtension", "Module Extension", "string", ""); + + SettingsInspector.endGroup(); +} + +function ESettingsWindow::getAssetEditingSettings(%this) +{ + ImportAssetWindow::reloadImportOptionConfigs(); + + //First, get our list of modules + %moduleList = ModuleDatabase.findModules(); + %formattedModuleList = ""; + + %count = getWordCount(%moduleList); + for(%i=0; %i < %count; %i++) + { + %module = getWord(%moduleList, %i); + if(%module.group !$= "Tools" && %module.group !$= "Core") + { + if(%formattedModuleList $= "") + %formattedModuleList = %module.moduleId; + else + %formattedModuleList = %formattedModuleList @ "," @ %module.moduleId; + } + } + + SettingsInspector.startGroup("Asset Creation"); + SettingsInspector.addSettingsField("Assets/New/defaultModule", "Default Module", "list", "Default Module for new assets to be created into", %formattedModuleList); + SettingsInspector.addSettingsField("Assets/New/alwaysPromptModuleTarget", "Always Prompt Target Module", "bool", "If off, use the default module"); + SettingsInspector.endGroup(); + + %formattedConfigList = ""; + for(%i=0; %i < ImportAssetWindow.importConfigsList.Count(); %i++) + { + %configName = ImportAssetWindow.importConfigsList.getKey(%i); + %formattedConfigList = %i == 0 ? %configName : %formattedConfigList @ "," @ %configName; + } + + SettingsInspector.startGroup("Assets Importing"); + SettingsInspector.addField("Edit Import Configs", "Edit Asset Import Configs", "button", "Open Asset Import Config Editor", "", "Canvas.pushDialog(AssetImportConfigEditor);"); + SettingsInspector.addSettingsField("Assets/AssetImporDefaultConfig", "Default Asset Import Config", "list", "", %formattedConfigList); + SettingsInspector.addSettingsField("Assets/AutoImport", "Automatically Import using default config", "bool", "If on, the asset importing process" @ + "will attempt to automatically import any inbound assets"@ + "using the default config, without prompting the import window."@ + "The window will still display if any issues are detected", ""); + SettingsInspector.addSettingsField("Assets/AutoImportLooseFiles", "Automatically Import Loose Files", "bool", "If on, will automatically import unassociated loose files in assets when navigating the Asset Browser.", ""); + SettingsInspector.endGroup(); + + SettingsInspector.startGroup("Asset Browser"); + SettingsInspector.addSettingsField("Assets/Browser/showCoreModule", "Show Core Module in Asset Browser", "bool", ""); + SettingsInspector.addSettingsField("Assets/Browser/showToolsModule", "Show Tools Module in Asset Browser", "bool", ""); + SettingsInspector.addSettingsField("Assets/Browser/showOnlyPopulatedModule", "Show Only Modules with Assets in Asset Browser", "bool", ""); + SettingsInspector.addSettingsField("Assets/Browser/showFolders", "Show Folders in Tiles view in Asset Browser", "bool", ""); + SettingsInspector.addSettingsField("Assets/Browser/showEmptyFolders", "Show Empty Folders in Tiles view in Asset Browser", "bool", ""); + SettingsInspector.addSettingsField("Assets/Browser/showLooseFiles", "Show Loose Files when viewing in Asset Browser", "bool", ""); + SettingsInspector.addSettingsField("AssetManagement/Assets/promptOnRename", "Prompt on Rename", "bool", ""); + SettingsInspector.addSettingsField("Assets/Browser/doubleClickAction", "Double Click Action", "list", "Dictates what sort of action double clicking on an asset in the Browser will invoke", "Edit Asset,Spawn Asset"); + SettingsInspector.addSettingsField("AssetManagement/Assets/closeBrowserOnDragAction", "Close Browser on Drag Action", "bool", "If on, the Asset Browser will automatically close after dragging an asset from it to the editor interface."); + SettingsInspector.endGroup(); +} +// +// +// + function AssetBrowser::showVisibiltyOptions(%this) { BrowserVisibilityPopup.showPopup(Canvas); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript index 803a5933a..c6b279d35 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/creator.tscript @@ -50,9 +50,9 @@ function AssetBrowser::loadCreatorClasses(%this) %this.addCreatorClass("MissionArea", "Mission Area" ); %this.addCreatorClass("NotesObject", "Note" ); %this.addCreatorClass("Path" ); - %this.addCreatorClass("SpawnSphere", "General Spawn Sphere" ); - %this.addCreatorClass("SpawnSphere", "Player Spawn Sphere"/*, "PlayerDropPoint"*/ ); - %this.addCreatorClass("SpawnSphere", "Observer Spawn Sphere"/*, "ObserverDropPoint"*/ ); + %this.addCreatorClass("SpawnSphere", "General Spawn Sphere", "GeneralDropPoint" ); + %this.addCreatorClass("SpawnSphere", "Player Spawn Sphere", "PlayerDropPoint" ); + %this.addCreatorClass("SpawnSphere", "Observer Spawn Sphere", "ObserverDropPoint" ); %this.addCreatorClass("VPath", "Verve Path" ); %this.endCreatorGroup(); @@ -168,6 +168,7 @@ function AssetBrowser::addCreatorClass(%this, %class, %name, %buildfunc) return; } + %cmd = ""; if(%buildfunc $= "") { %method = "build" @ %buildfunc; @@ -178,9 +179,13 @@ function AssetBrowser::addCreatorClass(%this, %class, %name, %buildfunc) %cmd = "new " @ %class @ "();"; else %cmd = "ObjectBuilderGui." @ %method @ "();"; - - %buildfunc = "ObjectBuilderGui.newObjectCallback = \"AssetBrowser.onFinishCreateObject\"; ObjectCreator.createObject( \"" @ %cmd @ "\" );"; } + else + { + %cmd = "ObjectBuilderGui.build" @ %buildfunc @ "();"; + } + + %buildfunc = "ObjectBuilderGui.newObjectCallback = \"AssetBrowser.onFinishCreateObject\"; ObjectCreator.createObject( \"" @ %cmd @ "\" );"; %args = new ScriptObject(); %args.val[0] = %class; diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.tscript index 6267462ee..ffa4abd3b 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.tscript @@ -476,4 +476,54 @@ function AssetBrowser::updateAssetReference(%this, %targetPath, %oldAssetId, %ne lineCache.delete(); %fileObj.delete(); +} + +function AssetBrowser::openFileLocation(%this) +{ + %filePath = ""; + if(EditAssetPopup.assetId !$= "") + { + %filePath = AssetDatabase.getAssetPath(EditAssetPopup.assetId); + } + else if(EditLevelAssetPopup.assetId !$= "") + { + %filePath = AssetDatabase.getAssetPath(EditAssetPopup.assetId); + } + else if(EditTerrainAssetPopup.assetId !$= "") + { + %filePath = AssetDatabase.getAssetPath(EditAssetPopup.assetId); + } + + if(%filePath !$= "") + { + if($platform $= "windows") + { + %cmd = "cd \"" @ makeFullPath(%filePath) @ "\" && start ."; + systemCommand(%cmd); + } + else + { + %cmd = "open \"" @ makeFullPath(%filePath) @ "\""; + systemCommand(%cmd); + } + } +} + +function AssetBrowser::openFolderLocation(%this) +{ + %filePath = AssetBrowser.dirHandler.currentAddress; + + if(%filePath !$= "") + { + if($platform $= "windows") + { + %cmd = "cd \"" @ makeFullPath(%filePath) @ "\" && start ."; + systemCommand(%cmd); + } + else + { + %cmd = "open \"" @ makeFullPath(%filePath) @ "\""; + systemCommand(%cmd); + } + } } \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.tscript index c4f0cca7b..808649d86 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.tscript @@ -34,7 +34,9 @@ function AssetBrowser::buildPopupMenus(%this) item[ 8 ] = "-"; item[ 9 ] = "Re-Import Asset" TAB "" TAB "AssetBrowser.reImportAsset();"; item[ 10 ] = "-"; - item[ 11 ] = "Delete Asset" TAB "" TAB "AssetBrowser.deleteAsset();"; + item[ 11 ] = "Open File Location" TAB "" TAB "AssetBrowser.openFileLocation();"; + item[ 12 ] = "-"; + item[ 13 ] = "Delete Asset" TAB "" TAB "AssetBrowser.deleteAsset();"; jumpFileName = ""; jumpLineNumber = ""; @@ -57,9 +59,9 @@ function AssetBrowser::buildPopupMenus(%this) item[ 5 ] = "-"; Item[ 6 ] = "Duplicate Asset" TAB "" TAB "AssetBrowser.duplicateAsset();"; item[ 7 ] = "-"; - //item[ 8 ] = "Re-Import Asset" TAB "" TAB "AssetBrowser.reImportAsset();"; - //item[ 9 ] = "-"; - item[ 8 ] = "Delete Asset" TAB "" TAB "AssetBrowser.deleteAsset();"; + item[ 8 ] = "Open File Location" TAB "" TAB "AssetBrowser.openFileLocation();"; + item[ 9 ] = "-"; + item[ 10 ] = "Delete Asset" TAB "" TAB "AssetBrowser.deleteAsset();"; jumpFileName = ""; jumpLineNumber = ""; @@ -80,7 +82,9 @@ function AssetBrowser::buildPopupMenus(%this) item[ 3 ] = "-"; Item[ 4 ] = "Duplicate Asset" TAB "" TAB "AssetBrowser.duplicateAsset();"; item[ 5 ] = "-"; - item[ 6 ] = "Delete Asset" TAB "" TAB "AssetBrowser.deleteAsset();"; + item[ 6 ] = "Open File Location" TAB "" TAB "AssetBrowser.openFileLocation();"; + item[ 7 ] = "-"; + item[ 8 ] = "Delete Asset" TAB "" TAB "AssetBrowser.deleteAsset();"; jumpFileName = ""; jumpLineNumber = ""; @@ -185,6 +189,9 @@ function AssetBrowser::buildPopupMenus(%this) item[10] = "Create New Module" TAB "" TAB "AssetBrowser.CreateNewModule();"; item[11] = "-"; item[12] = "View Loose Files" TAB "" TAB "AssetBrowser.importLooseFiles();"; + Item[ 13 ] = "-"; + item[ 14 ] = "Open Folder Location" TAB "" TAB "AssetBrowser.openFolderLocation();"; + }; } @@ -203,11 +210,13 @@ function AssetBrowser::buildPopupMenus(%this) Item[ 3 ] = "-"; Item[ 4 ] = "Module Properties" TAB "" TAB "AssetBrowser.editModuleInfo();"; Item[ 5 ] = "-"; - Item[ 6 ] = "Duplicate Module" TAB "" TAB "AssetBrowser.copyModule();"; - Item[ 7 ] = "-"; - Item[ 8 ] = "Delete Module" TAB "" TAB "AssetBrowser.deleteModule();"; - item[ 9 ] = "-"; - item[ 10 ] = "Import Loose Files" TAB "" TAB "AssetBrowser.importLooseFiles();"; + item[ 6 ] = "Open Folder Location" TAB "" TAB "AssetBrowser.openFolderLocation();"; + item[ 7 ] = "-"; + Item[ 8 ] = "Duplicate Module" TAB "" TAB "AssetBrowser.copyModule();"; + Item[ 9 ] = "-"; + Item[ 10 ] = "Delete Module" TAB "" TAB "AssetBrowser.deleteModule();"; + item[ 11 ] = "-"; + item[ 12 ] = "Import Loose Files" TAB "" TAB "AssetBrowser.importLooseFiles();"; }; } diff --git a/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.tscript b/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.tscript index e104dea65..c9b589caa 100644 --- a/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.tscript +++ b/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.tscript @@ -473,83 +473,6 @@ function ESettingsWindow::getUISettings(%this) SettingsInspector.endGroup(); } -function ESettingsWindow::getAssetManagementSettings(%this) -{ - SettingsInspector.startGroup("Modules"); - SettingsInspector.addSettingsField("AssetManagement/Modules/coreModulePath", "Core Module Path", "string", ""); - SettingsInspector.addSettingsField("AssetManagement/Modules/gameDataModulePath", "Game Data Module Path", "string", ""); - SettingsInspector.addSettingsField("AssetManagement/Modules/moduleExtension", "Module Extension", "string", ""); - - %moduleList = ModuleDatabase.findModules(true); - %moduleList = strreplace(%moduleList, " ", ","); - - SettingsInspector.addSettingsField("AssetManagement/Modules/DefaultModule", "Default Module", "list", %moduleList); - SettingsInspector.endGroup(); - - SettingsInspector.startGroup("Assets"); - SettingsInspector.addSettingsField("AssetManagement/Assets/assetExtension", "Asset Extension", "string", ""); - SettingsInspector.addSettingsField("AssetManagement/Assets/datablockCaching", "Cache Datablocks", "bool", ""); - //SettingsInspector.addSettingsField("AssetManagement/Assets/moduleExtension", "Module Extension", "string", ""); - - SettingsInspector.endGroup(); -} - -function ESettingsWindow::getAssetEditingSettings(%this) -{ - ImportAssetWindow::reloadImportOptionConfigs(); - - //First, get our list of modules - %moduleList = ModuleDatabase.findModules(); - %formattedModuleList = ""; - - %count = getWordCount(%moduleList); - for(%i=0; %i < %count; %i++) - { - %module = getWord(%moduleList, %i); - if(%module.group !$= "Tools" && %module.group !$= "Core") - { - if(%formattedModuleList $= "") - %formattedModuleList = %module.moduleId; - else - %formattedModuleList = %formattedModuleList @ "," @ %module.moduleId; - } - } - - SettingsInspector.startGroup("Asset Creation"); - SettingsInspector.addSettingsField("Assets/New/defaultModule", "Default Module", "list", "Default Module for new assets to be created into", %formattedModuleList); - SettingsInspector.addSettingsField("Assets/New/alwaysPromptModuleTarget", "Always Prompt Target Module", "bool", "If off, use the default module"); - SettingsInspector.endGroup(); - - %formattedConfigList = ""; - for(%i=0; %i < ImportAssetWindow.importConfigsList.Count(); %i++) - { - %configName = ImportAssetWindow.importConfigsList.getKey(%i); - %formattedConfigList = %i == 0 ? %configName : %formattedConfigList @ "," @ %configName; - } - - SettingsInspector.startGroup("Assets Importing"); - SettingsInspector.addField("Edit Import Configs", "Edit Asset Import Configs", "button", "Open Asset Import Config Editor", "", "Canvas.pushDialog(AssetImportConfigEditor);"); - SettingsInspector.addSettingsField("Assets/AssetImporDefaultConfig", "Default Asset Import Config", "list", "", %formattedConfigList); - SettingsInspector.addSettingsField("Assets/AutoImport", "Automatically Import using default config", "bool", "If on, the asset importing process" @ - "will attempt to automatically import any inbound assets"@ - "using the default config, without prompting the import window."@ - "The window will still display if any issues are detected", ""); - SettingsInspector.addSettingsField("Assets/AutoImportLooseFiles", "Automatically Import Loose Files", "bool", "If on, will automatically import unassociated loose files in assets when navigating the Asset Browser.", ""); - SettingsInspector.endGroup(); - - SettingsInspector.startGroup("Asset Browser"); - SettingsInspector.addSettingsField("Assets/Browser/showCoreModule", "Show Core Module in Asset Browser", "bool", ""); - SettingsInspector.addSettingsField("Assets/Browser/showToolsModule", "Show Tools Module in Asset Browser", "bool", ""); - SettingsInspector.addSettingsField("Assets/Browser/showOnlyPopulatedModule", "Show Only Modules with Assets in Asset Browser", "bool", ""); - SettingsInspector.addSettingsField("Assets/Browser/showFolders", "Show Folders in Tiles view in Asset Browser", "bool", ""); - SettingsInspector.addSettingsField("Assets/Browser/showEmptyFolders", "Show Empty Folders in Tiles view in Asset Browser", "bool", ""); - SettingsInspector.addSettingsField("Assets/Browser/showLooseFiles", "Show Loose Files when viewing in Asset Browser", "bool", ""); - SettingsInspector.addSettingsField("AssetManagement/Assets/promptOnRename", "Prompt on Rename", "bool", ""); - SettingsInspector.addSettingsField("Assets/Browser/doubleClickAction", "Double Click Action", "list", "Dictates what sort of action double clicking on an asset in the Browser will invoke", "Edit Asset,Spawn Asset"); - SettingsInspector.addSettingsField("AssetManagement/Assets/closeBrowserOnDragAction", "Close Browser on Drag Action", "bool", "If on, the Asset Browser will automatically close after dragging an asset from it to the editor interface."); - SettingsInspector.endGroup(); -} - function ESettingsWindow::getGameplaySettings(%this) { SettingsInspector.startGroup("Game Modes"); diff --git a/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.tscript b/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.tscript index 2be4dd630..b53e1edaa 100644 --- a/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.tscript +++ b/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.tscript @@ -1581,8 +1581,19 @@ function ShapeEdSequences::onEditSequenceSource( %this, %from ) %from = rtrim( getFields( %oldSource, 0, 0 ) ); if ( getFields( %oldSource, 0, 3 ) !$= ( %from TAB "" TAB %start TAB %end ) ) + { + %aq = new AssetQuery(); + %foundAssets = AssetDatabase.findAssetLooseFile(%aq, %from); + if(%foundAssets != 0) + { + //if we have an assetId associated to the file, we're gunna just pass that + //through for the edit actions + %from = %aq.getAsset(0); + } + %aq.delete(); ShapeEditor.doEditSeqSource( %seqName, %from, %start, %end ); } + } } function ShapeEdSequences::onToggleCyclic( %this ) @@ -3339,8 +3350,9 @@ function ShapeEdMountShapeMenu::onSelect( %this, %id, %text ) { if ( %text $= "Browse..." ) { - // Allow the user to browse for an external model file - getLoadFormatFilename( %this @ ".onBrowseSelect", %this.lastPath ); + if(%this.lastPath !$= "") + AssetBrowser.dirHandler.currentAddress = %this.lastPath; + AssetBrowser.showDialog("ShapeAsset", %this @ ".onBrowseSelect"); } else { @@ -3349,15 +3361,14 @@ function ShapeEdMountShapeMenu::onSelect( %this, %id, %text ) } } -function ShapeEdMountShapeMenu::onBrowseSelect( %this, %path ) +function ShapeEdMountShapeMenu::onBrowseSelect( %this, %shapeAssetId ) { - %path = makeRelativePath( %path, getMainDotCSDir() ); - %this.lastPath = %path; - %this.setText( %path ); + %this.lastPath = AssetBrowser.dirHandler.currentAddress; + %this.setText( %shapeAssetId ); // Add entry if unique - if ( %this.findText( %path ) == -1 ) - %this.add( %path ); + if ( %this.findText( %shapeAssetId ) == -1 ) + %this.add( %shapeAssetId ); ShapeEdMountWindow.updateSelectedMount(); } @@ -3369,11 +3380,11 @@ function ShapeEdMountWindow::mountShape( %this, %slot ) %type = %this-->mountType.getText(); if ( %model $= "Browse..." ) - %model = "core/gameObjects/shapes/octahedron.dts"; + %model = "Core_GameObjects:octahedron.dts"; if ( ShapeEdShapeView.mountShape( %model, %node, %type, %slot ) ) { - %rowText = %model TAB fileName( %model ) TAB %node TAB %type; + %rowText = %model TAB %node TAB %type; if ( %slot == -1 ) { %id = %this.mounts++; diff --git a/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditorActions.ed.tscript b/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditorActions.ed.tscript index 55d6f9483..656871086 100644 --- a/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditorActions.ed.tscript +++ b/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditorActions.ed.tscript @@ -301,7 +301,6 @@ function ActionEditNodeTransform::undo( %this ) // Add sequence function onAddAnimationAssetShapeEditor(%selectedAnimation) { - echo("SELECTED MUH ASSET"); ShapeEditor.doAddSequence(%selectedAnimation, 0, 0, 0); }