Переглянути джерело

Added changes missed via merge failures.
Removed some unused files/references that were causing errors, related to issues #502 & #512

Areloch 4 роки тому
батько
коміт
3e131f5b8e
78 змінених файлів з 1463 додано та 1486 видалено
  1. 6 2
      Engine/source/T3D/assets/ImageAsset.h
  2. 5 1
      Engine/source/T3D/assets/ShapeAsset.h
  3. 4 5
      Engine/source/T3D/player.cpp
  4. 0 1
      Templates/BaseGame/game/core/rendering/Core_Rendering.tscript
  5. BIN
      Templates/BaseGame/game/core/rendering/materials/Blank_sky/BlankSkybox.png
  6. 8 0
      Templates/BaseGame/game/core/rendering/materials/Blank_sky/BlankSkybox_image.asset.taml
  7. 19 0
      Templates/BaseGame/game/core/rendering/materials/Blank_sky/materials.tscript
  8. 2 2
      Templates/BaseGame/game/core/rendering/materials/NightSkybox_1.asset.taml
  9. 0 0
      Templates/BaseGame/game/core/rendering/materials/NightSkybox_1.png
  10. 2 2
      Templates/BaseGame/game/core/rendering/materials/NightSkybox_2.asset.taml
  11. 0 0
      Templates/BaseGame/game/core/rendering/materials/NightSkybox_2.png
  12. 2 2
      Templates/BaseGame/game/core/rendering/materials/NightSkybox_3.asset.taml
  13. 0 0
      Templates/BaseGame/game/core/rendering/materials/NightSkybox_3.png
  14. 2 2
      Templates/BaseGame/game/core/rendering/materials/NightSkybox_4.asset.taml
  15. 0 0
      Templates/BaseGame/game/core/rendering/materials/NightSkybox_4.png
  16. 8 0
      Templates/BaseGame/game/core/rendering/materials/NightSkybox_5.asset.taml
  17. 0 0
      Templates/BaseGame/game/core/rendering/materials/NightSkybox_5.png
  18. 8 0
      Templates/BaseGame/game/core/rendering/materials/NightSkybox_6.asset.taml
  19. 0 0
      Templates/BaseGame/game/core/rendering/materials/NightSkybox_6.png
  20. 6 6
      Templates/BaseGame/game/core/rendering/materials/materials.tscript
  21. 0 8
      Templates/BaseGame/game/core/rendering/materials/skybox_5.asset.taml
  22. 0 8
      Templates/BaseGame/game/core/rendering/materials/skybox_6.asset.taml
  23. 0 2
      Templates/BaseGame/game/data/ui/guis/startupGui.tscript
  24. 0 7
      Templates/BaseGame/game/tools/assetBrowser/guis/AssetImportConfigEditor.asset.taml
  25. 0 7
      Templates/BaseGame/game/tools/assetBrowser/guis/AssetPreviewButtonsTemplate.asset.taml
  26. 0 7
      Templates/BaseGame/game/tools/assetBrowser/guis/GameObjectCreator.asset.taml
  27. 7 0
      Templates/BaseGame/game/tools/assetBrowser/guis/assetImportConfigEditor.asset.taml
  28. 0 0
      Templates/BaseGame/game/tools/assetBrowser/guis/assetImportConfigEditor.gui
  29. 0 270
      Templates/BaseGame/game/tools/assetBrowser/guis/assetPreviewButtonsTemplate.gui
  30. 1 1
      Templates/BaseGame/game/tools/assetBrowser/guis/createNewCollectionSetCtrl.asset.taml
  31. 7 0
      Templates/BaseGame/game/tools/assetBrowser/guis/gameObjectCreator.asset.taml
  32. 0 0
      Templates/BaseGame/game/tools/assetBrowser/guis/gameObjectCreator.gui
  33. 0 2
      Templates/BaseGame/game/tools/assetBrowser/main.tscript
  34. 1 10
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript
  35. 1 1
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/component.tscript
  36. 1 1
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cpp.tscript
  37. 1 1
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/creatorObj.tscript
  38. 1 1
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/datablockObjects.tscript
  39. 1 1
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/folder.tscript
  40. 1 1
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/gameObject.tscript
  41. 1 1
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/gui.tscript
  42. 1 1
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/level.tscript
  43. 1 1
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/looseFiles.tscript
  44. 2 2
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.tscript
  45. 1 1
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/postFX.tscript
  46. 1 1
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/prefab.tscript
  47. 2 2
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/script.tscript
  48. 22 8
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.tscript
  49. 1 1
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shapeAnimation.tscript
  50. 1 1
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/sound.tscript
  51. 1 1
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/stateMachine.tscript
  52. 1 1
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.tscript
  53. 1 1
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrainMaterial.tscript
  54. 2 2
      Templates/BaseGame/game/tools/assetBrowser/scripts/directoryHandling.tscript
  55. 1 1
      Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.tscript
  56. 6 0
      Templates/BaseGame/game/tools/assetBrowser/scripts/selectModule.tscript
  57. 11 0
      Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/module.tscript.template
  58. 3 3
      Templates/BaseGame/game/tools/componentEditor/main.tscript
  59. 7 4
      Templates/BaseGame/game/tools/datablockEditor/datablockEditor.tscript
  60. 9 0
      Templates/BaseGame/game/tools/decalEditor/decalEditorGui.tscript
  61. 1 1
      Templates/BaseGame/game/tools/decalEditor/main.tscript
  62. 3 1
      Templates/BaseGame/game/tools/forestEditor/brushes.tscript
  63. 9 7
      Templates/BaseGame/game/tools/forestEditor/forestEditorGui.tscript
  64. 0 1
      Templates/BaseGame/game/tools/gui/guiDialogs.ed.tscript
  65. 1 1
      Templates/BaseGame/game/tools/guiEditor/gui/EditorChooseGUI.ed.gui
  66. 16 16
      Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui
  67. 182 313
      Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript
  68. 14 2
      Templates/BaseGame/game/tools/particleEditor/particleEmitterEditor.ed.tscript
  69. 51 15
      Templates/BaseGame/game/tools/particleEditor/particleParticleEditor.ed.tscript
  70. 15 0
      Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript
  71. 452 224
      Templates/BaseGame/game/tools/settings.xml
  72. 1 1
      Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditorActions.ed.tscript
  73. 1 1
      Templates/BaseGame/game/tools/worldEditor/gui/EditorChooseLevelGui.ed.gui
  74. 2 2
      Templates/BaseGame/game/tools/worldEditor/gui/EditorGui.ed.gui
  75. 199 366
      Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainMaterialDlg.ed.gui
  76. 125 2
      Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui
  77. 4 2
      Templates/BaseGame/game/tools/worldEditor/scripts/editors/terrainEditor.ed.tscript
  78. 218 148
      Templates/BaseGame/game/tools/worldEditor/scripts/interfaces/terrainMaterialDlg.ed.tscript

+ 6 - 2
Engine/source/T3D/assets/ImageAsset.h

@@ -538,9 +538,11 @@ DefineEngineMethod(className, set##name, bool, (const char* map, S32 index), , a
 }
 }
 
 
 #define INIT_IMAGEASSET_ARRAY(name, index) \
 #define INIT_IMAGEASSET_ARRAY(name, index) \
+{\
    m##name##Name[index] = StringTable->EmptyString(); \
    m##name##Name[index] = StringTable->EmptyString(); \
    m##name##AssetId[index] = StringTable->EmptyString(); \
    m##name##AssetId[index] = StringTable->EmptyString(); \
-   m##name##Asset[index] = NULL;
+   m##name##Asset[index] = NULL;\
+}
 
 
 #ifdef TORQUE_SHOW_LEGACY_FILE_FIELDS
 #ifdef TORQUE_SHOW_LEGACY_FILE_FIELDS
 
 
