SL-18854 Fix drag'n drop of plain textures on faces in PBR mode

When in PBR 'mode', defaulted texture drops to diffuse channel
master
Andrey Kleshchev 2023-01-04 13:23:47 +02:00
parent 81a4c7598d
commit 3290f16f29
5 changed files with 13 additions and 13 deletions

View File

@ -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)
{

View File

@ -119,6 +119,7 @@ public:
}
LLRender::eTexIndex getTextureChannelToEdit();
LLRender::eTexIndex getTextureDropChannel();
protected:
void navigateToTitleMedia(const std::string url);

View File

@ -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)
{

View File

@ -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);

View File

@ -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)
{