SL-18105 Fix for overrides not showing until a forced mesh update.

meow-7.2.2
Dave Parks 2022-10-20 13:55:42 -05:00
parent 8741c05cc1
commit 40695bbd31
5 changed files with 22 additions and 7 deletions

View File

@ -36,7 +36,6 @@
#include "llviewercontrol.h"
#include "llviewergenericmessage.h"
#include "llviewerobjectlist.h"
#include "pipeline.h"
#include "tinygltf/tiny_gltf.h"
#include <strstream>
@ -87,10 +86,7 @@ namespace
if(obj)
{
if (obj->setTEGLTFMaterialOverride(side, override_data))
{
gPipeline.markTextured(obj->mDrawable);
}
obj->setTEGLTFMaterialOverride(side, override_data);
}
LL_DEBUGS() << "successfully parsed override: " << override_data->asJSON() << LL_ENDL;

View File

@ -5315,7 +5315,6 @@ S32 LLViewerObject::setTEMaterialParams(const U8 te, const LLMaterialPtr pMateri
setTENormalMap(te, (pMaterialParams) ? pMaterialParams->getNormalID() : LLUUID::null);
setTESpecularMap(te, (pMaterialParams) ? pMaterialParams->getSpecularID() : LLUUID::null);
refreshMaterials();
return retval;
}

View File

@ -356,7 +356,7 @@ public:
/*virtual*/ S32 setTEGlow(const U8 te, const F32 glow);
/*virtual*/ S32 setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID);
/*virtual*/ S32 setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams);
S32 setTEGLTFMaterialOverride(U8 te, LLGLTFMaterial* mat);
virtual S32 setTEGLTFMaterialOverride(U8 te, LLGLTFMaterial* mat);
// Used by Materials update functions to properly kick off rebuilds
// of VBs etc when materials updates require changes.

View File

@ -2609,6 +2609,24 @@ S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialPa
return TEM_CHANGE_TEXTURE;
}
S32 LLVOVolume::setTEGLTFMaterialOverride(U8 te, LLGLTFMaterial* mat)
{
S32 retval = LLViewerObject::setTEGLTFMaterialOverride(te, mat);
if (retval == TEM_CHANGE_TEXTURE)
{
if (!mDrawable.isNull())
{
gPipeline.markTextured(mDrawable);
gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL);
}
mFaceMappingChanged = TRUE;
}
return retval;
}
S32 LLVOVolume::setTEScale(const U8 te, const F32 s, const F32 t)
{
S32 res = LLViewerObject::setTEScale(te, s, t);
@ -2642,6 +2660,7 @@ S32 LLVOVolume::setTEScaleT(const U8 te, const F32 t)
return res;
}
void LLVOVolume::updateTEData()
{
/*if (mDrawable.notNull())

View File

@ -209,6 +209,7 @@ public:
static void setTEMaterialParamsCallbackTE(const LLUUID& objectID, const LLMaterialID& pMaterialID, const LLMaterialPtr pMaterialParams, U32 te);
/*virtual*/ S32 setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams) override;
S32 setTEGLTFMaterialOverride(U8 te, LLGLTFMaterial* mat) override;
/*virtual*/ S32 setTEScale(const U8 te, const F32 s, const F32 t) override;
/*virtual*/ S32 setTEScaleS(const U8 te, const F32 s) override;
/*virtual*/ S32 setTEScaleT(const U8 te, const F32 t) override;