From bfbcd6d16931819c43eea8e83963c9f86c6892dd Mon Sep 17 00:00:00 2001 From: Anchor Linden Date: Wed, 28 Feb 2018 22:14:38 -0800 Subject: [MAINT-8081] - bakes on mesh. 1st pass. changed texture panel to select bakes on objects. handle magic bake ids in LLViewerObject. --- indra/newview/llvoavatar.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index eae8f2cc56..af98f78d0d 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2224,6 +2224,8 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU { result->setIsMissingAsset(false); } + + result->setBakedTextureIndex(te); } return result; } @@ -7413,6 +7415,9 @@ void LLVOAvatar::updateMeshTextures() removeMissingBakedTextures(); // May call back into this function if anything is removed call_remove_missing = true; } + + + } // virtual @@ -8189,6 +8194,45 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte } updateMeshTextures(); + + //refresh bakes on any attached objects + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); + ++iter) + { + LLViewerJointAttachment* attachment = iter->second; + + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) + { + LLViewerObject* attached_object = (*attachment_iter); + + const U32 MAX_TES = 32; + + S32 last_face_index = llmin((U32)attached_object->getNumTEs(), MAX_TES) - 1; + + if (last_face_index > -1) + { + S8 face_index; + for (face_index = 0; face_index <= last_face_index; face_index++) + { + LLViewerTexture* viewer_texture = attached_object->getTEImage((U8)face_index); + + if (viewer_texture && ( (viewer_texture->getType() == LLViewerTexture::FETCHED_TEXTURE) || (viewer_texture->getType() == LLViewerTexture::LOD_TEXTURE) )) + { + LLViewerFetchedTexture* fetched_texture = dynamic_cast(viewer_texture); + if (fetched_texture->getFTType() == FTT_SERVER_BAKE) + { + const LLUUID new_id = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::localTextureIndexToMagicId((LLAvatarAppearanceDefines::ETextureIndex)fetched_texture->getBakedTextureIndex()); + attached_object->setTETexture(face_index, new_id); + } + + } + } + } + } + } } // static -- cgit v1.3 From 8f64a9edea9d4230cdc845c126955e23990823cb Mon Sep 17 00:00:00 2001 From: Anchor Linden Date: Fri, 2 Mar 2018 02:25:59 -0800 Subject: [MAINT 8081] - show/hide avatar base mesh regions if avatar joint attachments are using server bakes. pass the magic ids correctly across ui and texture entry. --- indra/newview/llpanelface.cpp | 65 ++++++++++++++++--------- indra/newview/llselectmgr.cpp | 18 +++++++ indra/newview/lltexturectrl.cpp | 86 +++++++++++++++++++++++++++++++-- indra/newview/lltexturectrl.h | 5 ++ indra/newview/llviewerobject.cpp | 100 ++++----------------------------------- indra/newview/llviewerobject.h | 5 +- indra/newview/llviewertexture.h | 5 -- indra/newview/llvoavatar.cpp | 93 +++++++++++++++++++++++++++++++----- indra/newview/llvoavatar.h | 2 + 9 files changed, 242 insertions(+), 137 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 7e75dca908..363fe3da04 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -867,41 +867,52 @@ 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); - } - else if (id.isNull()) + + if (LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1) { - // 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->setBakeTextureEnabled(objectp->isAttachment()); } - else - { - // Tentative: multiple selected with different textures - texture_ctrl->setTentative( TRUE ); - texture_ctrl->setEnabled( editable ); - texture_ctrl->setImageAssetID( id ); + } + 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); + } + else + { + // Tentative: multiple selected with different textures + 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); + + if (LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1) + { + texture_ctrl->setBakeTextureEnabled(objectp->isAttachment()); + } } + } if (shinytexture_ctrl) @@ -2467,6 +2478,15 @@ 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)) + { + return te->getID(); + } + } + LLUUID id; LLViewerTexture* image = object->getTEImage(te_index); if (image) @@ -2476,7 +2496,6 @@ void LLPanelFace::LLSelectedTE::getTexId(LLUUID& id, bool& identical) if (!id.isNull() && LLViewerMedia::textureHasMedia(id)) { - LLTextureEntry *te = object->getTE(te_index); if (te) { LLViewerTexture* tex = te->getID().notNull() ? gTextureList.findImage(te->getID(), TEX_LIST_STANDARD) : NULL; diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index c44aca6fa5..7b7b81f3e4 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -1647,6 +1647,15 @@ void LLSelectMgr::selectionSetImage(const LLUUID& imageid) // * Can just apply the texture and be done with it. objectp->setTEImage(te, LLViewerTextureManager::getFetchedTexture(mImageID, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); } + + if (objectp->isAttachment()) + { + LLVOAvatar* avatar = objectp->getAvatar(); + if (avatar) + { + avatar->updateMeshVisibility(); + } + } return true; } }; @@ -1846,6 +1855,15 @@ BOOL LLSelectMgr::selectionRevertTextures() else { object->setTEImage(te, LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); + + if (object->isAttachment()) + { + LLVOAvatar* avatar = object->getAvatar(); + if (avatar) + { + avatar->updateMeshVisibility(); + } + } } } } diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 854d328c71..0aeea15b97 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -32,6 +32,7 @@ #include "llrender.h" #include "llagent.h" #include "llviewertexturelist.h" +#include "llselectmgr.h" #include "llcheckboxctrl.h" #include "llcombobox.h" #include "llbutton.h" @@ -406,8 +407,8 @@ BOOL LLFloaterTexturePicker::postBuild() getChild("l_bake_use_texture_combo_box")->setCommitCallback(onBakeTextureSelect, this); getChild("hide_base_mesh_region")->setCommitCallback(onHideBaseMeshRegionCheck, this); - + setBakeTextureEnabled(FALSE); return TRUE; } @@ -482,7 +483,24 @@ void LLFloaterTexturePicker::draw() mTexturep = NULL; if(mImageAssetID.notNull()) { - mTexturep = LLViewerTextureManager::getFetchedTexture(mImageAssetID); + LLPointer texture = NULL; + + if ((mImageAssetID == IMG_USE_BAKED_EYES) || (mImageAssetID == IMG_USE_BAKED_HAIR) || (mImageAssetID == IMG_USE_BAKED_HEAD) || (mImageAssetID == IMG_USE_BAKED_LOWER) || (mImageAssetID == IMG_USE_BAKED_SKIRT) || (mImageAssetID == IMG_USE_BAKED_UPPER)) + { + if (LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1) + { + LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); + LLViewerTexture* viewerTexture = obj->getBakedTextureForMagicId(mImageAssetID); + texture = viewerTexture ? dynamic_cast(viewerTexture) : NULL; + } + } + + if (texture.isNull()) + { + texture = LLViewerTextureManager::getFetchedTexture(mImageAssetID); + } + + mTexturep = texture; mTexturep->setBoostLevel(LLGLTexture::BOOST_PREVIEW); } @@ -783,6 +801,39 @@ void LLFloaterTexturePicker::onModeSelect(LLUICtrl* ctrl, void *userdata) self->getChild("l_bake_use_texture_combo_box")->setVisible(mode == 2); self->getChild("hide_base_mesh_region")->setVisible(false);// mode == 2); + + if (mode == 2) + { + S8 val = -1; + + LLUUID imageID = self->mImageAssetID; + if (imageID == IMG_USE_BAKED_HEAD) + { + val = 0; + } + else if (imageID == IMG_USE_BAKED_UPPER) + { + val = 1; + } + else if (imageID == IMG_USE_BAKED_LOWER) + { + val = 2; + } + else if (imageID == IMG_USE_BAKED_EYES) + { + val = 3; + } + else if (imageID == IMG_USE_BAKED_SKIRT) + { + val = 4; + } + else if (imageID == IMG_USE_BAKED_HAIR) + { + val = 5; + } + + self->getChild("l_bake_use_texture_combo_box")->setSelectedByValue(val, TRUE); + } } // static @@ -945,7 +996,9 @@ void LLFloaterTexturePicker::onBakeTextureSelect(LLUICtrl* ctrl, void *user_data } else { - onBtnCancel(self); + self->setCanApply(true, true); + self->setImageID(self->mOriginalImageAssetID); + self->commitIfImmediateSet(); } } @@ -1011,6 +1064,11 @@ void LLFloaterTexturePicker::setLocalTextureEnabled(BOOL enabled) mModeSelector->setIndexEnabled(1,enabled); } +void LLFloaterTexturePicker::setBakeTextureEnabled(BOOL enabled) +{ + mModeSelector->setIndexEnabled(2, enabled); +} + void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te ) { LLUUID inventory_item_id = findItemID(te.getID(), TRUE); @@ -1059,7 +1117,8 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p) mImageAssetID(p.image_id), mDefaultImageAssetID(p.default_image_id), mDefaultImageName(p.default_image_name), - mFallbackImage(p.fallback_image) + mFallbackImage(p.fallback_image), + mBakeTextureEnabled(FALSE) { // Default of defaults is white image for diff tex @@ -1256,6 +1315,8 @@ void LLTextureCtrl::showPicker(BOOL take_focus) if (root_floater) root_floater->addDependentFloater(floaterp); floaterp->openFloater(); + + texture_floaterp->setBakeTextureEnabled(mBakeTextureEnabled); } if (take_focus) @@ -1473,7 +1534,22 @@ void LLTextureCtrl::draw() } else if (!mImageAssetID.isNull()) { - LLPointer texture = LLViewerTextureManager::getFetchedTexture(mImageAssetID, FTT_DEFAULT, MIPMAP_YES,LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + LLPointer texture = NULL; + + if ((mImageAssetID == IMG_USE_BAKED_EYES) || (mImageAssetID == IMG_USE_BAKED_HAIR) || (mImageAssetID == IMG_USE_BAKED_HEAD) || (mImageAssetID == IMG_USE_BAKED_LOWER) || (mImageAssetID == IMG_USE_BAKED_SKIRT) || (mImageAssetID == IMG_USE_BAKED_UPPER)) + { + if (LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1) + { + LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); + LLViewerTexture* viewerTexture = obj->getBakedTextureForMagicId(mImageAssetID); + texture = viewerTexture ? dynamic_cast(viewerTexture) : NULL; + } + } + + if (texture.isNull()) + { + texture = LLViewerTextureManager::getFetchedTexture(mImageAssetID, FTT_DEFAULT, MIPMAP_YES, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + } texture->setBoostLevel(LLGLTexture::BOOST_PREVIEW); texture->forceToSaveRawImage(0) ; diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index e70849e5c9..ee43fdfb9e 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -198,6 +198,8 @@ public: LLViewerFetchedTexture* getTexture() { return mTexturep; } + void setBakeTextureEnabled(BOOL enabled) { mBakeTextureEnabled = enabled; } + private: BOOL allowDrop(LLInventoryItem* item); BOOL doDrop(LLInventoryItem* item); @@ -233,6 +235,7 @@ private: BOOL mShowLoadingPlaceholder; std::string mLoadingPlaceholderString; S32 mLabelWidth; + BOOL mBakeTextureEnabled; }; ////////////////////////////////////////////////////////////////////////////////////////// @@ -326,6 +329,7 @@ public: static void onHideBaseMeshRegionCheck(LLUICtrl* ctrl, void *userdata); void setLocalTextureEnabled(BOOL enabled); + void setBakeTextureEnabled(BOOL enabled); protected: LLPointer mTexturep; @@ -367,6 +371,7 @@ private: bool mCanPreview; bool mPreviewSettingChanged; + texture_selected_callback mTextureSelectedCallback; floater_close_callback mOnFloaterCloseCallback; floater_commit_callback mOnFloaterCommitCallback; diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 3c249c2420..8a58807a29 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4358,64 +4358,19 @@ void LLViewerObject::sendTEUpdate() const // TODO send media type - - const U32 MAX_TES = 32; - - LLUUID texture_id[MAX_TES]; - S32 last_face_index = llmin((U32)getNumTEs(), MAX_TES) - 1; - - if (last_face_index > -1) - { - S8 face_index; - for (face_index = 0; face_index <= last_face_index; face_index++) - { - LLTextureEntry* entry = getTE((U8)face_index); - texture_id[face_index] = entry->getID(); - - LLViewerFetchedTexture* fetched_texture = gTextureList.findImage(entry->getID(), TEX_LIST_STANDARD); - if (fetched_texture && fetched_texture->getFTType() == FTT_SERVER_BAKE) - { - const LLUUID new_id = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::localTextureIndexToMagicId((LLAvatarAppearanceDefines::ETextureIndex)fetched_texture->getBakedTextureIndex()); - entry->setID(new_id.notNull() ? new_id : IMG_DEFAULT_AVATAR); - } - } - } - packTEMessage(msg); - if (last_face_index > -1) - { - S8 face_index; - for (face_index = 0; face_index <= last_face_index; face_index++) - { - LLTextureEntry* entry = getTE((U8)face_index); - entry->setID(texture_id[face_index]); - } - } - LLViewerRegion *regionp = getRegion(); msg->sendReliable( regionp->getHost() ); } LLViewerTexture* LLViewerObject::getBakedTextureForMagicId(const LLUUID& id) { - if (!LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(id)) + if (!isAttachment()) { return NULL; } - LLVOAvatar* avatar = getAvatar(); - if (avatar) - { - LLAvatarAppearanceDefines::ETextureIndex texIndex = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::assetIdToBakedTextureIndex(id)); - return avatar->getBakedTextureImage(texIndex, avatar->getTE(texIndex)->getID()); - } - - return NULL; -} - -LLTextureEntry* LLViewerObject::getBakedTextureEntryForMagicId(const LLUUID& id) -{ if (!LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(id)) { return NULL; @@ -4425,7 +4380,7 @@ LLTextureEntry* LLViewerObject::getBakedTextureEntryForMagicId(const LLUUID& id) if (avatar) { LLAvatarAppearanceDefines::ETextureIndex texIndex = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::assetIdToBakedTextureIndex(id)); - return avatar->getTE(texIndex); + return avatar->getBakedTextureImage(texIndex, avatar->getTE(texIndex)->getID()); } return NULL; @@ -4433,20 +4388,11 @@ LLTextureEntry* LLViewerObject::getBakedTextureEntryForMagicId(const LLUUID& id) void LLViewerObject::setTE(const U8 te, const LLTextureEntry &texture_entry) { - const LLTextureEntry* baked_entry = getBakedTextureEntryForMagicId(texture_entry.getID()); - if (baked_entry) - { - LLPrimitive::setTE(te, *baked_entry); - - const LLUUID& image_id = baked_entry->getID(); - mTEImages[te] = getBakedTextureForMagicId(image_id); - } - else - { LLPrimitive::setTE(te, texture_entry); - const LLUUID& image_id = getTE(te)->getID(); - mTEImages[te] = LLViewerTextureManager::getFetchedTexture(image_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + const LLUUID& image_id = getTE(te)->getID(); + LLViewerTexture* bakedTexture = getBakedTextureForMagicId(image_id); + mTEImages[te] = bakedTexture ? bakedTexture : LLViewerTextureManager::getFetchedTexture(image_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); if (getTE(te)->getMaterialParams().notNull()) { @@ -4456,25 +4402,16 @@ void LLViewerObject::setTE(const U8 te, const LLTextureEntry &texture_entry) const LLUUID& spec_id = getTE(te)->getMaterialParams()->getSpecularID(); mTESpecularMaps[te] = LLViewerTextureManager::getFetchedTexture(spec_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); } - } - } void LLViewerObject::setTEImage(const U8 te, LLViewerTexture *imagep) { - if (imagep) - { - LLViewerTexture* baked_texture = getBakedTextureForMagicId(imagep->getID()); - if (baked_texture) - { - imagep = baked_texture; - } - } - if (mTEImages[te] != imagep) { - mTEImages[te] = imagep; LLPrimitive::setTETexture(te, imagep->getID()); + + LLViewerTexture* baked_texture = getBakedTextureForMagicId(imagep->getID()); + mTEImages[te] = baked_texture ? baked_texture : imagep; setChanged(TEXTURE); if (mDrawable.notNull()) { @@ -4485,22 +4422,14 @@ void LLViewerObject::setTEImage(const U8 te, LLViewerTexture *imagep) S32 LLViewerObject::setTETextureCore(const U8 te, LLViewerTexture *image) { - if (image) - { - LLViewerTexture* baked_texture = getBakedTextureForMagicId(image->getID()); - if (baked_texture) - { - image = baked_texture; - } - } - const LLUUID& uuid = image->getID(); S32 retval = 0; if (uuid != getTE(te)->getID() || uuid == LLUUID::null) { retval = LLPrimitive::setTETexture(te, uuid); - mTEImages[te] = image; + LLViewerTexture* baked_texture = getBakedTextureForMagicId(uuid); + mTEImages[te] = baked_texture ? baked_texture : image; setChanged(TEXTURE); if (mDrawable.notNull()) { @@ -4589,18 +4518,9 @@ void LLViewerObject::changeTESpecularMap(S32 index, LLViewerTexture* new_image) S32 LLViewerObject::setTETexture(const U8 te, const LLUUID& uuid) { // Invalid host == get from the agent's sim - - LLViewerTexture* baked_texture = getBakedTextureForMagicId(uuid); - if (baked_texture) - { - return setTETextureCore(te, baked_texture); - } - else - { LLViewerFetchedTexture *image = LLViewerTextureManager::getFetchedTexture( uuid, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, LLHost()); return setTETextureCore(te, image); - } } S32 LLViewerObject::setTENormalMap(const U8 te, const LLUUID& uuid) diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index bac96991fa..b63a7ab910 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -566,10 +566,9 @@ public: friend class LLViewerObjectList; friend class LLViewerMediaList; -private: +public: LLViewerTexture* getBakedTextureForMagicId(const LLUUID& id); - LLTextureEntry* getBakedTextureEntryForMagicId(const LLUUID& id); - + public: static void unpackVector3(LLDataPackerBinaryBuffer* dp, LLVector3& value, std::string name); static void unpackUUID(LLDataPackerBinaryBuffer* dp, LLUUID& value, std::string name); diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 2bd2f83e93..c9dea17f63 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -417,9 +417,6 @@ public: void setInFastCacheList(bool in_list) { mInFastCacheList = in_list; } bool isInFastCacheList() { return mInFastCacheList; } - U8 getBakedTextureIndex() { return mBakedTextureIndex; } - void setBakedTextureIndex(U8 index) { mBakedTextureIndex = index; } - /*virtual*/bool isActiveFetching(); //is actively in fetching by the fetching pipeline. protected: @@ -522,8 +519,6 @@ protected: BOOL mForSculpt ; //a flag if the texture is used as sculpt data. BOOL mIsFetched ; //is loaded from remote or from cache, not generated locally. - U8 mBakedTextureIndex; //for FTT_SERVER_BAKE fetched textures - public: static LLPointer sMissingAssetImagep; // Texture to show for an image asset that is not in the database static LLPointer sWhiteImagep; // Texture to show NOTHING (whiteness) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index af98f78d0d..9b69f5a836 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2225,7 +2225,6 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU result->setIsMissingAsset(false); } - result->setBakedTextureIndex(te); } return result; } @@ -7198,6 +7197,83 @@ void LLVOAvatar::debugColorizeSubMeshes(U32 i, const LLColor4& color) } } + +//----------------------------------------------------------------------------- +// updateMeshVisibility() +// Hide the mesh joints if attachments are using baked textures +//----------------------------------------------------------------------------- +void LLVOAvatar::updateMeshVisibility() +{ + bool bake_flag[BAKED_NUM_INDICES]; + memset(bake_flag, 0, BAKED_NUM_INDICES*sizeof(bool)); + + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); + ++iter) + { + LLViewerJointAttachment* attachment = iter->second; + if (attachment) + { + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) + { + LLViewerObject *objectp = (*attachment_iter); + if (objectp) + { + for (int face_index = 0; face_index < objectp->getNumTEs(); face_index++) + { + LLTextureEntry* tex_entry = objectp->getTE(face_index); + bake_flag[BAKED_HEAD] |= (tex_entry->getID() == IMG_USE_BAKED_HEAD); + bake_flag[BAKED_EYES] |= (tex_entry->getID() == IMG_USE_BAKED_EYES); + bake_flag[BAKED_HAIR] |= (tex_entry->getID() == IMG_USE_BAKED_HAIR); + bake_flag[BAKED_LOWER] |= (tex_entry->getID() == IMG_USE_BAKED_LOWER); + bake_flag[BAKED_UPPER] |= (tex_entry->getID() == IMG_USE_BAKED_UPPER); + bake_flag[BAKED_SKIRT] |= (tex_entry->getID() == IMG_USE_BAKED_SKIRT); + } + } + } + } + } + + for (S32 i = 0; i < mMeshLOD.size(); i++) + { + LLAvatarJoint* joint = mMeshLOD[i]; + if (i == MESH_ID_HAIR && bake_flag[BAKED_HAIR]) + { + joint->setVisible(!bake_flag[BAKED_HAIR], TRUE); + } + else if (i == MESH_ID_HEAD) + { + joint->setVisible(!bake_flag[BAKED_HEAD], TRUE); + } + else if (i == MESH_ID_SKIRT) + { + joint->setVisible(!bake_flag[BAKED_SKIRT], TRUE); + } + else if (i == MESH_ID_UPPER_BODY) + { + joint->setVisible(!bake_flag[BAKED_UPPER], TRUE); + } + else if (i == MESH_ID_LOWER_BODY) + { + joint->setVisible(!bake_flag[BAKED_LOWER], TRUE); + } + else if (i == MESH_ID_EYEBALL_LEFT) + { + joint->setVisible(!bake_flag[BAKED_EYES], TRUE); + } + else if (i == MESH_ID_EYEBALL_RIGHT) + { + joint->setVisible(!bake_flag[BAKED_EYES], TRUE); + } + else if (i == MESH_ID_EYELASH) + { + joint->setVisible(!bake_flag[BAKED_EYES], TRUE); + } + } +} + //----------------------------------------------------------------------------- // updateMeshTextures() // Uses the current TE values to set the meshes' and layersets' textures. @@ -8217,22 +8293,17 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte S8 face_index; for (face_index = 0; face_index <= last_face_index; face_index++) { - LLViewerTexture* viewer_texture = attached_object->getTEImage((U8)face_index); - - if (viewer_texture && ( (viewer_texture->getType() == LLViewerTexture::FETCHED_TEXTURE) || (viewer_texture->getType() == LLViewerTexture::LOD_TEXTURE) )) + LLTextureEntry* texEntry = attached_object->getTE(face_index); + if (texEntry && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(texEntry->getID())) { - LLViewerFetchedTexture* fetched_texture = dynamic_cast(viewer_texture); - if (fetched_texture->getFTType() == FTT_SERVER_BAKE) - { - const LLUUID new_id = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::localTextureIndexToMagicId((LLAvatarAppearanceDefines::ETextureIndex)fetched_texture->getBakedTextureIndex()); - attached_object->setTETexture(face_index, new_id); - } - + attached_object->setTEImage(face_index, LLViewerTextureManager::getFetchedTexture(texEntry->getID(), FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); } } } } } + + updateMeshVisibility(); } // static diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 4f876533ee..1b0044201f 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -654,6 +654,8 @@ public: void updateSexDependentLayerSets(); virtual void dirtyMesh(); // Dirty the avatar mesh void updateMeshData(); + void updateMeshVisibility(); + protected: void releaseMeshData(); virtual void restoreMeshData(); -- cgit v1.3 From d0b8617fe6052a94d3a1d06ca44475f05507c770 Mon Sep 17 00:00:00 2001 From: Anchor Linden Date: Mon, 26 Mar 2018 05:39:31 -0700 Subject: MAINT-8436,8412,8411,8446,8438: fixed attach/detach --- indra/newview/llselectmgr.cpp | 1 + indra/newview/llviewerobject.cpp | 23 ++++++--- indra/newview/llviewerobject.h | 2 +- indra/newview/llvoavatar.cpp | 104 +++++++++++++++++++++++++++++++++++++-- 4 files changed, 118 insertions(+), 12 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 1b40c21824..1eddf92ddf 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -95,6 +95,7 @@ #include "llviewershadermgr.h" #include "llpanelface.h" #include "llglheaders.h" +#include "llinventoryobserver.h" LLViewerObject* getSelectedParentObject(LLViewerObject *object) ; // diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 1fef20c94f..15d7ac7ad4 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4388,14 +4388,14 @@ LLViewerTexture* LLViewerObject::getBakedTextureForMagicId(const LLUUID& id) return NULL; } -void LLViewerObject::updateAvatarMeshVisibility(const LLUUID& id) +void LLViewerObject::updateAvatarMeshVisibility(const LLUUID& id, const LLUUID& old_id) { - if (!isAttachment()) + if (id == old_id) { return; } - if (!LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(id)) + if (!LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(old_id) && !LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(id)) { return; } @@ -4409,12 +4409,20 @@ void LLViewerObject::updateAvatarMeshVisibility(const LLUUID& id) void LLViewerObject::setTE(const U8 te, const LLTextureEntry &texture_entry) { + LLUUID old_image_id; + if (getTE(te)) + { + old_image_id = getTE(te)->getID(); + } + LLPrimitive::setTE(te, texture_entry); const LLUUID& image_id = getTE(te)->getID(); LLViewerTexture* bakedTexture = getBakedTextureForMagicId(image_id); mTEImages[te] = bakedTexture ? bakedTexture : LLViewerTextureManager::getFetchedTexture(image_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); - updateAvatarMeshVisibility(image_id); + + + updateAvatarMeshVisibility(image_id,old_image_id); if (getTE(te)->getMaterialParams().notNull()) { @@ -4430,11 +4438,13 @@ void LLViewerObject::setTEImage(const U8 te, LLViewerTexture *imagep) { if (mTEImages[te] != imagep) { + LLUUID old_image_id = getTE(te) ? getTE(te)->getID() : LLUUID::null; + LLPrimitive::setTETexture(te, imagep->getID()); LLViewerTexture* baked_texture = getBakedTextureForMagicId(imagep->getID()); mTEImages[te] = baked_texture ? baked_texture : imagep; - updateAvatarMeshVisibility(imagep->getID()); + updateAvatarMeshVisibility(imagep->getID(), old_image_id); setChanged(TEXTURE); if (mDrawable.notNull()) { @@ -4445,6 +4455,7 @@ void LLViewerObject::setTEImage(const U8 te, LLViewerTexture *imagep) S32 LLViewerObject::setTETextureCore(const U8 te, LLViewerTexture *image) { + LLUUID old_image_id = getTE(te)->getID(); const LLUUID& uuid = image->getID(); S32 retval = 0; if (uuid != getTE(te)->getID() || @@ -4453,7 +4464,7 @@ S32 LLViewerObject::setTETextureCore(const U8 te, LLViewerTexture *image) retval = LLPrimitive::setTETexture(te, uuid); LLViewerTexture* baked_texture = getBakedTextureForMagicId(uuid); mTEImages[te] = baked_texture ? baked_texture : image; - updateAvatarMeshVisibility(uuid); + updateAvatarMeshVisibility(uuid,old_image_id); setChanged(TEXTURE); if (mDrawable.notNull()) { diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index f2b94a8db2..e6ed7d2fd5 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -570,7 +570,7 @@ public: public: LLViewerTexture* getBakedTextureForMagicId(const LLUUID& id); - void updateAvatarMeshVisibility(const LLUUID& id); + void updateAvatarMeshVisibility(const LLUUID& id, const LLUUID& old_id); public: static void unpackVector3(LLDataPackerBinaryBuffer* dp, LLVector3& value, std::string name); static void unpackUUID(LLDataPackerBinaryBuffer* dp, LLUUID& value, std::string name); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9b69f5a836..9f8c27cc6c 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6430,6 +6430,44 @@ const LLViewerJointAttachment *LLVOAvatar::attachObject(LLViewerObject *viewer_o LLSelectMgr::getInstance()->updatePointAt(); } + const U32 MAX_TES = 32; + + S32 last_face_index = llmin((U32)viewer_object->getNumTEs(), MAX_TES) - 1; + + if (last_face_index > -1) + { + S8 face_index; + for (face_index = 0; face_index <= last_face_index; face_index++) + { + LLTextureEntry* texEntry = viewer_object->getTE(face_index); + if (texEntry && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(texEntry->getID())) + { + viewer_object->setTEImage(face_index, viewer_object->getBakedTextureForMagicId(texEntry->getID())); + } + } + } + + LLViewerObject::const_child_list_t& child_list = viewer_object->getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); + iter != child_list.end(); ++iter) + { + LLViewerObject* objectp = *iter; + if (objectp) + { + for (int face_index = 0; face_index < objectp->getNumTEs(); face_index++) + { + LLTextureEntry* tex_entry = objectp->getTE(face_index); + if (tex_entry && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(tex_entry->getID())) + { + objectp->setTEImage(face_index, viewer_object->getBakedTextureForMagicId(tex_entry->getID())); + } + } + } + } + + + updateMeshVisibility(); + return attachment; } @@ -6569,7 +6607,6 @@ void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO ) //----------------------------------------------------------------------------- BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object) { - for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); ++iter) @@ -6578,10 +6615,48 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object) if (attachment->isObjectAttached(viewer_object)) { - updateVisualComplexity(); - cleanupAttachedMesh( viewer_object ); - + updateVisualComplexity(); + cleanupAttachedMesh(viewer_object); + attachment->removeObject(viewer_object); + + const U32 MAX_TES = 32; + + S32 last_face_index = llmin((U32)viewer_object->getNumTEs(), MAX_TES) - 1; + + if (last_face_index > -1) + { + S8 face_index; + for (face_index = 0; face_index <= last_face_index; face_index++) + { + LLTextureEntry* texEntry = viewer_object->getTE(face_index); + if (texEntry && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(texEntry->getID())) + { + viewer_object->setTEImage(face_index, LLViewerTextureManager::getFetchedTexture(texEntry->getID(), FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); + } + } + } + + LLViewerObject::const_child_list_t& child_list = viewer_object->getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); + iter != child_list.end(); ++iter) + { + LLViewerObject* objectp = *iter; + if (objectp) + { + for (int face_index = 0; face_index < objectp->getNumTEs(); face_index++) + { + LLTextureEntry* texEntry = viewer_object->getTE(face_index); + if (texEntry && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(texEntry->getID())) + { + objectp->setTEImage(face_index, LLViewerTextureManager::getFetchedTexture(texEntry->getID(), FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); + } + } + } + } + + updateMeshVisibility(); + LL_DEBUGS() << "Detaching object " << viewer_object->mID << " from " << attachment->getName() << LL_ENDL; return TRUE; } @@ -7232,6 +7307,26 @@ void LLVOAvatar::updateMeshVisibility() bake_flag[BAKED_SKIRT] |= (tex_entry->getID() == IMG_USE_BAKED_SKIRT); } } + + LLViewerObject::const_child_list_t& child_list = objectp->getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); + iter != child_list.end(); ++iter) + { + LLViewerObject* objectp = *iter; + if (objectp) + { + for (int face_index = 0; face_index < objectp->getNumTEs(); face_index++) + { + LLTextureEntry* tex_entry = objectp->getTE(face_index); + bake_flag[BAKED_HEAD] |= (tex_entry->getID() == IMG_USE_BAKED_HEAD); + bake_flag[BAKED_EYES] |= (tex_entry->getID() == IMG_USE_BAKED_EYES); + bake_flag[BAKED_HAIR] |= (tex_entry->getID() == IMG_USE_BAKED_HAIR); + bake_flag[BAKED_LOWER] |= (tex_entry->getID() == IMG_USE_BAKED_LOWER); + bake_flag[BAKED_UPPER] |= (tex_entry->getID() == IMG_USE_BAKED_UPPER); + bake_flag[BAKED_SKIRT] |= (tex_entry->getID() == IMG_USE_BAKED_SKIRT); + } + } + } } } } @@ -8303,7 +8398,6 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte } } - updateMeshVisibility(); } // static -- cgit v1.3 From f8c42d2faf6c627b32903bf2be4f3aa4e58e6d13 Mon Sep 17 00:00:00 2001 From: Anchor Linden Date: Mon, 26 Mar 2018 17:10:43 -0700 Subject: MAINT-8445: fix baked textures on attachments after relog --- indra/newview/llvoavatar.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9f8c27cc6c..f61f0b7cc6 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -8395,9 +8395,29 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte } } } + + LLViewerObject::const_child_list_t& child_list = attached_object->getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); + iter != child_list.end(); ++iter) + { + LLViewerObject* objectp = *iter; + if (objectp) + { + for (int face_index = 0; face_index < objectp->getNumTEs(); face_index++) + { + LLTextureEntry* texEntry = objectp->getTE(face_index); + if (texEntry && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(texEntry->getID())) + { + objectp->setTEImage(face_index, LLViewerTextureManager::getFetchedTexture(texEntry->getID(), FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); + } + } + } + } } } + updateMeshVisibility(); + } // static -- cgit v1.3 From 513d1728c3417d1d6fdf7046bc792ecdcbb25440 Mon Sep 17 00:00:00 2001 From: Anchor Linden Date: Wed, 28 Mar 2018 17:21:03 -0700 Subject: MAINT-8438,8446: fix bakes on child prims --- indra/newview/lltexturectrl.cpp | 2 +- indra/newview/llviewerobject.cpp | 33 ++++++++++--- indra/newview/llviewerobject.h | 1 + indra/newview/llvoavatar.cpp | 102 +++++++-------------------------------- 4 files changed, 47 insertions(+), 91 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index d9170dd832..97876dd60a 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -1011,7 +1011,7 @@ void LLFloaterTexturePicker::onBakeTextureSelect(LLUICtrl* ctrl, void *user_data else { self->setCanApply(true, true); - self->setImageID(self->mOriginalImageAssetID); + self->setImageID(self->mDefaultImageAssetID); self->commitIfImmediateSet(); } } diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 15d7ac7ad4..37e6fa080a 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4368,11 +4368,6 @@ void LLViewerObject::sendTEUpdate() const LLViewerTexture* LLViewerObject::getBakedTextureForMagicId(const LLUUID& id) { - if (!isAttachment()) - { - return NULL; - } - if (!LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(id)) { return NULL; @@ -4382,7 +4377,19 @@ LLViewerTexture* LLViewerObject::getBakedTextureForMagicId(const LLUUID& id) if (avatar) { LLAvatarAppearanceDefines::ETextureIndex texIndex = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::assetIdToBakedTextureIndex(id)); - return avatar->getBakedTextureImage(texIndex, avatar->getTE(texIndex)->getID()); + LLViewerTexture* bakedTexture = avatar->getBakedTextureImage(texIndex, avatar->getTE(texIndex)->getID()); + if (bakedTexture == NULL || bakedTexture->isMissingAsset()) + { + return LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + } + else + { + return bakedTexture; + } + } + else + { + return LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); } return NULL; @@ -4434,6 +4441,20 @@ void LLViewerObject::setTE(const U8 te, const LLTextureEntry &texture_entry) } } +void LLViewerObject::refreshBakeTexture() +{ + for (int face_index = 0; face_index < getNumTEs(); face_index++) + { + LLTextureEntry* tex_entry = getTE(face_index); + if (tex_entry && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(tex_entry->getID())) + { + const LLUUID& image_id = tex_entry->getID(); + LLViewerTexture* bakedTexture = getBakedTextureForMagicId(image_id); + changeTEImage(face_index, bakedTexture); + } + } +} + void LLViewerObject::setTEImage(const U8 te, LLViewerTexture *imagep) { if (mTEImages[te] != imagep) diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index e6ed7d2fd5..a9035c71e1 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -571,6 +571,7 @@ public: public: LLViewerTexture* getBakedTextureForMagicId(const LLUUID& id); void updateAvatarMeshVisibility(const LLUUID& id, const LLUUID& old_id); + void refreshBakeTexture(); public: static void unpackVector3(LLDataPackerBinaryBuffer* dp, LLVector3& value, std::string name); static void unpackUUID(LLDataPackerBinaryBuffer* dp, LLUUID& value, std::string name); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index f61f0b7cc6..c6a8afe92d 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6430,22 +6430,8 @@ const LLViewerJointAttachment *LLVOAvatar::attachObject(LLViewerObject *viewer_o LLSelectMgr::getInstance()->updatePointAt(); } - const U32 MAX_TES = 32; + viewer_object->refreshBakeTexture(); - S32 last_face_index = llmin((U32)viewer_object->getNumTEs(), MAX_TES) - 1; - - if (last_face_index > -1) - { - S8 face_index; - for (face_index = 0; face_index <= last_face_index; face_index++) - { - LLTextureEntry* texEntry = viewer_object->getTE(face_index); - if (texEntry && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(texEntry->getID())) - { - viewer_object->setTEImage(face_index, viewer_object->getBakedTextureForMagicId(texEntry->getID())); - } - } - } LLViewerObject::const_child_list_t& child_list = viewer_object->getChildren(); for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); @@ -6454,18 +6440,10 @@ const LLViewerJointAttachment *LLVOAvatar::attachObject(LLViewerObject *viewer_o LLViewerObject* objectp = *iter; if (objectp) { - for (int face_index = 0; face_index < objectp->getNumTEs(); face_index++) - { - LLTextureEntry* tex_entry = objectp->getTE(face_index); - if (tex_entry && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(tex_entry->getID())) - { - objectp->setTEImage(face_index, viewer_object->getBakedTextureForMagicId(tex_entry->getID())); - } - } + objectp->refreshBakeTexture(); } } - updateMeshVisibility(); return attachment; @@ -6619,39 +6597,16 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object) cleanupAttachedMesh(viewer_object); attachment->removeObject(viewer_object); - - const U32 MAX_TES = 32; - - S32 last_face_index = llmin((U32)viewer_object->getNumTEs(), MAX_TES) - 1; - - if (last_face_index > -1) - { - S8 face_index; - for (face_index = 0; face_index <= last_face_index; face_index++) - { - LLTextureEntry* texEntry = viewer_object->getTE(face_index); - if (texEntry && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(texEntry->getID())) - { - viewer_object->setTEImage(face_index, LLViewerTextureManager::getFetchedTexture(texEntry->getID(), FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); - } - } - } - + viewer_object->refreshBakeTexture(); + LLViewerObject::const_child_list_t& child_list = viewer_object->getChildren(); - for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); - iter != child_list.end(); ++iter) + for (LLViewerObject::child_list_t::const_iterator iter1 = child_list.begin(); + iter1 != child_list.end(); ++iter1) { - LLViewerObject* objectp = *iter; + LLViewerObject* objectp = *iter1; if (objectp) { - for (int face_index = 0; face_index < objectp->getNumTEs(); face_index++) - { - LLTextureEntry* texEntry = viewer_object->getTE(face_index); - if (texEntry && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(texEntry->getID())) - { - objectp->setTEImage(face_index, LLViewerTextureManager::getFetchedTexture(texEntry->getID(), FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); - } - } + objectp->refreshBakeTexture(); } } @@ -7309,15 +7264,15 @@ void LLVOAvatar::updateMeshVisibility() } LLViewerObject::const_child_list_t& child_list = objectp->getChildren(); - for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); - iter != child_list.end(); ++iter) + for (LLViewerObject::child_list_t::const_iterator iter1 = child_list.begin(); + iter1 != child_list.end(); ++iter1) { - LLViewerObject* objectp = *iter; - if (objectp) + LLViewerObject* objectchild = *iter1; + if (objectchild) { - for (int face_index = 0; face_index < objectp->getNumTEs(); face_index++) + for (int face_index = 0; face_index < objectchild->getNumTEs(); face_index++) { - LLTextureEntry* tex_entry = objectp->getTE(face_index); + LLTextureEntry* tex_entry = objectchild->getTE(face_index); bake_flag[BAKED_HEAD] |= (tex_entry->getID() == IMG_USE_BAKED_HEAD); bake_flag[BAKED_EYES] |= (tex_entry->getID() == IMG_USE_BAKED_EYES); bake_flag[BAKED_HAIR] |= (tex_entry->getID() == IMG_USE_BAKED_HAIR); @@ -7331,6 +7286,8 @@ void LLVOAvatar::updateMeshVisibility() } } + LL_INFOS() << "head " << bake_flag[BAKED_HEAD] << "eyes " << bake_flag[BAKED_EYES] << "hair " << bake_flag[BAKED_HAIR] << "lower " << bake_flag[BAKED_LOWER] << "upper " << bake_flag[BAKED_UPPER] << "skirt " << bake_flag[BAKED_SKIRT] << LL_ENDL; + for (S32 i = 0; i < mMeshLOD.size(); i++) { LLAvatarJoint* joint = mMeshLOD[i]; @@ -8378,23 +8335,7 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte ++attachment_iter) { LLViewerObject* attached_object = (*attachment_iter); - - const U32 MAX_TES = 32; - - S32 last_face_index = llmin((U32)attached_object->getNumTEs(), MAX_TES) - 1; - - if (last_face_index > -1) - { - S8 face_index; - for (face_index = 0; face_index <= last_face_index; face_index++) - { - LLTextureEntry* texEntry = attached_object->getTE(face_index); - if (texEntry && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(texEntry->getID())) - { - attached_object->setTEImage(face_index, LLViewerTextureManager::getFetchedTexture(texEntry->getID(), FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); - } - } - } + attached_object->refreshBakeTexture(); LLViewerObject::const_child_list_t& child_list = attached_object->getChildren(); for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); @@ -8403,14 +8344,7 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte LLViewerObject* objectp = *iter; if (objectp) { - for (int face_index = 0; face_index < objectp->getNumTEs(); face_index++) - { - LLTextureEntry* texEntry = objectp->getTE(face_index); - if (texEntry && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(texEntry->getID())) - { - objectp->setTEImage(face_index, LLViewerTextureManager::getFetchedTexture(texEntry->getID(), FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); - } - } + objectp->refreshBakeTexture(); } } } -- cgit v1.3 From 7c90da6b9ef48757636b04f6401d5ea1dedf85f0 Mon Sep 17 00:00:00 2001 From: Anchor Linden Date: Fri, 30 Mar 2018 11:40:40 -0700 Subject: MAINT-8461: hair does not come back. --- indra/newview/llvoavatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index c6a8afe92d..5951733634 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7291,7 +7291,7 @@ void LLVOAvatar::updateMeshVisibility() for (S32 i = 0; i < mMeshLOD.size(); i++) { LLAvatarJoint* joint = mMeshLOD[i]; - if (i == MESH_ID_HAIR && bake_flag[BAKED_HAIR]) + if (i == MESH_ID_HAIR) { joint->setVisible(!bake_flag[BAKED_HAIR], TRUE); } -- cgit v1.3 From 3bf89821d9c9777a0f24d89280bd7a7011a7a3df Mon Sep 17 00:00:00 2001 From: Anchor Linden Date: Mon, 21 May 2018 16:00:52 -0700 Subject: [DRTVWR-455] - added 5 new bake channels --- indra/llappearance/llavatarappearance.cpp | 8 + indra/llappearance/llavatarappearancedefines.cpp | 89 +++- indra/llappearance/llavatarappearancedefines.h | 18 + indra/llcommon/indra_constants.cpp | 5 + indra/llcommon/indra_constants.h | 5 + indra/newview/character/avatar_lad.xml | 524 +++++++++++++++++++++ indra/newview/lllocalbitmaps.cpp | 40 ++ indra/newview/llpaneleditwearable.cpp | 10 +- indra/newview/llpanelface.cpp | 3 +- indra/newview/lltexturectrl.cpp | 47 +- indra/newview/llvoavatar.cpp | 12 +- .../skins/default/xui/en/floater_texture_ctrl.xml | 20 + .../skins/default/xui/en/panel_edit_tattoo.xml | 125 ++++- .../skins/default/xui/en/panel_edit_wearable.xml | 4 +- 14 files changed, 894 insertions(+), 16 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index e5089f028f..afc3274d64 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -1476,6 +1476,14 @@ BOOL LLAvatarAppearance::teToColorParams( ETextureIndex te, U32 *param_name ) case TEX_HEAD_TATTOO: case TEX_LOWER_TATTOO: case TEX_UPPER_TATTOO: + case TEX_SKIRT_TATTOO: + case TEX_HAIR_TATTOO: + case TEX_EYES_TATTOO: + case TEX_LEFT_ARM_TATTOO: + case TEX_LEFT_LEG_TATTOO: + case TEX_AUX1_TATTOO: + case TEX_AUX2_TATTOO: + case TEX_AUX3_TATTOO: param_name[0] = 1071; //"tattoo_red"; param_name[1] = 1072; //"tattoo_green"; param_name[2] = 1073; //"tattoo_blue"; diff --git a/indra/llappearance/llavatarappearancedefines.cpp b/indra/llappearance/llavatarappearancedefines.cpp index c9b975a9cc..3e91b47c07 100644 --- a/indra/llappearance/llavatarappearancedefines.cpp +++ b/indra/llappearance/llavatarappearancedefines.cpp @@ -65,6 +65,15 @@ LLAvatarAppearanceDictionary::Textures::Textures() addEntry(TEX_HEAD_TATTOO, new TextureEntry("head_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO)); addEntry(TEX_UPPER_TATTOO, new TextureEntry("upper_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO)); addEntry(TEX_LOWER_TATTOO, new TextureEntry("lower_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO)); + addEntry(TEX_SKIRT_TATTOO, new TextureEntry("skirt_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO)); + addEntry(TEX_HAIR_TATTOO, new TextureEntry("hair_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO)); + addEntry(TEX_EYES_TATTOO, new TextureEntry("eyes_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO)); + addEntry(TEX_LEFT_ARM_TATTOO, new TextureEntry("leftarm_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO)); + addEntry(TEX_LEFT_LEG_TATTOO, new TextureEntry("leftleg_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO)); + addEntry(TEX_AUX1_TATTOO, new TextureEntry("aux1_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO)); + addEntry(TEX_AUX2_TATTOO, new TextureEntry("aux2_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO)); + addEntry(TEX_AUX3_TATTOO, new TextureEntry("aux3_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO)); + addEntry(TEX_HEAD_BAKED, new TextureEntry("head-baked", FALSE, BAKED_HEAD, "head")); addEntry(TEX_UPPER_BAKED, new TextureEntry("upper-baked", FALSE, BAKED_UPPER, "upper")); @@ -72,6 +81,11 @@ LLAvatarAppearanceDictionary::Textures::Textures() addEntry(TEX_EYES_BAKED, new TextureEntry("eyes-baked", FALSE, BAKED_EYES, "eyes")); addEntry(TEX_HAIR_BAKED, new TextureEntry("hair-baked", FALSE, BAKED_HAIR, "hair")); addEntry(TEX_SKIRT_BAKED, new TextureEntry("skirt-baked", FALSE, BAKED_SKIRT, "skirt")); + addEntry(TEX_LEFT_ARM_BAKED, new TextureEntry("leftarm-baked", FALSE, BAKED_LEFT_ARM, "leftarm")); + addEntry(TEX_LEFT_LEG_BAKED, new TextureEntry("leftleg-baked", FALSE, BAKED_LEFT_LEG, "leftleg")); + addEntry(TEX_AUX1_BAKED, new TextureEntry("aux1-baked", FALSE, BAKED_AUX1, "aux1")); + addEntry(TEX_AUX2_BAKED, new TextureEntry("aux2-baked", FALSE, BAKED_AUX2, "aux2")); + addEntry(TEX_AUX3_BAKED, new TextureEntry("aux3-baked", FALSE, BAKED_AUX3, "aux3")); } LLAvatarAppearanceDictionary::BakedTextures::BakedTextures() @@ -96,18 +110,43 @@ LLAvatarAppearanceDictionary::BakedTextures::BakedTextures() addEntry(BAKED_EYES, new BakedEntry(TEX_EYES_BAKED, "eyes", "27b1bc0f-979f-4b13-95fe-b981c2ba9788", - 2, TEX_EYES_IRIS, TEX_EYES_ALPHA, - 2, LLWearableType::WT_EYES, LLWearableType::WT_ALPHA)); + 3, TEX_EYES_IRIS, TEX_EYES_TATTOO, TEX_EYES_ALPHA, + 3, LLWearableType::WT_EYES, LLWearableType::WT_TATTOO, LLWearableType::WT_ALPHA)); addEntry(BAKED_SKIRT, new BakedEntry(TEX_SKIRT_BAKED, "skirt", "03e7e8cb-1368-483b-b6f3-74850838ba63", - 1, TEX_SKIRT, - 1, LLWearableType::WT_SKIRT)); + 2, TEX_SKIRT, TEX_SKIRT_TATTOO, + 2, LLWearableType::WT_SKIRT, LLWearableType::WT_TATTOO )); addEntry(BAKED_HAIR, new BakedEntry(TEX_HAIR_BAKED, "hair", "a60e85a9-74e8-48d8-8a2d-8129f28d9b61", - 2, TEX_HAIR, TEX_HAIR_ALPHA, - 2, LLWearableType::WT_HAIR, LLWearableType::WT_ALPHA)); + 3, TEX_HAIR, TEX_HAIR_TATTOO, TEX_HAIR_ALPHA, + 3, LLWearableType::WT_HAIR, LLWearableType::WT_TATTOO, LLWearableType::WT_ALPHA)); + + addEntry(BAKED_LEFT_ARM, new BakedEntry(TEX_LEFT_ARM_BAKED, + "leftarm", "9f39febf-22d7-0087-79d1-e9e8c6c9ed19", + 1, TEX_LEFT_ARM_TATTOO, + 1, LLWearableType::WT_TATTOO)); + + addEntry(BAKED_LEFT_LEG, new BakedEntry(TEX_LEFT_LEG_BAKED, + "leftleg", "054a7a58-8ed5-6386-0add-3b636fb28b78", + 1, TEX_LEFT_LEG_TATTOO, + 1, LLWearableType::WT_TATTOO)); + + addEntry(BAKED_AUX1, new BakedEntry(TEX_AUX1_BAKED, + "aux1", "790c11be-b25c-c17e-b4d2-6a4ad786b752", + 1, TEX_AUX1_TATTOO, + 1, LLWearableType::WT_TATTOO)); + + addEntry(BAKED_AUX2, new BakedEntry(TEX_AUX2_BAKED, + "aux2", "d78c478f-48c7-5928-5864-8d99fb1f521e", + 1, TEX_AUX2_TATTOO, + 1, LLWearableType::WT_TATTOO)); + + addEntry(BAKED_AUX3, new BakedEntry(TEX_AUX3_BAKED, + "aux3", "6a95dd53-edd9-aac8-f6d3-27ed99f3c3eb", + 1, TEX_AUX3_TATTOO, + 1, LLWearableType::WT_TATTOO)); } LLAvatarAppearanceDictionary::MeshEntries::MeshEntries() @@ -270,7 +309,8 @@ LLWearableType::EType LLAvatarAppearanceDictionary::getTEWearableType(ETextureIn // static BOOL LLAvatarAppearanceDictionary::isBakedImageId(const LLUUID& id) { - if ((id == IMG_USE_BAKED_EYES) || (id == IMG_USE_BAKED_HAIR) || (id == IMG_USE_BAKED_HEAD) || (id == IMG_USE_BAKED_LOWER) || (id == IMG_USE_BAKED_SKIRT) || (id == IMG_USE_BAKED_UPPER)) + if ((id == IMG_USE_BAKED_EYES) || (id == IMG_USE_BAKED_HAIR) || (id == IMG_USE_BAKED_HEAD) || (id == IMG_USE_BAKED_LOWER) || (id == IMG_USE_BAKED_SKIRT) || (id == IMG_USE_BAKED_UPPER) + || (id == IMG_USE_BAKED_LEFTARM) || (id == IMG_USE_BAKED_LEFTLEG) || (id == IMG_USE_BAKED_AUX1) || (id == IMG_USE_BAKED_AUX2) || (id == IMG_USE_BAKED_AUX3) ) { return TRUE; } @@ -305,6 +345,26 @@ EBakedTextureIndex LLAvatarAppearanceDictionary::assetIdToBakedTextureIndex(cons { return BAKED_UPPER; } + else if (id == IMG_USE_BAKED_LEFTARM) + { + return BAKED_LEFT_ARM; + } + else if (id == IMG_USE_BAKED_LEFTLEG) + { + return BAKED_LEFT_LEG; + } + else if (id == IMG_USE_BAKED_AUX1) + { + return BAKED_AUX1; + } + else if (id == IMG_USE_BAKED_AUX2) + { + return BAKED_AUX2; + } + else if (id == IMG_USE_BAKED_AUX3) + { + return BAKED_AUX3; + } return BAKED_NUM_INDICES; } @@ -334,6 +394,21 @@ LLUUID LLAvatarAppearanceDictionary::localTextureIndexToMagicId(ETextureIndex t) case LLAvatarAppearanceDefines::TEX_HAIR_BAKED: id = IMG_USE_BAKED_HAIR; break; + case LLAvatarAppearanceDefines::TEX_LEFT_ARM_BAKED: + id = IMG_USE_BAKED_LEFTARM; + break; + case LLAvatarAppearanceDefines::TEX_LEFT_LEG_BAKED: + id = IMG_USE_BAKED_LEFTLEG; + break; + case LLAvatarAppearanceDefines::TEX_AUX1_BAKED: + id = IMG_USE_BAKED_AUX1; + break; + case LLAvatarAppearanceDefines::TEX_AUX2_BAKED: + id = IMG_USE_BAKED_AUX2; + break; + case LLAvatarAppearanceDefines::TEX_AUX3_BAKED: + id = IMG_USE_BAKED_AUX3; + break; default: break; } diff --git a/indra/llappearance/llavatarappearancedefines.h b/indra/llappearance/llavatarappearancedefines.h index af94ea94f2..e55e4df10d 100644 --- a/indra/llappearance/llavatarappearancedefines.h +++ b/indra/llappearance/llavatarappearancedefines.h @@ -78,6 +78,19 @@ enum ETextureIndex TEX_HEAD_TATTOO, TEX_UPPER_TATTOO, TEX_LOWER_TATTOO, + TEX_SKIRT_TATTOO, + TEX_HAIR_TATTOO, + TEX_EYES_TATTOO, + TEX_LEFT_ARM_TATTOO, + TEX_LEFT_LEG_TATTOO, + TEX_AUX1_TATTOO, + TEX_AUX2_TATTOO, + TEX_AUX3_TATTOO, + TEX_LEFT_ARM_BAKED, // Pre-composited + TEX_LEFT_LEG_BAKED, // Pre-composited + TEX_AUX1_BAKED, // Pre-composited + TEX_AUX2_BAKED, // Pre-composited + TEX_AUX3_BAKED, // Pre-composited TEX_NUM_INDICES }; @@ -89,6 +102,11 @@ enum EBakedTextureIndex BAKED_EYES, BAKED_SKIRT, BAKED_HAIR, + BAKED_LEFT_ARM, + BAKED_LEFT_LEG, + BAKED_AUX1, + BAKED_AUX2, + BAKED_AUX3, BAKED_NUM_INDICES }; diff --git a/indra/llcommon/indra_constants.cpp b/indra/llcommon/indra_constants.cpp index a9bdab9f4e..d9000bb5ac 100644 --- a/indra/llcommon/indra_constants.cpp +++ b/indra/llcommon/indra_constants.cpp @@ -78,4 +78,9 @@ const LLUUID IMG_USE_BAKED_LOWER ("066d5659-0856-748e-a6de-495d896fe93b"); const LLUUID IMG_USE_BAKED_EYES ("136c0789-b42c-4c6c-134b-63669d981fcb"); const LLUUID IMG_USE_BAKED_SKIRT ("baf656f8-0b45-a85a-244e-f3bdb835f1a2"); const LLUUID IMG_USE_BAKED_HAIR ("1ba5b07f-2d59-21ed-066c-1e188f9a8cad"); +const LLUUID IMG_USE_BAKED_LEFTARM ("9f39febf-22d7-0087-79d1-e9e8c6c9ed19"); +const LLUUID IMG_USE_BAKED_LEFTLEG ("054a7a58-8ed5-6386-0add-3b636fb28b78"); +const LLUUID IMG_USE_BAKED_AUX1 ("790c11be-b25c-c17e-b4d2-6a4ad786b752"); +const LLUUID IMG_USE_BAKED_AUX2 ("d78c478f-48c7-5928-5864-8d99fb1f521e"); +const LLUUID IMG_USE_BAKED_AUX3 ("6a95dd53-edd9-aac8-f6d3-27ed99f3c3eb"); diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index 28e55b2091..dc518b8ab4 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -213,6 +213,11 @@ LL_COMMON_API extern const LLUUID IMG_USE_BAKED_LOWER; LL_COMMON_API extern const LLUUID IMG_USE_BAKED_EYES; LL_COMMON_API extern const LLUUID IMG_USE_BAKED_SKIRT; LL_COMMON_API extern const LLUUID IMG_USE_BAKED_HAIR; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_LEFTARM; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_LEFTLEG; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_AUX1; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_AUX2; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_AUX3; LL_COMMON_API extern const LLUUID DEFAULT_WATER_NORMAL; diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index df30f46002..6d49e22065 100644 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -8947,6 +8947,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -12235,6 +12295,66 @@ render_pass="bump"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -12415,6 +12535,410 @@ render_pass="bump"> domain="0" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index a55938f334..29b374d411 100644 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -750,6 +750,46 @@ LLAvatarAppearanceDefines::ETextureIndex LLLocalBitmap::getTexIndex( result = LLAvatarAppearanceDefines::TEX_UPPER_TATTOO; break; } + case LLAvatarAppearanceDefines::BAKED_SKIRT: + { + result = LLAvatarAppearanceDefines::TEX_SKIRT_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_EYES: + { + result = LLAvatarAppearanceDefines::TEX_EYES_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_HAIR: + { + result = LLAvatarAppearanceDefines::TEX_HAIR_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_LEFT_ARM: + { + result = LLAvatarAppearanceDefines::TEX_LEFT_ARM_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_LEFT_LEG: + { + result = LLAvatarAppearanceDefines::TEX_LEFT_LEG_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_AUX1: + { + result = LLAvatarAppearanceDefines::TEX_AUX1_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_AUX2: + { + result = LLAvatarAppearanceDefines::TEX_AUX2_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_AUX3: + { + result = LLAvatarAppearanceDefines::TEX_AUX3_TATTOO; + break; + } default: { diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index a46fb3dfeb..bb8fadfdf4 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -240,7 +240,7 @@ LLEditWearableDictionary::Wearables::Wearables() addEntry(LLWearableType::WT_UNDERPANTS, new WearableEntry(LLWearableType::WT_UNDERPANTS,"edit_underpants_title","underpants_desc_text", texture_vec_t{TEX_LOWER_UNDERPANTS}, texture_vec_t{TEX_LOWER_UNDERPANTS}, subpart_vec_t{SUBPART_UNDERPANTS})); addEntry(LLWearableType::WT_SKIRT, new WearableEntry(LLWearableType::WT_SKIRT,"edit_skirt_title","skirt_desc_text", texture_vec_t{TEX_SKIRT}, texture_vec_t{TEX_SKIRT}, subpart_vec_t{SUBPART_SKIRT})); addEntry(LLWearableType::WT_ALPHA, new WearableEntry(LLWearableType::WT_ALPHA,"edit_alpha_title","alpha_desc_text", texture_vec_t(), texture_vec_t{TEX_LOWER_ALPHA, TEX_UPPER_ALPHA, TEX_HEAD_ALPHA, TEX_EYES_ALPHA, TEX_HAIR_ALPHA}, subpart_vec_t{SUBPART_ALPHA})); - addEntry(LLWearableType::WT_TATTOO, new WearableEntry(LLWearableType::WT_TATTOO,"edit_tattoo_title","tattoo_desc_text", texture_vec_t{TEX_HEAD_TATTOO}, texture_vec_t{TEX_LOWER_TATTOO, TEX_UPPER_TATTOO, TEX_HEAD_TATTOO}, subpart_vec_t{SUBPART_TATTOO})); + addEntry(LLWearableType::WT_TATTOO, new WearableEntry(LLWearableType::WT_TATTOO,"edit_tattoo_title","tattoo_desc_text", texture_vec_t{TEX_HEAD_TATTOO}, texture_vec_t{TEX_LOWER_TATTOO, TEX_UPPER_TATTOO, TEX_HEAD_TATTOO, TEX_SKIRT_TATTOO, TEX_HAIR_TATTOO, TEX_EYES_TATTOO, TEX_LEFT_ARM_TATTOO,TEX_LEFT_LEG_TATTOO,TEX_AUX1_TATTOO,TEX_AUX2_TATTOO,TEX_AUX3_TATTOO}, subpart_vec_t{SUBPART_TATTOO})); addEntry(LLWearableType::WT_PHYSICS, new WearableEntry(LLWearableType::WT_PHYSICS,"edit_physics_title","physics_desc_text", texture_vec_t(), texture_vec_t(), subpart_vec_t{SUBPART_PHYSICS_BREASTS_UPDOWN, SUBPART_PHYSICS_BREASTS_INOUT, SUBPART_PHYSICS_BREASTS_LEFTRIGHT, SUBPART_PHYSICS_BELLY_UPDOWN, SUBPART_PHYSICS_BUTT_UPDOWN, SUBPART_PHYSICS_BUTT_LEFTRIGHT, SUBPART_PHYSICS_ADVANCED})); } @@ -362,6 +362,14 @@ LLEditWearableDictionary::TextureCtrls::TextureCtrls() addEntry ( TEX_LOWER_TATTOO, new PickerControlEntry (TEX_LOWER_TATTOO, "Lower Tattoo", LLUUID::null, TRUE )); addEntry ( TEX_UPPER_TATTOO, new PickerControlEntry (TEX_UPPER_TATTOO, "Upper Tattoo", LLUUID::null, TRUE )); addEntry ( TEX_HEAD_TATTOO, new PickerControlEntry (TEX_HEAD_TATTOO, "Head Tattoo", LLUUID::null, TRUE )); + addEntry ( TEX_SKIRT_TATTOO, new PickerControlEntry(TEX_SKIRT_TATTOO, "Skirt Tattoo", LLUUID::null, TRUE)); + addEntry ( TEX_HAIR_TATTOO, new PickerControlEntry(TEX_HAIR_TATTOO, "Hair Tattoo", LLUUID::null, TRUE)); + addEntry ( TEX_EYES_TATTOO, new PickerControlEntry(TEX_EYES_TATTOO, "Eyes Tattoo", LLUUID::null, TRUE)); + addEntry (TEX_LEFT_ARM_TATTOO, new PickerControlEntry(TEX_LEFT_ARM_TATTOO, "Left Arm Tattoo", LLUUID::null, TRUE)); + addEntry (TEX_LEFT_LEG_TATTOO, new PickerControlEntry(TEX_LEFT_LEG_TATTOO, "Left Leg Tattoo", LLUUID::null, TRUE)); + addEntry (TEX_AUX1_TATTOO, new PickerControlEntry(TEX_AUX1_TATTOO, "Aux1 Tattoo", LLUUID::null, TRUE)); + addEntry (TEX_AUX2_TATTOO, new PickerControlEntry(TEX_AUX2_TATTOO, "Aux2 Tattoo", LLUUID::null, TRUE)); + addEntry (TEX_AUX3_BAKED, new PickerControlEntry(TEX_AUX3_TATTOO, "Aux3 Tattoo", LLUUID::null, TRUE)); } LLEditWearableDictionary::PickerControlEntry::PickerControlEntry(ETextureIndex tex_index, diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 5689c44e21..fc2ef59f9f 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -2504,7 +2504,8 @@ void LLPanelFace::LLSelectedTE::getTexId(LLUUID& id, bool& identical) 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)) + 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(); } diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 0c823931c1..9c1dd0f1df 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -485,7 +485,8 @@ void LLFloaterTexturePicker::draw() { LLPointer texture = NULL; - if ((mImageAssetID == IMG_USE_BAKED_EYES) || (mImageAssetID == IMG_USE_BAKED_HAIR) || (mImageAssetID == IMG_USE_BAKED_HEAD) || (mImageAssetID == IMG_USE_BAKED_LOWER) || (mImageAssetID == IMG_USE_BAKED_SKIRT) || (mImageAssetID == IMG_USE_BAKED_UPPER)) + if ((mImageAssetID == IMG_USE_BAKED_EYES) || (mImageAssetID == IMG_USE_BAKED_HAIR) || (mImageAssetID == IMG_USE_BAKED_HEAD) || (mImageAssetID == IMG_USE_BAKED_LOWER) || (mImageAssetID == IMG_USE_BAKED_SKIRT) || (mImageAssetID == IMG_USE_BAKED_UPPER) + || (mImageAssetID == IMG_USE_BAKED_LEFTARM) || (mImageAssetID == IMG_USE_BAKED_LEFTLEG) || (mImageAssetID == IMG_USE_BAKED_AUX1) || (mImageAssetID == IMG_USE_BAKED_AUX2) || (mImageAssetID == IMG_USE_BAKED_AUX3)) { LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); if (obj) @@ -831,6 +832,27 @@ void LLFloaterTexturePicker::onModeSelect(LLUICtrl* ctrl, void *userdata) { val = 5; } + else if (imageID == IMG_USE_BAKED_LEFTARM) + { + val = 6; + } + else if (imageID == IMG_USE_BAKED_LEFTLEG) + { + val = 7; + } + else if (imageID == IMG_USE_BAKED_AUX1) + { + val = 8; + } + else if (imageID == IMG_USE_BAKED_AUX2) + { + val = 9; + } + else if (imageID == IMG_USE_BAKED_AUX3) + { + val = 10; + } + self->getChild("l_bake_use_texture_combo_box")->setSelectedByValue(val, TRUE); } @@ -987,6 +1009,26 @@ void LLFloaterTexturePicker::onBakeTextureSelect(LLUICtrl* ctrl, void *user_data { imageID = IMG_USE_BAKED_HAIR; } + else if (type == 6) + { + imageID = IMG_USE_BAKED_LEFTARM; + } + else if (type == 7) + { + imageID = IMG_USE_BAKED_LEFTLEG; + } + else if (type == 8) + { + imageID = IMG_USE_BAKED_AUX1; + } + else if (type == 9) + { + imageID = IMG_USE_BAKED_AUX2; + } + else if (type == 10) + { + imageID = IMG_USE_BAKED_AUX3; + } self->setImageID(imageID); self->mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here? @@ -1556,7 +1598,8 @@ void LLTextureCtrl::draw() { LLPointer texture = NULL; - if ((mImageAssetID == IMG_USE_BAKED_EYES) || (mImageAssetID == IMG_USE_BAKED_HAIR) || (mImageAssetID == IMG_USE_BAKED_HEAD) || (mImageAssetID == IMG_USE_BAKED_LOWER) || (mImageAssetID == IMG_USE_BAKED_SKIRT) || (mImageAssetID == IMG_USE_BAKED_UPPER)) + if ((mImageAssetID == IMG_USE_BAKED_EYES) || (mImageAssetID == IMG_USE_BAKED_HAIR) || (mImageAssetID == IMG_USE_BAKED_HEAD) || (mImageAssetID == IMG_USE_BAKED_LOWER) || (mImageAssetID == IMG_USE_BAKED_SKIRT) || (mImageAssetID == IMG_USE_BAKED_UPPER) + || (mImageAssetID == IMG_USE_BAKED_LEFTARM) || (mImageAssetID == IMG_USE_BAKED_LEFTLEG) || (mImageAssetID == IMG_USE_BAKED_AUX1) || (mImageAssetID == IMG_USE_BAKED_AUX2) || (mImageAssetID == IMG_USE_BAKED_AUX3)) { LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); if (obj) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 5951733634..6a046534e3 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7260,6 +7260,11 @@ void LLVOAvatar::updateMeshVisibility() bake_flag[BAKED_LOWER] |= (tex_entry->getID() == IMG_USE_BAKED_LOWER); bake_flag[BAKED_UPPER] |= (tex_entry->getID() == IMG_USE_BAKED_UPPER); bake_flag[BAKED_SKIRT] |= (tex_entry->getID() == IMG_USE_BAKED_SKIRT); + bake_flag[BAKED_LEFT_ARM] |= (tex_entry->getID() == IMG_USE_BAKED_LEFTARM); + bake_flag[BAKED_LEFT_LEG] |= (tex_entry->getID() == IMG_USE_BAKED_LEFTLEG); + bake_flag[BAKED_AUX1] |= (tex_entry->getID() == IMG_USE_BAKED_AUX1); + bake_flag[BAKED_AUX2] |= (tex_entry->getID() == IMG_USE_BAKED_AUX2); + bake_flag[BAKED_AUX3] |= (tex_entry->getID() == IMG_USE_BAKED_AUX3); } } @@ -7279,6 +7284,11 @@ void LLVOAvatar::updateMeshVisibility() bake_flag[BAKED_LOWER] |= (tex_entry->getID() == IMG_USE_BAKED_LOWER); bake_flag[BAKED_UPPER] |= (tex_entry->getID() == IMG_USE_BAKED_UPPER); bake_flag[BAKED_SKIRT] |= (tex_entry->getID() == IMG_USE_BAKED_SKIRT); + bake_flag[BAKED_LEFT_ARM] |= (tex_entry->getID() == IMG_USE_BAKED_LEFTARM); + bake_flag[BAKED_LEFT_LEG] |= (tex_entry->getID() == IMG_USE_BAKED_LEFTLEG); + bake_flag[BAKED_AUX1] |= (tex_entry->getID() == IMG_USE_BAKED_AUX1); + bake_flag[BAKED_AUX2] |= (tex_entry->getID() == IMG_USE_BAKED_AUX2); + bake_flag[BAKED_AUX3] |= (tex_entry->getID() == IMG_USE_BAKED_AUX3); } } } @@ -7286,7 +7296,7 @@ void LLVOAvatar::updateMeshVisibility() } } - LL_INFOS() << "head " << bake_flag[BAKED_HEAD] << "eyes " << bake_flag[BAKED_EYES] << "hair " << bake_flag[BAKED_HAIR] << "lower " << bake_flag[BAKED_LOWER] << "upper " << bake_flag[BAKED_UPPER] << "skirt " << bake_flag[BAKED_SKIRT] << LL_ENDL; + //LL_INFOS() << "head " << bake_flag[BAKED_HEAD] << "eyes " << bake_flag[BAKED_EYES] << "hair " << bake_flag[BAKED_HAIR] << "lower " << bake_flag[BAKED_LOWER] << "upper " << bake_flag[BAKED_UPPER] << "skirt " << bake_flag[BAKED_SKIRT] << LL_ENDL; for (S32 i = 0; i < mMeshLOD.size(); i++) { diff --git a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml index 9bce037cba..549f4aca28 100644 --- a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml +++ b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml @@ -275,6 +275,26 @@ label="BAKED_HAIR" name="BAKED_HAIR" value="5" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Date: Wed, 27 Jun 2018 01:45:01 +0530 Subject: [MAINT-8513] - fix "Edit My Outfit" Changes Don't Update --- indra/newview/llviewerobject.cpp | 4 +- indra/newview/llvoavatar.cpp | 91 ++++++++++++++++++++++++++++++---------- indra/newview/llvoavatar.h | 1 + 3 files changed, 71 insertions(+), 25 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 3cc44638b1..5a502b61ab 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4376,8 +4376,8 @@ LLViewerTexture* LLViewerObject::getBakedTextureForMagicId(const LLUUID& id) LLVOAvatar* avatar = getAvatar(); if (avatar) { - LLAvatarAppearanceDefines::ETextureIndex texIndex = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::assetIdToBakedTextureIndex(id)); - LLViewerTexture* bakedTexture = avatar->getBakedTextureImage(texIndex, avatar->getTE(texIndex)->getID()); + LLAvatarAppearanceDefines::EBakedTextureIndex texIndex = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::assetIdToBakedTextureIndex(id); + LLViewerTexture* bakedTexture = avatar->getBakedTexture(texIndex); if (bakedTexture == NULL || bakedTexture->isMissingAsset()) { return LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9e2a69ae65..6e49a92e97 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7558,6 +7558,33 @@ void LLVOAvatar::updateMeshTextures() call_remove_missing = true; } + //refresh bakes on any attached objects + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); + ++iter) + { + LLViewerJointAttachment* attachment = iter->second; + + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) + { + LLViewerObject* attached_object = (*attachment_iter); + attached_object->refreshBakeTexture(); + + LLViewerObject::const_child_list_t& child_list = attached_object->getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); + iter != child_list.end(); ++iter) + { + LLViewerObject* objectp = *iter; + if (objectp) + { + objectp->refreshBakeTexture(); + } + } + } + } + } @@ -8336,36 +8363,54 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte } updateMeshTextures(); + updateMeshVisibility(); - //refresh bakes on any attached objects - for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); - iter != mAttachmentPoints.end(); - ++iter) +} + +LLViewerTexture* LLVOAvatar::getBakedTexture(const U8 te) +{ + if (te < 0 || te >= BAKED_NUM_INDICES) { - LLViewerJointAttachment* attachment = iter->second; + return NULL; + } - for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); - attachment_iter != attachment->mAttachedObjects.end(); - ++attachment_iter) - { - LLViewerObject* attached_object = (*attachment_iter); - attached_object->refreshBakeTexture(); + BOOL is_layer_baked = isTextureDefined(mBakedTextureDatas[te].mTextureIndex); + BOOL use_lkg_baked_layer; // lkg = "last known good" + + LLViewerTexLayerSet* layerset = NULL; + layerset = getTexLayerSet(te); + BOOL layerset_invalid = layerset && (!layerset->getViewerComposite()->isInitialized() || !layerset->isLocalTextureDataAvailable()); + use_lkg_baked_layer = (!is_layer_baked && (mBakedTextureDatas[te].mLastTextureID != IMG_DEFAULT_AVATAR) && layerset_invalid); + if (use_lkg_baked_layer) + { + layerset->setUpdatesEnabled(TRUE); + } + else + { + use_lkg_baked_layer = (!is_layer_baked && mBakedTextureDatas[te].mLastTextureID != IMG_DEFAULT_AVATAR); + } - LLViewerObject::const_child_list_t& child_list = attached_object->getChildren(); - for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); - iter != child_list.end(); ++iter) - { - LLViewerObject* objectp = *iter; - if (objectp) - { - objectp->refreshBakeTexture(); - } - } - } + if (use_lkg_baked_layer && !isUsingLocalAppearance()) + { + LLViewerFetchedTexture* baked_img = LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[te].mLastTextureID); + return baked_img; } + else if (!isUsingLocalAppearance() && is_layer_baked) + { + LLViewerFetchedTexture* baked_img = LLViewerTextureManager::staticCastToFetchedTexture(getImage(mBakedTextureDatas[te].mTextureIndex, 0), TRUE); + return baked_img; + } + else if (layerset && isUsingLocalAppearance()) + { + layerset->createComposite(); + layerset->setUpdatesEnabled(TRUE); - updateMeshVisibility(); + return layerset->getViewerComposite(); + } + + return NULL; + } // static diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 1b0044201f..8d45877a9d 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -655,6 +655,7 @@ public: virtual void dirtyMesh(); // Dirty the avatar mesh void updateMeshData(); void updateMeshVisibility(); + LLViewerTexture* getBakedTexture(const U8 te); protected: void releaseMeshData(); -- cgit v1.3 From a9cf29d52ffda2174e7362b98fb3bbb217081bc5 Mon Sep 17 00:00:00 2001 From: Anchor Linden Date: Wed, 27 Jun 2018 03:15:48 +0530 Subject: [MAINT-8509] - hide eyelash if BAKED_HEAD is set and not BAKED_EYES --- indra/newview/llvoavatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 6e49a92e97..81d114d7ba 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7335,7 +7335,7 @@ void LLVOAvatar::updateMeshVisibility() } else if (i == MESH_ID_EYELASH) { - joint->setVisible(!bake_flag[BAKED_EYES], TRUE); + joint->setVisible(!bake_flag[BAKED_HEAD], TRUE); } } } -- cgit v1.3 From a0beacf007b9e99b7d92647ebb31307d77eec51f Mon Sep 17 00:00:00 2001 From: Anchor Linden Date: Wed, 27 Jun 2018 05:57:21 +0530 Subject: [MAINT-8513] - use IMG_DEFAULT in case of no server bakes --- indra/newview/llviewerobject.cpp | 2 +- indra/newview/llvoavatar.cpp | 20 +++----------------- 2 files changed, 4 insertions(+), 18 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 5a502b61ab..5b4cc0980e 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4380,7 +4380,7 @@ LLViewerTexture* LLViewerObject::getBakedTextureForMagicId(const LLUUID& id) LLViewerTexture* bakedTexture = avatar->getBakedTexture(texIndex); if (bakedTexture == NULL || bakedTexture->isMissingAsset()) { - return LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + return LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); } else { diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 81d114d7ba..cba1fae758 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -8375,27 +8375,12 @@ LLViewerTexture* LLVOAvatar::getBakedTexture(const U8 te) } BOOL is_layer_baked = isTextureDefined(mBakedTextureDatas[te].mTextureIndex); - BOOL use_lkg_baked_layer; // lkg = "last known good" LLViewerTexLayerSet* layerset = NULL; layerset = getTexLayerSet(te); - BOOL layerset_invalid = layerset && (!layerset->getViewerComposite()->isInitialized() || !layerset->isLocalTextureDataAvailable()); - use_lkg_baked_layer = (!is_layer_baked && (mBakedTextureDatas[te].mLastTextureID != IMG_DEFAULT_AVATAR) && layerset_invalid); - if (use_lkg_baked_layer) - { - layerset->setUpdatesEnabled(TRUE); - } - else - { - use_lkg_baked_layer = (!is_layer_baked && mBakedTextureDatas[te].mLastTextureID != IMG_DEFAULT_AVATAR); - } + - if (use_lkg_baked_layer && !isUsingLocalAppearance()) - { - LLViewerFetchedTexture* baked_img = LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[te].mLastTextureID); - return baked_img; - } - else if (!isUsingLocalAppearance() && is_layer_baked) + if (!isUsingLocalAppearance() && is_layer_baked) { LLViewerFetchedTexture* baked_img = LLViewerTextureManager::staticCastToFetchedTexture(getImage(mBakedTextureDatas[te].mTextureIndex, 0), TRUE); return baked_img; @@ -8646,6 +8631,7 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) } } } + dirtyMesh(); } -- cgit v1.3 From 063d30e409d64d12a9ac3ca2d0328b55e49717f3 Mon Sep 17 00:00:00 2001 From: Anchor Linden Date: Sun, 15 Jul 2018 22:40:30 +0530 Subject: [MAINT-8845] - fix universal displays on avatar after taking it off --- indra/newview/llvoavatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7843f9f00d..2f3e8a31f8 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -8254,7 +8254,7 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte { if (!isTextureDefined(mBakedTextureDatas[baked_index].mTextureIndex) && mBakedTextureDatas[baked_index].mLastTextureID != IMG_DEFAULT - && baked_index != BAKED_SKIRT) + && baked_index != BAKED_SKIRT && baked_index != BAKED_LEFT_ARM && baked_index != BAKED_LEFT_LEG && baked_index != BAKED_AUX1 && baked_index != BAKED_AUX2 && baked_index != BAKED_AUX3) { LL_DEBUGS("Avatar") << avString() << " baked_index " << (S32) baked_index << " using mLastTextureID " << mBakedTextureDatas[baked_index].mLastTextureID << LL_ENDL; setTEImage(mBakedTextureDatas[baked_index].mTextureIndex, -- cgit v1.3 From ba6bd742df694f7419abe0a91cd454be9310891a Mon Sep 17 00:00:00 2001 From: Anchor Date: Thu, 29 Nov 2018 01:55:51 -0800 Subject: [SL-9974] - fix bake attachments can't be selected after closing appearance floater --- indra/newview/llvoavatar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index b6b779072c..9a4eb8b15b 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -9032,12 +9032,12 @@ LLViewerTexture* LLVOAvatar::getBakedTexture(const U8 te) layerset = getTexLayerSet(te); - if (!isUsingLocalAppearance() && is_layer_baked) + if (!isEditingAppearance() && is_layer_baked) { LLViewerFetchedTexture* baked_img = LLViewerTextureManager::staticCastToFetchedTexture(getImage(mBakedTextureDatas[te].mTextureIndex, 0), TRUE); return baked_img; } - else if (layerset && isUsingLocalAppearance()) + else if (layerset && isEditingAppearance()) { layerset->createComposite(); layerset->setUpdatesEnabled(TRUE); -- cgit v1.3 From 2461a7fe396fe95a043ed1cfc3b0c251d242a2c3 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Tue, 8 Jan 2019 14:15:44 +0200 Subject: SL-10320 FIXED Crash in LLVOAvatar::updateAttachmentOverrides() --- indra/newview/llvoavatar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 321f774210..2682c5b698 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5992,7 +5992,7 @@ void LLVOAvatar::rebuildAttachmentOverrides() LLViewerObject *vo = *at_it; // Attached animated objects affect joints in their control // avs, not the avs to which they are attached. - if (!vo->isAnimatedObject()) + if (vo && !vo->isAnimatedObject()) { addAttachmentOverridesForObject(vo); } @@ -6043,7 +6043,7 @@ void LLVOAvatar::updateAttachmentOverrides() LLViewerObject *vo = *at_it; // Attached animated objects affect joints in their control // avs, not the avs to which they are attached. - if (!vo->isAnimatedObject()) + if (vo && !vo->isAnimatedObject()) { addAttachmentOverridesForObject(vo, &meshes_seen); } -- cgit v1.3 From 597106fa34bca95c2d01c0bf28c6b2bdc031fe35 Mon Sep 17 00:00:00 2001 From: Anchor Date: Mon, 28 Jan 2019 01:51:58 -0800 Subject: [SL-1461] - fix black skirt --- indra/newview/llvoavatar.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9a4eb8b15b..2c42fbd3eb 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3584,6 +3584,7 @@ void LLVOAvatar::updateAppearanceMessageDebugText() debug_line += llformat(" %s", (isSitting() ? "S" : "T")); debug_line += llformat("%s", (isMotionActive(ANIM_AGENT_SIT_GROUND_CONSTRAINED) ? "G" : "-")); } + LLVector3 ankle_right_pos_agent = mFootRightp->getWorldPosition(); LLVector3 normal; LLVector3 ankle_right_ground_agent = ankle_right_pos_agent; @@ -7463,7 +7464,16 @@ BOOL LLVOAvatar::isWearingWearableType(LLWearableType::EType type) const if (texture_dict->mIsUsedByBakedTexture) { const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; - return isTextureDefined(LLAvatarAppearanceDictionary::getInstance()->getBakedTexture(baked_index)->mTextureIndex); + + if (type == LLWearableType::WT_SKIRT) + { + return (LLAvatarAppearance::isWearingWearableType(type) && isTextureDefined(LLAvatarAppearanceDictionary::getInstance()->getBakedTexture(baked_index)->mTextureIndex)); + } + else + { + return isTextureDefined(LLAvatarAppearanceDictionary::getInstance()->getBakedTexture(baked_index)->mTextureIndex); + } + } return FALSE; } -- cgit v1.3 From 756a6028eb1234d1a7a177bb438fe5980f87f8d4 Mon Sep 17 00:00:00 2001 From: Anchor Date: Mon, 4 Feb 2019 00:17:03 -0800 Subject: [SL-10179] - up the priority on baked images so they get fetched and decoded --- indra/newview/llvoavatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 2c42fbd3eb..a962a89e28 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2380,7 +2380,7 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU } LL_DEBUGS("Avatar") << avString() << "get server-bake image from URL " << url << LL_ENDL; result = LLViewerTextureManager::getFetchedTextureFromUrl( - url, FTT_SERVER_BAKE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid); + url, FTT_SERVER_BAKE, TRUE, LLGLTexture::BOOST_AVATAR_BAKED_SELF, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid); if (result->isMissingAsset()) { result->setIsMissingAsset(false); -- cgit v1.3 From 3dbafba55c96a664b1518c97daf856c332b2aa05 Mon Sep 17 00:00:00 2001 From: Anchor Date: Sun, 10 Feb 2019 22:48:59 -0800 Subject: [SL-1360] - black skirt fix. reverting change. wearable data doesnt really work for other avatars. made an appearanace service change instead --- indra/newview/llvoavatar.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a962a89e28..0764e7d72c 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7464,16 +7464,7 @@ BOOL LLVOAvatar::isWearingWearableType(LLWearableType::EType type) const if (texture_dict->mIsUsedByBakedTexture) { const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; - - if (type == LLWearableType::WT_SKIRT) - { - return (LLAvatarAppearance::isWearingWearableType(type) && isTextureDefined(LLAvatarAppearanceDictionary::getInstance()->getBakedTexture(baked_index)->mTextureIndex)); - } - else - { - return isTextureDefined(LLAvatarAppearanceDictionary::getInstance()->getBakedTexture(baked_index)->mTextureIndex); - } - + return isTextureDefined(LLAvatarAppearanceDictionary::getInstance()->getBakedTexture(baked_index)->mTextureIndex); } return FALSE; } -- cgit v1.3 From 5acdea8bb9a23c7b6d577983e40a50488b52c148 Mon Sep 17 00:00:00 2001 From: Anchor Date: Tue, 12 Feb 2019 02:00:31 -0800 Subject: [SL-10179] - fix for bakes not updating on other avatars. set decode priorities for bakes was not getting called for other avatars --- indra/newview/llvoavatar.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 0764e7d72c..106fccb434 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -829,7 +829,8 @@ BOOL LLVOAvatar::isFullyBaked() for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { if (!isTextureDefined(mBakedTextureDatas[i].mTextureIndex) - && ( (i != BAKED_SKIRT) || isWearingWearableType(LLWearableType::WT_SKIRT) ) ) + && ((i != BAKED_SKIRT) || isWearingWearableType(LLWearableType::WT_SKIRT)) + && (i != BAKED_LEFT_ARM) && (i != BAKED_LEFT_LEG) && (i != BAKED_AUX1) && (i != BAKED_AUX2) && (i != BAKED_AUX3)) { return FALSE; } @@ -2380,7 +2381,7 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU } LL_DEBUGS("Avatar") << avString() << "get server-bake image from URL " << url << LL_ENDL; result = LLViewerTextureManager::getFetchedTextureFromUrl( - url, FTT_SERVER_BAKE, TRUE, LLGLTexture::BOOST_AVATAR_BAKED_SELF, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid); + url, FTT_SERVER_BAKE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid); if (result->isMissingAsset()) { result->setIsMissingAsset(false); -- cgit v1.3 From 099e58f75b3edc036cff9f6cf5587dacaf16e3fc Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 23 Apr 2019 15:13:38 +0100 Subject: SL-10401 - get agent attachment limit from SimulatorFeatures if available --- indra/llcommon/indra_constants.h | 1 - indra/newview/llcofwearables.cpp | 3 ++- indra/newview/llinventorybridge.cpp | 2 +- indra/newview/llvoavatar.cpp | 25 +++++++++++++++++++++++-- indra/newview/llvoavatar.h | 1 + 5 files changed, 27 insertions(+), 5 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index a00a82aff0..c0213d7c16 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -153,7 +153,6 @@ const U8 SIM_ACCESS_DOWN = 254; const U8 SIM_ACCESS_MAX = SIM_ACCESS_ADULT; // attachment constants -const S32 MAX_AGENT_ATTACHMENTS = 38; const U8 ATTACHMENT_ADD = 0x80; // god levels diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index 307f93e28c..b47e0930a3 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -42,6 +42,7 @@ #include "llwearableitemslist.h" #include "llpaneloutfitedit.h" #include "lltrans.h" +#include "llvoavatarself.h" static LLPanelInjector t_cof_wearables("cof_wearables"); @@ -330,7 +331,7 @@ void LLCOFWearables::setAttachmentsTitle() { if (mAttachmentsTab) { - U32 free_slots = MAX_AGENT_ATTACHMENTS - mAttachments->size(); + U32 free_slots = gAgentAvatarp->getMaxAttachments() - mAttachments->size(); LLStringUtil::format_map_t args_attachments; args_attachments["[COUNT]"] = llformat ("%d", free_slots); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 1987e15850..b3f6d354df 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -6307,7 +6307,7 @@ bool confirm_attachment_rez(const LLSD& notification, const LLSD& response) if (!gAgentAvatarp->canAttachMoreObjects()) { LLSD args; - args["MAX_ATTACHMENTS"] = llformat("%d", MAX_AGENT_ATTACHMENTS); + args["MAX_ATTACHMENTS"] = llformat("%d", gAgentAvatarp->getMaxAttachments()); LLNotificationsUtil::add("MaxAttachmentsOnOutfit", args); return false; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 321f774210..c9f2ba1a3c 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7036,13 +7036,34 @@ U32 LLVOAvatar::getNumAttachments() const return num_attachments; } +//----------------------------------------------------------------------------- +// getMaxAttachments() +//----------------------------------------------------------------------------- +S32 LLVOAvatar::getMaxAttachments() const +{ + const S32 MAX_AGENT_ATTACHMENTS = 38; + + S32 max_attach = MAX_AGENT_ATTACHMENTS; + + if (gAgent.getRegion()) + { + LLSD features; + gAgent.getRegion()->getSimulatorFeatures(features); + if (features.has("MaxAgentAttachments")) + { + max_attach = features["MaxAgentAttachments"].asInteger(); + } + } + return max_attach; +} + //----------------------------------------------------------------------------- // canAttachMoreObjects() // Returns true if we can attach more objects. //----------------------------------------------------------------------------- BOOL LLVOAvatar::canAttachMoreObjects(U32 n) const { - return (getNumAttachments() + n) <= MAX_AGENT_ATTACHMENTS; + return (getNumAttachments() + n) <= getMaxAttachments(); } //----------------------------------------------------------------------------- @@ -7070,7 +7091,7 @@ S32 LLVOAvatar::getMaxAnimatedObjectAttachments() const S32 max_attach = 0; if (gSavedSettings.getBOOL("AnimatedObjectsIgnoreLimits")) { - max_attach = MAX_AGENT_ATTACHMENTS; + max_attach = getMaxAttachments(); } else { diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index deb22617a4..e1ea7c619b 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -809,6 +809,7 @@ public: BOOL hasHUDAttachment() const; LLBBox getHUDBBox() const; void resetHUDAttachments(); + S32 getMaxAttachments() const; BOOL canAttachMoreObjects(U32 n=1) const; S32 getMaxAnimatedObjectAttachments() const; BOOL canAttachMoreAnimatedObjects(U32 n=1) const; -- cgit v1.3 From aa1dd6bb7b5325bb65a0a979e00e6b537621bed9 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 16 Jul 2019 18:31:58 +0300 Subject: SL-11597 Fix crash on dead object --- indra/newview/llvoavatar.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 5004cbec4c..5584efeb7b 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -8245,16 +8245,19 @@ void LLVOAvatar::updateMeshTextures() ++attachment_iter) { LLViewerObject* attached_object = (*attachment_iter); - attached_object->refreshBakeTexture(); - - LLViewerObject::const_child_list_t& child_list = attached_object->getChildren(); - for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); - iter != child_list.end(); ++iter) + if (attached_object && !attached_object->isDead()) { - LLViewerObject* objectp = *iter; - if (objectp) + attached_object->refreshBakeTexture(); + + LLViewerObject::const_child_list_t& child_list = attached_object->getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); + iter != child_list.end(); ++iter) { - objectp->refreshBakeTexture(); + LLViewerObject* objectp = *iter; + if (objectp && !objectp->isDead()) + { + objectp->refreshBakeTexture(); + } } } } -- cgit v1.3