summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelface.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-10-29 01:27:35 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-10-29 02:52:56 +0300
commitb6a35e36d71b421e8f74e5b5e3f0909c8fcda930 (patch)
tree570f1dd6a532863e0e5f9e5cfe2e3815459d5cfa /indra/newview/llpanelface.cpp
parent105f50478c84b0c14243da3d49479c65ec6ee040 (diff)
SL-18448 Material Editor and Tools floater adjustments
1. Enable glow 2. Added buttons to texture->pbr
Diffstat (limited to 'indra/newview/llpanelface.cpp')
-rw-r--r--indra/newview/llpanelface.cpp39
1 files changed, 23 insertions, 16 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index 6d8d19c57c..f884cfe842 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -201,6 +201,8 @@ BOOL LLPanelFace::postBuild()
childSetAction("button align",&LLPanelFace::onClickAutoFix,this);
childSetAction("button align textures", &LLPanelFace::onAlignTexture, this);
+ childSetAction("pbr_from_inventory", &LLPanelFace::onClickBtnLoadInvPBR, this);
+ childSetAction("edit_selected_pbr", &LLPanelFace::onClickBtnEditPBR, this);
LLTextureCtrl* mTextureCtrl;
LLTextureCtrl* mShinyTextureCtrl;
@@ -237,9 +239,6 @@ BOOL LLPanelFace::postBuild()
pbr_ctrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER);
pbr_ctrl->setBakeTextureEnabled(false);
pbr_ctrl->setInventoryPickType(LLTextureCtrl::PICK_MATERIAL);
-
- // TODO - design real UI for activating live editing
- pbr_ctrl->setRightMouseUpCallback(boost::bind(&LLPanelFace::onPbrStartEditing, this));
}
mTextureCtrl = getChild<LLTextureCtrl>("texture control");
@@ -968,6 +967,8 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
pbr_ctrl->setImageAssetID(pbr_id);
has_pbr_material = pbr_id.notNull();
}
+ getChildView("pbr_from_inventory")->setEnabled(editable);
+ getChildView("edit_selected_pbr")->setEnabled(editable && has_pbr_material);
LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("texture control");
LLTextureCtrl* shinytexture_ctrl = getChild<LLTextureCtrl>("shinytexture control");
@@ -1469,8 +1470,8 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
LLSelectedTE::getGlow(glow,identical_glow);
getChild<LLUICtrl>("glow")->setValue(glow);
getChild<LLUICtrl>("glow")->setTentative(!identical_glow);
- getChildView("glow")->setEnabled(editable && !has_pbr_material);
- getChildView("glow label")->setEnabled(editable && !has_pbr_material);
+ getChildView("glow")->setEnabled(editable);
+ getChildView("glow label")->setEnabled(editable);
}
{
@@ -1746,6 +1747,8 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
getChildView("label shininess")->setEnabled(FALSE);
getChildView("label bumpiness")->setEnabled(FALSE);
getChildView("button align")->setEnabled(FALSE);
+ getChildView("pbr_from_inventory")->setEnabled(FALSE);
+ getChildView("edit_selected_pbr")->setEnabled(FALSE);
//getChildView("has media")->setEnabled(FALSE);
//getChildView("media info set")->setEnabled(FALSE);
@@ -2677,6 +2680,8 @@ void LLPanelFace::updateVisibility()
// PBR controls
getChildView("pbr_control")->setVisible(show_pbr);
+ getChildView("pbr_from_inventory")->setVisible(show_pbr);
+ getChildView("edit_selected_pbr")->setVisible(show_pbr);
}
// static
@@ -3651,6 +3656,19 @@ void LLPanelFace::onAlignTexture(void* userdata)
self->alignTestureLayer();
}
+void LLPanelFace::onClickBtnLoadInvPBR(void* userdata)
+{
+ // Shouldn't this be "save to inventory?"
+ LLPanelFace* self = (LLPanelFace*)userdata;
+ LLTextureCtrl* pbr_ctrl = self->findChild<LLTextureCtrl>("pbr_control");
+ pbr_ctrl->showPicker(true);
+}
+
+void LLPanelFace::onClickBtnEditPBR(void* userdata)
+{
+ LLMaterialEditor::loadLive();
+}
+
enum EPasteMode
{
PASTE_COLOR,
@@ -4580,17 +4598,6 @@ void LLPanelFace::onPbrSelectionChanged(LLInventoryItem* itemp)
}
}
-void LLPanelFace::onPbrStartEditing()
-{
- bool identical;
- LLUUID material_id;
- LLSelectedTE::getPbrMaterialId(material_id, identical);
-
- LL_DEBUGS() << "loading material live editor with asset " << material_id << LL_ENDL;
-
- LLMaterialEditor::loadLive();
-}
-
bool LLPanelFace::isIdenticalPlanarTexgen()
{
LLTextureEntry::e_texgen selected_texgen = LLTextureEntry::TEX_GEN_DEFAULT;