Forráskód Böngészése

Merge branch 'Preview4_0_w_translucencyWIP' of https://github.com/Areloch/Torque3D into Preview4_0_w_translucencyWIP

AzaezelX 6 éve
szülő
commit
b3d376d085
50 módosított fájl, 1462 hozzáadás és 428 törlés
  1. 12 1
      Engine/source/T3D/Scene.cpp
  2. 3 1
      Engine/source/T3D/Scene.h
  3. 24 5
      Engine/source/gfx/D3D11/gfxD3D11Cubemap.cpp
  4. 3 2
      Engine/source/gfx/gfxTextureManager.h
  5. 0 1
      Templates/BaseGame/game/core/Core.cs
  6. 2 0
      Templates/BaseGame/game/core/clientServer/scripts/client/client.cs
  7. 6 2
      Templates/BaseGame/game/core/clientServer/scripts/client/connectionToServer.cs
  8. 2 0
      Templates/BaseGame/game/core/clientServer/scripts/client/levelLoad.cs
  9. 29 1
      Templates/BaseGame/game/core/clientServer/scripts/server/connectionToClient.cs
  10. 3 0
      Templates/BaseGame/game/core/clientServer/scripts/server/defaults.cs
  11. 30 4
      Templates/BaseGame/game/core/clientServer/scripts/server/levelDownload.cs
  12. 89 5
      Templates/BaseGame/game/core/clientServer/scripts/server/levelLoad.cs
  13. 39 3
      Templates/BaseGame/game/core/clientServer/scripts/server/server.cs
  14. BIN
      Templates/BaseGame/game/core/gui/scripts/fonts/ArialItalic 14 (ansi).uft
  15. BIN
      Templates/BaseGame/game/core/gui/scripts/fonts/Lucida Console 12 (ansi).uft
  16. 46 0
      Templates/BaseGame/game/core/postFX/scripts/afxHighlight.cs
  17. 9 1
      Templates/BaseGame/game/core/rendering/scripts/renderManager.cs
  18. 58 0
      Templates/BaseGame/game/core/rendering/shaders/AFX/afxPostFX_Highlight_ALT_P.hlsl
  19. 27 0
      Templates/BaseGame/game/core/rendering/shaders/AFX/afxPostFX_Highlight_P.hlsl
  20. 28 0
      Templates/BaseGame/game/core/rendering/shaders/AFX/afxZodiac_Interior_P.hlsl
  21. 40 0
      Templates/BaseGame/game/core/rendering/shaders/AFX/afxZodiac_Interior_V.hlsl
  22. 28 0
      Templates/BaseGame/game/core/rendering/shaders/AFX/afxZodiac_Polysoup_P.hlsl
  23. 40 0
      Templates/BaseGame/game/core/rendering/shaders/AFX/afxZodiac_Polysoup_V.hlsl
  24. 28 0
      Templates/BaseGame/game/core/rendering/shaders/AFX/afxZodiac_Terrain_P.hlsl
  25. 40 0
      Templates/BaseGame/game/core/rendering/shaders/AFX/afxZodiac_Terrain_V.hlsl
  26. 24 0
      Templates/BaseGame/game/core/rendering/shaders/AFX/gl/afxZodiac_Interior_P.glsl
  27. 24 0
      Templates/BaseGame/game/core/rendering/shaders/AFX/gl/afxZodiac_Interior_V.glsl
  28. 25 0
      Templates/BaseGame/game/core/rendering/shaders/AFX/gl/afxZodiac_Polysoup_P.glsl
  29. 30 0
      Templates/BaseGame/game/core/rendering/shaders/AFX/gl/afxZodiac_Polysoup_V.glsl
  30. 25 0
      Templates/BaseGame/game/core/rendering/shaders/AFX/gl/afxZodiac_Terrain_P.glsl
  31. 30 0
      Templates/BaseGame/game/core/rendering/shaders/AFX/gl/afxZodiac_Terrain_V.glsl
  32. 0 5
      Templates/BaseGame/game/core/settings.xml
  33. 1 0
      Templates/BaseGame/game/core/utility/Core_Utility.cs
  34. 20 0
      Templates/BaseGame/game/core/utility/scripts/module.cs
  35. 0 0
      Templates/BaseGame/game/core/utility/scripts/scene.cs
  36. 14 0
      Templates/BaseGame/game/core/utility/scripts/signalManager.cs
  37. 10 0
      Templates/BaseGame/game/data/ImportTesting/ImportTesting.cs
  38. 25 0
      Templates/BaseGame/game/data/ImportTesting/ImportTesting.module
  39. 1 0
      Templates/BaseGame/game/data/ui/UI.cs
  40. 55 34
      Templates/BaseGame/game/tools/assetBrowser/assetImportConfigs.xml
  41. 104 2
      Templates/BaseGame/game/tools/assetBrowser/guis/assetImport.gui
  42. 25 0
      Templates/BaseGame/game/tools/assetBrowser/scripts/addModuleWindow.cs
  43. 29 93
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs
  44. 276 147
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetImportConfig.cs
  45. 5 5
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.cs
  46. 10 10
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs
  47. 1 1
      Templates/BaseGame/game/tools/assetBrowser/scripts/fieldTypes.cs
  48. 37 0
      Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/module.cs.template
  49. 7 7
      Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorTreeView.ed.cs
  50. 98 98
      Templates/BaseGame/game/tools/settings.xml

+ 12 - 1
Engine/source/T3D/Scene.cpp

@@ -12,7 +12,7 @@ Scene::Scene() :
    mIsEditing(false),
    mIsDirty(false)
 {
-
+   mGameModeName = StringTable->EmptyString();
 }
 
 Scene::~Scene()
@@ -29,6 +29,10 @@ void Scene::initPersistFields()
    addField("isEditing", TypeBool, Offset(mIsEditing, Scene), "", AbstractClassRep::FIELD_HideInInspectors);
    addField("isDirty", TypeBool, Offset(mIsDirty, Scene), "", AbstractClassRep::FIELD_HideInInspectors);
    endGroup("Internal");
+
+   addGroup("Gameplay");
+   addField("gameModeName", TypeString, Offset(mGameModeName, Scene), "The name of the gamemode that this scene utilizes");
+   endGroup("Gameplay");
 }
 
 bool Scene::onAdd()
@@ -186,6 +190,13 @@ DefineEngineFunction(getScene, Scene*, (U32 sceneId), (0),
    return Scene::smSceneList[sceneId];
 }
 
+DefineEngineFunction(getSceneCount, S32, (),,
+   "Get the number of active Scene objects that are loaded.\n"
+   "@return The number of active scenes")
+{
+   return Scene::smSceneList.size();
+}
+
 DefineEngineFunction(getRootScene, S32, (), ,
    "Get the root Scene object that is loaded.\n"
    "@return The id of the Root Scene. Will be 0 if no root scene is loaded")

+ 3 - 1
Engine/source/T3D/Scene.h

@@ -35,6 +35,8 @@ class Scene : public NetObject, public virtual ITickable
 
    bool mIsDirty;
 
+   StringTableEntry mGameModeName;
+
 protected:
    static Scene * smRootScene;
 
@@ -76,4 +78,4 @@ public:
    }
 
    static Vector<Scene*> smSceneList;
-};
+};

+ 24 - 5
Engine/source/gfx/D3D11/gfxD3D11Cubemap.cpp

@@ -223,7 +223,6 @@ void GFXD3D11Cubemap::initDynamic(U32 texSize, GFXFormat faceFormat, U32 mipLeve
 
     mMipMapLevels = mipLevels;
 
-
    bool compressed = ImageUtil::isCompressedFormat(mFaceFormat);
 
    UINT bindFlags = D3D11_BIND_SHADER_RESOURCE;
@@ -397,10 +396,19 @@ void GFXD3D11CubemapArray::init(GFXCubemapHandle *cubemaps, const U32 cubemapCou
    AssertFatal(cubemaps, "GFXD3D11CubemapArray::initStatic - Got null GFXCubemapHandle!");
    AssertFatal(*cubemaps, "GFXD3D11CubemapArray::initStatic - Got empty cubemap!");
 
+   U32 downscalePower = GFXTextureManager::smTextureReductionLevel;
+   U32 scaledSize = cubemaps[0]->getSize();
+
+   if (downscalePower != 0)
+   {
+      // Otherwise apply the appropriate scale...
+      scaledSize >>= downscalePower;
+   }
+
    //all cubemaps must be the same size,format and number of mipmaps. Grab the details from the first cubemap
-   mSize = cubemaps[0]->getSize();
+   mSize = scaledSize;
    mFormat = cubemaps[0]->getFormat();
-   mMipMapLevels = cubemaps[0]->getMipMapLevels();
+   mMipMapLevels = cubemaps[0]->getMipMapLevels() - downscalePower;
    mNumCubemaps = cubemapCount;
 
    //create texture object
@@ -467,8 +475,16 @@ void GFXD3D11CubemapArray::init(GFXCubemapHandle *cubemaps, const U32 cubemapCou
 //Just allocate the cubemap array but we don't upload any data
 void GFXD3D11CubemapArray::init(const U32 cubemapCount, const U32 cubemapFaceSize, const GFXFormat format)
 {
-   mSize = cubemapFaceSize;
-   mMipMapLevels = ImageUtil::getMaxMipCount(cubemapFaceSize, cubemapFaceSize);
+   U32 downscalePower = GFXTextureManager::smTextureReductionLevel;
+   U32 scaledSize = cubemapFaceSize;
+
+   if (downscalePower != 0)
+   {
+      scaledSize >>= downscalePower;
+   }
+
+   mSize = scaledSize;
+   mMipMapLevels = ImageUtil::getMaxMipCount(cubemapFaceSize, cubemapFaceSize) - downscalePower;
    mNumCubemaps = cubemapCount;
    mFormat = format;
 
@@ -512,6 +528,9 @@ void GFXD3D11CubemapArray::init(const U32 cubemapCount, const U32 cubemapFaceSiz
 
 void GFXD3D11CubemapArray::updateTexture(const GFXCubemapHandle &cubemap, const U32 slot)
 {
+   U32 cubeMapSz = cubemap->getSize();
+   U32 cubeMapSize = cubemap->getMipMapLevels();
+
    AssertFatal(slot <= mNumCubemaps, "GFXD3D11CubemapArray::updateTexture - trying to update a cubemap texture that is out of bounds!");
    AssertFatal(mFormat == cubemap->getFormat(), "GFXD3D11CubemapArray::updateTexture - Destination format doesn't match");
    AssertFatal(mSize == cubemap->getSize(), "GFXD3D11CubemapArray::updateTexture - Destination size doesn't match");

+ 3 - 2
Engine/source/gfx/gfxTextureManager.h

@@ -194,8 +194,7 @@ public:
    /// Used to remove a cubemap from the cache.
    void releaseCubemap( GFXCubemap *cubemap );
 
-protected:
-
+public:
    /// The amount of texture mipmaps to skip when loading a
    /// texture that allows downscaling.
    ///
@@ -205,6 +204,8 @@ protected:
    /// 
    static S32 smTextureReductionLevel;
 
+protected:
+
    /// File path to the missing texture
    static String smMissingTexturePath;
 

+ 0 - 1
Templates/BaseGame/game/core/Core.cs

@@ -25,7 +25,6 @@ function CoreModule::onCreate(%this)
    ModuleDatabase.LoadExplicit( "Core_PostFX" );
    ModuleDatabase.LoadExplicit( "Core_Components" );
    ModuleDatabase.LoadExplicit( "Core_GameObjects" );
-   ModuleDatabase.LoadExplicit( "Core_ClientServer" );
    
    new Settings(ProjectSettings) { file = "core/settings.xml"; };
    ProjectSettings.read();

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

@@ -20,6 +20,8 @@ function initClient()
       exec( %prefPath @ "/clientPrefs.cs" );
    else
       exec( "data/defaults.cs" );
+      
+   callOnModules("initClient");
 
    loadMaterials();
 

+ 6 - 2
Templates/BaseGame/game/core/clientServer/scripts/client/connectionToServer.cs

@@ -30,7 +30,9 @@ function GameConnection::onConnectionAccepted(%this)
 {
    // Startup the physX world on the client before any
    // datablocks and objects are ghosted over.
-   physicsInitWorld( "client" );   
+   physicsInitWorld( "client" ); 
+   
+   callOnModules("onCreateClient", "Game");
 }
 
 function GameConnection::initialControlSet(%this)
@@ -126,5 +128,7 @@ function disconnectedCleanup()
    }
    
    // We can now delete the client physics simulation.
-   physicsDestroyWorld( "client" );                 
+   physicsDestroyWorld( "client" );    
+   
+   callOnModules("onDestroyClient", "Game");
 }

+ 2 - 0
Templates/BaseGame/game/core/clientServer/scripts/client/levelLoad.cs

@@ -86,6 +86,8 @@ function clientCmdMissionEnd( %seq )
 {
    if( $Client::missionRunning && $Client::missionSeq == %seq )
    {
+      afxEndMissionNotify();
+      
       clientEndMission();
       $Client::missionSeq = -1;
    }

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

@@ -150,7 +150,35 @@ function GameConnection::onDrop(%client, %reason)
    }
    
    if($missionRunning)
-      theLevelInfo.onClientLeaveGame();
+   {
+      %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, "onClientLeaveGame"))
+            {
+               eval(getScene(%i).gameModeName @ "::onClientLeaveGame(" @ %client @ ");" );
+               %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, "onClientLeaveGame"))
+            {
+               eval(%defaultModeName @ "::onClientLeaveGame(" @ %client @ ");" );
+               %hasGameMode = 1;
+            }
+         }
+      }  
+   }
    
    removeFromServerGuidList( %client.guid );
 

+ 3 - 0
Templates/BaseGame/game/core/clientServer/scripts/server/defaults.cs

@@ -46,6 +46,9 @@ $Pref::Server::ConnectionError =
 // overrides pref::net::port for dedicated servers
 $Pref::Server::Port = 28000;
 
+$Pref::Server::EnableDatablockCache = true;
+$Pref::Server::DatablockCacheFilename = "core/clientServer/scripts/server/afx/cache/afx_datablock_cache.dbc";
+
 // If the password is set, clients must provide it in order
 // to connect to the server
 $Pref::Server::Password = "";

+ 30 - 4
Templates/BaseGame/game/core/clientServer/scripts/server/levelDownload.cs

@@ -148,12 +148,38 @@ function serverCmdMissionStartPhase3Ack(%client, %seq)
       %entity.notify("onClientConnect", %client);
    }
    
-   //Have any special game-play handling here
-   if(theLevelInfo.isMethod("onClientEnterGame"))
+   %activeSceneCount = getSceneCount();
+   
+   %hasGameMode = 0;
+   for(%i=0; %i < %activeSceneCount; %i++)
    {
-      theLevelInfo.onClientEnterGame(%client);
+      if(getScene(%i).gameModeName !$= "")
+      {
+         //if the scene defines a game mode, go ahead and envoke it here
+         if(isMethod(getScene(%i).gameModeName, "onClientEnterGame"))
+         {
+            eval(getScene(%i).gameModeName @ "::onClientEnterGame(" @ %client @ ");" );
+            %hasGameMode = 1;
+         }
+      }
    }
