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 | |
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')
-rw-r--r-- | indra/newview/llselectmgr.cpp | 21 | ||||
-rw-r--r-- | indra/newview/llselectmgr.h | 1 | ||||
-rw-r--r-- | indra/newview/llviewermessage.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llvovolume.cpp | 18 |
4 files changed, 33 insertions, 9 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; diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 4e79cb003d..fcbfd5fccd 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -341,6 +341,7 @@ public: // AXON validate a potential link against limits bool checkAnimatedObjectEstTris(); + bool checkAnimatedObjectLinkable(); // Apply functors to various subsets of the selected objects // If firstonly is FALSE, returns the AND of all apply() calls. diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 3834082f78..0f567ba5ac 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5113,7 +5113,7 @@ void process_object_animation(LLMessageSystem *mesgsys, void **user_data) S32 num_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_AnimationList); LL_DEBUGS("AXON") << "processing object animation requests, num_blocks " << num_blocks << LL_ENDL; -#if 0 +#if 1 if (!avatarp->mPlaying) { avatarp->mPlaying = true; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 004f335a5a..bb28d5d83e 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3413,6 +3413,8 @@ bool LLVOVolume::isAnimatedObject() const { LLVOVolume *root_vol = (LLVOVolume*)getRootEdit(); bool root_is_animated_flag = root_vol->getExtendedMeshFlags() & LLExtendedMeshParams::ANIMATED_MESH_ENABLED_FLAG; + return root_is_animated_flag; +#if 0 if (root_is_animated_flag) { bool root_can_be_animated = root_vol->canBeAnimatedObject(); @@ -3423,6 +3425,7 @@ bool LLVOVolume::isAnimatedObject() const } } return false; +#endif } // Make sure animated objects in a linkset are consistent. The rules are: @@ -4008,10 +4011,17 @@ void LLVOVolume::parameterChanged(U16 param_type, LLNetworkData* data, BOOL in_u void LLVOVolume::setSelected(BOOL sel) { LLViewerObject::setSelected(sel); - if (mDrawable.notNull()) - { - markForUpdate(TRUE); - } + if (isAnimatedObject()) + { + getRootEdit()->recursiveMarkForUpdate(TRUE); + } + else + { + if (mDrawable.notNull()) + { + markForUpdate(TRUE); + } + } } void LLVOVolume::updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) |