summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llgltfmateriallist.cpp6
-rw-r--r--indra/newview/llmaterialeditor.cpp3
2 files changed, 3 insertions, 6 deletions
diff --git a/indra/newview/llgltfmateriallist.cpp b/indra/newview/llgltfmateriallist.cpp
index cff2d22f18..8142762dfe 100644
--- a/indra/newview/llgltfmateriallist.cpp
+++ b/indra/newview/llgltfmateriallist.cpp
@@ -32,7 +32,6 @@
#include "lldispatcher.h"
#include "llfetchedgltfmaterial.h"
#include "llfilesystem.h"
-#include "llmaterialeditor.h"
#include "llsdserialize.h"
#include "lltinygltfhelper.h"
#include "llviewercontrol.h"
@@ -294,7 +293,6 @@ public:
}
else if (obj && obj->isAnySelected())
{
- LLMaterialEditor::updateLive(object_override.mObjectId, results[i].mSide);
for (auto& override_update_callback : callbacks)
{
override_update_callback(object_override.mObjectId, results[i].mSide);
@@ -306,7 +304,6 @@ public:
// unblock material editor
if (obj && obj->isAnySelected())
{
- LLMaterialEditor::updateLive(object_override.mObjectId, results[i].mSide);
for (auto& override_update_callback : callbacks)
{
override_update_callback(object_override.mObjectId, results[i].mSide);
@@ -325,7 +322,6 @@ public:
obj->setTEGLTFMaterialOverride(i, nullptr);
if (object_has_selection)
{
- LLMaterialEditor::updateLive(object_override.mObjectId, i);
for (auto& override_update_callback : callbacks)
{
override_update_callback(object_override.mObjectId, i);
@@ -343,7 +339,6 @@ public:
obj->setTEGLTFMaterialOverride(i, nullptr);
if (object_has_selection)
{
- LLMaterialEditor::updateLive(obj->getID(), i);
for (auto& override_update_callback : callbacks)
{
override_update_callback(obj->getID(), i);
@@ -395,7 +390,6 @@ void LLGLTFMaterialList::applyQueuedOverrides(LLViewerObject* obj)
obj->setTEGLTFMaterialOverride(i, overrides[i]);
if (object_has_selection)
{
- LLMaterialEditor::updateLive(id, i);
for (auto& override_update_callback : handle_gltf_override_message.mCallbacks)
{
override_update_callback(id, i);
diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp
index d5339777c4..f1fd276402 100644
--- a/indra/newview/llmaterialeditor.cpp
+++ b/indra/newview/llmaterialeditor.cpp
@@ -399,6 +399,9 @@ BOOL LLMaterialEditor::postBuild()
if (mIsOverride)
{
+ // Material override change success callback
+ LLGLTFMaterialList::addUpdateCallback(&LLMaterialEditor::updateLive);
+
// Live editing needs a recovery mechanism on cancel
mBaseColorTextureCtrl->setOnCancelCallback(boost::bind(&LLMaterialEditor::onCancelCtrl, this, _1, _2, MATERIAL_BASE_COLOR_TEX_DIRTY));
mMetallicTextureCtrl->setOnCancelCallback(boost::bind(&LLMaterialEditor::onCancelCtrl, this, _1, _2, MATERIAL_METALLIC_ROUGHTNESS_TEX_DIRTY));