From d444e9d5b4871609b9d01d78bf8d6833afd3da45 Mon Sep 17 00:00:00 2001 From: Zi Ree Date: Sun, 23 Oct 2022 19:09:15 +0200 Subject: [PATCH] FIRE-32315: Animation preview sometimes fails when FS AO is enabled --- indra/newview/llfloaterbvhpreview.cpp | 15 +++++++++++++++ indra/newview/llfloaterbvhpreview.h | 3 +++ 2 files changed, 18 insertions(+) diff --git a/indra/newview/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp index b8fe84fadf..b35a1210e9 100644 --- a/indra/newview/llfloaterbvhpreview.cpp +++ b/indra/newview/llfloaterbvhpreview.cpp @@ -67,6 +67,8 @@ #include "llviewercontrol.h" // for gSavedSettings #include "llvoavatarself.h" +#include "aoengine.h" // FIRE-32315: Animation preview sometimes fails when FS AO is enabled + S32 LLFloaterBvhPreview::sOwnAvatarInstanceCount = 0; // Preview on own avatar const S32 PREVIEW_BORDER_WIDTH = 2; @@ -137,6 +139,13 @@ LLFloaterBvhPreview::LLFloaterBvhPreview(const std::string& filename) : if (mUseOwnAvatar) { sOwnAvatarInstanceCount++; + + // // Switch FS AO off during preview + mAOEnabled = gSavedPerAccountSettings.getBOOL("UseAO"); + if (mAOEnabled) + { + AOEngine::getInstance()->enable(false); + } } // @@ -535,6 +544,12 @@ LLFloaterBvhPreview::~LLFloaterBvhPreview() gAgentAvatarp->startDefaultMotions(); gAgentAvatarp->startMotion(ANIM_AGENT_STAND); } + + // Switch FS AO back on if it was disabled during preview + if (mAOEnabled) + { + AOEngine::getInstance()->enable(true); + } } // diff --git a/indra/newview/llfloaterbvhpreview.h b/indra/newview/llfloaterbvhpreview.h index 89fffe13cb..ec3122821a 100644 --- a/indra/newview/llfloaterbvhpreview.h +++ b/indra/newview/llfloaterbvhpreview.h @@ -158,6 +158,9 @@ protected: // FIRE-17277: Allow entering Loop In/Loop Out as frames S32 mNumFrames; + + // FIRE-32315: Animation preview sometimes fails when FS AO is enabled + bool mAOEnabled; }; #endif // LL_LLFLOATERBVHPREVIEW_H