@@ -557,9 +559,11 @@ DefineEngineMethod(className, set##name, bool, (const char* map, S32 index), , a
 #endif
 #endif
 
 
 #define CLONE_IMAGEASSET_ARRAY(name, index) \
 #define CLONE_IMAGEASSET_ARRAY(name, index) \
+{\
    m##name##Name[index] = other.m##name##Name[index];\
    m##name##Name[index] = other.m##name##Name[index];\
    m##name##AssetId[index] = other.m##name##AssetId[index];\
    m##name##AssetId[index] = other.m##name##AssetId[index];\
-   m##name##Asset[index] = other.m##name##Asset[index];
+   m##name##Asset[index] = other.m##name##Asset[index];\
+}
 
 
 #define LOAD_IMAGEASSET_ARRAY(name, index)\
 #define LOAD_IMAGEASSET_ARRAY(name, index)\
 if (m##name##AssetId[index] != StringTable->EmptyString())\
 if (m##name##AssetId[index] != StringTable->EmptyString())\

+ 5 - 1
Engine/source/T3D/assets/ShapeAsset.h

@@ -567,11 +567,13 @@ DefineEngineMethod(className, set##name, bool, (const char*  shape, S32 index),
 }
 }
 
 
 #define INIT_SHAPEASSET_ARRAY(name, index) \
 #define INIT_SHAPEASSET_ARRAY(name, index) \
+{\
    m##name##Name[index] = StringTable->EmptyString(); \
    m##name##Name[index] = StringTable->EmptyString(); \
    m##name##AssetId[index] = StringTable->EmptyString(); \
    m##name##AssetId[index] = StringTable->EmptyString(); \
    m##name##Asset[index] = NULL; \
    m##name##Asset[index] = NULL; \
    m##name[index] = NULL;\
    m##name[index] = NULL;\
-   _set##name(StringTable->insert(ShapeAsset::smNoShapeAssetFallback), index);
+   _set##name(StringTable->insert(ShapeAsset::smNoShapeAssetFallback), index);\
+}
 
 
 #ifdef TORQUE_SHOW_LEGACY_FILE_FIELDS
 #ifdef TORQUE_SHOW_LEGACY_FILE_FIELDS
 
 
@@ -588,9 +590,11 @@ DefineEngineMethod(className, set##name, bool, (const char*  shape, S32 index),
 #endif // SHOW_LEGACY_FILE_FIELDS
 #endif // SHOW_LEGACY_FILE_FIELDS
 
 
 #define CLONE_SHAPEASSET_ARRAY(name, index) \
 #define CLONE_SHAPEASSET_ARRAY(name, index) \
+{\
    m##name##Name[index] = other.m##name##Name[index];\
    m##name##Name[index] = other.m##name##Name[index];\
    m##name##AssetId[index] = other.m##name##AssetId[index];\
    m##name##AssetId[index] = other.m##name##AssetId[index];\
    m##name##Asset[index] = other.m##name##Asset[index];\
    m##name##Asset[index] = other.m##name##Asset[index];\
+}
 
 
 #define PACKDATA_SHAPEASSET_ARRAY(name, index)\
 #define PACKDATA_SHAPEASSET_ARRAY(name, index)\
    if (stream->writeFlag(m##name##Asset[index].notNull()))\
    if (stream->writeFlag(m##name##Asset[index].notNull()))\

+ 4 - 5
Engine/source/T3D/player.cpp

@@ -1164,6 +1164,10 @@ void PlayerData::initPersistFields()
 
 
       // Mounted images arrays
       // Mounted images arrays
       addArray( "Mounted Images", ShapeBase::MaxMountedImages );
       addArray( "Mounted Images", ShapeBase::MaxMountedImages );
+         INITPERSISTFIELD_SHAPEASSET_ARRAY(ShapeFP, PlayerData, "@brief File name of this player's shape that will be used in conjunction with the corresponding mounted image.\n\n"
+            "These optional parameters correspond to each mounted image slot to indicate a shape that is rendered "
+            "in addition to the mounted image shape.  Typically these are a player's arms (or arm) that is "
+            "animated along with the mounted image's state animation sequences.\n");
 
 
          addProtectedField( "shapeNameFP", TypeShapeFilename, Offset(mShapeFPName, PlayerData), &_setShapeFPData, &defaultProtectedGetFn, ShapeBase::MaxMountedImages,
          addProtectedField( "shapeNameFP", TypeShapeFilename, Offset(mShapeFPName, PlayerData), &_setShapeFPData, &defaultProtectedGetFn, ShapeBase::MaxMountedImages,
             "@brief File name of this player's shape that will be used in conjunction with the corresponding mounted image.\n\n"
             "@brief File name of this player's shape that will be used in conjunction with the corresponding mounted image.\n\n"
@@ -1171,11 +1175,6 @@ void PlayerData::initPersistFields()
             "in addition to the mounted image shape.  Typically these are a player's arms (or arm) that is "
             "in addition to the mounted image shape.  Typically these are a player's arms (or arm) that is "
             "animated along with the mounted image's state animation sequences.\n", AbstractClassRep::FIELD_HideInInspectors);
             "animated along with the mounted image's state animation sequences.\n", AbstractClassRep::FIELD_HideInInspectors);
 
 
-         INITPERSISTFIELD_SHAPEASSET_ARRAY(ShapeFP, PlayerData, "@brief File name of this player's shape that will be used in conjunction with the corresponding mounted image.\n\n"
-            "These optional parameters correspond to each mounted image slot to indicate a shape that is rendered "
-            "in addition to the mounted image shape.  Typically these are a player's arms (or arm) that is "
-            "animated along with the mounted image's state animation sequences.\n");
-
       endArray( "Mounted Images" );
       endArray( "Mounted Images" );
 
 
    endGroup( "First Person Arms" );
    endGroup( "First Person Arms" );

+ 0 - 1
Templates/BaseGame/game/core/rendering/Core_Rendering.tscript

@@ -30,7 +30,6 @@ function Core_Rendering::onCreate(%this)
    $Terrain::OrmTextureFormat = ProjectSettings.value("Terrain/OrmTextureFormat", 12);
    $Terrain::OrmTextureFormat = ProjectSettings.value("Terrain/OrmTextureFormat", 12);
    
    
    exec("./scripts/graphicsOptions." @ $TorqueScriptFileExtension);
    exec("./scripts/graphicsOptions." @ $TorqueScriptFileExtension);
-   exec("./scripts/terrainSettings." @ $TorqueScriptFileExtension);
    exec("./scripts/renderManager." @ $TorqueScriptFileExtension);
    exec("./scripts/renderManager." @ $TorqueScriptFileExtension);
 }
 }
 
 

BIN
Templates/BaseGame/game/core/rendering/materials/Blank_sky/BlankSkybox.png


+ 8 - 0
Templates/BaseGame/game/core/rendering/materials/Blank_sky/BlankSkybox_image.asset.taml

@@ -0,0 +1,8 @@
+<ImageAsset
+    canSave="true"
+    canSaveDynamicFields="true"
+    AssetName="BlankSkybox_image"
+    imageFile="@assetFile=BlankSkybox.png"
+    UseMips="true"
+    isHDRImage="false"
+    imageType="Albedo" />

+ 19 - 0
Templates/BaseGame/game/core/rendering/materials/Blank_sky/materials.tscript

@@ -0,0 +1,19 @@
+//-----------------------------------------------------------------------------
+// Torque
+// Copyright GarageGames, LLC 2011
+//-----------------------------------------------------------------------------
+
+singleton CubemapData( BlankSkyCubemap )
+{
+   cubeFaceAsset[0] = "Core_Rendering:BlankSkybox_image";
+   cubeFaceAsset[1] = "Core_Rendering:BlankSkybox_image";
+   cubeFaceAsset[2] = "Core_Rendering:BlankSkybox_image";
+   cubeFaceAsset[3] = "Core_Rendering:BlankSkybox_image";
+   cubeFaceAsset[4] = "Core_Rendering:BlankSkybox_image";
+   cubeFaceAsset[5] = "Core_Rendering:BlankSkybox_image";
+};
+
+singleton Material( BlankSkyMat )
+{
+   cubemap = BlankSkyCubemap;
+};

+ 2 - 2
Templates/BaseGame/game/core/rendering/materials/skybox_1.asset.taml → Templates/BaseGame/game/core/rendering/materials/NightSkybox_1.asset.taml

@@ -1,8 +1,8 @@
 <ImageAsset
 <ImageAsset
     canSave="true"
     canSave="true"
     canSaveDynamicFields="true"
     canSaveDynamicFields="true"
-    AssetName="skybox_1"
-    imageFile="@assetFile=skybox_1.png"
+    AssetName="NightSkybox_1"
+    imageFile="@assetFile=NightSkybox_1.png"
     UseMips="true"
     UseMips="true"
     isHDRImage="false"
     isHDRImage="false"
     imageType="Albedo" />
     imageType="Albedo" />

+ 0 - 0
Templates/BaseGame/game/core/rendering/materials/skybox_1.png → Templates/BaseGame/game/core/rendering/materials/NightSkybox_1.png


+ 2 - 2
Templates/BaseGame/game/core/rendering/materials/skybox_2.asset.taml → Templates/BaseGame/game/core/rendering/materials/NightSkybox_2.asset.taml

@@ -1,8 +1,8 @@
 <ImageAsset
 <ImageAsset
     canSave="true"
     canSave="true"
     canSaveDynamicFields="true"
     canSaveDynamicFields="true"
-    AssetName="skybox_2"
-    imageFile="@assetFile=skybox_2.png"
+    AssetName="NightSkybox_2"
+    imageFile="@assetFile=NightSkybox_2.png"
     UseMips="true"
     UseMips="true"
     isHDRImage="false"
     isHDRImage="false"
     imageType="Albedo" />
     imageType="Albedo" />

+ 0 - 0
Templates/BaseGame/game/core/rendering/materials/skybox_2.png → Templates/BaseGame/game/core/rendering/materials/NightSkybox_2.png


+ 2 - 2
Templates/BaseGame/game/core/rendering/materials/skybox_3.asset.taml → Templates/BaseGame/game/core/rendering/materials/NightSkybox_3.asset.taml

@@ -1,8 +1,8 @@
 <ImageAsset
 <ImageAsset
     canSave="true"
     canSave="true"
     canSaveDynamicFields="true"
     canSaveDynamicFields="true"
-    AssetName="skybox_3"
-    imageFile="@assetFile=skybox_3.png"
+    AssetName="NightSkybox_3"
+    imageFile="@assetFile=NightSkybox_3.png"
     UseMips="true"
     UseMips="true"
     isHDRImage="false"
     isHDRImage="false"
     imageType="Albedo" />
     imageType="Albedo" />

+ 0 - 0
Templates/BaseGame/game/core/rendering/materials/skybox_3.png → Templates/BaseGame/game/core/rendering/materials/NightSkybox_3.png


+ 2 - 2
Templates/BaseGame/game/core/rendering/materials/skybox_4.asset.taml → Templates/BaseGame/game/core/rendering/materials/NightSkybox_4.asset.taml

@@ -1,8 +1,8 @@
 <ImageAsset
 <ImageAsset
     canSave="true"
     canSave="true"
     canSaveDynamicFields="true"
     canSaveDynamicFields="true"
-    AssetName="skybox_4"
-    imageFile="@assetFile=skybox_4.png"
+    AssetName="NightSkybox_4"
+    imageFile="@assetFile=NightSkybox_4.png"
     UseMips="true"
     UseMips="true"
     isHDRImage="false"
     isHDRImage="false"
     imageType="Albedo" />
     imageType="Albedo" />

+ 0 - 0
Templates/BaseGame/game/core/rendering/materials/skybox_4.png → Templates/BaseGame/game/core/rendering/materials/NightSkybox_4.png


+ 8 - 0
Templates/BaseGame/game/core/rendering/materials/NightSkybox_5.asset.taml

@@ -0,0 +1,8 @@
+<ImageAsset
+    canSave="true"
+    canSaveDynamicFields="true"
+    AssetName="NightSkybox_5"
+    imageFile="@assetFile=NightSkybox_5.png"
+    UseMips="true"
+    isHDRImage="false"
+    imageType="Albedo" />

+ 0 - 0
Templates/BaseGame/game/core/rendering/materials/skybox_5.png → Templates/BaseGame/game/core/rendering/materials/NightSkybox_5.png


+ 8 - 0
Templates/BaseGame/game/core/rendering/materials/NightSkybox_6.asset.taml

@@ -0,0 +1,8 @@
+<ImageAsset
+    canSave="true"
+    canSaveDynamicFields="true"
+    AssetName="NightSkybox_6"
+    imageFile="@assetFile=NightSkybox_6.png"
+    UseMips="true"
+    isHDRImage="false"
+    imageType="Albedo" />

+ 0 - 0
Templates/BaseGame/game/core/rendering/materials/skybox_6.png → Templates/BaseGame/game/core/rendering/materials/NightSkybox_6.png


+ 6 - 6
Templates/BaseGame/game/core/rendering/materials/materials.tscript

@@ -22,12 +22,12 @@
 
 
 singleton CubemapData( NightCubemap )
 singleton CubemapData( NightCubemap )
 {
 {
-   cubeFace[0] = "./skybox_1";
-   cubeFace[1] = "./skybox_2";
-   cubeFace[2] = "./skybox_3";
-   cubeFace[3] = "./skybox_4";
-   cubeFace[4] = "./skybox_5";
-   cubeFace[5] = "./skybox_6";
+   cubeFaceAsset[0] = "Core_Rendering:NightSkybox_1";
+   cubeFaceAsset[1] = "Core_Rendering:NightSkybox_2";
+   cubeFaceAsset[2] = "Core_Rendering:NightSkybox_3";
+   cubeFaceAsset[3] = "Core_Rendering:NightSkybox_4";
+   cubeFaceAsset[4] = "Core_Rendering:NightSkybox_5";
+   cubeFaceAsset[5] = "Core_Rendering:NightSkybox_6";
 };
 };
 
 
 singleton Material( NightSkyMat )
 singleton Material( NightSkyMat )

+ 0 - 8
Templates/BaseGame/game/core/rendering/materials/skybox_5.asset.taml

@@ -1,8 +0,0 @@
-<ImageAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="skybox_5"
-    imageFile="@assetFile=skybox_5.png"
-    UseMips="true"
-    isHDRImage="false"
-    imageType="Albedo" />

+ 0 - 8
Templates/BaseGame/game/core/rendering/materials/skybox_6.asset.taml

@@ -1,8 +0,0 @@
-<ImageAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="skybox_6"
-    imageFile="@assetFile=skybox_6.png"
-    UseMips="true"
-    isHDRImage="false"
-    imageType="Albedo" />

+ 0 - 2
Templates/BaseGame/game/data/ui/guis/startupGui.tscript

@@ -64,8 +64,6 @@ function StartupGui::next(%this)
    // Set us to a blank screen while we load the next one
    // Set us to a blank screen while we load the next one
    Canvas.setContent(BlankGui);
    Canvas.setContent(BlankGui);
    
    
-   %asdasd = %this.bitmap[$StartupIdx];
-
    // Set our bitmap and reset the done variable
    // Set our bitmap and reset the done variable
    %this.setBitmap(%this.bitmap[$StartupIdx]);
    %this.setBitmap(%this.bitmap[$StartupIdx]);
    %this.done = false;
    %this.done = false;

+ 0 - 7
Templates/BaseGame/game/tools/assetBrowser/guis/AssetImportConfigEditor.asset.taml

@@ -1,7 +0,0 @@
-<GUIAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="AssetImportConfigEditor"
-    scriptFile="@assetFile=AssetImportConfigEditor.gui"
-    GUIFile="@assetFile=AssetImportConfigEditor.gui"
-    VersionId="1" />

+ 0 - 7
Templates/BaseGame/game/tools/assetBrowser/guis/AssetPreviewButtonsTemplate.asset.taml

@@ -1,7 +0,0 @@
-<GUIAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="AssetPreviewButtonsTemplate"
-    scriptFile="@assetFile=assetPreviewButtonsTemplate.gui"
-    GUIFile="@assetFile=assetPreviewButtonsTemplate.gui"
-    VersionId="1" />

+ 0 - 7
Templates/BaseGame/game/tools/assetBrowser/guis/GameObjectCreator.asset.taml

@@ -1,7 +0,0 @@
-<GUIAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="GameObjectCreator"
-    scriptFile="@assetFile=GameObjectCreator.gui"
-    GUIFile="@assetFile=GameObjectCreator.gui"
-    VersionId="1" />

+ 7 - 0
Templates/BaseGame/game/tools/assetBrowser/guis/assetImportConfigEditor.asset.taml

@@ -0,0 +1,7 @@
+<GUIAsset
+    canSave="true"
+    canSaveDynamicFields="true"
+    AssetName="assetImportConfigEditor"
+    scriptFile="@assetFile=assetImportConfigEditor.gui"
+    GUIFile="@assetFile=assetImportConfigEditor.gui"
+    VersionId="1" />

+ 0 - 0
Templates/BaseGame/game/tools/assetBrowser/guis/AssetImportConfigEditor.gui → Templates/BaseGame/game/tools/assetBrowser/guis/assetImportConfigEditor.gui


+ 0 - 270
Templates/BaseGame/game/tools/assetBrowser/guis/assetPreviewButtonsTemplate.gui

@@ -1,270 +0,0 @@
-//--- OBJECT WRITE BEGIN ---
-%guiContent = new GuiControl(AssetPreviewButtonsTemplate) {
-   position = "0 0";
-   extent = "1024 768";
-   minExtent = "8 2";
-   horizSizing = "right";
-   vertSizing = "bottom";
-   profile = "GuiDefaultProfile";
-   visible = "1";
-   active = "1";
-   tooltipProfile = "GuiToolTipProfile";
-   hovertime = "1000";
-   isContainer = "1";
-   canSave = "1";
-   canSaveDynamicFields = "1";
-
-   new GuiControl() {
-      position = "0 0";
-      extent = "100 124";
-      minExtent = "8 2";
-      horizSizing = "right";
-      vertSizing = "bottom";
-      profile = "ToolsGuiDefaultProfile";
-      visible = "1";
-      active = "1";
-      tooltipProfile = "GuiToolTipProfile";
-      hovertime = "1000";
-      isContainer = "1";
-      internalName = "ShapeAssetPreviewButton";
-      canSave = "1";
-      canSaveDynamicFields = "0";
-
-      new GuiObjectView() {
-         shapeFile = "data/Blockout_Basics/Walls/DoorWall2x2.fbx";
-         mountedNode = "mount0";
-         lightColor = "1 1 1 1";
-         lightAmbient = "0.5 0.5 0.5 1";
-         lightDirection = "0 0.707 -0.707";
-         orbitDiststance = "5";
-         minOrbitDiststance = "141.715";
-         maxOrbitDiststance = "5";
-         cameraSpeed = "0.01";
-         cameraRotation = "0 0 0";
-         cameraZRot = "0";
-         forceFOV = "0";
-         reflectPriority = "0";
-         renderStyle = "standard";
-         margin = "0 0 0 0";
-         padding = "0 0 0 0";
-         anchorTop = "1";
-         anchorBottom = "0";
-         anchorLeft = "1";
-         anchorRight = "0";
-         position = "7 4";
-         extent = "80 80";
-         minExtent = "8 8";
-         horizSizing = "right";
-         vertSizing = "bottom";
-         profile = "ToolsGuiDefaultProfile";
-         visible = "1";
-         active = "1";
-         tooltipProfile = "ToolsGuiToolTipProfile";
-         hovertime = "1000";
-         isContainer = "1";
-         internalName = "shapeAssetView";
-         class = "AssetPreviewControl";
-         canSave = "1";
-         canSaveDynamicFields = "0";
-
-         new GuiBitmapButtonCtrl() {
-            bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
-            bitmapMode = "Stretched";
-            autoFitExtents = "0";
-            useModifiers = "0";
-            useStates = "1";
-            masked = "0";
-            groupNum = "0";
-            buttonType = "ToggleButton";
-            useMouseEvents = "0";
-            position = "0 0";
-            extent = "80 80";
-            minExtent = "8 2";
-            horizSizing = "right";
-            vertSizing = "bottom";
-            profile = "ToolsGuiButtonProfile";
-            visible = "1";
-            active = "1";
-            tooltipProfile = "GuiToolTipProfile";
-            hovertime = "1000";
-            isContainer = "0";
-            canSave = "1";
-            canSaveDynamicFields = "0";
-            internalName="AssetPreviewBorderButton";
-         };
-      };
-      new GuiButtonCtrl() {
-         groupNum = "0";
-         buttonType = "RadioButton";
-         useMouseEvents = "1";
-         position = "0 0";
-         extent = "100 104";
-         minExtent = "8 2";
-         horizSizing = "right";
-         vertSizing = "bottom";
-         profile = "ToolsGuiThumbHighlightButtonProfile";
-         visible = "1";
-         active = "1";
-         command = "AssetBrowser.updateSelection( $ThisControl.getParent().assetName, $ThisControl.getParent().moduleName );";
-         tooltipProfile = "GuiToolTipProfile";
-         tooltip = "\n20540";
-         hovertime = "1000";
-         isContainer = "0";
-         internalName = "Button";
-         class = "AssetPreviewButton";
-         canSave = "1";
-         canSaveDynamicFields = "0";
-      };
-      new GuiTextEditCtrl() {
-         historySize = "0";
-         tabComplete = "0";
-         sinkAllKeyEvents = "0";
-         password = "0";
-         passwordMask = "*";
-         text = "DoorWall2x2";
-         maxLength = "1024";
-         margin = "0 0 0 0";
-         padding = "0 0 0 0";
-         anchorTop = "1";
-         anchorBottom = "0";
-         anchorLeft = "1";
-         anchorRight = "0";
-         position = "0 84";
-         extent = "100 18";
-         minExtent = "8 2";
-         horizSizing = "right";
-         vertSizing = "bottom";
-         profile = "GuiTextEditProfile";
-         visible = "1";
-         active = "0";
-         tooltipProfile = "GuiToolTipProfile";
-         hovertime = "1000";
-         isContainer = "1";
-         internalName = "AssetNameLabel";
-         class = "AssetNameField";
-         canSave = "1";
-         canSaveDynamicFields = "0";
-      };
-   };
-   new GuiControl() {
-      position = "102 0";
-      extent = "100 124";
-      minExtent = "8 2";
-      horizSizing = "right";
-      vertSizing = "bottom";
-      profile = "ToolsGuiDefaultProfile";
-      visible = "1";
-      active = "1";
-      tooltipProfile = "GuiToolTipProfile";
-      hovertime = "1000";
-      isContainer = "1";
-      internalName = "GeneralAssetPreviewButton";
-      canSave = "1";
-      canSaveDynamicFields = "0";
-
-      new GuiBitmapButtonCtrl() {
-         bitmap = "Data/Blockout_Basics/Walls/WallGrid2x2_Albedo.png";
-         bitmapMode = "Stretched";
-         autoFitExtents = "0";
-         useModifiers = "0";
-         useStates = "0";
-         masked = "0";
-         groupNum = "-1";
-         buttonType = "PushButton";
-         useMouseEvents = "0";
-         position = "10 4";
-         extent = "80 80";
-         minExtent = "8 2";
-         horizSizing = "right";
-         vertSizing = "bottom";
-         profile = "ToolsGuiButtonProfile";
-         visible = "1";
-         active = "1";
-         tooltipProfile = "GuiToolTipProfile";
-         hovertime = "1000";
-         isContainer = "0";
-         internalName = "assetPreviewImage";
-         canSave = "1";
-         canSaveDynamicFields = "0";
-
-         new GuiBitmapButtonCtrl() {
-            bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
-            bitmapMode = "Stretched";
-            autoFitExtents = "0";
-            useModifiers = "0";
-            useStates = "1";
-            masked = "0";
-            groupNum = "0";
-            buttonType = "ToggleButton";
-            useMouseEvents = "0";
-            position = "0 0";
-            extent = "80 80";
-            minExtent = "8 2";
-            horizSizing = "right";
-            vertSizing = "bottom";
-            profile = "ToolsGuiButtonProfile";
-            visible = "1";
-            active = "1";
-            tooltipProfile = "GuiToolTipProfile";
-            hovertime = "1000";
-            isContainer = "0";
-            canSave = "1";
-            canSaveDynamicFields = "0";
-            internalName="AssetPreviewBorderButton";
-         };
-      };
-      new GuiButtonCtrl() {
-         groupNum = "0";
-         buttonType = "RadioButton";
-         useMouseEvents = "1";
-         position = "0 0";
-         extent = "100 104";
-         minExtent = "8 2";
-         horizSizing = "right";
-         vertSizing = "bottom";
-         profile = "ToolsGuiThumbHighlightButtonProfile";
-         visible = "1";
-         active = "1";
-         command = "AssetBrowser.updateSelection( $ThisControl.getParent().assetName, $ThisControl.getParent().moduleName );";
-         tooltipProfile = "GuiToolTipProfile";
-         tooltip = "\n20550";
-         hovertime = "1000";
-         isContainer = "0";
-         internalName = "Button";
-         class = "AssetPreviewButton";
-         canSave = "1";
-         canSaveDynamicFields = "0";
-      };
-      new GuiTextEditCtrl() {
-         historySize = "0";
-         tabComplete = "0";
-         sinkAllKeyEvents = "0";
-         password = "0";
-         passwordMask = "*";
-         text = "WallGrid2x2";
-         maxLength = "1024";
-         margin = "0 0 0 0";
-         padding = "0 0 0 0";
-         anchorTop = "1";
-         anchorBottom = "0";
-         anchorLeft = "1";
-         anchorRight = "0";
-         position = "0 84";
-         extent = "100 18";
-         minExtent = "8 2";
-         horizSizing = "right";
-         vertSizing = "bottom";
-         profile = "GuiTextEditProfile";
-         visible = "1";
-         active = "0";
-         tooltipProfile = "GuiToolTipProfile";
-         hovertime = "1000";
-         isContainer = "1";
-         internalName = "AssetNameLabel";
-         class = "AssetNameField";
-         canSave = "1";
-         canSaveDynamicFields = "0";
-      };
-   };
-};
-//--- OBJECT WRITE END ---

+ 1 - 1
Templates/BaseGame/game/tools/assetBrowser/guis/CreateNewCollectionSetCtrl.asset.taml → Templates/BaseGame/game/tools/assetBrowser/guis/createNewCollectionSetCtrl.asset.taml

@@ -1,7 +1,7 @@
 <GUIAsset
 <GUIAsset
     canSave="true"
     canSave="true"
     canSaveDynamicFields="true"
     canSaveDynamicFields="true"
-    AssetName="CreateNewCollectionSetCtrl"
+    AssetName="createNewCollectionSetCtrl"
     scriptFile="@assetFile=createNewCollectionSet.gui"
     scriptFile="@assetFile=createNewCollectionSet.gui"
     GUIFile="@assetFile=createNewCollectionSet.gui"
     GUIFile="@assetFile=createNewCollectionSet.gui"
     VersionId="1" />
     VersionId="1" />

+ 7 - 0
Templates/BaseGame/game/tools/assetBrowser/guis/gameObjectCreator.asset.taml

@@ -0,0 +1,7 @@
+<GUIAsset
+    canSave="true"
+    canSaveDynamicFields="true"
+    AssetName="gameObjectCreator"
+    scriptFile="@assetFile=gameObjectCreator.gui"
+    GUIFile="@assetFile=gameObjectCreator.gui"
+    VersionId="1" />

+ 0 - 0
Templates/BaseGame/game/tools/assetBrowser/guis/GameObjectCreator.gui → Templates/BaseGame/game/tools/assetBrowser/guis/gameObjectCreator.gui


+ 0 - 2
Templates/BaseGame/game/tools/assetBrowser/main.tscript

@@ -64,8 +64,6 @@ function initializeAssetBrowser()
    exec("./guis/selectModule.gui");
    exec("./guis/selectModule.gui");
    exec("./guis/selectPath.gui");
    exec("./guis/selectPath.gui");
    exec("./guis/editModule.gui");
    exec("./guis/editModule.gui");
-   exec("./guis/importTemplateModules.gui");
-   exec("./guis/assetPreviewButtonsTemplate.gui");
    exec("./guis/newFolder.gui");
    exec("./guis/newFolder.gui");
    exec("./guis/assetImportLog.gui");
    exec("./guis/assetImportLog.gui");
    exec("./guis/looseFileAudit.gui");
    exec("./guis/looseFileAudit.gui");

+ 1 - 10
Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript

@@ -453,15 +453,6 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
    
    
    %doubleClickCommand = "AssetBrowser.editAsset( "@%assetDesc@" );";
    %doubleClickCommand = "AssetBrowser.editAsset( "@%assetDesc@" );";
    
    
-   /*if(%assetType $= "ShapeAsset")
-   {
-      %previewButton = AssetPreviewButtonsTemplate-->ShapeAssetPreviewButton.deepClone();
-   }
-   else
-   {
-      %previewButton = AssetPreviewButtonsTemplate-->GeneralAssetPreviewButton.deepClone();
-   }*/
-   
    %textBottomPad = 20;
    %textBottomPad = 20;
    
    
    %previewButton = new GuiIconButtonCtrl()
    %previewButton = new GuiIconButtonCtrl()
@@ -517,7 +508,7 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
    %previewButton.moduleName = %moduleName;
    %previewButton.moduleName = %moduleName;
    %previewButton.assetType = %assetType;
    %previewButton.assetType = %assetType;
    
    
-   %previewButton.iconBitmap = %this.previewData.previewImage;
+   %previewButton.bitmapAsset = %this.previewData.previewImage;
    
    
    %previewButton.profile = "AssetBrowserPreview" @ %previewButton.assetType;
    %previewButton.profile = "AssetBrowserPreview" @ %previewButton.assetType;
    %previewButton.tooltip = %this.previewData.tooltip;
    %previewButton.tooltip = %this.previewData.tooltip;

+ 1 - 1
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/component.tscript

@@ -140,7 +140,7 @@ function AssetBrowser::buildComponentAssetPreview(%this, %assetDef, %previewData
    %previewData.assetPath = %assetDef.scriptFile;
    %previewData.assetPath = %assetDef.scriptFile;
    %previewData.doubleClickCommand = "EditorOpenFileInTorsion( "@%previewData.assetPath@", 0 );";
    %previewData.doubleClickCommand = "EditorOpenFileInTorsion( "@%previewData.assetPath@", 0 );";
    
    
-   %previewData.previewImage = "tools/assetBrowser/art/componentIcon";
+   %previewData.previewImage = "ToolsModule:componentIcon_image";
    
    
    %previewData.assetFriendlyName = %assetDef.friendlyName;
    %previewData.assetFriendlyName = %assetDef.friendlyName;
    %previewData.assetDesc = %assetDef.description;
    %previewData.assetDesc = %assetDef.description;

+ 1 - 1
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cpp.tscript

@@ -4,7 +4,7 @@ function AssetBrowser::buildCppPreview(%this, %assetDef, %previewData)
    %previewData.assetPath = %assetDef.codeFilePath;
    %previewData.assetPath = %assetDef.codeFilePath;
    %previewData.doubleClickCommand = "echo(\"Not yet implemented to edit C++ files from the editor\");";//"EditorOpenFileInTorsion( "@%previewData.assetPath@", 0 );";
    %previewData.doubleClickCommand = "echo(\"Not yet implemented to edit C++ files from the editor\");";//"EditorOpenFileInTorsion( "@%previewData.assetPath@", 0 );";
    
    
-   %previewData.previewImage = "tools/assetBrowser/art/cppIcon";
+   %previewData.previewImage = "ToolsModule:cppIcon_image";
    
    
    %previewData.assetFriendlyName = %assetDef.assetName;
    %previewData.assetFriendlyName = %assetDef.assetName;
    %previewData.assetDesc = %assetDef.description;
    %previewData.assetDesc = %assetDef.description;

+ 1 - 1
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/creatorObj.tscript

@@ -7,7 +7,7 @@ function AssetBrowser::buildCreatorPreview(%this, %assetDef, %previewData)
    %previewData.assetName = %name;
    %previewData.assetName = %name;
    %previewData.assetPath = "";
    %previewData.assetPath = "";
    
    
-   %previewData.previewImage = "tools/classIcons/" @ %class;
+   %previewData.previewImage = "ToolsModule:" @ %class @ "_image";
    
    
    //%previewData.assetFriendlyName = %assetDef.assetName;
    //%previewData.assetFriendlyName = %assetDef.assetName;
    %previewData.assetDesc = %assetDef;
    %previewData.assetDesc = %assetDef;

+ 1 - 1
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/datablockObjects.tscript

@@ -45,7 +45,7 @@ function AssetBrowser::buildDatablockPreview(%this, %assetDef, %previewData)
    %previewData.assetName = %assetDef;
    %previewData.assetName = %assetDef;
    %previewData.assetPath = "";
    %previewData.assetPath = "";
    
    
-   %previewData.previewImage = "tools/assetBrowser/art/datablockIcon";
+   %previewData.previewImage = "ToolsModule:datablockIcon_image";
    
    
    //Lets see if we have a icon for specifically for this datablock type
    //Lets see if we have a icon for specifically for this datablock type
    %dataClass = %assetDef.getClassName();
    %dataClass = %assetDef.getClassName();

+ 1 - 1
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/folder.tscript

@@ -58,7 +58,7 @@ function AssetBrowser::buildFolderPreview(%this, %assetDef, %previewData)
    %previewData.assetName = %assetDef.assetName;
    %previewData.assetName = %assetDef.assetName;
    %previewData.assetPath = %assetDef.dirPath;
    %previewData.assetPath = %assetDef.dirPath;
    
    
-   %previewData.previewImage = "tools/assetBrowser/art/folderIcon";
+   %previewData.previewImage = "ToolsModule:FolderIcon_image";
    
    
    //%previewData.assetFriendlyName = %assetDef.assetName;
    //%previewData.assetFriendlyName = %assetDef.assetName;
    %previewData.assetDesc = %assetDef.description;
    %previewData.assetDesc = %assetDef.description;

+ 1 - 1
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/gameObject.tscript

@@ -265,7 +265,7 @@ function AssetBrowser::buildGameObjectAssetPreview(%this, %assetDef, %previewDat
    %previewData.assetPath = %assetDef.scriptFile;
    %previewData.assetPath = %assetDef.scriptFile;
    %previewData.doubleClickCommand = "EditorOpenFileInTorsion( "@%previewData.assetPath@", 0 );";
    %previewData.doubleClickCommand = "EditorOpenFileInTorsion( "@%previewData.assetPath@", 0 );";
    
    
-   %previewData.previewImage = "tools/assetBrowser/art/gameObjectIcon";
+   %previewData.previewImage = "ToolsModule:gameObjectIcon_image";
    
    
    %previewData.assetFriendlyName = %assetDef.gameObjectName;
    %previewData.assetFriendlyName = %assetDef.gameObjectName;
    %previewData.assetDesc = %assetDef.description;
    %previewData.assetDesc = %assetDef.description;

+ 1 - 1
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/gui.tscript

@@ -171,7 +171,7 @@ function AssetBrowser::buildGUIAssetPreview(%this, %assetDef, %previewData)
    %previewData.assetPath = %assetDef.GUIFilePath;
    %previewData.assetPath = %assetDef.GUIFilePath;
    %previewData.doubleClickCommand = "";
    %previewData.doubleClickCommand = "";
    
    
-   %previewData.previewImage = "tools/assetBrowser/art/guiIcon";
+   %previewData.previewImage = "ToolsModule:guiIcon_image";
    
    
    %previewData.assetFriendlyName = %assetDef.assetName;
    %previewData.assetFriendlyName = %assetDef.assetName;
    %previewData.assetDesc = %assetDef.description;
    %previewData.assetDesc = %assetDef.description;

+ 1 - 1
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/level.tscript

@@ -142,7 +142,7 @@ function AssetBrowser::buildLevelAssetPreview(%this, %assetDef, %previewData)
    if(isFile(%levelPreviewImage))
    if(isFile(%levelPreviewImage))
       %previewData.previewImage = %levelPreviewImage;
       %previewData.previewImage = %levelPreviewImage;
    else
    else
-      %previewData.previewImage = "tools/assetBrowser/art/levelIcon";
+      %previewData.previewImage = "ToolsModule:levelIcon_image";
    
    
    %previewData.assetFriendlyName = %assetDef.assetName;
    %previewData.assetFriendlyName = %assetDef.assetName;
    %previewData.assetDesc = %assetDef.description;
    %previewData.assetDesc = %assetDef.description;

+ 1 - 1
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/looseFiles.tscript

@@ -4,7 +4,7 @@ function AssetBrowser::buildLooseFilePreview(%this, %assetDef, %previewData)
    %previewData.assetName = %assetDef.assetName;
    %previewData.assetName = %assetDef.assetName;
    %previewData.assetPath = %fullPath;
    %previewData.assetPath = %fullPath;
    
    
-   %previewData.previewImage = "tools/assetBrowser/art/looseFileIcon";
+   %previewData.previewImage = "ToolsModule:looseFileIcon_image";
    
    
    //%previewData.assetFriendlyName = %assetDef.assetName;
    //%previewData.assetFriendlyName = %assetDef.assetName;
    %previewData.assetDesc = %assetDef.description;
    %previewData.assetDesc = %assetDef.description;

+ 2 - 2
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.tscript

@@ -347,7 +347,7 @@ function AssetBrowser::importMaterialAsset(%this, %assetItem)
       %depAssetType = %childAssetItem.assetType;
       %depAssetType = %childAssetItem.assetType;
       if(%depAssetType $= "ImageAsset")
       if(%depAssetType $= "ImageAsset")
       {
       {
-         %matSet = "%newAsset.imageMap"@%dependencySlotId@"=\"@Asset="@%moduleName@":"@%childAssetItem.assetName@"\";";
+         %matSet = "%newAsset.imageMap"@%dependencySlotId@"=\"@asset="@%moduleName@":"@%childAssetItem.assetName@"\";";
          eval(%matSet);
          eval(%matSet);
          %dependencySlotId++;
          %dependencySlotId++;
       }
       }
@@ -461,7 +461,7 @@ function AssetBrowser::buildMaterialAssetPreview(%this, %assetDef, %previewData)
       %previewData.previewImage = %imgAsset.getImagePath();
       %previewData.previewImage = %imgAsset.getImagePath();
    }
    }
    else
    else
-      %previewData.previewImage = "tools/assetBrowser/art/materialIcon";
+      %previewData.previewImage = "tools/assetBrowser/art/materialIcon_image";
    
    
    %previewData.assetFriendlyName = %assetDef.assetName;
    %previewData.assetFriendlyName = %assetDef.assetName;
    %previewData.assetDesc = %assetDef.description;
    %previewData.assetDesc = %assetDef.description;

+ 1 - 1
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/postFX.tscript

@@ -161,7 +161,7 @@ function AssetBrowser::buildPostEffectAssetPreview(%this, %assetDef, %previewDat
    %previewData.assetPath = %assetDef.scriptFilePath;
    %previewData.assetPath = %assetDef.scriptFilePath;
    %previewData.doubleClickCommand = "";
    %previewData.doubleClickCommand = "";
    
    
-   %previewData.previewImage = "tools/assetBrowser/art/postEffectIcon";
+   %previewData.previewImage = "ToolsModule:postEffectIcon_image";
    
    
    %previewData.assetFriendlyName = %assetDef.assetName;
    %previewData.assetFriendlyName = %assetDef.assetName;
    %previewData.assetDesc = %assetDef.description;
    %previewData.assetDesc = %assetDef.description;

+ 1 - 1
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/prefab.tscript

@@ -21,7 +21,7 @@ function AssetBrowser::buildPrefabPreview(%this, %assetDef, %previewData)
    %previewData.assetName = %assetDef.assetName;
    %previewData.assetName = %assetDef.assetName;
    %previewData.assetPath = %fullPath;
    %previewData.assetPath = %fullPath;
    
    
-   %previewData.previewImage = "tools/assetBrowser/art/genericAssetIcon";
+   %previewData.previewImage = "ToolsModule:genericAssetIcon_image";
    
    
    //%previewData.assetFriendlyName = %assetDef.assetName;
    //%previewData.assetFriendlyName = %assetDef.assetName;
    %previewData.assetDesc = %assetDef.description;
    %previewData.assetDesc = %assetDef.description;

+ 2 - 2
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/script.tscript

@@ -97,9 +97,9 @@ function AssetBrowser::buildTScriptPreview(%this, %assetDef, %previewData)
    %previewData.doubleClickCommand = "EditorOpenFileInTorsion( \""@%previewData.assetPath@"\", 0 );";
    %previewData.doubleClickCommand = "EditorOpenFileInTorsion( \""@%previewData.assetPath@"\", 0 );";
    
    
    if(%assetDef.isServerSide)
    if(%assetDef.isServerSide)
-      %previewData.previewImage = "tools/assetBrowser/art/serverScriptIcon";
+      %previewData.previewImage = "ToolsModule:serverScriptIcon_image";
    else
    else
-      %previewData.previewImage = "tools/assetBrowser/art/clien" @ $TorqueScriptFileExtension @ "Icon";
+      %previewData.previewImage = "ToolsModule:clientScriptIcon_image";
    
    
    %previewData.assetFriendlyName = %assetDef.assetName;
    %previewData.assetFriendlyName = %assetDef.assetName;
    %previewData.assetDesc = %assetDef.description;
    %previewData.assetDesc = %assetDef.description;

+ 22 - 8
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.tscript

@@ -143,13 +143,13 @@ function AssetBrowser::importShapeAsset(%this, %assetItem)
       %depAssetType = %childAssetItem.assetType;
       %depAssetType = %childAssetItem.assetType;
       if(%childAssetItem.assetType $= "MaterialAsset")
       if(%childAssetItem.assetType $= "MaterialAsset")
       {
       {
-         %matSet = "%newAsset.materialSlot"@%dependencySlotId@"=\"@Asset="@%moduleName@":"@%childAssetItem.assetName@"\";";
+         %matSet = "%newAsset.materialSlot"@%dependencySlotId@"=\"@asset="@%moduleName@":"@%childAssetItem.assetName@"\";";
          eval(%matSet);
          eval(%matSet);
          %dependencySlotId++;
          %dependencySlotId++;
       }
       }
       else if(%depAssetType $= "AnimationAsset")
       else if(%depAssetType $= "AnimationAsset")
       {
       {
-         %matSet = "%newAsset.animationSequence"@%dependencySlotId@"=\"@Asset="@%moduleName@":"@%childAssetItem.assetName@"\";";
+         %matSet = "%newAsset.animationSequence"@%dependencySlotId@"=\"@asset="@%moduleName@":"@%childAssetItem.assetName@"\";";
          eval(%matSet);
          eval(%matSet);
          %dependencySlotId++;
          %dependencySlotId++;
       }
       }
@@ -252,8 +252,8 @@ function AssetBrowser::buildShapeAssetPreview(%this, %assetDef, %previewData)
       %this.dirHandler.createFolder(%previewPath);
       %this.dirHandler.createFolder(%previewPath);
    }
    }
    
    
-   %previewPath = %previewPath @ %assetDef.assetName @ "_Preview.png";
-   if(!isFile(%previewPath))
+   %previewFilePath = %previewPath @ %assetDef.assetName @ "_Preview.png";
+   if(!isFile(%previewFilePath))
    {
    {
       displayEditorLoadingGui("Generating Shape Asset Preview...");
       displayEditorLoadingGui("Generating Shape Asset Preview...");
       
       
@@ -265,7 +265,7 @@ function AssetBrowser::buildShapeAssetPreview(%this, %assetDef, %previewData)
       %filePath = %assetDef.generateCachedPreviewImage();
       %filePath = %assetDef.generateCachedPreviewImage();
       
       
       %imposterPath = %filePath @ ".imposter.png";
       %imposterPath = %filePath @ ".imposter.png";
-      pathCopy(%imposterPath, %previewPath);
+      pathCopy(%imposterPath, %previewFilePath);
       
       
       //cleanup
       //cleanup
       fileDelete(%imposterPath);
       fileDelete(%imposterPath);
@@ -275,17 +275,31 @@ function AssetBrowser::buildShapeAssetPreview(%this, %assetDef, %previewData)
       
       
       $TSLastDetail::dumpImposters = %oldImposterSetting;
       $TSLastDetail::dumpImposters = %oldImposterSetting;
       
       
+      %newAsset = new ImageAsset()
+      {
+         assetName = %assetDef.assetName @ "_PreviewImage";
+         versionId = 1;
+         imageFile = fileName(%previewFilePath);
+      };
+      
+      %previewImgAssetPath = %previewPath @ %newAsset.assetName @ ".asset.taml";
+      %assetImportSuccessful = TAMLWrite(%newAsset, %previewImgAssetPath); 
+      
+      %toolsModuleDef = ModuleDatabase.findModule("ToolsModule",1);
+         
+      %success = AssetDatabase.addDeclaredAsset(%toolsModuleDef, %previewImgAssetPath);
+      
       hideEditorLoadingGui();
       hideEditorLoadingGui();
    }
    }
    
    
    //Revalidate. If it didn't work, just use the default placeholder one
    //Revalidate. If it didn't work, just use the default placeholder one
-   if(!isFile(%previewPath))
-      %previewPath = "tools/assetBrowser/art/genericAssetIcon";
+   if(!isFile(%previewFilePath))
+      %previewFilePath = "ToolsModule:genericAssetIcon_image";
    
    
    %previewData.assetName = %assetDef.assetName;
    %previewData.assetName = %assetDef.assetName;
    %previewData.assetPath = %assetDef.fileName;
    %previewData.assetPath = %assetDef.fileName;
 
 
-   %previewData.previewImage = %previewPath;//%assetDef.fileName;
+   %previewData.previewImage = "ToolsModule:" @ %assetDef.assetName @ "_PreviewImage";//%assetDef.fileName;
    
    
    %previewData.assetFriendlyName = %assetDef.assetName;
    %previewData.assetFriendlyName = %assetDef.assetName;
    %previewData.assetDesc = %assetDef.description;
    %previewData.assetDesc = %assetDef.description;

+ 1 - 1
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shapeAnimation.tscript

@@ -47,7 +47,7 @@ function AssetBrowser::buildShapeAnimationAssetPreview(%this, %assetDef, %previe
                                    @ "EditorGui.setEditor(MaterialEditorPlugin); "
                                    @ "EditorGui.setEditor(MaterialEditorPlugin); "
                                    @ "AssetBrowser.hideDialog();";*/
                                    @ "AssetBrowser.hideDialog();";*/
    
    
-   %previewData.previewImage = "tools/assetBrowser/art/animationIcon";
+   %previewData.previewImage = "ToolsModule:animationIcon_image";
    
    
    %previewData.assetFriendlyName = %assetDef.assetName;
    %previewData.assetFriendlyName = %assetDef.assetName;
    %previewData.assetDesc = %assetDef.description;
    %previewData.assetDesc = %assetDef.description;

+ 1 - 1
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/sound.tscript

@@ -9,7 +9,7 @@ function AssetBrowser::buildSoundAssetPreview(%this, %assetDef, %previewData)
    else
    else
       %previewData.doubleClickCommand = "AssetBrowser.editAsset( "@%assetDef@" );";
       %previewData.doubleClickCommand = "AssetBrowser.editAsset( "@%assetDef@" );";
    
    
-   %previewData.previewImage = "tools/assetBrowser/art/soundIcon";   
+   %previewData.previewImage = "ToolsModule:soundIcon_image";   
    
    
    %previewData.assetFriendlyName = %assetDef.assetName;
    %previewData.assetFriendlyName = %assetDef.assetName;
    %previewData.assetDesc = %assetDef.description;
    %previewData.assetDesc = %assetDef.description;

+ 1 - 1
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/stateMachine.tscript

@@ -166,7 +166,7 @@ function AssetBrowser::buildStateMachineAssetPreview(%this, %assetDef, %previewD
    %previewData.assetPath = %assetDef.scriptFile;
    %previewData.assetPath = %assetDef.scriptFile;
    %previewData.doubleClickCommand = "AssetBrowser.editStateMachineAsset( "@%assetDef@" );";
    %previewData.doubleClickCommand = "AssetBrowser.editStateMachineAsset( "@%assetDef@" );";
    
    
-   %previewData.previewImage = "tools/assetBrowser/art/stateMachineIcon";
+   %previewData.previewImage = "ToolsModule:stateMachineIcon_image";
    
    
    %previewData.assetFriendlyName = %assetDef.friendlyName;
    %previewData.assetFriendlyName = %assetDef.friendlyName;
    %previewData.assetDesc = %assetDef.description;
    %previewData.assetDesc = %assetDef.description;

+ 1 - 1
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.tscript

@@ -162,7 +162,7 @@ function AssetBrowser::buildTerrainAssetPreview(%this, %assetDef, %previewData)
    %previewData.assetPath = "";
    %previewData.assetPath = "";
    %previewData.doubleClickCommand = "";
    %previewData.doubleClickCommand = "";
    
    
-   %previewData.previewImage = "tools/assetBrowser/art/gameObjectIcon";
+   %previewData.previewImage = "ToolsModule:gameObjectIcon_image";
    
    
    %previewData.assetFriendlyName = %assetDef.gameObjectName;
    %previewData.assetFriendlyName = %assetDef.gameObjectName;
    %previewData.assetDesc = %assetDef.description;
    %previewData.assetDesc = %assetDef.description;

+ 1 - 1
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrainMaterial.tscript

@@ -97,7 +97,7 @@ function AssetBrowser::buildTerrainMaterialAssetPreview(%this, %assetDef, %previ
    %previewData.assetPath = "";
    %previewData.assetPath = "";
    %previewData.doubleClickCommand = "";
    %previewData.doubleClickCommand = "";
    
    
-   %previewData.previewImage = "tools/assetBrowser/art/terrainMaterialIcon";
+   %previewData.previewImage = "ToolsModule:terrainMaterialIcon_image";
    
    
    %previewData.assetFriendlyName = %assetDef.gameObjectName;
    %previewData.assetFriendlyName = %assetDef.gameObjectName;
    %previewData.assetDesc = %assetDef.description;
    %previewData.assetDesc = %assetDef.description;

+ 2 - 2
Templates/BaseGame/game/tools/assetBrowser/scripts/directoryHandling.tscript

@@ -188,8 +188,8 @@ function directoryHandler::getModuleFromAddress(%this, %address)
       %modulePath = makeRelativePath(%module.ModulePath);
       %modulePath = makeRelativePath(%module.ModulePath);
       
       
       //We don't want to add stuff directly to the root core or tools modules
       //We don't want to add stuff directly to the root core or tools modules
-      if(%modulePath $= "Core" || %modulePath $= "Tools")
-         continue;
+      //if(%modulePath $= "Core" || %modulePath $= "Tools")
+      //   continue;
          
          
       if(startsWith(%address, %modulePath))
       if(startsWith(%address, %modulePath))
       {
       {

+ 1 - 1
Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.tscript

@@ -28,7 +28,7 @@ function AssetBrowser::editAsset(%this, %assetDef)
          }
          }
       }
       }
    }
    }
-   else if(!isObject(%assetDef) && strchrpos(%assetDef, ":") != -1)
+   else if(AssetDatabase.isDeclaredAsset(%assetDef))
    {
    {
       //Turns out we were passed an assetid, not an asset definition. 
       //Turns out we were passed an assetid, not an asset definition. 
       //Grab the asset def from that  
       //Grab the asset def from that  

+ 6 - 0
Templates/BaseGame/game/tools/assetBrowser/scripts/selectModule.tscript

@@ -1,3 +1,9 @@
+function AssetBrowser_SelectModule::showDialog(%this, %callback)
+{
+   AssetBrowser_SelectModule.callback = %callback;
+   Canvas.pushDialog(AssetBrowser_SelectModule);
+}
+
 function AssetBrowser_SelectModule::onWake(%this)
 function AssetBrowser_SelectModule::onWake(%this)
 {
 {
    AssetBrowser_SelectModuleWindow-->ModuleList.refresh();
    AssetBrowser_SelectModuleWindow-->ModuleList.refresh();

+ 11 - 0
Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/module.tscript.template

@@ -14,6 +14,17 @@ function @@::initServer(%this)
 //This is called when the server is created for an actual game/map to be played
 //This is called when the server is created for an actual game/map to be played
 function @@::onCreateGameServer(%this)
 function @@::onCreateGameServer(%this)
 {
 {
+    //These are common managed data files. For any datablock-based stuff that gets generated by the editors
+    //(that doesn't have a specific associated file, like data for a player class) will go into these.
+    //So we'll register them now if they exist.
+    if(isFile("./scripts/managedData/managedDatablocks." @ $TorqueScriptFileExtension))
+        %this.registerDatablock("./scripts/managedData/managedDatablocks");
+    if(isFile("./scripts/managedData/managedForestItemData." @ $TorqueScriptFileExtension))
+        %this.registerDatablock("./scripts/managedData/managedForestItemData");
+    if(isFile("./scripts/managedData/managedParticleEmitterData." @ $TorqueScriptFileExtension))
+        %this.registerDatablock("./scripts/managedData/managedParticleEmitterData");
+    if(isFile("./scripts/managedData/managedParticleData." @ $TorqueScriptFileExtension))
+        %this.registerDatablock("./scripts/managedData/managedParticleData");
 }
 }
 
 
 //This is called when the server is shut down due to the game/map being exited
 //This is called when the server is shut down due to the game/map being exited

+ 3 - 3
Templates/BaseGame/game/tools/componentEditor/main.tscript

@@ -21,13 +21,13 @@
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
 //Scripts
 //Scripts
-exec("./scripts/componentEditor.ed." @ $TorqueScriptFileExtension);
-exec("./scripts/stateMachineEditor.ed." @ $TorqueScriptFileExtension);
+//exec("./scripts/componentEditor.ed." @ $TorqueScriptFileExtension);
+//exec("./scripts/stateMachineEditor.ed." @ $TorqueScriptFileExtension);
 exec("./scripts/superToolTipDlg.ed." @ $TorqueScriptFileExtension);
 exec("./scripts/superToolTipDlg.ed." @ $TorqueScriptFileExtension);
 
 
 //gui
 //gui
 exec("./gui/superToolTipDlg.ed.gui");
 exec("./gui/superToolTipDlg.ed.gui");
-exec("./gui/stateMachineDlg.ed.gui");
+//exec("./gui/stateMachineDlg.ed.gui");
 
 
 //field types
 //field types
 exec("./interface/materialFieldType." @ $TorqueScriptFileExtension);
 exec("./interface/materialFieldType." @ $TorqueScriptFileExtension);

+ 7 - 4
Templates/BaseGame/game/tools/datablockEditor/datablockEditor.tscript

@@ -676,13 +676,16 @@ function DatablockEditorPlugin::createDatablock(%this)
 //---------------------------------------------------------------------------------------------
 //---------------------------------------------------------------------------------------------
 function DatablockEditorPlugin::pickDatablockPath(%this)
 function DatablockEditorPlugin::pickDatablockPath(%this)
 {
 {
-   SelectAssetPath.showDialog(AssetBrowser.dirHandler.currentAddress, "DatablockEditorPlugin.pickedNewDBPath", "Select New Datablock Path");
-   SelectAssetPathWindow.selectWindow();   
+   AssetBrowser_SelectModule.showDialog("DatablockEditorPlugin.pickedNewDBTargetModule");
+   //SelectAssetPath.showDialog(AssetBrowser.dirHandler.currentAddress, "DatablockEditorPlugin.pickedNewDBPath", "Select New Datablock Path");
+   AssetBrowser_SelectModuleWindow.selectWindow();   
 }
 }
 
 
-function DatablockEditorPlugin::pickedNewDBPath(%this, %path)
+function DatablockEditorPlugin::pickedNewDBTargetModule(%this, %module)
 {
 {
-   $DATABLOCK_EDITOR_DEFAULT_FILENAME = %path @ "/managedDatablocks." @ $TorqueScriptFileExtension;
+   %moduleDef = ModuleDatabase.findModule(%module);
+   
+   $DATABLOCK_EDITOR_DEFAULT_FILENAME = %moduleDef.ModulePath @ "/scripts/managedData/managedDatablocks." @ $TorqueScriptFileExtension;
    DatablockEditorPlugin.createDatablock();
    DatablockEditorPlugin.createDatablock();
 }
 }
 
 

+ 9 - 0
Templates/BaseGame/game/tools/decalEditor/decalEditorGui.tscript

@@ -158,6 +158,15 @@ function RetargetDecalButton::onClick( %this )
 
 
 function NewDecalButton::onClick( %this )
 function NewDecalButton::onClick( %this )
 {  
 {  
+   AssetBrowser_SelectModule.showDialog("DecalEditorGui.pickedNewDecalTargetModule");
+   AssetBrowser_SelectModuleWindow.selectWindow();
+}
+
+function DecalEditorGui::pickedNewDecalTargetModule(%this, %module)
+{
+   %moduleDef = ModuleDatabase.findModule(%module);
+   $decalDataFile = %moduleDef.ModulePath @ "/scripts/managedData/managedDecalData." @ $TorqueScriptFileExtension;
+   
    %name = getUniqueName( "NewDecalData" );
    %name = getUniqueName( "NewDecalData" );
    
    
    %str = "datablock DecalData( " @ %name @ " ) { Material = \"WarningMaterial\"; };";            
    %str = "datablock DecalData( " @ %name @ " ) { Material = \"WarningMaterial\"; };";            

+ 1 - 1
Templates/BaseGame/game/tools/decalEditor/main.tscript

@@ -24,7 +24,7 @@ function initializeDecalEditor()
 {
 {
    echo(" % - Initializing Decal Editor");
    echo(" % - Initializing Decal Editor");
    
    
-   $decalDataFile = "art/decals/managedDecalData." @ $TorqueScriptFileExtension;
+   $decalDataFile = "data/managedDecalData." @ $TorqueScriptFileExtension;
      
      
    exec( "./decalEditor." @ $TorqueScriptFileExtension );
    exec( "./decalEditor." @ $TorqueScriptFileExtension );
    exec( "./decalEditorGui.gui" );
    exec( "./decalEditorGui.gui" );

+ 3 - 1
Templates/BaseGame/game/tools/forestEditor/brushes.tscript

@@ -20,6 +20,8 @@
 // IN THE SOFTWARE.
 // IN THE SOFTWARE.
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
+//--- OBJECT WRITE BEGIN ---
 %forestBrushesGroup = new SimGroup( ForestBrushGroup )
 %forestBrushesGroup = new SimGroup( ForestBrushGroup )
 {
 {
-};
+};
+//--- OBJECT WRITE END ---

+ 9 - 7
Templates/BaseGame/game/tools/forestEditor/forestEditorGui.tscript

@@ -171,13 +171,15 @@ function ForestEditorGui::deleteBrushOrElement( %this )
 
 
 function ForestEditorGui::newMesh( %this )
 function ForestEditorGui::newMesh( %this )
 {
 {
-   SelectAssetPath.showDialog(AssetBrowser.dirHandler.currentAddress, "createNewForestMesh", "Select Forest Mesh Datablock Path");
-   SelectAssetPathWindow.selectWindow();
+   AssetBrowser_SelectModule.showDialog("ForestEditorGui.pickedNewMeshTargetModule");
+   AssetBrowser_SelectModuleWindow.selectWindow();
 }
 }
 
 
-function createNewForestMesh(%newPath)
+function ForestEditorGui::pickedNewMeshTargetModule(%this, %module)
 {
 {
-   ForestEditorGui.newMeshPath = %newPath;
+   %moduleDef = ModuleDatabase.findModule(%module);
+    
+   ForestEditorGui.forestItemDataPath = %moduleDef.ModulePath @ "/scripts/managedData/managedForestItemData." @ $TorqueScriptFileExtension;
    AssetBrowser.showDialog("ShapeAsset", "selectNewForestMesh", "", "", "");
    AssetBrowser.showDialog("ShapeAsset", "selectNewForestMesh", "", "", "");
 }
 }
 
 
@@ -212,10 +214,10 @@ function selectNewForestMesh(%selectedShapeAssetId)
    //%str = "datablock TSForestItemData( " @ %name @ " ) { shapeFile = \"" @ %fullPath @ "\"; };";            
    //%str = "datablock TSForestItemData( " @ %name @ " ) { shapeFile = \"" @ %fullPath @ "\"; };";            
    //eval( %str );
    //eval( %str );
    
    
-   %fullPath = AssetDatabase.acquireAsset(%selectedShapeAssetId).getShapeFile();
+   //%fullPath = AssetDatabase.acquireAsset(%selectedShapeAssetId).getShapeFile();
    
    
    new TSForestItemData(%name) {
    new TSForestItemData(%name) {
-      shapeFile = %fullPath;
+      shapeAsset = %selectedShapeAssetId;
    };
    };
    
    
    %isrl = isObject( %name );
    %isrl = isObject( %name );
@@ -228,7 +230,7 @@ function selectNewForestMesh(%selectedShapeAssetId)
       ForestEditMeshTree.scrollVisible( %item );
       ForestEditMeshTree.scrollVisible( %item );
       ForestEditMeshTree.addSelection( %item );
       ForestEditMeshTree.addSelection( %item );
       
       
-      ForestDataManager.setDirty( %name, ForestEditorGui.newMeshPath @ "/managedForestItemData." @ $TorqueScriptFileExtension );  
+      ForestDataManager.setDirty( %name, ForestEditorGui.forestItemDataPath );  
       
       
       %element = new ForestBrushElement()
       %element = new ForestBrushElement()
       {
       {

+ 0 - 1
Templates/BaseGame/game/tools/gui/guiDialogs.ed.tscript

@@ -34,7 +34,6 @@ exec("./GuiEaseEditDlg.ed." @ $TorqueScriptFileExtension);
 exec("./guiObjectInspector.ed." @ $TorqueScriptFileExtension);
 exec("./guiObjectInspector.ed." @ $TorqueScriptFileExtension);
 exec("./uvEditor.ed.gui");
 exec("./uvEditor.ed.gui");
 exec("./objectSelection.ed." @ $TorqueScriptFileExtension);
 exec("./objectSelection.ed." @ $TorqueScriptFileExtension);
-exec("./postFxManager.gui");
 exec("./assimpImport.ed.gui");
 exec("./assimpImport.ed.gui");
 
 
 exec("./fieldTypes/assetDependencies." @ $TorqueScriptFileExtension);
 exec("./fieldTypes/assetDependencies." @ $TorqueScriptFileExtension);

+ 1 - 1
Templates/BaseGame/game/tools/guiEditor/gui/EditorChooseGUI.ed.gui

@@ -13,7 +13,7 @@
    Visible = "1";
    Visible = "1";
    tooltipprofile = "ToolsGuiToolTipProfile";
    tooltipprofile = "ToolsGuiToolTipProfile";
    hovertime = "1000";
    hovertime = "1000";
-   bitmap = "art/gui/background";
+   bitmap = "data/ui/images/background.png";
    useVariable = "0";
    useVariable = "0";
    tile = "0";
    tile = "0";
 
 

+ 16 - 16
Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui

@@ -821,7 +821,7 @@
                            MinExtent = "8 2";
                            MinExtent = "8 2";
                            canSave = "1";
                            canSave = "1";
                            Visible = "1";
                            Visible = "1";
-                           Command = "MaterialEditorGui.updateORMConfigMap(1);";
+                           Command = "MaterialEditorGui.updateTextureMap(\"ORMConfig\",1);";
                            tooltipprofile = "ToolsGuiDefaultProfile";
                            tooltipprofile = "ToolsGuiDefaultProfile";
                            ToolTip = "Change the packed spec map for this layer. \n Roughness (R), Ambient Occlusion (G), and Metalness(B))";
                            ToolTip = "Change the packed spec map for this layer. \n Roughness (R), Ambient Occlusion (G), and Metalness(B))";
                            hovertime = "1000";
                            hovertime = "1000";
@@ -861,7 +861,7 @@
                            position = "134 34";
                            position = "134 34";
                            Extent = "40 16";
                            Extent = "40 16";
                            buttonType = "PushButton";
                            buttonType = "PushButton";
-                           command="MaterialEditorGui.updateORMConfigMap(1);";
+                           Command = "MaterialEditorGui.updateTextureMap(\"ORMConfig\",1);";
                         };
                         };
                         new GuiBitmapButtonCtrl() {
                         new GuiBitmapButtonCtrl() {
                            canSaveDynamicFields = "0";
                            canSaveDynamicFields = "0";
@@ -875,7 +875,7 @@
                            MinExtent = "8 2";
                            MinExtent = "8 2";
                            canSave = "1";
                            canSave = "1";
                            Visible = "1";
                            Visible = "1";
-                           Command = "MaterialEditorGui.updateORMConfigMap(0);";
+                           Command = "MaterialEditorGui.updateTextureMap(\"ORMConfig\",0);";
                            hovertime = "1000";
                            hovertime = "1000";
                            groupNum = "-1";
                            groupNum = "-1";
                            buttonType = "PushButton";
                            buttonType = "PushButton";
@@ -1049,7 +1049,7 @@
 						 profile = "ToolsGuiButtonProfile";
 						 profile = "ToolsGuiButtonProfile";
 						 visible = "1";
 						 visible = "1";
 						 active = "1";
 						 active = "1";
-						 command = "MaterialEditorGui.updateroughMap(1);";
+						 Command = "MaterialEditorGui.updateTextureMap(\"rough\",1);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 tooltipProfile = "GuiToolTipProfile";
 						 tooltip = "Change the Roughness map for this layer.";
 						 tooltip = "Change the Roughness map for this layer.";
 						 hovertime = "1000";
 						 hovertime = "1000";
@@ -1094,7 +1094,7 @@
 						 profile = "ToolsGuiButtonProfile";
 						 profile = "ToolsGuiButtonProfile";
 						 visible = "1";
 						 visible = "1";
 						 active = "1";
 						 active = "1";
-						 command = "MaterialEditorGui.updateroughMap(1);";
+						 Command = "MaterialEditorGui.updateTextureMap(\"rough\",1);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 hovertime = "1000";
 						 isContainer = "0";
 						 isContainer = "0";
@@ -1118,7 +1118,7 @@
 						 profile = "ToolsGuiButtonProfile";
 						 profile = "ToolsGuiButtonProfile";
 						 visible = "1";
 						 visible = "1";
 						 active = "1";
 						 active = "1";
-						 command = "MaterialEditorGui.updateroughMap(0);";
+						 Command = "MaterialEditorGui.updateTextureMap(\"rough\",0);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 hovertime = "1000";
 						 isContainer = "0";
 						 isContainer = "0";
@@ -1285,7 +1285,7 @@
 						 profile = "ToolsGuiButtonProfile";
 						 profile = "ToolsGuiButtonProfile";
 						 visible = "1";
 						 visible = "1";
 						 active = "1";
 						 active = "1";
-						 command = "MaterialEditorGui.updateaoMap(1);";
+						 Command = "MaterialEditorGui.updateTextureMap(\"ao\",1);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 tooltipProfile = "GuiToolTipProfile";
 						 tooltip = "Change the AO map for this layer.";
 						 tooltip = "Change the AO map for this layer.";
 						 hovertime = "1000";
 						 hovertime = "1000";
@@ -1330,7 +1330,7 @@
 						 profile = "ToolsGuiButtonProfile";
 						 profile = "ToolsGuiButtonProfile";
 						 visible = "1";
 						 visible = "1";
 						 active = "1";
 						 active = "1";
-						 command = "MaterialEditorGui.updateaoMap(1);";
+						 Command = "MaterialEditorGui.updateTextureMap(\"ao\",1);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 hovertime = "1000";
 						 isContainer = "0";
 						 isContainer = "0";
@@ -1354,7 +1354,7 @@
 						 profile = "ToolsGuiButtonProfile";
 						 profile = "ToolsGuiButtonProfile";
 						 visible = "1";
 						 visible = "1";
 						 active = "1";
 						 active = "1";
-						 command = "MaterialEditorGui.updateaoMap(0);";
+						 Command = "MaterialEditorGui.updateTextureMap(\"ao\",0);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 hovertime = "1000";
 						 isContainer = "0";
 						 isContainer = "0";
@@ -1521,7 +1521,7 @@
 						 profile = "ToolsGuiButtonProfile";
 						 profile = "ToolsGuiButtonProfile";
 						 visible = "1";
 						 visible = "1";
 						 active = "1";
 						 active = "1";
-						 command = "MaterialEditorGui.updatemetalMap(1);";
+						 Command = "MaterialEditorGui.updateTextureMap(\"metal\",1);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 tooltipProfile = "GuiToolTipProfile";
 						 tooltip = "Change the Metalness Map for this layer.";
 						 tooltip = "Change the Metalness Map for this layer.";
 						 hovertime = "1000";
 						 hovertime = "1000";
@@ -1566,7 +1566,7 @@
 						 profile = "ToolsGuiButtonProfile";
 						 profile = "ToolsGuiButtonProfile";
 						 visible = "1";
 						 visible = "1";
 						 active = "1";
 						 active = "1";
-						 command = "MaterialEditorGui.updatemetalMap(1);";
+						 Command = "MaterialEditorGui.updateTextureMap(\"metal\",1);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 hovertime = "1000";
 						 isContainer = "0";
 						 isContainer = "0";
@@ -1590,7 +1590,7 @@
 						 profile = "ToolsGuiButtonProfile";
 						 profile = "ToolsGuiButtonProfile";
 						 visible = "1";
 						 visible = "1";
 						 active = "1";
 						 active = "1";
-						 command = "MaterialEditorGui.updatemetalMap(0);";
+						 Command = "MaterialEditorGui.updateTextureMap(\"metal\",0);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 hovertime = "1000";
 						 isContainer = "0";
 						 isContainer = "0";
@@ -1773,7 +1773,7 @@
 						 profile = "ToolsGuiButtonProfile";
 						 profile = "ToolsGuiButtonProfile";
 						 visible = "1";
 						 visible = "1";
 						 active = "1";
 						 active = "1";
-						 command = "MaterialEditorGui.updateglowMap(1);";
+						 Command = "MaterialEditorGui.updateTextureMap(\"glow\",1);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 tooltipProfile = "GuiToolTipProfile";
 						 tooltip = "Change the glowness Map for this layer.";
 						 tooltip = "Change the glowness Map for this layer.";
 						 hovertime = "1000";
 						 hovertime = "1000";
@@ -1818,7 +1818,7 @@
 						 profile = "ToolsGuiButtonProfile";
 						 profile = "ToolsGuiButtonProfile";
 						 visible = "1";
 						 visible = "1";
 						 active = "1";
 						 active = "1";
-						 command = "MaterialEditorGui.updateglowMap(1);";
+						 Command = "MaterialEditorGui.updateTextureMap(\"glow\",1);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 hovertime = "1000";
 						 isContainer = "0";
 						 isContainer = "0";
@@ -1842,7 +1842,7 @@
 						 profile = "ToolsGuiButtonProfile";
 						 profile = "ToolsGuiButtonProfile";
 						 visible = "1";
 						 visible = "1";
 						 active = "1";
 						 active = "1";
-						 command = "MaterialEditorGui.updateglowMap(0);";
+						 Command = "MaterialEditorGui.updateTextureMap(\"glow\",0);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 hovertime = "1000";
 						 isContainer = "0";
 						 isContainer = "0";
@@ -4720,7 +4720,7 @@
             MinExtent = "8 2";
             MinExtent = "8 2";
             canSave = "1";
             canSave = "1";
             Visible = "1";
             Visible = "1";
-            Command = "materialSelector.showDialog(\"MaterialEditorGui.switchMaterial\");"; 
+            Command = "AssetBrowser.showDialog(\"MaterialAsset\", \"MaterialEditorGui.selectMaterialAsset\");";
             hovertime = "1000";
             hovertime = "1000";
             bitmap = "tools/gui/images/open-file";
             bitmap = "tools/gui/images/open-file";
             tooltip = "Open Existing Material";
             tooltip = "Open Existing Material";

+ 182 - 313
Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript

@@ -230,6 +230,11 @@ function MaterialEditorGui::openFile( %this, %fileType )
 		   return makeRelativePath( %filename, getMainDotCsDir() );
 		   return makeRelativePath( %filename, getMainDotCsDir() );
 }
 }
 
 
+function MaterialEditorGui::selectMaterialAsset(%this, %assetId)
+{
+   AssetBrowser.editAsset(%assetId);
+}
+
 //==============================================================================
 //==============================================================================
 // SubMaterial(Material Target) -- Supports different ways to grab the 
 // SubMaterial(Material Target) -- Supports different ways to grab the 
 // material from the dropdown list. We're here either because-
 // material from the dropdown list. We're here either because-
@@ -253,7 +258,16 @@ function SubMaterialSelector::onSelect( %this )
    // object does not have a valid method to grab a material
    // object does not have a valid method to grab a material
    if( !isObject( %material ) )
    if( !isObject( %material ) )
    {
    {
-      // look for a newMaterial name to grab
+      if(!AssetDatabase.isDeclaredAsset(%material))
+      {
+         return;
+      }
+      else
+      {
+         %assetDef = AssetDatabase.acquireAsset(%material);
+         %material = %assetDef.materialDefinitionName;  
+      }
+      /*// look for a newMaterial name to grab
       // addiitonally, convert "." to "_" in case we have something like: "base.texname" as a material name   
       // addiitonally, convert "." to "_" in case we have something like: "base.texname" as a material name   
       // at the end we will have generated material name: "base_texname_mat"   
       // at the end we will have generated material name: "base_texname_mat"   
       %material = getUniqueName( strreplace(%material, ".", "_") @ "_mat" );
       %material = getUniqueName( strreplace(%material, ".", "_") @ "_mat" );
@@ -268,7 +282,7 @@ function SubMaterialSelector::onSelect( %this )
       eval( "MaterialEditorGui.currentObject." @ strreplace(%this.getText(),".","_") @ " = " @ %material @ ";");
       eval( "MaterialEditorGui.currentObject." @ strreplace(%this.getText(),".","_") @ " = " @ %material @ ";");
       
       
       if( MaterialEditorGui.currentObject.isMethod("postApply") )
       if( MaterialEditorGui.currentObject.isMethod("postApply") )
-         MaterialEditorGui.currentObject.postApply();
+         MaterialEditorGui.currentObject.postApply();*/
    }
    }
 
 
    MaterialEditorGui.prepareActiveMaterial( %material.getId() );
    MaterialEditorGui.prepareActiveMaterial( %material.getId() );
@@ -325,7 +339,7 @@ function MaterialEditorGui::prepareActiveObject( %this, %override )
       {
       {
          %fieldName = %obj.getField(%i);
          %fieldName = %obj.getField(%i);
          
          
-         if( %obj.getFieldType(%fieldName) !$= "TypeMaterialName" )
+         if( %obj.getFieldType(%fieldName) !$= "TypeMaterialAssetId" && %obj.getFieldType(%fieldName) !$= "TypeMaterialName")
             continue;
             continue;
       
       
          if( !%canSupportMaterial )
          if( !%canSupportMaterial )
@@ -409,7 +423,8 @@ function MaterialEditorGui::prepareActiveMaterial(%this, %material, %override)
 {
 {
    // If were not valid, grab the first valid material out of the materialSet
    // If were not valid, grab the first valid material out of the materialSet
    if( !isObject(%material) )
    if( !isObject(%material) )
-      %material = MaterialSet.getObject(0);
+      return;
+      //%material = MaterialSet.getObject(0);
 	
 	
 	// Check made in order to avoid loading the same material. Overriding
 	// Check made in order to avoid loading the same material. Overriding
 	// made in special cases
 	// made in special cases
@@ -501,7 +516,13 @@ function MaterialEditorGui::setMaterialDirty(%this)
    // materials created in the material selector are given that as its filename, so we run another check
    // materials created in the material selector are given that as its filename, so we run another check
    if( MaterialEditorGui.isMatEditorMaterial( MaterialEditorGui.currentMaterial ) )
    if( MaterialEditorGui.isMatEditorMaterial( MaterialEditorGui.currentMaterial ) )
    {
    {
-      if( MaterialEditorGui.currentMaterial.isAutoGenerated() )
+      %currentMatFilename = MaterialEditorGui.currentMaterial.getFilename();
+
+      if(%currentMatFilename !$= "")
+      {
+           matEd_PersistMan.setDirty(MaterialEditorGui.currentMaterial, %currentMatFilename);
+      }
+      else if( MaterialEditorGui.currentMaterial.isAutoGenerated() )
       {
       {
          %obj = MaterialEditorGui.currentObject;
          %obj = MaterialEditorGui.currentObject;
          
          
@@ -525,13 +546,9 @@ function MaterialEditorGui::setMaterialDirty(%this)
          
          
          matEd_PersistMan.setDirty(MaterialEditorGui.currentMaterial, %savePath);
          matEd_PersistMan.setDirty(MaterialEditorGui.currentMaterial, %savePath);
       }
       }
-      else
-      {
-         matEd_PersistMan.setDirty(MaterialEditorGui.currentMaterial, "art/materials." @ $TorqueScriptFileExtension);
-      }
    }
    }
    else
    else
-      matEd_PersistMan.setDirty(MaterialEditorGui.currentMaterial);
+      matEd_PersistMan.setDirty(MaterialEditorGui.currentMaterial, MaterialEditorGui.defaultMaterialFile);
 }
 }
 
 
 function MaterialEditorGui::convertTextureFields(%this)
 function MaterialEditorGui::convertTextureFields(%this)
@@ -539,88 +556,30 @@ function MaterialEditorGui::convertTextureFields(%this)
    // Find the absolute paths for the texture filenames so that
    // Find the absolute paths for the texture filenames so that
    // we can properly wire up the preview materials and controls.
    // we can properly wire up the preview materials and controls.
    
    
-   for(%diffuseI = 0; %diffuseI < 4; %diffuseI++)
-   {
-      %diffuseMap = MaterialEditorGui.currentMaterial.diffuseMap[%diffuseI];         
-      %diffuseMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %diffuseMap);      
-      MaterialEditorGui.currentMaterial.diffuseMap[%diffuseI] = %diffuseMap;
+   %this.convertMaterialTextureField(MaterialEditorGui.currentMaterial, "DiffuseMap");
+   %this.convertMaterialTextureField(MaterialEditorGui.currentMaterial, "NormalMap");
+   %this.convertMaterialTextureField(MaterialEditorGui.currentMaterial, "OverlayMap");
+   %this.convertMaterialTextureField(MaterialEditorGui.currentMaterial, "DetailMap");
+   %this.convertMaterialTextureField(MaterialEditorGui.currentMaterial, "LightMap");
+   %this.convertMaterialTextureField(MaterialEditorGui.currentMaterial, "ToneMap");
+   %this.convertMaterialTextureField(MaterialEditorGui.currentMaterial, "ORMConfigMap");
+   %this.convertMaterialTextureField(MaterialEditorGui.currentMaterial, "RoughMap");
+   %this.convertMaterialTextureField(MaterialEditorGui.currentMaterial, "AOMap");
+   %this.convertMaterialTextureField(MaterialEditorGui.currentMaterial, "MetalMap");
+   %this.convertMaterialTextureField(MaterialEditorGui.currentMaterial, "GlowMap");
    }
    }
    
    
-   for(%normalI = 0; %normalI < 4; %normalI++)
+function MaterialEditorGui::convertMaterialTextureField(%this, %material, %mapName)
    {
    {
-      %normalMap = MaterialEditorGui.currentMaterial.normalMap[%normalI];
-      %normalMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %normalMap);
-      MaterialEditorGui.currentMaterial.normalMap[%normalI] = %normalMap;
-   }
-   
-   for(%overlayI = 0; %overlayI < 4; %overlayI++)
+   for(%index = 0; %index < 4; %index++)
    {
    {
-      %overlayMap = MaterialEditorGui.currentMaterial.overlayMap[%overlayI];
-      %overlayMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %overlayMap);      
-      MaterialEditorGui.currentMaterial.overlayMap[%overlayI] = %overlayMap;
-   }
-   
-   for(%detailI = 0; %detailI < 4; %detailI++)
+      %mapFile = %material.call("get" @ %mapName, %index);
+      if(%mapFile !$= "" && !isFile(%mapFile))
    {
    {
-      %detailMap = MaterialEditorGui.currentMaterial.detailMap[%detailI];
-      %detailMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %detailMap);      
-      MaterialEditorGui.currentMaterial.detailMap[%detailI] = %detailMap;
+         //see if we can't go finding it 
+         %mapFile = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %mapFile);      
+         MaterialEditorGui.currentMaterial.call("set" @ %mapName, %mapFile, %index);
    }
    }
-   
-   for(%detailNormalI = 0; %detailNormalI < 4; %detailNormalI++)
-   {
-      %detailNormalMap = MaterialEditorGui.currentMaterial.detailNormalMap[%detailNormalI];
-      %detailNormalMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %detailNormalMap);      
-      MaterialEditorGui.currentMaterial.detailNormalMap[%detailNormalI] = %detailNormalMap;
-   }
-   
-   for(%lightI = 0; %lightI < 4; %lightI++)
-   {
-      %lightMap = MaterialEditorGui.currentMaterial.lightMap[%lightI];      
-      %lightMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %lightMap);
-      MaterialEditorGui.currentMaterial.lightMap[%lightI] = %lightMap;
-   }
-   
-   for(%toneI = 0; %toneI < 4; %toneI++)
-   {
-      %toneMap = MaterialEditorGui.currentMaterial.toneMap[%toneI];      
-      %toneMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %toneMap);
-      MaterialEditorGui.currentMaterial.toneMap[%toneI] = %toneMap;
-   }
-   
-   for(%specI = 0; %specI < 4; %specI++)
-   {
-      %ORMConfigMap = MaterialEditorGui.currentMaterial.ORMConfigMap[%specI];      
-      %ORMConfigMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %ORMConfigMap);
-      MaterialEditorGui.currentMaterial.ORMConfigMap[%specI] = %ORMConfigMap;
-   }
-   
-   for(%roughI = 0; %roughI < 4; %roughI++)
-   {
-      %roughMap = MaterialEditorGui.currentMaterial.roughMap[%roughI];      
-      %roughMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %roughMap);
-      MaterialEditorGui.currentMaterial.roughMap[%specI] = %roughMap;
-   }
-   
-   for(%aoI = 0; %aoI < 4; %aoI++)
-   {
-      %aoMap = MaterialEditorGui.currentMaterial.aoMap[%aoI];      
-      %aoMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %aoMap);
-      MaterialEditorGui.currentMaterial.aoMap[%specI] = %aoMap;
-   }
-   
-   for(%metalI = 0; %metalI < 4; %metalI++)
-   {
-      %metalMap = MaterialEditorGui.currentMaterial.metalMap[%metalI];      
-      %metalMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %metalMap);
-      MaterialEditorGui.currentMaterial.metalMap[%metalI] = %metalMap;
-   }
-   
-   for(%glowI = 0; %glowI < 4; %glowI++)
-   {
-      %glowMap = MaterialEditorGui.currentMaterial.glowMap[%glowI];      
-      %glowMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %glowMap);
-      MaterialEditorGui.currentMaterial.glowMap[%glowI] = %glowMap;
    }
    }
 }
 }
 
 
