Browse Source

Implemented proper ScriptAsset execution on load
Implemented script dependency handling
Added test-case of script dependency handling in ExampleModule
Cleanup of redundant getSceneCount calls
Properly get scene count in callGamemodeFunction
Remove unneeded TODO comment in shaders
Converted onMissionEnded gamemode func call to use callGameModeFunction function
Convert ExampleGameMode to be container-object based, and updated callGamemodeFunction to handle that
Correct import settings typoe so image suffixes are read correctly
Largely fixed companion image scanning when importing images and streamlined image-material interop during import preprocessing
Added handling for reading in PBR maps and creating a composite image + asset
Added WIP of Cubemap asset, and editing integration with a standalone cubemap editor
Added ability to create new Cubemap asset in Asset Browser

Areloch 6 years ago
parent
commit
9db95f4fb2
28 changed files with 1300 additions and 721 deletions
  1. 252 0
      Engine/source/T3D/assets/CubemapAsset.cpp
  2. 113 0
      Engine/source/T3D/assets/CubemapAsset.h
  3. 51 0
      Engine/source/T3D/assets/ScriptAsset.cpp
  4. 8 2
      Engine/source/T3D/assets/ScriptAsset.h
  5. 0 2
      Templates/BaseGame/game/core/clientServer/scripts/server/levelDownload.cs
  6. 2 6
      Templates/BaseGame/game/core/clientServer/scripts/server/levelLoad.cs
  7. 1 29
      Templates/BaseGame/game/core/clientServer/scripts/server/server.cs
  8. 2 2
      Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl
  9. 1 1
      Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl
  10. 25 6
      Templates/BaseGame/game/core/utility/scripts/scene.cs
  11. 4 2
      Templates/BaseGame/game/data/ExampleModule/ExampleModule.cs
  12. 7 0
      Templates/BaseGame/game/data/ExampleModule/datablocks/ExampleDatablock.asset.taml
  13. 4 0
      Templates/BaseGame/game/data/ExampleModule/datablocks/ExampleDatablock.cs
  14. 31 25
      Templates/BaseGame/game/data/ExampleModule/scripts/ExampleGamemodeScript.cs
  15. 5 1
      Templates/BaseGame/game/data/ui/UI.cs
  16. 5 0
      Templates/BaseGame/game/data/ui/UI.module
  17. 6 0
      Templates/BaseGame/game/data/ui/datablocks/guiSounds.asset.taml
  18. 6 5
      Templates/BaseGame/game/data/ui/scripts/controlsMenu.cs
  19. 1 0
      Templates/BaseGame/game/tools/assetBrowser/main.cs
  20. 21 15
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs
  21. 70 0
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cubemap.cs
  22. 46 31
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.cs
  23. 49 23
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs
  24. 2 0
      Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs
  25. 454 0
      Templates/BaseGame/game/tools/gui/cubemapEditor.gui
  26. 0 439
      Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPreviewWindow.ed.gui
  27. 132 132
      Templates/BaseGame/game/tools/settings.xml
  28. 2 0
      Templates/BaseGame/game/tools/worldEditor/main.cs

+ 252 - 0
Engine/source/T3D/assets/CubemapAsset.cpp

@@ -0,0 +1,252 @@
+//-----------------------------------------------------------------------------
+// Copyright (c) 2013 GarageGames, LLC
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+
+#ifndef CUBEMAP_ASSET_H
+#include "CubemapAsset.h"
+#endif
+
+#ifndef _ASSET_MANAGER_H_
+#include "assets/assetManager.h"
+#endif
+
+#ifndef _CONSOLETYPES_H_
+#include "console/consoleTypes.h"
+#endif
+
+#ifndef _TAML_
+#include "persistence/taml/taml.h"
+#endif
+
+#ifndef _ASSET_PTR_H_
+#include "assets/assetPtr.h"
+#endif
+
+// Debug Profiling.
+#include "platform/profiler.h"
+
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_CONOBJECT(CubemapAsset);
+
+ConsoleType(CubemapAssetPtr, TypeCubemapAssetPtr, CubemapAsset, ASSET_ID_FIELD_PREFIX)
+
+//-----------------------------------------------------------------------------
+
+ConsoleGetType(TypeCubemapAssetPtr)
+{
+   // Fetch asset Id.
+   return (*((AssetPtr<CubemapAsset>*)dptr)).getAssetId();
+}
+
+//-----------------------------------------------------------------------------
+
+ConsoleSetType(TypeCubemapAssetPtr)
+{
+   // Was a single argument specified?
+   if (argc == 1)
+   {
+      // Yes, so fetch field value.
+      const char* pFieldValue = argv[0];
+
+      // Fetch asset pointer.
+      AssetPtr<CubemapAsset>* pAssetPtr = dynamic_cast<AssetPtr<CubemapAsset>*>((AssetPtrBase*)(dptr));
+
+      // Is the asset pointer the correct type?
+      if (pAssetPtr == NULL)
+      {
+         // No, so fail.
+         //Con::warnf("(TypeCubemapAssetPtr) - Failed to set asset Id '%d'.", pFieldValue);
+         return;
+      }
+
+      // Set asset.
+      pAssetPtr->setAssetId(pFieldValue);
+
+      return;
+   }
+
+   // Warn.
+   Con::warnf("(TypeCubemapAssetPtr) - Cannot set multiple args to a single asset.");
+}
+
+//-----------------------------------------------------------------------------
+
+CubemapAsset::CubemapAsset()
+{
+   mComponentName = StringTable->EmptyString();
+   mComponentClass = StringTable->EmptyString();
+   mFriendlyName = StringTable->EmptyString();
+   mComponentType = StringTable->EmptyString();
+   mDescription = StringTable->EmptyString();
+
+   mScriptFile = StringTable->EmptyString();
+}
+
+//-----------------------------------------------------------------------------
+
+CubemapAsset::~CubemapAsset()
+{
+   // If the asset manager does not own the asset then we own the
+   // asset definition so delete it.
+   if (!getOwned())
+      delete mpAssetDefinition;
+}
+
+//-----------------------------------------------------------------------------
+
+void CubemapAsset::initPersistFields()
+{
+   // Call parent.
+   Parent::initPersistFields();
+
+   addField("componentName", TypeString, Offset(mComponentName, CubemapAsset), "Unique Name of the component. Defines the namespace of the scripts for the component.");
+   addField("componentClass", TypeString, Offset(mComponentClass, CubemapAsset), "Class of object this component uses.");
+   addField("friendlyName", TypeString, Offset(mFriendlyName, CubemapAsset), "The human-readble name for the component.");
+   addField("componentType", TypeString, Offset(mComponentType, CubemapAsset), "The category of the component for organizing in the editor.");
+   addField("description", TypeString, Offset(mDescription, CubemapAsset), "Simple description of the component.");
+
+   addProtectedField("scriptFile", TypeAssetLooseFilePath, Offset(mScriptFile, CubemapAsset),
+      &setScriptFile, &getScriptFile, "A script file with additional scripted functionality for this component.");
+}
+
+//------------------------------------------------------------------------------
+
+void CubemapAsset::copyTo(SimObject* object)
+{
+   // Call to parent.
+   Parent::copyTo(object);
+}
+
+void CubemapAsset::initializeAsset()
+{
+   mScriptFile = expandAssetFilePath(mScriptFile);
+
+   if(Platform::isFile(mScriptFile))
+      Con::executeFile(mScriptFile, false, false);
+}
+
+void CubemapAsset::onAssetRefresh()
+{
+   mScriptFile = expandAssetFilePath(mScriptFile);
+
+   if (Platform::isFile(mScriptFile))
+      Con::executeFile(mScriptFile, false, false);
+}
+
+void CubemapAsset::setScriptFile(const char* pScriptFile)
+{
+   // Sanity!
+   AssertFatal(pScriptFile != NULL, "Cannot use a NULL script file.");
+
+   // Fetch image file.
+   pScriptFile = StringTable->insert(pScriptFile);
+
+   // Ignore no change,
+   if (pScriptFile == mScriptFile)
+      return;
+
+   // Update.
+   mScriptFile = getOwned() ? expandAssetFilePath(pScriptFile) : StringTable->insert(pScriptFile);
+
+   // Refresh the asset.
+   refreshAsset();
+}
+
+//-----------------------------------------------------------------------------
+// GuiInspectorTypeAssetId
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_CONOBJECT(GuiInspectorTypeCubemapAssetPtr);
+
+ConsoleDocClass(GuiInspectorTypeCubemapAssetPtr,
+   "@brief Inspector field type for Shapes\n\n"
+   "Editor use only.\n\n"
+   "@internal"
+);
+
+void GuiInspectorTypeCubemapAssetPtr::consoleInit()
+{
+   Parent::consoleInit();
+
+   ConsoleBaseType::getType(TypeCubemapAssetPtr)->setInspectorFieldType("GuiInspectorTypeCubemapAssetPtr");
+}
+
+GuiControl* GuiInspectorTypeCubemapAssetPtr::constructEditControl()
+{
+   // Create base filename edit controls
+   GuiControl* retCtrl = Parent::constructEditControl();
+   if (retCtrl == NULL)
+      return retCtrl;
+
+   // Change filespec
+   char szBuffer[512];
+   dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"CubemapAsset\", \"AssetBrowser.changeAsset\", %d, %s);",
+      mInspector->getComponentGroupTargetId(), mCaption);
+   mBrowseButton->setField("Command", szBuffer);
+
+   setDataField(StringTable->insert("ComponentOwner"), NULL, String::ToString(mInspector->getComponentGroupTargetId()).c_str());
+
+   // Create "Open in ShapeEditor" button
+   mShapeEdButton = new GuiBitmapButtonCtrl();
+
+   dSprintf(szBuffer, sizeof(szBuffer), "CubemapEditor.openCubemapAsset(%d.getText());", retCtrl->getId());
+   mShapeEdButton->setField("Command", szBuffer);
+
+   char bitmapName[512] = "tools/worldEditor/images/toolbar/shape-editor";
+   mShapeEdButton->setBitmap(bitmapName);
+
+   mShapeEdButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");
+   mShapeEdButton->setDataField(StringTable->insert("tooltipprofile"), NULL, "GuiToolTipProfile");
+   mShapeEdButton->setDataField(StringTable->insert("hovertime"), NULL, "1000");
+   mShapeEdButton->setDataField(StringTable->insert("tooltip"), NULL, "Open this file in the Shape Editor");
+
+   mShapeEdButton->registerObject();
+   addObject(mShapeEdButton);
+
+   return retCtrl;
+}
+
+bool GuiInspectorTypeCubemapAssetPtr::updateRects()
+{
+   S32 dividerPos, dividerMargin;
+   mInspector->getDivider(dividerPos, dividerMargin);
+   Point2I fieldExtent = getExtent();
+   Point2I fieldPos = getPosition();
+
+   mCaptionRect.set(0, 0, fieldExtent.x - dividerPos - dividerMargin, fieldExtent.y);
+   mEditCtrlRect.set(fieldExtent.x - dividerPos + dividerMargin, 1, dividerPos - dividerMargin - 34, fieldExtent.y);
+
+   bool resized = mEdit->resize(mEditCtrlRect.point, mEditCtrlRect.extent);
+   if (mBrowseButton != NULL)
+   {
+      mBrowseRect.set(fieldExtent.x - 32, 2, 14, fieldExtent.y - 4);
+      resized |= mBrowseButton->resize(mBrowseRect.point, mBrowseRect.extent);
+   }
+
+   if (mShapeEdButton != NULL)
+   {
+      RectI shapeEdRect(fieldExtent.x - 16, 2, 14, fieldExtent.y - 4);
+      resized |= mShapeEdButton->resize(shapeEdRect.point, shapeEdRect.extent);
+   }
+
+   return resized;
+}

+ 113 - 0
Engine/source/T3D/assets/CubemapAsset.h

