From 0918958507c9140cca0f4026ecef210eac9aef3a Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Fri, 17 Sep 2021 16:45:56 +0100
Subject: [PATCH] SL-15999 - disable various types of loading in noninteractive
 mode

---
 indra/newview/llviewerobject.cpp     | 19 +++++++++++++++----
 indra/newview/llviewerobjectlist.cpp |  5 +++--
 indra/newview/pipeline.cpp           |  8 ++++----
 3 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index b88baf6aa72..1852d4980ff 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -153,13 +153,21 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco
     LL_DEBUGS("ObjectUpdate") << "creating " << id << LL_ENDL;
     dumpStack("ObjectUpdateStack");
     
+	static LLCachedControl<bool> s_non_interactive(gSavedSettings, "NonInteractive", false);
+	
 	LLViewerObject *res = NULL;
 	LL_RECORD_BLOCK_TIME(FTM_CREATE_OBJECT);
 	
 	switch (pcode)
 	{
 	case LL_PCODE_VOLUME:
-	  res = new LLVOVolume(id, pcode, regionp); break;
+	{
+		if (!s_non_interactive)
+		{
+			res = new LLVOVolume(id, pcode, regionp); break;
+		}
+		break;
+	}
 	case LL_PCODE_LEGACY_AVATAR:
 	{
 		if (id == gAgentID)
@@ -193,9 +201,12 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco
         }
 		else
 		{
-			LLVOAvatar *avatar = new LLVOAvatar(id, pcode, regionp); 
-			avatar->initInstance();
-			res = avatar;
+			if (!s_non_interactive)
+			{
+				LLVOAvatar *avatar = new LLVOAvatar(id, pcode, regionp); 
+				avatar->initInstance();
+				res = avatar;
+			}
 		}
 		break;
 	}
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index 63e48d1dd09..9fe80b38d64 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -80,6 +80,7 @@
 #include "llfloaterperms.h"
 #include "llvocache.h"
 #include "llcorehttputil.h"
+#include "llstartup.h"
 
 #include <algorithm>
 #include <iterator>
@@ -303,9 +304,10 @@ static LLTrace::BlockTimerStatHandle FTM_PROCESS_OBJECTS("Process Objects");
 
 LLViewerObject* LLViewerObjectList::processObjectUpdateFromCache(LLVOCacheEntry* entry, LLViewerRegion* regionp)
 {
+	static LLCachedControl<bool> s_non_interactive(gSavedSettings, "NonInteractive", false);
 	LLDataPacker *cached_dpp = entry->getDP();
 
-	if (!cached_dpp)
+	if (!cached_dpp || s_non_interactive)
 	{
 		return NULL; //nothing cached.
 	}
@@ -2051,7 +2053,6 @@ LLViewerObject *LLViewerObjectList::createObjectFromCache(const LLPCode pcode, L
 LLViewerObject *LLViewerObjectList::createObject(const LLPCode pcode, LLViewerRegion *regionp,
 												 const LLUUID &uuid, const U32 local_id, const LLHost &sender)
 {
-	
 	LLUUID fullid;
 	if (uuid == LLUUID::null)
 	{
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 6d2eafd7c00..43ae0c2e763 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -487,10 +487,10 @@ void LLPipeline::init()
 	{
 		clearAllRenderTypes();
 	}
-	else if (gSavedSettings.getBOOL("NonInteractive"))
-	{
-		clearAllRenderTypes();
-	}
+	//else if (gSavedSettings.getBOOL("NonInteractive"))
+//	{
+	//	clearAllRenderTypes();
+	//}
 	else
 	{
 		setAllRenderTypes(); // By default, all rendering types start enabled
-- 
GitLab