diff options
| author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-11-01 22:07:42 +0100 |
|---|---|---|
| committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-11-01 22:07:42 +0100 |
| commit | ae40b68ba7fb9ea9c308c0dcb01d19e3d218aeaa (patch) | |
| tree | 35e95a5f00b80e4ab5ff7185a9c62f4bdfc84591 /indra/newview/llselectmgr.cpp | |
| parent | ef0e3bfdd92bb5faea633a14487f123dfeb2f5f1 (diff) | |
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.
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
| -rw-r--r-- | indra/newview/llselectmgr.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
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; |
