Squashed commit of the following:

commit 678d0ea2357915c6502af90083f1d34b6b21b7b4
Author: AtomicWalrus <headlesschickens.inc@gmail.com>
Date:   Mon Feb 20 20:46:15 2023 -0700

    Removed some commented-out code

commit 4a149157f7a7b781e2246b1417b144625ff559cd
Author: AtomicWalrus <headlesschickens.inc@gmail.com>
Date:   Mon Feb 20 20:42:03 2023 -0700

    Remove un-used instance of the blendHardness var

commit e5dc42adef00ed371cbc89b731ae16889ba68d9a
Author: AtomicWalrus <headlesschickens.inc@gmail.com>
Date:   Mon Feb 20 18:57:51 2023 -0700

    Cleanup un-needed conditionals and other leftover code

commit dccd10010e058f00cd41f5c5c111443f9cb71721
Author: AtomicWalrus <headlesschickens.inc@gmail.com>
Date:   Mon Feb 20 18:05:31 2023 -0700

    Use validator instead of protected field (2)

commit 4cc7f1d32fcc6ab788de54bb38763283fbd5533e
Author: AtomicWalrus <headlesschickens.inc@gmail.com>
Date:   Mon Feb 20 18:03:40 2023 -0700

    Use validator instead of protected field

commit e8d7e1731e383a99e8a0539d23a3b04f9c252491
Author: AtomicWalrus <headlesschickens.inc@gmail.com>
Date:   Mon Feb 20 15:34:48 2023 -0700

    Terrain macro textures and blending hardness
This commit is contained in:
AtomicWalrus 2023-02-20 20:47:46 -07:00
parent 2d946f693a
commit 13fec9bb80
10 changed files with 333 additions and 89 deletions

View file

