From 11c87378be68d9102d7dcf94d714b3c5c1923952 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 4 Nov 2022 18:57:48 +0200 Subject: SL-18560 Make local materials save correctly from right-click menu --- indra/newview/lltinygltfhelper.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'indra/newview/lltinygltfhelper.cpp') diff --git a/indra/newview/lltinygltfhelper.cpp b/indra/newview/lltinygltfhelper.cpp index cff26ea51f..58031d4204 100644 --- a/indra/newview/lltinygltfhelper.cpp +++ b/indra/newview/lltinygltfhelper.cpp @@ -186,11 +186,7 @@ bool LLTinyGLTFHelper::getMaterialFromFile( const std::string& filename, S32 mat_index, LLPointer < LLFetchedGLTFMaterial> material, - std::string& material_name, - LLPointer& base_color_tex, - LLPointer& normal_tex, - LLPointer& mr_tex, - LLPointer& emissive_tex) + std::string& material_name) { tinygltf::TinyGLTF loader; std::string error_msg; @@ -249,6 +245,11 @@ bool LLTinyGLTFHelper::getMaterialFromFile( occlusion_img = LLTinyGLTFHelper::getTexture(folder, model_in, material_in.occlusionTexture.index); } + LLPointer base_color_tex; + LLPointer normal_tex; + LLPointer mr_tex; + LLPointer emissive_tex; + // todo: pass it into local bitmaps? LLTinyGLTFHelper::initFetchedTextures(material_in, base_img, normal_img, mr_img, emissive_img, occlusion_img, @@ -258,7 +259,7 @@ bool LLTinyGLTFHelper::getMaterialFromFile( { base_color_tex->addTextureStats(64.f * 64.f, TRUE); material->mBaseColorId = base_color_tex->getID(); - material->mBaseColorTexture = base_color_tex; + material->mBaseColorTexture; } else { -- cgit v1.2.3