[MAINT-8081] - update mesh visibility on tex change

meow-7.2.2
Anchor Linden 2018-03-02 15:29:07 -08:00
parent 8f64a9edea
commit 485193c7f5
3 changed files with 23 additions and 17 deletions

View File

@ -1648,14 +1648,6 @@ void LLSelectMgr::selectionSetImage(const LLUUID& imageid)
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;
}
};
@ -1856,14 +1848,6 @@ BOOL LLSelectMgr::selectionRevertTextures()
{
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();
}
}
}
}
}

View File

@ -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())
{

View File

@ -568,7 +568,7 @@ public:
public:
LLViewerTexture* getBakedTextureForMagicId(const LLUUID& id);
void updateAvatarMeshVisibility(const LLUUID& id);
public:
static void unpackVector3(LLDataPackerBinaryBuffer* dp, LLVector3& value, std::string name);
static void unpackUUID(LLDataPackerBinaryBuffer* dp, LLUUID& value, std::string name);