@@ -785,15 +744,6 @@ function MaterialEditorGui::guiSync( %this, %material )
    MaterialEditorPropertiesWindow-->castShadows.setValue((%material).castShadows);
    MaterialEditorPropertiesWindow-->castShadows.setValue((%material).castShadows);
    MaterialEditorPropertiesWindow-->castDynamicShadows.setValue((%material).castDynamicShadows);
    MaterialEditorPropertiesWindow-->castDynamicShadows.setValue((%material).castDynamicShadows);
    MaterialEditorPropertiesWindow-->translucentCheckbox.setValue((%material).translucent);
    MaterialEditorPropertiesWindow-->translucentCheckbox.setValue((%material).translucent);
-   /*
-   
-   MaterialEditorPropertiesWindow-->blendingTypePopUp.add(preMul,1);
-   MaterialEditorPropertiesWindow-->blendingTypePopUp.add(LerpAlpha,2);
-   MaterialEditorPropertiesWindow-->blendingTypePopUp.add(Mul,3);
-   MaterialEditorPropertiesWindow-->blendingTypePopUp.add(Add,4);
-   MaterialEditorPropertiesWindow-->blendingTypePopUp.add(AddAlpha,5);
-   MaterialEditorPropertiesWindow-->blendingTypePopUp.add(Sub,6);
-   */
    switch$((%material).translucentBlendOp)
    switch$((%material).translucentBlendOp)
    {
    {
         case "None": %selectedNum = 0;
         case "None": %selectedNum = 0;
@@ -837,138 +787,174 @@ function MaterialEditorGui::guiSync( %this, %material )
    //layer specific controls are located here
    //layer specific controls are located here
    %layer = MaterialEditorGui.currentLayer;
    %layer = MaterialEditorGui.currentLayer;
    
    
-   if((%material).diffuseMap[%layer] $= "") 
+   //Diffuse
+   if((%material).getDiffuseMap(%layer) !$= "") 
    {
    {
-      MaterialEditorPropertiesWindow-->diffuseMapNameText.setText( "None" );
-      MaterialEditorPropertiesWindow-->diffuseMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
+      %difAsset = (%material).getDiffuseMapAsset(%layer);
+      MaterialEditorPropertiesWindow-->diffuseMapNameText.setText( (%material).getDiffuseMapAsset(%layer) );      
+      MaterialEditorPropertiesWindow-->diffuseMapDisplayBitmap.setBitmap( (%material).getDiffuseMap(%layer) );
    }
    }
    else
    else
    {
    {
-      MaterialEditorPropertiesWindow-->diffuseMapNameText.setText( (%material).diffuseMap[%layer] );      
-      MaterialEditorPropertiesWindow-->diffuseMapDisplayBitmap.setBitmap( (%material).diffuseMap[%layer] );
+      MaterialEditorPropertiesWindow-->diffuseMapNameText.setText( "None" );
+      MaterialEditorPropertiesWindow-->diffuseMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
    }
    }
  
  
-   if((%material).normalMap[%layer] $= "") 
+   //Normal
+   if((%material).getNormalMap(%layer) !$= "") 
    {
    {
-      MaterialEditorPropertiesWindow-->normalMapNameText.setText( "None" );
-      MaterialEditorPropertiesWindow-->normalMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
+      MaterialEditorPropertiesWindow-->normalMapNameText.setText( (%material).getNormalMapAsset(%layer) );      
+      MaterialEditorPropertiesWindow-->normalMapDisplayBitmap.setBitmap( (%material).getNormalMap(%layer) );
    }
    }
    else
    else
    {
    {
-      MaterialEditorPropertiesWindow-->normalMapNameText.setText( (%material).normalMap[%layer] );
-      MaterialEditorPropertiesWindow-->normalMapDisplayBitmap.setBitmap( (%material).normalMap[%layer] );
+      MaterialEditorPropertiesWindow-->normalMapNameText.setText( "None" );
+      MaterialEditorPropertiesWindow-->normalMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
    }
    }
    
    
-   if((%material).overlayMap[%layer] $= "") 
+   //ORM Config
+   if((%material).getORMConfigMap(%layer) !$= "") 
    {
    {
-      MaterialEditorPropertiesWindow-->overlayMapNameText.setText( "None" );
-      MaterialEditorPropertiesWindow-->overlayMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
+      MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText( (%material).getORMConfigMapAsset(%layer) );      
+      MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap( (%material).getORMConfigMap(%layer) );
+      //hide unused
+      MaterialEditorPropertiesWindow-->RoughnessTextEdit.setVisible(false);
+      MaterialEditorPropertiesWindow-->RoughnessSlider.setVisible(false);
+      MaterialEditorPropertiesWindow-->MetalnessTextEdit.setVisible(false);
+      MaterialEditorPropertiesWindow-->MetalnessSlider.setVisible(false);
+      
+      MaterialEditorPropertiesWindow-->isSRGBCheckbox.setValue((%material).isSRGB[%layer]);
+      MaterialEditorPropertiesWindow-->invertRoughnessCheckbox.setValue((%material).invertRoughness[%layer]);
+      //show used
+      MaterialEditorPropertiesWindow-->isSRGBCheckbox.setVisible(true);
+      MaterialEditorPropertiesWindow-->invertRoughnessCheckbox.setVisible(true);
+
    }
    }
    else
    else
    {
    {
-      MaterialEditorPropertiesWindow-->overlayMapNameText.setText( (%material).overlayMap[%layer] );
-      MaterialEditorPropertiesWindow-->overlayMapDisplayBitmap.setBitmap( (%material).overlayMap[%layer] );
+      MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText( "None" );
+      MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
+      
+      MaterialEditorPropertiesWindow-->RoughnessTextEdit.setText((%material).Roughness[%layer]);
+      MaterialEditorPropertiesWindow-->RoughnessSlider.setValue((%material).Roughness[%layer]);
+      MaterialEditorPropertiesWindow-->MetalnessTextEdit.setText((%material).Metalness[%layer]);
+      MaterialEditorPropertiesWindow-->MetalnessSlider.setValue((%material).Metalness[%layer]);   
+      //show used   
+      MaterialEditorPropertiesWindow-->RoughnessTextEdit.setVisible(true);
+      MaterialEditorPropertiesWindow-->RoughnessSlider.setVisible(true);
+      MaterialEditorPropertiesWindow-->MetalnessTextEdit.setVisible(true);
+      MaterialEditorPropertiesWindow-->MetalnessSlider.setVisible(true);
+      
+      //hide unused
+      MaterialEditorPropertiesWindow-->isSRGBCheckbox.setVisible(false);
+      MaterialEditorPropertiesWindow-->invertRoughnessCheckbox.setVisible(false);
    }
    }
    
    
-   if((%material).detailMap[%layer] $= "") 
+   //AOMap
+   if((%material).getAOMap(%layer) !$= "") 
    {
    {
-      MaterialEditorPropertiesWindow-->detailMapNameText.setText( "None" );
-      MaterialEditorPropertiesWindow-->detailMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
+      MaterialEditorPropertiesWindow-->aoMapNameText.setText( (%material).getAOMapAsset(%layer) );      
+      MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap( (%material).getAOMap(%layer) );
    }
    }
    else
    else
    {
    {
-      MaterialEditorPropertiesWindow-->detailMapNameText.setText( (%material).detailMap[%layer] );
-      MaterialEditorPropertiesWindow-->detailMapDisplayBitmap.setBitmap( (%material).detailMap[%layer] );
+      MaterialEditorPropertiesWindow-->aoMapNameText.setText( "None" );
+      MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
    }
    }
-   
-   if((%material).detailNormalMap[%layer] $= "") 
+   //RoughMap
+   if((%material).getRoughMap(%layer) !$= "") 
    {
    {
-      MaterialEditorPropertiesWindow-->detailNormalMapNameText.setText( "None" );
-      MaterialEditorPropertiesWindow-->detailNormalMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
+      MaterialEditorPropertiesWindow-->roughMapNameText.setText( (%material).getRoughMapAsset(%layer) );      
+      MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap( (%material).getRoughMap(%layer) );
    }
    }
    else
    else
    {
    {
-      MaterialEditorPropertiesWindow-->detailNormalMapNameText.setText( (%material).detailNormalMap[%layer] );
-      MaterialEditorPropertiesWindow-->detailNormalMapDisplayBitmap.setBitmap( (%material).detailNormalMap[%layer] );
+      MaterialEditorPropertiesWindow-->roughMapNameText.setText( "None" );
+      MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
    }
    }
    
    
-   if((%material).lightMap[%layer] $= "") 
+   //MetalMap
+   if((%material).getMetalMap(%layer) !$= "") 
    {
    {
-      MaterialEditorPropertiesWindow-->lightMapNameText.setText( "None" );
-      MaterialEditorPropertiesWindow-->lightMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
+      MaterialEditorPropertiesWindow-->metalMapNameText.setText( (%material).getMetalMapAsset(%layer) );      
+      MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap( (%material).getMetalMap(%layer) );
    }
    }
    else
    else
    {
    {
-      MaterialEditorPropertiesWindow-->lightMapNameText.setText( (%material).lightMap[%layer] );
-      MaterialEditorPropertiesWindow-->lightMapDisplayBitmap.setBitmap( (%material).lightMap[%layer] );
+      MaterialEditorPropertiesWindow-->metalMapNameText.setText( "None" );
+      MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
    }
    }
    
    
-   if((%material).toneMap[%layer] $= "") 
+   //GlowMap
+   if((%material).getGlowMap(%layer) !$= "") 
    {
    {
-      MaterialEditorPropertiesWindow-->toneMapNameText.setText( "None" );
-      MaterialEditorPropertiesWindow-->toneMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
+      MaterialEditorPropertiesWindow-->glowMapNameText.setText( (%material).getGlowMapAsset(%layer) );      
+      MaterialEditorPropertiesWindow-->glowMapDisplayBitmap.setBitmap( (%material).getGlowMap(%layer) );
    }
    }
    else
    else
    {
    {
-      MaterialEditorPropertiesWindow-->toneMapNameText.setText( (%material).toneMap[%layer] );
-      MaterialEditorPropertiesWindow-->toneMapDisplayBitmap.setBitmap( (%material).toneMap[%layer] );
+      MaterialEditorPropertiesWindow-->glowMapNameText.setText( "None" );
+      MaterialEditorPropertiesWindow-->glowMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
    }
    }
-   MaterialEditorPropertiesWindow-->isSRGBCheckbox.setValue((%material).isSRGB[%layer]);
-   MaterialEditorPropertiesWindow-->invertRoughnessCheckbox.setValue((%material).invertRoughness[%layer]);
       
       
-   if((%material).ORMConfigMap[%layer] $= "") 
+   //Overlay
+   if((%material).getOverlayMap(%layer) !$= "") 
    {
    {
-      MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText( "None" );
-      MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
+      MaterialEditorPropertiesWindow-->overlayMapNameText.setText( (%material).getOverlayMapAsset(%layer) );      
+      MaterialEditorPropertiesWindow-->overlayMapDisplayBitmap.setBitmap( (%material).getOverlayMap(%layer) );
    }
    }
    else
    else
    {
    {
-      MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText( (%material).ORMConfigMap[%layer] );
-      MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap( (%material).ORMConfigMap[%layer] );
+      MaterialEditorPropertiesWindow-->overlayMapNameText.setText( "None" );
+      MaterialEditorPropertiesWindow-->overlayMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
    }
    }
    
    
-   if((%material).roughMap[%layer] $= "") 
+   //Detail
+   if((%material).getDetailMap(%layer) !$= "") 
    {
    {
-      MaterialEditorPropertiesWindow-->roughMapNameText.setText( "None" );
-      MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" );
+      MaterialEditorPropertiesWindow-->detailMapNameText.setText( (%material).getDetailMapAsset(%layer) );      
+      MaterialEditorPropertiesWindow-->detailMapDisplayBitmap.setBitmap( (%material).getDetailMap(%layer) );
    }
    }
    else
    else
    {
    {
-      MaterialEditorPropertiesWindow-->roughMapNameText.setText( (%material).roughMap[%layer] );
-      MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap( (%material).roughMap[%layer] );
+      MaterialEditorPropertiesWindow-->detailMapNameText.setText( "None" );
+      MaterialEditorPropertiesWindow-->detailMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
    }
    }
    
    
-   if((%material).aoMap[%layer] $= "") 
+   //Detail Normal
+   if((%material).getDetailNormalMap(%layer) !$= "") 
    {
    {
-      MaterialEditorPropertiesWindow-->aoMapNameText.setText( "None" );
-      MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" );
+      MaterialEditorPropertiesWindow-->detailNormalMapNameText.setText( (%material).getDetailNormalMapAsset(%layer) );      
+      MaterialEditorPropertiesWindow-->detailNormalMapDisplayBitmap.setBitmap( (%material).getDetailNormalMap(%layer) );
    }
    }
    else
    else
    {
    {
-      MaterialEditorPropertiesWindow-->aoMapNameText.setText( (%material).aoMap[%layer] );
-      MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap( (%material).aoMap[%layer] );
+      MaterialEditorPropertiesWindow-->detailNormalMapNameText.setText( "None" );
+      MaterialEditorPropertiesWindow-->detailNormalMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
    }
    }
    
    
-   if((%material).metalMap[%layer] $= "") 
+   //Light
+   if((%material).getLightMap(%layer) !$= "") 
    {
    {
-      MaterialEditorPropertiesWindow-->metalMapNameText.setText( "None" );
-      MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" );
+      MaterialEditorPropertiesWindow-->lightMapNameText.setText( (%material).getLightMapAsset(%layer) );      
+      MaterialEditorPropertiesWindow-->lightMapDisplayBitmap.setBitmap( (%material).getLightMap(%layer) );
    }
    }
    else
    else
    {
    {
-      MaterialEditorPropertiesWindow-->metalMapNameText.setText( (%material).metalMap[%layer] );
-      MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap( (%material).metalMap[%layer] );
+      MaterialEditorPropertiesWindow-->lightMapNameText.setText( "None" );
+      MaterialEditorPropertiesWindow-->lightMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
    }
    }
    
    
-   if((%material).glowMap[%layer] $= "") 
+   //Tone
+   if((%material).getToneMap(%layer) !$= "") 
    {
    {
-      MaterialEditorPropertiesWindow-->glowMapNameText.setText( "None" );
-      MaterialEditorPropertiesWindow-->glowMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" );
+      MaterialEditorPropertiesWindow-->toneMapNameText.setText( (%material).getToneMapAsset(%layer) );      
+      MaterialEditorPropertiesWindow-->toneMapDisplayBitmap.setBitmap( (%material).getToneMap(%layer) );
    }
    }
    else
    else
    {
    {
-      MaterialEditorPropertiesWindow-->glowMapNameText.setText( (%material).glowMap[%layer] );
-      MaterialEditorPropertiesWindow-->glowMapDisplayBitmap.setBitmap( (%material).glowMap[%layer] );
+      MaterialEditorPropertiesWindow-->toneMapNameText.setText( "None" );
+      MaterialEditorPropertiesWindow-->toneMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
    }
    }
    
    
    MaterialEditorPropertiesWindow-->accuScaleTextEdit.setText((%material).accuScale[%layer]);
    MaterialEditorPropertiesWindow-->accuScaleTextEdit.setText((%material).accuScale[%layer]);
@@ -988,10 +974,6 @@ function MaterialEditorGui::guiSync( %this, %material )
    MaterialEditorPropertiesWindow-->colorTintSwatch.color = (%material).diffuseColor[%layer];
    MaterialEditorPropertiesWindow-->colorTintSwatch.color = (%material).diffuseColor[%layer];
    MaterialEditorPropertiesWindow-->specularColorSwatch.color = (%material).specular[%layer];     
    MaterialEditorPropertiesWindow-->specularColorSwatch.color = (%material).specular[%layer];     
    
    
-   MaterialEditorPropertiesWindow-->RoughnessTextEdit.setText((%material).Roughness[%layer]);
-   MaterialEditorPropertiesWindow-->RoughnessSlider.setValue((%material).Roughness[%layer]);
-   MaterialEditorPropertiesWindow-->MetalnessTextEdit.setText((%material).Metalness[%layer]);
-   MaterialEditorPropertiesWindow-->MetalnessSlider.setValue((%material).Metalness[%layer]);
    MaterialEditorPropertiesWindow-->glowMulTextEdit.setText((%material).glowMul[%layer]);
    MaterialEditorPropertiesWindow-->glowMulTextEdit.setText((%material).glowMul[%layer]);
    MaterialEditorPropertiesWindow-->glowMulSlider.setValue((%material).glowMul[%layer]);
    MaterialEditorPropertiesWindow-->glowMulSlider.setValue((%material).glowMul[%layer]);
    MaterialEditorPropertiesWindow-->glowCheckbox.setValue((%material).glow[%layer]);
    MaterialEditorPropertiesWindow-->glowCheckbox.setValue((%material).glow[%layer]);
@@ -1240,182 +1222,65 @@ function MaterialEditorGui::updateTextureMap( %this, %type, %action )
 
 
    if( %action )
    if( %action )
    {
    {
-      %texture = MaterialEditorGui.openFile("texture");
-      if( %texture !$= "" )
-      {
-         %bitmapCtrl.setBitmap(%texture);
-      
-         %bitmap = %bitmapCtrl.bitmap;
-         %bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/","");
-         %bitmapCtrl.setBitmap(%bitmap);
-         %textCtrl.setText(%bitmap);
-         MaterialEditorGui.updateActiveMaterial(%type @ "Map[" @ %layer @ "]","\"" @ %bitmap @ "\"");	
-      }
+      AssetBrowser.showDialog("ImageAsset", %this@".doUpdateTextureMap");
    }
    }
    else
    else
    {
    {
       %textCtrl.setText("None");
       %textCtrl.setText("None");
       %bitmapCtrl.setBitmap("tools/materialEditor/gui/unknownImage");
       %bitmapCtrl.setBitmap("tools/materialEditor/gui/unknownImage");
       MaterialEditorGui.updateActiveMaterial(%type @ "Map[" @ %layer @ "]","");
       MaterialEditorGui.updateActiveMaterial(%type @ "Map[" @ %layer @ "]","");
+      MaterialEditorGui.updateActiveMaterial(%type @ "MapAsset[" @ %layer @ "]","");
    }
    }
-}
-
-function MaterialEditorGui::updateDetailScale(%this,%newScale)
-{
-   %layer = MaterialEditorGui.currentLayer;
-   
-   %detailScale = "\"" @ %newScale SPC %newScale @ "\"";
-   MaterialEditorGui.updateActiveMaterial("detailScale[" @ %layer @ "]", %detailScale);
-}
-
-function MaterialEditorGui::updateDetailNormalStrength(%this,%newStrength)
-{
-   %layer = MaterialEditorGui.currentLayer;
-   
-   %detailStrength = "\"" @ %newStrength @ "\"";
-   MaterialEditorGui.updateActiveMaterial("detailNormalMapStrength[" @ %layer @ "]", %detailStrength);
-}
-
-function MaterialEditorGui::updateORMConfigMap(%this,%action)
-{
-   %layer = MaterialEditorGui.currentLayer;
-   
-   if( %action )
-   {
-      %texture = MaterialEditorGui.openFile("texture");
-      if( %texture !$= "" )
-      {
-         MaterialEditorGui.updateActiveMaterial("pixelSpecular[" @ MaterialEditorGui.currentLayer @ "]", 0);
-         
-         MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap(%texture);
-      
-         %bitmap = MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.bitmap;
-         %bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/","");
-         MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap(%bitmap);
-         MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText(%bitmap);
-         MaterialEditorGui.updateActiveMaterial("ORMConfigMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
-      }
-   }
-   else
-   {
-      MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText("None");
-      MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap("tools/materialEditor/gui/unknownImage");
-      MaterialEditorGui.updateActiveMaterial("ORMConfigMap[" @ %layer @ "]","");
-   }
-   
    MaterialEditorGui.guiSync( materialEd_previewMaterial );
    MaterialEditorGui.guiSync( materialEd_previewMaterial );
 }
 }
 
 
-function MaterialEditorGui::updateRoughMap(%this,%action)
+function MaterialEditorGui::doUpdateTextureMap( %this, %assetId )
+{
+   if(%assetId !$= "")
 {
 {
    %layer = MaterialEditorGui.currentLayer;
    %layer = MaterialEditorGui.currentLayer;
    
    
-   if( %action )
-   {
-      %texture = MaterialEditorGui.openFile("texture");
-      if( %texture !$= "" )
-      {         
-         MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap(%texture);
+      %type = %this.updatingTextureType;
       
       
-         %bitmap = MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.bitmap;
-         %bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/","");
-         MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap(%bitmap);
-         MaterialEditorPropertiesWindow-->roughMapNameText.setText(%bitmap);
-         MaterialEditorGui.updateActiveMaterial("roughMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
-      }
-   }
-   else
-   {
-      MaterialEditorPropertiesWindow-->roughMapNameText.setText("None");
-      MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap("tools/materialeditor/gui/unknownImage");
-      MaterialEditorGui.updateActiveMaterial("roughMap[" @ %layer @ "]","");
-   }
+      %bitmapCtrl = MaterialEditorPropertiesWindow.findObjectByInternalName( %type @ "MapDisplayBitmap", true );
+      %textCtrl = MaterialEditorPropertiesWindow.findObjectByInternalName( %type @ "MapNameText", true );
    
    
-   MaterialEditorGui.guiSync( materialEd_previewMaterial );
-}
+      %assetDef = AssetDatabase.acquireAsset(%assetId);
 
 
-function MaterialEditorGui::updateaoMap(%this,%action)
-{
-   %layer = MaterialEditorGui.currentLayer;
+      %texture = %assetDef.getImagePath();
    
    
-   if( %action )
-   {
-      %texture = MaterialEditorGui.openFile("texture");
+      //%texture = MaterialEditorGui.openFile("texture");
       if( %texture !$= "" )
       if( %texture !$= "" )
       {         
       {         
-         MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap(%texture);
+         %bitmapCtrl.setBitmap(%texture);
       
       
-         %bitmap = MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.bitmap;
+         %bitmap = %bitmapCtrl.bitmap;
          %bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/","");
          %bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/","");
-         MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap(%bitmap);
-         MaterialEditorPropertiesWindow-->aoMapNameText.setText(%bitmap);
-         MaterialEditorGui.updateActiveMaterial("aoMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
+         %bitmapCtrl.setBitmap(%bitmap);
+         %textCtrl.setText(%assetId);
+         MaterialEditorGui.updateActiveMaterial(%type @ "Map[" @ %layer @ "]","\"\"");
+         MaterialEditorGui.updateActiveMaterial(%type @ "MapAsset[" @ %layer @ "]","\"" @ %assetId @ "\"");	
       }
       }
    }
    }
-   else
-   {
-      MaterialEditorPropertiesWindow-->aoMapNameText.setText("None");
-      MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap("tools/materialeditor/gui/unknownImage");
-      MaterialEditorGui.updateActiveMaterial("aoMap[" @ %layer @ "]","");
-   }
    
    
+   %this.updatingTextureType = "";
    MaterialEditorGui.guiSync( materialEd_previewMaterial );
    MaterialEditorGui.guiSync( materialEd_previewMaterial );
 }
 }
 
 
-function MaterialEditorGui::updatemetalMap(%this,%action)
+function MaterialEditorGui::updateDetailScale(%this,%newScale)
 {
 {
    %layer = MaterialEditorGui.currentLayer;
    %layer = MaterialEditorGui.currentLayer;
    
    
-   if( %action )
-   {
-      %texture = MaterialEditorGui.openFile("texture");
-      if( %texture !$= "" )
-      {         
-         MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap(%texture);
-      
-         %bitmap = MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.bitmap;
-         %bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/","");
-         MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap(%bitmap);
-         MaterialEditorPropertiesWindow-->metalMapNameText.setText(%bitmap);
-         MaterialEditorGui.updateActiveMaterial("metalMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
-      }
-   }
-   else
-   {
-      MaterialEditorPropertiesWindow-->metalMapNameText.setText("None");
-      MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap("tools/materialeditor/gui/unknownImage");
-      MaterialEditorGui.updateActiveMaterial("metalMap[" @ %layer @ "]","");
+   %detailScale = "\"" @ %newScale SPC %newScale @ "\"";
+   MaterialEditorGui.updateActiveMaterial("detailScale[" @ %layer @ "]", %detailScale);
    }
    }
    
    
-   MaterialEditorGui.guiSync( materialEd_previewMaterial );
-}
-
-function MaterialEditorGui::updateGlowMap(%this,%action)
+function MaterialEditorGui::updateDetailNormalStrength(%this,%newStrength)
 {
 {
    %layer = MaterialEditorGui.currentLayer;
    %layer = MaterialEditorGui.currentLayer;
    
    
-   if( %action )
-   {
-      %texture = MaterialEditorGui.openFile("texture");
-      if( %texture !$= "" )
-      {         
-         MaterialEditorPropertiesWindow-->GlowMapDisplayBitmap.setBitmap(%texture);
-      
-         %bitmap = MaterialEditorPropertiesWindow-->GlowMapDisplayBitmap.bitmap;
-         %bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/","");
-         MaterialEditorPropertiesWindow-->GlowMapDisplayBitmap.setBitmap(%bitmap);
-         MaterialEditorPropertiesWindow-->GlowMapNameText.setText(%bitmap);
-         MaterialEditorGui.updateActiveMaterial("glowMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
-      }
-   }
-   else
-   {
-      MaterialEditorPropertiesWindow-->GlowMapNameText.setText("None");
-      MaterialEditorPropertiesWindow-->GlowMapDisplayBitmap.setBitmap("tools/materialeditor/gui/unknownImage");
-      MaterialEditorGui.updateActiveMaterial("glowMap[" @ %layer @ "]","");
-   }
-   
-   MaterialEditorGui.guiSync( materialEd_previewMaterial );
+   %detailStrength = "\"" @ %newStrength @ "\"";
+   MaterialEditorGui.updateActiveMaterial("detailNormalMapStrength[" @ %layer @ "]", %detailStrength);
 }
 }
 
 
 function MaterialEditorGui::updateRotationOffset(%this, %isSlider, %onMouseUp)
 function MaterialEditorGui::updateRotationOffset(%this, %isSlider, %onMouseUp)
@@ -1599,12 +1464,6 @@ function MaterialEditorGui::updateColorMultiply(%this,%color)
    %this.syncGuiColor(MaterialEditorPropertiesWindow-->colorTintSwatch, %propName, %color);
    %this.syncGuiColor(MaterialEditorPropertiesWindow-->colorTintSwatch, %propName, %color);
 }
 }
 
 
-function MaterialEditorGui::updateSpecularCheckbox(%this,%value)
-{
-   MaterialEditorGui.updateActiveMaterial("pixelSpecular[" @ MaterialEditorGui.currentLayer @ "]", %value);   
-   MaterialEditorGui.guiSync( materialEd_previewMaterial );
-}
-
 function MaterialEditorGui::updateSpecular(%this, %color)
 function MaterialEditorGui::updateSpecular(%this, %color)
 {
 {
    %propName = "specular[" @ MaterialEditorGui.currentLayer @ "]";
    %propName = "specular[" @ MaterialEditorGui.currentLayer @ "]";
@@ -2164,6 +2023,16 @@ function MaterialEditorGui::save( %this )
 
 
 function MaterialEditorGui::createNewMaterial( %this )
 function MaterialEditorGui::createNewMaterial( %this )
 {
 {
+   AssetBrowser_SelectModule.showDialog("MaterialEditorGui.pickedNewMaterialTargetModule");
+   AssetBrowser_SelectModuleWindow.selectWindow();
+}
+
+function MaterialEditorGui::pickedNewMaterialTargetModule( %this, %module )
+{
+   %moduleDef = ModuleDatabase.findModule(%module);
+   PE_EmitterEditor.targetModule = %module;
+   MaterialEditorGui.defaultMaterialFile = %moduleDef.ModulePath @ "/scripts/managedData/materials." @ $TorqueScriptFileExtension;
+
    %action = %this.createUndo(ActionCreateNewMaterial, "Create New Material");
    %action = %this.createUndo(ActionCreateNewMaterial, "Create New Material");
    %action.object = "";
    %action.object = "";
    
    
@@ -2571,10 +2440,10 @@ function MaterialEditorGui::saveCompositeMap(%this)
     %material = %this.currentMaterial;
     %material = %this.currentMaterial;
     %layer = %this.currentLayer;
     %layer = %this.currentLayer;
    
    
-    %roughMap = %material.roughMap[%layer];
-    %aoMap = %material.aoMap[%layer];
-    %metalMap = %material.metalMap[%layer];
-    %glowMap = %material.glowMap[%layer];
+    %roughMap = %material.getRoughMap(%layer);
+    %aoMap = %material.getAOMap(%layer);
+    %metalMap = %material.getMetalMap(%layer);
+    %glowMap = %material.getGlowMap(%layer);
     
     
     %roughness = %material.RoughnessChan[%layer];
     %roughness = %material.RoughnessChan[%layer];
     %ao = %material.AOChan[%layer];
     %ao = %material.AOChan[%layer];

+ 14 - 2
Templates/BaseGame/game/tools/particleEditor/particleEmitterEditor.ed.tscript

@@ -21,7 +21,7 @@
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
 
 
-$PE_EMITTEREDITOR_DEFAULT_FILENAME = "art/particles/managedParticleEmitterData." @ $TorqueScriptFileExtension;
+$PE_EMITTEREDITOR_DEFAULT_FILENAME = "data/managedParticleEmitterData." @ $TorqueScriptFileExtension;
 
 
 
 
 //=============================================================================================
 //=============================================================================================
@@ -499,8 +499,10 @@ function PE_EmitterEditor::setEmitterDirty( %this )
    PE_EmitterEditor.dirty = true;
    PE_EmitterEditor.dirty = true;
    
    
    %emitter = PE_EmitterEditor.currEmitter;
    %emitter = PE_EmitterEditor.currEmitter;
+   %filename = %emitter.getFilename();
+   %editorFilename = "tools/particleEditor/particleEmitterEditor.ed." @ $TorqueScriptFileExtension;
    
    
-   if( %emitter.getFilename() $= "" || %emitter.getFilename() $= "tools/particleEditor/particleEmitterEditor.ed." @ $TorqueScriptFileExtension )
+   if( %filename $= "" || %filename $= %editorFilename )
       PE_EmitterSaver.setDirty( %emitter, $PE_EMITTEREDITOR_DEFAULT_FILENAME );
       PE_EmitterSaver.setDirty( %emitter, $PE_EMITTEREDITOR_DEFAULT_FILENAME );
    else
    else
       PE_EmitterSaver.setDirty( %emitter );
       PE_EmitterSaver.setDirty( %emitter );
@@ -551,6 +553,16 @@ function PE_EmitterEditor::showNewDialog( %this )
 
 
 function PE_EmitterEditor::createEmitter( %this )
 function PE_EmitterEditor::createEmitter( %this )
 {
 {
+   AssetBrowser_SelectModule.showDialog("PE_EmitterEditor.pickedNewEmitterTargetModule");
+   AssetBrowser_SelectModuleWindow.selectWindow();
+}
+
+function PE_EmitterEditor::pickedNewEmitterTargetModule( %this, %module )
+{
+   %moduleDef = ModuleDatabase.findModule(%module);
+   PE_EmitterEditor.targetModule = %module;
+   $PE_EMITTEREDITOR_DEFAULT_FILENAME = %moduleDef.ModulePath @ "/scripts/managedData/managedParticleEmitterData." @ $TorqueScriptFileExtension;
+   
    // Create a new emitter.
    // Create a new emitter.
    %emitter = getUniqueName( "newEmitter" );
    %emitter = getUniqueName( "newEmitter" );
    datablock ParticleEmitterData( %emitter : DefaultEmitter )
    datablock ParticleEmitterData( %emitter : DefaultEmitter )

+ 51 - 15
Templates/BaseGame/game/tools/particleEditor/particleParticleEditor.ed.tscript

@@ -21,7 +21,7 @@
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
 
 
-$PE_PARTICLEEDITOR_DEFAULT_FILENAME = "art/particles/managedParticleData." @ $TorqueScriptFileExtension;
+$PE_PARTICLEEDITOR_DEFAULT_FILENAME = "data/managedParticleData." @ $TorqueScriptFileExtension;
 
 
 
 
 //=============================================================================================
 //=============================================================================================
@@ -57,11 +57,16 @@ function PE_ParticleEditor::guiSync( %this )
    %popup.sort();
    %popup.sort();
    %popup.setSelected( %data );
    %popup.setSelected( %data );
          
          
-   %bitmap = MaterialEditorGui.searchForTexture( %data.getName(), %data.textureName );
+   %bitmap = %data.getTexture();//MaterialEditorGui.searchForTexture( %data.getName(), %data.getTexture() );
    if( %bitmap !$= "" )
    if( %bitmap !$= "" )
    {
    {
       PE_ParticleEditor-->PEP_previewImage.setBitmap( %bitmap );
       PE_ParticleEditor-->PEP_previewImage.setBitmap( %bitmap );
-      PE_ParticleEditor-->PEP_previewImageName.setText( %bitmap );
+      
+      %text = %data.getTextureAsset();
+      if(%text $= "")
+         %text = %bitmap;
+         
+      PE_ParticleEditor-->PEP_previewImageName.setText( %text );
       PE_ParticleEditor-->PEP_previewImageName.tooltip = %bitmap;
       PE_ParticleEditor-->PEP_previewImageName.tooltip = %bitmap;
    }
    }
    else
    else
@@ -215,15 +220,7 @@ function PE_ParticleEditor::updateParticleTexture( %this, %action )
 {
 {
    if( %action )
    if( %action )
    {
    {
-      %texture = MaterialEditorGui.openFile("texture");
-      if( %texture !$= "" )
-      {
-         PE_ParticleEditor-->PEP_previewImage.setBitmap(%texture);
-         PE_ParticleEditor-->PEP_previewImageName.setText(%texture);
-         PE_ParticleEditor-->PEP_previewImageName.tooltip = %texture;
-         
-         PE_ParticleEditor.updateParticle( "textureName", %texture );
-      }
+      AssetBrowser.showDialog("ImageAsset", "PE_ParticleEditor.onImageAssetSelected");
    }
    }
    else
    else
    {
    {
@@ -235,6 +232,18 @@ function PE_ParticleEditor::updateParticleTexture( %this, %action )
    }
    }
 }
 }
 
 
+function PE_ParticleEditor::onImageAssetSelected(%this, %assetId)
+{
+   if( AssetDatabase.isDeclaredAsset(%assetId) )
+   {
+      PE_ParticleEditor-->PEP_previewImage.setBitmap(%assetId);
+      PE_ParticleEditor-->PEP_previewImageName.setText(%assetId);
+      PE_ParticleEditor-->PEP_previewImageName.tooltip = %assetId;
+      
+      PE_ParticleEditor.updateParticle( "textureAsset", %assetId );
+   }
+}
+
 //---------------------------------------------------------------------------------------------
 //---------------------------------------------------------------------------------------------
 
 
 function PE_ParticleEditor::updateLifeFields( %this, %isRandom, %value, %isSlider, %onMouseUp )
 function PE_ParticleEditor::updateLifeFields( %this, %isRandom, %value, %isSlider, %onMouseUp )
@@ -389,11 +398,18 @@ function PE_ParticleEditor::loadNewParticle( %this, %particle )
       
       
    PE_ParticleEditor.currParticle = %particle;
    PE_ParticleEditor.currParticle = %particle;
    
    
+   error("PE_ParticleEditor::loadNewParticle() - Loading particle: " @ %particle.getName());
+   error("Particle TextureName: " @ %particle.getTexture());
+   
+   error("ReloadingParticle...");
    %particle.reload();
    %particle.reload();
    
    
    PE_ParticleEditor_NotDirtyParticle.assignFieldsFrom( %particle );
    PE_ParticleEditor_NotDirtyParticle.assignFieldsFrom( %particle );
    PE_ParticleEditor_NotDirtyParticle.originalName = %particle.getName();
    PE_ParticleEditor_NotDirtyParticle.originalName = %particle.getName();
 
 
+   error("Post duplicate Particle TextureName: " @ %particle.getTexture());
+   error("Post duplicate PE_ParticleEditor_NotDirtyParticle TextureName: " @ PE_ParticleEditor_NotDirtyParticle.getTexture());
+
    PE_ParticleEditor.guiSync();
    PE_ParticleEditor.guiSync();
    PE_ParticleEditor.setParticleNotDirty();
    PE_ParticleEditor.setParticleNotDirty();
 }
 }
@@ -406,8 +422,10 @@ function PE_ParticleEditor::setParticleDirty( %this )
    PE_ParticleEditor.dirty = true;
    PE_ParticleEditor.dirty = true;
    
    
    %particle = PE_ParticleEditor.currParticle;
    %particle = PE_ParticleEditor.currParticle;
+   %filename = %particle.getFilename();
+   %editorFilename = "tools/particleEditor/particleParticleEditor.ed." @ $TorqueScriptFileExtension;
    
    
-   if( %particle.getFilename() $= "" || %particle.getFilename() $= "tools/particleEditor/particleParticleEditor.ed." @ $TorqueScriptFileExtension )
+   if( %filename $= "" || %filename $= %editorFilename )
       PE_ParticleSaver.setDirty( %particle, $PE_PARTICLEEDITOR_DEFAULT_FILENAME );
       PE_ParticleSaver.setDirty( %particle, $PE_PARTICLEEDITOR_DEFAULT_FILENAME );
    else
    else
       PE_ParticleSaver.setDirty( %particle );
       PE_ParticleSaver.setDirty( %particle );
@@ -462,6 +480,24 @@ function PE_ParticleEditor::createParticle( %this, %replaceSlot )
    else
    else
       %particleIndex = %replaceSlot - 1;
       %particleIndex = %replaceSlot - 1;
    
    
+   PE_ParticleEditor.newParticleSlot = %particleIndex;
+   
+   if(%replaceSlot $= "" || %replaceSlot != 0)
+   {
+      AssetBrowser_SelectModule.showDialog("PE_ParticleEditor.pickedNewParticleTargetModule");
+      AssetBrowser_SelectModuleWindow.selectWindow();
+   }
+   else
+   {
+      PE_ParticleEditor.pickedNewParticleTargetModule(PE_EmitterEditor.targetModule);
+   }
+}
+
+function PE_ParticleEditor::pickedNewParticleTargetModule(%this, %module)
+{
+   %moduleDef = ModuleDatabase.findModule(%module);
+   $PE_PARTICLEEDITOR_DEFAULT_FILENAME = %moduleDef.ModulePath @ "/scripts/managedData/managedParticleData." @ $TorqueScriptFileExtension;
+   
    // Create the particle datablock and add to the emitter.
    // Create the particle datablock and add to the emitter.
    
    
    %newParticle = getUniqueName( "newParticle" );
    %newParticle = getUniqueName( "newParticle" );
@@ -474,8 +510,8 @@ function PE_ParticleEditor::createParticle( %this, %replaceSlot )
    
    
    %action = ParticleEditor.createUndo( ActionCreateNewParticle, "Create New Particle" );
    %action = ParticleEditor.createUndo( ActionCreateNewParticle, "Create New Particle" );
    %action.particle = %newParticle.getId();
    %action.particle = %newParticle.getId();
-   %action.particleIndex = %particleIndex;
-   %action.prevParticle = ( "PEE_EmitterParticleSelector" @ ( %particleIndex + 1 ) ).getSelected();
+   %action.particleIndex = PE_ParticleEditor.newParticleSlot;
+   %action.prevParticle = ( "PEE_EmitterParticleSelector" @ ( PE_ParticleEditor.newParticleSlot + 1 ) ).getSelected();
    %action.emitter = PE_EmitterEditor.currEmitter;
    %action.emitter = PE_EmitterEditor.currEmitter;
    
    
    ParticleEditor.submitUndo( %action );
    ParticleEditor.submitUndo( %action );

+ 15 - 0
Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript

@@ -114,6 +114,21 @@ function T3Dpre4ProjectImporter::copyFiles(%this)
       %file = findNextFileMultiExpr( $ProjectImporter::sourceContentFolder @ "/*.*" );
       %file = findNextFileMultiExpr( $ProjectImporter::sourceContentFolder @ "/*.*" );
    }
    }
    
    
+   //
+   //Now that we've done that, we'll load and scan the module for asset defs
+   %file = findFirstFileMultiExpr( $ProjectImporter::modulePath @ "/*.asset.taml", true);
+   
+   while( %file !$= "" )
+   {
+      %moduleName = AssetBrowser.dirHandler.getModuleFromAddress(%file).ModuleId;
+      %moduleDef = ModuleDatabase.findModule(%moduleName, 1);
+      
+      AssetDatabase.addDeclaredAsset(%moduleDef, %file);
+      
+      %file = findNextFileMultiExpr( $ProjectImporter::modulePath @ "/*.asset.taml" );
+   }
+   //
+   
    %currentPage-->fileCopyText.setValue("File copy done! Press Next to continue.");
    %currentPage-->fileCopyText.setValue("File copy done! Press Next to continue.");
    
    
    ProjectImportWindow-->nextButton.setActive(true);
    ProjectImportWindow-->nextButton.setActive(true);

+ 452 - 224
Templates/BaseGame/game/tools/settings.xml

@@ -1,268 +1,496 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <EditorSettings>
 <EditorSettings>
-    <Group name="AssetBrowser">
-        <Setting name="previewSize">Small</Setting>
+    <Group
+        name="AssetBrowser">
+        <Setting
+            name="previewSize">Small</Setting>
     </Group>
     </Group>
-    <Group name="AssetCreation">
-        <Setting name="AssetImporDefaultConfig">TestConfig</Setting>
-        <Setting name="AutoImport">1</Setting>
-        <Setting name="CppAssetSubdirectoryFormat">&lt;AssetType&gt;/&lt;SpecialAssetTag&gt;/</Setting>
-        <Setting name="CubemapAssetSubdirectoryFormat">&lt;AssetType&gt;/</Setting>
-        <Setting name="GUIAssetSubdirectoryFormat">&lt;AssetType&gt;/OtherFolder/</Setting>
-        <Setting name="LevelAssetSubdirectoryFormat">&lt;AssetType&gt;/&lt;AssetName&gt;/</Setting>
-        <Setting name="PostFXAssetSubdirectoryFormat">&lt;AssetType&gt;/</Setting>
-        <Setting name="ScriptAssetSubdirectoryFormat">&lt;AssetType&gt;/&lt;SpecialAssetTag&gt;/</Setting>
-        <Setting name="StatemachineAssetSubdirectoryFormat">&lt;AssetType&gt;/</Setting>
-        <Setting name="TerrainAssetSubdirectoryFormat">&lt;AssetType&gt;/</Setting>
-        <Setting name="TerrainMatAssetSubdirectoryFormat">&lt;AssetType&gt;/</Setting>
+    <Group
+        name="AssetCreation">
+        <Setting
+            name="AssetImporDefaultConfig">TestConfig</Setting>
+        <Setting
+            name="AutoImport">1</Setting>
+        <Setting
+            name="CppAssetSubdirectoryFormat">&lt;AssetType&gt;/&lt;SpecialAssetTag&gt;/</Setting>
+        <Setting
+            name="CubemapAssetSubdirectoryFormat">&lt;AssetType&gt;/</Setting>
+        <Setting
+            name="GUIAssetSubdirectoryFormat">&lt;AssetType&gt;/OtherFolder/</Setting>
+        <Setting
+            name="LevelAssetSubdirectoryFormat">&lt;AssetType&gt;/&lt;AssetName&gt;/</Setting>
+        <Setting
+            name="PostFXAssetSubdirectoryFormat">&lt;AssetType&gt;/</Setting>
+        <Setting
+            name="ScriptAssetSubdirectoryFormat">&lt;AssetType&gt;/&lt;SpecialAssetTag&gt;/</Setting>
+        <Setting
+            name="StatemachineAssetSubdirectoryFormat">&lt;AssetType&gt;/</Setting>
+        <Setting
+            name="TerrainAssetSubdirectoryFormat">&lt;AssetType&gt;/</Setting>
+        <Setting
+            name="TerrainMatAssetSubdirectoryFormat">&lt;AssetType&gt;/</Setting>
     </Group>
     </Group>
-    <Group name="Assets">
-        <Setting name="AssetImporDefaultConfig">DefaultImportConfig</Setting>
-        <Setting name="AutoImport">1</Setting>
-        <Group name="Browser">
-            <Setting name="previewTileSize">1</Setting>
+    <Group
+        name="Assets">
+        <Setting
+            name="AssetImporDefaultConfig">DefaultImportConfig</Setting>
+        <Setting
+            name="AutoImport">1</Setting>
+        <Group
+            name="Browser">
+            <Setting
+                name="previewTileSize">1</Setting>
+            <Setting
+                name="showCoreModule">1</Setting>
+            <Setting
+                name="showToolsModule">1</Setting>
         </Group>
         </Group>
     </Group>
     </Group>
-    <Group name="AxisGizmo">
-        <Setting name="axisGizmoMaxScreenLen">100</Setting>
-        <Setting name="mouseRotateScalar">0.8</Setting>
-        <Setting name="mouseScaleScalar">0.8</Setting>
-        <Setting name="renderInfoText">1</Setting>
-        <Setting name="renderWhenUsed">0</Setting>
-        <Setting name="rotationSnap">15</Setting>
-        <Setting name="snapRotations">0</Setting>
-        <Group name="Grid">
-            <Setting name="forceSnapRotations">1</Setting>
-            <Setting name="gridColor">255 255 255 20</Setting>
-            <Setting name="gridSize">1 1 1</Setting>
-            <Setting name="planeDim">500</Setting>
-            <Setting name="renderPlane">0</Setting>
-            <Setting name="renderPlaneHashes">0</Setting>
-            <Setting name="snapToGrid">0</Setting>
+    <Group
+        name="AxisGizmo">
+        <Setting
+            name="axisGizmoMaxScreenLen">100</Setting>
+        <Setting
+            name="mouseRotateScalar">0.8</Setting>
+        <Setting
+            name="mouseScaleScalar">0.8</Setting>
+        <Setting
+            name="renderInfoText">1</Setting>
+        <Setting
+            name="renderWhenUsed">0</Setting>
+        <Setting
+            name="rotationSnap">15</Setting>
+        <Setting
+            name="snapRotations">0</Setting>
+        <Group
+            name="Grid">
+            <Setting
+                name="forceSnapRotations">1</Setting>
+            <Setting
+                name="gridColor">255 255 255 20</Setting>
+            <Setting
+                name="gridSize">1 1 1</Setting>
+            <Setting
+                name="planeDim">500</Setting>
+            <Setting
+                name="renderPlane">0</Setting>
+            <Setting
+                name="renderPlaneHashes">0</Setting>
+            <Setting
+                name="snapToGrid">0</Setting>
         </Group>
         </Group>
     </Group>
     </Group>
-    <Group name="ConvexEditor">
-        <Setting name="materialName">Grid_512_Orange</Setting>
+    <Group
+        name="ConvexEditor">
+        <Setting
+            name="materialName">Grid_512_Orange</Setting>
     </Group>
     </Group>
-    <Group name="DatablockEditor">
-        <Setting name="libraryTab">1</Setting>
+    <Group
+        name="DatablockEditor">
+        <Setting
+            name="libraryTab">1</Setting>
     </Group>
     </Group>
-    <Group name="GuiEditor">
-        <Setting name="lastPath">tools/RPGDialogEditor/gui</Setting>
-        <Setting name="previewResolution">1024 768</Setting>
-        <Group name="EngineDevelopment">
-            <Setting name="showEditorGuis">0</Setting>
-            <Setting name="showEditorProfiles">0</Setting>
-            <Setting name="toggleIntoEditor">0</Setting>
+    <Group
+        name="GuiEditor">
+        <Setting
+            name="lastPath">tools/RPGDialogEditor/gui</Setting>
+        <Setting
+            name="previewResolution">1024 768</Setting>
+        <Group
+            name="EngineDevelopment">
+            <Setting
+                name="showEditorGuis">0</Setting>
+            <Setting
+                name="showEditorProfiles">0</Setting>
+            <Setting
+                name="toggleIntoEditor">0</Setting>
         </Group>
         </Group>
-        <Group name="Help">
-            <Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
-            <Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
-            <Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
+        <Group
+            name="Help">
+            <Setting
+                name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
+            <Setting
+                name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
+            <Setting
+                name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
         </Group>
         </Group>
-        <Group name="Library">
-            <Setting name="viewType">Categorized</Setting>
+        <Group
+            name="Library">
+            <Setting
+                name="viewType">Categorized</Setting>
         </Group>
         </Group>
-        <Group name="Rendering">
-            <Setting name="drawBorderLines">1</Setting>
-            <Setting name="drawGuides">1</Setting>
+        <Group
+            name="Rendering">
+            <Setting
+                name="drawBorderLines">1</Setting>
+            <Setting
+                name="drawGuides">1</Setting>
         </Group>
         </Group>
-        <Group name="Selection">
-            <Setting name="fullBox">0</Setting>
+        <Group
+            name="Selection">
+            <Setting
+                name="fullBox">0</Setting>
         </Group>
         </Group>
-        <Group name="Snapping">
-            <Setting name="sensitivity">2</Setting>
-            <Setting name="snap2Grid">0</Setting>
-            <Setting name="snap2GridSize">8</Setting>
-            <Setting name="snapToCanvas">1</Setting>
-            <Setting name="snapToCenters">1</Setting>
-            <Setting name="snapToControls">1</Setting>
-            <Setting name="snapToEdges">1</Setting>
-            <Setting name="snapToGuides">1</Setting>
+        <Group
+            name="Snapping">
+            <Setting
+                name="sensitivity">2</Setting>
+            <Setting
+                name="snap2Grid">0</Setting>
+            <Setting
+                name="snap2GridSize">8</Setting>
+            <Setting
+                name="snapToCanvas">1</Setting>
+            <Setting
+                name="snapToCenters">1</Setting>
+            <Setting
+                name="snapToControls">1</Setting>
+            <Setting
+                name="snapToEdges">1</Setting>
+            <Setting
+                name="snapToGuides">1</Setting>
         </Group>
         </Group>
     </Group>
     </Group>
-    <Group name="LevelInformation">
-        <Setting name="levelsDirectory">data/FPSGameplay/levels</Setting>
-        <Group name="levels">
-            <Group name="BlankRoom.mis">
-                <Setting name="cameraSpeed">25</Setting>
+    <Group
+        name="LevelInformation">
+        <Setting
+            name="levelsDirectory">data/FPSGameplay/levels</Setting>
+        <Group
+            name="levels">
+            <Group
+                name="BlankRoom.mis">
+                <Setting
+                    name="cameraSpeed">25</Setting>
             </Group>
             </Group>
-            <Group name="DefaultEditorLevel.mis">
-                <Setting name="cameraSpeed">25</Setting>
+            <Group
+                name="DefaultEditorLevel.mis">
+                <Setting
+                    name="cameraSpeed">25</Setting>
             </Group>
             </Group>
-            <Group name="EmptyLevel.mis">
-                <Setting name="cameraSpeed">25</Setting>
+            <Group
+                name="EmptyLevel.mis">
+                <Setting
+                    name="cameraSpeed">25</Setting>
             </Group>
             </Group>
-            <Group name="Empty Terrain.mis">
-                <Setting name="cameraSpeed">25</Setting>
+            <Group
+                name="Empty Terrain.mis">
+                <Setting
+                    name="cameraSpeed">25</Setting>
             </Group>
             </Group>
-            <Group name="PbrMatTest.mis">
-                <Setting name="cameraSpeed">5</Setting>
+            <Group
+                name="PbrMatTest.mis">
+                <Setting
+                    name="cameraSpeed">5</Setting>
             </Group>
             </Group>
         </Group>
         </Group>
     </Group>
     </Group>
-    <Group name="MeshRoadEditor">
-        <Setting name="DefaultNormal">0 0 1</Setting>
-        <Setting name="DefaultWidth">10</Setting>
-        <Setting name="HoverSplineColor">255 0 0 255</Setting>
-        <Setting name="SelectedSplineColor">0 255 0 255</Setting>
-        <Setting name="sideMaterialName">DefaultRoadMaterialOther</Setting>
-        <Setting name="topMaterialName">DefaultRoadMaterialTop</Setting>
+    <Group
+        name="MeshRoadEditor">
+        <Setting
+            name="DefaultNormal">0 0 1</Setting>
+        <Setting
+            name="DefaultWidth">10</Setting>
+        <Setting
+            name="HoverSplineColor">255 0 0 255</Setting>
+        <Setting
+            name="SelectedSplineColor">0 255 0 255</Setting>
+        <Setting
+            name="sideMaterialName">DefaultRoadMaterialOther</Setting>
+        <Setting
+            name="topMaterialName">DefaultRoadMaterialTop</Setting>
     </Group>
     </Group>
-    <Group name="NavEditor">
-        <Setting name="backgroundBuild">1</Setting>
-        <Setting name="SpawnClass">AIPlayer</Setting>
-        <Setting name="spawnDatablock">DefaultPlayerData</Setting>
+    <Group
+        name="NavEditor">
+        <Setting
+            name="backgroundBuild">1</Setting>
+        <Setting
+            name="SpawnClass">AIPlayer</Setting>
+        <Setting
+            name="spawnDatablock">DefaultPlayerData</Setting>
     </Group>
     </Group>
-    <Group name="RiverEditor">
-        <Setting name="DefaultDepth">5</Setting>
-        <Setting name="DefaultNormal">0 0 1</Setting>
-        <Setting name="DefaultWidth">10</Setting>
-        <Setting name="HoverNodeColor">255 255 255 255</Setting>
-        <Setting name="HoverSplineColor">255 0 0 255</Setting>
-        <Setting name="SelectedSplineColor">0 255 0 255</Setting>
+    <Group
+        name="RiverEditor">
+        <Setting
+            name="DefaultDepth">5</Setting>
+        <Setting
+            name="DefaultNormal">0 0 1</Setting>
+        <Setting
+            name="DefaultWidth">10</Setting>
+        <Setting
+            name="HoverNodeColor">255 255 255 255</Setting>
+        <Setting
+            name="HoverSplineColor">255 0 0 255</Setting>
+        <Setting
+            name="SelectedSplineColor">0 255 0 255</Setting>
     </Group>
     </Group>
-    <Group name="RoadEditor">
-        <Setting name="DefaultWidth">10</Setting>
-        <Setting name="HoverNodeColor">255 255 255 255</Setting>
-        <Setting name="materialName">DefaultDecalRoadMaterial</Setting>
-        <Setting name="SelectedSplineColor">0 255 0 255</Setting>
+    <Group
+        name="RoadEditor">
+        <Setting
+            name="DefaultWidth">10</Setting>
+        <Setting
+            name="HoverNodeColor">255 255 255 255</Setting>
+        <Setting
+            name="materialName">DefaultDecalRoadMaterial</Setting>
+        <Setting
+            name="SelectedSplineColor">0 255 0 255</Setting>
     </Group>
     </Group>
-    <Group name="ShapeEditor">
-        <Setting name="AdvancedWndVisible">1</Setting>
-        <Setting name="backgroundColor">0 0 0 100</Setting>
-        <Setting name="gridDimension">40 40</Setting>
-        <Setting name="gridSize">0.1</Setting>
-        <Setting name="highlightMaterial">1</Setting>
-        <Setting name="RenderCollision">0</Setting>
-        <Setting name="renderMounts">1</Setting>
-        <Setting name="showBounds">0</Setting>
-        <Setting name="ShowGrid">1</Setting>
-        <Setting name="showNodes">1</Setting>
-        <Setting name="showObjBox">1</Setting>
-        <Setting name="SunAmbientColor">180 180 180 255</Setting>
-        <Setting name="SunAngleX">45</Setting>
-        <Setting name="SunAngleZ">135</Setting>
-        <Setting name="SunDiffuseColor">255 255 255 255</Setting>
+    <Group
+        name="ShapeEditor">
+        <Setting
+            name="AdvancedWndVisible">1</Setting>
+        <Setting
+            name="backgroundColor">0 0 0 100</Setting>
+        <Setting
+            name="gridDimension">40 40</Setting>
+        <Setting
+            name="gridSize">0.1</Setting>
+        <Setting
+            name="highlightMaterial">1</Setting>
+        <Setting
+            name="RenderCollision">0</Setting>
+        <Setting
+            name="renderMounts">1</Setting>
+        <Setting
+            name="showBounds">0</Setting>
+        <Setting
+            name="ShowGrid">1</Setting>
+        <Setting
+            name="showNodes">1</Setting>
+        <Setting
+            name="showObjBox">1</Setting>
+        <Setting
+            name="SunAmbientColor">180 180 180 255</Setting>
+        <Setting
+            name="SunAngleX">45</Setting>
+        <Setting
+            name="SunAngleZ">135</Setting>
+        <Setting
+            name="SunDiffuseColor">255 255 255 255</Setting>
     </Group>
     </Group>
-    <Group name="TerrainEditor">
-        <Setting name="currentAction">lowerHeight</Setting>
-        <Group name="ActionValues">
-            <Setting name="adjustHeightVal">10</Setting>
-            <Setting name="noiseFactor">1</Setting>
-            <Setting name="scaleVal">1</Setting>
-            <Setting name="setHeightVal">100</Setting>
-            <Setting name="SlopeMaxAngle">90</Setting>
-            <Setting name="SlopeMinAngle">0</Setting>
-            <Setting name="smoothFactor">0.1</Setting>
-            <Setting name="softSelectDefaultFilter">1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000</Setting>
-            <Setting name="softSelectFilter">1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000</Setting>
-            <Setting name="softSelectRadius">50</Setting>
+    <Group
+        name="TerrainEditor">
+        <Setting
+            name="currentAction">lowerHeight</Setting>
+        <Group
+            name="ActionValues">
+            <Setting
+                name="adjustHeightVal">10</Setting>
+            <Setting
+                name="noiseFactor">1</Setting>
+            <Setting
+                name="scaleVal">1</Setting>
+            <Setting
+                name="setHeightVal">100</Setting>
+            <Setting
+                name="SlopeMaxAngle">90</Setting>
+            <Setting
+                name="SlopeMinAngle">0</Setting>
+            <Setting
+                name="smoothFactor">0.1</Setting>
+            <Setting
+                name="softSelectDefaultFilter">1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000</Setting>
+            <Setting
+                name="softSelectFilter">1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000</Setting>
+            <Setting
+                name="softSelectRadius">50</Setting>
         </Group>
         </Group>
-        <Group name="Brush">
-            <Setting name="brushPressure">1</Setting>
-            <Setting name="brushSize">40 40</Setting>
-            <Setting name="brushSoftness">1</Setting>
-            <Setting name="brushType">ellipse</Setting>
-            <Setting name="maxBrushSize">40 40</Setting>
+        <Group
+            name="Brush">
+            <Setting
+                name="brushPressure">1</Setting>
+            <Setting
+                name="brushSize">40 40</Setting>
+            <Setting
+                name="brushSoftness">1</Setting>
+            <Setting
+                name="brushType">ellipse</Setting>
+            <Setting
+                name="maxBrushSize">40 40</Setting>
         </Group>
         </Group>
     </Group>
     </Group>
-    <Group name="Theme">
-        <Setting name="dividerDarkColor">17 16 15 255</Setting>
-        <Setting name="dividerLightColor">96 94 92 255</Setting>
-        <Setting name="dividerMidColor">50 49 48 255</Setting>
-        <Setting name="fieldBGColor">59 58 57 255</Setting>
-        <Setting name="fieldBGHLColor">72 70 68 255</Setting>
-        <Setting name="fieldBGSELColor">100 98 96 255</Setting>
-        <Setting name="fieldTextColor">178 175 172 255</Setting>
-        <Setting name="fieldTextHLColor">234 232 230 255</Setting>
-        <Setting name="fieldTextNAColor">120 120 120 255</Setting>
-        <Setting name="fieldTextSELColor">255 255 255 255</Setting>
-        <Setting name="headerColor">50 49 48 255</Setting>
-        <Setting name="headerTextColor">236 234 232 255</Setting>
-        <Setting name="tabsColor">37 36 35 255</Setting>
-        <Setting name="tabsHLColor">50 49 48 255</Setting>
-        <Setting name="tabsSELColor">59 58 57 255</Setting>
-        <Setting name="tooltipBGColor">43 43 43 255</Setting>
-        <Setting name="tooltipDividerColor">72 70 68 255</Setting>
-        <Setting name="tooltipTextColor">255 255 255 255</Setting>
-        <Setting name="windowBackgroundColor">32 31 30 255</Setting>
+    <Group
+        name="Theme">
+        <Setting
+            name="dividerDarkColor">17 16 15 255</Setting>
+        <Setting
+            name="dividerLightColor">96 94 92 255</Setting>
+        <Setting
+            name="dividerMidColor">50 49 48 255</Setting>
+        <Setting
+            name="fieldBGColor">59 58 57 255</Setting>
+        <Setting
+            name="fieldBGHLColor">72 70 68 255</Setting>
+        <Setting
+            name="fieldBGSELColor">100 98 96 255</Setting>
+        <Setting
+            name="fieldTextColor">178 175 172 255</Setting>
+        <Setting
+            name="fieldTextHLColor">234 232 230 255</Setting>
+        <Setting
+            name="fieldTextNAColor">120 120 120 255</Setting>
+        <Setting
+            name="fieldTextSELColor">255 255 255 255</Setting>
+        <Setting
+            name="headerColor">50 49 48 255</Setting>
+        <Setting
+            name="headerTextColor">236 234 232 255</Setting>
+        <Setting
+            name="tabsColor">37 36 35 255</Setting>
+        <Setting
+            name="tabsHLColor">50 49 48 255</Setting>
+        <Setting
+            name="tabsSELColor">59 58 57 255</Setting>
+        <Setting
+            name="tooltipBGColor">43 43 43 255</Setting>
+        <Setting
+            name="tooltipDividerColor">72 70 68 255</Setting>
+        <Setting
+            name="tooltipTextColor">255 255 255 255</Setting>
+        <Setting
+            name="windowBackgroundColor">32 31 30 255</Setting>
     </Group>
     </Group>
-    <Group name="WorldEditor">
-        <Setting name="currentEditor">WorldEditorInspectorPlugin</Setting>
-        <Setting name="displayType">6</Setting>
-        <Setting name="dropType">screenCenter</Setting>
-        <Setting name="EditorLayoutMode">Modern</Setting>
-        <Setting name="forceLoadDAE">0</Setting>
-        <Setting name="forceSidebarToSide">1</Setting>
-        <Setting name="lastEditedLevel">FPSGameplay:EmptyLevel</Setting>
-        <Setting name="orthoFOV">50</Setting>
-        <Setting name="orthoShowGrid">1</Setting>
-        <Setting name="recentLevelsList">FPSGameplay:EmptyLevel,FPSGameplay:EmptyTerrain,pbr:PbrMatTestLevel,TTR:DasBootLevel</Setting>
-        <Setting name="startupMode">Blank Level</Setting>
-        <Setting name="torsionPath">AssetWork_Debug.exe</Setting>
-        <Setting name="undoLimit">40</Setting>
-        <Group name="Color">
-            <Setting name="dragRectColor">255 255 0 255</Setting>
-            <Setting name="objectTextColor">255 255 255 255</Setting>
-            <Setting name="objMouseOverColor">0 255 0 255</Setting>
-            <Setting name="objMouseOverSelectColor">0 0 255 255</Setting>
-            <Setting name="objSelectColor">255 0 0 255</Setting>
-            <Setting name="popupBackgroundColor">100 100 100 255</Setting>
-            <Setting name="selectionBoxColor">255 255 0 255</Setting>
+    <Group
+        name="WorldEditor">
+        <Setting
+            name="currentEditor">WorldEditorInspectorPlugin</Setting>
+        <Setting
+            name="displayType">6</Setting>
+        <Setting
+            name="dropType">screenCenter</Setting>
+        <Setting
+            name="EditorLayoutMode">Modern</Setting>
+        <Setting
+            name="forceLoadDAE">0</Setting>
+        <Setting
+            name="forceSidebarToSide">1</Setting>
+        <Setting
+            name="lastEditedLevel">FPSGameplay:EmptyLevel</Setting>
+        <Setting
+            name="orthoFOV">4.60158</Setting>
+        <Setting
+            name="orthoShowGrid">1</Setting>
+        <Setting
+            name="recentLevelsList">FPSGameplay:EmptyLevel,FPSGameplay:EmptyTerrain,pbr:PbrMatTestLevel,TTR:DasBootLevel</Setting>
+        <Setting
+            name="startupMode">Blank Level</Setting>
+        <Setting
+            name="torsionPath">AssetWork_Debug.exe</Setting>
+        <Setting
+            name="undoLimit">40</Setting>
+        <Group
+            name="Color">
+            <Setting
+                name="dragRectColor">255 255 0 255</Setting>
+            <Setting
+                name="objectTextColor">255 255 255 255</Setting>
+            <Setting
+                name="objMouseOverColor">0 255 0 255</Setting>
+            <Setting
+                name="objMouseOverSelectColor">0 0 255 255</Setting>
+            <Setting
+                name="objSelectColor">255 0 0 255</Setting>
+            <Setting
+                name="popupBackgroundColor">100 100 100 255</Setting>
+            <Setting
+                name="selectionBoxColor">255 255 0 255</Setting>
         </Group>
         </Group>
-        <Group name="Docs">
-            <Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
-            <Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
-            <Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
-            <Setting name="forumURL">http://www.garagegames.com/products/torque-3d/forums</Setting>
+        <Group
+            name="Docs">
+            <Setting
+                name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
+            <Setting
+                name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
+            <Setting
+                name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
+            <Setting
+                name="forumURL">http://www.garagegames.com/products/torque-3d/forums</Setting>
         </Group>
         </Group>
-        <Group name="Grid">
-            <Setting name="gridColor">102 102 102 100</Setting>
-            <Setting name="gridMinorColor">51 51 51 100</Setting>
-            <Setting name="gridOriginColor">255 255 255 100</Setting>
-            <Setting name="gridSize">1</Setting>
-            <Setting name="gridSnap">0</Setting>
+        <Group
+            name="Grid">
+            <Setting
+                name="gridColor">102 102 102 100</Setting>
+            <Setting
+                name="gridMinorColor">51 51 51 100</Setting>
+            <Setting
+                name="gridOriginColor">255 255 255 100</Setting>
+            <Setting
+                name="gridSize">1</Setting>
+            <Setting
+                name="gridSnap">0</Setting>
         </Group>
         </Group>
-        <Group name="Images">
-            <Setting name="defaultHandle">tools/worldEditor/images/DefaultHandle</Setting>
-            <Setting name="lockedHandle">tools/worldEditor/images/LockedHandle</Setting>
-            <Setting name="selectHandle">tools/worldEditor/images/SelectHandle</Setting>
+        <Group
+            name="Images">
+            <Setting
+                name="defaultHandle">tools/worldEditor/images/DefaultHandle</Setting>
+            <Setting
+                name="lockedHandle">tools/worldEditor/images/LockedHandle</Setting>
+            <Setting
+                name="selectHandle">tools/worldEditor/images/SelectHandle</Setting>
         </Group>
         </Group>
-        <Group name="Layout">
-            <Setting name="LayoutMode">Classic</Setting>
+        <Group
+            name="Layout">
+            <Setting
+                name="LayoutMode">Classic</Setting>
         </Group>
         </Group>
-        <Group name="ObjectIcons">
-            <Setting name="fadeIcons">1</Setting>
-            <Setting name="fadeIconsEndAlpha">0</Setting>
-            <Setting name="fadeIconsEndDist">20</Setting>
-            <Setting name="fadeIconsStartAlpha">255</Setting>
-            <Setting name="fadeIconsStartDist">8</Setting>
+        <Group
+            name="ObjectIcons">
+            <Setting
+                name="fadeIcons">1</Setting>
+            <Setting
+                name="fadeIconsEndAlpha">0</Setting>
+            <Setting
+                name="fadeIconsEndDist">20</Setting>
+            <Setting
+                name="fadeIconsStartAlpha">255</Setting>
+            <Setting
+                name="fadeIconsStartDist">8</Setting>
         </Group>
         </Group>
-        <Group name="Render">
-            <Setting name="renderObjHandle">1</Setting>
-            <Setting name="renderObjText">1</Setting>
-            <Setting name="renderPopupBackground">1</Setting>
-            <Setting name="renderSelectionBox">1</Setting>
-            <Setting name="showMousePopupInfo">1</Setting>
+        <Group
+            name="Render">
+            <Setting
+                name="renderObjHandle">1</Setting>
+            <Setting
+                name="renderObjText">1</Setting>
+            <Setting
+                name="renderPopupBackground">1</Setting>
+            <Setting
+                name="renderSelectionBox">1</Setting>
+            <Setting
+                name="showMousePopupInfo">1</Setting>
         </Group>
         </Group>
-        <Group name="Theme">
-            <Setting name="windowTitleBGColor">50 50 50 255</Setting>
-            <Setting name="windowTitleBGHLColor">48 48 48 255</Setting>
-            <Setting name="windowTitleBGNAColor">180 180 180 255</Setting>
-            <Setting name="windowTitleFontColor">215 215 215 255</Setting>
-            <Setting name="windowTitleFontHLColor">255 255 255 255</Setting>
+        <Group
+            name="Theme">
+            <Setting
+                name="windowTitleBGColor">50 50 50 255</Setting>
+            <Setting
+                name="windowTitleBGHLColor">48 48 48 255</Setting>
+            <Setting
+                name="windowTitleBGNAColor">180 180 180 255</Setting>
+            <Setting
+                name="windowTitleFontColor">215 215 215 255</Setting>
+            <Setting
+                name="windowTitleFontHLColor">255 255 255 255</Setting>
         </Group>
         </Group>
-        <Group name="Tools">
-            <Setting name="boundingBoxCollision">0</Setting>
-            <Setting name="dropAtScreenCenterMax">100</Setting>
-            <Setting name="dropAtScreenCenterScalar">1</Setting>
-            <Setting name="objectsUseBoxCenter">1</Setting>
-            <Setting name="OffsetZValue">0.01</Setting>
-            <Setting name="snapGround">0</Setting>
-            <Setting name="snapSoft">0</Setting>
-            <Setting name="snapSoftSize">2</Setting>
-            <Setting name="TerrainSnapOffsetZ">0</Setting>
+        <Group
+            name="Tools">
+            <Setting
+                name="boundingBoxCollision">0</Setting>
+            <Setting
+                name="dropAtScreenCenterMax">100</Setting>
+            <Setting
+                name="dropAtScreenCenterScalar">1</Setting>
+            <Setting
+                name="objectsUseBoxCenter">1</Setting>
+            <Setting
+                name="OffsetZValue">0.01</Setting>
+            <Setting
+                name="snapGround">0</Setting>
+            <Setting
+                name="snapSoft">0</Setting>
+            <Setting
+                name="snapSoftSize">2</Setting>
+            <Setting
+                name="TerrainSnapOffsetZ">0</Setting>
         </Group>
         </Group>
     </Group>
     </Group>
 </EditorSettings>
 </EditorSettings>

+ 1 - 1
Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditorActions.ed.tscript

@@ -361,7 +361,7 @@ function ActionAddSequence::doit( %this )
       //We adjust due to the list "header" row as well
       //We adjust due to the list "header" row as well
       %idx -= 1;
       %idx -= 1;
       
       
-      %animSet = "ShapeEditorPlugin.selectedAssetDef.animationSequence"@%idx@"=\"@Asset="@%moduleName@":"@%assetDef.assetName@"\";";
+      %animSet = "ShapeEditorPlugin.selectedAssetDef.animationSequence"@%idx@"=\"@asset="@%moduleName@":"@%assetDef.assetName@"\";";
       eval(%animSet);
       eval(%animSet);
       
       
       %assetPath = AssetDatabase.getAssetFilePath(ShapeEditorPlugin.selectedAssetId);
       %assetPath = AssetDatabase.getAssetFilePath(ShapeEditorPlugin.selectedAssetId);

+ 1 - 1
Templates/BaseGame/game/tools/worldEditor/gui/EditorChooseLevelGui.ed.gui

@@ -28,7 +28,7 @@
       Visible = "1";
       Visible = "1";
       tooltipprofile = "ToolsGuiToolTipProfile";
       tooltipprofile = "ToolsGuiToolTipProfile";
       hovertime = "1000";
       hovertime = "1000";
-      bitmap = "art/gui/background";
+      bitmap = "data/ui/images/background.png";
       useVariable = "0";
       useVariable = "0";
       tile = "0";
       tile = "0";
    };
    };

+ 2 - 2
Templates/BaseGame/game/tools/worldEditor/gui/EditorGui.ed.gui

@@ -481,8 +481,8 @@
       selectionBoxColor = "255 255 0 255";
       selectionBoxColor = "255 255 0 255";
       selectionLocked = "0";
       selectionLocked = "0";
       toggleIgnoreList = "0";
       toggleIgnoreList = "0";
-      selectHandle = "tools/worldEditor/images/SelectHandle.png";
-      defaultHandle = "tools/worldEditor/images/DefaultHandle.png";
+      selectHandle = "ToolsModule:SelectHandle_image";
+      defaultHandle = "ToolsModule:DefaultHandle_image";
       lockedHandleAsset = "ToolsModule:LockedHandle_image";
       lockedHandleAsset = "ToolsModule:LockedHandle_image";
    };
    };
    new TerrainEditor(ETerrainEditor) {
    new TerrainEditor(ETerrainEditor) {

Різницю між файлами не показано, бо вона завелика
+ 199 - 366
Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainMaterialDlg.ed.gui


+ 125 - 2
Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui

@@ -299,7 +299,120 @@ function ObjectBuilderGui::gotTerrainAsset(%this, %name)
    //%this.controls[%this.currentControl].setValue(%name);
    //%this.controls[%this.currentControl].setValue(%name);
 }
 }
 //------------------------------------------------------------------------------
 //------------------------------------------------------------------------------
+function ObjectBuilderGui::createImageAssetType(%this, %index)
+{
+   if(%index >= %this.numFields || %this.field[%index, name] $= "")
+   {
+      error("ObjectBuilderGui::createImageAssetType: invalid field");
+      return;
+   }
+
+   //
+   if(%this.field[%index, text] $= "")
+      %name = %this.field[%index, name];
+   else
+      %name = %this.field[%index, text];
+
+   // 
+   /*%this.textControls[%this.numControls] = new GuiTextCtrl() {
+      profile = "ToolsGuiTextRightProfile";
+      internalName = "assetText";
+      text = %name;
+      extent = %this.fieldNameExtent;
+      position = %this.curXPos @ " " @ %this.curYPos;
+      modal = "1";
+   };
+
+   // 
+   %this.controls[%this.numControls] = new GuiButtonCtrl() {
+      HorizSizing = "width";
+      profile = "ToolsGuiButtonProfile";
+      internalName = "assetButton";
+      extent = %this.fileButtonExtent;
+      position = %this.curXPos + %this.columnOffset @ " " @ %this.curYPos;
+      modal = "1";
+      command = %this @ ".getImageAsset(" @ %index @ ");";
+   };
+
+   %val = %this.field[%index, value];
+   %this.controls[%this.numControls].setText(fileBase(%val) @ fileExt(%val));*/
+   
+   %this.textControls[%this.numControls] = new GuiTextCtrl() {
+      profile = "ToolsGuiTextRightProfile";
+      text = %name;
+      extent = %this.fieldNameExtent;
+      position = %this.curXPos @ " " @ %this.curYPos;
+      modal = "1";
+   };
+
+   // 
+   %this.controls[%this.numControls] = new GuiControl() {
+      HorizSizing = "width";
+      profile = "ToolsGuiDefaultProfile";
+      extent = %this.textEditExtent;
+      position = %this.curXPos + %this.columnOffset @ " " @ %this.curYPos;
+      modal = "1";
+   };
+   
+   %text = new GuiTextEditCtrl() {
+      class = ObjectBuilderGuiTextEditCtrl;
+      internalName = "assetText";
+      HorizSizing = "width";
+      profile = "ToolsGuiTextEditProfile";
+      extent = getWord(%this.textEditExtent,0) - getWord(%this.matButtonExtent,0) - 2 @ " " @ getWord(%this.textEditExtent,1);
+      text = %this.field[%index, value];
+      position = "0 0";
+      modal = "1";
+   };
+   %this.controls[%this.numControls].addGuiControl(%text);
+   
+   %button = new GuiBitmapButtonCtrl() {
+      internalName = "assetButton";
+      HorizSizing = "left";
+      profile = "ToolsGuiButtonProfile";
+      extent = %this.matButtonExtent;
+      position = getWord(%this.textEditExtent,0) - getWord(%this.matButtonExtent,0) @ " 0";
+      modal = "1";
+      command = %this @ ".getImageAsset(" @ %index @ ");";
+   };
+   %button.setBitmap("tools/materialEditor/gui/change-material-btn");
+   %this.controls[%this.numControls].addGuiControl(%button);
 
 
+   %this.numControls++;
+   %this.curYPos += %this.defaultFieldStep;
+}
+
+function ObjectBuilderGui::getImageAsset(%this, %index)
+{
+   if(%index >= %this.numFields || %this.field[%index, name] $= "")
+   {
+      error("ObjectBuilderGui::getImageAsset: invalid field");
+      return;
+   }
+   
+   %val = %this.field[%index, ext];
+
+   //%path = filePath(%val);
+   //%ext = fileExt(%val);
+
+   %this.currentControl = %index;
+   AssetBrowser.showDialog("ImageAsset", %this @ ".gotImageAsset", "", "", "");
+   //getLoadFilename( %val @ "|" @ %val, %this @ ".gotFileName", %this.lastPath );
+}
+
+function ObjectBuilderGui::gotImageAsset(%this, %name)
+{
+   %index = %this.currentControl;
+   
+   %this.field[%index, value] = %name;
+   %this.controls[%this.currentControl]-->assetText.setText(%name);
+   
+   %this.lastPath = %name;
+   
+   // This doesn't work for button controls as getValue returns their state!
+   //%this.controls[%this.currentControl].setValue(%name);
+}
+//------------------------------------------------------------------------------
 function ObjectBuilderGui::createMaterialNameType(%this, %index)
 function ObjectBuilderGui::createMaterialNameType(%this, %index)
 {
 {
    if(%index >= %this.numFields || %this.field[%index, name] $= "")
    if(%index >= %this.numFields || %this.field[%index, name] $= "")
@@ -564,6 +677,9 @@ function ObjectBuilderGui::process(%this)
          case "TypeTerrainAsset":
          case "TypeTerrainAsset":
             %this.createTerrainAssetType(%i);
             %this.createTerrainAssetType(%i);
 
 
+         case "TypeImageAsset":
+            %this.createImageAssetType(%i);
+
          case "TypeMaterialName":
          case "TypeMaterialName":
             %this.createMaterialNameType(%i);
             %this.createMaterialNameType(%i);
 
 
@@ -636,6 +752,12 @@ function ObjectBuilderGui::onOK(%this)
          %this.field[%i, value] = %this.controls[%i]-->MatText.getValue();
          %this.field[%i, value] = %this.controls[%i]-->MatText.getValue();
          continue;
          continue;
       }
       }
+      if (%this.field[%i, type] $= "TypeImageAsset" || 
+      %this.field[%i, type] $= "TypeTerrainAsset")
+      {
+         %this.field[%i, value] = %this.controls[%i]-->assetText.getText();
+         continue;
+      }
       %this.field[%i, value] = %this.controls[%i].getValue();
       %this.field[%i, value] = %this.controls[%i].getValue();
    }
    }
       
       
