triage#59 Render Friends Only option

An option for performance testing, video recording or taking photos, so
that unexpected people won't appear in your photos or tests.
master
Andrey Kleshchev 2024-05-20 17:16:18 +03:00 committed by Andrey Kleshchev
parent e1493a10b4
commit 6d6eabca44
8 changed files with 70 additions and 0 deletions

View File

@ -10910,6 +10910,17 @@
<key>Value</key>
<integer>1</integer>
</map>
<key>RenderAvatarFriendsOnly</key>
<map>
<key>Comment</key>
<string>When enabled hides all avatars that aren't friends. Does not affect inworld control avatars (animeshes), nor self.</string>
<key>Persist</key>
<integer>0</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<real>0</real>
</map>
<key>RenderAvatarComplexityMode</key>
<map>
<key>Comment</key>

View File

@ -85,6 +85,7 @@ public:
virtual bool shouldRenderRigged() const;
virtual bool isImpostor();
virtual bool isBuddy() const { return false; }
bool mPlaying;

View File

@ -370,6 +370,15 @@ void LLDrawPoolAvatar::renderShadow(S32 pass)
return;
}
LLCachedControl<bool> debug_invisible(gSavedSettings, "RenderAvatarFriendsOnly", false);
if (debug_invisible()
&& !avatarp->isControlAvatar()
&& !avatarp->isSelf()
&& !avatarp->isBuddy())
{
return;
}
LLVOAvatar::AvatarOverallAppearance oa = avatarp->getOverallAppearance();
bool impostor = !LLPipeline::sImpostorRender && avatarp->isImpostor();
// no shadows if the shadows are causing this avatar to breach the limit.
@ -723,6 +732,17 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
return;
}
LLCachedControl<bool> friends_only(gSavedSettings, "RenderAvatarFriendsOnly", false);
if (!single_avatar
&& friends_only()
&& !avatarp->isUIAvatar()
&& !avatarp->isControlAvatar()
&& !avatarp->isSelf()
&& !avatarp->isBuddy())
{
return;
}
bool impostor = !LLPipeline::sImpostorRender && avatarp->isImpostor() && !single_avatar;
if (( avatarp->isInMuteList()

View File

@ -39,6 +39,7 @@ public:
LLUIAvatar(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
virtual void initInstance(); // Called after construction to initialize the class.
virtual ~LLUIAvatar();
virtual bool isBuddy() const { return false; }
};
#endif //LL_CONTROLAVATAR_H

View File

@ -2586,6 +2586,27 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time)
LL_INFOS() << "Warning! Idle on dead avatar" << LL_ENDL;
return;
}
LLCachedControl<bool> friends_only(gSavedSettings, "RenderAvatarFriendsOnly", false);
if (friends_only()
&& !isUIAvatar()
&& !isControlAvatar()
&& !isSelf()
&& !isBuddy())
{
if (mNameText)
{
mNameIsSet = false;
mNameText->markDead();
mNameText = NULL;
sNumVisibleChatBubbles--;
}
deleteParticleSource();
mVoiceVisualizer->setVoiceEnabled(false);
return;
}
// record time and refresh "tooSlow" status
updateTooSlow();
@ -11722,4 +11743,8 @@ F32 LLVOAvatar::getAverageGPURenderTime()
return ret;
}
bool LLVOAvatar::isBuddy() const
{
return LLAvatarTracker::instance().isBuddy(getID());
}

View File

@ -253,6 +253,7 @@ public:
virtual bool isControlAvatar() const { return mIsControlAvatar; } // True if this avatar is a control av (no associated user)
virtual bool isUIAvatar() const { return mIsUIAvatar; } // True if this avatar is a supplemental av used in some UI views (no associated user)
virtual bool isBuddy() const;
// If this is an attachment, return the avatar it is attached to. Otherwise NULL.
virtual const LLVOAvatar *getAttachedAvatar() const { return NULL; }

View File

@ -110,6 +110,7 @@ private:
public:
/*virtual*/ bool isSelf() const { return true; }
virtual bool isBuddy() const { return false; }
/*virtual*/ bool isValid() const;
//--------------------------------------------------------------------

View File

@ -3843,6 +3843,16 @@ function="World.EnvPreset"
function="ToggleControl"
parameter="AllowSelectAvatar" />
</menu_item_check>
<menu_item_check
label="Render Only Friends"
name="Render Only Friends">
<menu_item_check.on_check
function="CheckControl"
parameter="RenderAvatarFriendsOnly" />
<menu_item_check.on_click
function="ToggleControl"
parameter="RenderAvatarFriendsOnly" />
</menu_item_check>
</menu>
<menu
create_jump_keys="true"