From 74275f590e75fc8b1685b77a39529cc91ad084b9 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 15 Feb 2023 14:47:33 -0600
Subject: [PATCH] SL-18927 Warn *before* destroying content, not after. 
 Followup from last commit -- immediately apply scale to sphere probes.

---
 indra/newview/llpanelvolume.cpp                      | 8 ++++++++
 indra/newview/llreflectionmapmanager.cpp             | 2 ++
 indra/newview/skins/default/xui/en/notifications.xml | 2 +-
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp
index 0cbc2b0bad6..3c34d6ee65e 100644
--- a/indra/newview/llpanelvolume.cpp
+++ b/indra/newview/llpanelvolume.cpp
@@ -755,6 +755,7 @@ void LLPanelVolume::sendIsReflectionProbe()
     if (value && !old_value)
     { // has become a reflection probe, slam to a 10m sphere and pop up a message
         // warning people about the pitfalls of reflection probes
+#if 0
         auto* select_mgr = LLSelectMgr::getInstance();
 
         mObject->setScale(LLVector3(10.f, 10.f, 10.f));
@@ -768,6 +769,7 @@ void LLPanelVolume::sendIsReflectionProbe()
         params.getPathParams().setCurveType(LL_PCODE_PATH_CIRCLE);
         params.getProfileParams().setCurveType(LL_PCODE_PROFILE_CIRCLE_HALF);
         mObject->updateVolume(params);
+#endif
 
         LLNotificationsUtil::add("ReflectionProbeApplied");
     }
@@ -1343,6 +1345,12 @@ void LLPanelVolume::onCommitProbe(LLUICtrl* ctrl, void* userdata)
     if (volobjp->setReflectionProbeIsBox(is_box))
     {
         // make the volume match the probe
+        auto* select_mgr = LLSelectMgr::getInstance();
+
+        select_mgr->selectionUpdatePhantom(true);
+        select_mgr->selectionSetGLTFMaterial(LLUUID::null);
+        select_mgr->selectionSetAlphaOnly(0.f);
+
         U8 profile, path;
 
         if (!is_box)
diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp
index 8f342fc0bb2..4377f266337 100644
--- a/indra/newview/llreflectionmapmanager.cpp
+++ b/indra/newview/llreflectionmapmanager.cpp
@@ -802,6 +802,8 @@ void LLReflectionMapManager::updateUniforms()
             if (refmap->mViewerObject)
             { // have active manual probes live-track the object they're associated with
                 refmap->mOrigin.load3(refmap->mViewerObject->getPositionAgent().mV);
+                refmap->mRadius = refmap->mViewerObject->getScale().mV[0] * 0.5f;
+
             }
             modelview.affineTransform(refmap->mOrigin, oa);
             rpd.refSphere[count].set(oa.getF32ptr());
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 7cdf4af5c27..711be767645 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -12041,7 +12041,7 @@ Material successfully created.  Asset ID: [ASSET_ID]
     name="ReflectionProbeApplied"
     persist="true"
     type="alertmodal">
-    Your object has been set to the default Reflection Probe state, which is an invisible, phantom, 5m sphere.  To learn more about Reflection Probes and how to use them, see the Knowledge Base.
+    WARNING: You have made your object a Refelction Probe.  Continuing to manipulate the object while it is a probe will implicitly change the object to mimic its influence volume and will make irreversible changes to the object.  If you don't know what a reflection probe is, uncheck "Reflection Probe" immediately.  To learn more about Reflection Probes and how to use them, see https://wiki.secondlife.com/wiki/PBR_Materials#Understanding_and_Assisting_the_New_Reflections_System.
     <usetemplate ignoretext="Reflection Probe tips"
                  name="okignore"
                  yestext="OK"/>
-- 
GitLab