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.
master
Beq 2025-06-03 22:12:44 +01:00
parent 76942456fd
commit dfe9930232
3 changed files with 56 additions and 0 deletions

View File

@ -26379,5 +26379,16 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<integer>0</integer>
</map>
<key>FSAutoHideDefaultBodyParts</key>
<map>
<key>Comment</key>
<string>Hide default body, until all attachments are available.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
</map>
</llsd>

View File

@ -9625,6 +9625,13 @@ bool LLVOAvatar::processFullyLoadedChange(bool loading)
mNeedsImpostorUpdate = true;
mLastImpostorUpdateReason = 6;
}
// <FS:Beq> Automatically hide the default body until we know which parts we need
static LLCachedControl<bool> auto_hide_default_body(gSavedSettings, "FSAutoHideDefaultBodyParts");
if (auto_hide_default_body && fully_loaded_changed)
{
updateMeshVisibility();
}
// </FS:Beq>
return changed;
}
@ -9822,6 +9829,18 @@ void LLVOAvatar::debugColorizeSubMeshes(U32 i, const LLColor4& color)
//-----------------------------------------------------------------------------
void LLVOAvatar::updateMeshVisibility()
{
// <FS:Beq> Automatically hide the default body until we know which parts we need
static LLCachedControl<bool> auto_hide_default_body(gSavedSettings, "FSAutoHideDefaultBodyParts");
// This aims to avoid most cases of "flesh-muppet"/"BOM-Monster"
// EARLYEXIT: hide all defaultbody joints if we are still “cloud”, “gray”,
// downloading baked textures, or waiting for attachments.
//
if ( auto_hide_default_body && getRezzedStatus() < 4 )
{
hideAllDefaultBodyJoints();
return;
}
// </FS:Beq>
bool bake_flag[BAKED_NUM_INDICES];
memset(bake_flag, 0, BAKED_NUM_INDICES*sizeof(bool));
@ -9926,6 +9945,31 @@ void LLVOAvatar::updateMeshVisibility()
}
}
// <FS:Beq> 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);
}
}
}
// </FS:Beq>
//-----------------------------------------------------------------------------
// updateMeshTextures()
// Uses the current TE values to set the meshes' and layersets' textures.

View File

@ -852,6 +852,7 @@ public:
virtual void dirtyMesh(); // Dirty the avatar mesh
void updateMeshData();
void updateMeshVisibility();
void hideAllDefaultBodyJoints(); // <FS:Beq>
LLViewerTexture* getBakedTexture(const U8 te);
// Matrix palette cache entry