@ -394,7 +394,7 @@ $guiContent = new GuiControl(TerrainMaterialDlg,EditorGuiGroup) {
};
new GuiContainer(NormalMapContainer) {
position = "6 205";
extent = "261 100";
extent = "261 120";
horizSizing = "width";
profile = "ToolsGuiDefaultProfile";
tooltipProfile = "ToolsGuiToolTipProfile";
@ -527,17 +527,45 @@ $guiContent = new GuiControl(TerrainMaterialDlg,EditorGuiGroup) {
isContainer = "0";
internalName = "blendHeightContrastTextEditCtrl";
};
new GuiTextEditCtrl(TerrainMaterialDlgBlendHeightHardnessTextEdit) {
text = "0";
anchorTop = "0";
anchorLeft = "0";
position = "1 99";
extent = "35 18";
profile = "ToolsGuiTextEditProfile";
tooltipProfile = "ToolsGuiToolTipProfile";
isContainer = "0";
internalName = "blendHeightHardnessTextEditCtrl";
};
new GuiTextCtrl() {
text = "Blend Hardness";
position = "115 101";
extent = "76 15";
profile = "ToolsGuiTextProfile";
tooltipProfile = "ToolsGuiToolTipProfile";
};
new GuiSliderCtrl(TerrainMaterialDlgBlendHeightHardnessSlider) {
range = "0 0.999";
ticks = "0";
value = "0";
position = "39 101";
extent = "70 14";
profile = "ToolsGuiSliderProfile";
tooltipProfile = "ToolsGuiToolTipProfile";
internalName = "blendHeightHardnessSliderCtrl";
};
};
new GuiBitmapCtrl() {
BitmapAsset = "ToolsModule:separator_v_image";
position = "6 307";
extent = "266 2";
BitmapAsset = "ToolsModule:separator_v_image";
position = "6 323";
extent = "266 2";
horizSizing = "width";
profile = "ToolsGuiDefaultProfile";
tooltipProfile = "ToolsGuiToolTipProfile";
};
new GuiContainer(ORMConfigMapContainer) {
position = "6 314";
position = "6 330";
extent = "261 64";
horizSizing = "width";
profile = "ToolsGuiDefaultProfile";
@ -615,14 +643,14 @@ $guiContent = new GuiControl(TerrainMaterialDlg,EditorGuiGroup) {
};
new GuiBitmapCtrl() {
BitmapAsset = "ToolsModule:separator_v_image";
position = "6 381";
position = "6 397";
extent = "266 2";
horizSizing = "width";
profile = "ToolsGuiDefaultProfile";
tooltipProfile = "ToolsGuiToolTipProfile";
};
new GuiContainer(MacroMapContainer) {
position = "6 388";
position = "6 404";
extent = "261 72";
horizSizing = "width";
profile = "ToolsGuiDefaultProfile";
@ -746,7 +774,7 @@ $guiContent = new GuiControl(TerrainMaterialDlg,EditorGuiGroup) {
};
};
new GuiContainer(TerrainEffectsContainer) {
position = "6 460";
position = "6 476";
extent = "265 97";
horizSizing = "width";
profile = "ToolsGuiDefaultProfile";

View file

@ -477,6 +477,10 @@ function TerrainMaterialDlg::setActiveMaterial( %this, %mat )
%this-->blendHeightContrastTextEditCtrl.setText( %blendHeightContrast );
%this-->blendHeightContrastSliderCtrl.setValue( %mat.blendHeightContrast );
%blendHeightHardness = mFloor(%mat.blendHeightHardness * 1000)/1000;
%this-->blendHeightHardnessTextEditCtrl.setText( %blendHeightHardness );
%this-->blendHeightHardnessSliderCtrl.setValue( %mat.blendHeightHardness );
%this-->macroSizeCtrl.setText( %mat.macroSize );
%this-->macroStrengthCtrl.setText( %mat.macroStrength );
%this-->macroDistanceCtrl.setText( %mat.macroDistance );
@ -686,6 +690,7 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %materialAssetId )
%parallaxScale = %this-->parallaxScaleCtrl.getText();
%blendHeightBase = %this-->blendHeightBaseTextEditCtrl.getText();
%blendHeightContrast = %this-->blendHeightContrastTextEditCtrl.getText();
%blendHeightHardness = %this-->blendHeightHardnessTextEditCtrl.getText();
%macroSize = %this-->macroSizeCtrl.getText();
%macroStrength = %this-->macroStrengthCtrl.getText();
@ -725,6 +730,7 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %materialAssetId )
%mat.parallaxScale == %parallaxScale &&
%mat.blendHeightBase == %blendHeightBase &&
%mat.blendHeightContrast == %blendHeightContrast &&
%mat.blendHeightHardness == %blendHeightHardness &&
%mat.isSRGB == %isSRGB &&
%mat.invertRoughness == %invertRoughness &&
%fxMat.effectColor[0] == %effectColor0 &&
@ -772,6 +778,7 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %materialAssetId )
%mat.parallaxScale = %parallaxScale;
%mat.blendHeightBase = %blendHeightBase;
%mat.blendHeightContrast = %blendHeightContrast;
%mat.blendHeightHardness = %blendHeightHardness;
%mat.isSRGB = %isSRGB;
%mat.invertRoughness = %invertRoughness;
@ -861,6 +868,7 @@ function TerrainMaterialDlg::snapshotMaterials( %this )
parallaxScale = %mat.parallaxScale;
blendHeightBase = %mat.blendHeightBase;
blendHeightContrast = %mat.blendHeightContrast;
blendHeightHardness = %mat.blendHeightHardness;
isSRGB = %mat.isSRGB;
invertRoughness = %mat.invertRoughness;
};
@ -901,6 +909,7 @@ function TerrainMaterialDlg::restoreMaterials( %this )
%mat.parallaxScale = %obj.parallaxScale;
%mat.blendHeightBase = %obj.blendHeightBase;
%mat.blendHeightContrast = %obj.blendHeightContrast;
%mat.blendHeightHardness = %obj.blendHeightHardness;
%mat.isSRGB = %obj.isSRGB;
%mat.invertRoughness = %obj.invertRoughness;
}
@ -971,6 +980,25 @@ function TerrainMaterialDlgBlendHeightContrastTextEdit::onValidate(%this)
TerrainMaterialDlg.matDirty = true;
}
function TerrainMaterialDlgBlendHeightHardnessSlider::onMouseDragged(%this)
{
%value = mClamp(%this.value, 0.0, 0.999);
%value = mFloor(%value * 1000)/1000;
TerrainMaterialDlgBlendHeightHardnessTextEdit.setText(%value);
TerrainMaterialDlg.activeMat.blendHeightHardness = %value;
TerrainMaterialDlg.matDirty = true;
}
function TerrainMaterialDlgBlendHeightHardnessTextEdit::onValidate(%this)
{
%value = mClamp(%this.getText(), 0.0, 0.999);
%value = mFloor(%value * 1000)/1000;
%this.setText(%value);
TerrainMaterialDlgBlendHeightHardnessSlider.setValue(%value);
TerrainMaterialDlg.activeMat.blendHeightHardness = %value;
TerrainMaterialDlg.matDirty = true;
}
//
//
function terrMatEdDragNDropMapAssignment(%mapName, %payload)