From 70156605e283326e9476908141c44c197f9c6d18 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" <vir@lindenlab.com> Date: Fri, 22 Apr 2016 14:51:57 -0400 Subject: [PATCH] SL-374 - don't allow sliders to modify joint positions if there's already a mesh-imposed override in place. --- indra/llappearance/llpolyskeletaldistortion.cpp | 3 ++- indra/llcharacter/lljoint.cpp | 16 +++++++++++++++- indra/llcharacter/lljoint.h | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index 722965af287..484969a9d95 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -226,7 +226,8 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex ) LLVector3 positionDelta = iter->second; newPosition = newPosition + (effective_weight * positionDelta) - (mLastWeight * positionDelta); // SL-315 - joint->setPosition(newPosition); + // BENTO - allow attachment positions to override requests from the params. + joint->setPosition(newPosition, true); } if (mLastWeight != mCurWeight && !mIsAnimating) diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index 3ad919072d6..8365ab8eb17 100755 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -336,8 +336,22 @@ bool do_debug_joint(const std::string& name) //-------------------------------------------------------------------- // setPosition() //-------------------------------------------------------------------- -void LLJoint::setPosition( const LLVector3& pos ) +void LLJoint::setPosition( const LLVector3& requested_pos, bool apply_attachment_overrides ) { + LLVector3 pos(requested_pos); + + LLVector3 active_override; + LLUUID mesh_id; + if (apply_attachment_overrides && m_attachmentOverrides.findActiveOverride(mesh_id,active_override)) + { + if (pos != active_override && do_debug_joint(getName())) + { + LLScopedContextString str("setPosition"); + LL_DEBUGS("Avatar") << " joint " << getName() << " requested_pos " << requested_pos + << " overriden by attachment " << active_override << LL_ENDL; + } + pos = active_override; + } if ((pos != getPosition()) && do_debug_joint(getName())) { LLScopedContextString str("setPosition"); diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index c967770cff5..d2c573864bd 100755 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -209,7 +209,7 @@ class LLJoint // get/set local position const LLVector3& getPosition(); - void setPosition( const LLVector3& pos ); + void setPosition( const LLVector3& pos, bool apply_attachment_overrides = false ); // Tracks the default position defined by the skeleton void setDefaultPosition( const LLVector3& pos ); -- GitLab