From dfe9930232aa66e04ef58166fadd959be282405f Mon Sep 17 00:00:00 2001 From: Beq Date: Tue, 3 Jun 2025 22:12:44 +0100 Subject: [PATCH] Hide the default avatar on-rez. Hides the default avatar until the avatar is loaded and then unmasks the default avatar selectively based upon worn mesh. Should reduce the bleed through of linden body and the flesh-muppet cyclops. Note: Only prevents issues due to arrival of attachments and will not fix the underlying issues with a broken COF. --- indra/newview/app_settings/settings.xml | 11 +++++++ indra/newview/llvoavatar.cpp | 44 +++++++++++++++++++++++++ indra/newview/llvoavatar.h | 1 + 3 files changed, 56 insertions(+) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c3243b7dae..b1568a07d9 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -26379,5 +26379,16 @@ Change of this parameter will affect the layout of buttons in notification toast Value 0 + FSAutoHideDefaultBodyParts + + Comment + Hide default body, until all attachments are available. + Persist + 1 + Type + Boolean + Value + 1 + diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 135bbe14ed..ff67922ccd 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -9625,6 +9625,13 @@ bool LLVOAvatar::processFullyLoadedChange(bool loading) mNeedsImpostorUpdate = true; mLastImpostorUpdateReason = 6; } + // Automatically hide the default body until we know which parts we need + static LLCachedControl auto_hide_default_body(gSavedSettings, "FSAutoHideDefaultBodyParts"); + if (auto_hide_default_body && fully_loaded_changed) + { + updateMeshVisibility(); + } + // return changed; } @@ -9822,6 +9829,18 @@ void LLVOAvatar::debugColorizeSubMeshes(U32 i, const LLColor4& color) //----------------------------------------------------------------------------- void LLVOAvatar::updateMeshVisibility() { + // Automatically hide the default body until we know which parts we need + static LLCachedControl auto_hide_default_body(gSavedSettings, "FSAutoHideDefaultBodyParts"); + // This aims to avoid most cases of "flesh-muppet"/"BOM-Monster" + // EARLY‐EXIT: hide all default‐body joints if we are still “cloud”, “gray”, + // downloading baked textures, or waiting for attachments. + // + if ( auto_hide_default_body && getRezzedStatus() < 4 ) + { + hideAllDefaultBodyJoints(); + return; + } + // bool bake_flag[BAKED_NUM_INDICES]; memset(bake_flag, 0, BAKED_NUM_INDICES*sizeof(bool)); @@ -9926,6 +9945,31 @@ void LLVOAvatar::updateMeshVisibility() } } +// Automatically hide the default body until we know which parts we need +void LLVOAvatar::hideAllDefaultBodyJoints() +{ + static const S32 jointIDs[] = + { + MESH_ID_HAIR, + MESH_ID_HEAD, + MESH_ID_SKIRT, + MESH_ID_UPPER_BODY, + MESH_ID_LOWER_BODY, + MESH_ID_EYEBALL_LEFT, + MESH_ID_EYEBALL_RIGHT, + MESH_ID_EYELASH + }; + + for (S32 idx : jointIDs) + { + LLAvatarJoint* joint = getViewerJoint(idx); + if (joint) + { + joint->setVisible(false, true); + } + } +} +// //----------------------------------------------------------------------------- // updateMeshTextures() // Uses the current TE values to set the meshes' and layersets' textures. diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 4cb80380fb..de68e03689 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -852,6 +852,7 @@ public: virtual void dirtyMesh(); // Dirty the avatar mesh void updateMeshData(); void updateMeshVisibility(); + void hideAllDefaultBodyJoints(); // LLViewerTexture* getBakedTexture(const U8 te); // Matrix palette cache entry