diff options
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r-- | indra/newview/llvoavatar.cpp | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 060e93ac9a..0688a57439 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5762,6 +5762,17 @@ void LLVOAvatar::clearAttachmentOverrides() pJoint->clearAttachmentScaleOverrides(); } } + + if (mPelvisFixups.count()>0) + { + mPelvisFixups.clear(); + LLJoint* pJointPelvis = getJoint("mPelvis"); + if (pJointPelvis) + { + pJointPelvis->setPosition( LLVector3( 0.0f, 0.0f, 0.0f) ); + } + postPelvisSetRecalc(); + } } //----------------------------------------------------------------------------- @@ -5771,6 +5782,8 @@ void LLVOAvatar::rebuildAttachmentOverrides() { LLScopedContextString str("rebuildAttachmentOverrides " + getFullname()); + clearAttachmentOverrides(); + // Handle the case that we're resetting the skeleton of an animated object. LLControlAvatar *control_av = dynamic_cast<LLControlAvatar*>(this); if (control_av) @@ -5806,7 +5819,7 @@ void LLVOAvatar::rebuildAttachmentOverrides() } //----------------------------------------------------------------------------- -// addAttachmentPosOverridesForObject +// addAttachmentOverridesForObject //----------------------------------------------------------------------------- void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo) { @@ -6638,6 +6651,11 @@ const LLViewerJointAttachment *LLVOAvatar::attachObject(LLViewerObject *viewer_o return 0; } + if (!viewer_object->isAnimatedObject()) + { + rebuildAttachmentOverrides(); + } + updateVisualComplexity(); if (viewer_object->isSelected()) @@ -6814,7 +6832,7 @@ void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO ) LLUUID mesh_id; if (getRiggedMeshID(pVO, mesh_id)) { - removeAttachmentOverridesForObject(mesh_id); + // FIXME this seems like an odd place for this code. if ( gAgentCamera.cameraCustomizeAvatar() ) { gAgent.unpauseAnimation(); @@ -6839,9 +6857,13 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object) if (attachment->isObjectAttached(viewer_object)) { updateVisualComplexity(); + bool is_animated_object = viewer_object->isAnimatedObject(); cleanupAttachedMesh( viewer_object ); - attachment->removeObject(viewer_object); + if (!is_animated_object) + { + rebuildAttachmentOverrides(); + } LL_DEBUGS() << "Detaching object " << viewer_object->mID << " from " << attachment->getName() << LL_ENDL; return TRUE; } |