From 9dd3f07e8886d804abba1f3003d934f32614c4a4 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 22 Jan 2018 13:50:51 +0100 Subject: [PATCH] FIRE-6155: Previewing an animation to upload while walking/sitting/flying results in the avatar getting stuck in that animation --- indra/newview/llfloaterbvhpreview.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/indra/newview/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp index fcd4b388f6..34e8d394f3 100644 --- a/indra/newview/llfloaterbvhpreview.cpp +++ b/indra/newview/llfloaterbvhpreview.cpp @@ -491,16 +491,16 @@ BOOL LLFloaterBvhPreview::loadBVH() void LLFloaterBvhPreview::unloadMotion() { if (mMotionID.notNull() && mAnimPreview && mUseOwnAvatar) - { + { resetMotion(); // Preview on own avatar //mAnimPreview->getDummyAvatar()->removeMotion(mMotionID); mAnimPreview->getPreviewAvatar(this)->removeMotion(mMotionID); // - LLKeyframeDataCache::removeKeyframeData(mMotionID); + LLKeyframeDataCache::removeKeyframeData(mMotionID); } - mMotionID.setNull(); + mMotionID.setNull(); mAnimPreview = NULL; } // @@ -510,19 +510,23 @@ void LLFloaterBvhPreview::unloadMotion() //----------------------------------------------------------------------------- LLFloaterBvhPreview::~LLFloaterBvhPreview() { - // Reload animation from disk - //mAnimPreview = NULL; - unloadMotion(); - // + mAnimPreview = NULL; // Preview on own avatar if (mUseOwnAvatar) { sOwnAvatarInstanceCount--; + if (mMotionID.notNull()) + { + LLKeyframeDataCache::removeKeyframeData(mMotionID); + } + if (sOwnAvatarInstanceCount == 0 && isAgentAvatarValid()) { + gAgentAvatarp->deactivateAllMotions(); gAgentAvatarp->startDefaultMotions(); + gAgentAvatarp->startMotion(ANIM_AGENT_STAND); } } //