summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-05-20 17:16:18 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-05-20 19:34:42 +0300
commit6d6eabca44d08d5b97bfe3e941d2b9687c2246ea (patch)
tree40202fcf4d6226ebda64a1b2208e2d8931f29463
parente1493a10b46bb53af165e4f23fda0fedd3193269 (diff)
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.
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llcontrolavatar.h1
-rw-r--r--indra/newview/lldrawpoolavatar.cpp20
-rw-r--r--indra/newview/lluiavatar.h1
-rw-r--r--indra/newview/llvoavatar.cpp25
-rw-r--r--indra/newview/llvoavatar.h1
-rw-r--r--indra/newview/llvoavatarself.h1
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml10
8 files changed, 70 insertions, 0 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index bf556b9046..ed996e6832 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -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>
diff --git a/indra/newview/llcontrolavatar.h b/indra/newview/llcontrolavatar.h
index 7beefad191..fd1cda7a2c 100644
--- a/indra/newview/llcontrolavatar.h
+++ b/indra/newview/llcontrolavatar.h
@@ -85,6 +85,7 @@ public:
virtual bool shouldRenderRigged() const;
virtual bool isImpostor();
+ virtual bool isBuddy() const { return false; }
bool mPlaying;
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index 32f0e185ce..a07827d395 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -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()
diff --git a/indra/newview/lluiavatar.h b/indra/newview/lluiavatar.h
index bcdffedef2..d9fe003155 100644
--- a/indra/newview/lluiavatar.h
+++ b/indra/newview/lluiavatar.h
@@ -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
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 35fc82126a..e4f7e8292c 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -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());
+}
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 3f5e390af2..e5d232b792 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -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; }
diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h
index c7b61edd1c..46bac63d93 100644
--- a/indra/newview/llvoavatarself.h
+++ b/indra/newview/llvoavatarself.h
@@ -110,6 +110,7 @@ private:
public:
/*virtual*/ bool isSelf() const { return true; }
+ virtual bool isBuddy() const { return false; }
/*virtual*/ bool isValid() const;
//--------------------------------------------------------------------
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index a88e4757af..49f5dfec04 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -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"