diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-08-29 15:43:02 +0300 |
---|---|---|
committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-08-29 15:43:02 +0300 |
commit | e439f0366fffe336ad42c09596427ef35596992c (patch) | |
tree | 5f998d175b411c76691388f1909dd5ebda0cc202 /indra/newview/llpanelface.cpp | |
parent | d13b4d18030ec5748adf7960a3a5ce367440f96e (diff) | |
parent | 5986bf4826d04027a17a098d1b80064aabde5a7b (diff) |
Merge from lindenlab/viewer-release
Diffstat (limited to 'indra/newview/llpanelface.cpp')
-rw-r--r-- | indra/newview/llpanelface.cpp | 75 |
1 files changed, 59 insertions, 16 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 93c81889de..5742b5ad1a 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1014,43 +1014,77 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) } updateAlphaControls(); - - if(texture_ctrl) + + if (texture_ctrl) { if (identical_diffuse) { - texture_ctrl->setTentative( FALSE ); - texture_ctrl->setEnabled( editable ); - texture_ctrl->setImageAssetID( id ); + texture_ctrl->setTentative(FALSE); + texture_ctrl->setEnabled(editable); + texture_ctrl->setImageAssetID(id); getChildView("combobox alphamode")->setEnabled(editable && mIsAlpha && transparency <= 0.f); getChildView("label alphamode")->setEnabled(editable && mIsAlpha); getChildView("maskcutoff")->setEnabled(editable && mIsAlpha); getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha); + + bool allAttachments = true; + for (LLObjectSelection::iterator iter = LLSelectMgr::getInstance()->getSelection()->begin(); + iter != LLSelectMgr::getInstance()->getSelection()->end();iter++) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + if (!object->isAttachment()) + { + allAttachments = false; + break; + } + } + + texture_ctrl->setBakeTextureEnabled(allAttachments); + } else if (id.isNull()) { // None selected - texture_ctrl->setTentative( FALSE ); - texture_ctrl->setEnabled( FALSE ); - texture_ctrl->setImageAssetID( LLUUID::null ); - getChildView("combobox alphamode")->setEnabled( FALSE ); - getChildView("label alphamode")->setEnabled( FALSE ); - getChildView("maskcutoff")->setEnabled( FALSE); - getChildView("label maskcutoff")->setEnabled( FALSE ); + texture_ctrl->setTentative(FALSE); + texture_ctrl->setEnabled(FALSE); + texture_ctrl->setImageAssetID(LLUUID::null); + getChildView("combobox alphamode")->setEnabled(FALSE); + getChildView("label alphamode")->setEnabled(FALSE); + getChildView("maskcutoff")->setEnabled(FALSE); + getChildView("label maskcutoff")->setEnabled(FALSE); + + texture_ctrl->setBakeTextureEnabled(false); } else { // Tentative: multiple selected with different textures - texture_ctrl->setTentative( TRUE ); - texture_ctrl->setEnabled( editable ); - texture_ctrl->setImageAssetID( id ); + texture_ctrl->setTentative(TRUE); + texture_ctrl->setEnabled(editable); + texture_ctrl->setImageAssetID(id); getChildView("combobox alphamode")->setEnabled(editable && mIsAlpha && transparency <= 0.f); getChildView("label alphamode")->setEnabled(editable && mIsAlpha); getChildView("maskcutoff")->setEnabled(editable && mIsAlpha); getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha); + + bool allAttachments = true; + for (LLObjectSelection::iterator iter = LLSelectMgr::getInstance()->getSelection()->begin(); + iter != LLSelectMgr::getInstance()->getSelection()->end();iter++) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + if (!object->isAttachment()) + { + allAttachments = false; + break; } } + texture_ctrl->setBakeTextureEnabled(allAttachments); + } + + } + if (shinytexture_ctrl) { shinytexture_ctrl->setTentative( !identical_spec ); @@ -2640,6 +2674,16 @@ void LLPanelFace::LLSelectedTE::getTexId(LLUUID& id, bool& identical) { LLUUID get(LLViewerObject* object, S32 te_index) { + LLTextureEntry *te = object->getTE(te_index); + if (te) + { + if ((te->getID() == IMG_USE_BAKED_EYES) || (te->getID() == IMG_USE_BAKED_HAIR) || (te->getID() == IMG_USE_BAKED_HEAD) || (te->getID() == IMG_USE_BAKED_LOWER) || (te->getID() == IMG_USE_BAKED_SKIRT) || (te->getID() == IMG_USE_BAKED_UPPER) + || (te->getID() == IMG_USE_BAKED_LEFTARM) || (te->getID() == IMG_USE_BAKED_LEFTLEG) || (te->getID() == IMG_USE_BAKED_AUX1) || (te->getID() == IMG_USE_BAKED_AUX2) || (te->getID() == IMG_USE_BAKED_AUX3)) + { + return te->getID(); + } + } + LLUUID id; LLViewerTexture* image = object->getTEImage(te_index); if (image) @@ -2649,7 +2693,6 @@ void LLPanelFace::LLSelectedTE::getTexId(LLUUID& id, bool& identical) if (!id.isNull() && LLViewerMedia::getInstance()->textureHasMedia(id)) { - LLTextureEntry *te = object->getTE(te_index); if (te) { LLViewerTexture* tex = te->getID().notNull() ? gTextureList.findImage(te->getID(), TEX_LIST_STANDARD) : NULL; |