@@ -0,0 +1,113 @@
+#pragma once
+//-----------------------------------------------------------------------------
+// Copyright (c) 2013 GarageGames, LLC
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef CUBEMAP_ASSET_H
+#define CUBEMAP_ASSET_H
+
+#ifndef _ASSET_BASE_H_
+#include "assets/assetBase.h"
+#endif
+
+#ifndef _ASSET_DEFINITION_H_
+#include "assets/assetDefinition.h"
+#endif
+
+#ifndef _STRINGUNIT_H_
+#include "string/stringUnit.h"
+#endif
+
+#ifndef _ASSET_FIELD_TYPES_H_
+#include "assets/assetFieldTypes.h"
+#endif
+
+#include "gui/editor/guiInspectorTypes.h"
+
+//-----------------------------------------------------------------------------
+class CubemapAsset : public AssetBase
+{
+   typedef AssetBase Parent;
+
+   StringTableEntry mComponentName;
+   StringTableEntry mComponentClass;
+   StringTableEntry mFriendlyName;
+   StringTableEntry mComponentType;
+   StringTableEntry mDescription;
+
+   StringTableEntry mScriptFile;
+
+public:
+   CubemapAsset();
+   virtual ~CubemapAsset();
+
+   /// Engine.
+   static void initPersistFields();
+   virtual void copyTo(SimObject* object);
+
+   /// Declare Console Object.
+   DECLARE_CONOBJECT(CubemapAsset);
+
+   StringTableEntry getComponentName() { return mComponentName; }
+   StringTableEntry getComponentClass() { return mComponentClass; }
+   StringTableEntry getFriendlyName() { return mFriendlyName; }
+   StringTableEntry getComponentType() { return mComponentType; }
+   StringTableEntry getDescription() { return mDescription; }
+
+   void setComponentName(StringTableEntry name) { mComponentName = name; }
+   void setComponentClass(StringTableEntry name) { mComponentClass = name; }
+   void setFriendlyName(StringTableEntry name) { mFriendlyName = name; }
+   void setComponentType(StringTableEntry typeName) { mComponentType = typeName; }
+   void setDescription(StringTableEntry description) { mDescription = description; }
+
+   AssetDefinition* getAssetDefinition() { return mpAssetDefinition; }
+
+   void                    setScriptFile(const char* pScriptFile);
+   inline StringTableEntry getScriptFile(void) const { return mScriptFile; };
+
+protected:
+   virtual void            initializeAsset(void);
+   virtual void            onAssetRefresh(void);
+
+   static bool setScriptFile(void *obj, const char *index, const char *data) { static_cast<CubemapAsset*>(obj)->setScriptFile(data); return false; }
+   static const char* getScriptFile(void* obj, const char* data) { return static_cast<CubemapAsset*>(obj)->getScriptFile(); }
+};
+
+DefineConsoleType(TypeCubemapAssetPtr, CubemapAsset)
+
+//-----------------------------------------------------------------------------
+// TypeAssetId GuiInspectorField Class
+//-----------------------------------------------------------------------------
+class GuiInspectorTypeCubemapAssetPtr : public GuiInspectorTypeFileName
+{
+   typedef GuiInspectorTypeFileName Parent;
+public:
+
+   GuiBitmapButtonCtrl* mShapeEdButton;
+
+   DECLARE_CONOBJECT(GuiInspectorTypeCubemapAssetPtr);
+   static void consoleInit();
+
+   virtual GuiControl* constructEditControl();
+   virtual bool updateRects();
+};
+
+#endif // _ASSET_BASE_H_
+

+ 51 - 0
Engine/source/T3D/assets/ScriptAsset.cpp

@@ -123,6 +123,50 @@ void ScriptAsset::copyTo(SimObject* object)
    Parent::copyTo(object);
 }
 
