diff options
| author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-10-04 20:33:10 +0300 | 
|---|---|---|
| committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-10-04 20:33:10 +0300 | 
| commit | 1a437cbedf94de90d749f426dde09f2466693de2 (patch) | |
| tree | 1151aa03d708dfb7a47dc7ff0517c56c1b894038 | |
| parent | 7d426815019ac5394e5821f1c6ba374e12606aaa (diff) | |
SL-18144 Bakes On Mesh not showing in-world as Albedo
| -rw-r--r-- | indra/newview/llmaterialeditor.cpp | 1 | ||||
| -rw-r--r-- | indra/newview/llviewerobject.cpp | 22 | 
2 files changed, 16 insertions, 7 deletions
| diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index a72d38223f..a2cd68259b 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -1903,6 +1903,7 @@ void LLMaterialEditor::onLoadComplete(const LLUUID& asset_uuid,              editor->setEnableEditing(allow_modify && !source_library);              editor->setHasUnsavedChanges(false);              editor->mAssetStatus = PREVIEW_ASSET_LOADED; +            editor->setEnabled(true); // ready for use          }          else          { diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index b4fad16dba..a256b770b1 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4930,13 +4930,21 @@ void LLViewerObject::updateTEMaterialTextures(U8 te)  		mTESpecularMaps[te] = LLViewerTextureManager::getFetchedTexture(spec_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM, LLViewerTexture::LOD_TEXTURE);  	} -    auto fetch_texture = [](const LLUUID& id) +    auto fetch_texture = [](const LLUUID& id, LLViewerObject *obj)      {          LLViewerFetchedTexture* img = nullptr;          if (id.notNull())          { -            img = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM, LLViewerTexture::LOD_TEXTURE); -            img->addTextureStats(64.f * 64.f, TRUE); +            if (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(id)) +            { +                LLViewerTexture* viewerTexture = obj->getBakedTextureForMagicId(id); +                img = viewerTexture ? dynamic_cast<LLViewerFetchedTexture*>(viewerTexture) : nullptr; +            } +            else +            { +                img = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM, LLViewerTexture::LOD_TEXTURE); +                img->addTextureStats(64.f * 64.f, TRUE); +            }          }          return img; @@ -4957,10 +4965,10 @@ void LLViewerObject::updateTEMaterialTextures(U8 te)      if (mat != nullptr)      { -        mGLTFBaseColorMaps[te] = fetch_texture(mat->mBaseColorId); -        mGLTFNormalMaps[te] = fetch_texture(mat->mNormalId); -        mGLTFMetallicRoughnessMaps[te] = fetch_texture(mat->mMetallicRoughnessId); -        mGLTFEmissiveMaps[te] = fetch_texture(mat->mEmissiveId); +        mGLTFBaseColorMaps[te] = fetch_texture(mat->mBaseColorId, this); +        mGLTFNormalMaps[te] = fetch_texture(mat->mNormalId, this); +        mGLTFMetallicRoughnessMaps[te] = fetch_texture(mat->mMetallicRoughnessId, this); +        mGLTFEmissiveMaps[te] = fetch_texture(mat->mEmissiveId, this);      }      else      { | 