-   else
+   
+   //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, "onClientEnterGame"))
+         {
+            eval(%defaultModeName @ "::onClientEnterGame(" @ %client @ ");" );
+            %hasGameMode = 1;
+         }
+      }
+   }
+   
+   //if that also failed, just spawn a camera
+   if(%hasGameMode == 0)
    {
       //No Game mode class for the level info, so just spawn a default camera
       // Set the control object to the default camera

+ 89 - 5
Templates/BaseGame/game/core/clientServer/scripts/server/levelLoad.cs

@@ -135,8 +135,35 @@ function loadMissionStage2()
       ClientGroup.getObject(%clientIndex).loadMission();
 
    // Go ahead and launch the game
-   if(TheLevelInfo.isMethod("onMissionStart"))
-      TheLevelInfo.onMissionStart();
+   %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, "onMissionStart"))
+         {
+            eval(getScene(%i).gameModeName @ "::onMissionStart();" );
+            %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, "onMissionStart"))
+         {
+            eval(%defaultModeName @ "::onMissionStart();" );
+            %hasGameMode = 1;
+         }
+      }
+   }
 }
 
 function endMission()
@@ -147,7 +174,35 @@ function endMission()
    echo("*** ENDING MISSION");
    
    // Inform the game code we're done.
-   TheLevelInfo.onMissionEnded();
+   %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;
+         }
+      }
+   }
 
    // Inform the clients
    for( %clientIndex = 0; %clientIndex < ClientGroup.getCount(); %clientIndex++ ) {
@@ -176,6 +231,35 @@ function resetMission()
    $instantGroup = MissionCleanup;
 
    clearServerPaths();
-   //
-   TheLevelInfo.onMissionReset();
+   
+   // Inform the game code we're resetting.
+   %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, "onMissionReset"))
+         {
+            eval(getScene(%i).gameModeName @ "::onMissionReset(" @ %client @ ");" );
+            %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, "onMissionReset"))
+         {
+            eval(%defaultModeName @ "::onMissionReset(" @ %client @ ");" );
+            %hasGameMode = 1;
+         }
+      }
+   }
 }

+ 39 - 3
Templates/BaseGame/game/core/clientServer/scripts/server/server.cs

@@ -52,6 +52,8 @@ function initServer()
 
    // Specify where the mission files are.
    $Server::MissionFileSpec = "data/levels/*.mis";
+   
+   callOnModules("initServer");
 }
 
 //-----------------------------------------------------------------------------
@@ -155,7 +157,9 @@ function createServer(%serverType, %level)
       if ($pref::Net::DisplayOnMaster !$= "Never" )
          schedule(0,0,startHeartbeat);
    }
-
+   
+   callOnModules("onCreateServer", "Game");
+   
    // Let the game initialize some things now that the
    // the server has been created
    onServerCreated();
@@ -194,6 +198,8 @@ function onServerCreated()
    
    // Keep track of when the game started
    $Game::StartTime = $Sim::Time;
+
+   onServerCreatedAFX();
 }
 
 /// Shut down the server
@@ -227,6 +233,9 @@ function destroyServer()
    // Delete all the data blocks...
    deleteDataBlocks();
    
+   //Get our modules so we can exec any specific server-side loading/handling
+   callOnModules("onDestroyServer", "Game");
+   
    // Save any server settings
    %prefPath = getPrefpath();
    echo( "Exporting server prefs..." );
@@ -249,8 +258,35 @@ function onServerDestroyed()
    echo("*** ENDING MISSION");
    
    // Inform the game code we're done.
-   if(TheLevelInfo.isMethod("onMissionEnded"))
-      TheLevelInfo.onMissionEnded();
+   %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;
+         }
+      }
+   }
 
    // Inform the clients
    for( %clientIndex = 0; %clientIndex < ClientGroup.getCount(); %clientIndex++ ) {

BIN
Templates/BaseGame/game/core/gui/scripts/fonts/ArialItalic 14 (ansi).uft


BIN
Templates/BaseGame/game/core/gui/scripts/fonts/Lucida Console 12 (ansi).uft


+ 46 - 0
Templates/BaseGame/game/core/postFX/scripts/afxHighlight.cs

@@ -0,0 +1,46 @@
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+// This Post-Effect is adapted from the resource,
+// "Silhoute selection via postFX for Torque3D" posted by Konrad Kiss.
+// http://www.garagegames.com/community/resources/view/17821
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+
+singleton ShaderData( PFX_afxHighlightShader )
+{
+   DXVertexShaderFile   = "shaders/common/postFx/postFxV.hlsl";
+   DXPixelShaderFile    = "shaders/AFX/afxPostFX_Highlight_P.hlsl";
+
+   //OGLVertexShaderFile  = "shaders/common/postFx/gl//postFxV.glsl";
+   //OGLPixelShaderFile   = "shaders/common/postFx/gl/passthruP.glsl";
+
+   samplerNames[0] = "$inputTex";
+
+   pixVersion = 2.0;
+};  
+
+singleton GFXStateBlockData( PFX_afxDefaultHighlightStateBlock )
+{  
+   zDefined = true;
+   zEnable = false;
+   zWriteEnable = false;
+
+   samplersDefined = true;
+   samplerStates[0] = SamplerClampLinear;
+};
+
+singleton PostEffect( afxHighlightPostFX )
+{
+   // Do not allow the selection effect to work in reflection 
+   // passes by default so we don't do the extra drawing.
+   allowReflectPass = false;
+                  
+   renderTime = "PFXAfterDiffuse";
+   renderBin = "HighlightBin";
+   renderPriority = 1;
+   isEnabled = true;
+
+   shader = PFX_afxHighlightShader;
+   stateBlock = PFX_afxDefaultHighlightStateBlock;
+   texture[0] = "#highlight";
+   texture[1] = "$backBuffer";
+   target = "$backBuffer";
+};

+ 9 - 1
Templates/BaseGame/game/core/rendering/scripts/renderManager.cs

@@ -50,7 +50,6 @@ function initRenderManager()
      
    DiffuseRenderPassManager.addManager( new RenderProbeMgr(ProbeBin)       { bintype = "Probes"; renderOrder = 0.019; processAddOrder = 0.019; } );
    
-   //DiffuseRenderPassManager.addManager( new RenderVistaMgr()               { bintype = "Vista"; renderOrder = 0.15; processAddOrder = 0.15; } );
    
    DiffuseRenderPassManager.addManager( new RenderObjectMgr(BeginBin)      { bintype = "Begin"; renderOrder = 0.2; processAddOrder = 0.2; } );
    // Normal mesh rendering.
@@ -90,6 +89,15 @@ function initRenderManager()
                
    // Resolve format change token last.
    DiffuseRenderPassManager.addManager( new RenderPassStateBin(FinalBin)       { renderOrder = 1.7; stateToken = AL_FormatToken; } );
+
+   if(isObject(afxZodiacTerrainRenderer))
+   {
+      DiffuseRenderPassManager.addManager( new afxZodiacTerrainRenderer() { bintype = "TerrainZodiac"; renderOrder = 1.41; processAddOrder = 1.41; } );
+      DiffuseRenderPassManager.addManager( new afxZodiacPolysoupRenderer() { bintype = "PolysoupZodiac"; renderOrder = 1.42; processAddOrder = 1.42; } );
+      DiffuseRenderPassManager.addManager( new afxZodiacGroundPlaneRenderer() { bintype = "GroundPlaneZodiac"; renderOrder = 1.43; processAddOrder = 1.43; } );
+      DiffuseRenderPassManager.addManager( new afxZodiacMeshRoadRenderer() { bintype = "MeshRoadZodiac"; renderOrder = 1.44; processAddOrder = 1.44; } );
+      DiffuseRenderPassManager.addManager( new afxRenderHighlightMgr() { renderOrder = 1.55; processAddOrder = 1.55; } );  // for selection-highlighting
+   }
 }
 
 /// This is the Default PostFX state block. Put here to prevent any missing object  

+ 58 - 0
Templates/BaseGame/game/core/rendering/shaders/AFX/afxPostFX_Highlight_ALT_P.hlsl

@@ -0,0 +1,58 @@
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+// This is the original Post-Effect Shader used in the resource,
+// "Silhoute selection via postFX for Torque3D" posted by Konrad Kiss.
+// http://www.garagegames.com/community/resources/view/17821
+// (currently not used for default AFX selection-highlighting)
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+
+#include "../common/shaderModel.hlsl"
+#include "../common/shaderModelAutoGen.hlsl"
+#include "shaders/common/postFX/postFx.hlsl"  
+  
+TORQUE_UNIFORM_SAMPLER2D(highlightBuffer,0);
+TORQUE_UNIFORM_SAMPLER2D(backBuffer,1);
+uniform float2 targetSize;
+				 
+float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
+{  
+   float2 offsets[9] = {  
+      float2( 0.0,  0.0),  
+      float2(-1.0, -1.0),  
+      float2( 0.0, -1.0),  
+      float2( 1.0, -1.0),  
+      float2( 1.0,  0.0),  
+      float2( 1.0,  1.0),  
+      float2( 0.0,  1.0),  
+      float2(-1.0,  1.0),  
+      float2(-1.0,  0.0),  
+   };
+
+   float2 PixelSize = 1.0 / targetSize;  
+
+	float avgval = 0;
+
+   for(int i = 0; i < 9; i++)  
+   {  
+      float2 uv = IN.uv0 + offsets[i] * PixelSize;  
+      float4 cpix = float4( TORQUE_TEX2D( highlightBuffer, uv ).rrr, 1.0 );
+		avgval += clamp(cpix.r*256, 0, 1);
+	}
+	
+	avgval /= 9;
+
+	float vis = round(1.0-(abs(frac(avgval)-0.5)*2));
+
+	float4 bb = TORQUE_TEX2D(backBuffer, IN.uv0);
+	float4 outlineColor = float4(vis, 0, 0, vis);
+	float4 overlayColor = float4(avgval, 0, 0, avgval);
+	//float4 outlineColor = float4(vis*0.5, vis*0.5, vis*0.5, vis*0.5);
+	//float4 overlayColor = float4(avgval, avgval, avgval, avgval);
+
+	overlayColor *= 0.4;
+
+	bb = lerp(bb, overlayColor, overlayColor.a);
+
+	outlineColor = lerp(bb, outlineColor, outlineColor.a);
+
+	return outlineColor;
+}  

+ 27 - 0
Templates/BaseGame/game/core/rendering/shaders/AFX/afxPostFX_Highlight_P.hlsl

@@ -0,0 +1,27 @@
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+// This Post-Effect Shader is adapted from the resource,
+// "Silhoute selection via postFX for Torque3D" posted by Konrad Kiss.
+// http://www.garagegames.com/community/resources/view/17821
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+
+#include "../common/shaderModel.hlsl"
+#include "../common/shaderModelAutoGen.hlsl"
+#include "shaders/common/postFX/postFx.hlsl"  
+  
+TORQUE_UNIFORM_SAMPLER2D(highlightBuffer,0);
+TORQUE_UNIFORM_SAMPLER2D(backBuffer,1);
+uniform float2 targetSize;
+
+float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
+{  
+	float4 bufferColor = TORQUE_TEX2D(backBuffer, IN.uv0);
+	float4 highlightColor = TORQUE_TEX2D(highlightBuffer, IN.uv0);
+
+   if (highlightColor.a > 0.0)
+      bufferColor.rgb = clamp(highlightColor.a*(bufferColor.rgb*1.4 + 0.05), 0, 1);
+
+   //if (highlightColor.r + highlightColor.g + highlightColor.b > 0.0)
+   //   bufferColor.rgb = clamp(bufferColor.rgb*1.4 + 0.05, 0, 1);
+
+	return bufferColor;
+}  

+ 28 - 0
Templates/BaseGame/game/core/rendering/shaders/AFX/afxZodiac_Interior_P.hlsl

@@ -0,0 +1,28 @@
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+// Arcane-FX - PIXEL SHADER
+//
+// afxZodiac_Interior_P.hlsl
+//   This is the pixel shader for rendering zodiacs on interiors.
+//   
+// Copyright (C) Faust Logic, Inc.
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+
+#include "../common/shaderModel.hlsl"
+
+struct ConnectData
+{
+   float4 hpos         : TORQUE_POSITION;
+   float2 texCoord     : TEXCOORD0;
+};
+
+TORQUE_UNIFORM_SAMPLER2D(zodiacMap,0);
+uniform float4    zodiacColor;
+
+float4 main( ConnectData IN ) : TORQUE_TARGET0
+{
+   float4 outColor = zodiacColor*TORQUE_TEX2D(zodiacMap, IN.texCoord);   
+   return outColor;
+}
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//

+ 40 - 0
Templates/BaseGame/game/core/rendering/shaders/AFX/afxZodiac_Interior_V.hlsl

@@ -0,0 +1,40 @@
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+// Arcane-FX - VERTEX SHADER
+//
+// afxZodiac_Interior_P.hlsl
+//   This is the pixel shader for rendering zodiacs on interiors.
+//   
+// Copyright (C) Faust Logic, Inc.
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+
+#include "../common/shaderModel.hlsl"
+struct VertData
+{
+   float3 position        : POSITION;
+   float4 color           : COLOR0;
+   float2 texCoord        : TEXCOORD0;
+};
+
+struct ConnectData
+{
+   float4 hpos         : TORQUE_POSITION;
+   float2 texCoord     : TEXCOORD0;
+};
+
+//-----------------------------------------------------------------------------
+// Main
+//-----------------------------------------------------------------------------
+ConnectData main( VertData IN,
+                  uniform float4x4 modelView : register(C0)
+                  )
+{
+   ConnectData OUT;
+
+   OUT.hpos = mul(modelView, float4(IN.position,1.0)); 
+   OUT.texCoord = IN.texCoord;
+    
+   return OUT;
+}
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//

+ 28 - 0
Templates/BaseGame/game/core/rendering/shaders/AFX/afxZodiac_Polysoup_P.hlsl

@@ -0,0 +1,28 @@
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+// Arcane-FX - PIXEL SHADER
+//
+// afxZodiac_Polysoup_P.hlsl
+//   This is the pixel shader for rendering zodiacs on polysoup models.
+//   
+// Copyright (C) Faust Logic, Inc.
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+
+#include "../common/shaderModel.hlsl"
+
+struct ConnectData
+{
+   float4 hpos         : TORQUE_POSITION;
+   float2 texCoord     : TEXCOORD0;
+};
+
+TORQUE_UNIFORM_SAMPLER2D(zodiacMap,0);
+uniform float4    zodiacColor;
+
+float4 main( ConnectData IN ) : TORQUE_TARGET0
+{
+   float4 outColor = zodiacColor*TORQUE_TEX2D(zodiacMap, IN.texCoord);   
+   return outColor;
+}
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//

+ 40 - 0
Templates/BaseGame/game/core/rendering/shaders/AFX/afxZodiac_Polysoup_V.hlsl

@@ -0,0 +1,40 @@
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+// Arcane-FX - VERTEX SHADER
+//
+// afxZodiac_Polysoup_P.hlsl
+//   This is the pixel shader for rendering zodiacs on polysoup models.
+//   
+// Copyright (C) Faust Logic, Inc.
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+
+#include "../common/shaderModel.hlsl"
+struct VertData
+{
+   float3 position        : POSITION;
+   float4 color           : COLOR0;
+   float2 texCoord        : TEXCOORD0;
+};
+
+struct ConnectData
+{
+   float4 hpos         : TORQUE_POSITION;
+   float2 texCoord     : TEXCOORD0;
+};
+
+//-----------------------------------------------------------------------------
+// Main
+//-----------------------------------------------------------------------------
+ConnectData main( VertData IN,
+                  uniform float4x4 modelView : register(C0)
+                  )
+{
+   ConnectData OUT;
+
+   OUT.hpos = mul(modelView, float4(IN.position,1.0));
+   OUT.texCoord = IN.texCoord;
+    
+   return OUT;
+}
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//

