summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-11-05 12:33:24 +0200
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-11-05 13:53:33 +0200
commit2b8dc2f02a940a930624116a27700a38b7068f83 (patch)
tree1607d56aa572f928b33719db5eb2f79620f5eaa2
parent5e11448e4fccb56d03eb9a7b18774b8c550683b7 (diff)
#4785 The Apply button is not activated after changing a Material
-rw-r--r--indra/newview/llfloaterregioninfo.cpp34
-rw-r--r--indra/newview/llfloaterregioninfo.h1
2 files changed, 23 insertions, 12 deletions
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index 334f32d051..2b243ef972 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -270,10 +270,12 @@ bool LLFloaterRegionInfo::postBuild()
static LLCachedControl<bool> feature_pbr_terrain_transforms_enabled(gSavedSettings, "RenderTerrainPBRTransformsEnabled", false);
if (!feature_pbr_terrain_transforms_enabled() || !feature_pbr_terrain_enabled())
{
+ LL_INFOS("Terrain") << "Building region terrain panel from panel_region_terrain.xml" << LL_ENDL;
panel->buildFromFile("panel_region_terrain.xml");
}
else
{
+ LL_INFOS("Terrain") << "Building region terrain panel from panel_region_terrain_texture_transform.xml" << LL_ENDL;
panel->buildFromFile("panel_region_terrain_texture_transform.xml");
}
mTab->addTabPanel(panel);
@@ -1999,18 +2001,7 @@ void LLPanelRegionTerrainInfo::initMaterialCtrl(LLTextureCtrl*& ctrl, const std:
ctrl->setCommitCallback(
[this, index](LLUICtrl* ctrl, const LLSD& param)
{
- if (!mMaterialScaleUCtrl[index]
- || !mMaterialScaleVCtrl[index]
- || !mMaterialRotationCtrl[index]
- || !mMaterialOffsetUCtrl[index]
- || !mMaterialOffsetVCtrl[index]) return;
-
- mMaterialScaleUCtrl[index]->setValue(1.f);
- mMaterialScaleVCtrl[index]->setValue(1.f);
- mMaterialRotationCtrl[index]->setValue(0.f);
- mMaterialOffsetUCtrl[index]->setValue(0.f);
- mMaterialOffsetVCtrl[index]->setValue(0.f);
- onChangeAnything();
+ callbackMaterialCommit(index);
});
}
@@ -2098,6 +2089,25 @@ bool LLPanelRegionTerrainInfo::callbackBakeTerrain(const LLSD& notification, con
return false;
}
+void LLPanelRegionTerrainInfo::callbackMaterialCommit(S32 index)
+{
+ // These can be null if 'transforms' panel was not inited
+ if (mMaterialScaleUCtrl[index]
+ && mMaterialScaleVCtrl[index]
+ && mMaterialRotationCtrl[index]
+ && mMaterialOffsetUCtrl[index]
+ && mMaterialOffsetVCtrl[index])
+ {
+ mMaterialScaleUCtrl[index]->setValue(1.f);
+ mMaterialScaleVCtrl[index]->setValue(1.f);
+ mMaterialRotationCtrl[index]->setValue(0.f);
+ mMaterialOffsetUCtrl[index]->setValue(0.f);
+ mMaterialOffsetVCtrl[index]->setValue(0.f);
+ }
+
+ onChangeAnything();
+}
+
/////////////////////////////////////////////////////////////////////////////
// LLPanelEstateInfo
//
diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h
index a8631c36ca..0036df9c3d 100644
--- a/indra/newview/llfloaterregioninfo.h
+++ b/indra/newview/llfloaterregioninfo.h
@@ -272,6 +272,7 @@ public:
static void onClickBakeTerrain(void*);
bool callbackBakeTerrain(const LLSD& notification, const LLSD& response);
bool callbackTextureHeights(const LLSD& notification, const LLSD& response);
+ void callbackMaterialCommit(S32 index);
protected:
bool sendUpdate() override;