Fix material preview sometimes not updating when transitioning from blank material to non-blank material
parent
97764080b0
commit
1691a25ce8
|
|
@ -40,6 +40,8 @@ public:
|
|||
virtual ~LLFetchedGLTFMaterial();
|
||||
|
||||
LLFetchedGLTFMaterial& operator=(const LLFetchedGLTFMaterial& rhs);
|
||||
// LLGLTFMaterial::operator== is defined, but LLFetchedGLTFMaterial::operator== is not.
|
||||
bool operator==(const LLGLTFMaterial& rhs) const = delete;
|
||||
|
||||
// If this material is loaded, fire the given function
|
||||
void onMaterialComplete(std::function<void()> material_complete);
|
||||
|
|
|
|||
|
|
@ -130,6 +130,8 @@ namespace
|
|||
|
||||
LLGLTFPreviewTexture::MaterialLoadLevels get_material_load_levels(LLFetchedGLTFMaterial& material)
|
||||
{
|
||||
llassert(!material.isFetching());
|
||||
|
||||
using MaterialTextures = LLPointer<LLViewerFetchedTexture>*[LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT];
|
||||
|
||||
MaterialTextures textures;
|
||||
|
|
|
|||
|
|
@ -666,7 +666,7 @@ void LLFloaterTexturePicker::draw()
|
|||
{
|
||||
mGLTFMaterial = (LLFetchedGLTFMaterial*) gGLTFMaterialList.getMaterial(mImageAssetID);
|
||||
llassert(mGLTFMaterial == nullptr || dynamic_cast<LLFetchedGLTFMaterial*>(gGLTFMaterialList.getMaterial(mImageAssetID)) != nullptr);
|
||||
if (mGLTFPreview.isNull() || mGLTFMaterial.isNull() || (old_material.notNull() && (*old_material.get() != *mGLTFMaterial.get())))
|
||||
if (mGLTFPreview.isNull() || mGLTFMaterial.isNull() || (old_material.notNull() && (old_material.get() != mGLTFMaterial.get())))
|
||||
{
|
||||
// Only update the preview if needed, since gGLTFMaterialPreviewMgr does not cache the preview.
|
||||
if (mGLTFMaterial.isNull())
|
||||
|
|
@ -2206,7 +2206,7 @@ void LLTextureCtrl::draw()
|
|||
if (mInventoryPickType == PICK_MATERIAL)
|
||||
{
|
||||
mGLTFMaterial = gGLTFMaterialList.getMaterial(mImageAssetID);
|
||||
if (mGLTFPreview.isNull() || mGLTFMaterial.isNull() || (old_material.notNull() && (*old_material.get() != *mGLTFMaterial.get())))
|
||||
if (mGLTFPreview.isNull() || mGLTFMaterial.isNull() || (old_material.notNull() && (old_material.get() != mGLTFMaterial.get())))
|
||||
{
|
||||
// Only update the preview if needed, since gGLTFMaterialPreviewMgr does not cache the preview.
|
||||
if (mGLTFMaterial.isNull())
|
||||
|
|
|
|||
Loading…
Reference in New Issue