@@ -736,7 +858,7 @@ function ObjectBuilderGui::buildScatterSky( %this, %dontWarnAboutSun )
    // This is a trick... any fields added after process won't show
    // This is a trick... any fields added after process won't show
    // up as controls, but will be applied to the created object.
    // up as controls, but will be applied to the created object.
    %this.addField( "flareType", "TypeLightFlareDataPtr", "Flare", "ScatterSkyFlareExample" );
    %this.addField( "flareType", "TypeLightFlareDataPtr", "Flare", "ScatterSkyFlareExample" );
-   %this.addField( "moonMat", "TypeMaterialName", "Moon Material", "Moon_Glow_Mat" );
+   %this.addField( "moonMatAsset", "TypeMaterialAsset", "Moon Material", "Core_Rendering:moon_wglow" );
    %this.addField( "nightCubemap", "TypeCubemapName", "Night Cubemap", "NightCubemap" );
    %this.addField( "nightCubemap", "TypeCubemapName", "Night Cubemap", "NightCubemap" );
    %this.addField( "useNightCubemap", "TypeBool", "Use Night Cubemap", "true" );
    %this.addField( "useNightCubemap", "TypeBool", "Use Night Cubemap", "true" );
    
    
@@ -746,7 +868,8 @@ function ObjectBuilderGui::buildCloudLayer(%this)
 {
 {
    OBObjectName.setValue( "" );      
    OBObjectName.setValue( "" );      
    %this.objectClassName = "CloudLayer";
    %this.objectClassName = "CloudLayer";
-   %this.addField( "texture", "TypeImageFilename", "Texture", "core/rendering/images/clouds_normal_displacement" );   
+   %this.addField( "textureAsset", "TypeImageAsset", "Image", "Core_Rendering:clouds_normal_displacement_image" ); 
+   //%this.addField( "textureFile", "TypeImageFilename", "Texture", "core/rendering/images/clouds_normal_displacement" );   
 	%this.process();
 	%this.process();
 }
 }
 
 

