diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2018-01-22 22:08:06 +0000 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2018-01-22 22:08:06 +0000 |
commit | 26add5700d88338b94ce891892948998b0468131 (patch) | |
tree | 592c0295c96f3b48f9c75a0c0452709abe305bd3 /indra/newview/llvovolume.cpp | |
parent | cddb530b4de1521f59261dd53498e49a4050191b (diff) |
MAINT-8159 - animation state management during link/unlink commands
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) |