From 27f8b19040231c3cfb637d31c0a8a1de8b061e8c Mon Sep 17 00:00:00 2001
From: Loren Shih <seraph@lindenlab.com>
Date: Wed, 30 Mar 2011 22:16:35 -0400
Subject: [PATCH] Increased butt physics range. Added more logic to not center
 camera during edit physics mode.

---
 indra/newview/llpolymesh.cpp                          |  4 ++--
 indra/newview/llsidepanelappearance.cpp               | 11 +++++++++++
 .../skins/default/xui/en/panel_edit_physics.xml       |  4 ++--
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp
index e736690da50..6d6fb2fa0ef 100644
--- a/indra/newview/llpolymesh.cpp
+++ b/indra/newview/llpolymesh.cpp
@@ -631,13 +631,13 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
 				if (!strcmp(morphName, "Small_Butt"))
 				{
 					mMorphData.insert(clone_morph_param(morph_data,
-									    LLVector3(0,0,0.01f),
+									    LLVector3(0,0,0.015f),
 									    "Butt_Physics_UpDown_Driven"));
 				}
 				if (!strcmp(morphName, "Small_Butt"))
 				{
 					mMorphData.insert(clone_morph_param(morph_data,
-									    LLVector3(0,0.01f,0),
+									    LLVector3(0,0.015f,0),
 									    "Butt_Physics_LeftRight_Driven"));
 				}
 			}
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp
index b3488a507a3..16729f045a0 100644
--- a/indra/newview/llsidepanelappearance.cpp
+++ b/indra/newview/llsidepanelappearance.cpp
@@ -204,6 +204,8 @@ void LLSidepanelAppearance::updateToVisibility(const LLSD &new_visibility)
 				llwarns << "Visibility change to invalid wearable" << llendl;
 				return;
 			}
+			// Disable camera switch is currently just for WT_PHYSICS type since we don't want to freeze the avatar
+			// when editing its physics.
 			const BOOL disable_camera_motion = LLWearableType::getDisableCameraSwitch(wearable_ptr->getType());
 			if (!gAgentCamera.cameraCustomizeAvatar() && 
 				!disable_camera_motion &&
@@ -313,6 +315,15 @@ void LLSidepanelAppearance::showOutfitEditPanel()
 		mOutfitEdit->resetAccordionState();
 	}
 
+	// If we're exiting the edit wearable view, and the camera was not focused on the avatar
+	// (e.g. such as if we were editing a physics param), then skip the outfits edit mode since
+	// otherwise this would trigger the camera focus mode.
+	if (mEditWearable != NULL && mEditWearable->getVisible() && !gAgentCamera.cameraCustomizeAvatar())
+	{
+		showOutfitsInventoryPanel();
+		return;
+	}
+
 	toggleMyOutfitsPanel(FALSE);
 	toggleWearableEditPanel(FALSE, NULL, TRUE); // don't switch out of edit appearance mode
 	toggleOutfitEditPanel(TRUE);
diff --git a/indra/newview/skins/default/xui/en/panel_edit_physics.xml b/indra/newview/skins/default/xui/en/panel_edit_physics.xml
index 0eb9c703ca2..6e89a8cb1ab 100644
--- a/indra/newview/skins/default/xui/en/panel_edit_physics.xml
+++ b/indra/newview/skins/default/xui/en/panel_edit_physics.xml
@@ -27,8 +27,8 @@
         height ="300"
         layout="topleft"
         left="0"
-        name="wearable_accordion"
-        single_expansion="true"
+		single_expansion="true"
+        name="physics_accordion"
         top="0"
         width="313">
 		<accordion_tab
-- 
GitLab