summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2018-04-06 20:29:32 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2018-04-06 20:29:32 +0100
commitb35cfb489a78110b705f7afe878d258523727fa6 (patch)
treec2ebd0244181b8461c50c6fb0418c963b83cbe27 /indra/newview/llvoavatar.cpp
parent501351915ce2df618241c5f6923cc0c0a869fdcd (diff)
MAINT-8239 - avatar remembers which meshes it knows overrides for, making some updates more efficient. addAttachmentOverrides() called in rebuildGeom()
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r--indra/newview/llvoavatar.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index edb7856de1..a31d48dc4f 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -5794,6 +5794,8 @@ void LLVOAvatar::clearAttachmentOverrides()
{
LLScopedContextString str("clearAttachmentOverrides " + getFullname());
+ mActiveOverrideMeshes.clear();
+
for (S32 i=0; i<LL_CHARACTER_MAX_ANIMATED_JOINTS; i++)
{
LLJoint *pJoint = getJoint(i);
@@ -5920,10 +5922,24 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo)
const F32 pelvisZOffset = pSkinData->mPelvisOffset;
const LLUUID& mesh_id = pSkinData->mMeshID;
- LL_DEBUGS("AnimatedObjects") << "adding attachment overrides for " << mesh_id << " to root object " << root_object->getID() << LL_ENDL;
+ bool mesh_overrides_loaded = (mActiveOverrideMeshes.find(mesh_id) != mActiveOverrideMeshes.end());
+ if (mesh_overrides_loaded)
+ {
+ LL_DEBUGS("AnimatedObjects") << "skipping add attachment overrides for " << mesh_id
+ << " to root object " << root_object->getID()
+ << ", already loaded"
+ << LL_ENDL;
+ }
+ else
+ {
+ LL_DEBUGS("AnimatedObjects") << "adding attachment overrides for " << mesh_id
+ << " to root object " << root_object->getID() << LL_ENDL;
+ }
bool fullRig = (jointCnt>=JOINT_COUNT_REQUIRED_FOR_FULLRIG) ? true : false;
- if ( fullRig )
+ if ( fullRig && !mesh_overrides_loaded )
{
+ mActiveOverrideMeshes.insert(mesh_id);
+
for ( int i=0; i<jointCnt; ++i )
{
std::string lookingForJoint = pSkinData->mJointNames[i].c_str();
@@ -6127,6 +6143,8 @@ void LLVOAvatar::removeAttachmentOverridesForObject(LLViewerObject *vo)
//-----------------------------------------------------------------------------
void LLVOAvatar::removeAttachmentOverridesForObject(const LLUUID& mesh_id)
{
+ mActiveOverrideMeshes.erase(mesh_id);
+
//Subsequent joints are relative to pelvis
avatar_joint_list_t::iterator iter = mSkeleton.begin();
avatar_joint_list_t::iterator end = mSkeleton.end();