diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-10-29 01:27:35 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-10-29 02:52:56 +0300 |
commit | b6a35e36d71b421e8f74e5b5e3f0909c8fcda930 (patch) | |
tree | 570f1dd6a532863e0e5f9e5cfe2e3815459d5cfa /indra | |
parent | 105f50478c84b0c14243da3d49479c65ec6ee040 (diff) |
SL-18448 Material Editor and Tools floater adjustments
1. Enable glow
2. Added buttons to texture->pbr
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llpanelface.cpp | 39 | ||||
-rw-r--r-- | indra/newview/llpanelface.h | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_tools_texture.xml | 38 |
3 files changed, 53 insertions, 27 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; diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index cc46116545..38d81e44ba 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -228,6 +228,8 @@ protected: static void onCommitRepeatsPerMeter( LLUICtrl* ctrl, void* userinfo); static void onClickAutoFix(void*); static void onAlignTexture(void*); + static void onClickBtnLoadInvPBR(void* userdata); + static void onClickBtnEditPBR(void* userdata); public: // needs to be accessible to selection manager void onCopyColor(); // records all selected faces @@ -438,7 +440,6 @@ private: */ void onTextureSelectionChanged(LLInventoryItem* itemp); void onPbrSelectionChanged(LLInventoryItem* itemp); - void onPbrStartEditing(); LLMenuButton* mMenuClipboardColor; LLMenuButton* mMenuClipboardTexture; 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 ff2323784c..e2d571324f 100644 --- a/indra/newview/skins/default/xui/en/panel_tools_texture.xml +++ b/indra/newview/skins/default/xui/en/panel_tools_texture.xml @@ -239,28 +239,46 @@ width="160" /> <texture_picker can_apply_immediately="true" - default_image_name="Default" - fallback_image="materials_ui_x_24.png" + allow_no_texture="true" follows="left|top" height="80" - label="Texture " + label="PBR " layout="topleft" left="10" - name="texture control" - tool_tip="Click to choose a picture" + name="pbr_control" + tool_tip="Click to choose a pbr material" top_pad="5" width="64" /> + <button + follows="left|top" + height="23" + layout="topleft" + left_pad="10" + top_delta="0" + name="pbr_from_inventory" + label="Choose from inventory" + width="140"/> + <button + follows="left|top" + height="23" + layout="topleft" + left_delta="0" + top_pad="4" + name="edit_selected_pbr" + label="Edit Selected" + width="140"/> <texture_picker can_apply_immediately="true" - allow_no_texture="true" + default_image_name="Default" + fallback_image="materials_ui_x_24.png" follows="left|top" height="80" - label="PBR " + label="Texture " layout="topleft" left="10" - name="pbr_control" - tool_tip="Click to choose a pbr material" - top_delta="0" + name="texture control" + tool_tip="Click to choose a picture" + top_delta="-27" width="64" /> <text type="string" |