SL-18144 Bakes On Mesh not showing in-world as Albedo
parent
7d42681501
commit
1a437cbedf
|
|
@ -1903,6 +1903,7 @@ void LLMaterialEditor::onLoadComplete(const LLUUID& asset_uuid,
|
||||||
editor->setEnableEditing(allow_modify && !source_library);
|
editor->setEnableEditing(allow_modify && !source_library);
|
||||||
editor->setHasUnsavedChanges(false);
|
editor->setHasUnsavedChanges(false);
|
||||||
editor->mAssetStatus = PREVIEW_ASSET_LOADED;
|
editor->mAssetStatus = PREVIEW_ASSET_LOADED;
|
||||||
|
editor->setEnabled(true); // ready for use
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4930,13 +4930,21 @@ void LLViewerObject::updateTEMaterialTextures(U8 te)
|
||||||
mTESpecularMaps[te] = LLViewerTextureManager::getFetchedTexture(spec_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM, LLViewerTexture::LOD_TEXTURE);
|
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;
|
LLViewerFetchedTexture* img = nullptr;
|
||||||
if (id.notNull())
|
if (id.notNull())
|
||||||
{
|
{
|
||||||
img = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM, LLViewerTexture::LOD_TEXTURE);
|
if (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(id))
|
||||||
img->addTextureStats(64.f * 64.f, TRUE);
|
{
|
||||||
|
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;
|
return img;
|
||||||
|
|
@ -4957,10 +4965,10 @@ void LLViewerObject::updateTEMaterialTextures(U8 te)
|
||||||
|
|
||||||
if (mat != nullptr)
|
if (mat != nullptr)
|
||||||
{
|
{
|
||||||
mGLTFBaseColorMaps[te] = fetch_texture(mat->mBaseColorId);
|
mGLTFBaseColorMaps[te] = fetch_texture(mat->mBaseColorId, this);
|
||||||
mGLTFNormalMaps[te] = fetch_texture(mat->mNormalId);
|
mGLTFNormalMaps[te] = fetch_texture(mat->mNormalId, this);
|
||||||
mGLTFMetallicRoughnessMaps[te] = fetch_texture(mat->mMetallicRoughnessId);
|
mGLTFMetallicRoughnessMaps[te] = fetch_texture(mat->mMetallicRoughnessId, this);
|
||||||
mGLTFEmissiveMaps[te] = fetch_texture(mat->mEmissiveId);
|
mGLTFEmissiveMaps[te] = fetch_texture(mat->mEmissiveId, this);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue