diff options
| author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-05-27 22:44:47 +0300 |
|---|---|---|
| committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-05-27 22:44:47 +0300 |
| commit | e611a30fe742dbae02d20062532ca92473da9bed (patch) | |
| tree | 36ba084c22f962f2e7a5aa272226c3772a5ed122 /indra/newview/llpreviewanim.cpp | |
| parent | 54a80085d75f2e286b29c708ae08d5f1e401ce0d (diff) | |
SL-14076 Fix motion preloading
Diffstat (limited to 'indra/newview/llpreviewanim.cpp')
| -rw-r--r-- | indra/newview/llpreviewanim.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/indra/newview/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp index d29609fc1e..97f1dcd5d0 100644 --- a/indra/newview/llpreviewanim.cpp +++ b/indra/newview/llpreviewanim.cpp @@ -53,13 +53,6 @@ LLPreviewAnim::LLPreviewAnim(const LLSD& key) // virtual BOOL LLPreviewAnim::postBuild() { - const LLInventoryItem* item = getItem(); - if(item) - { - pMotion = gAgentAvatarp->createMotion(item->getAssetUUID()); // preload the animation - getChild<LLUICtrl>("desc")->setValue(item->getDescription()); - } - childSetCommitCallback("desc", LLPreview::onText, this); getChild<LLLineEditor>("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); getChild<LLTextBox>("adv_trigger")->setClickedCallback(boost::bind(&LLPreviewAnim::showAdvanced, this)); @@ -73,7 +66,6 @@ BOOL LLPreviewAnim::postBuild() return LLPreview::postBuild(); } -// static // llinventorybridge also calls into here void LLPreviewAnim::play(const LLSD& param) { @@ -171,6 +163,20 @@ void LLPreviewAnim::draw() } // virtual +void LLPreviewAnim::refreshFromItem() +{ + const LLInventoryItem* item = getItem(); + if (!item) + { + return; + } + + // Preload motion + pMotion = gAgentAvatarp->createMotion(item->getAssetUUID()); + + LLPreview::refreshFromItem(); +} + void LLPreviewAnim::cleanup() { this->mItemID = LLUUID::null; |
