diff --git a/Engine/source/T3D/assets/CubemapAsset.cpp b/Engine/source/T3D/assets/CubemapAsset.cpp
index 7929eddad..32d5dce3a 100644
--- a/Engine/source/T3D/assets/CubemapAsset.cpp
+++ b/Engine/source/T3D/assets/CubemapAsset.cpp
@@ -200,10 +200,10 @@ GuiControl* GuiInspectorTypeCubemapAssetPtr::constructEditControl()
// Change filespec
char szBuffer[512];
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"CubemapAsset\", \"AssetBrowser.changeAsset\", %d, %s);",
- mInspector->getComponentGroupTargetId(), mCaption);
+ mInspector->getInspectObject(), mCaption);
mBrowseButton->setField("Command", szBuffer);
- setDataField(StringTable->insert("ComponentOwner"), NULL, String::ToString(mInspector->getComponentGroupTargetId()).c_str());
+ setDataField(StringTable->insert("object"), NULL, String::ToString(mInspector->getInspectObject()).c_str());
// Create "Open in ShapeEditor" button
mShapeEdButton = new GuiBitmapButtonCtrl();
diff --git a/Engine/source/T3D/assets/ShapeAsset.cpp b/Engine/source/T3D/assets/ShapeAsset.cpp
index 1262b13ee..ceea28bfc 100644
--- a/Engine/source/T3D/assets/ShapeAsset.cpp
+++ b/Engine/source/T3D/assets/ShapeAsset.cpp
@@ -367,10 +367,12 @@ GuiControl* GuiInspectorTypeShapeAssetPtr::constructEditControl()
// Change filespec
char szBuffer[512];
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ShapeAsset\", \"AssetBrowser.changeAsset\", %d, %s);",
- mInspector->getComponentGroupTargetId(), mCaption);
+ mInspector->getInspectObject()->getIdString(), mCaption);
mBrowseButton->setField("Command", szBuffer);
- setDataField(StringTable->insert("ComponentOwner"), NULL, String::ToString(mInspector->getComponentGroupTargetId()).c_str());
+ const char* id = mInspector->getInspectObject()->getIdString();
+
+ setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());
// Create "Open in ShapeEditor" button
mShapeEdButton = new GuiBitmapButtonCtrl();
diff --git a/Engine/source/gui/editor/popupMenu.cpp b/Engine/source/gui/editor/popupMenu.cpp
index 4d3a2002b..1c1f44ae4 100644
--- a/Engine/source/gui/editor/popupMenu.cpp
+++ b/Engine/source/gui/editor/popupMenu.cpp
@@ -60,6 +60,8 @@ PopupMenu::PopupMenu()
mTextList = nullptr;
mIsSubmenu = false;
+
+ mRadioSelection = true;
}
PopupMenu::~PopupMenu()
@@ -83,6 +85,7 @@ void PopupMenu::initPersistFields()
Parent::initPersistFields();
addField("barTitle", TypeCaseString, Offset(mBarTitle, PopupMenu), "");
+ addField("radioSelection", TypeBool, Offset(mRadioSelection, PopupMenu), "");
}
//-----------------------------------------------------------------------------
@@ -225,7 +228,7 @@ void PopupMenu::checkItem(S32 pos, bool checked)
if (mMenuItems.empty() || mMenuItems.size() < pos || pos < 0)
return;
- if (checked && mMenuItems[pos].mCheckGroup != -1)
+ if (checked && mMenuItems[pos].mCheckGroup != -1 && mRadioSelection)
{
// first, uncheck everything in the group:
for (U32 i = 0; i < mMenuItems.size(); i++)
diff --git a/Engine/source/gui/editor/popupMenu.h b/Engine/source/gui/editor/popupMenu.h
index b473bf818..4750f44d2 100644
--- a/Engine/source/gui/editor/popupMenu.h
+++ b/Engine/source/gui/editor/popupMenu.h
@@ -83,6 +83,9 @@ protected:
bool mIsSubmenu;
+ bool mRadioSelection; ///If true, we treat all the items in the same check group as a radio item, so we uncheck everything else in the group if an item is checked
+ ///If false, then we don't clear other selections
+
//This is the gui control that renders our popup
GuiPopupMenuTextListCtrl *mTextList;
diff --git a/Engine/source/gui/worldEditor/gizmo.cpp b/Engine/source/gui/worldEditor/gizmo.cpp
index a74202f81..4b0ac19ab 100644
--- a/Engine/source/gui/worldEditor/gizmo.cpp
+++ b/Engine/source/gui/worldEditor/gizmo.cpp
@@ -188,6 +188,7 @@ GizmoProfile::GizmoProfile()
rotationSnap = 15.0f;
allowSnapScale = true;
scaleSnap = 0.1f;
+ forceSnapRotations = false;
rotateScalar = 0.8f;
scaleScalar = 0.8f;
@@ -246,6 +247,7 @@ void GizmoProfile::initPersistFields()
addField( "rotationSnap", TypeF32, Offset(rotationSnap, GizmoProfile) );
addField( "allowSnapScale", TypeBool, Offset(allowSnapScale, GizmoProfile) );
addField( "scaleSnap", TypeF32, Offset(scaleSnap, GizmoProfile) );
+ addField( "forceSnapRotations", TypeBool, Offset(forceSnapRotations, GizmoProfile));
addField( "renderWhenUsed", TypeBool, Offset(renderWhenUsed, GizmoProfile) );
addField( "renderInfoText", TypeBool, Offset(renderInfoText, GizmoProfile) );
addField( "renderPlane", TypeBool, Offset(renderPlane, GizmoProfile) );
@@ -1083,7 +1085,7 @@ void Gizmo::on3DMouseDragged( const Gui3DMouseEvent & event )
angle *= 0.02f; // scale down to not require rotate scalar to be microscopic
//
- if( mProfile->allowSnapRotations && event.modifier & SI_SHIFT )
+ if((mProfile->forceSnapRotations && event.modifier | SI_SHIFT) || (mProfile->allowSnapRotations && event.modifier & SI_SHIFT ))
angle = mDegToRad( _snapFloat( mRadToDeg( angle ), mProfile->rotationSnap ) );
mDeltaAngle = angle - mLastAngle;
diff --git a/Engine/source/gui/worldEditor/gizmo.h b/Engine/source/gui/worldEditor/gizmo.h
index d33a9957a..a9baf1aa1 100644
--- a/Engine/source/gui/worldEditor/gizmo.h
+++ b/Engine/source/gui/worldEditor/gizmo.h
@@ -108,6 +108,7 @@ public:
bool allowSnapScale;
F32 rotationSnap;
bool allowSnapRotations;
+ bool forceSnapRotations;
bool renderWhenUsed;
bool renderInfoText;
@@ -415,4 +416,4 @@ protected:
static F32 smProjectDistance;
};
-#endif // _GIZMO_H_
\ No newline at end of file
+#endif // _GIZMO_H_
diff --git a/Engine/source/ts/tsShapeConstruct.cpp b/Engine/source/ts/tsShapeConstruct.cpp
index ca40b142d..03a2d3757 100644
--- a/Engine/source/ts/tsShapeConstruct.cpp
+++ b/Engine/source/ts/tsShapeConstruct.cpp
@@ -402,6 +402,12 @@ bool TSShapeConstructor::onAdd()
if ( !Parent::onAdd() )
return false;
+ static const U32 bufSize = 512;
+ char* buf = Con::getReturnBuffer(bufSize);
+ Platform::makeFullPathName(mShapePath, buf, bufSize, NULL);
+
+ mShapePath = buf;
+
// Prevent multiple objects pointing at the same shape file
TSShapeConstructor* tss = findShapeConstructor( mShapePath );
if ( tss )
diff --git a/Templates/BaseGame/game/tools/assetBrowser/art/folderIcon.png b/Templates/BaseGame/game/tools/assetBrowser/art/folderIcon.png
new file mode 100644
index 000000000..b2c0a251d
Binary files /dev/null and b/Templates/BaseGame/game/tools/assetBrowser/art/folderIcon.png differ
diff --git a/Templates/BaseGame/game/tools/assetBrowser/assetImportConfigs.xml b/Templates/BaseGame/game/tools/assetBrowser/assetImportConfigs.xml
index 889e72ce0..039a6674a 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/assetImportConfigs.xml
+++ b/Templates/BaseGame/game/tools/assetBrowser/assetImportConfigs.xml
@@ -1,60 +1,64 @@
-
- 1
- _ROUGH,_ROUGHNESS
- _AO,_AMBIENT,_AMBIENTOCCLUSION
- 0
- 1.0
- 1
- 1
- _NORMAL,_NORM
- Bilinear
- _ALBEDO,_DIFFUSE,_ALB,_DIF,_COLOR,_COL,_baseColor,_a,
- _METAL,_MET,_METALNESS,_METALLIC
- _SMOOTH,_SMOOTHNESS
- _COMP,_COMPOSITE
- N/A
- 1
-
+ 0
Z_AXIS
- 0
TrailingNumber
+ 0.01
0
+ 0
+ 0
+ 1
+ 1
0
- 0
- 1
0
-
-
- AutoPrune
+ 0
- CollisionMesh
Col
- CollisionMesh
+ CollisionMesh
1
LOS
+ CollisionMesh
1
+
+ _AO,_AMBIENT,_AMBIENTOCCLUSION
+ _ROUGH,_ROUGHNESS
+ 1
+ _COMP,_COMPOSITE
+ _SMOOTH,_SMOOTHNESS
+ 1
+ _ALBEDO,_DIFFUSE,_ALB,_DIF,_COLOR,_COL,_baseColor,_a,
+ 0
+ 1
+ N/A
+ 1
+ _NORMAL,_NORM
+ 1.0
+ _METAL,_MET,_METALNESS,_METALLIC
+ Bilinear
+
ColorEffect*,
- 1
+ 1
1
1
- 1
- 1
-
-
- 1.0
- 0
- 1.0
+ 0
+ 1
1
1
+
+ 1.0
+ 0
+ 1.0
+
+
+ AutoPrune
+
diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/assetPreviewButtonsTemplate.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/assetPreviewButtonsTemplate.gui
new file mode 100644
index 000000000..1030d0940
--- /dev/null
+++ b/Templates/BaseGame/game/tools/assetBrowser/guis/assetPreviewButtonsTemplate.gui
@@ -0,0 +1,272 @@
+//--- 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 );";
+ altCommand = "AssetBrowser.editAsset( 20540 );";
+ 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 );";
+ altCommand = "20550.materialDefinitionName.reload(); $Tools::materialEditorList = \"\";EWorldEditor.clearSelection();MaterialEditorGui.currentObject = 0;MaterialEditorGui.currentMode = \"asset\";MaterialEditorGui.currentMaterial = 20550.materialDefinitionName;MaterialEditorGui.setActiveMaterial( 20550.materialDefinitionName );EditorGui.setEditor(MaterialEditorPlugin); AssetBrowser.hideDialog();";
+ 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/main.cs b/Templates/BaseGame/game/tools/assetBrowser/main.cs
index 03e61a316..abc61f2e3 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/main.cs
+++ b/Templates/BaseGame/game/tools/assetBrowser/main.cs
@@ -37,23 +37,24 @@ function initializeAssetBrowser()
{
new ArrayObject(AssetFilterTypeList);
+ AssetFilterTypeList.add("All");
AssetFilterTypeList.add("Component");
AssetFilterTypeList.add("Cpp");
AssetFilterTypeList.add("Cubemap");
- AssetFilterTypeList.add("GameObjects");
- AssetFilterTypeList.add("GUIs");
- AssetFilterTypeList.add("Images");
- AssetFilterTypeList.add("Levels");
- AssetFilterTypeList.add("Materials");
- AssetFilterTypeList.add("Particles");
- AssetFilterTypeList.add("PostFXs");
- AssetFilterTypeList.add("Scripts");
- AssetFilterTypeList.add("Shapes");
- AssetFilterTypeList.add("ShapeAnimations");
- AssetFilterTypeList.add("Sounds");
- AssetFilterTypeList.add("StateMachines");
+ AssetFilterTypeList.add("GameObject");
+ AssetFilterTypeList.add("GUI");
+ AssetFilterTypeList.add("Image");
+ AssetFilterTypeList.add("Level");
+ AssetFilterTypeList.add("Material");
+ AssetFilterTypeList.add("Particle");
+ AssetFilterTypeList.add("PostFX");
+ AssetFilterTypeList.add("Script");
+ AssetFilterTypeList.add("Shape");
+ AssetFilterTypeList.add("ShapeAnimation");
+ AssetFilterTypeList.add("Sound");
+ AssetFilterTypeList.add("StateMachine");
AssetFilterTypeList.add("Terrain");
- AssetFilterTypeList.add("TerrainMaterials");
+ AssetFilterTypeList.add("TerrainMaterial");
}
exec("./guis/assetBrowser.gui");
@@ -66,6 +67,7 @@ function initializeAssetBrowser()
exec("./guis/selectModule.gui");
exec("./guis/editModule.gui");
exec("./guis/importTemplateModules.gui");
+ exec("./guis/assetPreviewButtonsTemplate.gui");
exec("./scripts/assetBrowser.cs");
exec("./scripts/popupMenus.cs");
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs
index aa95fa029..c890a6ce7 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs
@@ -172,10 +172,55 @@ function AssetBrowser::viewTagsFilter(%this)
AssetBrowser.loadFilters();
}
-function AssetBrowser::toggleAssetTypeFilter(%assetTypeIdx)
+function AssetBrowser::toggleAssetTypeFilter(%this, %assetTypeIdx)
{
%isChecked = AssetTypeListPopup.isItemChecked(%assetTypeIdx);
- AssetTypeListPopup.checkItem(%assetTypeIdx, !%isChecked);
+
+ //Clear existing filters
+ if(%assetTypeIdx == 0)
+ {
+ for(%i=0; %i < AssetFilterTypeList.Count() + 1; %i++)
+ {
+ AssetTypeListPopup.checkItem(%i, false);
+ }
+
+ AssetTypeListPopup.checkItem(0, true);
+ }
+ else
+ {
+ if(%isChecked)
+ {
+ %anyOtherFilters = false;
+ for(%i=1; %i < AssetFilterTypeList.Count() + 1; %i++)
+ {
+ if(%assetTypeIdx == %i)
+ continue;
+
+ if(AssetTypeListPopup.isItemChecked(%i))
+ {
+ %anyOtherFilters = true;
+ break;
+ }
+ }
+ }
+
+ if(%isChecked && !%anyOtherFilters)
+ {
+ for(%i=0; %i < AssetFilterTypeList.Count() + 1; %i++)
+ {
+ AssetTypeListPopup.checkItem(%i, false);
+ }
+
+ AssetTypeListPopup.checkItem(0, true);
+ }
+ else
+ {
+ AssetTypeListPopup.checkItem(0, false);
+ AssetTypeListPopup.checkItem(%assetTypeIdx, !%isChecked);
+ }
+ }
+
+ %this.rebuildAssetArray();
}
function AssetBrowser::selectAsset( %this, %asset )
@@ -219,6 +264,13 @@ function AssetBrowser::showDialog( %this, %AssetTypeFilter, %selectCallback, %ta
AssetBrowserWindow.setVisible(1);
AssetBrowserWindow.selectWindow();
+ //If we're special-case filtering(like for selecting a given type), then ignore our normal
+ //visibility filter
+ if(%AssetTypeFilter !$= "")
+ {
+ AssetBrowser.toggleAssetTypeFilter(0);
+ }
+
if(%selectCallback $= "")
{
//we're not in selection mode, so just hide the select button
@@ -268,6 +320,7 @@ function AssetBrowser::buildPreviewArray( %this, %asset, %moduleName )
%fullPath = strreplace(%fullPath, "/", "_");
if(isObject(%fullPath))
+
%assetDesc = %fullPath;
else
%assetDesc = new ScriptObject(%fullPath);
@@ -280,194 +333,65 @@ function AssetBrowser::buildPreviewArray( %this, %asset, %moduleName )
%assetName = %asset;
%assetType = "Folder";
}
-
- // it may seem goofy why the checkbox can't be instanciated inside the container
- // reason being its because we need to store the checkbox ctrl in order to make changes
- // on it later in the function.
-
-
+
%previewSize = %this.previewSize SPC %this.previewSize;
%previewBounds = 20;
- %container = new GuiControl(){
- profile = "ToolsGuiDefaultProfile";
- Position = "0 0";
- Extent = %previewSize.x + %previewBounds SPC %previewSize.y + %previewBounds + 24;
- HorizSizing = "right";
- VertSizing = "bottom";
- isContainer = "1";
- assetName = %assetName;
- moduleName = %moduleName;
- assetType = %assetType;
- };
-
%tooltip = %assetName;
%doubleClickCommand = "AssetBrowser.editAsset( "@%assetDesc@" );";
if(%assetType $= "ShapeAsset")
{
- %this.previewData.assetName = %assetDesc.assetName;
- %this.previewData.assetPath = %assetDesc.scriptFile;
- %this.previewData.doubleClickCommand = %doubleClickCommand;
-
- %this.previewData.previewImage = "tools/assetBrowser/art/componentIcon";
-
- %this.previewData.assetFriendlyName = %assetDesc.friendlyName;
- %this.previewData.assetDesc = %assetDesc.description;
- %this.previewData.tooltip = %assetDesc.friendlyName @ "\n" @ %assetDesc;
-
- %previewButton = new GuiObjectView()
- {
- className = "AssetPreviewControl";
- internalName = %matName;
- HorizSizing = "right";
- VertSizing = "bottom";
- Profile = "ToolsGuiDefaultProfile";
- position = "7 4";
- extent = %previewSize;
- MinExtent = "8 8";
- canSave = "1";
- Visible = "1";
- tooltipprofile = "ToolsGuiToolTipProfile";
- hovertime = "1000";
- Margin = "0 0 0 0";
- Padding = "0 0 0 0";
- AnchorTop = "1";
- AnchorBottom = "0";
- AnchorLeft = "1";
- AnchorRight = "0";
- renderMissionArea = "0";
- GizmoProfile = "GlobalGizmoProfile";
- cameraZRot = "0";
- forceFOV = "0";
- gridColor = "0 0 0 0";
- renderNodes = "0";
- renderObjBox = "0";
- renderMounts = "0";
- renderColMeshes = "0";
- selectedNode = "-1";
- sunDiffuse = "255 255 255 255";
- sunAmbient = "180 180 180 255";
- timeScale = "1.0";
- fixedDetail = "0";
- orbitNode = "0";
-
- new GuiBitmapButtonCtrl()
- {
- HorizSizing = "right";
- VertSizing = "bottom";
- profile = "ToolsGuiButtonProfile";
- position = "0 0";
- extent = %previewSize;
- Variable = "";
- buttonType = "ToggleButton";
- bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
- groupNum = "0";
- text = "";
- };
- };
-
- %assetQuery = new AssetQuery();
- %numAssetsFound = AssetDatabase.findAllAssets(%assetQuery);
-
- for( %i=0; %i < %numAssetsFound; %i++)
- {
- %assetId = %assetQuery.getAsset(%i);
- %name = AssetDatabase.getAssetName(%assetId);
-
- if(%name $= %assetName)
- {
- %asset = AssetDatabase.acquireAsset(%assetId);
-
- %previewButton.setModel(%asset.fileName);
- //%previewButton.refreshShape();
- //%previewButton.currentDL = 0;
- //%previewButton.fitToShape();
-
- break;
- }
- }
+ %previewButton = AssetPreviewButtonsTemplate-->ShapeAssetPreviewButton.deepClone();
}
else
{
- //Build out the preview
- %buildCommand = %this @ ".build" @ %assetType @ "Preview(" @ %assetDesc @ "," @ %this.previewData @ ");";
- eval(%buildCommand);
-
- //debug dump
- %tooltip = %this.previewData.tooltip;
- %assetName = %this.previewData.assetName;
- %previewImage = %this.previewData.previewImage;
- %doubleClickCommand = %this.previewData.doubleClickCommand;
-
- %previewButton = new GuiBitmapButtonCtrl()
- {
- className = "AssetPreviewControl";
- internalName = %this.previewData.assetName;
- HorizSizing = "right";
- VertSizing = "bottom";
- profile = "ToolsGuiButtonProfile";
- position = "10 4";
- extent = %previewSize;
- buttonType = "PushButton";
- bitmap = %this.previewData.previewImage;
- Command = "";
- text = "";
- useStates = false;
-
- new GuiBitmapButtonCtrl()
- {
- HorizSizing = "right";
- VertSizing = "bottom";
- profile = "ToolsGuiButtonProfile";
- position = "0 0";
- extent = %previewSize;
- Variable = "";
- buttonType = "toggleButton";
- bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
- groupNum = "0";
- text = "";
- };
- };
+ %previewButton = AssetPreviewButtonsTemplate-->GeneralAssetPreviewButton.deepClone();
}
- %previewBorder = new GuiButtonCtrl(){
- class = "AssetPreviewButton";
- internalName = %this.previewData.assetName@"Border";
- HorizSizing = "right";
- VertSizing = "bottom";
- profile = "ToolsGuiThumbHighlightButtonProfile";
- position = "0 0";
- extent = %previewSize.x + %previewBounds SPC %previewSize.y + 24;
- Variable = "";
- buttonType = "radioButton";
- tooltip = %this.previewData.tooltip;
- Command = "AssetBrowser.updateSelection( $ThisControl.getParent().assetName, $ThisControl.getParent().moduleName );";
- altCommand = %this.previewData.doubleClickCommand;
- groupNum = "0";
- useMouseEvents = true;
- text = "";
- icon = %this.previewData.previewImage;
- };
+ %previewButton.extent = %previewSize.x + %previewBounds SPC %previewSize.y + %previewBounds + 24;
+ %previewButton.assetName = %assetName;
+ %previewButton.moduleName = %moduleName;
+ %previewButton.assetType = %assetType;
- %previewNameCtrl = new GuiTextEditCtrl(){
- position = 0 SPC %previewSize.y + %previewBounds - 16;
- profile = ToolsGuiTextEditCenterProfile;
- extent = %previewSize.x + %previewBounds SPC 16;
- text = %this.previewData.assetName;
- originalAssetName = %this.previewData.assetName; //special internal field used in renaming assets
- internalName = "AssetNameLabel";
- class = "AssetNameField";
- active = false;
- };
+ //Build out the preview
+ %buildCommand = %this @ ".build" @ %assetType @ "Preview(" @ %assetDesc @ "," @ %this.previewData @ ");";
+ eval(%buildCommand);
- %container.add(%previewButton);
- %container.add(%previewBorder);
- %container.add(%previewNameCtrl);
+ //debug dump
+ %tooltip = %this.previewData.tooltip;
+ %assetName = %this.previewData.assetName;
+ %previewImage = %this.previewData.previewImage;
+ %doubleClickCommand = %this.previewData.doubleClickCommand;
+ if(%assetType $= "ShapeAsset")
+ {
+ %previewButton-->shapeAssetView.setModel(%previewImage);
+ %previewButton-->shapeAssetView.extent = %previewSize;
+ }
+ else
+ {
+ %previewButton-->assetPreviewImage.bitmap = %this.previewData.previewImage;
+ %previewButton-->assetPreviewImage.extent = %previewSize;
+ }
+
+ %previewButton-->AssetPreviewBorderButton.extent = %previewSize;
+
+ //%previewButton-->AssetPreviewButton.internalName = %this.previewData.assetName@"Border";
+ %previewButton-->AssetPreviewButton.extent = %previewSize.x + %previewBounds SPC %previewSize.y + 24;
+ %previewButton-->AssetPreviewButton.tooltip = %this.previewData.tooltip;
+ %previewButton-->AssetPreviewButton.Command = "AssetBrowser.updateSelection( $ThisControl.getParent().assetName, $ThisControl.getParent().moduleName );";
+ %previewButton-->AssetPreviewButton.altCommand = %this.previewData.doubleClickCommand;
+ //%previewButton-->AssetPreviewButton.icon = %this.previewData.previewImage;
+
+ %previewButton-->AssetNameLabel.position = 0 SPC %previewSize.y + %previewBounds - 16;
+ %previewButton-->AssetNameLabel.extent = %previewSize.x + %previewBounds SPC 16;
+ %previewButton-->AssetNameLabel.text = %this.previewData.assetName;
+ %previewButton-->AssetNameLabel.originalAssetName = %this.previewData.assetName;
+
// add to the gui control array
- AssetBrowser-->assetList.add(%container);
+ AssetBrowser-->assetList.add(%previewButton);
// add to the array object for reference later
AssetPreviewArray.add( %previewButton, %this.previewData.previewImage );
@@ -502,7 +426,7 @@ function AssetBrowser::loadFolders(%this, %path, %parentId)
%folderName = getToken(%childPath, "/", %f);
//we don't need to display the shadercache folder
- if(%parentId == 1 && %folderName $= "shaderCache")
+ if(%parentId == 1 && (%folderName $= "shaderCache" || %folderName $= "cache"))
continue;
%iconIdx = 1;
@@ -1171,12 +1095,12 @@ function AssetBrowser::setPreviewSize(%this, %size)
else if(%size $= "Large")
{
%this.previewSize = 160;
- AssetPreviewSizePopup.checkItem(2, false);
+ AssetPreviewSizePopup.checkItem(2, true);
}
EditorSettings.setValue("Assets/Browser/previewTileSize", %size);
- %this.refreshPreviews();
+ %this.rebuildAssetArray();
}
function AssetBrowser::refreshPreviews(%this)
@@ -1193,12 +1117,17 @@ function AssetBrowserFilterTree::onSelect(%this, %itemId)
//Make sure we have an actual module selected!
%parentId = %this.getParentItem(%itemId);
+ %name = %this.getItemText(%itemId);
+
%breadcrumbPath = %this.getItemValue(%itemId);
if(%breadcrumbPath !$= "")
%breadcrumbPath = %breadcrumbPath @ "/" @ %this.getItemText(%itemId);
else
%breadcrumbPath = %this.getItemText(%itemId);
+ if(%breadcrumbPath $= "")
+ %breadcrumbPath = AssetBrowser.currentAddress;
+
AssetBrowser.navigateTo(%breadcrumbPath);
}
@@ -1215,6 +1144,8 @@ function AssetBrowser::rebuildAssetArray(%this)
//First, Query for our assets
%assetQuery = new AssetQuery();
%numAssetsFound = AssetDatabase.findAllAssets(%assetQuery);
+
+ %finalAssetCount = 0;
//now, we'll iterate through, and find the assets that are in this module, and this category
for( %i=0; %i < %numAssetsFound; %i++)
@@ -1240,8 +1171,46 @@ function AssetBrowser::rebuildAssetArray(%this)
%assetType = AssetDatabase.getAssetType(%assetId);
}
- if(AssetBrowser.assetTypeFilter !$= "" && AssetBrowser.assetTypeFilter !$= %assetType)
- continue;
+ %validType = false;
+
+ if(AssetBrowser.assetTypeFilter $= "")
+ {
+ if(AssetTypeListPopup.isItemChecked(0))
+ {
+ %validType = true;
+ }
+ else
+ {
+ for(%f=1; %f < AssetFilterTypeList.Count(); %f++)
+ {
+ %isChecked = AssetTypeListPopup.isItemChecked(%f+1);
+
+ if(%isChecked)
+ {
+ %filterTypeName = AssetFilterTypeList.getKey(%f);
+
+ if(%activeTypeFilterList $= "")
+ %activeTypeFilterList = %filterTypeName;
+ else
+ %activeTypeFilterList = %activeTypeFilterList @ ", " @ %filterTypeName;
+
+ if(%filterTypeName @ "Asset" $= %assetType)
+ {
+ %validType = true;
+ break;
+ }
+ }
+ }
+ }
+
+ if(!%validType)
+ continue;
+ }
+ else
+ {
+ if(%assetType !$= AssetBrowser.assetTypeFilter)
+ continue;
+ }
/*if(%this.getItemText(%itemId) $= %assetType || (%assetType $= "" && %this.getItemText(%itemId) $= "Misc")
|| %moduleItemId == 1)
@@ -1253,12 +1222,20 @@ function AssetBrowser::rebuildAssetArray(%this)
if(%searchText !$= "Search Assets...")
{
if(strstr(strlwr(%assetName), strlwr(%searchText)) != -1)
+ {
%assetArray.add( %moduleName, %assetId);
+
+ if(%assetType !$= "Folder")
+ %finalAssetCount++;
+ }
}
else
{
//got it.
%assetArray.add( %moduleName, %assetId );
+
+ if(%assetType !$= "Folder")
+ %finalAssetCount++;
}
//}
}
@@ -1292,7 +1269,39 @@ function AssetBrowser::rebuildAssetArray(%this)
for(%i=0; %i < %assetArray.count(); %i++)
AssetBrowser.buildPreviewArray( %assetArray.getValue(%i), %assetArray.getKey(%i) );
- AssetBrowser_FooterText.text = %assetArray.count() @ " Assets";
+ AssetBrowser_FooterText.text = %finalAssetCount @ " Assets";
+
+ %activeTypeFilterList = "";
+ if(AssetBrowser.assetTypeFilter $= "")
+ {
+ if(!AssetTypeListPopup.isItemChecked(0))
+ {
+ for(%f=1; %f < AssetFilterTypeList.Count(); %f++)
+ {
+ %isChecked = AssetTypeListPopup.isItemChecked(%f+1);
+
+ if(%isChecked)
+ {
+ %filterTypeName = AssetFilterTypeList.getKey(%f);
+
+ if(%activeTypeFilterList $= "")
+ %activeTypeFilterList = %filterTypeName;
+ else
+ %activeTypeFilterList = %activeTypeFilterList @ ", " @ %filterTypeName;
+ }
+ }
+ }
+
+ if(!%validType)
+ continue;
+ }
+ else
+ {
+ %activeTypeFilterList = AssetBrowser.assetTypeFilter;
+ }
+
+ if(%activeTypeFilterList !$= "")
+ AssetBrowser_FooterText.text = AssetBrowser_FooterText.text @ " | Active Type Filters: " @ %activeTypeFilterList;
}
//
@@ -1835,17 +1844,22 @@ function AssetBrowserFilterTree::onControlDropped( %this, %payload, %position )
%parent = %this.getParentItem(%item);
- if(%parent == 1)
+ if(%item != 1)
{
- //we're a module entry, cool
- %targetModuleName = %this.getItemText(%item);
- echo("DROPPED IT ON MODULE " @ %targetModuleName);
+ //we're a folder entry, cool
+ %path = %this.getItemValue(%item) @ "/" @ %this.getItemText(%item);
+ echo("DROPPED IT ON PATH " @ %path);
- if(%moduleName !$= %targetModuleName)
+ if(%path !$= AssetBrowser.CurrentAddress)
{
//we're trying to move the asset to a different module!
- MessageBoxYesNo( "Move Asset", "Do you wish to move asset " @ %assetName @ " to module " @ %targetModuleName @ "?",
- "AssetBrowser.moveAsset("@%assetName@", "@%targetModuleName@");", "");
+ MessageBoxYesNo( "Move Asset", "Do you wish to move asset " @ %assetName @ " to " @ %path @ "?",
+ "AssetBrowser.moveAsset(\""@ %moduleName @ ":" @ %assetName @"\", \""@%path@"\");", "");
}
}
-}
\ No newline at end of file
+}
+
+function AssetBrowserFilterTree::onDragDropped( %this )
+{
+ %asdgadfhg =true;
+}
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cubemap.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cubemap.cs
index 80fd69807..ce7a5ad7f 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cubemap.cs
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cubemap.cs
@@ -60,7 +60,7 @@ function GuiInspectorTypeCubemapAssetPtr::onControlDropped( %this, %payload, %po
%module = %payload.dragSourceControl.parentGroup.moduleName;
%asset = %payload.dragSourceControl.parentGroup.assetName;
- %targetComponent = %this.ComponentOwner;
+ %targetComponent = %this.object;
%targetComponent.CubemapAsset = %module @ ":" @ %asset;
//Inspector.refresh();
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/folder.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/folder.cs
index d6e05db29..a684ec371 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/folder.cs
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/folder.cs
@@ -3,8 +3,7 @@ function AssetBrowser::buildFolderPreview(%this, %assetDef, %previewData)
%previewData.assetName = %assetDef.assetName;
%previewData.assetPath = %assetDef.dirPath;
- //%previewData.previewImage = "tools/assetBrowser/art/folderIcon";
- %previewData.previewImage = "tools/gui/images/folder";
+ %previewData.previewImage = "tools/assetBrowser/art/folderIcon";
//%previewData.assetFriendlyName = %assetDef.assetName;
%previewData.assetDesc = %assetDef.description;
@@ -92,4 +91,6 @@ function AssetBrowser::moveFolder(%this, %folderPath, %newFolderPath)
%copiedSuccess = pathCopy(%fullPath, %newFullPath @ "/" @ %newFolderName);
%this.deleteFolder(%fullPath);
+
+ //thrash the modules and reload them
}
\ No newline at end of file
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.cs
index b41b67e87..26616ab5d 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.cs
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.cs
@@ -164,6 +164,33 @@ function AssetBrowser::buildImageAssetPreview(%this, %assetDef, %previewData)
%previewData.tooltip = %assetDef.friendlyName @ "\n" @ %assetDef;
}
+function AssetBrowser::moveImageAsset(%this, %assetDef, %destination)
+{
+ %currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
+ %targetModule = AssetBrowser.getModuleFromAddress(%destination);
+
+ if(%currentModule $= %targetModule)
+ {
+ //just move the files
+ %assetPath = makeFullPath(AssetDatabase.getAssetFilePath(%assetDef.getAssetId()));
+ %assetFilename = fileName(%assetPath);
+
+ %newAssetPath = %destination @ "/" @ %assetFilename;
+
+ %copiedSuccess = pathCopy(%assetPath, %destination @ "/" @ %assetFilename);
+ %deleteSuccess = fileDelete(%assetPath);
+
+ %imagePath = %assetDef.imageFile;
+ %imageFilename = fileName(%imagePath);
+
+ %copiedSuccess = pathCopy(%imagePath, %destination @ "/" @ %imageFilename);
+ %deleteSuccess = fileDelete(%imagePath);
+ }
+
+ AssetDatabase.removeDeclaredAsset(%assetDef.getAssetId());
+ AssetDatabase.addDeclaredAsset(%targetModule, %newAssetPath);
+}
+
function GuiInspectorTypeImageAssetPtr::onControlDropped( %this, %payload, %position )
{
Canvas.popDialog(EditorDragAndDropLayer);
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs
index be77243c6..05947e6e9 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs
@@ -92,6 +92,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
//the material name), then we go ahead and create a blank entry
%suff = getTokenCount(%diffuseTypeSuffixes, ",;") == 0 ? "_albedo" : getToken(%diffuseTypeSuffixes, ",;", 0);
%diffuseAsset = AssetBrowser.addImportingAsset("Image", %assetItem.AssetName @ %suff, %assetItem);
+ %assetItem.diffuseImageAsset = %diffuseAsset;
}
}
@@ -114,6 +115,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
//the material name), then we go ahead and create a blank entry
%suff = getTokenCount(%normalTypeSuffixes, ",;") == 0 ? "_normal" : getToken(%normalTypeSuffixes, ",;", 0);
%normalAsset = AssetBrowser.addImportingAsset("Image", %assetItem.AssetName @ %suff, %assetItem);
+ %assetItem.normalImageAsset = %normalAsset;
}
}
@@ -134,6 +136,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
//the material name), then we go ahead and create a blank entry
%suff = getTokenCount(%metalnessTypeSuffixes, ",;") == 0 ? "_metalness" : getToken(%metalnessTypeSuffixes, ",;", 0);
%metalAsset = AssetBrowser.addImportingAsset("Image", %assetItem.AssetName @ %suff, %assetItem);
+ %assetItem.metalImageAsset = %metalAsset;
}
}
@@ -154,6 +157,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
//the material name), then we go ahead and create a blank entry
%suff = getTokenCount(%roughnessTypeSuffixes, ",;") == 0 ? "_roughness" : getToken(%roughnessTypeSuffixes, ",;", 0);
%roughnessAsset = AssetBrowser.addImportingAsset("Image", %assetItem.AssetName @ %suff, %assetItem);
+ %assetItem.roughnessImageAsset = %roughnessAsset;
}
}
@@ -174,6 +178,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
//the material name), then we go ahead and create a blank entry
%suff = getTokenCount(%smoothnessTypeSuffixes, ",;") == 0 ? "_smoothness" : getToken(%smoothnessTypeSuffixes, ",;", 0);
%smoothnessAsset = AssetBrowser.addImportingAsset("Image", %assetItem.AssetName @ %suff, %assetItem);
+ %assetItem.SmoothnessImageAsset = %smoothnessAsset;
}
}
@@ -194,6 +199,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
//the material name), then we go ahead and create a blank entry
%suff = getTokenCount(%aoTypeSuffixes, ",;") == 0 ? "_AO" : getToken(%aoTypeSuffixes, ",;", 0);
%AOAsset = AssetBrowser.addImportingAsset("Image", %assetItem.AssetName @ %suff, %assetItem);
+ %assetItem.AOImageAsset = %AOAsset;
}
}
@@ -214,6 +220,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
//the material name), then we go ahead and create a blank entry
%suff = getTokenCount(%compositeTypeSuffixes, ",;") == 0 ? "_composite" : getToken(%compositeTypeSuffixes, ",;", 0);
%compositeAsset = AssetBrowser.addImportingAsset("Image", %assetItem.AssetName @ %suff, %assetItem);
+ %assetItem.compositeImageAsset = %compositeAsset;
}
}
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.cs
index 343456ab0..6a03a1c83 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.cs
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.cs
@@ -175,7 +175,7 @@ function AssetBrowser::importShapeAsset(%this, %assetItem)
%assetId = %moduleName@":"@%assetName;
%assetPath = AssetBrowser.currentAddress @ "/";
- %assetFullPath = %assetPath @ "/" @ fileName(%filePath);
+ %assetFullPath = %assetPath @ fileName(%filePath);
%newAsset = new ShapeAsset()
{
@@ -213,7 +213,7 @@ function AssetBrowser::importShapeAsset(%this, %assetItem)
}
}
- %assetImportSuccessful = TAMLWrite(%newAsset, %assetPath @ "/" @ %assetName @ ".asset.taml");
+ %assetImportSuccessful = TAMLWrite(%newAsset, %assetPath @ %assetName @ ".asset.taml");
//and copy the file into the relevent directory
%doOverwrite = !AssetBrowser.isAssetReImport;
@@ -245,6 +245,11 @@ function AssetBrowser::importShapeAsset(%this, %assetItem)
if(getAssetImportConfigValue("Materials/DoUpAxisOverride", "") $= "1")
%constructor.upAxis = getAssetImportConfigValue("Meshes/UpAxisOverride", "Z_AXIS");
+
+ if(getAssetImportConfigValue("Meshes/DoScaleOverride", "0") $= "1")
+ %constructor.unit = getAssetImportConfigValue("Meshes/ScaleOverride", "1");
+ else
+ %constructor.unit = -1;
%constructor.lodType = getAssetImportConfigValue("Meshes/LODType", "0");
//%constructor.singleDetailSize = getAssetImportConfigValue("Meshes/convertLeftHanded", "0");
@@ -287,11 +292,23 @@ function AssetBrowser::importShapeAsset(%this, %assetItem)
%moduleDef = ModuleDatabase.findModule(%moduleName,1);
if(!AssetBrowser.isAssetReImport)
- AssetDatabase.addDeclaredAsset(%moduleDef, %assetPath @ "/" @ %assetName @ ".asset.taml");
+ AssetDatabase.addDeclaredAsset(%moduleDef, %assetPath @ %assetName @ ".asset.taml");
else
AssetDatabase.refreshAsset(%assetId);
}
+function AssetBrowser::buildShapeAssetPreview(%this, %assetDef, %previewData)
+{
+ %previewData.assetName = %assetDef.assetName;
+ %previewData.assetPath = %assetDef.fileName;
+
+ %previewData.previewImage = fileName;
+
+ %previewData.assetFriendlyName = %assetDef.assetName;
+ %previewData.assetDesc = %assetDef.description;
+ %previewData.tooltip = %assetDef.friendlyName @ "\n" @ %assetDef;
+}
+
function GuiInspectorTypeShapeAssetPtr::onControlDropped( %this, %payload, %position )
{
Canvas.popDialog(EditorDragAndDropLayer);
@@ -304,12 +321,12 @@ function GuiInspectorTypeShapeAssetPtr::onControlDropped( %this, %payload, %posi
if(%assetType $= "ShapeAsset")
{
- echo("DROPPED A SHAPE ON A SHAPE ASSET COMPONENT FIELD!");
+ //echo("DROPPED A SHAPE ON A SHAPE ASSET COMPONENT FIELD!");
%module = %payload.dragSourceControl.parentGroup.moduleName;
%asset = %payload.dragSourceControl.parentGroup.assetName;
- %targetComponent = %this.ComponentOwner;
+ %targetComponent = %this.targetObject;
%targetComponent.MeshAsset = %module @ ":" @ %asset;
//Inspector.refresh();
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.cs
index a8cfb9701..9128b75af 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.cs
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/editAsset.cs
@@ -153,7 +153,7 @@ function AssetNameField::onReturn(%this)
}
//------------------------------------------------------------
-function AssetBrowser::moveAsset(%this, %destination)
+function AssetBrowser::moveAsset(%this, %assetId, %destination)
{
if(EditAssetPopup.assetType $= "Folder")
{
@@ -163,12 +163,15 @@ function AssetBrowser::moveAsset(%this, %destination)
}
else
{
- %assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
- %assetType = AssetDatabase.getAssetType(EditAssetPopup.assetType);
+ %assetDef = AssetDatabase.acquireAsset(%assetId);
+ %assetType = AssetDatabase.getAssetType(%assetId);
//Do any cleanup required given the type
if(%this.isMethod("move"@%assetType))
- eval(%this @ ".move"@%assetType@"("@%assetDef@");");
+ {
+ %command = %this @ ".move" @ %assetType @ "(" @ %assetDef @ ",\"" @ %destination @ "\");";
+ eval(%this @ ".move" @ %assetType @ "(" @ %assetDef @ ",\"" @ %destination @ "\");");
+ }
}
}
diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs
index be2365bd9..d76e20633 100644
--- a/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs
+++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs
@@ -104,24 +104,24 @@ function AssetBrowser::buildPopupMenus(%this)
class = "EditorWorldMenu";
//isPopup = true;
- item[ 0 ] = "Create Material" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"MaterialAsset\", AssetBrowser.selectedModule);";//"createNewMaterialAsset(\"NewMaterial\", AssetBrowser.selectedModule);";
- item[ 1 ] = "Create Terrain Material" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"TerrainMaterialAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewImageAsset(\"NewImage\", AssetBrowser.selectedModule);";
- item[ 2 ] = "Create Image" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ImageAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewImageAsset(\"NewImage\", AssetBrowser.selectedModule);";
+ item[ 0 ] = "Material" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"MaterialAsset\", AssetBrowser.selectedModule);";//"createNewMaterialAsset(\"NewMaterial\", AssetBrowser.selectedModule);";
+ item[ 1 ] = "Terrain Material" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"TerrainMaterialAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewImageAsset(\"NewImage\", AssetBrowser.selectedModule);";
+ item[ 2 ] = "Image" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ImageAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewImageAsset(\"NewImage\", AssetBrowser.selectedModule);";
item[ 3 ] = "-";
- item[ 4 ] = "Create Terrain Data" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"TerrainAsset\", AssetBrowser.selectedModule);";
+ item[ 4 ] = "Terrain Data" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"TerrainAsset\", AssetBrowser.selectedModule);";
item[ 5 ] = "-";
- item[ 6 ] = "Create Shape" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"Shape\", AssetBrowser.selectedModule);";
- item[ 7 ] = "Create Shape Animation" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ShapeAnimationAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewShapeAnimationAsset(\"NewShapeAnimation\", AssetBrowser.selectedModule);";
+ item[ 6 ] = "Shape" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"Shape\", AssetBrowser.selectedModule);";
+ item[ 7 ] = "Shape Animation" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ShapeAnimationAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewShapeAnimationAsset(\"NewShapeAnimation\", AssetBrowser.selectedModule);";
item[ 8 ] = "-";
- item[ 9 ] = "Create GUI" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"GUIAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewGUIAsset(\"NewGUI\", AssetBrowser.selectedModule);";
+ item[ 9 ] = "GUI" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"GUIAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewGUIAsset(\"NewGUI\", AssetBrowser.selectedModule);";
item[ 10 ] = "-";
- item[ 11 ] = "Create Post Effect" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"PostEffectAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewPostEffectAsset(\"NewPostEffect\", AssetBrowser.selectedModule);";
+ item[ 11 ] = "Post Effect" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"PostEffectAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewPostEffectAsset(\"NewPostEffect\", AssetBrowser.selectedModule);";
item[ 12 ] = "-";
- item[ 13 ] = "Create Sound" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"SoundAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewSoundAsset(\"NewSound\", AssetBrowser.selectedModule);";
+ item[ 13 ] = "Sound" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"SoundAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewSoundAsset(\"NewSound\", AssetBrowser.selectedModule);";
item[ 14 ] = "-";
- item[ 15 ] = "Create Particle Effect" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ParticleEffectAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewParticleEffectAsset(\"NewParticleEffect\", AssetBrowser.selectedModule);";
+ item[ 15 ] = "Particle Effect" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ParticleEffectAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewParticleEffectAsset(\"NewParticleEffect\", AssetBrowser.selectedModule);";
item[ 16 ] = "-";
- item[ 17 ] = "Create Cubemap" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"CubemapAsset\", AssetBrowser.selectedModule);";
+ item[ 17 ] = "Cubemap" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"CubemapAsset\", AssetBrowser.selectedModule);";
};
}
@@ -139,7 +139,7 @@ function AssetBrowser::buildPopupMenus(%this)
item[ 3 ] = "Create Component Class" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"CppComponentAsset\", AssetBrowser.selectedModule);";
item[ 4 ] = "Create Script Class" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"CppScriptClass\", AssetBrowser.selectedModule);";*/
- item[ 0 ] = "Create C++ Class" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"CppAsset\", AssetBrowser.selectedModule);";
+ item[ 0 ] = "C++ Class" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"CppAsset\", AssetBrowser.selectedModule);";
};
//%this.AddNewScriptAssetPopup.insertSubMenu(0, "Create Component", AddNewComponentAssetPopup);
}
@@ -151,17 +151,17 @@ function AssetBrowser::buildPopupMenus(%this)
superClass = "MenuBuilder";
class = "EditorWorldMenu";
- item[0] = "Create Folder" TAB "" TAB "AssetBrowser.CreateNewFolder();";
+ item[0] = "Folder" TAB "" TAB "AssetBrowser.CreateNewFolder();";
item[1] = "-";
- item[2] = "Create Code Asset" TAB AddNewScriptAssetPopup;
+ item[2] = "Code Asset" TAB AddNewScriptAssetPopup;
item[3] = "-";
- item[4] = "Create Art Asset" TAB AddNewArtAssetPopup;
+ item[4] = "Art Asset" TAB AddNewArtAssetPopup;
item[5] = "-";
- item[6] = "Create Level" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"LevelAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewLevelAsset(\"NewLevel\", AssetBrowser.selectedModule);";
+ item[6] = "Level" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"LevelAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewLevelAsset(\"NewLevel\", AssetBrowser.selectedModule);";
item[7] = "-";
- item[8] = "Create C++ Asset" TAB AddNewCppAssetPopup;
+ item[8] = "C++ Asset" TAB AddNewCppAssetPopup;
item[9] = "-";
- item[10] = "Create New Module" TAB "" TAB "AssetBrowser.CreateNewModule();";
+ item[10] = "New Module" TAB "" TAB "AssetBrowser.CreateNewModule();";
};
}
@@ -174,7 +174,7 @@ function AssetBrowser::buildPopupMenus(%this)
class = "EditorWorldMenu";
//isPopup = true;
- item[ 0 ] = "Create New Asset" TAB AddNewAssetPopup;
+ item[ 0 ] = "New Asset" TAB AddNewAssetPopup;
item[ 1 ] = "Reload Module" TAB "" TAB "AssetBrowser.reloadModule();";
Item[ 2 ] = "-";
Item[ 3 ] = "Edit Module" TAB "" TAB "AssetBrowser.editModuleInfo();";
@@ -199,7 +199,7 @@ function AssetBrowser::buildPopupMenus(%this)
class = "EditorWorldMenu";
//isPopup = true;
- Item[ 0 ] = "Create in Folder" TAB AddNewAssetPopup;
+ Item[ 0 ] = "Create" TAB AddNewAssetPopup;
item[ 1 ] = "-";
item[ 2 ] = "Rename Folder" TAB "" TAB "AssetBrowser.renameAsset();";
Item[ 3 ] = "Duplicate Folder" TAB "" TAB "AssetBrowser.duplicateAsset();";
@@ -243,15 +243,22 @@ function AssetBrowser::buildPopupMenus(%this)
superClass = "MenuBuilder";
class = "EditorWorldMenu";
//isPopup = true;
+
+ radioSelection = false;
};
- /*for(%i=0; %i < AssetFilterTypeList.Count(); %i++)
+ AssetTypeListPopup.addItem(0, AssetFilterTypeList.getKey(0) TAB "" TAB "AssetBrowser.toggleAssetTypeFilter(" @ 0 @ ");");
+ AssetTypeListPopup.addItem(1, "-");
+
+ for(%i=1; %i < AssetFilterTypeList.Count(); %i++)
{
%assetTypeName = AssetFilterTypeList.getKey(%i);
- AssetTypeListPopup.insertItem(%i, %assetTypeName, "", "AssetBrowser.toggleAssetTypeFilter(" @ %i @ ");");
- }*/
+ AssetTypeListPopup.addItem(%i+1, %assetTypeName TAB "" TAB "AssetBrowser.toggleAssetTypeFilter(" @ %i + 1 @ ");");
+ }
}
+ AssetBrowser.toggleAssetTypeFilter(0);
+
//Browser visibility menu
if( !isObject( BrowserVisibilityPopup ) )
{
@@ -276,7 +283,6 @@ function AssetBrowser::buildPopupMenus(%this)
};
BrowserVisibilityPopup.enableItem(5, false);
- BrowserVisibilityPopup.enableItem(7, false);
BrowserVisibilityPopup.enableItem(9, false);
}
diff --git a/Templates/BaseGame/game/tools/settings.xml b/Templates/BaseGame/game/tools/settings.xml
index a07f63b5d..d16b7ef71 100644
--- a/Templates/BaseGame/game/tools/settings.xml
+++ b/Templates/BaseGame/game/tools/settings.xml
@@ -1,257 +1,259 @@
-
- 0.1
- 1
- 1
- 45
- 1
- 180 180 180 255
- 0 0 0 100
- 135
- 1
- 0
- 0
- 1
- 255 255 255 255
- 1
- 40 40
-
-
- Modern
- 50
- 0
- 6
- TTR:DasBootLevel,pbr:PbrMatTestLevel
- TTR:DasBootLevel
- screenCenter
- 40
- AssetWork_Debug.exe
- WorldEditorInspectorPlugin
- Blank Level
- 1
-
- ../../../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
-
-
- Classic
-
-
- 1
- 1
- 1
- 1
- 1
-
-
- 0.01
- 0
- 0
- 2
- 0
- 0
- 100
- 1
- 1
-
-
- 255 0 0 255
- 100 100 100 255
- 0 0 255 255
- 255 255 255 255
- 255 255 0 255
- 255 255 0 255
- 0 255 0 255
-
-
- 255
- 1
- 8
- 20
- 0
-
-
- 51 51 51 100
- 1
- 1
- 102 102 102 100
- 255 255 255 100
-
-
- 50 50 50 255
- 255 255 255 255
- 48 48 48 255
- 215 215 215 255
- 180 180 180 255
-
-
- tools/worldEditor/images/LockedHandle
- tools/worldEditor/images/DefaultHandle
- tools/worldEditor/images/SelectHandle
-
-
-
- 1
- 0
- 0.8
- 100
- 15
- 0.8
- 0
-
- 255 255 255 20
- 500
- 0
- 0
- 1 1 1
- 1
-
-
-
- DefaultPlayerData
- AIPlayer
- 1
+
+ 0 255 0 255
+ 10
+ DefaultDecalRoadMaterial
+ 255 255 255 255
<AssetType>/
- <AssetType>/<AssetName>/
- <AssetType>/
- <AssetType>/
- <AssetType>/
- 1
- <AssetType>/
<AssetType>/OtherFolder/
+ <AssetType>/
+ <AssetType>/
+ <AssetType>/
+ <AssetType>/<AssetName>/
+ <AssetType>/
TestConfig
+ 1
<AssetType>/<SpecialAssetTag>/
<AssetType>/<SpecialAssetTag>/
-
- 0 0 1
- 255 0 0 255
- 10
- DefaultRoadMaterialOther
- 0 255 0 255
- DefaultRoadMaterialTop
+
+ 1
+ 135
+ 0
+ 0.1
+ 0
+ 1
+ 0 0 0 100
+ 255 255 255 255
+ 180 180 180 255
+ 1
+ 1
+ 1
+ 45
+ 40 40
+ 1
lowerHeight
-
- 1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000
- 10
- 90
- 1
- 1
- 1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000
- 50
- 0
- 100
- 0.1
-
40 40
- 1
- 1
40 40
ellipse
+ 1
+ 1
-
-
- 5
- 0 255 0 255
- 255 255 255 255
- 255 0 0 255
- 0 0 1
- 10
-
-
- 1
- TestConfig
-
- small
+
+ 0.1
+ 1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000
+ 1
+ 1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000
+ 100
+ 90
+ 0
+ 1
+ 10
+ 50
-
- 236 234 232 255
- 59 58 57 255
- 32 31 30 255
- 50 49 48 255
- 178 175 172 255
- 255 255 255 255
- 43 43 43 255
- 37 36 35 255
- 59 58 57 255
- 72 70 68 255
- 77 77 77 255
- 50 49 48 255
- 17 16 15 255
- 72 70 68 255
- 50 49 48 255
- 234 232 230 255
- 100 98 96 255
- 96 94 92 255
- 255 255 255 255
-
- tools/gui/messageBoxes
+ tools/gui
1024 768
+ http://www.garagegames.com/products/torque-3d/documentation/user
../../../Documentation/Torque 3D - Script Manual.chm
../../../Documentation/Official Documentation.html
- http://www.garagegames.com/products/torque-3d/documentation/user
+
+
+ 0
+ 0
+ 0
- 1
- 1
1
1
2
0
8
1
+ 1
+ 1
1
1
+
+ Categorized
+
0
-
- 0
- 0
- 0
+
+
+ 40
+ 1
+ pbr:PbrMatTestLevel,TTR:DasBootLevel
+ 50
+ 1
+ pbr:PbrMatTestLevel
+ Blank Level
+ screenCenter
+ WorldEditorInspectorPlugin
+ 6
+ AssetWork_Debug.exe
+ Modern
+ 0
+
+ 1
+ 102 102 102 100
+ 255 255 255 100
+ 51 51 51 100
+ 1
-
- Categorized
+
+ 100 100 100 255
+ 255 255 0 255
+ 0 0 255 255
+ 255 255 255 255
+ 255 0 0 255
+ 255 255 0 255
+ 0 255 0 255
+
+
+ 48 48 48 255
+ 50 50 50 255
+ 180 180 180 255
+ 255 255 255 255
+ 215 215 215 255
+
+
+ http://www.garagegames.com/products/torque-3d/documentation/user
+ ../../../Documentation/Torque 3D - Script Manual.chm
+ ../../../Documentation/Official Documentation.html
+ http://www.garagegames.com/products/torque-3d/forums
+
+
+ 0
+ 2
+ 0
+ 0
+ 0.01
+ 0
+ 100
+ 1
+ 1
+
+
+ tools/worldEditor/images/LockedHandle
+ tools/worldEditor/images/DefaultHandle
+ tools/worldEditor/images/SelectHandle
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 20
+ 0
+ 255
+ 1
+ 8
+
+
+ Classic
+
+
+
+ 10
+ DefaultRoadMaterialTop
+ 0 0 1
+ 0 255 0 255
+ 255 0 0 255
+ DefaultRoadMaterialOther
+
+
+ 0
+ 1
+ 0
+ 0.8
+ 100
+ 15
+ 0.8
+
+ 0
+ 1
+ 1 1 1
+ 500
+ 0
+ 255 255 255 20
+ 1
+
+
+
+ 5
+ 255 0 0 255
+ 255 255 255 255
+ 0 0 1
+ 0 255 0 255
+ 10
+
+
+ DefaultPlayerData
+ AIPlayer
+ 1
+
+
+ Small
+
+
+ 100 98 96 255
+ 50 49 48 255
+ 50 49 48 255
+ 32 31 30 255
+ 72 70 68 255
+ 234 232 230 255
+ 17 16 15 255
+ 72 70 68 255
+ 236 234 232 255
+ 43 43 43 255
+ 77 77 77 255
+ 255 255 255 255
+ 178 175 172 255
+ 59 58 57 255
+ 96 94 92 255
+ 50 49 48 255
+ 255 255 255 255
+ 37 36 35 255
+ 59 58 57 255
+
+
+ TestConfig
+ 0
+
+ small
data/FPSGameplay/levels
-
- 5
-
25
+
+ 5
+
-
- 10
- 0 255 0 255
- 255 255 255 255
- DefaultDecalRoadMaterial
-
Grid_512_Orange
1
-
- Small
-
diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.cs
index 5e3734fa5..66f95c23c 100644
--- a/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.cs
+++ b/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.cs
@@ -1344,6 +1344,7 @@ function EWorldEditor::setGridSnap( %this, %value )
{
%this.gridSnap = %value;
GlobalGizmoProfile.snapToGrid = %value;
+ GlobalGizmoProfile.forceSnapRotations = %value;
%this.syncGui();
}
diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/editorPrefs.ed.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/editorPrefs.ed.cs
index f53243afa..04e946640 100644
--- a/Templates/BaseGame/game/tools/worldEditor/scripts/editorPrefs.ed.cs
+++ b/Templates/BaseGame/game/tools/worldEditor/scripts/editorPrefs.ed.cs
@@ -131,6 +131,7 @@ EditorSettings.beginGroup( "Grid" );
EditorSettings.setDefaultValue( "gridColor", "255 255 255 20" );
EditorSettings.setDefaultValue( "gridSize", "1 1 1" );
EditorSettings.setDefaultValue( "snapToGrid", "0" ); //<-- Not currently used
+EditorSettings.setDefaultValue( "forceSnapRotations", "0" ); //<-- Not currently used
EditorSettings.setDefaultValue( "renderPlane", "0" );
EditorSettings.setDefaultValue( "renderPlaneHashes", "0" );
EditorSettings.setDefaultValue( "planeDim", "500" );
@@ -276,6 +277,7 @@ function EditorGui::readWorldEditorSettings(%this)
GlobalGizmoProfile.gridColor = EditorSettings.value("gridColor"); //$pref::WorldEditor::gridColor;
GlobalGizmoProfile.gridSize = EditorSettings.value("gridSize"); //$pref::WorldEditor::gridSize;
GlobalGizmoProfile.snapToGrid = EditorSettings.value("snapToGrid"); //$pref::WorldEditor::snapToGrid;
+ GlobalGizmoProfile.forceSnapRotations = EditorSettings.value("forceSnapRotations"); //$pref::WorldEditor::forceSnapRotations;
GlobalGizmoProfile.renderPlane = EditorSettings.value("renderPlane"); //$pref::WorldEditor::renderPlane;
GlobalGizmoProfile.renderPlaneHashes = EditorSettings.value("renderPlaneHashes"); //$pref::WorldEditor::renderPlaneHashes;
GlobalGizmoProfile.planeDim = EditorSettings.value("planeDim"); //$pref::WorldEditor::planeDim;
@@ -371,6 +373,7 @@ function EditorGui::writeWorldEditorSettings(%this)
EditorSettings.setValue( "gridColor", GlobalGizmoProfile.gridColor ); //$Pref::WorldEditor::gridColor
EditorSettings.setValue( "gridSize", GlobalGizmoProfile.gridSize ); //$Pref::WorldEditor::gridSize
EditorSettings.setValue( "snapToGrid", GlobalGizmoProfile.snapToGrid ); //$Pref::WorldEditor::snapToGrid
+ EditorSettings.setValue( "forceSnapRotations", GlobalGizmoProfile.forceSnapRotations ); //$Pref::WorldEditor::forceSnapRotations
EditorSettings.setValue( "renderPlane", GlobalGizmoProfile.renderPlane ); //$Pref::WorldEditor::renderPlane
EditorSettings.setValue( "renderPlaneHashes", GlobalGizmoProfile.renderPlaneHashes );//$Pref::WorldEditor::renderPlaneHashes
EditorSettings.setValue( "planeDim", GlobalGizmoProfile.planeDim ); //$Pref::WorldEditor::planeDim
diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/miscViz.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/miscViz.cs
index b96b1b4c9..f6493da78 100644
--- a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/miscViz.cs
+++ b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/miscViz.cs
@@ -216,9 +216,9 @@ function toggleSurfacePropertiesViz( %mode )
for(%i=0; %i < 15; %i++)
{
if(%i == $Viz_SurfacePropertiesModeVar)
- EVisibilityBufferVizOptions.checkItem(%i, true);
+ EVisibilityBufferVizOptions.checkItem(%i+1, true);
else
- EVisibilityBufferVizOptions.checkItem(%i, false);
+ EVisibilityBufferVizOptions.checkItem(%i+1, false);
}
//forces the forward materials to get dis viz properly