Torque3D/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript

2859 lines
85 KiB
Plaintext
Raw Permalink Normal View History

//AssetBrowser.addToolbarButton
function AssetBrowser::addToolbarButton(%this)
{
%button = new GuiBitmapButtonCtrl() {
canSaveDynamicFields = "0";
internalName = AssetBrowserBtn;
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "180 0";
Extent = "25 19";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "AssetBrowser.ShowDialog();";
tooltipprofile = "ToolsGuiToolTipProfile";
ToolTip = "Asset Browser";
hovertime = "750";
bitmapAsset = "ToolsModule:assetBrowser_n_image";
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
bitmapMode = "Stretched";
buttonType = "ToggleButton";
groupNum = "0";
useMouseEvents = "0";
};
ToolsToolbarArray.add(%button);
EWToolsToolbar.setExtent((29 + 4) * (ToolsToolbarArray.getCount()) + 4 SPC "32");
}
//
//
function AssetBrowser::registerAssetType(%assetTypeName, %humanReadableName, %assetClassNamesList, %showInFilters)
{
if(%showInFilters $= "")
%showInFilters = true;
ABAssetTypesList.add("Asset", %assetTypeName TAB %humanReadableName TAB %assetClassNamesList TAB %showInFilters);
}
function AssetBrowser::registerFileType(%fileTypeName, %humanReadableName, %fileExtensionsList, %showInFilters)
{
if(%showInFilters $= "")
%showInFilters = true;
ABAssetTypesList.add("File", %fileTypeName TAB %humanReadableName TAB %fileExtensionsList TAB %showInFilters);
}
function AssetBrowser::registerObjectType(%objectTypeName, %humanReadableName, %objectClassNames, %showInFilters)
{
if(%showInFilters $= "")
%showInFilters = true;
ABAssetTypesList.add("Object", %objectTypeName TAB %humanReadableName TAB %objectClassNames TAB %showInFilters);
}
function AssetBrowser::callAssetTypeFunc(%this, %type, %function, %param0, %param1, %param2, %param3, %param4)
{
//echo("AssetBrowser::callAssetTypeFunc() - deets: " @ %type @ ", " @ %function @ ", " @ %param0 @ ", " @ %param1 @ ", " @ %param2 @ ", " @ %param3 @ ", " @ %param4);
$paramCache0 = %param0;
$paramCache1 = %param1;
$paramCache2 = %param2;
$paramCache3 = %param3;
$paramCache4 = %param4;
$CurrentAssetBrowser = %this;
//look up the type group
%typeGroup = "";
%typeData = "";
for(%i=0; %i < ABAssetTypesList.count(); %i++)
{
%group = ABAssetTypesList.getKey(%i);
%typeData = ABAssetTypesList.getValue(%i);
if(getField(%typeData, 0) $= %type)
{
%typeGroup = %group;
%typeData = %typeData;
break;
}
}
%paramOffset = 0;
%isStaticCall = false;
%command = "";
if(%typeGroup $= "Asset")
{
//check to see if the first param is an asset definition
if(isObject(%param0) && %param0.isInNamespaceHierarchy("AssetBase"))
{
if(%param0.isMethod(%function))
{
%command = %param0 @ "." @ %function @ "(";
%paramOffset = 1;
}
else
{
%command = "GenericAsset::" @ %function @ "(" @ %param0;
%paramOffset = 1;
%isStaticCall = true;
}
}
else
{
if(AssetDatabase.isDeclaredAsset(%param0))
{
%assetDef = AssetDatabase.acquireAsset(%param0);
if(%assetDef.isMethod(%function))
{
%command = %assetDef @ "." @ %function @ "(";
%paramOffset = 1;
}
else
{
%command = "GenericAsset::" @ %function @ "(" @ %assetDef;
%paramOffset = 1;
%isStaticCall = true;
}
}
else
{
//we may have to build the assetID
%assetId = %param0 @ ":" @ %param1;
if(AssetDatabase.isDeclaredAsset(%assetId))
{
%assetDef = AssetDatabase.acquireAsset(%assetId);
if(%assetDef.isMethod(%function))
{
%command = %assetDef @ "." @ %function @ "(";
%paramOffset = 2;
}
else
{
%command = "GenericAsset::" @ %function @ "(" @ %assetDef;
%paramOffset = 2;
%isStaticCall = true;
}
}
}
}
}
else if(%typeGroup $= "File")
{
%compoundPath = %param0 @ "/" @ %param1;
if(isFile(%compoundPath) || isDirectory(%compoundPath))
{
if(isMethod(%type, %function))
{
%command = %type @ "::" @ %function @ "(\"" @ %compoundPath @ "\"";
%paramOffset = 2;
%isStaticCall = true;
}
else
{
%command = "GenericAsset::" @ %function @ "(\"" @ %compoundPath @ "\"";
%paramOffset = 2;
%isStaticCall = true;
}
}
else if(isFile(%param0) || isDirectory(%param0))
{
if(isMethod(%type, %function))
{
%command = %type @ "::" @ %function @ "(\"" @ %param0 @ "\"";
%paramOffset = 1;
%isStaticCall = true;
}
else
{
%command = "GenericAsset::" @ %function @ "(\"" @ %param0 @ "\"";
%paramOffset = 1;
%isStaticCall = true;
}
}
}
else if(%typeGroup $= "Object")
{
if(isObject(%param0) && %param0.isMethod(%function))
{
%command = %param0 @ "." @ %function @ "(";
%paramOffset = 1;
}
else
{
if(isMethod(%type, %function))
{
%command = %type @ "::" @ %function @ "(";
%isStaticCall = true;
}
}
}
if(%command $= "")
{
//check in case it's a purely static type call with no usual incoming vars.
//Usually only relevent for create functions
if($paramCache0 $= "" && $paramCache1 $= "" && isMethod(%type, %function))
{
%command = %type @ "::" @ %function @ "(";
%isStaticCall = true;
}
else if(isMethod("GenericAsset", %function))
{
%command = "GenericAsset::" @ %function @ "(";
%isStaticCall = true;
}
else
{
error("AssetBrowser::callAssetTypeFunc() - unable to find a valid type: " @ %type @ " with function: " @ %function);
return;
}
}
for(%i=%paramOffset; %i < 5; %i++)
{
%paramVar = getVariable("$paramCache" @ %i);
if(%paramVar !$= "")
{
if(%paramOffset != 0 && %i==%paramOffset && %isStaticCall)
%command = %command @ ",";
if(getWordCount(%paramVar) > 1 || strPos(%paramVar, "/") != 0 || stePos(%paramVar, "\\") != 0)
%command = %command @ "\"" @ %paramVar @ "\"";
else
%command = %command @ %paramVar;
}
%nextParamVar = getVariable("$paramCache" @ %i+1);
if(%nextParamVar !$= "")
{
%command = %command @ ",";
}
}
%command = %command @ ");";
//echo("AssetBrowser::callAssetTypeFunc() - executing command: " @ %command);
%return = "";
if(%command !$= "")
%return = eval(%command);
$CurrentAssetBrowser = "";
return %return;
}
function AssetBrowser::getAssetTypeGroup(%typeName)
{
%typeGroup = "";
%typeData = "";
for(%i=0; %i < ABAssetTypesList.count(); %i++)
{
%group = ABAssetTypesList.getKey(%i);
%typeData = ABAssetTypesList.getValue(%i);
if(getField(%typeData, 0) $= %typeName)
{
%typeGroup = %group;
%typeData = %typeData;
break;
}
}
return %typeGroup;
}
//
function AssetBrowser::initialize(%this)
{
// manage preview array
if(!isObject(AssetPreviewArray))
new ArrayObject(AssetPreviewArray);
if(!isObject(ObjectCreator))
new ScriptObject(ObjectCreator);
if(!isObject(%this.dirHandler))
Misc Quality of Life and Bug fixes Added handling for if preview images on image assets fails to generate, will fallback to using the full image Added handling for double clicking or drag-n-dropping terrain assets to create them Improved handling of field labels in variable inspector by making the stringtable be case sensitive. Added editor settings for handling of asset double click behavior. Can now select between Edit Asset and Spawn Asset. Support is asset type dependent. Added editor setting for auto-importing loose files when navigating to a folder. If on and the user has flagged to also enable auto-import generally, will auto import all unaffiliated loose files in as assets. Added editor setting for default module to use when creating new assets. Updated various tooling logic so when creating a new material, if this and the 'Always Prompt Module Target' setting is off, it will fill in the target module and target asset path info based on the default module. Fixed issue with editors that use managedData scripts where if the path didn't exist, the script file wouldn't be made. Fixed display issue in terrain editor where if you clear the detail map, the normal/macro/orm maps would disable, but not also clear. Fixed handling of cleared maps in terrain editor so it no longer fills empty maps in with the no image image. Fixed handling of creating new material where it would fill in the diffuse with a no texture image as the default. Fixed issue where canceling out of creating a module would still prompt to create the common default folders. Fixed issue where the Select Module window couldn't be closed via the cancel or x buttons. Based on feedback, reduced default size of the Text Pad window. Fixed issue where the Drop At menu list wouldn't correctly display which item was marked after it was changed. Fixed spawning shape asset handling so it uses whatever the editor's Drop At setting is. Improved themeing of regular bitmap buttons in the editor. Based on feedback, flipped layout of Target Module and Target Path in the Create New Asset window. Improved handling of setting up the Target Path for when creating new assets. If a path is not set, and the user has a Default Module, it will default the path to that module.
2021-08-28 23:51:27 +00:00
{
%this.dirHandler = makedirectoryHandler(%this-->filterTree, "cache,shaderCache,previewCache", "");
Misc Quality of Life and Bug fixes Added handling for if preview images on image assets fails to generate, will fallback to using the full image Added handling for double clicking or drag-n-dropping terrain assets to create them Improved handling of field labels in variable inspector by making the stringtable be case sensitive. Added editor settings for handling of asset double click behavior. Can now select between Edit Asset and Spawn Asset. Support is asset type dependent. Added editor setting for auto-importing loose files when navigating to a folder. If on and the user has flagged to also enable auto-import generally, will auto import all unaffiliated loose files in as assets. Added editor setting for default module to use when creating new assets. Updated various tooling logic so when creating a new material, if this and the 'Always Prompt Module Target' setting is off, it will fill in the target module and target asset path info based on the default module. Fixed issue with editors that use managedData scripts where if the path didn't exist, the script file wouldn't be made. Fixed display issue in terrain editor where if you clear the detail map, the normal/macro/orm maps would disable, but not also clear. Fixed handling of cleared maps in terrain editor so it no longer fills empty maps in with the no image image. Fixed handling of creating new material where it would fill in the diffuse with a no texture image as the default. Fixed issue where canceling out of creating a module would still prompt to create the common default folders. Fixed issue where the Select Module window couldn't be closed via the cancel or x buttons. Based on feedback, reduced default size of the Text Pad window. Fixed issue where the Drop At menu list wouldn't correctly display which item was marked after it was changed. Fixed spawning shape asset handling so it uses whatever the editor's Drop At setting is. Improved themeing of regular bitmap buttons in the editor. Based on feedback, flipped layout of Target Module and Target Path in the Create New Asset window. Improved handling of setting up the Target Path for when creating new assets. If a path is not set, and the user has a Default Module, it will default the path to that module.
2021-08-28 23:51:27 +00:00
%this.dirHandler.currentAddress = "data/";
}
%this-->filterTree.buildIconTable( ":tools/classIcons/Prefab:tools/classIcons/Prefab" @
":tools/classIcons/SimSet:tools/classIcons/SimSet");
%this.isReImportingAsset = false;
%this.coreModulesFilter = false;
%this.toolsModulesFilter = false;
%this.onlyShowModulesWithAssets = false;
%this.folderPanelState = true;
%this.folderPanelSplit = 0;
%this.templateFilesPath = "tools/assetBrowser/scripts/templateFiles/";
//First, build our our list of active modules
%modulesList = ModuleDatabase.findModules(true);
%this-->previewSlider.setValue(EditorSettings.value("Assets/Browser/previewTileSize", "1.0"));
%this-->filterAssetsButton.setActive(true);
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
%this.toggleAssetTypeFilter(0);
}
function AssetBrowser::onAdd(%this)
{
}
function AssetBrowser::onWake(%this)
{
%this.initialize();
// Make the window fit next to the side panel
// We do a simple resize so that we don't have to redo the whole GUI layout
%newWidth = getWord($pref::Video::mode, 0) - 360;
%vertPos = getWord($pref::Video::mode, 1) - 360 - 35;
AssetBrowserWindow.resize("0", %vertPos, %newWidth, "360");
AssetBrowserWindow.dockPanel();
}
function AssetBrowser::onDialogPop(%this)
{
$AssetBrowser::Open = false;
%lastPosExt = AssetBrowserWindow.position SPC AssetBrowserWindow.extent;
EditorSettings.setValue("Assets/Browser/LastPosExt", %lastPosExt);
}
function AssetBrowser::onDialogPush(%this)
{
$AssetBrowser::Open = true;
EditorGui.updateSideBar();
}
function AssetBrowser::setTab(%this, %tab, %text, %command)
{
if(isObject(%tab))
{
%tab.setActive(true);
%tab.setHidden(false);
%tab.setText(%text);
%tab.command = %command;
}
}
function AssetBrowser::putToFront(%this)
{
// Close the object
%this.hideDialog();
// Create the object again so it will render on top
%this.ShowDialog();
// Put the focus on this window
%this.restoreLastPosExt();
AssetBrowserWindow.selectWindow();
}
function AssetBrowser::restoreLastPosExt(%this)
{
%lastPosExt = EditorSettings.value("Assets/Browser/LastPosExt", "");
if(%lastPosExt !$= "")
{
AssetBrowserWindow.resize(getWord(%lastPosExt, 0), getWord(%lastPosExt, 1), getWord(%lastPosExt, 2), getWord(%lastPosExt, 3));
}
EditorGui.updateSideBar();
}
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
function contentTreeTabBook::onTabSelected(%this, %tabText, %tabIndex)
{
if(%tabText $= "Content")
{
//Force it to navigate to current active directory, which also rebuilds the
//tree
AssetBrowser.dirHandler.navigateTo(AssetBrowser.dirHandler.currentAddress);
}
else
{
AssetBrowser-->filterTree.clear();
AssetBrowser-->filterTree.buildVisibleTree(true);
}
}
//Filters
function AssetBrowser::showFilterPopup(%this)
{
BrowserVisibilityPopup.showPopup(Canvas);
}
function AssetBrowser::viewCoreModulesFilter(%this)
{
%oldVal = EditorSettings.value("Assets/Browser/showCoreModule", false);
%newVal = !%oldVal;
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
%this.coreModulesFilter = %newVal;
BrowserVisibilityPopup.checkItem(0,%newVal);
EditorSettings.setValue("Assets/Browser/showCoreModule", %newVal);
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
AssetBrowser.loadDirectories();
}
function AssetBrowser::viewToolsModulesFilter(%this)
{
%oldVal = EditorSettings.value("Assets/Browser/showToolsModule", false);
%newVal = !%oldVal;
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
%this.toolsModulesFilter = %newVal;
BrowserVisibilityPopup.checkItem(1,%newVal);
EditorSettings.setValue("Assets/Browser/showToolsModule", %newVal);
%this.loadDirectories();
}
function AssetBrowser::viewPopulatedModulesFilter(%this)
{
%oldVal = EditorSettings.value("Assets/Browser/showOnlyPopulatedModule", false);
%newVal = !%oldVal;
BrowserVisibilityPopup.checkItem(2,%newVal);
EditorSettings.setValue("Assets/Browser/showOnlyPopulatedModule", %newVal);
%this.loadDirectories();
}
function AssetBrowser::toggleShowingFolders(%this)
{
%oldVal = EditorSettings.value("Assets/Browser/showFolders", false);
%newVal = !%oldVal;
BrowserVisibilityPopup.checkItem(4,%newVal);
EditorSettings.setValue("Assets/Browser/showFolders", %newVal);
%this.loadDirectories();
}
function AssetBrowser::toggleShowingEmptyFolders(%this)
{
%oldVal = EditorSettings.value("Assets/Browser/showEmptyFolders", false);
%newVal = !%oldVal;
BrowserVisibilityPopup.checkItem(5,%newVal);
EditorSettings.setValue("Assets/Browser/showEmptyFolders", %newVal);
%this.refresh();
}
function AssetBrowser::toggleAssetTypeFilter(%this, %assetTypeIdx)
{
%isChecked = AssetTypeListPopup.isItemChecked(%assetTypeIdx);
//Clear existing filters
if(%assetTypeIdx == 0)
{
for(%i=0; %i < ABAssetTypesList.Count(); %i++)
{
AssetTypeListPopup.checkItem(%i+2, false);
}
AssetTypeListPopup.checkItem(0, true);
}
else if(%assetTypeIdx > 1) //slot 1 is the divider so ignore it
{
if(%isChecked)
{
%anyOtherFilters = false;
for(%i=0; %i < ABAssetTypesList.Count(); %i++)
{
if(%assetTypeIdx == %i+2)
continue;
if(AssetTypeListPopup.isItemChecked(%i+1))
{
%anyOtherFilters = true;
break;
}
}
}
if(%isChecked && !%anyOtherFilters)
{
for(%i=0; %i < ABAssetTypesList.Count(); %i++)
{
AssetTypeListPopup.checkItem(%i+2, false);
}
AssetTypeListPopup.checkItem(0, true);
}
else
{
AssetTypeListPopup.checkItem(0, false);
AssetTypeListPopup.checkItem(%assetTypeIdx, !%isChecked);
}
}
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
//Update the displayed search text!
//First, clear out the old type search term
for(%i=0; %i < AssetSearchTerms.count(); %i++)
{
%action = AssetSearchTerms.getKey(%i);
if(%action $= "type")
{
AssetSearchTerms.erase(%i);
%i--;
}
}
for(%i=2; %i < AssetTypeListPopup.getItemCount(); %i++)
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
{
%isChecked = AssetTypeListPopup.isItemChecked(%i);
if(!%isChecked)
continue;
%typeListText = AssetTypeListPopup.getItemText(%i);
for(%t=0; %t < ABAssetTypesList.Count(); %t++)
{
%typeData = ABAssetTypesList.getValue(%t);
%typeName = getField(%typeData, 1);
if(%typeListText $= %typeName)
{
AssetSearchTerms.add("type", getField(%typeData, 0));
break;
}
}
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
}
%this.updateSearchTextFromFilter();
%this.rebuildAssetArray();
}
//
function AssetBrowser::selectAsset( %this, %asset )
{
if(%this.selectCallback !$= "")
{
// The callback function should be ready to intake the returned material
//eval("materialEd_previewMaterial." @ %propertyField @ " = " @ %value @ ";");
if( %this.returnType $= "name" )
{
2021-05-05 02:49:19 +00:00
// TODO!
%name = "";
eval( "" @ %this.selectCallback @ "(" @ %name @ ");");
}
else
{
%command = "" @ %this.selectCallback @ "(\"" @ %asset @ "\");";
eval(%command);
}
}
else
{
//try just setting the asset
%this.changeAsset();
}
Adjusted callback handling of asset inspector fields when invoking AB to select asset for more consistent behavior and better handling of updating the objects and inspector Added logic to forcefully acquire newly imported asset definition to better try and ensure it's loaded immediately after import Added logic to asset importer so if a file is not found for an importing material asset, if populate maps is on, then it will try and find a matching image asset in the destination module Added logic to tsStatic to better handle fields being updated via the editor, forcing updates and refreshes of the shape and materialSlots Fixed handling of guiBitmapButtonCtrl so it will update the bitmap used when edited via the Gui Editor Updated image ref to the hudFill image asset for the console GUI Cleaned up names for the default camera model/material Defaulted import config to utilize the Prune action instead of rename for more predictable default behavior Added icons next to AB's preview slider bar for additional visual feedback of slider intent Added missing checkbox to asset import window and cleaned up scaling behavior Fixed handling of drag-n-drop behavior in GUI editor so it doesn't block further interaction Added logic for drag-n-drop of image assets to GUI Editor so it will create a GuiBitmapCtrl with the image Added handling for drag-n-drop import of folders of assets to AB/Asset Import Added missing asset import config option to indicate if config supported import of sound assets Added logic when opening asset import config editor, where if there is a default import config set in the settings, it will open that one by default Hid the collision section of the import config editor, as those options are currently unutilized Improved behavior for Create New Folder window in the AB, now always pushing to the front, and also selecting the text by default, so the user can just start typing the new name Also added return and escape key accelerators to Create New Folder window for better UX Fixed display of editor windows, adding a distinct blue color to highlighted windows' title bar and fixing display of minimize/maximize/window/close buttons Moved GUIEditor's onControlDropped function to the AB script to match placement of sibling world editor function Fixed issue with material editor where the ORM Config map slot was getting the normal map instead of the correct ORM map
2021-11-26 22:40:15 +00:00
if(isObject(Inspector))
Inspector.refresh();
%this.hideDialog();
}
function AssetBrowser::showDialog( %this, %AssetTypeFilter, %selectCallback, %targetObj, %fieldName, %returnType)
{
// Set the select callback
%this.selectCallback = %selectCallback;
%this.returnType = %returnType;
%this.assetTypeFilter = %AssetTypeFilter;
%this.fieldTargetObject = %targetObj;
%this.fieldTargetName = %fieldName;
Canvas.popDialog(%this);
Canvas.pushDialog(%this);
%this.setVisible(1);
AssetBrowserWindow.setVisible(1);
AssetBrowserWindow.selectWindow();
if(AssetBrowserWindow.docked)
AssetBrowserWindow.dockPanel();
else
AssetBrowserWindow.releasePanel();
//If we're special-case filtering(like for selecting a given type), then ignore our normal
//visibility filter
if(%AssetTypeFilter !$= "")
{
%this-->filterAssetsButton.setActive(false);
}
else
{
%this-->filterAssetsButton.setActive(true);
}
if(%selectCallback $= "")
{
//we're not in selection mode, so just hide the select button
%this-->SelectButton.setHidden(true);
%this.selectMode = 0;
}
else
{
%this-->SelectButton.setHidden(false);
%this.selectMode = 1;
}
%this.loadDirectories();
%this.restoreLastPosExt();
}
function AssetBrowser::hideDialog( %this )
{
%this.setVisible(1);
AssetBrowserWindow.setVisible(1);
Canvas.popDialog(AssetBrowser_addModule);
Canvas.popDialog(ImportAssetWindow);
Canvas.popDialog(%this);
}
function AssetBrowser::toggleDialog( %this )
{
if(%this.isAwake())
{
%this.hideDialog();
}
else
{
%this.showDialog();
}
}
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
{
if(!isObject(%this.previewData))
{
%this.previewData = new ScriptObject();
}
Adjusted handling for the bitmap and bitmapAsset fields for guiBitmapButtonCtrl to forcefully update the button states when changed, ensuring that the bitmaps refresh when changed via the field Added callback for onResize to guiWindowCtrl so controls - such as the EditorTree - can be properly resized in certain circumstances when the window is changed Added getIncrement() and getRange() to GuiGameSettingsCtrl to better facilitate options manipulation on the script side Corrected some of the console method documentation strings in GuiGameSettingsCtrl Removed some unneeded, extraneous files and their asset definitions that came from odd import conversions. Where applicable, created cleaned up versions to make naming conventions and references stable Fixed canvas mode update text typo: FSAA -> FXAA Added logic to DOF, Light Rays, SSAO and Vignette postFX's to check both the preset setting AND the user preference before enabling. Shifted initialization order so PostFX's are loaded before we configure the canvas, to ensure stuff like the FXAAPostFX exists and can be toggled on on load Fixed multiple issues with options menu: When using gamepad, unable to navigate from categories to options. Fixed so can now traverse as normal Input limitations on gamepad necessitated changing of how setting applying happens, is now done as a 'apply or discard' prompt when leaving the options menu Added proper handling for adjusting settings with gamepad with left/right inputs Fixed issue where the unapplied change for an option was sometimes being processed as an object name rather than an implicit string. Now made to be explicit strings to avoid issue. Made the menu button input for "Select" to go from categories to options gamepad only, and hidden when in the options list Fixed issue where changing window mode didn't correctly affect resolution option. Now set up so changing this field correctly refreshes the resolution option. Specifically, when on borderless, the resolution field does not show, preventing confusion as it is always full resolution Generally have the options list refresh when changes happen to allow any and all fields to be able to dynamically respond to other options having changed improving flexibility. Cleaned up old, unused, commented out functions Added ability on OKCancel message boxes to override the button text if needed Fixed issue with AssetBrowser where the shrink/grow icons next to the preview size slider were not anchored correctly. Adjusted callback logic so if preview slider is clicked on, rather than dragged, it will correctly update the zoom values Added sorting to Modules List dropdown for the AssetBrowser Improved standardization of double-clicking in AssetBrowser. Now defaults to editing action if regularly browsing and selecting if in select mode. Still allows regular per-type overrides as normal Moved definition of GuiDisabledTextEditProfile to gui profiles.ed.tscript file, removed duplicates to stop error spam Adjusted default settings value for double-click action in AB to be edit to prevent unstable behavior Removed old file refs from Load Recent list in the default settings
2022-03-27 03:36:37 +00:00
else
{
%this.previewData.tooltip = "";
%this.previewData.assetName = "";
%this.previewData.previewImage = "";
%this.previewData.doubleClickCommand = "";
}
%previewImage = "core/art/warnmat";
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
if(/*%moduleName !$= "" && */ModuleDatabase.findModule(%moduleName, 1) !$= "")
{
%assetDesc = AssetDatabase.acquireAsset(%asset);
%assetName = AssetDatabase.getAssetName(%asset);
%assetType = AssetDatabase.getAssetType(%asset);
}
else
{
//special-case entry
if(getFieldCount(%asset) > 1)
{
%assetType = getField(%asset,0);
%assetName = getField(%asset, 1);
if(%assetType $= "Creator")
{
%assetDesc = %assetName;
%assetDesc.assetType = %assetType;
%moduleName = %assetDesc;
}
}
}
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%previewSize = 100 SPC 100;
%previewBounds = 20;
%tooltip = %assetName;
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%textBottomPad = 20;
%previewScaleSize = %this-->previewSlider.getValue();
if(%previewScaleSize $= "")
{
%previewScaleSize = 1;
%this-->previewSlider.setValue(1);
}
if(%this.selectMode)
{
%doubleClickCommand = %this @ ".selectAsset( "@ %this @ ".selectedAsset );";
}
else
{
%doubleClickCommand = %this @ ".callAssetTypeFunc(" @ %assetType @ ", \"onEdit\", \"" @ %moduleName @ "\", \"" @ %assetName @ "\" );";
}
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%this.previewData.previewLoaded = true;
//echo("AssetBrowser::buildAssetPreview() - building preview of asset type: " @ %assetType);
%this.callAssetTypeFunc(%assetType, "buildBrowserElement", %moduleName, %assetName, %this.previewData);
//debug dump
%tooltip = %this.previewData.tooltip;
%assetName = %this.previewData.assetName;
%previewImage = %this.previewData.previewImage;
if(%this.previewData.doubleClickCommand !$= "")
%doubleClickCommand = %this.previewData.doubleClickCommand;
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%previewButton = new GuiIconButtonCtrl()
{
class = "AssetBrowserPreviewButton";
useMouseEvents = true;
iconLocation = "Center";
sizeIconToButton = true;
makeIconSquare = true;
textLocation = "Bottom";
extent = %previewSize.x SPC %previewSize.y + %textBottomPad;
buttonType = "RadioButton";
buttonMargin = "0 -10";
profile = ToolsGuiDefaultIconBtnProfile;
tooltip = %this.previewData.tooltip;
assetBrowser = %this;
assetName = %assetName;
moduleName = %moduleName;
assetType = %assetType;
bitmapAsset = %this.previewData.previewImage;
Command = %this @ ".updateSelection( $ThisControl.assetName, $ThisControl.moduleName );";
altCommand = %doubleClickCommand;
text = %this.previewData.assetName;
originalAssetName = %this.previewData.assetName;
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
};
if(%previewScaleSize == 0 || startsWith(%this.dirHandler.currentAddress, "Creator"))
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
{
%previewButton.iconLocation = "Left";
%previewButton.textLocation = "Right";
%previewButton.setextent(160,34);
%previewButton.buttonMargin = "8 8";
%previewButton.textMargin = "6";
%this.previewListMode = true;
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
}
else
{
%size = %previewSize.x * %previewScaleSize;
%previewButton.setextent(%size,%size + %textBottomPad);
%this.previewListMode = false;
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
}
// add to the gui control array
%this-->assetList.add(%previewButton);
// add to the array object for reference later
if(%this.previewData.previewLoaded == false)
AssetPreviewArray.add( %previewButton );
}
- Fixes the display of the preview in the MaterialAsset fields - Hides the special-case direct filepath field for ShapeAsset persist fields macro - Shifts the handling of TSStatics so the shape instance will load materials on the server as well as the client. This opens gameplay options as well as allowing rebaking of meshes functionality more easily - Expands AssetBase's isValidAsset utility function to actually check validity instead of just returning true - Adds isValid utility function to AssetPtr - Added new field flag that makes the field not write out to file - Removed legacy iconBitmap field from GuiIconButtonCtrl because it was causing errors - Fixed group filtering check of guiInspector to ignore case - Removed unneeded isFile checks for common datablock script files in Prototyping module script - Removed test datablocks from Prototyping module - Removed unnecessary container control from AssetBrowser - Adjusted preview regen logic of AssetBrowser so it doesn't trip if you're simply resizing the window - Fixed issue where row-vs-column layout logic for AssetBrowser when resizing window was fiddly - Added handling for when Dragging and Dropping datablock from AssetBrowser to spawn, it'll prompt if it spawns the actual object, or a spawnsphere that spawns said object. In the event of an PlayerData will also prompt if it should spawn an AIPlayer - Added ability to take a TSStatic that uses a baked down mesh and are able to restore it to the cache prefab, or trigger and in-place rebake to refresh it if something has changed in the original contents via RMB menu on the scene tree - Added ability to explode prefab to RMB menu on scene tree - Added ability to convert selection to prefab or bake to mesh in RMB menu on scene tree - Tweaked sizing of the DatablockEditorCreatePrompt window to not have cut off elements and easier to see/work with - Added sanity check to datablock editor creation - Fixed preview display of material in Decal Editor - Made compositeTextureEditor use the cached preview of images - Fixed sizing/spacing of gui selection dropdown as well as resolution dropdown of GuiEditor - Fixes MaterialEditor to properly save the group collapse state when editing - Adds ability to in-flow edit and create datablocks in the NavMesh Editor for the testing panel, and makes the datablock dropdown searchable - Fixed issue where opening the ShapeEditor via the edit button on a ShapeAsset field would cause the action buttons on the top bar to not show - Fixed error in shape editor where when exiting it was erroneously checking for a clear value of -1 rather than 0 - Removed unneeded top tabbook and tab page for main editor panel - Fixed issue where reset button of TerrainBrush Softness Curve editor didn't actually reset - Resized Object Builder window to not cut off elements and have enough width to show more data - Added a TypeCommand field type to Object Builder and changed spawnscript field of SpawnSphere to use it rather than a simple text edit field - Allow SpawnSphere in ObjectBuilder to be passed in spawn class and spawn datablock default info - Injects button to controllable objects when Inspecting them to make it easy to toggle if you're in control of it or not -
2025-08-26 04:35:28 +00:00
function AssetBrowser::refresh(%this, %regenPreviews)
{
- Fixes the display of the preview in the MaterialAsset fields - Hides the special-case direct filepath field for ShapeAsset persist fields macro - Shifts the handling of TSStatics so the shape instance will load materials on the server as well as the client. This opens gameplay options as well as allowing rebaking of meshes functionality more easily - Expands AssetBase's isValidAsset utility function to actually check validity instead of just returning true - Adds isValid utility function to AssetPtr - Added new field flag that makes the field not write out to file - Removed legacy iconBitmap field from GuiIconButtonCtrl because it was causing errors - Fixed group filtering check of guiInspector to ignore case - Removed unneeded isFile checks for common datablock script files in Prototyping module script - Removed test datablocks from Prototyping module - Removed unnecessary container control from AssetBrowser - Adjusted preview regen logic of AssetBrowser so it doesn't trip if you're simply resizing the window - Fixed issue where row-vs-column layout logic for AssetBrowser when resizing window was fiddly - Added handling for when Dragging and Dropping datablock from AssetBrowser to spawn, it'll prompt if it spawns the actual object, or a spawnsphere that spawns said object. In the event of an PlayerData will also prompt if it should spawn an AIPlayer - Added ability to take a TSStatic that uses a baked down mesh and are able to restore it to the cache prefab, or trigger and in-place rebake to refresh it if something has changed in the original contents via RMB menu on the scene tree - Added ability to explode prefab to RMB menu on scene tree - Added ability to convert selection to prefab or bake to mesh in RMB menu on scene tree - Tweaked sizing of the DatablockEditorCreatePrompt window to not have cut off elements and easier to see/work with - Added sanity check to datablock editor creation - Fixed preview display of material in Decal Editor - Made compositeTextureEditor use the cached preview of images - Fixed sizing/spacing of gui selection dropdown as well as resolution dropdown of GuiEditor - Fixes MaterialEditor to properly save the group collapse state when editing - Adds ability to in-flow edit and create datablocks in the NavMesh Editor for the testing panel, and makes the datablock dropdown searchable - Fixed issue where opening the ShapeEditor via the edit button on a ShapeAsset field would cause the action buttons on the top bar to not show - Fixed error in shape editor where when exiting it was erroneously checking for a clear value of -1 rather than 0 - Removed unneeded top tabbook and tab page for main editor panel - Fixed issue where reset button of TerrainBrush Softness Curve editor didn't actually reset - Resized Object Builder window to not cut off elements and have enough width to show more data - Added a TypeCommand field type to Object Builder and changed spawnscript field of SpawnSphere to use it rather than a simple text edit field - Allow SpawnSphere in ObjectBuilder to be passed in spawn class and spawn datablock default info - Injects button to controllable objects when Inspecting them to make it easy to toggle if you're in control of it or not -
2025-08-26 04:35:28 +00:00
if(%regenPreviews $= "")
%regenPreviews = true;
if(!%this.dirty && %regenPreviews)
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
{
%this.dirty = true;
%this.schedule(1, "doRefresh");
}
}
function AssetBrowser::doRefresh(%this)
{
if(%this.dirty)
{
%this.navigateTo(%this.dirHandler.currentAddress);
//Forces a clean collapse of the tree for any not-really-exposed items
%dataItem = %this-->filterTree.findItemByName("data");
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
* Fixes handling for Image, Material and Shape Assets' inspector fields so they properly work with non-object targeted inspectors, such as the PostFXEditor * Updated PostFXEditor scripts to handle refreshing properly when certainl field types(assetId fields) are changed * Adjusted display handling of slider values on guiGameSettingsCtrl to show 0.x decimal format instead of 0.xxxxx * Fixed pad length of item names in guiTreeView for items that are marked to avoid console spam * Fixed local offseting for popupMenus so scaled/offset window position doesn't cause the popup menu to offset from mouse click position(courtesy OTHG_Mars) * Fix issue with terrain where, due to default value save validation, the global scope for the terrain collision list would be whiped when saving, causing players to fall through terrain. Moved to per-terrain convexLists * Fixed issue with the core camera model mesh and updated references so camera bookmarks display properly * Fixed console spam during asset browser initialization where it would try and expand the directory tree even though the dir tree isn't populated yet * Fixed handling of Open File Location RMB menu action to properly deal with script and datablock types * Removed unusuable "Create ___" asset type prompts from the RMB menus for the AB to avoid confusion * Improved slider offset positioning for various popup sliders on editor toolbars * Anchored the visibility popup menu to the button for more consistent formatting and better feel * Shifted various visibility toggles from 'in place' on the menu buttons to functions, allowing it to also properly mark the menu entries as checked or not, improving usability
2022-08-26 20:25:17 +00:00
if(%dataItem != 0)
{
%this-->filterTree.expandItem(%dataItem, false);
%this-->filterTree.expandItem(%dataItem);
* Fixes handling for Image, Material and Shape Assets' inspector fields so they properly work with non-object targeted inspectors, such as the PostFXEditor * Updated PostFXEditor scripts to handle refreshing properly when certainl field types(assetId fields) are changed * Adjusted display handling of slider values on guiGameSettingsCtrl to show 0.x decimal format instead of 0.xxxxx * Fixed pad length of item names in guiTreeView for items that are marked to avoid console spam * Fixed local offseting for popupMenus so scaled/offset window position doesn't cause the popup menu to offset from mouse click position(courtesy OTHG_Mars) * Fix issue with terrain where, due to default value save validation, the global scope for the terrain collision list would be whiped when saving, causing players to fall through terrain. Moved to per-terrain convexLists * Fixed issue with the core camera model mesh and updated references so camera bookmarks display properly * Fixed console spam during asset browser initialization where it would try and expand the directory tree even though the dir tree isn't populated yet * Fixed handling of Open File Location RMB menu action to properly deal with script and datablock types * Removed unusuable "Create ___" asset type prompts from the RMB menus for the AB to avoid confusion * Improved slider offset positioning for various popup sliders on editor toolbars * Anchored the visibility popup menu to the button for more consistent formatting and better feel * Shifted various visibility toggles from 'in place' on the menu buttons to functions, allowing it to also properly mark the menu entries as checked or not, improving usability
2022-08-26 20:25:17 +00:00
}
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
%this.dirty = false;
}
}
function AssetBrowser::populatePreviewImages(%this)
{
for(%i=0; %i < AssetPreviewArray.count(); %i++)
{
%previewButton = AssetPreviewArray.getKey(%i);
%assetType = %previewButton.assetType;
%this.callAssetTypeFunc(%assetType, "generatePreviewImage", %previewButton.moduleName, %previewButton.assetName, %previewButton);
AssetPreviewArray.erase(%i);
%this.schedule(32, "populatePreviewImages");
return;
}
}
//
//
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
/*function AssetPreviewButton::onClick(%this)
{
echo("CLICKED AN ASSET PREVIEW BUTTON");
}
function AssetPreviewButton::onDoubleClick(%this)
{
echo("DOUBLE CLICKED AN ASSET PREVIEW BUTTON");
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
}*/
//
//
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
function assetBrowserPreviewSlider::onMouseDragged(%this)
{
EditorSettings.setValue("Assets/Browser/previewTileSize", %this.getValue());
- Fixes the display of the preview in the MaterialAsset fields - Hides the special-case direct filepath field for ShapeAsset persist fields macro - Shifts the handling of TSStatics so the shape instance will load materials on the server as well as the client. This opens gameplay options as well as allowing rebaking of meshes functionality more easily - Expands AssetBase's isValidAsset utility function to actually check validity instead of just returning true - Adds isValid utility function to AssetPtr - Added new field flag that makes the field not write out to file - Removed legacy iconBitmap field from GuiIconButtonCtrl because it was causing errors - Fixed group filtering check of guiInspector to ignore case - Removed unneeded isFile checks for common datablock script files in Prototyping module script - Removed test datablocks from Prototyping module - Removed unnecessary container control from AssetBrowser - Adjusted preview regen logic of AssetBrowser so it doesn't trip if you're simply resizing the window - Fixed issue where row-vs-column layout logic for AssetBrowser when resizing window was fiddly - Added handling for when Dragging and Dropping datablock from AssetBrowser to spawn, it'll prompt if it spawns the actual object, or a spawnsphere that spawns said object. In the event of an PlayerData will also prompt if it should spawn an AIPlayer - Added ability to take a TSStatic that uses a baked down mesh and are able to restore it to the cache prefab, or trigger and in-place rebake to refresh it if something has changed in the original contents via RMB menu on the scene tree - Added ability to explode prefab to RMB menu on scene tree - Added ability to convert selection to prefab or bake to mesh in RMB menu on scene tree - Tweaked sizing of the DatablockEditorCreatePrompt window to not have cut off elements and easier to see/work with - Added sanity check to datablock editor creation - Fixed preview display of material in Decal Editor - Made compositeTextureEditor use the cached preview of images - Fixed sizing/spacing of gui selection dropdown as well as resolution dropdown of GuiEditor - Fixes MaterialEditor to properly save the group collapse state when editing - Adds ability to in-flow edit and create datablocks in the NavMesh Editor for the testing panel, and makes the datablock dropdown searchable - Fixed issue where opening the ShapeEditor via the edit button on a ShapeAsset field would cause the action buttons on the top bar to not show - Fixed error in shape editor where when exiting it was erroneously checking for a clear value of -1 rather than 0 - Removed unneeded top tabbook and tab page for main editor panel - Fixed issue where reset button of TerrainBrush Softness Curve editor didn't actually reset - Resized Object Builder window to not cut off elements and have enough width to show more data - Added a TypeCommand field type to Object Builder and changed spawnscript field of SpawnSphere to use it rather than a simple text edit field - Allow SpawnSphere in ObjectBuilder to be passed in spawn class and spawn datablock default info - Injects button to controllable objects when Inspecting them to make it easy to toggle if you're in control of it or not -
2025-08-26 04:35:28 +00:00
AssetBrowser.refresh(false);
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
}
function AssetBrowser::loadDirectories( %this )
{
%this-->filterTree.clear();
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
%dataItem = AssetBrowser-->filterTree.insertItem(0, "Content");
%this-->filterTree.collectionsIdx = %this-->filterTree.insertItem(1, "Collections");
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%this-->filterTree.modulesIdx = %this-->filterTree.insertItem(1, "Modules");
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%dataItem = AssetBrowser-->filterTree.insertItem(AssetBrowser-->filterTree.modulesIdx, "data");
%this-->filterTree.tagsIdx = %this-->filterTree.insertItem(1, "Tags");
%this-->filterTree.creatorIdx = %this-->filterTree.insertItem(1, "Creator");
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
%this-->filterTree.clearSelection();
Fixed formatting to match the standard for TerrainMaterialAsset inspector fields Added utility functions to TerrainMaterialAsset for getting the material and fx material definitions Fixed logical flaw with the initialization code that could cause the materialDefinition to be nulled in terrainmaterialassets Fixed layer handling in GroundCover to properly work with TerrainMaterialAssets Added logic to properly exit out of the onAdd in the event no internal name is assigned or if there is a collision. This prevents duplicates from appearing in the terr mat editor when creating a new material Fixed issue where going from a creator item in the AB to selecting a particular asset type would break the filtering because select mode removed collections and creator items, changing all the item ids and breaking references. Added sanity check to prevent attempting to acquire non-assets in the AB, such as creator entries, which would cause console spam Added optional field to provide an override new asset name to the New Asset window Added logic so in the event no FX Material is found when importing a terrain material, it will create a stub entry so it always has one defined Added logic to handle situations where a terrain has a reference to an assetId, but the asset does not exist for whatever reason. Will prompt to create the missing asset, then continue on with the regular saving/editing process as normal Fixed issue where the terrain material editor would try and reference the preview images being used in the display on the editor instead of the proper assetId itself
2022-03-29 06:40:07 +00:00
if(%this.selectMode)
{
//Due to a fluke in how this tracks, it overrides the current addres, so we'll
//store it real fast
%curAdd = %this.dirHandler.currentAddress;
//Disable these for this go
%this-->filterTree.addSelection(%this-->filterTree.collectionsIdx);
%this-->filterTree.addSelection(%this-->filterTree.creatorIdx);
%this-->filterTree.hideSelection();
%this-->filterTree.clearSelection();
%this.dirHandler.currentAddress = %curAdd;
Fixed formatting to match the standard for TerrainMaterialAsset inspector fields Added utility functions to TerrainMaterialAsset for getting the material and fx material definitions Fixed logical flaw with the initialization code that could cause the materialDefinition to be nulled in terrainmaterialassets Fixed layer handling in GroundCover to properly work with TerrainMaterialAssets Added logic to properly exit out of the onAdd in the event no internal name is assigned or if there is a collision. This prevents duplicates from appearing in the terr mat editor when creating a new material Fixed issue where going from a creator item in the AB to selecting a particular asset type would break the filtering because select mode removed collections and creator items, changing all the item ids and breaking references. Added sanity check to prevent attempting to acquire non-assets in the AB, such as creator entries, which would cause console spam Added optional field to provide an override new asset name to the New Asset window Added logic so in the event no FX Material is found when importing a terrain material, it will create a stub entry so it always has one defined Added logic to handle situations where a terrain has a reference to an assetId, but the asset does not exist for whatever reason. Will prompt to create the missing asset, then continue on with the regular saving/editing process as normal Fixed issue where the terrain material editor would try and reference the preview images being used in the display on the editor instead of the proper assetId itself
2022-03-29 06:40:07 +00:00
}
%this.dirHandler.loadFolders("data", %dataItem);
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%this.loadCollectionSets();
%this.loadTags();
if (!%this.selectMode)
%this.loadCreatorClasses();
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
//If set to, show core
if(EditorSettings.value("Assets/Browser/showCoreModule", false) == 1)
{
%coreItem = %this-->filterTree.insertItem(%this-->filterTree.modulesIdx, "core");
%this.dirHandler.loadFolders("core", %coreItem);
}
//If set to, show tools
if(EditorSettings.value("Assets/Browser/showToolsModule", false) == 1)
{
%toolsItem = %this-->filterTree.insertItem(%this-->filterTree.modulesIdx, "tools");
%this.dirHandler.loadFolders("tools", %toolsItem);
}
%this-->filterTree.buildVisibleTree(true);
//Remove any modules that have no assets if we have that filter on
if(%this.onlyShowModulesWithAssets)
{
2021-05-05 02:49:19 +00:00
%modulesList = ModuleDatabase.findModules();
for(%i=0; %i < getWordCount(%modulesList); %i++)
{
%moduleName = getWord(%modulesList, %i).ModuleId;
%moduleItemId = %this-->filterTree.findItemByName(%moduleName);
if(%this-->filterTree.isParentItem(%moduleItemId) == false)
%this-->filterTree.removeItem(%moduleItemId);
}
}
//special handling for selections
if(%this.newModuleId !$= "")
{
%this-->filterTree.clearSelection();
%newModuleItem = %this-->filterTree.findItemByName(%this.newModuleId);
%this-->filterTree.selectItem(%newModuleItem);
%this.newModuleId = "";
}
%this.dirHandler.expandTreeToAddress(%this.dirHandler.currentAddress);
%selectedItem = %this.dirHandler.getFolderTreeItemFromAddress(%this.dirHandler.currentAddress);
%this-->filterTree.scrollVisibleByObjectId(%selectedItem);
%this-->filterTree.buildVisibleTree(true);
%this.refresh();
}
function AssetBrowser::updateSelection( %this, %asset, %moduleName )
{
//If we had an existing selected assetDef, clear the reference
if(isObject(AssetBrowser.selectedAssetDef))
AssetDatabase.releaseAsset(AssetBrowser.selectedAssetDef.getAssetId());
//AssetBrowser.selectedMaterial = %asset;
AssetBrowser.selectedAsset = %moduleName@":"@%asset;
//If it's got slashes, it's a path so it's actually a folder item, not an asset
if(strstr(%moduleName, "/") != -1)
return;
Fixed formatting to match the standard for TerrainMaterialAsset inspector fields Added utility functions to TerrainMaterialAsset for getting the material and fx material definitions Fixed logical flaw with the initialization code that could cause the materialDefinition to be nulled in terrainmaterialassets Fixed layer handling in GroundCover to properly work with TerrainMaterialAssets Added logic to properly exit out of the onAdd in the event no internal name is assigned or if there is a collision. This prevents duplicates from appearing in the terr mat editor when creating a new material Fixed issue where going from a creator item in the AB to selecting a particular asset type would break the filtering because select mode removed collections and creator items, changing all the item ids and breaking references. Added sanity check to prevent attempting to acquire non-assets in the AB, such as creator entries, which would cause console spam Added optional field to provide an override new asset name to the New Asset window Added logic so in the event no FX Material is found when importing a terrain material, it will create a stub entry so it always has one defined Added logic to handle situations where a terrain has a reference to an assetId, but the asset does not exist for whatever reason. Will prompt to create the missing asset, then continue on with the regular saving/editing process as normal Fixed issue where the terrain material editor would try and reference the preview images being used in the display on the editor instead of the proper assetId itself
2022-03-29 06:40:07 +00:00
//Check if this is an actual assetId, or if it's just a programmatic reference
//like what we use for the creator entries
if(AssetDatabase.isDeclaredAsset(AssetBrowser.selectedAsset))
{
//Looks good, it's an asset so we'll select the definition while we're at it
AssetBrowser.selectedAssetDef = AssetDatabase.acquireAsset(AssetBrowser.selectedAsset);
Fixed formatting to match the standard for TerrainMaterialAsset inspector fields Added utility functions to TerrainMaterialAsset for getting the material and fx material definitions Fixed logical flaw with the initialization code that could cause the materialDefinition to be nulled in terrainmaterialassets Fixed layer handling in GroundCover to properly work with TerrainMaterialAssets Added logic to properly exit out of the onAdd in the event no internal name is assigned or if there is a collision. This prevents duplicates from appearing in the terr mat editor when creating a new material Fixed issue where going from a creator item in the AB to selecting a particular asset type would break the filtering because select mode removed collections and creator items, changing all the item ids and breaking references. Added sanity check to prevent attempting to acquire non-assets in the AB, such as creator entries, which would cause console spam Added optional field to provide an override new asset name to the New Asset window Added logic so in the event no FX Material is found when importing a terrain material, it will create a stub entry so it always has one defined Added logic to handle situations where a terrain has a reference to an assetId, but the asset does not exist for whatever reason. Will prompt to create the missing asset, then continue on with the regular saving/editing process as normal Fixed issue where the terrain material editor would try and reference the preview images being used in the display on the editor instead of the proper assetId itself
2022-03-29 06:40:07 +00:00
}
}
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
function AssetBrowser::loadCollectionSets(%this)
{
//Process any datablocks and populate their lists categories as tags as well
%collectionsItem = AssetBrowser-->filterTree.collectionsIdx;
%collectionsCount = AssetBrowserCollectionSets.value("CollectionSetCount", 0);
for ( %i = 0; %i < %collectionsCount; %i++ )
{
%collection = AssetBrowserCollectionSets.value("Collection"@%i, "");
%collectionName = getField(%collection, 0);
%collectionTerm = getField(%collection, 1);
AssetBrowser-->filterTree.insertItem(%collectionsItem, %collectionName, %collectionTerm);
}
}
function AssetBrowser::setCollectionSetActive(%this, %collectionSet)
{
AssetBrowserSearchFilter.setText(%collectionSet);
AssetBrowserSearchFilter.onReturn();
}
function AssetBrowser::loadTags(%this)
{
//Process any datablocks and populate their lists categories as tags as well
%dataGroup = "DataBlockGroup";
%tagItem = AssetBrowser-->filterTree.tagsIdx;
for ( %i = 0; %i < %dataGroup.getCount(); %i++ )
{
%obj = %dataGroup.getObject(%i);
// echo ("Obj: " @ %obj.getName() @ " - " @ %obj.category );
if ( %obj.category $= "" && %obj.category == 0 )
continue;
%tagChildItem = AssetBrowser-->filterTree.findChildItemByName(%tagItem, %obj.category);
if(%tagChildItem == 0)
{
//Didn't already exist, so register it in
AssetBrowser-->filterTree.insertItem(%tagItem, %obj.category);
}
}
}
function AssetBrowser::setTagActive(%this, %tag)
{
%found = false;
for(%i=0; %i < AssetSearchTerms.count(); %i++)
{
%action = AssetSearchTerms.getKey(%i);
%word = AssetSearchTerms.getValue(%i);
if(%action $= "tag" && %word $= %tag)
{
//If we found it, we just remove it from our list, toggling it off
AssetSearchTerms.erase(%i);
%found = true;
}
}
//If we didn't find it, we're going to add it into our list
if(!%found)
{
AssetSearchTerms.add("tag", %tag);
}
%this.updateSearchTextFromFilter();
%this.rebuildAssetArray();
}
//
//needs to be deleted with the persistence manager and needs to be blanked out of the matmanager
//also need to update instances... i guess which is the tricky part....
function AssetBrowser::showDeleteDialog( %this )
{
%material = AssetBrowser.selectedAsset;
%secondFilter = "MaterialFilterMappedArray";
%secondFilterName = "Mapped";
for( %i = 0; %i < MaterialFilterUnmappedArray.count(); %i++ )
{
if( MaterialFilterUnmappedArray.getValue(%i) $= %material )
{
%secondFilter = "MaterialFilterUnmappedArray";
%secondFilterName = "Unmapped";
break;
}
}
if( isObject( %material ) )
{
toolsMessageBoxYesNoCancel("Delete Material?",
"Are you sure you want to delete<br><br>" @ %material.getName() @ "<br><br> Material deletion won't take affect until the engine is quit.",
"AssetBrowser.deleteMaterial( " @ %material @ ", " @ %secondFilter @ ", " @ %secondFilterName @" );",
"",
"" );
}
}
function AssetBrowser::deleteMaterial( %this, %materialName, %secondFilter, %secondFilterName )
{
if( !isObject( %materialName ) )
return;
for( %i = 0; %i <= MaterialFilterAllArray.countValue( %materialName ); %i++)
{
%index = MaterialFilterAllArray.getIndexFromValue( %materialName );
MaterialFilterAllArray.erase( %index );
}
MaterialFilterAllArrayCheckbox.setText("All ( " @ MaterialFilterAllArray.count() - 1 @ " ) ");
%checkbox = %secondFilter @ "Checkbox";
for( %k = 0; %k <= %secondFilter.countValue( %materialName ); %k++)
{
%index = %secondFilter.getIndexFromValue( %materialName );
%secondFilter.erase( %index );
}
%checkbox.setText( %secondFilterName @ " ( " @ %secondFilter.count() - 1 @ " ) ");
for( %i = 0; %materialName.getFieldValue("materialTag" @ %i) !$= ""; %i++ )
{
%materialTag = %materialName.getFieldValue("materialTag" @ %i);
for( %j = AssetBrowser.staticFilterObjects; %j < AssetBrowser-->filterArray.getCount() ; %j++ )
{
if( %materialTag $= AssetBrowser-->filterArray.getObject(%j).getObject(0).filter )
{
%count = getWord( AssetBrowser-->filterArray.getObject(%j).getObject(0).getText(), 2 );
%count--;
AssetBrowser-->filterArray.getObject(%j).getObject(0).setText( %materialTag @ " ( "@ %count @ " )");
}
}
}
UnlistedMaterials.add( "unlistedMaterials", %materialName );
if( %materialName.getFilename() !$= "" &&
%materialName.getFilename() !$= "tools/gui/AssetBrowser.ed.gui" &&
%materialName.getFilename() !$= "tools/materialEditor/scripts/materialEditor.ed." @ $TorqueScriptFileExtension )
{
AssetBrowserPerMan.removeObjectFromFile(%materialName);
AssetBrowserPerMan.saveDirty();
}
Added sanity check to ensure that the requested file to be scaled via saveScaledImage actually exists Shifts integration of other modules with the OptionsMenu so other modules can inject their own options categories to a callOnModules hook Updated ExampleModule to use new options menu integration angle to show example option Deleted unneeded dropdown_textEdit_image asset def from baseUI Fixed incorrect internal values for the terrainIcon_image asset def that made it present as a redundant terrain material asset Cleaned up old, bad loadFilters calls and replaced them with the proper refresh() calls. Removed old, bad calls for jumping through the asset browser's tree from when it was still hardcoded organization, which cuts down a lot of error spam Cleaned up some of the asset type's preview image assignment code to be more reliable Made terrain materials now use a similar preview proxy shape as regular materials Fixed erroneous duplicate GuiInspectorTypeShapeAssetPtr::onControlDropped, which was breaking drag-n-drop actions of shapeAssets into inspector fields Added proper logic for drag-n-drop actions of imageAssets into inspector fields Add sanity check after creating new asset to avoid redundant attempts at initialization of the new asset Fixed ConvexShape Editor tooling so you can now use the UI to apply the selected material to the selected surface Added tools menu to the menubar with the Project Importer entry so the PI can be launched from either tool Implemented ability to drag-n-drop imageAssets onto MaterialEditor map fields and have it work Implemented ability to drag-n-drop imageAssets onto TerrainMaterial Editor map fields and have it work Made the TerrainMaterial editor dialogue have a non-modal background so you can interact with the editor as normal while it's up Add sanity check to avoid attempting to mark EditorTree items if we couldn't find it's id renamed BaseMap references in terrain material editor to diffuseMap for consistency
2022-03-27 08:05:48 +00:00
AssetBrowser.refresh();
}
function AssetBrowser::toggleTagFilterPopup(%this)
{
if(TagFilterWindow.visible)
TagFilterWindow.visible = false;
else
TagFilterWindow.visible = true;
return;
%assetQuery = new AssetQuery();
%numAssetsFound = AssetDatabase.findAllAssets(%assetQuery);
for( %i=0; %i < %numAssetsFound; %i++)
{
%assetId = %assetQuery.getAsset(%i);
//first, get the asset's module, as our major categories
%module = AssetDatabase.getAssetModule(%assetId);
%moduleName = %module.moduleId;
//check that we don't re-add it
%moduleItemId = AssetBrowser-->filterTree.findItemByName(%moduleName);
if(%moduleItemId == -1 || %moduleItemId == 0)
%moduleItemId = AssetBrowser-->filterTree.insertItem(1, %module.moduleId, "", "", 1, 2);
//now, add the asset's category
%assetType = AssetDatabase.getAssetCategory(%assetId);
2021-05-05 02:49:19 +00:00
// TODO?
%text = "";
%var = "";
%cmd = "";
%textLength = strlen(%text);
// end todo
%checkBox = new GuiCheckBoxCtrl()
{
canSaveDynamicFields = "0";
isContainer = "0";
Profile = "ToolsGuiCheckBoxListProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "0 0";
Extent = (%textLength * 4) @ " 18";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Variable = %var;
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
text = %text;
groupNum = "-1";
buttonType = "ToggleButton";
useMouseEvents = "0";
useInactiveState = "0";
Command = %cmd;
};
TagFilterList.add(%checkBox);
}
}
function AssetBrowser::changeAsset(%this)
{
Adjusted callback handling of asset inspector fields when invoking AB to select asset for more consistent behavior and better handling of updating the objects and inspector Added logic to forcefully acquire newly imported asset definition to better try and ensure it's loaded immediately after import Added logic to asset importer so if a file is not found for an importing material asset, if populate maps is on, then it will try and find a matching image asset in the destination module Added logic to tsStatic to better handle fields being updated via the editor, forcing updates and refreshes of the shape and materialSlots Fixed handling of guiBitmapButtonCtrl so it will update the bitmap used when edited via the Gui Editor Updated image ref to the hudFill image asset for the console GUI Cleaned up names for the default camera model/material Defaulted import config to utilize the Prune action instead of rename for more predictable default behavior Added icons next to AB's preview slider bar for additional visual feedback of slider intent Added missing checkbox to asset import window and cleaned up scaling behavior Fixed handling of drag-n-drop behavior in GUI editor so it doesn't block further interaction Added logic for drag-n-drop of image assets to GUI Editor so it will create a GuiBitmapCtrl with the image Added handling for drag-n-drop import of folders of assets to AB/Asset Import Added missing asset import config option to indicate if config supported import of sound assets Added logic when opening asset import config editor, where if there is a default import config set in the settings, it will open that one by default Hid the collision section of the import config editor, as those options are currently unutilized Improved behavior for Create New Folder window in the AB, now always pushing to the front, and also selecting the text by default, so the user can just start typing the new name Also added return and escape key accelerators to Create New Folder window for better UX Fixed display of editor windows, adding a distinct blue color to highlighted windows' title bar and fixing display of minimize/maximize/window/close buttons Moved GUIEditor's onControlDropped function to the AB script to match placement of sibling world editor function Fixed issue with material editor where the ORM Config map slot was getting the normal map instead of the correct ORM map
2021-11-26 22:40:15 +00:00
%targetObject = %this.fieldTargetObject;
%inspectorObject = "";
* Fixes handling for Image, Material and Shape Assets' inspector fields so they properly work with non-object targeted inspectors, such as the PostFXEditor * Updated PostFXEditor scripts to handle refreshing properly when certainl field types(assetId fields) are changed * Adjusted display handling of slider values on guiGameSettingsCtrl to show 0.x decimal format instead of 0.xxxxx * Fixed pad length of item names in guiTreeView for items that are marked to avoid console spam * Fixed local offseting for popupMenus so scaled/offset window position doesn't cause the popup menu to offset from mouse click position(courtesy OTHG_Mars) * Fix issue with terrain where, due to default value save validation, the global scope for the terrain collision list would be whiped when saving, causing players to fall through terrain. Moved to per-terrain convexLists * Fixed issue with the core camera model mesh and updated references so camera bookmarks display properly * Fixed console spam during asset browser initialization where it would try and expand the directory tree even though the dir tree isn't populated yet * Fixed handling of Open File Location RMB menu action to properly deal with script and datablock types * Removed unusuable "Create ___" asset type prompts from the RMB menus for the AB to avoid confusion * Improved slider offset positioning for various popup sliders on editor toolbars * Anchored the visibility popup menu to the button for more consistent formatting and better feel * Shifted various visibility toggles from 'in place' on the menu buttons to functions, allowing it to also properly mark the menu entries as checked or not, improving usability
2022-08-26 20:25:17 +00:00
if(isObject(%this.fieldTargetObject) && %this.fieldTargetObject.isInNamespaceHierarchy("GuiInspector"))
Adjusted callback handling of asset inspector fields when invoking AB to select asset for more consistent behavior and better handling of updating the objects and inspector Added logic to forcefully acquire newly imported asset definition to better try and ensure it's loaded immediately after import Added logic to asset importer so if a file is not found for an importing material asset, if populate maps is on, then it will try and find a matching image asset in the destination module Added logic to tsStatic to better handle fields being updated via the editor, forcing updates and refreshes of the shape and materialSlots Fixed handling of guiBitmapButtonCtrl so it will update the bitmap used when edited via the Gui Editor Updated image ref to the hudFill image asset for the console GUI Cleaned up names for the default camera model/material Defaulted import config to utilize the Prune action instead of rename for more predictable default behavior Added icons next to AB's preview slider bar for additional visual feedback of slider intent Added missing checkbox to asset import window and cleaned up scaling behavior Fixed handling of drag-n-drop behavior in GUI editor so it doesn't block further interaction Added logic for drag-n-drop of image assets to GUI Editor so it will create a GuiBitmapCtrl with the image Added handling for drag-n-drop import of folders of assets to AB/Asset Import Added missing asset import config option to indicate if config supported import of sound assets Added logic when opening asset import config editor, where if there is a default import config set in the settings, it will open that one by default Hid the collision section of the import config editor, as those options are currently unutilized Improved behavior for Create New Folder window in the AB, now always pushing to the front, and also selecting the text by default, so the user can just start typing the new name Also added return and escape key accelerators to Create New Folder window for better UX Fixed display of editor windows, adding a distinct blue color to highlighted windows' title bar and fixing display of minimize/maximize/window/close buttons Moved GUIEditor's onControlDropped function to the AB script to match placement of sibling world editor function Fixed issue with material editor where the ORM Config map slot was getting the normal map instead of the correct ORM map
2021-11-26 22:40:15 +00:00
{
%inspectorObject = %this.fieldTargetObject;
* Fixes handling for Image, Material and Shape Assets' inspector fields so they properly work with non-object targeted inspectors, such as the PostFXEditor * Updated PostFXEditor scripts to handle refreshing properly when certainl field types(assetId fields) are changed * Adjusted display handling of slider values on guiGameSettingsCtrl to show 0.x decimal format instead of 0.xxxxx * Fixed pad length of item names in guiTreeView for items that are marked to avoid console spam * Fixed local offseting for popupMenus so scaled/offset window position doesn't cause the popup menu to offset from mouse click position(courtesy OTHG_Mars) * Fix issue with terrain where, due to default value save validation, the global scope for the terrain collision list would be whiped when saving, causing players to fall through terrain. Moved to per-terrain convexLists * Fixed issue with the core camera model mesh and updated references so camera bookmarks display properly * Fixed console spam during asset browser initialization where it would try and expand the directory tree even though the dir tree isn't populated yet * Fixed handling of Open File Location RMB menu action to properly deal with script and datablock types * Removed unusuable "Create ___" asset type prompts from the RMB menus for the AB to avoid confusion * Improved slider offset positioning for various popup sliders on editor toolbars * Anchored the visibility popup menu to the button for more consistent formatting and better feel * Shifted various visibility toggles from 'in place' on the menu buttons to functions, allowing it to also properly mark the menu entries as checked or not, improving usability
2022-08-26 20:25:17 +00:00
if(%inspectorObject.getNumInspectObjects() != 0)
{
%targetObject = %inspectorObject.getInspectObject();
%cmd = %targetObject @ "." @ %this.fieldTargetName @ "=\"" @ %this.selectedAsset @ "\";";
* Fixes handling for Image, Material and Shape Assets' inspector fields so they properly work with non-object targeted inspectors, such as the PostFXEditor * Updated PostFXEditor scripts to handle refreshing properly when certainl field types(assetId fields) are changed * Adjusted display handling of slider values on guiGameSettingsCtrl to show 0.x decimal format instead of 0.xxxxx * Fixed pad length of item names in guiTreeView for items that are marked to avoid console spam * Fixed local offseting for popupMenus so scaled/offset window position doesn't cause the popup menu to offset from mouse click position(courtesy OTHG_Mars) * Fix issue with terrain where, due to default value save validation, the global scope for the terrain collision list would be whiped when saving, causing players to fall through terrain. Moved to per-terrain convexLists * Fixed issue with the core camera model mesh and updated references so camera bookmarks display properly * Fixed console spam during asset browser initialization where it would try and expand the directory tree even though the dir tree isn't populated yet * Fixed handling of Open File Location RMB menu action to properly deal with script and datablock types * Removed unusuable "Create ___" asset type prompts from the RMB menus for the AB to avoid confusion * Improved slider offset positioning for various popup sliders on editor toolbars * Anchored the visibility popup menu to the button for more consistent formatting and better feel * Shifted various visibility toggles from 'in place' on the menu buttons to functions, allowing it to also properly mark the menu entries as checked or not, improving usability
2022-08-26 20:25:17 +00:00
}
else if(startsWith(%this.fieldTargetName, "$"))
{
//we're targeting a variable directly, so deal with that then
%cmd = %this.fieldTargetName @ "=\"" @ %this.selectedAsset @ "\";";
}
Adjusted callback handling of asset inspector fields when invoking AB to select asset for more consistent behavior and better handling of updating the objects and inspector Added logic to forcefully acquire newly imported asset definition to better try and ensure it's loaded immediately after import Added logic to asset importer so if a file is not found for an importing material asset, if populate maps is on, then it will try and find a matching image asset in the destination module Added logic to tsStatic to better handle fields being updated via the editor, forcing updates and refreshes of the shape and materialSlots Fixed handling of guiBitmapButtonCtrl so it will update the bitmap used when edited via the Gui Editor Updated image ref to the hudFill image asset for the console GUI Cleaned up names for the default camera model/material Defaulted import config to utilize the Prune action instead of rename for more predictable default behavior Added icons next to AB's preview slider bar for additional visual feedback of slider intent Added missing checkbox to asset import window and cleaned up scaling behavior Fixed handling of drag-n-drop behavior in GUI editor so it doesn't block further interaction Added logic for drag-n-drop of image assets to GUI Editor so it will create a GuiBitmapCtrl with the image Added handling for drag-n-drop import of folders of assets to AB/Asset Import Added missing asset import config option to indicate if config supported import of sound assets Added logic when opening asset import config editor, where if there is a default import config set in the settings, it will open that one by default Hid the collision section of the import config editor, as those options are currently unutilized Improved behavior for Create New Folder window in the AB, now always pushing to the front, and also selecting the text by default, so the user can just start typing the new name Also added return and escape key accelerators to Create New Folder window for better UX Fixed display of editor windows, adding a distinct blue color to highlighted windows' title bar and fixing display of minimize/maximize/window/close buttons Moved GUIEditor's onControlDropped function to the AB script to match placement of sibling world editor function Fixed issue with material editor where the ORM Config map slot was getting the normal map instead of the correct ORM map
2021-11-26 22:40:15 +00:00
}
* Fixes handling for Image, Material and Shape Assets' inspector fields so they properly work with non-object targeted inspectors, such as the PostFXEditor * Updated PostFXEditor scripts to handle refreshing properly when certainl field types(assetId fields) are changed * Adjusted display handling of slider values on guiGameSettingsCtrl to show 0.x decimal format instead of 0.xxxxx * Fixed pad length of item names in guiTreeView for items that are marked to avoid console spam * Fixed local offseting for popupMenus so scaled/offset window position doesn't cause the popup menu to offset from mouse click position(courtesy OTHG_Mars) * Fix issue with terrain where, due to default value save validation, the global scope for the terrain collision list would be whiped when saving, causing players to fall through terrain. Moved to per-terrain convexLists * Fixed issue with the core camera model mesh and updated references so camera bookmarks display properly * Fixed console spam during asset browser initialization where it would try and expand the directory tree even though the dir tree isn't populated yet * Fixed handling of Open File Location RMB menu action to properly deal with script and datablock types * Removed unusuable "Create ___" asset type prompts from the RMB menus for the AB to avoid confusion * Improved slider offset positioning for various popup sliders on editor toolbars * Anchored the visibility popup menu to the button for more consistent formatting and better feel * Shifted various visibility toggles from 'in place' on the menu buttons to functions, allowing it to also properly mark the menu entries as checked or not, improving usability
2022-08-26 20:25:17 +00:00
else if(isObject(%this.fieldTargetObject))
2022-07-04 23:10:25 +00:00
{
//alright, we've selectd an asset for a field, so time to set it!
if(%this.fieldTargetName $= "")
%cmd = %targetObject @ ".apply(\""@ %this.selectedAsset @ "\");";
else
%cmd = %targetObject @ "." @ %this.fieldTargetName @ "=\"" @ %this.selectedAsset @ "\";";
//echo("Changing asset via the " @ %cmd @ " command");
}
* Fixes handling for Image, Material and Shape Assets' inspector fields so they properly work with non-object targeted inspectors, such as the PostFXEditor * Updated PostFXEditor scripts to handle refreshing properly when certainl field types(assetId fields) are changed * Adjusted display handling of slider values on guiGameSettingsCtrl to show 0.x decimal format instead of 0.xxxxx * Fixed pad length of item names in guiTreeView for items that are marked to avoid console spam * Fixed local offseting for popupMenus so scaled/offset window position doesn't cause the popup menu to offset from mouse click position(courtesy OTHG_Mars) * Fix issue with terrain where, due to default value save validation, the global scope for the terrain collision list would be whiped when saving, causing players to fall through terrain. Moved to per-terrain convexLists * Fixed issue with the core camera model mesh and updated references so camera bookmarks display properly * Fixed console spam during asset browser initialization where it would try and expand the directory tree even though the dir tree isn't populated yet * Fixed handling of Open File Location RMB menu action to properly deal with script and datablock types * Removed unusuable "Create ___" asset type prompts from the RMB menus for the AB to avoid confusion * Improved slider offset positioning for various popup sliders on editor toolbars * Anchored the visibility popup menu to the button for more consistent formatting and better feel * Shifted various visibility toggles from 'in place' on the menu buttons to functions, allowing it to also properly mark the menu entries as checked or not, improving usability
2022-08-26 20:25:17 +00:00
else if(startsWith(%this.fieldTargetName, "$"))
{
//we're targeting a variable directly, so deal with that then
%cmd = %this.fieldTargetName @ "=\"" @ %this.selectedAsset @ "\";";
}
eval(%cmd);
Adjusted callback handling of asset inspector fields when invoking AB to select asset for more consistent behavior and better handling of updating the objects and inspector Added logic to forcefully acquire newly imported asset definition to better try and ensure it's loaded immediately after import Added logic to asset importer so if a file is not found for an importing material asset, if populate maps is on, then it will try and find a matching image asset in the destination module Added logic to tsStatic to better handle fields being updated via the editor, forcing updates and refreshes of the shape and materialSlots Fixed handling of guiBitmapButtonCtrl so it will update the bitmap used when edited via the Gui Editor Updated image ref to the hudFill image asset for the console GUI Cleaned up names for the default camera model/material Defaulted import config to utilize the Prune action instead of rename for more predictable default behavior Added icons next to AB's preview slider bar for additional visual feedback of slider intent Added missing checkbox to asset import window and cleaned up scaling behavior Fixed handling of drag-n-drop behavior in GUI editor so it doesn't block further interaction Added logic for drag-n-drop of image assets to GUI Editor so it will create a GuiBitmapCtrl with the image Added handling for drag-n-drop import of folders of assets to AB/Asset Import Added missing asset import config option to indicate if config supported import of sound assets Added logic when opening asset import config editor, where if there is a default import config set in the settings, it will open that one by default Hid the collision section of the import config editor, as those options are currently unutilized Improved behavior for Create New Folder window in the AB, now always pushing to the front, and also selecting the text by default, so the user can just start typing the new name Also added return and escape key accelerators to Create New Folder window for better UX Fixed display of editor windows, adding a distinct blue color to highlighted windows' title bar and fixing display of minimize/maximize/window/close buttons Moved GUIEditor's onControlDropped function to the AB script to match placement of sibling world editor function Fixed issue with material editor where the ORM Config map slot was getting the normal map instead of the correct ORM map
2021-11-26 22:40:15 +00:00
//Force update our object with the field change
* Fixes handling for Image, Material and Shape Assets' inspector fields so they properly work with non-object targeted inspectors, such as the PostFXEditor * Updated PostFXEditor scripts to handle refreshing properly when certainl field types(assetId fields) are changed * Adjusted display handling of slider values on guiGameSettingsCtrl to show 0.x decimal format instead of 0.xxxxx * Fixed pad length of item names in guiTreeView for items that are marked to avoid console spam * Fixed local offseting for popupMenus so scaled/offset window position doesn't cause the popup menu to offset from mouse click position(courtesy OTHG_Mars) * Fix issue with terrain where, due to default value save validation, the global scope for the terrain collision list would be whiped when saving, causing players to fall through terrain. Moved to per-terrain convexLists * Fixed issue with the core camera model mesh and updated references so camera bookmarks display properly * Fixed console spam during asset browser initialization where it would try and expand the directory tree even though the dir tree isn't populated yet * Fixed handling of Open File Location RMB menu action to properly deal with script and datablock types * Removed unusuable "Create ___" asset type prompts from the RMB menus for the AB to avoid confusion * Improved slider offset positioning for various popup sliders on editor toolbars * Anchored the visibility popup menu to the button for more consistent formatting and better feel * Shifted various visibility toggles from 'in place' on the menu buttons to functions, allowing it to also properly mark the menu entries as checked or not, improving usability
2022-08-26 20:25:17 +00:00
if(isObject(%targetObject))
{
if(%this.fieldTargetObject.isInNamespaceHierarchy("GuiInspector"))
%this.fieldTargetObject.refresh();
else
%targetObject.inspectPostApply();
}
Adjusted callback handling of asset inspector fields when invoking AB to select asset for more consistent behavior and better handling of updating the objects and inspector Added logic to forcefully acquire newly imported asset definition to better try and ensure it's loaded immediately after import Added logic to asset importer so if a file is not found for an importing material asset, if populate maps is on, then it will try and find a matching image asset in the destination module Added logic to tsStatic to better handle fields being updated via the editor, forcing updates and refreshes of the shape and materialSlots Fixed handling of guiBitmapButtonCtrl so it will update the bitmap used when edited via the Gui Editor Updated image ref to the hudFill image asset for the console GUI Cleaned up names for the default camera model/material Defaulted import config to utilize the Prune action instead of rename for more predictable default behavior Added icons next to AB's preview slider bar for additional visual feedback of slider intent Added missing checkbox to asset import window and cleaned up scaling behavior Fixed handling of drag-n-drop behavior in GUI editor so it doesn't block further interaction Added logic for drag-n-drop of image assets to GUI Editor so it will create a GuiBitmapCtrl with the image Added handling for drag-n-drop import of folders of assets to AB/Asset Import Added missing asset import config option to indicate if config supported import of sound assets Added logic when opening asset import config editor, where if there is a default import config set in the settings, it will open that one by default Hid the collision section of the import config editor, as those options are currently unutilized Improved behavior for Create New Folder window in the AB, now always pushing to the front, and also selecting the text by default, so the user can just start typing the new name Also added return and escape key accelerators to Create New Folder window for better UX Fixed display of editor windows, adding a distinct blue color to highlighted windows' title bar and fixing display of minimize/maximize/window/close buttons Moved GUIEditor's onControlDropped function to the AB script to match placement of sibling world editor function Fixed issue with material editor where the ORM Config map slot was getting the normal map instead of the correct ORM map
2021-11-26 22:40:15 +00:00
//Flag us as dirty for editing purposes
EWorldEditor.setSceneAsDirty();
}
function AssetBrowser::reImportAsset(%this)
{
//Find out what type it is
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
%assetType = AssetDatabase.getAssetType(EditAssetPopup.assetId);
if(%assetType $= "ShapeAsset" || %assetType $= "ImageAsset" || %assetType $= "SoundAsset")
{
AssetBrowser.isAssetReImport = true;
AssetBrowser.reImportingAssetId = EditAssetPopup.assetId;
%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
if(!isFile(%reimportingPath))
{
//if(%assetType $= "ImageAsset")
// %filters = "";
2021-05-05 02:49:19 +00:00
//TODO
%currentFile = "";
%dlg = new OpenFileDialog()
{
Filters = "(All Files (*.*)|*.*|";
DefaultFile = %currentFile;
ChangePath = false;
MustExist = true;
MultipleFiles = false;
forceRelativePath = false;
};
if ( %dlg.Execute() )
{
%reimportingPath = %dlg.FileName;
}
%dlg.delete();
}
AssetBrowser.onBeginDropFiles();
AssetBrowser.onDropFile(%reimportingPath);
AssetBrowser.onEndDropFiles();
%module = AssetDatabase.getAssetModule(EditAssetPopup.assetId);
//get the selected module data
ImportAssetModuleList.setText(%module.ModuleId);
}
}
//
//
// RMB context popups
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
function AssetBrowserPreviewButton::onRightClick(%this)
{
%this.assetBrowser.selectedAssetPreview = %this;
%this.assetBrowser.callAssetTypeFunc(%this.assetType, "onShowActionMenu", %this.moduleName, %this.assetName);
}
//function AssetListPanel::onRightMouseDown(%this)
function AssetListPanelInputs::onRightMouseDown(%this)
{
AddNewAssetPopup.showPopup(Canvas);
}
function AssetBrowserFilterTree::onRightMouseDown(%this, %itemId)
{
%count = %this.getSelectedItemsCount();
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
%itemText = %this.getItemText(%itemId);
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%parentItem = %this.getParentItem(%itemId);
if(%parentItem == %this.tagsIdx)
{
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
}
else if(%parentItem == %this.collectionsIdx)
{
EditCollectionSets.showPopup(Canvas);
AssetBrowser.selectedCollectionSet = %itemText;
}
else if(%parentItem == %this.creatorIdx)
{
}
else
{
if( %this.getSelectedItemsCount() > 0 && (%itemText !$= "data" && %itemText !$="core" && %itemText !$= "tools"))
{
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
//AddNewAssetPopup.showPopup(Canvas);
//We have something clicked, so figure out if it's a sub-filter or a module filter, then push the correct
//popup menu
%parentItem = %this.getParentItem(%itemId);
if(%this.getItemText(%parentItem) $= "data") //if it's a data module, continue
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
{
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
//find out if it's a folder or a module!
if(ModuleDatabase.findModule(%itemText))
{
//yep, module, push the all-inclusive popup
EditModulePopup.showPopup(Canvas);
//also set the module value for creation info
AssetBrowser.selectedModule = %itemText;
}
else
{
EditNonModulePopup.showPopup(Canvas);
EditNonModulePopup.targetFolder = %itemText;
}
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
}
else
{
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
EditFolderPopup.showPopup(Canvas);
EditFolderPopup.assetType = "Folder";
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
}
}
else if(%itemText $= "data")
{
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
AddNewModulePopup.showPopup(Canvas);
}
else if(%itemText $= "tools")
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
{
AddNewToolPopup.showPopup(Canvas);
}
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
}
}
//
//
//
function AssetBrowser::openAssetSettings(%this)
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
{
ESettingsWindow.toggleEditorSettings();
%assetEditIndex = ESettingsWindowList.findTextIndex("Asset Editing");
ESettingsWindowList.setSelectedRow( %assetEditIndex );
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
}
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);
}
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
function AssetBrowser::saveCurrentFiltersAsCollection(%this)
{
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%colSetName = CreateNewCollectionSetCtrl-->collectionSetName.getText();
if(%colSetName $= "")
{
error("Collection Sets require a name!");
}
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%collectionsCount = AssetBrowserCollectionSets.value("CollectionSetCount", 0);
%collectionsCount += 1;
AssetBrowserCollectionSets.setValue("CollectionSetCount", %collectionsCount);
%collection = %colSetName TAB AssetBrowserSearchFilter.getText();
AssetBrowserCollectionSets.setValue("Collection"@%collectionsCount-1, %collection);
%success = AssetBrowserCollectionSets.write();
AssetBrowser.loadDirectories();
}
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
function AssetBrowser::deleteCollectionSet(%this)
{
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%collectionsCount = AssetBrowserCollectionSets.value("CollectionSetCount", 0);
%tempCollectionListCount = 0;
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%found = false;
for ( %i = 0; %i < %collectionsCount; %i++ )
{
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%collection = AssetBrowserCollectionSets.value("Collection"@%i, "");
%collectionName = getField(%collection, 0);
%collectionTerm = getField(%collection, 1);
if(AssetBrowser.selectedCollectionSet !$= %collectionName)
{
%tempCollectionList[%tempCollectionListCount] = %collection;
%tempCollectionListCount++;
}
}
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
AssetBrowserCollectionSets.setValue("CollectionSetCount", %tempCollectionListCount);
for(%i=0; %i < %collectionsCount; %i++)
{
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
if(%i < %tempCollectionListCount)
AssetBrowserCollectionSets.setValue("Collection"@%i, %tempCollectionList[%i]);
else
AssetBrowserCollectionSets.remove("Collection"@%i);
}
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
AssetBrowserCollectionSets.write();
%this.loadDirectories();
}
function AssetBrowser::refreshPreviews(%this)
{
AssetBrowserFilterTree.onSelect(AssetBrowser.selectedItem);
}
function AssetBrowserFilterTree::onSelect(%this, %itemId)
{
if(%itemId == 1)
//can't select root
return;
%scrollCtrl = %this.getParent();
%scrollPos = %scrollCtrl.getScrollPosition();
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
//process special cases
%parentItem = %this.getParentItem(%itemId);
if(%parentItem == %this.tagsIdx)
{
//we selected a tag, so deal with that
AssetBrowser.setTagActive(%this.getItemText(%itemId));
}
else if(%parentItem == %this.collectionsIdx)
{
//A collection set was selected
AssetBrowser.setCollectionSetActive(%this.getItemValue(%itemId));
}
else if(%parentItem == %this.creatorIdx)
{
%name = %this.getItemText(%itemId);
AssetBrowser.dirHandler.currentAddress = "Creator/" @ %name;
AssetBrowser.rebuildAssetArray();
AssetBrowser.refresh();
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
}
else
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
{
//Make sure we have an actual module selected!
%parentId = %this.getParentItem(%itemId);
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%name = %this.getItemText(%itemId);
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%breadcrumbPath = %this.getItemValue(%itemId);
if(%breadcrumbPath !$= "")
%breadcrumbPath = %breadcrumbPath @ "/" @ %this.getItemText(%itemId);
else
%breadcrumbPath = %this.getItemText(%itemId);
if(%breadcrumbPath $= "")
%breadcrumbPath = AssetBrowser.dirHandler.currentAddress;
AssetBrowser.navigateTo(%breadcrumbPath);
}
//restore the scroll position
%scrollCtrl.schedule(1, "setScrollPosition", %scrollPos.x, %scrollPos.y);
}
function AssetBrowserFilterTree::hasAsParent(%this, %itemId, %text)
{
%parentId = %this.getParentItem(%itemId);
while(%parentId != 0)
{
%parentText = %this.getItemText(%parentId);
if(%parentText $= %text)
return true;
%parentId = %this.getParentItem(%parentId);
}
return false;
}
function AssetBrowser::rebuildAssetArray(%this)
{
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
if(!%this.previewArrayDirty)
{
%this.previewArrayDirty = true;
cancel(%this.pendingRebuild);
%this.pendingRebuild = %this.schedule(16, "doRebuildAssetArray");
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
}
}
function AssetBrowser::doRebuildAssetArray(%this)
{
if(!%this.previewArrayDirty)
return;
%breadcrumbPath = AssetBrowser.dirHandler.currentAddress;
// we have to empty out the list; so when we create new guicontrols, these dont linger
AssetBrowser-->assetList.deleteAllObjects();
AssetPreviewArray.empty();
if(isObject($AssetBrowser::AssetArray))
$AssetBrowser::AssetArray.delete();
$AssetBrowser::AssetArray = new ArrayObject();
//First, Query for our assets
%assetQuery = new AssetQuery();
%numAssetsFound = AssetDatabase.findAllAssets(%assetQuery);
%finalAssetCount = 0;
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
if(!startsWith(%breadcrumbPath, "Creator"))
{
//Add folders
if(EditorSettings.value("Assets/Browser/showFolders", true) == true)
{
%folders = getDirectoryList(%breadcrumbPath);
for(%f=0; %f < getFieldCount(%folders); %f++)
{
%folderName = getField(%folders, %f);
%searchActive = AssetSearchTerms.count() != 0;
if(%searchActive)
{
if(matchesSearch(%folderName, "Folder", ""))
{
$AssetBrowser::AssetArray.add( %breadcrumbPath, "FolderObjectType" TAB %folderName );
continue;
}
}
else
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
{
//got it.
if(%folderName $= "shaderCache" || %folderName $= "cache" || %folderName $= ".git" || %folderName $= "previewCache")
continue;
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
if(!%this.coreModulesFilter && %folderName $= "core" && %breadcrumbPath $= "")
continue;
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
if(!%this.toolsModulesFilter && %folderName $= "tools" && %breadcrumbPath $= "")
continue;
$AssetBrowser::AssetArray.add( %breadcrumbPath, "FolderObjectType" TAB %folderName );
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
}
}
}
//now, we'll iterate through, and find the assets that are in this module, and this category
for( %i=0; %i < %numAssetsFound; %i++)
{
%assetId = %assetQuery.getAsset(%i);
%assetPath = makeRelativePath(AssetDatabase.getAssetFilePath(%assetId));
%assetBasePath = filePath(%assetPath);
//clean up the path
%assetBasePath = strreplace(%assetBasePath, "//", "/");
%searchActive = AssetSearchTerms.count() != 0;
if(%assetBasePath $= %breadcrumbPath || (%searchActive && startsWith(%assetBasePath,%breadcrumbPath)))
{
//first, get the asset's module, as our major categories
%module = AssetDatabase.getAssetModule(%assetId);
%moduleName = %module.moduleId;
//it's good, so test that the category is right!
%assetType = AssetDatabase.getAssetCategory(%assetId);
if(%assetType $= "")
{
%assetType = AssetDatabase.getAssetType(%assetId);
}
//stop adding after previewsPerPage is hit
%assetName = AssetDatabase.getAssetName(%assetId);
if(%searchActive)
{
if(matchesSearch(%assetName, %assetType))
{
$AssetBrowser::AssetArray.add( %moduleName, %assetId);
if(%assetType !$= "Folder")
%finalAssetCount++;
continue;
}
}
else
{
if(AssetBrowser.assetTypeFilter !$= "")
{
%filtersCount = getWordCount(AssetBrowser.assetTypeFilter);
for(%fltrIdx = 0; %fltrIdx < %filtersCount; %fltrIdx++)
{
%fltr = getWord(AssetBrowser.assetTypeFilter, %fltrIdx);
if(%fltr $= %assetType)
{
$AssetBrowser::AssetArray.add( %moduleName, %assetId );
if(%assetType !$= "FolderObjectType")
%finalAssetCount++;
}
}
}
else
{
//got it.
$AssetBrowser::AssetArray.add( %moduleName, %assetId );
if(%assetType !$= "FolderObjectType")
%finalAssetCount++;
}
}
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
}
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
}
if(!isObject(ABLooseFileArray))
new ArrayObject(ABLooseFileArray){};
%nonAssetFileCount = getNonAssetFilesInDir(%this.dirHandler.currentAddress, ABLooseFileArray);
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%looseFiles = ABLooseFileArray.count();
for( %i=0; %i < %looseFiles; %i++)
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
{
%looseFileFullPath = ABLooseFileArray.getKey(%i);
%looseFilePath = filePath(%looseFileFullPath);
%looseFileName = fileName(%looseFileFullPath);
%looseFileExt = fileExt(%looseFileFullPath);
//iterate over the registered types to filter out types we special handle
for(%t=0; %t < ABAssetTypesList.count(); %t++)
{
%typeGroup = ABAssetTypesList.getKey(%t);
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%typeEntryName = getField(ABAssetTypesList.getValue(%t), 0);
%filterDataList = getField(ABAssetTypesList.getValue(%t), 2);
if(%typeGroup $= "Asset")
{
%classNameCount = getTokenCount(%filterDataList, ";");
for(%e=0; %e < %classNameCount; %e++)
{
%className = getToken(%filterDataList, ";", %e);
if(%className $= %looseFileExt)
{
if(matchesSearch(%looseFileName, %typeEntryName))
$AssetBrowser::AssetArray.add( %looseFilePath, %typeEntryName TAB %looseFileName );
}
}
}
else if(%typeGroup $= "File")
{
%extensionsCount = getTokenCount(%filterDataList, ";");
for(%e=0; %e < %extensionsCount; %e++)
{
%extension = getToken(%filterDataList, ";", %e);
if(%extension $= %looseFileExt)
{
if(matchesSearch(%looseFileName, %typeEntryName))
$AssetBrowser::AssetArray.add( %looseFilePath, %typeEntryName TAB %looseFileName );
}
}
}
else if(%typeGroup $= "Object")
{
%classNameCount = getTokenCount(%filterDataList, ";");
//now we iterate over the root group to find any and all objects that match to class
for(%rgo = 0; %rgo < RootGroup.getCount(); %rgo++)
{
%rootGroupObj = RootGroup.getObject(%rgo);
%rootGroupObjPath = filePath(%rootGroupObj.getFileName());
if(%rootGroupObjPath !$= %this.dirHandler.currentAddress)
continue;
for(%c=0; %c < %classNameCount; %c++)
{
%className = getToken(%filterDataList, ";", %c);
if(%rootGroupObj.isMemberOfClass(%className))
{
if(matchesSearch(%className, %typeEntryName))
$AssetBrowser::AssetArray.add( %rootGroupObj, %typeEntryName TAB %className );
}
}
}
//check the datablocks group for certainty as well`
for(%rgo = 0; %rgo < DatablockGroup.getCount(); %rgo++)
{
%dbGroupObject = DatablockGroup.getObject(%rgo);
%dbGroupObjPath = filePath(%dbGroupObject.getFileName());
if(%dbGroupObjPath !$= %this.dirHandler.currentAddress)
continue;
for(%c=0; %c < %classNameCount; %c++)
{
%className = getToken(%filterDataList, ";", %c);
if(%dbGroupObject.isMemberOfClass(%className))
{
if(matchesSearch(%className, %typeEntryName))
$AssetBrowser::AssetArray.add( %dbGroupObject, %typeEntryName TAB %className );
}
}
}
}
}
}
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
}
else //If we've selected into the Creator section, we have special handling for that
{
//One of the creator folders was selected
%creatorGroup = AssetBrowserFilterTree.getItemText(AssetBrowserFilterTree.getSelectedItem(0));
Add getScriptPath console function to GUIAsset Shifted tracking of importing asset status to an enum for more robust handling Added logic to properly init freshly created shapeConstructors with the newly imported shapeAsset Fixed handling of assets that have been marked to be skipped, but needed to fill in the parent's dependencies(UseForDependencies enum value) Cleaned up redundant recursive logic for importing assets Disable Create Game Objects button in inspector Fixed material assignment for convex proxies Updated asset icons for AB with WIP images to be more clear Fixed issue where type-generic icons in the creator items in the AB weren't showing correctly. Force AB to show creator entries in list mode for efficiency and avoid icon scaling issues Moved creator functions for AB to separate file for convenience Filled out GUIControls in the AB's creator mode, and context world editor and GUI creator entries based on active editor Added drag-n-drop handling for guiControls via AB creator in guiEditor mode Added more types' profiles in the AB gui profiles to give more unique border colors for better visual clarity of asset type Added editor setting to indicate if the editor should load into the last edited level, or the editor default scene Fixed setting of highlight material overlay in shapeEditor Added global keybind for GUIEditor so space also toggles assetbrowser Fixed up binding/finding of shapeConstructor by assetId, which also fixed displaying of shape's material listing
2021-09-10 07:13:56 +00:00
if(%creatorGroup $= "Creator")
{
//add folders for the groups
%placeholderVar = "";
}
else
{
for ( %i = 0; %i < %this.creatorClassArray.count(); %i++ )
{
%group = %this.creatorClassArray.getKey( %i );
Add getScriptPath console function to GUIAsset Shifted tracking of importing asset status to an enum for more robust handling Added logic to properly init freshly created shapeConstructors with the newly imported shapeAsset Fixed handling of assets that have been marked to be skipped, but needed to fill in the parent's dependencies(UseForDependencies enum value) Cleaned up redundant recursive logic for importing assets Disable Create Game Objects button in inspector Fixed material assignment for convex proxies Updated asset icons for AB with WIP images to be more clear Fixed issue where type-generic icons in the creator items in the AB weren't showing correctly. Force AB to show creator entries in list mode for efficiency and avoid icon scaling issues Moved creator functions for AB to separate file for convenience Filled out GUIControls in the AB's creator mode, and context world editor and GUI creator entries based on active editor Added drag-n-drop handling for guiControls via AB creator in guiEditor mode Added more types' profiles in the AB gui profiles to give more unique border colors for better visual clarity of asset type Added editor setting to indicate if the editor should load into the last edited level, or the editor default scene Fixed setting of highlight material overlay in shapeEditor Added global keybind for GUIEditor so space also toggles assetbrowser Fixed up binding/finding of shapeConstructor by assetId, which also fixed displaying of shape's material listing
2021-09-10 07:13:56 +00:00
//Do some filter logic do skip out of groups if we're in the wrong editor mode for it
%creatorEditorFilter = "WorldEditor";
if(GuiEditorIsActive())
{
%creatorEditorFilter = "GuiEditor";
}
%creatorGroupIndex = AssetBrowserCreatorGroupsList.getIndexFromValue(%group);
%creatorGroupKey = AssetBrowserCreatorGroupsList.getKey(%creatorGroupIndex);
if ( %group $= %creatorGroup && %creatorGroupKey $= %creatorEditorFilter )
{
%creatorObj = %this.creatorClassArray.getValue( %i );
%class = %creatorObj.val[0];
%name = %creatorObj.val[1];
%func = %creatorObj.val[2];
%searchActive = AssetSearchTerms.count() != 0;
if(%searchActive && !matchesSearch(%name, "Creator"))
continue;
$AssetBrowser::AssetArray.add( %name, "Creator" TAB %creatorObj );
}
}
}
Add getScriptPath console function to GUIAsset Shifted tracking of importing asset status to an enum for more robust handling Added logic to properly init freshly created shapeConstructors with the newly imported shapeAsset Fixed handling of assets that have been marked to be skipped, but needed to fill in the parent's dependencies(UseForDependencies enum value) Cleaned up redundant recursive logic for importing assets Disable Create Game Objects button in inspector Fixed material assignment for convex proxies Updated asset icons for AB with WIP images to be more clear Fixed issue where type-generic icons in the creator items in the AB weren't showing correctly. Force AB to show creator entries in list mode for efficiency and avoid icon scaling issues Moved creator functions for AB to separate file for convenience Filled out GUIControls in the AB's creator mode, and context world editor and GUI creator entries based on active editor Added drag-n-drop handling for guiControls via AB creator in guiEditor mode Added more types' profiles in the AB gui profiles to give more unique border colors for better visual clarity of asset type Added editor setting to indicate if the editor should load into the last edited level, or the editor default scene Fixed setting of highlight material overlay in shapeEditor Added global keybind for GUIEditor so space also toggles assetbrowser Fixed up binding/finding of shapeConstructor by assetId, which also fixed displaying of shape's material listing
2021-09-10 07:13:56 +00:00
}
for(%i=0; %i < $AssetBrowser::AssetArray.count(); %i++)
%this.buildAssetPreview( $AssetBrowser::AssetArray.getValue(%i), $AssetBrowser::AssetArray.getKey(%i) );
//Queue population of any non-Type Card preview images
%this.schedule(32, "populatePreviewImages");
AssetBrowser_FooterText.text = %finalAssetCount @ " Assets";
%activeTypeFilterList = "";
if(AssetBrowser.assetTypeFilter $= "")
{
if(!AssetTypeListPopup.isItemChecked(0))
{
for(%f=0; %f < ABAssetTypesList.Count(); %f++)
{
%isChecked = AssetTypeListPopup.isItemChecked(%f+2);
if(%isChecked)
{
%filterTypeData = ABAssetTypesList.getKey(%f);
%filterTypeName = getField(%filterTypeData, 0);
if(%activeTypeFilterList $= "")
%activeTypeFilterList = %filterTypeName;
else
%activeTypeFilterList = %activeTypeFilterList @ ", " @ %filterTypeName;
}
}
}
}
else
{
%activeTypeFilterList = AssetBrowser.assetTypeFilter;
}
if(%activeTypeFilterList !$= "")
AssetBrowser_FooterText.text = AssetBrowser_FooterText.text @ " | Active Type Filters: " @ %activeTypeFilterList;
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
%this.previewArrayDirty = false;
}
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
//
//
// Search
function AssetBrowser::updateSearchTextFromFilter(%this)
{
AssetSearchTerms.sortk();
//Update the displayed search text!
%newSearchPhrase = "";
%currentAction = "";
%actionCount = 0;
for(%i=0; %i < AssetSearchTerms.count(); %i++)
{
%action = AssetSearchTerms.getKey(%i);
%word = AssetSearchTerms.getValue(%i);
if(%action !$= %currentAction)
{
if(%actionCount != 0)
{
if(%action !$= "")
%newSearchPhrase = %newSearchPhrase @ ";" @ %action @ ":" @ %word;
else
%newSearchPhrase = %newSearchPhrase @ ";" @ %word;
}
else
{
if(%action !$= "")
%newSearchPhrase = %action @ ":" @ %word;
else
%newSearchPhrase = %word;
}
%actionCount++;
}
else
{
%newSearchPhrase = %newSearchPhrase @ "," @ %word;
}
%currentAction = %action;
}
AssetBrowserSearchFilter.setText(%newSearchPhrase);
}
function AssetBrowser::processSearchFilter(%this)
{
AssetSearchTerms.empty();
%searchText = AssetBrowserSearchFilter.getText();
%termCount = getTokenCount(%searchText, ";");
for(%s=0; %s < %termCount; %s++)
{
%term = getToken(%searchText, ";", %s);
%phraseCount = getTokenCount(%term, ":");
if(%phraseCount == 2)
{
//action/words split
%action = getToken(%term, ":", 0);
%words = getToken(%term, ":", 1);
}
else
{
%action = "";
%words = getToken(%term, ":", 0);
}
%wordCount = getTokenCount(%words, ",");
for(%w=0; %w < %wordCount; %w++)
{
%word = getToken(%words, ",", %w);
AssetSearchTerms.add(%action, %word);
}
}
}
//Takes an item and compares it against the parsed search language
//This is written to be inclusive, rather than exclusive
function matchesSearch(%assetName, %assetType)
{
if(AssetSearchTerms.count() == 0)
return true;
%matchTags = false;
%matchType = false;
%matchName = false;
%needsTag = false;
%needsType = false;
%needsName = false;
for(%i=0; %i < AssetSearchTerms.count(); %i++)
{
%action = AssetSearchTerms.getKey(%i);
%word = AssetSearchTerms.getValue(%i);
if(%action $= "tag" && %matchTags == false)
{
%needsTag = true;
if(%assetType $= "Datablock")
{
if(%assetName.category $= %word)
%matchTags = true;
}
else
{
if(strstr(strlwr(%assetName.tags), strlwr(%word)) != -1)
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%matchTags = true;
}
}
else if(%action $= "type" && %matchType == false)
{
%needsType = true;
if(%assetType $= %word)
%matchType = true;
}
else if(%action $= "" && %matchName == false)
{
%needsName = true;
if(strstr(strlwr(%assetName), strlwr(%word)) != -1)
%matchName = true;
}
}
if(((%needsTag && %matchTags) || !%needsTag) &&
((%needsType && %matchType) || !%needsType) &&
((%needsName && %matchName) || !%needsName))
return true;
else
return false;
}
//
//
// Search Filters
function AssetBrowserSearchFilterTxt::onWake( %this )
{
/*%filter = %this.treeView.getFilterText();
if( %filter $= "" )
%this.setText( "\c2Filter..." );
else
%this.setText( %filter );*/
}
function AssetBrowserSearchFilterTxt::onGainFirstResponder( %this )
{
%this.selectAllText();
}
// When Enter is pressed in the filter text control, pass along the text of the control
// as the treeview's filter.
function AssetBrowserFolderSearchFilter::onReturn( %this )
{
%text = %this.getText();
if( %text $= "" )
%this.reset();
AssetBrowser.refresh();
}
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
function AssetBrowserFolderSearchFilter::onEdited(%this)
{
if(AssetBrowserFolderSearchFilter.getText() $= "")
{
AssetBrowser-->folderSearchBtn.setBitmap("tools/gui/images/stencilIcons/zoom.png");
}
else
{
AssetBrowser-->folderSearchBtn.setBitmap("tools/gui/images/stencilIcons/cross.png");
}
}
function AssetBrowserSearchFilter::onEdited(%this)
{
AssetBrowserSearchFilter.updateButton();
}
function AssetBrowserSearchFilter::onReturn( %this )
{
%text = %this.getText();
if( %text $= "" )
%this.reset();
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
AssetBrowserSearchFilter.updateButton();
AssetBrowser.processSearchFilter();
AssetBrowser.rebuildAssetArray();
}
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
function AssetBrowserSearchFilter::updateButton(%this)
{
if(%this.getText() $= "")
{
AssetBrowser-->assetSearchBtn.setBitmap("tools/gui/images/stencilIcons/zoom.png");
}
else
{
AssetBrowser-->assetSearchBtn.setBitmap("tools/gui/images/stencilIcons/cross.png");
}
}
function AssetBrowserFolderSearchFilter::reset( %this )
{
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%this.setText( "" );
AssetBrowser-->folderSearchBtn.setBitmap("tools/gui/images/stencilIcons/zoom.png");
//AssetBrowser.refresh();
}
function AssetBrowserSearchFilter::reset( %this )
{
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%this.setText( "" );
AssetBrowser-->assetSearchBtn.setBitmap("tools/gui/images/stencilIcons/zoom.png");
//AssetBrowser.rebuildAssetArray();
}
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
function AssetBrowserFolderSearchBtn::onClick( %this )
{
AssetBrowserFolderSearchFilter.reset();
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
AssetBrowser.refresh();
}
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
function AssetBrowserAssetSearchBtn::onClick( %this )
{
AssetBrowserSearchFilter.reset();
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
AssetBrowser.processSearchFilter();
AssetBrowser.rebuildAssetArray();
}
//
//
// Navigation
function AssetBrowser::navigateTo(%this, %address, %historyNav)
{
//Sanitize
if(startsWith(%address, "/"))
%address = strreplace(%address, "/", "");
// Safety
%address = strreplace(%address, "//", "/");
//Don't bother navigating if it's to the place we already are
if(%this.dirHandler.currentAddress !$= %address)
{
%this.dirHandler.navigateTo(%address, %historyNav);
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
//%this.updateNavigationBreadcrumb(%address);
%this.lastValidNavPath = %address;
%this-->navPath.setText(%address);
%module = %this.dirHandler.getModuleFromAddress(%address);
if(%module !$= "")
{
//legit module, so set it as current target
%this.SelectedModule = %module.moduleId;
}
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
if(%this.hasLooseFilesInDir())
{
Misc Quality of Life and Bug fixes Added handling for if preview images on image assets fails to generate, will fallback to using the full image Added handling for double clicking or drag-n-dropping terrain assets to create them Improved handling of field labels in variable inspector by making the stringtable be case sensitive. Added editor settings for handling of asset double click behavior. Can now select between Edit Asset and Spawn Asset. Support is asset type dependent. Added editor setting for auto-importing loose files when navigating to a folder. If on and the user has flagged to also enable auto-import generally, will auto import all unaffiliated loose files in as assets. Added editor setting for default module to use when creating new assets. Updated various tooling logic so when creating a new material, if this and the 'Always Prompt Module Target' setting is off, it will fill in the target module and target asset path info based on the default module. Fixed issue with editors that use managedData scripts where if the path didn't exist, the script file wouldn't be made. Fixed display issue in terrain editor where if you clear the detail map, the normal/macro/orm maps would disable, but not also clear. Fixed handling of cleared maps in terrain editor so it no longer fills empty maps in with the no image image. Fixed handling of creating new material where it would fill in the diffuse with a no texture image as the default. Fixed issue where canceling out of creating a module would still prompt to create the common default folders. Fixed issue where the Select Module window couldn't be closed via the cancel or x buttons. Based on feedback, reduced default size of the Text Pad window. Fixed issue where the Drop At menu list wouldn't correctly display which item was marked after it was changed. Fixed spawning shape asset handling so it uses whatever the editor's Drop At setting is. Improved themeing of regular bitmap buttons in the editor. Based on feedback, flipped layout of Target Module and Target Path in the Create New Asset window. Improved handling of setting up the Target Path for when creating new assets. If a path is not set, and the user has a Default Module, it will default the path to that module.
2021-08-28 23:51:27 +00:00
if(EditorSettings.value("Assets/AutoImportLooseFiles", false) && EditorSettings.value("Assets/AutoImport", false))
{
AssetBrowser.autoImportSimpleLooseFiles();
}
else
{
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%this-->AutoImportAssetButton.visible = true;
Misc Quality of Life and Bug fixes Added handling for if preview images on image assets fails to generate, will fallback to using the full image Added handling for double clicking or drag-n-dropping terrain assets to create them Improved handling of field labels in variable inspector by making the stringtable be case sensitive. Added editor settings for handling of asset double click behavior. Can now select between Edit Asset and Spawn Asset. Support is asset type dependent. Added editor setting for auto-importing loose files when navigating to a folder. If on and the user has flagged to also enable auto-import generally, will auto import all unaffiliated loose files in as assets. Added editor setting for default module to use when creating new assets. Updated various tooling logic so when creating a new material, if this and the 'Always Prompt Module Target' setting is off, it will fill in the target module and target asset path info based on the default module. Fixed issue with editors that use managedData scripts where if the path didn't exist, the script file wouldn't be made. Fixed display issue in terrain editor where if you clear the detail map, the normal/macro/orm maps would disable, but not also clear. Fixed handling of cleared maps in terrain editor so it no longer fills empty maps in with the no image image. Fixed handling of creating new material where it would fill in the diffuse with a no texture image as the default. Fixed issue where canceling out of creating a module would still prompt to create the common default folders. Fixed issue where the Select Module window couldn't be closed via the cancel or x buttons. Based on feedback, reduced default size of the Text Pad window. Fixed issue where the Drop At menu list wouldn't correctly display which item was marked after it was changed. Fixed spawning shape asset handling so it uses whatever the editor's Drop At setting is. Improved themeing of regular bitmap buttons in the editor. Based on feedback, flipped layout of Target Module and Target Path in the Create New Asset window. Improved handling of setting up the Target Path for when creating new assets. If a path is not set, and the user has a Default Module, it will default the path to that module.
2021-08-28 23:51:27 +00:00
}
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
}
else
{
%this-->AutoImportAssetButton.visible = false;
}
}
%this.rebuildAssetArray();
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
%this.refresh();
}
function AssetBrowser::navigateHistoryForward(%this)
{
%this.dirHandler.navigateHistoryForward();
%this.updateNavigationBreadcrumb();
%address = %this.dirHandler.currentAddress;
%module = AssetBrowser.dirHandler.getModuleFromAddress(%address);
if(%module !$= "")
{
//legit module, so set it as current target
%this.SelectedModule = %module.moduleId;
}
%this.lastValidNavPath = %address;
%this-->navPath.setText(%address);
%this.rebuildAssetArray();
}
function AssetBrowser::navigateHistoryBack(%this)
{
%this.dirHandler.navigateHistoryBack();
%this.updateNavigationBreadcrumb();
%address = %this.dirHandler.currentAddress;
%module = %this.dirHandler.getModuleFromAddress(%address);
if(%module !$= "")
{
//legit module, so set it as current target
%this.SelectedModule = %module.moduleId;
}
%this.lastValidNavPath = %address;
%this-->navPath.setText(%address);
%this.rebuildAssetArray();
}
function AssetBrowser::updateNavigationBreadcrumb(%this, %address)
{
//clear the breadcrumb bar
AssetBrowser_BreadcrumbBar.clear();
//break down the address
%folderCount = getTokenCount(%address, "/");
%rebuiltPath = "";
for(%f=0; %f < %folderCount; %f++)
{
%folderName = getToken(%address, "/", %f);
%rebuiltPath = %f == 0 ? %folderName : %rebuiltPath @ "/" @ %folderName;
%folderNavButton = new GuiButtonCtrl()
{
profile = ToolsGuiButtonProfile;
text = %folderName;
command = "AssetBrowser.navigateTo(\"" @ %rebuiltPath @ "\");";
extent = "100" SPC AssetBrowser_BreadcrumbBar.extent.y;
};
AssetBrowser_BreadcrumbBar.add(%folderNavButton);
if(%f != %folderCount-1)
{
%folderSpacerButton = new GuiBitmapButtonCtrl()
{
profile = ToolsGuiButtonProfile;
bitmapAsset = "ToolsModule:rightArrowWhite_image";
bitmapMode = "Centered";
extent = "25" SPC AssetBrowser_BreadcrumbBar.extent.y;
//command = "AssetBrowser.navigateTo(\"" @ %rebuiltPath @ "\");";
};
AssetBrowser_BreadcrumbBar.add(%folderSpacerButton);
}
}
//refresh the nav buttons to display the history
%backButtonHistory = "";
for(%i=0; %i < AssetBrowser.dirHandler.prevHistoryList.Count(); %i++)
{
%prevAddress = AssetBrowser.dirHandler.prevHistoryList.getKey(%i);
%backButtonHistory = %i==0 ? %prevAddress @ "\n" : %backButtonHistory @ %prevAddress @ "\n";
}
AssetBrowser_NavigateBackBtn.tooltip = %backButtonHistory;
%foreButtonHistory = "";
for(%i=0; %i < AssetBrowser.dirHandler.foreHistoryList.Count(); %i++)
{
%prevAddress = AssetBrowser.dirHandler.foreHistoryList.getKey(%i);
%foreButtonHistory = %i==0 ? %prevAddress @ "\n" : %foreButtonHistory @ %prevAddress @ "\n";
}
AssetBrowser_NavigateForwardBtn.tooltip = %foreButtonHistory;
}
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
function assetBrowserNavPath::onReturn(%this)
{
%newPath = %this.getText();
if(isDirectory(%newPath))
{
AssetBrowser.lastValidNavPath = %newPath;
AssetBrowser.navigateTo(%newPath);
}
else
{
%this.setText(AssetBrowser.lastValidNavPath);
AssetBrowser.navigateTo(AssetBrowser.lastValidNavPath);
}
}
//
//
//
function AssetBrowser::reloadModules(%this)
{
ModuleDatabase.unloadGroup("Game");
%modulesList = ModuleDatabase.findModules();
%count = getWordCount(%modulesList);
for(%i=0; %i < %count; %i++)
{
%moduleId = getWord(%modulesList, %i).ModuleId;
ModuleDatabase.unloadExplicit(%moduleId);
}
ModuleDatabase.scanModules();
%modulesList = ModuleDatabase.findModules();
%count = getWordCount(%modulesList);
for(%i=0; %i < %count; %i++)
{
%moduleId = getWord(%modulesList, %i).ModuleId;
ModuleDatabase.loadExplicit(%moduleId);
}
//ModuleDatabase.loadGroup("Game");
}
//
//
//
function AssetBrowser::toggleFolderCollapseButton(%this)
{
%this.folderPanelState = !%this.folderPanelState;
//If we're collapsing
if(!%this.folderPanelState)
{
//Store the original
%this.folderPanelSplit = AssetBrowser_MainSplit.splitPoint.x;
//collapse it
AssetBrowser_MainSplit.setSplitPoint(AssetBrowser_MainSplit.splitterSize SPC AssetBrowser_MainSplit.splitPoint.y);
}
else
{
//restore the original
AssetBrowser_MainSplit.setSplitPoint(%this.folderPanelSplit SPC AssetBrowser_MainSplit.splitPoint.y);
}
}
//
//
// Drag n drop
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
function AssetBrowserPreviewButton::onMouseDragged(%this)
{
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%payload = %this.clone();
%payload.position = "0 0";
//%payload.class = "AssetPreviewControl";
%xOffset = getWord( %payload.extent, 0 ) / 2;
%yOffset = getWord( %payload.extent, 1 ) / 2;
// Compute the initial position of the GuiDragAndDrop control on the cavas based on the current
// mouse cursor position.
%cursorpos = Canvas.getCursorPos();
%xPos = getWord( %cursorpos, 0 ) - %xOffset;
%yPos = getWord( %cursorpos, 1 ) - %yOffset;
if(!isObject(EditorDragAndDropLayer))
{
new GuiControl(EditorDragAndDropLayer)
{
position = "0 0";
extent = Canvas.extent;
};
}
// Create the drag control.
%ctrl = new GuiDragAndDropControl()
{
canSaveDynamicFields = "0";
Profile = "ToolsGuiSolidDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = %xPos SPC %yPos;
extent = %payload.extent;
MinExtent = "4 4";
canSave = "1";
Visible = "1";
hovertime = "1000";
// Let the GuiDragAndDropControl delete itself on mouse-up. When the drag is aborted,
// this not only deletes the drag control but also our payload.
deleteOnMouseUp = true;
useWholeCanvas = true;
// To differentiate drags, use the namespace hierarchy to classify them.
// This will allow a color swatch drag to tell itself apart from a file drag, for example.
class = "AssetPreviewControlType_AssetDrop";
};
// Add the temporary color swatch to the drag control as the payload.
%ctrl.add( %payload );
// Start drag by adding the drag control to the canvas and then calling startDragging().
//Canvas.getContent().add( %ctrl );
EditorDragAndDropLayer.add(%ctrl);
Canvas.pushDialog(EditorDragAndDropLayer);
%ctrl.startDragging( %xOffset, %yOffset );
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
Canvas.repaint();
}
- Fixes the display of the preview in the MaterialAsset fields - Hides the special-case direct filepath field for ShapeAsset persist fields macro - Shifts the handling of TSStatics so the shape instance will load materials on the server as well as the client. This opens gameplay options as well as allowing rebaking of meshes functionality more easily - Expands AssetBase's isValidAsset utility function to actually check validity instead of just returning true - Adds isValid utility function to AssetPtr - Added new field flag that makes the field not write out to file - Removed legacy iconBitmap field from GuiIconButtonCtrl because it was causing errors - Fixed group filtering check of guiInspector to ignore case - Removed unneeded isFile checks for common datablock script files in Prototyping module script - Removed test datablocks from Prototyping module - Removed unnecessary container control from AssetBrowser - Adjusted preview regen logic of AssetBrowser so it doesn't trip if you're simply resizing the window - Fixed issue where row-vs-column layout logic for AssetBrowser when resizing window was fiddly - Added handling for when Dragging and Dropping datablock from AssetBrowser to spawn, it'll prompt if it spawns the actual object, or a spawnsphere that spawns said object. In the event of an PlayerData will also prompt if it should spawn an AIPlayer - Added ability to take a TSStatic that uses a baked down mesh and are able to restore it to the cache prefab, or trigger and in-place rebake to refresh it if something has changed in the original contents via RMB menu on the scene tree - Added ability to explode prefab to RMB menu on scene tree - Added ability to convert selection to prefab or bake to mesh in RMB menu on scene tree - Tweaked sizing of the DatablockEditorCreatePrompt window to not have cut off elements and easier to see/work with - Added sanity check to datablock editor creation - Fixed preview display of material in Decal Editor - Made compositeTextureEditor use the cached preview of images - Fixed sizing/spacing of gui selection dropdown as well as resolution dropdown of GuiEditor - Fixes MaterialEditor to properly save the group collapse state when editing - Adds ability to in-flow edit and create datablocks in the NavMesh Editor for the testing panel, and makes the datablock dropdown searchable - Fixed issue where opening the ShapeEditor via the edit button on a ShapeAsset field would cause the action buttons on the top bar to not show - Fixed error in shape editor where when exiting it was erroneously checking for a clear value of -1 rather than 0 - Removed unneeded top tabbook and tab page for main editor panel - Fixed issue where reset button of TerrainBrush Softness Curve editor didn't actually reset - Resized Object Builder window to not cut off elements and have enough width to show more data - Added a TypeCommand field type to Object Builder and changed spawnscript field of SpawnSphere to use it rather than a simple text edit field - Allow SpawnSphere in ObjectBuilder to be passed in spawn class and spawn datablock default info - Injects button to controllable objects when Inspecting them to make it easy to toggle if you're in control of it or not -
2025-08-26 04:35:28 +00:00
function AssetPreviewControlType_AssetDrop::onControlDragCancelled(%this)
{
Canvas.popDialog(EditorDragAndDropLayer);
}
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
function AssetBrowserPreviewButton::onControlDropped( %this, %payload, %position )
{
Canvas.popDialog(EditorDragAndDropLayer);
if( !%payload.parentGroup.isInNamespaceHierarchy( "AssetPreviewControlType_AssetDrop" ) )
return;
// If dropped on same button whence we came from,
// do nothing.
if( %payload.dragSourceControl == %this )
return;
Changed default terrain paths to go into data/terrains if nothing is set Added default terrianmat definition for warning_material Corrected separator-h image path for a few GUI controls Corrected SelectAssetPathWindow reference so it focuses the window right Changed new asset window to work with new Select Path window and address system Added call to force AssetBrowser to load/initialize when the tools are initialized(ensures anything utilizing assets in other tools don't have reference issues) Standardized drag-n-drop move behavior in the Asset browser so dragging onto the folder tree and a folder in the browser both behave more predictably If import config is set to not allow importing with errors, then the Done button is disabled when errors are detected Updated the example assettype file for the AB Fixed up move/delete/rename behavior for folders in AB Begun full standardization of move/delete/rename actions for other asset types in AB Added standardized call for New Asset field fillouts by letting the asset types populate them Moved terrain block creation to the standard create call so it can accept other normal fields like resolution Updated the 'Do you want to create' terrain block prompts to generate the asset if yes, and if no it'll prompt to go find an existing terrain asset Added placeholder image for terrain material asset for preview Updated refresh behavior for terrain material assets so they properly populate on creation now Added standardized functions to the directoryHandling class for folder/file manipulation Corrected some warnMat image references
2019-12-23 18:37:55 +00:00
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%assetType = %payload.assetType;
%assetName = %payload.assetName;
%moduleName = %payload.moduleName;
Changed default terrain paths to go into data/terrains if nothing is set Added default terrianmat definition for warning_material Corrected separator-h image path for a few GUI controls Corrected SelectAssetPathWindow reference so it focuses the window right Changed new asset window to work with new Select Path window and address system Added call to force AssetBrowser to load/initialize when the tools are initialized(ensures anything utilizing assets in other tools don't have reference issues) Standardized drag-n-drop move behavior in the Asset browser so dragging onto the folder tree and a folder in the browser both behave more predictably If import config is set to not allow importing with errors, then the Done button is disabled when errors are detected Updated the example assettype file for the AB Fixed up move/delete/rename behavior for folders in AB Begun full standardization of move/delete/rename actions for other asset types in AB Added standardized call for New Asset field fillouts by letting the asset types populate them Moved terrain block creation to the standard create call so it can accept other normal fields like resolution Updated the 'Do you want to create' terrain block prompts to generate the asset if yes, and if no it'll prompt to go find an existing terrain asset Added placeholder image for terrain material asset for preview Updated refresh behavior for terrain material assets so they properly populate on creation now Added standardized functions to the directoryHandling class for folder/file manipulation Corrected some warnMat image references
2019-12-23 18:37:55 +00:00
%targetAssetName = %this.assetName;
%targetAssetType = %this.assetType;
%targetModuleName = %this.moduleName;
Changed default terrain paths to go into data/terrains if nothing is set Added default terrianmat definition for warning_material Corrected separator-h image path for a few GUI controls Corrected SelectAssetPathWindow reference so it focuses the window right Changed new asset window to work with new Select Path window and address system Added call to force AssetBrowser to load/initialize when the tools are initialized(ensures anything utilizing assets in other tools don't have reference issues) Standardized drag-n-drop move behavior in the Asset browser so dragging onto the folder tree and a folder in the browser both behave more predictably If import config is set to not allow importing with errors, then the Done button is disabled when errors are detected Updated the example assettype file for the AB Fixed up move/delete/rename behavior for folders in AB Begun full standardization of move/delete/rename actions for other asset types in AB Added standardized call for New Asset field fillouts by letting the asset types populate them Moved terrain block creation to the standard create call so it can accept other normal fields like resolution Updated the 'Do you want to create' terrain block prompts to generate the asset if yes, and if no it'll prompt to go find an existing terrain asset Added placeholder image for terrain material asset for preview Updated refresh behavior for terrain material assets so they properly populate on creation now Added standardized functions to the directoryHandling class for folder/file manipulation Corrected some warnMat image references
2019-12-23 18:37:55 +00:00
if( %payload.dragSourceControl.class $= "AssetPreviewButton" && %targetAssetType $= "Folder")
{
Changed default terrain paths to go into data/terrains if nothing is set Added default terrianmat definition for warning_material Corrected separator-h image path for a few GUI controls Corrected SelectAssetPathWindow reference so it focuses the window right Changed new asset window to work with new Select Path window and address system Added call to force AssetBrowser to load/initialize when the tools are initialized(ensures anything utilizing assets in other tools don't have reference issues) Standardized drag-n-drop move behavior in the Asset browser so dragging onto the folder tree and a folder in the browser both behave more predictably If import config is set to not allow importing with errors, then the Done button is disabled when errors are detected Updated the example assettype file for the AB Fixed up move/delete/rename behavior for folders in AB Begun full standardization of move/delete/rename actions for other asset types in AB Added standardized call for New Asset field fillouts by letting the asset types populate them Moved terrain block creation to the standard create call so it can accept other normal fields like resolution Updated the 'Do you want to create' terrain block prompts to generate the asset if yes, and if no it'll prompt to go find an existing terrain asset Added placeholder image for terrain material asset for preview Updated refresh behavior for terrain material assets so they properly populate on creation now Added standardized functions to the directoryHandling class for folder/file manipulation Corrected some warnMat image references
2019-12-23 18:37:55 +00:00
%destination = %targetModuleName @ "/" @ %targetAssetName;
if(%assetType $= "Folder")
{
%originFolder = %moduleName @ "/" @ %assetName;
%destination = %destination @ "/" @ %assetName;
//Do any cleanup required given the type
if(AssetBrowser.isMethod("moveFolder"))
eval(AssetBrowser @ ".moveFolder(\""@%originFolder@"\",\""@%destination@"\");");
}
else
Changed default terrain paths to go into data/terrains if nothing is set Added default terrianmat definition for warning_material Corrected separator-h image path for a few GUI controls Corrected SelectAssetPathWindow reference so it focuses the window right Changed new asset window to work with new Select Path window and address system Added call to force AssetBrowser to load/initialize when the tools are initialized(ensures anything utilizing assets in other tools don't have reference issues) Standardized drag-n-drop move behavior in the Asset browser so dragging onto the folder tree and a folder in the browser both behave more predictably If import config is set to not allow importing with errors, then the Done button is disabled when errors are detected Updated the example assettype file for the AB Fixed up move/delete/rename behavior for folders in AB Begun full standardization of move/delete/rename actions for other asset types in AB Added standardized call for New Asset field fillouts by letting the asset types populate them Moved terrain block creation to the standard create call so it can accept other normal fields like resolution Updated the 'Do you want to create' terrain block prompts to generate the asset if yes, and if no it'll prompt to go find an existing terrain asset Added placeholder image for terrain material asset for preview Updated refresh behavior for terrain material assets so they properly populate on creation now Added standardized functions to the directoryHandling class for folder/file manipulation Corrected some warnMat image references
2019-12-23 18:37:55 +00:00
{
%assetId = %moduleName @ ":" @ %assetName;
%assetDef = AssetDatabase.acquireAsset(%assetId);
%assetType = AssetDatabase.getAssetType(%assetId);
//Do any cleanup required given the type
if(AssetBrowser.isMethod("move"@%assetType))
{
%command = AssetBrowser @ ".move" @ %assetType @ "(" @ %assetDef @ ",\"" @ %destination @ "\");";
eval(AssetBrowser @ ".move" @ %assetType @ "(" @ %assetDef @ ",\"" @ %destination @ "\");");
}
}
AssetBrowser.refresh();
}
}
function EWorldEditor::onControlDropped( %this, %payload, %position )
{
Canvas.popDialog(EditorDragAndDropLayer);
// Make sure this is a color swatch drag operation.
if( !%payload.parentGroup.isInNamespaceHierarchy( "AssetPreviewControlType_AssetDrop" ) )
return;
// If dropped on same button whence we came from,
// do nothing.
if( %payload.dragSourceControl == %this )
return;
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%assetType = %payload.assetType;
%createPosition = ObjectCreator.getCreateObjectPosition(); //LocalClientConnection.camera.position;
%targetPosition = EWorldEditor.unproject(%createPosition SPC 1);
%camPos = LocalClientConnection.camera.getPosition();
%rayResult = containerRayCast(%camPos, %targetPosition, -1);
%pos = ObjectCreator.getCreateObjectPosition();
if(%rayResult != 0)
{
%pos = getWords(%rayResult, 1, 3);
}
else
{
%pos = "0 0 0";
}
AssetBrowser.callAssetTypeFunc(%assetType, "onWorldEditorDropped", %payload.moduleName, %payload.assetName, %pos);
if(EditorSettings.value("AssetManagement/Assets/closeBrowserOnDragAction", false))
{
AssetBrowser.hideDialog();
}
EWorldEditor.isDirty = true;
}
Adjusted callback handling of asset inspector fields when invoking AB to select asset for more consistent behavior and better handling of updating the objects and inspector Added logic to forcefully acquire newly imported asset definition to better try and ensure it's loaded immediately after import Added logic to asset importer so if a file is not found for an importing material asset, if populate maps is on, then it will try and find a matching image asset in the destination module Added logic to tsStatic to better handle fields being updated via the editor, forcing updates and refreshes of the shape and materialSlots Fixed handling of guiBitmapButtonCtrl so it will update the bitmap used when edited via the Gui Editor Updated image ref to the hudFill image asset for the console GUI Cleaned up names for the default camera model/material Defaulted import config to utilize the Prune action instead of rename for more predictable default behavior Added icons next to AB's preview slider bar for additional visual feedback of slider intent Added missing checkbox to asset import window and cleaned up scaling behavior Fixed handling of drag-n-drop behavior in GUI editor so it doesn't block further interaction Added logic for drag-n-drop of image assets to GUI Editor so it will create a GuiBitmapCtrl with the image Added handling for drag-n-drop import of folders of assets to AB/Asset Import Added missing asset import config option to indicate if config supported import of sound assets Added logic when opening asset import config editor, where if there is a default import config set in the settings, it will open that one by default Hid the collision section of the import config editor, as those options are currently unutilized Improved behavior for Create New Folder window in the AB, now always pushing to the front, and also selecting the text by default, so the user can just start typing the new name Also added return and escape key accelerators to Create New Folder window for better UX Fixed display of editor windows, adding a distinct blue color to highlighted windows' title bar and fixing display of minimize/maximize/window/close buttons Moved GUIEditor's onControlDropped function to the AB script to match placement of sibling world editor function Fixed issue with material editor where the ORM Config map slot was getting the normal map instead of the correct ORM map
2021-11-26 22:40:15 +00:00
function GuiEditor::onControlDropped(%this, %payload, %position)
{
Canvas.popDialog(EditorDragAndDropLayer);
// Make sure we have the right kind of D&D.
if( !%payload.parentGroup.isInNamespaceHierarchy( "GuiDragAndDropControlType_GuiControl" ) &&
!%payload.parentGroup.isInNamespaceHierarchy( "AssetPreviewControlType_AssetDrop" ))
return;
if( %payload.dragSourceControl == %this )
return;
%pos = %payload.getGlobalPosition();
%x = getWord(%pos, 0);
%y = getWord(%pos, 1);
if(%payload.assetType !$= "Creator")
{
//dealing with an actual asset, so build the assetName
%assetId = %payload.moduleName @ ":" @ %payload.assetName;
%assetType = AssetDatabase.getAssetType(%assetId);
%ctrl = AssetBrowser.callAssetTypeFunc(%assetType, "onGUIEditorDropped", %payload.moduleName, %payload.assetName, %pos);
Adjusted callback handling of asset inspector fields when invoking AB to select asset for more consistent behavior and better handling of updating the objects and inspector Added logic to forcefully acquire newly imported asset definition to better try and ensure it's loaded immediately after import Added logic to asset importer so if a file is not found for an importing material asset, if populate maps is on, then it will try and find a matching image asset in the destination module Added logic to tsStatic to better handle fields being updated via the editor, forcing updates and refreshes of the shape and materialSlots Fixed handling of guiBitmapButtonCtrl so it will update the bitmap used when edited via the Gui Editor Updated image ref to the hudFill image asset for the console GUI Cleaned up names for the default camera model/material Defaulted import config to utilize the Prune action instead of rename for more predictable default behavior Added icons next to AB's preview slider bar for additional visual feedback of slider intent Added missing checkbox to asset import window and cleaned up scaling behavior Fixed handling of drag-n-drop behavior in GUI editor so it doesn't block further interaction Added logic for drag-n-drop of image assets to GUI Editor so it will create a GuiBitmapCtrl with the image Added handling for drag-n-drop import of folders of assets to AB/Asset Import Added missing asset import config option to indicate if config supported import of sound assets Added logic when opening asset import config editor, where if there is a default import config set in the settings, it will open that one by default Hid the collision section of the import config editor, as those options are currently unutilized Improved behavior for Create New Folder window in the AB, now always pushing to the front, and also selecting the text by default, so the user can just start typing the new name Also added return and escape key accelerators to Create New Folder window for better UX Fixed display of editor windows, adding a distinct blue color to highlighted windows' title bar and fixing display of minimize/maximize/window/close buttons Moved GUIEditor's onControlDropped function to the AB script to match placement of sibling world editor function Fixed issue with material editor where the ORM Config map slot was getting the normal map instead of the correct ORM map
2021-11-26 22:40:15 +00:00
}
else
{
%className = %payload.assetName;
if(%payload.altCommand !$= "")
{
%cmd = %payload.altCommand;
}
else
{
Adjusted callback handling of asset inspector fields when invoking AB to select asset for more consistent behavior and better handling of updating the objects and inspector Added logic to forcefully acquire newly imported asset definition to better try and ensure it's loaded immediately after import Added logic to asset importer so if a file is not found for an importing material asset, if populate maps is on, then it will try and find a matching image asset in the destination module Added logic to tsStatic to better handle fields being updated via the editor, forcing updates and refreshes of the shape and materialSlots Fixed handling of guiBitmapButtonCtrl so it will update the bitmap used when edited via the Gui Editor Updated image ref to the hudFill image asset for the console GUI Cleaned up names for the default camera model/material Defaulted import config to utilize the Prune action instead of rename for more predictable default behavior Added icons next to AB's preview slider bar for additional visual feedback of slider intent Added missing checkbox to asset import window and cleaned up scaling behavior Fixed handling of drag-n-drop behavior in GUI editor so it doesn't block further interaction Added logic for drag-n-drop of image assets to GUI Editor so it will create a GuiBitmapCtrl with the image Added handling for drag-n-drop import of folders of assets to AB/Asset Import Added missing asset import config option to indicate if config supported import of sound assets Added logic when opening asset import config editor, where if there is a default import config set in the settings, it will open that one by default Hid the collision section of the import config editor, as those options are currently unutilized Improved behavior for Create New Folder window in the AB, now always pushing to the front, and also selecting the text by default, so the user can just start typing the new name Also added return and escape key accelerators to Create New Folder window for better UX Fixed display of editor windows, adding a distinct blue color to highlighted windows' title bar and fixing display of minimize/maximize/window/close buttons Moved GUIEditor's onControlDropped function to the AB script to match placement of sibling world editor function Fixed issue with material editor where the ORM Config map slot was getting the normal map instead of the correct ORM map
2021-11-26 22:40:15 +00:00
%cmd = "return new " @ %className @ "();";
}
Adjusted callback handling of asset inspector fields when invoking AB to select asset for more consistent behavior and better handling of updating the objects and inspector Added logic to forcefully acquire newly imported asset definition to better try and ensure it's loaded immediately after import Added logic to asset importer so if a file is not found for an importing material asset, if populate maps is on, then it will try and find a matching image asset in the destination module Added logic to tsStatic to better handle fields being updated via the editor, forcing updates and refreshes of the shape and materialSlots Fixed handling of guiBitmapButtonCtrl so it will update the bitmap used when edited via the Gui Editor Updated image ref to the hudFill image asset for the console GUI Cleaned up names for the default camera model/material Defaulted import config to utilize the Prune action instead of rename for more predictable default behavior Added icons next to AB's preview slider bar for additional visual feedback of slider intent Added missing checkbox to asset import window and cleaned up scaling behavior Fixed handling of drag-n-drop behavior in GUI editor so it doesn't block further interaction Added logic for drag-n-drop of image assets to GUI Editor so it will create a GuiBitmapCtrl with the image Added handling for drag-n-drop import of folders of assets to AB/Asset Import Added missing asset import config option to indicate if config supported import of sound assets Added logic when opening asset import config editor, where if there is a default import config set in the settings, it will open that one by default Hid the collision section of the import config editor, as those options are currently unutilized Improved behavior for Create New Folder window in the AB, now always pushing to the front, and also selecting the text by default, so the user can just start typing the new name Also added return and escape key accelerators to Create New Folder window for better UX Fixed display of editor windows, adding a distinct blue color to highlighted windows' title bar and fixing display of minimize/maximize/window/close buttons Moved GUIEditor's onControlDropped function to the AB script to match placement of sibling world editor function Fixed issue with material editor where the ORM Config map slot was getting the normal map instead of the correct ORM map
2021-11-26 22:40:15 +00:00
%ctrl = eval( %cmd );
}
%this.addNewCtrl(%ctrl);
%ctrl.setPositionGlobal(%x, %y);
%this.setFirstResponder();
if(EditorSettings.value("AssetManagement/Assets/closeBrowserOnDragAction", false))
{
AssetBrowser.hideDialog();
}
}
function AssetBrowserFilterTree::onControlDropped( %this, %payload, %position )
{
Canvas.popDialog(EditorDragAndDropLayer);
if( !%payload.parentGroup.isInNamespaceHierarchy( "AssetPreviewControlType_AssetDrop" ) )
return;
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%assetType = %payload.assetType;
%assetName = %payload.assetName;
%moduleName = %payload.moduleName;
%item = %this.getItemAtPosition(%position);
%parent = %this.getParentItem(%item);
if(%item != 1)
{
//we're a folder entry, cool
%path = %this.getItemValue(%item) @ "/" @ %this.getItemText(%item);
if(%path !$= AssetBrowser.dirHandler.CurrentAddress)
{
if(getModuleFromAddress(%path) !$= getModuleFromAddress(AssetBrowser.dirHandler.CurrentAddress))
Changed default terrain paths to go into data/terrains if nothing is set Added default terrianmat definition for warning_material Corrected separator-h image path for a few GUI controls Corrected SelectAssetPathWindow reference so it focuses the window right Changed new asset window to work with new Select Path window and address system Added call to force AssetBrowser to load/initialize when the tools are initialized(ensures anything utilizing assets in other tools don't have reference issues) Standardized drag-n-drop move behavior in the Asset browser so dragging onto the folder tree and a folder in the browser both behave more predictably If import config is set to not allow importing with errors, then the Done button is disabled when errors are detected Updated the example assettype file for the AB Fixed up move/delete/rename behavior for folders in AB Begun full standardization of move/delete/rename actions for other asset types in AB Added standardized call for New Asset field fillouts by letting the asset types populate them Moved terrain block creation to the standard create call so it can accept other normal fields like resolution Updated the 'Do you want to create' terrain block prompts to generate the asset if yes, and if no it'll prompt to go find an existing terrain asset Added placeholder image for terrain material asset for preview Updated refresh behavior for terrain material assets so they properly populate on creation now Added standardized functions to the directoryHandling class for folder/file manipulation Corrected some warnMat image references
2019-12-23 18:37:55 +00:00
{
AssetBrowser.callAssetTypeFunc(%this.assetType, "onMoveModule", %this.moduleName, %this.assetName, %path);
Changed default terrain paths to go into data/terrains if nothing is set Added default terrianmat definition for warning_material Corrected separator-h image path for a few GUI controls Corrected SelectAssetPathWindow reference so it focuses the window right Changed new asset window to work with new Select Path window and address system Added call to force AssetBrowser to load/initialize when the tools are initialized(ensures anything utilizing assets in other tools don't have reference issues) Standardized drag-n-drop move behavior in the Asset browser so dragging onto the folder tree and a folder in the browser both behave more predictably If import config is set to not allow importing with errors, then the Done button is disabled when errors are detected Updated the example assettype file for the AB Fixed up move/delete/rename behavior for folders in AB Begun full standardization of move/delete/rename actions for other asset types in AB Added standardized call for New Asset field fillouts by letting the asset types populate them Moved terrain block creation to the standard create call so it can accept other normal fields like resolution Updated the 'Do you want to create' terrain block prompts to generate the asset if yes, and if no it'll prompt to go find an existing terrain asset Added placeholder image for terrain material asset for preview Updated refresh behavior for terrain material assets so they properly populate on creation now Added standardized functions to the directoryHandling class for folder/file manipulation Corrected some warnMat image references
2019-12-23 18:37:55 +00:00
}
else
{
AssetBrowser.callAssetTypeFunc(%this.assetType, "onMovePath", %this.moduleName, %this.assetName, %path);
Changed default terrain paths to go into data/terrains if nothing is set Added default terrianmat definition for warning_material Corrected separator-h image path for a few GUI controls Corrected SelectAssetPathWindow reference so it focuses the window right Changed new asset window to work with new Select Path window and address system Added call to force AssetBrowser to load/initialize when the tools are initialized(ensures anything utilizing assets in other tools don't have reference issues) Standardized drag-n-drop move behavior in the Asset browser so dragging onto the folder tree and a folder in the browser both behave more predictably If import config is set to not allow importing with errors, then the Done button is disabled when errors are detected Updated the example assettype file for the AB Fixed up move/delete/rename behavior for folders in AB Begun full standardization of move/delete/rename actions for other asset types in AB Added standardized call for New Asset field fillouts by letting the asset types populate them Moved terrain block creation to the standard create call so it can accept other normal fields like resolution Updated the 'Do you want to create' terrain block prompts to generate the asset if yes, and if no it'll prompt to go find an existing terrain asset Added placeholder image for terrain material asset for preview Updated refresh behavior for terrain material assets so they properly populate on creation now Added standardized functions to the directoryHandling class for folder/file manipulation Corrected some warnMat image references
2019-12-23 18:37:55 +00:00
}
//we're trying to move the asset to a different module!
//toolsMessageBoxYesNo( "Move Asset", "Do you wish to move asset " @ %assetName @ " to " @ %path @ "?",
// "AssetBrowser.moveAsset(\""@ %moduleName @ ":" @ %assetName @"\", \""@%path@"\");", "");
}
}
}
function AssetBrowserFilterTree::onDragDropped( %this )
{
}
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
function AssetBrowser::hasLooseFilesInDir(%this)
{
Add getScriptPath console function to GUIAsset Shifted tracking of importing asset status to an enum for more robust handling Added logic to properly init freshly created shapeConstructors with the newly imported shapeAsset Fixed handling of assets that have been marked to be skipped, but needed to fill in the parent's dependencies(UseForDependencies enum value) Cleaned up redundant recursive logic for importing assets Disable Create Game Objects button in inspector Fixed material assignment for convex proxies Updated asset icons for AB with WIP images to be more clear Fixed issue where type-generic icons in the creator items in the AB weren't showing correctly. Force AB to show creator entries in list mode for efficiency and avoid icon scaling issues Moved creator functions for AB to separate file for convenience Filled out GUIControls in the AB's creator mode, and context world editor and GUI creator entries based on active editor Added drag-n-drop handling for guiControls via AB creator in guiEditor mode Added more types' profiles in the AB gui profiles to give more unique border colors for better visual clarity of asset type Added editor setting to indicate if the editor should load into the last edited level, or the editor default scene Fixed setting of highlight material overlay in shapeEditor Added global keybind for GUIEditor so space also toggles assetbrowser Fixed up binding/finding of shapeConstructor by assetId, which also fixed displaying of shape's material listing
2021-09-10 07:13:56 +00:00
if(!isDirectory(%this.dirHandler.currentAddress))
return false;
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
//First, wipe out any files inside the folder first
%file = findFirstFileMultiExpr( %this.dirHandler.currentAddress @ "/*.*", false);
%aq = new AssetQuery();
while( %file !$= "" )
{
if(!strIsMatchExpr("*.asset.taml", %file) && !strIsMatchExpr("*.taml", %file) && !strIsMatchExpr("*.cached.dts", %file))
{
%assetsFound = AssetDatabase.findAssetLooseFile(%aq, %file);
if(%assetsFound == 0)
{
%ext = fileExt(%file);
if(isShapeFormat(%ext) || isImageFormat(%ext) || isSoundFormat(%ext))
{
%aq.delete();
return true;
}
}
}
%file = findNextFileMultiExpr( %this.dirHandler.currentAddress @ "/*.*" );
}
%aq.delete();
return false;
}
function AssetBrowser::autoImportSimpleLooseFiles(%this)
{
%importer = new AssetImporter();
//First, wipe out any files inside the folder first
%file = findFirstFileMultiExpr( %this.dirHandler.currentAddress @ "/*.*", false);
%aq = new AssetQuery();
while( %file !$= "" )
{
if(!strIsMatchExpr("*.asset.taml", %file) && !strIsMatchExpr("*.taml", %file) && !strIsMatchExpr("*.cached.dts", %file)
&& !strIsMatchExpr("*.cs", %file) && !strIsMatchExpr("*.tscript", %file) && !strIsMatchExpr("*.module", %file))
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
{
%aq.clear();
Added/Improved some asset type icons Renamed current default import config to DefaultConfig Updated Asset Browser UI layout. Fixed sizing behavior for Edit Asset window Fixed sizing behavior for Edit Module window Implemented Collection Sets system Implemented handling of non-asset loose files for AB Initial handling logic for prefabs for AB Updated Asset Importer to hook into C++ AssetImporter Made Add Module window properly reset module name field when opened Overhauled entire AB search system so it can use phrases and compound search logic Overhauled asset previews to utilize single guiIconButtonCtrl for efficiency and stability Updated Asset Preview Drag-n-drop to work with new previews Begun initial work with Tags integration into AB - currently only works with datablock categories Bugin initial work with Creator classes - currently only populates category lists, no items Added logic for scanning current AB directory for non-asset loose files, and activating an Auto-Import button if any are found Added ability to drag-n-drop datablocks from AB and spawn requisite object Stabilized drag-n-drop behavior of ShapeAssets, so when spawned, it'll find a much more sane drop position Fixed shapeAsset fields for drag-n-drop behavior so it correctly sets field now Adjusted folder and asset search fields in AB to utilize placeholder text Added logic when creating new module to prompt auto-populating common default folders Shifted preview size to slider Added logic to MenuBuilder so popup menus can utilize bitmap arrays Added editor setting for if to display loose files in AB Minor theme color corrections for some profiles
2020-07-11 21:49:06 +00:00
%assetsFound = AssetDatabase.findAssetLooseFile(%aq, %file);
if(%assetsFound == 0)
{
%ext = fileExt(%file);
if(isShapeFormat(%ext) || isImageFormat(%ext) || isSoundFormat(%ext))
{
%assetId = %importer.autoImportFile(%file);
}
}
}
%file = findNextFileMultiExpr( %this.dirHandler.currentAddress @ "/*.*" );
}
%aq.delete();
%importer.delete();
%this.refresh();
}
function AssetBrowser::getLooseFilesInDir(%this)
{
if(!isObject(ABLooseFileArray))
new ArrayObject(ABLooseFileArray);
ABLooseFileArray.empty();
%showLooseFiles = EditorSettings.value("Assets/Browser/showLooseFiles", false);
if(%showLooseFiles == false)
return;
//First, wipe out any files inside the folder first
%file = findFirstFileMultiExpr( %this.dirHandler.currentAddress @ "/*.*", false);
%aq = new AssetQuery();
while( %file !$= "" )
{
if(!strIsMatchExpr("*.asset.taml", %file) && !strIsMatchExpr("*.taml", %file) && !strIsMatchExpr("*.cached.dts", %file))
{
%assetsFound = AssetDatabase.findAssetLooseFile(%aq, %file);
if(%assetsFound == 0)
{
ABLooseFileArray.add(%file);
}
}
%file = findNextFileMultiExpr( %this.dirHandler.currentAddress @ "/*.*" );
}
%aq.delete();
return false;
}
function getNonAssetFilesInDir(%path, %arrayObj)
{
//echo("getNonAssetFilesInDir() - path: " @ %path);
if(!isObject(%arrayObj))
{
error("getNonAssetFilesInDir() - requires a valid arrayObject to place found non-Asset files into!");
return 0;
}
%arrayObj.empty();
//First, wipe out any files inside the folder first
%file = findFirstFileMultiExpr( %path @ "/*.*", false);
%aq = new AssetQuery();
while( %file !$= "" )
{
if(!strIsMatchExpr("*.asset.taml", %file) && !strIsMatchExpr("*.taml", %file) && !strIsMatchExpr("*.cached.dts", %file))
{
%assetsFound = AssetDatabase.findAssetLooseFile(%aq, %file);
if(%assetsFound == 0)
{
%arrayObj.add(%file);
}
}
%file = findNextFileMultiExpr( %path @ "/*.*" );
}
%aq.delete();
return %arrayObj.count();
}
//
//
function AssetBrowser::importLooseFiles(%this)
{
echo("Adding loose files at directory " @ %this.dirHandler.currentAddress);
LooseFileAuditWindow.showDialog(%this.dirHandler.currentAddress);
}
// -----------------------------------------------------------------------------
function getAssetPreviewImage(%asset)
{
if(isFile(%asset))
{
%aq = new AssetQuery();
%assetsFound = AssetDatabase.findAssetLooseFile(%aq, %asset);
if(%assetsFound != 0)
{
%asset = %aq.getAsset(0);
}
else
{
%previewPath = %asset;
}
%aq.delete();
}
if(AssetDatabase.isDeclaredAsset(%asset))
{
%moduleName = AssetDatabase.getAssetModule(%asset).ModuleId;
%assetName = AssetDatabase.getAssetName(%asset);
%previewPath = "tools/resources/previewCache/" @ %moduleName @ "/";
%previewFilePath = %previewPath @ %assetName @ ".png";
if(isFile(%previewFilePath))
{
%previewPath = %previewFilePath;
}
else
{
%previewPath = %asset;
}
}
else
{
%previewPath = %asset;
}
if(%previewPath $= "")
%previewPath = "ToolsModule:unknownImage_image";
return %previewPath;
}
// -----------------------------------------------------------------------------
function AssetBrowserWindow::dockPanel(%this)
{
if(%this.docked == true)
return;
%this.resizing = true;
%this.docked = true;
%this.canCollapse = "0";
%this.canMove = "0";
%this.resizeWidth = "0";
AssetBrowserWindow_UnDockBtn.Visible = "1";
AssetBrowserWindow_DockBtn.Visible = "0";
EditorGui.updateSideBar();
}
function AssetBrowserWindow::releasePanel(%this)
{
if(%this.docked == false)
return;
%this.canCollapse = "1";
%this.canMove = "1";
%this.resizeWidth = "1";
AssetBrowserWindow_UnDockBtn.Visible = "0";
AssetBrowserWindow_DockBtn.Visible = "1";
// Let's do a small resize so it's visually clear we're "undocking"
%position = %this.position.x + 6 SPC %this.position.y - 6;
%extent = %this.extent.x SPC %this.extent.y;
%this.resize(%position.x, %position.y, %extent.x, %extent.y);
%this.docked = false;
%this.resizing = false;
EditorGui.updateSideBar();
}
function AssetBrowserWindow::onResize(%this, %posX, %posY, %width, %height)
{
if (%width>%height)
- Fixes the display of the preview in the MaterialAsset fields - Hides the special-case direct filepath field for ShapeAsset persist fields macro - Shifts the handling of TSStatics so the shape instance will load materials on the server as well as the client. This opens gameplay options as well as allowing rebaking of meshes functionality more easily - Expands AssetBase's isValidAsset utility function to actually check validity instead of just returning true - Adds isValid utility function to AssetPtr - Added new field flag that makes the field not write out to file - Removed legacy iconBitmap field from GuiIconButtonCtrl because it was causing errors - Fixed group filtering check of guiInspector to ignore case - Removed unneeded isFile checks for common datablock script files in Prototyping module script - Removed test datablocks from Prototyping module - Removed unnecessary container control from AssetBrowser - Adjusted preview regen logic of AssetBrowser so it doesn't trip if you're simply resizing the window - Fixed issue where row-vs-column layout logic for AssetBrowser when resizing window was fiddly - Added handling for when Dragging and Dropping datablock from AssetBrowser to spawn, it'll prompt if it spawns the actual object, or a spawnsphere that spawns said object. In the event of an PlayerData will also prompt if it should spawn an AIPlayer - Added ability to take a TSStatic that uses a baked down mesh and are able to restore it to the cache prefab, or trigger and in-place rebake to refresh it if something has changed in the original contents via RMB menu on the scene tree - Added ability to explode prefab to RMB menu on scene tree - Added ability to convert selection to prefab or bake to mesh in RMB menu on scene tree - Tweaked sizing of the DatablockEditorCreatePrompt window to not have cut off elements and easier to see/work with - Added sanity check to datablock editor creation - Fixed preview display of material in Decal Editor - Made compositeTextureEditor use the cached preview of images - Fixed sizing/spacing of gui selection dropdown as well as resolution dropdown of GuiEditor - Fixes MaterialEditor to properly save the group collapse state when editing - Adds ability to in-flow edit and create datablocks in the NavMesh Editor for the testing panel, and makes the datablock dropdown searchable - Fixed issue where opening the ShapeEditor via the edit button on a ShapeAsset field would cause the action buttons on the top bar to not show - Fixed error in shape editor where when exiting it was erroneously checking for a clear value of -1 rather than 0 - Removed unneeded top tabbook and tab page for main editor panel - Fixed issue where reset button of TerrainBrush Softness Curve editor didn't actually reset - Resized Object Builder window to not cut off elements and have enough width to show more data - Added a TypeCommand field type to Object Builder and changed spawnscript field of SpawnSphere to use it rather than a simple text edit field - Allow SpawnSphere in ObjectBuilder to be passed in spawn class and spawn datablock default info - Injects button to controllable objects when Inspecting them to make it easy to toggle if you're in control of it or not -
2025-08-26 04:35:28 +00:00
{
AssetBrowser-->assetList.fillRowFirst = true;
- Fixes the display of the preview in the MaterialAsset fields - Hides the special-case direct filepath field for ShapeAsset persist fields macro - Shifts the handling of TSStatics so the shape instance will load materials on the server as well as the client. This opens gameplay options as well as allowing rebaking of meshes functionality more easily - Expands AssetBase's isValidAsset utility function to actually check validity instead of just returning true - Adds isValid utility function to AssetPtr - Added new field flag that makes the field not write out to file - Removed legacy iconBitmap field from GuiIconButtonCtrl because it was causing errors - Fixed group filtering check of guiInspector to ignore case - Removed unneeded isFile checks for common datablock script files in Prototyping module script - Removed test datablocks from Prototyping module - Removed unnecessary container control from AssetBrowser - Adjusted preview regen logic of AssetBrowser so it doesn't trip if you're simply resizing the window - Fixed issue where row-vs-column layout logic for AssetBrowser when resizing window was fiddly - Added handling for when Dragging and Dropping datablock from AssetBrowser to spawn, it'll prompt if it spawns the actual object, or a spawnsphere that spawns said object. In the event of an PlayerData will also prompt if it should spawn an AIPlayer - Added ability to take a TSStatic that uses a baked down mesh and are able to restore it to the cache prefab, or trigger and in-place rebake to refresh it if something has changed in the original contents via RMB menu on the scene tree - Added ability to explode prefab to RMB menu on scene tree - Added ability to convert selection to prefab or bake to mesh in RMB menu on scene tree - Tweaked sizing of the DatablockEditorCreatePrompt window to not have cut off elements and easier to see/work with - Added sanity check to datablock editor creation - Fixed preview display of material in Decal Editor - Made compositeTextureEditor use the cached preview of images - Fixed sizing/spacing of gui selection dropdown as well as resolution dropdown of GuiEditor - Fixes MaterialEditor to properly save the group collapse state when editing - Adds ability to in-flow edit and create datablocks in the NavMesh Editor for the testing panel, and makes the datablock dropdown searchable - Fixed issue where opening the ShapeEditor via the edit button on a ShapeAsset field would cause the action buttons on the top bar to not show - Fixed error in shape editor where when exiting it was erroneously checking for a clear value of -1 rather than 0 - Removed unneeded top tabbook and tab page for main editor panel - Fixed issue where reset button of TerrainBrush Softness Curve editor didn't actually reset - Resized Object Builder window to not cut off elements and have enough width to show more data - Added a TypeCommand field type to Object Builder and changed spawnscript field of SpawnSphere to use it rather than a simple text edit field - Allow SpawnSphere in ObjectBuilder to be passed in spawn class and spawn datablock default info - Injects button to controllable objects when Inspecting them to make it easy to toggle if you're in control of it or not -
2025-08-26 04:35:28 +00:00
AssetBrowser-->assetList.extent.x = AssetListPanel.extent.x;
}
else
- Fixes the display of the preview in the MaterialAsset fields - Hides the special-case direct filepath field for ShapeAsset persist fields macro - Shifts the handling of TSStatics so the shape instance will load materials on the server as well as the client. This opens gameplay options as well as allowing rebaking of meshes functionality more easily - Expands AssetBase's isValidAsset utility function to actually check validity instead of just returning true - Adds isValid utility function to AssetPtr - Added new field flag that makes the field not write out to file - Removed legacy iconBitmap field from GuiIconButtonCtrl because it was causing errors - Fixed group filtering check of guiInspector to ignore case - Removed unneeded isFile checks for common datablock script files in Prototyping module script - Removed test datablocks from Prototyping module - Removed unnecessary container control from AssetBrowser - Adjusted preview regen logic of AssetBrowser so it doesn't trip if you're simply resizing the window - Fixed issue where row-vs-column layout logic for AssetBrowser when resizing window was fiddly - Added handling for when Dragging and Dropping datablock from AssetBrowser to spawn, it'll prompt if it spawns the actual object, or a spawnsphere that spawns said object. In the event of an PlayerData will also prompt if it should spawn an AIPlayer - Added ability to take a TSStatic that uses a baked down mesh and are able to restore it to the cache prefab, or trigger and in-place rebake to refresh it if something has changed in the original contents via RMB menu on the scene tree - Added ability to explode prefab to RMB menu on scene tree - Added ability to convert selection to prefab or bake to mesh in RMB menu on scene tree - Tweaked sizing of the DatablockEditorCreatePrompt window to not have cut off elements and easier to see/work with - Added sanity check to datablock editor creation - Fixed preview display of material in Decal Editor - Made compositeTextureEditor use the cached preview of images - Fixed sizing/spacing of gui selection dropdown as well as resolution dropdown of GuiEditor - Fixes MaterialEditor to properly save the group collapse state when editing - Adds ability to in-flow edit and create datablocks in the NavMesh Editor for the testing panel, and makes the datablock dropdown searchable - Fixed issue where opening the ShapeEditor via the edit button on a ShapeAsset field would cause the action buttons on the top bar to not show - Fixed error in shape editor where when exiting it was erroneously checking for a clear value of -1 rather than 0 - Removed unneeded top tabbook and tab page for main editor panel - Fixed issue where reset button of TerrainBrush Softness Curve editor didn't actually reset - Resized Object Builder window to not cut off elements and have enough width to show more data - Added a TypeCommand field type to Object Builder and changed spawnscript field of SpawnSphere to use it rather than a simple text edit field - Allow SpawnSphere in ObjectBuilder to be passed in spawn class and spawn datablock default info - Injects button to controllable objects when Inspecting them to make it easy to toggle if you're in control of it or not -
2025-08-26 04:35:28 +00:00
{
AssetBrowser-->assetList.fillRowFirst = false;
- Fixes the display of the preview in the MaterialAsset fields - Hides the special-case direct filepath field for ShapeAsset persist fields macro - Shifts the handling of TSStatics so the shape instance will load materials on the server as well as the client. This opens gameplay options as well as allowing rebaking of meshes functionality more easily - Expands AssetBase's isValidAsset utility function to actually check validity instead of just returning true - Adds isValid utility function to AssetPtr - Added new field flag that makes the field not write out to file - Removed legacy iconBitmap field from GuiIconButtonCtrl because it was causing errors - Fixed group filtering check of guiInspector to ignore case - Removed unneeded isFile checks for common datablock script files in Prototyping module script - Removed test datablocks from Prototyping module - Removed unnecessary container control from AssetBrowser - Adjusted preview regen logic of AssetBrowser so it doesn't trip if you're simply resizing the window - Fixed issue where row-vs-column layout logic for AssetBrowser when resizing window was fiddly - Added handling for when Dragging and Dropping datablock from AssetBrowser to spawn, it'll prompt if it spawns the actual object, or a spawnsphere that spawns said object. In the event of an PlayerData will also prompt if it should spawn an AIPlayer - Added ability to take a TSStatic that uses a baked down mesh and are able to restore it to the cache prefab, or trigger and in-place rebake to refresh it if something has changed in the original contents via RMB menu on the scene tree - Added ability to explode prefab to RMB menu on scene tree - Added ability to convert selection to prefab or bake to mesh in RMB menu on scene tree - Tweaked sizing of the DatablockEditorCreatePrompt window to not have cut off elements and easier to see/work with - Added sanity check to datablock editor creation - Fixed preview display of material in Decal Editor - Made compositeTextureEditor use the cached preview of images - Fixed sizing/spacing of gui selection dropdown as well as resolution dropdown of GuiEditor - Fixes MaterialEditor to properly save the group collapse state when editing - Adds ability to in-flow edit and create datablocks in the NavMesh Editor for the testing panel, and makes the datablock dropdown searchable - Fixed issue where opening the ShapeEditor via the edit button on a ShapeAsset field would cause the action buttons on the top bar to not show - Fixed error in shape editor where when exiting it was erroneously checking for a clear value of -1 rather than 0 - Removed unneeded top tabbook and tab page for main editor panel - Fixed issue where reset button of TerrainBrush Softness Curve editor didn't actually reset - Resized Object Builder window to not cut off elements and have enough width to show more data - Added a TypeCommand field type to Object Builder and changed spawnscript field of SpawnSphere to use it rather than a simple text edit field - Allow SpawnSphere in ObjectBuilder to be passed in spawn class and spawn datablock default info - Injects button to controllable objects when Inspecting them to make it easy to toggle if you're in control of it or not -
2025-08-26 04:35:28 +00:00
AssetBrowser-->assetList.extent.y = AssetListPanel.extent.y;
}
//AssetBrowser.rebuildAssetArray();
}