+void ScriptAsset::initializeAsset()
+{
+   mScriptFile = expandAssetFilePath(mScriptFile);
+
+   if (Platform::isFile(mScriptFile))
+   {
+      //We're initialized properly, so we'll go ahead and kick along any dependencies we may have as well
+      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)
+         {
+            AssetPtr<ScriptAsset> scriptAsset = assetDependenciesItr->value;
+
+            mScriptAssets.push_front(scriptAsset);
+
+            // Next dependency.
+            assetDependenciesItr++;
+         }
+      }
+
+      Con::executeFile(mScriptFile, false, false);
+   }
+}
+
+void ScriptAsset::onAssetRefresh()
+{
+   mScriptFile = expandAssetFilePath(mScriptFile);
+
+   if (Platform::isFile(mScriptFile))
+   {
+      //Refresh any dependencies we may have
+      for (U32 i = 0; i < mScriptAssets.size(); i++)
+      {
+         mScriptAssets[i]->onAssetRefresh();
+      }
+
+      Con::executeFile(mScriptFile, false, false);
+   }
+}
+
 void ScriptAsset::setScriptFile(const char* pScriptFile)
 {
    // Sanity!
@@ -144,6 +188,13 @@ void ScriptAsset::setScriptFile(const char* pScriptFile)
 
 bool ScriptAsset::execScript()
 {
+   AssetBase* handle = mpOwningAssetManager->acquireAsset<AssetBase>(getAssetId());
+
+   if (handle)
+      return true;
+
+   return false;
+
    if (Platform::isFile(mScriptFile))
    {
       return Con::executeFile(mScriptFile, false, false);

+ 8 - 2
Engine/source/T3D/assets/ScriptAsset.h

@@ -39,6 +39,10 @@
 #include "assets/assetFieldTypes.h"
 #endif
 
+#ifndef _ASSET_PTR_H_
+#include "assets/assetPtr.h"
+#endif
+
 //-----------------------------------------------------------------------------
 class ScriptAsset : public AssetBase
 {
@@ -47,6 +51,8 @@ class ScriptAsset : public AssetBase
    StringTableEntry        mScriptFile;
    bool                    mIsServerSide;
 
+   Vector<AssetPtr<ScriptAsset>> mScriptAssets;
+
 public:
    ScriptAsset();
    virtual ~ScriptAsset();
@@ -64,8 +70,8 @@ public:
    bool execScript();
 
 protected:
-   virtual void            initializeAsset(void) {}
-   virtual void            onAssetRefresh(void) {}
+   virtual void            initializeAsset(void);
+   virtual void            onAssetRefresh(void);
 
    static bool setScriptFile(void *obj, const char *index, const char *data) { static_cast<ScriptAsset*>(obj)->setScriptFile(data); return false; }
    static const char* getScriptFile(void* obj, const char* data) { return static_cast<ScriptAsset*>(obj)->getScriptFile(); }

+ 0 - 2
Templates/BaseGame/game/core/clientServer/scripts/server/levelDownload.cs

@@ -148,8 +148,6 @@ function serverCmdMissionStartPhase3Ack(%client, %seq)
       %entity.notify("onClientConnect", %client);
    }
    
-   %activeSceneCount = getSceneCount();
-   
    %hasGameMode = callGamemodeFunction("onClientEnterGame", %client);
    
    //if that also failed, just spawn a camera

+ 2 - 6
Templates/BaseGame/game/core/clientServer/scripts/server/levelLoad.cs

@@ -123,6 +123,8 @@ function loadMissionStage2()
    // Make the MissionCleanup group the place where all new objects will automatically be added.
    $instantGroup = MissionCleanup;
    
+   %hasGameMode = callGamemodeFunction("onCreateGame");
+   
    // Construct MOD paths
    pathOnMissionLoadDone();
 
@@ -135,8 +137,6 @@ function loadMissionStage2()
       ClientGroup.getObject(%clientIndex).loadMission();
 
    // Go ahead and launch the game
-   %activeSceneCount = getSceneCount();
-   
    %hasGameMode = callGamemodeFunction("onMissionStart");
 }
 
@@ -148,8 +148,6 @@ function endMission()
    echo("*** ENDING MISSION");
    
    // Inform the game code we're done.
-   %activeSceneCount = getSceneCount();
-   
    %hasGameMode = callGamemodeFunction("onMissionEnded");
 
    // Inform the clients
@@ -181,7 +179,5 @@ function resetMission()
    clearServerPaths();
    
    // Inform the game code we're resetting.
-   %activeSceneCount = getSceneCount();
-   
    %hasGameMode = callGamemodeFunction("onMissionReset", %client);
 }

+ 1 - 29
Templates/BaseGame/game/core/clientServer/scripts/server/server.cs

@@ -267,35 +267,7 @@ function onServerDestroyed()
    echo("*** ENDING MISSION");
    
    // Inform the game code we're done.
-   %activeSceneCount = getSceneCount();
-   
-   %hasGameMode = 0;
-   for(%i=0; %i < %activeSceneCount; %i++)
-   {
-      if(getScene(%i).gameModeName !$= "")
-      {
-         //if the scene defines a game mode, go ahead and envoke it here
-         if(isMethod(getScene(%i).gameModeName, "onMissionEnded"))
-         {
-            eval(getScene(%i).gameModeName @ "::onMissionEnded();" );
-            %hasGameMode = 1;
-         }
-      }
-   }
-   
-   //if none of our scenes have gamemodes, we need to kick off a default
-   if(%hasGameMode == 0)
-   {
-      %defaultModeName = ProjectSettings.value("Gameplay/GameModes/defaultModeName");
-      if(%defaultModeName !$= "")
-      {
-         if(isMethod(%defaultModeName, "onMissionEnded"))
-         {
-            eval(%defaultModeName @ "::onMissionEnded();" );
-            %hasGameMode = 1;
-         }
-      }
-   }
+   %hasGameMode = callGamemodeFunction("onMissionEnded");
 
    // Inform the clients
    for( %clientIndex = 0; %clientIndex < ClientGroup.getCount(); %clientIndex++ ) {

+ 2 - 2
Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl

@@ -129,7 +129,7 @@ Surface createSurface(vec4 normDepth, sampler2D colorBuffer, sampler2D matInfoBu
 	vec4 gbuffer2 = texture(matInfoBuffer, uv);
 	surface.depth = normDepth.a;
 	surface.P = wsEyePos + wsEyeRay * surface.depth;
-	surface.N = tMul(invView, vec4(normDepth.xyz,0)).xyz; //TODO move t3d to use WS normals
+	surface.N = tMul(invView, vec4(normDepth.xyz,0)).xyz;
 	surface.V = normalize(wsEyePos - surface.P);
 	surface.baseColor = gbuffer1;
 	const float minRoughness=1e-4;
@@ -148,7 +148,7 @@ Surface createForwardSurface(vec4 baseColor, vec4 normal, vec4 pbrProperties, in
 
   surface.depth = 0;
 	surface.P = wsPosition;
-	surface.N = tMul(invView, vec4(normal.xyz,0)).xyz; //TODO move t3d to use WS normals
+	surface.N = tMul(invView, vec4(normal.xyz,0)).xyz;
 	surface.V = normalize(wsEyePos - surface.P);
 	surface.baseColor = baseColor;
   const float minRoughness=1e-4;

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl

@@ -108,7 +108,7 @@ inline Surface createSurface(float4 gbuffer0, TORQUE_SAMPLER2D(gbufferTex1), TOR
 
    surface.depth = gbuffer0.a;
 	surface.P = wsEyePos + wsEyeRay * surface.depth;
-	surface.N = mul(invView, float4(gbuffer0.xyz,0)).xyz; //TODO move t3d to use WS normals
+	surface.N = mul(invView, float4(gbuffer0.xyz,0)).xyz;
 	surface.V = normalize(wsEyePos - surface.P);
 	surface.baseColor = gbuffer1;
    const float minRoughness=1e-4;

+ 25 - 6
Templates/BaseGame/game/core/utility/scripts/scene.cs

@@ -3,18 +3,29 @@ function callGamemodeFunction(%gameModeFuncName, %data)
    if(%data !$= "")
       %data = "\""@%data@"\"";
       
+   %activeSceneCount = getSceneCount();
+      
    %hasGameMode = 0;
    for(%i=0; %i < %activeSceneCount; %i++)
    {
-      if(getScene(%i).gameModeName !$= "")
+      %gamemodeName = getScene(%i).gameModeName;
+      if(%gamemodeName !$= "")
       {
          //if the scene defines a game mode, go ahead and envoke it here
-         if(isMethod(getScene(%i).gameModeName, %gameModeFuncName))
+         if(isObject(%gamemodeName) && %gamemodeName.isMethod(%gameModeFuncName))
          {
-            
-            eval(getScene(%i).gameModeName @ "::"@%gameModeFuncName@"("@%data@");" );
+            eval(%gamemodeName @ "."@%gameModeFuncName@"("@%data@");" );
             %hasGameMode = 1;
          }
+         else
+         {
+            //if we don't have an object, attempt the static call  
+            if(isMethod(%gamemodeName, %gameModeFuncName))
+            {
+               eval(%gamemodeName @ "::"@%gameModeFuncName@"("@%data@");" );
+               %hasGameMode = 1;
+            }
+         }
       }
    }
    
@@ -24,11 +35,19 @@ function callGamemodeFunction(%gameModeFuncName, %data)
       %defaultModeName = ProjectSettings.value("Gameplay/GameModes/defaultModeName");
       if(%defaultModeName !$= "")
       {
-         if(isMethod(%defaultModeName, %gameModeFuncName))
+         if(isObject(%defaultModeName) && %defaultModeName.isMethod(%gameModeFuncName))
          {
-            eval(%defaultModeName @ "::"@%gameModeFuncName@"("@%data@");" );
+            eval(%defaultModeName @ "."@%gameModeFuncName@"("@%data@");" );
             %hasGameMode = 1;
          }
+         else
+         {
+            if(isMethod(%defaultModeName, %gameModeFuncName))
+            {
+               eval(%defaultModeName @ "::"@%gameModeFuncName@"("@%data@");" );
+               %hasGameMode = 1;
+            }  
+         }
       }
    }  
    

+ 4 - 2
Templates/BaseGame/game/data/ExampleModule/ExampleModule.cs

@@ -6,7 +6,7 @@
 //else.
 function ExampleModule::onCreate(%this)
 {
-
+   %bool = true;
 }
 
 //Similar to the create function, this is defined in thye module file, and called 
@@ -51,7 +51,7 @@ function ExampleModule::onCreateGameServer(%this)
    //onServerCreated(), it loads the datablocks via this array, and when when the server goes
    //to pass data to the client, it iterates over this list and processes it, ensuring all datablocks
    //are the most up to date possible for transmission to the connecting client
-   %this.registerDatablock("./datablocks/ExampleDatablock.cs");
+   //%this.registerDatablock("./datablocks/ExampleDatablock.cs");
 }
 
 //This is called when a game session server is destroyed, when the game shuts down. It's called from
@@ -69,6 +69,8 @@ function ExampleModule::onDestroyGameServer(%this)
 //and the like
 function ExampleModule::initClient(%this)
 {
+   AssetDatabase.acquireAsset("ExampleModule:exampleDatablock");
+   
    //client scripts
    //Here, we exec out keybind scripts so the player is able to move when they get into a game
    exec("./scripts/default.keybinds.cs");

+ 7 - 0
Templates/BaseGame/game/data/ExampleModule/datablocks/ExampleDatablock.asset.taml

@@ -0,0 +1,7 @@
+<ScriptAsset
+    canSave="true"
+    canSaveDynamicFields="true"
+    AssetName="ExampleDatablock"
+    scriptFile="@assetFile=ExampleDatablock.cs"
+    dependency0="@Asset=UI:guiSounds"
+    VersionId="1" />

+ 4 - 0
Templates/BaseGame/game/data/ExampleModule/datablocks/ExampleDatablock.cs

@@ -0,0 +1,4 @@
+new ScriptObject(DummyObjectTestThing)
+{
+   
+};

+ 31 - 25
Templates/BaseGame/game/data/ExampleModule/scripts/ExampleGamemodeScript.cs

@@ -19,72 +19,78 @@
 //triggers for a CTF mode. The subscene would then have it's GameModeName defined to run the CTF gamemode logic
 //and the levelLoad code will execute it.
 
+function ExampleGameMode::onCreateGame()
+{
+   // Note: The Game object will be cleaned up by MissionCleanup.  Therefore its lifetime is
+   // limited to that of the mission.
+   new ScriptObject(ExampleGameMode){};
+
+   return ExampleGameMode;
+}
+
 //This function is called when the level finishes loading. It sets up the initial configuration, variables and
 //spawning and dynamic objects, timers or rules needed for the gamemode to run
-function ExampleGameMode::onMissionStart()
+function ExampleGameMode::onMissionStart(%this)
 {
    //set up the game and game variables
-   ExampleGameMode::initGameVars();
+   %this.initGameVars();
 
-   if ($Game::Running)
+   if (%this.running)
    {
       error("onMissionStart: End the game first!");
       return;
    }
 
    // Start the game timer
-   if ($Game::Duration)
-      $Game::Schedule = schedule($Game::Duration * 1000, "onGameDurationEnd");
+   if (%this.duration)
+      %this.gameSchedule = schedule(%this.duration * 1000, "onGameDurationEnd");
       
-   $Game::Running = true;
-   
-   $Game = ExampleGameMode;
+   %this.running = true;
 }
 
 //This function is called when the level ends. It can be envoked due to the gamemode ending
 //but is also kicked off when the game server is shut down as a form of cleanup for anything the gamemode
 //created or is managing like the above mentioned dynamic objects or timers
-function ExampleGameMode::onMissionEnded()
+function ExampleGameMode::onMissionEnded(%this)
 {
-   if (!$Game::Running)
+   if (!%this.running)
    {
       error("onMissionEnded: No game running!");
       return;
    }
 
    // Stop any game timers
-   cancel($Game::Schedule);
+   cancel(%this.gameSchedule);
 
-   $Game::Running = false;
-   $Game = "";
+   %this.running = false;
 }
 
 //This function is called in the event the server resets and is used to re-initialize the gamemode
-function ExampleGameMode::onMissionReset()
+function ExampleGameMode::onMissionReset(%this)
 {
    // Called by resetMission(), after all the temporary mission objects
    // have been deleted.
-   ExampleGameMode::initGameVars();
+   %this.initGameVars();
 }
 
 //This sets up our gamemode's duration time
-function ExampleGameMode::initGameVars()
+function ExampleGameMode::initGameVars(%this)
 {
    // Set the gameplay parameters
-   $Game::Duration = 30 * 60;
+   %this.duration = 30 * 60;
 }
 
 //This is called when the timer runs out, allowing the gamemode to end
-function ExampleGameMode::onGameDurationEnd()
+function ExampleGameMode::onGameDurationEnd(%this)
 {
    //we don't end if we're currently editing the level
-   if ($Game::Duration && !(EditorIsActive() && GuiEditorIsActive()))
-      ExampleGameMode::onMissionEnded();
+   if (%this.duration && !(EditorIsActive() && GuiEditorIsActive()))
+      %this.onMissionEnded();
 }
 
 //This is called to actually spawn a control object for the player to utilize
 //A player character, spectator camera, etc.
-function ExampleGameMode::spawnControlObject(%client)
+function ExampleGameMode::spawnControlObject(%this, %client)
 {
    //In this example, we just spawn a camera
    if (!isObject(%client.camera))
@@ -116,25 +122,25 @@ function ExampleGameMode::spawnControlObject(%client)
 //It's used for setting up anything ahead of time for the client, such as loading in client-passed
 //config stuffs, saved data or the like that should be handled BEFORE the client has actually entered
 //the game itself
-function ExampleGameMode::onClientConnect(%client)
+function ExampleGameMode::onClientConnect(%this, %client)
 {
 }
 
 //This is called when a client enters the game server. It's used to spawn a player object
 //set up any client-specific properties such as saved configs, values, their name, etc
 //These callbacks are activated in core/clientServer/scripts/server/levelDownload.cs
-function ExampleGameMode::onClientEnterGame(%client)
+function ExampleGameMode::onClientEnterGame(%this, %client)
 {
    //Set the player name based on the client's connection data
    %client.setPlayerName(%client.connectData);
    
-   ExampleGameMode::spawnControlObject(%client);
+   %this.spawnControlObject(%client);
 }
 
 //This is called when the player leaves the game server. It's used to clean up anything that
 //was spawned or setup for the client when it connected, in onClientEnterGame
 //These callbacks are activated in core/clientServer/scripts/server/levelDownload.cs
-function ExampleGameMode::onClientLeaveGame(%client)
+function ExampleGameMode::onClientLeaveGame(%this, %client)
 {
    // Cleanup the camera
    if (isObject(%client.camera))

+ 5 - 1
Templates/BaseGame/game/data/ui/UI.cs

@@ -14,6 +14,7 @@
 
 function UI::onCreate( %this )
 {
+   %bool = true;
 }
 
 function UI::onDestroy( %this )
@@ -30,7 +31,7 @@ function UI::initClient(%this)
 {
    //Load UI stuff
    //we need to load this because some of the menu profiles use the sounds here
-   exec("./datablocks/guiSounds.cs");
+   //exec("./datablocks/guiSounds.cs");
    
    //Profiles
    exec("./scripts/profiles.cs");
@@ -81,6 +82,9 @@ function UI::initClient(%this)
    exec("./scripts/help.cs");
    exec("./scripts/cursors.cs");
    
+   exec("./guis/menuGraphics.gui");
+   exec("./guis/menuGraphics.cs");
+   
    //exec("./scripts/GuiTreeViewCtrl.cs");
    
    loadStartup();

+ 5 - 0
Templates/BaseGame/game/data/ui/UI.module

@@ -6,4 +6,9 @@
 	CreateFunction="onCreate"
 	DestroyFunction="onDestroy"
 	Group="Game">
+	 <DeclaredAssets
+        canSave="true"
+        canSaveDynamicFields="true"
+        Extension="asset.taml"
+        Recurse="true" />
 </ModuleDefinition>

+ 6 - 0
Templates/BaseGame/game/data/ui/datablocks/guiSounds.asset.taml

@@ -0,0 +1,6 @@
+<ScriptAsset
+    canSave="true"
+    canSaveDynamicFields="true"
+    AssetName="guiSounds"
+    scriptFile="@assetFile=guiSounds.cs"
+    VersionId="1" />

+ 6 - 5
Templates/BaseGame/game/data/ui/scripts/controlsMenu.cs

@@ -51,12 +51,12 @@ $RemapCount++;
 
 function ControlsMenu::loadSettings(%this)
 {
-   ControlSetList.clear();
+   /*ControlSetList.clear();
    ControlSetList.add( "Movement", "Movement" );
    ControlSetList.add( "Combat", "Combat" );
-   ControlSetList.add( "Miscellaneous", "Miscellaneous" );
+   ControlSetList.add( "Miscellaneous", "Miscellaneous" );*/
    
-   ControlSetList.setSelected( "Movement", false );
+   //ControlSetList.setSelected( "Movement", false );
    
    OptionsSettingStack.clear();
    loadGroupKeybinds("Movement");
@@ -118,9 +118,10 @@ function addKeybindOption()
 {
     %tamlReader = new Taml();
    
-    %graphicsOption = %tamlReader.read("data/ui/guis/controlsMenuSetting.taml");
+    %controlOption = %tamlReader.read("data/ui/guis/controlsMenuSetting.taml");
+    %controlOption.extent.x = OptionsSettingStack.extent.x;
 
-    OptionsSettingStack.add(%graphicsOption);
+    OptionsSettingStack.add(%controlOption);
 
     return %graphicsOption;
 }

+ 1 - 0
Templates/BaseGame/game/tools/assetBrowser/main.cs

@@ -66,6 +66,7 @@ function initializeAssetBrowser()
    exec("./scripts/assetTypes/shapeAnimation.cs"); 
    exec("./scripts/assetTypes/sound.cs"); 
    exec("./scripts/assetTypes/stateMachine.cs");   
+   exec("./scripts/assetTypes/cubemap.cs");  
      
    exec("./scripts/fieldTypes.cs");
    

+ 21 - 15
Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs

@@ -381,6 +381,7 @@ function AssetBrowser::addImportingAsset( %this, %assetType, %filePath, %parentA
       statusInfo = "";
       skip = false;
       processed = false;
+      generatedAsset = false;
    };
 
    //little bit of interception here
@@ -425,6 +426,11 @@ function AssetBrowser::addImportingAsset( %this, %assetType, %filePath, %parentA
       }
    }
    
+   if(%assetType $= "Material")
+   {
+      %assetItem.generatedAsset = true;  
+   }
+   
    if(%parentAssetItem $= "")
    {
       ImportAssetTree.insertObject(1, %assetItem);
@@ -723,10 +729,10 @@ function ImportAssetWindow::_findImportingAssetByName(%this, %id, %assetName)
 function ImportAssetWindow::parseImageSuffixes(%this, %assetItem)
 {
    //diffuse
-   %suffixCount = getTokenCount(getAssetImportConfigValue("Image/DiffuseTypeSuffixes", ""), ",;");
+   %suffixCount = getTokenCount(getAssetImportConfigValue("Images/DiffuseTypeSuffixes", ""), ",;");
    for(%sfx = 0; %sfx < %suffixCount; %sfx++)
    {
-      %suffixToken = getToken(getAssetImportConfigValue("Image/DiffuseTypeSuffixes", ""), ",;", %sfx);
+      %suffixToken = getToken(getAssetImportConfigValue("Images/DiffuseTypeSuffixes", ""), ",;", %sfx);
       if(strIsMatchExpr("*"@%suffixToken, %assetItem.AssetName))
       {
          %assetItem.imageSuffixType = %suffixToken;
@@ -735,10 +741,10 @@ function ImportAssetWindow::parseImageSuffixes(%this, %assetItem)
    }
    
    //normal
-   %suffixCount = getTokenCount(getAssetImportConfigValue("Image/NormalTypeSuffixes", ""), ",;");
+   %suffixCount = getTokenCount(getAssetImportConfigValue("Images/NormalTypeSuffixes", ""), ",;");
    for(%sfx = 0; %sfx < %suffixCount; %sfx++)
    {
-      %suffixToken = getToken(getAssetImportConfigValue("Image/NormalTypeSuffixes", ""), ",;", %sfx);
+      %suffixToken = getToken(getAssetImportConfigValue("Images/NormalTypeSuffixes", ""), ",;", %sfx);
       if(strIsMatchExpr("*"@%suffixToken, %assetItem.AssetName))
       {
          %assetItem.imageSuffixType = %suffixToken;
@@ -747,10 +753,10 @@ function ImportAssetWindow::parseImageSuffixes(%this, %assetItem)
    }
    
    //roughness
-   %suffixCount = getTokenCount(getAssetImportConfigValue("Image/RoughnessTypeSuffixes", ""), ",;");
+   %suffixCount = getTokenCount(getAssetImportConfigValue("Images/RoughnessTypeSuffixes", ""), ",;");
    for(%sfx = 0; %sfx < %suffixCount; %sfx++)
    {
-      %suffixToken = getToken(getAssetImportConfigValue("Image/RoughnessTypeSuffixes", ""), ",;", %sfx);
+      %suffixToken = getToken(getAssetImportConfigValue("Images/RoughnessTypeSuffixes", ""), ",;", %sfx);
       if(strIsMatchExpr("*"@%suffixToken, %assetItem.AssetName))
       {
          %assetItem.imageSuffixType = %suffixToken;
@@ -759,10 +765,10 @@ function ImportAssetWindow::parseImageSuffixes(%this, %assetItem)
    }
    
    //Ambient Occlusion
-   %suffixCount = getTokenCount(getAssetImportConfigValue("Image/AOTypeSuffixes", ""), ",;");
+   %suffixCount = getTokenCount(getAssetImportConfigValue("Images/AOTypeSuffixes", ""), ",;");
    for(%sfx = 0; %sfx < %suffixCount; %sfx++)
    {
-      %suffixToken = getToken(getAssetImportConfigValue("Image/AOTypeSuffixes", ""), ",;", %sfx);
+      %suffixToken = getToken(getAssetImportConfigValue("Images/AOTypeSuffixes", ""), ",;", %sfx);
       if(strIsMatchExpr("*"@%suffixToken, %assetItem.AssetName))
       {
          %assetItem.imageSuffixType = %suffixToken;
@@ -771,10 +777,10 @@ function ImportAssetWindow::parseImageSuffixes(%this, %assetItem)
    }
    
    //metalness
-   %suffixCount = getTokenCount(getAssetImportConfigValue("Image/MetalnessTypeSuffixes", ""), ",;");
+   %suffixCount = getTokenCount(getAssetImportConfigValue("Images/MetalnessTypeSuffixes", ""), ",;");
    for(%sfx = 0; %sfx < %suffixCount; %sfx++)
    {
-      %suffixToken = getToken(getAssetImportConfigValue("Image/MetalnessTypeSuffixes", ""), ",;", %sfx);
+      %suffixToken = getToken(getAssetImportConfigValue("Images/MetalnessTypeSuffixes", ""), ",;", %sfx);
       if(strIsMatchExpr("*"@%suffixToken, %assetItem.AssetName))
       {
          %assetItem.imageSuffixType = %suffixToken;
@@ -783,10 +789,10 @@ function ImportAssetWindow::parseImageSuffixes(%this, %assetItem)
    }
    
    //composite
-   %suffixCount = getTokenCount(getAssetImportConfigValue("Image/CompositeTypeSuffixes", ""), ",;");
+   %suffixCount = getTokenCount(getAssetImportConfigValue("Images/CompositeTypeSuffixes", ""), ",;");
    for(%sfx = 0; %sfx < %suffixCount; %sfx++)
    {
-      %suffixToken = getToken(getAssetImportConfigValue("Image/CompositeTypeSuffixes", ""), ",;", %sfx);
+      %suffixToken = getToken(getAssetImportConfigValue("Images/CompositeTypeSuffixes", ""), ",;", %sfx);
       if(strIsMatchExpr("*"@%suffixToken, %assetItem.AssetName))
       {
          %assetItem.imageSuffixType = %suffixToken;
@@ -1017,10 +1023,10 @@ function ImportAssetWindow::refreshChildItem(%this, %id)
       //Check if it's a generated type, like materials
       %inputPathProfile = ToolsGuiTextEditProfile;
       %generatedField = false;
-      if(%assetType $= "Material")
+      if(%assetItem.generatedAsset)
       {
-         %inputField = "(Generated)";
          %generatedField = true;
+         %inputField = "(Generated)";
       }
       else
       {
@@ -1251,7 +1257,7 @@ 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.AssetType !$= "Material" && !isFile(%assetItem.filePath))
+      if(%assetItem.filePath !$= ""  && !%assetItem.generatedAsset && !isFile(%assetItem.filePath))
       {
          %hasIssues = true;  
          %assetItem.status = "error";

+ 70 - 0
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cubemap.cs

@@ -0,0 +1,70 @@
+function AssetBrowser::createCubemapAsset(%this)
+{
+   Canvas.pushDialog(CubemapEditor);
+   return;
+   
+   %moduleName = AssetBrowser.newAssetSettings.moduleName;
+   %modulePath = "data/" @ %moduleName;
+      
+   %assetName = AssetBrowser.newAssetSettings.assetName;
+   
+   %tamlpath = %modulePath @ "/cubemaps/" @ %assetName @ ".asset.taml";
+   %shapeFilePath = %modulePath @ "/cubemaps/" @ %assetName @ ".dae";
+   
+   %asset = new CubemapAsset()
+   {
+      AssetName = %assetName;
+      versionId = 1;
+      friendlyName = AssetBrowser.newAssetSettings.friendlyName;
+      description = AssetBrowser.newAssetSettings.description;
+      fileName = %assetName @ ".dae";
+   };
+   
+   TamlWrite(%asset, %tamlpath);
+   
+   Canvas.popDialog(AssetBrowser_newComponentAsset);
+	
+	%moduleDef = ModuleDatabase.findModule(%moduleName, 1);
+	AssetDatabase.addDeclaredAsset(%moduleDef, %tamlpath);
+
+	AssetBrowser.loadFilters();
+	
+	%treeItemId = AssetBrowserFilterTree.findItemByName(%moduleName);
+	%smItem = AssetBrowserFilterTree.findChildItemByName(%treeItemId, "CubemapAsset");
+	
+	AssetBrowserFilterTree.onSelect(%smItem);
+	
+	return %tamlpath;
+}
+
+function AssetBrowser::editCubemapAsset(%this, %assetDef)
+{
+   %this.hideDialog();
+   CubemapEditor.openCubemapAsset(%assetDef);    
+}
+
+function GuiInspectorTypeCubemapAssetPtr::onControlDropped( %this, %payload, %position )
+{
+   Canvas.popDialog(EditorDragAndDropLayer);
+   
+   // Make sure this is a color swatch drag operation.
+   if( !%payload.parentGroup.isInNamespaceHierarchy( "AssetPreviewControlType_AssetDrop" ) )
+      return;
+
+   %assetType = %payload.dragSourceControl.parentGroup.assetType;
+   
+   if(%assetType $= "CubemapAsset")
+   {
+      echo("DROPPED A CUBEMAP ON A CUBEMAP ASSET COMPONENT FIELD!");  
+      
+      %module = %payload.dragSourceControl.parentGroup.moduleName;
+      %asset = %payload.dragSourceControl.parentGroup.assetName;
+      
+      %targetComponent = %this.ComponentOwner;
+      %targetComponent.CubemapAsset = %module @ ":" @ %asset;
+      
+      //Inspector.refresh();
+   }
+   
+   EWorldEditor.isDirty = true;
+}

+ 46 - 31
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.cs

@@ -18,11 +18,17 @@ function AssetBrowser::prepareImportImageAsset(%this, %assetItem)
       //Check if our material already exists
       //First, lets double-check that we don't already have an
       %materialAsset = ImportAssetWindow.findImportingAssetByName(%noSuffixName);
+      %cratedNewMaterial = false;
+      
       if(%materialAsset == 0)
       {
          %filePath = %assetItem.filePath;
          if(%filePath !$= "")
             %materialAsset = AssetBrowser.addImportingAsset("Material", "", "", %noSuffixName);
+            
+         %materialAsset.filePath = filePath(%assetItem.filePath) @ "/" @ %noSuffixName;
+            
+         %cratedNewMaterial = true;
       }
       
       if(isObject(%materialAsset))
@@ -45,51 +51,60 @@ function AssetBrowser::prepareImportImageAsset(%this, %assetItem)
       //if we find these, we'll just populate into the original's material
       
       //If we need to append the diffuse suffix and indeed didn't find a suffix on the name, do that here
-      if(getAssetImportConfigValue("Images/UseDiffuseSuffixOnOriginImg", "1") == 1)
+      if(%foundSuffixType $= "")
       {
-         if(%foundSuffixType $= "")
+         if(getAssetImportConfigValue("Images/UseDiffuseSuffixOnOriginImg", "1") == 1)
          {
-            %diffuseToken = getToken(getAssetImportConfigValue("Images/DiffuseTypeSuffixes", ""), ",", 0);
-            %assetItem.AssetName = %assetItem.AssetName @ %diffuseToken;
-            
-            if(getAssetImportConfigValue("Materials/PopulateMaterialMaps", "1") == 1)
-               %materialAsset.diffuseImageAsset = %assetItem;
+            if(%foundSuffixType $= "")
+            {
+               %diffuseToken = getToken(getAssetImportConfigValue("Images/DiffuseTypeSuffixes", ""), ",", 0);
+               %assetItem.AssetName = %assetItem.AssetName @ %diffuseToken;
+            }
          }
-         else if(%foundSuffixType !$= "")
+         else
          {
-            //otherwise, if we have some sort of suffix, we'll want to figure out if we've already got an existing material, and should append to it  
-            
-            if(getAssetImportConfigValue("Materials/PopulateMaterialMaps", "1") == 1)
+            //We need to ensure that our image asset doesn't match the same name as the material asset, so if we're not trying to force the diffuse suffix
+            //we'll give it a generic one
+            if(%materialAsset.assetName $= %assetItem.assetName)
             {
-               if(%foundSuffixType $= "diffuse")
-                  %materialAsset.diffuseImageAsset = %assetItem;
-               else if(%foundSuffixType $= "normal")
-                  %materialAsset.normalImageAsset = %assetItem;
-               else if(%foundSuffixType $= "metalness")
-                  %materialAsset.metalnessImageAsset = %assetItem;
-               else if(%foundSuffixType $= "roughness")
-                  %materialAsset.roughnessImageAsset = %assetItem;
-                  else if(%foundSuffixType $= "specular")
-                  %materialAsset.specularImageAsset = %assetItem;
-               else if(%foundSuffixType $= "AO")
-                  %materialAsset.AOImageAsset = %assetItem;
-               else if(%foundSuffixType $= "composite")
-                  %materialAsset.compositeImageAsset = %assetItem;
+               %assetItem.AssetName = %assetItem.AssetName @ "_image";
             }
          }
+         
+         %foundSuffixType = "diffuse";
       }
-      else
+      
+      if(%foundSuffixType !$= "")
       {
-         //We need to ensure that our image asset doesn't match the same name as the material asset, so if we're not trying to force the diffuse suffix
-         //we'll give it a generic one
-         if(%materialAsset.assetName $= %assetItem.assetName)
+         //otherwise, if we have some sort of suffix, we'll want to figure out if we've already got an existing material, and should append to it  
+         
+         if(getAssetImportConfigValue("Materials/PopulateMaterialMaps", "1") == 1)
          {
-            %assetItem.AssetName = %assetItem.AssetName @ "_image";
+            if(%foundSuffixType $= "diffuse")
+               %materialAsset.diffuseImageAsset = %assetItem;
+            else if(%foundSuffixType $= "normal")
+               %materialAsset.normalImageAsset = %assetItem;
+            else if(%foundSuffixType $= "metalness")
+               %materialAsset.metalnessImageAsset = %assetItem;
+            else if(%foundSuffixType $= "roughness")
+               %materialAsset.roughnessImageAsset = %assetItem;
+               else if(%foundSuffixType $= "specular")
+               %materialAsset.specularImageAsset = %assetItem;
+            else if(%foundSuffixType $= "AO")
+               %materialAsset.AOImageAsset = %assetItem;
+            else if(%foundSuffixType $= "composite")
+               %materialAsset.compositeImageAsset = %assetItem;
          }
       }
       
-      %assetItem.processed = true;
+      //If we JUST created this material, we need to do a process pass on it to do any other setup for it
+      if(%cratedNewMaterial)
+      {
+         AssetBrowser.prepareImportMaterialAsset(%materialAsset);
+      }
    }
+   
+   %assetItem.processed = true;
 }
 
 function AssetBrowser::importImageAsset(%this, %assetItem)

+ 49 - 23
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs

@@ -84,29 +84,15 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
       
       if(%assetItem.diffuseImageAsset $= "")
       {
-         //First, load our diffuse map, as set to the material in the shape
-         //We're going to presume(for now) that the specifically-mentioned file for a given material is the diffuse/albedo
-         %diffuseImagePath = %fileDir @ "/" @ %filename @ %fileExt;
+         %diffuseTypeSuffixes = getAssetImportConfigValue("Images/DiffuseTypeSuffixes", "");
          
-         %diffuseImageSuffix = ImportAssetWindow.parseImagePathSuffixes(%diffuseImagePath);
+         %targetFilePath = %this.findMaterialMapFileWSuffix(%fileDir, %fileName, %fileExt, %diffuseTypeSuffixes);
          
-         if(getAssetImportConfigValue("Images/UseDiffuseSuffixOnOriginImage", "1") == 1 && %diffuseImageSuffix $= "")
-         {
-            %diffuseTypeSuffixes = getAssetImportConfigValue("Images/DiffuseTypeSuffixes", "");
-            
-            %diffuseFilename = %this.findMaterialMapFileWSuffix(%fileDir, %fileName, %fileExt, %diffuseTypeSuffixes);
-            
-            if(%diffuseFilename !$= "")
-               %diffuseAsset = AssetBrowser.addImportingAsset("Image", %diffuseFilename, %assetItem, fileBase(%diffuseFilename));
-            else
-               %diffuseAsset = AssetBrowser.addImportingAsset("Image", %diffuseImagePath, %assetItem, %filename @ getToken(%diffuseTypeSuffixes, ",;", 0));
-         }
-         else
+         if(%targetFilePath !$= "")
          {
-            %diffuseAsset = AssetBrowser.addImportingAsset("Image", %diffuseImagePath, %assetItem);
+            %diffuseAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
+            %assetItem.diffuseImageAsset = %diffuseAsset;
          }
-         
-         %assetItem.diffuseImageAsset = %diffuseAsset;
       }
       
       //Now, iterate over our comma-delimited suffixes to see if we have any matches. We'll use the first match in each case, if any.
@@ -209,7 +195,25 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
             %assetItem.compositeImageAsset = %compositeAsset;
          }
       }
+      
+      //If after the above we didn't find any, check to see if we should be generating one
+      if(%assetItem.compositeImageAsset $= "" && getAssetImportConfigValue("Materials/CreateComposites", "1") == 1)
+      {
+         %assetItem.roughnessImageAsset.skip = true;
+         %assetItem.AOImageAsset.skip = true;
+         %assetItem.metalnessImageAsset.skip = true;
+         
+         %compositeAssetPath = "data/" @ %assetItem.moduleName @ "/images";
+         %saveAsPath = %compositeAssetPath @ "/" @ %assetItem.assetName @ "_composite.png";
+         %compositeAsset = AssetBrowser.addImportingAsset("Image", "", %assetItem, %assetItem.assetName @ "_composite");
+         %compositeAsset.generatedAsset = true;
+         %compositeAsset.filePath = %saveAsPath;
+         
+         %assetItem.compositeImageAsset = %compositeAsset;
+      }
    }
+   
+   %assetItem.processed = true;
 }
 
 function AssetBrowser::findMaterialMapFileWSuffix(%this, %fileDir, %filename, %fileExt, %suffixesList)
@@ -291,6 +295,28 @@ function AssetBrowser::importMaterialAsset(%this, %assetItem)
    
    %assetImportSuccessful = TamlWrite(%newAsset, %tamlpath);
    
+   //if we're set to save a composite image, we do that first
+   if(getAssetImportConfigValue("Materials/CreateComposites", "1") == 1)
+   {
+      //don't save a composite if we've already got one bound
+      if(%assetItem.compositeImageAsset !$= "" && %assetItem.compositeImageAsset.generatedAsset)
+      {
+         if(%assetItem.roughnessImageAsset !$= "" || %assetItem.AOImageAsset !$= "" || %assetItem.metalnessImageAsset !$= "")
+         {
+            %channelKey = "0 1 2 3";
+            
+            saveCompositeTexture(%assetItem.AOImageAsset.filePath,
+                                 %assetItem.roughnessImageAsset.filePath,
+                                 %assetItem.metalnessImageAsset.filePath,"",
+                                 %channelKey, 
+                                 %assetItem.compositeImageAsset.filePath); 
+                                 
+            %compositeAssetId = %moduleName @ ":" @ assetItem.compositeImageAsset.assetName;
+            AssetDatabase.refreshAsset(%compositeAssetId);
+         }
+      }
+   }
+   
    %file = new FileObject();
 
    if(%file.openForWrite(%scriptPath))
@@ -317,22 +343,22 @@ function AssetBrowser::importMaterialAsset(%this, %assetItem)
          %file.writeline("   SpecularMap[0] = \"" @ %assetItem.specularImageAsset.filePath @"\";");
          %file.writeline("   SpecularMapAsset[0] = \"" @ %moduleName @ ":" @ %assetItem.specularImageAsset.assetName @"\";");
       }*/
-      if(%assetItem.roughnessImageAsset)
+      if(%assetItem.roughnessImageAsset && %assetItem.roughnessImageAsset.skip == false)
       {
          %file.writeline("   RoughMap[0] = \"" @ %assetItem.roughnessImageAsset.filePath @"\";");
          %file.writeline("   RoughMapAsset[0] = \"" @ %moduleName @ ":" @ %assetItem.roughnessImageAsset.assetName @"\";");
       }
-      if(%assetItem.smoothnessImageAsset)
+      if(%assetItem.smoothnessImageAsset && %assetItem.smoothnessImageAsset.skip == false)
       {
          %file.writeline("   SmoothnessMap[0] = \"" @ %assetItem.smoothnessImageAsset.filePath @"\";");
          %file.writeline("   SmoothnessMapAsset[0] = \"" @ %moduleName @ ":" @ %assetItem.smoothnessImageAsset.assetName @"\";");
       }
-      if(%assetItem.metalnessImageAsset)
+      if(%assetItem.metalnessImageAsset && %assetItem.metalnessImageAsset.skip == false)
       {
          %file.writeline("   MetalMap[0] = \"" @ %assetItem.metalnessImageAsset.filePath @"\";");
          %file.writeline("   MetalMapAsset[0] = \"" @ %moduleName @ ":" @ %assetItem.metalnessImageAsset.assetName @"\";");
       }
-      if(%assetItem.AOImageAsset)
+      if(%assetItem.AOImageAsset && %assetItem.AOImageAsset.skip == false)
       {
          %file.writeline("   AOMap[0] = \"" @ %assetItem.AOImageAsset.filePath @"\";");
          %file.writeline("   AOMapAsset[0] = \"" @ %moduleName @ ":" @ %assetItem.AOImageAsset.assetName @"\";");

+ 2 - 0
Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs

@@ -115,6 +115,8 @@ function AssetBrowser::buildPopupMenus(%this)
          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);";
       };
    }
    

+ 454 - 0
Templates/BaseGame/game/tools/gui/cubemapEditor.gui

@@ -0,0 +1,454 @@
+%guiContent = new GuiControl(CubemapEditor) {
+   canSaveDynamicFields = "0";
+   Enabled = "1";
+   isContainer = "1";
+   Profile = "ToolsGuiDefaultProfile";
+   HorizSizing = "width";
+   VertSizing = "height";
+   Position = "0 0";
+   Extent = "800 600";
+   MinExtent = "8 2";
+   canSave = "1";
+   Visible = "1";
+   hovertime = "1000";
+   
+   new GuiWindowCtrl(CubemapEditorWindow) {
+      canSaveDynamicFields = "0";
+      Enabled = "1";
+      isContainer = "1";
+      Profile = "ToolsGuiWindowProfile";
+      HorizSizing = "center";
+      VertSizing = "center";
+      position = "200 257";
+      Extent = "478 248";
+      MinExtent = "478 248";
+      canSave = "1";
+      Visible = "1";
+      hovertime = "1000";
+      Margin = "0 0 0 0";
+      Padding = "0 0 0 0";
+      AnchorTop = "1";
+      AnchorBottom = "0";
+      AnchorLeft = "1";
+      AnchorRight = "0";
+      resizeWidth = "0";
+      resizeHeight = "0";
+      canMove = "1";
+      canClose = "1";
+      canMinimize = "0";
+      canMaximize = "0";
+      minSize = "50 50";
+      EdgeSnap = "1";
+      closeCommand = "MaterialEditorGui.hideCubemapEditor(true);";
+      text = "Cubemap Editor";
+
+      new GuiTextCtrl(){
+         Profile = "ToolsGuiTextProfile";
+         position = "307 40";
+         Extent = "30 16";
+         text = "Name";
+      };
+      new GuiTextEditCtrl(CubemapEditor_Name) {
+         canSaveDynamicFields = "0";
+         Enabled = "1";
+         isContainer = "0";
+         Profile = "ToolsGuiTextEditProfile";
+         HorizSizing = "right";
+         VertSizing = "bottom";
+         position = "338 40";
+         Extent = "131 18";
+         MinExtent = "8 2";
+         canSave = "1";
+         Visible = "1";
+         hovertime = "1000";
+         Margin = "0 0 0 0";
+         Padding = "0 0 0 0";
+         AnchorTop = "1";
+         AnchorBottom = "0";
+         AnchorLeft = "1";
+         AnchorRight = "0";
+         text = "myCubemap 1";
+         maxLength = "1024";
+         AltCommand = "MaterialEditorGui.editCubemapName($ThisControl.getText());";
+      };
+      new GuiButtonCtrl(){
+         Profile = "ToolsGuiButtonProfile";
+         position = "339 216";
+         Extent = "74 24";
+         text = "Select";
+         command = "MaterialEditorGui.selectCubemap();"; // needs hookup use selected cubemap
+      };
+      new GuiButtonCtrl(){
+         Profile = "ToolsGuiButtonProfile";
+         position = "417 216";
+         Extent = "52 24";
+         text = "Cancel";
+         command = "MaterialEditorGui.hideCubemapEditor(true);"; // needs hookup Cancel
+      };
+      new GuiScrollCtrl(matEd_cubemapEd_availableCubemapScroller) {
+         canSaveDynamicFields = "0";
+         Enabled = "1";
+         isContainer = "1";
+         Profile = "ToolsGuiScrollProfile";
+         HorizSizing = "right";
+         VertSizing = "bottom";
+         position = "5 40";
+         Extent = "154 203";
+         MinExtent = "8 2";
+         canSave = "1";
+         Visible = "1";
+         hovertime = "1000";
+         willFirstRespond = "1";
+         hScrollBar = "alwaysOff";
+         vScrollBar = "dynamic";
+         lockHorizScroll = "true";
+         lockVertScroll = "false";
+         constantThumbHeight = "0";
+         childMargin = "0 0";
+
+         new GuiListBoxCtrl(matEd_cubemapEd_availableCubemapList) {
+            canSaveDynamicFields = "0";
+            Enabled = "1";
+            isContainer = "0";
+            Profile = "ToolsGuiListBoxProfile";
+            HorizSizing = "right";
+            VertSizing = "bottom";
+            position = "2 2";
+            Extent = "128 2";
+            MinExtent = "8 2";
+            canSave = "1";
+            Visible = "1";
+            hovertime = "1000";
+            AllowMultipleSelections = "0";
+            fitParentWidth = "1";
+         };
+      };
+      new GuiTextCtrl(){
+         Profile = "ToolsGuiTextProfile";
+         position = "6 22";
+         Extent = "67 16";
+         text = "Cubemaps";
+      };
+      // ------------------------------ Right X Positive ------------------------------------
+      new GuiBitmapCtrl(matEd_cubemapEd_XPos) {
+         canSaveDynamicFields = "0";
+         Enabled = "1";
+         isContainer = "0";
+         Profile = "ToolsGuiDefaultProfile";
+         HorizSizing = "right";
+         VertSizing = "bottom";
+         position = "299 106";
+         Extent = "64 64";
+         MinExtent = "8 2";
+         canSave = "1";
+         Visible = "1";
+         hovertime = "1000";
+         bitmap = "tools/materialEditor/gui/unknownImage";
+         wrap = "0";
+      };
+      new GuiTextCtrl(matEd_cubeMapEd_xPosTxt) {
+         position = "304 110";
+         Extent = "57 10";
+         text = "+ X  Right";
+      };
+      new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateXPOSImg) {
+         canSaveDynamicFields = "0";
+         Enabled = "1";
+         isContainer = "0";
+         Profile = "ToolsGuiDefaultProfile";
+         HorizSizing = "right";
+         VertSizing = "bottom";
+         position = "299 106";
+         Extent = "64 64";
+         MinExtent = "8 2";
+         canSave = "1";
+         Visible = "1";
+         Command = "MaterialEditorGui.editCubemapImage(\"0\", $ThisControl.bitmap );";
+         tooltipprofile = "ToolsGuiDefaultProfile";
+         ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
+         hovertime = "1000";
+         groupNum = "-1";
+         buttonType = "PushButton";
+         useMouseEvents = "0";
+         bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
+      };
+      // ------------------------------ X Negitive ------------------------------------
+      new GuiBitmapCtrl(matEd_cubemapEd_XNeg) {
+         canSaveDynamicFields = "0";
+         Enabled = "1";
+         isContainer = "0";
+         Profile = "ToolsGuiDefaultProfile";
+         HorizSizing = "right";
+         VertSizing = "bottom";
+         position = "167 106";
+         Extent = "64 64";
+         MinExtent = "8 2";
+         canSave = "1";
+         Visible = "1";
+         hovertime = "1000";
+         bitmap = "tools/materialEditor/gui/unknownImage";
+         wrap = "0";
+      };
+      new GuiTextCtrl(matEd_cubeMapEd_xNegTxt) {
+         position = "171 110";
+         Extent = "57 10";
+         text = "- X  Left";
+      };
+      new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateXNEGImg) {
+         canSaveDynamicFields = "0";
+         Enabled = "1";
+         isContainer = "0";
+         Profile = "ToolsGuiDefaultProfile";
+         HorizSizing = "right";
+         VertSizing = "bottom";
+         position = "167 106";
+         Extent = "64 64";
+         MinExtent = "8 2";
+         canSave = "1";
+         Visible = "1";
+         Command = "MaterialEditorGui.editCubemapImage(\"1\", $ThisControl.bitmap );";
+         tooltipprofile = "ToolsGuiDefaultProfile";
+         ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
+         hovertime = "1000";
+         groupNum = "-1";
+         buttonType = "PushButton";
+         useMouseEvents = "0";
+         bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
+      };
+      // ------------------------------ Y Positive ------------------------------------
+      new GuiBitmapCtrl(matEd_cubemapEd_YPos) {
+         canSaveDynamicFields = "0";
+         Enabled = "1";
+         isContainer = "0";
+         Profile = "ToolsGuiDefaultProfile";
+         HorizSizing = "right";
+         VertSizing = "bottom";
+         position = "233 172";
+         Extent = "64 64";
+         MinExtent = "8 2";
+         canSave = "1";
+         Visible = "1";
+         hovertime = "1000";
+         bitmap = "tools/materialEditor/gui/unknownImage";
+         wrap = "0";
+      };
+      new GuiTextCtrl(matEd_cubeMapEd_yPosTxt) {
+         position = "237 175";
+         Extent = "57 10";
+         text = "+ Y  Front";
+      };
+      new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateYPOSImg) {
+         canSaveDynamicFields = "0";
+         Enabled = "1";
+         isContainer = "0";
+         Profile = "ToolsGuiDefaultProfile";
+         HorizSizing = "right";
+         VertSizing = "bottom";
+         position = "233 172";
+         Extent = "64 64";
+         MinExtent = "8 2";
+         canSave = "1";
+         Visible = "1";
+         Command = "MaterialEditorGui.editCubemapImage(\"3\", $ThisControl.bitmap );";
+         tooltipprofile = "ToolsGuiDefaultProfile";
+         ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
+         hovertime = "1000";
+         groupNum = "-1";
+         buttonType = "PushButton";
+         useMouseEvents = "0";
+         bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
+      };
+      // ------------------------------ Y Negitive ------------------------------------
+      new GuiBitmapCtrl(matEd_cubemapEd_YNeG) {
+         canSaveDynamicFields = "0";
+         Enabled = "1";
+         isContainer = "0";
+         Profile = "ToolsGuiDefaultProfile";
+         HorizSizing = "right";
+         VertSizing = "bottom";
+         position = "233 40";
+         Extent = "64 64";
+         MinExtent = "8 2";
+         canSave = "1";
+         Visible = "1";
+         hovertime = "1000";
+         bitmap = "tools/materialEditor/gui/unknownImage";
+         wrap = "0";
+      };
+      new GuiTextCtrl(matEd_cubeMapEd_yNegTxt) {
+         position = "237 44";
+         Extent = "57 10";
+         text = "- Y  Back";
+      };
+      new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateYNegImg) {
+         canSaveDynamicFields = "0";
+         Enabled = "1";
+         isContainer = "0";
+         Profile = "ToolsGuiDefaultProfile";
+         HorizSizing = "right";
+         VertSizing = "bottom";
+         position = "233 40";
+         Extent = "64 64";
+         MinExtent = "8 2";
+         canSave = "1";
+         Visible = "1";
+         Command = "MaterialEditorGui.editCubemapImage(\"2\", $ThisControl.bitmap );";
+         tooltipprofile = "ToolsGuiDefaultProfile";
+         ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
+         hovertime = "1000";
+         groupNum = "-1";
+         buttonType = "PushButton";
+         useMouseEvents = "0";
+         bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
+      };
+      // ------------------------------ Z Positive ------------------------------------
+      new GuiBitmapCtrl(matEd_cubemapEd_ZPos) {
+         canSaveDynamicFields = "0";
+         Enabled = "1";
+         isContainer = "0";
+         Profile = "ToolsGuiDefaultProfile";
+         HorizSizing = "right";
+         VertSizing = "bottom";
+         position = "233 106";
+         Extent = "64 64";
+         MinExtent = "8 2";
+         canSave = "1";
+         Visible = "1";
+         hovertime = "1000";
+         bitmap = "tools/materialEditor/gui/unknownImage";
+         wrap = "0";
+      };
+      new GuiTextCtrl(matEd_cubeMapEd_zPosTxt) {
+         position = "237 110";
+         Extent = "57 10";
+         text = "+ Z  Top";
+      };
+      new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateZPosImg) {
+         canSaveDynamicFields = "0";
+         Enabled = "1";
+         isContainer = "0";
+         Profile = "ToolsGuiDefaultProfile";
+         HorizSizing = "right";
+         VertSizing = "bottom";
+         position = "233 106";
+         Extent = "64 64";
+         MinExtent = "8 2";
+         canSave = "1";
+         Visible = "1";
+         Command = "MaterialEditorGui.editCubemapImage(\"4\", $ThisControl.bitmap );";
+         tooltipprofile = "ToolsGuiDefaultProfile";
+         ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
+         hovertime = "1000";
+         groupNum = "-1";
+         buttonType = "PushButton";
+         useMouseEvents = "0";
+         bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
+      };
+      // ------------------------------ Z Negitive ------------------------------------
+      new GuiBitmapCtrl(matEd_cubemapEd_ZNeg) {
+         canSaveDynamicFields = "0";
+         Enabled = "1";
+         isContainer = "0";
+         Profile = "ToolsGuiDefaultProfile";
+         HorizSizing = "right";
+         VertSizing = "bottom";
+         position = "365 106";
+         Extent = "64 64";
+         MinExtent = "8 2";
+         canSave = "1";
+         Visible = "1";
+         hovertime = "1000";
+         bitmap = "tools/materialEditor/gui/unknownImage";
+         wrap = "0";
+      };
+      new GuiTextCtrl(matEd_cubeMapEd_zNegTxt) {
+         position = "369 110";
+         Extent = "57 10";
+         text = "- Z  Bottom";
+      };
+      new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateZNegImg) {
+         canSaveDynamicFields = "0";
+         Enabled = "1";
+         isContainer = "0";
+         Profile = "ToolsGuiDefaultProfile";
+         HorizSizing = "right";
+         VertSizing = "bottom";
+         position = "365 106";
+         Extent = "64 64";
+         MinExtent = "8 2";
+         canSave = "1";
+         Visible = "1";
+         Command = "MaterialEditorGui.editCubemapImage(\"5\", $ThisControl.bitmap );";
+         tooltipprofile = "ToolsGuiDefaultProfile";
+         ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
+         hovertime = "1000";
+         groupNum = "-1";
+         buttonType = "PushButton";
+         useMouseEvents = "0";
+         bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
+      };
+
+       // Create New Cubemap
+      new GuiBitmapButtonCtrl() {
+         canSaveDynamicFields = "0";
+         Enabled = "1";
+         isContainer = "0";
+         Profile = "ToolsGuiDefaultProfile";
+         HorizSizing = "right";
+         VertSizing = "top";
+         position = "128 23";
+         Extent = "17 17";
+         MinExtent = "8 2";
+         canSave = "1";
+         Visible = "1";
+         Command = "matEd_addCubemapWindow.setVisible(1);"; // -------------- Needs Hookup Create New Cubemap
+         hovertime = "1000";
+         tooltip = "Create New Cubemap";
+         bitmap = "tools/gui/images/new";
+         groupNum = "-1";
+         buttonType = "PushButton";
+         useMouseEvents = "0";
+      };
+      new GuiBitmapButtonCtrl() {
+         canSaveDynamicFields = "0";
+         Enabled = "1";
+         isContainer = "0";
+         Profile = "ToolsGuiDefaultProfile";
+         HorizSizing = "right";
+         VertSizing = "top";
+         position = "143 23";
+         Extent = "17 17";
+         MinExtent = "8 2";
+         canSave = "1";
+         Visible = "1";
+         Command = "MaterialEditorGui.showDeleteCubemapDialog();"; // -------------- Needs Hookup Delete Cubemap
+         hovertime = "1000";
+         tooltip = "Delete Cubemap";
+         bitmap = "tools/gui/images/delete";
+         groupNum = "-1";
+         buttonType = "PushButton";
+         useMouseEvents = "0";
+      };
+      new GuiBitmapButtonCtrl() {
+         internalName = "saveCubemap";
+         canSaveDynamicFields = "0";
+         Enabled = "1";
+         isContainer = "0";
+         Profile = "ToolsGuiDefaultProfile";
+         HorizSizing = "right";
+         VertSizing = "top";
+         position = "106 23";
+         Extent = "17 17";
+         MinExtent = "8 2";
+         canSave = "1";
+         Visible = "1";
+         Command = "MaterialEditorGui.showSaveCubemapDialog();"; // -------------- Needs Hookup Save Cubemap
+         hovertime = "1000";
+         tooltip = "Save Cubemap";
+         bitmap = "tools/gui/images/save-icon";
+         groupNum = "-1";
+         buttonType = "PushButton";
+         useMouseEvents = "0";
+      };
+   };
+};

+ 0 - 439
Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPreviewWindow.ed.gui

@@ -234,445 +234,6 @@
          text ="Preview in World";
       };
    };
