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/llviewerobject.cpp | 130 +++++++++++++++++++++++++++++++++++---- 1 file changed, 118 insertions(+), 12 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 5de4029542..1bc3b3c726 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4358,31 +4358,119 @@ 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)) + { + 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; + } + + LLVOAvatar* avatar = getAvatar(); + if (avatar) + { + LLAvatarAppearanceDefines::ETextureIndex texIndex = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::assetIdToBakedTextureIndex(id)); + return avatar->getTE(texIndex); + } + + return NULL; +} + void LLViewerObject::setTE(const U8 te, const LLTextureEntry &texture_entry) { - LLPrimitive::setTE(te, 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); - - if (getTE(te)->getMaterialParams().notNull()) - { - const LLUUID& norm_id = getTE(te)->getMaterialParams()->getNormalID(); - mTENormalMaps[te] = LLViewerTextureManager::getFetchedTexture(norm_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); - - const LLUUID& spec_id = getTE(te)->getMaterialParams()->getSpecularID(); - mTESpecularMaps[te] = LLViewerTextureManager::getFetchedTexture(spec_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + + if (getTE(te)->getMaterialParams().notNull()) + { + const LLUUID& norm_id = getTE(te)->getMaterialParams()->getNormalID(); + mTENormalMaps[te] = LLViewerTextureManager::getFetchedTexture(norm_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + + 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; @@ -4397,6 +4485,15 @@ 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() || @@ -4492,9 +4589,18 @@ 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 - LLViewerFetchedTexture *image = LLViewerTextureManager::getFetchedTexture( - uuid, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, LLHost()); - return setTETextureCore(te,image); + + 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) -- cgit v1.2.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/llviewerobject.cpp | 100 ++++----------------------------------- 1 file changed, 10 insertions(+), 90 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') 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) -- cgit v1.2.3 From 485193c7f530fa3d8574c74304e452ab6d012e41 Mon Sep 17 00:00:00 2001 From: Anchor Linden Date: Fri, 2 Mar 2018 15:29:07 -0800 Subject: [MAINT-8081] - update mesh visibility on tex change --- indra/newview/llviewerobject.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 8a58807a29..ef5b5eef20 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4386,6 +4386,25 @@ LLViewerTexture* LLViewerObject::getBakedTextureForMagicId(const LLUUID& id) return NULL; } +void LLViewerObject::updateAvatarMeshVisibility(const LLUUID& id) +{ + if (!isAttachment()) + { + return; + } + + if (!LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(id)) + { + return; + } + + LLVOAvatar* avatar = getAvatar(); + if (avatar) + { + avatar->updateMeshVisibility(); + } +} + void LLViewerObject::setTE(const U8 te, const LLTextureEntry &texture_entry) { LLPrimitive::setTE(te, texture_entry); @@ -4393,6 +4412,7 @@ void LLViewerObject::setTE(const U8 te, const LLTextureEntry &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); if (getTE(te)->getMaterialParams().notNull()) { @@ -4412,6 +4432,7 @@ void LLViewerObject::setTEImage(const U8 te, LLViewerTexture *imagep) LLViewerTexture* baked_texture = getBakedTextureForMagicId(imagep->getID()); mTEImages[te] = baked_texture ? baked_texture : imagep; + updateAvatarMeshVisibility(imagep->getID()); setChanged(TEXTURE); if (mDrawable.notNull()) { @@ -4430,6 +4451,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); setChanged(TEXTURE); if (mDrawable.notNull()) { -- cgit v1.2.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/llviewerobject.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') 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()) { -- cgit v1.2.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/llviewerobject.cpp | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') 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) -- cgit v1.2.3 From 69b2add00a9d371f6148d3102f1a54b3b6ce3175 Mon Sep 17 00:00:00 2001 From: Anchor Linden 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 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewerobject.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); -- cgit v1.2.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 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewerobject.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 { -- cgit v1.2.3 From dcbf57ab2d3ec86d9e2b3ec7d3c627f37fe24392 Mon Sep 17 00:00:00 2001 From: Anchor Linden Date: Sun, 15 Jul 2018 21:33:02 +0530 Subject: [MAINT-8846] - fixing duplicate id in avatar_lad.xml fixrs character test female crash. code cleanup. --- indra/newview/llviewerobject.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 4f64ee94c1..ace2504fbd 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4408,7 +4408,6 @@ LLViewerTexture* LLViewerObject::getBakedTextureForMagicId(const LLUUID& id) return LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); } - return NULL; } void LLViewerObject::updateAvatarMeshVisibility(const LLUUID& id, const LLUUID& old_id) -- cgit v1.2.3 From 9b364bf7037bed2c85251458b00e34088deda197 Mon Sep 17 00:00:00 2001 From: Anchor Date: Wed, 28 Nov 2018 16:01:36 -0800 Subject: [SL-10079] - Bom handling for animated objects --- indra/newview/llviewerobject.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index e9b0316393..1539f47ca7 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -1,4 +1,4 @@ -/** +is_a/** * @file llviewerobject.cpp * @brief Base class for viewer objects * @@ -4682,6 +4682,12 @@ LLViewerTexture* LLViewerObject::getBakedTextureForMagicId(const LLUUID& id) return NULL; } + LLViewerObject *root = getRootEdit(); + if (root && root->isAnimatedObject()) + { + return LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + } + LLVOAvatar* avatar = getAvatar(); if (avatar) { -- cgit v1.2.3 From d4abdf3560810b6bf0d08661abf592b4bb366e23 Mon Sep 17 00:00:00 2001 From: Anchor Date: Thu, 29 Nov 2018 23:19:31 -0800 Subject: fix typo --- indra/newview/llviewerobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 1539f47ca7..262a2550ec 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -1,4 +1,4 @@ -is_a/** +/** * @file llviewerobject.cpp * @brief Base class for viewer objects * -- cgit v1.2.3