Skip to content
Snippets Groups Projects
Commit 70156605 authored by Brad Payne (Vir Linden)'s avatar Brad Payne (Vir Linden)
Browse files

SL-374 - don't allow sliders to modify joint positions if there's already a...

SL-374 - don't allow sliders to modify joint positions if there's already a mesh-imposed override in place.
parent cad96c6d
No related branches found
No related tags found
No related merge requests found
...@@ -226,7 +226,8 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex ) ...@@ -226,7 +226,8 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex )
LLVector3 positionDelta = iter->second; LLVector3 positionDelta = iter->second;
newPosition = newPosition + (effective_weight * positionDelta) - (mLastWeight * positionDelta); newPosition = newPosition + (effective_weight * positionDelta) - (mLastWeight * positionDelta);
// SL-315 // SL-315
joint->setPosition(newPosition); // BENTO - allow attachment positions to override requests from the params.
joint->setPosition(newPosition, true);
} }
if (mLastWeight != mCurWeight && !mIsAnimating) if (mLastWeight != mCurWeight && !mIsAnimating)
......
...@@ -336,8 +336,22 @@ bool do_debug_joint(const std::string& name) ...@@ -336,8 +336,22 @@ bool do_debug_joint(const std::string& name)
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// setPosition() // 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())) if ((pos != getPosition()) && do_debug_joint(getName()))
{ {
LLScopedContextString str("setPosition"); LLScopedContextString str("setPosition");
......
...@@ -209,7 +209,7 @@ class LLJoint ...@@ -209,7 +209,7 @@ class LLJoint
// get/set local position // get/set local position
const LLVector3& getPosition(); 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 // Tracks the default position defined by the skeleton
void setDefaultPosition( const LLVector3& pos ); void setDefaultPosition( const LLVector3& pos );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment