From 6d0fcc0e616ff58f4a83bc3730374c5509ee959a Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 28 Oct 2022 19:58:27 +0300 Subject: SL-17699 Blank material Id for material picker --- indra/newview/lltexturectrl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/lltexturectrl.cpp') diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index ebb7ee609c..07e09ec038 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -700,8 +700,9 @@ void LLFloaterTexturePicker::onBtnBlank(void* userdata) void LLFloaterTexturePicker::onBtnNone(void* userdata) { LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; + self->setCanApply(true, true); self->setImageID( LLUUID::null ); - self->commitCancel(); + self->commitIfImmediateSet(); } /* -- cgit v1.2.3 From c61224bef22686c4e6f5b4a6af9acbeb27d561ab Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 29 Oct 2022 00:27:47 +0300 Subject: SL-17699 Hide pipette for material picker At the moment there is no specification how it should work, it can't work like it does for textures due to material overrides. Also removed some dead code --- indra/newview/lltexturectrl.cpp | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) (limited to 'indra/newview/lltexturectrl.cpp') diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 07e09ec038..7aa3639df7 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -479,7 +479,6 @@ BOOL LLFloaterTexturePicker::postBuild() LLToolPipette::getInstance()->setToolSelectCallback(boost::bind(&LLFloaterTexturePicker::onTextureSelect, this, _1)); getChild("l_bake_use_texture_combo_box")->setCommitCallback(onBakeTextureSelect, this); - getChild("hide_base_mesh_region")->setCommitCallback(onHideBaseMeshRegionCheck, this); setBakeTextureEnabled(TRUE); return TRUE; @@ -822,7 +821,6 @@ void LLFloaterTexturePicker::onModeSelect(LLUICtrl* ctrl, void *userdata) self->getChild("Default")->setVisible(index == 0 ? TRUE : FALSE); self->getChild("Blank")->setVisible(index == 0 ? TRUE : FALSE); self->getChild("None")->setVisible(index == 0 ? TRUE : FALSE); - self->getChild("Pipette")->setVisible(index == 0 ? TRUE : FALSE); self->getChild("inventory search editor")->setVisible(index == 0 ? TRUE : FALSE); self->getChild("inventory panel")->setVisible(index == 0 ? TRUE : FALSE); @@ -832,7 +830,10 @@ void LLFloaterTexturePicker::onModeSelect(LLUICtrl* ctrl, void *userdata) self->getChild("l_name_list")->setVisible(index == 1 ? TRUE : FALSE); self->getChild("l_bake_use_texture_combo_box")->setVisible(index == 2 ? TRUE : FALSE); - self->getChild("hide_base_mesh_region")->setVisible(FALSE);// index == 2 ? TRUE : FALSE); + + bool pipette_visible = (index == 0) + && (self->mInventoryPickType != LLTextureCtrl::PICK_MATERIAL); + self->getChild("Pipette")->setVisible(pipette_visible); if (index == 2) { @@ -1111,13 +1112,6 @@ void LLFloaterTexturePicker::onBakeTextureSelect(LLUICtrl* ctrl, void *user_data } } -//static -void LLFloaterTexturePicker::onHideBaseMeshRegionCheck(LLUICtrl* ctrl, void *user_data) -{ - //LLFloaterTexturePicker* picker = (LLFloaterTexturePicker*)user_data; - //LLCheckBoxCtrl* check_box = (LLCheckBoxCtrl*)ctrl; -} - void LLFloaterTexturePicker::updateFilterPermMask() { //mInventoryPanel->setFilterPermMask( getFilterPermMask() ); Commented out due to no-copy texture loss. @@ -1242,6 +1236,16 @@ void LLFloaterTexturePicker::setInventoryPickType(LLTextureCtrl::EPickInventoryT mInventoryPickType = type; refreshLocalList(); refreshInventoryFilter(); + + if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL) + { + getChild("Pipette")->setVisible(false); + } + else + { + S32 index = mModeSelector->getValue().asInteger(); + getChild("Pipette")->setVisible(index == 0); + } } void LLFloaterTexturePicker::onPickerCallback(const std::vector& filenames, LLHandle handle) @@ -1292,7 +1296,17 @@ void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te ) if (inventory_item_id.notNull()) { LLToolPipette::getInstance()->setResult(TRUE, ""); - setImageID(te.getID()); + if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL) + { + // tes have no data about material ids + // Plus gltf materials are layered with overrides, + // which mean that end result might have no id. + LL_WARNS() << "tes have no data about material ids" << LL_ENDL; + } + else + { + setImageID(te.getID()); + } mNoCopyTextureSelected = FALSE; LLInventoryItem* itemp = gInventory.getItem(inventory_item_id); -- cgit v1.2.3