summaryrefslogtreecommitdiff
path: root/indra/llcharacter
diff options
context:
space:
mode:
authorAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2026-06-26 21:05:13 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2026-07-01 20:01:14 +0300
commit4e0283133e87035c16fe2341748a2d68aa1a0302 (patch)
treeb3a74b92e3a9ae92f8e3fffa98bff448923a5721 /indra/llcharacter
parentdc58a8730bf6422d51f2ecf457e8a973fb99b964 (diff)
#5962 Optimize writeWearablesToAvatar
Diffstat (limited to 'indra/llcharacter')
-rw-r--r--indra/llcharacter/llcharacter.cpp25
-rw-r--r--indra/llcharacter/llcharacter.h1
-rw-r--r--indra/llcharacter/llvisualparam.h1
3 files changed, 27 insertions, 0 deletions
diff --git a/indra/llcharacter/llcharacter.cpp b/indra/llcharacter/llcharacter.cpp
index 8efcd9dd29..6a66c06b62 100644
--- a/indra/llcharacter/llcharacter.cpp
+++ b/indra/llcharacter/llcharacter.cpp
@@ -307,6 +307,31 @@ bool LLCharacter::setVisualParamWeight(S32 index, F32 weight)
}
//-----------------------------------------------------------------------------
+// setVisualParamWeight()
+//-----------------------------------------------------------------------------
+bool LLCharacter::setVisualParamWeight(S32 index, S32 type, F32 weight)
+{
+ visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index);
+ if (index_iter != mVisualParamIndexMap.end())
+ {
+ LLVisualParam* param = index_iter->second;
+ if (param->getWearableType() == type)
+ {
+ param->setWeight(weight);
+ return true;
+ }
+ else
+ {
+ // setVisualParamWeight at the moment is only used in writeToAvatar.
+ // The type is supposed to match since wearable is a subset of avatar by type.
+ llassert(false);
+ LL_WARNS() << "Visual param index " << index << " is not of type " << type << LL_ENDL;
+ }
+ }
+ return false;
+}
+
+//-----------------------------------------------------------------------------
// getVisualParamWeight()
//-----------------------------------------------------------------------------
F32 LLCharacter::getVisualParamWeight(LLVisualParam *which_param)
diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h
index 079bcd132a..689e3f7d7c 100644
--- a/indra/llcharacter/llcharacter.h
+++ b/indra/llcharacter/llcharacter.h
@@ -195,6 +195,7 @@ public:
virtual bool setVisualParamWeight(const LLVisualParam *which_param, F32 weight);
virtual bool setVisualParamWeight(const char* param_name, F32 weight);
virtual bool setVisualParamWeight(S32 index, F32 weight);
+ virtual bool setVisualParamWeight(S32 index, S32 type, F32 weight);
// get visual param weight by param or name
F32 getVisualParamWeight(LLVisualParam *distortion);
diff --git a/indra/llcharacter/llvisualparam.h b/indra/llcharacter/llvisualparam.h
index 8d2c4a3723..0ed47be064 100644
--- a/indra/llcharacter/llvisualparam.h
+++ b/indra/llcharacter/llvisualparam.h
@@ -120,6 +120,7 @@ public:
// Pure virtuals
//virtual bool parseData( LLXmlTreeNode *node ) = 0;
virtual void apply( ESex avatar_sex ) = 0;
+ virtual S32 getWearableType() const = 0;
// Default functions
virtual void setWeight(F32 weight);
virtual void setAnimationTarget( F32 target_value);