-   new GuiWindowCtrl(matEd_cubemapEditor) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "1";
-      Profile = "ToolsGuiWindowProfile";
-      HorizSizing = "center";
-      VertSizing = "center";
-      position = "200 257";
-      Extent = "478 248";
-      MinExtent = "478 248";
-      canSave = "1";
-      Visible = "0";
-      hovertime = "1000";
-      Margin = "0 0 0 0";
-      Padding = "0 0 0 0";
-      AnchorTop = "1";
-      AnchorBottom = "0";
-      AnchorLeft = "1";
-      AnchorRight = "0";
-      resizeWidth = "0";
-      resizeHeight = "0";
-      canMove = "1";
-      canClose = "1";
-      canMinimize = "0";
-      canMaximize = "0";
-      minSize = "50 50";
-      EdgeSnap = "1";
-      closeCommand = "MaterialEditorGui.hideCubemapEditor(true);";
-      text = "Cubemap Editor";
-
-      new GuiTextCtrl(){
-         Profile = "ToolsGuiTextProfile";
-         position = "307 40";
-         Extent = "30 16";
-         text = "Name";
-      };
-      new GuiTextEditCtrl(matEd_cubemapEd_activeCubemapNameTxt) {
-         canSaveDynamicFields = "0";
-         Enabled = "1";
-         isContainer = "0";
-         Profile = "ToolsGuiTextEditProfile";
-         HorizSizing = "right";
-         VertSizing = "bottom";
-         position = "338 40";
-         Extent = "131 18";
-         MinExtent = "8 2";
-         canSave = "1";
-         Visible = "1";
-         hovertime = "1000";
-         Margin = "0 0 0 0";
-         Padding = "0 0 0 0";
-         AnchorTop = "1";
-         AnchorBottom = "0";
-         AnchorLeft = "1";
-         AnchorRight = "0";
-         text = "myCubemap 1";
-         maxLength = "1024";
-         AltCommand = "MaterialEditorGui.editCubemapName($ThisControl.getText());";
-      };
-      new GuiButtonCtrl(){
-         Profile = "ToolsGuiButtonProfile";
-         position = "339 216";
-         Extent = "74 24";
-         text = "Select";
-         command = "MaterialEditorGui.selectCubemap();"; // needs hookup use selected cubemap
-      };
-      new GuiButtonCtrl(){
-         Profile = "ToolsGuiButtonProfile";
-         position = "417 216";
-         Extent = "52 24";
-         text = "Cancel";
-         command = "MaterialEditorGui.hideCubemapEditor(true);"; // needs hookup Cancel
-      };
-      new GuiScrollCtrl(matEd_cubemapEd_availableCubemapScroller) {
-         canSaveDynamicFields = "0";
-         Enabled = "1";
-         isContainer = "1";
-         Profile = "ToolsGuiScrollProfile";
-         HorizSizing = "right";
-         VertSizing = "bottom";
-         position = "5 40";
-         Extent = "154 203";
-         MinExtent = "8 2";
-         canSave = "1";
-         Visible = "1";
-         hovertime = "1000";
-         willFirstRespond = "1";
-         hScrollBar = "alwaysOff";
-         vScrollBar = "dynamic";
-         lockHorizScroll = "true";
-         lockVertScroll = "false";
-         constantThumbHeight = "0";
-         childMargin = "0 0";
-
-         new GuiListBoxCtrl(matEd_cubemapEd_availableCubemapList) {
-            canSaveDynamicFields = "0";
-            Enabled = "1";
-            isContainer = "0";
-            Profile = "ToolsGuiListBoxProfile";
-            HorizSizing = "right";
-            VertSizing = "bottom";
-            position = "2 2";
-            Extent = "128 2";
-            MinExtent = "8 2";
-            canSave = "1";
-            Visible = "1";
-            hovertime = "1000";
-            AllowMultipleSelections = "0";
-            fitParentWidth = "1";
-         };
-      };
-      new GuiTextCtrl(){
-         Profile = "ToolsGuiTextProfile";
-         position = "6 22";
-         Extent = "67 16";
-         text = "Cubemaps";
-      };
-      // ------------------------------ Right X Positive ------------------------------------
-      new GuiBitmapCtrl(matEd_cubemapEd_XPos) {
-         canSaveDynamicFields = "0";
-         Enabled = "1";
-         isContainer = "0";
-         Profile = "ToolsGuiDefaultProfile";
-         HorizSizing = "right";
-         VertSizing = "bottom";
-         position = "299 106";
-         Extent = "64 64";
-         MinExtent = "8 2";
-         canSave = "1";
-         Visible = "1";
-         hovertime = "1000";
-         bitmap = "tools/materialEditor/gui/unknownImage";
-         wrap = "0";
-      };
-      new GuiTextCtrl(matEd_cubeMapEd_xPosTxt) {
-         position = "304 110";
-         Extent = "57 10";
-         text = "+ X  Right";
-      };
-      new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateXPOSImg) {
-         canSaveDynamicFields = "0";
-         Enabled = "1";
-         isContainer = "0";
-         Profile = "ToolsGuiDefaultProfile";
-         HorizSizing = "right";
-         VertSizing = "bottom";
-         position = "299 106";
-         Extent = "64 64";
-         MinExtent = "8 2";
-         canSave = "1";
-         Visible = "1";
-         Command = "MaterialEditorGui.editCubemapImage(\"0\", $ThisControl.bitmap );";
-         tooltipprofile = "ToolsGuiDefaultProfile";
-         ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
-         hovertime = "1000";
-         groupNum = "-1";
-         buttonType = "PushButton";
-         useMouseEvents = "0";
-         bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
-      };
-      // ------------------------------ X Negitive ------------------------------------
-      new GuiBitmapCtrl(matEd_cubemapEd_XNeg) {
-         canSaveDynamicFields = "0";
-         Enabled = "1";
-         isContainer = "0";
-         Profile = "ToolsGuiDefaultProfile";
-         HorizSizing = "right";
-         VertSizing = "bottom";
-         position = "167 106";
-         Extent = "64 64";
-         MinExtent = "8 2";
-         canSave = "1";
-         Visible = "1";
-         hovertime = "1000";
-         bitmap = "tools/materialEditor/gui/unknownImage";
-         wrap = "0";
-      };
-      new GuiTextCtrl(matEd_cubeMapEd_xNegTxt) {
-         position = "171 110";
-         Extent = "57 10";
-         text = "- X  Left";
-      };
-      new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateXNEGImg) {
-         canSaveDynamicFields = "0";
-         Enabled = "1";
-         isContainer = "0";
-         Profile = "ToolsGuiDefaultProfile";
-         HorizSizing = "right";
-         VertSizing = "bottom";
-         position = "167 106";
-         Extent = "64 64";
-         MinExtent = "8 2";
-         canSave = "1";
-         Visible = "1";
-         Command = "MaterialEditorGui.editCubemapImage(\"1\", $ThisControl.bitmap );";
-         tooltipprofile = "ToolsGuiDefaultProfile";
-         ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
-         hovertime = "1000";
-         groupNum = "-1";
-         buttonType = "PushButton";
-         useMouseEvents = "0";
-         bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
-      };
-      // ------------------------------ Y Positive ------------------------------------
-      new GuiBitmapCtrl(matEd_cubemapEd_YPos) {
-         canSaveDynamicFields = "0";
-         Enabled = "1";
-         isContainer = "0";
-         Profile = "ToolsGuiDefaultProfile";
-         HorizSizing = "right";
-         VertSizing = "bottom";
-         position = "233 172";
-         Extent = "64 64";
-         MinExtent = "8 2";
-         canSave = "1";
-         Visible = "1";
-         hovertime = "1000";
-         bitmap = "tools/materialEditor/gui/unknownImage";
-         wrap = "0";
-      };
-      new GuiTextCtrl(matEd_cubeMapEd_yPosTxt) {
-         position = "237 175";
-         Extent = "57 10";
-         text = "+ Y  Front";
-      };
-      new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateYPOSImg) {
-         canSaveDynamicFields = "0";
-         Enabled = "1";
-         isContainer = "0";
-         Profile = "ToolsGuiDefaultProfile";
-         HorizSizing = "right";
-         VertSizing = "bottom";
-         position = "233 172";
-         Extent = "64 64";
-         MinExtent = "8 2";
-         canSave = "1";
-         Visible = "1";
-         Command = "MaterialEditorGui.editCubemapImage(\"3\", $ThisControl.bitmap );";
-         tooltipprofile = "ToolsGuiDefaultProfile";
-         ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
-         hovertime = "1000";
-         groupNum = "-1";
-         buttonType = "PushButton";
-         useMouseEvents = "0";
-         bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
-      };
-      // ------------------------------ Y Negitive ------------------------------------
-      new GuiBitmapCtrl(matEd_cubemapEd_YNeG) {
-         canSaveDynamicFields = "0";
-         Enabled = "1";
-         isContainer = "0";
-         Profile = "ToolsGuiDefaultProfile";
-         HorizSizing = "right";
-         VertSizing = "bottom";
-         position = "233 40";
-         Extent = "64 64";
-         MinExtent = "8 2";
-         canSave = "1";
-         Visible = "1";
-         hovertime = "1000";
-         bitmap = "tools/materialEditor/gui/unknownImage";
-         wrap = "0";
-      };
-      new GuiTextCtrl(matEd_cubeMapEd_yNegTxt) {
-         position = "237 44";
-         Extent = "57 10";
-         text = "- Y  Back";
-      };
-      new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateYNegImg) {
-         canSaveDynamicFields = "0";
-         Enabled = "1";
-         isContainer = "0";
-         Profile = "ToolsGuiDefaultProfile";
-         HorizSizing = "right";
-         VertSizing = "bottom";
-         position = "233 40";
-         Extent = "64 64";
-         MinExtent = "8 2";
-         canSave = "1";
-         Visible = "1";
-         Command = "MaterialEditorGui.editCubemapImage(\"2\", $ThisControl.bitmap );";
-         tooltipprofile = "ToolsGuiDefaultProfile";
-         ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
-         hovertime = "1000";
-         groupNum = "-1";
-         buttonType = "PushButton";
-         useMouseEvents = "0";
-         bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
-      };
-      // ------------------------------ Z Positive ------------------------------------
-      new GuiBitmapCtrl(matEd_cubemapEd_ZPos) {
-         canSaveDynamicFields = "0";
-         Enabled = "1";
-         isContainer = "0";
-         Profile = "ToolsGuiDefaultProfile";
-         HorizSizing = "right";
-         VertSizing = "bottom";
-         position = "233 106";
-         Extent = "64 64";
-         MinExtent = "8 2";
-         canSave = "1";
-         Visible = "1";
-         hovertime = "1000";
-         bitmap = "tools/materialEditor/gui/unknownImage";
-         wrap = "0";
-      };
-      new GuiTextCtrl(matEd_cubeMapEd_zPosTxt) {
-         position = "237 110";
-         Extent = "57 10";
-         text = "+ Z  Top";
-      };
-      new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateZPosImg) {
-         canSaveDynamicFields = "0";
-         Enabled = "1";
-         isContainer = "0";
-         Profile = "ToolsGuiDefaultProfile";
-         HorizSizing = "right";
-         VertSizing = "bottom";
-         position = "233 106";
-         Extent = "64 64";
-         MinExtent = "8 2";
-         canSave = "1";
-         Visible = "1";
-         Command = "MaterialEditorGui.editCubemapImage(\"4\", $ThisControl.bitmap );";
-         tooltipprofile = "ToolsGuiDefaultProfile";
-         ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
-         hovertime = "1000";
-         groupNum = "-1";
-         buttonType = "PushButton";
-         useMouseEvents = "0";
-         bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
-      };
-      // ------------------------------ Z Negitive ------------------------------------
-      new GuiBitmapCtrl(matEd_cubemapEd_ZNeg) {
-         canSaveDynamicFields = "0";
-         Enabled = "1";
-         isContainer = "0";
-         Profile = "ToolsGuiDefaultProfile";
-         HorizSizing = "right";
-         VertSizing = "bottom";
-         position = "365 106";
-         Extent = "64 64";
-         MinExtent = "8 2";
-         canSave = "1";
-         Visible = "1";
-         hovertime = "1000";
-         bitmap = "tools/materialEditor/gui/unknownImage";
-         wrap = "0";
-      };
-      new GuiTextCtrl(matEd_cubeMapEd_zNegTxt) {
-         position = "369 110";
-         Extent = "57 10";
-         text = "- Z  Bottom";
-      };
-      new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateZNegImg) {
-         canSaveDynamicFields = "0";
-         Enabled = "1";
-         isContainer = "0";
-         Profile = "ToolsGuiDefaultProfile";
-         HorizSizing = "right";
-         VertSizing = "bottom";
-         position = "365 106";
-         Extent = "64 64";
-         MinExtent = "8 2";
-         canSave = "1";
-         Visible = "1";
-         Command = "MaterialEditorGui.editCubemapImage(\"5\", $ThisControl.bitmap );";
-         tooltipprofile = "ToolsGuiDefaultProfile";
-         ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
-         hovertime = "1000";
-         groupNum = "-1";
-         buttonType = "PushButton";
-         useMouseEvents = "0";
-         bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
-      };
-
-       // Create New Cubemap
-      new GuiBitmapButtonCtrl() {
-         canSaveDynamicFields = "0";
-         Enabled = "1";
-         isContainer = "0";
-         Profile = "ToolsGuiDefaultProfile";
-         HorizSizing = "right";
-         VertSizing = "top";
-         position = "128 23";
-         Extent = "17 17";
-         MinExtent = "8 2";
-         canSave = "1";
-         Visible = "1";
-         Command = "matEd_addCubemapWindow.setVisible(1);"; // -------------- Needs Hookup Create New Cubemap
-         hovertime = "1000";
-         tooltip = "Create New Cubemap";
-         bitmap = "tools/gui/images/new";
-         groupNum = "-1";
-         buttonType = "PushButton";
-         useMouseEvents = "0";
-      };
-      new GuiBitmapButtonCtrl() {
-         canSaveDynamicFields = "0";
-         Enabled = "1";
-         isContainer = "0";
-         Profile = "ToolsGuiDefaultProfile";
-         HorizSizing = "right";
-         VertSizing = "top";
-         position = "143 23";
-         Extent = "17 17";
-         MinExtent = "8 2";
-         canSave = "1";
-         Visible = "1";
-         Command = "MaterialEditorGui.showDeleteCubemapDialog();"; // -------------- Needs Hookup Delete Cubemap
-         hovertime = "1000";
-         tooltip = "Delete Cubemap";
-         bitmap = "tools/gui/images/delete";
-         groupNum = "-1";
-         buttonType = "PushButton";
-         useMouseEvents = "0";
-      };
-      new GuiBitmapButtonCtrl() {
-         internalName = "saveCubemap";
-         canSaveDynamicFields = "0";
-         Enabled = "1";
-         isContainer = "0";
-         Profile = "ToolsGuiDefaultProfile";
-         HorizSizing = "right";
-         VertSizing = "top";
-         position = "106 23";
-         Extent = "17 17";
-         MinExtent = "8 2";
-         canSave = "1";
-         Visible = "1";
-         Command = "MaterialEditorGui.showSaveCubemapDialog();"; // -------------- Needs Hookup Save Cubemap
-         hovertime = "1000";
-         tooltip = "Save Cubemap";
-         bitmap = "tools/gui/images/save-icon";
-         groupNum = "-1";
-         buttonType = "PushButton";
-         useMouseEvents = "0";
-      };
-   };
 
    new GuiWindowCtrl(matEd_addCubemapWindow) {
       canSaveDynamicFields = "0";

+ 132 - 132
Templates/BaseGame/game/tools/settings.xml

@@ -1,186 +1,186 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <EditorSettings>
-    <Group name="LevelInformation">
-        <Setting name="levelsDirectory">data/FPSGameplay/levels</Setting>
-        <Group name="levels">
-            <Group name="PbrMatTest.mis">
-                <Setting name="cameraSpeed">5</Setting>
-            </Group>
-            <Group name="BlankRoom.mis">
-                <Setting name="cameraSpeed">25</Setting>
-            </Group>
+    <Group name="NavEditor">
+        <Setting name="SpawnClass">AIPlayer</Setting>
+    </Group>
+    <Group name="Theme">
+        <Setting name="tooltipDividerColor">72 70 68 255</Setting>
+        <Setting name="fieldTextHLColor">234 232 230 255</Setting>
+        <Setting name="tabsSELColor">59 58 57 255</Setting>
+        <Setting name="tooltipTextColor">255 255 255 255</Setting>
+        <Setting name="fieldBGHLColor">72 70 68 255</Setting>
+        <Setting name="fieldTextSELColor">240 240 240 255</Setting>
+        <Setting name="fieldTextColor">178 175 172 255</Setting>
+        <Setting name="headerTextColor">236 234 232 255</Setting>
+        <Setting name="fieldBGColor">59 58 57 255</Setting>
+        <Setting name="headerColor">50 49 48 255</Setting>
+        <Setting name="tabsHLColor">50 49 48 255</Setting>
+        <Setting name="dividerMidColor">50 49 48 255</Setting>
+        <Setting name="tabsColor">37 36 35 255</Setting>
+        <Setting name="windowBackgroundColor">32 31 30 255</Setting>
+        <Setting name="dividerDarkColor">17 16 15 255</Setting>
+        <Setting name="tooltipBGColor">43 43 43 255</Setting>
+        <Setting name="dividerLightColor">96 94 92 255</Setting>
+        <Setting name="fieldBGSELColor">100 98 96 255</Setting>
+    </Group>
+    <Group name="TerrainEditor">
+        <Setting name="currentAction">lowerHeight</Setting>
+        <Group name="ActionValues">
+            <Setting name="softSelectFilter">1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000</Setting>
+            <Setting name="smoothFactor">0.1</Setting>
+            <Setting name="SlopeMinAngle">0</Setting>
+            <Setting name="softSelectDefaultFilter">1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000</Setting>
+            <Setting name="SlopeMaxAngle">90</Setting>
+            <Setting name="scaleVal">1</Setting>
+            <Setting name="setHeightVal">100</Setting>
+            <Setting name="adjustHeightVal">10</Setting>
+            <Setting name="softSelectRadius">50</Setting>
+            <Setting name="noiseFactor">1</Setting>
+        </Group>
+        <Group name="Brush">
+            <Setting name="brushType">ellipse</Setting>
+            <Setting name="maxBrushSize">40 40</Setting>
+            <Setting name="brushPressure">1</Setting>
+            <Setting name="brushSize">40 40</Setting>
+            <Setting name="brushSoftness">1</Setting>
         </Group>
     </Group>
     <Group name="WorldEditor">
         <Setting name="orthoFOV">50</Setting>
-        <Setting name="dropType">screenCenter</Setting>
-        <Setting name="torsionPath">AssetWork_Debug.exe</Setting>
-        <Setting name="forceLoadDAE">0</Setting>
-        <Setting name="orthoShowGrid">1</Setting>
         <Setting name="undoLimit">40</Setting>
-        <Setting name="displayType">6</Setting>
         <Setting name="currentEditor">WorldEditorInspectorPlugin</Setting>
-        <Group name="ObjectIcons">
-            <Setting name="fadeIconsEndAlpha">0</Setting>
-            <Setting name="fadeIcons">1</Setting>
-            <Setting name="fadeIconsStartDist">8</Setting>
-            <Setting name="fadeIconsEndDist">20</Setting>
-            <Setting name="fadeIconsStartAlpha">255</Setting>
-        </Group>
+        <Setting name="displayType">6</Setting>
+        <Setting name="orthoShowGrid">1</Setting>
+        <Setting name="forceLoadDAE">0</Setting>
+        <Setting name="torsionPath">AssetWork_Debug.exe</Setting>
+        <Setting name="dropType">screenCenter</Setting>
         <Group name="Tools">
-            <Setting name="snapGround">0</Setting>
             <Setting name="snapSoftSize">2</Setting>
+            <Setting name="dropAtScreenCenterScalar">1</Setting>
+            <Setting name="snapGround">0</Setting>
             <Setting name="dropAtScreenCenterMax">100</Setting>
-            <Setting name="objectsUseBoxCenter">1</Setting>
-            <Setting name="boundingBoxCollision">0</Setting>
             <Setting name="snapSoft">0</Setting>
-            <Setting name="dropAtScreenCenterScalar">1</Setting>
-        </Group>
-        <Group name="Docs">
-            <Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
-            <Setting name="forumURL">http://www.garagegames.com/products/torque-3d/forums</Setting>
-            <Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
-            <Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
+            <Setting name="boundingBoxCollision">0</Setting>
+            <Setting name="objectsUseBoxCenter">1</Setting>
         </Group>
         <Group name="Color">
-            <Setting name="selectionBoxColor">255 255 0 255</Setting>
             <Setting name="objMouseOverColor">0 255 0 255</Setting>
+            <Setting name="popupBackgroundColor">100 100 100 255</Setting>
+            <Setting name="objMouseOverSelectColor">0 0 255 255</Setting>
+            <Setting name="selectionBoxColor">255 255 0 255</Setting>
             <Setting name="objSelectColor">255 0 0 255</Setting>
-            <Setting name="objectTextColor">255 255 255 255</Setting>
             <Setting name="dragRectColor">255 255 0 255</Setting>
-            <Setting name="objMouseOverSelectColor">0 0 255 255</Setting>
-            <Setting name="popupBackgroundColor">100 100 100 255</Setting>
+            <Setting name="objectTextColor">255 255 255 255</Setting>
         </Group>
-        <Group name="Images">
-            <Setting name="lockedHandle">tools/worldEditor/images/LockedHandle</Setting>
-            <Setting name="selectHandle">tools/worldEditor/images/SelectHandle</Setting>
-            <Setting name="defaultHandle">tools/worldEditor/images/DefaultHandle</Setting>
+        <Group name="Docs">
+            <Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
+            <Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
+            <Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
+            <Setting name="forumURL">http://www.garagegames.com/products/torque-3d/forums</Setting>
         </Group>
-        <Group name="Grid">
-            <Setting name="gridColor">102 102 102 100</Setting>
-            <Setting name="gridSnap">0</Setting>
-            <Setting name="gridSize">1</Setting>
-            <Setting name="gridMinorColor">51 51 51 100</Setting>
-            <Setting name="gridOriginColor">255 255 255 100</Setting>
+        <Group name="ObjectIcons">
+            <Setting name="fadeIcons">1</Setting>
+            <Setting name="fadeIconsEndAlpha">0</Setting>
+            <Setting name="fadeIconsStartAlpha">255</Setting>
+            <Setting name="fadeIconsEndDist">20</Setting>
+            <Setting name="fadeIconsStartDist">8</Setting>
         </Group>
         <Group name="Render">
-            <Setting name="renderObjText">1</Setting>
-            <Setting name="renderObjHandle">1</Setting>
             <Setting name="showMousePopupInfo">1</Setting>
             <Setting name="renderSelectionBox">1</Setting>
+            <Setting name="renderObjText">1</Setting>
             <Setting name="renderPopupBackground">1</Setting>
+            <Setting name="renderObjHandle">1</Setting>
+        </Group>
+        <Group name="Grid">
+            <Setting name="gridColor">102 102 102 100</Setting>
+            <Setting name="gridMinorColor">51 51 51 100</Setting>
+            <Setting name="gridSnap">0</Setting>
+            <Setting name="gridOriginColor">255 255 255 100</Setting>
+            <Setting name="gridSize">1</Setting>
         </Group>
         <Group name="Theme">
             <Setting name="windowTitleBGNAColor">180 180 180 255</Setting>
-            <Setting name="windowTitleBGHLColor">48 48 48 255</Setting>
             <Setting name="windowTitleFontHLColor">255 255 255 255</Setting>
-            <Setting name="windowTitleFontColor">215 215 215 255</Setting>
             <Setting name="windowTitleBGColor">50 50 50 255</Setting>
+            <Setting name="windowTitleBGHLColor">48 48 48 255</Setting>
+            <Setting name="windowTitleFontColor">215 215 215 255</Setting>
         </Group>
-    </Group>
-    <Group name="GuiEditor">
-        <Setting name="previewResolution">1024 768</Setting>
-        <Setting name="lastPath">tools/gui</Setting>
-        <Group name="Snapping">
-            <Setting name="sensitivity">2</Setting>
-            <Setting name="snap2GridSize">8</Setting>
-            <Setting name="snap2Grid">0</Setting>
-            <Setting name="snapToControls">1</Setting>
-            <Setting name="snapToGuides">1</Setting>
-            <Setting name="snapToEdges">1</Setting>
-            <Setting name="snapToCenters">1</Setting>
-            <Setting name="snapToCanvas">1</Setting>
-        </Group>
-        <Group name="Library">
-            <Setting name="viewType">Categorized</Setting>
-        </Group>
-        <Group name="Help">
-            <Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
-            <Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
-            <Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
-        </Group>
-        <Group name="Rendering">
-            <Setting name="drawBorderLines">1</Setting>
-            <Setting name="drawGuides">1</Setting>
-        </Group>
-        <Group name="EngineDevelopment">
-            <Setting name="showEditorGuis">0</Setting>
-            <Setting name="toggleIntoEditor">0</Setting>
-            <Setting name="showEditorProfiles">0</Setting>
-        </Group>
-        <Group name="Selection">
-            <Setting name="fullBox">0</Setting>
+        <Group name="Images">
+            <Setting name="lockedHandle">tools/worldEditor/images/LockedHandle</Setting>
+            <Setting name="defaultHandle">tools/worldEditor/images/DefaultHandle</Setting>
+            <Setting name="selectHandle">tools/worldEditor/images/SelectHandle</Setting>
         </Group>
     </Group>
-    <Group name="Theme">
-        <Setting name="windowBackgroundColor">32 31 30 255</Setting>
-        <Setting name="tabsSELColor">59 58 57 255</Setting>
-        <Setting name="tabsHLColor">50 49 48 255</Setting>
-        <Setting name="dividerDarkColor">17 16 15 255</Setting>
-        <Setting name="fieldTextSELColor">240 240 240 255</Setting>
-        <Setting name="fieldBGColor">59 58 57 255</Setting>
-        <Setting name="dividerMidColor">50 49 48 255</Setting>
-        <Setting name="fieldTextColor">178 175 172 255</Setting>
-        <Setting name="tooltipBGColor">43 43 43 255</Setting>
-        <Setting name="tabsColor">37 36 35 255</Setting>
-        <Setting name="fieldBGSELColor">100 98 96 255</Setting>
-        <Setting name="headerColor">50 49 48 255</Setting>
-        <Setting name="tooltipTextColor">255 255 255 255</Setting>
-        <Setting name="tooltipDividerColor">72 70 68 255</Setting>
-        <Setting name="fieldTextHLColor">234 232 230 255</Setting>
-        <Setting name="fieldBGHLColor">72 70 68 255</Setting>
-        <Setting name="headerTextColor">236 234 232 255</Setting>
-        <Setting name="dividerLightColor">96 94 92 255</Setting>
-    </Group>
-    <Group name="TerrainEditor">
-        <Setting name="currentAction">lowerHeight</Setting>
-        <Group name="ActionValues">
-            <Setting name="noiseFactor">1</Setting>
-            <Setting name="scaleVal">1</Setting>
-            <Setting name="softSelectFilter">1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000</Setting>
-            <Setting name="SlopeMaxAngle">90</Setting>
-            <Setting name="adjustHeightVal">10</Setting>
-            <Setting name="softSelectDefaultFilter">1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000</Setting>
-            <Setting name="smoothFactor">0.1</Setting>
-            <Setting name="softSelectRadius">50</Setting>
-            <Setting name="setHeightVal">100</Setting>
-            <Setting name="SlopeMinAngle">0</Setting>
-        </Group>
-        <Group name="Brush">
-            <Setting name="brushSize">40 40</Setting>
-            <Setting name="brushSoftness">1</Setting>
-            <Setting name="maxBrushSize">40 40</Setting>
-            <Setting name="brushPressure">1</Setting>
-            <Setting name="brushType">ellipse</Setting>
+    <Group name="LevelInformation">
+        <Setting name="levelsDirectory">data/FPSGameplay/levels</Setting>
+        <Group name="levels">
+            <Group name="PbrMatTest.mis">
+                <Setting name="cameraSpeed">5</Setting>
+            </Group>
+            <Group name="BlankRoom.mis">
+                <Setting name="cameraSpeed">25</Setting>
+            </Group>
         </Group>
     </Group>
     <Group name="AxisGizmo">
+        <Setting name="rotationSnap">15</Setting>
         <Setting name="renderWhenUsed">0</Setting>
         <Setting name="mouseRotateScalar">0.8</Setting>
         <Setting name="axisGizmoMaxScreenLen">100</Setting>
         <Setting name="mouseScaleScalar">0.8</Setting>
         <Setting name="snapRotations">0</Setting>
         <Setting name="renderInfoText">1</Setting>
-        <Setting name="rotationSnap">15</Setting>
         <Group name="Grid">
-            <Setting name="snapToGrid">0</Setting>
-            <Setting name="gridSize">10 10 10</Setting>
             <Setting name="planeDim">500</Setting>
-            <Setting name="renderPlane">0</Setting>
-            <Setting name="gridColor">255 255 255 20</Setting>
             <Setting name="renderPlaneHashes">0</Setting>
+            <Setting name="gridSize">10 10 10</Setting>
+            <Setting name="snapToGrid">0</Setting>
+            <Setting name="gridColor">255 255 255 20</Setting>
+            <Setting name="renderPlane">0</Setting>
         </Group>
     </Group>
     <Group name="RiverEditor">
+        <Setting name="SelectedSplineColor">0 255 0 255</Setting>
+        <Setting name="HoverNodeColor">255 255 255 255</Setting>
         <Setting name="HoverSplineColor">255 0 0 255</Setting>
         <Setting name="DefaultDepth">5</Setting>
-        <Setting name="DefaultWidth">10</Setting>
-        <Setting name="HoverNodeColor">255 255 255 255</Setting>
-        <Setting name="SelectedSplineColor">0 255 0 255</Setting>
         <Setting name="DefaultNormal">0 0 1</Setting>
+        <Setting name="DefaultWidth">10</Setting>
     </Group>
-    <Group name="NavEditor">
-        <Setting name="SpawnClass">AIPlayer</Setting>
+    <Group name="GuiEditor">
+        <Setting name="lastPath">tools/gui</Setting>
+        <Setting name="previewResolution">1024 768</Setting>
+        <Group name="EngineDevelopment">
+            <Setting name="showEditorGuis">0</Setting>
+            <Setting name="showEditorProfiles">0</Setting>
+            <Setting name="toggleIntoEditor">0</Setting>
+        </Group>
+        <Group name="Rendering">
+            <Setting name="drawGuides">1</Setting>
+            <Setting name="drawBorderLines">1</Setting>
+        </Group>
+        <Group name="Snapping">
+            <Setting name="snapToCenters">1</Setting>
+            <Setting name="snap2Grid">0</Setting>
+            <Setting name="snapToCanvas">1</Setting>
+            <Setting name="snapToGuides">1</Setting>
+            <Setting name="sensitivity">2</Setting>
+            <Setting name="snapToEdges">1</Setting>
+            <Setting name="snapToControls">1</Setting>
+            <Setting name="snap2GridSize">8</Setting>
+        </Group>
+        <Group name="Help">
+            <Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
+            <Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
+            <Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
+        </Group>
+        <Group name="Library">
+            <Setting name="viewType">Categorized</Setting>
+        </Group>
+        <Group name="Selection">
+            <Setting name="fullBox">0</Setting>
+        </Group>
     </Group>
     <Group name="ConvexEditor">
         <Setting name="materialName">Grid_512_Orange</Setting>

+ 2 - 0
Templates/BaseGame/game/tools/worldEditor/main.cs

@@ -46,6 +46,8 @@ function initializeWorldEditor()
    exec("./gui/shadowViz.gui" );
    exec("./gui/probeBakeDlg.gui" );
    
+   exec("tools/gui/cubemapEditor.gui" );
+   
    // Load Scripts.
    exec("./scripts/menus.ed.cs");
    exec("./scripts/menuHandlers.ed.cs");