diff options
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r-- | indra/newview/llvovolume.cpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 7192b4a196..aa50122ff0 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1445,7 +1445,7 @@ BOOL LLVOVolume::setParent(LLViewerObject* parent) gPipeline.markMoved(mDrawable); gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE); } - updateAnimatedObjectStateOnReparent(old_parent, parent); + onReparent(old_parent, parent); } return ret ; @@ -3427,8 +3427,10 @@ bool LLVOVolume::isAnimatedObject() const // Called any time parenting changes for a volume. Update flags and // control av accordingly. This is called after parent has been -// changed to new_parent. -void LLVOVolume::updateAnimatedObjectStateOnReparent(LLViewerObject *old_parent, LLViewerObject *new_parent) +// changed to new_parent, but before new_parent's mChildList has changed. + +// virtual +void LLVOVolume::onReparent(LLViewerObject *old_parent, LLViewerObject *new_parent) { LLVOVolume *old_volp = dynamic_cast<LLVOVolume*>(old_parent); @@ -3442,11 +3444,6 @@ void LLVOVolume::updateAnimatedObjectStateOnReparent(LLViewerObject *old_parent, mControlAvatar = NULL; av->markForDeath(); } - // If this succeeds now, it's because the new_parent is an animated object - if (isAnimatedObject() && getControlAvatar()) - { - getControlAvatar()->addAttachmentOverridesForObject(this); - } } if (old_volp && old_volp->isAnimatedObject()) { @@ -3454,10 +3451,25 @@ void LLVOVolume::updateAnimatedObjectStateOnReparent(LLViewerObject *old_parent, { // We have been removed from an animated object, need to do cleanup. old_volp->getControlAvatar()->rebuildAttachmentOverrides(); + old_volp->getControlAvatar()->updateAnimations(); } } } +// This needs to be called after onReparent(), because mChildList is +// not updated until the end of LLViewerObject::addChild() + +// virtual +void LLVOVolume::afterReparent() +{ + // If this succeeds now, it's because the new parent is an animated object + if (isAnimatedObject() && getControlAvatar()) + { + getControlAvatar()->addAttachmentOverridesForObject(this); + getControlAvatar()->updateAnimations(); + } +} + //---------------------------------------------------------------------------- void LLVOVolume::generateSilhouette(LLSelectNode* nodep, const LLVector3& view_point) |