summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authormax nikolenko <maximnproductengine@lindenlab.com>2017-04-27 16:28:48 +0000
committermax nikolenko <maximnproductengine@lindenlab.com>2017-04-27 16:28:48 +0000
commitc995dcdbf301bd3de5d8166fbb76b9835c46bbb3 (patch)
treeb9865370bb765166ffaa6e652aa62b80be64bfca /indra
parentf199fd5a521bde770694481c0878300687a6daf2 (diff)
parent69db7cd947a6b272004f7a02a0f45527dba0fdbd (diff)
Merged in MAINT-3223
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llpanelface.cpp326
-rw-r--r--indra/newview/llpanelface.h13
-rw-r--r--indra/newview/skins/default/xui/en/panel_tools_texture.xml14
4 files changed, 317 insertions, 47 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index f0a91fd407..89f5d7a24f 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -11878,6 +11878,17 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>SyncMaterialSettings</key>
+ <map>
+ <key>Comment</key>
+ <string>SyncMaterialSettings</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>SnapshotQuality</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index ad600358dd..a16259886d 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -131,13 +131,13 @@ BOOL LLPanelFace::postBuild()
childSetCommitCallback("combobox shininess",&LLPanelFace::onCommitShiny,this);
childSetCommitCallback("combobox bumpiness",&LLPanelFace::onCommitBump,this);
childSetCommitCallback("combobox alphamode",&LLPanelFace::onCommitAlphaMode,this);
- childSetCommitCallback("TexScaleU",&LLPanelFace::onCommitTextureInfo, this);
- childSetCommitCallback("TexScaleV",&LLPanelFace::onCommitTextureInfo, this);
- childSetCommitCallback("TexRot",&LLPanelFace::onCommitTextureInfo, this);
+ childSetCommitCallback("TexScaleU",&LLPanelFace::onCommitTextureScaleX, this);
+ childSetCommitCallback("TexScaleV",&LLPanelFace::onCommitTextureScaleY, this);
+ childSetCommitCallback("TexRot",&LLPanelFace::onCommitTextureRot, this);
childSetCommitCallback("rptctrl",&LLPanelFace::onCommitRepeatsPerMeter, this);
childSetCommitCallback("checkbox planar align",&LLPanelFace::onCommitPlanarAlign, this);
- childSetCommitCallback("TexOffsetU",LLPanelFace::onCommitTextureInfo, this);
- childSetCommitCallback("TexOffsetV",LLPanelFace::onCommitTextureInfo, this);
+ childSetCommitCallback("TexOffsetU",LLPanelFace::onCommitTextureOffsetX, this);
+ childSetCommitCallback("TexOffsetV",LLPanelFace::onCommitTextureOffsetY, this);
childSetCommitCallback("bumpyScaleU",&LLPanelFace::onCommitMaterialBumpyScaleX, this);
childSetCommitCallback("bumpyScaleV",&LLPanelFace::onCommitMaterialBumpyScaleY, this);
@@ -691,6 +691,8 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
}
getChildView("radio_material_type")->setEnabled(editable);
+ getChildView("checkbox_sync_settings")->setEnabled(editable);
+ childSetValue("checkbox_sync_settings", gSavedSettings.getBOOL("SyncMaterialSettings"));
updateVisibility();
bool identical = true; // true because it is anded below
@@ -1863,11 +1865,38 @@ void LLPanelFace::onSelectNormalTexture(const LLSD& data)
}
//static
+void LLPanelFace::syncOffsetX(LLPanelFace* self, F32 offsetU)
+{
+ LLSelectedTEMaterial::setNormalOffsetX(self,offsetU);
+ LLSelectedTEMaterial::setSpecularOffsetX(self,offsetU);
+ self->getChild<LLSpinCtrl>("TexOffsetU")->forceSetValue(offsetU);
+ self->sendTextureInfo();
+}
+
+//static
+void LLPanelFace::syncOffsetY(LLPanelFace* self, F32 offsetV)
+{
+ LLSelectedTEMaterial::setNormalOffsetY(self,offsetV);
+ LLSelectedTEMaterial::setSpecularOffsetY(self,offsetV);
+ self->getChild<LLSpinCtrl>("TexOffsetV")->forceSetValue(offsetV);
+ self->sendTextureInfo();
+}
+
+//static
void LLPanelFace::onCommitMaterialBumpyOffsetX(LLUICtrl* ctrl, void* userdata)
{
LLPanelFace* self = (LLPanelFace*) userdata;
llassert_always(self);
- LLSelectedTEMaterial::setNormalOffsetX(self,self->getCurrentBumpyOffsetU());
+
+ if (gSavedSettings.getBOOL("SyncMaterialSettings"))
+ {
+ syncOffsetX(self,self->getCurrentBumpyOffsetU());
+ }
+ else
+ {
+ LLSelectedTEMaterial::setNormalOffsetX(self,self->getCurrentBumpyOffsetU());
+ }
+
}
//static
@@ -1875,7 +1904,15 @@ void LLPanelFace::onCommitMaterialBumpyOffsetY(LLUICtrl* ctrl, void* userdata)
{
LLPanelFace* self = (LLPanelFace*) userdata;
llassert_always(self);
- LLSelectedTEMaterial::setNormalOffsetY(self,self->getCurrentBumpyOffsetV());
+
+ if (gSavedSettings.getBOOL("SyncMaterialSettings"))
+ {
+ syncOffsetY(self,self->getCurrentBumpyOffsetV());
+ }
+ else
+ {
+ LLSelectedTEMaterial::setNormalOffsetY(self,self->getCurrentBumpyOffsetV());
+ }
}
//static
@@ -1883,7 +1920,15 @@ void LLPanelFace::onCommitMaterialShinyOffsetX(LLUICtrl* ctrl, void* userdata)
{
LLPanelFace* self = (LLPanelFace*) userdata;
llassert_always(self);
- LLSelectedTEMaterial::setSpecularOffsetX(self,self->getCurrentShinyOffsetU());
+
+ if (gSavedSettings.getBOOL("SyncMaterialSettings"))
+ {
+ syncOffsetX(self, self->getCurrentShinyOffsetU());
+ }
+ else
+ {
+ LLSelectedTEMaterial::setSpecularOffsetX(self,self->getCurrentShinyOffsetU());
+ }
}
//static
@@ -1891,7 +1936,31 @@ void LLPanelFace::onCommitMaterialShinyOffsetY(LLUICtrl* ctrl, void* userdata)
{
LLPanelFace* self = (LLPanelFace*) userdata;
llassert_always(self);
- LLSelectedTEMaterial::setSpecularOffsetY(self,self->getCurrentShinyOffsetV());
+
+ if (gSavedSettings.getBOOL("SyncMaterialSettings"))
+ {
+ syncOffsetY(self,self->getCurrentShinyOffsetV());
+ }
+ else
+ {
+ LLSelectedTEMaterial::setSpecularOffsetY(self,self->getCurrentShinyOffsetV());
+ }
+}
+
+//static
+void LLPanelFace::syncRepeatX(LLPanelFace* self, F32 scaleU)
+{
+ LLSelectedTEMaterial::setNormalRepeatX(self,scaleU);
+ LLSelectedTEMaterial::setSpecularRepeatX(self,scaleU);
+ self->sendTextureInfo();
+}
+
+//static
+void LLPanelFace::syncRepeatY(LLPanelFace* self, F32 scaleV)
+{
+ LLSelectedTEMaterial::setNormalRepeatY(self,scaleV);
+ LLSelectedTEMaterial::setSpecularRepeatY(self,scaleV);
+ self->sendTextureInfo();
}
//static
@@ -1904,7 +1973,16 @@ void LLPanelFace::onCommitMaterialBumpyScaleX(LLUICtrl* ctrl, void* userdata)
{
bumpy_scale_u *= 0.5f;
}
- LLSelectedTEMaterial::setNormalRepeatX(self,bumpy_scale_u);
+
+ if (gSavedSettings.getBOOL("SyncMaterialSettings"))
+ {
+ self->getChild<LLSpinCtrl>("TexScaleU")->forceSetValue(self->getCurrentBumpyScaleU());
+ syncRepeatX(self, bumpy_scale_u);
+ }
+ else
+ {
+ LLSelectedTEMaterial::setNormalRepeatX(self,bumpy_scale_u);
+ }
}
//static
@@ -1917,7 +1995,17 @@ void LLPanelFace::onCommitMaterialBumpyScaleY(LLUICtrl* ctrl, void* userdata)
{
bumpy_scale_v *= 0.5f;
}
- LLSelectedTEMaterial::setNormalRepeatY(self,bumpy_scale_v);
+
+
+ if (gSavedSettings.getBOOL("SyncMaterialSettings"))
+ {
+ self->getChild<LLSpinCtrl>("TexScaleV")->forceSetValue(self->getCurrentBumpyScaleV());
+ syncRepeatY(self, bumpy_scale_v);
+ }
+ else
+ {
+ LLSelectedTEMaterial::setNormalRepeatY(self,bumpy_scale_v);
+ }
}
//static
@@ -1930,7 +2018,16 @@ void LLPanelFace::onCommitMaterialShinyScaleX(LLUICtrl* ctrl, void* userdata)
{
shiny_scale_u *= 0.5f;
}
- LLSelectedTEMaterial::setSpecularRepeatX(self,shiny_scale_u);
+
+ if (gSavedSettings.getBOOL("SyncMaterialSettings"))
+ {
+ self->getChild<LLSpinCtrl>("TexScaleU")->forceSetValue(self->getCurrentShinyScaleU());
+ syncRepeatX(self, shiny_scale_u);
+ }
+ else
+ {
+ LLSelectedTEMaterial::setSpecularRepeatX(self,shiny_scale_u);
+ }
}
//static
@@ -1943,7 +2040,24 @@ void LLPanelFace::onCommitMaterialShinyScaleY(LLUICtrl* ctrl, void* userdata)
{
shiny_scale_v *= 0.5f;
}
- LLSelectedTEMaterial::setSpecularRepeatY(self,shiny_scale_v);
+
+ if (gSavedSettings.getBOOL("SyncMaterialSettings"))
+ {
+ self->getChild<LLSpinCtrl>("TexScaleV")->forceSetValue(self->getCurrentShinyScaleV());
+ syncRepeatY(self, shiny_scale_v);
+ }
+ else
+ {
+ LLSelectedTEMaterial::setSpecularRepeatY(self,shiny_scale_v);
+ }
+}
+
+//static
+void LLPanelFace::syncMaterialRot(LLPanelFace* self, F32 rot)
+{
+ LLSelectedTEMaterial::setNormalRotation(self,rot * DEG_TO_RAD);
+ LLSelectedTEMaterial::setSpecularRotation(self,rot * DEG_TO_RAD);
+ self->sendTextureInfo();
}
//static
@@ -1951,7 +2065,16 @@ void LLPanelFace::onCommitMaterialBumpyRot(LLUICtrl* ctrl, void* userdata)
{
LLPanelFace* self = (LLPanelFace*) userdata;
llassert_always(self);
- LLSelectedTEMaterial::setNormalRotation(self,self->getCurrentBumpyRot() * DEG_TO_RAD);
+
+ if (gSavedSettings.getBOOL("SyncMaterialSettings"))
+ {
+ self->getChild<LLSpinCtrl>("TexRot")->forceSetValue(self->getCurrentBumpyRot());
+ syncMaterialRot(self, self->getCurrentBumpyRot());
+ }
+ else
+ {
+ LLSelectedTEMaterial::setNormalRotation(self,self->getCurrentBumpyRot() * DEG_TO_RAD);
+ }
}
//static
@@ -1959,7 +2082,16 @@ void LLPanelFace::onCommitMaterialShinyRot(LLUICtrl* ctrl, void* userdata)
{
LLPanelFace* self = (LLPanelFace*) userdata;
llassert_always(self);
- LLSelectedTEMaterial::setSpecularRotation(self,self->getCurrentShinyRot() * DEG_TO_RAD);
+
+ if (gSavedSettings.getBOOL("SyncMaterialSettings"))
+ {
+ self->getChild<LLSpinCtrl>("TexRot")->forceSetValue(self->getCurrentShinyRot());
+ syncMaterialRot(self, self->getCurrentShinyRot());
+ }
+ else
+ {
+ LLSelectedTEMaterial::setSpecularRotation(self,self->getCurrentShinyRot() * DEG_TO_RAD);
+ }
}
//static
@@ -1994,6 +2126,92 @@ void LLPanelFace::onCommitTextureInfo( LLUICtrl* ctrl, void* userdata )
self->updateUI(true);
}
+// static
+void LLPanelFace::onCommitTextureScaleX( LLUICtrl* ctrl, void* userdata )
+{
+ LLPanelFace* self = (LLPanelFace*) userdata;
+ if (gSavedSettings.getBOOL("SyncMaterialSettings"))
+ {
+ F32 bumpy_scale_u = self->getChild<LLUICtrl>("TexScaleU")->getValue().asReal();
+ if (self->isIdenticalPlanarTexgen())
+ {
+ bumpy_scale_u *= 0.5f;
+ }
+ syncRepeatX(self, bumpy_scale_u);
+ }
+ else
+ {
+ self->sendTextureInfo();
+ }
+ self->updateUI(true);
+}
+
+// static
+void LLPanelFace::onCommitTextureScaleY( LLUICtrl* ctrl, void* userdata )
+{
+ LLPanelFace* self = (LLPanelFace*) userdata;
+ if (gSavedSettings.getBOOL("SyncMaterialSettings"))
+ {
+ F32 bumpy_scale_v = self->getChild<LLUICtrl>("TexScaleV")->getValue().asReal();
+ if (self->isIdenticalPlanarTexgen())
+ {
+ bumpy_scale_v *= 0.5f;
+ }
+ syncRepeatY(self, bumpy_scale_v);
+ }
+ else
+ {
+ self->sendTextureInfo();
+ }
+ self->updateUI(true);
+}
+
+// static
+void LLPanelFace::onCommitTextureRot( LLUICtrl* ctrl, void* userdata )
+{
+ LLPanelFace* self = (LLPanelFace*) userdata;
+
+ if (gSavedSettings.getBOOL("SyncMaterialSettings"))
+ {
+ syncMaterialRot(self, self->getChild<LLUICtrl>("TexRot")->getValue().asReal());
+ }
+ else
+ {
+ self->sendTextureInfo();
+ }
+ self->updateUI(true);
+}
+
+// static
+void LLPanelFace::onCommitTextureOffsetX( LLUICtrl* ctrl, void* userdata )
+{
+ LLPanelFace* self = (LLPanelFace*) userdata;
+ if (gSavedSettings.getBOOL("SyncMaterialSettings"))
+ {
+ syncOffsetX(self, self->getChild<LLUICtrl>("TexOffsetU")->getValue().asReal());
+ }
+ else
+ {
+ self->sendTextureInfo();
+ }
+ self->updateUI(true);
+}
+
+// static
+void LLPanelFace::onCommitTextureOffsetY( LLUICtrl* ctrl, void* userdata )
+{
+ LLPanelFace* self = (LLPanelFace*) userdata;
+ if (gSavedSettings.getBOOL("SyncMaterialSettings"))
+ {
+ syncOffsetY(self, self->getChild<LLUICtrl>("TexOffsetV")->getValue().asReal());
+ }
+ else
+ {
+ self->sendTextureInfo();
+ }
+ self->updateUI(true);
+}
+
// Commit the number of repeats per meter
// static
void LLPanelFace::onCommitRepeatsPerMeter(LLUICtrl* ctrl, void* userdata)
@@ -2017,44 +2235,62 @@ void LLPanelFace::onCommitRepeatsPerMeter(LLUICtrl* ctrl, void* userdata)
LLSelectedTE::getObjectScaleS(obj_scale_s, identical_scale_s);
LLSelectedTE::getObjectScaleS(obj_scale_t, identical_scale_t);
+
+ LLUICtrl* bumpy_scale_u = self->getChild<LLUICtrl>("bumpyScaleU");
+ LLUICtrl* bumpy_scale_v = self->getChild<LLUICtrl>("bumpyScaleV");
+ LLUICtrl* shiny_scale_u = self->getChild<LLUICtrl>("shinyScaleU");
+ LLUICtrl* shiny_scale_v = self->getChild<LLUICtrl>("shinyScaleV");
- switch (material_type)
+ if (gSavedSettings.getBOOL("SyncMaterialSettings"))
{
- case MATTYPE_DIFFUSE:
- {
- LLSelectMgr::getInstance()->selectionTexScaleAutofit( repeats_per_meter );
-}
- break;
+ LLSelectMgr::getInstance()->selectionTexScaleAutofit( repeats_per_meter );
- case MATTYPE_NORMAL:
- {
- LLUICtrl* bumpy_scale_u = self->getChild<LLUICtrl>("bumpyScaleU");
- LLUICtrl* bumpy_scale_v = self->getChild<LLUICtrl>("bumpyScaleV");
-
- bumpy_scale_u->setValue(obj_scale_s * repeats_per_meter);
- bumpy_scale_v->setValue(obj_scale_t * repeats_per_meter);
+ bumpy_scale_u->setValue(obj_scale_s * repeats_per_meter);
+ bumpy_scale_v->setValue(obj_scale_t * repeats_per_meter);
- LLSelectedTEMaterial::setNormalRepeatX(self,obj_scale_s * repeats_per_meter);
- LLSelectedTEMaterial::setNormalRepeatY(self,obj_scale_t * repeats_per_meter);
- }
- break;
+ LLSelectedTEMaterial::setNormalRepeatX(self,obj_scale_s * repeats_per_meter);
+ LLSelectedTEMaterial::setNormalRepeatY(self,obj_scale_t * repeats_per_meter);
- case MATTYPE_SPECULAR:
+ shiny_scale_u->setValue(obj_scale_s * repeats_per_meter);
+ shiny_scale_v->setValue(obj_scale_t * repeats_per_meter);
+
+ LLSelectedTEMaterial::setSpecularRepeatX(self,obj_scale_s * repeats_per_meter);
+ LLSelectedTEMaterial::setSpecularRepeatY(self,obj_scale_t * repeats_per_meter);
+ }
+ else
+ {
+ switch (material_type)
{
- LLUICtrl* shiny_scale_u = self->getChild<LLUICtrl>("shinyScaleU");
- LLUICtrl* shiny_scale_v = self->getChild<LLUICtrl>("shinyScaleV");
-
- shiny_scale_u->setValue(obj_scale_s * repeats_per_meter);
- shiny_scale_v->setValue(obj_scale_t * repeats_per_meter);
+ case MATTYPE_DIFFUSE:
+ {
+ LLSelectMgr::getInstance()->selectionTexScaleAutofit( repeats_per_meter );
+ }
+ break;
- LLSelectedTEMaterial::setSpecularRepeatX(self,obj_scale_s * repeats_per_meter);
- LLSelectedTEMaterial::setSpecularRepeatY(self,obj_scale_t * repeats_per_meter);
- }
- break;
+ case MATTYPE_NORMAL:
+ {
+ bumpy_scale_u->setValue(obj_scale_s * repeats_per_meter);
+ bumpy_scale_v->setValue(obj_scale_t * repeats_per_meter);
- default:
- llassert(false);
- break;
+ LLSelectedTEMaterial::setNormalRepeatX(self,obj_scale_s * repeats_per_meter);
+ LLSelectedTEMaterial::setNormalRepeatY(self,obj_scale_t * repeats_per_meter);
+ }
+ break;
+
+ case MATTYPE_SPECULAR:
+ {
+ shiny_scale_u->setValue(obj_scale_s * repeats_per_meter);
+ shiny_scale_v->setValue(obj_scale_t * repeats_per_meter);
+
+ LLSelectedTEMaterial::setSpecularRepeatX(self,obj_scale_s * repeats_per_meter);
+ LLSelectedTEMaterial::setSpecularRepeatY(self,obj_scale_t * repeats_per_meter);
+ }
+ break;
+
+ default:
+ llassert(false);
+ break;
+ }
}
// vertical scale and repeats per meter depends on each other, so force set on changes
self->updateUI(true);
diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h
index 078995e787..7c084cb0ab 100644
--- a/indra/newview/llpanelface.h
+++ b/indra/newview/llpanelface.h
@@ -162,7 +162,12 @@ protected:
// Callback funcs for individual controls
//
- static void onCommitTextureInfo( LLUICtrl* ctrl, void* userdata);
+ static void onCommitTextureInfo(LLUICtrl* ctrl, void* userdata);
+ static void onCommitTextureScaleX(LLUICtrl* ctrl, void* userdata);
+ static void onCommitTextureScaleY(LLUICtrl* ctrl, void* userdata);
+ static void onCommitTextureRot(LLUICtrl* ctrl, void* userdata);
+ static void onCommitTextureOffsetX(LLUICtrl* ctrl, void* userdata);
+ static void onCommitTextureOffsetY(LLUICtrl* ctrl, void* userdata);
static void onCommitMaterialBumpyScaleX( LLUICtrl* ctrl, void* userdata);
static void onCommitMaterialBumpyScaleY( LLUICtrl* ctrl, void* userdata);
@@ -170,6 +175,12 @@ protected:
static void onCommitMaterialBumpyOffsetX( LLUICtrl* ctrl, void* userdata);
static void onCommitMaterialBumpyOffsetY( LLUICtrl* ctrl, void* userdata);
+ static void syncRepeatX(LLPanelFace* self, F32 scaleU);
+ static void syncRepeatY(LLPanelFace* self, F32 scaleV);
+ static void syncOffsetX(LLPanelFace* self, F32 offsetU);
+ static void syncOffsetY(LLPanelFace* self, F32 offsetV);
+ static void syncMaterialRot(LLPanelFace* self, F32 rot);
+
static void onCommitMaterialShinyScaleX( LLUICtrl* ctrl, void* userdata);
static void onCommitMaterialShinyScaleY( LLUICtrl* ctrl, void* userdata);
static void onCommitMaterialShinyRot( LLUICtrl* ctrl, void* userdata);
diff --git a/indra/newview/skins/default/xui/en/panel_tools_texture.xml b/indra/newview/skins/default/xui/en/panel_tools_texture.xml
index b7b67147eb..ffdbc5d227 100644
--- a/indra/newview/skins/default/xui/en/panel_tools_texture.xml
+++ b/indra/newview/skins/default/xui/en/panel_tools_texture.xml
@@ -148,6 +148,18 @@
top_pad="1"
value="2"/>
</radio_group>
+ <check_box
+ control_name="SyncMaterialSettings"
+ follows="top|left"
+ height="20"
+ initial_value="false"
+ label="Lock repeat"
+ layout="topleft"
+ left="8"
+ name="checkbox_sync_settings"
+ tool_tip="Adjust all maps repeats simultaneously"
+ top_pad="-16"
+ width="160" />
<texture_picker
can_apply_immediately="true"
default_image_name="Default"
@@ -159,7 +171,7 @@
left="10"
name="texture control"
tool_tip="Click to choose a picture"
- top_pad="7"
+ top_pad="5"
width="64" />
<text
type="string"