From 77eba62335158db6b0c6c7966a26b956fd796da9 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 17 Oct 2022 23:55:59 +0300 Subject: SL-18008 Placeholder functionality for PBR Edit button --- indra/newview/llmaterialeditor.cpp | 23 +++++++++++++++++++++- .../default/xui/en/floater_material_editor.xml | 1 + 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 80a0583fd0..f1b015fc84 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -1537,7 +1537,28 @@ void LLMaterialEditor::loadMaterial(LLGLTFMaterial * material, bool make_copy) { setTitle(LLTrans::getString("New Material")); } - // else ??? Think of a name for live editing + else + { + setTitle(getString("material_override_title")); + // TODO: Save whole selection + + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); + LLViewerObject* object = selection->getFirstNode()->getObject(); + if (object) + { + const S32 num_tes = llmin((S32)object->getNumTEs(), (S32)object->getNumFaces()); // avatars have TEs but no faces + for (S32 face = 0; face < num_tes; ++face) + { + LLTextureEntry *te = object->getTE(face); + if (te->isSelected()) + { + // TEMP + setOverrideTarget(object->getLocalID(), face); + break; + } + } + } + } // Todo: At the moment it always makes a 'copy' // Will need a way to expand existing material diff --git a/indra/newview/skins/default/xui/en/floater_material_editor.xml b/indra/newview/skins/default/xui/en/floater_material_editor.xml index 3314d49ac3..434123faf0 100644 --- a/indra/newview/skins/default/xui/en/floater_material_editor.xml +++ b/indra/newview/skins/default/xui/en/floater_material_editor.xml @@ -15,6 +15,7 @@ L$[FEE] upload fee Material selection Select material: + Material override