+ 28 - 0
Templates/BaseGame/game/core/rendering/shaders/AFX/afxZodiac_Terrain_P.hlsl

@@ -0,0 +1,28 @@
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+// Arcane-FX - PIXEL SHADER
+//
+// afxZodiac_Terrain_P.hlsl
+//   This is the pixel shader for rendering zodiacs on terrain.
+//   
+// Copyright (C) Faust Logic, Inc.
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+
+#include "../common/shaderModel.hlsl"
+
+struct ConnectData
+{
+   float4 hpos         : TORQUE_POSITION;
+   float2 texCoord     : TEXCOORD0;
+};
+
+TORQUE_UNIFORM_SAMPLER2D(zodiacMap,0);
+uniform float4    zodiacColor;
+
+float4 main( ConnectData IN ) : TORQUE_TARGET0
+{
+   float4 outColor = zodiacColor*TORQUE_TEX2D(zodiacMap, IN.texCoord);   
+   return outColor;
+}
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//

+ 40 - 0
Templates/BaseGame/game/core/rendering/shaders/AFX/afxZodiac_Terrain_V.hlsl

@@ -0,0 +1,40 @@
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+// Arcane-FX - VERTEX SHADER
+//
+// afxZodiac_Terrain_P.hlsl
+//   This is the pixel shader for rendering zodiacs on terrain.
+//   
+// Copyright (C) Faust Logic, Inc.
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+
+#include "../common/shaderModel.hlsl"
+struct VertData
+{
+   float3 position        : POSITION;
+   float4 color           : COLOR0;
+   float2 texCoord        : TEXCOORD0;
+};
+
+struct ConnectData
+{
+   float4 hpos         : TORQUE_POSITION;
+   float2 texCoord     : TEXCOORD0;
+};
+
+//-----------------------------------------------------------------------------
+// Main
+//-----------------------------------------------------------------------------
+ConnectData main( VertData IN,
+                  uniform float4x4 modelView : register(C0)
+                  )
+{
+   ConnectData OUT;
+
+   OUT.hpos = mul(modelView, float4(IN.position,1.0));
+   OUT.texCoord = IN.texCoord;
+    
+   return OUT;
+}
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//

+ 24 - 0
Templates/BaseGame/game/core/rendering/shaders/AFX/gl/afxZodiac_Interior_P.glsl

@@ -0,0 +1,24 @@
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+// Arcane-FX - PIXEL SHADER
+//
+// afxZodiac_Interior_P.glsl
+//   This is the pixel shader for rendering zodiacs on interiors.
+//   
+// Copyright (C) Faust Logic, Inc.
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+
+uniform sampler2D zodiacMap;
+uniform vec4 zodiacColor;
+
+varying vec4 hpos;
+varying vec2 texCoord;
+
+//~~~~~~~~~~~~~~~~~~~~//
+
+void main()
+{
+   gl_FragColor = zodiacColor*texture2D(zodiacMap, texCoord);
+}
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//

+ 24 - 0
Templates/BaseGame/game/core/rendering/shaders/AFX/gl/afxZodiac_Interior_V.glsl

@@ -0,0 +1,24 @@
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+// Arcane-FX - VERTEX SHADER
+//
+// afxZodiac_Interior_V.glsl
+//   This is the vertex shader for rendering zodiacs on interiors.
+//   
+// Copyright (C) Faust Logic, Inc.
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+
+uniform mat4 modelview;
+
+varying vec2 texCoord;
+varying vec4 position, color;
+
+//~~~~~~~~~~~~~~~~~~~~//
+
+void main()
+{
+   texCoord = gl_MultiTexCoord0.st;
+   gl_Position = modelview * gl_Vertex;
+}
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//

+ 25 - 0
Templates/BaseGame/game/core/rendering/shaders/AFX/gl/afxZodiac_Polysoup_P.glsl

@@ -0,0 +1,25 @@
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+// Arcane-FX - PIXEL SHADER
+//
+// afxZodiac_Polysoup_P.glsl
+//   This is the pixel shader for rendering zodiacs on polysoup models.
+//   
+// Copyright (C) Faust Logic, Inc.
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+
+uniform sampler2D zodiacMap;
+uniform vec4 zodiacColor;
+
+in vec4 hpos;
+in vec2 texCoord;
+
+out vec4 OUT_FragColor0;
+//~~~~~~~~~~~~~~~~~~~~//
+
+void main()
+{
+   OUT_FragColor0 = zodiacColor*texture(zodiacMap, texCoord);
+}
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//

+ 30 - 0
Templates/BaseGame/game/core/rendering/shaders/AFX/gl/afxZodiac_Polysoup_V.glsl

@@ -0,0 +1,30 @@
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+// Arcane-FX - VERTEX SHADER
+//
+// afxZodiac_Polysoup_V.glsl
+//   This is the vertex shader for rendering zodiacs on polysoup models.
+//   
+// Copyright (C) Faust Logic, Inc.
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+
+#include "../../common/gl/hlslCompat.glsl"
+
+uniform mat4 modelview;
+
+out vec2 texCoord;
+
+in vec4 vPosition;
+in vec4 vColor;
+in vec2 vTexCoord0;
+
+//~~~~~~~~~~~~~~~~~~~~//
+
+void main()
+{
+   texCoord = vTexCoord0.st;
+   gl_Position = modelview * vPosition;
+   correctSSP(gl_Position);
+}
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//

+ 25 - 0
Templates/BaseGame/game/core/rendering/shaders/AFX/gl/afxZodiac_Terrain_P.glsl

@@ -0,0 +1,25 @@
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+// Arcane-FX - PIXEL SHADER
+//
+// afxZodiac_Terrain_P.glsl
+//   This is the pixel shader for rendering zodiacs on terrain.
+//   
+// Copyright (C) Faust Logic, Inc.
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+
+uniform sampler2D zodiacMap;
+uniform vec4 zodiacColor;
+
+in vec4 hpos;
+in vec2 texCoord;
+
+out vec4 OUT_FragColor0;
+//~~~~~~~~~~~~~~~~~~~~//
+
+void main()
+{
+   OUT_FragColor0 = zodiacColor*texture(zodiacMap, texCoord);
+}
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//

+ 30 - 0
Templates/BaseGame/game/core/rendering/shaders/AFX/gl/afxZodiac_Terrain_V.glsl

@@ -0,0 +1,30 @@
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+// Arcane-FX - VERTEX SHADER
+//
+// afxZodiac_Terrain_V.glsl
+//   This is the vertex shader for rendering zodiacs on terrain.
+//   
+// Copyright (C) Faust Logic, Inc.
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
+
+#include "../../common/gl/hlslCompat.glsl"
+
+uniform mat4 modelview;
+
+out vec2 texCoord;
+
+in vec4 vPosition;
+in vec4 vColor;
+in vec2 vTexCoord0;
+
+//~~~~~~~~~~~~~~~~~~~~//
+
+void main()
+{
+   texCoord = vTexCoord0.st;
+   gl_Position = modelview * vPosition;
+   correctSSP(gl_Position);
+}
+
+//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//

+ 0 - 5
Templates/BaseGame/game/core/settings.xml

@@ -5,9 +5,4 @@
             <Setting name="coreModulePath">core/</Setting>
         </Group>
     </Group>
-    <Group name="Gameplay">
-        <Group name="GameModes">
-            <Setting name="defaultModeName">a</Setting>
-        </Group>
-    </Group>
 </ProjectSettings>

+ 1 - 0
Templates/BaseGame/game/core/utility/Core_Utility.cs

@@ -6,6 +6,7 @@ function Core_Utility::onCreate(%this)
    exec("./scripts/helperFunctions.cs");
    exec("./scripts/gameObjectManagement.cs");
    exec("./scripts/persistanceManagement.cs");
+   exec("./scripts/module.cs");
 }
 
 function Core_Utility::onDestroy(%this)

+ 20 - 0
Templates/BaseGame/game/core/utility/scripts/module.cs

@@ -0,0 +1,20 @@
+function callOnModules(%functionName, %moduleGroup)
+{
+   //Get our modules so we can exec any specific client-side loading/handling
+   %modulesList = ModuleDatabase.findModules(false);
+   for(%i=0; %i < getWordCount(%modulesList); %i++)
+   {
+      %module = getWord(%modulesList, %i);
+      
+      if(%moduleGroup !$= "")
+      {
+         if(%module.group !$= %moduleGroup)
+            continue;  
+      }
+      
+      if(isObject(%module.scopeSet) && %module.scopeSet.isMethod(%functionName))
+      {
+         eval(%module.scopeSet @ "." @ %functionName @ "();");
+      }
+   }   
+}

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


+ 14 - 0
Templates/BaseGame/game/core/utility/scripts/signalManager.cs

@@ -0,0 +1,14 @@
+function SimObject::notify(%this, %signalName)
+{
+   
+}
+
+function SimObject::removeNotify(%this, %signalName)
+{
+   
+}
+
+function SimObject::removeNotify(%this, %signalName)
+{
+   
+}

+ 10 - 0
Templates/BaseGame/game/data/ImportTesting/ImportTesting.cs

@@ -0,0 +1,10 @@
+function ImportTesting::onCreate(%this)
+{
+
+}
+
+function ImportTesting::onDestroy(%this)
+{
+
+}
+

+ 25 - 0
Templates/BaseGame/game/data/ImportTesting/ImportTesting.module

@@ -0,0 +1,25 @@
+<ModuleDefinition
+    canSave="true"
+    canSaveDynamicFields="true"
+    ModuleId="ImportTesting"
+    VersionId="1"
+    Group="Game"
+    scriptFile="ImportTesting.cs"
+    CreateFunction="onCreate"
+    DestroyFunction="onDestroy">
+    <DeclaredAssets
+        canSave="true"
+        canSaveDynamicFields="true"
+        Extension="asset.taml"
+        Recurse="true" />
+    <AutoloadAssets
+        canSave="true"
+        canSaveDynamicFields="true"
+        AssetType="ComponentAsset"
+        Recurse="true" />
+    <AutoloadAssets
+        canSave="true"
+        canSaveDynamicFields="true"
+        AssetType="GUIAsset"
+        Recurse="true" />
+</ModuleDefinition>

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

@@ -39,6 +39,7 @@ function UI::create( %this )
    
    exec("./scripts/guis/profiler.gui");
    exec("./scripts/guis/netGraphGui.gui");
+   exec("./scripts/guis/RecordingsDlg.gui");
    exec("./scripts/guis/FileDialog.gui");
    exec("./scripts/guis/guiMusicPlayer.gui");
    exec("./scripts/guis/startupGui.gui");

+ 55 - 34
Templates/BaseGame/game/tools/assetBrowser/assetImportConfigs.xml

