summaryrefslogtreecommitdiff
path: root/indra/newview/llselectmgr.cpp
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2023-02-14 13:52:33 -0800
committerCosmic Linden <cosmic@lindenlab.com>2023-02-14 13:59:00 -0800
commit917932549fe40f02bf393f22ec1af12aa2245264 (patch)
tree9f5f210626e6a943f31c6520f2bb4f35306a018d /indra/newview/llselectmgr.cpp
parent3561e9b5d5a7fef8e6a710c7b6f9b13243a4d51c (diff)
SL-19002: Stop sending material IDs from client via material params and just call queueApply/queueModify
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r--indra/newview/llselectmgr.cpp68
1 files changed, 5 insertions, 63 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 02e85d7470..55cf6795fe 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -1941,12 +1941,6 @@ void LLSelectMgr::selectionSetGLTFMaterial(const LLUUID& mat_id)
asset_id = mItem->getAssetUUID();
}
- if (asset_id.notNull() && !objectp->hasRenderMaterialParams())
- {
- // make sure param section exists
- objectp->setParameterEntryInUse(LLNetworkData::PARAMS_RENDER_MATERIAL, TRUE, false /*prevent an update*/);
- }
-
// Blank out most override data on the object and send to server
objectp->setRenderMaterialID(te, asset_id);
@@ -1975,25 +1969,6 @@ void LLSelectMgr::selectionSetGLTFMaterial(const LLUUID& mat_id)
return false;
}
- LLRenderMaterialParams* param_block = (LLRenderMaterialParams*)object->getParameterEntry(LLNetworkData::PARAMS_RENDER_MATERIAL);
- if (param_block)
- {
- // To not cause multiple competing request that modify
- // same param field send update only once per object
- if (param_block->isEmpty())
- {
- object->setHasRenderMaterialParams(false);
- }
- else if (object->hasRenderMaterialParams())
- {
- object->parameterChanged(LLNetworkData::PARAMS_RENDER_MATERIAL, true);
- }
- else
- {
- object->setHasRenderMaterialParams(true);
- }
- }
-
if (!mItem)
{
// 1 particle effect per object
@@ -2209,14 +2184,13 @@ void LLSelectMgr::selectionRevertGLTFMaterials()
{
// Restore base material
LLUUID asset_id = nodep->mSavedGLTFMaterialIds[te];
- objectp->setRenderMaterialID(te, asset_id, false /*wait for bulk update*/);
+ // Update material locally
+ objectp->setRenderMaterialID(te, asset_id, false /*wait for LLGLTFMaterialList update*/);
+ objectp->setTEGLTFMaterialOverride(te, nodep->mSavedGLTFOverrideMaterials[te]);
- // todo: make sure this does not cause race condition with setRenderMaterialID
- // when we are reverting from null id to non null plus override
- if (te < (S32)nodep->mSavedGLTFOverrideMaterials.size()
- && nodep->mSavedGLTFOverrideMaterials[te].notNull()
- && asset_id.notNull())
+ // Enqueue update to server
+ if (asset_id.notNull())
{
// Restore overrides
LLGLTFMaterialList::queueModify(objectp, te, nodep->mSavedGLTFOverrideMaterials[te]);
@@ -2232,38 +2206,6 @@ void LLSelectMgr::selectionRevertGLTFMaterials()
}
} setfunc(mSelectedObjects);
getSelection()->applyToTEs(&setfunc);
-
- struct g : public LLSelectedObjectFunctor
- {
- virtual bool apply(LLViewerObject* object)
- {
- if (object && !object->permModify())
- {
- return false;
- }
-
- LLRenderMaterialParams* param_block = (LLRenderMaterialParams*)object->getParameterEntry(LLNetworkData::PARAMS_RENDER_MATERIAL);
- if (param_block)
- {
- if (param_block->isEmpty())
- {
- object->setHasRenderMaterialParams(false);
- }
- else if (object->hasRenderMaterialParams())
- {
- object->parameterChanged(LLNetworkData::PARAMS_RENDER_MATERIAL, true);
- }
- else
- {
- object->setHasRenderMaterialParams(true);
- }
- }
-
- object->sendTEUpdate();
- return true;
- }
- } sendfunc;
- getSelection()->applyToObjects(&sendfunc);
}
void LLSelectMgr::selectionSetBumpmap(U8 bumpmap, const LLUUID &image_id)