+ 4 - 2
Templates/BaseGame/game/tools/worldEditor/scripts/editors/terrainEditor.ed.tscript

@@ -61,7 +61,9 @@ function TerrainEditor::setPaintMaterial( %this, %matIndex, %terrainMat )
    ETerrainEditor.paintIndex = %matIndex;
    ETerrainEditor.paintIndex = %matIndex;
    ETerrainMaterialSelected.selectedMatIndex = %matIndex;
    ETerrainMaterialSelected.selectedMatIndex = %matIndex;
    ETerrainMaterialSelected.selectedMat = %terrainMat;
    ETerrainMaterialSelected.selectedMat = %terrainMat;
-   ETerrainMaterialSelected.bitmap = %terrainMat.diffuseMap;
+   
+   ETerrainMaterialSelected.setBitmap(%terrainMat.getDiffuseMap());
+
    ETerrainMaterialSelectedEdit.Visible = isObject(%terrainMat);
    ETerrainMaterialSelectedEdit.Visible = isObject(%terrainMat);
    TerrainTextureText.text = %terrainMat.getInternalName();
    TerrainTextureText.text = %terrainMat.getInternalName();
    ProceduralTerrainPainterDescription.text = "Generate "@ %terrainMat.getInternalName() @" layer";
    ProceduralTerrainPainterDescription.text = "Generate "@ %terrainMat.getInternalName() @" layer";
