From 466d03ffecf10c0a9fa89a8101d30fbab5d357d9 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sat, 5 Oct 2019 07:53:43 -0500 Subject: [PATCH 01/21] adds a moduleDependencySort qsort callback, and uses it in the findModule method to massage the return vector by depends order --- Engine/source/module/moduleManager.cpp | 29 +++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Engine/source/module/moduleManager.cpp b/Engine/source/module/moduleManager.cpp index d8620c1f0..22c877594 100644 --- a/Engine/source/module/moduleManager.cpp +++ b/Engine/source/module/moduleManager.cpp @@ -38,9 +38,16 @@ #include "console/consoleTypes.h" #endif +#ifndef _MODULE_DEFINITION_H +#include "module/moduleDefinition.h" +#endif + +#ifndef _STRINGFUNCTIONS_H_ +#include "core/strings/stringFunctions.h" +#endif + // Script bindings. #include "moduleManager_ScriptBinding.h" - //----------------------------------------------------------------------------- IMPLEMENT_CONOBJECT( ModuleManager ); @@ -65,6 +72,25 @@ S32 QSORT_CALLBACK moduleDefinitionVersionIdSort( const void* a, const void* b ) return versionId1 > versionId2 ? -1 : versionId1 < versionId2 ? 1 : 0; } +S32 QSORT_CALLBACK moduleDependencySort(const void* a, const void* b) +{ + // Fetch module definitions. + ModuleDefinition* pDefinition1 = *(ModuleDefinition * *)a; + ModuleDefinition* pDefinition2 = *(ModuleDefinition * *)b; + + // Fetch version Ids. + ModuleDefinition::typeModuleDependencyVector moduleDependencies = pDefinition1->getDependencies(); + bool foundDependant = false; + for (ModuleDefinition::typeModuleDependencyVector::const_iterator dependencyItr = moduleDependencies.begin(); dependencyItr != moduleDependencies.end(); ++dependencyItr) + { + if (dStrcmp(dependencyItr->mModuleId, pDefinition2->getModuleId()) + && (dependencyItr->mVersionId == pDefinition2->getVersionId())) + foundDependant = true; + } + + return foundDependant ? 1 : -1; +} + //----------------------------------------------------------------------------- ModuleManager::ModuleManager() : @@ -1087,6 +1113,7 @@ void ModuleManager::findModules( const bool loadedOnly, typeConstModuleDefinitio moduleDefinitions.push_back( pModuleDefinition ); } } + dQsort(moduleDefinitions.address(), moduleDefinitions.size(), sizeof(ModuleDefinition*), moduleDependencySort); } //----------------------------------------------------------------------------- From 9229c21788cfb77184642e835b8fe3f49e5123f8 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sat, 5 Oct 2019 08:03:13 -0500 Subject: [PATCH 02/21] adds an optional entry to registerDatablock that sets a flag in the datablock files to-be-executed DatablockFilesList ArrayObject that erases relative-path duplicates and surpresses overwrites. setting it again in a sucessively executed module will take ownership of the exclusivity. otherwise, all script files follwing the same general path will be executed. adds an unRegisterDatablock to remove a given "relativePath / file" from the list sets up an automatically-cleaned ExecFilesList ArrayObject following a similar pattern, and executed for each callOnModules call, so that for instance all module::initServer(%this) entries are parsed, %this.queueExec feeds the vector, and opon completion of gathering the list, all are then executed in module-dependency order --- .../game/core/utility/scripts/module.cs | 194 +++++++++++++++++- 1 file changed, 190 insertions(+), 4 deletions(-) diff --git a/Templates/BaseGame/game/core/utility/scripts/module.cs b/Templates/BaseGame/game/core/utility/scripts/module.cs index 2ff14c1e1..a81be2bf2 100644 --- a/Templates/BaseGame/game/core/utility/scripts/module.cs +++ b/Templates/BaseGame/game/core/utility/scripts/module.cs @@ -1,5 +1,12 @@ +$traceModuleCalls=false; +$reportModuleFileConflicts=true; +if (!isObject(ExecFilesList)) + new ArrayObject(ExecFilesList); + function callOnModules(%functionName, %moduleGroup) { + //clear per module group file execution chain + ExecFilesList.empty(); //Get our modules so we can exec any specific client-side loading/handling %modulesList = ModuleDatabase.findModules(false); for(%i=0; %i < getWordCount(%modulesList); %i++) @@ -16,7 +23,14 @@ function callOnModules(%functionName, %moduleGroup) { eval(%module.scopeSet @ "." @ %functionName @ "();"); } - } + } + + %execFilecount = ExecFilesList.count(); + for (%i=0;%i<=%execFilecount;%i++) + { + %filename = ExecFilesList.getKey(%i); + exec(%filename); + } } function loadModuleMaterials(%moduleGroup) @@ -69,10 +83,12 @@ function SimSet::getModulePath(%scopeSet) return ""; } -function SimSet::registerDatablock(%scopeSet, %datablockFilePath) +function SimSet::registerDatablock(%scopeSet, %datablockFilePath, %isExclusive) { + if ($traceModuleCalls) + warn("SimSet::registerDatablock"); %name = %scopeSet.getName(); - %moduleDef = ModuleDatabase.findModule(%name); + %moduleDef = ModuleDatabase.findModule(%name, 1); if(!isObject(%moduleDef)) { @@ -89,6 +105,176 @@ function SimSet::registerDatablock(%scopeSet, %datablockFilePath) %relativePath = makeRelativePath(%datablockFilePath); %fullPath = pathConcat(%moduleDef.ModulePath, %relativePath); + ///go through all entries + %locked = false; + %dbFilecount = DatablockFilesList.count(); + for (%i=0;%i<=%dbFilecount;%i++) + { + %check = DatablockFilesList.getKey(%i); + //look for a substring match + %isMatch = strIsMatchExpr("*"@ %datablockFilePath,%check ); + if (%isMatch) + { + //check if we're already locked in + //and kill off any duplicates + //do note that doing it in this order means setting exclusive twice + //allows one to override exclusive with exclusive + %locked = DatablockFilesList.getValue(%i); + + if ((!%locked && !%isExclusive)&&($reportModuleFileConflicts)) + error("found" SPC %datablockFilePath SPC "duplicate file!"); + if (!%locked || (%locked && %isExclusive)) + { + DatablockFilesList.erase(%i); + } + } + } + //if we're not locked, or we are exclusive, go ahead and add it to the pile + //(ensures exclusives get re-added after that erasure) + if (!%locked || %isExclusive) + DatablockFilesList.add(%fullPath,%isExclusive); + if ($traceModuleCalls) + DatablockFilesList.echo(); +} + +function SimSet::unRegisterDatablock(%scopeSet, %datablockFilePath) +{ + if ($traceModuleCalls) + warn("SimSet::unRegisterDatablock"); + %name = %scopeSet.getName(); + %moduleDef = ModuleDatabase.findModule(%name, 1); + + if(!isObject(%moduleDef)) + { + error("Module::unRegisterDatablock() - unable to find a module with the moduleID of " @ %name); + return; + } - DatablockFilesList.add(%fullPath); + if(!isObject(DatablockFilesList)) + { + error("Module::unRegisterDatablock() - DatablockFilesList array object doesn't exist!"); + return; + } + + %relativePath = makeRelativePath(%datablockFilePath); + + %fullPath = pathConcat(%moduleDef.ModulePath, %relativePath); + ///go through all entries + %locked = false; + %dbFilecount = DatablockFilesList.count(); + for (%i=0;%i<=%dbFilecount;%i++) + { + %check = DatablockFilesList.getKey(%i); + //look for a substring match + %isMatch = strIsMatchExpr("*"@ %datablockFilePath,%check ); + if (%isMatch) + { + //check if we're already locked in. if not, kill it. + %locked = DatablockFilesList.getValue(%i); + if (!%locked) + { + DatablockFilesList.erase(%i); + } + } + } + if ($traceModuleCalls) + DatablockFilesList.echo(); +} + +function SimSet::queueExec(%scopeSet, %execFilePath, %isExclusive) +{ + if ($traceModuleCalls) + warn("SimSet::queueExec"); + %name = %scopeSet.getName(); + %moduleDef = ModuleDatabase.findModule(%name, 1); + + if(!isObject(%moduleDef)) + { + error("Module::queueExec() - unable to find a module with the moduleID of " @ %name); + return; + } + + if(!isObject(ExecFilesList)) + { + error("Module::queueExec() - ExecFilesList array object doesn't exist!"); + return; + } + + if ($traceModuleCalls) + warn("module root path="@ makeRelativePath(%moduleDef.ModulePath)); + + %fullPath = makeRelativePath(%moduleDef.ModulePath) @ %execFilePath; + ///go through all entries + %locked = false; + %execFilecount = ExecFilesList.count(); + for (%i=0;%i<=%execFilecount;%i++) + { + %check = ExecFilesList.getKey(%i); + //look for a substring match + %isMatch = strIsMatchExpr("*"@ %execFilePath,%check ); + if (%isMatch) + { + //check if we're already locked in + //and kill off any duplicates + //do note that doing it in this order means setting exclusive twice + //allows one to override exclusive with exclusive + %locked = ExecFilesList.getValue(%i); + if ((!%locked && !%isExclusive)&&($reportModuleFileConflicts)) + error("found" SPC %execFilePath SPC "duplicate file!"); + if (!%locked || (%locked && %isExclusive)) + { + ExecFilesList.erase(%i); + } + } + } + //if we're not locked, or we are exclusive, go ahead and add it to the pile + //(ensures exclusives get re-added after that erasure) + if (!%locked || %isExclusive) + ExecFilesList.add(%fullPath,%isExclusive); + if ($traceModuleCalls) + ExecFilesList.echo(); +} + +function SimSet::unQueueExec(%scopeSet, %execFilePath) +{ + if ($traceModuleCalls) + warn("SimSet::unRegisterDatablock"); + %name = %scopeSet.getName(); + %moduleDef = ModuleDatabase.findModule(%name, 1); + + if(!isObject(%moduleDef)) + { + error("Module::unRegisterDatablock() - unable to find a module with the moduleID of " @ %name); + return; + } + + if(!isObject(ExecFilesList)) + { + error("Module::unRegisterDatablock() - ExecFilesList array object doesn't exist!"); + return; + } + + %relativePath = makeRelativePath(%execFilePath); + + %fullPath = pathConcat(%moduleDef.ModulePath, %relativePath); + ///go through all entries + %locked = false; + %execFilecount = ExecFilesList.count(); + for (%i=0;%i<=%execFilecount;%i++) + { + %check = ExecFilesList.getKey(%i); + //look for a substring match + %isMatch = strIsMatchExpr("*"@ %execFilePath,%check ); + if (%isMatch) + { + //check if we're already locked in. if not, kill it. + %locked = ExecFilesList.getValue(%i); + if (!%locked) + { + ExecFilesList.erase(%i); + } + } + } + if ($traceModuleCalls) + ExecFilesList.echo(); } \ No newline at end of file From f44cb0124969e5015db29cef5f89050c17a8418f Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sun, 6 Oct 2019 11:08:49 -0500 Subject: [PATCH 03/21] looks like arrayObjects return count() as size+1; one of these days should really do a consistency pass on those... --- Templates/BaseGame/game/core/utility/scripts/module.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Templates/BaseGame/game/core/utility/scripts/module.cs b/Templates/BaseGame/game/core/utility/scripts/module.cs index a81be2bf2..7d6cc5eed 100644 --- a/Templates/BaseGame/game/core/utility/scripts/module.cs +++ b/Templates/BaseGame/game/core/utility/scripts/module.cs @@ -26,7 +26,7 @@ function callOnModules(%functionName, %moduleGroup) } %execFilecount = ExecFilesList.count(); - for (%i=0;%i<=%execFilecount;%i++) + for (%i=0;%i<%execFilecount;%i++) { %filename = ExecFilesList.getKey(%i); exec(%filename); @@ -108,7 +108,7 @@ function SimSet::registerDatablock(%scopeSet, %datablockFilePath, %isExclusive) ///go through all entries %locked = false; %dbFilecount = DatablockFilesList.count(); - for (%i=0;%i<=%dbFilecount;%i++) + for (%i=0;%i<%dbFilecount;%i++) { %check = DatablockFilesList.getKey(%i); //look for a substring match @@ -162,7 +162,7 @@ function SimSet::unRegisterDatablock(%scopeSet, %datablockFilePath) ///go through all entries %locked = false; %dbFilecount = DatablockFilesList.count(); - for (%i=0;%i<=%dbFilecount;%i++) + for (%i=0;%i<%dbFilecount;%i++) { %check = DatablockFilesList.getKey(%i); //look for a substring match @@ -207,7 +207,7 @@ function SimSet::queueExec(%scopeSet, %execFilePath, %isExclusive) ///go through all entries %locked = false; %execFilecount = ExecFilesList.count(); - for (%i=0;%i<=%execFilecount;%i++) + for (%i=0;%i<%execFilecount;%i++) { %check = ExecFilesList.getKey(%i); //look for a substring match @@ -260,7 +260,7 @@ function SimSet::unQueueExec(%scopeSet, %execFilePath) ///go through all entries %locked = false; %execFilecount = ExecFilesList.count(); - for (%i=0;%i<=%execFilecount;%i++) + for (%i=0;%i<%execFilecount;%i++) { %check = ExecFilesList.getKey(%i); //look for a substring match From 7ddf6cd4f2d222818cb7db9de76d0a80d43d8478 Mon Sep 17 00:00:00 2001 From: Marc Chapman Date: Wed, 16 Oct 2019 19:22:34 +0100 Subject: [PATCH 04/21] Fix shader path and added console.log in cleanup.bat --- Tools/CMake/cleanup-win.bat.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Tools/CMake/cleanup-win.bat.in b/Tools/CMake/cleanup-win.bat.in index c8c3a4fad..d0495a01e 100644 --- a/Tools/CMake/cleanup-win.bat.in +++ b/Tools/CMake/cleanup-win.bat.in @@ -2,7 +2,7 @@ :: Delete procedural shaders echo shaders -del /q /a:-R shaders\procedural\*.* +del /q /a:-R data\shaderCachel\*.* :: Delete dumped shader disassembly files for /R %%a IN (*._dis.txt) do IF EXIST "%%a._dis.txt" del "%%a._dis.txt" @@ -38,10 +38,11 @@ IF EXIST "scripts\server\banlist.cs" del /s scripts\server\banlist.cs IF EXIST "scripts\server\prefs.cs" del /s scripts\server\prefs.cs IF EXIST "client\config.cs" del /s client\config.cs IF EXIST "config.cs" del /s config.cs -IF EXIST "tools\settings.xml" del /s tools\settings.xml +:: IF EXIST "tools\settings.xml" del /s tools\settings.xml IF EXIST "banlist.cs" del /s banlist.cs :: logs echo logs IF EXIST "torque3d.log" del /s torque3d.log -echo DONE! +IF EXIST "console.log" del /s console.log +echo DONE! \ No newline at end of file From 4aed48697d27084b4f5ff11c2bb0e79dec7e1c08 Mon Sep 17 00:00:00 2001 From: Marc Chapman Date: Wed, 16 Oct 2019 19:22:56 +0100 Subject: [PATCH 05/21] typos --- .../game/data/ExampleModule/components/ExampleComponent.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Templates/BaseGame/game/data/ExampleModule/components/ExampleComponent.cs b/Templates/BaseGame/game/data/ExampleModule/components/ExampleComponent.cs index 497b0e41d..5656f5cd5 100644 --- a/Templates/BaseGame/game/data/ExampleModule/components/ExampleComponent.cs +++ b/Templates/BaseGame/game/data/ExampleModule/components/ExampleComponent.cs @@ -4,7 +4,7 @@ function ExampleComponent::onAdd(%this) { } -//onAdd is called when the component is removed and deleted from it's owner entity. +//onRemove is called when the component is removed and deleted from it's owner entity. function ExampleComponent::onRemove(%this) { @@ -15,7 +15,7 @@ function ExampleComponent::onClientConnect(%this, %client) } //onClientDisconnect is called any time a client disconnects from the server. -function ExampleComponent::onClientDisonnect(%this, %client) +function ExampleComponent::onClientDisconnect(%this, %client) { } From 27d2f63986301548fab3451c4586b0e0d55a1c37 Mon Sep 17 00:00:00 2001 From: Marc Chapman Date: Wed, 16 Oct 2019 19:23:32 +0100 Subject: [PATCH 06/21] Shaderdata new->singleton --- .../game/core/gameObjects/materials/materials.cs | 4 ++-- .../lighting/scripts/advancedLighting_Shaders.cs | 12 ++++++------ .../game/core/lighting/scripts/deferredShading.cs | 2 +- .../game/core/lighting/scripts/shadowMaps_Init.cs | 2 +- .../game/core/rendering/scripts/gfxData/shaders.cs | 6 +++--- .../worldEditor/scripts/visibility/lightViz.cs | 14 +++++++------- .../worldEditor/scripts/visibility/miscViz.cs | 8 ++++---- .../worldEditor/scripts/visibility/shadowViz.cs | 2 +- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Templates/BaseGame/game/core/gameObjects/materials/materials.cs b/Templates/BaseGame/game/core/gameObjects/materials/materials.cs index 9ea6fa1bd..af1f49cf7 100644 --- a/Templates/BaseGame/game/core/gameObjects/materials/materials.cs +++ b/Templates/BaseGame/game/core/gameObjects/materials/materials.cs @@ -1,4 +1,4 @@ -new ShaderData( BasicRibbonShader ) +singleton ShaderData( BasicRibbonShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/ribbons/basicRibbonShaderV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/ribbons/basicRibbonShaderP.hlsl"; @@ -26,7 +26,7 @@ singleton CustomMaterial( BasicRibbonMat ) preload = true; }; -new ShaderData( TexturedRibbonShader ) +singleton ShaderData( TexturedRibbonShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/ribbons/texRibbonShaderV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/ribbons/texRibbonShaderP.hlsl"; diff --git a/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs b/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs index bc70856ad..8ccb8a517 100644 --- a/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs +++ b/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs @@ -61,7 +61,7 @@ new GFXStateBlockData( AL_VectorLightState ) }; // Vector Light Material -new ShaderData( AL_VectorLightShader ) +singleton shaderData( AL_VectorLightShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/farFrustumQuadV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/vectorLightP.hlsl"; @@ -140,7 +140,7 @@ new GFXStateBlockData( AL_ConvexLightState ) }; // Point Light Material -new ShaderData( AL_PointLightShader ) +singleton shaderData( AL_PointLightShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/convexGeometryV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/pointLightP.hlsl"; @@ -179,7 +179,7 @@ new CustomMaterial( AL_PointLightMaterial ) }; // Spot Light Material -new ShaderData( AL_SpotLightShader ) +singleton shaderData( AL_SpotLightShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/convexGeometryV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/spotLightP.hlsl"; @@ -256,7 +256,7 @@ new Material( AL_DefaultShadowMaterial ) }; // Particle System Point Light Material -new ShaderData( AL_ParticlePointLightShader ) +singleton shaderData( AL_ParticlePointLightShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/particlePointLightV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/particlePointLightP.hlsl"; @@ -281,7 +281,7 @@ new CustomMaterial( AL_ParticlePointLightMaterial ) }; //Probe Processing -new ShaderData( IrradianceShader ) +singleton shaderData( IrradianceShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/cubemapV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/irradianceP.hlsl"; @@ -294,7 +294,7 @@ new ShaderData( IrradianceShader ) pixVersion = 3.0; }; -new ShaderData( PrefiterCubemapShader ) +singleton shaderData( PrefiterCubemapShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/cubemapV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/prefilterP.hlsl"; diff --git a/Templates/BaseGame/game/core/lighting/scripts/deferredShading.cs b/Templates/BaseGame/game/core/lighting/scripts/deferredShading.cs index eb6afe74c..d0631fc50 100644 --- a/Templates/BaseGame/game/core/lighting/scripts/deferredShading.cs +++ b/Templates/BaseGame/game/core/lighting/scripts/deferredShading.cs @@ -27,7 +27,7 @@ new GFXStateBlockData( AL_DeferredCaptureState : PFX_DefaultStateBlock ) samplerStates[4] = SamplerWrapLinear; }; -new ShaderData( AL_ProbeShader ) +singleton shaderData( AL_ProbeShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/lighting/advanced/probeShadingP.hlsl"; diff --git a/Templates/BaseGame/game/core/lighting/scripts/shadowMaps_Init.cs b/Templates/BaseGame/game/core/lighting/scripts/shadowMaps_Init.cs index f4875bf08..f1e9f175c 100644 --- a/Templates/BaseGame/game/core/lighting/scripts/shadowMaps_Init.cs +++ b/Templates/BaseGame/game/core/lighting/scripts/shadowMaps_Init.cs @@ -21,7 +21,7 @@ //----------------------------------------------------------------------------- -new ShaderData(BlurDepthShader) +singleton shaderData(BlurDepthShader) { DXVertexShaderFile = $Core::CommonShaderPath @ "/lighting/shadowMap/boxFilterV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/lighting/shadowMap/boxFilterP.hlsl"; diff --git a/Templates/BaseGame/game/core/rendering/scripts/gfxData/shaders.cs b/Templates/BaseGame/game/core/rendering/scripts/gfxData/shaders.cs index da3b7c864..6a2981fa9 100644 --- a/Templates/BaseGame/game/core/rendering/scripts/gfxData/shaders.cs +++ b/Templates/BaseGame/game/core/rendering/scripts/gfxData/shaders.cs @@ -57,7 +57,7 @@ singleton ShaderData( OffscreenParticleCompositeShaderData ) //----------------------------------------------------------------------------- // Planar Reflection //----------------------------------------------------------------------------- -new ShaderData( ReflectBump ) +singleton shaderData( ReflectBump ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/planarReflectBumpV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/planarReflectBumpP.hlsl"; @@ -72,7 +72,7 @@ new ShaderData( ReflectBump ) pixVersion = 2.0; }; -new ShaderData( Reflect ) +singleton shaderData( Reflect ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/planarReflectV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/planarReflectP.hlsl"; @@ -89,7 +89,7 @@ new ShaderData( Reflect ) //----------------------------------------------------------------------------- // fxFoliageReplicator //----------------------------------------------------------------------------- -new ShaderData( fxFoliageReplicatorShader ) +singleton shaderData( fxFoliageReplicatorShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/fxFoliageReplicatorV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/fxFoliageReplicatorP.hlsl"; diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/lightViz.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/lightViz.cs index 2edfa2898..913e19f95 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/lightViz.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/lightViz.cs @@ -20,7 +20,7 @@ // IN THE SOFTWARE. //----------------------------------------------------------------------------- // Debug Shaders. -new ShaderData( AL_ColorBufferShader ) +singleton shaderData( AL_ColorBufferShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; DXPixelShaderFile = "./shaders/dbgColorBufferP.hlsl"; @@ -59,7 +59,7 @@ function toggleColorBufferViz( %enable ) } } -new ShaderData( AL_SpecMapShader ) +singleton shaderData( AL_SpecMapShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; DXPixelShaderFile = "./shaders/dbgSpecMapVisualizeP.hlsl"; @@ -121,7 +121,7 @@ new GFXStateBlockData( AL_DefaultVisualizeState ) samplerStates[1] = SamplerClampLinear; // depthviz }; -new ShaderData( AL_DepthVisualizeShader ) +singleton shaderData( AL_DepthVisualizeShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; DXPixelShaderFile = "./shaders/dbgDepthVisualizeP.hlsl"; @@ -157,7 +157,7 @@ function AL_DepthVisualize::onEnabled( %this ) return true; } -new ShaderData( AL_GlowVisualizeShader ) +singleton shaderData( AL_GlowVisualizeShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; DXPixelShaderFile = "./shaders/dbgGlowVisualizeP.hlsl"; @@ -178,7 +178,7 @@ singleton PostEffect( AL_GlowVisualize ) renderPriority = 9999; }; -new ShaderData( AL_NormalsVisualizeShader ) +singleton shaderData( AL_NormalsVisualizeShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; DXPixelShaderFile = "./shaders/dbgNormalVisualizeP.hlsl"; @@ -214,7 +214,7 @@ function AL_NormalsVisualize::onEnabled( %this ) -new ShaderData( AL_LightColorVisualizeShader ) +singleton shaderData( AL_LightColorVisualizeShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; DXPixelShaderFile = "./shaders/dbgLightColorVisualizeP.hlsl"; @@ -249,7 +249,7 @@ function AL_LightColorVisualize::onEnabled( %this ) } -new ShaderData( AL_LightSpecularVisualizeShader ) +singleton shaderData( AL_LightSpecularVisualizeShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; DXPixelShaderFile = "./shaders/dbgLightSpecularVisualizeP.hlsl"; diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/miscViz.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/miscViz.cs index 3bb990019..5fc159ce7 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/miscViz.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/miscViz.cs @@ -39,7 +39,7 @@ new GFXStateBlockData( Viz_DefaultVisualizeState ) samplerStates[4] = SamplerClampLinear; // depthviz }; -new ShaderData( Viz_TexelDensity ) +singleton shaderData( Viz_TexelDensity ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; DXPixelShaderFile = "./shaders/Viz_TexelDensityP.hlsl"; @@ -79,7 +79,7 @@ function toggleTexelDensityViz( %enable ) // // -new ShaderData( Viz_SurfaceProperties ) +singleton shaderData( Viz_SurfaceProperties ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; DXPixelShaderFile = "./shaders/Viz_SurfacePropertiesP.hlsl"; @@ -203,7 +203,7 @@ function Viz_SurfacePropertiesPFX::onEnabled( %this ) // // // -new ShaderData( Viz_ColorBlindness ) +singleton shaderData( Viz_ColorBlindness ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; DXPixelShaderFile = "./shaders/Viz_ColorblindnessP.hlsl"; @@ -307,7 +307,7 @@ function Viz_ColorBlindnessPFX::onEnabled( %this ) // //Material Complexity Viz -new ShaderData( Viz_MaterialComplexity ) +singleton shaderData( Viz_MaterialComplexity ) { DXVertexShaderFile = "./shaders/Viz_materialComplexityV.hlsl"; DXPixelShaderFile = "./shaders/Viz_materialComplexityP.hlsl"; diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/shadowViz.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/shadowViz.cs index 1bfa88488..bb07ba596 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/shadowViz.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/shadowViz.cs @@ -20,7 +20,7 @@ // IN THE SOFTWARE. //----------------------------------------------------------------------------- -new ShaderData( AL_ShadowVisualizeShader ) +singleton shaderData( AL_ShadowVisualizeShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/guiMaterialV.hlsl"; DXPixelShaderFile = "./shaders/dbgShadowVisualizeP.hlsl"; From 40cdc29e0c1561979e6a6b2af588e2bcbb84cd4f Mon Sep 17 00:00:00 2001 From: Marc Chapman Date: Wed, 16 Oct 2019 19:26:45 +0100 Subject: [PATCH 07/21] GFXStateBlockData new -> singleton --- .../core/lighting/scripts/advancedLighting_Shaders.cs | 4 ++-- .../game/core/lighting/scripts/deferredShading.cs | 2 +- .../core/rendering/scripts/gfxData/commonMaterialData.cs | 8 ++++---- .../game/core/rendering/scripts/gfxData/scatterSky.cs | 2 +- .../BaseGame/game/core/rendering/scripts/gfxData/water.cs | 2 +- .../game/tools/worldEditor/scripts/visibility/lightViz.cs | 4 ++-- .../game/tools/worldEditor/scripts/visibility/miscViz.cs | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs b/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs index 8ccb8a517..af04cea66 100644 --- a/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs +++ b/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs @@ -22,7 +22,7 @@ // Vector Light State -new GFXStateBlockData( AL_VectorLightState ) +singleton GFXStateBlockData( AL_VectorLightState ) { blendDefined = true; blendEnable = true; @@ -102,7 +102,7 @@ new CustomMaterial( AL_VectorLightMaterial ) //------------------------------------------------------------------------------ // Convex-geometry light states -new GFXStateBlockData( AL_ConvexLightState ) +singleton GFXStateBlockData( AL_ConvexLightState ) { blendDefined = true; blendEnable = true; diff --git a/Templates/BaseGame/game/core/lighting/scripts/deferredShading.cs b/Templates/BaseGame/game/core/lighting/scripts/deferredShading.cs index d0631fc50..f2c9e43af 100644 --- a/Templates/BaseGame/game/core/lighting/scripts/deferredShading.cs +++ b/Templates/BaseGame/game/core/lighting/scripts/deferredShading.cs @@ -9,7 +9,7 @@ singleton ShaderData( DeferredColorShader ) pixVersion = 2.0; }; -new GFXStateBlockData( AL_DeferredCaptureState : PFX_DefaultStateBlock ) +singleton GFXStateBlockData( AL_DeferredCaptureState : PFX_DefaultStateBlock ) { blendEnable = false; diff --git a/Templates/BaseGame/game/core/rendering/scripts/gfxData/commonMaterialData.cs b/Templates/BaseGame/game/core/rendering/scripts/gfxData/commonMaterialData.cs index c5d8ef5bc..dee7364de 100644 --- a/Templates/BaseGame/game/core/rendering/scripts/gfxData/commonMaterialData.cs +++ b/Templates/BaseGame/game/core/rendering/scripts/gfxData/commonMaterialData.cs @@ -34,7 +34,7 @@ $sequence = 16; // Common stateblock definitions -new GFXSamplerStateData(SamplerClampLinear) +singleton GFXSamplerStateData(SamplerClampLinear) { textureColorOp = GFXTOPModulate; addressModeU = GFXAddressClamp; @@ -45,7 +45,7 @@ new GFXSamplerStateData(SamplerClampLinear) mipFilter = GFXTextureFilterLinear; }; -new GFXSamplerStateData(SamplerClampPoint) +singleton GFXSamplerStateData(SamplerClampPoint) { textureColorOp = GFXTOPModulate; addressModeU = GFXAddressClamp; @@ -56,7 +56,7 @@ new GFXSamplerStateData(SamplerClampPoint) mipFilter = GFXTextureFilterPoint; }; -new GFXSamplerStateData(SamplerWrapLinear) +singleton GFXSamplerStateData(SamplerWrapLinear) { textureColorOp = GFXTOPModulate; addressModeU = GFXTextureAddressWrap; @@ -67,7 +67,7 @@ new GFXSamplerStateData(SamplerWrapLinear) mipFilter = GFXTextureFilterLinear; }; -new GFXSamplerStateData(SamplerWrapPoint) +singleton GFXSamplerStateData(SamplerWrapPoint) { textureColorOp = GFXTOPModulate; addressModeU = GFXTextureAddressWrap; diff --git a/Templates/BaseGame/game/core/rendering/scripts/gfxData/scatterSky.cs b/Templates/BaseGame/game/core/rendering/scripts/gfxData/scatterSky.cs index 5add01d8b..a37fb1a48 100644 --- a/Templates/BaseGame/game/core/rendering/scripts/gfxData/scatterSky.cs +++ b/Templates/BaseGame/game/core/rendering/scripts/gfxData/scatterSky.cs @@ -20,7 +20,7 @@ // IN THE SOFTWARE. //----------------------------------------------------------------------------- -new GFXStateBlockData( ScatterSkySBData ) +singleton GFXStateBlockData( ScatterSkySBData ) { cullMode = "GFXCullNone"; diff --git a/Templates/BaseGame/game/core/rendering/scripts/gfxData/water.cs b/Templates/BaseGame/game/core/rendering/scripts/gfxData/water.cs index ec5e4be71..e462a604b 100644 --- a/Templates/BaseGame/game/core/rendering/scripts/gfxData/water.cs +++ b/Templates/BaseGame/game/core/rendering/scripts/gfxData/water.cs @@ -45,7 +45,7 @@ singleton ShaderData( WaterShader ) pixVersion = 3.0; }; -new GFXSamplerStateData(WaterSampler) +singleton GFXSamplerStateData(WaterSampler) { textureColorOp = GFXTOPModulate; addressModeU = GFXAddressWrap; diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/lightViz.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/lightViz.cs index 913e19f95..9031526e5 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/lightViz.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/lightViz.cs @@ -94,7 +94,7 @@ function toggleSpecMapViz( %enable ) AL_SpecMapVisualize.disable(); } -new GFXStateBlockData( AL_DepthVisualizeState ) +singleton GFXStateBlockData( AL_DepthVisualizeState ) { zDefined = true; zEnable = false; @@ -105,7 +105,7 @@ new GFXStateBlockData( AL_DepthVisualizeState ) samplerStates[1] = SamplerClampLinear; // viz color lookup }; -new GFXStateBlockData( AL_DefaultVisualizeState ) +singleton GFXStateBlockData( AL_DefaultVisualizeState ) { blendDefined = true; blendEnable = true; diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/miscViz.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/miscViz.cs index 5fc159ce7..1b09d28fe 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/miscViz.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/miscViz.cs @@ -1,4 +1,4 @@ -new GFXStateBlockData( Viz_DefaultVisualizeState ) +singleton GFXStateBlockData( Viz_DefaultVisualizeState ) { /*alphaDefined = true; alphaTestEnable = true; From 27d6665d21c3e74dbff7833b08c7164a1aee6dd3 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Thu, 17 Oct 2019 09:54:38 -0500 Subject: [PATCH 08/21] set volumetric fog to use the standard window-resized trigger for it's update --- .../environment/VolumetricFogRTManager.cpp | 20 +++++++------------ .../environment/VolumetricFogRTManager.h | 3 +-- .../windowManager/win32/win32Window.cpp | 4 ++-- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/Engine/source/environment/VolumetricFogRTManager.cpp b/Engine/source/environment/VolumetricFogRTManager.cpp index dfe05cefe..c9caf29e4 100644 --- a/Engine/source/environment/VolumetricFogRTManager.cpp +++ b/Engine/source/environment/VolumetricFogRTManager.cpp @@ -109,7 +109,7 @@ VolumetricFogRTManager::~VolumetricFogRTManager() void VolumetricFogRTManager::onSceneRemove() { if (mIsInitialized) - mPlatformWindow->getScreenResChangeSignal().remove(this, &VolumetricFogRTManager::ResizeRT); + mPlatformWindow->resizeEvent.remove(this, &VolumetricFogRTManager::ResizeRT); } void VolumetricFogRTManager::onRemove() @@ -148,7 +148,7 @@ bool VolumetricFogRTManager::Init() } mPlatformWindow = cv->getPlatformWindow(); - mPlatformWindow->getScreenResChangeSignal().notify(this,&VolumetricFogRTManager::ResizeRT); + mPlatformWindow->resizeEvent.notify(this,&VolumetricFogRTManager::ResizeRT); if (mTargetScale < 1 || GFX->getAdapterType() == Direct3D11) mTargetScale = 1; @@ -205,22 +205,17 @@ U32 VolumetricFogRTManager::DecFogObjects() return mNumFogObjects; } -void VolumetricFogRTManager::ResizeRT(PlatformWindow* win,bool resize) +void VolumetricFogRTManager::ResizeRT( WindowId did, S32 width, S32 height ) { - mFogHasAnswered = 0; smVolumetricFogRTMResizeSignal.trigger(this, true); } void VolumetricFogRTManager::FogAnswered() { - mFogHasAnswered++; - if (mFogHasAnswered == mNumFogObjects) - { - if (Resize()) - smVolumetricFogRTMResizeSignal.trigger(this, false); - else - Con::errorf("VolumetricFogRTManager::FogAnswered - Error resizing rendertargets!"); - } + if (Resize()) + smVolumetricFogRTMResizeSignal.trigger(this, false); + else + Con::errorf("VolumetricFogRTManager::FogAnswered - Error resizing rendertargets!"); } bool VolumetricFogRTManager::Resize() @@ -279,7 +274,6 @@ S32 VolumetricFogRTManager::setQuality(U32 Quality) mTargetScale = Quality; - mFogHasAnswered = 0; smVolumetricFogRTMResizeSignal.trigger(this, true); return mTargetScale; diff --git a/Engine/source/environment/VolumetricFogRTManager.h b/Engine/source/environment/VolumetricFogRTManager.h index 8000a4447..725f3b5db 100644 --- a/Engine/source/environment/VolumetricFogRTManager.h +++ b/Engine/source/environment/VolumetricFogRTManager.h @@ -59,13 +59,12 @@ class VolumetricFogRTManager : public SceneObject static S32 mTargetScale; bool mIsInitialized; U32 mNumFogObjects; - U32 mFogHasAnswered; U32 mWidth; U32 mHeight; void onRemove(); void onSceneRemove(); - void ResizeRT(PlatformWindow *win, bool resize); + void ResizeRT(WindowId did, S32 width, S32 height); static VolumetricFogRTMResizeSignal smVolumetricFogRTMResizeSignal; diff --git a/Engine/source/windowManager/win32/win32Window.cpp b/Engine/source/windowManager/win32/win32Window.cpp index 7d287cebd..21a0597d9 100644 --- a/Engine/source/windowManager/win32/win32Window.cpp +++ b/Engine/source/windowManager/win32/win32Window.cpp @@ -277,7 +277,7 @@ void Win32Window::setVideoMode( const GFXVideoMode &mode ) mOwningManager->raiseCurtain(); SetForegroundWindow( getHWND() ); - getScreenResChangeSignal().trigger( this, true ); + resizeEvent.trigger( this, true ); } bool Win32Window::clearFullscreen() @@ -806,7 +806,7 @@ LRESULT PASCAL Win32Window::WindowProc( HWND hWnd, UINT message, WPARAM wParam, window->getGFXTarget()->resetMode(); } - window->getScreenResChangeSignal().trigger(window, true); + window->resizeEvent.trigger(window, true); } return 0; From 326908aa3dcafad4b272e762a0a08ba977afdcff Mon Sep 17 00:00:00 2001 From: Marc Chapman Date: Fri, 18 Oct 2019 04:25:49 +0100 Subject: [PATCH 09/21] Fixed bug in display options UI writing incorrect values. --- Templates/BaseGame/game/data/ui/guis/optionsMenu.cs | 2 +- Templates/BaseGame/game/data/ui/scripts/displayMenu.cs | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Templates/BaseGame/game/data/ui/guis/optionsMenu.cs b/Templates/BaseGame/game/data/ui/guis/optionsMenu.cs index 98c3eda8d..51b4e4790 100644 --- a/Templates/BaseGame/game/data/ui/guis/optionsMenu.cs +++ b/Templates/BaseGame/game/data/ui/guis/optionsMenu.cs @@ -367,7 +367,7 @@ function OptionsMenuBackSetting::onClick(%this) //advance by one %newSetting = getToken(%settingsList, ",", %currentSettingIdx); - eval(%settingCtrl.qualitySettingGroup@"::set("@%newSetting@");"); + eval(%settingCtrl.qualitySettingGroup@"::set(\""@%newSetting@"\");"); %settingCtrl-->SettingText.setText( %newSetting ); if(%currentSettingIdx == %settingsListCount) diff --git a/Templates/BaseGame/game/data/ui/scripts/displayMenu.cs b/Templates/BaseGame/game/data/ui/scripts/displayMenu.cs index 71fb68b65..bf84abfd8 100644 --- a/Templates/BaseGame/game/data/ui/scripts/displayMenu.cs +++ b/Templates/BaseGame/game/data/ui/scripts/displayMenu.cs @@ -38,7 +38,14 @@ function DisplayMenu::apply(%this) } //Update the display settings now - $pref::Video::Resolution = getWord( $pref::Video::Resolution, 0 ) SPC getWord( $pref::Video::Resolution, 2 ); + if (getWord( $pref::Video::Resolution, 2) == "") + { + $pref::Video::Resolution = getWord( $pref::Video::Resolution, 0 ) SPC getWord( $pref::Video::Resolution, 1 ); + } + else + { + $pref::Video::Resolution = getWord( $pref::Video::Resolution, 0 ) SPC getWord( $pref::Video::Resolution, 2 ); + } /*if ( %newFullScreen $= "false" ) { From cba14c035f6c23408dc4d1d04f2c83c12ccf0160 Mon Sep 17 00:00:00 2001 From: Areloch Date: Sun, 20 Oct 2019 02:47:15 -0500 Subject: [PATCH 10/21] Change Asset Browser logic to utilize folder heirarchy instead of strict Asset Type filtration Added navigation history to AB, as well as ability to navigate via forward and backward buttons and breadcrumb buttons Added folder 'asset type', allowing you to create, rename, delete and move folders via the asset browser for better organization Adjusted various behaviors to work with the address-driven navigation/organization of the AB Expanded visibility options for the AB and integrated them into editor settings so they are retained Added Search field for searching the folder structure, in addition to the existing preview tiles search Adjusted drag-n-drop behavior of the platform code so it accepts dropping folders Added ability to dump active PostEffects list to see what is currently running Added ability to mark specific items in GuiTreeViewCtrl as hidden Made reflection probe bounds boxes translucent rather than wireframe to improve editing visibility Added expanded loose file references to LevelAsset for common companion files like decals and posteffect scrips Added editor setting for Editor Layout Mode, allowing you to set the editor into 'Modern' layout. Added editor settings to set default import config ruleset, and also ability to set auto-import. If both of these are set, then as long as the importing assets have no errors, they will auto-process and the user doesn't need to manually check and confirm them via the asset import window --- Engine/source/T3D/assets/LevelAsset.cpp | 13 + Engine/source/T3D/assets/LevelAsset.h | 12 + .../source/T3D/lighting/reflectionProbe.cpp | 3 +- .../source/gui/controls/guiTreeViewCtrl.cpp | 36 + Engine/source/gui/controls/guiTreeViewCtrl.h | 3 + Engine/source/postFx/postEffectManager.cpp | 73 ++ Engine/source/postFx/postEffectManager.h | 4 +- .../source/windowManager/sdl/sdlWindowMgr.cpp | 2 +- .../BaseGame/game/core/postFX/scripts/glow.cs | 2 +- .../BaseGame/game/core/postFX/scripts/hdr.cs | 2 +- .../game/core/postFX/scripts/postFx.cs | 2 - .../tools/assetBrowser/assetImportConfigs.xml | 66 +- .../tools/assetBrowser/guis/assetBrowser.gui | 508 +++++----- .../tools/assetBrowser/guis/assetImport.gui | 2 +- .../BaseGame/game/tools/assetBrowser/main.cs | 27 + .../assetBrowser/scripts/assetBrowser.cs | 882 +++++++++++++++--- .../tools/assetBrowser/scripts/assetImport.cs | 176 +--- .../assetBrowser/scripts/assetImportConfig.cs | 9 +- .../scripts/assetTypes/component.cs | 2 +- .../assetBrowser/scripts/assetTypes/gui.cs | 8 +- .../assetBrowser/scripts/assetTypes/image.cs | 2 +- .../assetBrowser/scripts/assetTypes/level.cs | 14 +- .../scripts/assetTypes/material.cs | 8 +- .../assetBrowser/scripts/assetTypes/script.cs | 8 +- .../assetBrowser/scripts/assetTypes/shape.cs | 6 +- .../tools/assetBrowser/scripts/editAsset.cs | 115 ++- .../tools/assetBrowser/scripts/newAsset.cs | 12 + .../tools/assetBrowser/scripts/popupMenus.cs | 88 +- .../game/tools/gui/editorSettingsWindow.ed.cs | 39 +- .../BaseGame/game/tools/gui/profiles.ed.cs | 2 +- Templates/BaseGame/game/tools/settings.xml | 302 +++--- .../tools/worldEditor/scripts/EditorGui.ed.cs | 3 + .../tools/worldEditor/scripts/editor.ed.cs | 2 +- 33 files changed, 1633 insertions(+), 800 deletions(-) diff --git a/Engine/source/T3D/assets/LevelAsset.cpp b/Engine/source/T3D/assets/LevelAsset.cpp index 32e7175d2..088b80045 100644 --- a/Engine/source/T3D/assets/LevelAsset.cpp +++ b/Engine/source/T3D/assets/LevelAsset.cpp @@ -87,6 +87,10 @@ LevelAsset::LevelAsset() : AssetBase(), mIsSubLevel(false) mLevelName = StringTable->EmptyString(); mLevelFile = StringTable->EmptyString(); mPreviewImage = StringTable->EmptyString(); + mPostFXPresetFile = StringTable->EmptyString(); + mDecalsFile = StringTable->EmptyString(); + mForestFile = StringTable->EmptyString(); + mNavmeshFile = StringTable->EmptyString(); mGamemodeName = StringTable->EmptyString(); mMainLevelAsset = StringTable->EmptyString(); @@ -115,6 +119,15 @@ void LevelAsset::initPersistFields() addProtectedField("PreviewImage", TypeAssetLooseFilePath, Offset(mPreviewImage, LevelAsset), &setPreviewImageFile, &getPreviewImageFile, "Path to the image used for selection preview."); + addProtectedField("PostFXPresetFile", TypeAssetLooseFilePath, Offset(mPostFXPresetFile, LevelAsset), + &setLevelFile, &getLevelFile, "Path to the level's postFXPreset."); + addProtectedField("DecalsFile", TypeAssetLooseFilePath, Offset(mDecalsFile, LevelAsset), + &setLevelFile, &getLevelFile, "Path to the decals cache file."); + addProtectedField("ForestFile", TypeAssetLooseFilePath, Offset(mForestFile, LevelAsset), + &setLevelFile, &getLevelFile, "Path to the Forest cache file."); + addProtectedField("NavmeshFile", TypeAssetLooseFilePath, Offset(mNavmeshFile, LevelAsset), + &setLevelFile, &getLevelFile, "Path to the navmesh file."); + addField("isSubScene", TypeBool, Offset(mIsSubLevel, LevelAsset), "Is this a sublevel to another Scene"); addField("gameModeName", TypeString, Offset(mGamemodeName, LevelAsset), "Name of the Game Mode to be used with this level"); } diff --git a/Engine/source/T3D/assets/LevelAsset.h b/Engine/source/T3D/assets/LevelAsset.h index e271d1c91..17aff3fc9 100644 --- a/Engine/source/T3D/assets/LevelAsset.h +++ b/Engine/source/T3D/assets/LevelAsset.h @@ -46,6 +46,10 @@ class LevelAsset : public AssetBase StringTableEntry mLevelName; StringTableEntry mLevelFile; + StringTableEntry mPostFXPresetFile; + StringTableEntry mDecalsFile; + StringTableEntry mForestFile; + StringTableEntry mNavmeshFile; StringTableEntry mPreviewImage; bool mIsSubLevel; @@ -66,6 +70,14 @@ public: void setLevelFile(const char* pImageFile); inline StringTableEntry getLevelFile(void) const { return mLevelFile; }; + void setPostFXPresetFile(const char* pPostFXPresetFile); + inline StringTableEntry getPostFXPresetFile(void) const { return mPostFXPresetFile; }; + void setDecalsFile(const char* pDecalsFile); + inline StringTableEntry getDecalsFile(void) const { return mDecalsFile; }; + void setForestFile(const char* pForestFile); + inline StringTableEntry getForestFile(void) const { return mForestFile; }; + void setNavmeshFile(const char* pNavmeshFile); + inline StringTableEntry getNavmeshFile(void) const { return mNavmeshFile; }; void setImageFile(const char* pImageFile); inline StringTableEntry getImageFile(void) const { return mPreviewImage; }; diff --git a/Engine/source/T3D/lighting/reflectionProbe.cpp b/Engine/source/T3D/lighting/reflectionProbe.cpp index b0606a62a..cdf948cc1 100644 --- a/Engine/source/T3D/lighting/reflectionProbe.cpp +++ b/Engine/source/T3D/lighting/reflectionProbe.cpp @@ -963,7 +963,8 @@ void ReflectionProbe::_onRenderViz(ObjectRenderInst *ri, desc.setZReadWrite(true, false); desc.setCullMode(GFXCullNone); desc.setBlend(true); - desc.fillMode = GFXFillWireframe; + //desc.fillMode = GFXFillWireframe; + // Base the sphere color on the light color. ColorI color = ColorI(255, 0, 255, 63); diff --git a/Engine/source/gui/controls/guiTreeViewCtrl.cpp b/Engine/source/gui/controls/guiTreeViewCtrl.cpp index a1fa30412..6bb33a198 100644 --- a/Engine/source/gui/controls/guiTreeViewCtrl.cpp +++ b/Engine/source/gui/controls/guiTreeViewCtrl.cpp @@ -1176,6 +1176,10 @@ void GuiTreeViewCtrl::_buildItem( Item* item, U32 tabLevel, bool bForceFullUpdat else item->mState.clear( Item::Filtered ); + //If the item should be hidden from view, check now + if (mHiddenItemsList.contains(item->mId)) + item->mState.set(Item::Filtered); + // Is this the root item? const bool isRoot = item == mRoot; @@ -4477,6 +4481,18 @@ void GuiTreeViewCtrl::setItemFilterException(U32 item, bool isExempted) } } +void GuiTreeViewCtrl::setItemHidden(U32 item, bool isHidden) +{ + if (isHidden) + { + mHiddenItemsList.push_back(item); + } + else + { + mHiddenItemsList.remove(item); + } +} + void GuiTreeViewCtrl::reparentItems(Vector selectedItems, Item* newParent) { for (S32 i = 0; i < selectedItems.size(); i++) @@ -5651,6 +5667,26 @@ DefineEngineMethod(GuiTreeViewCtrl, setItemFilterException, void, (U32 item, boo { object->setItemFilterException(item, isExempt); } + +DefineEngineMethod(GuiTreeViewCtrl, setItemHidden, void, (U32 item, bool hidden), (0, true), + "Set the pattern by which to filter items in the tree. Only items in the tree whose text " + "matches this pattern are displayed.\n\n" + "@param pattern New pattern based on which visible items in the tree should be filtered. If empty, all items become visible.\n\n" + "@see getFilterText\n" + "@see clearFilterText") +{ + object->setItemHidden(item, hidden); +} + +DefineEngineMethod(GuiTreeViewCtrl, clearHiddenItems, void, (),, + "Set the pattern by which to filter items in the tree. Only items in the tree whose text " + "matches this pattern are displayed.\n\n" + "@param pattern New pattern based on which visible items in the tree should be filtered. If empty, all items become visible.\n\n" + "@see getFilterText\n" + "@see clearFilterText") +{ + object->clearHiddenItems(); +} //----------------------------------------------------------------------------- DefineEngineMethod( GuiTreeViewCtrl, clearFilterText, void, (),, diff --git a/Engine/source/gui/controls/guiTreeViewCtrl.h b/Engine/source/gui/controls/guiTreeViewCtrl.h index 23de96b27..256a2c30f 100644 --- a/Engine/source/gui/controls/guiTreeViewCtrl.h +++ b/Engine/source/gui/controls/guiTreeViewCtrl.h @@ -360,6 +360,7 @@ class GuiTreeViewCtrl : public GuiArrayCtrl bool mDoFilterChildren; Vector mItemFilterExceptionList; + Vector mHiddenItemsList; /// If true, a trace of actions taken by the control is logged to the console. Can /// be turned on with the setDebug() script method. @@ -578,6 +579,8 @@ class GuiTreeViewCtrl : public GuiArrayCtrl void setFilterChildren(bool doFilter) { mDoFilterChildren = doFilter; } void setItemFilterException(U32 item, bool isExempt); + void setItemHidden(U32 item, bool isHidden); + void clearHiddenItems() { mHiddenItemsList.clear(); } /// Clear the current item filtering pattern. void clearFilterText() { setFilterText( String::EmptyString ); } diff --git a/Engine/source/postFx/postEffectManager.cpp b/Engine/source/postFx/postEffectManager.cpp index dc37723bb..7904c522d 100644 --- a/Engine/source/postFx/postEffectManager.cpp +++ b/Engine/source/postFx/postEffectManager.cpp @@ -314,3 +314,76 @@ S32 PostEffectManager::_effectPrioritySort( PostEffect* const *e1, PostEffect* c return 0; } + +void PostEffectManager::dumpActivePostFX() +{ + EffectVector effects; + + for (U32 i = 0; i < mEndOfFrameList.size(); i++) + { + PostEffect* effect = mEndOfFrameList[i]; + + if(effect->isEnabled()) + effects.push_back(effect); + } + + for (U32 i = 0; i < mAfterDiffuseList.size(); i++) + { + PostEffect* effect = mAfterDiffuseList[i]; + + if (effect->isEnabled()) + effects.push_back(effect); + } + + + // Now check the bin maps. + EffectMap::Iterator mapIter = mAfterBinMap.begin(); + for (; mapIter != mAfterBinMap.end(); mapIter++) + { + EffectVector& ef = mapIter->value; + + for (U32 i = 0; i < ef.size(); i++) + { + PostEffect* effect = ef[i]; + + if (effect->isEnabled()) + effects.push_back(effect); + } + } + + mapIter = mBeforeBinMap.begin(); + for (; mapIter != mBeforeBinMap.end(); mapIter++) + { + EffectVector& ef = mapIter->value; + + for (U32 i = 0; i < ef.size(); i++) + { + PostEffect* effect = ef[i]; + + if (effect->isEnabled()) + effects.push_back(effect); + } + } + + // Resort the effects by priority. + effects.sort(&_effectPrioritySort); + + Con::printf("PostEffectManager::dumpActivePostFX() - Beginning Dump"); + + for (U32 i = 0; i < effects.size(); i++) + { + PostEffect* effect = effects[i]; + + if (effect->isEnabled()) + { + Con::printf("%s", effect->getName()); + } + } + + Con::printf("PostEffectManager::dumpActivePostFX() - Ending Dump"); +} + +DefineEngineFunction(dumpActivePostFX, void, (),, "") +{ + PFXMGR->dumpActivePostFX(); +} diff --git a/Engine/source/postFx/postEffectManager.h b/Engine/source/postFx/postEffectManager.h index f06e6b76a..e8c55c0d7 100644 --- a/Engine/source/postFx/postEffectManager.h +++ b/Engine/source/postFx/postEffectManager.h @@ -132,9 +132,11 @@ public: // For ManagedSingleton. static const char* getSingletonName() { return "PostEffectManager"; } + + void dumpActivePostFX(); }; /// Returns the PostEffectManager singleton. #define PFXMGR ManagedSingleton::instance() -#endif // _POSTEFFECTMANAGER_H_ \ No newline at end of file +#endif // _POSTEFFECTMANAGER_H_ diff --git a/Engine/source/windowManager/sdl/sdlWindowMgr.cpp b/Engine/source/windowManager/sdl/sdlWindowMgr.cpp index 5be1ae53d..f937ba97e 100644 --- a/Engine/source/windowManager/sdl/sdlWindowMgr.cpp +++ b/Engine/source/windowManager/sdl/sdlWindowMgr.cpp @@ -353,7 +353,7 @@ void PlatformWindowManagerSDL::_process() char* fileName = evt.drop.file; - if (!Platform::isFile(fileName)) + if (!Platform::isDirectory(fileName) && !Platform::isFile(fileName)) break; Con::executef("onDropFile", StringTable->insert(fileName)); diff --git a/Templates/BaseGame/game/core/postFX/scripts/glow.cs b/Templates/BaseGame/game/core/postFX/scripts/glow.cs index 0f062f6f7..c4e7a9595 100644 --- a/Templates/BaseGame/game/core/postFX/scripts/glow.cs +++ b/Templates/BaseGame/game/core/postFX/scripts/glow.cs @@ -146,7 +146,7 @@ singleton PostEffect( VolFogGlowPostFx ) texture[0] = "$backbuffer"; target = "$outTex"; targetScale = "0.5 0.5"; - isEnabled = true; + isEnabled = false; // Blur vertically new PostEffect() { diff --git a/Templates/BaseGame/game/core/postFX/scripts/hdr.cs b/Templates/BaseGame/game/core/postFX/scripts/hdr.cs index 99afc2256..f74fbcd0c 100644 --- a/Templates/BaseGame/game/core/postFX/scripts/hdr.cs +++ b/Templates/BaseGame/game/core/postFX/scripts/hdr.cs @@ -328,7 +328,7 @@ function HDRPostFX::onAdd( %this ) PostFXManager.registerPostEffect(%this); //HDR should really be on at all times - %this.enable(); + //%this.enable(); $HDRPostFX::enableToneMapping = 1; } diff --git a/Templates/BaseGame/game/core/postFX/scripts/postFx.cs b/Templates/BaseGame/game/core/postFX/scripts/postFx.cs index fe931a994..2d92a7ea7 100644 --- a/Templates/BaseGame/game/core/postFX/scripts/postFx.cs +++ b/Templates/BaseGame/game/core/postFX/scripts/postFx.cs @@ -35,8 +35,6 @@ singleton ShaderData( PFX_PassthruShader ) function postFXInit() { - exec("core/postFX/guis/postFxManager.gui"); - //Load the core postFX files themselves if (!$Server::Dedicated) { diff --git a/Templates/BaseGame/game/tools/assetBrowser/assetImportConfigs.xml b/Templates/BaseGame/game/tools/assetBrowser/assetImportConfigs.xml index 67ce2c5d6..b5ffe874e 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/assetImportConfigs.xml +++ b/Templates/BaseGame/game/tools/assetBrowser/assetImportConfigs.xml @@ -1,56 +1,56 @@ - - 0 - 0 - 1 - 0 - 0 - 0 - Z_AXIS - TrailingNumber + + 1 + 1 - 1 - 1 - 1 - 1 ColorEffect*, + 1 + 1 + 1 + 1 + + + 0 + 0 + 0 + Z_AXIS + 1 + TrailingNumber + 0 + 0 - _AO,_AMBIENT,_AMBIENTOCCLUSION - _METAL,_MET,_METALNESS,_METALLIC - 1 - 1 - 1 - Bilinear - 1 - _ROUGH,_ROUGHNESS - 0 1.0 - _ALBEDO,_DIFFUSE,_ALB,_DIF,_COLOR,_COL,_baseColor, - _COMP,_COMPOSITE - N/A - _SMOOTH,_SMOOTHNESS + 1 + Bilinear + 0 + _METAL,_MET,_METALNESS,_METALLIC _NORMAL,_NORM + _AO,_AMBIENT,_AMBIENTOCCLUSION + N/A + 1 + _ROUGH,_ROUGHNESS + _SMOOTH,_SMOOTHNESS + _ALBEDO,_DIFFUSE,_ALB,_DIF,_COLOR,_COL,_baseColor,_a, + 1 + 1 + _COMP,_COMPOSITE 1 - 1 - LOS Col CollisionMesh + 1 + LOS CollisionMesh - - 1 - 1 - 1.0 - 0 1.0 + 0 AutoPrune diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui index 20500af05..1bf2eff3c 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui @@ -13,13 +13,23 @@ isContainer = "1"; canSave = "1"; canSaveDynamicFields = "1"; - AddNewArtAssetPopup = "18222"; - AddNewAssetPopup = "18223"; - AddNewScriptAssetPopup = "18221"; + AddNewArtAssetPopup = "18110"; + AddNewAssetPopup = "18112"; + AddNewCppAssetPopup = "18111"; + AddNewScriptAssetPopup = "18109"; coreModulesFilter = "0"; currentPreviewPage = "0"; - enabled = "1"; + Enabled = "1"; + importAssetFinalListArray = "20689"; + ImportAssetResolutionsPopup = "18119"; + importAssetUnprocessedListArray = "20688"; + importingFilesArray = "20687"; isReImportingAsset = "0"; + navigationHistoryIdx = "0"; + onlyShowModulesWithAssets = "0"; + previewData = "19953"; + previewSize = "80"; + templateFilesPath = "tools/assetBrowser/scripts/templateFiles/"; totalPages = "1"; treeFilterMode = "list"; @@ -201,7 +211,7 @@ groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; - position = "50 22"; + position = "52 22"; extent = "45 19"; minExtent = "8 2"; horizSizing = "right"; @@ -215,97 +225,107 @@ canSave = "1"; canSaveDynamicFields = "0"; }; - new GuiWindowCtrl(TagFilterWindow) { - text = "New Window"; - resizeWidth = "1"; - resizeHeight = "1"; - canMove = "1"; - canClose = "0"; - canMinimize = "0"; - canMaximize = "0"; - canCollapse = "0"; - edgeSnap = "1"; - docking = "None"; - margin = "4 4 4 4"; - padding = "0 0 0 0"; - anchorTop = "0"; - anchorBottom = "0"; - anchorLeft = "0"; - anchorRight = "0"; - position = "129 62"; - extent = "161 250"; - minExtent = "161 86"; - horizSizing = "windowRelative"; - vertSizing = "windowRelative"; - profile = "ToolsGuiToolbarWindowProfile"; - visible = "0"; + new GuiBitmapButtonCtrl(AssetBrowser_NavigateBackBtn) { + bitmap = "tools/gui/images/folderUp.png"; + bitmapMode = "Centered"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "98 21"; + extent = "22 22"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "AssetBrowser.navigateHistoryBack();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiBitmapButtonCtrl(AssetBrowser_NavigateForwardBtn) { + bitmap = "tools/gui/images/folderDown.png"; + bitmapMode = "Centered"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "120 21"; + extent = "22 22"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "AssetBrowser.navigateHistoryForward();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiStackControl(AssetBrowser_BreadcrumbBar) { + stackingType = "Horizontal"; + horizStacking = "Left to Right"; + vertStacking = "Top to Bottom"; + padding = "0"; + dynamicSize = "0"; + dynamicNonStackExtent = "0"; + dynamicPos = "0"; + changeChildSizeToFit = "0"; + changeChildPosition = "1"; + position = "156 21"; + extent = "326 23"; + minExtent = "16 16"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; hovertime = "1000"; isContainer = "1"; - internalName = "VisibilityLayerWindow"; - hidden = "1"; canSave = "1"; canSaveDynamicFields = "0"; - - new GuiScrollCtrl() { - willFirstRespond = "1"; - hScrollBar = "alwaysOff"; - vScrollBar = "dynamic"; - lockHorizScroll = "1"; - lockVertScroll = "0"; - constantThumbHeight = "0"; - childMargin = "2 0"; - mouseWheelScrollSpeed = "-1"; - docking = "Client"; - margin = "0 0 0 0"; - padding = "0 0 0 0"; - anchorTop = "1"; - anchorBottom = "0"; - anchorLeft = "1"; - anchorRight = "0"; - position = "1 9"; - extent = "159 238"; - minExtent = "8 2"; - horizSizing = "width"; - vertSizing = "height"; - profile = "ToolsGuiScrollProfile"; - visible = "1"; - active = "1"; - tooltipProfile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - isContainer = "1"; - canSave = "1"; - canSaveDynamicFields = "0"; - - new GuiStackControl(TagFilterList) { - stackingType = "Vertical"; - horizStacking = "Left to Right"; - vertStacking = "Top to Bottom"; - padding = "-2"; - dynamicSize = "1"; - dynamicNonStackExtent = "0"; - dynamicPos = "0"; - changeChildSizeToFit = "1"; - changeChildPosition = "1"; - position = "3 1"; - extent = "153 16"; - minExtent = "16 16"; - horizSizing = "width"; - vertSizing = "bottom"; - profile = "ToolsGuiDefaultProfile"; - visible = "1"; - active = "1"; - tooltipProfile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - isContainer = "1"; - internalName = "theVisOptionsList"; - canSave = "1"; - canSaveDynamicFields = "0"; - }; - }; }; - new GuiSplitContainer() { + new GuiBitmapButtonCtrl(AssetBrowser_VisibilityOptions) { + bitmap = "tools/gui/images/visible"; + bitmapMode = "Centered"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "487 21"; + extent = "23 23"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "AssetBrowser.showVisibiltyOptions();"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Visibility Options"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiSplitContainer(AssetBrowser_MainSplit) { orientation = "Vertical"; splitterSize = "2"; splitPoint = "149 100"; @@ -332,7 +352,7 @@ canSave = "1"; canSaveDynamicFields = "0"; - new GuiPanel() { + new GuiPanel(AssetBrowser_FoldersPanel) { docking = "Client"; margin = "0 0 0 0"; padding = "0 0 0 0"; @@ -342,7 +362,7 @@ anchorRight = "0"; position = "0 0"; extent = "147 509"; - minExtent = "16 16"; + minExtent = "0 0"; horizSizing = "right"; vertSizing = "bottom"; profile = "ToolsGuiDefaultProfile"; @@ -376,8 +396,13 @@ canSave = "1"; canSaveDynamicFields = "0"; - new GuiTextCtrl() { - text = "Filters"; + new GuiTextEditCtrl(AssetBrowserFolderSearchFilter) { + historySize = "0"; + tabComplete = "0"; + sinkAllKeyEvents = "0"; + password = "0"; + passwordMask = "*"; + text = "Search Folders..."; maxLength = "1024"; margin = "0 0 0 0"; padding = "0 0 0 0"; @@ -385,23 +410,24 @@ anchorBottom = "0"; anchorLeft = "1"; anchorRight = "0"; - position = "5 0"; - extent = "30 16"; + position = "0 0"; + extent = "148 18"; minExtent = "8 2"; - horizSizing = "right"; - vertSizing = "bottom"; - profile = "ToolsGuiDefaultProfile"; + horizSizing = "width"; + vertSizing = "height"; + profile = "ToolsGuiTextEditProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; hovertime = "1000"; isContainer = "1"; + class = "AssetBrowserSearchFilterTxt"; canSave = "1"; canSaveDynamicFields = "0"; }; - new GuiBitmapButtonCtrl() { - bitmap = "tools/gui/images/visible"; - bitmapMode = "Stretched"; + new GuiBitmapButtonCtrl(AssetBrowser_ClearFolderFilterBtn) { + bitmap = "tools/gui/images/clear-icon"; + bitmapMode = "Centered"; autoFitExtents = "0"; useModifiers = "0"; useStates = "1"; @@ -409,17 +435,15 @@ groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; - position = "128 -1"; - extent = "18 19"; + position = "132 0"; + extent = "15 15"; minExtent = "8 2"; - horizSizing = "right"; + horizSizing = "left"; vertSizing = "bottom"; - profile = "ToolsGuiDefaultProfile"; + profile = "GuiDefaultProfile"; visible = "1"; active = "1"; - command = "AssetBrowser.showFilterPopup();"; tooltipProfile = "GuiToolTipProfile"; - tooltip = "Views assets via module-oriented list tree."; hovertime = "1000"; isContainer = "0"; canSave = "1"; @@ -500,7 +524,7 @@ canRenameObjects = "1"; renameInternal = "0"; position = "1 1"; - extent = "145 252"; + extent = "145 147"; minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; @@ -517,7 +541,7 @@ }; }; }; - new GuiPanel() { + new GuiPanel(AssetBrowser_AssetsPanel) { docking = "Client"; margin = "0 0 0 0"; padding = "0 0 0 0"; @@ -548,7 +572,7 @@ anchorLeft = "1"; anchorRight = "0"; position = "1 0"; - extent = "354 41"; + extent = "354 19"; minExtent = "8 2"; horizSizing = "width"; vertSizing = "bottom"; @@ -561,65 +585,13 @@ canSave = "1"; canSaveDynamicFields = "0"; - new GuiBitmapButtonCtrl() { - bitmap = "tools/gui/images/new"; - bitmapMode = "Stretched"; - autoFitExtents = "0"; - useModifiers = "0"; - useStates = "1"; - masked = "0"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - position = "42 22"; - extent = "15 15"; - minExtent = "8 2"; - horizSizing = "right"; - vertSizing = "bottom"; - profile = "ToolsGuiDefaultProfile"; - visible = "1"; - active = "1"; - command = "AssetBrowser.createNewAsset();"; - tooltipProfile = "GuiToolTipProfile"; - tooltip = "Create New Asset"; - hovertime = "1000"; - isContainer = "0"; - canSave = "1"; - canSaveDynamicFields = "0"; - }; - new GuiBitmapButtonCtrl() { - bitmap = "tools/gui/images/delete"; - bitmapMode = "Stretched"; - autoFitExtents = "0"; - useModifiers = "0"; - useStates = "1"; - masked = "0"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - position = "23 22"; - extent = "15 15"; - minExtent = "8 2"; - horizSizing = "right"; - vertSizing = "bottom"; - profile = "ToolsGuiDefaultProfile"; - visible = "1"; - active = "1"; - command = "AssetBrowser.showDeleteDialog();"; - tooltipProfile = "GuiToolTipProfile"; - tooltip = "Delete Asset"; - hovertime = "1000"; - isContainer = "0"; - canSave = "1"; - canSaveDynamicFields = "0"; - }; new GuiTextEditCtrl(AssetBrowserSearchFilter) { historySize = "0"; tabComplete = "0"; sinkAllKeyEvents = "0"; password = "0"; passwordMask = "*"; - text = "\c2Filter..."; + text = "Search Assets..."; maxLength = "1024"; margin = "0 0 0 0"; padding = "0 0 0 0"; @@ -627,8 +599,8 @@ anchorBottom = "0"; anchorLeft = "1"; anchorRight = "0"; - position = "62 19"; - extent = "273 18"; + position = "21 1"; + extent = "314 18"; minExtent = "8 2"; horizSizing = "width"; vertSizing = "bottom"; @@ -638,12 +610,12 @@ tooltipProfile = "GuiToolTipProfile"; hovertime = "1000"; isContainer = "1"; - class = "AssetBrowserSearchFilterText"; + class = "AssetBrowserSearchFilterTxt"; canSave = "1"; canSaveDynamicFields = "0"; }; - new GuiBitmapButtonCtrl(TagFilterButton) { - bitmap = "tools/gui/images/visible"; + new GuiBitmapButtonCtrl(AssetBrowser_ClearAssetFilterBtn) { + bitmap = "tools/gui/images/clear-icon"; bitmapMode = "Stretched"; autoFitExtents = "0"; useModifiers = "0"; @@ -652,55 +624,7 @@ groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; - position = "4 19"; - extent = "20 20"; - minExtent = "8 2"; - horizSizing = "right"; - vertSizing = "bottom"; - profile = "ToolsGuiDefaultProfile"; - visible = "1"; - active = "1"; - command = "AssetBrowser.toggleTagFilterPopup();"; - tooltipProfile = "GuiToolTipProfile"; - hovertime = "1000"; - isContainer = "0"; - canSave = "1"; - canSaveDynamicFields = "0"; - }; - new GuiTextCtrl() { - text = "Assets"; - maxLength = "1024"; - margin = "0 0 0 0"; - padding = "0 0 0 0"; - anchorTop = "1"; - anchorBottom = "0"; - anchorLeft = "1"; - anchorRight = "0"; - position = "5 0"; - extent = "53 16"; - minExtent = "8 2"; - horizSizing = "right"; - vertSizing = "bottom"; - profile = "ToolsGuiDefaultProfile"; - visible = "1"; - active = "1"; - tooltipProfile = "GuiToolTipProfile"; - hovertime = "1000"; - isContainer = "1"; - canSave = "1"; - canSaveDynamicFields = "0"; - }; - new GuiBitmapButtonCtrl() { - bitmap = "tools/gui/images/delete"; - bitmapMode = "Stretched"; - autoFitExtents = "0"; - useModifiers = "0"; - useStates = "1"; - masked = "0"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - position = "337 22"; + position = "321 1"; extent = "15 15"; minExtent = "8 2"; horizSizing = "left"; @@ -708,9 +632,60 @@ profile = "ToolsGuiDefaultProfile"; visible = "1"; active = "1"; - command = "AssetBrowser.showDeleteDialog();"; tooltipProfile = "GuiToolTipProfile"; - tooltip = "Delete Asset"; + tooltip = "Create New Asset"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiBitmapButtonCtrl(AssetBrowser_ToggleFolderPanel) { + bitmap = "tools/gui/images/iconList.png"; + bitmapMode = "Centered"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "1 1"; + extent = "15 15"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "AssetBrowser.toggleFolderCollapseButton();"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Toggles the display of the folders panel"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiBitmapButtonCtrl(AssetBrowser_FilterOptionsBtn) { + bitmap = "tools/gui/images/filter.png"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "337 1"; + extent = "15 15"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "AssetBrowser.showFilterOptions();"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Filter Options"; hovertime = "1000"; isContainer = "0"; canSave = "1"; @@ -724,8 +699,8 @@ anchorBottom = "0"; anchorLeft = "1"; anchorRight = "1"; - position = "1 40"; - extent = "354 468"; + position = "1 17"; + extent = "354 487"; minExtent = "8 2"; horizSizing = "width"; vertSizing = "height"; @@ -755,7 +730,7 @@ anchorLeft = "1"; anchorRight = "0"; position = "0 0"; - extent = "354 448"; + extent = "354 467"; minExtent = "8 8"; horizSizing = "width"; vertSizing = "height"; @@ -768,6 +743,22 @@ canSave = "1"; canSaveDynamicFields = "0"; + new GuiMouseEventCtrl(AssetListPanelInputs) { + lockMouse = "0"; + position = "1 0"; + extent = "339 467"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "height"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; new GuiStackControl() { stackingType = "Vertical"; horizStacking = "Left to Right"; @@ -778,8 +769,8 @@ dynamicPos = "0"; changeChildSizeToFit = "1"; changeChildPosition = "0"; - position = "1 1"; - extent = "352 254"; + position = "2 1"; + extent = "339 124"; minExtent = "16 16"; horizSizing = "width"; vertSizing = "bottom"; @@ -792,25 +783,10 @@ canSave = "1"; canSaveDynamicFields = "0"; - new GuiControl() { - position = "0 0"; - extent = "352 4"; - minExtent = "8 2"; - horizSizing = "right"; - vertSizing = "bottom"; - profile = "ToolsGuiDefaultProfile"; - visible = "1"; - active = "1"; - tooltipProfile = "GuiToolTipProfile"; - hovertime = "1000"; - isContainer = "1"; - canSave = "1"; - canSaveDynamicFields = "0"; - }; new GuiDynamicCtrlArrayControl() { colCount = "3"; colSize = "100"; - rowCount = "2"; + rowCount = "1"; rowSize = "124"; rowSpacing = "2"; colSpacing = "2"; @@ -819,8 +795,8 @@ fillRowFirst = "1"; dynamicSize = "1"; padding = "0 0 0 0"; - position = "3 4"; - extent = "352 250"; + position = "3 0"; + extent = "339 124"; minExtent = "8 8"; horizSizing = "width"; vertSizing = "bottom"; @@ -830,7 +806,7 @@ tooltipProfile = "GuiToolTipProfile"; hovertime = "1000"; isContainer = "1"; - internalName = "materialSelection"; + internalName = "assetList"; canSave = "1"; canSaveDynamicFields = "0"; }; @@ -844,7 +820,7 @@ anchorBottom = "0"; anchorLeft = "1"; anchorRight = "0"; - position = "0 448"; + position = "0 467"; extent = "354 20"; minExtent = "8 2"; horizSizing = "width"; @@ -859,13 +835,35 @@ canSave = "1"; canSaveDynamicFields = "0"; }; + new GuiTextCtrl(AssetBrowser_FooterText) { + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "0 470"; + extent = "269 23"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "top"; + profile = "ToolsGuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; }; new GuiButtonCtrl() { text = "Select"; groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; - position = "242 491"; + position = "301 488"; extent = "53 19"; minExtent = "8 2"; horizSizing = "left"; @@ -882,26 +880,6 @@ canSave = "1"; canSaveDynamicFields = "0"; }; - new GuiButtonCtrl() { - text = "Cancel"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - position = "300 491"; - extent = "52 19"; - minExtent = "8 2"; - horizSizing = "left"; - vertSizing = "top"; - profile = "ToolsGuiButtonProfile"; - visible = "1"; - active = "1"; - command = "AssetBrowser.hideDialog();"; - tooltipProfile = "GuiToolTipProfile"; - hovertime = "1000"; - isContainer = "0"; - canSave = "1"; - canSaveDynamicFields = "0"; - }; }; }; }; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/assetImport.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/assetImport.gui index a6002f35e..a89b344c5 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/assetImport.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/assetImport.gui @@ -224,7 +224,7 @@ canSave = "1"; canSaveDynamicFields = "0"; }; - new GuiScrollCtrl() { + new GuiScrollCtrl(ImportAssetConfigEditorScroll) { willFirstRespond = "1"; hScrollBar = "dynamic"; vScrollBar = "dynamic"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/main.cs b/Templates/BaseGame/game/tools/assetBrowser/main.cs index 9ba71c91b..d35a3d6b6 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/main.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/main.cs @@ -30,6 +30,32 @@ function initializeAssetBrowser() { echo(" % - Initializing Asset Browser"); + $AssetBrowser::importConfigsFile = "tools/assetBrowser/assetImportConfigs.xml"; + $AssetBrowser::currentImportConfig = ""; + + if(!isObject(AssetFilterTypeList)) + { + new ArrayObject(AssetFilterTypeList); + + AssetFilterTypeList.add("Component"); + AssetFilterTypeList.add("Cpp"); + AssetFilterTypeList.add("Cubemap"); + AssetFilterTypeList.add("GameObjects"); + AssetFilterTypeList.add("GUIs"); + AssetFilterTypeList.add("Images"); + AssetFilterTypeList.add("Levels"); + AssetFilterTypeList.add("Materials"); + AssetFilterTypeList.add("Particles"); + AssetFilterTypeList.add("PostFXs"); + AssetFilterTypeList.add("Scripts"); + AssetFilterTypeList.add("Shapes"); + AssetFilterTypeList.add("ShapeAnimations"); + AssetFilterTypeList.add("Sounds"); + AssetFilterTypeList.add("StateMachines"); + AssetFilterTypeList.add("Terrains"); + AssetFilterTypeList.add("TerrainMaterials"); + } + exec("./guis/assetBrowser.gui"); exec("./guis/addModuleWindow.gui"); exec("./guis/gameObjectCreator.gui"); @@ -67,6 +93,7 @@ function initializeAssetBrowser() exec("./scripts/assetTypes/sound.cs"); exec("./scripts/assetTypes/stateMachine.cs"); exec("./scripts/assetTypes/cubemap.cs"); + exec("./scripts/assetTypes/folder.cs"); exec("./scripts/fieldTypes/fieldTypes.cs"); exec("./scripts/fieldTypes/listField.cs"); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs index ebe1e2b44..2de51f4e1 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs @@ -44,15 +44,28 @@ function AssetBrowser::onWake(%this) if(!isObject(ImportAssetTree)) new GuiTreeViewCtrl(ImportAssetTree); + if(!isObject(AssetBrowser_NavPrevHistoryList)) + { + new ArrayObject(AssetBrowser_NavPrevHistoryList); + } + if(!isObject(AssetBrowser_NavForeHistoryList)) + { + new ArrayObject(AssetBrowser_NavForeHistoryList); + } + %this.importingFilesArray = new ArrayObject(); %this.importAssetUnprocessedListArray = new ArrayObject(); %this.importAssetFinalListArray = new ArrayObject(); %this.isReImportingAsset = false; %this.coreModulesFilter = false; + %this.toolsModulesFilter = false; %this.onlyShowModulesWithAssets = false; %this.treeFilterMode = "list"; + %this.folderPanelState = true; + %this.folderPanelSplit = 0; + %this.templateFilesPath = "tools/assetBrowser/scripts/templateFiles/"; //First, build our our list of active modules @@ -77,6 +90,8 @@ function AssetBrowser::onWake(%this) "You have no modules or content. Do you want to import a module from the template content?", "AssetBrowser.ImportTemplateModules();", "" ); } + + %this.setPreviewSize(EditorSettings.value("Assets/Browser/previewTileSize", "small")); } //Filters @@ -87,18 +102,60 @@ function AssetBrowser::showFilterPopup(%this) function AssetBrowser::viewCoreModulesFilter(%this) { - %this.coreModulesFilter = !%this.coreModulesFilter; + %oldVal = EditorSettings.value("Assets/Browser/showCoreModule", false); + %newVal = !%oldVal; - BrowserVisibilityPopup.checkItem(0,%this.coreModulesFilter); + BrowserVisibilityPopup.checkItem(0,%newVal); + + EditorSettings.setValue("Assets/Browser/showCoreModule", %newVal); + + AssetBrowser.loadFilters(); +} + +function AssetBrowser::viewToolsModulesFilter(%this) +{ + %oldVal = EditorSettings.value("Assets/Browser/showToolsModule", false); + %newVal = !%oldVal; + + BrowserVisibilityPopup.checkItem(1,%newVal); + + EditorSettings.setValue("Assets/Browser/showToolsModule", %newVal); AssetBrowser.loadFilters(); } function AssetBrowser::viewPopulatedModulesFilter(%this) { - %this.onlyShowModulesWithAssets = !%this.onlyShowModulesWithAssets; + %oldVal = EditorSettings.value("Assets/Browser/showOnlyPopulatedModule", false); + %newVal = !%oldVal; - BrowserVisibilityPopup.checkItem(1,%this.onlyShowModulesWithAssets); + BrowserVisibilityPopup.checkItem(2,%newVal); + + EditorSettings.setValue("Assets/Browser/showOnlyPopulatedModule", %newVal); + + AssetBrowser.loadFilters(); +} + +function AssetBrowser::toggleShowingFolders(%this) +{ + %oldVal = EditorSettings.value("Assets/Browser/showFolders", false); + %newVal = !%oldVal; + + BrowserVisibilityPopup.checkItem(4,%newVal); + + EditorSettings.setValue("Assets/Browser/showFolders", %newVal); + + AssetBrowser.loadFilters(); +} + +function AssetBrowser::toggleShowingEmptyFolders(%this) +{ + %oldVal = EditorSettings.value("Assets/Browser/showEmptyFolders", false); + %newVal = !%oldVal; + + BrowserVisibilityPopup.checkItem(5,%newVal); + + EditorSettings.setValue("Assets/Browser/showEmptyFolders", %newVal); AssetBrowser.loadFilters(); } @@ -115,7 +172,12 @@ function AssetBrowser::viewTagsFilter(%this) AssetBrowser.loadFilters(); } -//Drag-Drop functionality +function AssetBrowser::toggleAssetTypeFilter(%assetTypeIdx) +{ + %isChecked = AssetTypeListPopup.isItemChecked(%assetTypeIdx); + AssetTypeListPopup.checkItem(%assetTypeIdx, !%isChecked); +} + function AssetBrowser::selectAsset( %this, %asset ) { if(AssetBrowser.selectCallback !$= "") @@ -189,20 +251,43 @@ function AssetBrowser::buildPreviewArray( %this, %asset, %moduleName ) %this.previewData = new ScriptObject(); } - %assetDesc = AssetDatabase.acquireAsset(%asset); - %assetName = AssetDatabase.getAssetName(%asset); + AssetPreviewArray.empty(); + %previewImage = "core/art/warnmat"; - AssetPreviewArray.empty(); + if(ModuleDatabase.findModule(%moduleName, 1) !$= "") + { + %assetDesc = AssetDatabase.acquireAsset(%asset); + %assetName = AssetDatabase.getAssetName(%asset); + %assetType = AssetDatabase.getAssetType(%asset); + + } + else + { + %fullPath = %moduleName !$= "" ? %moduleName @ "/" @ %asset : %asset; + %fullPath = strreplace(%fullPath, "/", "_"); + + if(isObject(%fullPath)) + %assetDesc = %fullPath; + else + %assetDesc = new ScriptObject(%fullPath); + + %assetDesc.dirPath = %moduleName; + %assetDesc.assetName = %asset; + %assetDesc.description = %moduleName @ "/" @ %asset; + %assetDesc.assetType = "Folder"; + + %assetName = %asset; + %assetType = "Folder"; + } // it may seem goofy why the checkbox can't be instanciated inside the container // reason being its because we need to store the checkbox ctrl in order to make changes // on it later in the function. - - %previewSize = "80 80"; - %previewBounds = 20; - %assetType = AssetDatabase.getAssetType(%asset); + + %previewSize = %this.previewSize SPC %this.previewSize; + %previewBounds = 20; %container = new GuiControl(){ profile = "ToolsGuiDefaultProfile"; @@ -310,6 +395,12 @@ function AssetBrowser::buildPreviewArray( %this, %asset, %moduleName ) %buildCommand = %this @ ".build" @ %assetType @ "Preview(" @ %assetDesc @ "," @ %this.previewData @ ");"; eval(%buildCommand); + //debug dump + %tooltip = %this.previewData.tooltip; + %assetName = %this.previewData.assetName; + %previewImage = %this.previewData.previewImage; + %doubleClickCommand = %this.previewData.doubleClickCommand; + %previewButton = new GuiBitmapButtonCtrl() { className = "AssetPreviewControl"; @@ -376,23 +467,198 @@ function AssetBrowser::buildPreviewArray( %this, %asset, %moduleName ) %container.add(%previewNameCtrl); // add to the gui control array - AssetBrowser-->materialSelection.add(%container); + AssetBrowser-->assetList.add(%container); // add to the array object for reference later AssetPreviewArray.add( %previewButton, %this.previewData.previewImage ); } +// +// +function AssetPreviewButton::onClick(%this) +{ + echo("CLICKED AN ASSET PREVIEW BUTTON"); +} + +function AssetPreviewButton::onDoubleClick(%this) +{ + echo("DOUBLE CLICKED AN ASSET PREVIEW BUTTON"); +} +// +// + +function AssetBrowser::loadFolders(%this, %path, %parentId) +{ + //utilize home dir project setting here + %paths = getDirectoryList(%path); + for(%i=0; %i < getFieldCount(%paths); %i++) + { + %childPath = getField(%paths, %i); + + %folderCount = getTokenCount(%childPath, "/"); + + for(%f=0; %f < %folderCount; %f++) + { + %folderName = getToken(%childPath, "/", %f); + + //we don't need to display the shadercache folder + if(%parentId == 1 && %folderName $= "shaderCache") + continue; + + %iconIdx = 1; + + if(ModuleDatabase.findModule(%folderName) !$= "") + %iconIdx = 0; + + %searchFoldersText = AssetBrowserFolderSearchFilter.getText(); + if(%searchFoldersText !$= "Search Folders...") + { + if(strstr(strlwr(%folderName), strlwr(%searchFoldersText)) != -1) + { + %folderID = AssetBrowser-->filterTree.insertItem(%parentId, %folderName, %path, "", %iconIdx, %iconIdx); + + %this.loadFolders(%path @ "/" @ %folderName, %folderID); + } + } + else + { + %folderID = AssetBrowser-->filterTree.insertItem(%parentId, %folderName, %path, "", %iconIdx, %iconIdx); + + %this.loadFolders(%path @ "/" @ %folderName, %folderID); + } + } + } +} + function AssetBrowser::loadFilters( %this ) { AssetBrowser-->filterTree.clear(); - AssetBrowser-->filterTree.buildIconTable(":tools/classIcons/prefab"); + AssetBrowser-->filterTree.buildIconTable( "tools/classIcons/Prefab" @ + ":tools/classIcons/SimSet"); + + %dataItem = AssetBrowser-->filterTree.insertItem(0, "Data"); + %this.loadFolders("Data", %dataItem); + + //If set to, show core + if(%this.coreModulesFilter) + { + %coreItem = AssetBrowser-->filterTree.insertItem(0, "Core"); + %this.loadFolders("Core", %coreItem); + } + + //If set to, show tools + if(%this.toolsModulesFilter) + { + %toolsItem = AssetBrowser-->filterTree.insertItem(0, "Tools"); + %this.loadFolders("Tools", %toolsItem); + } - AssetBrowser-->filterTree.insertItem(0, "Assets"); + //AssetBrowser-->filterTree.insertItem(0, "Data"); + + //get it alllll + /*%directoryDump = getDirectoryList("data", -1); + + %dirs = getFieldCount(%directoryDump); + + for(%i=0; %i < %dirs; %i++) + { + %folderName = getToken(%assetBasePath, "/", %f); + + %folderID = AssetBrowser-->filterTree.findChildItemByName(%prevFolderID, %folderName); + + if(%folderID == -1 || %folderID == 0) + { + %pathCache = ""; + + for(%c=0; %c < %f; %c++) + { + %pathCache = %c == 0 ? getToken(%assetBasePath, "/", %c) : %pathCache @ "/" @ getToken(%assetBasePath, "/", %c); + } + + %folderID = AssetBrowser-->filterTree.insertItem(%prevFolderID, %folderName, %pathCache, "", 1, 1); + } + }*/ AssetPreviewArray.empty(); - if(%this.treeFilterMode $= "list") + /*%assetQuery = new AssetQuery(); + %numAssetsFound = AssetDatabase.findAllAssets(%assetQuery); + + for( %i=0; %i < %numAssetsFound; %i++) + { + %assetId = %assetQuery.getAsset(%i); + + %assetPath = makeRelativePath(AssetDatabase.getAssetFilePath(%assetId)); + + //clean up the path + %assetPath = strreplace(%assetPath, "\\\\", "\\"); + %assetPath = strreplace(%assetPath, "\\", "\\"); + %assetPath = strreplace(%assetPath, "//", "\\"); + + %assetBasePath = filePath(%assetPath); + + %foldersCount = getTokenCount(%assetBasePath, "/"); + + //Build our directory structure + %prevFolderID = 0; + for(%f=0; %f < %foldersCount; %f++) + { + %folderName = getToken(%assetBasePath, "/", %f); + + %folderID = AssetBrowser-->filterTree.findChildItemByName(%prevFolderID, %folderName); + + if(%folderID == -1 || %folderID == 0) + { + %pathCache = ""; + + for(%c=0; %c < %f; %c++) + { + %pathCache = %c == 0 ? getToken(%assetBasePath, "/", %c) : %pathCache @ "/" @ getToken(%assetBasePath, "/", %c); + } + + %folderID = AssetBrowser-->filterTree.insertItem(%prevFolderID, %folderName, %pathCache, "", 1, 1); + } + + %prevFolderID = %folderID; + } + + //first, get the asset's module, as our major categories + %module = AssetDatabase.getAssetModule(%assetId); + + %moduleName = %module.moduleId; + + %moduleGroup = %module.Group; + if((%moduleGroup $= "Core" || %moduleGroup $= "Tools") && !%this.coreModulesFilter) + continue; + + //first, see if this module Module is listed already + /*%moduleItemId = AssetBrowser-->filterTree.findItemByName(%moduleName); + + //if(%moduleItemId == 0) + // %moduleItemId = AssetBrowser-->filterTree.insertItem(1, %moduleName, "", "", 1, 1); + + %assetType = AssetDatabase.getAssetCategory(%assetId); + + if(%assetType $= "") + { + %assetType = AssetDatabase.getAssetType(%assetId); + if(%assetType $= "") + %assetType = "Misc"; + } + + if(AssetBrowser.assetTypeFilter !$= "" && AssetBrowser.assetTypeFilter !$= %assetType) + continue; + + %assetTypeId = AssetBrowser-->filterTree.findChildItemByName(%moduleItemId, %assetType); + + if(%assetTypeId == 0) + %assetTypeId = AssetBrowser-->filterTree.insertItem(%moduleItemId, %assetType);*/ + //} + + AssetBrowser-->filterTree.buildVisibleTree(true); + + /*if(%this.treeFilterMode $= "list") { //First, build our our list of active modules %modulesList = ModuleDatabase.findModules(true); @@ -457,9 +723,9 @@ function AssetBrowser::loadFilters( %this ) else if(%this.treeFilterMode $= "tags") { - } + }*/ - %this.collapseTree(); + //%this.collapseTree(); //Remove any modules that have no assets if we have that filter on if(%this.onlyShowModulesWithAssets) @@ -484,7 +750,12 @@ function AssetBrowser::loadFilters( %this ) AssetBrowser.newModuleId = ""; } - %selectedItem = AssetBrowser-->filterTree.getSelectedItem(); + %dataItem = AssetBrowser-->filterTree.findItemByName("Data"); + AssetBrowser-->filterTree.expandItem(%dataItem); + + AssetBrowser.expandTreeToAddress(AssetBrowser.currentAddress); + + %selectedItem = AssetBrowser.getFolderTreeItemFromAddress(AssetBrowser.currentAddress); AssetBrowser-->filterTree.scrollVisibleByObjectId(%selectedItem); AssetBrowser-->filterTree.buildVisibleTree(); @@ -541,9 +812,12 @@ function AssetBrowser::createFilter( %this, %filter ) function AssetBrowser::updateSelection( %this, %asset, %moduleName ) { - // the material selector will visually update per material information - // after we move away from the material. eg: if we remove a field from the material, - // the empty checkbox will still be there until you move fro and to the material again + //If we're navigating a folder, just nav to it and be done + /*if(isDirectory(%moduleName)) + { + AssetBrowser.navigateTo(%moduleName @ "/" @ %asset); + return; + }*/ %isAssetBorder = 0; eval("%isAssetBorder = isObject(AssetBrowser-->"@%asset@"Border);"); @@ -786,11 +1060,14 @@ function AssetBrowser::reImportAsset(%this) } } -//------------------------------------------------------------------------------ +// +// +// RMB context popups function AssetPreviewButton::onRightClick(%this) { AssetBrowser.selectedAssetPreview = %this.getParent(); EditAssetPopup.assetId = %this.getParent().moduleName @ ":" @ %this.getParent().assetName; + EditAssetPopup.assetType = %this.getParent().assetType; %assetType = %this.getParent().assetType; //Do some enabling/disabling of options depending on asset type @@ -813,123 +1090,23 @@ function AssetPreviewButton::onRightClick(%this) if(%assetType $= "LevelAsset") EditLevelAssetPopup.showPopup(Canvas); + else if(%assetType $= "Folder") + EditFolderPopup.showPopup(Canvas); else EditAssetPopup.showPopup(Canvas); + + if(%assetType $= "Folder") + { + EditAssetPopup.assetId = %this.getParent().moduleName @ "/" @ %this.getParent().assetName; + } } -function AssetListPanel::onRightMouseDown(%this) +//function AssetListPanel::onRightMouseDown(%this) +function AssetListPanelInputs::onRightMouseDown(%this) { AddNewAssetPopup.showPopup(Canvas); } -//------------------------------------------------------------------------------ -function AssetBrowser::refreshPreviews(%this) -{ - AssetBrowserFilterTree.onSelect(AssetBrowser.selectedItem); -} - -function AssetBrowserFilterTree::onSelect(%this, %itemId) -{ - if(%itemId == 1) - //can't select root - return; - - //Make sure we have an actual module selected! - %parentId = %this.getParentItem(%itemId); - - if(%parentId != 1) - AssetBrowser.selectedModule = %this.getItemText(%parentId);//looks like we have one of the categories selected, not the module. Nab the parent so we have the correct thing! - else - AssetBrowser.selectedModule = %this.getItemText(%itemId); - - AssetBrowser.selectedItem = %itemId; - - //alright, we have a module or sub-filter selected, so now build our asset list based on that filter! - echo("Asset Browser Filter Tree selected filter #:" @ %itemId); - - // manage schedule array properly - if(!isObject(MatEdScheduleArray)) - new ArrayObject(MatEdScheduleArray); - - // if we select another list... delete all schedules that were created by - // previous load - for( %i = 0; %i < MatEdScheduleArray.count(); %i++ ) - cancel(MatEdScheduleArray.getKey(%i)); - - // we have to empty out the list; so when we create new schedules, these dont linger - MatEdScheduleArray.empty(); - - // we have to empty out the list; so when we create new guicontrols, these dont linger - AssetPreviewArray.empty(); - AssetBrowser-->materialSelection.deleteAllObjects(); - //AssetBrowser-->materialPreviewPagesStack.deleteAllObjects(); - - %assetArray = new ArrayObject(); - - //First, Query for our assets - %assetQuery = new AssetQuery(); - %numAssetsFound = AssetDatabase.findAllAssets(%assetQuery); - - //module name per our selected filter: - %moduleItemId = %this.getParentItem(%itemId); - - //check if we've selected a Module - if(%moduleItemId == 1) - { - %FilterModuleName = %this.getItemText(%itemId); - } - else - { - %FilterModuleName = %this.getItemText(%moduleItemId); - } - - //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); - - //first, get the asset's module, as our major categories - %module = AssetDatabase.getAssetModule(%assetId); - - %moduleName = %module.moduleId; - - if(%FilterModuleName $= %moduleName) - { - //it's good, so test that the category is right! - %assetType = AssetDatabase.getAssetCategory(%assetId); - if(%assetType $= "") - { - %assetType = AssetDatabase.getAssetType(%assetId); - } - - if(%this.getItemText(%itemId) $= %assetType || (%assetType $= "" && %this.getItemText(%itemId) $= "Misc") - || %moduleItemId == 1) - { - //stop adding after previewsPerPage is hit - %assetName = AssetDatabase.getAssetName(%assetId); - - %searchText = AssetBrowserSearchFilter.getText(); - if(%searchText !$= "\c2Filter...") - { - if(strstr(strlwr(%assetName), strlwr(%searchText)) != -1) - %assetArray.add( %moduleName, %assetId); - } - else - { - //got it. - %assetArray.add( %moduleName, %assetId ); - } - } - } - } - - AssetBrowser.currentPreviewPage = 0; - AssetBrowser.totalPages = 1; - - for(%i=0; %i < %assetArray.count(); %i++) - AssetBrowser.buildPreviewArray( %assetArray.getValue(%i), %assetArray.getKey(%i) ); -} - function AssetBrowserFilterTree::onRightMouseDown(%this, %itemId) { if( %this.getSelectedItemsCount() > 0 && %itemId != 1) @@ -973,7 +1150,166 @@ function AssetBrowserFilterTree::onRightMouseDown(%this, %itemId) // // -function AssetBrowserSearchFilterText::onWake( %this ) +// +function AssetBrowser::showVisibiltyOptions(%this) +{ + BrowserVisibilityPopup.showPopup(Canvas); +} + +function AssetBrowser::showFilterOptions(%this) +{ + +} + +// +// +// Preview tile handling +function AssetBrowser::setPreviewSize(%this, %size) +{ + AssetPreviewSizePopup.checkItem(0, false); + AssetPreviewSizePopup.checkItem(1, false); + AssetPreviewSizePopup.checkItem(2, false); + + %this.previewSize = 80; //default to small + + if(%size $= "Small") + { + %this.previewSize = 80; + AssetPreviewSizePopup.checkItem(0, true); + } + else if(%size $= "Medium") + { + %this.previewSize = 120; + AssetPreviewSizePopup.checkItem(1, true); + } + else if(%size $= "Large") + { + %this.previewSize = 160; + AssetPreviewSizePopup.checkItem(2, false); + } + + EditorSettings.setValue("Assets/Browser/previewTileSize", %size); + + %this.refreshPreviews(); +} + +function AssetBrowser::refreshPreviews(%this) +{ + AssetBrowserFilterTree.onSelect(AssetBrowser.selectedItem); +} + +function AssetBrowserFilterTree::onSelect(%this, %itemId) +{ + if(%itemId == 1) + //can't select root + return; + + //Make sure we have an actual module selected! + %parentId = %this.getParentItem(%itemId); + + %breadcrumbPath = %this.getItemValue(%itemId); + if(%breadcrumbPath !$= "") + %breadcrumbPath = %breadcrumbPath @ "/" @ %this.getItemText(%itemId); + else + %breadcrumbPath = %this.getItemText(%itemId); + + AssetBrowser.navigateTo(%breadcrumbPath); +} + +function AssetBrowser::rebuildAssetArray(%this) +{ + %breadcrumbPath = AssetBrowser.currentAddress; + + // we have to empty out the list; so when we create new guicontrols, these dont linger + AssetBrowser-->assetList.deleteAllObjects(); + AssetPreviewArray.empty(); + + %assetArray = new ArrayObject(); + + //First, Query for our assets + %assetQuery = new AssetQuery(); + %numAssetsFound = AssetDatabase.findAllAssets(%assetQuery); + + //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, "//", "/"); + + if(%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); + } + + /*if(%this.getItemText(%itemId) $= %assetType || (%assetType $= "" && %this.getItemText(%itemId) $= "Misc") + || %moduleItemId == 1) + {*/ + //stop adding after previewsPerPage is hit + %assetName = AssetDatabase.getAssetName(%assetId); + + %searchText = AssetBrowserSearchFilter.getText(); + if(%searchText !$= "Search Assets...") + { + if(strstr(strlwr(%assetName), strlwr(%searchText)) != -1) + %assetArray.add( %moduleName, %assetId); + } + else + { + //got it. + %assetArray.add( %moduleName, %assetId ); + } + //} + } + } + + //Add folders + if(EditorSettings.value("Assets/Browser/showFolders", true) == true) + { + %folders = getDirectoryList(%breadcrumbPath); + for(%f=0; %f < getFieldCount(%folders); %f++) + { + %folderName = getField(%folders, %f); + + %searchText = AssetBrowserSearchFilter.getText(); + if(%searchText !$= "Search Assets...") + { + if(strstr(strlwr(%folderName), strlwr(%searchText)) != -1) + %assetArray.add( %breadcrumbPath, %folderName ); + } + else + { + //got it. + %assetArray.add( %breadcrumbPath, %folderName ); + } + } + } + + AssetBrowser.currentPreviewPage = 0; + AssetBrowser.totalPages = 1; + + for(%i=0; %i < %assetArray.count(); %i++) + AssetBrowser.buildPreviewArray( %assetArray.getValue(%i), %assetArray.getKey(%i) ); + + AssetBrowser_FooterText.text = %assetArray.count() @ " Assets"; +} + +// +// +// Search Filters +function AssetBrowserSearchFilterTxt::onWake( %this ) { /*%filter = %this.treeView.getFilterText(); if( %filter $= "" ) @@ -982,45 +1318,175 @@ function AssetBrowserSearchFilterText::onWake( %this ) %this.setText( %filter );*/ } -//------------------------------------------------------------------------------ - -function AssetBrowserSearchFilterText::onGainFirstResponder( %this ) +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 AssetBrowserSearchFilterText::onReturn( %this ) +function AssetBrowserFolderSearchFilter::onReturn( %this ) { %text = %this.getText(); if( %text $= "" ) %this.reset(); - else + + AssetBrowser.loadFilters(); +} + +function AssetBrowserSearchFilter::onReturn( %this ) +{ + %text = %this.getText(); + if( %text $= "" ) + %this.reset(); + + AssetBrowser.rebuildAssetArray(); +} + +function AssetBrowserFolderSearchFilter::reset( %this ) +{ + %this.setText( "Search Folders..." ); + + AssetBrowser.loadFilters(); +} + +function AssetBrowserSearchFilter::reset( %this ) +{ + %this.setText( "Search Assets..." ); + + AssetBrowser.rebuildAssetArray(); +} + +function AssetBrowser_ClearFolderFilterBtn::onClick( %this ) +{ + AssetBrowserFolderSearchFilter.reset(); +} + +function AssetBrowser_ClearAssetFilterBtn::onClick( %this ) +{ + AssetBrowserSearchFilter.reset(); +} +// +// +// Navigation +function AssetBrowser::navigateTo(%this, %address, %historyNav) +{ + //Don't bother navigating if it's to the place we already are + if(AssetBrowser.currentAddress $= %address) + return; + + //clear the breadcrumb bar + AssetBrowser_BreadcrumbBar.clear(); + + //break down the address + %folderCount = getTokenCount(%address, "/"); + + %rebuiltPath = ""; + for(%f=0; %f < %folderCount; %f++) { - //%this.treeView.setFilterText( %text ); - %curItem = AssetBrowserFilterTree.getSelectedItem(); - AssetBrowserFilterTree.onSelect(%curItem); + %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; + bitmap = "tools/gui/images/rightArrowWhite"; + bitmapMode = "Centered"; + extent = "25" SPC AssetBrowser_BreadcrumbBar.extent.y; + //command = "AssetBrowser.navigateTo(\"" @ %rebuiltPath @ "\");"; + }; + + AssetBrowser_BreadcrumbBar.add(%folderSpacerButton); + } } + + //find our folder tree and action on it tree + %folderId = AssetBrowser.getFolderTreeItemFromAddress(%address); + + %oldAddress = AssetBrowser.currentAddress; + AssetBrowser.currentAddress = %address; + AssetBrowser.selectedItem = %folderId; + + AssetBrowser-->filterTree.clearSelection(); + AssetBrowser-->filterTree.selectItem(%folderId); + + //remove any history records that are 'newer' than this one + if(%historyNav $= "") + { + AssetBrowser_NavForeHistoryList.empty(); + + if(%oldAddress !$= "") + AssetBrowser_NavPrevHistoryList.push_front(%oldAddress); + } + + //refresh the nav buttons to display the history + %backButtonHistory = ""; + for(%i=0; %i < AssetBrowser_NavPrevHistoryList.Count(); %i++) + { + %prevAddress = AssetBrowser_NavPrevHistoryList.getKey(%i); + %backButtonHistory = %i==0 ? %prevAddress @ "\n" : %backButtonHistory @ %prevAddress @ "\n"; + } + + AssetBrowser_NavigateBackBtn.tooltip = %backButtonHistory; + + %foreButtonHistory = ""; + for(%i=0; %i < AssetBrowser_NavForeHistoryList.Count(); %i++) + { + %prevAddress = AssetBrowser_NavForeHistoryList.getKey(%i); + %foreButtonHistory = %i==0 ? %prevAddress @ "\n" : %foreButtonHistory @ %prevAddress @ "\n"; + } + + AssetBrowser_NavigateForwardBtn.tooltip = %foreButtonHistory; + + %module = AssetBrowser.getModuleFromAddress(%address); + if(%module !$= "") + { + //legit module, so set it as current target + AssetBrowser.SelectedModule = %module.moduleId; + } + + %this.rebuildAssetArray(); } -//--------------------------------------------------------------------------------------------- - -function AssetBrowserSearchFilterText::reset( %this ) +function AssetBrowser::navigateHistoryForward(%this) { - %this.setText( "\c2Filter..." ); - //%this.treeView.clearFilterText(); - %curItem = AssetBrowserFilterTree.getSelectedItem(); - AssetBrowserFilterTree.onSelect(%curItem); + if(AssetBrowser_NavForeHistoryList.count() == 0) + return; + + %newAddress = AssetBrowser_NavForeHistoryList.getKey(0); + %prevHistory = AssetBrowser.currentAddress; + + AssetBrowser_NavPrevHistoryList.push_front(%prevHistory); + AssetBrowser_NavForeHistoryList.pop_front(); + + %this.navigateTo(%newAddress, true); } -//--------------------------------------------------------------------------------------------- - -function AssetBrowserSearchFilterText::onClick( %this ) +function AssetBrowser::navigateHistoryBack(%this) { - %this.textCtrl.reset(); + if(AssetBrowser_NavPrevHistoryList.count() == 0) + return; + + %newAddress = AssetBrowser_NavPrevHistoryList.getKey(0); + %foreHistory = AssetBrowser.currentAddress; + + AssetBrowser_NavForeHistoryList.push_front(%foreHistory); + AssetBrowser_NavPrevHistoryList.pop_front(); + + %this.navigateTo(%newAddress, true); } // @@ -1054,8 +1520,114 @@ function AssetBrowser::reloadModules(%this) //ModuleDatabase.loadGroup("Game"); } -// +function AssetBrowser::getModuleFromAddress(%this, %address) +{ + //break down the address + %folderCount = getTokenCount(%address, "/"); + + for(%f=0; %f < %folderCount; %f++) + { + %folderName = getToken(%address, "/", %f); + + %module = ModuleDatabase.findModule(%folderName); + if(%module !$= "") + return %module; + } + + return ""; +} + +//AssetBrowser.getFolderTreeItemFromAddress(AssetBrowser.currentAddress); +function AssetBrowser::getFolderTreeItemFromAddress(%this, %address) +{ + //break down the address + %folderCount = getTokenCount(%address, "/"); + + %curItem = 0; + %rebuiltPath = ""; + for(%f=0; %f < %folderCount; %f++) + { + %folderName = getToken(%address, "/", %f); + %curItem = AssetBrowser-->filterTree.findChildItemByName(%curItem, %folderName); + } + + return %curItem; +} + +function AssetBrowser::expandTreeToAddress(%this, %address) +{ + //break down the address + %folderCount = getTokenCount(%address, "/"); + AssetBrowser-->filterTree.expandItem(0); + + %curItem = 0; + %rebuiltPath = ""; + for(%f=0; %f < %folderCount; %f++) + { + %folderName = getToken(%address, "/", %f); + %curItem = AssetBrowser-->filterTree.findChildItemByName(%curItem, %folderName); + AssetBrowser-->filterTree.expandItem(%curItem); + } +} +// +// +// +function AssetBrowser::createNewFolder(%this) +{ + %newFolderIdx = ""; + %matched = true; + %newFolderPath = ""; + while(%matched == true) + { + %newFolderPath = AssetBrowser.currentAddress @ "/NewFolder" @ %newFolderIdx; + if(!isDirectory(%newFolderPath)) + { + %matched = false; + } + else + { + %newFolderIdx++; + } + } + + //make a dummy file + %file = new FileObject(); + %file.openForWrite(%newFolderPath @ "/test"); + %file.close(); + + fileDelete(%newFolderPath @ "/test"); + + //refresh the directory + %this.loadFilters(); + %this.rebuildAssetArray(); +} + +// +// +// +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 function AssetPreviewButton::onMouseDragged(%this) { %payload = new GuiBitmapButtonCtrl(); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs index 0a66779da..ab5e1832d 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs @@ -85,6 +85,7 @@ function AssetBrowser::onBeginDropFiles( %this ) //prep the import control Canvas.pushDialog(AssetImportCtrl); AssetImportCtrl.setHidden(true); + ImportAssetTree.clear(); ImportAssetTree.insertItem(0, "Importing Assets"); AssetBrowser.unprocessedAssetsCount = 0; @@ -161,136 +162,39 @@ function AssetBrowser::onDropZipFile(%this, %filePath) } } -function AssetBrowser::onDropImageFile(%this, %filePath) -{ - if(!%this.isVisible()) - return; - - // File Information madness - %fileName = %filePath; - %fileOnlyName = fileName( %fileName ); - %fileBase = validateDatablockName(fileBase( %fileName ) @ "ImageMap"); - - // [neo, 5/17/2007 - #3117] - // Check if the file being dropped is already in data/images or a sub dir by checking if - // the file path up to length of check path is the same as check path. - %defaultPath = EditorSettings.value( "WorldEditor/defaultMaterialsPath" ); - - %checkPath = expandFilename( "^"@%defaultPath ); - %fileOnlyPath = expandFileName( %filePath ); //filePath( expandFileName( %filePath ) ); - %fileBasePath = getSubStr( %fileOnlyPath, 0, strlen( %checkPath ) ); - - if( %checkPath !$= %fileBasePath ) - { - // No match so file is from outside images directory and we need to copy it in - %fileNewLocation = expandFilename("^"@%defaultPath) @ "/" @ fileBase( %fileName ) @ fileExt( %fileName ); - - // Move to final location - if( !pathCopy( %filePath, %fileNewLocation ) ) - return; - } - else - { - // Already in images path somewhere so just link to it - %fileNewLocation = %filePath; - } - - addResPath( filePath( %fileNewLocation ) ); - - %matName = fileBase( %fileName ); - - // Create Material - %imap = new Material(%matName) - { - mapTo = fileBase( %matName ); - diffuseMap[0] = %defaultPath @ "/" @ fileBase( %fileName ) @ fileExt( %fileName ); - }; - //%imap.setName( %fileBase ); - //%imap.imageName = %fileNewLocation; - //%imap.imageMode = "FULL"; - //%imap.filterPad = false; - //%imap.compile(); - - %diffusecheck = %imap.diffuseMap[0]; - - // Bad Creation! - if( !isObject( %imap ) ) - return; - - %this.addDatablock( %fileBase, false ); -} - -function AssetBrowser::onDropSoundFile(%this, %filePath) -{ - if(!%this.isVisible()) - return; - - // File Information madness - %fileName = %filePath; - %fileOnlyName = fileName( %fileName ); - %fileBase = validateDatablockName(fileBase( %fileName ) @ "ImageMap"); - - // [neo, 5/17/2007 - #3117] - // Check if the file being dropped is already in data/images or a sub dir by checking if - // the file path up to length of check path is the same as check path. - %defaultPath = EditorSettings.value( "WorldEditor/defaultMaterialsPath" ); - - %checkPath = expandFilename( "^"@%defaultPath ); - %fileOnlyPath = expandFileName( %filePath ); //filePath( expandFileName( %filePath ) ); - %fileBasePath = getSubStr( %fileOnlyPath, 0, strlen( %checkPath ) ); - - if( %checkPath !$= %fileBasePath ) - { - // No match so file is from outside images directory and we need to copy it in - %fileNewLocation = expandFilename("^"@%defaultPath) @ "/" @ fileBase( %fileName ) @ fileExt( %fileName ); - - // Move to final location - if( !pathCopy( %filePath, %fileNewLocation ) ) - return; - } - else - { - // Already in images path somewhere so just link to it - %fileNewLocation = %filePath; - } - - addResPath( filePath( %fileNewLocation ) ); - - %matName = fileBase( %fileName ); - - // Create Material - %imap = new Material(%matName) - { - mapTo = fileBase( %matName ); - diffuseMap[0] = %defaultPath @ "/" @ fileBase( %fileName ) @ fileExt( %fileName ); - }; - //%imap.setName( %fileBase ); - //%imap.imageName = %fileNewLocation; - //%imap.imageMode = "FULL"; - //%imap.filterPad = false; - //%imap.compile(); - - %diffusecheck = %imap.diffuseMap[0]; - - // Bad Creation! - if( !isObject( %imap ) ) - return; - - %this.addDatablock( %fileBase, false ); -} - function AssetBrowser::onEndDropFiles( %this ) { if(!%this.isVisible()) return; - - //we have assets to import, so go ahead and display the window for that now - AssetImportCtrl.setHidden(false); - ImportAssetWindow.visible = true; - //ImportAssetWindow.validateAssets(); + ImportAssetWindow.refresh(); - ImportAssetWindow.selectWindow(); + %hasIssues = ImportAssetWindow.validateAssets(); + + //If we have a valid config file set and we've set to auto-import, and we have no + //issues for importing, then go ahead and run the import immediately, don't + //bother showing the window. + //If any of these conditions fail, we'll display the import window so it can be handled + //by the user + if(ImportAssetWindow.importConfigsList.count() != 0 && + EditorSettings.value("Assets/AssetImporDefaultConfig") !$= "" && + EditorSettings.value("Assets/AutoImport", false) == true + && %hasIssues == false) + { + AssetImportCtrl.setHidden(true); + ImportAssetWindow.visible = false; + + //Go ahead and check if we have any issues, and if not, run the import! + ImportAssetWindow.ImportAssets(); + } + else + { + //we have assets to import, so go ahead and display the window for that now + AssetImportCtrl.setHidden(false); + ImportAssetWindow.visible = true; + ImportAssetWindow.selectWindow(); + } + // Update object library GuiFormManager::SendContentMessage($LBCreateSiderBar, %this, "refreshAll 1"); @@ -503,9 +407,6 @@ function ImportAssetWindow::onWake(%this) //Lets refresh our list if(!ImportAssetWindow.isVisible()) return; - - $AssetBrowser::importConfigsFile = "tools/assetBrowser/assetImportConfigs.xml"; - $AssetBrowser::currentImportConfig = ""; if(!isObject(AssetImportSettings)) { @@ -526,7 +427,11 @@ function ImportAssetWindow::onWake(%this) function ImportAssetWindow::reloadImportOptionConfigs(%this) { - ImportAssetWindow.importConfigsList = new ArrayObject(); + if(!isObject(ImportAssetWindow.importConfigsList)) + ImportAssetWindow.importConfigsList = new ArrayObject(); + else + ImportAssetWindow.importConfigsList.empty(); + ImportAssetConfigList.clear(); %xmlDoc = new SimXMLDocument(); @@ -1168,10 +1073,12 @@ function ImportAssetWindow::validateAssets(%this) //Clear any status %this.resetAssetsValidationStatus(); + ImportAssetWindow.importIssues = false; + %id = ImportAssetTree.getChild(1); %hasIssues = %this.validateAsset(%id); - if(%hasIssues) + if(ImportAssetWindow.importIssues == false) return false; else return true; @@ -1179,6 +1086,7 @@ function ImportAssetWindow::validateAssets(%this) function ImportAssetWindow::validateAsset(%this, %id) { + %moduleName = ImportAssetModuleList.getText(); while (%id > 0) @@ -1229,21 +1137,17 @@ function ImportAssetWindow::validateAsset(%this, %id) { %foundCollision = true; - %assetItem.status = "Warning"; + %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!"; - //Clean up our queries - %assetQuery.delete(); break; } } if(%foundCollision == true) { - %hasIssues = true; - //yup, a collision, prompt for the change and bail out /*MessageBoxOK( "Error!", "Duplicate asset names found with the target module!\nAsset \"" @ %assetItemA.assetName @ "\" of type \"" @ %assetItemA.assetType @ "\" has a matching name.\nPlease rename it and try again!");*/ @@ -1259,7 +1163,6 @@ function ImportAssetWindow::validateAsset(%this, %id) //Check if we were given a file path(so not generated) but somehow isn't a valid file if(%assetItem.filePath !$= "" && !%assetItem.generatedAsset && !isFile(%assetItem.filePath)) { - %hasIssues = true; %assetItem.status = "error"; %assetItem.statusType = "MissingFile"; %assetItem.statusInfo = "Unable to find file to be imported. Please select asset file."; @@ -1273,6 +1176,9 @@ function ImportAssetWindow::validateAsset(%this, %id) } } + if(%assetItem.status $= "error") + ImportAssetWindow.importIssues = true; + if(ImportAssetTree.isParentItem(%id)) { %childItem = ImportAssetTree.getChild(%id); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImportConfig.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImportConfig.cs index f81ef5e04..842f442f9 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImportConfig.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImportConfig.cs @@ -9,7 +9,9 @@ function ImportAssetConfigList::onSelect( %this, %id, %text ) ImportAssetWindow.activeImportConfigIndex = %id; ImportAssetWindow.activeImportConfig = ImportAssetWindow.importConfigsList.getKey(%id); - AssetBrowser.reloadImportingFiles(); + //If we were trying to import anything, refresh it with the new config + if( AssetBrowser.importingFilesArray.count() != 0) + AssetBrowser.reloadImportingFiles(); } function setupImportConfigSettingsList() @@ -428,8 +430,9 @@ function ImportOptionsConfigList::changeEditorSetting(%this, %varName, %value) if(%oldValue !$= %value) { - %id = %this.getSelectedRow(); - %this.setSelectedRow(%id); + %scollPos = ImportAssetConfigEditorScroll.getScrollPosition(); + ImportAssetConfigEditorWindow.populateConfigList(ImportAssetWindow.activeImportConfig); + ImportAssetConfigEditorScroll.setScrollPosition(%scollPos.x, %scollPos.y); } } diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/component.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/component.cs index f0ba4d228..8c6ea6809 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/component.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/component.cs @@ -76,7 +76,7 @@ function AssetBrowser::duplicateComponentAsset(%this, %assetId) } -function AssetBrowser::renameGameObjectAsset(%this, %assetDef, %newAssetId, %originalName, %newName) +function AssetBrowser::renameComponentAsset(%this, %assetDef, %newAssetId, %originalName, %newName) { %assetPath = AssetDatabase.getAssetFilePath(%newAssetId); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/gui.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/gui.cs index 1a5075afb..d6c7dbdc6 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/gui.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/gui.cs @@ -5,9 +5,11 @@ function AssetBrowser::createGUIAsset(%this) %assetName = AssetBrowser.newAssetSettings.assetName; - %tamlpath = %modulePath @ "/GUIs/" @ %assetName @ ".asset.taml"; - %guipath = %modulePath @ "/GUIs/" @ %assetName @ ".gui"; - %scriptPath = %modulePath @ "/GUIs/" @ %assetName @ ".cs"; + %assetPath = AssetBrowser.currentAddress @ "/"; + + %tamlpath = %assetPath @ %assetName @ ".asset.taml"; + %guipath = %assetPath @ %assetName @ ".gui"; + %scriptPath = %assetPath @ %assetName @ ".cs"; %asset = new GUIAsset() { diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.cs index f5dbd9f76..7b65619cf 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.cs @@ -117,7 +117,7 @@ function AssetBrowser::importImageAsset(%this, %assetItem) %assetImportSuccessful = false; %assetId = %moduleName@":"@%assetName; - %assetPath = "data/" @ %moduleName @ "/Images"; + %assetPath = AssetBrowser.currentAddress @ "/"; %assetFullPath = %assetPath @ "/" @ fileName(%filePath); %newAsset = new ImageAsset() diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/level.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/level.cs index ba8b92b5a..4ea263cf6 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/level.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/level.cs @@ -5,14 +5,20 @@ function AssetBrowser::createLevelAsset(%this) %assetName = AssetBrowser.newAssetSettings.assetName; - %tamlpath = %modulePath @ "/levels/" @ %assetName @ ".asset.taml"; - %levelPath = %modulePath @ "/levels/" @ %assetName @ ".mis"; + %assetPath = AssetBrowser.currentAddress @ "/"; + + %tamlpath = %assetPath @ %assetName @ ".asset.taml"; + %levelPath = %assetPath @ %assetName @ ".mis"; %asset = new LevelAsset() { AssetName = %assetName; versionId = 1; LevelFile = %assetName @ ".mis"; + DecalsFile = %assetName @ ".mis.decals"; + PostFXPresetFile = %assetName @ ".postfxpreset.cs"; + ForestFile = %assetName @ ".forest"; + NavmeshFile = %assetName @ ".nav"; LevelName = AssetBrowser.newAssetSettings.levelName; AssetDescription = AssetBrowser.newAssetSettings.description; PreviewImage = AssetBrowser.newAssetSettings.levelPreviewImage; @@ -24,6 +30,10 @@ function AssetBrowser::createLevelAsset(%this) { echo("Unable to copy template level file!"); } + + //Generate the associated files + DecalManagerSave( %assetPath @ %asset.DecalsFile ); + PostFXManager::savePresetHandler( %assetPath @ %asset.PostFXPresetFile ); %moduleDef = ModuleDatabase.findModule(%moduleName, 1); AssetDatabase.addDeclaredAsset(%moduleDef, %tamlpath); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs index b5a95865a..6463da6e4 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs @@ -278,10 +278,10 @@ function AssetBrowser::importMaterialAsset(%this, %assetItem) %assetImportSuccessful = false; %assetId = %moduleName@":"@%assetName; - %assetPath = "data/" @ %moduleName @ "/materials"; - %tamlpath = %assetPath @ "/" @ %assetName @ ".asset.taml"; - %sgfPath = %assetPath @ "/" @ %assetName @ ".sgf"; - %scriptPath = %assetPath @ "/" @ %assetName @ ".cs"; + %assetPath = AssetBrowser.currentAddress @ "/"; + %tamlpath = %assetPath @ %assetName @ ".asset.taml"; + %sgfPath = %assetPath @ %assetName @ ".sgf"; + %scriptPath = %assetPath @ %assetName @ ".cs"; %newAsset = new MaterialAsset() { diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/script.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/script.cs index a11373a20..c6cf48e09 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/script.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/script.cs @@ -3,10 +3,12 @@ function AssetBrowser::createScriptAsset(%this) %moduleName = AssetBrowser.newAssetSettings.moduleName; %modulePath = "data/" @ %moduleName; - %assetName = AssetBrowser.newAssetSettings.assetName; + %assetName = AssetBrowser.newAssetSettings.assetName; - %tamlpath = %modulePath @ "/scripts/" @ %assetName @ ".asset.taml"; - %scriptPath = %modulePath @ "/scripts/" @ %assetName @ ".cs"; + %assetPath = AssetBrowser.currentAddress @ "/"; + + %tamlpath = %assetPath @ %assetName @ ".asset.taml"; + %scriptPath = %assetPath @ %assetName @ ".cs"; %asset = new ScriptAsset() { diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.cs index 90f3bc4cb..35a2f4343 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.cs @@ -5,8 +5,10 @@ function AssetBrowser::createShapeAsset(%this) %assetName = AssetBrowser.newAssetSettings.assetName; - %tamlpath = %modulePath @ "/shapes/" @ %assetName @ ".asset.taml"; - %shapeFilePath = %modulePath @ "/shapes/" @ %assetName @ ".dae"; + %assetPath = AssetBrowser.currentAddress @ "/"; + + %tamlpath = %assetPath @ %assetName @ ".asset.taml"; + %shapeFilePath = %assetPath @ %assetName @ ".dae"; %asset = new ShapeAsset() { diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.cs index b207f0c7a..a8cfb9701 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.cs @@ -76,7 +76,7 @@ function AssetBrowser::refreshAsset(%this, %assetId) function AssetBrowser::renameAsset(%this) { //Find out what type it is - %assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId); + //%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId); %curFirstResponder = AssetBrowser.getFirstResponder(); @@ -92,36 +92,56 @@ function AssetBrowser::performRenameAsset(%this, %originalAssetName, %newName) //if the name is different to the asset's original name, rename it! if(%originalAssetName !$= %newName) { - %moduleName = AssetBrowser.selectedModule; - - //do a rename! - %success = AssetDatabase.renameDeclaredAsset(%moduleName @ ":" @ %originalAssetName, %moduleName @ ":" @ %newName); - - if(%success) - echo("AssetBrowser - renaming of asset " @ %moduleName @ ":" @ %originalAssetName @ " to " @ %moduleName @ ":" @ %newName @ " was a success."); - else - echo("AssetBrowser - renaming of asset " @ %moduleName @ ":" @ %originalAssetName @ " to " @ %moduleName @ ":" @ %newName @ " was a failure."); - - if(%success) + if(EditAssetPopup.assetType !$= "Folder") { - %newAssetId = %moduleName @ ":" @ %newName; - %assetPath = AssetDatabase.getAssetFilePath(%newAssetId); + %moduleName = AssetBrowser.selectedModule; - //Rename any associated files as well - %assetDef = AssetDatabase.acquireAsset(%newAssetId); - %assetType = %assetDef.getClassName(); + //do a rename! + %success = AssetDatabase.renameDeclaredAsset(%moduleName @ ":" @ %originalAssetName, %moduleName @ ":" @ %newName); - //rename the file to match - %path = filePath(%assetPath); + if(%success) + echo("AssetBrowser - renaming of asset " @ %moduleName @ ":" @ %originalAssetName @ " to " @ %moduleName @ ":" @ %newName @ " was a success."); + else + echo("AssetBrowser - renaming of asset " @ %moduleName @ ":" @ %originalAssetName @ " to " @ %moduleName @ ":" @ %newName @ " was a failure."); - //Do the rename command - %buildCommand = %this @ ".rename" @ %assetType @ "(" @ %assetDef @ "," @ %newAssetId @ ");"; - eval(%buildCommand); + if(%success) + { + %newAssetId = %moduleName @ ":" @ %newName; + %assetPath = AssetDatabase.getAssetFilePath(%newAssetId); + + //Rename any associated files as well + %assetDef = AssetDatabase.acquireAsset(%newAssetId); + %assetType = %assetDef.getClassName(); + + //rename the file to match + %path = filePath(%assetPath); + + //Do the rename command + %buildCommand = %this @ ".rename" @ %assetType @ "(" @ %assetDef @ "," @ %newAssetId @ ");"; + eval(%buildCommand); + } + } + else + { + %buildCommand = %this @ ".renameFolder(\"" @ EditAssetPopup.assetId @ "\",\"" @ %newName @ "\");"; + eval(%buildCommand); } } //Make sure everything is refreshed AssetBrowser.loadFilters(); + + //Update the selection to immediately jump to the new asset + AssetBrowser-->filterTree.clearSelection(); + %ModuleItem = AssetBrowser-->filterTree.findItemByName(%moduleName); + %assetTypeId = AssetBrowser-->filterTree.findChildItemByName(%ModuleItem, %assetType); + + AssetBrowser-->filterTree.selectItem(%assetTypeId); + + %selectedItem = AssetBrowser-->filterTree.getSelectedItem(); + AssetBrowser-->filterTree.scrollVisibleByObjectId(%selectedItem); + + AssetBrowser-->filterTree.buildVisibleTree(); } function AssetNameField::onReturn(%this) @@ -132,6 +152,26 @@ function AssetNameField::onReturn(%this) AssetBrowser.performRenameAsset(%this.originalAssetName, %this.getText()); } +//------------------------------------------------------------ +function AssetBrowser::moveAsset(%this, %destination) +{ + if(EditAssetPopup.assetType $= "Folder") + { + //Do any cleanup required given the type + if(%this.isMethod("moveFolder")) + eval(%this @ ".moveFolder("@EditAssetPopup.assetId@",\""@%destination@"\");"); + } + else + { + %assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId); + %assetType = AssetDatabase.getAssetType(EditAssetPopup.assetType); + + //Do any cleanup required given the type + if(%this.isMethod("move"@%assetType)) + eval(%this @ ".move"@%assetType@"("@%assetDef@");"); + } +} + //------------------------------------------------------------ function AssetBrowser::duplicateAsset(%this, %targetModule) @@ -157,10 +197,10 @@ function AssetBrowser::duplicateAsset(%this, %targetModule) function AssetBrowser::deleteAsset(%this) { //Find out what type it is - %assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId); - %assetType = %assetDef.getClassName(); + //%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId); + //%assetType = %assetDef.getClassName(); - MessageBoxOKCancel("Warning!", "This will delete the selected asset and the files associated to it, do you wish to continue?", + MessageBoxOKCancel("Warning!", "This will delete the selected content and the files associated to it, do you wish to continue?", "AssetBrowser.confirmDeleteAsset();", ""); } @@ -169,14 +209,23 @@ function AssetBrowser::confirmDeleteAsset(%this) %currentSelectedItem = AssetBrowserFilterTree.getSelectedItem(); %currentItemParent = AssetBrowserFilterTree.getParentItem(%currentSelectedItem); - %assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId); - %assetType = AssetDatabase.getAssetType(EditAssetPopup.assetId); - - //Do any cleanup required given the type - if(%this.isMethod("delete"@%assetType)) - eval(%this @ ".delete"@%assetType@"("@%assetDef@");"); - - AssetDatabase.deleteAsset(EditAssetPopup.assetId, false); + if(EditAssetPopup.assetType $= "Folder") + { + //Do any cleanup required given the type + if(%this.isMethod("deleteFolder")) + eval(%this @ ".deleteFolder(\""@EditAssetPopup.assetId@"\");"); + } + else + { + %assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId); + %assetType = AssetDatabase.getAssetType(EditAssetPopup.assetType); + + //Do any cleanup required given the type + if(%this.isMethod("delete"@%assetType)) + eval(%this @ ".delete"@%assetType@"("@%assetDef@");"); + + AssetDatabase.deleteAsset(EditAssetPopup.assetId, false); + } %this.loadFilters(); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/newAsset.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/newAsset.cs index c12a4020e..602f6ce52 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/newAsset.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/newAsset.cs @@ -191,6 +191,18 @@ function CreateNewAsset() %callbackCommand = "" @ AssetBrowser_newAsset.callbackFunc @ "(\"" @ %moduleName @ ":" @ %assetName @ "\");"; eval(%callbackCommand); } + + //Update the selection to immediately jump to the new asset + AssetBrowser-->filterTree.clearSelection(); + %ModuleItem = AssetBrowser-->filterTree.findItemByName(%moduleName); + %assetTypeId = AssetBrowser-->filterTree.findChildItemByName(%ModuleItem, %assetType); + + AssetBrowser-->filterTree.selectItem(%assetTypeId); + + %selectedItem = AssetBrowser-->filterTree.getSelectedItem(); + AssetBrowser-->filterTree.scrollVisibleByObjectId(%selectedItem); + + AssetBrowser-->filterTree.buildVisibleTree(); } function ParentComponentList::onWake(%this) diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs index 704c6daa0..31d317d38 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs @@ -55,15 +55,31 @@ function AssetBrowser::buildPopupMenus(%this) item[ 5 ] = "-"; Item[ 6 ] = "Duplicate Asset" TAB "" TAB "AssetBrowser.duplicateAsset();"; item[ 7 ] = "-"; - item[ 8 ] = "Re-Import Asset" TAB "" TAB "AssetBrowser.reImportAsset();"; - item[ 9 ] = "-"; - item[ 10 ] = "Delete Asset" TAB "" TAB "AssetBrowser.deleteAsset();"; + //item[ 8 ] = "Re-Import Asset" TAB "" TAB "AssetBrowser.reImportAsset();"; + //item[ 9 ] = "-"; + item[ 8 ] = "Delete Asset" TAB "" TAB "AssetBrowser.deleteAsset();"; jumpFileName = ""; jumpLineNumber = ""; }; } + if( !isObject( EditFolderPopup ) ) + { + new PopupMenu( EditFolderPopup ) + { + superClass = "MenuBuilder"; + class = "EditorWorldMenu"; + //isPopup = true; + + item[ 0 ] = "Rename Folder" TAB "" TAB "AssetBrowser.renameAsset();"; + item[ 1 ] = "-"; + Item[ 2 ] = "Duplicate Folder" TAB "" TAB "AssetBrowser.duplicateAsset();"; + item[ 3 ] = "-"; + item[ 4 ] = "Delete Folder" TAB "" TAB "AssetBrowser.deleteAsset();"; + }; + } + if( !isObject( AddNewComponentAssetPopup ) ) { new PopupMenu( AddNewComponentAssetPopup ) @@ -148,15 +164,17 @@ function AssetBrowser::buildPopupMenus(%this) superClass = "MenuBuilder"; class = "EditorWorldMenu"; - item[0] = "Create Code Asset" TAB AddNewScriptAssetPopup; + item[0] = "Create Folder" TAB "" TAB "AssetBrowser.CreateNewFolder();"; item[1] = "-"; - item[2] = "Create Art Asset" TAB AddNewArtAssetPopup; + item[2] = "Create Code Asset" TAB AddNewScriptAssetPopup; item[3] = "-"; - item[4] = "Create Level" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"LevelAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewLevelAsset(\"NewLevel\", AssetBrowser.selectedModule);"; + item[4] = "Create Art Asset" TAB AddNewArtAssetPopup; item[5] = "-"; - item[6] = "Create C++ Asset" TAB AddNewCppAssetPopup; + item[6] = "Create Level" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"LevelAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewLevelAsset(\"NewLevel\", AssetBrowser.selectedModule);"; item[7] = "-"; - item[8] = "Create New Module" TAB "" TAB "AssetBrowser.CreateNewModule();"; + item[8] = "Create C++ Asset" TAB AddNewCppAssetPopup; + item[9] = "-"; + item[10] = "Create New Module" TAB "" TAB "AssetBrowser.CreateNewModule();"; }; } @@ -198,6 +216,38 @@ function AssetBrowser::buildPopupMenus(%this) }; } + //Asset Preview size presets + if( !isObject( AssetPreviewSizePopup ) ) + { + new PopupMenu( AssetPreviewSizePopup ) + { + superClass = "MenuBuilder"; + class = "EditorWorldMenu"; + + item[ 0 ] = "Small" TAB "" TAB "AssetBrowser.setPreviewSize(\"Small\");"; + item[ 1 ] = "Medium" TAB "" TAB "AssetBrowser.setPreviewSize(\"Medium\");"; + Item[ 2 ] = "Large" TAB "" TAB "AssetBrowser.setPreviewSize(\"Large\");"; + }; + + AssetPreviewSizePopup.checkItem(0, true); + } + + if( !isObject( AssetTypeListPopup ) ) + { + new PopupMenu( AssetTypeListPopup ) + { + superClass = "MenuBuilder"; + class = "EditorWorldMenu"; + //isPopup = true; + }; + + /*for(%i=0; %i < AssetFilterTypeList.Count(); %i++) + { + %assetTypeName = AssetFilterTypeList.getKey(%i); + AssetTypeListPopup.insertItem(%i, %assetTypeName, "", "AssetBrowser.toggleAssetTypeFilter(" @ %i @ ");"); + }*/ + } + //Browser visibility menu if( !isObject( BrowserVisibilityPopup ) ) { @@ -208,13 +258,26 @@ function AssetBrowser::buildPopupMenus(%this) //isPopup = true; item[ 0 ] = "Toggle Show Core Modules" TAB "" TAB "AssetBrowser.viewCoreModulesFilter();"; - item[ 1 ] = "Toggle Only Show Modules with Assets" TAB "" TAB "AssetBrowser.viewPopulatedModulesFilter();"; - Item[ 2 ] = "-"; - item[ 3 ] = "Show Assets as list" TAB "" TAB "AssetBrowser.viewListFilter();"; - Item[ 4 ] = "Show Assets with tags" TAB "" TAB "AssetBrowser.viewTagsFilter();"; + item[ 1 ] = "Toggle Show Tools Modules" TAB "" TAB "AssetBrowser.viewToolsModulesFilter();"; + item[ 2 ] = "Toggle Only Show Modules with Assets" TAB "" TAB "AssetBrowser.viewPopulatedModulesFilter();"; + Item[ 3 ] = "-"; + item[ 4 ] = "Show Folders" TAB "" TAB "AssetBrowser.toggleShowingFolders();"; + item[ 5 ] = "Show Empty Folders" TAB "" TAB "AssetBrowser.toggleShowingEmptyFolders();"; + item[ 6 ] = "-"; + item[ 7 ] = "Filter by Asset Type" TAB AssetTypeListPopup; + item[ 8 ] = "-"; + item[ 9 ] = "Enable Auto-refresh" TAB "" TAB "AssetBrowser.toggleAutorefresh();"; + Item[ 10 ] = "-"; + Item[ 11 ] = "Asset Preview Size" TAB AssetPreviewSizePopup; }; + + BrowserVisibilityPopup.enableItem(5, false); + BrowserVisibilityPopup.enableItem(7, false); + BrowserVisibilityPopup.enableItem(9, false); } + // + //Import Legacy menus if( !isObject( ImportAssetsPopup ) ) { @@ -266,6 +329,7 @@ function AssetBrowser::buildPopupMenus(%this) }; } + } function AddNewScriptAssetPopupMenu::onSelectItem(%this, %id, %text) diff --git a/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs b/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs index 7a673d64d..6137b0f64 100644 --- a/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs +++ b/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs @@ -32,6 +32,7 @@ function ESettingsWindow::startup( %this ) %this.addEditorSettingsPage("ShapeEditor", "Shape Editor"); %this.addEditorSettingsPage("NavEditor", "Navigation Editor"); %this.addEditorSettingsPage("Theme", "Theme"); + %this.addEditorSettingsPage("AssetEditing", "Asset Editing"); %this.addGameSettingsPage("GameGeneral", "General"); %this.addGameSettingsPage("Gameplay", "Gameplay"); @@ -185,7 +186,7 @@ function SettingsInspector::changeEditorSetting(%this, %varName, %value) %success = ProjectSettings.write(); if(%oldValue !$= %value) - ESettingsWindow.refresh(); + ESettingsWindow.schedule(15,"refresh"); } function GuiInspectorVariableGroup::buildOptionsSettingField(%this, %fieldName, %fieldLabel, %fieldDesc, %fieldDefaultVal, %fieldDataVals, %ownerObj) @@ -292,6 +293,12 @@ function ESettingsWindow::getGeneralSettings(%this) SettingsInspector.addSettingsField("WorldEditor/Theme/windowTitleFontColor", "Window Title Text Color", "colorI", ""); SettingsInspector.addSettingsField("WorldEditor/Theme/mainTextColor", "Main Text Color", "colorI", ""); SettingsInspector.endGroup(); + + SettingsInspector.startGroup("Layout"); + SettingsInspector.addSettingsField("WorldEditor/Layout/LayoutMode", "Editor Layout Mode", "list", "This dictates which layout style the editor should use." @ + "WARNING - Modern layout is highlight experimental." @ + "Updating this requires a restart of the program", "Classic,Modern"); + SettingsInspector.endGroup(); } function ESettingsWindow::getCameraSettings(%this) @@ -380,6 +387,7 @@ function ESettingsWindow::getThemeSettings(%this) SettingsInspector.addSettingsField("Theme/fieldTextColor", "Field Text Color", "ColorI", ""); SettingsInspector.addSettingsField("Theme/fieldTextHLColor", "Field Text Highlight Color", "ColorI", ""); SettingsInspector.addSettingsField("Theme/fieldTextSELColor", "Field Text Selected Color", "ColorI", ""); + SettingsInspector.addSettingsField("Theme/fieldTextNAColor", "Field Text N/A Color", "ColorI", ""); SettingsInspector.addSettingsField("Theme/fieldBGColor", "Field Background Color", "ColorI", ""); SettingsInspector.addSettingsField("Theme/fieldBGHLColor", "Field Background Highlight Color", "ColorI", ""); @@ -431,9 +439,38 @@ function ESettingsWindow::getAssetManagementSettings(%this) 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(); + + for(%i=0; %i < ImportAssetWindow.importConfigsList.Count(); %i++) + { + %configName = ImportAssetWindow.importConfigsList.getKey(%i); + %formattedConfigList = %i == 0 ? %configName : %formattedConfigList @ "," @ %configName; + } + + SettingsInspector.startGroup("Assets Importing"); + 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.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/previewTileSize", "Asset Preview Tile Size", "bool", ""); + SettingsInspector.endGroup(); +} + function ESettingsWindow::getGameplaySettings(%this) { SettingsInspector.startGroup("Game Modes"); diff --git a/Templates/BaseGame/game/tools/gui/profiles.ed.cs b/Templates/BaseGame/game/tools/gui/profiles.ed.cs index b094a4c4e..b14de3db0 100644 --- a/Templates/BaseGame/game/tools/gui/profiles.ed.cs +++ b/Templates/BaseGame/game/tools/gui/profiles.ed.cs @@ -1109,7 +1109,7 @@ singleton GuiControlProfile( ToolsGuiMenuBarProfile ) fontColor = EditorSettings.value("Theme/headerTextColor"); fontColorSEL = EditorSettings.value("Theme/fieldTextSELColor"); fontColorHL = EditorSettings.value("Theme/fieldTextHLColor"); - fontColorNA = EditorSettings.value("Theme/fieldTextSELColor"); + fontColorNA = EditorSettings.value("Theme/fieldTextNAColor"); border = 0; borderThickness = 1; opaque = true; diff --git a/Templates/BaseGame/game/tools/settings.xml b/Templates/BaseGame/game/tools/settings.xml index 7b5338057..73307a503 100644 --- a/Templates/BaseGame/game/tools/settings.xml +++ b/Templates/BaseGame/game/tools/settings.xml @@ -1,219 +1,247 @@ - - data/FPSGameplay/levels - - - 25 - - - 5 - - - - 0 0 1 - 10 255 0 0 255 - DefaultRoadMaterialOther + 10 DefaultRoadMaterialTop + 0 0 1 + DefaultRoadMaterialOther 0 255 0 255 - 234 232 230 255 72 70 68 255 - 255 255 255 255 - 50 49 48 255 - 100 98 96 255 - 50 49 48 255 - 17 16 15 255 - 96 94 92 255 - 72 70 68 255 + 59 58 57 255 255 255 255 255 43 43 43 255 - 32 31 30 255 - 50 49 48 255 - 178 175 172 255 - 59 58 57 255 + 17 16 15 255 37 36 35 255 - 59 58 57 255 + 32 31 30 255 + 50 49 48 255 + 255 255 255 255 236 234 232 255 + 178 175 172 255 + 72 70 68 255 + 50 49 48 255 + 100 98 96 255 + 59 58 57 255 + 96 94 92 255 + 234 232 230 255 + 77 77 77 255 + 50 49 48 255 - - 1 - 0.8 - 0 - 0 - 100 - 0.8 - 15 - - 0 - 500 - 0 - 10 10 10 - 255 255 255 20 - 0 - + + 1 + 1 + 0 0 0 100 + 1 + 0 + 255 255 255 255 + 135 + 180 180 180 255 + 1 + 1 + 1 + 40 40 + 0 + 45 + 0.1 tools/gui 1024 768 - 0 0 + 0 0 - - Categorized + + 0 - 1 1 + 2 + 1 8 + 1 + 1 0 1 - 1 - 2 - 1 - ../../../Documentation/Torque 3D - Script Manual.chm - ../../../Documentation/Official Documentation.html http://www.garagegames.com/products/torque-3d/documentation/user + ../../../Documentation/Official Documentation.html + ../../../Documentation/Torque 3D - Script Manual.chm 1 1 - - 0 + + Categorized + + + + 0.8 + 0.8 + 0 + 15 + 0 + 1 + 100 + + 0 + 1 + 0 + 1 1 1 + 255 255 255 20 + 500 - 50 - 1 AssetWork_Debug.exe - 0 - 6 - WorldEditorInspectorPlugin - screenCenter 40 - - 1 - 1 - 1 - 1 - 1 - - - 100 100 100 255 - 255 255 255 255 - 255 255 0 255 - 0 255 0 255 - 255 255 0 255 - 255 0 0 255 - 0 0 255 255 - + screenCenter + 6 + 0 + 50 + Modern + 1 + WorldEditorInspectorPlugin 51 51 51 100 102 102 102 100 1 255 255 255 100 - 0 + 1 + + + 1 + 1 + 1 + 1 + 1 - 20 8 - 1 - 0 255 + 20 + 0 + 1 - - ../../../Documentation/Torque 3D - Script Manual.chm - ../../../Documentation/Official Documentation.html - http://www.garagegames.com/products/torque-3d/forums - http://www.garagegames.com/products/torque-3d/documentation/user - - - 0 - 1 - 1 - 100 - 2 - 0 - 0 + + 255 255 0 255 + 255 255 0 255 + 0 0 255 255 + 255 0 0 255 + 255 255 255 255 + 100 100 100 255 + 0 255 0 255 255 255 255 255 - 50 50 50 255 - 48 48 48 255 215 215 215 255 + 48 48 48 255 180 180 180 255 + 50 50 50 255 + + + 0 + 2 + 0 + 1 + 100 + 0 + 1 + + + http://www.garagegames.com/products/torque-3d/documentation/user + http://www.garagegames.com/products/torque-3d/forums + ../../../Documentation/Torque 3D - Script Manual.chm + ../../../Documentation/Official Documentation.html + tools/worldEditor/images/DefaultHandle tools/worldEditor/images/LockedHandle tools/worldEditor/images/SelectHandle - tools/worldEditor/images/DefaultHandle + + + Classic - - 180 180 180 255 - 0 - 0 - 1 - 0.1 - 135 - 1 - 1 - 1 - 255 255 255 255 - 0 0 0 100 - 1 - 45 - 1 - 40 40 + + <AssetType>/<SpecialAssetTag>/ + 1 + <AssetType>/ + <AssetType>/OtherFolder/ + <AssetType>/ + <AssetType>/<AssetName>/ + TestConfig + <AssetType>/ + <AssetType>/ + <AssetType>/ + <AssetType>/<SpecialAssetTag>/ lowerHeight - - 1 - 40 40 - 40 40 - 1 - ellipse - + 1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000 + 1 + 90 + 50 + 0 + 1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000 + 0.1 + 10 100 1 - 0 - 10 - 50 - 90 - 1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000 - 1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000 - 1 - 0.1 + + + 1 + ellipse + 40 40 + 40 40 + 1 - - 0 0 1 - 255 255 255 255 - 255 0 0 255 + 0 255 0 255 + 255 255 255 255 + DefaultDecalRoadMaterial 10 - 5 + + + TestConfig + 0 + + small + + DefaultPlayerData 1 AIPlayer - DefaultPlayerData - - 255 255 255 255 + + 255 0 0 255 10 - DefaultDecalRoadMaterial + 0 0 1 0 255 0 255 + 255 255 255 255 + 5 + + + data/FPSGameplay/levels + + + 5 + + + 25 + + + + + Small Grid_512_Orange diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.cs index 5e7d32893..a3a883b64 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.cs @@ -1885,6 +1885,9 @@ function Editor::open(%this) Canvas.setContent(EditorGui); $isFirstPersonVar = true; EditorGui.syncCameraGui(); + + if(EditorSettings.value("WorldEditor/Layout/LayoutMode", "Classic") $= "Modern") + togglePanelLayout(); } function Editor::close(%this, %gui) diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/editor.ed.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/editor.ed.cs index 98acd2d75..1a05008eb 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/editor.ed.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/editor.ed.cs @@ -164,7 +164,7 @@ function toggleEditor(%make) //------------------------------------------------------------------------------ // The editor action maps are defined in editor.bind.cs -GlobalActionMap.bind(keyboard, "f11", toggleEditor); +GlobalActionMap.bind(keyboard, "f11", fastLoadWorldEdit); // The scenario: From 47f60f9272e3396baf5104ccb02fa858f9f2d9f8 Mon Sep 17 00:00:00 2001 From: Marc Chapman Date: Sun, 20 Oct 2019 09:16:16 +0100 Subject: [PATCH 11/21] Added TerrainSnapOffsetZ back to editor settings --- .../BaseGame/game/tools/worldEditor/scripts/editorPrefs.ed.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/editorPrefs.ed.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/editorPrefs.ed.cs index 876ae120a..891a5988a 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/editorPrefs.ed.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/editorPrefs.ed.cs @@ -60,6 +60,8 @@ EditorSettings.endGroup(); EditorSettings.beginGroup( "Tools" ); EditorSettings.setDefaultValue( "snapGround", "0" ); +EditorSettings.setDefaultValue( "TerrainSnapOffsetZ", "0" ); +EditorSettings.setDefaultValue( "OffsetZValue", "0.01" ); EditorSettings.setDefaultValue( "snapSoft", "0" ); EditorSettings.setDefaultValue( "snapSoftSize", "2.0" ); EditorSettings.setDefaultValue( "boundingBoxCollision", "0" ); From 626a656bcb5695595b215aada7c5b5ea8d0bc6af Mon Sep 17 00:00:00 2001 From: Marc Chapman Date: Sun, 20 Oct 2019 09:48:57 +0100 Subject: [PATCH 12/21] MIssed settings --- .../BaseGame/game/tools/worldEditor/scripts/editorPrefs.ed.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/editorPrefs.ed.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/editorPrefs.ed.cs index 891a5988a..f53243afa 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/editorPrefs.ed.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/editorPrefs.ed.cs @@ -217,6 +217,8 @@ function EditorGui::readWorldEditorSettings(%this) EditorSettings.beginGroup( "Tools" ); EWorldEditor.stickToGround = EditorSettings.value("snapGround"); //$pref::WorldEditor::snapGround; + EWorldEditor.TerrainSnapOffsetZ = EditorSettings.value("TerrainSnapOffsetZ"); //$pref::WorldEditor::TerrainSnapOffsetZ; + EWorldEditor.OffsetZValue = EditorSettings.value("OffsetZValue"); //$pref::WorldEditor::OffsetZValue; EWorldEditor.setSoftSnap( EditorSettings.value("snapSoft") ); //$pref::WorldEditor::snapSoft EWorldEditor.setSoftSnapSize( EditorSettings.value("snapSoftSize") ); //$pref::WorldEditor::snapSoftSize EWorldEditor.boundingBoxCollision = EditorSettings.value("boundingBoxCollision"); //$pref::WorldEditor::boundingBoxCollision; @@ -312,6 +314,8 @@ function EditorGui::writeWorldEditorSettings(%this) EditorSettings.beginGroup( "Tools" ); EditorSettings.setValue( "snapGround", EWorldEditor.stickToGround ); //$Pref::WorldEditor::snapGround + EditorSettings.setValue( "TerrainSnapOffsetZ", EWorldEditor.TerrainSnapOffsetZ ); //$pref::WorldEditor::TerrainSnapOffsetZ; + EditorSettings.setValue( "OffsetZValue", EWorldEditor.OffsetZValue ); //$pref::WorldEditor::OffsetZValue; EditorSettings.setValue( "snapSoft", EWorldEditor.getSoftSnap() ); //$Pref::WorldEditor::snapSoft EditorSettings.setValue( "snapSoftSize", EWorldEditor.getSoftSnapSize() ); //$Pref::WorldEditor::snapSoftSize EditorSettings.setValue( "boundingBoxCollision", EWorldEditor.boundingBoxCollision ); //$Pref::WorldEditor::boundingBoxCollision From 723125695de466eefb520360a4bbc4ba9afec28e Mon Sep 17 00:00:00 2001 From: Marc Chapman Date: Sun, 20 Oct 2019 14:05:09 +0100 Subject: [PATCH 13/21] Un Mirrored these green textures... again --- .../tools/base/images/512_forestgreen.png | Bin 4614 -> 3938 bytes .../base/images/512_forestgreen_lines.png | Bin 6245 -> 10553 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/Templates/BaseGame/game/tools/base/images/512_forestgreen.png b/Templates/BaseGame/game/tools/base/images/512_forestgreen.png index 179831bea181d17b5d3594211f0f8e68481caabc..c5f2cd2fd5eb6fb6767b92743ca7ad5fc3eff943 100644 GIT binary patch delta 2223 zcmV;g2vGNiB;p>BBYzJmNkljLRJ;@dT8Xivg1sJyZ_eq5&@5 zLe!IOBk|O-;LZNiiy&=pV%qgY2y}aqMrnH>#3*ed#Dncx^dw!{D{1wN18ZJ}nfIOd zdEa>p>hJS8G~Mm{&hGm*dA>8x%roz8AAkJu8~}N4699lr{}lWXXCvO9Q*0;wzvOj?b_9)14|vx?H~X^k)8pl_Tmpdf2c8(cL(4XM~*H&zS!|2R^MOU|C4=v zc7dnRGXT|pG0=(Q%Ud7b+WmIbRpDG&K0UO8162!;|LWMJuSEcWB7FidYAEjrK;bxB z?f>rBweUqA2lNR*$51{h0M)+#+1Jl?kN)eH4m?{jpH?RTK#@KH81>vy0od};*4Iy- zD*Qn!XI7p&Fu{o2Q=b5IJa<$8UOREBeYh~nBj4VCI`%|Dod5tu>Vx><7Z0tzzuNuy z%U3Q9cFgO~y>au#V1IU008SiRuFrQ@PdWDT(Usqvsy0~dL@)j5xyEexqyt|c^+CLP z6RNkO`|%&$_-HUmRex^%eV7{&fa=AbJ9WPPo$4Js^uobvgY&n~FFd-VF{?Id3k3iu zQXj;ByU$pTdTur3?cKj;-!uCMyR<_CPz`OD{_wfFEbQ9enCNfJDRs<%zxmp^lGDzO z4X$0g`i<{AGIWFWL452<>`~9HM(Xo#ojY;tWcOQoVCmrQ@9!CWdH(J5d-w0IKcHQR ziH30j0E+YsKs8qG-M72ig|E+P3>`ol^FKp>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, and dependency-object vs hooked up class method segregation 1) relies on https://github.com/Areloch/Torque3D/pull/99 for modular resolvers (re-included for ease of testing) 2) adds a new module::onServerScriptExec(%this) callback executed after datablock transmission 3) bypasses DB transmission in favor of a straight file read if the resulting network data would (via CRC compare) match what a client already has saved off under data\cache\ --- .../scripts/client/levelDownload.cs | 120 ++++++++++- .../clientServer/scripts/server/defaults.cs | 2 - .../scripts/server/levelDownload.cs | 57 ++++- .../clientServer/scripts/server/server.cs | 8 +- .../game/core/utility/scripts/module.cs | 194 +++++++++++++++++- 5 files changed, 362 insertions(+), 19 deletions(-) diff --git a/Templates/BaseGame/game/core/clientServer/scripts/client/levelDownload.cs b/Templates/BaseGame/game/core/clientServer/scripts/client/levelDownload.cs index 58f02c92f..fbd5bfccd 100644 --- a/Templates/BaseGame/game/core/clientServer/scripts/client/levelDownload.cs +++ b/Templates/BaseGame/game/core/clientServer/scripts/client/levelDownload.cs @@ -38,7 +38,73 @@ //---------------------------------------------------------------------------- // Phase 1 //---------------------------------------------------------------------------- -function clientCmdMissionStartPhase1(%seq, %missionName) +$pref::Client::EnableDatablockCache = true; +$pref::Client::DatablockCacheFilename = "data/cache/client/datablock_cache_c.dbc"; + +function clientCmdMissionStartPhase1_LoadCache(%seq, %missionName) +{ + if ($pref::Client::EnableDatablockCache && $loadFromDatablockCache) + { + if (!$pref::Video::disableVerticalSync) + { + warn("Disabling Vertical Sync during datablock cache load to avoid significant slowdown."); + $AFX_tempDisableVSync = true; + + $pref::Video::disableVerticalSync = true; + Canvas.resetVideoMode(); + } + + echo("<<<< Loading Datablocks From Cache >>>>"); + if (ServerConnection.loadDatablockCache_Begin()) + { + schedule(10, 0, "updateLoadDatablockCacheProgress", %seq, %missionName); + } + } +} + +function updateLoadDatablockCacheProgress(%seq, %missionName) +{ + if (ServerConnection.loadDatablockCache_Continue()) + { + $loadDatablockCacheProgressThread = schedule(10, 0, "updateLoadDatablockCacheProgress", %seq, %missionName); + return; + } + + if ($AFX_tempDisableVSync) + { + warn("Restoring Vertical Sync setting."); + $AFX_tempDisableVSync = false; + + $pref::Video::disableVerticalSync = false; + Canvas.resetVideoMode(); + } + + echo("<<<< Finished Loading Datablocks From Cache >>>>"); + clientCmdMissionStartPhase2(%seq,%missionName); +} + +function updateLoadDatablockCacheProgress(%seq, %missionName) +{ + if (ServerConnection.loadDatablockCache_Continue()) + { + $loadDatablockCacheProgressThread = schedule(10, 0, "updateLoadDatablockCacheProgress", %seq, %missionName); + return; + } + + if ($AFX_tempDisableVSync) + { + warn("Restoring Vertical Sync setting."); + $AFX_tempDisableVSync = false; + + $pref::Video::disableVerticalSync = false; + Canvas.resetVideoMode(); + } + + echo("<<<< Finished Loading Datablocks From Cache >>>>"); + clientCmdMissionStartPhase2(%seq,%missionName); +} + +function clientCmdMissionStartPhase1(%seq, %missionName, %cache_crc) { // These need to come after the cls. echo ("*** New Mission: " @ %missionName); @@ -61,6 +127,56 @@ function clientCmdMissionStartPhase1(%seq, %missionName) PostFXManager::settingsApplyDefaultPreset(); } + $loadFromDatablockCache = false; + if ($pref::Client::EnableDatablockCache) + { + %cache_filename = $pref::Client::DatablockCacheFilename; + + // if cache CRC is provided, check for validity + if (%cache_crc !$= "") + { + // check for existence of cache file + if (isFile(%cache_filename)) + { + // here we are not comparing the CRC of the cache itself, but the CRC of + // the server cache (stored in the header) when these datablocks were + // transmitted. + %my_cache_crc = extractDatablockCacheCRC(%cache_filename); + echo("<<<< client cache CRC:" SPC %my_cache_crc SPC ">>>>"); + echo("<<<< comparing CRC codes:" SPC "s:" @ %cache_crc SPC "c:" @ %my_cache_crc SPC ">>>>"); + if (%my_cache_crc == %cache_crc) + { + echo("<<<< cache CRC codes match, datablocks will be loaded from local cache. >>>>"); + $loadFromDatablockCache = true; + } + else + { + echo("<<<< cache CRC codes differ, datablocks will be transmitted and cached. >>>>" SPC %cache_crc); + setDatablockCacheCRC(%cache_crc); + } + } + else + { + echo("<<<< client datablock cache does not exist, datablocks will be transmitted and cached. >>>>"); + setDatablockCacheCRC(%cache_crc); + } + } + else + { + echo("<<<< server datablock caching is disabled, datablocks will be transmitted. >>>>"); + } + if ($loadFromDatablockCache) + { + // skip datablock transmission and initiate a cache load + commandToServer('MissionStartPhase1Ack_UseCache', %seq); + return; + } + } + else if (%cache_crc !$= "") + { + echo("<<<< client datablock caching is disabled, datablocks will be transmitted. >>>>"); + } + onMissionDownloadPhase("LOADING DATABLOCKS"); commandToServer('MissionStartPhase1Ack', %seq); @@ -164,7 +280,7 @@ function connect(%server) { %conn = new GameConnection(ServerConnection); RootGroup.add(ServerConnection); - %conn.setConnectArgs($pref::Player::Name); + %conn.setConnectArgs($pref::Player::Name, $ConncetInfoKey); %conn.setJoinPassword($Client::Password); %conn.connect(%server); } diff --git a/Templates/BaseGame/game/core/clientServer/scripts/server/defaults.cs b/Templates/BaseGame/game/core/clientServer/scripts/server/defaults.cs index b8e72e213..ed213e99d 100644 --- a/Templates/BaseGame/game/core/clientServer/scripts/server/defaults.cs +++ b/Templates/BaseGame/game/core/clientServer/scripts/server/defaults.cs @@ -46,8 +46,6 @@ $Pref::Server::ConnectionError = // overrides pref::net::port for dedicated servers $Pref::Server::Port = 28000; -$Pref::Server::EnableDatablockCache = true; -$Pref::Server::DatablockCacheFilename = "core/clientServer/scripts/server/afx/cache/afx_datablock_cache.dbc"; // If the password is set, clients must provide it in order // to connect to the server diff --git a/Templates/BaseGame/game/core/clientServer/scripts/server/levelDownload.cs b/Templates/BaseGame/game/core/clientServer/scripts/server/levelDownload.cs index de2f5e500..c5777f8fa 100644 --- a/Templates/BaseGame/game/core/clientServer/scripts/server/levelDownload.cs +++ b/Templates/BaseGame/game/core/clientServer/scripts/server/levelDownload.cs @@ -38,8 +38,26 @@ //---------------------------------------------------------------------------- // Phase 1 //---------------------------------------------------------------------------- +$Pref::Server::EnableDatablockCache = true; +$pref::Server::DatablockCacheFilename = "data/cache/server/datablock_cache_c.dbc"; function GameConnection::loadMission(%this) { + %cache_crc = ""; + + if ($Pref::Server::EnableDatablockCache) + { + if (!isDatablockCacheSaved()) + { + echo("<<<< saving server datablock cache >>>>"); + %this.saveDatablockCache(); + } + + if (isFile($Pref::Server::DatablockCacheFilename)) + { + %cache_crc = getDatablockCacheCRC(); + echo(" <<<< sending CRC to client:" SPC %cache_crc SPC ">>>>"); + } + } // Send over the information that will display the server info // when we learn it got there, we'll send the data blocks %this.currentPhase = 0; @@ -50,12 +68,41 @@ function GameConnection::loadMission(%this) } else { - commandToClient(%this, 'MissionStartPhase1', $missionSequence, $Server::MissionFile); + commandToClient(%this, 'MissionStartPhase1', $missionSequence, $Server::MissionFile, %cache_crc); echo("*** Sending mission load to client: " @ $Server::MissionFile); } } +function serverCmdMissionStartPhase1Ack_UseCache(%client, %seq) +{ + echo("<<<< client will load datablocks from a cache >>>>"); + echo(" <<<< skipping datablock transmission >>>>"); + + // Make sure to ignore calls from a previous mission load + if (%seq != $missionSequence || !$MissionRunning) + return; + if (%client.currentPhase != 0) + return; + %client.currentPhase = 1; + + // Start with the CRC + %client.setMissionCRC( $missionCRC ); + + %client.onBeginDatablockCacheLoad($missionSequence); +} + +function GameConnection::onBeginDatablockCacheLoad( %this, %missionSequence ) +{ + // Make sure to ignore calls from a previous mission load + if (%missionSequence != $missionSequence) + return; + if (%this.currentPhase != 1) + return; + %this.currentPhase = 1.5; + commandToClient(%this, 'MissionStartPhase1_LoadCache', $missionSequence, $Server::MissionFile); +} + function serverCmdMissionStartPhase1Ack(%client, %seq) { // Make sure to ignore calls from a previous mission load @@ -157,14 +204,6 @@ function serverCmdMissionStartPhase3Ack(%client, %seq) // Set the control object to the default camera if (!isObject(%client.camera)) { - if(!isObject(Observer)) - { - datablock CameraData(Observer) - { - mode = "Observer"; - }; - } - //if (isDefined("$Game::DefaultCameraClass")) %client.camera = spawnObject("Camera", Observer); } diff --git a/Templates/BaseGame/game/core/clientServer/scripts/server/server.cs b/Templates/BaseGame/game/core/clientServer/scripts/server/server.cs index 5663d8bc6..0c6c680af 100644 --- a/Templates/BaseGame/game/core/clientServer/scripts/server/server.cs +++ b/Templates/BaseGame/game/core/clientServer/scripts/server/server.cs @@ -204,10 +204,11 @@ function onServerCreated() loadDatablockFiles( DatablockFilesList, true ); + callOnModules("onServerScriptExec", "Core"); + callOnModules("onServerScriptExec", "Game"); + // Keep track of when the game started $Game::StartTime = $Sim::Time; - - onServerCreatedAFX(); } /// Shut down the server @@ -283,6 +284,9 @@ function onServerDestroyed() MissionCleanup.delete(); clearServerPaths(); + + if ($Pref::Server::EnableDatablockCache) + resetDatablockCache(); } /// Guid list maintenance functions diff --git a/Templates/BaseGame/game/core/utility/scripts/module.cs b/Templates/BaseGame/game/core/utility/scripts/module.cs index 2ff14c1e1..7d6cc5eed 100644 --- a/Templates/BaseGame/game/core/utility/scripts/module.cs +++ b/Templates/BaseGame/game/core/utility/scripts/module.cs @@ -1,5 +1,12 @@ +$traceModuleCalls=false; +$reportModuleFileConflicts=true; +if (!isObject(ExecFilesList)) + new ArrayObject(ExecFilesList); + function callOnModules(%functionName, %moduleGroup) { + //clear per module group file execution chain + ExecFilesList.empty(); //Get our modules so we can exec any specific client-side loading/handling %modulesList = ModuleDatabase.findModules(false); for(%i=0; %i < getWordCount(%modulesList); %i++) @@ -16,7 +23,14 @@ function callOnModules(%functionName, %moduleGroup) { eval(%module.scopeSet @ "." @ %functionName @ "();"); } - } + } + + %execFilecount = ExecFilesList.count(); + for (%i=0;%i<%execFilecount;%i++) + { + %filename = ExecFilesList.getKey(%i); + exec(%filename); + } } function loadModuleMaterials(%moduleGroup) @@ -69,10 +83,12 @@ function SimSet::getModulePath(%scopeSet) return ""; } -function SimSet::registerDatablock(%scopeSet, %datablockFilePath) +function SimSet::registerDatablock(%scopeSet, %datablockFilePath, %isExclusive) { + if ($traceModuleCalls) + warn("SimSet::registerDatablock"); %name = %scopeSet.getName(); - %moduleDef = ModuleDatabase.findModule(%name); + %moduleDef = ModuleDatabase.findModule(%name, 1); if(!isObject(%moduleDef)) { @@ -89,6 +105,176 @@ function SimSet::registerDatablock(%scopeSet, %datablockFilePath) %relativePath = makeRelativePath(%datablockFilePath); %fullPath = pathConcat(%moduleDef.ModulePath, %relativePath); + ///go through all entries + %locked = false; + %dbFilecount = DatablockFilesList.count(); + for (%i=0;%i<%dbFilecount;%i++) + { + %check = DatablockFilesList.getKey(%i); + //look for a substring match + %isMatch = strIsMatchExpr("*"@ %datablockFilePath,%check ); + if (%isMatch) + { + //check if we're already locked in + //and kill off any duplicates + //do note that doing it in this order means setting exclusive twice + //allows one to override exclusive with exclusive + %locked = DatablockFilesList.getValue(%i); + + if ((!%locked && !%isExclusive)&&($reportModuleFileConflicts)) + error("found" SPC %datablockFilePath SPC "duplicate file!"); + if (!%locked || (%locked && %isExclusive)) + { + DatablockFilesList.erase(%i); + } + } + } + //if we're not locked, or we are exclusive, go ahead and add it to the pile + //(ensures exclusives get re-added after that erasure) + if (!%locked || %isExclusive) + DatablockFilesList.add(%fullPath,%isExclusive); + if ($traceModuleCalls) + DatablockFilesList.echo(); +} + +function SimSet::unRegisterDatablock(%scopeSet, %datablockFilePath) +{ + if ($traceModuleCalls) + warn("SimSet::unRegisterDatablock"); + %name = %scopeSet.getName(); + %moduleDef = ModuleDatabase.findModule(%name, 1); + + if(!isObject(%moduleDef)) + { + error("Module::unRegisterDatablock() - unable to find a module with the moduleID of " @ %name); + return; + } - DatablockFilesList.add(%fullPath); + if(!isObject(DatablockFilesList)) + { + error("Module::unRegisterDatablock() - DatablockFilesList array object doesn't exist!"); + return; + } + + %relativePath = makeRelativePath(%datablockFilePath); + + %fullPath = pathConcat(%moduleDef.ModulePath, %relativePath); + ///go through all entries + %locked = false; + %dbFilecount = DatablockFilesList.count(); + for (%i=0;%i<%dbFilecount;%i++) + { + %check = DatablockFilesList.getKey(%i); + //look for a substring match + %isMatch = strIsMatchExpr("*"@ %datablockFilePath,%check ); + if (%isMatch) + { + //check if we're already locked in. if not, kill it. + %locked = DatablockFilesList.getValue(%i); + if (!%locked) + { + DatablockFilesList.erase(%i); + } + } + } + if ($traceModuleCalls) + DatablockFilesList.echo(); +} + +function SimSet::queueExec(%scopeSet, %execFilePath, %isExclusive) +{ + if ($traceModuleCalls) + warn("SimSet::queueExec"); + %name = %scopeSet.getName(); + %moduleDef = ModuleDatabase.findModule(%name, 1); + + if(!isObject(%moduleDef)) + { + error("Module::queueExec() - unable to find a module with the moduleID of " @ %name); + return; + } + + if(!isObject(ExecFilesList)) + { + error("Module::queueExec() - ExecFilesList array object doesn't exist!"); + return; + } + + if ($traceModuleCalls) + warn("module root path="@ makeRelativePath(%moduleDef.ModulePath)); + + %fullPath = makeRelativePath(%moduleDef.ModulePath) @ %execFilePath; + ///go through all entries + %locked = false; + %execFilecount = ExecFilesList.count(); + for (%i=0;%i<%execFilecount;%i++) + { + %check = ExecFilesList.getKey(%i); + //look for a substring match + %isMatch = strIsMatchExpr("*"@ %execFilePath,%check ); + if (%isMatch) + { + //check if we're already locked in + //and kill off any duplicates + //do note that doing it in this order means setting exclusive twice + //allows one to override exclusive with exclusive + %locked = ExecFilesList.getValue(%i); + if ((!%locked && !%isExclusive)&&($reportModuleFileConflicts)) + error("found" SPC %execFilePath SPC "duplicate file!"); + if (!%locked || (%locked && %isExclusive)) + { + ExecFilesList.erase(%i); + } + } + } + //if we're not locked, or we are exclusive, go ahead and add it to the pile + //(ensures exclusives get re-added after that erasure) + if (!%locked || %isExclusive) + ExecFilesList.add(%fullPath,%isExclusive); + if ($traceModuleCalls) + ExecFilesList.echo(); +} + +function SimSet::unQueueExec(%scopeSet, %execFilePath) +{ + if ($traceModuleCalls) + warn("SimSet::unRegisterDatablock"); + %name = %scopeSet.getName(); + %moduleDef = ModuleDatabase.findModule(%name, 1); + + if(!isObject(%moduleDef)) + { + error("Module::unRegisterDatablock() - unable to find a module with the moduleID of " @ %name); + return; + } + + if(!isObject(ExecFilesList)) + { + error("Module::unRegisterDatablock() - ExecFilesList array object doesn't exist!"); + return; + } + + %relativePath = makeRelativePath(%execFilePath); + + %fullPath = pathConcat(%moduleDef.ModulePath, %relativePath); + ///go through all entries + %locked = false; + %execFilecount = ExecFilesList.count(); + for (%i=0;%i<%execFilecount;%i++) + { + %check = ExecFilesList.getKey(%i); + //look for a substring match + %isMatch = strIsMatchExpr("*"@ %execFilePath,%check ); + if (%isMatch) + { + //check if we're already locked in. if not, kill it. + %locked = ExecFilesList.getValue(%i); + if (!%locked) + { + ExecFilesList.erase(%i); + } + } + } + if ($traceModuleCalls) + ExecFilesList.echo(); } \ No newline at end of file From 8b4f3fea3145d2bdee828fbcb599c2c63bcad06d Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 21 Oct 2019 18:58:15 -0500 Subject: [PATCH 15/21] misc formatting fixes, and a removal of the bool LightningData::preload(bool server, String &errorStr) {... dQsort(thunderSounds, MaxThunders, sizeof(SFXTrack*), cmpSounds); ...} call causing network stream corruption --- Engine/source/T3D/fx/lightning.cpp | 39 +++++++++++++++++++----------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index 9be145075..c951f022e 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -240,9 +240,15 @@ LightningData::LightningData() { strikeSound = NULL; - dMemset( strikeTextureNames, 0, sizeof( strikeTextureNames ) ); - dMemset( strikeTextures, 0, sizeof( strikeTextures ) ); - dMemset( thunderSounds, 0, sizeof( thunderSounds ) ); + for (S32 i = 0; i < MaxThunders; i++) + thunderSounds[i] = NULL; + + for (S32 i = 0; i < MaxTextures; i++) + { + strikeTextureNames[i] = NULL; + strikeTextures[i] = NULL; + } + mNumStrikeTextures = 0; } @@ -282,9 +288,10 @@ bool LightningData::preload(bool server, String &errorStr) if (Parent::preload(server, errorStr) == false) return false; - dQsort(thunderSounds, MaxThunders, sizeof(SFXTrack*), cmpSounds); - for (numThunders = 0; numThunders < MaxThunders && thunderSounds[numThunders] != NULL; numThunders++) { - // + //dQsort(thunderSounds, MaxThunders, sizeof(SFXTrack*), cmpSounds); + + for (S32 i = 0; i < MaxThunders; i++) { + if (thunderSounds[i]!= NULL) numThunders++; } if (server == false) @@ -321,14 +328,15 @@ void LightningData::packData(BitStream* stream) U32 i; for (i = 0; i < MaxThunders; i++) - sfxWrite( stream, thunderSounds[ i ] ); + { + if (stream->writeFlag(thunderSounds[i])) + sfxWrite(stream, thunderSounds[i]); + } stream->writeInt(mNumStrikeTextures, 4); - for (i = 0; i < MaxTextures; i++) - { + for (i = 0; i < MaxTextures; i++) stream->writeString(strikeTextureNames[i]); - } sfxWrite( stream, strikeSound ); } @@ -339,14 +347,17 @@ void LightningData::unpackData(BitStream* stream) U32 i; for (i = 0; i < MaxThunders; i++) - sfxRead( stream, &thunderSounds[ i ] ); + { + if (stream->readFlag()) + sfxRead(stream, &thunderSounds[i]); + else + thunderSounds[i] = NULL; + } mNumStrikeTextures = stream->readInt(4); - for (i = 0; i < MaxTextures; i++) - { + for (i = 0; i < MaxTextures; i++) strikeTextureNames[i] = stream->readSTString(); - } sfxRead( stream, &strikeSound ); } From 4f31dea023968a272790a1728b45fccec9a61189 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 21 Oct 2019 19:22:13 -0500 Subject: [PATCH 16/21] materials.cs files are still being automatically executed reguardless of location twice. shifted the ribbonshader shaderdata defines from new to singleton to avoid attempts at duplicated creation. --- .../BaseGame/game/core/gameObjects/materials/materials.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Templates/BaseGame/game/core/gameObjects/materials/materials.cs b/Templates/BaseGame/game/core/gameObjects/materials/materials.cs index 9ea6fa1bd..af1f49cf7 100644 --- a/Templates/BaseGame/game/core/gameObjects/materials/materials.cs +++ b/Templates/BaseGame/game/core/gameObjects/materials/materials.cs @@ -1,4 +1,4 @@ -new ShaderData( BasicRibbonShader ) +singleton ShaderData( BasicRibbonShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/ribbons/basicRibbonShaderV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/ribbons/basicRibbonShaderP.hlsl"; @@ -26,7 +26,7 @@ singleton CustomMaterial( BasicRibbonMat ) preload = true; }; -new ShaderData( TexturedRibbonShader ) +singleton ShaderData( TexturedRibbonShader ) { DXVertexShaderFile = $Core::CommonShaderPath @ "/ribbons/texRibbonShaderV.hlsl"; DXPixelShaderFile = $Core::CommonShaderPath @ "/ribbons/texRibbonShaderP.hlsl"; From 8cb018fb44a28852ed6b9d77dec614a06e694b33 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Tue, 29 Oct 2019 06:57:13 -0500 Subject: [PATCH 17/21] from @rextimmy: clamps the vc workaround now that later versions fixed that bug --- Engine/source/console/engineFunctions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/console/engineFunctions.h b/Engine/source/console/engineFunctions.h index eb935d995..8f2d600fe 100644 --- a/Engine/source/console/engineFunctions.h +++ b/Engine/source/console/engineFunctions.h @@ -113,7 +113,7 @@ private: std::tie(std::get(args)...) = defaultArgs; } -#if defined(_MSC_VER) && (_MSC_VER >= 1910) +#if defined(_MSC_VER) && (_MSC_VER >= 1910) && (_MSC_VER < 1920) template struct DodgyVCHelper { From 047a45c82dda5863f7ade2ebd79c6587ff9de80f Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Wed, 30 Oct 2019 21:39:20 -0500 Subject: [PATCH 18/21] getChanelValueAt 'correction' when feeding a u8 value from a 16 bit format, best to look up the red chanel for minimal artifacting --- Engine/source/gfx/bitmap/gBitmap.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Engine/source/gfx/bitmap/gBitmap.cpp b/Engine/source/gfx/bitmap/gBitmap.cpp index effc5f258..1ae980427 100644 --- a/Engine/source/gfx/bitmap/gBitmap.cpp +++ b/Engine/source/gfx/bitmap/gBitmap.cpp @@ -862,7 +862,10 @@ U8 GBitmap::getChanelValueAt(U32 x, U32 y, U32 chan) { ColorI pixelColor = ColorI(255,255,255,255); getColor(x, y, pixelColor); - + if (mInternalFormat == GFXFormatL16) + { + chan = 0; + } switch (chan) { case 0: return pixelColor.red; case 1: return pixelColor.green; @@ -1323,7 +1326,7 @@ U32 GBitmap::getSurfaceSize(const U32 mipLevel) const if (mInternalFormat >= GFXFormatBC1 && mInternalFormat <= GFXFormatBC3) { // From the directX docs: - // max(1, width ÷ 4) x max(1, height ÷ 4) x 8(DXT1) or 16(DXT2-5) + // max(1, width ÷ 4) x max(1, height ÷ 4) x 8(DXT1) or 16(DXT2-5) U32 sizeMultiple = 0; From 501990c3b6dff07d65ab2255beaa1b7f88662d26 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Thu, 31 Oct 2019 19:06:40 -0500 Subject: [PATCH 19/21] from @rextimmy: ssao work shifts ssao from the vectorlight to ibl-only via the reflectionProbearray postfx shader --- .../advanced/advancedLightBinManager.cpp | 4 --- .../source/renderInstance/renderProbeMgr.cpp | 20 ++++++++++- .../scripts/advancedLighting_Shaders.cs | 16 ++++----- .../core/rendering/shaders/gl/lighting.glsl | 32 ++++++++++-------- .../game/core/rendering/shaders/lighting.hlsl | 31 +++++++++-------- .../advanced/gl/reflectionProbeArrayP.glsl | 32 +++++++++++------- .../lighting/advanced/gl/vectorLightP.glsl | 9 ----- .../advanced/reflectionProbeArrayP.hlsl | 33 ++++++++++++------- .../shaders/lighting/advanced/softShadow.hlsl | 2 +- .../lighting/advanced/vectorLightP.hlsl | 13 ++------ 10 files changed, 107 insertions(+), 85 deletions(-) diff --git a/Engine/source/lighting/advanced/advancedLightBinManager.cpp b/Engine/source/lighting/advanced/advancedLightBinManager.cpp index 6bf1ca59f..532052bfa 100644 --- a/Engine/source/lighting/advanced/advancedLightBinManager.cpp +++ b/Engine/source/lighting/advanced/advancedLightBinManager.cpp @@ -447,10 +447,6 @@ AdvancedLightBinManager::LightMaterialInfo* AdvancedLightBinManager::_getLightMa if ( smPSSMDebugRender ) shadowMacros.push_back( GFXShaderMacro( "PSSM_DEBUG_RENDER" ) ); - // If its a vector light see if we can enable SSAO. - if ( lightType == LightInfo::Vector && smUseSSAOMask ) - shadowMacros.push_back( GFXShaderMacro( "USE_SSAO_MASK" ) ); - // Now create the material info object. info = new LightMaterialInfo( lightMatName, smLightMatVertex[ lightType ], shadowMacros ); } diff --git a/Engine/source/renderInstance/renderProbeMgr.cpp b/Engine/source/renderInstance/renderProbeMgr.cpp index 9b6aff737..a4633de67 100644 --- a/Engine/source/renderInstance/renderProbeMgr.cpp +++ b/Engine/source/renderInstance/renderProbeMgr.cpp @@ -30,7 +30,7 @@ #include "renderInstance/renderDeferredMgr.h" #include "math/mPolyhedron.impl.h" #include "gfx/gfxTransformSaver.h" - +#include "lighting/advanced/advancedLightBinManager.h" //for ssao #include "gfx/gfxDebugEvent.h" #include "shaderGen/shaderGenVars.h" #include "materials/shaderData.h" @@ -752,6 +752,24 @@ void RenderProbeMgr::render( SceneRenderState *state ) mProbeArrayEffect->setShaderMacro("SKYLIGHT_ONLY", "1"); else mProbeArrayEffect->setShaderMacro("SKYLIGHT_ONLY", "0"); + + //ssao mask + if (AdvancedLightBinManager::smUseSSAOMask) + { + //find ssaoMask + NamedTexTargetRef ssaoTarget = NamedTexTarget::find("ssaoMask"); + GFXTextureObject* pTexObj = ssaoTarget->getTexture(); + if (pTexObj) + { + mProbeArrayEffect->setShaderMacro("USE_SSAO_MASK"); + mProbeArrayEffect->setTexture(6, pTexObj); + + } + } + else + { + mProbeArrayEffect->setTexture(6, NULL); + } mProbeArrayEffect->setTexture(3, mBRDFTexture); mProbeArrayEffect->setCubemapArrayTexture(4, mPrefilterArray); diff --git a/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs b/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs index af04cea66..6b9d95190 100644 --- a/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs +++ b/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs @@ -48,9 +48,7 @@ singleton GFXStateBlockData( AL_VectorLightState ) mSamplerNames[1] = "shadowMap"; samplerStates[2] = SamplerClampPoint; // Shadow Map (Do not change this to linear, as all cards can not filter equally.) mSamplerNames[2] = "dynamicShadowMap"; - samplerStates[3] = SamplerClampLinear; // SSAO Mask - mSamplerNames[3] = "ssaoMask"; - samplerStates[4] = SamplerWrapPoint; // Random Direction Map + samplerStates[3] = SamplerWrapPoint; // Random Direction Map cullDefined = true; cullMode = GFXCullNone; @@ -72,11 +70,10 @@ singleton shaderData( AL_VectorLightShader ) samplerNames[0] = "$deferredBuffer"; samplerNames[1] = "$shadowMap"; samplerNames[2] = "$dynamicShadowMap"; - samplerNames[3] = "$ssaoMask"; - samplerNames[4] = "$gTapRotationTex"; - samplerNames[5] = "$lightBuffer"; - samplerNames[6] = "$colorBuffer"; - samplerNames[7] = "$matInfoBuffer"; + samplerNames[3] = "$gTapRotationTex"; + samplerNames[4] = "$lightBuffer"; + samplerNames[5] = "$colorBuffer"; + samplerNames[6] = "$matInfoBuffer"; pixVersion = 3.0; }; @@ -89,7 +86,6 @@ new CustomMaterial( AL_VectorLightMaterial ) sampler["deferredBuffer"] = "#deferred"; sampler["shadowMap"] = "$dynamiclight"; sampler["dynamicShadowMap"] = "$dynamicShadowMap"; - sampler["ssaoMask"] = "#ssaoMask"; sampler["lightBuffer"] = "#specularLighting"; sampler["colorBuffer"] = "#color"; sampler["matInfoBuffer"] = "#matinfo"; @@ -322,6 +318,7 @@ singleton ShaderData( PFX_ReflectionProbeArray ) samplerNames[3] = "$BRDFTexture"; samplerNames[4] = "$specularCubemapAR"; samplerNames[5] = "$irradianceCubemapAR"; + samplerNames[6] = "$ssaoMask"; pixVersion = 2.0; }; @@ -350,4 +347,5 @@ singleton GFXStateBlockData( PFX_ReflectionProbeArrayStateBlock ) samplerStates[3] = SamplerClampPoint; samplerStates[4] = SamplerClampLinear; samplerStates[5] = SamplerClampLinear; + samplerStates[6] = SamplerClampPoint; }; \ No newline at end of file diff --git a/Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl index 3bf586218..c95f8f764 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl +++ b/Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl @@ -81,6 +81,7 @@ struct Surface float NdotV; // cos(angle between normal and view vector) vec3 f0; // fresnel value (rgb) + float f90; vec3 albedo; // diffuse light absorbtion value (rgb) vec3 R; // reflection vector vec3 F; // fresnel term computed from f0, N and V @@ -93,8 +94,8 @@ void updateSurface(inout Surface surface) surface.albedo = surface.baseColor.rgb * (1.0 - surface.metalness); surface.f0 = lerp(vec3(0.04f), surface.baseColor.rgb, surface.metalness); surface.R = -reflect(surface.V, surface.N); - float f90 = saturate(50.0 * dot(surface.f0, vec3(0.33,0.33,0.33))); - surface.F = F_Schlick(surface.f0, f90, surface.NdotV); + surface.f90 = saturate(50.0 * dot(surface.f0, vec3(0.33,0.33,0.33))); + surface.F = F_Schlick(surface.f0, surface.f90, surface.NdotV); } Surface createSurface(vec4 normDepth, sampler2D colorBuffer, sampler2D matInfoBuffer, in vec2 uv, in vec3 wsEyePos, in vec3 wsEyeRay, in mat4 invView) @@ -229,6 +230,11 @@ vec3 getPunctualLight(in Surface surface, in SurfaceToLight surfaceToLight, vec3 return final; } +float computeSpecOcclusion( float NdotV , float AO , float roughness ) +{ + return saturate (pow( abs(NdotV + AO) , exp2 ( -16.0f * roughness - 1.0f )) - 1.0f + AO ); +} + vec4 compute4Lights( Surface surface, vec4 shadowMask, vec4 inLightPos[4], @@ -421,20 +427,18 @@ vec4 computeForwardProbes(Surface surface, specular = mix(specular,textureLod(specularCubemapAR, vec4(surface.R, skylightCubemapIdx), lod).xyz, alpha); } - vec3 F = FresnelSchlickRoughness(surface.NdotV, surface.f0, surface.roughness); - //energy conservation - vec3 kD = vec3(1.0,1.0,1.0) - F; - kD *= 1.0 - surface.metalness; + vec3 kD = 1.0f - surface.F; + kD *= 1.0f - surface.metalness; - //apply brdf - //Do it once to save on texture samples - vec2 brdf = textureLod(BRDFTexture, vec2(surface.roughness, 1.0-surface.NdotV),0).xy; - specular *= brdf.x * F + brdf.y; + float dfgNdotV = max( surface.NdotV , 0.0009765625f ); //0.5f/512.0f (512 is size of dfg/brdf lookup tex) + vec2 envBRDF = textureLod(BRDFTexture, vec2(dfgNdotV, surface.roughness),0).rg; + specular *= surface.F * envBRDF.x + surface.f90 * envBRDF.y; + irradiance *= kD * surface.baseColor.rgb; - //final diffuse color - vec3 diffuse = kD * irradiance * surface.baseColor.rgb; - vec4 finalColor = vec4(diffuse + specular * surface.ao, 1.0); + //AO + irradiance *= surface.ao; + specular *= computeSpecOcclusion(surface.NdotV, surface.ao, surface.roughness); - return finalColor; + return vec4(irradiance + specular, 0);//alpha writes disabled } diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl index fdf6f45b9..c371b87ce 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl @@ -85,6 +85,7 @@ struct Surface float3 albedo; // diffuse light absorbtion value (rgb) float3 R; // reflection vector float3 F; // fresnel term computed from f0, N and V + float f90; inline void Update() { @@ -94,7 +95,7 @@ struct Surface f0 = lerp(0.04.xxx, baseColor.rgb, metalness); R = -reflect(V, N); - float f90 = saturate(50.0 * dot(f0, 0.33)); + f90 = saturate(50.0 * dot(f0, 0.33)); F = F_Schlick(f0, f90, NdotV); } }; @@ -235,6 +236,11 @@ inline float3 getPunctualLight(in Surface surface, in SurfaceToLight surfaceToLi return final; } +float computeSpecOcclusion( float NdotV , float AO , float roughness ) +{ + return saturate (pow( abs(NdotV + AO) , exp2 ( -16.0f * roughness - 1.0f )) - 1.0f + AO ); +} + float4 compute4Lights( Surface surface, float4 shadowMask, float4 inLightPos[4], @@ -462,19 +468,18 @@ float4 computeForwardProbes(Surface surface, specular = lerp(specular,TORQUE_TEXCUBEARRAYLOD(specularCubemapAR, surface.R, skylightCubemapIdx, lod).xyz,alpha); } - float3 F = FresnelSchlickRoughness(surface.NdotV, surface.f0, surface.roughness); - //energy conservation - float3 kD = 1.0.xxx - F; - kD *= 1.0 - surface.metalness; + float3 kD = 1.0f - surface.F; + kD *= 1.0f - surface.metalness; - //apply brdf - //Do it once to save on texture samples - float2 brdf = TORQUE_TEX2DLOD(BRDFTexture,float4(surface.roughness, 1.0-surface.NdotV, 0.0, 0.0)).xy; - specular *= brdf.x * F + brdf.y; + float dfgNdotV = max( surface.NdotV , 0.0009765625f ); //0.5f/512.0f (512 is size of dfg/brdf lookup tex) + float2 envBRDF = TORQUE_TEX2DLOD(BRDFTexture, float4(dfgNdotV, surface.roughness,0,0)).rg; + specular *= surface.F * envBRDF.x + surface.f90 * envBRDF.y; + irradiance *= kD * surface.baseColor.rgb; - //final diffuse color - float3 diffuse = kD * irradiance * surface.baseColor.rgb; - float4 finalColor = float4(diffuse* surface.ao + specular * surface.ao, 1.0); - return finalColor; + //AO + irradiance *= surface.ao; + specular *= computeSpecOcclusion(surface.NdotV, surface.ao, surface.roughness); + + return float4(irradiance + specular, 0);//alpha writes disabled } \ No newline at end of file diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeArrayP.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeArrayP.glsl index 77a17c3a6..5c7d74ffb 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeArrayP.glsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeArrayP.glsl @@ -24,6 +24,11 @@ uniform int numProbes; uniform samplerCubeArray specularCubemapAR; uniform samplerCubeArray irradianceCubemapAR; +#ifdef USE_SSAO_MASK +uniform sampler2D ssaoMask; +uniform vec4 rtParams6; +#endif + uniform vec4 inProbePosArray[MAX_PROBES]; uniform vec4 inRefPosArray[MAX_PROBES]; uniform mat4 worldToObjArray[MAX_PROBES]; @@ -52,6 +57,12 @@ void main() { discard; } + + #ifdef USE_SSAO_MASK + float ssao = 1.0 - texture( ssaoMask, viewportCoordToRenderTarget( uv0.xy, rtParams6 ) ).r; + surface.ao = min(surface.ao, ssao); + #endif + float alpha = 1; @@ -190,20 +201,19 @@ void main() return; #endif - vec3 F = FresnelSchlickRoughness(surface.NdotV, surface.f0, surface.roughness); //energy conservation - vec3 kD = vec3(1,1,1) - F; - kD *= 1.0 - surface.metalness; + vec3 kD = 1.0f - surface.F; + kD *= 1.0f - surface.metalness; - //apply brdf - //Do it once to save on texture samples - vec2 brdf = textureLod(BRDFTexture, vec2(surface.roughness, surface.NdotV),0).xy; - specular *= brdf.x * F + brdf.y; + float dfgNdotV = max( surface.NdotV , 0.0009765625f ); //0.5f/512.0f (512 is size of dfg/brdf lookup tex) + vec2 envBRDF = textureLod(BRDFTexture, vec2(dfgNdotV, surface.roughness),0).rg; + specular *= surface.F * envBRDF.x + surface.f90 * envBRDF.y; + irradiance *= kD * surface.baseColor.rgb; - //final diffuse color - vec3 diffuse = kD * irradiance * surface.baseColor.rgb; - vec4 finalColor = vec4(diffuse + specular * surface.ao, 1.0); + //AO + irradiance *= surface.ao; + specular *= computeSpecOcclusion(surface.NdotV, surface.ao, surface.roughness); - OUT_col = finalColor; + OUT_col = vec4(irradiance + specular, 0);//alpha writes disabled } diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/vectorLightP.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/vectorLightP.glsl index 75ba29d04..9db5b0ff7 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/vectorLightP.glsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/vectorLightP.glsl @@ -37,11 +37,6 @@ uniform sampler2D deferredBuffer; uniform sampler2D shadowMap; uniform sampler2D dynamicShadowMap; -#ifdef USE_SSAO_MASK -uniform sampler2D ssaoMask ; -uniform vec4 rtParams3; -#endif - uniform sampler2D colorBuffer; uniform sampler2D matInfoBuffer; uniform float lightBrightness; @@ -245,10 +240,6 @@ void main() #endif #endif //NO_SHADOW - // Sample the AO texture. - #ifdef USE_SSAO_MASK - surface.ao *= 1.0 - texture( ssaoMask, viewportCoordToRenderTarget( uv0.xy, rtParams3 ) ).r; - #endif //get directional light contribution vec3 lighting = getDirectionalLight(surface, surfaceToLight, lightingColor.rgb, lightBrightness, shadow); diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl index 283eb8fae..746c8f1ce 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl @@ -21,6 +21,11 @@ uniform int numProbes; TORQUE_UNIFORM_SAMPLERCUBEARRAY(specularCubemapAR, 4); TORQUE_UNIFORM_SAMPLERCUBEARRAY(irradianceCubemapAR, 5); +#ifdef USE_SSAO_MASK +TORQUE_UNIFORM_SAMPLER2D(ssaoMask, 6); +uniform float4 rtParams6; +#endif + uniform float4 inProbePosArray[MAX_PROBES]; uniform float4 inRefPosArray[MAX_PROBES]; uniform float4x4 worldToObjArray[MAX_PROBES]; @@ -49,6 +54,11 @@ float4 main(PFXVertToPix IN) : SV_TARGET return TORQUE_TEX2D(colorBuffer, IN.uv0.xy); } + #ifdef USE_SSAO_MASK + float ssao = 1.0 - TORQUE_TEX2D( ssaoMask, viewportCoordToRenderTarget( IN.uv0.xy, rtParams6 ) ).r; + surface.ao = min(surface.ao, ssao); + #endif + float alpha = 1; #if SKYLIGHT_ONLY == 0 @@ -182,19 +192,18 @@ float4 main(PFXVertToPix IN) : SV_TARGET return float4(irradiance, 1); #endif - float3 F = FresnelSchlickRoughness(surface.NdotV, surface.f0, surface.roughness); - //energy conservation - float3 kD = 1.0.xxx - F; - kD *= 1.0 - surface.metalness; + float3 kD = 1.0f - surface.F; + kD *= 1.0f - surface.metalness; - //apply brdf - //Do it once to save on texture samples - float2 brdf = TORQUE_TEX2DLOD(BRDFTexture, float4(surface.roughness, 1.0-surface.NdotV, 0.0, 0.0)).xy; - specular *= brdf.x * F + brdf.y; + float dfgNdotV = max( surface.NdotV , 0.0009765625f ); //0.5f/512.0f (512 is size of dfg/brdf lookup tex) + float2 envBRDF = TORQUE_TEX2DLOD(BRDFTexture, float4(dfgNdotV, surface.roughness,0,0)).rg; + specular *= surface.F * envBRDF.x + surface.f90 * envBRDF.y; + irradiance *= kD * surface.baseColor.rgb; - //final diffuse color - float3 diffuse = kD * irradiance * surface.baseColor.rgb; - float4 finalColor = float4(diffuse* surface.ao + specular * surface.ao, 1.0); - return finalColor; + //AO + irradiance *= surface.ao; + specular *= computeSpecOcclusion(surface.NdotV, surface.ao, surface.roughness); + + return float4(irradiance + specular, 0);//alpha writes disabled } diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/softShadow.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/softShadow.hlsl index 0faf3e1fb..d98fe4d65 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/softShadow.hlsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/softShadow.hlsl @@ -70,7 +70,7 @@ static float2 sNonUniformTaps[NUM_PRE_TAPS] = /// The texture used to do per-pixel pseudorandom /// rotations of the filter taps. -TORQUE_UNIFORM_SAMPLER2D(gTapRotationTex, 4); +TORQUE_UNIFORM_SAMPLER2D(gTapRotationTex, 3); float softShadow_sampleTaps( TORQUE_SAMPLER2D(shadowMap1), float2 sinCos, diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/vectorLightP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/vectorLightP.hlsl index 1d1f98930..53fbed9a3 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/vectorLightP.hlsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/vectorLightP.hlsl @@ -33,13 +33,8 @@ TORQUE_UNIFORM_SAMPLER2D(deferredBuffer, 0); TORQUE_UNIFORM_SAMPLER2D(shadowMap, 1); TORQUE_UNIFORM_SAMPLER2D(dynamicShadowMap, 2); -#ifdef USE_SSAO_MASK -TORQUE_UNIFORM_SAMPLER2D(ssaoMask, 3); -uniform float4 rtParams3; -#endif - -TORQUE_UNIFORM_SAMPLER2D(colorBuffer, 6); -TORQUE_UNIFORM_SAMPLER2D(matInfoBuffer, 7); +TORQUE_UNIFORM_SAMPLER2D(colorBuffer, 5); +TORQUE_UNIFORM_SAMPLER2D(matInfoBuffer, 6); uniform float lightBrightness; uniform float3 lightDirection; @@ -234,10 +229,6 @@ float4 main(FarFrustumQuadConnectP IN) : SV_TARGET #endif #endif //NO_SHADOW - // Sample the AO texture. - #ifdef USE_SSAO_MASK - surface.ao *= 1.0 - TORQUE_TEX2D( ssaoMask, viewportCoordToRenderTarget( IN.uv0.xy, rtParams3 ) ).r; - #endif //get directional light contribution float3 lighting = getDirectionalLight(surface, surfaceToLight, lightingColor.rgb, lightBrightness, shadow); From 22249bf4d4d4e0f62712b11a7cacd9009b0d5864 Mon Sep 17 00:00:00 2001 From: Areloch Date: Wed, 6 Nov 2019 00:23:07 -0600 Subject: [PATCH 20/21] WIP of updating terrain editor to work with assets Fix minor UI issues for asset browser included folder 'asset type' script --- Engine/source/T3D/assets/TerrainAsset.cpp | 100 +- Engine/source/T3D/assets/TerrainAsset.h | 29 +- .../source/T3D/assets/TerrainMaterialAsset.h | 1 + .../source/materials/materialDefinition.cpp | 2 +- Engine/source/terrain/terrData.cpp | 198 +- Engine/source/terrain/terrData.h | 14 +- Engine/source/terrain/terrMaterial.cpp | 2 +- .../tools/assetBrowser/guis/assetBrowser.gui | 24 +- .../BaseGame/game/tools/assetBrowser/main.cs | 4 +- .../assetBrowser/scripts/assetBrowser.cs | 24 +- .../assetBrowser/scripts/assetTypes/folder.cs | 95 + .../scripts/assetTypes/terrain.cs | 74 + .../scripts/assetTypes/terrainMaterial.cs | 61 + .../tools/assetBrowser/scripts/popupMenus.cs | 75 +- .../templateFiles/terrainMaterial.cs.template | 24 + .../game/tools/gui/EditorLoadingGui.gui | 2 +- .../game/tools/gui/images/folderDown.png | Bin 0 -> 7293 bytes .../game/tools/gui/images/rightArrowWhite.png | Bin 0 -> 1348 bytes .../BaseGame/game/tools/gui/profiles.ed.cs | 6 +- Templates/BaseGame/game/tools/settings.xml | 352 +-- .../gui/guiCreateNewTerrainGui.gui | 18 +- .../gui/guiTerrainMaterialDlg.ed.gui | 2198 ++++++++++------- .../worldEditor/gui/objectBuilderGui.ed.gui | 75 + .../interfaces/terrainMaterialDlg.ed.cs | 69 +- .../worldEditor/scripts/menuHandlers.ed.cs | 12 +- 25 files changed, 2203 insertions(+), 1256 deletions(-) create mode 100644 Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/folder.cs create mode 100644 Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/terrainMaterial.cs.template create mode 100644 Templates/BaseGame/game/tools/gui/images/folderDown.png create mode 100644 Templates/BaseGame/game/tools/gui/images/rightArrowWhite.png diff --git a/Engine/source/T3D/assets/TerrainAsset.cpp b/Engine/source/T3D/assets/TerrainAsset.cpp index b3e2a8a1c..522b11a71 100644 --- a/Engine/source/T3D/assets/TerrainAsset.cpp +++ b/Engine/source/T3D/assets/TerrainAsset.cpp @@ -40,6 +40,8 @@ #include "assets/assetPtr.h" #endif +#include "T3D/assets/TerrainMaterialAsset.h" + //----------------------------------------------------------------------------- IMPLEMENT_CONOBJECT(TerrainAsset); @@ -89,7 +91,7 @@ ConsoleSetType(TypeTerrainAssetPtr) TerrainAsset::TerrainAsset() { - mTerrainFile = StringTable->EmptyString(); + mTerrainFilePath = StringTable->EmptyString(); } //----------------------------------------------------------------------------- @@ -106,8 +108,22 @@ void TerrainAsset::initPersistFields() Parent::initPersistFields(); //addField("shaderGraph", TypeRealString, Offset(mShaderGraphFile, TerrainAsset), ""); - addProtectedField("terrainFile", TypeAssetLooseFilePath, Offset(mTerrainFile, TerrainAsset), - &setTerrainFile, &getTerrainFile, "Path to the file containing the terrain data."); + addProtectedField("terrainFile", TypeAssetLooseFilePath, Offset(mTerrainFilePath, TerrainAsset), + &setTerrainFilePath, &getTerrainFilePath, "Path to the file containing the terrain data."); +} + +void TerrainAsset::setDataField(StringTableEntry slotName, const char* array, const char* value) +{ + Parent::setDataField(slotName, array, value); + + //Now, if it's a material slot of some fashion, set it up + StringTableEntry matSlotName = StringTable->insert("terrainMaterialAsset"); + if (String(slotName).startsWith(matSlotName)) + { + StringTableEntry matId = StringTable->insert(value); + + mTerrMaterialAssetIds.push_back(matId); + } } void TerrainAsset::initializeAsset() @@ -115,22 +131,20 @@ void TerrainAsset::initializeAsset() // Call parent. Parent::initializeAsset(); - if (!Platform::isFullPath(mTerrainFile)) - mTerrainFile = getOwned() ? expandAssetFilePath(mTerrainFile) : mTerrainFile; + if (!Platform::isFullPath(mTerrainFilePath)) + mTerrainFilePath = getOwned() ? expandAssetFilePath(mTerrainFilePath) : mTerrainFilePath; - //if (Platform::isFile(mTerrainFile)) - // Con::executeFile(mScriptFile, false, false); + loadTerrain(); } void TerrainAsset::onAssetRefresh() { - mTerrainFile = expandAssetFilePath(mTerrainFile); + mTerrainFilePath = expandAssetFilePath(mTerrainFilePath); - //if (Platform::isFile(mScriptFile)) - // Con::executeFile(mScriptFile, false, false); + loadTerrain(); } -void TerrainAsset::setTerrainFile(const char* pScriptFile) +void TerrainAsset::setTerrainFilePath(const char* pScriptFile) { // Sanity! AssertFatal(pScriptFile != NULL, "Cannot use a NULL script file."); @@ -139,12 +153,52 @@ void TerrainAsset::setTerrainFile(const char* pScriptFile) pScriptFile = StringTable->insert(pScriptFile); // Update. - mTerrainFile = getOwned() ? expandAssetFilePath(pScriptFile) : pScriptFile; + mTerrainFilePath = getOwned() ? expandAssetFilePath(pScriptFile) : pScriptFile; // Refresh the asset. refreshAsset(); } +bool TerrainAsset::loadTerrain() +{ + mTerrMaterialAssets.clear(); + mTerrMaterialAssetIds.clear(); + + //First, load any material, animation, etc assets we may be referencing in our asset + // Find any asset dependencies. + AssetManager::typeAssetDependsOnHash::Iterator assetDependenciesItr = mpOwningAssetManager->getDependedOnAssets()->find(mpAssetDefinition->mAssetId); + + // Does the asset have any dependencies? + if (assetDependenciesItr != mpOwningAssetManager->getDependedOnAssets()->end()) + { + // Iterate all dependencies. + while (assetDependenciesItr != mpOwningAssetManager->getDependedOnAssets()->end() && assetDependenciesItr->key == mpAssetDefinition->mAssetId) + { + StringTableEntry assetType = mpOwningAssetManager->getAssetType(assetDependenciesItr->value); + + if (assetType == StringTable->insert("TerrainMaterialAsset")) + { + mTerrMaterialAssetIds.push_front(assetDependenciesItr->value); + + //Force the asset to become initialized if it hasn't been already + AssetPtr matAsset = assetDependenciesItr->value; + + mTerrMaterialAssets.push_front(matAsset); + } + + // Next dependency. + assetDependenciesItr++; + } + } + + mTerrainFile = ResourceManager::get().load(mTerrainFilePath); + + if (mTerrainFile) + return true; + + return false; +} + //------------------------------------------------------------------------------ void TerrainAsset::copyTo(SimObject* object) @@ -190,7 +244,7 @@ GuiControl* GuiInspectorTypeTerrainAssetPtr::constructEditControl() TerrainAsset* matAsset = AssetDatabase.acquireAsset< TerrainAsset>(matAssetId); - TerrainMaterial* materialDef = nullptr; + //TerrainMaterial* materialDef = nullptr; char bitmapName[512] = "tools/worldEditor/images/toolbar/shape-editor"; @@ -268,23 +322,3 @@ bool GuiInspectorTypeTerrainAssetPtr::updateRects() return resized; } - -void GuiInspectorTypeTerrainAssetPtr::setMaterialAsset(String assetId) -{ - mTargetObject->setDataField(mCaption, "", assetId); - - //force a refresh - SimObject* obj = mInspector->getInspectObject(); - mInspector->inspectObject(obj); -} - -DefineEngineMethod(GuiInspectorTypeTerrainAssetPtr, setMaterialAsset, void, (String assetId), (""), - "Gets a particular shape animation asset for this shape.\n" - "@param animation asset index.\n" - "@return Shape Animation Asset.\n") -{ - if (assetId == String::EmptyString) - return; - - return object->setMaterialAsset(assetId); -} diff --git a/Engine/source/T3D/assets/TerrainAsset.h b/Engine/source/T3D/assets/TerrainAsset.h index e8c2be59b..805779fe9 100644 --- a/Engine/source/T3D/assets/TerrainAsset.h +++ b/Engine/source/T3D/assets/TerrainAsset.h @@ -19,6 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. //----------------------------------------------------------------------------- +#pragma once #ifndef TERRAINASSET_H #define TERRAINASSET_H @@ -46,14 +47,23 @@ #include "gui/editor/guiInspectorTypes.h" #endif -#include "terrain/terrData.h" +//#include "terrain/terrData.h" +#include "assets/assetPtr.h" +#include "terrain/terrFile.h" + +class TerrainMaterialAsset; //----------------------------------------------------------------------------- class TerrainAsset : public AssetBase { typedef AssetBase Parent; - StringTableEntry mTerrainFile; + StringTableEntry mTerrainFilePath; + Resource mTerrainFile; + + //Material assets we're dependent on and use + Vector mTerrMaterialAssetIds; + Vector> mTerrMaterialAssets; public: TerrainAsset(); @@ -63,8 +73,14 @@ public: static void initPersistFields(); virtual void copyTo(SimObject* object); - void setTerrainFile(const char* pTerrainFile); - inline StringTableEntry getTerrainFile(void) const { return mTerrainFile; }; + virtual void setDataField(StringTableEntry slotName, const char* array, const char* value); + + void setTerrainFilePath(const char* pTerrainFile); + inline StringTableEntry getTerrainFilePath(void) const { return mTerrainFilePath; }; + + inline Resource getTerrainResource(void) const { return mTerrainFile; }; + + bool loadTerrain(); /// Declare Console Object. DECLARE_CONOBJECT(TerrainAsset); @@ -73,8 +89,8 @@ protected: virtual void initializeAsset(); virtual void onAssetRefresh(void); - static bool setTerrainFile(void *obj, const char *index, const char *data) { static_cast(obj)->setTerrainFile(data); return false; } - static const char* getTerrainFile(void* obj, const char* data) { return static_cast(obj)->getTerrainFile(); } + static bool setTerrainFilePath(void *obj, const char *index, const char *data) { static_cast(obj)->setTerrainFilePath(data); return false; } + static const char* getTerrainFilePath(void* obj, const char* data) { return static_cast(obj)->getTerrainFilePath(); } }; DefineConsoleType(TypeTerrainAssetPtr, TerrainAsset) @@ -96,7 +112,6 @@ public: virtual GuiControl* constructEditControl(); virtual bool updateRects(); - void setMaterialAsset(String assetId); }; #endif // _ASSET_BASE_H_ diff --git a/Engine/source/T3D/assets/TerrainMaterialAsset.h b/Engine/source/T3D/assets/TerrainMaterialAsset.h index ae9a28f01..3fb4d3c7e 100644 --- a/Engine/source/T3D/assets/TerrainMaterialAsset.h +++ b/Engine/source/T3D/assets/TerrainMaterialAsset.h @@ -19,6 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. //----------------------------------------------------------------------------- +#pragma once #ifndef TERRAINMATERIALASSET_H #define TERRAINMATERIALASSET_H diff --git a/Engine/source/materials/materialDefinition.cpp b/Engine/source/materials/materialDefinition.cpp index b6c0cbfab..632e26fec 100644 --- a/Engine/source/materials/materialDefinition.cpp +++ b/Engine/source/materials/materialDefinition.cpp @@ -184,7 +184,7 @@ Material::Material() dMemset(mCellLayout, 0, sizeof(mCellLayout)); dMemset(mCellSize, 0, sizeof(mCellSize)); dMemset(mNormalMapAtlas, 0, sizeof(mNormalMapAtlas)); - dMemset(mUseAnisotropic, 0, sizeof(mUseAnisotropic)); + dMemset(mUseAnisotropic, 1, sizeof(mUseAnisotropic)); // Deferred Shading : Metalness dMemset(mUseMetalness, 0, sizeof(mUseMetalness)); diff --git a/Engine/source/terrain/terrData.cpp b/Engine/source/terrain/terrData.cpp index 78e991b63..2193ff66d 100644 --- a/Engine/source/terrain/terrData.cpp +++ b/Engine/source/terrain/terrData.cpp @@ -53,7 +53,7 @@ #include "T3D/physics/physicsCollision.h" #include "console/engineAPI.h" -#include "console/engineAPI.h" +#include "T3D/assets/TerrainMaterialAsset.h" using namespace Torque; IMPLEMENT_CO_NETOBJECT_V1(TerrainBlock); @@ -207,6 +207,9 @@ TerrainBlock::TerrainBlock() mNetFlags.set(Ghostable | ScopeAlways); mIgnoreZodiacs = false; zode_primBuffer = 0; + + mTerrainAsset = StringTable->EmptyString(); + mTerrainAssetId = StringTable->EmptyString(); } @@ -352,17 +355,121 @@ void TerrainBlock::setFile(const Resource& terr) mTerrFileName = terr.getPath(); } +bool TerrainBlock::setTerrainAsset(const StringTableEntry terrainAssetId) +{ + mTerrainAssetId = terrainAssetId; + mTerrainAsset = mTerrainAssetId; + + if (mTerrainAsset.isNull()) + { + Con::errorf("[TerrainBlock] Failed to load terrain asset."); + return false; + } + + Resource file = mTerrainAsset->getTerrainResource(); + if (!file) + return false; + + mFile = file; + return true; +} + bool TerrainBlock::save(const char *filename) { return mFile->save(filename); } +bool TerrainBlock::saveAsset() +{ + if (!mTerrainAsset.isNull() && mTerrainAsset->isAssetValid()) + { + //first, clear out our old dependency references + /*SimFieldDictionary* fieldDictionary = mTerrainAsset->getFieldDictionary(); + for (SimFieldDictionaryIterator itr(fieldDictionary); *itr; ++itr) + { + SimFieldDictionary::Entry* entry = *itr; + + if (String(entry->slotName).startsWith("terrainMaterailAsset")) + { + //got one, so clear it's value + setDataField(entry->slotName, NULL, ""); + } + } + + AssetQuery* pAssetQuery = new AssetQuery(); + AssetDatabase.findAssetType(pAssetQuery, "TerrainMaterialAsset"); + + TerrainBlock* clientTerr = static_cast(getClientObject()); + + U32 terrMatIdx = 0; + for (U32 i = 0; i < pAssetQuery->mAssetList.size(); i++) + { + //Acquire it so we can check it for matches + AssetPtr terrMatAsset = pAssetQuery->mAssetList[i]; + + for (U32 m = 0; m < clientTerr->mFile->mMaterials.size(); m++) + { + StringTableEntry intMatName = clientTerr->mFile->mMaterials[m]->getInternalName(); + + StringTableEntry assetMatDefName = terrMatAsset->getMaterialDefinitionName(); + if (assetMatDefName == intMatName) + { + //we have a match! + char depSlotName[30]; + dSprintf(depSlotName, sizeof(depSlotName), "terrainMaterialAsset%d", terrMatIdx); + + char depValue[255]; + dSprintf(depValue, sizeof(depValue), "@Asset=%s", terrMatAsset.getAssetId()); + + setDataField(depSlotName, NULL, depValue); + + terrMatIdx++; + } + } + + terrMatAsset.clear(); + } + + pAssetQuery->destroySelf(); + + // Set the format mode. + Taml taml; + + // Yes, so set it. + taml.setFormatMode(Taml::getFormatModeEnum("xml")); + + // Turn-off auto-formatting. + taml.setAutoFormat(false); + + // Read object. + bool success = taml.write(mTerrainAsset, AssetDatabase.getAssetFilePath(mTerrainAsset.getAssetId())); + + if (!success) + return false;*/ + + return mFile->save(mTerrainAsset->getTerrainFilePath()); + } + + return false; +} + bool TerrainBlock::_setTerrainFile( void *obj, const char *index, const char *data ) { static_cast( obj )->setFile( FileName( data ) ); return false; } +bool TerrainBlock::_setTerrainAsset(void* obj, const char* index, const char* data) +{ + TerrainBlock* terr = static_cast(obj);// ->setFile(FileName(data)); + + terr->setTerrainAsset(StringTable->insert(data)); + + terr->setMaskBits(FileMask | HeightMapChangeMask); + + return false; +} + void TerrainBlock::_updateBounds() { if ( !mFile ) @@ -901,31 +1008,50 @@ bool TerrainBlock::onAdd() if(!Parent::onAdd()) return false; - if ( mTerrFileName.isEmpty() ) + Resource terr; + + if (!mTerrainAsset.isNull()) { - mTerrFileName = Con::getVariable( "$Client::MissionFile" ); - String terrainDirectory( Con::getVariable( "$pref::Directories::Terrain" ) ); - if ( terrainDirectory.isEmpty() ) + terr = mTerrainAsset->getTerrainResource(); + + if (terr == NULL) { - terrainDirectory = "art/terrains/"; + if (isClientObject()) + NetConnection::setLastError("Unable to load terrain asset: %s", mTerrainAsset.getAssetId()); + return false; } - mTerrFileName.replace("tools/levels/", terrainDirectory); - mTerrFileName.replace("levels/", terrainDirectory); - Vector materials; - materials.push_back( "warning_material" ); - TerrainFile::create( &mTerrFileName, 256, materials ); + mFile = terr; } - - Resource terr = ResourceManager::get().load( mTerrFileName ); - if(terr == NULL) + else { - if(isClientObject()) - NetConnection::setLastError("You are missing a file needed to play this mission: %s", mTerrFileName.c_str()); - return false; - } + if (mTerrFileName.isEmpty()) + { + mTerrFileName = Con::getVariable("$Client::MissionFile"); + String terrainDirectory(Con::getVariable("$pref::Directories::Terrain")); + if (terrainDirectory.isEmpty()) + { + terrainDirectory = "art/terrains/"; + } + mTerrFileName.replace("tools/levels/", terrainDirectory); + mTerrFileName.replace("levels/", terrainDirectory); - setFile( terr ); + Vector materials; + materials.push_back("warning_material"); + TerrainFile::create(&mTerrFileName, 256, materials); + } + + terr = ResourceManager::get().load(mTerrFileName); + + if (terr == NULL) + { + if (isClientObject()) + NetConnection::setLastError("You are missing a file needed to play this mission: %s", mTerrFileName.c_str()); + return false; + } + + setFile(terr); + } if ( terr->mNeedsResaving ) { @@ -1130,6 +1256,10 @@ void TerrainBlock::initPersistFields() &TerrainBlock::_setTerrainFile, &defaultProtectedGetFn, "The source terrain data file." ); + addProtectedField("terrainAsset", TypeTerrainAssetPtr, Offset(mTerrainAsset, TerrainBlock), + &TerrainBlock::_setTerrainAsset, &defaultProtectedGetFn, + "The source terrain data asset."); + endGroup( "Media" ); addGroup( "Misc" ); @@ -1190,6 +1320,7 @@ U32 TerrainBlock::packUpdate(NetConnection* con, U32 mask, BitStream *stream) if ( stream->writeFlag( mask & FileMask ) ) { stream->write( mTerrFileName ); + stream->writeString( mTerrainAssetId ); stream->write( mCRC ); } @@ -1230,12 +1361,25 @@ void TerrainBlock::unpackUpdate(NetConnection* con, BitStream *stream) { FileName terrFile; stream->read( &terrFile ); + char buffer[256]; + stream->readString(buffer); + StringTableEntry terrainAsset = StringTable->insert(buffer); stream->read( &mCRC ); - if ( isProperlyAdded() ) - setFile( terrFile ); + if (terrainAsset != StringTable->EmptyString()) + { + if (isProperlyAdded()) + setTerrainAsset(StringTable->insert(terrFile.c_str())); + else + mTerrainAssetId = StringTable->insert(terrFile.c_str()); + } else - mTerrFileName = terrFile; + { + if (isProperlyAdded()) + setFile(terrFile); + else + mTerrFileName = terrFile; + } } if ( stream->readFlag() ) // SizeMask @@ -1310,6 +1454,16 @@ DefineEngineMethod( TerrainBlock, save, bool, ( const char* fileName),, return static_cast(object)->save(filename); } +DefineEngineMethod(TerrainBlock, saveAsset, bool, (), , + "@brief Saves the terrain block's terrain file to the specified file name.\n\n" + + "@param fileName Name and path of file to save terrain data to.\n\n" + + "@return True if file save was successful, false otherwise") +{ + return static_cast(object)->saveAsset(); +} + //ConsoleMethod(TerrainBlock, save, bool, 3, 3, "(string fileName) - saves the terrain block's terrain file to the specified file name.") //{ // char filename[256]; diff --git a/Engine/source/terrain/terrData.h b/Engine/source/terrain/terrData.h index 87f994a03..15b02bee5 100644 --- a/Engine/source/terrain/terrData.h +++ b/Engine/source/terrain/terrData.h @@ -50,7 +50,12 @@ #include "gfx/gfxPrimitiveBuffer.h" #endif - +#ifndef _ASSET_PTR_H_ +#include "assets/assetPtr.h" +#endif +#ifndef TERRAINASSET_H +#include "T3D/assets/TerrainAsset.h" +#endif class GBitmap; class TerrainBlock; @@ -120,6 +125,9 @@ protected: /// FileName mTerrFileName; + + AssetPtr mTerrainAsset; + StringTableEntry mTerrainAssetId; /// The maximum detail distance found in the material list. F32 mMaxDetailDistance; @@ -241,6 +249,7 @@ protected: // Protected fields static bool _setTerrainFile( void *obj, const char *index, const char *data ); + static bool _setTerrainAsset(void* obj, const char* index, const char* data); static bool _setSquareSize( void *obj, const char *index, const char *data ); static bool _setBaseTexSize(void *obj, const char *index, const char *data); static bool _setBaseTexFormat(void *obj, const char *index, const char *data); @@ -418,7 +427,10 @@ public: void setFile(const Resource& file); + bool setTerrainAsset(const StringTableEntry terrainAssetId); + bool save(const char* filename); + bool saveAsset(); F32 getSquareSize() const { return mSquareSize; } diff --git a/Engine/source/terrain/terrMaterial.cpp b/Engine/source/terrain/terrMaterial.cpp index ecbf8d822..02b776f58 100644 --- a/Engine/source/terrain/terrMaterial.cpp +++ b/Engine/source/terrain/terrMaterial.cpp @@ -97,7 +97,7 @@ void TerrainMaterial::initPersistFields() addField( "parallaxScale", TypeF32, Offset( mParallaxScale, TerrainMaterial ), "Used to scale the height from the normal map to give some self " "occlusion effect (aka parallax) to the terrain material" ); - addField("compositeMap", TypeStringFilename, Offset(mCompositeMap, TerrainMaterial), "Composite map for the material"); + addField("pbrConfigMap", TypeStringFilename, Offset(mCompositeMap, TerrainMaterial), "Composite map for the material"); Parent::initPersistFields(); // Gotta call this at least once or it won't get created! diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui index 1bf2eff3c..299007868 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui @@ -314,7 +314,7 @@ minExtent = "8 2"; horizSizing = "left"; vertSizing = "bottom"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; command = "AssetBrowser.showVisibiltyOptions();"; @@ -343,7 +343,7 @@ minExtent = "64 64"; horizSizing = "relative"; vertSizing = "height"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; @@ -365,7 +365,7 @@ minExtent = "0 0"; horizSizing = "right"; vertSizing = "bottom"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; @@ -462,7 +462,7 @@ minExtent = "8 2"; horizSizing = "width"; vertSizing = "height"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; @@ -495,7 +495,7 @@ profile = "GuiEditorScrollProfile"; visible = "1"; active = "1"; - tooltipProfile = "ToolsGuiDefaultProfile"; + tooltipProfile = "ToolsGuiSolidDefaultProfile"; hovertime = "1000"; isContainer = "1"; canSave = "1"; @@ -554,7 +554,7 @@ minExtent = "16 16"; horizSizing = "right"; vertSizing = "bottom"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; @@ -629,7 +629,7 @@ minExtent = "8 2"; horizSizing = "left"; vertSizing = "bottom"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; @@ -654,7 +654,7 @@ minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; command = "AssetBrowser.toggleFolderCollapseButton();"; @@ -680,7 +680,7 @@ minExtent = "8 2"; horizSizing = "left"; vertSizing = "bottom"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; command = "AssetBrowser.showFilterOptions();"; @@ -704,7 +704,7 @@ minExtent = "8 2"; horizSizing = "width"; vertSizing = "height"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; @@ -737,7 +737,7 @@ profile = "GuiEditorScrollProfile"; visible = "1"; active = "1"; - tooltipProfile = "ToolsGuiDefaultProfile"; + tooltipProfile = "ToolsGuiSolidDefaultProfile"; hovertime = "1000"; isContainer = "1"; canSave = "1"; @@ -825,7 +825,7 @@ minExtent = "8 2"; horizSizing = "width"; vertSizing = "height"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/main.cs b/Templates/BaseGame/game/tools/assetBrowser/main.cs index d35a3d6b6..b9ddf94ba 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/main.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/main.cs @@ -52,7 +52,7 @@ function initializeAssetBrowser() AssetFilterTypeList.add("ShapeAnimations"); AssetFilterTypeList.add("Sounds"); AssetFilterTypeList.add("StateMachines"); - AssetFilterTypeList.add("Terrains"); + AssetFilterTypeList.add("Terrain"); AssetFilterTypeList.add("TerrainMaterials"); } @@ -94,6 +94,8 @@ function initializeAssetBrowser() exec("./scripts/assetTypes/stateMachine.cs"); exec("./scripts/assetTypes/cubemap.cs"); exec("./scripts/assetTypes/folder.cs"); + exec("./scripts/assetTypes/terrain.cs"); + exec("./scripts/assetTypes/terrainMaterial.cs"); exec("./scripts/fieldTypes/fieldTypes.cs"); exec("./scripts/fieldTypes/listField.cs"); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs index 2de51f4e1..cd9c2ccd0 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs @@ -1124,28 +1124,9 @@ function AssetBrowserFilterTree::onRightMouseDown(%this, %itemId) } else { - //get the parent, and thus our module - %moduleId = %this.getParentItem(%itemId); - - //set the module value for creation info - AssetBrowser.selectedModule = %this.getItemText(%moduleId); - - if(%this.getItemText(%itemId) $= "ComponentAsset") - { - AddNewComponentAssetPopup.showPopup(Canvas); - //Canvas.popDialog(AssetBrowser_newComponentAsset); - //AssetBrowser_newComponentAsset-->AssetBrowserModuleList.setText(AssetBrowser.selectedModule); - } - else if(%this.getItemText(%itemId) $= "ScriptAsset") - { - EditAssetCategoryPopup.showPopup(Canvas); - } + EditFolderPopup.showPopup(Canvas); } } - else if( %this.getSelectedItemsCount() > 0 && %itemId == 1) - { - AddNewModulePopup.showPopup(Canvas); - } } // @@ -1254,6 +1235,9 @@ function AssetBrowser::rebuildAssetArray(%this) %assetType = AssetDatabase.getAssetType(%assetId); } + if(AssetBrowser.assetTypeFilter !$= "" && AssetBrowser.assetTypeFilter !$= %assetType) + continue; + /*if(%this.getItemText(%itemId) $= %assetType || (%assetType $= "" && %this.getItemText(%itemId) $= "Misc") || %moduleItemId == 1) {*/ diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/folder.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/folder.cs new file mode 100644 index 000000000..d6e05db29 --- /dev/null +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/folder.cs @@ -0,0 +1,95 @@ +function AssetBrowser::buildFolderPreview(%this, %assetDef, %previewData) +{ + %previewData.assetName = %assetDef.assetName; + %previewData.assetPath = %assetDef.dirPath; + + //%previewData.previewImage = "tools/assetBrowser/art/folderIcon"; + %previewData.previewImage = "tools/gui/images/folder"; + + //%previewData.assetFriendlyName = %assetDef.assetName; + %previewData.assetDesc = %assetDef.description; + %previewData.tooltip = %assetDef.dirPath; + %previewData.doubleClickCommand = "AssetBrowser.navigateTo(\""@ %assetDef.dirPath @ "/" @ %assetDef.assetName @"\")";//browseTo %assetDef.dirPath / %assetDef.assetName +} + +function AssetBrowser::renameFolder(%this, %folderPath, %newFolderName) +{ + %fullPath = makeFullPath(%folderPath); + %newFullPath = makeFullPath(%folderPath); + + %fullPath = strreplace(%fullPath, "//", "/"); + + %count = getTokenCount(%fullPath, "/"); + %basePath = getTokens(%fullPath, "/", 0, %count-2); + %oldName = getToken(%fullPath, "/", %count-1); + + //We need to ensure that no files are 'active' while we try and clean up behind ourselves with the delete action + //so, we nix any assets active for the module, do the delete action on the old folder, and then re-acquire our assets. + //This will have the added benefit of updating paths for asset items + + %module = AssetBrowser.getModuleFromAddress(AssetBrowser.currentAddress); + %moduleId = %module.ModuleId; + + AssetDatabase.removeDeclaredAssets(%moduleId); + + %copiedSuccess = pathCopy(%fullPath, %basePath @ "/" @ %newFolderName); + %this.deleteFolder(%fullPath); + + AssetDatabase.addModuleDeclaredAssets(%moduleId); +} + +function AssetBrowser::deleteFolder(%this, %folderPath) +{ + doDeleteFolder(%folderPath); + + %this.loadFilters(); +} + +function doDeleteFolder(%folderPath) +{ + %fullPath = makeFullPath(%folderPath); + + //First, wipe out any files inside the folder first + %file = findFirstFileMultiExpr( %fullPath @ "/*.*", true); + + while( %file !$= "" ) + { + %success = fileDelete( %file ); + + if(!%success) + { + error("doDeleteFolder - unable to delete file " @ %file); + return; + } + + %file = findNextFileMultiExpr( %fullPath @ "/*.*" ); + } + + //next, walk through and delete any subfolders that may be remaining + while(fileDelete(%fullPath) == 0) + { + //We couldn't delete the folder, so get a directory list and recurse through it, deleteing them as we go + %paths = getDirectoryList(%fullPath); + for(%i=0; %i < getFieldCount(%paths); %i++) + { + %childPath = getField(%paths, %i); + doDeleteFolder(%fullPath @ "/" @ %childPath); + } + } +} + +function AssetBrowser::moveFolder(%this, %folderPath, %newFolderPath) +{ + %fullPath = makeFullPath(%folderPath); + %newFullPath = makeFullPath(%newFolderPath); + + %fullPath = strreplace(%fullPath, "//", "/"); + %newFullPath = strreplace(%newFullPath, "//", "/"); + + %count = getTokenCount(%fullPath, "/"); + %basePath = getTokens(%fullPath, "/", 0, %count-2); + %oldName = getToken(%fullPath, "/", %count-1); + + %copiedSuccess = pathCopy(%fullPath, %newFullPath @ "/" @ %newFolderName); + %this.deleteFolder(%fullPath); +} \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.cs index 809c3166f..f5d2c32e6 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.cs @@ -1,5 +1,38 @@ function AssetBrowser::createTerrainAsset(%this) { + %moduleName = AssetBrowser.newAssetSettings.moduleName; + %modulePath = "data/" @ %moduleName; + + %assetName = AssetBrowser.newAssetSettings.assetName; + + %assetType = AssetBrowser.newAssetSettings.assetType; + %assetPath = AssetBrowser.currentAddress @ "/"; + + %tamlpath = %assetPath @ %assetName @ ".asset.taml"; + %terPath = %assetPath @ %assetName @ ".ter"; + + %asset = new TerrainAsset() + { + AssetName = %assetName; + versionId = 1; + terrainFile = %assetName @ ".ter"; + }; + + TamlWrite(%asset, %tamlpath); + + %moduleDef = ModuleDatabase.findModule(%moduleName, 1); + AssetDatabase.addDeclaredAsset(%moduleDef, %tamlpath); + + AssetBrowser.loadFilters(); + + AssetBrowserFilterTree.onSelect(%smItem); + + //Save out a basic terrain block here + %terrBlock = new TerrainBlock() { terrainFile = %terPath; }; + %terrBlock.save(%terPath); + %terrBlock.delete(); + + return %tamlpath; } function AssetBrowser::editTerrainAsset(%this, %assetDef) @@ -50,4 +83,45 @@ function GuiInspectorTypeTerrainAssetPtr::onClick( %this, %fieldName ) function GuiInspectorTypeTerrainAssetPtr::onControlDropped( %this, %payload, %position ) { +} + +//AssetDatabase.acquireAsset("pbr:NewTerrain"); +function TerrainAsset::saveAsset(%this) +{ + %matDepIdx = 0; + while(%this.getFieldValue("terrainMaterialAsset", %matDepIdx) !$= "") + { + %this.setFieldValue("terrainMaterialAsset", "", %matDepIdx); + } + + %filePath = AssetDatabase.getAssetFilePath(%this.getAssetId()); + + %mats = ETerrainEditor.getMaterials(); + + %assetQuery = new AssetQuery(); + AssetDatabase.findAssetType(%assetQuery, "TerrainMaterialAsset"); + + %count = %assetQuery.getCount(); + + %matDepIdx = 0; + for( %i = 0; %i < getRecordCount( %mats ); %i++ ) + { + %matInternalName = getRecord( %mats, %i ); + + for(%m=0; %m < %count; %m++) + { + %assetId = %assetQuery.getAsset(%m); + + %terrMatAssetDef = AssetDatabase.acquireAsset(%assetId); + + if(%terrMatAssetDef.materialDefinitionName $= %matInternalName) + { + %this.setFieldValue("terrainMaterialAsset", "@Asset=" @ %assetId, %matDepIdx); + %matDepIdx++; + } + } + } + %assetQuery.delete(); + + TAMLWrite(%this, %filePath); } \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrainMaterial.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrainMaterial.cs index d6a8488f7..5e249d59a 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrainMaterial.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrainMaterial.cs @@ -1,9 +1,70 @@ function AssetBrowser::createTerrainMaterialAsset(%this) { + %moduleName = AssetBrowser.newAssetSettings.moduleName; + %modulePath = "data/" @ %moduleName; + + %assetName = AssetBrowser.newAssetSettings.assetName; + + %assetType = AssetBrowser.newAssetSettings.assetType; + %assetPath = AssetBrowser.currentAddress @ "/"; + + %tamlpath = %assetPath @ %assetName @ ".asset.taml"; + %scriptPath = %assetPath @ %assetName @ ".cs"; + + %asset = new TerrainMaterialAsset() + { + AssetName = %assetName; + versionId = 1; + scriptFile = %assetName @ ".cs"; + materialDefinitionName = %assetName; + }; + + TamlWrite(%asset, %tamlpath); + + %moduleDef = ModuleDatabase.findModule(%moduleName, 1); + AssetDatabase.addDeclaredAsset(%moduleDef, %tamlpath); + + AssetBrowser.loadFilters(); + + AssetBrowserFilterTree.onSelect(%smItem); + + %file = new FileObject(); + %templateFile = new FileObject(); + + %templateFilePath = %this.templateFilesPath @ "terrainMaterial.cs.template"; + + if(%file.openForWrite(%scriptPath) && %templateFile.openForRead(%templateFilePath)) + { + while( !%templateFile.isEOF() ) + { + %line = %templateFile.readline(); + %line = strreplace( %line, "@", %assetName ); + + %file.writeline(%line); + //echo(%line); + } + + %file.close(); + %templateFile.close(); + } + else + { + %file.close(); + %templateFile.close(); + + warnf("CreateNewTerrainMaterialAsset - Something went wrong and we couldn't write thescript file!"); + } + + //If we've got the terrain mat editor open, go ahead and update it all + TerrainMaterialDlg.onWake(); + + return %tamlpath; } function AssetBrowser::editTerrainMaterialAsset(%this, %assetDef) { + TerrainMaterialDlg.show(0, 0, 0); + TerrainMaterialDlg.setActiveMaterial(%assetDef.assetName); } function AssetBrowser::duplicateTerrainMaterialAsset(%this, %assetDef, %targetModule) diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs index 31d317d38..88f2662c6 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs @@ -14,7 +14,8 @@ function AssetBrowser::buildPopupMenus(%this) AddNewModulePopup.enableItem(1, false); } - + + if( !isObject( EditAssetPopup ) ) { new PopupMenu( EditAssetPopup ) @@ -64,22 +65,6 @@ function AssetBrowser::buildPopupMenus(%this) }; } - if( !isObject( EditFolderPopup ) ) - { - new PopupMenu( EditFolderPopup ) - { - superClass = "MenuBuilder"; - class = "EditorWorldMenu"; - //isPopup = true; - - item[ 0 ] = "Rename Folder" TAB "" TAB "AssetBrowser.renameAsset();"; - item[ 1 ] = "-"; - Item[ 2 ] = "Duplicate Folder" TAB "" TAB "AssetBrowser.duplicateAsset();"; - item[ 3 ] = "-"; - item[ 4 ] = "Delete Folder" TAB "" TAB "AssetBrowser.deleteAsset();"; - }; - } - if( !isObject( AddNewComponentAssetPopup ) ) { new PopupMenu( AddNewComponentAssetPopup ) @@ -121,20 +106,23 @@ function AssetBrowser::buildPopupMenus(%this) //isPopup = true; item[ 0 ] = "Create Material" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"MaterialAsset\", AssetBrowser.selectedModule);";//"createNewMaterialAsset(\"NewMaterial\", AssetBrowser.selectedModule);"; - item[ 1 ] = "Create Image" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ImageAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewImageAsset(\"NewImage\", AssetBrowser.selectedModule);"; - item[ 2 ] = "-"; - item[ 3 ] = "Create Shape" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"Shape\", AssetBrowser.selectedModule);"; - item[ 4 ] = "Create Shape Animation" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ShapeAnimationAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewShapeAnimationAsset(\"NewShapeAnimation\", AssetBrowser.selectedModule);"; - item[ 5 ] = "-"; - item[ 6 ] = "Create GUI" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"GUIAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewGUIAsset(\"NewGUI\", AssetBrowser.selectedModule);"; - item[ 7 ] = "-"; - item[ 8 ] = "Create Post Effect" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"PostEffectAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewPostEffectAsset(\"NewPostEffect\", AssetBrowser.selectedModule);"; - item[ 9 ] = "-"; - item[ 10 ] = "Create Sound" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"SoundAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewSoundAsset(\"NewSound\", AssetBrowser.selectedModule);"; - item[ 11 ] = "-"; - item[ 12 ] = "Create Particle Effect" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ParticleEffectAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewParticleEffectAsset(\"NewParticleEffect\", AssetBrowser.selectedModule);"; - item[ 13 ] = "-"; - item[ 14 ] = "Create Cubemap" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"CubemapAsset\", AssetBrowser.selectedModule);"; + item[ 1 ] = "Create Terrain Material" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"TerrainMaterialAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewImageAsset(\"NewImage\", AssetBrowser.selectedModule);"; + item[ 2 ] = "Create Image" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ImageAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewImageAsset(\"NewImage\", AssetBrowser.selectedModule);"; + item[ 3 ] = "-"; + item[ 4 ] = "Create Terrain Data" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"TerrainAsset\", AssetBrowser.selectedModule);"; + item[ 5 ] = "-"; + item[ 6 ] = "Create Shape" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"Shape\", AssetBrowser.selectedModule);"; + item[ 7 ] = "Create Shape Animation" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ShapeAnimationAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewShapeAnimationAsset(\"NewShapeAnimation\", AssetBrowser.selectedModule);"; + item[ 8 ] = "-"; + item[ 9 ] = "Create GUI" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"GUIAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewGUIAsset(\"NewGUI\", AssetBrowser.selectedModule);"; + item[ 10 ] = "-"; + item[ 11 ] = "Create Post Effect" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"PostEffectAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewPostEffectAsset(\"NewPostEffect\", AssetBrowser.selectedModule);"; + item[ 12 ] = "-"; + item[ 13 ] = "Create Sound" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"SoundAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewSoundAsset(\"NewSound\", AssetBrowser.selectedModule);"; + item[ 14 ] = "-"; + item[ 15 ] = "Create Particle Effect" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ParticleEffectAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewParticleEffectAsset(\"NewParticleEffect\", AssetBrowser.selectedModule);"; + item[ 16 ] = "-"; + item[ 17 ] = "Create Cubemap" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"CubemapAsset\", AssetBrowser.selectedModule);"; }; } @@ -199,10 +187,27 @@ function AssetBrowser::buildPopupMenus(%this) } //Some assets are not yet ready/implemented, so disable their creation here - AddNewArtAssetPopup.enableItem(3, false); //shape - AddNewArtAssetPopup.enableItem(4, false); //shape animation - AddNewArtAssetPopup.enableItem(10, false); //sound asset - AddNewArtAssetPopup.enableItem(12, false); //particle effect + AddNewArtAssetPopup.enableItem(6, false); //shape + AddNewArtAssetPopup.enableItem(7, false); //shape animation + AddNewArtAssetPopup.enableItem(13, false); //sound asset + AddNewArtAssetPopup.enableItem(15, false); //particle effect + + if( !isObject( EditFolderPopup ) ) + { + new PopupMenu( EditFolderPopup ) + { + superClass = "MenuBuilder"; + class = "EditorWorldMenu"; + //isPopup = true; + + Item[ 0 ] = "Create in Folder" TAB AddNewAssetPopup; + item[ 1 ] = "-"; + item[ 2 ] = "Rename Folder" TAB "" TAB "AssetBrowser.renameAsset();"; + Item[ 3 ] = "Duplicate Folder" TAB "" TAB "AssetBrowser.duplicateAsset();"; + item[ 4 ] = "-"; + item[ 5 ] = "Delete Folder" TAB "" TAB "AssetBrowser.deleteAsset();"; + }; + } if( !isObject( EditAssetCategoryPopup ) ) { diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/terrainMaterial.cs.template b/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/terrainMaterial.cs.template new file mode 100644 index 000000000..ef614edaf --- /dev/null +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/terrainMaterial.cs.template @@ -0,0 +1,24 @@ +singleton Material(TerrainFX_@) +{ + mapTo = "@"; + footstepSoundId = 0; + terrainMaterials = "1"; + ShowDust = "1"; + showFootprints = "1"; + materialTag0 = "Terrain"; + effectColor[0] = "0.42 0.42 0 1"; + effectColor[1] = "0.42 0.42 0 1"; + impactSoundId = "0"; +}; + +new TerrainMaterial(@) +{ + internalName = "@"; + diffuseMap = ""; + detailMap = ""; + detailSize = "10"; + isManaged = "1"; + detailBrightness = "1"; + Enabled = "1"; + diffuseSize = "200"; +}; \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/gui/EditorLoadingGui.gui b/Templates/BaseGame/game/tools/gui/EditorLoadingGui.gui index a7b497108..8b627a1d8 100644 --- a/Templates/BaseGame/game/tools/gui/EditorLoadingGui.gui +++ b/Templates/BaseGame/game/tools/gui/EditorLoadingGui.gui @@ -20,7 +20,7 @@ minExtent = "8 2"; horizSizing = "center"; vertSizing = "center"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "ToolsGuiToolTipProfile"; diff --git a/Templates/BaseGame/game/tools/gui/images/folderDown.png b/Templates/BaseGame/game/tools/gui/images/folderDown.png new file mode 100644 index 0000000000000000000000000000000000000000..b2dcbed2dac341231b9f010689ef0a9ceb0280b3 GIT binary patch literal 7293 zcmV-@9D?JCP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O?W%b|tHFg#R-N521L&aCole8F={q0!nI0-F3!eEAMg9m+q-WwvhKaa{rbh3QMLK``sYjh_MT<$ zbywFyGK4F=i~3mNdBugDaQgGH#NW*S$m@LmR{oZ!J%g-GmfFqJ`Jq}zWVa1=+Ge+1 z=ligODF(M(=DTyl`SV`!*;O}AQiA^4?Xn?1(-*Qb$eibG_c<4P?pt*~ZdSPSv|Q;d zgOTI!f6dP~{4YaplZtV%CKe6Jg6TX;+GN-RxMMCU;V;WC34`8?JsQklV|@#!=>T5^)C?Jv*LJWy|D?q53=wpa6rkG=i zHMZnaNHL|9lX$9SpF@s0<(x~dxfNeRi6xa>N~xt)S3NWqO-(h|QfqCEo3_vxt8snf zjqbYdp~s$j?xok>2JjhS#F0iGWz^B8n|?w8W~P~EnRT{h7f@PZ#g$fGW!2R-SlfPw z9e3J!mtA-J%-WmP?^*kqxqqEC`)19ZMCrQxD{H)+^T!ZYbP|;_GUkFM<5?L1&`vpf ziVeXjbIRFMoj2Y`$1J0gGp#a42E(#0Zu^l z_j}&{khR$k-QH?c6%tbz(o=q1)Lh{oa`M~vZhK7Ix>;A5Idq1kPS#kX5a}{0r!q{n zbCexg^IP>?=c-w+;3uZCc8U6FxmJ*o+*a}H>hx!A}a4 z=qsF5MP{{Tqi7|;7NE3H$WP8Bcs(;Q{(uk^vjH4V{+QE=RcTr)02Qzfe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MtNm zs7`VKPe^okb^upMz*HAN2SCRGofTO5g?8f&AmvpexC|zg4v&@q0000 255 0 0 255 + 0 255 0 255 + DefaultRoadMaterialOther 10 DefaultRoadMaterialTop 0 0 1 - DefaultRoadMaterialOther - 0 255 0 255 + + + lowerHeight + + 50 + 1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000 + 100 + 1 + 1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000 + 90 + 0 + 0.1 + 1 + 10 + + + 40 40 + 40 40 + 1 + 1 + ellipse + - 72 70 68 255 - 59 58 57 255 - 255 255 255 255 - 43 43 43 255 17 16 15 255 - 37 36 35 255 - 32 31 30 255 - 50 49 48 255 - 255 255 255 255 - 236 234 232 255 + 234 232 230 255 178 175 172 255 + 255 255 255 255 72 70 68 255 50 49 48 255 - 100 98 96 255 + 43 43 43 255 + 32 31 30 255 59 58 57 255 - 96 94 92 255 - 234 232 230 255 - 77 77 77 255 + 100 98 96 255 + 37 36 35 255 50 49 48 255 - - - 1 - 1 - 0 0 0 100 - 1 - 0 - 255 255 255 255 - 135 - 180 180 180 255 - 1 - 1 - 1 - 40 40 - 0 - 45 - 0.1 + 50 49 48 255 + 77 77 77 255 + 255 255 255 255 + 236 234 232 255 + 72 70 68 255 + 59 58 57 255 + 96 94 92 255 - tools/gui + tools/worldEditor/gui 1024 768 - - 0 - 0 - 0 + + Categorized + + + 1 + 1 + 2 + 0 + 8 + 1 + 1 + 1 + + + 1 + 1 + + + http://www.garagegames.com/products/torque-3d/documentation/user + ../../../Documentation/Torque 3D - Script Manual.chm + ../../../Documentation/Official Documentation.html 0 - - 1 - 2 - 1 - 8 - 1 - 1 - 0 - 1 - - - http://www.garagegames.com/products/torque-3d/documentation/user - ../../../Documentation/Official Documentation.html - ../../../Documentation/Torque 3D - Script Manual.chm - - - 1 - 1 - - - Categorized + + 0 + 0 + 0 - - 0.8 - 0.8 - 0 - 15 - 0 - 1 - 100 - - 0 - 1 - 0 - 1 1 1 - 255 255 255 20 - 500 - + + 135 + 40 40 + 0.1 + 1 + 1 + 1 + 1 + 255 255 255 255 + 45 + 1 + 0 0 0 100 + 1 + 0 + 0 + 180 180 180 255 - AssetWork_Debug.exe - 40 - screenCenter - 6 0 + AssetWork_Debug.exe 50 + 40 Modern + screenCenter 1 - WorldEditorInspectorPlugin - - 51 51 51 100 - 102 102 102 100 - 1 - 255 255 255 100 - 1 - - - 1 - 1 - 1 - 1 - 1 - - - 8 - 255 - 20 - 0 - 1 - - - 255 255 0 255 - 255 255 0 255 - 0 0 255 255 - 255 0 0 255 - 255 255 255 255 - 100 100 100 255 - 0 255 0 255 - - - 255 255 255 255 - 215 215 215 255 - 48 48 48 255 - 180 180 180 255 - 50 50 50 255 - - - 0 - 2 - 0 - 1 - 100 - 0 - 1 + 6 + TerrainPainterPlugin + + tools/worldEditor/images/SelectHandle + tools/worldEditor/images/LockedHandle + tools/worldEditor/images/DefaultHandle http://www.garagegames.com/products/torque-3d/documentation/user http://www.garagegames.com/products/torque-3d/forums - ../../../Documentation/Torque 3D - Script Manual.chm ../../../Documentation/Official Documentation.html + ../../../Documentation/Torque 3D - Script Manual.chm - - tools/worldEditor/images/DefaultHandle - tools/worldEditor/images/LockedHandle - tools/worldEditor/images/SelectHandle + + 215 215 215 255 + 255 255 255 255 + 50 50 50 255 + 48 48 48 255 + 180 180 180 255 + + + 102 102 102 100 + 255 255 255 100 + 51 51 51 100 + 1 + 1 + + + 1 + 8 + 20 + 0 + 255 + + + 1 + 0 + 0.01 + 1 + 0 + 100 + 0 + 0 + 2 + + + 1 + 1 + 1 + 1 + 1 + + + 0 0 255 255 + 255 0 0 255 + 0 255 0 255 + 255 255 0 255 + 255 255 255 255 + 255 255 0 255 + 100 100 100 255 Classic - <AssetType>/<SpecialAssetTag>/ - 1 - <AssetType>/ - <AssetType>/OtherFolder/ - <AssetType>/ + <AssetType>/ <AssetType>/<AssetName>/ TestConfig - <AssetType>/ - <AssetType>/ <AssetType>/ <AssetType>/<SpecialAssetTag>/ + <AssetType>/ + <AssetType>/ + <AssetType>/<SpecialAssetTag>/ + 1 + <AssetType>/ + <AssetType>/OtherFolder/ - - lowerHeight - - 1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000 - 1 - 90 - 50 - 0 - 1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000 - 0.1 - 10 - 100 - 1 + + data/FPSGameplay/levels + + + 25 + + + 5 + - - 1 - ellipse - 40 40 - 40 40 - 1 - - - - 0 255 0 255 - 255 255 255 255 - DefaultDecalRoadMaterial - 10 TestConfig @@ -217,32 +207,44 @@ - DefaultPlayerData 1 + DefaultPlayerData AIPlayer + 0 0 1 255 0 0 255 10 - 0 0 1 - 0 255 0 255 - 255 255 255 255 5 + 255 255 255 255 + 0 255 0 255 - - data/FPSGameplay/levels - - - 5 - - - 25 - + + 15 + 0.8 + 0 + 0.8 + 1 + 0 + 100 + + 1 1 1 + 500 + 255 255 255 20 + 0 + 1 + 0 Small + + DefaultDecalRoadMaterial + 10 + 0 255 0 255 + 255 255 255 255 + Grid_512_Orange diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/guiCreateNewTerrainGui.gui b/Templates/BaseGame/game/tools/worldEditor/gui/guiCreateNewTerrainGui.gui index 23d65e24a..943e85185 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/guiCreateNewTerrainGui.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/guiCreateNewTerrainGui.gui @@ -299,6 +299,20 @@ function CreateNewTerrainGui::onWake( %this ) { %this-->theName.setText( "" ); + + //Run through and grab any TerrainMaterialAssets + %assetQuery = new AssetQuery(); + AssetDatabase.findAssetType(%assetQuery, "TerrainMaterialAsset"); + + %count = %assetQuery.getCount(); + + for(%i=0; %i < %count; %i++) + { + %assetId = %assetQuery.getAsset(%i); + + AssetDatabase.acquireAsset(%assetId); + } + %assetQuery.delete(); %matList = %this-->theMaterialList; %matList.clear(); @@ -313,8 +327,8 @@ function CreateNewTerrainGui::onWake( %this ) %rezList.add( "512", 512 ); %rezList.add( "1024", 1024 ); %rezList.add( "2048", 2048 ); - //%rezList.add( "4096", 4096 ); - %rezList.setSelected( 256 ); + %rezList.add( "4096", 4096 ); + %rezList.setSelected( 512 ); %this-->flatRadio.setStateOn( true ); } diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainMaterialDlg.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainMaterialDlg.ed.gui index 09a90ef26..5c39cbbf5 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainMaterialDlg.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainMaterialDlg.ed.gui @@ -1,632 +1,495 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(TerrainMaterialDlg, EditorGuiGroup) { - canSaveDynamicFields = "0"; - isContainer = "1"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; +%guiContent = new GuiControl(TerrainMaterialDlg,EditorGuiGroup) { position = "0 0"; - Extent = "800 768"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; + extent = "1024 768"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "1"; new GuiWindowCtrl() { - canSaveDynamicFields = "0"; - isContainer = "1"; - Profile = "ToolsGuiWindowProfile"; - HorizSizing = "center"; - VertSizing = "center"; - position = "221 151"; - Extent = "394 432"; - MinExtent = "358 432"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Docking = "None"; - Margin = "4 4 4 4"; - Padding = "0 0 0 0"; - AnchorTop = "0"; - AnchorBottom = "0"; - AnchorLeft = "0"; - AnchorRight = "0"; + text = "Terrain Materials Editor"; resizeWidth = "1"; resizeHeight = "1"; canMove = "1"; canClose = "1"; canMinimize = "0"; canMaximize = "0"; - minSize = "50 50"; + canCollapse = "0"; closeCommand = "TerrainMaterialDlg.dialogCancel();"; - EdgeSnap = "0"; - text = "Terrain Materials Editor"; - new GuiContainer(){ //Node Properties + edgeSnap = "0"; + docking = "None"; + margin = "4 4 4 4"; + padding = "0 0 0 0"; + anchorTop = "0"; + anchorBottom = "0"; + anchorLeft = "0"; + anchorRight = "0"; + position = "315 168"; + extent = "394 494"; + minExtent = "358 432"; + horizSizing = "center"; + vertSizing = "center"; + profile = "ToolsGuiWindowProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiContainer() { + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "6 25"; + extent = "189 64"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "inspectorStyleRolloutDarkProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; isContainer = "1"; - Profile = "inspectorStyleRolloutDarkProfile"; - HorizSizing = "width"; - VertSizing = "bottom"; - Position = "6 25"; - Extent = "189 64"; - - new GuiTextCtrl(){ - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - Position = "5 0"; - Extent = "91 18"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiTextCtrl() { text = "Terrain Materials"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "5 0"; + extent = "91 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiBitmapButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiButtonProfile"; - HorizSizing = "left"; - VertSizing = "top"; - position = "160 2"; - Extent = "15 15"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg.newMat();"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; bitmap = "tools/gui/images/new"; - }; - new GuiBitmapButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiButtonProfile"; - HorizSizing = "left"; - VertSizing = "top"; - position = "173 2"; - Extent = "15 15"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg.deleteMat();"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; + position = "160 2"; + extent = "15 15"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "top"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.newMat();"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiBitmapButtonCtrl() { bitmap = "tools/gui/images/delete"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "173 2"; + extent = "15 15"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "top"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.deleteMat();"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; }; new GuiContainer() { - canSaveDynamicFields = "0"; - internalName = "matSettingsParent"; - isContainer = "1"; - Profile = "inspectorStyleRolloutProfile"; - HorizSizing = "left"; - VertSizing = "height"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; position = "202 26"; - Extent = "185 363"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; + extent = "185 425"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "height"; + profile = "inspectorStyleRolloutProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; + isContainer = "1"; + internalName = "matSettingsParent"; + canSave = "1"; + canSaveDynamicFields = "0"; new GuiBitmapCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "width"; - VertSizing = "bottom"; - position = "1 0"; - Extent = "183 2"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; bitmap = "core/art/gui/images/separator-v"; + color = "255 255 255 255"; wrap = "0"; + position = "1 0"; + extent = "183 2"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "8 22"; - Extent = "44 17"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiDefaultProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; text = "Name"; maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "8 22"; + extent = "44 17"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiDefaultProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiTextEditCtrl() { - internalName = "matNameCtrl"; - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextEditProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "39 21"; - Extent = "143 18"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; - maxLength = "1024"; historySize = "0"; - password = "0"; tabComplete = "0"; sinkAllKeyEvents = "0"; + password = "0"; passwordMask = "*"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "39 21"; + extent = "143 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextEditProfile"; + visible = "1"; + active = "1"; altCommand = "TerrainMaterialDlg.setMaterialName( $ThisControl.getText() );"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "matNameCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiInspectorTitleTextProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "8 0"; - Extent = "117 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; text = "Material Properties"; maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "8 0"; + extent = "117 16"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiInspectorTitleTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiContainer() { - canSaveDynamicFields = "0"; - isContainer = "1"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "width"; - VertSizing = "bottom"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; position = "6 43"; - Extent = "185 75"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; + extent = "185 75"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; new GuiCheckBoxCtrl() { - internalName = "sideProjectionCtrl"; - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiCheckBoxProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "55 54"; - Extent = "119 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; text = " Use Side Projection"; groupNum = "-1"; buttonType = "ToggleButton"; useMouseEvents = "0"; - useInactiveState = "0"; + position = "55 54"; + extent = "119 16"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiCheckBoxProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "sideProjectionCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiBitmapCtrl() { - internalName = "baseTexCtrl"; - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "1 1"; - Extent = "47 47"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; bitmap = "tools/materialEditor/gui/unknownImage"; + color = "255 255 255 255"; wrap = "0"; + position = "1 1"; + extent = "47 47"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "baseTexCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiBitmapButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "1 1"; - Extent = "48 48"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg.changeBase();"; - tooltipprofile = "ToolsGuiDefaultProfile"; - ToolTip = "Change the Active Diffuse Map for this layer"; - hovertime = "1000"; + bitmap = "tools/materialEditor/gui/cubemapBtnBorder"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; - bitmap = "tools/materialEditor/gui/cubemapBtnBorder"; + position = "1 1"; + extent = "48 48"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.changeBase();"; + tooltipProfile = "ToolsGuiDefaultProfile"; + tooltip = "Change the Active Diffuse Map for this layer"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "EditorTextProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "56 -3"; - Extent = "39 18"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; text = "Diffuse"; maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "56 -3"; + extent = "39 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "EditorTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextProfile"; - HorizSizing = "width"; - VertSizing = "bottom"; - position = "56 16"; - Extent = "116 17"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; text = "None"; maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "56 16"; + extent = "116 17"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiButtonProfile"; - HorizSizing = "left"; - VertSizing = "bottom"; - position = "116 0"; - Extent = "40 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg.changeBase();"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; text = "Edit"; groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; + position = "116 0"; + extent = "40 16"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.changeBase();"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiBitmapButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "left"; - VertSizing = "bottom"; - position = "159 0"; - Extent = "16 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg-->baseTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; + bitmap = "tools/gui/images/delete"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; - bitmap = "tools/gui/images/delete"; + position = "159 0"; + extent = "16 16"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg-->baseTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "132 35"; - Extent = "39 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "0"; - AnchorBottom = "0"; - AnchorLeft = "0"; - AnchorRight = "0"; text = "Size"; maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "0"; + anchorBottom = "0"; + anchorLeft = "0"; + anchorRight = "0"; + position = "132 35"; + extent = "39 16"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiTextEditCtrl() { - internalName = "baseSizeCtrl"; - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextEditProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; + historySize = "0"; + tabComplete = "0"; + sinkAllKeyEvents = "0"; + password = "0"; + passwordMask = "*"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "0"; + anchorBottom = "0"; + anchorLeft = "0"; + anchorRight = "0"; position = "94 34"; - Extent = "34 18"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; + extent = "34 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextEditProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "0"; - AnchorBottom = "0"; - AnchorLeft = "0"; - AnchorRight = "0"; - maxLength = "1024"; - historySize = "0"; - password = "0"; - tabComplete = "0"; - sinkAllKeyEvents = "0"; - passwordMask = "*"; + isContainer = "0"; + internalName = "baseSizeCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; }; }; new GuiBitmapCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "width"; - VertSizing = "bottom"; + bitmap = "tools/gui/images/separator-v"; + color = "255 255 255 255"; + wrap = "0"; position = "6 116"; - Extent = "175 2"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - bitmap = "tools/gui/images/separator-v"; - wrap = "0"; - }; - new GuiContainer() { - canSaveDynamicFields = "0"; - isContainer = "1"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "width"; - VertSizing = "bottom"; - position = "6 295"; - Extent = "185 50"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; - - new GuiBitmapCtrl() { - internalName = "normTexCtrl"; - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "1 1"; - Extent = "47 47"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - bitmap = "tools/materialEditor/gui/unknownImage"; - wrap = "0"; - }; - new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "EditorTextProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "56 -3"; - Extent = "39 18"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; - text = "Normal"; - maxLength = "1024"; - }; - new GuiBitmapButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "1 1"; - Extent = "48 48"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg.changeNormal();"; - tooltipprofile = "ToolsGuiDefaultProfile"; - ToolTip = "Change the active Normal Map for this layer."; - hovertime = "1000"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - bitmap = "tools/materialEditor/gui/cubemapBtnBorder"; - }; - new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextProfile"; - HorizSizing = "width"; - VertSizing = "bottom"; - position = "56 15"; - Extent = "116 17"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; - text = "None"; - maxLength = "1024"; - }; - new GuiButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiButtonProfile"; - HorizSizing = "left"; - VertSizing = "bottom"; - position = "116 0"; - Extent = "40 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg.changeNormal();"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - text = "Edit"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - }; - new GuiBitmapButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "left"; - VertSizing = "bottom"; - position = "159 0"; - Extent = "16 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg-->normTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - bitmap = "tools/gui/images/delete"; - }; - new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "92 34"; - Extent = "77 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; - text = "Parallax Scale"; - maxLength = "1024"; - }; - new GuiTextEditCtrl() { - internalName = "parallaxScaleCtrl"; - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextEditProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "55 33"; - Extent = "34 18"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "0"; - AnchorBottom = "0"; - AnchorLeft = "0"; - AnchorRight = "0"; - text = "0.00"; - maxLength = "1024"; - historySize = "0"; - password = "0"; - tabComplete = "0"; - sinkAllKeyEvents = "0"; - passwordMask = "*"; - }; - }; - - new GuiBitmapCtrl() { - bitmap = "tools/gui/images/separator-v"; - wrap = "0"; - position = "6 288"; extent = "175 2"; minExtent = "8 2"; horizSizing = "width"; @@ -648,6 +511,410 @@ anchorLeft = "1"; anchorRight = "0"; position = "6 122"; + extent = "185 50"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiBitmapCtrl() { + bitmap = "tools/materialEditor/gui/unknownImage"; + color = "255 255 255 255"; + wrap = "0"; + position = "1 1"; + extent = "47 47"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "normTexCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Normal"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "56 -3"; + extent = "39 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "EditorTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiBitmapButtonCtrl() { + bitmap = "tools/materialEditor/gui/cubemapBtnBorder"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "1 1"; + extent = "48 48"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.changeNormal();"; + tooltipProfile = "ToolsGuiDefaultProfile"; + tooltip = "Change the active Normal Map for this layer."; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "None"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "56 15"; + extent = "116 17"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + text = "Edit"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "116 0"; + extent = "40 16"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.changeNormal();"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiBitmapButtonCtrl() { + bitmap = "tools/gui/images/delete"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "159 0"; + extent = "16 16"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg-->normTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Parallax Scale"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "92 34"; + extent = "77 16"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextEditCtrl() { + historySize = "0"; + tabComplete = "0"; + sinkAllKeyEvents = "0"; + password = "0"; + passwordMask = "*"; + text = "0.00"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "0"; + anchorBottom = "0"; + anchorLeft = "0"; + anchorRight = "0"; + position = "55 33"; + extent = "34 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextEditProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "parallaxScaleCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + new GuiBitmapCtrl() { + bitmap = "tools/gui/images/separator-v"; + color = "255 255 255 255"; + wrap = "0"; + position = "6 177"; + extent = "175 2"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiContainer() { + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "6 184"; + extent = "185 50"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiBitmapCtrl() { + bitmap = "tools/materialEditor/gui/unknownImage"; + color = "255 255 255 255"; + wrap = "0"; + position = "1 1"; + extent = "47 47"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "pbrConfigTexCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "PBR Config"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "56 -3"; + extent = "60 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "EditorTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiBitmapButtonCtrl() { + bitmap = "tools/materialEditor/gui/cubemapBtnBorder"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "1 1"; + extent = "48 48"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.changePBRConfig();"; + tooltipProfile = "ToolsGuiDefaultProfile"; + tooltip = "Change the active PBR Config Map for this layer."; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "None"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "56 15"; + extent = "116 17"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + text = "Edit"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "116 0"; + extent = "40 16"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.changePBRConfig();"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiBitmapButtonCtrl() { + bitmap = "tools/gui/images/delete"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "159 0"; + extent = "16 16"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg-->pbrConfigTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + new GuiBitmapCtrl() { + bitmap = "tools/gui/images/separator-v"; + color = "255 255 255 255"; + wrap = "0"; + position = "6 238"; + extent = "175 2"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiContainer() { + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "6 245"; extent = "185 72"; minExtent = "8 2"; horizSizing = "width"; @@ -663,6 +930,336 @@ new GuiBitmapCtrl() { bitmap = "tools/materialEditor/gui/unknownImage"; + color = "255 255 255 255"; + wrap = "0"; + position = "1 1"; + extent = "47 47"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "detailTexCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiBitmapButtonCtrl() { + bitmap = "tools/materialEditor/gui/cubemapBtnBorder"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "1 1"; + extent = "48 48"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.changeDetail();"; + tooltipProfile = "ToolsGuiDefaultProfile"; + tooltip = "Change the active Detail Map for this layer."; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Detail"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "56 -3"; + extent = "30 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "EditorTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "None"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "56 16"; + extent = "116 17"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + text = "Edit"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "116 0"; + extent = "40 16"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.changeDetail();"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiBitmapButtonCtrl() { + bitmap = "tools/gui/images/delete"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "159 0"; + extent = "16 16"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg-->detailTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Size"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "0"; + anchorBottom = "0"; + anchorLeft = "0"; + anchorRight = "0"; + position = "132 33"; + extent = "39 16"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextEditCtrl() { + historySize = "0"; + tabComplete = "0"; + sinkAllKeyEvents = "0"; + password = "0"; + passwordMask = "*"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "0"; + anchorBottom = "0"; + anchorLeft = "0"; + anchorRight = "0"; + position = "94 32"; + extent = "34 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextEditProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "detSizeCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Strength"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "0"; + anchorBottom = "0"; + anchorLeft = "0"; + anchorRight = "0"; + position = "39 54"; + extent = "46 16"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextEditCtrl() { + historySize = "0"; + tabComplete = "0"; + sinkAllKeyEvents = "0"; + password = "0"; + passwordMask = "*"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "0"; + anchorBottom = "0"; + anchorLeft = "0"; + anchorRight = "0"; + position = "1 53"; + extent = "34 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextEditProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "detStrengthCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Distance"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "0"; + anchorBottom = "0"; + anchorLeft = "0"; + anchorRight = "0"; + position = "132 54"; + extent = "45 16"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextEditCtrl() { + historySize = "0"; + tabComplete = "0"; + sinkAllKeyEvents = "0"; + password = "0"; + passwordMask = "*"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "0"; + anchorBottom = "0"; + anchorLeft = "0"; + anchorRight = "0"; + position = "94 53"; + extent = "34 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextEditProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "detDistanceCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + new GuiBitmapCtrl() { + bitmap = "tools/gui/images/separator-v"; + color = "255 255 255 255"; + wrap = "0"; + position = "6 320"; + extent = "175 2"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiContainer() { + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "6 327"; + extent = "185 72"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiBitmapCtrl() { + bitmap = "tools/materialEditor/gui/unknownImage"; + color = "255 255 255 255"; wrap = "0"; position = "1 1"; extent = "47 47"; @@ -685,6 +1282,7 @@ autoFitExtents = "0"; useModifiers = "0"; useStates = "1"; + masked = "0"; groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; @@ -776,6 +1374,7 @@ autoFitExtents = "0"; useModifiers = "0"; useStates = "1"; + masked = "0"; groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; @@ -948,443 +1547,174 @@ canSaveDynamicFields = "0"; }; }; - - new GuiBitmapCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "width"; - VertSizing = "bottom"; - position = "6 200"; - Extent = "175 2"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - bitmap = "tools/gui/images/separator-v"; - wrap = "0"; - }; - new GuiContainer() { - canSaveDynamicFields = "0"; - isContainer = "1"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "width"; - VertSizing = "bottom"; - position = "6 206"; - Extent = "185 72"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; - - new GuiBitmapCtrl() { - internalName = "detailTexCtrl"; - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "1 1"; - Extent = "47 47"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - bitmap = "tools/materialEditor/gui/unknownImage"; - wrap = "0"; - }; - new GuiBitmapButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "1 1"; - Extent = "48 48"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg.changeDetail();"; - tooltipprofile = "ToolsGuiDefaultProfile"; - ToolTip = "Change the active Detail Map for this layer."; - hovertime = "1000"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - bitmap = "tools/materialEditor/gui/cubemapBtnBorder"; - }; - new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "EditorTextProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "56 -3"; - Extent = "30 18"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; - text = "Detail"; - maxLength = "1024"; - }; - new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextProfile"; - HorizSizing = "width"; - VertSizing = "bottom"; - position = "56 16"; - Extent = "116 17"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; - text = "None"; - maxLength = "1024"; - }; - new GuiButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiButtonProfile"; - HorizSizing = "left"; - VertSizing = "bottom"; - position = "116 0"; - Extent = "40 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg.changeDetail();"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - text = "Edit"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - }; - new GuiBitmapButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "left"; - VertSizing = "bottom"; - position = "159 0"; - Extent = "16 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg-->detailTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - bitmap = "tools/gui/images/delete"; - }; - new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "132 33"; - Extent = "39 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "0"; - AnchorBottom = "0"; - AnchorLeft = "0"; - AnchorRight = "0"; - text = "Size"; - maxLength = "1024"; - }; - new GuiTextEditCtrl() { - internalName = "detSizeCtrl"; - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextEditProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "94 32"; - Extent = "34 18"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "0"; - AnchorBottom = "0"; - AnchorLeft = "0"; - AnchorRight = "0"; - maxLength = "1024"; - historySize = "0"; - password = "0"; - tabComplete = "0"; - sinkAllKeyEvents = "0"; - passwordMask = "*"; - }; - new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "39 54"; - Extent = "46 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "0"; - AnchorBottom = "0"; - AnchorLeft = "0"; - AnchorRight = "0"; - text = "Strength"; - maxLength = "1024"; - }; - new GuiTextEditCtrl() { - internalName = "detStrengthCtrl"; - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextEditProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "1 53"; - Extent = "34 18"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "0"; - AnchorBottom = "0"; - AnchorLeft = "0"; - AnchorRight = "0"; - maxLength = "1024"; - historySize = "0"; - password = "0"; - tabComplete = "0"; - sinkAllKeyEvents = "0"; - passwordMask = "*"; - }; - new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "132 54"; - Extent = "45 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "0"; - AnchorBottom = "0"; - AnchorLeft = "0"; - AnchorRight = "0"; - text = "Distance"; - maxLength = "1024"; - }; - new GuiTextEditCtrl() { - internalName = "detDistanceCtrl"; - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextEditProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "94 53"; - Extent = "34 18"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "0"; - AnchorBottom = "0"; - AnchorLeft = "0"; - AnchorRight = "0"; - maxLength = "1024"; - historySize = "0"; - password = "0"; - tabComplete = "0"; - sinkAllKeyEvents = "0"; - passwordMask = "*"; - }; - }; }; new GuiControl() { - canSaveDynamicFields = "0"; - isContainer = "1"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "width"; - VertSizing = "height"; position = "6 42"; - Extent = "189 373"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; + extent = "189 435"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "height"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; new GuiScrollCtrl() { - canSaveDynamicFields = "0"; - isContainer = "1"; - Profile = "ToolsGuiScrollProfile"; - HorizSizing = "width"; - VertSizing = "height"; - position = "0 0"; - Extent = "189 374"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; willFirstRespond = "1"; hScrollBar = "dynamic"; vScrollBar = "dynamic"; - lockHorizScroll = "false"; - lockVertScroll = "false"; + 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 = "0 0"; + extent = "189 436"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "height"; + profile = "ToolsGuiScrollProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; new GuiTreeViewCtrl() { - internalName = "matLibTree"; - canSaveDynamicFields = "0"; - class = "TerrainMaterialTreeCtrl"; - className = "TerrainMaterialTreeCtrl"; - isContainer = "1"; - Profile = "ToolsGuiTreeViewProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "1 1"; - Extent = "125 84"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; tabSize = "16"; textOffset = "2"; fullRowSelect = "0"; itemHeight = "21"; destroyTreeOnSleep = "1"; - MouseDragging = "0"; - MultipleSelections = "0"; - DeleteObjectAllowed = "0"; - DragToItemAllowed = "0"; - ClearAllOnSingleSelection = "1"; + mouseDragging = "0"; + multipleSelections = "0"; + deleteObjectAllowed = "0"; + dragToItemAllowed = "0"; + clearAllOnSingleSelection = "1"; showRoot = "0"; - internalNamesOnly = "1"; - objectNamesOnly = "0"; + useInspectorTooltips = "0"; + tooltipOnWidthOnly = "0"; + showObjectIds = "0"; + showClassNames = "0"; + showObjectNames = "0"; + showInternalNames = "1"; + showClassNameForUnnamedObjects = "0"; + compareToObjectID = "1"; + canRenameObjects = "1"; + renameInternal = "0"; + position = "1 1"; + extent = "8 2"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTreeViewProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + internalName = "matLibTree"; + class = "TerrainMaterialTreeCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; }; }; }; new GuiButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiButtonProfile"; - HorizSizing = "left"; - VertSizing = "top"; - position = "202 394"; - Extent = "98 22"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg.dialogApply();"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; text = "Apply&Select"; groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; + position = "202 456"; + extent = "98 22"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "top"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.dialogApply();"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiButtonProfile"; - HorizSizing = "left"; - VertSizing = "top"; - position = "307 394"; - Extent = "80 22"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg.dialogCancel();"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; text = "Cancel"; groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; + position = "307 456"; + extent = "80 22"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "top"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.dialogCancel();"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; - - new GuiBitmapCtrl() { // inactive overlay - internalName = "inactiveOverlay"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "left"; - VertSizing = "height"; - position = "199 23"; - Extent = "190 267"; - isContainer = true; - Visible = false; + new GuiBitmapCtrl() { bitmap = "tools/gui/images/inactive-overlay"; - - new GuiTextCtrl(){ - internalName = "inactiveOverlayDlg"; - Profile = "ToolsGuiTextCenterProfile"; - HorizSizing = "width"; - VertSizing = "center"; - position = "0 104"; - Extent = "190 64"; + color = "255 255 255 255"; + wrap = "0"; + position = "199 23"; + extent = "190 329"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "height"; + profile = "ToolsGuiDefaultProfile"; + visible = "0"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + internalName = "inactiveOverlay"; + hidden = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiTextCtrl() { text = "Inactive"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "0 132"; + extent = "190 64"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "center"; + profile = "ToolsGuiTextCenterProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + internalName = "inactiveOverlayDlg"; + canSave = "1"; + canSaveDynamicFields = "0"; }; }; }; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui index f7ccd33c4..95ed67f52 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui @@ -227,6 +227,77 @@ function ObjectBuilderGui::gotFileName(%this, %name) //%this.controls[%this.currentControl].setValue(%name); } +//------------------------------------------------------------------------------ +function ObjectBuilderGui::createTerrainAssetType(%this, %index) +{ + if(%index >= %this.numFields || %this.field[%index, name] $= "") + { + error("ObjectBuilderGui::createTerrainAssetType: invalid field"); + return; + } + + // + if(%this.field[%index, text] $= "") + %name = %this.field[%index, name]; + else + %name = %this.field[%index, text]; + + // + %this.textControls[%this.numControls] = new GuiTextCtrl() { + profile = "ToolsGuiTextRightProfile"; + text = %name; + extent = %this.fieldNameExtent; + position = %this.curXPos @ " " @ %this.curYPos; + modal = "1"; + }; + + // + %this.controls[%this.numControls] = new GuiButtonCtrl() { + HorizSizing = "width"; + profile = "ToolsGuiButtonProfile"; + extent = %this.fileButtonExtent; + position = %this.curXPos + %this.columnOffset @ " " @ %this.curYPos; + modal = "1"; + command = %this @ ".getTerrainAsset(" @ %index @ ");"; + }; + + %val = %this.field[%index, value]; + %this.controls[%this.numControls].setValue(fileBase(%val) @ fileExt(%val)); + + %this.numControls++; + %this.curYPos += %this.defaultFieldStep; +} + +function ObjectBuilderGui::getTerrainAsset(%this, %index) +{ + if(%index >= %this.numFields || %this.field[%index, name] $= "") + { + error("ObjectBuilderGui::getTerrainAsset: invalid field"); + return; + } + + %val = %this.field[%index, ext]; + + //%path = filePath(%val); + //%ext = fileExt(%val); + + %this.currentControl = %index; + AssetBrowser.showDialog("TerrainAsset", %this @ ".gotTerrainAsset", "", "", ""); + //getLoadFilename( %val @ "|" @ %val, %this @ ".gotFileName", %this.lastPath ); +} + +function ObjectBuilderGui::gotTerrainAsset(%this, %name) +{ + %index = %this.currentControl; + + %this.field[%index, value] = %name; + %this.controls[%this.currentControl].setText(fileBase(%name) @ fileExt(%name)); + + %this.lastPath = %name; + + // This doesn't work for button controls as getValue returns their state! + //%this.controls[%this.currentControl].setValue(%name); +} //------------------------------------------------------------------------------ function ObjectBuilderGui::createMaterialNameType(%this, %index) @@ -489,6 +560,9 @@ function ObjectBuilderGui::process(%this) case "TypeFile": %this.createFileType(%i); + + case "TypeTerrainAsset": + %this.createTerrainAssetType(%i); case "TypeMaterialName": %this.createMaterialNameType(%i); @@ -830,6 +904,7 @@ function ObjectBuilderGui::buildTerrainBlock(%this) %this.createCallback = "ETerrainEditor.attachTerrain();"; %this.addField("terrainFile", "TypeFile", "Terrain file", "", "*.ter"); + %this.addField("terrainAsset", "TypeTerrainAsset", "Terrain Asset", "", ""); %this.addField("squareSize", "TypeInt", "Square size", "8"); %this.process(); diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/interfaces/terrainMaterialDlg.ed.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/interfaces/terrainMaterialDlg.ed.cs index 2ec8e17f3..5cd3e38d3 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/interfaces/terrainMaterialDlg.ed.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/interfaces/terrainMaterialDlg.ed.cs @@ -83,6 +83,20 @@ function TerrainMaterialDlg::onWake( %this ) if( !isObject( TerrainMaterialDlgDeleteGroup ) ) new SimGroup( TerrainMaterialDlgDeleteGroup ); + //Run through and grab any TerrainMaterialAssets + %assetQuery = new AssetQuery(); + AssetDatabase.findAssetType(%assetQuery, "TerrainMaterialAsset"); + + %count = %assetQuery.getCount(); + + for(%i=0; %i < %count; %i++) + { + %assetId = %assetQuery.getAsset(%i); + + AssetDatabase.acquireAsset(%assetId); + } + %assetQuery.delete(); + // Snapshot the materials. %this.snapshotMaterials(); @@ -292,12 +306,33 @@ function TerrainMaterialDlg::changeNormal( %this ) %ctrl.setBitmap( %file ); } +//----------------------------------------------------------------------------- +function TerrainMaterialDlg::changePBRConfig( %this ) +{ + %ctrl = %this-->pbrConfigTexCtrl; + %file = %ctrl.bitmap; + if( getSubStr( %file, 0 , 6 ) $= "tools/" ) + %file = ""; + + %file = TerrainMaterialDlg._selectTextureFileDialog( %file ); + if( %file $= "" ) + { + if( %ctrl.bitmap !$= "" ) + %file = %ctrl.bitmap; + else + %file = "tools/materialEditor/gui/unknownImage"; + } + + %file = makeRelativePath( %file, getMainDotCsDir() ); + %ctrl.setBitmap( %file ); +} + //----------------------------------------------------------------------------- function TerrainMaterialDlg::newMat( %this ) { // Create a unique material name. - %matName = getUniqueInternalName( "newMaterial", TerrainMaterialSet, true ); + /*%matName = getUniqueInternalName( "newMaterial", TerrainMaterialSet, true ); // Create the new material. %newMat = new TerrainMaterial() @@ -308,12 +343,16 @@ function TerrainMaterialDlg::newMat( %this ) %newMat.setFileName( "art/terrains/materials.cs" ); // Mark it as dirty and to be saved in the default location. - ETerrainMaterialPersistMan.setDirty( %newMat, "art/terrains/materials.cs" ); - - %matLibTree = %this-->matLibTree; - %matLibTree.buildVisibleTree( true ); - %item = %matLibTree.findItemByObjectId( %newMat ); - %matLibTree.selectItem( %item ); + ETerrainMaterialPersistMan.setDirty( %newMat, "art/terrains/materials.cs" );*/ + + %scene = getRootScene(); + %path = filePath(%scene.getFilename()); + %module = AssetBrowser.getModuleFromAddress(%path); + AssetBrowser.selectedModule = %module.moduleID; + + AssetBrowser.currentAddress = "data/" @ %module.moduleID; + + AssetBrowser.setupCreateNewAsset("TerrainMaterialAsset", AssetBrowser.selectedModule); } //----------------------------------------------------------------------------- @@ -380,6 +419,11 @@ function TerrainMaterialDlg::setActiveMaterial( %this, %mat ) }else{ %this-->baseTexCtrl.setBitmap( %mat.diffuseMap ); } + if (%mat.pbrConfigMap $= ""){ + %this-->pbrConfigTexCtrl.setBitmap( "tools/materialEditor/gui/unknownImage" ); + }else{ + %this-->pbrConfigTexCtrl.setBitmap( %mat.pbrConfigMap ); + } if (%mat.detailMap $= ""){ %this-->detailTexCtrl.setBitmap( "tools/materialEditor/gui/unknownImage" ); }else{ @@ -438,6 +482,11 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat ) }else{ %newNormal = %this-->normTexCtrl.bitmap; } + if (%this-->pbrConfigTexCtrl.bitmap $= "tools/materialEditor/gui/unknownImage"){ + %newPBRConfig = ""; + }else{ + %newPBRConfig = %this-->pbrConfigTexCtrl.bitmap; + } if (%this-->detailTexCtrl.bitmap $= "tools/materialEditor/gui/unknownImage"){ %newDetail = ""; }else{ @@ -466,6 +515,7 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat ) %mat.diffuseMap $= %newDiffuse && %mat.normalMap $= %newNormal && %mat.detailMap $= %newDetail && + %mat.pbrConfigMap $= %newPBRConfig && %mat.macroMap $= %newMacro && %mat.detailSize == %detailSize && %mat.diffuseSize == %diffuseSize && @@ -497,7 +547,8 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat ) } %mat.diffuseMap = %newDiffuse; - %mat.normalMap = %newNormal; + %mat.normalMap = %newNormal; + %mat.pbrConfigMap = %newPBRConfig; %mat.detailMap = %newDetail; %mat.macroMap = %newMacro; %mat.detailSize = %detailSize; @@ -543,6 +594,7 @@ function TerrainMaterialDlg::snapshotMaterials( %this ) internalName = %mat.internalName; diffuseMap = %mat.diffuseMap; normalMap = %mat.normalMap; + pbrConfigMap = %mat.pbrConfigMap; detailMap = %mat.detailMap; macroMap = %mat.macroMap; detailSize = %mat.detailSize; @@ -577,6 +629,7 @@ function TerrainMaterialDlg::restoreMaterials( %this ) %mat.setInternalName( %obj.internalName ); %mat.diffuseMap = %obj.diffuseMap; %mat.normalMap = %obj.normalMap; + %mat.pbrConfigMap = %obj.pbrConfigMap; %mat.detailMap = %obj.detailMap; %mat.macroMap = %obj.macroMap; %mat.detailSize = %obj.detailSize; diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.cs index 384517223..221af7944 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.cs @@ -280,7 +280,17 @@ function EditorSaveMission() initContainerTypeSearch($TypeMasks::TerrainObjectType); while ((%terrainObject = containerSearchNext()) != 0) - %terrainObject.save(%terrainObject.terrainFile); + { + if(%terrainObject.terrainAsset !$= "") + { + //we utilize a terrain asset, so we'll update our dependencies while we're at it + %terrainObject.saveAsset(); + } + else + { + %terrainObject.save(%terrainObject.terrainFile); + } + } } ETerrainPersistMan.saveDirty(); From d8cc73f5a1fb557fcc80aa227fc41a190d299c36 Mon Sep 17 00:00:00 2001 From: Areloch Date: Thu, 7 Nov 2019 00:42:55 -0600 Subject: [PATCH 21/21] Added utility methods to AssetBase: getAssetDependencyFieldCount clearAssetDependencyFields addAssetDependencyField saveAsset Updated the saveAsset function for terrain block to utilize utility methods to ensure the terrain asset's material dependencies, so they will load properly. --- Engine/source/assets/assetBase.cpp | 72 ++++++++++++++++++ Engine/source/assets/assetBase.h | 6 ++ .../source/assets/assetBase_ScriptBinding.h | 30 +++++++- Engine/source/terrain/terrData.cpp | 71 ++++------------- .../gui/scripts/fonts/Arial 14 (ansi).uft | Bin 5075 -> 5117 bytes .../scripts/assetTypes/terrain.cs | 41 ---------- 6 files changed, 120 insertions(+), 100 deletions(-) diff --git a/Engine/source/assets/assetBase.cpp b/Engine/source/assets/assetBase.cpp index e1bc9bf7a..2eb33a299 100644 --- a/Engine/source/assets/assetBase.cpp +++ b/Engine/source/assets/assetBase.cpp @@ -284,6 +284,78 @@ void AssetBase::refreshAsset(void) //----------------------------------------------------------------------------- +S32 AssetBase::getAssetDependencyFieldCount(const char* pFieldName) +{ + S32 matchedFieldCount = 0; + SimFieldDictionary* fieldDictionary = getFieldDictionary(); + for (SimFieldDictionaryIterator itr(fieldDictionary); *itr; ++itr) + { + SimFieldDictionary::Entry* entry = *itr; + + if (String(entry->slotName).startsWith(pFieldName)) + { + matchedFieldCount++; + } + } + + return matchedFieldCount; +} + +//----------------------------------------------------------------------------- + +void AssetBase::clearAssetDependencyFields(const char* pFieldName) +{ + SimFieldDictionary* fieldDictionary = getFieldDictionary(); + for (SimFieldDictionaryIterator itr(fieldDictionary); *itr; ++itr) + { + SimFieldDictionary::Entry* entry = *itr; + + if (String(entry->slotName).startsWith(pFieldName)) + { + setDataField(entry->slotName, NULL, ""); + } + } +} + +//----------------------------------------------------------------------------- + +void AssetBase::addAssetDependencyField(const char* pFieldName, const char* pAssetId) +{ + U32 existingFieldCount = getAssetDependencyFieldCount(pFieldName); + + //we have a match! + char depSlotName[50]; + dSprintf(depSlotName, sizeof(depSlotName), "%s%d", pFieldName, existingFieldCount); + + char depValue[255]; + dSprintf(depValue, sizeof(depValue), "@Asset=%s", pAssetId); + + setDataField(StringTable->insert(depSlotName), NULL, StringTable->insert(depValue)); +} + +//----------------------------------------------------------------------------- +bool AssetBase::saveAsset() +{ + // Set the format mode. + Taml taml; + + // Yes, so set it. + taml.setFormatMode(Taml::getFormatModeEnum("xml")); + + // Turn-off auto-formatting. + taml.setAutoFormat(false); + + // Read object. + bool success = taml.write(this, AssetDatabase.getAssetFilePath(getAssetId())); + + if (!success) + return false; + + return true; +} + +//----------------------------------------------------------------------------- + void AssetBase::acquireAssetReference(void) { // Acquired the acquired reference count. diff --git a/Engine/source/assets/assetBase.h b/Engine/source/assets/assetBase.h index 73c6df1c0..f127c83cc 100644 --- a/Engine/source/assets/assetBase.h +++ b/Engine/source/assets/assetBase.h @@ -104,6 +104,12 @@ public: void refreshAsset(void); + S32 getAssetDependencyFieldCount(const char* pFieldName); + void clearAssetDependencyFields(const char* pFieldName); + void addAssetDependencyField(const char* pFieldName, const char* pAssetId); + + bool saveAsset(); + /// Declare Console Object. DECLARE_CONOBJECT(AssetBase); diff --git a/Engine/source/assets/assetBase_ScriptBinding.h b/Engine/source/assets/assetBase_ScriptBinding.h index 8ac8f6a0d..6c0b4be66 100644 --- a/Engine/source/assets/assetBase_ScriptBinding.h +++ b/Engine/source/assets/assetBase_ScriptBinding.h @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- // Copyright (c) 2013 GarageGames, LLC // // Permission is hereby granted, free of charge, to any person obtaining a copy @@ -39,3 +39,31 @@ DefineEngineMethod(AssetBase, getAssetId, String, (), , { return object->getAssetId(); } + +DefineEngineMethod(AssetBase, getAssetDependencyFieldCount, S32, (const char* pFieldName), (""), + "Gets the assets' Asset Id. This is only available if the asset was acquired from the asset manager.\n" + "@return The assets' Asset Id.\n") +{ + return object->getAssetDependencyFieldCount(pFieldName); +} + +DefineEngineMethod(AssetBase, clearAssetDependencyFields, void, (const char* pFieldName), (""), + "Gets the assets' Asset Id. This is only available if the asset was acquired from the asset manager.\n" + "@return The assets' Asset Id.\n") +{ + object->clearAssetDependencyFields(pFieldName); +} + +DefineEngineMethod(AssetBase, addAssetDependencyField, void, (const char* pFieldName, const char* pAssetId), ("", ""), + "Gets the assets' Asset Id. This is only available if the asset was acquired from the asset manager.\n" + "@return The assets' Asset Id.\n") +{ + object->addAssetDependencyField(pFieldName, pAssetId); +} + +DefineEngineMethod(AssetBase, saveAsset, bool, (), , + "Gets the assets' Asset Id. This is only available if the asset was acquired from the asset manager.\n" + "@return The assets' Asset Id.\n") +{ + return object->saveAsset(); +} diff --git a/Engine/source/terrain/terrData.cpp b/Engine/source/terrain/terrData.cpp index 2193ff66d..a961b260f 100644 --- a/Engine/source/terrain/terrData.cpp +++ b/Engine/source/terrain/terrData.cpp @@ -370,7 +370,7 @@ bool TerrainBlock::setTerrainAsset(const StringTableEntry terrainAssetId) if (!file) return false; - mFile = file; + setFile(file); return true; } @@ -383,25 +383,13 @@ bool TerrainBlock::saveAsset() { if (!mTerrainAsset.isNull() && mTerrainAsset->isAssetValid()) { - //first, clear out our old dependency references - /*SimFieldDictionary* fieldDictionary = mTerrainAsset->getFieldDictionary(); - for (SimFieldDictionaryIterator itr(fieldDictionary); *itr; ++itr) - { - SimFieldDictionary::Entry* entry = *itr; - - if (String(entry->slotName).startsWith("terrainMaterailAsset")) - { - //got one, so clear it's value - setDataField(entry->slotName, NULL, ""); - } - } + mTerrainAsset->clearAssetDependencyFields("terrainMaterailAsset"); AssetQuery* pAssetQuery = new AssetQuery(); AssetDatabase.findAssetType(pAssetQuery, "TerrainMaterialAsset"); TerrainBlock* clientTerr = static_cast(getClientObject()); - U32 terrMatIdx = 0; for (U32 i = 0; i < pAssetQuery->mAssetList.size(); i++) { //Acquire it so we can check it for matches @@ -414,16 +402,7 @@ bool TerrainBlock::saveAsset() StringTableEntry assetMatDefName = terrMatAsset->getMaterialDefinitionName(); if (assetMatDefName == intMatName) { - //we have a match! - char depSlotName[30]; - dSprintf(depSlotName, sizeof(depSlotName), "terrainMaterialAsset%d", terrMatIdx); - - char depValue[255]; - dSprintf(depValue, sizeof(depValue), "@Asset=%s", terrMatAsset.getAssetId()); - - setDataField(depSlotName, NULL, depValue); - - terrMatIdx++; + mTerrainAsset->addAssetDependencyField("terrainMaterailAsset", terrMatAsset.getAssetId()); } } @@ -432,20 +411,10 @@ bool TerrainBlock::saveAsset() pAssetQuery->destroySelf(); - // Set the format mode. - Taml taml; + bool saveAssetSuccess = mTerrainAsset->saveAsset(); - // Yes, so set it. - taml.setFormatMode(Taml::getFormatModeEnum("xml")); - - // Turn-off auto-formatting. - taml.setAutoFormat(false); - - // Read object. - bool success = taml.write(mTerrainAsset, AssetDatabase.getAssetFilePath(mTerrainAsset.getAssetId())); - - if (!success) - return false;*/ + if (!saveAssetSuccess) + return false; return mFile->save(mTerrainAsset->getTerrainFilePath()); } @@ -1251,15 +1220,15 @@ void TerrainBlock::setScale( const VectorF &scale ) void TerrainBlock::initPersistFields() { addGroup( "Media" ); - - addProtectedField( "terrainFile", TypeStringFilename, Offset( mTerrFileName, TerrainBlock ), - &TerrainBlock::_setTerrainFile, &defaultProtectedGetFn, - "The source terrain data file." ); addProtectedField("terrainAsset", TypeTerrainAssetPtr, Offset(mTerrainAsset, TerrainBlock), &TerrainBlock::_setTerrainAsset, &defaultProtectedGetFn, "The source terrain data asset."); + addProtectedField( "terrainFile", TypeStringFilename, Offset( mTerrFileName, TerrainBlock ), + &TerrainBlock::_setTerrainFile, &defaultProtectedGetFn, + "The source terrain data file." ); + endGroup( "Media" ); addGroup( "Misc" ); @@ -1320,7 +1289,6 @@ U32 TerrainBlock::packUpdate(NetConnection* con, U32 mask, BitStream *stream) if ( stream->writeFlag( mask & FileMask ) ) { stream->write( mTerrFileName ); - stream->writeString( mTerrainAssetId ); stream->write( mCRC ); } @@ -1361,25 +1329,12 @@ void TerrainBlock::unpackUpdate(NetConnection* con, BitStream *stream) { FileName terrFile; stream->read( &terrFile ); - char buffer[256]; - stream->readString(buffer); - StringTableEntry terrainAsset = StringTable->insert(buffer); stream->read( &mCRC ); - if (terrainAsset != StringTable->EmptyString()) - { - if (isProperlyAdded()) - setTerrainAsset(StringTable->insert(terrFile.c_str())); - else - mTerrainAssetId = StringTable->insert(terrFile.c_str()); - } + if ( isProperlyAdded() ) + setFile( terrFile ); else - { - if (isProperlyAdded()) - setFile(terrFile); - else - mTerrFileName = terrFile; - } + mTerrFileName = terrFile; } if ( stream->readFlag() ) // SizeMask diff --git a/Templates/BaseGame/game/core/gui/scripts/fonts/Arial 14 (ansi).uft b/Templates/BaseGame/game/core/gui/scripts/fonts/Arial 14 (ansi).uft index 74e399f3185a177abb4ec73d0b64f44f63889d7e..5f100417a46a63b1f563b34004b1650683b1ee14 100644 GIT binary patch delta 2166 zcmV-+2#NR8C;caoA^}~oBg+aK006iE000gE000C4000O800000000O8000G(>k2D> z>`6pHRCt{2*e`VI${NPupNNQvKvW6hs6ZgL*rEcl zMMVXo;)n`F1p-llKp+r^2t)(|fvBj6n6=(30+fCJ+;#3<`>b=;z2BnJFDy`lJYHbxaE3sx*>mJZs z7nWL;>l?*&Xp8Dvo0cT)9Ds0MzKH;-nXby!g-;jN;#_fESqorY;%Xl-J8zW^fh6s3 zaQ=?L-p}&7P5Xn?DLd-IxS#7a07?tu)|PdD6$JT1?mZ9t zh^yTxfc6vp?)_H)HkItCc>^k&(f3ZAF=HKQ{*~?ua<9>>l?|!A7vbwI zX-ITBjo#%J(raNfC9L1C?qf{z~q`1KXQ@GxZf zexGe^nlv{*1~BeJut=gTfb6Jm13p_od8K8!zR50F#N=)Ttosx0KHl$-qbRO+?Q`mt zSPXm5sJu{IrubasbW)JuYL`zVqT>|s&VSrVT|dtQL}~HuyaL!@)OEcz0Pjv{(6Kn_Z38TtI&?8Q5lr2=2a;=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