From ae40b68ba7fb9ea9c308c0dcb01d19e3d218aeaa Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 1 Nov 2017 22:07:42 +0100 Subject: SL-830, SL-831 - no linking if any of the roots is animated object. isAnimatedObject() just uses check against extended mesh flag of the root. On select, LLVOVolume marks whole linkset for update if animated object. --- indra/newview/llselectmgr.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 81fd228997..e8b2d1ec8c 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -691,7 +691,7 @@ bool LLSelectMgr::enableLinkObjects() new_value = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly); } } - if (!LLSelectMgr::getInstance()->getSelection()->checkAnimatedObjectEstTris()) + if (!LLSelectMgr::getInstance()->getSelection()->checkAnimatedObjectLinkable()) { new_value = false; } @@ -7434,10 +7434,9 @@ bool LLObjectSelection::checkAnimatedObjectEstTris() F32 est_tris = 0; F32 max_tris = 0; S32 anim_count = 0; - for (root_iterator iter = root_begin(); iter != root_end(); ) + for (root_iterator iter = root_begin(); iter != root_end(); ++iter) { - root_iterator nextiter = iter++; - LLViewerObject* object = (*nextiter)->getObject(); + LLViewerObject* object = (*iter)->getObject(); if (!object) continue; if (object->isAnimatedObject()) @@ -7450,6 +7449,20 @@ bool LLObjectSelection::checkAnimatedObjectEstTris() return anim_count==0 || est_tris <= max_tris; } +bool LLObjectSelection::checkAnimatedObjectLinkable() +{ + // Can't link if any of the roots is currently an animated object + for (root_iterator iter = root_begin(); iter != root_end(); ++iter) + { + LLViewerObject* objectp = (*iter)->getObject(); + if (objectp && objectp->isAnimatedObject()) + { + return false; + } + } + return true; +} + bool LLObjectSelection::applyToRootObjects(LLSelectedObjectFunctor* func, bool firstonly) { bool result = firstonly ? false : true; -- cgit v1.2.3