diff --git a/Engine/source/T3D/assets/ImageAsset.h b/Engine/source/T3D/assets/ImageAsset.h
index a29d9b4c7..ec16179aa 100644
--- a/Engine/source/T3D/assets/ImageAsset.h
+++ b/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) \
+{\
m##name##Name[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
@@ -557,9 +559,11 @@ DefineEngineMethod(className, set##name, bool, (const char* map, S32 index), , a
#endif
#define CLONE_IMAGEASSET_ARRAY(name, index) \
+{\
m##name##Name[index] = other.m##name##Name[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)\
if (m##name##AssetId[index] != StringTable->EmptyString())\
diff --git a/Engine/source/T3D/assets/ShapeAsset.h b/Engine/source/T3D/assets/ShapeAsset.h
index 00ae72e00..18dabdd40 100644
--- a/Engine/source/T3D/assets/ShapeAsset.h
+++ b/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) \
+{\
m##name##Name[index] = StringTable->EmptyString(); \
m##name##AssetId[index] = StringTable->EmptyString(); \
m##name##Asset[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
@@ -588,9 +590,11 @@ DefineEngineMethod(className, set##name, bool, (const char* shape, S32 index),
#endif // SHOW_LEGACY_FILE_FIELDS
#define CLONE_SHAPEASSET_ARRAY(name, index) \
+{\
m##name##Name[index] = other.m##name##Name[index];\
m##name##AssetId[index] = other.m##name##AssetId[index];\
m##name##Asset[index] = other.m##name##Asset[index];\
+}
#define PACKDATA_SHAPEASSET_ARRAY(name, index)\
if (stream->writeFlag(m##name##Asset[index].notNull()))\
diff --git a/Engine/source/T3D/player.cpp b/Engine/source/T3D/player.cpp
index 95369616e..09b8edb0d 100644
--- a/Engine/source/T3D/player.cpp
+++ b/Engine/source/T3D/player.cpp
@@ -1164,6 +1164,10 @@ void PlayerData::initPersistFields()
// Mounted images arrays
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,
"@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 "
"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" );
endGroup( "First Person Arms" );
diff --git a/Templates/BaseGame/game/core/rendering/Core_Rendering.tscript b/Templates/BaseGame/game/core/rendering/Core_Rendering.tscript
index 3d0c8f03c..142f04783 100644
--- a/Templates/BaseGame/game/core/rendering/Core_Rendering.tscript
+++ b/Templates/BaseGame/game/core/rendering/Core_Rendering.tscript
@@ -30,7 +30,6 @@ function Core_Rendering::onCreate(%this)
$Terrain::OrmTextureFormat = ProjectSettings.value("Terrain/OrmTextureFormat", 12);
exec("./scripts/graphicsOptions." @ $TorqueScriptFileExtension);
- exec("./scripts/terrainSettings." @ $TorqueScriptFileExtension);
exec("./scripts/renderManager." @ $TorqueScriptFileExtension);
}
diff --git a/Templates/BaseGame/game/core/rendering/materials/Blank_sky/BlankSkybox.png b/Templates/BaseGame/game/core/rendering/materials/Blank_sky/BlankSkybox.png
new file mode 100644
index 000000000..69b986833
Binary files /dev/null and b/Templates/BaseGame/game/core/rendering/materials/Blank_sky/BlankSkybox.png differ
diff --git a/Templates/BaseGame/game/core/rendering/materials/Blank_sky/BlankSkybox_image.asset.taml b/Templates/BaseGame/game/core/rendering/materials/Blank_sky/BlankSkybox_image.asset.taml
new file mode 100644
index 000000000..01c1de5b8
--- /dev/null
+++ b/Templates/BaseGame/game/core/rendering/materials/Blank_sky/BlankSkybox_image.asset.taml
@@ -0,0 +1,8 @@
+
diff --git a/Templates/BaseGame/game/core/rendering/materials/Blank_sky/materials.tscript b/Templates/BaseGame/game/core/rendering/materials/Blank_sky/materials.tscript
new file mode 100644
index 000000000..107fcf670
--- /dev/null
+++ b/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;
+};
diff --git a/Templates/BaseGame/game/core/rendering/materials/skybox_1.asset.taml b/Templates/BaseGame/game/core/rendering/materials/NightSkybox_1.asset.taml
similarity index 63%
rename from Templates/BaseGame/game/core/rendering/materials/skybox_1.asset.taml
rename to Templates/BaseGame/game/core/rendering/materials/NightSkybox_1.asset.taml
index 18907b6d0..8344c55a2 100644
--- a/Templates/BaseGame/game/core/rendering/materials/skybox_1.asset.taml
+++ b/Templates/BaseGame/game/core/rendering/materials/NightSkybox_1.asset.taml
@@ -1,8 +1,8 @@
diff --git a/Templates/BaseGame/game/core/rendering/materials/skybox_1.png b/Templates/BaseGame/game/core/rendering/materials/NightSkybox_1.png
similarity index 100%
rename from Templates/BaseGame/game/core/rendering/materials/skybox_1.png
rename to Templates/BaseGame/game/core/rendering/materials/NightSkybox_1.png
diff --git a/Templates/BaseGame/game/core/rendering/materials/skybox_2.asset.taml b/Templates/BaseGame/game/core/rendering/materials/NightSkybox_2.asset.taml
similarity index 63%
rename from Templates/BaseGame/game/core/rendering/materials/skybox_2.asset.taml
rename to Templates/BaseGame/game/core/rendering/materials/NightSkybox_2.asset.taml
index 0f74afc13..e43fa4c40 100644
--- a/Templates/BaseGame/game/core/rendering/materials/skybox_2.asset.taml
+++ b/Templates/BaseGame/game/core/rendering/materials/NightSkybox_2.asset.taml
@@ -1,8 +1,8 @@
diff --git a/Templates/BaseGame/game/core/rendering/materials/skybox_2.png b/Templates/BaseGame/game/core/rendering/materials/NightSkybox_2.png
similarity index 100%
rename from Templates/BaseGame/game/core/rendering/materials/skybox_2.png
rename to Templates/BaseGame/game/core/rendering/materials/NightSkybox_2.png
diff --git a/Templates/BaseGame/game/core/rendering/materials/skybox_3.asset.taml b/Templates/BaseGame/game/core/rendering/materials/NightSkybox_3.asset.taml
similarity index 63%
rename from Templates/BaseGame/game/core/rendering/materials/skybox_3.asset.taml
rename to Templates/BaseGame/game/core/rendering/materials/NightSkybox_3.asset.taml
index e3550ad21..cf83ba338 100644
--- a/Templates/BaseGame/game/core/rendering/materials/skybox_3.asset.taml
+++ b/Templates/BaseGame/game/core/rendering/materials/NightSkybox_3.asset.taml
@@ -1,8 +1,8 @@
diff --git a/Templates/BaseGame/game/core/rendering/materials/skybox_3.png b/Templates/BaseGame/game/core/rendering/materials/NightSkybox_3.png
similarity index 100%
rename from Templates/BaseGame/game/core/rendering/materials/skybox_3.png
rename to Templates/BaseGame/game/core/rendering/materials/NightSkybox_3.png
diff --git a/Templates/BaseGame/game/core/rendering/materials/skybox_4.asset.taml b/Templates/BaseGame/game/core/rendering/materials/NightSkybox_4.asset.taml
similarity index 63%
rename from Templates/BaseGame/game/core/rendering/materials/skybox_4.asset.taml
rename to Templates/BaseGame/game/core/rendering/materials/NightSkybox_4.asset.taml
index 979f229b8..754204ed4 100644
--- a/Templates/BaseGame/game/core/rendering/materials/skybox_4.asset.taml
+++ b/Templates/BaseGame/game/core/rendering/materials/NightSkybox_4.asset.taml
@@ -1,8 +1,8 @@
diff --git a/Templates/BaseGame/game/core/rendering/materials/skybox_4.png b/Templates/BaseGame/game/core/rendering/materials/NightSkybox_4.png
similarity index 100%
rename from Templates/BaseGame/game/core/rendering/materials/skybox_4.png
rename to Templates/BaseGame/game/core/rendering/materials/NightSkybox_4.png
diff --git a/Templates/BaseGame/game/core/rendering/materials/NightSkybox_5.asset.taml b/Templates/BaseGame/game/core/rendering/materials/NightSkybox_5.asset.taml
new file mode 100644
index 000000000..a3e774e56
--- /dev/null
+++ b/Templates/BaseGame/game/core/rendering/materials/NightSkybox_5.asset.taml
@@ -0,0 +1,8 @@
+
diff --git a/Templates/BaseGame/game/core/rendering/materials/skybox_5.png b/Templates/BaseGame/game/core/rendering/materials/NightSkybox_5.png
similarity index 100%
rename from Templates/BaseGame/game/core/rendering/materials/skybox_5.png
rename to Templates/BaseGame/game/core/rendering/materials/NightSkybox_5.png
diff --git a/Templates/BaseGame/game/core/rendering/materials/NightSkybox_6.asset.taml b/Templates/BaseGame/game/core/rendering/materials/NightSkybox_6.asset.taml
new file mode 100644
index 000000000..6778e0033
--- /dev/null
+++ b/Templates/BaseGame/game/core/rendering/materials/NightSkybox_6.asset.taml
@@ -0,0 +1,8 @@
+
diff --git a/Templates/BaseGame/game/core/rendering/materials/skybox_6.png b/Templates/BaseGame/game/core/rendering/materials/NightSkybox_6.png
similarity index 100%
rename from Templates/BaseGame/game/core/rendering/materials/skybox_6.png
rename to Templates/BaseGame/game/core/rendering/materials/NightSkybox_6.png
diff --git a/Templates/BaseGame/game/core/rendering/materials/materials.tscript b/Templates/BaseGame/game/core/rendering/materials/materials.tscript
index 9695bd5b0..ed62284c4 100644
--- a/Templates/BaseGame/game/core/rendering/materials/materials.tscript
+++ b/Templates/BaseGame/game/core/rendering/materials/materials.tscript
@@ -22,12 +22,12 @@
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 )
diff --git a/Templates/BaseGame/game/core/rendering/materials/skybox_5.asset.taml b/Templates/BaseGame/game/core/rendering/materials/skybox_5.asset.taml
deleted file mode 100644
index e8bad82dd..000000000
--- a/Templates/BaseGame/game/core/rendering/materials/skybox_5.asset.taml
+++ /dev/null
@@ -1,8 +0,0 @@
-
diff --git a/Templates/BaseGame/game/core/rendering/materials/skybox_6.asset.taml b/Templates/BaseGame/game/core/rendering/materials/skybox_6.asset.taml
deleted file mode 100644
index 6518b7e3a..000000000
--- a/Templates/BaseGame/game/core/rendering/materials/skybox_6.asset.taml
+++ /dev/null
@@ -1,8 +0,0 @@
-
diff --git a/Templates/BaseGame/game/data/ui/guis/startupGui.tscript b/Templates/BaseGame/game/data/ui/guis/startupGui.tscript
index 38aedd3b4..af673c819 100644
--- a/Templates/BaseGame/game/data/ui/guis/startupGui.tscript
+++ b/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
Canvas.setContent(BlankGui);
- %asdasd = %this.bitmap[$StartupIdx];
-
// Set our bitmap and reset the done variable
%this.setBitmap(%this.bitmap[$StartupIdx]);
%this.done = false;
diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/AssetImportConfigEditor.asset.taml b/Templates/BaseGame/game/tools/assetBrowser/guis/AssetImportConfigEditor.asset.taml
deleted file mode 100644
index b59508d57..000000000
--- a/Templates/BaseGame/game/tools/assetBrowser/guis/AssetImportConfigEditor.asset.taml
+++ /dev/null
@@ -1,7 +0,0 @@
-
diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/AssetPreviewButtonsTemplate.asset.taml b/Templates/BaseGame/game/tools/assetBrowser/guis/AssetPreviewButtonsTemplate.asset.taml
deleted file mode 100644
index 8ca061889..000000000
--- a/Templates/BaseGame/game/tools/assetBrowser/guis/AssetPreviewButtonsTemplate.asset.taml
+++ /dev/null
@@ -1,7 +0,0 @@
-
diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/GameObjectCreator.asset.taml b/Templates/BaseGame/game/tools/assetBrowser/guis/GameObjectCreator.asset.taml
deleted file mode 100644
index 1fbfa8243..000000000
--- a/Templates/BaseGame/game/tools/assetBrowser/guis/GameObjectCreator.asset.taml
+++ /dev/null
@@ -1,7 +0,0 @@
-
diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/assetImportConfigEditor.asset.taml b/Templates/BaseGame/game/tools/assetBrowser/guis/assetImportConfigEditor.asset.taml
new file mode 100644
index 000000000..5e909e9c7
--- /dev/null
+++ b/Templates/BaseGame/game/tools/assetBrowser/guis/assetImportConfigEditor.asset.taml
@@ -0,0 +1,7 @@
+
diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/AssetImportConfigEditor.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/assetImportConfigEditor.gui
similarity index 100%
rename from Templates/BaseGame/game/tools/assetBrowser/guis/AssetImportConfigEditor.gui
rename to Templates/BaseGame/game/tools/assetBrowser/guis/assetImportConfigEditor.gui
diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/assetPreviewButtonsTemplate.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/assetPreviewButtonsTemplate.gui
deleted file mode 100644
index 2ee3b1cdc..000000000
--- a/Templates/BaseGame/game/tools/assetBrowser/guis/assetPreviewButtonsTemplate.gui
+++ /dev/null
@@ -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 ---
diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/CreateNewCollectionSetCtrl.asset.taml b/Templates/BaseGame/game/tools/assetBrowser/guis/createNewCollectionSetCtrl.asset.taml
similarity index 81%
rename from Templates/BaseGame/game/tools/assetBrowser/guis/CreateNewCollectionSetCtrl.asset.taml
rename to Templates/BaseGame/game/tools/assetBrowser/guis/createNewCollectionSetCtrl.asset.taml
index 4d51d7fc7..75cc65e26 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/guis/CreateNewCollectionSetCtrl.asset.taml
+++ b/Templates/BaseGame/game/tools/assetBrowser/guis/createNewCollectionSetCtrl.asset.taml
@@ -1,7 +1,7 @@
diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/gameObjectCreator.asset.taml b/Templates/BaseGame/game/tools/assetBrowser/guis/gameObjectCreator.asset.taml
new file mode 100644
index 000000000..65769925b
--- /dev/null
+++ b/Templates/BaseGame/game/tools/assetBrowser/guis/gameObjectCreator.asset.taml
@@ -0,0 +1,7 @@
+
diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/GameObjectCreator.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/gameObjectCreator.gui
similarity index 100%
rename from Templates/BaseGame/game/tools/assetBrowser/guis/GameObjectCreator.gui
rename to Templates/BaseGame/game/tools/assetBrowser/guis/gameObjectCreator.gui
diff --git a/Templates/BaseGame/game/tools/assetBrowser/main.tscript b/Templates/BaseGame/game/tools/assetBrowser/main.tscript
index 7ac0ced40..e4811cf5b 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/main.tscript
+++ b/Templates/BaseGame/game/tools/assetBrowser/main.tscript
@@ -64,8 +64,6 @@ function initializeAssetBrowser()
exec("./guis/selectModule.gui");
exec("./guis/selectPath.gui");
exec("./guis/editModule.gui");
- exec("./guis/importTemplateModules.gui");
- exec("./guis/assetPreviewButtonsTemplate.gui");
exec("./guis/newFolder.gui");
exec("./guis/assetImportLog.gui");
exec("./guis/looseFileAudit.gui");
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript
index 3831adf2e..4578ee86e 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript
@@ -453,15 +453,6 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
%doubleClickCommand = "AssetBrowser.editAsset( "@%assetDesc@" );";
- /*if(%assetType $= "ShapeAsset")
- {
- %previewButton = AssetPreviewButtonsTemplate-->ShapeAssetPreviewButton.deepClone();
- }
- else
- {
- %previewButton = AssetPreviewButtonsTemplate-->GeneralAssetPreviewButton.deepClone();
- }*/
-
%textBottomPad = 20;
%previewButton = new GuiIconButtonCtrl()
@@ -517,7 +508,7 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
%previewButton.moduleName = %moduleName;
%previewButton.assetType = %assetType;
- %previewButton.iconBitmap = %this.previewData.previewImage;
+ %previewButton.bitmapAsset = %this.previewData.previewImage;
%previewButton.profile = "AssetBrowserPreview" @ %previewButton.assetType;
%previewButton.tooltip = %this.previewData.tooltip;
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/component.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/component.tscript
index 8d0b6eaee..c9db8fb32 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/component.tscript
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/component.tscript
@@ -140,7 +140,7 @@ function AssetBrowser::buildComponentAssetPreview(%this, %assetDef, %previewData
%previewData.assetPath = %assetDef.scriptFile;
%previewData.doubleClickCommand = "EditorOpenFileInTorsion( "@%previewData.assetPath@", 0 );";
- %previewData.previewImage = "tools/assetBrowser/art/componentIcon";
+ %previewData.previewImage = "ToolsModule:componentIcon_image";
%previewData.assetFriendlyName = %assetDef.friendlyName;
%previewData.assetDesc = %assetDef.description;
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cpp.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cpp.tscript
index 4ae71361b..4fdd7b173 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cpp.tscript
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cpp.tscript
@@ -4,7 +4,7 @@ function AssetBrowser::buildCppPreview(%this, %assetDef, %previewData)
%previewData.assetPath = %assetDef.codeFilePath;
%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.assetDesc = %assetDef.description;
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/creatorObj.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/creatorObj.tscript
index 0cdeb5d0d..3c90e1782 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/creatorObj.tscript
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/creatorObj.tscript
@@ -7,7 +7,7 @@ function AssetBrowser::buildCreatorPreview(%this, %assetDef, %previewData)
%previewData.assetName = %name;
%previewData.assetPath = "";
- %previewData.previewImage = "tools/classIcons/" @ %class;
+ %previewData.previewImage = "ToolsModule:" @ %class @ "_image";
//%previewData.assetFriendlyName = %assetDef.assetName;
%previewData.assetDesc = %assetDef;
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/datablockObjects.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/datablockObjects.tscript
index 2c46ca1e6..b13b0b470 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/datablockObjects.tscript
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/datablockObjects.tscript
@@ -45,7 +45,7 @@ function AssetBrowser::buildDatablockPreview(%this, %assetDef, %previewData)
%previewData.assetName = %assetDef;
%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
%dataClass = %assetDef.getClassName();
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/folder.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/folder.tscript
index 5c8bcc10a..33dd9a98b 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/folder.tscript
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/folder.tscript
@@ -58,7 +58,7 @@ function AssetBrowser::buildFolderPreview(%this, %assetDef, %previewData)
%previewData.assetName = %assetDef.assetName;
%previewData.assetPath = %assetDef.dirPath;
- %previewData.previewImage = "tools/assetBrowser/art/folderIcon";
+ %previewData.previewImage = "ToolsModule:FolderIcon_image";
//%previewData.assetFriendlyName = %assetDef.assetName;
%previewData.assetDesc = %assetDef.description;
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/gameObject.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/gameObject.tscript
index 617c6f8ba..4703d1752 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/gameObject.tscript
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/gameObject.tscript
@@ -265,7 +265,7 @@ function AssetBrowser::buildGameObjectAssetPreview(%this, %assetDef, %previewDat
%previewData.assetPath = %assetDef.scriptFile;
%previewData.doubleClickCommand = "EditorOpenFileInTorsion( "@%previewData.assetPath@", 0 );";
- %previewData.previewImage = "tools/assetBrowser/art/gameObjectIcon";
+ %previewData.previewImage = "ToolsModule:gameObjectIcon_image";
%previewData.assetFriendlyName = %assetDef.gameObjectName;
%previewData.assetDesc = %assetDef.description;
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/gui.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/gui.tscript
index c4e2b99c7..9f32b4fbc 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/gui.tscript
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/gui.tscript
@@ -171,7 +171,7 @@ function AssetBrowser::buildGUIAssetPreview(%this, %assetDef, %previewData)
%previewData.assetPath = %assetDef.GUIFilePath;
%previewData.doubleClickCommand = "";
- %previewData.previewImage = "tools/assetBrowser/art/guiIcon";
+ %previewData.previewImage = "ToolsModule:guiIcon_image";
%previewData.assetFriendlyName = %assetDef.assetName;
%previewData.assetDesc = %assetDef.description;
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/level.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/level.tscript
index d57f1594c..9f1a62a40 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/level.tscript
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/level.tscript
@@ -142,7 +142,7 @@ function AssetBrowser::buildLevelAssetPreview(%this, %assetDef, %previewData)
if(isFile(%levelPreviewImage))
%previewData.previewImage = %levelPreviewImage;
else
- %previewData.previewImage = "tools/assetBrowser/art/levelIcon";
+ %previewData.previewImage = "ToolsModule:levelIcon_image";
%previewData.assetFriendlyName = %assetDef.assetName;
%previewData.assetDesc = %assetDef.description;
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/looseFiles.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/looseFiles.tscript
index d209e2f06..2c036c064 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/looseFiles.tscript
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/looseFiles.tscript
@@ -4,7 +4,7 @@ function AssetBrowser::buildLooseFilePreview(%this, %assetDef, %previewData)
%previewData.assetName = %assetDef.assetName;
%previewData.assetPath = %fullPath;
- %previewData.previewImage = "tools/assetBrowser/art/looseFileIcon";
+ %previewData.previewImage = "ToolsModule:looseFileIcon_image";
//%previewData.assetFriendlyName = %assetDef.assetName;
%previewData.assetDesc = %assetDef.description;
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.tscript
index f4ba45999..f5a11b7c4 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.tscript
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.tscript
@@ -347,7 +347,7 @@ function AssetBrowser::importMaterialAsset(%this, %assetItem)
%depAssetType = %childAssetItem.assetType;
if(%depAssetType $= "ImageAsset")
{
- %matSet = "%newAsset.imageMap"@%dependencySlotId@"=\"@Asset="@%moduleName@":"@%childAssetItem.assetName@"\";";
+ %matSet = "%newAsset.imageMap"@%dependencySlotId@"=\"@asset="@%moduleName@":"@%childAssetItem.assetName@"\";";
eval(%matSet);
%dependencySlotId++;
}
@@ -461,7 +461,7 @@ function AssetBrowser::buildMaterialAssetPreview(%this, %assetDef, %previewData)
%previewData.previewImage = %imgAsset.getImagePath();
}
else
- %previewData.previewImage = "tools/assetBrowser/art/materialIcon";
+ %previewData.previewImage = "tools/assetBrowser/art/materialIcon_image";
%previewData.assetFriendlyName = %assetDef.assetName;
%previewData.assetDesc = %assetDef.description;
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/postFX.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/postFX.tscript
index 06ca879f6..f5f8a3af7 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/postFX.tscript
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/postFX.tscript
@@ -161,7 +161,7 @@ function AssetBrowser::buildPostEffectAssetPreview(%this, %assetDef, %previewDat
%previewData.assetPath = %assetDef.scriptFilePath;
%previewData.doubleClickCommand = "";
- %previewData.previewImage = "tools/assetBrowser/art/postEffectIcon";
+ %previewData.previewImage = "ToolsModule:postEffectIcon_image";
%previewData.assetFriendlyName = %assetDef.assetName;
%previewData.assetDesc = %assetDef.description;
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/prefab.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/prefab.tscript
index a2a44568d..a13711aae 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/prefab.tscript
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/prefab.tscript
@@ -21,7 +21,7 @@ function AssetBrowser::buildPrefabPreview(%this, %assetDef, %previewData)
%previewData.assetName = %assetDef.assetName;
%previewData.assetPath = %fullPath;
- %previewData.previewImage = "tools/assetBrowser/art/genericAssetIcon";
+ %previewData.previewImage = "ToolsModule:genericAssetIcon_image";
//%previewData.assetFriendlyName = %assetDef.assetName;
%previewData.assetDesc = %assetDef.description;
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/script.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/script.tscript
index c7a226d49..c3b978318 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/script.tscript
+++ b/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 );";
if(%assetDef.isServerSide)
- %previewData.previewImage = "tools/assetBrowser/art/serverScriptIcon";
+ %previewData.previewImage = "ToolsModule:serverScriptIcon_image";
else
- %previewData.previewImage = "tools/assetBrowser/art/clien" @ $TorqueScriptFileExtension @ "Icon";
+ %previewData.previewImage = "ToolsModule:clientScriptIcon_image";
%previewData.assetFriendlyName = %assetDef.assetName;
%previewData.assetDesc = %assetDef.description;
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.tscript
index dd6310c74..947115312 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.tscript
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.tscript
@@ -143,13 +143,13 @@ function AssetBrowser::importShapeAsset(%this, %assetItem)
%depAssetType = %childAssetItem.assetType;
if(%childAssetItem.assetType $= "MaterialAsset")
{
- %matSet = "%newAsset.materialSlot"@%dependencySlotId@"=\"@Asset="@%moduleName@":"@%childAssetItem.assetName@"\";";
+ %matSet = "%newAsset.materialSlot"@%dependencySlotId@"=\"@asset="@%moduleName@":"@%childAssetItem.assetName@"\";";
eval(%matSet);
%dependencySlotId++;
}
else if(%depAssetType $= "AnimationAsset")
{
- %matSet = "%newAsset.animationSequence"@%dependencySlotId@"=\"@Asset="@%moduleName@":"@%childAssetItem.assetName@"\";";
+ %matSet = "%newAsset.animationSequence"@%dependencySlotId@"=\"@asset="@%moduleName@":"@%childAssetItem.assetName@"\";";
eval(%matSet);
%dependencySlotId++;
}
@@ -252,8 +252,8 @@ function AssetBrowser::buildShapeAssetPreview(%this, %assetDef, %previewData)
%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...");
@@ -265,7 +265,7 @@ function AssetBrowser::buildShapeAssetPreview(%this, %assetDef, %previewData)
%filePath = %assetDef.generateCachedPreviewImage();
%imposterPath = %filePath @ ".imposter.png";
- pathCopy(%imposterPath, %previewPath);
+ pathCopy(%imposterPath, %previewFilePath);
//cleanup
fileDelete(%imposterPath);
@@ -275,17 +275,31 @@ function AssetBrowser::buildShapeAssetPreview(%this, %assetDef, %previewData)
$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();
}
//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.assetPath = %assetDef.fileName;
- %previewData.previewImage = %previewPath;//%assetDef.fileName;
+ %previewData.previewImage = "ToolsModule:" @ %assetDef.assetName @ "_PreviewImage";//%assetDef.fileName;
%previewData.assetFriendlyName = %assetDef.assetName;
%previewData.assetDesc = %assetDef.description;
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shapeAnimation.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shapeAnimation.tscript
index 1f418876b..2c72ce8c7 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shapeAnimation.tscript
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shapeAnimation.tscript
@@ -47,7 +47,7 @@ function AssetBrowser::buildShapeAnimationAssetPreview(%this, %assetDef, %previe
@ "EditorGui.setEditor(MaterialEditorPlugin); "
@ "AssetBrowser.hideDialog();";*/
- %previewData.previewImage = "tools/assetBrowser/art/animationIcon";
+ %previewData.previewImage = "ToolsModule:animationIcon_image";
%previewData.assetFriendlyName = %assetDef.assetName;
%previewData.assetDesc = %assetDef.description;
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/sound.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/sound.tscript
index 7c11680fb..a3132d213 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/sound.tscript
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/sound.tscript
@@ -9,7 +9,7 @@ function AssetBrowser::buildSoundAssetPreview(%this, %assetDef, %previewData)
else
%previewData.doubleClickCommand = "AssetBrowser.editAsset( "@%assetDef@" );";
- %previewData.previewImage = "tools/assetBrowser/art/soundIcon";
+ %previewData.previewImage = "ToolsModule:soundIcon_image";
%previewData.assetFriendlyName = %assetDef.assetName;
%previewData.assetDesc = %assetDef.description;
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/stateMachine.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/stateMachine.tscript
index d55b926df..1a18b7ed1 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/stateMachine.tscript
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/stateMachine.tscript
@@ -166,7 +166,7 @@ function AssetBrowser::buildStateMachineAssetPreview(%this, %assetDef, %previewD
%previewData.assetPath = %assetDef.scriptFile;
%previewData.doubleClickCommand = "AssetBrowser.editStateMachineAsset( "@%assetDef@" );";
- %previewData.previewImage = "tools/assetBrowser/art/stateMachineIcon";
+ %previewData.previewImage = "ToolsModule:stateMachineIcon_image";
%previewData.assetFriendlyName = %assetDef.friendlyName;
%previewData.assetDesc = %assetDef.description;
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.tscript
index cacee3655..64e0eb7c6 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.tscript
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.tscript
@@ -162,7 +162,7 @@ function AssetBrowser::buildTerrainAssetPreview(%this, %assetDef, %previewData)
%previewData.assetPath = "";
%previewData.doubleClickCommand = "";
- %previewData.previewImage = "tools/assetBrowser/art/gameObjectIcon";
+ %previewData.previewImage = "ToolsModule:gameObjectIcon_image";
%previewData.assetFriendlyName = %assetDef.gameObjectName;
%previewData.assetDesc = %assetDef.description;
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrainMaterial.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrainMaterial.tscript
index fb53a25fa..51bc88d54 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrainMaterial.tscript
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrainMaterial.tscript
@@ -97,7 +97,7 @@ function AssetBrowser::buildTerrainMaterialAssetPreview(%this, %assetDef, %previ
%previewData.assetPath = "";
%previewData.doubleClickCommand = "";
- %previewData.previewImage = "tools/assetBrowser/art/terrainMaterialIcon";
+ %previewData.previewImage = "ToolsModule:terrainMaterialIcon_image";
%previewData.assetFriendlyName = %assetDef.gameObjectName;
%previewData.assetDesc = %assetDef.description;
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/directoryHandling.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/directoryHandling.tscript
index f40904ea8..d9bcad51f 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/directoryHandling.tscript
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/directoryHandling.tscript
@@ -188,8 +188,8 @@ function directoryHandler::getModuleFromAddress(%this, %address)
%modulePath = makeRelativePath(%module.ModulePath);
//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))
{
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.tscript
index 82385f25f..856ba7d11 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.tscript
+++ b/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.
//Grab the asset def from that
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/selectModule.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/selectModule.tscript
index 4b34f4551..54358a8e8 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/selectModule.tscript
+++ b/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)
{
AssetBrowser_SelectModuleWindow-->ModuleList.refresh();
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/module.tscript.template b/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/module.tscript.template
index bcc092757..4a9eafc7d 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/module.tscript.template
+++ b/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
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
diff --git a/Templates/BaseGame/game/tools/componentEditor/main.tscript b/Templates/BaseGame/game/tools/componentEditor/main.tscript
index 7dc10a11f..1de7febb2 100644
--- a/Templates/BaseGame/game/tools/componentEditor/main.tscript
+++ b/Templates/BaseGame/game/tools/componentEditor/main.tscript
@@ -21,13 +21,13 @@
//-----------------------------------------------------------------------------
//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);
//gui
exec("./gui/superToolTipDlg.ed.gui");
-exec("./gui/stateMachineDlg.ed.gui");
+//exec("./gui/stateMachineDlg.ed.gui");
//field types
exec("./interface/materialFieldType." @ $TorqueScriptFileExtension);
diff --git a/Templates/BaseGame/game/tools/datablockEditor/datablockEditor.tscript b/Templates/BaseGame/game/tools/datablockEditor/datablockEditor.tscript
index dd7925bbe..9396faeb6 100644
--- a/Templates/BaseGame/game/tools/datablockEditor/datablockEditor.tscript
+++ b/Templates/BaseGame/game/tools/datablockEditor/datablockEditor.tscript
@@ -676,13 +676,16 @@ function DatablockEditorPlugin::createDatablock(%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();
}
diff --git a/Templates/BaseGame/game/tools/decalEditor/decalEditorGui.tscript b/Templates/BaseGame/game/tools/decalEditor/decalEditorGui.tscript
index 98950f9a6..3a6545e02 100644
--- a/Templates/BaseGame/game/tools/decalEditor/decalEditorGui.tscript
+++ b/Templates/BaseGame/game/tools/decalEditor/decalEditorGui.tscript
@@ -158,6 +158,15 @@ function RetargetDecalButton::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" );
%str = "datablock DecalData( " @ %name @ " ) { Material = \"WarningMaterial\"; };";
diff --git a/Templates/BaseGame/game/tools/decalEditor/main.tscript b/Templates/BaseGame/game/tools/decalEditor/main.tscript
index d948f1133..52e98d0e6 100644
--- a/Templates/BaseGame/game/tools/decalEditor/main.tscript
+++ b/Templates/BaseGame/game/tools/decalEditor/main.tscript
@@ -24,7 +24,7 @@ function initializeDecalEditor()
{
echo(" % - Initializing Decal Editor");
- $decalDataFile = "art/decals/managedDecalData." @ $TorqueScriptFileExtension;
+ $decalDataFile = "data/managedDecalData." @ $TorqueScriptFileExtension;
exec( "./decalEditor." @ $TorqueScriptFileExtension );
exec( "./decalEditorGui.gui" );
diff --git a/Templates/BaseGame/game/tools/forestEditor/brushes.tscript b/Templates/BaseGame/game/tools/forestEditor/brushes.tscript
index 2146c2e34..ea313e60b 100644
--- a/Templates/BaseGame/game/tools/forestEditor/brushes.tscript
+++ b/Templates/BaseGame/game/tools/forestEditor/brushes.tscript
@@ -20,6 +20,8 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
+//--- OBJECT WRITE BEGIN ---
%forestBrushesGroup = new SimGroup( ForestBrushGroup )
{
-};
\ No newline at end of file
+};
+//--- OBJECT WRITE END ---
\ No newline at end of file
diff --git a/Templates/BaseGame/game/tools/forestEditor/forestEditorGui.tscript b/Templates/BaseGame/game/tools/forestEditor/forestEditorGui.tscript
index b6a3d61d4..93e659307 100644
--- a/Templates/BaseGame/game/tools/forestEditor/forestEditorGui.tscript
+++ b/Templates/BaseGame/game/tools/forestEditor/forestEditorGui.tscript
@@ -171,13 +171,15 @@ function ForestEditorGui::deleteBrushOrElement( %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", "", "", "");
}
@@ -212,10 +214,10 @@ function selectNewForestMesh(%selectedShapeAssetId)
//%str = "datablock TSForestItemData( " @ %name @ " ) { shapeFile = \"" @ %fullPath @ "\"; };";
//eval( %str );
- %fullPath = AssetDatabase.acquireAsset(%selectedShapeAssetId).getShapeFile();
+ //%fullPath = AssetDatabase.acquireAsset(%selectedShapeAssetId).getShapeFile();
new TSForestItemData(%name) {
- shapeFile = %fullPath;
+ shapeAsset = %selectedShapeAssetId;
};
%isrl = isObject( %name );
@@ -228,7 +230,7 @@ function selectNewForestMesh(%selectedShapeAssetId)
ForestEditMeshTree.scrollVisible( %item );
ForestEditMeshTree.addSelection( %item );
- ForestDataManager.setDirty( %name, ForestEditorGui.newMeshPath @ "/managedForestItemData." @ $TorqueScriptFileExtension );
+ ForestDataManager.setDirty( %name, ForestEditorGui.forestItemDataPath );
%element = new ForestBrushElement()
{
diff --git a/Templates/BaseGame/game/tools/gui/guiDialogs.ed.tscript b/Templates/BaseGame/game/tools/gui/guiDialogs.ed.tscript
index fdb16e1b4..1eae6bb2e 100644
--- a/Templates/BaseGame/game/tools/gui/guiDialogs.ed.tscript
+++ b/Templates/BaseGame/game/tools/gui/guiDialogs.ed.tscript
@@ -34,7 +34,6 @@ exec("./GuiEaseEditDlg.ed." @ $TorqueScriptFileExtension);
exec("./guiObjectInspector.ed." @ $TorqueScriptFileExtension);
exec("./uvEditor.ed.gui");
exec("./objectSelection.ed." @ $TorqueScriptFileExtension);
-exec("./postFxManager.gui");
exec("./assimpImport.ed.gui");
exec("./fieldTypes/assetDependencies." @ $TorqueScriptFileExtension);
diff --git a/Templates/BaseGame/game/tools/guiEditor/gui/EditorChooseGUI.ed.gui b/Templates/BaseGame/game/tools/guiEditor/gui/EditorChooseGUI.ed.gui
index 02d9e04b3..22974b57a 100644
--- a/Templates/BaseGame/game/tools/guiEditor/gui/EditorChooseGUI.ed.gui
+++ b/Templates/BaseGame/game/tools/guiEditor/gui/EditorChooseGUI.ed.gui
@@ -13,7 +13,7 @@
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
- bitmap = "art/gui/background";
+ bitmap = "data/ui/images/background.png";
useVariable = "0";
tile = "0";
diff --git a/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui b/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui
index a1d9ae259..d93f24c53 100644
--- a/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui
+++ b/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui
@@ -821,7 +821,7 @@
MinExtent = "8 2";
canSave = "1";
Visible = "1";
- Command = "MaterialEditorGui.updateORMConfigMap(1);";
+ Command = "MaterialEditorGui.updateTextureMap(\"ORMConfig\",1);";
tooltipprofile = "ToolsGuiDefaultProfile";
ToolTip = "Change the packed spec map for this layer. \n Roughness (R), Ambient Occlusion (G), and Metalness(B))";
hovertime = "1000";
@@ -861,7 +861,7 @@
position = "134 34";
Extent = "40 16";
buttonType = "PushButton";
- command="MaterialEditorGui.updateORMConfigMap(1);";
+ Command = "MaterialEditorGui.updateTextureMap(\"ORMConfig\",1);";
};
new GuiBitmapButtonCtrl() {
canSaveDynamicFields = "0";
@@ -875,7 +875,7 @@
MinExtent = "8 2";
canSave = "1";
Visible = "1";
- Command = "MaterialEditorGui.updateORMConfigMap(0);";
+ Command = "MaterialEditorGui.updateTextureMap(\"ORMConfig\",0);";
hovertime = "1000";
groupNum = "-1";
buttonType = "PushButton";
@@ -1049,7 +1049,7 @@
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
- command = "MaterialEditorGui.updateroughMap(1);";
+ Command = "MaterialEditorGui.updateTextureMap(\"rough\",1);";
tooltipProfile = "GuiToolTipProfile";
tooltip = "Change the Roughness map for this layer.";
hovertime = "1000";
@@ -1094,7 +1094,7 @@
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
- command = "MaterialEditorGui.updateroughMap(1);";
+ Command = "MaterialEditorGui.updateTextureMap(\"rough\",1);";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
@@ -1118,7 +1118,7 @@
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
- command = "MaterialEditorGui.updateroughMap(0);";
+ Command = "MaterialEditorGui.updateTextureMap(\"rough\",0);";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
@@ -1285,7 +1285,7 @@
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
- command = "MaterialEditorGui.updateaoMap(1);";
+ Command = "MaterialEditorGui.updateTextureMap(\"ao\",1);";
tooltipProfile = "GuiToolTipProfile";
tooltip = "Change the AO map for this layer.";
hovertime = "1000";
@@ -1330,7 +1330,7 @@
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
- command = "MaterialEditorGui.updateaoMap(1);";
+ Command = "MaterialEditorGui.updateTextureMap(\"ao\",1);";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
@@ -1354,7 +1354,7 @@
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
- command = "MaterialEditorGui.updateaoMap(0);";
+ Command = "MaterialEditorGui.updateTextureMap(\"ao\",0);";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
@@ -1521,7 +1521,7 @@
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
- command = "MaterialEditorGui.updatemetalMap(1);";
+ Command = "MaterialEditorGui.updateTextureMap(\"metal\",1);";
tooltipProfile = "GuiToolTipProfile";
tooltip = "Change the Metalness Map for this layer.";
hovertime = "1000";
@@ -1566,7 +1566,7 @@
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
- command = "MaterialEditorGui.updatemetalMap(1);";
+ Command = "MaterialEditorGui.updateTextureMap(\"metal\",1);";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
@@ -1590,7 +1590,7 @@
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
- command = "MaterialEditorGui.updatemetalMap(0);";
+ Command = "MaterialEditorGui.updateTextureMap(\"metal\",0);";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
@@ -1773,7 +1773,7 @@
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
- command = "MaterialEditorGui.updateglowMap(1);";
+ Command = "MaterialEditorGui.updateTextureMap(\"glow\",1);";
tooltipProfile = "GuiToolTipProfile";
tooltip = "Change the glowness Map for this layer.";
hovertime = "1000";
@@ -1818,7 +1818,7 @@
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
- command = "MaterialEditorGui.updateglowMap(1);";
+ Command = "MaterialEditorGui.updateTextureMap(\"glow\",1);";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
@@ -1842,7 +1842,7 @@
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
- command = "MaterialEditorGui.updateglowMap(0);";
+ Command = "MaterialEditorGui.updateTextureMap(\"glow\",0);";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
@@ -4720,7 +4720,7 @@
MinExtent = "8 2";
canSave = "1";
Visible = "1";
- Command = "materialSelector.showDialog(\"MaterialEditorGui.switchMaterial\");";
+ Command = "AssetBrowser.showDialog(\"MaterialAsset\", \"MaterialEditorGui.selectMaterialAsset\");";
hovertime = "1000";
bitmap = "tools/gui/images/open-file";
tooltip = "Open Existing Material";
diff --git a/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript b/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript
index e3070de4b..5162af8c0 100644
--- a/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript
+++ b/Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript
@@ -230,6 +230,11 @@ function MaterialEditorGui::openFile( %this, %fileType )
return makeRelativePath( %filename, getMainDotCsDir() );
}
+function MaterialEditorGui::selectMaterialAsset(%this, %assetId)
+{
+ AssetBrowser.editAsset(%assetId);
+}
+
//==============================================================================
// SubMaterial(Material Target) -- Supports different ways to grab the
// 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
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
// at the end we will have generated material name: "base_texname_mat"
%material = getUniqueName( strreplace(%material, ".", "_") @ "_mat" );
@@ -268,7 +282,7 @@ function SubMaterialSelector::onSelect( %this )
eval( "MaterialEditorGui.currentObject." @ strreplace(%this.getText(),".","_") @ " = " @ %material @ ";");
if( MaterialEditorGui.currentObject.isMethod("postApply") )
- MaterialEditorGui.currentObject.postApply();
+ MaterialEditorGui.currentObject.postApply();*/
}
MaterialEditorGui.prepareActiveMaterial( %material.getId() );
@@ -325,7 +339,7 @@ function MaterialEditorGui::prepareActiveObject( %this, %override )
{
%fieldName = %obj.getField(%i);
- if( %obj.getFieldType(%fieldName) !$= "TypeMaterialName" )
+ if( %obj.getFieldType(%fieldName) !$= "TypeMaterialAssetId" && %obj.getFieldType(%fieldName) !$= "TypeMaterialName")
continue;
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( !isObject(%material) )
- %material = MaterialSet.getObject(0);
+ return;
+ //%material = MaterialSet.getObject(0);
// Check made in order to avoid loading the same material. Overriding
// 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
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;
@@ -525,13 +546,9 @@ function MaterialEditorGui::setMaterialDirty(%this)
matEd_PersistMan.setDirty(MaterialEditorGui.currentMaterial, %savePath);
}
- else
- {
- matEd_PersistMan.setDirty(MaterialEditorGui.currentMaterial, "art/materials." @ $TorqueScriptFileExtension);
- }
}
else
- matEd_PersistMan.setDirty(MaterialEditorGui.currentMaterial);
+ matEd_PersistMan.setDirty(MaterialEditorGui.currentMaterial, MaterialEditorGui.defaultMaterialFile);
}
function MaterialEditorGui::convertTextureFields(%this)
@@ -539,88 +556,30 @@ function MaterialEditorGui::convertTextureFields(%this)
// Find the absolute paths for the texture filenames so that
// 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(%index = 0; %index < 4; %index++)
+ {
+ %mapFile = %material.call("get" @ %mapName, %index);
+ if(%mapFile !$= "" && !isFile(%mapFile))
+ {
+ //see if we can't go finding it
+ %mapFile = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %mapFile);
+ MaterialEditorGui.currentMaterial.call("set" @ %mapName, %mapFile, %index);
}
-
- for(%overlayI = 0; %overlayI < 4; %overlayI++)
- {
- %overlayMap = MaterialEditorGui.currentMaterial.overlayMap[%overlayI];
- %overlayMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %overlayMap);
- MaterialEditorGui.currentMaterial.overlayMap[%overlayI] = %overlayMap;
- }
-
- for(%detailI = 0; %detailI < 4; %detailI++)
- {
- %detailMap = MaterialEditorGui.currentMaterial.detailMap[%detailI];
- %detailMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %detailMap);
- MaterialEditorGui.currentMaterial.detailMap[%detailI] = %detailMap;
- }
-
- 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-->castDynamicShadows.setValue((%material).castDynamicShadows);
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)
{
case "None": %selectedNum = 0;
@@ -837,139 +787,175 @@ function MaterialEditorGui::guiSync( %this, %material )
//layer specific controls are located here
%layer = MaterialEditorGui.currentLayer;
- if((%material).diffuseMap[%layer] $= "")
+ //Diffuse
+ if((%material).getDiffuseMap(%layer) !$= "")
+ {
+ %difAsset = (%material).getDiffuseMapAsset(%layer);
+ MaterialEditorPropertiesWindow-->diffuseMapNameText.setText( (%material).getDiffuseMapAsset(%layer) );
+ MaterialEditorPropertiesWindow-->diffuseMapDisplayBitmap.setBitmap( (%material).getDiffuseMap(%layer) );
+ }
+ else
{
MaterialEditorPropertiesWindow-->diffuseMapNameText.setText( "None" );
MaterialEditorPropertiesWindow-->diffuseMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
}
- else
- {
- MaterialEditorPropertiesWindow-->diffuseMapNameText.setText( (%material).diffuseMap[%layer] );
- MaterialEditorPropertiesWindow-->diffuseMapDisplayBitmap.setBitmap( (%material).diffuseMap[%layer] );
- }
- if((%material).normalMap[%layer] $= "")
+ //Normal
+ if((%material).getNormalMap(%layer) !$= "")
+ {
+ MaterialEditorPropertiesWindow-->normalMapNameText.setText( (%material).getNormalMapAsset(%layer) );
+ MaterialEditorPropertiesWindow-->normalMapDisplayBitmap.setBitmap( (%material).getNormalMap(%layer) );
+ }
+ else
{
MaterialEditorPropertiesWindow-->normalMapNameText.setText( "None" );
MaterialEditorPropertiesWindow-->normalMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
}
+
+ //ORM Config
+ if((%material).getORMConfigMap(%layer) !$= "")
+ {
+ 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
{
- MaterialEditorPropertiesWindow-->normalMapNameText.setText( (%material).normalMap[%layer] );
- MaterialEditorPropertiesWindow-->normalMapDisplayBitmap.setBitmap( (%material).normalMap[%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).overlayMap[%layer] $= "")
+ //AOMap
+ if((%material).getAOMap(%layer) !$= "")
+ {
+ MaterialEditorPropertiesWindow-->aoMapNameText.setText( (%material).getAOMapAsset(%layer) );
+ MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap( (%material).getAOMap(%layer) );
+ }
+ else
+ {
+ MaterialEditorPropertiesWindow-->aoMapNameText.setText( "None" );
+ MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
+ }
+ //RoughMap
+ if((%material).getRoughMap(%layer) !$= "")
+ {
+ MaterialEditorPropertiesWindow-->roughMapNameText.setText( (%material).getRoughMapAsset(%layer) );
+ MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap( (%material).getRoughMap(%layer) );
+ }
+ else
+ {
+ MaterialEditorPropertiesWindow-->roughMapNameText.setText( "None" );
+ MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
+ }
+
+ //MetalMap
+ if((%material).getMetalMap(%layer) !$= "")
+ {
+ MaterialEditorPropertiesWindow-->metalMapNameText.setText( (%material).getMetalMapAsset(%layer) );
+ MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap( (%material).getMetalMap(%layer) );
+ }
+ else
+ {
+ MaterialEditorPropertiesWindow-->metalMapNameText.setText( "None" );
+ MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
+ }
+
+ //GlowMap
+ if((%material).getGlowMap(%layer) !$= "")
+ {
+ MaterialEditorPropertiesWindow-->glowMapNameText.setText( (%material).getGlowMapAsset(%layer) );
+ MaterialEditorPropertiesWindow-->glowMapDisplayBitmap.setBitmap( (%material).getGlowMap(%layer) );
+ }
+ else
+ {
+ MaterialEditorPropertiesWindow-->glowMapNameText.setText( "None" );
+ MaterialEditorPropertiesWindow-->glowMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
+ }
+
+ //Overlay
+ if((%material).getOverlayMap(%layer) !$= "")
+ {
+ MaterialEditorPropertiesWindow-->overlayMapNameText.setText( (%material).getOverlayMapAsset(%layer) );
+ MaterialEditorPropertiesWindow-->overlayMapDisplayBitmap.setBitmap( (%material).getOverlayMap(%layer) );
+ }
+ else
{
MaterialEditorPropertiesWindow-->overlayMapNameText.setText( "None" );
MaterialEditorPropertiesWindow-->overlayMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
}
- else
- {
- MaterialEditorPropertiesWindow-->overlayMapNameText.setText( (%material).overlayMap[%layer] );
- MaterialEditorPropertiesWindow-->overlayMapDisplayBitmap.setBitmap( (%material).overlayMap[%layer] );
- }
- if((%material).detailMap[%layer] $= "")
+ //Detail
+ if((%material).getDetailMap(%layer) !$= "")
+ {
+ MaterialEditorPropertiesWindow-->detailMapNameText.setText( (%material).getDetailMapAsset(%layer) );
+ MaterialEditorPropertiesWindow-->detailMapDisplayBitmap.setBitmap( (%material).getDetailMap(%layer) );
+ }
+ else
{
MaterialEditorPropertiesWindow-->detailMapNameText.setText( "None" );
MaterialEditorPropertiesWindow-->detailMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
}
- else
- {
- MaterialEditorPropertiesWindow-->detailMapNameText.setText( (%material).detailMap[%layer] );
- MaterialEditorPropertiesWindow-->detailMapDisplayBitmap.setBitmap( (%material).detailMap[%layer] );
- }
- if((%material).detailNormalMap[%layer] $= "")
+ //Detail Normal
+ if((%material).getDetailNormalMap(%layer) !$= "")
+ {
+ MaterialEditorPropertiesWindow-->detailNormalMapNameText.setText( (%material).getDetailNormalMapAsset(%layer) );
+ MaterialEditorPropertiesWindow-->detailNormalMapDisplayBitmap.setBitmap( (%material).getDetailNormalMap(%layer) );
+ }
+ else
{
MaterialEditorPropertiesWindow-->detailNormalMapNameText.setText( "None" );
MaterialEditorPropertiesWindow-->detailNormalMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
}
- else
- {
- MaterialEditorPropertiesWindow-->detailNormalMapNameText.setText( (%material).detailNormalMap[%layer] );
- MaterialEditorPropertiesWindow-->detailNormalMapDisplayBitmap.setBitmap( (%material).detailNormalMap[%layer] );
- }
- if((%material).lightMap[%layer] $= "")
+ //Light
+ if((%material).getLightMap(%layer) !$= "")
+ {
+ MaterialEditorPropertiesWindow-->lightMapNameText.setText( (%material).getLightMapAsset(%layer) );
+ MaterialEditorPropertiesWindow-->lightMapDisplayBitmap.setBitmap( (%material).getLightMap(%layer) );
+ }
+ else
{
MaterialEditorPropertiesWindow-->lightMapNameText.setText( "None" );
MaterialEditorPropertiesWindow-->lightMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
}
- else
- {
- MaterialEditorPropertiesWindow-->lightMapNameText.setText( (%material).lightMap[%layer] );
- MaterialEditorPropertiesWindow-->lightMapDisplayBitmap.setBitmap( (%material).lightMap[%layer] );
- }
- if((%material).toneMap[%layer] $= "")
+ //Tone
+ if((%material).getToneMap(%layer) !$= "")
+ {
+ MaterialEditorPropertiesWindow-->toneMapNameText.setText( (%material).getToneMapAsset(%layer) );
+ MaterialEditorPropertiesWindow-->toneMapDisplayBitmap.setBitmap( (%material).getToneMap(%layer) );
+ }
+ else
{
MaterialEditorPropertiesWindow-->toneMapNameText.setText( "None" );
MaterialEditorPropertiesWindow-->toneMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
}
- else
- {
- MaterialEditorPropertiesWindow-->toneMapNameText.setText( (%material).toneMap[%layer] );
- MaterialEditorPropertiesWindow-->toneMapDisplayBitmap.setBitmap( (%material).toneMap[%layer] );
- }
- MaterialEditorPropertiesWindow-->isSRGBCheckbox.setValue((%material).isSRGB[%layer]);
- MaterialEditorPropertiesWindow-->invertRoughnessCheckbox.setValue((%material).invertRoughness[%layer]);
-
- if((%material).ORMConfigMap[%layer] $= "")
- {
- MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText( "None" );
- MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
- }
- else
- {
- MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText( (%material).ORMConfigMap[%layer] );
- MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap( (%material).ORMConfigMap[%layer] );
- }
-
- if((%material).roughMap[%layer] $= "")
- {
- MaterialEditorPropertiesWindow-->roughMapNameText.setText( "None" );
- MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" );
- }
- else
- {
- MaterialEditorPropertiesWindow-->roughMapNameText.setText( (%material).roughMap[%layer] );
- MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap( (%material).roughMap[%layer] );
- }
-
- if((%material).aoMap[%layer] $= "")
- {
- MaterialEditorPropertiesWindow-->aoMapNameText.setText( "None" );
- MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" );
- }
- else
- {
- MaterialEditorPropertiesWindow-->aoMapNameText.setText( (%material).aoMap[%layer] );
- MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap( (%material).aoMap[%layer] );
- }
-
- if((%material).metalMap[%layer] $= "")
- {
- MaterialEditorPropertiesWindow-->metalMapNameText.setText( "None" );
- MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" );
- }
- else
- {
- MaterialEditorPropertiesWindow-->metalMapNameText.setText( (%material).metalMap[%layer] );
- MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap( (%material).metalMap[%layer] );
- }
-
- if((%material).glowMap[%layer] $= "")
- {
- MaterialEditorPropertiesWindow-->glowMapNameText.setText( "None" );
- MaterialEditorPropertiesWindow-->glowMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" );
- }
- else
- {
- MaterialEditorPropertiesWindow-->glowMapNameText.setText( (%material).glowMap[%layer] );
- MaterialEditorPropertiesWindow-->glowMapDisplayBitmap.setBitmap( (%material).glowMap[%layer] );
- }
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-->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-->glowMulSlider.setValue((%material).glowMul[%layer]);
MaterialEditorPropertiesWindow-->glowCheckbox.setValue((%material).glow[%layer]);
@@ -1240,24 +1222,49 @@ function MaterialEditorGui::updateTextureMap( %this, %type, %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
{
%textCtrl.setText("None");
%bitmapCtrl.setBitmap("tools/materialEditor/gui/unknownImage");
MaterialEditorGui.updateActiveMaterial(%type @ "Map[" @ %layer @ "]","");
+ MaterialEditorGui.updateActiveMaterial(%type @ "MapAsset[" @ %layer @ "]","");
}
+ MaterialEditorGui.guiSync( materialEd_previewMaterial );
+}
+
+function MaterialEditorGui::doUpdateTextureMap( %this, %assetId )
+{
+ if(%assetId !$= "")
+{
+ %layer = MaterialEditorGui.currentLayer;
+
+ %type = %this.updatingTextureType;
+
+ %bitmapCtrl = MaterialEditorPropertiesWindow.findObjectByInternalName( %type @ "MapDisplayBitmap", true );
+ %textCtrl = MaterialEditorPropertiesWindow.findObjectByInternalName( %type @ "MapNameText", true );
+
+ %assetDef = AssetDatabase.acquireAsset(%assetId);
+
+ %texture = %assetDef.getImagePath();
+
+ //%texture = MaterialEditorGui.openFile("texture");
+ if( %texture !$= "" )
+ {
+ %bitmapCtrl.setBitmap(%texture);
+
+ %bitmap = %bitmapCtrl.bitmap;
+ %bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/","");
+ %bitmapCtrl.setBitmap(%bitmap);
+ %textCtrl.setText(%assetId);
+ MaterialEditorGui.updateActiveMaterial(%type @ "Map[" @ %layer @ "]","\"\"");
+ MaterialEditorGui.updateActiveMaterial(%type @ "MapAsset[" @ %layer @ "]","\"" @ %assetId @ "\"");
+ }
+ }
+
+ %this.updatingTextureType = "";
+ MaterialEditorGui.guiSync( materialEd_previewMaterial );
}
function MaterialEditorGui::updateDetailScale(%this,%newScale)
@@ -1266,8 +1273,8 @@ function MaterialEditorGui::updateDetailScale(%this,%newScale)
%detailScale = "\"" @ %newScale SPC %newScale @ "\"";
MaterialEditorGui.updateActiveMaterial("detailScale[" @ %layer @ "]", %detailScale);
-}
-
+ }
+
function MaterialEditorGui::updateDetailNormalStrength(%this,%newStrength)
{
%layer = MaterialEditorGui.currentLayer;
@@ -1276,148 +1283,6 @@ function MaterialEditorGui::updateDetailNormalStrength(%this,%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 );
-}
-
-function MaterialEditorGui::updateRoughMap(%this,%action)
-{
- %layer = MaterialEditorGui.currentLayer;
-
- if( %action )
- {
- %texture = MaterialEditorGui.openFile("texture");
- if( %texture !$= "" )
- {
- MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap(%texture);
-
- %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 @ "]","");
- }
-
- MaterialEditorGui.guiSync( materialEd_previewMaterial );
-}
-
-function MaterialEditorGui::updateaoMap(%this,%action)
-{
- %layer = MaterialEditorGui.currentLayer;
-
- if( %action )
- {
- %texture = MaterialEditorGui.openFile("texture");
- if( %texture !$= "" )
- {
- MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap(%texture);
-
- %bitmap = MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.bitmap;
- %bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/","");
- MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap(%bitmap);
- MaterialEditorPropertiesWindow-->aoMapNameText.setText(%bitmap);
- MaterialEditorGui.updateActiveMaterial("aoMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
- }
- }
- else
- {
- MaterialEditorPropertiesWindow-->aoMapNameText.setText("None");
- MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap("tools/materialeditor/gui/unknownImage");
- MaterialEditorGui.updateActiveMaterial("aoMap[" @ %layer @ "]","");
- }
-
- MaterialEditorGui.guiSync( materialEd_previewMaterial );
-}
-
-function MaterialEditorGui::updatemetalMap(%this,%action)
-{
- %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 @ "]","");
- }
-
- MaterialEditorGui.guiSync( materialEd_previewMaterial );
-}
-
-function MaterialEditorGui::updateGlowMap(%this,%action)
-{
- %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 );
-}
-
function MaterialEditorGui::updateRotationOffset(%this, %isSlider, %onMouseUp)
{
%layer = MaterialEditorGui.currentLayer;
@@ -1599,12 +1464,6 @@ function MaterialEditorGui::updateColorMultiply(%this,%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)
{
%propName = "specular[" @ MaterialEditorGui.currentLayer @ "]";
@@ -2164,6 +2023,16 @@ function MaterialEditorGui::save( %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.object = "";
@@ -2571,10 +2440,10 @@ function MaterialEditorGui::saveCompositeMap(%this)
%material = %this.currentMaterial;
%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];
%ao = %material.AOChan[%layer];
diff --git a/Templates/BaseGame/game/tools/particleEditor/particleEmitterEditor.ed.tscript b/Templates/BaseGame/game/tools/particleEditor/particleEmitterEditor.ed.tscript
index f3825cfe2..ecd6c0209 100644
--- a/Templates/BaseGame/game/tools/particleEditor/particleEmitterEditor.ed.tscript
+++ b/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;
%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 );
else
PE_EmitterSaver.setDirty( %emitter );
@@ -551,6 +553,16 @@ function PE_EmitterEditor::showNewDialog( %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.
%emitter = getUniqueName( "newEmitter" );
datablock ParticleEmitterData( %emitter : DefaultEmitter )
diff --git a/Templates/BaseGame/game/tools/particleEditor/particleParticleEditor.ed.tscript b/Templates/BaseGame/game/tools/particleEditor/particleParticleEditor.ed.tscript
index 2dd764ce7..ff6f4cd5f 100644
--- a/Templates/BaseGame/game/tools/particleEditor/particleParticleEditor.ed.tscript
+++ b/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.setSelected( %data );
- %bitmap = MaterialEditorGui.searchForTexture( %data.getName(), %data.textureName );
+ %bitmap = %data.getTexture();//MaterialEditorGui.searchForTexture( %data.getName(), %data.getTexture() );
if( %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;
}
else
@@ -215,15 +220,7 @@ function PE_ParticleEditor::updateParticleTexture( %this, %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
{
@@ -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 )
@@ -389,11 +398,18 @@ function PE_ParticleEditor::loadNewParticle( %this, %particle )
PE_ParticleEditor.currParticle = %particle;
+ error("PE_ParticleEditor::loadNewParticle() - Loading particle: " @ %particle.getName());
+ error("Particle TextureName: " @ %particle.getTexture());
+
+ error("ReloadingParticle...");
%particle.reload();
PE_ParticleEditor_NotDirtyParticle.assignFieldsFrom( %particle );
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.setParticleNotDirty();
}
@@ -406,8 +422,10 @@ function PE_ParticleEditor::setParticleDirty( %this )
PE_ParticleEditor.dirty = true;
%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 );
else
PE_ParticleSaver.setDirty( %particle );
@@ -462,6 +480,24 @@ function PE_ParticleEditor::createParticle( %this, %replaceSlot )
else
%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.
%newParticle = getUniqueName( "newParticle" );
@@ -474,8 +510,8 @@ function PE_ParticleEditor::createParticle( %this, %replaceSlot )
%action = ParticleEditor.createUndo( ActionCreateNewParticle, "Create New Particle" );
%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;
ParticleEditor.submitUndo( %action );
diff --git a/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript b/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript
index 82b328623..e8ce055da 100644
--- a/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript
+++ b/Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript
@@ -114,6 +114,21 @@ function T3Dpre4ProjectImporter::copyFiles(%this)
%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.");
ProjectImportWindow-->nextButton.setActive(true);
diff --git a/Templates/BaseGame/game/tools/settings.xml b/Templates/BaseGame/game/tools/settings.xml
index 0addb2094..610c77918 100644
--- a/Templates/BaseGame/game/tools/settings.xml
+++ b/Templates/BaseGame/game/tools/settings.xml
@@ -1,268 +1,496 @@
-
- Small
+
+ Small
-
- TestConfig
- 1
- <AssetType>/<SpecialAssetTag>/
- <AssetType>/
- <AssetType>/OtherFolder/
- <AssetType>/<AssetName>/
- <AssetType>/
- <AssetType>/<SpecialAssetTag>/
- <AssetType>/
- <AssetType>/
- <AssetType>/
+
+ TestConfig
+ 1
+ <AssetType>/<SpecialAssetTag>/
+ <AssetType>/
+ <AssetType>/OtherFolder/
+ <AssetType>/<AssetName>/
+ <AssetType>/
+ <AssetType>/<SpecialAssetTag>/
+ <AssetType>/
+ <AssetType>/
+ <AssetType>/
-
- DefaultImportConfig
- 1
-
- 1
+
+ DefaultImportConfig
+ 1
+
+ 1
+ 1
+ 1
-
- 100
- 0.8
- 0.8
- 1
- 0
- 15
- 0
-
- 1
- 255 255 255 20
- 1 1 1
- 500
- 0
- 0
- 0
+
+ 100
+ 0.8
+ 0.8
+ 1
+ 0
+ 15
+ 0
+
+ 1
+ 255 255 255 20
+ 1 1 1
+ 500
+ 0
+ 0
+ 0
-
- Grid_512_Orange
+
+ Grid_512_Orange
-
- 1
+
+ 1
-
- tools/RPGDialogEditor/gui
- 1024 768
-
- 0
- 0
- 0
+
+ tools/RPGDialogEditor/gui
+ 1024 768
+
+ 0
+ 0
+ 0
-
- ../../../Documentation/Official Documentation.html
- ../../../Documentation/Torque 3D - Script Manual.chm
- http://www.garagegames.com/products/torque-3d/documentation/user
+
+ ../../../Documentation/Official Documentation.html
+ ../../../Documentation/Torque 3D - Script Manual.chm
+ http://www.garagegames.com/products/torque-3d/documentation/user
-
- Categorized
+
+ Categorized
-
- 1
- 1
+
+ 1
+ 1
-
- 0
+
+ 0
-
- 2
- 0
- 8
- 1
- 1
- 1
- 1
- 1
+
+ 2
+ 0
+ 8
+ 1
+ 1
+ 1
+ 1
+ 1
-
- data/FPSGameplay/levels
-
-
- 25
+
+ data/FPSGameplay/levels
+
+
+ 25
-
- 25
+
+ 25
-
- 25
+
+ 25
-
- 25
+
+ 25
-
- 5
+
+ 5
-
- 0 0 1
- 10
- 255 0 0 255
- 0 255 0 255
- DefaultRoadMaterialOther
- DefaultRoadMaterialTop
+
+ 0 0 1
+ 10
+ 255 0 0 255
+ 0 255 0 255
+ DefaultRoadMaterialOther
+ DefaultRoadMaterialTop
-
- 1
- AIPlayer
- DefaultPlayerData
+
+ 1
+ AIPlayer
+ DefaultPlayerData
-
- 5
- 0 0 1
- 10
- 255 255 255 255
- 255 0 0 255
- 0 255 0 255
+
+ 5
+ 0 0 1
+ 10
+ 255 255 255 255
+ 255 0 0 255
+ 0 255 0 255
-
- 10
- 255 255 255 255
- DefaultDecalRoadMaterial
- 0 255 0 255
+
+ 10
+ 255 255 255 255
+ DefaultDecalRoadMaterial
+ 0 255 0 255
-
- 1
- 0 0 0 100
- 40 40
- 0.1
- 1
- 0
- 1
- 0
- 1
- 1
- 1
- 180 180 180 255
- 45
- 135
- 255 255 255 255
+
+ 1
+ 0 0 0 100
+ 40 40
+ 0.1
+ 1
+ 0
+ 1
+ 0
+ 1
+ 1
+ 1
+ 180 180 180 255
+ 45
+ 135
+ 255 255 255 255
-
- lowerHeight
-
- 10
- 1
- 1
- 100
- 90
- 0
- 0.1
- 1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000
- 1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000
- 50
+
+ lowerHeight
+
+ 10
+ 1
+ 1
+ 100
+ 90
+ 0
+ 0.1
+ 1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000
+ 1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000
+ 50
-
- 1
- 40 40
- 1
- ellipse
- 40 40
+
+ 1
+ 40 40
+ 1
+ ellipse
+ 40 40
-
- 17 16 15 255
- 96 94 92 255
- 50 49 48 255
- 59 58 57 255
- 72 70 68 255
- 100 98 96 255
- 178 175 172 255
- 234 232 230 255
- 120 120 120 255
- 255 255 255 255
- 50 49 48 255
- 236 234 232 255
- 37 36 35 255
- 50 49 48 255
- 59 58 57 255
- 43 43 43 255
- 72 70 68 255
- 255 255 255 255
- 32 31 30 255
+
+ 17 16 15 255
+ 96 94 92 255
+ 50 49 48 255
+ 59 58 57 255
+ 72 70 68 255
+ 100 98 96 255
+ 178 175 172 255
+ 234 232 230 255
+ 120 120 120 255
+ 255 255 255 255
+ 50 49 48 255
+ 236 234 232 255
+ 37 36 35 255
+ 50 49 48 255
+ 59 58 57 255
+ 43 43 43 255
+ 72 70 68 255
+ 255 255 255 255
+ 32 31 30 255
-
- WorldEditorInspectorPlugin
- 6
- screenCenter
- Modern
- 0
- 1
- FPSGameplay:EmptyLevel
- 50
- 1
- FPSGameplay:EmptyLevel,FPSGameplay:EmptyTerrain,pbr:PbrMatTestLevel,TTR:DasBootLevel
- Blank Level
- AssetWork_Debug.exe
- 40
-
- 255 255 0 255
- 255 255 255 255
- 0 255 0 255
- 0 0 255 255
- 255 0 0 255
- 100 100 100 255
- 255 255 0 255
+
+ WorldEditorInspectorPlugin
+ 6
+ screenCenter
+ Modern
+ 0
+ 1
+ FPSGameplay:EmptyLevel
+ 4.60158
+ 1
+ FPSGameplay:EmptyLevel,FPSGameplay:EmptyTerrain,pbr:PbrMatTestLevel,TTR:DasBootLevel
+ Blank Level
+ AssetWork_Debug.exe
+ 40
+
+ 255 255 0 255
+ 255 255 255 255
+ 0 255 0 255
+ 0 0 255 255
+ 255 0 0 255
+ 100 100 100 255
+ 255 255 0 255
-
- ../../../Documentation/Official Documentation.html
- ../../../Documentation/Torque 3D - Script Manual.chm
- http://www.garagegames.com/products/torque-3d/documentation/user
- http://www.garagegames.com/products/torque-3d/forums
+
+ ../../../Documentation/Official Documentation.html
+ ../../../Documentation/Torque 3D - Script Manual.chm
+ http://www.garagegames.com/products/torque-3d/documentation/user
+ http://www.garagegames.com/products/torque-3d/forums
-
- 102 102 102 100
- 51 51 51 100
- 255 255 255 100
- 1
- 0
+
+ 102 102 102 100
+ 51 51 51 100
+ 255 255 255 100
+ 1
+ 0
-
- tools/worldEditor/images/DefaultHandle
- tools/worldEditor/images/LockedHandle
- tools/worldEditor/images/SelectHandle
+
+ tools/worldEditor/images/DefaultHandle
+ tools/worldEditor/images/LockedHandle
+ tools/worldEditor/images/SelectHandle
-
- Classic
+
+ Classic
-
- 1
- 0
- 20
- 255
- 8
+
+ 1
+ 0
+ 20
+ 255
+ 8
-
- 1
- 1
- 1
- 1
- 1
+
+ 1
+ 1
+ 1
+ 1
+ 1
-
- 50 50 50 255
- 48 48 48 255
- 180 180 180 255
- 215 215 215 255
- 255 255 255 255
+
+ 50 50 50 255
+ 48 48 48 255
+ 180 180 180 255
+ 215 215 215 255
+ 255 255 255 255
-
- 0
- 100
- 1
- 1
- 0.01
- 0
- 0
- 2
- 0
+
+ 0
+ 100
+ 1
+ 1
+ 0.01
+ 0
+ 0
+ 2
+ 0
diff --git a/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditorActions.ed.tscript b/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditorActions.ed.tscript
index a5b213424..bd6ee4d92 100644
--- a/Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditorActions.ed.tscript
+++ b/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
%idx -= 1;
- %animSet = "ShapeEditorPlugin.selectedAssetDef.animationSequence"@%idx@"=\"@Asset="@%moduleName@":"@%assetDef.assetName@"\";";
+ %animSet = "ShapeEditorPlugin.selectedAssetDef.animationSequence"@%idx@"=\"@asset="@%moduleName@":"@%assetDef.assetName@"\";";
eval(%animSet);
%assetPath = AssetDatabase.getAssetFilePath(ShapeEditorPlugin.selectedAssetId);
diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/EditorChooseLevelGui.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/EditorChooseLevelGui.ed.gui
index a384f59e7..06a8f7599 100644
--- a/Templates/BaseGame/game/tools/worldEditor/gui/EditorChooseLevelGui.ed.gui
+++ b/Templates/BaseGame/game/tools/worldEditor/gui/EditorChooseLevelGui.ed.gui
@@ -28,7 +28,7 @@
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
- bitmap = "art/gui/background";
+ bitmap = "data/ui/images/background.png";
useVariable = "0";
tile = "0";
};
diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/EditorGui.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/EditorGui.ed.gui
index 94eb425f6..a07d8cd50 100644
--- a/Templates/BaseGame/game/tools/worldEditor/gui/EditorGui.ed.gui
+++ b/Templates/BaseGame/game/tools/worldEditor/gui/EditorGui.ed.gui
@@ -481,8 +481,8 @@
selectionBoxColor = "255 255 0 255";
selectionLocked = "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";
};
new TerrainEditor(ETerrainEditor) {
diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainMaterialDlg.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainMaterialDlg.ed.gui
index fc0c0369a..32bae596f 100644
--- a/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainMaterialDlg.ed.gui
+++ b/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainMaterialDlg.ed.gui
@@ -32,8 +32,8 @@
anchorBottom = "0";
anchorLeft = "0";
anchorRight = "0";
- position = "315 127";
- extent = "394 514";
+ position = "315 118";
+ extent = "394 532";
minExtent = "358 452";
horizSizing = "center";
vertSizing = "center";
@@ -149,7 +149,7 @@
anchorLeft = "1";
anchorRight = "0";
position = "202 26";
- extent = "185 445";
+ extent = "185 463";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "height";
@@ -256,7 +256,7 @@
canSave = "1";
canSaveDynamicFields = "0";
};
- new GuiContainer() {
+ new GuiContainer(BaseMapContainer) {
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
@@ -312,7 +312,7 @@
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
- internalName = "baseTexCtrl";
+ internalName = "texBaseMap";
canSave = "1";
canSaveDynamicFields = "0";
};
@@ -334,7 +334,7 @@
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
- command = "TerrainMaterialDlg.changeBase();";
+ command = "TerrainMaterialDlg.updateTextureMap(\"BaseMap\");";
tooltipProfile = "ToolsGuiDefaultProfile";
tooltip = "Change the Active Diffuse Map for this layer";
hovertime = "1000";
@@ -385,6 +385,7 @@
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
+ internalName = "diffuseMapAssetId";
canSave = "1";
canSaveDynamicFields = "0";
};
@@ -401,7 +402,7 @@
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
- command = "TerrainMaterialDlg.changeBase();";
+ command = "TerrainMaterialDlg.updateTextureMap(\"BaseMap\");";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
@@ -426,7 +427,7 @@
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
- command = "TerrainMaterialDlg-->baseTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");";
+ command = "TerrainMaterialDlg.clearTextureMap(\"BaseMap\");";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
@@ -462,6 +463,7 @@
sinkAllKeyEvents = "0";
password = "0";
passwordMask = "*";
+ text = "200";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
@@ -503,7 +505,7 @@
canSave = "1";
canSaveDynamicFields = "0";
};
- new GuiContainer() {
+ new GuiContainer(DetailMapContainer) {
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
@@ -539,30 +541,7 @@
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
- internalName = "normTexCtrl";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiTextCtrl() {
- text = "Normal";
- maxLength = "1024";
- margin = "0 0 0 0";
- padding = "0 0 0 0";
- anchorTop = "1";
- anchorBottom = "0";
- anchorLeft = "1";
- anchorRight = "0";
- position = "56 -3";
- extent = "39 18";
- minExtent = "8 2";
- horizSizing = "right";
- vertSizing = "bottom";
- profile = "EditorTextProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "0";
+ internalName = "texDetailMap";
canSave = "1";
canSaveDynamicFields = "0";
};
@@ -584,578 +563,7 @@
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
- command = "TerrainMaterialDlg.changeNormal();";
- tooltipProfile = "ToolsGuiDefaultProfile";
- tooltip = "Change the active Normal Map for this layer.";
- hovertime = "1000";
- isContainer = "0";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiTextCtrl() {
- text = "None";
- maxLength = "1024";
- margin = "0 0 0 0";
- padding = "0 0 0 0";
- anchorTop = "1";
- anchorBottom = "0";
- anchorLeft = "1";
- anchorRight = "0";
- position = "56 15";
- extent = "116 17";
- minExtent = "8 2";
- horizSizing = "width";
- vertSizing = "bottom";
- profile = "ToolsGuiTextProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "0";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiButtonCtrl() {
- text = "Edit";
- groupNum = "-1";
- buttonType = "PushButton";
- useMouseEvents = "0";
- position = "116 0";
- extent = "40 16";
- minExtent = "8 2";
- horizSizing = "left";
- vertSizing = "bottom";
- profile = "ToolsGuiButtonProfile";
- visible = "1";
- active = "1";
- command = "TerrainMaterialDlg.changeNormal();";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "0";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiBitmapButtonCtrl() {
- bitmap = "tools/gui/images/delete";
- bitmapMode = "Stretched";
- autoFitExtents = "0";
- useModifiers = "0";
- useStates = "1";
- masked = "0";
- groupNum = "-1";
- buttonType = "PushButton";
- useMouseEvents = "0";
- position = "159 0";
- extent = "16 16";
- minExtent = "8 2";
- horizSizing = "left";
- vertSizing = "bottom";
- profile = "ToolsGuiDefaultProfile";
- visible = "1";
- active = "1";
- command = "TerrainMaterialDlg-->normTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "0";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiTextCtrl() {
- text = "Parallax Scale";
- maxLength = "1024";
- margin = "0 0 0 0";
- padding = "0 0 0 0";
- anchorTop = "1";
- anchorBottom = "0";
- anchorLeft = "1";
- anchorRight = "0";
- position = "92 34";
- extent = "77 16";
- minExtent = "8 2";
- horizSizing = "right";
- vertSizing = "bottom";
- profile = "ToolsGuiTextProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "0";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiTextEditCtrl() {
- historySize = "0";
- tabComplete = "0";
- sinkAllKeyEvents = "0";
- password = "0";
- passwordMask = "*";
- text = "0.00";
- maxLength = "1024";
- margin = "0 0 0 0";
- padding = "0 0 0 0";
- anchorTop = "0";
- anchorBottom = "0";
- anchorLeft = "0";
- anchorRight = "0";
- position = "55 33";
- extent = "34 18";
- minExtent = "8 2";
- horizSizing = "right";
- vertSizing = "bottom";
- profile = "ToolsGuiTextEditProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "0";
- internalName = "parallaxScaleCtrl";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiSliderCtrl(TerrainMaterialDlgBlendHeightBaseSlider) {
- range = "-0.5 0.5";
- ticks = "0";
- snap = "0";
- value = "0.5";
- useFillBar = "0";
- fillBarColor = "255 255 255 255";
- renderTicks = "1";
- position = "39 61";
- extent = "70 14";
- minExtent = "8 2";
- horizSizing = "right";
- vertSizing = "bottom";
- profile = "ToolsGuiSliderProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "0";
- internalName = "blendHeightBaseSliderCtrl";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiTextCtrl() {
- text = "Blend Height";
- maxLength = "1024";
- margin = "0 0 0 0";
- padding = "0 0 0 0";
- anchorTop = "1";
- anchorBottom = "0";
- anchorLeft = "1";
- anchorRight = "0";
- position = "115 61";
- extent = "58 15";
- minExtent = "8 2";
- horizSizing = "right";
- vertSizing = "bottom";
- profile = "ToolsGuiTextProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "1";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiTextEditCtrl(TerrainMaterialDlgBlendHeightBaseTextEdit) {
- historySize = "0";
- tabComplete = "0";
- sinkAllKeyEvents = "0";
- password = "0";
- passwordMask = "*";
- text = "0.3";
- maxLength = "1024";
- margin = "0 0 0 0";
- padding = "0 0 0 0";
- anchorTop = "0";
- anchorBottom = "0";
- anchorLeft = "0";
- anchorRight = "0";
- position = "1 59";
- extent = "35 18";
- minExtent = "8 2";
- horizSizing = "right";
- vertSizing = "bottom";
- profile = "ToolsGuiTextEditProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "0";
- internalName = "blendHeightBaseTextEditCtrl";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiSliderCtrl(TerrainMaterialDlgBlendHeightContrastSlider) {
- range = "0.0 5.0";
- ticks = "0";
- snap = "0";
- value = "1.0";
- useFillBar = "0";
- fillBarColor = "255 255 255 255";
- renderTicks = "1";
- position = "39 81";
- extent = "70 14";
- minExtent = "8 2";
- horizSizing = "right";
- vertSizing = "bottom";
- profile = "ToolsGuiSliderProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "0";
- internalName = "blendHeightContrastSliderCtrl";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiTextCtrl() {
- text = "Blend Contrast";
- maxLength = "1024";
- margin = "0 0 0 0";
- padding = "0 0 0 0";
- anchorTop = "1";
- anchorBottom = "0";
- anchorLeft = "1";
- anchorRight = "0";
- position = "115 81";
- extent = "58 15";
- minExtent = "8 2";
- horizSizing = "right";
- vertSizing = "bottom";
- profile = "ToolsGuiTextProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "1";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiTextEditCtrl(TerrainMaterialDlgBlendHeightContrastTextEdit) {
- historySize = "0";
- tabComplete = "0";
- sinkAllKeyEvents = "0";
- password = "0";
- passwordMask = "*";
- text = "0.3";
- maxLength = "1024";
- margin = "0 0 0 0";
- padding = "0 0 0 0";
- anchorTop = "0";
- anchorBottom = "0";
- anchorLeft = "0";
- anchorRight = "0";
- position = "1 79";
- extent = "35 18";
- minExtent = "8 2";
- horizSizing = "right";
- vertSizing = "bottom";
- profile = "ToolsGuiTextEditProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "0";
- internalName = "blendHeightContrastTextEditCtrl";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- };
- new GuiBitmapCtrl() {
- bitmapAsset = "ToolsModule:separator_v_image";
- color = "255 255 255 255";
- wrap = "0";
- position = "6 222";
- extent = "175 2";
- minExtent = "8 2";
- horizSizing = "width";
- vertSizing = "bottom";
- profile = "ToolsGuiDefaultProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "0";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiContainer() {
- margin = "0 0 0 0";
- padding = "0 0 0 0";
- anchorTop = "1";
- anchorBottom = "0";
- anchorLeft = "1";
- anchorRight = "0";
- position = "6 229";
- extent = "185 64";
- minExtent = "8 2";
- horizSizing = "width";
- vertSizing = "bottom";
- profile = "ToolsGuiDefaultProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "1";
- canSave = "1";
- canSaveDynamicFields = "0";
-
- new GuiBitmapCtrl() {
- bitmapAsset = "ToolsModule:unknownImage_image";
- color = "255 255 255 255";
- wrap = "0";
- position = "1 1";
- extent = "47 47";
- minExtent = "8 2";
- horizSizing = "right";
- vertSizing = "bottom";
- profile = "ToolsGuiDefaultProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "0";
- internalName = "ormConfigTexCtrl";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiTextCtrl() {
- text = "ORM Config";
- maxLength = "1024";
- margin = "0 0 0 0";
- padding = "0 0 0 0";
- anchorTop = "1";
- anchorBottom = "0";
- anchorLeft = "1";
- anchorRight = "0";
- position = "56 -3";
- extent = "64 18";
- minExtent = "8 2";
- horizSizing = "right";
- vertSizing = "bottom";
- profile = "EditorTextProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "0";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiBitmapButtonCtrl() {
- bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
- bitmapMode = "Stretched";
- autoFitExtents = "0";
- useModifiers = "0";
- useStates = "1";
- masked = "0";
- groupNum = "-1";
- buttonType = "PushButton";
- useMouseEvents = "0";
- position = "1 1";
- extent = "48 48";
- minExtent = "8 2";
- horizSizing = "right";
- vertSizing = "bottom";
- profile = "ToolsGuiDefaultProfile";
- visible = "1";
- active = "1";
- command = "TerrainMaterialDlg.changeormConfig();";
- tooltipProfile = "ToolsGuiDefaultProfile";
- tooltip = "Change the active ORM Config Map for this layer.";
- hovertime = "1000";
- isContainer = "0";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiTextCtrl() {
- text = "None";
- maxLength = "1024";
- margin = "0 0 0 0";
- padding = "0 0 0 0";
- anchorTop = "1";
- anchorBottom = "0";
- anchorLeft = "1";
- anchorRight = "0";
- position = "56 15";
- extent = "116 17";
- minExtent = "8 2";
- horizSizing = "width";
- vertSizing = "bottom";
- profile = "ToolsGuiTextProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "0";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiButtonCtrl() {
- text = "Edit";
- groupNum = "-1";
- buttonType = "PushButton";
- useMouseEvents = "0";
- position = "116 0";
- extent = "40 16";
- minExtent = "8 2";
- horizSizing = "left";
- vertSizing = "bottom";
- profile = "ToolsGuiButtonProfile";
- visible = "1";
- active = "1";
- command = "TerrainMaterialDlg.changeormConfig();";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "0";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiBitmapButtonCtrl() {
- bitmap = "tools/gui/images/delete";
- bitmapMode = "Stretched";
- autoFitExtents = "0";
- useModifiers = "0";
- useStates = "1";
- masked = "0";
- groupNum = "-1";
- buttonType = "PushButton";
- useMouseEvents = "0";
- position = "159 0";
- extent = "16 16";
- minExtent = "8 2";
- horizSizing = "left";
- vertSizing = "bottom";
- profile = "ToolsGuiDefaultProfile";
- visible = "1";
- active = "1";
- command = "TerrainMaterialDlg-->ormConfigTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "0";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiCheckBoxCtrl() {
- text = " Is sRGB";
- groupNum = "-1";
- buttonType = "ToggleButton";
- useMouseEvents = "0";
- position = "55 32";
- extent = "119 16";
- minExtent = "8 2";
- horizSizing = "right";
- vertSizing = "bottom";
- profile = "ToolsGuiCheckBoxProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "0";
- internalName = "isSRGb";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiCheckBoxCtrl() {
- text = " Invert Roughness";
- groupNum = "-1";
- buttonType = "ToggleButton";
- useMouseEvents = "0";
- position = "55 48";
- extent = "119 16";
- minExtent = "8 2";
- horizSizing = "right";
- vertSizing = "bottom";
- profile = "ToolsGuiCheckBoxProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "0";
- internalName = "invertRoughness";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- };
- new GuiBitmapCtrl() {
- bitmapAsset = "ToolsModule:separator_v_image";
- color = "255 255 255 255";
- wrap = "0";
- position = "6 299";
- extent = "175 2";
- minExtent = "8 2";
- horizSizing = "width";
- vertSizing = "bottom";
- profile = "ToolsGuiDefaultProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "0";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiContainer() {
- margin = "0 0 0 0";
- padding = "0 0 0 0";
- anchorTop = "1";
- anchorBottom = "0";
- anchorLeft = "1";
- anchorRight = "0";
- position = "6 306";
- extent = "185 72";
- minExtent = "8 2";
- horizSizing = "width";
- vertSizing = "bottom";
- profile = "ToolsGuiDefaultProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "1";
- canSave = "1";
- canSaveDynamicFields = "0";
-
- new GuiBitmapCtrl() {
- bitmapAsset = "ToolsModule:unknownImage_image";
- color = "255 255 255 255";
- wrap = "0";
- position = "1 1";
- extent = "47 47";
- minExtent = "8 2";
- horizSizing = "right";
- vertSizing = "bottom";
- profile = "ToolsGuiDefaultProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- isContainer = "0";
- internalName = "detailTexCtrl";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiBitmapButtonCtrl() {
- bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
- bitmapMode = "Stretched";
- autoFitExtents = "0";
- useModifiers = "0";
- useStates = "1";
- masked = "0";
- groupNum = "-1";
- buttonType = "PushButton";
- useMouseEvents = "0";
- position = "1 1";
- extent = "48 48";
- minExtent = "8 2";
- horizSizing = "right";
- vertSizing = "bottom";
- profile = "ToolsGuiDefaultProfile";
- visible = "1";
- active = "1";
- command = "TerrainMaterialDlg.changeDetail();";
+ command = "TerrainMaterialDlg.updateTextureMap(\"DetailMap\");";
tooltipProfile = "ToolsGuiDefaultProfile";
tooltip = "Change the active Detail Map for this layer.";
hovertime = "1000";
@@ -1206,6 +614,7 @@
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
+ internalName = "detailMapAssetId";
canSave = "1";
canSaveDynamicFields = "0";
};
@@ -1222,7 +631,7 @@
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
- command = "TerrainMaterialDlg.changeDetail();";
+ command = "TerrainMaterialDlg.updateTextureMap(\"DetailMap\");";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
@@ -1247,7 +656,7 @@
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
- command = "TerrainMaterialDlg-->detailTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");";
+ command = "TerrainMaterialDlg.clearTextureMap(\"DetailMap\");";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
@@ -1283,6 +692,7 @@
sinkAllKeyEvents = "0";
password = "0";
passwordMask = "*";
+ text = "2";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
@@ -1334,6 +744,7 @@
sinkAllKeyEvents = "0";
password = "0";
passwordMask = "*";
+ text = "1";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
@@ -1385,6 +796,7 @@
sinkAllKeyEvents = "0";
password = "0";
passwordMask = "*";
+ text = "50";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
@@ -1407,15 +819,413 @@
canSave = "1";
canSaveDynamicFields = "0";
};
- new GuiContainer() {
+ };
+ new GuiBitmapCtrl() {
+ bitmapAsset = "ToolsModule:separator_v_image";
+ color = "255 255 255 255";
+ wrap = "0";
+ position = "6 198";
+ extent = "175 2";
+ minExtent = "8 2";
+ horizSizing = "width";
+ vertSizing = "bottom";
+ profile = "ToolsGuiDefaultProfile";
+ visible = "1";
+ active = "1";
+ tooltipProfile = "ToolsGuiToolTipProfile";
+ hovertime = "1000";
+ isContainer = "0";
+ canSave = "1";
+ canSaveDynamicFields = "0";
+ };
+ new GuiContainer(NormalMapContainer) {
+ margin = "0 0 0 0";
+ padding = "0 0 0 0";
+ anchorTop = "1";
+ anchorBottom = "0";
+ anchorLeft = "1";
+ anchorRight = "0";
+ position = "6 205";
+ extent = "185 100";
+ minExtent = "8 2";
+ horizSizing = "width";
+ vertSizing = "bottom";
+ profile = "ToolsGuiDefaultProfile";
+ visible = "1";
+ active = "1";
+ tooltipProfile = "ToolsGuiToolTipProfile";
+ hovertime = "1000";
+ isContainer = "1";
+ canSave = "1";
+ canSaveDynamicFields = "0";
+
+ new GuiBitmapCtrl() {
+ bitmapAsset = "ToolsModule:unknownImage_image";
+ color = "255 255 255 255";
+ wrap = "0";
+ position = "1 1";
+ extent = "47 47";
+ minExtent = "8 2";
+ horizSizing = "right";
+ vertSizing = "bottom";
+ profile = "ToolsGuiDefaultProfile";
+ visible = "1";
+ active = "1";
+ tooltipProfile = "ToolsGuiToolTipProfile";
+ hovertime = "1000";
+ isContainer = "0";
+ internalName = "texNormalMap";
+ canSave = "1";
+ canSaveDynamicFields = "0";
+ };
+ new GuiTextCtrl() {
+ text = "Normal";
+ maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
- position = "6 216";
- extent = "174 53";
+ position = "56 -3";
+ extent = "39 18";
+ minExtent = "8 2";
+ horizSizing = "right";
+ vertSizing = "bottom";
+ profile = "EditorTextProfile";
+ visible = "1";
+ active = "1";
+ tooltipProfile = "ToolsGuiToolTipProfile";
+ hovertime = "1000";
+ isContainer = "0";
+ canSave = "1";
+ canSaveDynamicFields = "0";
+ };
+ new GuiBitmapButtonCtrl() {
+ bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
+ bitmapMode = "Stretched";
+ autoFitExtents = "0";
+ useModifiers = "0";
+ useStates = "1";
+ masked = "0";
+ groupNum = "-1";
+ buttonType = "PushButton";
+ useMouseEvents = "0";
+ position = "1 1";
+ extent = "48 48";
+ minExtent = "8 2";
+ horizSizing = "right";
+ vertSizing = "bottom";
+ profile = "ToolsGuiDefaultProfile";
+ visible = "1";
+ active = "1";
+ command = "TerrainMaterialDlg.updateTextureMap(\"NormalMap\");";
+ tooltipProfile = "ToolsGuiDefaultProfile";
+ tooltip = "Change the active Normal Map for this layer.";
+ hovertime = "1000";
+ isContainer = "0";
+ canSave = "1";
+ canSaveDynamicFields = "0";
+ };
+ new GuiTextCtrl() {
+ text = "None";
+ maxLength = "1024";
+ margin = "0 0 0 0";
+ padding = "0 0 0 0";
+ anchorTop = "1";
+ anchorBottom = "0";
+ anchorLeft = "1";
+ anchorRight = "0";
+ position = "56 15";
+ extent = "116 17";
+ minExtent = "8 2";
+ horizSizing = "width";
+ vertSizing = "bottom";
+ profile = "ToolsGuiTextProfile";
+ visible = "1";
+ active = "1";
+ tooltipProfile = "ToolsGuiToolTipProfile";
+ hovertime = "1000";
+ isContainer = "0";
+ internalName = "normalMapAssetId";
+ canSave = "1";
+ canSaveDynamicFields = "0";
+ };
+ new GuiButtonCtrl() {
+ text = "Edit";
+ groupNum = "-1";
+ buttonType = "PushButton";
+ useMouseEvents = "0";
+ position = "116 0";
+ extent = "40 16";
+ minExtent = "8 2";
+ horizSizing = "left";
+ vertSizing = "bottom";
+ profile = "ToolsGuiButtonProfile";
+ visible = "1";
+ active = "1";
+ command = "TerrainMaterialDlg.updateTextureMap(\"NormalMap\");";
+ tooltipProfile = "ToolsGuiToolTipProfile";
+ hovertime = "1000";
+ isContainer = "0";
+ canSave = "1";
+ canSaveDynamicFields = "0";
+ };
+ new GuiBitmapButtonCtrl() {
+ bitmap = "tools/gui/images/delete";
+ bitmapMode = "Stretched";
+ autoFitExtents = "0";
+ useModifiers = "0";
+ useStates = "1";
+ masked = "0";
+ groupNum = "-1";
+ buttonType = "PushButton";
+ useMouseEvents = "0";
+ position = "159 0";
+ extent = "16 16";
+ minExtent = "8 2";
+ horizSizing = "left";
+ vertSizing = "bottom";
+ profile = "ToolsGuiDefaultProfile";
+ visible = "1";
+ active = "1";
+ command = "TerrainMaterialDlg.clearTextureMap(\"NormalMap\");";
+ tooltipProfile = "ToolsGuiToolTipProfile";
+ hovertime = "1000";
+ isContainer = "0";
+ canSave = "1";
+ canSaveDynamicFields = "0";
+ };
+ new GuiTextCtrl() {
+ text = "Parallax Scale";
+ maxLength = "1024";
+ margin = "0 0 0 0";
+ padding = "0 0 0 0";
+ anchorTop = "1";
+ anchorBottom = "0";
+ anchorLeft = "1";
+ anchorRight = "0";
+ position = "92 34";
+ extent = "77 16";
+ minExtent = "8 2";
+ horizSizing = "right";
+ vertSizing = "bottom";
+ profile = "ToolsGuiTextProfile";
+ visible = "1";
+ active = "1";
+ tooltipProfile = "ToolsGuiToolTipProfile";
+ hovertime = "1000";
+ isContainer = "0";
+ canSave = "1";
+ canSaveDynamicFields = "0";
+ };
+ new GuiTextEditCtrl() {
+ historySize = "0";
+ tabComplete = "0";
+ sinkAllKeyEvents = "0";
+ password = "0";
+ passwordMask = "*";
+ text = "0";
+ maxLength = "1024";
+ margin = "0 0 0 0";
+ padding = "0 0 0 0";
+ anchorTop = "0";
+ anchorBottom = "0";
+ anchorLeft = "0";
+ anchorRight = "0";
+ position = "55 33";
+ extent = "34 18";
+ minExtent = "8 2";
+ horizSizing = "right";
+ vertSizing = "bottom";
+ profile = "ToolsGuiTextEditProfile";
+ visible = "1";
+ active = "1";
+ tooltipProfile = "ToolsGuiToolTipProfile";
+ hovertime = "1000";
+ isContainer = "0";
+ internalName = "parallaxScaleCtrl";
+ canSave = "1";
+ canSaveDynamicFields = "0";
+ };
+ new GuiSliderCtrl(TerrainMaterialDlgBlendHeightBaseSlider) {
+ range = "-0.5 0.5";
+ ticks = "0";
+ snap = "0";
+ value = "0";
+ useFillBar = "0";
+ fillBarColor = "255 255 255 255";
+ renderTicks = "1";
+ position = "39 61";
+ extent = "70 14";
+ minExtent = "8 2";
+ horizSizing = "right";
+ vertSizing = "bottom";
+ profile = "ToolsGuiSliderProfile";
+ visible = "1";
+ active = "1";
+ tooltipProfile = "ToolsGuiToolTipProfile";
+ hovertime = "1000";
+ isContainer = "0";
+ internalName = "blendHeightBaseSliderCtrl";
+ canSave = "1";
+ canSaveDynamicFields = "0";
+ };
+ new GuiTextCtrl() {
+ text = "Blend Height";
+ maxLength = "1024";
+ margin = "0 0 0 0";
+ padding = "0 0 0 0";
+ anchorTop = "1";
+ anchorBottom = "0";
+ anchorLeft = "1";
+ anchorRight = "0";
+ position = "115 61";
+ extent = "58 15";
+ minExtent = "8 2";
+ horizSizing = "right";
+ vertSizing = "bottom";
+ profile = "ToolsGuiTextProfile";
+ visible = "1";
+ active = "1";
+ tooltipProfile = "ToolsGuiToolTipProfile";
+ hovertime = "1000";
+ isContainer = "1";
+ canSave = "1";
+ canSaveDynamicFields = "0";
+ };
+ new GuiTextEditCtrl(TerrainMaterialDlgBlendHeightBaseTextEdit) {
+ historySize = "0";
+ tabComplete = "0";
+ sinkAllKeyEvents = "0";
+ password = "0";
+ passwordMask = "*";
+ text = "0";
+ maxLength = "1024";
+ margin = "0 0 0 0";
+ padding = "0 0 0 0";
+ anchorTop = "0";
+ anchorBottom = "0";
+ anchorLeft = "0";
+ anchorRight = "0";
+ position = "1 59";
+ extent = "35 18";
+ minExtent = "8 2";
+ horizSizing = "right";
+ vertSizing = "bottom";
+ profile = "ToolsGuiTextEditProfile";
+ visible = "1";
+ active = "1";
+ tooltipProfile = "ToolsGuiToolTipProfile";
+ hovertime = "1000";
+ isContainer = "0";
+ internalName = "blendHeightBaseTextEditCtrl";
+ canSave = "1";
+ canSaveDynamicFields = "0";
+ };
+ new GuiSliderCtrl(TerrainMaterialDlgBlendHeightContrastSlider) {
+ range = "0 5";
+ ticks = "0";
+ snap = "0";
+ value = "1";
+ useFillBar = "0";
+ fillBarColor = "255 255 255 255";
+ renderTicks = "1";
+ position = "39 81";
+ extent = "70 14";
+ minExtent = "8 2";
+ horizSizing = "right";
+ vertSizing = "bottom";
+ profile = "ToolsGuiSliderProfile";
+ visible = "1";
+ active = "1";
+ tooltipProfile = "ToolsGuiToolTipProfile";
+ hovertime = "1000";
+ isContainer = "0";
+ internalName = "blendHeightContrastSliderCtrl";
+ canSave = "1";
+ canSaveDynamicFields = "0";
+ };
+ new GuiTextCtrl() {
+ text = "Blend Contrast";
+ maxLength = "1024";
+ margin = "0 0 0 0";
+ padding = "0 0 0 0";
+ anchorTop = "1";
+ anchorBottom = "0";
+ anchorLeft = "1";
+ anchorRight = "0";
+ position = "115 81";
+ extent = "58 15";
+ minExtent = "8 2";
+ horizSizing = "right";
+ vertSizing = "bottom";
+ profile = "ToolsGuiTextProfile";
+ visible = "1";
+ active = "1";
+ tooltipProfile = "ToolsGuiToolTipProfile";
+ hovertime = "1000";
+ isContainer = "1";
+ canSave = "1";
+ canSaveDynamicFields = "0";
+ };
+ new GuiTextEditCtrl(TerrainMaterialDlgBlendHeightContrastTextEdit) {
+ historySize = "0";
+ tabComplete = "0";
+ sinkAllKeyEvents = "0";
+ password = "0";
+ passwordMask = "*";
+ text = "1";
+ maxLength = "1024";
+ margin = "0 0 0 0";
+ padding = "0 0 0 0";
+ anchorTop = "0";
+ anchorBottom = "0";
+ anchorLeft = "0";
+ anchorRight = "0";
+ position = "1 79";
+ extent = "35 18";
+ minExtent = "8 2";
+ horizSizing = "right";
+ vertSizing = "bottom";
+ profile = "ToolsGuiTextEditProfile";
+ visible = "1";
+ active = "1";
+ tooltipProfile = "ToolsGuiToolTipProfile";
+ hovertime = "1000";
+ isContainer = "0";
+ internalName = "blendHeightContrastTextEditCtrl";
+ canSave = "1";
+ canSaveDynamicFields = "0";
+ };
+ };
+ new GuiBitmapCtrl() {
+ bitmapAsset = "ToolsModule:separator_v_image";
+ color = "255 255 255 255";
+ wrap = "0";
+ position = "6 307";
+ extent = "175 2";
+ minExtent = "8 2";
+ horizSizing = "width";
+ vertSizing = "bottom";
+ profile = "ToolsGuiDefaultProfile";
+ visible = "1";
+ active = "1";
+ tooltipProfile = "ToolsGuiToolTipProfile";
+ hovertime = "1000";
+ isContainer = "0";
+ canSave = "1";
+ canSaveDynamicFields = "0";
+ };
+ new GuiContainer(ORMMapContainer) {
+ margin = "0 0 0 0";
+ padding = "0 0 0 0";
+ anchorTop = "1";
+ anchorBottom = "0";
+ anchorLeft = "1";
+ anchorRight = "0";
+ position = "6 314";
+ extent = "185 64";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
@@ -1443,7 +1253,30 @@
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
- internalName = "compositeTexCtrl";
+ internalName = "texORMConfigMap";
+ canSave = "1";
+ canSaveDynamicFields = "0";
+ };
+ new GuiTextCtrl() {
+ text = "ORM Config";
+ maxLength = "1024";
+ margin = "0 0 0 0";
+ padding = "0 0 0 0";
+ anchorTop = "1";
+ anchorBottom = "0";
+ anchorLeft = "1";
+ anchorRight = "0";
+ position = "56 -3";
+ extent = "64 18";
+ minExtent = "8 2";
+ horizSizing = "right";
+ vertSizing = "bottom";
+ profile = "EditorTextProfile";
+ visible = "1";
+ active = "1";
+ tooltipProfile = "ToolsGuiToolTipProfile";
+ hovertime = "1000";
+ isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
@@ -1465,32 +1298,9 @@
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
- command = "TerrainMaterialDlg.changecomposite();";
+ command = "TerrainMaterialDlg.updateTextureMap(\"ORMConfigMap\");";
tooltipProfile = "ToolsGuiDefaultProfile";
- tooltip = "Change the active composite Map for this layer.";
- hovertime = "1000";
- isContainer = "0";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiTextCtrl() {
- text = "Composite";
- maxLength = "1024";
- margin = "0 0 0 0";
- padding = "0 0 0 0";
- anchorTop = "1";
- anchorBottom = "0";
- anchorLeft = "1";
- anchorRight = "0";
- position = "56 -3";
- extent = "61 18";
- minExtent = "8 2";
- horizSizing = "right";
- vertSizing = "bottom";
- profile = "EditorTextProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "ToolsGuiToolTipProfile";
+ tooltip = "Change the active ORM Config Map for this layer.";
hovertime = "1000";
isContainer = "0";
canSave = "1";
@@ -1505,8 +1315,8 @@
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
- position = "56 17";
- extent = "79 17";
+ position = "56 15";
+ extent = "116 17";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
@@ -1516,6 +1326,7 @@
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
+ internalName = "ORMMapAssetId";
canSave = "1";
canSaveDynamicFields = "0";
};
@@ -1524,7 +1335,7 @@
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
- position = "111 0";
+ position = "116 0";
extent = "40 16";
minExtent = "8 2";
horizSizing = "left";
@@ -1532,7 +1343,7 @@
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
- command = "TerrainMaterialDlg.changecomposite();";
+ command = "TerrainMaterialDlg.updateTextureMap(\"OrmConfigMap\");";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
@@ -1549,7 +1360,7 @@
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
- position = "154 0";
+ position = "159 0";
extent = "16 16";
minExtent = "8 2";
horizSizing = "left";
@@ -1557,31 +1368,52 @@
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
- command = "TerrainMaterialDlg-->compositeTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");";
+ command = "TerrainMaterialDlg.clearTextureMap(\"ORMConfigMap\");";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
- new GuiBitmapCtrl() {
- bitmapAsset = "ToolsModule:separator_v_image";
- color = "255 255 255 255";
- wrap = "0";
- position = "4 51";
- extent = "148 2";
+ new GuiCheckBoxCtrl() {
+ text = " Is sRGB";
+ groupNum = "-1";
+ buttonType = "ToggleButton";
+ useMouseEvents = "0";
+ position = "55 32";
+ extent = "119 16";
minExtent = "8 2";
- horizSizing = "width";
+ horizSizing = "right";
vertSizing = "bottom";
- profile = "ToolsGuiDefaultProfile";
+ profile = "ToolsGuiCheckBoxProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
+ internalName = "isSRGB";
canSave = "1";
canSaveDynamicFields = "0";
};
+ new GuiCheckBoxCtrl() {
+ text = " Invert Roughness";
+ groupNum = "-1";
+ buttonType = "ToggleButton";
+ useMouseEvents = "0";
+ position = "55 48";
+ extent = "119 16";
+ minExtent = "8 2";
+ horizSizing = "right";
+ vertSizing = "bottom";
+ profile = "ToolsGuiCheckBoxProfile";
+ visible = "1";
+ active = "1";
+ tooltipProfile = "ToolsGuiToolTipProfile";
+ hovertime = "1000";
+ isContainer = "0";
+ internalName = "invertRoughness";
+ canSave = "1";
+ canSaveDynamicFields = "0";
};
};
new GuiBitmapCtrl() {
@@ -1602,7 +1434,7 @@
canSave = "1";
canSaveDynamicFields = "0";
};
- new GuiContainer() {
+ new GuiContainer(MacroMapContainer) {
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
@@ -1638,7 +1470,7 @@
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
- internalName = "macroTexCtrl";
+ internalName = "texMacroMap";
canSave = "1";
canSaveDynamicFields = "0";
};
@@ -1660,7 +1492,7 @@
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
- command = "TerrainMaterialDlg.changeMacro();";
+ command = "TerrainMaterialDlg.updateTextureMap(\"MacroMap\");";
tooltipProfile = "ToolsGuiDefaultProfile";
tooltip = "Change the active Macro Map for this layer.";
hovertime = "1000";
@@ -1711,6 +1543,7 @@
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
+ internalName = "macroMapAssetId";
canSave = "1";
canSaveDynamicFields = "0";
};
@@ -1727,7 +1560,7 @@
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
- command = "TerrainMaterialDlg.changeMacro();";
+ command = "TerrainMaterialDlg.updateTextureMap(\"MacroMap\");";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
@@ -1752,7 +1585,7 @@
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
- command = "TerrainMaterialDlg-->macroTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");";
+ command = "TerrainMaterialDlg.clearTextureMap(\"MacroMap\");";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
@@ -1788,6 +1621,7 @@
sinkAllKeyEvents = "0";
password = "0";
passwordMask = "*";
+ text = "200";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
@@ -1839,6 +1673,7 @@
sinkAllKeyEvents = "0";
password = "0";
passwordMask = "*";
+ text = "0.7";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
@@ -1890,6 +1725,7 @@
sinkAllKeyEvents = "0";
password = "0";
passwordMask = "*";
+ text = "500";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
@@ -1916,7 +1752,7 @@
};
new GuiControl() {
position = "6 42";
- extent = "189 455";
+ extent = "189 473";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "height";
@@ -1945,7 +1781,7 @@
anchorLeft = "1";
anchorRight = "0";
position = "0 0";
- extent = "189 436";
+ extent = "189 454";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "height";
@@ -1981,7 +1817,7 @@
canRenameObjects = "1";
renameInternal = "0";
position = "1 1";
- extent = "136 798";
+ extent = "136 147";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
@@ -2003,7 +1839,7 @@
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
- position = "202 476";
+ position = "202 494";
extent = "98 22";
minExtent = "8 2";
horizSizing = "left";
@@ -2023,7 +1859,7 @@
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
- position = "307 476";
+ position = "307 494";
extent = "80 22";
minExtent = "8 2";
horizSizing = "left";
@@ -2043,7 +1879,7 @@
color = "255 255 255 255";
wrap = "0";
position = "199 23";
- extent = "190 349";
+ extent = "190 367";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "height";
@@ -2067,7 +1903,7 @@
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
- position = "0 132";
+ position = "0 151";
extent = "190 64";
minExtent = "8 2";
horizSizing = "width";
diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui
index fada5f6f8..8341ebc7f 100644
--- a/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui
+++ b/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui
@@ -299,7 +299,120 @@ function ObjectBuilderGui::gotTerrainAsset(%this, %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)
{
if(%index >= %this.numFields || %this.field[%index, name] $= "")
@@ -564,6 +677,9 @@ function ObjectBuilderGui::process(%this)
case "TypeTerrainAsset":
%this.createTerrainAssetType(%i);
+ case "TypeImageAsset":
+ %this.createImageAssetType(%i);
+
case "TypeMaterialName":
%this.createMaterialNameType(%i);
@@ -636,6 +752,12 @@ function ObjectBuilderGui::onOK(%this)
%this.field[%i, value] = %this.controls[%i]-->MatText.getValue();
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();
}
@@ -736,7 +858,7 @@ function ObjectBuilderGui::buildScatterSky( %this, %dontWarnAboutSun )
// This is a trick... any fields added after process won't show
// up as controls, but will be applied to the created object.
%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( "useNightCubemap", "TypeBool", "Use Night Cubemap", "true" );
@@ -746,7 +868,8 @@ function ObjectBuilderGui::buildCloudLayer(%this)
{
OBObjectName.setValue( "" );
%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();
}
diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/editors/terrainEditor.ed.tscript b/Templates/BaseGame/game/tools/worldEditor/scripts/editors/terrainEditor.ed.tscript
index c0a883fda..c2fd3e766 100644
--- a/Templates/BaseGame/game/tools/worldEditor/scripts/editors/terrainEditor.ed.tscript
+++ b/Templates/BaseGame/game/tools/worldEditor/scripts/editors/terrainEditor.ed.tscript
@@ -61,7 +61,9 @@ function TerrainEditor::setPaintMaterial( %this, %matIndex, %terrainMat )
ETerrainEditor.paintIndex = %matIndex;
ETerrainMaterialSelected.selectedMatIndex = %matIndex;
ETerrainMaterialSelected.selectedMat = %terrainMat;
- ETerrainMaterialSelected.bitmap = %terrainMat.diffuseMap;
+
+ ETerrainMaterialSelected.setBitmap(%terrainMat.getDiffuseMap());
+
ETerrainMaterialSelectedEdit.Visible = isObject(%terrainMat);
TerrainTextureText.text = %terrainMat.getInternalName();
ProceduralTerrainPainterDescription.text = "Generate "@ %terrainMat.getInternalName() @" layer";
@@ -139,7 +141,7 @@ function EPainter::updateLayers( %this, %matIndex )
};
%ctrl.setText( %matInternalName );
- %ctrl.setBitmap( %mat.diffuseMap );
+ %ctrl.setBitmap( %mat.getDiffuseMap() );
%tooltip = %matInternalName;
if(%i < 9)
diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/interfaces/terrainMaterialDlg.ed.tscript b/Templates/BaseGame/game/tools/worldEditor/scripts/interfaces/terrainMaterialDlg.ed.tscript
index e817f61bf..9ed28d51a 100644
--- a/Templates/BaseGame/game/tools/worldEditor/scripts/interfaces/terrainMaterialDlg.ed.tscript
+++ b/Templates/BaseGame/game/tools/worldEditor/scripts/interfaces/terrainMaterialDlg.ed.tscript
@@ -20,6 +20,7 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
+$TerrainMaterialEditor::emptyMaterialImage = "ToolsModule:unknownImage_image";
//-----------------------------------------------------------------------------
@@ -34,6 +35,7 @@ function TerrainMaterialDlg::show( %this, %matIndex, %terrMat, %onApplyCallback
%item = %matLibTree.findItemByObjectId( %terrMat );
if ( %item != -1 )
{
+ %matLibTree.selectItem( %item, false );
%matLibTree.selectItem( %item );
%matLibTree.scrollVisible( %item );
}
@@ -164,11 +166,26 @@ function TerrainMaterialDlg::dialogApply( %this )
Canvas.popDialog( TerrainMaterialDlg );
call( %this.onApplyCallback, %this.activeMat, %this.matIndex );
+
+ TerrainMaterialDlg.matDirty = false;
}
//-----------------------------------------------------------------------------
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.
@@ -213,118 +230,67 @@ function TerrainMaterialDlg::setMaterialName( %this, %newName )
{
%mat.setInternalName( %newName );
%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 $= "" )
+ %targetMap.setBitmap($TerrainMaterialEditor::emptyMaterialImage);
+ %targetMap.asset = "";
+
+ TerrainMaterialDlg.matDirty = true;
+
+ 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::changeDetail( %this )
+function TerrainMaterialDlg::updateTextureMap(%this, %mapName)
{
- %ctrl = %this-->detailTexCtrl;
- %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::changeMacro( %this )
+function TerrainMaterialDlg::changeTerrainMatMapAsset(%this)
{
- %ctrl = %this-->macroTexCtrl;
- %file = %ctrl.bitmap;
- if( getSubStr( %file, 0 , 6 ) $= "tools/" )
- %file = "";
+ %targetMapName = "tex" @ %this.updateTargetMap;
+ %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 );
-}
-
-
-//-----------------------------------------------------------------------------
-
-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
- %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;
%count = %parent.getCount();
for ( %i = 0; %i < %count; %i++ )
+ {
+ %ctrl = %parent.getObject( %i );
+ %ctrlnm = %ctrl.getName();
+ %ictrlnm = %ctrl.getInternalName();
%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 )
{
+ 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 );
}
+}
//-----------------------------------------------------------------------------
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 ) )
{
%this.activeMat = %mat;
+ %this.matDirty = false;
%this-->matNameCtrl.setText( %mat.internalName );
- if (%mat.diffuseMap $= ""){
- %this-->baseTexCtrl.setBitmap( "tools/materialEditor/gui/unknownImage" );
- }else{
+
+ //
+ %imgPath = %mat.getDiffuseMap();
%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 );
+ 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" );
}
- if (%mat.normalMap $= ""){
- %this-->normTexCtrl.setBitmap( "tools/materialEditor/gui/unknownImage" );
- }else{
- %this-->normTexCtrl.setBitmap( %mat.normalMap );
- }
+
%this-->detSizeCtrl.setText( %mat.detailSize );
%this-->baseSizeCtrl.setText( %mat.diffuseSize );
%this-->detStrengthCtrl.setText( %mat.detailStrength );
@@ -481,31 +546,31 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat )
%newName = %this-->matNameCtrl.getText();
- if (%this-->baseTexCtrl.bitmap $= "tools/materialEditor/gui/unknownImage"){
+ //---
+ %newDiffuse = %this-->texBaseMap.getBitmap();
+ if(%newDiffuse $= $TerrainMaterialEditor::emptyMaterialImage)
%newDiffuse = "";
- }else{
- %newDiffuse = %this-->baseTexCtrl.bitmap;
- }
- if (%this-->normTexCtrl.bitmap $= "tools/materialEditor/gui/unknownImage"){
+
+ //---
+ %newNormal = %this-->texNormalMap.getBitmap();
+ if(%newNormal $= $TerrainMaterialEditor::emptyMaterialImage)
%newNormal = "";
- }else{
- %newNormal = %this-->normTexCtrl.bitmap;
- }
- if (%this-->ormConfigTexCtrl.bitmap $= "tools/materialEditor/gui/unknownImage"){
+
+ //---
+ %newormConfig = %this-->texORMConfigMap.getBitmap();
+ if(%newormConfig $= $TerrainMaterialEditor::emptyMaterialImage)
%newormConfig = "";
- }else{
- %newormConfig = %this-->ormConfigTexCtrl.bitmap;
- }
- if (%this-->detailTexCtrl.bitmap $= "tools/materialEditor/gui/unknownImage"){
+
+ //---
+ %newDetail = %this-->texDetailMap.getBitmap();
+ if(%newDetail $= $TerrainMaterialEditor::emptyMaterialImage)
%newDetail = "";
- }else{
- %newDetail = %this-->detailTexCtrl.bitmap;
- }
- if (%this-->macroTexCtrl.bitmap $= "tools/materialEditor/gui/unknownImage"){
+
+ //---
+ %newMacro = %this-->texMacroMap.getBitmap();
+ if(%newMacro $= $TerrainMaterialEditor::emptyMaterialImage)
%newMacro = "";
- }else{
- %newMacro = %this-->macroTexCtrl.bitmap;
- }
+
%detailSize = %this-->detSizeCtrl.getText();
%diffuseSize = %this-->baseSizeCtrl.getText();
%detailStrength = %this-->detStrengthCtrl.getText();
@@ -526,11 +591,11 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat )
// return.
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.diffuseSize == %diffuseSize &&
%mat.detailStrength == %detailStrength &&
@@ -564,12 +629,12 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat )
%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.diffuseSize = %diffuseSize;
%mat.detailStrength = %detailStrength;
@@ -619,11 +684,11 @@ function TerrainMaterialDlg::snapshotMaterials( %this )
parentGroup = %group;
material = %mat;
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;
diffuseSize = %mat.diffuseSize;
detailStrength = %mat.detailStrength;
@@ -638,6 +703,7 @@ function TerrainMaterialDlg::snapshotMaterials( %this )
isSRGB = %mat.isSRGB;
invertRoughness = %mat.invertRoughness;
};
+
}
}
@@ -658,11 +724,11 @@ function TerrainMaterialDlg::restoreMaterials( %this )
%mat = %obj.material;
%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.diffuseSize = %obj.diffuseSize;
%mat.detailStrength = %obj.detailStrength;
@@ -717,6 +783,7 @@ function TerrainMaterialDlgBlendHeightBaseSlider::onMouseDragged(%this)
%value = mFloor(%this.value * 1000)/1000;
TerrainMaterialDlgBlendHeightBaseTextEdit.setText(%value);
TerrainMaterialDlg.activeMat.blendHeightBase = %this.value;
+ TerrainMaterialDlg.matDirty = true;
}
@@ -724,6 +791,7 @@ function TerrainMaterialDlgBlendHeightBaseTextEdit::onValidate(%this)
{
TerrainMaterialDlgBlendHeightBaseSlider.setValue(%this.getText());
TerrainMaterialDlg.activeMat.blendHeightBase = %this.getText();
+ TerrainMaterialDlg.matDirty = true;
}
function TerrainMaterialDlgBlendHeightContrastSlider::onMouseDragged(%this)
@@ -731,6 +799,7 @@ function TerrainMaterialDlgBlendHeightContrastSlider::onMouseDragged(%this)
%value = mFloor(%this.value * 1000)/1000;
TerrainMaterialDlgBlendHeightContrastTextEdit.setText(%value);
TerrainMaterialDlg.activeMat.blendHeightContrast = %this.value;
+ TerrainMaterialDlg.matDirty = true;
}
@@ -738,4 +807,5 @@ function TerrainMaterialDlgBlendHeightContrastTextEdit::onValidate(%this)
{
TerrainMaterialDlgBlendHeightContrastSlider.setValue(%this.getText());
TerrainMaterialDlg.activeMat.blendHeightContrast = %this.getText();
+ TerrainMaterialDlg.matDirty = true;
}