@@ -1,34 +1,55 @@
-<AssetImportConfigs>
-    <Config Name="TestConfig">
-        <Mesh ImportMesh="1" DoUpAxisOverride="0" UpAxisOverride="Z_AXIS" DoScaleOverride="0" ScaleOverride="1" IgnoreNodeScale="0" AdjustCenter="0" AdjustFloor="1" CollapseSubmeshes="0" LODType="TrailingNumber" ImportedNodes="" IgnoreNodes="" ImportMeshes="" IgnoreMeshes="" />
-        <Materials ImportMaterials="1" IgnoreMaterials="" CreateComposites="1" UseDiffuseSuffixOnOriginImg="1" UseExistingMaterials="1" />
-        <Animations ImportAnimations="1" SeparateAnimations="1" SeparateAnimationPrefix="" />
-        <Collisions GenerateCollisions="1" GenCollisionType="CollisionMesh" CollisionMeshPrefix="Col" GenerateLOSCollisions="1" GenLOSCollisionType="CollisionMesh" LOSCollisionMeshPrefix="LOS" />
-        <Images ImageType="GUI" DiffuseTypeSuffixes="_ALBEDO,_DIFFUSE,_ALB,_DIF,_Base_Color,_COLOR,_COL" NormalTypeSuffixes="_NORMAL,_NORM" SpecularTypeSuffixes="_SPECULAR,_SPEC" MetalnessTypeSuffixes="_METAL,_MET,_METALNESS,_METALLIC" RoughnessTypeSuffixes="_ROUGH,_ROUGHNESS" SmoothnessTypeSuffixes="_SMOOTH,_SMOOTHNESS" AOTypeSuffixes="_AO,_AMBIENT,_AMBIENTOCCLUSION,_Ambient_Occlusion" CompositeTypeSuffixes="_COMP,_COMPOSITE" TextureFilteringMode="Bilinear" UseMips="1" IsHDR="0" Scaling="1" Compressed="0" GenerateMaterialOnImport="1" PopulateMaterialMaps="1" />
-        <Sounds VolumeAdjust="1" PitchAdjust="1" Compressed="0" />
-    </Config>
-    <Config Name="SecondTest">
-        <Mesh ImportMesh="1" DoUpAxisOverride="0" UpAxisOverride="Z_AXIS" DoScaleOverride="0" ScaleOverride="1" IgnoreNodeScale="0" AdjustCenter="0" AdjustFloor="0" CollapseSubmeshes="0" LODType="TrailingNumber" ImportedNodes="" IgnoreNodes="" ImportMeshes="" IgnoreMeshes="" />
-        <Materials ImportMaterials="1" IgnoreMaterials="" CreateComposites="1" UseDiffuseSuffixOnOriginImg="" UseExistingMaterials="" />
-        <Animations ImportAnimations="1" SeparateAnimations="1" SeparateAnimationPrefix="" />
-        <Collisions GenerateCollisions="1" GenCollisionType="CollisionMesh" CollisionMeshPrefix="Col" GenerateLOSCollisions="1" GenLOSCollisionType="CollisionMesh" LOSCollisionMeshPrefix="LOS" />
-        <Images ImageType="N/A" DiffuseTypeSuffixes="_ALBEDO,_DIFFUSE,_ALB,_DIF,_COLOR,_COL" NormalTypeSuffixes="_NORMAL,_NORM" SpecularTypeSuffixes="_SPECULAR,_SPEC" MetalnessTypeSuffixes="_METAL,_MET,_METALNESS,_METALLIC" RoughnessTypeSuffixes="_ROUGH,_ROUGHNESS" SmoothnessTypeSuffixes="_SMOOTH,_SMOOTHNESS" AOTypeSuffixes="_AO,_AMBIENT,_AMBIENTOCCLUSION" CompositeTypeSuffixes="_COMP,_COMPOSITE" TextureFilteringMode="Bilinear" UseMips="1" IsHDR="0" Scaling="1" Compressed="0" GenerateMaterialOnImport="" PopulateMaterialMaps="" />
-        <Sounds VolumeAdjust="1" PitchAdjust="1" Compressed="0" />
-    </Config>
-    <Config Name="GUI_Image_Import">
-        <Mesh ImportMesh="0" DoUpAxisOverride="0" UpAxisOverride="Z_AXIS" DoScaleOverride="0" ScaleOverride="1" IgnoreNodeScale="0" AdjustCenter="0" AdjustFloor="0" CollapseSubmeshes="0" LODType="TrailingNumber" ImportedNodes="" IgnoreNodes="" ImportMeshes="" IgnoreMeshes="" />
-        <Materials ImportMaterials="0" IgnoreMaterials="" CreateComposites="1" UseDiffuseSuffixOnOriginImg="1" UseExistingMaterials="1" />
-        <Animations ImportAnimations="0" SeparateAnimations="1" SeparateAnimationPrefix="" />
-        <Collisions GenerateCollisions="0" GenCollisionType="CollisionMesh" CollisionMeshPrefix="Col" GenerateLOSCollisions="1" GenLOSCollisionType="CollisionMesh" LOSCollisionMeshPrefix="LOS" />
-        <Images ImageType="GUI" DiffuseTypeSuffixes="_ALBEDO;_DIFFUSE;_ALB;_DIF;_COLOR;_COL;_BASECOLOR;_BASE_COLOR" NormalTypeSuffixes="_NORMAL;_NORM" SpecularTypeSuffixes="_SPECULAR;_SPEC" MetalnessTypeSuffixes="_METAL;_MET;_METALNESS;_METALLIC" RoughnessTypeSuffixes="_ROUGH;_ROUGHNESS" SmoothnessTypeSuffixes="_SMOOTH;_SMOOTHNESS" AOTypeSuffixes="_AO;_AMBIENT;_AMBIENTOCCLUSION" CompositeTypeSuffixes="_COMP;_COMPOSITE" TextureFilteringMode="Bilinear" UseMips="1" IsHDR="0" Scaling="1" Compressed="0" GenerateMaterialOnImport="0" PopulateMaterialMaps="0" />
-        <Sounds VolumeAdjust="1" PitchAdjust="1" Compressed="0" />
-    </Config>
-    <Config Name="CogflictsMesh">
-        <Mesh ImportMesh="1" DoUpAxisOverride="0" UpAxisOverride="Z_AXIS" DoScaleOverride="0" ScaleOverride="1" IgnoreNodeScale="0" AdjustCenter="0" AdjustFloor="0" CollapseSubmeshes="0" LODType="TrailingNumber" ImportedNodes="" IgnoreNodes="" ImportMeshes="" IgnoreMeshes="" />
-        <Materials ImportMaterials="1" IgnoreMaterials="ColorEffect*;" CreateComposites="1" UseDiffuseSuffixOnOriginImg="1" UseExistingMaterials="1" />
-        <Animations ImportAnimations="1" SeparateAnimations="1" SeparateAnimationPrefix="" />
-        <Collisions GenerateCollisions="1" GenCollisionType="CollisionMesh" CollisionMeshPrefix="Col" GenerateLOSCollisions="1" GenLOSCollisionType="CollisionMesh" LOSCollisionMeshPrefix="LOS" />
-        <Images ImageType="N/A" DiffuseTypeSuffixes="_ALBEDO;_DIFFUSE;_ALB;_DIF;_COLOR;_COL;_BASECOLOR;_BASE_COLOR;_Al" NormalTypeSuffixes="_NORMAL;_NORM;_N" SpecularTypeSuffixes="_SPECULAR;_SPEC" MetalnessTypeSuffixes="_METAL;_MET;_METALNESS;_METALLIC" RoughnessTypeSuffixes="_ROUGH;_ROUGHNESS" SmoothnessTypeSuffixes="_SMOOTH;_SMOOTHNESS" AOTypeSuffixes="_AO;_AMBIENT;_AMBIENTOCCLUSION" CompositeTypeSuffixes="_COMP;_COMPOSITE;_C" TextureFilteringMode="Bilinear" UseMips="1" IsHDR="0" Scaling="1" Compressed="0" GenerateMaterialOnImport="1" PopulateMaterialMaps="1" />
-        <Sounds VolumeAdjust="1" PitchAdjust="1" Compressed="0" />
-    </Config>
-</AssetImportConfigs>
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<AssetImportSettings>
+    <Group name="TestConfig">
+        <Group name="Collision">
+            <Setting name="LOSCollisionMeshPrefix">LOS</Setting>
+            <Setting name="GenerateCollisions">1</Setting>
+            <Setting name="GenLOSCollisionType">CollisionMesh</Setting>
+            <Setting name="GenerateLOSCollisions">1</Setting>
+            <Setting name="CollisionMeshPrefix">Col</Setting>
+            <Setting name="GenCollisionType">CollisionMesh</Setting>
+        </Group>
+        <Group name="Meshes">
+            <Setting name="AdjustFloor">0</Setting>
+            <Setting name="ScaleOverride">1</Setting>
+            <Setting name="LODType">TrailingNumber</Setting>
+            <Setting name="AdjustCenter">0</Setting>
+            <Setting name="UpAxisOverride">Z_AXIS</Setting>
+            <Setting name="CollapseSubmeshes">0</Setting>
+            <Setting name="IgnoreNodeScale">0</Setting>
+            <Setting name="DoUpAxisOverride">0</Setting>
+        </Group>
+        <Group name="Sounds">
+            <Setting name="VolumeAdjust">1.0</Setting>
+            <Setting name="Compressed">0</Setting>
+            <Setting name="PitchAdjust">1.0</Setting>
+        </Group>
+        <Group name="Images">
+            <Setting name="AOTypeSuffixes">_AO,_AMBIENT,_AMBIENTOCCLUSION</Setting>
+            <Setting name="NormalTypeSuffixes">_NORMAL,_NORM</Setting>
+            <Setting name="UseMips">1</Setting>
+            <Setting name="SmoothnessTypeSuffixes">_SMOOTH,_SMOOTHNESS</Setting>
+            <Setting name="PopulateMaterialMaps">1</Setting>
+            <Setting name="Scaling">1.0</Setting>
+            <Setting name="DiffuseTypeSuffixes">_ALBEDO,_DIFFUSE,_ALB,_DIF,_COLOR,_COL</Setting>
+            <Setting name="TextureFilteringMode">Bilinear</Setting>
+            <Setting name="GenerateMaterialOnImport">1</Setting>
+            <Setting name="RoughnessTypeSuffixes">_ROUGH,_ROUGHNESS</Setting>
+            <Setting name="CompositeTypeSuffixes">_COMP,_COMPOSITE</Setting>
+            <Setting name="ImageType">N/A</Setting>
+            <Setting name="IsHDR">0</Setting>
+            <Setting name="MetalnessTypeSuffixes">_METAL,_MET,_METALNESS,_METALLIC</Setting>
+            <Setting name="Compressed">1</Setting>
+        </Group>
+        <Group name="Materials">
+            <Setting name="UseExistingMaterials">1</Setting>
+            <Setting name="UseDiffuseSuffixOnOriginImage">1</Setting>
+            <Setting name="CreateComposites">1</Setting>
+            <Setting name="ImportMaterials">1</Setting>
+        </Group>
+        <Group name="Animations">
+            <Setting name="SeparateAnimations">1</Setting>
+            <Setting name="ImportAnimations">1</Setting>
+        </Group>
+    </Group>
+</AssetImportSettings>

+ 104 - 2
Templates/BaseGame/game/tools/assetBrowser/guis/assetImport.gui

@@ -1,7 +1,7 @@
 //--- OBJECT WRITE BEGIN ---
 %guiContent = new GuiControl(AssetImportCtrl) {
    position = "0 0";
-   extent = "1440 900";
+   extent = "1024 768";
    minExtent = "8 2";
    horizSizing = "right";
    vertSizing = "bottom";
@@ -296,7 +296,7 @@
       anchorBottom = "0";
       anchorLeft = "1";
       anchorRight = "0";
-      position = "140 98";
+      position = "145 133";
       extent = "733 502";
       minExtent = "48 92";
       horizSizing = "center";
@@ -609,5 +609,107 @@
          };
       };
    };
+   new GuiWindowCtrl(ImportAssetNewConfigEditorWindow) {
+      text = "Import Options Config";
+      resizeWidth = "1";
+      resizeHeight = "1";
+      canMove = "1";
+      canClose = "0";
+      canMinimize = "0";
+      canMaximize = "0";
+      canCollapse = "0";
+      edgeSnap = "1";
+      margin = "0 0 0 0";
+      padding = "0 0 0 0";
+      anchorTop = "1";
+      anchorBottom = "0";
+      anchorLeft = "1";
+      anchorRight = "0";
+      position = "348 332";
+      extent = "376 70";
+      minExtent = "48 70";
+      horizSizing = "center";
+      vertSizing = "center";
+      profile = "ToolsGuiWindowProfile";
+      visible = "0";
+      active = "1";
+      tooltipProfile = "ToolsGuiToolTipProfile";
+      hovertime = "1000";
+      isContainer = "1";
+      hidden = "1";
+      canSave = "1";
+      canSaveDynamicFields = "0";
+
+      new GuiTextCtrl() {
+         text = "Configuration Name:";
+         maxLength = "1024";
+         margin = "0 0 0 0";
+         padding = "0 0 0 0";
+         anchorTop = "1";
+         anchorBottom = "0";
+         anchorLeft = "1";
+         anchorRight = "0";
+         position = "10 26";
+         extent = "100 17";
+         minExtent = "8 2";
+         horizSizing = "right";
+         vertSizing = "bottom";
+         profile = "GuiTextProfile";
+         visible = "1";
+         active = "1";
+         tooltipProfile = "GuiToolTipProfile";
+         hovertime = "1000";
+         isContainer = "1";
+         canSave = "1";
+         canSaveDynamicFields = "0";
+      };
+      new GuiTextEditCtrl(AssetImportNewConfigName) {
+         historySize = "0";
+         tabComplete = "0";
+         sinkAllKeyEvents = "0";
+         password = "0";
+         passwordMask = "*";
+         maxLength = "1024";
+         margin = "0 0 0 0";
+         padding = "0 0 0 0";
+         anchorTop = "1";
+         anchorBottom = "0";
+         anchorLeft = "1";
+         anchorRight = "0";
+         position = "113 25";
+         extent = "250 18";
+         minExtent = "8 2";
+         horizSizing = "width";
+         vertSizing = "bottom";
+         profile = "GuiTextEditProfile";
+         visible = "1";
+         active = "1";
+         tooltipProfile = "GuiToolTipProfile";
+         hovertime = "1000";
+         isContainer = "1";
+         canSave = "1";
+         canSaveDynamicFields = "0";
+      };
+      new GuiButtonCtrl() {
+         text = "Done";
+         groupNum = "-1";
+         buttonType = "PushButton";
+         useMouseEvents = "0";
+         position = "301 45";
+         extent = "64 22";
+         minExtent = "8 2";
+         horizSizing = "left";
+         vertSizing = "top";
+         profile = "ToolsGuiButtonProfile";
+         visible = "1";
+         active = "1";
+         command = "ImportAssetConfigEditorWindow.createNewImportConfig();";
+         tooltipProfile = "ToolsGuiToolTipProfile";
+         hovertime = "1000";
+         isContainer = "0";
+         canSave = "1";
+         canSaveDynamicFields = "0";
+      };
+   };
 };
 //--- OBJECT WRITE END ---

+ 25 - 0
Templates/BaseGame/game/tools/assetBrowser/scripts/addModuleWindow.cs

@@ -75,6 +75,31 @@ function AssetBrowser_addModuleWindow::CreateNewModule(%this)
    
    //Now generate the script file for it
    %file = new FileObject();