@@ -139,7 +141,7 @@ function EPainter::updateLayers( %this, %matIndex )
       };
       };
 
 
       %ctrl.setText( %matInternalName );
       %ctrl.setText( %matInternalName );
-      %ctrl.setBitmap( %mat.diffuseMap );
+      %ctrl.setBitmap( %mat.getDiffuseMap() );
 
 
       %tooltip = %matInternalName;
       %tooltip = %matInternalName;
       if(%i < 9)
       if(%i < 9)

+ 218 - 148
Templates/BaseGame/game/tools/worldEditor/scripts/interfaces/terrainMaterialDlg.ed.tscript

@@ -20,6 +20,7 @@
 // IN THE SOFTWARE.
 // IN THE SOFTWARE.
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
+$TerrainMaterialEditor::emptyMaterialImage = "ToolsModule:unknownImage_image";
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
@@ -34,6 +35,7 @@ function TerrainMaterialDlg::show( %this, %matIndex, %terrMat, %onApplyCallback
    %item = %matLibTree.findItemByObjectId( %terrMat );
    %item = %matLibTree.findItemByObjectId( %terrMat );
    if ( %item != -1 )
    if ( %item != -1 )
    {
    {
+      %matLibTree.selectItem( %item, false );
       %matLibTree.selectItem( %item );
       %matLibTree.selectItem( %item );
       %matLibTree.scrollVisible( %item );
       %matLibTree.scrollVisible( %item );
    }
    }
@@ -164,11 +166,26 @@ function TerrainMaterialDlg::dialogApply( %this )
    Canvas.popDialog( TerrainMaterialDlg ); 
    Canvas.popDialog( TerrainMaterialDlg ); 
                             
                             
    call( %this.onApplyCallback, %this.activeMat, %this.matIndex );
    call( %this.onApplyCallback, %this.activeMat, %this.matIndex );
+   
+   TerrainMaterialDlg.matDirty = false;
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
 function TerrainMaterialDlg::dialogCancel( %this )
 function TerrainMaterialDlg::dialogCancel( %this )
+{
+   if(TerrainMaterialDlg.matDirty)
+   {
+      toolsMessageBoxYesNo("Save Dirty Material?", "The current material has been modified. Do you wish save your changes?", 
+                           "TerrainMaterialDlg.saveDirtyMaterial(" @ %this-->matLibTree.getSelectedItem() @ ");TerrainMaterialDlg.closeDialog();", "TerrainMaterialDlg.closeDialog();");
+   }
+   else
+   {
+      %this.closeDialog();
+   }
+}
+
+function TerrainMaterialDlg::closeDialog( %this )
 {
 {
    // Restore material properties we have changed.
    // Restore material properties we have changed.
    
    
@@ -213,118 +230,67 @@ function TerrainMaterialDlg::setMaterialName( %this, %newName )
       {
       {
          %mat.setInternalName( %newName );
          %mat.setInternalName( %newName );
          %this-->matLibTree.buildVisibleTree( false );
          %this-->matLibTree.buildVisibleTree( false );
+         
+         TerrainMaterialDlg.matDirty = true;
       }
       }
    }
    }
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-function TerrainMaterialDlg::changeBase( %this )
+function TerrainMaterialDlg::clearTextureMap(%this, %mapName)
 {   
 {   
-   %ctrl = %this-->baseTexCtrl;
-   %file = %ctrl.bitmap;
-   if( getSubStr( %file, 0 , 6 ) $= "tools/" )
-      %file = "";
+   %targetMapName = "tex" @ %mapName;
+   %targetMap = %this.findObjectByInternalName(%targetMapName, true);
       
       
-   %file = TerrainMaterialDlg._selectTextureFileDialog( %file );      
-   if( %file $= "" )
-   {
-      if( %ctrl.bitmap !$= "" )
-         %file = %ctrl.bitmap;
-      else
-         %file = "tools/materialEditor/gui/unknownImage";
-   }
-   
-   %file = makeRelativePath( %file, getMainDotCsDir() );
-   %ctrl.setBitmap( %file );  
-}
-
-//-----------------------------------------------------------------------------
+   %targetMap.setBitmap($TerrainMaterialEditor::emptyMaterialImage);
+   %targetMap.asset = "";
 
 
-function TerrainMaterialDlg::changeDetail( %this )
-{
-   %ctrl = %this-->detailTexCtrl;
-   %file = %ctrl.bitmap;
-   if( getSubStr( %file, 0 , 6 ) $= "tools/" )
-      %file = "";
+   TerrainMaterialDlg.matDirty = true;
 
 
-   %file = TerrainMaterialDlg._selectTextureFileDialog( %file );  
-   if( %file $= "" )
+   if(%mapName $= "DetailMap")
    {
    {
-      if( %ctrl.bitmap !$= "" )
-         %file = %ctrl.bitmap;
-      else
-         %file = "tools/materialEditor/gui/unknownImage";
+      //hide the supplemental maps
+      NormalMapContainer.callOnChildren("setActive", false);  
+      ORMMapContainer.callOnChildren("setActive", false);
+      MacroMapContainer.callOnChildren("setActive", false);
    }
    }
-   
-   %file = makeRelativePath( %file, getMainDotCsDir() );
-   %ctrl.setBitmap( %file );  
 }
 }
 
 
-//----------------------------------------------------------------------------
-
-function TerrainMaterialDlg::changeMacro( %this )
+function TerrainMaterialDlg::updateTextureMap(%this, %mapName)
 {
 {
-   %ctrl = %this-->macroTexCtrl;
-   %file = %ctrl.bitmap;
-   if( getSubStr( %file, 0 , 6 ) $= "tools/" )
-      %file = "";
-
-   %file = TerrainMaterialDlg._selectTextureFileDialog( %file );  
-   if( %file $= "" )
-   {
-      if( %ctrl.bitmap !$= "" )
-         %file = %ctrl.bitmap;
-      else
-         %file = "tools/materialEditor/gui/unknownImage";
-   }
+   %this.updateTargetMap = %mapName;
    
    
-   %file = makeRelativePath( %file, getMainDotCsDir() );
-   %ctrl.setBitmap( %file );  
+   AssetBrowser.showDialog("ImageAsset", %this@".changeTerrainMatMapAsset", "", "");
 }
 }
 
 
+function TerrainMaterialDlg::changeTerrainMatMapAsset(%this)
+{
+   %targetMapName = "tex" @ %this.updateTargetMap;
+   %targetMap = %this.findObjectByInternalName(%targetMapName, true);
 
 
-//-----------------------------------------------------------------------------
-
-function TerrainMaterialDlg::changeNormal( %this )
+   %imgAsset = AssetBrowser.selectedAsset;
+   if(%imgAsset !$= "")
 {   
 {   
-   %ctrl = %this-->normTexCtrl;
-   %file = %ctrl.bitmap;
-   if( getSubStr( %file, 0 , 6 ) $= "tools/" )
-      %file = "";
+      %targetMap.asset = %imgAsset;
+      %image = %imgAsset;
 
 
-   %file = TerrainMaterialDlg._selectTextureFileDialog( %file );  
-   if( %file $= "" )
+      if(%this.updateTargetMap $= "DetailMap")
    {
    {
-      if( %ctrl.bitmap !$= "" )
-         %file = %ctrl.bitmap;
-      else
-         %file = "tools/materialEditor/gui/unknownImage";
+         //show the supplemental maps
+         NormalMapContainer.callOnChildren("setActive", true);  
+         ORMMapContainer.callOnChildren("setActive", true);
+         MacroMapContainer.callOnChildren("setActive", true);
    }
    }
-
-   %file = makeRelativePath( %file, getMainDotCsDir() );
-   %ctrl.setBitmap( %file );   
 }
 }
-
-//-----------------------------------------------------------------------------
-function TerrainMaterialDlg::changeormConfig( %this )
-{   
-   %ctrl = %this-->ormConfigTexCtrl;
-   %file = %ctrl.bitmap;
-   if( getSubStr( %file, 0 , 6 ) $= "tools/" )
-      %file = "";
-
-   %file = TerrainMaterialDlg._selectTextureFileDialog( %file );  
-   if( %file $= "" )
-   {
-      if( %ctrl.bitmap !$= "" )
-         %file = %ctrl.bitmap;
       else
       else
-         %file = "tools/materialEditor/gui/unknownImage";
+   {
+      %image = $TerrainMaterialEditor::emptyMaterialImage;
    }
    }
 
 
-   %file = makeRelativePath( %file, getMainDotCsDir() );
-   %ctrl.setBitmap( %file );   
+   %targetMap.setBitmap( %image );  
+
+   TerrainMaterialDlg.matDirty = true;
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -384,22 +350,49 @@ function TerrainMaterialDlg::activateMaterialCtrls( %this, %active )
    %parent = %this-->matSettingsParent;
    %parent = %this-->matSettingsParent;
    %count = %parent.getCount();
    %count = %parent.getCount();
    for ( %i = 0; %i < %count; %i++ )
    for ( %i = 0; %i < %count; %i++ )
+   {
+      %ctrl = %parent.getObject( %i );
+      %ctrlnm = %ctrl.getName();
+      %ictrlnm = %ctrl.getInternalName();
       %parent.getObject( %i ).setActive( %active );      
       %parent.getObject( %i ).setActive( %active );      
 }
 }
 
 
+   %detailz = %this-->texDetailMap.getBitmap();
+   if(%this-->texDetailMap.getBitmap() $= "" || %this-->texDetailMap.getBitmap() $= $TerrainMaterialEditor::emptyMaterialImage)
+   {
+      NormalMapContainer.callOnChildren("setActive", false);  
+      ORMMapContainer.callOnChildren("setActive", false);
+      MacroMapContainer.callOnChildren("setActive", false);
+   }
+   else
+   {
+      NormalMapContainer.callOnChildren("setActive", true);  
+      ORMMapContainer.callOnChildren("setActive", true);
+      MacroMapContainer.callOnChildren("setActive", true); 
+   }
+}
+
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
 function TerrainMaterialTreeCtrl::onSelect( %this, %item )
 function TerrainMaterialTreeCtrl::onSelect( %this, %item )
 {
 {
+   if(TerrainMaterialDlg.matDirty)
+   {
+      toolsMessageBoxYesNo("Save Dirty Material?", "The current material has been modified. Do you wish save your changes?", 
+                           "TerrainMaterialDlg.saveDirtyMaterial(" @ TerrainMaterialDlg.previousMat @ ");TerrainMaterialDlg.setActiveMaterial(" @ %item @ ");", 
+                           "TerrainMaterialDlg.setActiveMaterial(" @ %item @ ");");
+   }
+   else
+   {
    TerrainMaterialDlg.setActiveMaterial( %item );
    TerrainMaterialDlg.setActiveMaterial( %item );
 }
 }
+}
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
 function TerrainMaterialTreeCtrl::onUnSelect( %this, %item )
 function TerrainMaterialTreeCtrl::onUnSelect( %this, %item )
 {
 {
-   TerrainMaterialDlg.saveDirtyMaterial( %item );   
-   TerrainMaterialDlg.setActiveMaterial( 0 );   
+   TerrainMaterialDlg.previousMat = %item;
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -410,33 +403,105 @@ function TerrainMaterialDlg::setActiveMaterial( %this, %mat )
          %mat.isMemberOfClass( TerrainMaterial ) )
          %mat.isMemberOfClass( TerrainMaterial ) )
    {
    {
       %this.activeMat = %mat;
       %this.activeMat = %mat;
+      %this.matDirty = false;
       
       
       %this-->matNameCtrl.setText( %mat.internalName );
       %this-->matNameCtrl.setText( %mat.internalName );
-      if (%mat.diffuseMap $= ""){
-         %this-->baseTexCtrl.setBitmap( "tools/materialEditor/gui/unknownImage" );
-      }else{
+
+      //
+      %imgPath = %mat.getDiffuseMap();
          %this-->baseTexCtrl.setBitmap( %mat.diffuseMap ); 
          %this-->baseTexCtrl.setBitmap( %mat.diffuseMap ); 
+         %imgPath = $TerrainMaterialEditor::emptyMaterialImage;
+
+      %this-->texBaseMap.setBitmap( %imgPath );
+      
+      if(%imgPath !$= $TerrainMaterialEditor::emptyMaterialImage)
+      {
+         %imgAsset = %mat.getDiffuseMapAsset();
+         if(%imgAsset $= "")
+            %imgAsset = %imgPath;
+         %this-->diffuseMapAssetId.setText( %imgAsset );
       }
       }
-      if (%mat.ormConfigMap $= ""){
-         %this-->ormConfigTexCtrl.setBitmap( "tools/materialEditor/gui/unknownImage" );
-      }else{
-         %this-->ormConfigTexCtrl.setBitmap( %mat.ormConfigMap );
+      else
+      {
+         %this-->normalMapAssetId.setText( "None" );  
       }
       }
-      if (%mat.detailMap $= ""){
-         %this-->detailTexCtrl.setBitmap( "tools/materialEditor/gui/unknownImage" );
-      }else{
-         %this-->detailTexCtrl.setBitmap( %mat.detailMap );
+
+      //
+      %imgPath = %mat.getNormalMap();
+      if(%imgPath $= "")
+         %imgPath = $TerrainMaterialEditor::emptyMaterialImage;
+
+      %this-->texNormalMap.setBitmap( %imgPath );
+      
+      if(%imgPath !$= $TerrainMaterialEditor::emptyMaterialImage)
+      {
+         %imgAsset = %mat.getNormalMapAsset();
+         if(%imgAsset $= "")
+            %imgAsset = %imgPath;
+         %this-->normalMapAssetId.setText( %imgAsset );
       }
       }
-      if (%mat.macroMap $= ""){
-         %this-->macroTexCtrl.setBitmap( "tools/materialEditor/gui/unknownImage" );
-      }else{
-         %this-->macroTexCtrl.setBitmap( %mat.macroMap );
-      }      
-      if (%mat.normalMap $= ""){
-         %this-->normTexCtrl.setBitmap( "tools/materialEditor/gui/unknownImage" );
-      }else{
-         %this-->normTexCtrl.setBitmap( %mat.normalMap ); 
+      else
+      {
+         %this-->normalMapAssetId.setText( "None" );  
+      }
+
+      //
+      %imgPath = %mat.getORMConfigMap();
+      if(%imgPath $= "")
+         %imgPath = $TerrainMaterialEditor::emptyMaterialImage;
+
+      %this-->texORMConfigMap.setBitmap( %imgPath );
+      
+      if(%imgPath !$= $TerrainMaterialEditor::emptyMaterialImage)
+      {
+         %imgAsset = %mat.getORMConfigMapAsset();
+         if(%imgAsset $= "")
+            %imgAsset = %imgPath;
+         %this-->ORMMapAssetId.setText( %imgAsset );
+      }
+      else
+      {
+         %this-->normalMapAssetId.setText( "None" );  
+      }
+       
+      //
+      %imgPath = %mat.getDetailMap();
+      if(%imgPath $= "")
+         %imgPath = $TerrainMaterialEditor::emptyMaterialImage;
+
+      %this-->texDetailMap.setBitmap( %imgPath );
+      
+      if(%imgPath !$= $TerrainMaterialEditor::emptyMaterialImage)
+      {
+         %imgAsset = %mat.getDetailMapAsset();
+         if(%imgAsset $= "")
+            %imgAsset = %imgPath;
+         %this-->detailMapAssetId.setText( %imgAsset );
       }
       }
+      else
+      {
+         %this-->normalMapAssetId.setText( "None" );  
+      }
+      
+      //
+      %imgPath = %mat.getMacroMap();
+      if(%imgPath $= "")
+         %imgPath = $TerrainMaterialEditor::emptyMaterialImage;
+
+      %this-->texMacroMap.setBitmap( %imgPath );
+
+      if(%imgPath !$= $TerrainMaterialEditor::emptyMaterialImage)
+      {
+         %imgAsset = %mat.getMacroMapAsset();
+         if(%imgAsset $= "")
+            %imgAsset = %imgPath;
+         %this-->macroMapAssetId.setText( %imgAsset );
+      }
+      else
+      {
+         %this-->normalMapAssetId.setText( "None" );  
+      }      
+      
       %this-->detSizeCtrl.setText( %mat.detailSize );
       %this-->detSizeCtrl.setText( %mat.detailSize );
       %this-->baseSizeCtrl.setText( %mat.diffuseSize );
       %this-->baseSizeCtrl.setText( %mat.diffuseSize );
       %this-->detStrengthCtrl.setText( %mat.detailStrength );
       %this-->detStrengthCtrl.setText( %mat.detailStrength );
@@ -481,31 +546,31 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat )
    
    
    %newName = %this-->matNameCtrl.getText(); 
    %newName = %this-->matNameCtrl.getText(); 
    
    
-   if (%this-->baseTexCtrl.bitmap $= "tools/materialEditor/gui/unknownImage"){
+   //---
+   %newDiffuse = %this-->texBaseMap.getBitmap();
+   if(%newDiffuse $= $TerrainMaterialEditor::emptyMaterialImage)
       %newDiffuse = "";
       %newDiffuse = "";
-   }else{
-      %newDiffuse = %this-->baseTexCtrl.bitmap;  
-   }
-   if (%this-->normTexCtrl.bitmap $= "tools/materialEditor/gui/unknownImage"){
+   
+   //---
+   %newNormal = %this-->texNormalMap.getBitmap();
+   if(%newNormal $= $TerrainMaterialEditor::emptyMaterialImage)
       %newNormal = "";
       %newNormal = "";
-   }else{
-      %newNormal = %this-->normTexCtrl.bitmap;  
-   }
-   if (%this-->ormConfigTexCtrl.bitmap $= "tools/materialEditor/gui/unknownImage"){
+   
+   //---
+   %newormConfig = %this-->texORMConfigMap.getBitmap();
+   if(%newormConfig $= $TerrainMaterialEditor::emptyMaterialImage)
       %newormConfig = "";
       %newormConfig = "";
-   }else{
-      %newormConfig = %this-->ormConfigTexCtrl.bitmap;  
-   }
-   if (%this-->detailTexCtrl.bitmap $= "tools/materialEditor/gui/unknownImage"){
+   
+   //---
+   %newDetail = %this-->texDetailMap.getBitmap();
+   if(%newDetail $= $TerrainMaterialEditor::emptyMaterialImage)
       %newDetail = "";
       %newDetail = "";
-   }else{
-      %newDetail = %this-->detailTexCtrl.bitmap;  
-   }
-   if (%this-->macroTexCtrl.bitmap $= "tools/materialEditor/gui/unknownImage"){
+   
+   //---
+   %newMacro = %this-->texMacroMap.getBitmap();
+   if(%newMacro $= $TerrainMaterialEditor::emptyMaterialImage)
       %newMacro = "";
       %newMacro = "";
-   }else{
-      %newMacro = %this-->macroTexCtrl.bitmap;  
-   }
+   
    %detailSize = %this-->detSizeCtrl.getText();      
    %detailSize = %this-->detSizeCtrl.getText();      
    %diffuseSize = %this-->baseSizeCtrl.getText();     
    %diffuseSize = %this-->baseSizeCtrl.getText();     
    %detailStrength = %this-->detStrengthCtrl.getText();
    %detailStrength = %this-->detStrengthCtrl.getText();
@@ -526,11 +591,11 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat )
    // return.
    // return.
 
 
    if (  %mat.internalName $= %newName &&
    if (  %mat.internalName $= %newName &&
-         %mat.diffuseMap $= %newDiffuse &&
-         %mat.normalMap $= %newNormal &&
-         %mat.detailMap $= %newDetail &&
-         %mat.ormConfigMap $= %newormConfig &&
-         %mat.macroMap $= %newMacro &&
+         %mat.getDiffuseMap() $= %newDiffuse &&
+         %mat.getNormalMap() $= %newNormal &&
+         %mat.getDetailMap() $= %newDetail &&
+         %mat.getORMConfigMap() $= %newormConfig &&
+         %mat.getMacroMap() $= %newMacro &&
          %mat.detailSize == %detailSize &&
          %mat.detailSize == %detailSize &&
          %mat.diffuseSize == %diffuseSize &&
          %mat.diffuseSize == %diffuseSize &&
          %mat.detailStrength == %detailStrength &&
          %mat.detailStrength == %detailStrength &&
@@ -564,12 +629,12 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat )
          %mat.setInternalName( %newName );    
          %mat.setInternalName( %newName );    
    }
    }
    
    
