summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llmaterialeditor.cpp23
-rw-r--r--indra/newview/skins/default/xui/en/floater_material_editor.xml1
2 files changed, 23 insertions, 1 deletions
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 @@
<string name="upload_fee_string">L$[FEE] upload fee</string>
<string name="material_selection_title">Material selection</string>
<string name="material_selection_text">Select material:</string>
+ <string name="material_override_title">Material override</string>
<scroll_container
name="materials_scroll"