summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-11-07 16:35:13 +0200
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-11-07 20:24:10 +0200
commit4cec03671cd2a4ea3222bfaf4fd755ceaeb14231 (patch)
tree65f004f9156c5c903c521205fa5e98284b133218 /indra
parent56b93ddde257f6901ef28efa90b4e600f53384f5 (diff)
viewer#3037 hasPendingAttachedMeshes wasn't checking some objects
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llvoavatar.cpp116
1 files changed, 66 insertions, 50 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index bfed8b9d39..31be509b0b 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -683,7 +683,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
mFullyLoaded(false),
mPreviousFullyLoaded(false),
mFullyLoadedInitialized(false),
- mLastCloudAttachmentCount(0),
+ mLastCloudAttachmentCount(-1),
mVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN),
mLoadedCallbacksPaused(false),
mLoadedCallbackTextures(0),
@@ -7722,6 +7722,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();
@@ -7736,62 +7794,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;
}
}
}