diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-01-04 13:23:47 +0200 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-01-04 13:31:27 +0200 |
commit | 3290f16f29e503115b7eaeb2005cfdbba42668dd (patch) | |
tree | 571f47e765ebb3ca8ec922bdd0bff0c64b195fd8 /indra/newview | |
parent | 81a4c7598d5971b46826e37a0237a659b8895822 (diff) |
SL-18854 Fix drag'n drop of plain textures on faces in PBR mode
When in PBR 'mode', defaulted texture drops to diffuse channel
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llpanelface.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llpanelface.h | 1 | ||||
-rw-r--r-- | indra/newview/llselectmgr.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llselectmgr.h | 5 | ||||
-rw-r--r-- | indra/newview/lltooldraganddrop.cpp | 2 |
5 files changed, 13 insertions, 13 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 8848accab0..0b18bdc6e6 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -193,8 +193,6 @@ std::string USE_TEXTURE; LLRender::eTexIndex LLPanelFace::getTextureChannelToEdit() { - - LLRender::eTexIndex channel_to_edit = LLRender::DIFFUSE_MAP; if (mComboMatMedia) { @@ -216,6 +214,17 @@ LLRender::eTexIndex LLPanelFace::getTextureChannelToEdit() return channel_to_edit; } +LLRender::eTexIndex LLPanelFace::getTextureDropChannel() +{ + if (mComboMatMedia && mComboMatMedia->getCurrentIndex() == MATMEDIA_MATERIAL) + { + LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_material_type"); + return LLRender::eTexIndex(radio_mat_type->getSelectedIndex()); + } + + return LLRender::eTexIndex(MATTYPE_DIFFUSE); +} + // Things the UI provides... // LLUUID LLPanelFace::getCurrentNormalMap() { return getChild<LLTextureCtrl>("bumpytexture control")->getImageAssetID(); } @@ -1560,7 +1569,6 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) enabled = editable && has_pbr_material; material_type = radio_pbr_type->getSelectedIndex(); } - LLSelectMgr::getInstance()->setTextureChannel(LLRender::eTexIndex(material_type)); switch (material_type) { diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index c0afc79cbe..707d693672 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -119,6 +119,7 @@ public: } LLRender::eTexIndex getTextureChannelToEdit(); + LLRender::eTexIndex getTextureDropChannel(); protected: void navigateToTitleMedia(const std::string url); diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index dbc3fe0ce5..4a69eba4d3 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -1039,10 +1039,6 @@ void LLSelectMgr::addAsIndividual(LLViewerObject *objectp, S32 face, BOOL undoab // check to see if object is already in list LLSelectNode *nodep = mSelectedObjects->findNode(objectp); - // Reset (in anticipation of being set to an appropriate value by panel refresh, if they're up) - // - setTextureChannel(LLRender::DIFFUSE_MAP); - // if not in list, add it if (!nodep) { diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 64b87b7c86..3ee78f9a58 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -619,11 +619,6 @@ public: void saveSelectedShinyColors(); void saveSelectedObjectTextures(); - // Sets which texture channel to query for scale and rot of display - // and depends on UI state of LLPanelFace when editing - void setTextureChannel(LLRender::eTexIndex texIndex) { mTextureChannel = texIndex; } - LLRender::eTexIndex getTextureChannel() { return mTextureChannel; } - void selectionUpdatePhysics(BOOL use_physics); void selectionUpdateTemporary(BOOL is_temporary); void selectionUpdatePhantom(BOOL is_ghost); diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 5c4f7f75bf..cde33a5f96 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -1202,7 +1202,7 @@ void LLToolDragAndDrop::dropTextureOneFace(LLViewerObject* hit_obj, if (gFloaterTools->getVisible() && panel_face) { - tex_channel = (tex_channel > -1) ? tex_channel : LLSelectMgr::getInstance()->getTextureChannel(); + tex_channel = (tex_channel > -1) ? tex_channel : panel_face->getTextureDropChannel(); switch (tex_channel) { |