summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelface.cpp')
-rwxr-xr-xindra/newview/llpanelface.cpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index 911af9df04..3869219da6 100755
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -66,7 +66,7 @@
#include "llvovolume.h"
#include "lluictrlfactory.h"
#include "llpluginclassmedia.h"
-#include "llviewertexturelist.h"
+#include "llviewertexturelist.h"// Update sel manager as to which channel we're editing so it can reflect the correct overlay UI
//
// Constant definitions for comboboxes
@@ -89,6 +89,19 @@ const S32 SHINY_TEXTURE = 4; // use supplied specular map
//
std::string USE_TEXTURE;
+LLRender::eTexIndex LLPanelFace::getTextureChannelToEdit()
+{
+ LLComboBox* combobox_matmedia = getChild<LLComboBox>("combobox matmedia");
+ LLComboBox* combobox_mattype = getChild<LLComboBox>("combobox mattype");
+
+ LLRender::eTexIndex channel_to_edit = (combobox_matmedia && combobox_matmedia->getCurrentIndex() == MATMEDIA_MATERIAL) ?
+ (combobox_mattype ? (LLRender::eTexIndex)combobox_mattype->getCurrentIndex() : LLRender::DIFFUSE_MAP) : LLRender::DIFFUSE_MAP;
+
+ channel_to_edit = (channel_to_edit == LLRender::NORMAL_MAP) ? (getCurrentNormalMap().isNull() ? LLRender::DIFFUSE_MAP : channel_to_edit) : channel_to_edit;
+ channel_to_edit = (channel_to_edit == LLRender::SPECULAR_MAP) ? (getCurrentSpecularMap().isNull() ? LLRender::DIFFUSE_MAP : channel_to_edit) : channel_to_edit;
+ return channel_to_edit;
+}
+
// Things the UI provides...
//
LLUUID LLPanelFace::getCurrentNormalMap() { return getChild<LLTextureCtrl>("bumpytexture control")->getImageAssetID(); }
@@ -1194,7 +1207,8 @@ void LLPanelFace::updateUI()
getChildView("checkbox fullbright")->setEnabled(editable);
getChild<LLUICtrl>("checkbox fullbright")->setTentative(!identical_fullbright);
}
-
+
+
// Repeats per meter
{
F32 repeats_diff = 1.f;
@@ -1218,6 +1232,9 @@ void LLPanelFace::updateUI()
F32 repeats = 1.0f;
U32 material_type = (combobox_matmedia->getCurrentIndex() == MATMEDIA_MATERIAL) ? combobox_mattype->getCurrentIndex() : MATTYPE_DIFFUSE;
+
+ LLSelectMgr::getInstance()->setTextureChannel(LLRender::eTexIndex(material_type));
+
switch (material_type)
{
default:
@@ -1328,18 +1345,6 @@ void LLPanelFace::updateUI()
getChild<LLColorSwatchCtrl>("shinycolorswatch")->set(material->getSpecularLightColor(),TRUE);
}
- // Update sel manager as to which channel we're editing so it can reflect the correct overlay UI
- // NORSPEC-103
- LLRender::eTexIndex channel_to_edit = (combobox_matmedia->getCurrentIndex() == MATMEDIA_MATERIAL) ? (LLRender::eTexIndex)combobox_mattype->getCurrentIndex() : LLRender::DIFFUSE_MAP;
-
- if ( ((channel_to_edit == LLRender::NORMAL_MAP) && material->getNormalID().isNull())
- ||((channel_to_edit == LLRender::SPECULAR_MAP) && material->getSpecularID().isNull()))
- {
- channel_to_edit = LLRender::DIFFUSE_MAP;
- }
-
- LLSelectMgr::getInstance()->setTextureChannel(channel_to_edit);
-
// Bumpy (normal)
texture_ctrl = getChild<LLTextureCtrl>("bumpytexture control");
texture_ctrl->setImageAssetID(material->getNormalID());
@@ -1365,10 +1370,6 @@ void LLPanelFace::updateUI()
updateBumpyControls(!material->getNormalID().isNull(), true);
}
}
- else
- {
- LLSelectMgr::getInstance()->setTextureChannel(LLRender::DIFFUSE_MAP);
- }
}
// Set variable values for numeric expressions