-   %mat.diffuseMap = %newDiffuse;    
-   %mat.diffuseMapAsset = "";    
-   %mat.normalMap = %newNormal;   
-   %mat.ormConfigMap = %newormConfig; 
-   %mat.detailMap = %newDetail;    
-   %mat.macroMap = %newMacro;
+   %mat.setDiffuseMap(%newDiffuse);
+   %mat.setNormalMap(%newNormal);
+   %mat.setORMConfigMap(%newormConfig);
+   %mat.setDetailMap(%newDetail);
+   %mat.setMacroMap(%newMacro);
+   
    %mat.detailSize = %detailSize;  
    %mat.detailSize = %detailSize;  
    %mat.diffuseSize = %diffuseSize;
    %mat.diffuseSize = %diffuseSize;
    %mat.detailStrength = %detailStrength;    
    %mat.detailStrength = %detailStrength;    
@@ -619,11 +684,11 @@ function TerrainMaterialDlg::snapshotMaterials( %this )
          parentGroup = %group;
          parentGroup = %group;
          material = %mat;
          material = %mat;
          internalName = %mat.internalName;
          internalName = %mat.internalName;
-         diffuseMap = %mat.diffuseMap;
-         normalMap = %mat.normalMap;
-         ormConfigMap = %mat.ormConfigMap;
-         detailMap = %mat.detailMap;
-         macroMap = %mat.macroMap;
+         diffuseMap = %mat.getDiffuseMap();
+         normalMap = %mat.getNormalMap();
+         ormConfigMap = %mat.getORMConfigMap();
+         detailMap = %mat.getDetailMap();
+         macroMap = %mat.getMacroMap();
          detailSize = %mat.detailSize;
          detailSize = %mat.detailSize;
          diffuseSize = %mat.diffuseSize;
          diffuseSize = %mat.diffuseSize;
          detailStrength = %mat.detailStrength;
          detailStrength = %mat.detailStrength;
