diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2024-07-02 21:53:16 +0300 |
---|---|---|
committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2024-07-03 06:23:50 +0300 |
commit | 42a9690daa127f34ec73120ac8a3580639f8067a (patch) | |
tree | 2bbc0a8d2b022e75f961a937cf596b34274d66a7 /indra/newview | |
parent | 9af13cce6192c3e01f8a895b56954f9fc3560879 (diff) |
viewer-private#247 Porperly reload image when uploading a model
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llmodelpreview.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index b1a48db0ee..2483308c82 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -3134,6 +3134,13 @@ U32 LLModelPreview::loadTextures(LLImportMaterial& material, void* opaque) LLPointer< LLViewerFetchedTexture >& tex = (*reinterpret_cast< LLPointer< LLViewerFetchedTexture > * >(material.mOpaqueData)); tex = LLViewerTextureManager::getFetchedTextureFromUrl("file://" + LLURI::unescape(material.mDiffuseMapFilename), FTT_LOCAL_FILE, true, LLGLTexture::BOOST_PREVIEW); + if (tex->getDiscardLevel() < tex->getMaxDiscardLevel()) + { + // file was loaded previosly, reload image to get potential changes + tex->clearFetchedResults(); + } + // Todo: might cause a crash if preview gets closed before we get the callback. + // Use a callback list or guard callback in some way tex->setLoadedCallback(LLModelPreview::textureLoadedCallback, 0, true, false, opaque, NULL, false); tex->forceToSaveRawImage(0, F32_MAX); material.setDiffuseMap(tex->getID()); // record tex ID |