mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-28 07:45:40 +00:00
Change Asset Browser logic to utilize folder heirarchy instead of strict Asset Type filtration
Added navigation history to AB, as well as ability to navigate via forward and backward buttons and breadcrumb buttons Added folder 'asset type', allowing you to create, rename, delete and move folders via the asset browser for better organization Adjusted various behaviors to work with the address-driven navigation/organization of the AB Expanded visibility options for the AB and integrated them into editor settings so they are retained Added Search field for searching the folder structure, in addition to the existing preview tiles search Adjusted drag-n-drop behavior of the platform code so it accepts dropping folders Added ability to dump active PostEffects list to see what is currently running Added ability to mark specific items in GuiTreeViewCtrl as hidden Made reflection probe bounds boxes translucent rather than wireframe to improve editing visibility Added expanded loose file references to LevelAsset for common companion files like decals and posteffect scrips Added editor setting for Editor Layout Mode, allowing you to set the editor into 'Modern' layout. Added editor settings to set default import config ruleset, and also ability to set auto-import. If both of these are set, then as long as the importing assets have no errors, they will auto-process and the user doesn't need to manually check and confirm them via the asset import window
This commit is contained in:
parent
ec63be32e3
commit
25758d3148
33 changed files with 1633 additions and 800 deletions
|
|
@ -76,7 +76,7 @@ function AssetBrowser::refreshAsset(%this, %assetId)
|
|||
function AssetBrowser::renameAsset(%this)
|
||||
{
|
||||
//Find out what type it is
|
||||
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
|
||||
//%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
|
||||
|
||||
%curFirstResponder = AssetBrowser.getFirstResponder();
|
||||
|
||||
|
|
@ -92,36 +92,56 @@ function AssetBrowser::performRenameAsset(%this, %originalAssetName, %newName)
|
|||
//if the name is different to the asset's original name, rename it!
|
||||
if(%originalAssetName !$= %newName)
|
||||
{
|
||||
%moduleName = AssetBrowser.selectedModule;
|
||||
|
||||
//do a rename!
|
||||
%success = AssetDatabase.renameDeclaredAsset(%moduleName @ ":" @ %originalAssetName, %moduleName @ ":" @ %newName);
|
||||
|
||||
if(%success)
|
||||
echo("AssetBrowser - renaming of asset " @ %moduleName @ ":" @ %originalAssetName @ " to " @ %moduleName @ ":" @ %newName @ " was a success.");
|
||||
else
|
||||
echo("AssetBrowser - renaming of asset " @ %moduleName @ ":" @ %originalAssetName @ " to " @ %moduleName @ ":" @ %newName @ " was a failure.");
|
||||
|
||||
if(%success)
|
||||
if(EditAssetPopup.assetType !$= "Folder")
|
||||
{
|
||||
%newAssetId = %moduleName @ ":" @ %newName;
|
||||
%assetPath = AssetDatabase.getAssetFilePath(%newAssetId);
|
||||
%moduleName = AssetBrowser.selectedModule;
|
||||
|
||||
//Rename any associated files as well
|
||||
%assetDef = AssetDatabase.acquireAsset(%newAssetId);
|
||||
%assetType = %assetDef.getClassName();
|
||||
//do a rename!
|
||||
%success = AssetDatabase.renameDeclaredAsset(%moduleName @ ":" @ %originalAssetName, %moduleName @ ":" @ %newName);
|
||||
|
||||
//rename the file to match
|
||||
%path = filePath(%assetPath);
|
||||
if(%success)
|
||||
echo("AssetBrowser - renaming of asset " @ %moduleName @ ":" @ %originalAssetName @ " to " @ %moduleName @ ":" @ %newName @ " was a success.");
|
||||
else
|
||||
echo("AssetBrowser - renaming of asset " @ %moduleName @ ":" @ %originalAssetName @ " to " @ %moduleName @ ":" @ %newName @ " was a failure.");
|
||||
|
||||
//Do the rename command
|
||||
%buildCommand = %this @ ".rename" @ %assetType @ "(" @ %assetDef @ "," @ %newAssetId @ ");";
|
||||
eval(%buildCommand);
|
||||
if(%success)
|
||||
{
|
||||
%newAssetId = %moduleName @ ":" @ %newName;
|
||||
%assetPath = AssetDatabase.getAssetFilePath(%newAssetId);
|
||||
|
||||
//Rename any associated files as well
|
||||
%assetDef = AssetDatabase.acquireAsset(%newAssetId);
|
||||
%assetType = %assetDef.getClassName();
|
||||
|
||||
//rename the file to match
|
||||
%path = filePath(%assetPath);
|
||||
|
||||
//Do the rename command
|
||||
%buildCommand = %this @ ".rename" @ %assetType @ "(" @ %assetDef @ "," @ %newAssetId @ ");";
|
||||
eval(%buildCommand);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
%buildCommand = %this @ ".renameFolder(\"" @ EditAssetPopup.assetId @ "\",\"" @ %newName @ "\");";
|
||||
eval(%buildCommand);
|
||||
}
|
||||
}
|
||||
|
||||
//Make sure everything is refreshed
|
||||
AssetBrowser.loadFilters();
|
||||
|
||||
//Update the selection to immediately jump to the new asset
|
||||
AssetBrowser-->filterTree.clearSelection();
|
||||
%ModuleItem = AssetBrowser-->filterTree.findItemByName(%moduleName);
|
||||
%assetTypeId = AssetBrowser-->filterTree.findChildItemByName(%ModuleItem, %assetType);
|
||||
|
||||
AssetBrowser-->filterTree.selectItem(%assetTypeId);
|
||||
|
||||
%selectedItem = AssetBrowser-->filterTree.getSelectedItem();
|
||||
AssetBrowser-->filterTree.scrollVisibleByObjectId(%selectedItem);
|
||||
|
||||
AssetBrowser-->filterTree.buildVisibleTree();
|
||||
}
|
||||
|
||||
function AssetNameField::onReturn(%this)
|
||||
|
|
@ -132,6 +152,26 @@ function AssetNameField::onReturn(%this)
|
|||
AssetBrowser.performRenameAsset(%this.originalAssetName, %this.getText());
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
function AssetBrowser::moveAsset(%this, %destination)
|
||||
{
|
||||
if(EditAssetPopup.assetType $= "Folder")
|
||||
{
|
||||
//Do any cleanup required given the type
|
||||
if(%this.isMethod("moveFolder"))
|
||||
eval(%this @ ".moveFolder("@EditAssetPopup.assetId@",\""@%destination@"\");");
|
||||
}
|
||||
else
|
||||
{
|
||||
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
|
||||
%assetType = AssetDatabase.getAssetType(EditAssetPopup.assetType);
|
||||
|
||||
//Do any cleanup required given the type
|
||||
if(%this.isMethod("move"@%assetType))
|
||||
eval(%this @ ".move"@%assetType@"("@%assetDef@");");
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
function AssetBrowser::duplicateAsset(%this, %targetModule)
|
||||
|
|
@ -157,10 +197,10 @@ function AssetBrowser::duplicateAsset(%this, %targetModule)
|
|||
function AssetBrowser::deleteAsset(%this)
|
||||
{
|
||||
//Find out what type it is
|
||||
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
|
||||
%assetType = %assetDef.getClassName();
|
||||
//%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
|
||||
//%assetType = %assetDef.getClassName();
|
||||
|
||||
MessageBoxOKCancel("Warning!", "This will delete the selected asset and the files associated to it, do you wish to continue?",
|
||||
MessageBoxOKCancel("Warning!", "This will delete the selected content and the files associated to it, do you wish to continue?",
|
||||
"AssetBrowser.confirmDeleteAsset();", "");
|
||||
}
|
||||
|
||||
|
|
@ -169,14 +209,23 @@ function AssetBrowser::confirmDeleteAsset(%this)
|
|||
%currentSelectedItem = AssetBrowserFilterTree.getSelectedItem();
|
||||
%currentItemParent = AssetBrowserFilterTree.getParentItem(%currentSelectedItem);
|
||||
|
||||
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
|
||||
%assetType = AssetDatabase.getAssetType(EditAssetPopup.assetId);
|
||||
|
||||
//Do any cleanup required given the type
|
||||
if(%this.isMethod("delete"@%assetType))
|
||||
eval(%this @ ".delete"@%assetType@"("@%assetDef@");");
|
||||
|
||||
AssetDatabase.deleteAsset(EditAssetPopup.assetId, false);
|
||||
if(EditAssetPopup.assetType $= "Folder")
|
||||
{
|
||||
//Do any cleanup required given the type
|
||||
if(%this.isMethod("deleteFolder"))
|
||||
eval(%this @ ".deleteFolder(\""@EditAssetPopup.assetId@"\");");
|
||||
}
|
||||
else
|
||||
{
|
||||
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
|
||||
%assetType = AssetDatabase.getAssetType(EditAssetPopup.assetType);
|
||||
|
||||
//Do any cleanup required given the type
|
||||
if(%this.isMethod("delete"@%assetType))
|
||||
eval(%this @ ".delete"@%assetType@"("@%assetDef@");");
|
||||
|
||||
AssetDatabase.deleteAsset(EditAssetPopup.assetId, false);
|
||||
}
|
||||
|
||||
%this.loadFilters();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue