[MAINT-8513] - fix "Edit My Outfit" Changes Don't Update

meow-7.2.2
Anchor Linden 2018-06-27 01:45:01 +05:30
parent f848271c28
commit 69b2add00a
3 changed files with 76 additions and 30 deletions

View File

@ -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);

View File

@ -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,38 +8363,56 @@ 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);
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();
}
}
}
}
updateMeshVisibility();
}
LLViewerTexture* LLVOAvatar::getBakedTexture(const U8 te)
{
if (te < 0 || te >= BAKED_NUM_INDICES)
{
return NULL;
}
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)
{
LLViewerFetchedTexture* baked_img = LLViewerTextureManager::staticCastToFetchedTexture(getImage(mBakedTextureDatas[te].mTextureIndex, 0), TRUE);
return baked_img;
}
else if (layerset && isUsingLocalAppearance())
{
layerset->createComposite();
layerset->setUpdatesEnabled(TRUE);
return layerset->getViewerComposite();
}
return NULL;
}
// static
void LLVOAvatar::getAnimLabels( std::vector<std::string>* labels )
{

View File

@ -655,6 +655,7 @@ public:
virtual void dirtyMesh(); // Dirty the avatar mesh
void updateMeshData();
void updateMeshVisibility();
LLViewerTexture* getBakedTexture(const U8 te);
protected:
void releaseMeshData();