diff options
| author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2024-11-07 16:35:13 +0200 | 
|---|---|---|
| committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2025-01-28 20:48:44 +0200 | 
| commit | 142cf21cc111c7d75f4d75bab2b35364fbaf3624 (patch) | |
| tree | 65883f9110b23f5cffce83661a8b3c98b913d6ae | |
| parent | a428b7dfbd7d5b766b2ae6e4fbd2c8c510ee19a1 (diff) | |
viewer#3037 hasPendingAttachedMeshes wasn't checking some objects
| -rw-r--r-- | indra/newview/llvoavatar.cpp | 116 | 
1 files changed, 66 insertions, 50 deletions
| diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7bc9d06f9a..1ab27d752d 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -682,7 +682,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,      mFullyLoaded(false),      mPreviousFullyLoaded(false),      mFullyLoadedInitialized(false), -    mLastCloudAttachmentCount(0), +    mLastCloudAttachmentCount(-1),      mVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN),      mLoadedCallbacksPaused(false),      mLoadedCallbackTextures(0), @@ -7710,6 +7710,64 @@ void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO )      }  } +bool check_object_for_mesh_loading(LLViewerObject* objectp) +{ +    if (!objectp || !objectp->getVolume()) +    { +        return false; +    } +    LLVolume* volp = objectp->getVolume(); +    const LLUUID& mesh_id = volp->getParams().getSculptID(); +    if (mesh_id.isNull()) +    { +        // No mesh nor skin info needed +        return false; +    } + +    if (volp->isMeshAssetUnavaliable()) +    { +        // Mesh failed to load, do not expect it +        return false; +    } + +    if (!objectp->mDrawable) +    { +        return false; +    } + +    LLVOVolume* pvobj = objectp->mDrawable->getVOVolume(); +    if (pvobj) +    { +        if (!pvobj->isMesh()) +        { +            // Not a mesh +            return false; +        } + +        if (!volp->isMeshAssetLoaded()) +        { +            // Waiting for mesh +            return true; +        } + +        const LLMeshSkinInfo* skin_data = pvobj->getSkinInfo(); +        if (skin_data) +        { +            // Skin info present, done +            return false; +        } + +        if (pvobj->isSkinInfoUnavaliable()) +        { +            // Load failed or info not present, don't expect it +            return false; +        } +    } + +    // object is not ready +    return true; +} +  bool LLVOAvatar::hasPendingAttachedMeshes()  {      for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); @@ -7724,62 +7782,20 @@ bool LLVOAvatar::hasPendingAttachedMeshes()                   ++attachment_iter)              {                  LLViewerObject* objectp = attachment_iter->get(); -                if (objectp) +                if (objectp && !objectp->isDead())                  { +                    if (check_object_for_mesh_loading(objectp)) +                    { +                        return true; +                    }                      LLViewerObject::const_child_list_t& child_list = objectp->getChildren();                      for (LLViewerObject::child_list_t::const_iterator iter1 = child_list.begin();                           iter1 != child_list.end(); ++iter1)                      {                          LLViewerObject* objectchild = *iter1; -                        if (objectchild && objectchild->getVolume()) +                        if (check_object_for_mesh_loading(objectchild))                          { -                            const LLUUID& mesh_id = objectchild->getVolume()->getParams().getSculptID(); -                            if (mesh_id.isNull()) -                            { -                                // No mesh nor skin info needed -                                continue; -                            } - -                            if (objectchild->getVolume()->isMeshAssetUnavaliable()) -                            { -                                // Mesh failed to load, do not expect it -                                continue; -                            } - -                            if (objectchild->mDrawable) -                            { -                                LLVOVolume* pvobj = objectchild->mDrawable->getVOVolume(); -                                if (pvobj) -                                { -                                    if (!pvobj->isMesh()) -                                    { -                                        // Not a mesh -                                        continue; -                                    } - -                                    if (!objectchild->getVolume()->isMeshAssetLoaded()) -                                    { -                                        // Waiting for mesh -                                        return true; -                                    } - -                                    const LLMeshSkinInfo* skin_data = pvobj->getSkinInfo(); -                                    if (skin_data) -                                    { -                                        // Skin info present, done -                                        continue; -                                    } - -                                    if (pvobj->isSkinInfoUnavaliable()) -                                    { -                                        // Load failed or info not present, don't expect it -                                        continue; -                                    } -                                } - -                                // objectchild is not ready -                                return true; -                            } +                            return true;                          }                      }                  } | 