@@ -638,6 +703,7 @@ function TerrainMaterialDlg::snapshotMaterials( %this )
          isSRGB = %mat.isSRGB;
          isSRGB = %mat.isSRGB;
          invertRoughness = %mat.invertRoughness;
          invertRoughness = %mat.invertRoughness;
       };
       };
+      
    }
    }
 }
 }
 
 
@@ -658,11 +724,11 @@ function TerrainMaterialDlg::restoreMaterials( %this )
       %mat = %obj.material;
       %mat = %obj.material;
 
 
       %mat.setInternalName( %obj.internalName );
       %mat.setInternalName( %obj.internalName );
-      %mat.diffuseMap = %obj.diffuseMap;
-      %mat.normalMap = %obj.normalMap;
-      %mat.ormConfigMap = %obj.ormConfigMap;
-      %mat.detailMap = %obj.detailMap;
-      %mat.macroMap = %obj.macroMap;
+      %mat.setDiffuseMap(%obj.diffuseMap);
+      %mat.setNormalMap(%obj.normalMap);
+      %mat.setORMConfigMap(%obj.ORMConfigMap);
+      %mat.setDetailMap(%obj.detailMap);
+      %mat. setMacroMap(%obj.macroMap);
       %mat.detailSize = %obj.detailSize;
       %mat.detailSize = %obj.detailSize;
       %mat.diffuseSize = %obj.diffuseSize;
       %mat.diffuseSize = %obj.diffuseSize;
       %mat.detailStrength = %obj.detailStrength;
       %mat.detailStrength = %obj.detailStrength;
@@ -717,6 +783,7 @@ function TerrainMaterialDlgBlendHeightBaseSlider::onMouseDragged(%this)
    %value = mFloor(%this.value * 1000)/1000;
    %value = mFloor(%this.value * 1000)/1000;
    TerrainMaterialDlgBlendHeightBaseTextEdit.setText(%value);
    TerrainMaterialDlgBlendHeightBaseTextEdit.setText(%value);
    TerrainMaterialDlg.activeMat.blendHeightBase = %this.value;
    TerrainMaterialDlg.activeMat.blendHeightBase = %this.value;
+   TerrainMaterialDlg.matDirty = true;
 
 
 }
 }
 
 
@@ -724,6 +791,7 @@ function TerrainMaterialDlgBlendHeightBaseTextEdit::onValidate(%this)
 {
 {
    TerrainMaterialDlgBlendHeightBaseSlider.setValue(%this.getText());
    TerrainMaterialDlgBlendHeightBaseSlider.setValue(%this.getText());
    TerrainMaterialDlg.activeMat.blendHeightBase = %this.getText();
    TerrainMaterialDlg.activeMat.blendHeightBase = %this.getText();
+   TerrainMaterialDlg.matDirty = true;
 }
 }
 
 
 function TerrainMaterialDlgBlendHeightContrastSlider::onMouseDragged(%this)
 function TerrainMaterialDlgBlendHeightContrastSlider::onMouseDragged(%this)
@@ -731,6 +799,7 @@ function TerrainMaterialDlgBlendHeightContrastSlider::onMouseDragged(%this)
    %value = mFloor(%this.value * 1000)/1000;
    %value = mFloor(%this.value * 1000)/1000;
    TerrainMaterialDlgBlendHeightContrastTextEdit.setText(%value);
    TerrainMaterialDlgBlendHeightContrastTextEdit.setText(%value);
    TerrainMaterialDlg.activeMat.blendHeightContrast = %this.value;
    TerrainMaterialDlg.activeMat.blendHeightContrast = %this.value;
+   TerrainMaterialDlg.matDirty = true;
 
 
 }
 }
 
 
@@ -738,4 +807,5 @@ function TerrainMaterialDlgBlendHeightContrastTextEdit::onValidate(%this)
 {
 {
    TerrainMaterialDlgBlendHeightContrastSlider.setValue(%this.getText());
    TerrainMaterialDlgBlendHeightContrastSlider.setValue(%this.getText());
    TerrainMaterialDlg.activeMat.blendHeightContrast = %this.getText();
    TerrainMaterialDlg.activeMat.blendHeightContrast = %this.getText();
+   TerrainMaterialDlg.matDirty = true;
 }
 }

Деякі файли не було показано, через те що забагато файлів було змінено