summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobject.cpp
diff options
context:
space:
mode:
authorAnchor Linden <anchor@lindenlab.com>2018-03-28 17:21:03 -0700
committerAnchor Linden <anchor@lindenlab.com>2018-03-28 17:21:03 -0700
commit513d1728c3417d1d6fdf7046bc792ecdcbb25440 (patch)
treeb9165e49aaafaa25fab9735fcd335861fe6ae16f /indra/newview/llviewerobject.cpp
parentf8c42d2faf6c627b32903bf2be4f3aa4e58e6d13 (diff)
MAINT-8438,8446: fix bakes on child prims
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r--indra/newview/llviewerobject.cpp33
1 files changed, 27 insertions, 6 deletions
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)