summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2022-11-29 13:51:23 -0800
committerCosmic Linden <cosmic@lindenlab.com>2022-11-29 13:51:23 -0800
commit361571cdb330dea18ad5a3575d7b06c69371e11b (patch)
treea29a49d1d2dfb9f6173bee1859d62fe550303396
parentf313a762fcfa69a0259a7db90283bbd03b4107fb (diff)
SL-18732: Use override update callback for LLMaterialEditor::updateLive as well
-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));