SL-18446 Don't cause excessive udpates

meow-7.2.2
Andrey Kleshchev 2022-10-31 21:24:41 +02:00
parent b1f529082b
commit 4cb5439e42
1 changed files with 14 additions and 9 deletions

View File

@ -2221,17 +2221,22 @@ void LLMaterialEditor::applyToSelection()
std::string url = gAgent.getRegionCapability("ModifyMaterialParams");
if (!url.empty())
{
mOverrideInProgress = true;
LLObjectSelectionHandle selected_objects = LLSelectMgr::getInstance()->getSelection();
// TODO figure out how to get the right asset id in cases where we don't have a good one
LLRenderMaterialOverrideFunctor override_func(this, url);
if (!selected_objects->applyToTEs(&override_func))
// Don't send data if there is nothing to send.
// Some UI elements will cause multiple commits,
// like spin ctrls on click and on down
if (mUnsavedChanges != 0)
{
mOverrideInProgress = false;
}
mOverrideInProgress = true;
LLObjectSelectionHandle selected_objects = LLSelectMgr::getInstance()->getSelection();
LLRenderMaterialOverrideFunctor override_func(this, url);
if (!selected_objects->applyToTEs(&override_func))
{
mOverrideInProgress = false;
}
// we posted all changes
mUnsavedChanges = 0;
// we posted all changes
mUnsavedChanges = 0;
}
}
else
{