+   %templateFile = new FileObject();
+   
+   %moduleTemplateCodeFilePath = AssetBrowser.templateFilesPath @ "module.cs.template";
+   
+   if(%file.openForWrite(%moduleScriptFilePath) && %templateFile.openForRead(%moduleTemplateCodeFilePath))
+   {
+      while( !%templateFile.isEOF() )
+      {
+         %line = %templateFile.readline();
+         %line = strreplace( %line, "@@", %newModuleName );
+         
+         %file.writeline(%line);
+         echo(%line);
+      }
+      
+      %file.close();
+      %templateFile.close();
+   }
+   else
+   {
+      %file.close();
+      %templateFile.close();
+      
+      warnf("CreateNewModule - Something went wrong and we couldn't write the script file!");
+   }
 	
 	if(%file.openForWrite(%moduleScriptFilePath))
 	{

+ 29 - 93
Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs

@@ -513,93 +513,29 @@ function ImportAssetWindow::reloadImportOptionConfigs(%this)
    if(%xmlDoc.loadFile($AssetBrowser::importConfigsFile))
    {
       //StateMachine element
-      %xmlDoc.pushFirstChildElement("AssetImportSettings");
+      if(!%xmlDoc.pushFirstChildElement("AssetImportSettings"))
+      {
+         error("Invalid Import Configs file");
+         return;  
+      }
       
       //Config Groups
       %configCount = 0;
-      while(%xmlDoc.pushChildElement(%configCount))
+      %hasGroup = %xmlDoc.pushFirstChildElement("Group");
+      while(%hasGroup)
       {
          %configName = %xmlDoc.attribute("name");
-
-         /*%xmlDoc.pushFirstChildElement("Mesh");
-            %configObj.ImportMesh = %xmlDoc.attribute("ImportMesh");
-            %configObj.DoUpAxisOverride = %xmlDoc.attribute("DoUpAxisOverride");
-            %configObj.UpAxisOverride = %xmlDoc.attribute("UpAxisOverride");
-            %configObj.DoScaleOverride = %xmlDoc.attribute("DoScaleOverride");
-            %configObj.ScaleOverride = %xmlDoc.attribute("ScaleOverride");
-            %configObj.IgnoreNodeScale = %xmlDoc.attribute("IgnoreNodeScale");
-            %configObj.AdjustCenter = %xmlDoc.attribute("AdjustCenter");
-            %configObj.AdjustFloor = %xmlDoc.attribute("AdjustFloor");
-            %configObj.CollapseSubmeshes = %xmlDoc.attribute("CollapseSubmeshes");       
-            %configObj.LODType = %xmlDoc.attribute("LODType");
-            %configObj.ImportedNodes = %xmlDoc.attribute("ImportedNodes");
-            %configObj.IgnoreNodes = %xmlDoc.attribute("IgnoreNodes");
-            %configObj.ImportMeshes = %xmlDoc.attribute("ImportMeshes");
-            %configObj.IgnoreMeshes = %xmlDoc.attribute("IgnoreMeshes");
-         %xmlDoc.popElement();
-         
-         %xmlDoc.pushFirstChildElement("Materials");
-            %configObj.ImportMaterials = %xmlDoc.attribute("ImportMaterials");
-            %configObj.IgnoreMaterials = %xmlDoc.attribute("IgnoreMaterials");
-            %configObj.CreateComposites = %xmlDoc.attribute("CreateComposites");
-            %configObj.UseDiffuseSuffixOnOriginImg = %xmlDoc.attribute("UseDiffuseSuffixOnOriginImg");
-            %configObj.UseExistingMaterials = %xmlDoc.attribute("UseExistingMaterials");
-         %xmlDoc.popElement();
-         
-         %xmlDoc.pushFirstChildElement("Animations");
-            %configObj.ImportAnimations = %xmlDoc.attribute("ImportAnimations");
-            %configObj.SeparateAnimations = %xmlDoc.attribute("SeparateAnimations");
-            %configObj.SeparateAnimationPrefix = %xmlDoc.attribute("SeparateAnimationPrefix");
-         %xmlDoc.popElement();
-         
-         %xmlDoc.pushFirstChildElement("Collisions");
-            %configObj.GenerateCollisions = %xmlDoc.attribute("GenerateCollisions");
-            %configObj.GenCollisionType = %xmlDoc.attribute("GenCollisionType");
-            %configObj.CollisionMeshPrefix = %xmlDoc.attribute("CollisionMeshPrefix");
-            %configObj.GenerateLOSCollisions = %xmlDoc.attribute("GenerateLOSCollisions");
-            %configObj.GenLOSCollisionType = %xmlDoc.attribute("GenLOSCollisionType");
-            %configObj.LOSCollisionMeshPrefix = %xmlDoc.attribute("LOSCollisionMeshPrefix");
-         %xmlDoc.popElement();
-         
-         %xmlDoc.pushFirstChildElement("Images");
-            %configObj.ImageType = %xmlDoc.attribute("ImageType");
-            %configObj.DiffuseTypeSuffixes = %xmlDoc.attribute("DiffuseTypeSuffixes");
-            %configObj.NormalTypeSuffixes = %xmlDoc.attribute("NormalTypeSuffixes");
-            %configObj.SpecularTypeSuffixes = %xmlDoc.attribute("SpecularTypeSuffixes");
-            %configObj.MetalnessTypeSuffixes = %xmlDoc.attribute("MetalnessTypeSuffixes");
-            %configObj.RoughnessTypeSuffixes = %xmlDoc.attribute("RoughnessTypeSuffixes");
-            %configObj.SmoothnessTypeSuffixes = %xmlDoc.attribute("SmoothnessTypeSuffixes");
-            %configObj.AOTypeSuffixes = %xmlDoc.attribute("AOTypeSuffixes");
-            %configObj.CompositeTypeSuffixes = %xmlDoc.attribute("CompositeTypeSuffixes");
-            %configObj.TextureFilteringMode = %xmlDoc.attribute("TextureFilteringMode");
-            %configObj.UseMips = %xmlDoc.attribute("UseMips");
-            %configObj.IsHDR = %xmlDoc.attribute("IsHDR");
-            %configObj.Scaling = %xmlDoc.attribute("Scaling");
-            %configObj.Compressed = %xmlDoc.attribute("Compressed");
-            %configObj.GenerateMaterialOnImport = %xmlDoc.attribute("GenerateMaterialOnImport");
-            %configObj.PopulateMaterialMaps = %xmlDoc.attribute("PopulateMaterialMaps");
-         %xmlDoc.popElement();
-         
-         %xmlDoc.pushFirstChildElement("Sounds");
-            %configObj.VolumeAdjust = %xmlDoc.attribute("VolumeAdjust");
-            %configObj.PitchAdjust = %xmlDoc.attribute("PitchAdjust");
-            %configObj.Compressed = %xmlDoc.attribute("Compressed");
-         %xmlDoc.popElement();*/
-         
-         %xmlDoc.popElement();
-         %configCount++;
          
          ImportAssetWindow.importConfigsList.add(%configName);
+         ImportAssetConfigList.add(%configName);
+         
+         %hasGroup = %xmlDoc.nextSiblingElement("Group");
       }
-      
+
       %xmlDoc.popElement();
    }
    
-   for(%i = 0; %i < ImportAssetWindow.importConfigsList.count(); %i++)
-   {
-      %configName = ImportAssetWindow.importConfigsList.getKey(%i);
-      ImportAssetConfigList.add(%configName);
-   }
+   %xmlDoc.delete();
    
    %importConfigIdx = ImportAssetWindow.activeImportConfigIndex;
    if(%importConfigIdx $= "")
@@ -679,14 +615,14 @@ function ImportAssetWindow::processNewImportAssets(%this, %id)
       
       if(isObject(%assetItem) && %assetItem.processed == false)
       {
-         %assetConfigObj = ImportAssetWindow.activeImportConfig.clone();
-         %assetConfigObj.assetIndex = %i;
+         //%assetConfigObj = ImportAssetWindow.activeImportConfig.clone();
+         //%assetConfigObj.assetIndex = %i;
 
          //sanetize before modifying our asset name(suffix additions, etc)      
          if(%assetItem.assetName !$= %assetItem.cleanAssetName)
             %assetItem.assetName = %assetItem.cleanAssetName;
             
-         %assetConfigObj.assetName = %assetItem.assetName;
+         //%assetConfigObj.assetName = %assetItem.assetName;
          
          if(%assetItem.assetType $= "Model")
          {
@@ -773,10 +709,10 @@ function ImportAssetWindow::_findImportingAssetByName(%this, %id, %assetName)
 function ImportAssetWindow::parseImageSuffixes(%this, %assetItem)
 {
    //diffuse
-   %suffixCount = getTokenCount(ImportAssetWindow.activeImportConfig.DiffuseTypeSuffixes, ",;");
+   %suffixCount = getTokenCount(getAssetImportConfigValue("Image/DiffuseTypeSuffixes", ""), ",;");
    for(%sfx = 0; %sfx < %suffixCount; %sfx++)
    {
-      %suffixToken = getToken(ImportAssetWindow.activeImportConfig.DiffuseTypeSuffixes, ",;", %sfx);
+      %suffixToken = getToken(getAssetImportConfigValue("Image/DiffuseTypeSuffixes", ""), ",;", %sfx);
       if(strIsMatchExpr("*"@%suffixToken, %assetItem.AssetName))
       {
          %assetItem.imageSuffixType = %suffixToken;
@@ -785,10 +721,10 @@ function ImportAssetWindow::parseImageSuffixes(%this, %assetItem)
    }
    
    //normal
-   %suffixCount = getTokenCount(ImportAssetWindow.activeImportConfig.NormalTypeSuffixes, ",;");
+   %suffixCount = getTokenCount(getAssetImportConfigValue("Image/NormalTypeSuffixes", ""), ",;");
    for(%sfx = 0; %sfx < %suffixCount; %sfx++)
    {
-      %suffixToken = getToken(ImportAssetWindow.activeImportConfig.NormalTypeSuffixes, ",;", %sfx);
+      %suffixToken = getToken(getAssetImportConfigValue("Image/NormalTypeSuffixes", ""), ",;", %sfx);
       if(strIsMatchExpr("*"@%suffixToken, %assetItem.AssetName))
       {
          %assetItem.imageSuffixType = %suffixToken;
@@ -797,10 +733,10 @@ function ImportAssetWindow::parseImageSuffixes(%this, %assetItem)
    }
    
    //roughness
-   %suffixCount = getTokenCount(ImportAssetWindow.activeImportConfig.RoughnessTypeSuffixes, ",;");
+   %suffixCount = getTokenCount(getAssetImportConfigValue("Image/RoughnessTypeSuffixes", ""), ",;");
    for(%sfx = 0; %sfx < %suffixCount; %sfx++)
    {
-      %suffixToken = getToken(ImportAssetWindow.activeImportConfig.RoughnessTypeSuffixes, ",;", %sfx);
+      %suffixToken = getToken(getAssetImportConfigValue("Image/RoughnessTypeSuffixes", ""), ",;", %sfx);
       if(strIsMatchExpr("*"@%suffixToken, %assetItem.AssetName))
       {
          %assetItem.imageSuffixType = %suffixToken;
@@ -809,10 +745,10 @@ function ImportAssetWindow::parseImageSuffixes(%this, %assetItem)
    }
    
    //Ambient Occlusion
-   %suffixCount = getTokenCount(ImportAssetWindow.activeImportConfig.AOTypeSuffixes, ",;");
+   %suffixCount = getTokenCount(getAssetImportConfigValue("Image/AOTypeSuffixes", ""), ",;");
    for(%sfx = 0; %sfx < %suffixCount; %sfx++)
    {
-      %suffixToken = getToken(ImportAssetWindow.activeImportConfig.AOTypeSuffixes, ",;", %sfx);
+      %suffixToken = getToken(getAssetImportConfigValue("Image/AOTypeSuffixes", ""), ",;", %sfx);
       if(strIsMatchExpr("*"@%suffixToken, %assetItem.AssetName))
       {
          %assetItem.imageSuffixType = %suffixToken;
@@ -821,10 +757,10 @@ function ImportAssetWindow::parseImageSuffixes(%this, %assetItem)
    }
    
    //metalness
-   %suffixCount = getTokenCount(ImportAssetWindow.activeImportConfig.MetalnessTypeSuffixes, ",;");
+   %suffixCount = getTokenCount(getAssetImportConfigValue("Image/MetalnessTypeSuffixes", ""), ",;");
    for(%sfx = 0; %sfx < %suffixCount; %sfx++)
    {
-      %suffixToken = getToken(ImportAssetWindow.activeImportConfig.MetalnessTypeSuffixes, ",;", %sfx);
+      %suffixToken = getToken(getAssetImportConfigValue("Image/MetalnessTypeSuffixes", ""), ",;", %sfx);
       if(strIsMatchExpr("*"@%suffixToken, %assetItem.AssetName))
       {
          %assetItem.imageSuffixType = %suffixToken;
@@ -833,10 +769,10 @@ function ImportAssetWindow::parseImageSuffixes(%this, %assetItem)
    }
    
    //composite
-   %suffixCount = getTokenCount(ImportAssetWindow.activeImportConfig.CompositeTypeSuffixes, ",;");
+   %suffixCount = getTokenCount(getAssetImportConfigValue("Image/CompositeTypeSuffixes", ""), ",;");
    for(%sfx = 0; %sfx < %suffixCount; %sfx++)
    {
-      %suffixToken = getToken(ImportAssetWindow.activeImportConfig.CompositeTypeSuffixes, ",;", %sfx);
+      %suffixToken = getToken(getAssetImportConfigValue("Image/CompositeTypeSuffixes", ""), ",;", %sfx);
       if(strIsMatchExpr("*"@%suffixToken, %assetItem.AssetName))
       {
          %assetItem.imageSuffixType = %suffixToken;
@@ -845,7 +781,7 @@ function ImportAssetWindow::parseImageSuffixes(%this, %assetItem)
    }
    
    //specular
-   %suffixCount = getTokenCount(ImportAssetWindow.activeImportConfig.SpecularTypeSuffixes, ",;");
+   /*%suffixCount = getTokenCount(ImportAssetWindow.activeImportConfig.SpecularTypeSuffixes, ",;");
    for(%sfx = 0; %sfx < %suffixCount; %sfx++)
    {
       %suffixToken = getToken(ImportAssetWindow.activeImportConfig.SpecularTypeSuffixes, ",;", %sfx);
@@ -854,7 +790,7 @@ function ImportAssetWindow::parseImageSuffixes(%this, %assetItem)
          %assetItem.imageSuffixType = %suffixToken;
          return "specular";
       }
-   }
+   }*/
    
    return "";
 }

+ 276 - 147
Templates/BaseGame/game/tools/assetBrowser/scripts/assetImportConfig.cs

@@ -8,11 +8,83 @@ function ImportAssetConfigList::onSelect( %this, %id, %text )
    
    ImportAssetWindow.activeImportConfigIndex = %id;
    ImportAssetWindow.activeImportConfig = ImportAssetWindow.importConfigsList.getKey(%id);
-   //ImportAssetWindow.refresh();
    
    AssetBrowser.reloadImportingFiles();
 }
 
+function setupImportConfigSettingsList()
+{
+   if(!isObject(ImportAssetConfigSettingsList))
+   {
+      new ArrayObject(ImportAssetConfigSettingsList);
+   
+      ImportAssetConfigSettingsList.addNewConfigSetting("Mesh/ImportMesh", "Import Mesh", "bool", "", "1", "", "ToggleImportMesh");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Meshes/DoUpAxisOverride", "Do Up-axis Override", "bool", "", "0", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Meshes/UpAxisOverride", "Up-axis Override", "list", "", "Z_AXIS", "X_AXIS,Y_AXIS,Z_AXIS");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Meshes/ScaleOverride", "Do Scale Override", "bool", "", "0", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Meshes/ScaleOverride", "Scale Override", "float", "", "1", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Meshes/IgnoreNodeScale", "Ignore Node Scale", "bool", "", "0", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Meshes/AdjustCenter", "Adjust Center", "bool", "", "0", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Meshes/AdjustFloor", "Adjust Floor", "bool", "", "0", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Meshes/CollapseSubmeshes", "Collapse Submeshes", "bool", "", "0", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Meshes/LODType", "LOD Type", "list", "", "TrailingNumber", "TrailingNumber,DetectDTS");
+      //ImportAssetConfigSettingsList.addNewConfigSetting("TrailingNumber", "Trailing Number", "float", "", "2", "", "Mesh");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Meshes/ImportedNodes", "Imported Nodes", "command", "", "", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Meshes/IgnoreNodes", "Ignore Nodes", "command", "", "", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Meshes/ImportMeshes", "Import Meshes", "command", "", "", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Meshes/IgnoreMeshes", "Imported Meshes", "command", "", "", "");
+      
+      //Materials
+      ImportAssetConfigSettingsList.addNewConfigSetting("Materials/ImportMaterials", "Import Materials", "bool", "", "1", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Materials/CreateComposites", "Create Composites", "bool", "", "1", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Materials/UseDiffuseSuffixOnOriginImage", "Use Diffuse Suffix for Origin Image", "bool", "", "1", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Materials/UseExistingMaterials", "Use Existing Materials", "bool", "", "1", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Materials/IgnoreMaterials", "Ignore Materials", "command", "", "", "");
+      
+      //Animations
+      ImportAssetConfigSettingsList.addNewConfigSetting("Animations/ImportAnimations", "Import Animations", "bool", "", "1", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Animations/SeparateAnimations", "Separate Animations", "bool", "", "1", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Animations/SeparateAnimationPrefix", "Separate Animation Prefix", "string", "", "", "");
+      
+      //Collision
+      ImportAssetConfigSettingsList.addNewConfigSetting("Collision/GenerateCollisions", "Generate Collisions", "bool", "", "1", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Collision/GenCollisionType", "Generate Collision Type", "list", "", "CollisionMesh", "CollisionMesh,ConvexHull");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Collision/CollisionMeshPrefix", "CollisionMesh Prefix", "string", "", "Col", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Collision/GenerateLOSCollisions", "Generate LOS Collisions", "bool", "", "1", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Collision/GenLOSCollisionType", "Generate LOS Collision Type", "list", "", "CollisionMesh", "CollisionMesh,ConvexHull");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Collision/LOSCollisionMeshPrefix", "LOS CollisionMesh Prefix", "string", "", "LOS", "");
+      
+      //Images
+      ImportAssetConfigSettingsList.addNewConfigSetting("Images/ImageType", "Image Type", "list", "", "N/A", "N/A,Diffuse,Normal,Specular,Metalness,Roughness,AO,Composite,GUI");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Images/DiffuseTypeSuffixes", "Diffuse Type Suffixes", "command", "", "_ALBEDO,_DIFFUSE,_ALB,_DIF,_COLOR,_COL", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Images/NormalTypeSuffixes", "Normal Type Suffixes", "command", "", "_NORMAL,_NORM", "");
+      
+      ImportAssetConfigSettingsList.addNewConfigSetting("Images/MetalnessTypeSuffixes", "Metalness Type Suffixes", "command", "", "_METAL,_MET,_METALNESS,_METALLIC", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Images/RoughnessTypeSuffixes", "Roughness Type Suffixes", "command", "", "_ROUGH,_ROUGHNESS", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Images/SmoothnessTypeSuffixes", "Smoothness Type Suffixes", "command", "", "_SMOOTH,_SMOOTHNESS", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Images/AOTypeSuffixes", "AO Type Suffixes", "command", "", "_AO,_AMBIENT,_AMBIENTOCCLUSION", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Images/CompositeTypeSuffixes", "Composite Type Suffixes", "command", "", "_COMP,_COMPOSITE", "");
+      
+      ImportAssetConfigSettingsList.addNewConfigSetting("Images/TextureFilteringMode", "Texture Filtering Mode", "list", "", "Bilinear", "None,Bilinear,Trilinear");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Images/UseMips", "Use Mipmaps", "bool", "", "1", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Images/IsHDR", "Is HDR", "bool", "", "0", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Images/Scaling", "Scaling", "float", "", "1.0", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Images/Compressed", "Is Compressed", "bool", "", "1", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Images/GenerateMaterialOnImport", "Generate Material On Import", "bool", "", "1", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Images/PopulateMaterialMaps", "Populate Material Maps", "bool", "", "1", "");
+
+      //Sounds
+      ImportAssetConfigSettingsList.addNewConfigSetting("Sounds/VolumeAdjust", "Volume Adjustment", "float", "", "1.0", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Sounds/PitchAdjust", "Pitch Adjustment", "float", "", "1.0", "");
+      ImportAssetConfigSettingsList.addNewConfigSetting("Sounds/Compressed", "Is Compressed", "bool", "", "0", "");
+   }
+}
+
+function ImportAssetConfigSettingsList::addNewConfigSetting(%this, %settingName, %settingFieldLabel, %type, %tooltip, %defaultValue, %fieldData)
+{
+   %this.add(%settingName TAB %settingFieldLabel TAB %type TAB %tooltip, %defaultValue TAB %fieldData);
+}
+
 function ImportAssetOptionsWindow::findMissingFile(%this, %assetItem)
 {
    if(%assetItem.assetType $= "Model")
@@ -100,6 +172,7 @@ function ImportAssetOptionsWindow::editImportSettings(%this, %assetItem)
       if(%meshCount > 0)
       {
          ImportOptionsList.startGroup("Mesh");
+         
          ImportOptionsList.addField("AutogenCollisions", "Auto-gen Collisions", "bool", "", "0", "", %assetConfigObj);
          ImportOptionsList.addField("CollapseSubmeshes", "Collapse Submeshes", "bool", "", "0", "", %assetConfigObj);
          ImportOptionsList.addField("UpAxisOverride", "Up-Axis Override", "list", "", "Z_AXIS", "Z_AXIS,Y_AXIS,X_AXIS", %assetConfigObj);
@@ -187,14 +260,31 @@ function ImportOptionsList::ImportMaterialsChanged(%this, %fieldName, %newValue,
    echo("CHANGED IF OUR IMPORTED MATERIALS WERE HAPPENING!");
 }
 
-function ImportAssetConfigEditorWindow::populateConfigList(%this, %optionsObj)
+function getAssetImportConfigValue(%fieldName, %defaultValue)
+{
+   if(ImportAssetWindow.activeImportConfig $= "")
+      return "";
+   
+   return AssetImportSettings.value(ImportAssetWindow.activeImportConfig @ "/" @ %fieldName, %defaultValue);
+}
+
+function ImportAssetConfigEditorWindow::populateConfigList(%this, %configName)
 {
-   AssetImportConfigName.setText(%optionsObj.Name);
+   //Ensure our config list is set up
+   setupImportConfigSettingsList();
+   
+   AssetImportConfigName.setText(%configName);
    
-   ImportOptionsConfigList.clear();
+   ImportOptionsConfigList.clearFields();
    
-   ImportOptionsConfigList.startGroup("Mesh");
-   ImportOptionsConfigList.addCallbackField("ImportMesh", "Import Mesh", "bool", "", "1", "", "ToggleImportMesh", %optionsObj);
+   %this.populateConfigListByGroup("Meshes");
+   %this.populateConfigListByGroup("Materials");
+   %this.populateConfigListByGroup("Animations");
+   %this.populateConfigListByGroup("Images");
+   %this.populateConfigListByGroup("Collision");
+   %this.populateConfigListByGroup("Sound");
+   
+   /*ImportOptionsConfigList.addCallbackField("ImportMesh", "Import Mesh", "bool", "", "1", "", "ToggleImportMesh", %optionsObj);
    ImportOptionsConfigList.addField("DoUpAxisOverride", "Do Up-axis Override", "bool", "", "0", "", %optionsObj);
    ImportOptionsConfigList.addField("UpAxisOverride", "Up-axis Override", "list", "", "Z_AXIS", "X_AXIS,Y_AXIS,Z_AXIS", %optionsObj);
    ImportOptionsConfigList.addField("DoScaleOverride", "Do Scale Override", "bool", "", "0", "", %optionsObj);
@@ -270,84 +360,108 @@ function ImportAssetConfigEditorWindow::populateConfigList(%this, %optionsObj)
    ImportOptionsConfigList.addField("VolumeAdjust", "Volume Adjustment", "float", "", "1.0", "", %optionsObj);
    ImportOptionsConfigList.addField("PitchAdjust", "Pitch Adjustment", "float", "", "1.0", "", %optionsObj);
    ImportOptionsConfigList.addField("Compressed", "Is Compressed", "bool", "", "0", "", %optionsObj);
+   ImportOptionsConfigList.endGroup();*/
+}
+
+function ImportAssetConfigEditorWindow::populateConfigListByGroup(%this, %groupName)
+{
+   ImportOptionsConfigList.startGroup(%groupName);
+   for(%i=0; %i < ImportAssetConfigSettingsList.count(); %i++)
+   {
+      %settingName = getField(ImportAssetConfigSettingsList.getKey(%i),0);
+      if(startsWith(%settingName, %groupName@"/"))
+      {
+         %labelName = getField(ImportAssetConfigSettingsList.getKey(%i), 1);
+         %type = getField(ImportAssetConfigSettingsList.getKey(%i), 2);
+         %tooltip = getField(ImportAssetConfigSettingsList.getKey(%i), 3);
+         
+         %defaultValue = getField(ImportAssetConfigSettingsList.getValue(%i), 0);
+         %dataValues = getField(ImportAssetConfigSettingsList.getValue(%i), 1);
+         ImportOptionsConfigList.addSettingsField(%settingName, %labelName, %type, %tooltip, %defaultValue, %dataValues);
+      }
+   }
    ImportOptionsConfigList.endGroup();
 }
 
 function ImportAssetConfigEditorWindow::addNewConfig(%this)
 {
-   ImportAssetConfigEditorWindow.setVisible(1);
-   ImportAssetConfigEditorWindow.selectWindow();
-   
-   %optionsObj = new ScriptObject(){};
-   
-   ImportAssetWindow.importConfigsList.add(%optionsObj); 
-   
-   //Initial, blank configuration
-   %optionsObj.ImportMesh = true;
-   %optionsObj.DoUpAxisOverride = false;
-   %optionsObj.UpAxisOverride = "Z_AXIS";
-   %optionsObj.DoScaleOverride = false;
-   %optionsObj.ScaleOverride = 1.0;
-   %optionsObj.IgnoreNodeScale = false;
-   %optionsObj.AdjustCenter = false;
-   %optionsObj.AdjustFloor = false;
-   %optionsObj.CollapseSubmeshes = false;
-   %optionsObj.LODType = "TrailingNumber";
-   //%optionsObj.TrailingNumber = 2;
-   %optionsObj.ImportedNodes = "";
-   %optionsObj.IgnoreNodes = "";
-   %optionsObj.ImportMeshes = "";
-   %optionsObj.IgnoreMeshes = "";
+   //Ensure our list is set up
+   setupImportConfigSettingsList();
+   
+   ImportAssetNewConfigEditorWindow.setVisible(1);
+   ImportAssetNewConfigEditorWindow.selectWindow();
+   
+   %configName = AssetImportConfigName.getText();
+   
+   AssetImportSettings.beginGroup(%configName);
+   
+   //Meshes
+   AssetImportSettings.setValue("Meshes/ImportMesh", "1");
+   AssetImportSettings.setValue("Meshes/DoUpAxisOverride", "0");
+   AssetImportSettings.setValue("Meshes/UpAxisOverride", "Z_AXIS");
+   AssetImportSettings.setValue("Meshes/DoScaleOverride", "0");
+   AssetImportSettings.setValue("Meshes/ScaleOverride", "1.0");
+   AssetImportSettings.setValue("Meshes/IgnoreNodeScale", "0");
+   AssetImportSettings.setValue("Meshes/AdjustCenter", "0");
+   AssetImportSettings.setValue("Meshes/AdjustFloor", "0");
+   AssetImportSettings.setValue("Meshes/CollapseSubmeshes", "0");
+   AssetImportSettings.setValue("Meshes/LODType", "TrailingNumber");
+   AssetImportSettings.setValue("Meshes/ImportedNodes", "");
+   AssetImportSettings.setValue("Meshes/IgnoreNodes", "");
+   AssetImportSettings.setValue("Meshes/ImportMeshes", "");
+   AssetImportSettings.setValue("Meshes/IgnoreMeshes", "");
    
    //Materials
-   %optionsObj.ImportMaterials = true;
-   %optionsObj.IgnoreMaterials = "";
-   %optionsObj.CreateComposites = true;
-   %optionsObj.UseDiffuseSuffixOnOriginImg = true;
-   %optionsObj.UseExistingMaterials = true;
+   AssetImportSettings.setValue("Materials/ImportMaterials", "1");
+   AssetImportSettings.setValue("Materials/IgnoreMaterials", "");
+   AssetImportSettings.setValue("Materials/CreateComposites", "1");
+   AssetImportSettings.setValue("Materials/UseDiffuseSuffixOnOriginImage", "1");
+   AssetImportSettings.setValue("Materials/UseExistingMaterials", "1");
    
    //Animations
-   %optionsObj.ImportAnimations = true;
-   %optionsObj.SeparateAnimations = true;
-   %optionsObj.SeparateAnimationPrefix = "";
+   AssetImportSettings.setValue("Animations/ImportAnimations", "1");
+   AssetImportSettings.setValue("Animations/SeparateAnimations", "1");
+   AssetImportSettings.setValue("Animations/SeparateAnimationPrefix", "");
    
    //Collision
-   %optionsObj.GenerateCollisions = true;
-   %optionsObj.GenCollisionType = "CollisionMesh";
-   %optionsObj.CollisionMeshPrefix = "Col";
-   %optionsObj.GenerateLOSCollisions = true;
-   %optionsObj.GenLOSCollisionType = "CollisionMesh";
-   %optionsObj.LOSCollisionMeshPrefix = "LOS";
+   AssetImportSettings.setValue("Collision/GenerateCollisions", "1");
+   AssetImportSettings.setValue("Collision/GenCollisionType", "CollisionMesh");
+   AssetImportSettings.setValue("Collision/CollisionMeshPrefix", "Col");
+   AssetImportSettings.setValue("Collision/GenerateLOSCollisions", "1");
+   AssetImportSettings.setValue("Collision/GenLOSCollisionType", "CollisionMesh");
+   AssetImportSettings.setValue("Collision/LOSCollisionMeshPrefix", "LOS");
    
    //Images
-   %optionsObj.ImageType = "N/A";
-   %optionsObj.DiffuseTypeSuffixes = "_ALBEDO;_DIFFUSE;_ALB;_DIF;_COLOR;_COL;_BASECOLOR;_BASE_COLOR";
-   %optionsObj.NormalTypeSuffixes = "_NORMAL;_NORM";
-   %optionsObj.SpecularTypeSuffixes = "_SPECULAR;_SPEC";
-   %optionsObj.MetalnessTypeSuffixes = "_METAL;_MET;_METALNESS;_METALLIC";
-   %optionsObj.RoughnessTypeSuffixes = "_ROUGH;_ROUGHNESS";
-   %optionsObj.SmoothnessTypeSuffixes = "_SMOOTH;_SMOOTHNESS";
-   %optionsObj.AOTypeSuffixes = "_AO;_AMBIENT;_AMBIENTOCCLUSION";
-   %optionsObj.CompositeTypeSuffixes = "_COMP;_COMPOSITE";
-   %optionsObj.TextureFilteringMode = "Bilinear";
-   %optionsObj.UseMips = true;
-   %optionsObj.IsHDR = false;
-   %optionsObj.Scaling = 1.0;
-   %optionsObj.Compressed = true;
-   %optionsObj.GenerateMaterialOnImport = true;
-   %optionsObj.PopulateMaterialMaps = true;
+   AssetImportSettings.setValue("Images/ImageType", "N/A");
+   AssetImportSettings.setValue("Images/DiffuseTypeSuffixes", "_ALBEDO;_DIFFUSE;_ALB;_DIF;_COLOR;_COL;_BASECOLOR;_BASE_COLOR");
+   AssetImportSettings.setValue("Images/NormalTypeSuffixes", "_NORMAL;_NORM");
+   AssetImportSettings.setValue("Images/MetalnessTypeSuffixes", "_METAL;_MET;_METALNESS;_METALLIC");
+   AssetImportSettings.setValue("Images/RoughnessTypeSuffixes", "_ROUGH;_ROUGHNESS");
+   AssetImportSettings.setValue("Images/SmoothnessTypeSuffixes", "_SMOOTH;_SMOOTHNESS");
+   AssetImportSettings.setValue("Images/AOTypeSuffixes", "_AO;_AMBIENT;_AMBIENTOCCLUSION");
+   AssetImportSettings.setValue("Images/CompositeTypeSuffixes", "_COMP;_COMPOSITE");
+   AssetImportSettings.setValue("Images/TextureFilteringMode", "Bilinear");
+   AssetImportSettings.setValue("Images/UseMips", "1");
+   AssetImportSettings.setValue("Images/IsHDR", "0");
+   AssetImportSettings.setValue("Images/Scaling", "1.0");
+   AssetImportSettings.setValue("Images/Compressed", "1");
+   AssetImportSettings.setValue("Images/GenerateMaterialOnImport", "1");
+   AssetImportSettings.setValue("Images/PopulateMaterialMaps", "1");
    
    //Sounds
-   %optionsObj.VolumeAdjust = 1.0;
-   %optionsObj.PitchAdjust = 1.0;
-   %optionsObj.Compressed = false;
+   AssetImportSettings.setValue("Sounds/VolumeAdjust", "1.0");
+   AssetImportSettings.setValue("Sounds/PitchAdjust", "1.0");
+   AssetImportSettings.setValue("Sounds/Compressed", "0");
+   
+   AssetImportSettings.endGroup();
    
    //Hook in the UI
-   %this.populateConfigList(%optionsObj);
+   //%this.populateConfigList(%optionsObj);
 }
 
 function ImportAssetConfigEditorWindow::editConfig(%this)
 {
+   //Ensure our list is set up
    ImportAssetConfigEditorWindow.setVisible(1);
    ImportAssetConfigEditorWindow.selectWindow();
    
@@ -356,6 +470,10 @@ function ImportAssetConfigEditorWindow::editConfig(%this)
 
 function ImportAssetConfigEditorWindow::deleteConfig(%this)
 {
+   for(%i=0; %i < %configList.count(); %i++)
+   {
+      
+   }
    ImportAssetWindow.importConfigsList.erase(ImportAssetWindow.activeImportConfigIndex);
    ImportAssetConfigList.setSelected(0); //update it
    
@@ -364,95 +482,106 @@ function ImportAssetConfigEditorWindow::deleteConfig(%this)
 
 function ImportAssetConfigEditorWindow::saveAssetOptionsConfig(%this)
 {
-   %xmlDoc = new SimXMLDocument();
+   %success = AssetImportSettings.write();
    
-   %xmlDoc.pushNewElement("AssetImportConfigs");
-      
-      for(%i = 0; %i < ImportAssetWindow.importConfigsList.count(); %i++)
+   ImportAssetConfigEditorWindow.setVisible(0);
+   ImportAssetWindow.reloadImportOptionConfigs();
+}
+
+function ImportAssetConfigEditorWindow::createNewImportConfig(%this)
+{
+   %configName = AssetImportNewConfigName.getText();
+   %configList = ImportAssetConfigSettingsList;
+   
+   AssetImportSettings.beginGroup(%configName);
+   
+   for(%i=0; %i < %configList.count(); %i++)
+   {
+      %settingName = getField(%configList.getKey(%i),0);
+      if(startsWith(%settingName, "Meshes/"))
       {
-         %configObj = ImportAssetWindow.importConfigsList.getKey(%i);         
-         
-         %xmlDoc.pushNewElement("Config");
-         
-         if(%configObj.Name $= "")
-            %configObj.Name = AssetImportConfigName.getText();
-            
-         %xmlDoc.setAttribute("Name", %configObj.Name); 
-         
-            %xmlDoc.pushNewElement("Mesh");
-               %xmlDoc.setAttribute("ImportMesh", %configObj.ImportMesh);
-               %xmlDoc.setAttribute("DoUpAxisOverride", %configObj.DoUpAxisOverride);
-               %xmlDoc.setAttribute("UpAxisOverride", %configObj.UpAxisOverride);
-               %xmlDoc.setAttribute("DoScaleOverride", %configObj.DoScaleOverride);
-               %xmlDoc.setAttribute("ScaleOverride", %configObj.ScaleOverride);
-               %xmlDoc.setAttribute("IgnoreNodeScale", %configObj.IgnoreNodeScale);
-               %xmlDoc.setAttribute("AdjustCenter", %configObj.AdjustCenter);
-               %xmlDoc.setAttribute("AdjustFloor", %configObj.AdjustFloor);
-               %xmlDoc.setAttribute("CollapseSubmeshes", %configObj.CollapseSubmeshes);         
-               %xmlDoc.setAttribute("LODType", %configObj.LODType);
-               %xmlDoc.setAttribute("ImportedNodes", %configObj.ImportedNodes);
-               %xmlDoc.setAttribute("IgnoreNodes", %configObj.IgnoreNodes);
-               %xmlDoc.setAttribute("ImportMeshes", %configObj.ImportMeshes);
-               %xmlDoc.setAttribute("IgnoreMeshes", %configObj.IgnoreMeshes);
-            %xmlDoc.popElement();
-            
-            %xmlDoc.pushNewElement("Materials");
-               %xmlDoc.setAttribute("ImportMaterials", %configObj.ImportMaterials);
-               %xmlDoc.setAttribute("IgnoreMaterials", %configObj.IgnoreMaterials);
-               %xmlDoc.setAttribute("CreateComposites", %configObj.CreateComposites);
-               %xmlDoc.setAttribute("UseDiffuseSuffixOnOriginImg", %configObj.UseDiffuseSuffixOnOriginImg);
-               %xmlDoc.setAttribute("UseExistingMaterials", %configObj.UseExistingMaterials);
-            %xmlDoc.popElement();
-            
-            %xmlDoc.pushNewElement("Animations");
-               %xmlDoc.setAttribute("ImportAnimations", %configObj.ImportAnimations);
-               %xmlDoc.setAttribute("SeparateAnimations", %configObj.SeparateAnimations);
-               %xmlDoc.setAttribute("SeparateAnimationPrefix", %configObj.SeparateAnimationPrefix);
-            %xmlDoc.popElement();
-            
-            %xmlDoc.pushNewElement("Collisions");
-               %xmlDoc.setAttribute("GenerateCollisions", %configObj.GenerateCollisions);
-               %xmlDoc.setAttribute("GenCollisionType", %configObj.GenCollisionType);
-               %xmlDoc.setAttribute("CollisionMeshPrefix", %configObj.CollisionMeshPrefix);
-               %xmlDoc.setAttribute("GenerateLOSCollisions", %configObj.GenerateLOSCollisions);
-               %xmlDoc.setAttribute("GenLOSCollisionType", %configObj.GenLOSCollisionType);
-               %xmlDoc.setAttribute("LOSCollisionMeshPrefix", %configObj.LOSCollisionMeshPrefix);
-            %xmlDoc.popElement();
-            
-            %xmlDoc.pushNewElement("Images");
-               %xmlDoc.setAttribute("ImageType", %configObj.ImageType);
-               %xmlDoc.setAttribute("DiffuseTypeSuffixes", %configObj.DiffuseTypeSuffixes);
-               %xmlDoc.setAttribute("NormalTypeSuffixes", %configObj.NormalTypeSuffixes);
-               %xmlDoc.setAttribute("SpecularTypeSuffixes", %configObj.SpecularTypeSuffixes);
-               %xmlDoc.setAttribute("MetalnessTypeSuffixes", %configObj.MetalnessTypeSuffixes);
-               %xmlDoc.setAttribute("RoughnessTypeSuffixes", %configObj.RoughnessTypeSuffixes);
-               %xmlDoc.setAttribute("SmoothnessTypeSuffixes", %configObj.SmoothnessTypeSuffixes);
-               %xmlDoc.setAttribute("AOTypeSuffixes", %configObj.AOTypeSuffixes);
-               %xmlDoc.setAttribute("CompositeTypeSuffixes", %configObj.CompositeTypeSuffixes);
-               %xmlDoc.setAttribute("TextureFilteringMode", %configObj.TextureFilteringMode);
-               %xmlDoc.setAttribute("UseMips", %configObj.UseMips);
-               %xmlDoc.setAttribute("IsHDR", %configObj.IsHDR);
-               %xmlDoc.setAttribute("Scaling", %configObj.Scaling);
-               %xmlDoc.setAttribute("Compressed", %configObj.Compressed);
-               %xmlDoc.setAttribute("GenerateMaterialOnImport", %configObj.GenerateMaterialOnImport);
-               %xmlDoc.setAttribute("PopulateMaterialMaps", %configObj.PopulateMaterialMaps);
-            %xmlDoc.popElement();
-            
-            %xmlDoc.pushNewElement("Sounds");
-               %xmlDoc.setAttribute("VolumeAdjust", %configObj.VolumeAdjust);
-               %xmlDoc.setAttribute("PitchAdjust", %configObj.PitchAdjust);
-               %xmlDoc.setAttribute("Compressed", %configObj.Compressed);
-            %xmlDoc.popElement();
-         
-         %xmlDoc.popElement();
+         %defaultValue = getField(%configList.getValue(%i), 0);
+         AssetImportSettings.setValue(%settingName, %defaultValue);
       }
-      
-   %xmlDoc.popElement();
+   }
    
-   %xmlDoc.saveFile($AssetBrowser::importConfigsFile);
+   for(%i=0; %i < %configList.count(); %i++)
+   {
+      %settingName = getField(%configList.getKey(%i),0);
+      if(startsWith(%settingName, "Materials/"))
+      {
+         %defaultValue = getField(%configList.getValue(%i), 0);
+         AssetImportSettings.setValue(%settingName, %defaultValue);
+      }
+   }
    
-   ImportAssetConfigEditorWindow.setVisible(0);
-   ImportAssetWindow.reloadImportOptionConfigs();
+   for(%i=0; %i < %configList.count(); %i++)
+   {
+      %settingName = getField(%configList.getKey(%i),0);
+      if(startsWith(%settingName, "Animations/"))
+      {
+         %defaultValue = getField(%configList.getValue(%i), 0);
+         AssetImportSettings.setValue(%settingName, %defaultValue);
+      }
+   }
+   
+   for(%i=0; %i < %configList.count(); %i++)
+   {
+      %settingName = getField(%configList.getKey(%i),0);
+      if(startsWith(%settingName, "Collision/"))
+      {
+         %defaultValue = getField(%configList.getValue(%i), 0);
+         AssetImportSettings.setValue(%settingName, %defaultValue);
+      }
+   }
+   
+   for(%i=0; %i < %configList.count(); %i++)
+   {
+      %settingName = getField(%configList.getKey(%i),0);
+      if(startsWith(%settingName, "Images/"))
+      {
+         %defaultValue = getField(%configList.getValue(%i), 0);
+         AssetImportSettings.setValue(%settingName, %defaultValue);
+      }
+   }
+
+   for(%i=0; %i < %configList.count(); %i++)
+   {
+      %settingName = getField(%configList.getKey(%i),0);
+      if(startsWith(%settingName, "Sounds/"))
+      {
+         %defaultValue = getField(%configList.getValue(%i), 0);
+         AssetImportSettings.setValue(%settingName, %defaultValue);
+      }
+   }
+   
+   AssetImportSettings.endGroup();
+   
+   %success = AssetImportSettings.write();
+   
+   ImportAssetNewConfigEditorWindow.setVisible(0);
+}
+
+function ImportOptionsConfigList::addSettingsField(%this, %settingsFieldName, %labelText, %fieldType, %tooltip, %fieldValue, %fieldData)
+{
+   %moddedSettingsFieldName = strreplace(%settingsFieldName, "/", "-");
+   
+   %value = AssetImportSettings.value(%settingsFieldName);
+   if(%value $= "")
+      %value = %fieldValue;
+   
+   %this.addCallbackField(%moddedSettingsFieldName, %labelText, %fieldType, "", %value, %fieldData, "changeEditorSetting");
+}
+
+function ImportOptionsConfigList::changeEditorSetting(%this, %varName, %value)
+{
+   %varName = strreplace(%varName, "-", "/");
+   
+   echo("Set " @ %varName @ " to be " @ %value);  
+   
+   AssetImportSettings.setValue(%varName, %value);
+   
+   %success = AssetImportSettings.write();
 }
 
 function ImportOptionsConfigList::ToggleImportMesh(%this, %fieldName, %newValue, %ownerObject)

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

@@ -1,6 +1,6 @@
 function AssetBrowser::prepareImportImageAsset(%this, %assetItem)
 {
-   if(ImportAssetWindow.activeImportConfig.GenerateMaterialOnImport == 1 && %assetItem.parentAssetItem $= "")
+   if(getAssetImportConfigValue("Images/GenerateMaterialOnImport", "1") == 1 && %assetItem.parentAssetItem $= "")
    {
       //First, see if this already has a suffix of some sort based on our import config logic. Many content pipeline tools like substance automatically appends them
       %foundSuffixType = ImportAssetWindow.parseImageSuffixes(%assetItem);
@@ -45,21 +45,21 @@ 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(ImportAssetWindow.activeImportConfig.UseDiffuseSuffixOnOriginImg == 1)
+      if(getAssetImportConfigValue("Images/UseDiffuseSuffixOnOriginImg", "1") == 1)
       {
          if(%foundSuffixType $= "")
          {
-            %diffuseToken = getToken(ImportAssetWindow.activeImportConfig.DiffuseTypeSuffixes, ",", 0);
+            %diffuseToken = getToken(getAssetImportConfigValue("Images/DiffuseTypeSuffixes", ""), ",", 0);
             %assetItem.AssetName = %assetItem.AssetName @ %diffuseToken;
             
-            if(ImportAssetWindow.activeImportConfig.PopulateMaterialMaps == 1)
+            if(getAssetImportConfigValue("Materials/PopulateMaterialMaps", "1") == 1)
                %materialAsset.diffuseImageAsset = %assetItem;
          }
          else if(%foundSuffixType !$= "")
          {
             //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(ImportAssetWindow.activeImportConfig.PopulateMaterialMaps == 1)
+            if(getAssetImportConfigValue("Materials/PopulateMaterialMaps", "1") == 1)
             {
                if(%foundSuffixType $= "diffuse")
                   %materialAsset.diffuseImageAsset = %assetItem;

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

@@ -62,12 +62,12 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
    %fileExt = fileExt(%assetItem.filePath);
    
    //Check if we need to filter this material out or not
-   if(ImportAssetWindow.activeImportConfig.IgnoreMaterials !$= "")
+   if(getAssetImportConfigValue("Materials/IgnoreMaterials", "") !$= "")
    {
-      %ignoredMatNamesCount = getTokenCount(ImportAssetWindow.activeImportConfig.IgnoreMaterials, ",;");
+      %ignoredMatNamesCount = getTokenCount(getAssetImportConfigValue("Materials/IgnoreMaterials", ""), ",;");
       for(%i=0; %i < %ignoredMatNamesCount; %i++)
       {
-        %ignoreName = getToken(ImportAssetWindow.activeImportConfig.IgnoreMaterials, ".;", %i);
+        %ignoreName = getToken(getAssetImportConfigValue("Materials/IgnoreMaterials", ""), ",;", %i);
         
         if(strIsMatchExpr(%ignoreName, %fileName))
         {
@@ -78,7 +78,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
       }
    }
    
-   if(ImportAssetWindow.activeImportConfig.PopulateMaterialMaps == 1)
+   if(getAssetImportConfigValue("Materials/PopulateMaterialMaps", "") == 1)
    {
       %materialItemId = ImportAssetTree.findItemByObjectId(%assetItem);
       
@@ -90,9 +90,9 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
          
          %diffuseImageSuffix = ImportAssetWindow.parseImagePathSuffixes(%diffuseImagePath);
          
-         if(ImportAssetWindow.activeImportConfig.UseDiffuseSuffixOnOriginImg == 1 && %diffuseImageSuffix $= "")
+         if(getAssetImportConfigValue("Images/UseDiffuseSuffixOnOriginImage", "1") == 1 && %diffuseImageSuffix $= "")
          {
-            %diffuseToken = getToken(ImportAssetWindow.activeImportConfig.DiffuseTypeSuffixes, ",;", 0);
+            %diffuseToken = getToken(getAssetImportConfigValue("Materials/DiffuseTypeSuffixes", ""), ",;", 0);
             
             %diffuseAsset = AssetBrowser.addImportingAsset("Image", %diffuseImagePath, %assetItem, %filename @ %diffuseToken);
          }
@@ -121,10 +121,10 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
                   %diffFileName = fileBase(%assetItem.diffuseImageAsset.filePath);
                   %diffFileExt = fileExt(%assetItem.diffuseImageAsset.filePath);
                   
-                  %suffixCount = getTokenCount(ImportAssetWindow.activeImportConfig.DiffuseTypeSuffixes, ",;");
+                  %suffixCount = getTokenCount(getAssetImportConfigValue("Materials/DiffuseTypeSuffixes", ""), ",;");
                   for(%sfx = 0; %sfx < %suffixCount; %sfx++)
                   {
-                     %suffixToken = getToken(ImportAssetWindow.activeImportConfig.DiffuseTypeSuffixes, ",;", %sfx);
+                     %suffixToken = getToken(getAssetImportConfigValue("Materials/DiffuseTypeSuffixes", ""), ",;", %sfx);
                      if(strIsMatchExpr("*"@%suffixToken, %diffFileName))
                      {
                         %diffFileName = strreplace(%diffFileName, %suffixToken, "");
@@ -143,7 +143,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
             %assetItem.normalImageAsset = %normalAsset;
          }
       }
-      if(%assetItem.specularImageAsset $= "")
+      /*if(%assetItem.specularImageAsset $= "")
       {
          //Specular
          %listCount = getTokenCount(ImportAssetWindow.activeImportConfig.SpecularTypeSuffixes, ",;");
@@ -163,7 +163,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
                break;  
             }
          }
-      }
+      }*/
       
       if(%assetItem.metalImageAsset $= "")
       {

+ 1 - 1
Templates/BaseGame/game/tools/assetBrowser/scripts/fieldTypes.cs

@@ -90,7 +90,7 @@ function GuiInspectorVariableGroup::buildListField(%this, %fieldName, %fieldLabe
       if(%fieldName $= "")
          %editControl.setText(%fieldName);
    }
-   else
+   else if(isObject(%ownerObj))
    {
       //regular variable
       %setCommand = %editControl @ ".setText(" @ %ownerObj @ "." @ %fieldName @ ");";

+ 37 - 0
Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/module.cs.template

@@ -0,0 +1,37 @@
+function @@::onCreate(%this)
+{
+}
+
+function @@::onDestroy(%this)
+{
+}
+
+//This is called when the server is initially set up by the game application
+function @@::initServer(%this)
+{
+}
+
+//This is called when the server is created for an actual game/map to be played
+function @@::onCreateServer(%this)
+{
+}
+
+//This is called when the server is shut down due to the game/map being exited
+function @@::onDestroyServer(%this)
+{
+}
+
+//This is called when the client is initially set up by the game application
+function @@::initClient(%this)
+{
+}
+
+//This is called when a client connects to a server
+function @@::onCreateClient(%this)
+{
+}
+
+//This is called when a client disconnects from a server
+function @@::onDestroyClient(%this)
+{
+}

+ 7 - 7
Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorTreeView.ed.cs

@@ -107,15 +107,15 @@ function GuiEditorTreeView::onRightMouseDown( %this, %item, %pts, %obj )
          object = %obj;
       };
       
-      %popup.item[ 0 ] = "Rename" TAB "" TAB "GuiEditorTreeView.showItemRenameCtrl( GuiEditorTreeView.findItemByObjectId(" @ %popup.object @ ") );";
-      %popup.item[ 1 ] = "Delete" TAB "" TAB "GuiEditor.deleteControl(" @ %popup.object @ ");";
+      %popup.item[ 0 ] = "Rename" TAB "" TAB "GuiEditorTreeView.showItemRenameCtrl( GuiEditorTreeView.findItemByObjectId(" @ %obj @ ") );";
+      %popup.item[ 1 ] = "Delete" TAB "" TAB "GuiEditor.deleteControl(" @ %obj @ ");";
       %popup.item[ 2 ] = "-";
-      %popup.item[ 3 ] = "Locked" TAB "" TAB "%this.object.setLocked( !" @ %popup.object @ ".locked); GuiEditorTreeView.update();";
-      %popup.item[ 4 ] = "Hidden" TAB "" TAB "%this.object.setVisible( !" @ %popup.object @ ".isVisible() ); GuiEditorTreeView.update();";
+      %popup.item[ 3 ] = "Locked" TAB "" TAB %obj @ ".setLocked( !" @ %obj @ ".locked); GuiEditorTreeView.update();";
+      %popup.item[ 4 ] = "Hidden" TAB "" TAB %obj @ ".setVisible( !" @ %obj @ ".isVisible() ); GuiEditorTreeView.update();";
       %popup.item[ 5 ] = "-";
-      %popup.item[ 6 ] = "Add New Controls Here" TAB "" TAB "GuiEditor.setCurrentAddSet( " @ %popup.object @ ");";
-      %popup.item[ 7 ] = "Add Child Controls to Selection" TAB "" TAB "GuiEditor.selectAllControlsInSet( " @ %popup.object @ ", false );";
-      %popup.item[ 8 ] = "Remove Child Controls from Selection" TAB "" TAB "GuiEditor.selectAllControlsInSet( " @ %popup.object @ ", true );";
+      %popup.item[ 6 ] = "Add New Controls Here" TAB "" TAB "GuiEditor.setCurrentAddSet( " @ %obj @ ");";
+      %popup.item[ 7 ] = "Add Child Controls to Selection" TAB "" TAB "GuiEditor.selectAllControlsInSet( " @ %obj @ ", false );";
+      %popup.item[ 8 ] = "Remove Child Controls from Selection" TAB "" TAB "GuiEditor.selectAllControlsInSet( " @ %obj @ ", true );";
       
       %popup.checkItem( 3, %obj.locked );
       %popup.checkItem( 4, !%obj.isVisible() );

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

@@ -1,142 +1,148 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <EditorSettings>
-    <Group name="AxisGizmo">
-        <Setting name="rotationSnap">15</Setting>
-        <Setting name="mouseRotateScalar">0.8</Setting>
-        <Setting name="renderWhenUsed">0</Setting>
-        <Setting name="axisGizmoMaxScreenLen">100</Setting>
-        <Setting name="snapRotations">0</Setting>
-        <Setting name="mouseScaleScalar">0.8</Setting>
-        <Setting name="renderInfoText">1</Setting>
-        <Group name="Grid">
-            <Setting name="renderPlane">0</Setting>
-            <Setting name="gridColor">255 255 255 20</Setting>
-            <Setting name="gridSize">10 10 10</Setting>
-            <Setting name="planeDim">500</Setting>
-            <Setting name="snapToGrid">0</Setting>
-            <Setting name="renderPlaneHashes">0</Setting>
-        </Group>
-    </Group>
-    <Group name="Theme">
-        <Setting name="tooltipDividerColor">72 70 68 255</Setting>
-        <Setting name="fieldTextColor">178 175 172 255</Setting>
-        <Setting name="fieldBGHLColor">72 70 68 255</Setting>
-        <Setting name="fieldTextSELColor">240 240 240 255</Setting>
-        <Setting name="dividerMidColor">50 49 48 255</Setting>
-        <Setting name="windowBackgroundColor">32 31 30 255</Setting>
-        <Setting name="dividerLightColor">96 94 92 255</Setting>
-        <Setting name="dividerDarkColor">17 16 15 255</Setting>
-        <Setting name="fieldBGColor">59 58 57 255</Setting>
-        <Setting name="tooltipBGColor">43 43 43 255</Setting>
-        <Setting name="tabsColor">37 36 35 255</Setting>
-        <Setting name="tabsHLColor">50 49 48 255</Setting>
-        <Setting name="headerTextColor">236 234 232 255</Setting>
-        <Setting name="headerColor">50 49 48 255</Setting>
-        <Setting name="fieldBGSELColor">100 98 96 255</Setting>
-        <Setting name="tabsSELColor">59 58 57 255</Setting>
-        <Setting name="fieldTextHLColor">234 232 230 255</Setting>
-        <Setting name="tooltipTextColor">255 255 255 255</Setting>
-    </Group>
     <Group name="WorldEditor">
-        <Setting name="undoLimit">40</Setting>
-        <Setting name="currentEditor">WorldEditorInspectorPlugin</Setting>
-        <Setting name="forceLoadDAE">0</Setting>
-        <Setting name="torsionPath">AssetWork_Debug.exe</Setting>
-        <Setting name="orthoShowGrid">1</Setting>
         <Setting name="displayType">6</Setting>
         <Setting name="orthoFOV">50</Setting>
+        <Setting name="torsionPath">AssetWork_Debug.exe</Setting>
         <Setting name="dropType">screenCenter</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>
+        <Setting name="forceLoadDAE">0</Setting>
+        <Setting name="currentEditor">WorldEditorInspectorPlugin</Setting>
+        <Setting name="orthoShowGrid">1</Setting>
+        <Setting name="undoLimit">40</Setting>
+        <Group name="Render">
+            <Setting name="showMousePopupInfo">1</Setting>
+            <Setting name="renderObjText">1</Setting>
+            <Setting name="renderPopupBackground">1</Setting>
+            <Setting name="renderSelectionBox">1</Setting>
+            <Setting name="renderObjHandle">1</Setting>
         </Group>
         <Group name="Grid">
             <Setting name="gridSize">1</Setting>
-            <Setting name="gridMinorColor">51 51 51 100</Setting>
             <Setting name="gridOriginColor">255 255 255 100</Setting>
-            <Setting name="gridColor">102 102 102 100</Setting>
             <Setting name="gridSnap">0</Setting>
+            <Setting name="gridMinorColor">51 51 51 100</Setting>
+            <Setting name="gridColor">102 102 102 100</Setting>
         </Group>
-        <Group name="Images">
-            <Setting name="selectHandle">tools/worldEditor/images/SelectHandle</Setting>
-            <Setting name="defaultHandle">tools/worldEditor/images/DefaultHandle</Setting>
-            <Setting name="lockedHandle">tools/worldEditor/images/LockedHandle</Setting>
-        </Group>
-        <Group name="Render">
-            <Setting name="renderPopupBackground">1</Setting>
-            <Setting name="renderObjHandle">1</Setting>
-            <Setting name="showMousePopupInfo">1</Setting>
-            <Setting name="renderObjText">1</Setting>
-            <Setting name="renderSelectionBox">1</Setting>
+        <Group name="Color">
+            <Setting name="selectionBoxColor">255 255 0 255</Setting>
+            <Setting name="objMouseOverColor">0 255 0 255</Setting>
+            <Setting name="objMouseOverSelectColor">0 0 255 255</Setting>
+            <Setting name="dragRectColor">255 255 0 255</Setting>
+            <Setting name="objectTextColor">255 255 255 255</Setting>
+            <Setting name="popupBackgroundColor">100 100 100 255</Setting>
+            <Setting name="objSelectColor">255 0 0 255</Setting>
         </Group>
         <Group name="Tools">
-            <Setting name="snapSoft">0</Setting>
-            <Setting name="snapSoftSize">2</Setting>
-            <Setting name="dropAtScreenCenterScalar">1</Setting>
             <Setting name="objectsUseBoxCenter">1</Setting>
             <Setting name="snapGround">0</Setting>
-            <Setting name="boundingBoxCollision">0</Setting>
             <Setting name="dropAtScreenCenterMax">100</Setting>
+            <Setting name="dropAtScreenCenterScalar">1</Setting>
+            <Setting name="snapSoft">0</Setting>
+            <Setting name="snapSoftSize">2</Setting>
+            <Setting name="boundingBoxCollision">0</Setting>
         </Group>
-        <Group name="Color">
-            <Setting name="popupBackgroundColor">100 100 100 255</Setting>
-            <Setting name="objMouseOverSelectColor">0 0 255 255</Setting>
-            <Setting name="objMouseOverColor">Lime</Setting>
-            <Setting name="selectionBoxColor">255 255 0 255</Setting>
-            <Setting name="objectTextColor">255 255 255 255</Setting>
-            <Setting name="dragRectColor">255 255 0 255</Setting>
-            <Setting name="objSelectColor">255 0 0 255</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="Theme">
-            <Setting name="windowTitleBGHLColor">48 48 48 255</Setting>
-            <Setting name="windowTitleBGNAColor">180 180 180 255</Setting>
-            <Setting name="windowTitleBGColor">50 50 50 255</Setting>
             <Setting name="windowTitleFontColor">215 215 215 255</Setting>
+            <Setting name="windowTitleBGNAColor">180 180 180 255</Setting>
             <Setting name="windowTitleFontHLColor">255 255 255 255</Setting>
+            <Setting name="windowTitleBGColor">50 50 50 255</Setting>
+            <Setting name="windowTitleBGHLColor">48 48 48 255</Setting>
+        </Group>
+        <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 name="Docs">
+            <Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
             <Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
-            <Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
             <Setting name="forumURL">http://www.garagegames.com/products/torque-3d/forums</Setting>
-            <Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
+            <Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
         </Group>
     </Group>
+    <Group name="AxisGizmo">
+        <Setting name="axisGizmoMaxScreenLen">100</Setting>
+        <Setting name="snapRotations">0</Setting>
+        <Setting name="rotationSnap">15</Setting>
+        <Setting name="mouseRotateScalar">0.8</Setting>
+        <Setting name="mouseScaleScalar">0.8</Setting>
+        <Setting name="renderInfoText">1</Setting>
+        <Setting name="renderWhenUsed">0</Setting>
+        <Group name="Grid">
+            <Setting name="planeDim">500</Setting>
+            <Setting name="renderPlane">0</Setting>
+            <Setting name="renderPlaneHashes">0</Setting>
+            <Setting name="snapToGrid">0</Setting>
+            <Setting name="gridColor">255 255 255 20</Setting>
+            <Setting name="gridSize">10 10 10</Setting>
+        </Group>
+    </Group>
+    <Group name="Theme">
+        <Setting name="dividerLightColor">96 94 92 255</Setting>
+        <Setting name="windowBackgroundColor">32 31 30 255</Setting>
+        <Setting name="tooltipTextColor">255 255 255 255</Setting>
+        <Setting name="fieldTextColor">178 175 172 255</Setting>
+        <Setting name="dividerDarkColor">17 16 15 255</Setting>
+        <Setting name="headerTextColor">236 234 232 255</Setting>
+        <Setting name="tabsSELColor">59 58 57 255</Setting>
+        <Setting name="fieldBGSELColor">100 98 96 255</Setting>
+        <Setting name="fieldBGHLColor">72 70 68 255</Setting>
+        <Setting name="tooltipDividerColor">72 70 68 255</Setting>
+        <Setting name="fieldTextSELColor">240 240 240 255</Setting>
+        <Setting name="fieldBGColor">59 58 57 255</Setting>
+        <Setting name="fieldTextHLColor">234 232 230 255</Setting>
+        <Setting name="dividerMidColor">50 49 48 255</Setting>
+        <Setting name="tabsColor">37 36 35 255</Setting>
+        <Setting name="tabsHLColor">50 49 48 255</Setting>
+        <Setting name="headerColor">50 49 48 255</Setting>
+        <Setting name="tooltipBGColor">43 43 43 255</Setting>
+    </Group>
     <Group name="GuiEditor">
         <Setting name="previewResolution">1024 768</Setting>
         <Setting name="lastPath">tools/gui</Setting>
-        <Group name="Rendering">
-            <Setting name="drawGuides">1</Setting>
-            <Setting name="drawBorderLines">1</Setting>
-        </Group>
         <Group name="EngineDevelopment">
-            <Setting name="showEditorProfiles">0</Setting>
             <Setting name="showEditorGuis">0</Setting>
+            <Setting name="showEditorProfiles">0</Setting>
             <Setting name="toggleIntoEditor">0</Setting>
         </Group>
         <Group name="Snapping">
-            <Setting name="snapToGuides">1</Setting>
-            <Setting name="snap2GridSize">8</Setting>
-            <Setting name="snapToEdges">1</Setting>
-            <Setting name="snapToCanvas">1</Setting>
             <Setting name="snapToControls">1</Setting>
-            <Setting name="sensitivity">2</Setting>
+            <Setting name="snap2GridSize">8</Setting>
             <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>
+        </Group>
+        <Group name="Rendering">
+            <Setting name="drawBorderLines">1</Setting>
+            <Setting name="drawGuides">1</Setting>
         </Group>
         <Group name="Help">
-            <Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
             <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 name="Library">
+            <Setting name="viewType">Categorized</Setting>
+        </Group>
+    </Group>
+    <Group name="ConvexEditor">
+        <Setting name="materialName">Grid_512_Orange</Setting>
+    </Group>
+    <Group name="NavEditor">
+        <Setting name="SpawnClass">AIPlayer</Setting>
     </Group>
     <Group name="LevelInformation">
         <Setting name="levelsDirectory">data/FPSGameplay/levels</Setting>
@@ -149,10 +155,4 @@
             </Group>
         </Group>
     </Group>
-    <Group name="NavEditor">
-        <Setting name="SpawnClass">AIPlayer</Setting>
-    </Group>
-    <Group name="ConvexEditor">
-        <Setting name="materialName">Grid_512_Orange</Setting>
-    </Group>
 </EditorSettings>