From d840d5203899eb709f7d595ba9a385b6008405fe Mon Sep 17 00:00:00 2001 From: Areloch Date: Thu, 9 Jan 2020 18:28:53 -0600 Subject: [PATCH] Added asset import logging Added WIP of lighting viz logic to point and spotlight shaders Made new asset window adhere to path-based system Ongoing work to standardize asset import actions Context-based Asset Import popups Fixed behavior with adding a new sequence in shape editor Made it so apply in PostFX editor no longer closes window Work to re-add class visibility filters in editor --- Engine/source/scene/sceneObject.cpp | 2 +- Engine/source/scene/sceneObject.h | 12 +- .../lighting/advanced/pointLightP.hlsl | 29 ++ .../shaders/lighting/advanced/spotLightP.hlsl | 29 ++ .../tools/assetBrowser/assetImportConfigs.xml | 2 +- .../tools/assetBrowser/guis/assetImport.gui | 32 ++- .../assetBrowser/guis/assetImportLog.gui | 119 ++++++++ .../game/tools/assetBrowser/guis/newAsset.gui | 176 ++++++------ .../BaseGame/game/tools/assetBrowser/main.cs | 42 +-- .../assetBrowser/scripts/addModuleWindow.cs | 3 +- .../assetBrowser/scripts/assetBrowser.cs | 3 - .../tools/assetBrowser/scripts/assetImport.cs | 267 +++++++++++------- .../assetBrowser/scripts/assetImportConfig.cs | 33 ++- .../scripts/assetTypes/datablockObjects.cs | 0 .../assetBrowser/scripts/assetTypes/image.cs | 11 +- .../scripts/assetTypes/material.cs | 24 ++ .../assetBrowser/scripts/assetTypes/prefab.cs | 0 .../assetBrowser/scripts/assetTypes/shape.cs | 42 +-- .../tools/assetBrowser/scripts/newAsset.cs | 14 +- .../tools/assetBrowser/scripts/popupMenus.cs | 27 +- .../BaseGame/game/tools/gui/postFxEditor.gui | 2 +- .../BaseGame/game/tools/gui/profiles.ed.cs | 2 + .../shapeEditor/scripts/shapeEditor.ed.cs | 6 +- .../scripts/visibility/visibilityLayer.ed.cs | 17 +- 24 files changed, 613 insertions(+), 281 deletions(-) create mode 100644 Templates/BaseGame/game/tools/assetBrowser/guis/assetImportLog.gui create mode 100644 Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/datablockObjects.cs create mode 100644 Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/prefab.cs diff --git a/Engine/source/scene/sceneObject.cpp b/Engine/source/scene/sceneObject.cpp index 8a0aa4589..897a2035b 100644 --- a/Engine/source/scene/sceneObject.cpp +++ b/Engine/source/scene/sceneObject.cpp @@ -955,7 +955,7 @@ void SceneObject::_updateZoningState() const //----------------------------------------------------------------------------- -U32 SceneObject::_getCurrZone( const U32 index ) const +U32 SceneObject::getCurrZone( const U32 index ) const { _updateZoningState(); diff --git a/Engine/source/scene/sceneObject.h b/Engine/source/scene/sceneObject.h index 1bafc3b83..d0bb1130e 100644 --- a/Engine/source/scene/sceneObject.h +++ b/Engine/source/scene/sceneObject.h @@ -282,12 +282,6 @@ class SceneObject : public NetObject, private SceneContainer::Link, public Proce /// of the object is dirty, the list contents may be outdated. ZoneRef* _getZoneRefHead() const { return mZoneRefHead; } - /// Gets the number of zones containing this object. - U32 _getNumCurrZones() const { return mNumCurrZones; } - - /// Returns the nth zone containing this object. - U32 _getCurrZone( const U32 index ) const; - /// @} /// @name Transform and Collision Members @@ -749,6 +743,12 @@ class SceneObject : public NetObject, private SceneContainer::Link, public Proce void setLightingPlugin( SceneObjectLightingPlugin* plugin ) { mLightPlugin = plugin; } SceneObjectLightingPlugin* getLightingPlugin() { return mLightPlugin; } + /// Gets the number of zones containing this object. + U32 getNumCurrZones() const { return mNumCurrZones; } + + /// Returns the nth zone containing this object. + U32 getCurrZone(const U32 index) const; + /// @} /// @name Global Bounds diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/pointLightP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/pointLightP.hlsl index 27f84b061..fcfc0c59e 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/pointLightP.hlsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/pointLightP.hlsl @@ -198,6 +198,35 @@ float4 main( ConvexConnectP IN ) : SV_TARGET lightCol *= max(cookie.r, max(cookie.g, cookie.b)); #endif + #ifdef DIFFUSE_LIGHT_VIZ + float attenuation = getDistanceAtt(surfaceToLight.Lu, radius); + float3 factor = lightColor * max(surfaceToLight.NdotL, 0) * shadow * lightIntensity * attenuation; + + float3 diffuse = BRDF_GetDebugDiffuse(surface,surfaceToLight) * factor; + float3 final = max(0.0f, diffuse); + return float4(final, 0); + #endif + + #ifdef SPECULAR_LIGHT_VIZ + float attenuation = getDistanceAtt(surfaceToLight.Lu, radius); + float3 factor = lightColor * max(surfaceToLight.NdotL, 0) * shadow * lightIntensity * attenuation; + + float3 diffuse = BRDF_GetDebugSpecular(surface,surfaceToLight) * factor; + float3 final = max(0.0f, diffuse); + return float4(final, 0); + #endif + + #ifdef DETAIL_LIGHTING_VIZ + float attenuation = getDistanceAtt(surfaceToLight.Lu, radius); + vec3 factor = lightColor * max(surfaceToLight.NdotL, 0) * shadow * lightIntensity * attenuation; + + vec3 diffuse = BRDF_GetDiffuse(surface,surfaceToLight) * factor; + vec3 spec = BRDF_GetSpecular(surface,surfaceToLight) * factor; + + vec3 final = max(vec3(0.0f), diffuse + spec * surface.F); + return final; + #endif + //get punctual light contribution lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadowed); } diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/spotLightP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/spotLightP.hlsl index f8ec741ed..940e8f06d 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/spotLightP.hlsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/spotLightP.hlsl @@ -128,6 +128,35 @@ float4 main( ConvexConnectP IN ) : SV_TARGET lightCol *= max(cookie.r, max(cookie.g, cookie.b)); #endif + #ifdef DIFFUSE_LIGHT_VIZ + float attenuation = getDistanceAtt(surfaceToLight.Lu, radius); + float3 factor = lightColor * max(surfaceToLight.NdotL, 0) * shadow * lightIntensity * attenuation; + + float3 diffuse = BRDF_GetDebugDiffuse(surface,surfaceToLight) * factor; + float3 final = max(0.0f, diffuse) * getSpotAngleAtt(-surfaceToLight.L, lightDirection, lightSpotParams ); + return float4(final, 0); + #endif + + #ifdef SPECULAR_LIGHT_VIZ + float attenuation = getDistanceAtt(surfaceToLight.Lu, radius); + float3 factor = lightColor * max(surfaceToLight.NdotL, 0) * shadow * lightIntensity * attenuation; + + float3 diffuse = BRDF_GetDebugSpecular(surface,surfaceToLight) * factor; + float3 final = max(0.0f, diffuse) * getSpotAngleAtt(-surfaceToLight.L, lightDirection, lightSpotParams ); + return float4(final, 0); + #endif + + #ifdef DETAIL_LIGHTING_VIZ + float attenuation = getDistanceAtt(surfaceToLight.Lu, radius); + vec3 factor = lightColor * max(surfaceToLight.NdotL, 0) * shadow * lightIntensity * attenuation; + + vec3 diffuse = BRDF_GetDiffuse(surface,surfaceToLight) * factor; + vec3 spec = BRDF_GetSpecular(surface,surfaceToLight) * factor; + + vec3 final = max(vec3(0.0f), diffuse + spec * surface.F) * getSpotAngleAtt(-surfaceToLight.L, lightDirection, lightSpotParams ); + return final; + #endif + //get Punctual light contribution lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadowed); //get spot angle attenuation diff --git a/Templates/BaseGame/game/tools/assetBrowser/assetImportConfigs.xml b/Templates/BaseGame/game/tools/assetBrowser/assetImportConfigs.xml index 71d78379f..3bbd75af6 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/assetImportConfigs.xml +++ b/Templates/BaseGame/game/tools/assetBrowser/assetImportConfigs.xml @@ -6,6 +6,7 @@ 1 1 1 + 1 0 @@ -34,7 +35,6 @@ _NORMAL,_NORM _AO,_AMBIENT,_AMBIENTOCCLUSION _METAL,_MET,_METALNESS,_METALLIC - 1 _COMP,_COMPOSITE _ROUGH,_ROUGHNESS N/A diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/assetImport.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/assetImport.gui index db0d3137b..d7b4f6f94 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/assetImport.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/assetImport.gui @@ -503,25 +503,29 @@ canSave = "1"; canSaveDynamicFields = "0"; }; - new GuiTextCtrl(AssetImportSummarization) { - maxLength = "1024"; - margin = "0 0 0 0"; - padding = "0 0 0 0"; - anchorTop = "1"; - anchorBottom = "0"; - anchorLeft = "1"; - anchorRight = "0"; - position = "4 554"; - extent = "574 23"; + new GuiBitmapButtonCtrl(ImportLogButton) { + bitmap = "tools/gui/images/iconInformation.png"; + bitmapMode = "Centered"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "5 555"; + extent = "22 22"; minExtent = "8 2"; - horizSizing = "width"; - vertSizing = "top"; - profile = "ToolsGuiTextProfile"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "ToolsGuiButtonProfile"; visible = "1"; active = "1"; + command = "ImportAssetWindow.toggleLogWindow();"; tooltipProfile = "GuiToolTipProfile"; + tooltip = "View Import Log"; hovertime = "1000"; - isContainer = "1"; + isContainer = "0"; canSave = "1"; canSaveDynamicFields = "0"; }; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/assetImportLog.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/assetImportLog.gui new file mode 100644 index 000000000..14935f2b1 --- /dev/null +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/assetImportLog.gui @@ -0,0 +1,119 @@ +//--- OBJECT WRITE BEGIN --- +%guiContent = new GuiControl(AssetBrowserImportLog) { + position = "0 0"; + extent = "1024 768"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultNonModalProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "1"; + + new GuiWindowCtrl(AssetBrowserImportLogWindow) { + text = "Import Log"; + resizeWidth = "1"; + resizeHeight = "1"; + canMove = "1"; + canClose = "1"; + canMinimize = "0"; + canMaximize = "0"; + canCollapse = "0"; + closeCommand = "Canvas.popDialog(AssetBrowserImportLog);"; + edgeSnap = "1"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "178 113"; + extent = "649 528"; + minExtent = "48 92"; + horizSizing = "center"; + vertSizing = "center"; + profile = "ToolsGuiWindowProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiScrollCtrl() { + willFirstRespond = "1"; + hScrollBar = "alwaysOn"; + vScrollBar = "alwaysOn"; + lockHorizScroll = "0"; + lockVertScroll = "0"; + constantThumbHeight = "0"; + childMargin = "0 0"; + mouseWheelScrollSpeed = "-1"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "7 25"; + extent = "635 468"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "height"; + profile = "ToolsGuiScrollProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiTextListCtrl(ImportLogTextList) { + columns = "0"; + fitParentWidth = "1"; + clipColumnText = "0"; + rowHeightPadding = "2"; + position = "1 1"; + extent = "620 2"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "height"; + profile = "ToolsGuiTextEditProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + new GuiButtonCtrl() { + text = "Cancel"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "576 497"; + extent = "64 22"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "top"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "Canvas.popDialog(AssetBrowserImportLog);"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; +}; +//--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/newAsset.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/newAsset.gui index b84405161..e7efb40d4 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/newAsset.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/newAsset.gui @@ -45,78 +45,8 @@ canSave = "1"; canSaveDynamicFields = "0"; - new GuiButtonCtrl(NewAssetCreateBtn) { - text = "Done"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - position = "227 419"; - extent = "64 22"; - minExtent = "8 2"; - horizSizing = "right"; - vertSizing = "bottom"; - profile = "ToolsGuiButtonProfile"; - visible = "1"; - active = "1"; - command = "CreateNewAsset();"; - tooltipProfile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - isContainer = "0"; - canSave = "1"; - canSaveDynamicFields = "0"; - }; - new GuiBitmapButtonCtrl() { - bitmap = "tools/gui/images/iconOpen.png"; - bitmapMode = "Centered"; - autoFitExtents = "0"; - useModifiers = "0"; - useStates = "1"; - masked = "0"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - position = "342 27"; - extent = "22 22"; - minExtent = "8 2"; - horizSizing = "left"; - vertSizing = "bottom"; - profile = "ToolsGuiButtonProfile"; - visible = "1"; - active = "1"; - command = "SelectAssetPath.showDialog(AssetBrowser.dirHandler.currentAddress, \"newAssetUpdatePath\");\nSelectAssetPathWindow.selectWindow();"; - tooltipProfile = "GuiToolTipProfile"; - tooltip = "New Module"; - hovertime = "1000"; - isContainer = "0"; - canSave = "1"; - canSaveDynamicFields = "0"; - }; - new GuiButtonCtrl() { - text = "Cancel"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - position = "295 419"; - extent = "64 22"; - minExtent = "8 2"; - horizSizing = "right"; - vertSizing = "bottom"; - profile = "ToolsGuiButtonProfile"; - visible = "1"; - active = "1"; - command = "AssetBrowser_newAssetWindow.onClose();"; - tooltipProfile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - isContainer = "0"; - canSave = "1"; - canSaveDynamicFields = "0"; - }; - new GuiTextEditCtrl(NewAssetTargetAddress) { - historySize = "0"; - tabComplete = "0"; - sinkAllKeyEvents = "0"; - password = "0"; - passwordMask = "*"; + new GuiTextCtrl() { + text = "Target Module:"; maxLength = "1024"; margin = "0 0 0 0"; padding = "0 0 0 0"; @@ -124,14 +54,14 @@ anchorBottom = "0"; anchorLeft = "1"; anchorRight = "0"; - position = "135 30"; - extent = "204 18"; + position = "12 54"; + extent = "116 17"; minExtent = "8 2"; - horizSizing = "width"; + horizSizing = "right"; vertSizing = "bottom"; - profile = "ToolsGuiTextEditProfile"; + profile = "ToolsGuiTextProfile"; visible = "1"; - active = "0"; + active = "1"; tooltipProfile = "GuiToolTipProfile"; hovertime = "1000"; isContainer = "1"; @@ -161,8 +91,12 @@ canSave = "1"; canSaveDynamicFields = "0"; }; - new GuiTextCtrl() { - text = "Target Module:"; + new GuiTextEditCtrl(NewAssetTargetAddress) { + historySize = "0"; + tabComplete = "0"; + sinkAllKeyEvents = "0"; + password = "0"; + passwordMask = "*"; maxLength = "1024"; margin = "0 0 0 0"; padding = "0 0 0 0"; @@ -170,20 +104,46 @@ anchorBottom = "0"; anchorLeft = "1"; anchorRight = "0"; - position = "12 54"; - extent = "116 17"; + position = "135 30"; + extent = "201 18"; minExtent = "8 2"; - horizSizing = "right"; + horizSizing = "width"; vertSizing = "bottom"; - profile = "ToolsGuiTextProfile"; + profile = "ToolsGuiTextEditProfile"; visible = "1"; - active = "1"; + active = "0"; tooltipProfile = "GuiToolTipProfile"; hovertime = "1000"; isContainer = "1"; canSave = "1"; canSaveDynamicFields = "0"; }; + new GuiBitmapButtonCtrl() { + bitmap = "tools/gui/images/iconOpen.png"; + bitmapMode = "Centered"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "343 27"; + extent = "22 22"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "SelectAssetPath.showDialog(AssetBrowser.dirHandler.currentAddress, \"newAssetUpdatePath\");\nSelectAssetPathWindow.selectWindow();"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "New Module"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; new GuiTextEditCtrl(NewAssetTargetModule) { historySize = "0"; tabComplete = "0"; @@ -198,7 +158,7 @@ anchorLeft = "1"; anchorRight = "0"; position = "135 53"; - extent = "204 18"; + extent = "202 18"; minExtent = "8 2"; horizSizing = "width"; vertSizing = "bottom"; @@ -229,7 +189,7 @@ position = "7 79"; extent = "354 334"; minExtent = "8 2"; - horizSizing = "right"; + horizSizing = "width"; vertSizing = "bottom"; profile = "ToolsGuiScrollProfile"; visible = "1"; @@ -255,8 +215,8 @@ position = "1 1"; extent = "337 338"; minExtent = "16 16"; - horizSizing = "right"; - vertSizing = "bottom"; + horizSizing = "width"; + vertSizing = "height"; profile = "GuiDefaultProfile"; visible = "1"; active = "1"; @@ -267,6 +227,46 @@ canSaveDynamicFields = "0"; }; }; + new GuiButtonCtrl(NewAssetCreateBtn) { + text = "Done"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "227 419"; + extent = "64 22"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "top"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "CreateNewAsset();"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + text = "Cancel"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "295 419"; + extent = "64 22"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "top"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "AssetBrowser_newAssetWindow.onClose();"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; }; }; //--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/tools/assetBrowser/main.cs b/Templates/BaseGame/game/tools/assetBrowser/main.cs index e89105474..a362f3a5e 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/main.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/main.cs @@ -38,23 +38,23 @@ function initializeAssetBrowser() new ArrayObject(AssetFilterTypeList); AssetFilterTypeList.add("All"); - AssetFilterTypeList.add("Component"); - AssetFilterTypeList.add("Cpp"); - AssetFilterTypeList.add("Cubemap"); - AssetFilterTypeList.add("GameObject"); - AssetFilterTypeList.add("GUI"); - AssetFilterTypeList.add("Image"); - AssetFilterTypeList.add("Level"); - AssetFilterTypeList.add("Material"); - AssetFilterTypeList.add("Particle"); - AssetFilterTypeList.add("PostFX"); - AssetFilterTypeList.add("Script"); - AssetFilterTypeList.add("Shape"); - AssetFilterTypeList.add("ShapeAnimation"); - AssetFilterTypeList.add("Sound"); - AssetFilterTypeList.add("StateMachine"); - AssetFilterTypeList.add("Terrain"); - AssetFilterTypeList.add("TerrainMaterial"); + AssetFilterTypeList.add("ComponentAsset"); + AssetFilterTypeList.add("CppAsset"); + AssetFilterTypeList.add("CubemapAsset"); + AssetFilterTypeList.add("GameObjectAsset"); + AssetFilterTypeList.add("GUIAsset"); + AssetFilterTypeList.add("ImageAsset"); + AssetFilterTypeList.add("LevelAsset"); + AssetFilterTypeList.add("MaterialAsset"); + AssetFilterTypeList.add("ParticleAsset"); + AssetFilterTypeList.add("PostFXAsset"); + AssetFilterTypeList.add("ScriptAsset"); + AssetFilterTypeList.add("ShapeAsset"); + AssetFilterTypeList.add("ShapeAnimationAsset"); + AssetFilterTypeList.add("SoundAsset"); + AssetFilterTypeList.add("StateMachineAsset"); + AssetFilterTypeList.add("TerrainAsset"); + AssetFilterTypeList.add("TerrainMaterialAsset"); } exec("./guis/assetBrowser.gui"); @@ -71,6 +71,7 @@ function initializeAssetBrowser() exec("./guis/importTemplateModules.gui"); exec("./guis/assetPreviewButtonsTemplate.gui"); exec("./guis/newFolder.gui"); + exec("./guis/assetImportLog.gui"); exec("./scripts/assetBrowser.cs"); exec("./scripts/popupMenus.cs"); @@ -127,6 +128,13 @@ function initializeAssetBrowser() if(!isObject(ImportAssetTree)) new GuiTreeViewCtrl(ImportAssetTree); + + if(!isObject(ImportActivityLog)) + new ArrayObject(ImportActivityLog); + + ImportAssetWindow.importingFilesArray = new ArrayObject(); + ImportAssetWindow.importAssetUnprocessedListArray = new ArrayObject(); + ImportAssetWindow.importAssetFinalListArray = new ArrayObject(); AssetBrowser.buildPopupMenus(); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/addModuleWindow.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/addModuleWindow.cs index 56c00d6db..7c0692ee6 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/addModuleWindow.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/addModuleWindow.cs @@ -96,8 +96,7 @@ function AssetBrowser_addModuleWindow::CreateNewModule(%this) ModuleDatabase.ignoreLoadedGroups(false); //force a reload of the Module lists - GameObjectModuleList.refresh(); - ImportAssetModuleList.refresh(); + AssetBrowser.refresh(); AssetBrowser.newModuleId = %newModuleName; diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs index 7440f512e..5107cf9ca 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs @@ -47,9 +47,6 @@ function AssetBrowser::onWake(%this) AssetBrowser-->filterTree.buildIconTable( ":tools/classIcons/Prefab:tools/classIcons/Prefab" @ ":tools/classIcons/SimSet:tools/classIcons/SimSet"); - %this.importingFilesArray = new ArrayObject(); - %this.importAssetUnprocessedListArray = new ArrayObject(); - %this.importAssetFinalListArray = new ArrayObject(); %this.isReImportingAsset = false; %this.coreModulesFilter = false; diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs index 8f31d6985..3165c09d4 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs @@ -77,8 +77,8 @@ function AssetBrowser::onBeginDropFiles( %this ) return; error("% DragDrop - Beginning files dropping."); - %this.importAssetUnprocessedListArray.empty(); - %this.importAssetFinalListArray.empty(); + ImportAssetWindow.importAssetUnprocessedListArray.empty(); + ImportAssetWindow.importAssetFinalListArray.empty(); ImportAssetWindow.assetHeirarchyChanged = false; @@ -99,23 +99,23 @@ function AssetBrowser::onDropFile( %this, %filePath ) %fileExt = fileExt( %filePath ); //add it to our array! if(isImageFormat(%fileExt)) - %this.addImportingAsset("Image", %filePath); + %this.addImportingAsset("ImageAsset", %filePath); else if( isShapeFormat(%fileExt)) - %this.addImportingAsset("Model", %filePath); + %this.addImportingAsset("ShapeAsset", %filePath); else if( isSoundFormat(%fileExt)) - %this.addImportingAsset("Sound", %filePath); + %this.addImportingAsset("SoundAsset", %filePath); else if( %fileExt $= ".cs" || %fileExt $= ".cs.dso" ) - %this.addImportingAsset("Script", %filePath); + %this.addImportingAsset("ScriptAsset", %filePath); else if( %fileExt $= ".gui" || %fileExt $= ".gui.dso" ) - %this.addImportingAsset("GUI", %filePath); + %this.addImportingAsset("GUIAsset", %filePath); else if (%fileExt $= ".zip") %this.onDropZipFile(%filePath); //Used to keep tabs on what files we were trying to import, used mainly in the event of //adjusting configs and needing to completely reprocess the import //ensure we're not doubling-up on files by accident - if(%this.importingFilesArray.getIndexFromKey(%filePath) == -1) - %this.importingFilesArray.add(%filePath); + if(ImportAssetWindow.importingFilesArray.getIndexFromKey(%filePath) == -1) + ImportAssetWindow.importingFilesArray.add(%filePath); } function AssetBrowser::onDropZipFile(%this, %filePath) @@ -140,17 +140,17 @@ function AssetBrowser::onDropZipFile(%this, %filePath) //If not modules, it's likely an art pack or other mixed files, so we'll import them as normal if( (%fileExt $= ".png") || (%fileExt $= ".jpg") || (%fileExt $= ".bmp") || (%fileExt $= ".dds") ) - %this.importAssetListArray.add("Image", %filePath); + %this.importAssetListArray.add("ImageAsset", %filePath); else if( (%fileExt $= ".dae") || (%fileExt $= ".dts")) - %this.importAssetListArray.add("Model", %filePath); + %this.importAssetListArray.add("ShapeAsset", %filePath); else if( (%fileExt $= ".ogg") || (%fileExt $= ".wav") || (%fileExt $= ".mp3")) - %this.importAssetListArray.add("Sound", %filePath); + %this.importAssetListArray.add("SoundAsset", %filePath); else if( (%fileExt $= ".gui") || (%fileExt $= ".gui.dso")) - %this.importAssetListArray.add("GUI", %filePath); + %this.importAssetListArray.add("GUIAsset", %filePath); //else if( (%fileExt $= ".cs") || (%fileExt $= ".dso")) // %this.importAssetListArray.add("Script", %filePath); else if( (%fileExt $= ".mis")) - %this.importAssetListArray.add("Level", %filePath); + %this.importAssetListArray.add("LevelAsset", %filePath); // For now, if it's a .cs file, we'll assume it's a behavior. if (fileExt(%fileFrom) !$= ".cs") @@ -221,9 +221,9 @@ function AssetBrowser::reloadImportingFiles(%this) //Effectively, we re-import the files we were trying to originally. We'd only usually do this in the event we change our import config %this.onBeginDropFiles(); - for(%i=0; %i < %this.importingFilesArray.count(); %i++) + for(%i=0; %i < ImportAssetWindow.importingFilesArray.count(); %i++) { - %this.onDropFile(%this.importingFilesArray.getKey(%i)); + %this.onDropFile(ImportAssetWindow.importingFilesArray.getKey(%i)); } %this.onEndDropFiles(); @@ -296,53 +296,26 @@ function AssetBrowser::addImportingAsset( %this, %assetType, %filePath, %parentA processed = false; generatedAsset = false; }; - - //little bit of interception here - /*if(%assetItem.assetType $= "Model") - { - %fileExt = fileExt(%assetItem.filePath); - %shapeInfo = new GuiTreeViewCtrl(); - if(%fileExt $= ".dae") - { - enumColladaForImport(%assetItem.filePath, %shapeInfo, false); - } - else if(%fileExt $= ".dts") - { - %shapeInfo.insertItem(0, "Shape", 1); - %shapeInfo.insertItem(0, "Animations", 0); - } - else - { - %success = GetShapeInfo(%assetItem.filePath, %shapeInfo); - } - - %assetItem.shapeInfo = %shapeInfo; - - %shapeCount = %assetItem.shapeInfo._meshCount; - - %animCount = %assetItem.shapeInfo._animCount; - - //If the model has shapes AND animations, then it's a normal shape with embedded animations - //if it has shapes and no animations it's a regular static mesh - //if it has no shapes and animations, it's a special case. This means it's a shape animation only file so it gets flagged as special - if(%shapeCount == 0 && %animCount != 0) - { - %assetItem.assetType = "Animation"; - } - else if(%shapeCount == 0 && %animCount == 0) - { - //either it imported wrong or it's a bad file we can't read. Either way, don't try importing it - error("Error - attempted to import a model file with no shapes or animations! Model in question was: " @ %filePath); - - %assetItem.delete(); - return 0; - } - }*/ - if(%assetType $= "Material") + if(%parentAssetItem !$= "") + { + ImportActivityLog.add("Added Child Importing Asset to " @ %parentAssetItem.assetName); + } + else + { + ImportActivityLog.add("Added Importing Asset"); + } + + ImportActivityLog.add(" Asset Info: Name: " @ %assetName @ " | Type: " @ %assetType); + + if(%assetType $= "MaterialAsset") { %assetItem.generatedAsset = true; } + else + { + ImportActivityLog.add(" File: " @ %filePath); + } if(%parentAssetItem $= "") { @@ -405,7 +378,9 @@ function AssetBrowser::importNewAssetFile(%this) // function ImportAssetButton::onClick(%this) { - ImportAssetsPopup.showPopup(Canvas); + //ImportAssetsPopup.showPopup(Canvas); + + Canvas.pushDialog(AssetImportCtrl); } // @@ -443,6 +418,8 @@ function ImportAssetWindow::onWake(%this) AssetImportTargetAddress.text = AssetBrowser.dirHandler.currentAddress; AssetImportTargetModule.text = AssetBrowser.dirHandler.getModuleFromAddress(AssetBrowser.dirHandler.currentAddress).ModuleId; ImportAssetConfigList.setSelected(0); + + ImportActivityLog.empty(); } function ImportAssetWindow::reloadImportOptionConfigs(%this) @@ -515,7 +492,7 @@ function ImportAssetWindow::processNewImportAssets(%this, %id) //%assetConfigObj.assetName = %assetItem.assetName; - if(%assetItem.assetType $= "Animation") + if(%assetItem.assetType $= "AnimationAsset") { //if we don't have our own file, that means we're gunna be using our parent shape's file so reference that if(!isFile(%assetItem.filePath)) @@ -774,7 +751,7 @@ function ImportAssetWindow::refresh(%this) %id = ImportAssetTree.getChild(1); ImportAssetWindow.assetHeirarchyChanged = false; - AssetBrowser.importAssetFinalListArray.empty(); + ImportAssetWindow.importAssetFinalListArray.empty(); %this.processNewImportAssets(%id); @@ -788,7 +765,7 @@ function ImportAssetWindow::refresh(%this) AssetImportCtrl-->NewAssetsTree.clear(); AssetImportCtrl-->NewAssetsTree.insertItem(0, "Importing Assets"); - if(AssetBrowser.importAssetUnprocessedListArray.count() == 0) + if(ImportAssetWindow.importAssetUnprocessedListArray.count() == 0) { //We've processed them all, prep the assets for actual importing //Initial set of assets @@ -852,7 +829,7 @@ function ImportAssetWindow::refreshChildItem(%this, %id) %toolTip = ""; %configCommand = "ImportAssetOptionsWindow.editImportSettings(" @ %assetItem @ ");"; - if(%assetType $= "Model" || %assetType $= "Animation" || %assetType $= "Image" || %assetType $= "Sound") + if(%assetType $= "ShapeAsset" || %assetType $= "AnimationAsset" || %assetType $= "ImageAsset" || %assetType $= "SoundAsset") { if(%assetItem.status $= "Error") { @@ -890,19 +867,19 @@ function ImportAssetWindow::refreshChildItem(%this, %id) if(%assetItem.status $= "") { - if(%assetType $= "Model") + if(%assetType $= "ShapeAsset") %iconIdx = 1; - else if(%assetType $= "Material") + else if(%assetType $= "MaterialAsset") %iconIdx = 3; - else if(%assetType $= "Image") + else if(%assetType $= "ImageAsset") %iconIdx = 5; - else if(%assetType $= "Sound") + else if(%assetType $= "SoundAsset") %iconIdx = 7; } AssetImportCtrl-->NewAssetsTree.insertItem(%parentItem, %assetName, %assetItem, "", %iconIdx, %iconIdx+1); - AssetBrowser.importAssetFinalListArray.add(%assetItem); + ImportAssetWindow.importAssetFinalListArray.add(%assetItem); if(ImportAssetTree.isParentItem(%id)) { @@ -941,6 +918,12 @@ function NewAssetsViewTree::onSelect(%this, %itemId) AssetImportCtrl-->NewAssetsInspector.endGroup(); AssetImportCtrl-->NewAssetsInspector.setFieldEnabled("assetType", false); + + if(AssetBrowser.isMethod("inspectImporting" @ %assetItem.assetType)) + { + %command = "AssetBrowser.inspectImporting" @ %assetItem.assetType @ "(" @ %assetItem @ ");"; + eval(%command); + } //AssetImportCtrl-->NewAssetsInspector.setFieldEnabled("status", false); /*moduleName = %moduleName; @@ -960,9 +943,33 @@ function NewAssetsViewTree::onRightMouseDown(%this, %itemId) if( %itemId != 1 && %itemId != -1) { - ImportAssetActions.showPopup(Canvas); - ImportAssetActions.assetItem = %this.getItemValue(%itemId); - ImportAssetActions.itemId = %itemId; + %assetItem = %this.getItemValue(%itemId); + + if(%assetItem.assetType $= "MaterialAsset") + { + %contextPopup = ImportAssetMaterialMaps; + + for(%i=0; %i < 7; %i++) + { + %contextPopup.enableItem(%i, true); + } + + if(isObject(%assetItem.diffuseImageAsset)) + %contextPopup.enableItem(0, false); + + if(isObject(%assetItem.normalImageAsset)) + %contextPopup.enableItem(1, false); + + if(isObject(%assetItem.compositeImageAsset)) + %contextPopup.enableItem(2, false); + } + else + { + %contextPopup = ImportAssetActions; + } + %contextPopup.showPopup(Canvas); + %contextPopup.assetItem = %assetItem; + %contextPopup.itemId = %itemId; } else { @@ -979,18 +986,37 @@ function NewAssetsPanelInputs::onRightMouseDown(%this) // function ImportAssetWindow::removeImportingAsset(%this) { + ImportActivityLog.add("Removing Asset from Import"); + ImportAssetTree.removeAllChildren(ImportAssetActions.itemId); ImportAssetTree.removeItem(ImportAssetActions.itemId); ImportAssetWindow.refresh(); } -function ImportAssetWindow::addNewImportingAsset(%this) +function ImportAssetWindow::addNewImportingAsset(%this, %filterType) { + %filter = "Any Files (*.*)|*.*|"; + + if(%filterType $= "Sound" || %filterType $= "") + %filter = "Sound Files(*.wav, *.ogg)|*.wav;*.ogg|" @ %filter; + if(%filterType $= "Image" || %filterType $= "") + %filter = "Images Files(*.jpg,*.png,*.tga,*.bmp,*.dds)|*.jpg;*.png;*.tga;*.bmp;*.dds|" @ %filter; + if(%filterType $= "Shape" || %filterType $= "") + %filter = "Shape Files(*.dae, *.cached.dts)|*.dae;*.cached.dts|" @ %filter; + + //get our item depending on which action we're trying for + if(ImportAssetActions.visible) + %parentAssetItem = ImportAssetActions.assetItem; + else if(ImportAssetMaterialMaps.visible) + %parentAssetItem = ImportAssetMaterialMaps.assetItem; + + %defaultPath = filePath(%parentAssetItem.filePath) @ "/"; + %dlg = new OpenFileDialog() { - Filters = "Shape Files(*.dae, *.cached.dts)|*.dae;*.cached.dts|Images Files(*.jpg,*.png,*.tga,*.bmp,*.dds)|*.jpg;*.png;*.tga;*.bmp;*.dds|Any Files (*.*)|*.*|"; - DefaultFile = ""; + Filters = %filter; + DefaultFile = %defaultPath; ChangePath = false; MustExist = true; MultipleFiles = false; @@ -1004,22 +1030,25 @@ function ImportAssetWindow::addNewImportingAsset(%this) %dlg.delete(); + if(%filePath $= "") + return ""; + //AssetBrowser.onDropFile( %path ); %fileExt = fileExt( %filePath ); //add it to our array! if(isImageFormat(%fileExt)) - %type = "Image"; + %type = "ImageAsset"; else if( isShapeFormat(%fileExt)) - %type = "Model"; + %type = "ShapeAsset"; else if( isSoundFormat(%fileExt)) - %type = "Sound"; + %type = "SoundAsset"; else if( %fileExt $= ".cs" || %fileExt $= ".cs.dso" ) - %type = "Script"; + %type = "ScriptAsset"; else if( %fileExt $= ".gui" || %fileExt $= ".gui.dso" ) - %type = "GUI"; + %type = "GUIAsset"; - AssetBrowser.addImportingAsset(%type, %filePath, ImportAssetActions.assetItem); + %newAssetItem = AssetBrowser.addImportingAsset(%type, %filePath, %parentAssetItem); //Used to keep tabs on what files we were trying to import, used mainly in the event of //adjusting configs and needing to completely reprocess the import @@ -1028,6 +1057,15 @@ function ImportAssetWindow::addNewImportingAsset(%this) %this.importingFilesArray.add(%filePath); AssetBrowser.onEndDropFiles(); + + return %newAssetItem; +} + +function ImportAssetWindow::addMaterialMap(%this, %map) +{ + %newAssetItem = %this.addNewImportingAsset("Image"); + + %newAssetItem.ImageType = %map; } // @@ -1130,8 +1168,10 @@ function ImportAssetWindow::validateAsset(%this, %id) %assetItem.status = "error"; %assetItem.statusType = "DuplicateAsset"; %assetItem.statusInfo = "Duplicate asset names found with the target module!\nAsset \"" @ - %assetItem.assetName @ "\" of type \"" @ %assetItem.assetType @ "\" has a matching name.\nPlease rename it and try again!"; + %assetItem.assetName @ "\" of type \"" @ %assetItem.assetType @ "\" has a matching name.\nPlease rename it and try again!"; + ImportActivityLog.add("Error! Asset " @ %assetItem.assetName @ " has an identically named asset in the target module"); + break; } } @@ -1156,6 +1196,8 @@ function ImportAssetWindow::validateAsset(%this, %id) %assetItem.status = "error"; %assetItem.statusType = "MissingFile"; %assetItem.statusInfo = "Unable to find file to be imported. Please select asset file."; + + ImportActivityLog.add("Error! Asset " @ %assetItem.filePath @ " was not found"); } if(%assetItem.status $= "Warning") @@ -1163,6 +1205,8 @@ function ImportAssetWindow::validateAsset(%this, %id) if(getAssetImportConfigValue("General/WarningsAsErrors", "0") == 1) { %assetItem.status = "error"; + + ImportActivityLog.add("Warnings treated as errors!"); } } @@ -1250,6 +1294,8 @@ function ImportAssetWindow::checkAssetForCollision(%this, %assetItem, %id) %assetItem.statusInfo = "Duplicate asset names found with importing assets!\nAsset \"" @ %assetItemB.assetName @ "\" of type \"" @ %assetItemB.assetType @ "\" and \"" @ %assetItem.assetName @ "\" of type \"" @ %assetItem.assetType @ "\" have matching names.\nPlease rename one of them and try again!"; + + ImportActivityLog.add("Warning! Asset " @ %assetItem.assetName @ ", type " @ %assetItem.assetType @ " has a naming collisions with asset " @ %assetItemB.assetName @ ", type " @ %assetItemB.assetType); return true; } @@ -1273,6 +1319,8 @@ function ImportAssetWindow::deleteImportingAsset(%this, %assetItem) { %item = ImportAssetTree.findItemByObjectId(%assetItem); + ImportActivityLog.add("Deleting Importing Asset " @ %assetItem.assetName @ " and all it's child items"); + ImportAssetTree.removeAllChildren(%item); ImportAssetTree.removeItem(%item); @@ -1285,7 +1333,7 @@ function ImportAssetWindow::deleteImportingAsset(%this, %assetItem) function ImportAssetWindow::ImportAssets(%this) { //do the actual importing, now! - %assetCount = AssetBrowser.importAssetFinalListArray.count(); + %assetCount = ImportAssetWindow.importAssetFinalListArray.count(); //get the selected module data %moduleName = AssetImportTargetModule.getText(); @@ -1326,15 +1374,15 @@ function ImportAssetWindow::doImportAssets(%this, %id) %assetImportSuccessful = false; %assetId = %moduleName@":"@%assetName; - if(%assetType $= "Image") + if(%assetType $= "ImageAsset") { AssetBrowser.importImageAsset(%assetItem); } - else if(%assetType $= "Model") + else if(%assetType $= "ShapeAsset") { AssetBrowser.importShapeAsset(%assetItem); } - else if(%assetType $= "Animation") + else if(%assetType $= "AnimationAsset") { %assetPath = "data/" @ %moduleName @ "/ShapeAnimations"; %assetFullPath = %assetPath @ "/" @ fileName(%filePath); @@ -1362,7 +1410,7 @@ function ImportAssetWindow::doImportAssets(%this, %id) error("Unable to import asset: " @ %filePath); } } - else if(%assetType $= "Sound") + else if(%assetType $= "SoundAsset") { %assetPath = "data/" @ %moduleName @ "/Sounds"; %assetFullPath = %assetPath @ "/" @ fileName(%filePath); @@ -1384,11 +1432,11 @@ function ImportAssetWindow::doImportAssets(%this, %id) error("Unable to import asset: " @ %filePath); } } - else if(%assetType $= "Material") + else if(%assetType $= "MaterialAsset") { AssetBrowser.importMaterialAsset(%assetItem); } - else if(%assetType $= "Script") + else if(%assetType $= "ScriptAsset") { %assetPath = "data/" @ %moduleName @ "/Scripts"; %assetFullPath = %assetPath @ "/" @ fileName(%filePath); @@ -1411,7 +1459,7 @@ function ImportAssetWindow::doImportAssets(%this, %id) error("Unable to import asset: " @ %filePath); } } - else if(%assetType $= "GUI") + else if(%assetType $= "GUIAsset") { %assetPath = "data/" @ %moduleName @ "/GUIs"; %assetFullPath = %assetPath @ "/" @ fileName(%filePath); @@ -1460,7 +1508,7 @@ function ImportAssetWindow::doImportAssets(%this, %id) function ImportAssetWindow::Close(%this) { //Some cleanup - AssetBrowser.importingFilesArray.empty(); + ImportAssetWindow.importingFilesArray.empty(); Canvas.popDialog(); } @@ -1472,13 +1520,19 @@ function ImportAssetWindow::resolveIssue(%this, %assetItem) { %resolutionAction = getAssetImportConfigValue("General/DuplicatAutoResolution", "AutoPrune"); + %humanReadableStatus = %assetItem.statusType $= "DuplicateImportAsset" ? "Duplicate Import Asset" : "Duplicate Asset"; + if(%resolutionAction $= "AutoPrune") { %this.deleteImportingAsset(%assetItem); %this.prunedDuplicateAssets++; + + ImportActivityLog.add("Asset " @ %assetItem.assetName @ " was Autopruned due to " @ %humanReadableStatus); } else if(%resolutionAction $= "AutoRename") { + ImportActivityLog.add("Asset " @ %assetItem.assetName @ " was Auto-Renamed due to " @ %humanReadableStatus); + %noNum = stripTrailingNumber(%assetItem.assetName); %num = getTrailingNumber(%assetItem.assetName); @@ -1492,6 +1546,8 @@ function ImportAssetWindow::resolveIssue(%this, %assetItem) %assetItem.assetName = %noNum @ %num; } + ImportActivityLog.add(" New name is " @ %assetItem.assetName); + %this.autoRenamedAssets++; } } @@ -1506,9 +1562,9 @@ function ImportAssetWindow::resolveIssue(%this, %assetItem) function ImportAssetWindow::findMissingFile(%this, %assetItem) { - if(%assetItem.assetType $= "Model") + if(%assetItem.assetType $= "ShapeAsset") %filters = "Shape Files(*.dae, *.cached.dts)|*.dae;*.cached.dts"; - else if(%assetItem.assetType $= "Image") + else if(%assetItem.assetType $= "ImageAsset") %filters = "Images Files(*.jpg,*.png,*.tga,*.bmp,*.dds)|*.jpg;*.png;*.tga;*.bmp;*.dds"; %dlg = new OpenFileDialog() @@ -1539,7 +1595,7 @@ function ImportAssetWindow::findMissingFile(%this, %assetItem) %assetItem.filePath = %fullPath; %assetItem.assetName = fileBase(%assetItem.filePath); - if(%assetItem.assetType $= "Image") + if(%assetItem.assetType $= "ImageAsset") { //See if we have anything important to update for our material parent(if we have one) %treeItem = ImportAssetTree.findItemByObjectId(%assetItem); @@ -1548,7 +1604,7 @@ function ImportAssetWindow::findMissingFile(%this, %assetItem) if(%parentItem != 0) { %parentAssetItem = ImportAssetTree.getItemObject(%parentItem); - if(%parentAssetItem.assetType $= "Material") + if(%parentAssetItem.assetType $= "MaterialAsset") { AssetBrowser.prepareImportMaterialAsset(%parentAssetItem); } @@ -1559,6 +1615,27 @@ function ImportAssetWindow::findMissingFile(%this, %assetItem) } // +// +function ImportAssetWindow::toggleLogWindow() +{ + if(AssetBrowserImportLog.isAwake()) + { + Canvas.popDialog(AssetBrowserImportLog); + return; + } + else + { + Canvas.pushDialog(AssetBrowserImportLog); + } + + ImportLogTextList.clear(); + for(%i=0; %i < ImportActivityLog.count(); %i++) + { + ImportLogTextList.addRow(%i, ImportActivityLog.getKey(%i)); + } +} +// + // function ImportAssetModuleList::onWake(%this) { diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImportConfig.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImportConfig.cs index 699810464..1755d0a86 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImportConfig.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImportConfig.cs @@ -2,15 +2,22 @@ function ImportAssetConfigList::onSelect( %this, %id, %text ) { //Apply our settings to the assets echo("Changed our import config!"); - AssetBrowser.importAssetUnprocessedListArray.empty(); - AssetBrowser.importAssetUnprocessedListArray.duplicate(AssetBrowser.importAssetNewListArray); - AssetBrowser.importAssetFinalListArray.empty(); + + if(ImportActivityLog.count() != 0) + ImportActivityLog.add(""); + + ImportActivityLog.add("Asset Import Configs set to " @ %text); + ImportActivityLog.add(""); + + ImportAssetWindow.importAssetUnprocessedListArray.empty(); + ImportAssetWindow.importAssetUnprocessedListArray.duplicate(AssetBrowser.importAssetNewListArray); + ImportAssetWindow.importAssetFinalListArray.empty(); ImportAssetWindow.activeImportConfigIndex = %id; ImportAssetWindow.activeImportConfig = ImportAssetWindow.importConfigsList.getKey(%id); //If we were trying to import anything, refresh it with the new config - if( AssetBrowser.importingFilesArray.count() != 0) + if( ImportAssetWindow.importingFilesArray.count() != 0) AssetBrowser.reloadImportingFiles(); } @@ -62,6 +69,7 @@ function setupImportConfigSettingsList() ImportAssetConfigSettingsList.addNewConfigSetting("Materials/IgnoreMaterials", "Ignore Materials", "command", "", "", ""); ImportAssetConfigSettingsList.addNewConfigSetting("Materials/AlwaysPresentImageMaps", "Always Present Image Maps", "bool", "Wether to always display all normal material map fields, even if an image isn't detected.", "", ""); + ImportAssetConfigSettingsList.addNewConfigSetting("Materials/PopulateMaterialMaps", "Populate Material Maps", "bool", "", "1", ""); //Animations ImportAssetConfigSettingsList.addNewConfigSetting("Animations/ImportAnimations", "Import Animations", "bool", "", "1", ""); @@ -95,7 +103,6 @@ function setupImportConfigSettingsList() ImportAssetConfigSettingsList.addNewConfigSetting("Images/Scaling", "Scaling", "float", "", "1.0", ""); ImportAssetConfigSettingsList.addNewConfigSetting("Images/Compressed", "Is Compressed", "bool", "", "1", ""); ImportAssetConfigSettingsList.addNewConfigSetting("Images/GenerateMaterialOnImport", "Generate Material On Import", "bool", "", "1", ""); - ImportAssetConfigSettingsList.addNewConfigSetting("Images/PopulateMaterialMaps", "Populate Material Maps", "bool", "", "1", ""); //Sounds ImportAssetConfigSettingsList.addNewConfigSetting("Sounds/VolumeAdjust", "Volume Adjustment", "float", "", "1.0", ""); @@ -131,7 +138,7 @@ function ImportAssetOptionsWindow::editImportSettings(%this, %assetItem) ImportOptionsList.addField("AssetName", "Asset Name", "string", "", "NewAsset", "", %assetItem); ImportOptionsList.endGroup(); - if(%assetType $= "Model") + if(%assetType $= "ShapeAsset") { //Get the shape info, so we know what we're doing with the mesh %shapeInfo = GetShapeInfo(%filePath); @@ -168,13 +175,13 @@ function ImportAssetOptionsWindow::editImportSettings(%this, %assetItem) ImportOptionsList.endGroup(); } } - else if(%assetType $= "Material") + else if(%assetType $= "MaterialAsset") { ImportOptionsList.startGroup("Material"); ImportOptionsList.addField("CreateComposites", "Create Composite Textures", "bool", "", "1", "", %assetConfigObj); ImportOptionsList.endGroup(); } - else if(%assetType $= "Image") + else if(%assetType $= "ImageAsset") { ImportOptionsList.startGroup("Formatting"); ImportOptionsList.addField("ImageType", "Image Type", "string", "", "Diffuse", "", %assetConfigObj); @@ -199,7 +206,7 @@ function ImportAssetOptionsWindow::editImportSettings(%this, %assetItem) ImportOptionsList.addField("IgnoreMaterials", "Ignore Importing Materials that fit these naming convention.", "command", "", "1", "", %optionsObj); ImportOptionsList.endGroup(); } - else if(%assetType $= "Sound") + else if(%assetType $= "SoundAsset") { ImportOptionsList.startGroup("Adjustment"); ImportOptionsList.addField("VolumeAdjust", "VolumeAdjustment", "float", "", "1.0", "", %assetConfigObj); @@ -216,6 +223,12 @@ function ImportAssetOptionsWindow::saveAssetOptions(%this) { %success = AssetImportSettings.write(); + if(ImportActivityLog.count() != 0) + ImportActivityLog.add(""); + + ImportActivityLog.add("Asset Import Configs saved, refreshing Import session"); + ImportActivityLog.add(""); + ImportAssetWindow.refresh(); ImportAssetOptionsWindow.setVisible(0); } @@ -309,6 +322,7 @@ function ImportAssetConfigEditorWindow::addNewConfig(%this) AssetImportSettings.setValue("Materials/UseDiffuseSuffixOnOriginImage", "1"); AssetImportSettings.setValue("Materials/UseExistingMaterials", "1"); AssetImportSettings.setValue("Materials/AlwaysPresentImageMaps", "0"); + AssetImportSettings.setValue("Materials/PopulateMaterialMaps", "1"); //Animations AssetImportSettings.setValue("Animations/ImportAnimations", "1"); @@ -338,7 +352,6 @@ function ImportAssetConfigEditorWindow::addNewConfig(%this) AssetImportSettings.setValue("Images/Scaling", "1.0"); AssetImportSettings.setValue("Images/Compressed", "1"); AssetImportSettings.setValue("Images/GenerateMaterialOnImport", "1"); - AssetImportSettings.setValue("Images/PopulateMaterialMaps", "1"); //Sounds AssetImportSettings.setValue("Sounds/VolumeAdjust", "1.0"); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/datablockObjects.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/datablockObjects.cs new file mode 100644 index 000000000..e69de29bb diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.cs index 438d5e22b..b9b70ba53 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.cs @@ -24,7 +24,7 @@ function AssetBrowser::prepareImportImageAsset(%this, %assetItem) { %filePath = %assetItem.filePath; if(%filePath !$= "") - %materialAsset = AssetBrowser.addImportingAsset("Material", "", "", %noSuffixName); + %materialAsset = AssetBrowser.addImportingAsset("MaterialAsset", "", "", %noSuffixName); %materialAsset.filePath = filePath(%assetItem.filePath) @ "/" @ %noSuffixName; @@ -107,6 +107,15 @@ function AssetBrowser::prepareImportImageAsset(%this, %assetItem) %assetItem.processed = true; } +function AssetBrowser::inspectImportingImageAsset(%this, %assetItem) +{ + AssetImportCtrl-->NewAssetsInspector.startGroup("Image"); + AssetImportCtrl-->NewAssetsInspector.addField("ImageType", "Image Type", "list", "Intended usage case of this image. Used to map to material slots and set up texture profiles.", "GUI", + "Color,Normal,Composite,Roughness,AO,Metalness,Glow,GUI,Particle,Decal", %assetItem); + + AssetImportCtrl-->NewAssetsInspector.endGroup(); +} + function AssetBrowser::importImageAsset(%this, %assetItem) { %moduleName = AssetImportTargetModule.getText(); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs index e8dee98a1..23266ab44 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs @@ -47,6 +47,8 @@ function AssetBrowser::editMaterialAsset(%this, %assetDef) function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem) { + ImportActivityLog.add("Preparing Shape for Import: " @ %assetItem.assetName); + //Iterate over to find appropriate images for //Fetch just the fileBase name @@ -66,6 +68,9 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem) { //We fit the bill, ignore this material and skip it %assetItem.skip = true; + + ImportActivityLog.add(%assetItem.assetName @ " has been ignored due to config Materials/IgnoreMaterials settings"); + return; } } @@ -73,6 +78,8 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem) if(getAssetImportConfigValue("Materials/PopulateMaterialMaps", "1") == 1) { + ImportActivityLog.add("Attempting to Auto-Populate Material Maps"); + %materialItemId = ImportAssetTree.findItemByObjectId(%assetItem); if(%assetItem.diffuseImageAsset $= "") @@ -83,6 +90,8 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem) if(%targetFilePath !$= "") { + ImportActivityLog.add("Auto-Populated Diffuse Map Image Asset via file: " @ %targetFilePath); + %diffuseAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem); %assetItem.diffuseImageAsset = %diffuseAsset; } @@ -106,6 +115,8 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem) if(%targetFilePath !$= "") { + ImportActivityLog.add("Auto-Populated Normal Map Image Asset via file: " @ %targetFilePath); + %normalAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem); %assetItem.normalImageAsset = %normalAsset; } @@ -127,6 +138,8 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem) if(%targetFilePath !$= "") { + ImportActivityLog.add("Auto-Populated Metalness Map Image Asset via file: " @ %targetFilePath); + %metalAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem); %assetItem.metalImageAsset = %metalAsset; } @@ -148,6 +161,8 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem) if(%targetFilePath !$= "") { + ImportActivityLog.add("Auto-Populated Roughness Map Image Asset via file: " @ %targetFilePath); + %roughnessAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem); %assetItem.roughnessImageAsset = %roughnessAsset; } @@ -169,6 +184,8 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem) if(%targetFilePath !$= "") { + ImportActivityLog.add("Auto-Populated Smoothness Map Image Asset via file: " @ %targetFilePath); + %smoothnessAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem); %assetItem.SmoothnessImageAsset = %smoothnessAsset; } @@ -190,6 +207,8 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem) if(%targetFilePath !$= "") { + ImportActivityLog.add("Auto-Populated AO Map Image Asset via file: " @ %targetFilePath); + %AOAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem); %assetItem.AOImageAsset = %AOAsset; } @@ -211,6 +230,8 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem) if(%targetFilePath !$= "") { + ImportActivityLog.add("Auto-Populated Composite Map Image Asset via file: " @ %targetFilePath); + %compositeAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem); %assetItem.compositeImageAsset = %compositeAsset; } @@ -236,6 +257,9 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem) %compositeAssetPath = AssetBrowser.dirHandler.currentAddress @ "/"; %saveAsPath = %compositeAssetPath @ "/" @ %assetItem.assetName @ "_composite.png"; + + ImportActivityLog.add("Auto-Generated Composite Map from ORM maps"); + %compositeAsset = AssetBrowser.addImportingAsset("Image", "", %assetItem, %assetItem.assetName @ "_composite"); %compositeAsset.generatedAsset = true; %compositeAsset.filePath = %saveAsPath; diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/prefab.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/prefab.cs new file mode 100644 index 000000000..e69de29bb diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.cs index ebf04f9a0..b52fafef1 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.cs @@ -49,6 +49,8 @@ function AssetBrowser::deleteShapeAsset(%this, %assetDef) function AssetBrowser::prepareImportShapeAsset(%this, %assetItem) { + ImportActivityLog.add("Preparing Shape for Import: " @ %assetItem.assetName); + %fileExt = fileExt(%assetItem.filePath); if(!isObject(%assetItem.shapeInfo)) @@ -78,7 +80,6 @@ function AssetBrowser::prepareImportShapeAsset(%this, %assetItem) if(getAssetImportConfigValue("Meshes/ImportMesh", "1") == 1 && %shapeCount > 0) { - } %animCount = %assetItem.shapeInfo._animCount; @@ -86,28 +87,13 @@ function AssetBrowser::prepareImportShapeAsset(%this, %assetItem) if(getAssetImportConfigValue("Animations/ImportAnimations", "1") == 1 && %animCount > 0) { - /*%animationItem = %assetItem.shapeInfo.getChild(%animItem); - - %animName = %assetItem.shapeInfo.getItemText(%animationItem); - - AssetBrowser.addImportingAsset("Animation", %animName, %shapeId); - - %animationItem = %assetItem.shapeInfo.getNextSibling(%animationItem); - while(%animationItem != 0) - { - %animName = %assetItem.shapeInfo.getItemText(%animationItem); - //%animName = %assetItem.shapeInfo.getItemValue(%animationItem); - - AssetBrowser.addImportingAsset("Animation", %animName, %shapeId); - - %animationItem = %shapeInfo.getNextSibling(%animationItem); - }*/ } - %matCount = %assetItem.shapeInfo._materialCount; %matItem = %assetItem.shapeInfo.findItemByName("Materials"); + ImportActivityLog.add(" Shape Info: Mesh Count: " @ %shapeCount @ " | Material Count: " @ %matCount @ " | Anim Count: " @ %animCount); + if(getAssetImportConfigValue("Materials/ImportMaterials", "1") == 1 && %matCount > 0) { %materialItem = %assetItem.shapeInfo.getChild(%matItem); @@ -117,23 +103,23 @@ function AssetBrowser::prepareImportShapeAsset(%this, %assetItem) %filePath = %assetItem.shapeInfo.getItemValue(%materialItem); if(%filePath !$= "" && isFile(%filePath)) { - AssetBrowser.addImportingAsset("Material", %filePath, %assetItem); + AssetBrowser.addImportingAsset("MaterialAsset", %filePath, %assetItem); } else { //check to see if it's actually just a flat color if(getWordCount(%filePath) == 4 && getWord(%filePath, 0) $= "Color:") { - AssetBrowser.addImportingAsset("Material", %matName, %assetItem); + AssetBrowser.addImportingAsset("MaterialAsset", %matName, %assetItem); } else { //we need to try and find our material, since the shapeInfo wasn't able to find it automatically %filePath = findImageFile(filePath(%assetItem.filePath), %matName); if(%filePath !$= "" && isFile(%filePath)) - AssetBrowser.addImportingAsset("Material", %filePath, %assetItem); + AssetBrowser.addImportingAsset("MaterialAsset", %filePath, %assetItem); else - AssetBrowser.addImportingAsset("Material", filePath(%assetItem.filePath) @ "/" @ %matName, %assetItem); + AssetBrowser.addImportingAsset("MaterialAsset", filePath(%assetItem.filePath) @ "/" @ %matName, %assetItem); } } @@ -144,23 +130,23 @@ function AssetBrowser::prepareImportShapeAsset(%this, %assetItem) %filePath = %assetItem.shapeInfo.getItemValue(%materialItem); if(%filePath !$= "" && isFile(%filePath)) { - AssetBrowser.addImportingAsset("Material", %filePath, %assetItem); + AssetBrowser.addImportingAsset("MaterialAsset", %filePath, %assetItem); } else { //check to see if it's actually just a flat color if(getWordCount(%filePath) == 4 && getWord(%filePath, 0) $= "Color:") { - AssetBrowser.addImportingAsset("Material", %matName, %assetItem); + AssetBrowser.addImportingAsset("MaterialAsset", %matName, %assetItem); } else { //we need to try and find our material, since the shapeInfo wasn't able to find it automatically %filePath = findImageFile(filePath(%assetItem.filePath), %matName); if(%filePath !$= "" && isFile(%filePath)) - AssetBrowser.addImportingAsset("Material", %filePath, %assetItem); + AssetBrowser.addImportingAsset("MaterialAsset", %filePath, %assetItem); else - AssetBrowser.addImportingAsset("Material", filePath(%assetItem.filePath) @ "/" @ %matName, %assetItem); + AssetBrowser.addImportingAsset("MaterialAsset", filePath(%assetItem.filePath) @ "/" @ %matName, %assetItem); } } @@ -202,12 +188,12 @@ function AssetBrowser::importShapeAsset(%this, %assetItem) %dependencyAssetItem = ImportAssetTree.getItemObject(%childId); %depAssetType = %dependencyAssetItem.assetType; - if(%depAssetType $= "Material") + if(%depAssetType $= "MaterialAsset") { %matSet = "%newAsset.materialSlot"@%matSlotId@"=\"@Asset="@%moduleName@":"@%dependencyAssetItem.assetName@"\";"; eval(%matSet); } - if(%depAssetType $= "Animation") + if(%depAssetType $= "AnimationAsset") { %matSet = "%newAsset.animationSequence"@%matSlotId@"=\"@Asset="@%moduleName@":"@%dependencyAssetItem.assetName@"\";"; eval(%matSet); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/newAsset.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/newAsset.cs index 861ac1b15..ffb86228a 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/newAsset.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/newAsset.cs @@ -48,19 +48,19 @@ function NewAssetTypeList::refresh(%this) //TODO: make this more automated //%this.add("GameObject", 0); - %this.add("Component", 0); - %this.add("Image", 1); - %this.add("Material", 2); - %this.add("Shape", 3); - %this.add("Sound", 4); - %this.add("State Machine", 5); + %this.add("ComponentAsset", 0); + %this.add("ImageAsset", 1); + %this.add("MaterialAsset", 2); + %this.add("ShapeAsset", 3); + %this.add("SoundAsset", 4); + %this.add("StateMachineAsset", 5); } function NewAssetTypeList::onSelected(%this) { %assetType = %this.getText(); - if(%assetType $= "Component") + if(%assetType $= "ComponentAsset") { NewComponentAssetSettings.hidden = false; } diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs index 859282dab..3a7a92589 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs @@ -296,9 +296,9 @@ function AssetBrowser::buildPopupMenus(%this) superClass = "MenuBuilder"; class = "EditorWorldMenu"; - item[ 0 ] = "Import Legacy Game" TAB "" TAB "AssetBrowser.importLegacyGame();"; + item[ 0 ] = "Import Project Loose Files" TAB "" TAB "AssetBrowser.importLegacyGame();"; Item[ 1 ] = "-"; - item[ 2 ] = "Import new assets" TAB "" TAB "AssetBrowser.importNewAssetFile();"; + item[ 2 ] = "Import new assets" TAB "" TAB "Canvas.pushDialog(AssetImportCtrl);"; }; } @@ -341,7 +341,27 @@ function AssetBrowser::buildPopupMenus(%this) } // + // Import Asset Actions // + if( !isObject( ImportAssetMaterialMaps ) ) + { + %this.ImportAssetActions = new PopupMenu( ImportAssetMaterialMaps ) + { + superClass = "MenuBuilder"; + class = "EditorWorldMenu"; + + item[0] = "Add Color Map" TAB "" TAB "ImportAssetWindow.addMaterialMap(\"Color\");"; + item[1] = "Add Normal Map" TAB "" TAB "ImportAssetWindow.addMaterialMap(\"Normal\");"; + item[2] = "Add Composite Map" TAB "" TAB "ImportAssetWindow.addMaterialMap(\"Composite\");"; + item[3] = "Add Metalness Map" TAB "" TAB "ImportAssetWindow.addMaterialMap(\"Metalness\");"; + item[4] = "Add AO Map" TAB "" TAB "ImportAssetWindow.addMaterialMap(\"AO\");"; + item[5] = "Add Roughness Map" TAB "" TAB "ImportAssetWindow.addMaterialMap(\"Roughness\");"; + item[6] = "Add Glow Map" TAB "" TAB "ImportAssetWindow.addMaterialMap(\"Glow\");"; + Item[7] = "-"; + Item[8] = "Add Existing Image Asset" TAB "" TAB "ImportAssetWindow.addExistingImageAsset();"; + }; + } + if( !isObject( ImportAssetActions ) ) { %this.ImportAssetActions = new PopupMenu( ImportAssetActions ) @@ -349,7 +369,8 @@ function AssetBrowser::buildPopupMenus(%this) superClass = "MenuBuilder"; class = "EditorWorldMenu"; - item[0] = "Add asset" TAB "" TAB "ImportAssetWindow.addNewImportingAsset();"; + item[0] = "Add New Asset" TAB "" TAB "ImportAssetWindow.addNewImportingAsset();"; + item[0] = "Add Reference to Existing Asset" TAB "" TAB "ImportAssetWindow.addRefExistingAsset();"; item[1] = "Remove asset" TAB "" TAB "ImportAssetWindow.removeImportingAsset();"; }; } diff --git a/Templates/BaseGame/game/tools/gui/postFxEditor.gui b/Templates/BaseGame/game/tools/gui/postFxEditor.gui index e1eb8e179..05029650b 100644 --- a/Templates/BaseGame/game/tools/gui/postFxEditor.gui +++ b/Templates/BaseGame/game/tools/gui/postFxEditor.gui @@ -239,7 +239,7 @@ profile = "ToolsGuiButtonProfile"; visible = "1"; active = "1"; - command = "PostFXEditor.apply(); Canvas.popDialog(PostFXEditor);"; + command = "PostFXEditor.apply();"; tooltipProfile = "GuiToolTipProfile"; tooltip = "Apply the settings and close this dialog"; hovertime = "1000"; diff --git a/Templates/BaseGame/game/tools/gui/profiles.ed.cs b/Templates/BaseGame/game/tools/gui/profiles.ed.cs index f76e1b572..d653e62de 100644 --- a/Templates/BaseGame/game/tools/gui/profiles.ed.cs +++ b/Templates/BaseGame/game/tools/gui/profiles.ed.cs @@ -649,6 +649,8 @@ new GuiControlProfile( ToolsGuiTextPadProfile ) fontColor = EditorSettings.value("Theme/fieldTextColor"); fontColorHL = EditorSettings.value("Theme/fieldTextHLColor"); fontColorSEL = EditorSettings.value("Theme/fieldTextSELColor"); + + cursorColor = EditorSettings.value("Theme/fieldTextSELColor"); border = 0; category = "Tools"; }; diff --git a/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.cs b/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.cs index 427fa62cf..7830dcf93 100644 --- a/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.cs +++ b/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.cs @@ -805,8 +805,7 @@ function ShapeEdSeqNodeTabBook::onTabSelected( %this, %name, %index ) { case "Seq": ShapeEdPropWindow-->newBtn.ToolTip = "Add new sequence"; - //ShapeEdPropWindow-->newBtn.Command = "ShapeEdSequences.onAddSequence();"; - ShapeEdPropWindow-->newBtn.Command = "AssetBrowser.showDialog(\"ShapeAnimationAsset\", \"onAddAnimationAssetShapeEditor\", \"\", \"\", \"\");"; + ShapeEdPropWindow-->newBtn.Command = "ShapeEdSequences.onAddSequence();"; ShapeEdPropWindow-->newBtn.setActive( true ); ShapeEdPropWindow-->deleteBtn.ToolTip = "Delete selected sequence (cannot be undone)"; ShapeEdPropWindow-->deleteBtn.Command = "ShapeEdSequences.onDeleteSequence();"; @@ -1651,7 +1650,8 @@ function ShapeEdSequences::onAddSequence( %this, %name ) if ( %from $= "" ) { // No sequence selected => open dialog to browse for one - getLoadFormatFilename( %this @ ".onAddSequenceFromBrowse", ShapeEdFromMenu.lastPath ); + //getLoadFormatFilename( %this @ ".onAddSequenceFromBrowse", ShapeEdFromMenu.lastPath ); + AssetBrowser.showDialog("ShapeAnimationAsset", "onAddAnimationAssetShapeEditor", "", "", ""); return; } else diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/visibilityLayer.ed.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/visibilityLayer.ed.cs index 42d87b07e..d245783ac 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/visibilityLayer.ed.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/visibilityLayer.ed.cs @@ -242,10 +242,25 @@ function setupEditorVisibilityMenu() item[ 12 ] = "Probes" TAB EVisibilityProbesOptions; item[ 13 ] = "Buffer Visualization" TAB EVisibilityBufferVizOptions; item[ 14 ] = "-" TAB "" TAB ""; - item[ 15 ] = "Class Visibility" TAB EVisibilityClassVizOptions; + item[ 15 ] = "Class Visibility" TAB "" TAB "Editor_VisibilityOptionsButton::onClick();"; }; } +function Editor_VisibilityOptionsButton::onClick(%this) +{ + if ( EVisibility.visible ) + { + EVisibility.setVisible(false); + //visibilityToggleBtn.setStateOn(0); + } + else + { + EVisibility.setVisible(true); + //visibilityToggleBtn.setStateOn(1); + EVisibility.setExtent("200 540"); + } +} + function EVisibility::onWake( %this ) { // Create the array if it