From b4866775a2acc98ebcb3986d7779eea479028ff9 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Tue, 11 Sep 2012 20:57:04 -0400
Subject: [PATCH] Dump XML tweaks, suppress wearable updates when bakes should
 dominate

---
 indra/newview/llviewermenu.cpp                         |  9 +++++++++
 indra/newview/llvoavatar.cpp                           |  5 +++++
 indra/newview/llwearable.cpp                           |  2 +-
 .../skins/default/xui/en/menu_attachment_other.xml     |  2 +-
 .../skins/default/xui/en/menu_attachment_self.xml      |  2 +-
 .../newview/skins/default/xui/en/menu_avatar_other.xml |  2 +-
 .../newview/skins/default/xui/en/menu_avatar_self.xml  | 10 +---------
 .../skins/default/xui/en/menu_inspect_avatar_gear.xml  |  2 +-
 .../skins/default/xui/en/menu_inspect_self_gear.xml    |  2 +-
 9 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 9c748c7f865..e3e05ef80da 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -1596,6 +1596,14 @@ class LLAdvancedEnableGrabBakedTexture : public view_listener_t
 ///////////////////////
 
 
+class LLAdvancedEnableAppearanceToXML : public view_listener_t
+{
+	bool handleEvent(const LLSD& userdata)
+	{
+		return gSavedSettings.getBOOL("DebugAvatarCompositeBaked");
+	}
+};
+
 class LLAdvancedAppearanceToXML : public view_listener_t
 {
 	bool handleEvent(const LLSD& userdata)
@@ -8459,6 +8467,7 @@ void initialize_menus()
 
 	// Advanced > Character > Character Tests
 	view_listener_t::addMenu(new LLAdvancedAppearanceToXML(), "Advanced.AppearanceToXML");
+	view_listener_t::addMenu(new LLAdvancedEnableAppearanceToXML(), "Advanced.EnableAppearanceToXML");
 	view_listener_t::addMenu(new LLAdvancedToggleCharacterGeometry(), "Advanced.ToggleCharacterGeometry");
 
 	view_listener_t::addMenu(new LLAdvancedTestMale(), "Advanced.TestMale");
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 61816c1771c..96e59dd9ebc 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -7361,7 +7361,9 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
 //			llinfos << "processAvatarAppearance end  " << mID << llendl;
 			return;
 		}
+		clearVisualParamWeights();
 	}
+	dumpArchetypeXML("process_post_clear");
 
 	ESex old_sex = getSex();
 
@@ -7481,6 +7483,8 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
 			}
 		}
 
+		dumpArchetypeXML("process_post_set_weights");
+
 		const S32 expected_tweakable_count = getVisualParamCountInGroup(VISUAL_PARAM_GROUP_TWEAKABLE); // don't worry about VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT
 		if (num_blocks != expected_tweakable_count)
 		{
@@ -7545,6 +7549,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
 
 	updateMeshTextures();
 
+	dumpArchetypeXML("process_end");
 //	llinfos << "processAvatarAppearance end " << mID << llendl;
 }
 
diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp
index 3f07d6877c7..b924a4471d0 100755
--- a/indra/newview/llwearable.cpp
+++ b/indra/newview/llwearable.cpp
@@ -619,7 +619,7 @@ void LLWearable::setTexturesToDefaults()
 void LLWearable::writeToAvatar()
 {
 	if (!isAgentAvatarValid()) return;
-#if 0
+#if 1
 	if (!gAgentAvatarp->isUsingLocalAppearance())
 	{
 		return;
diff --git a/indra/newview/skins/default/xui/en/menu_attachment_other.xml b/indra/newview/skins/default/xui/en/menu_attachment_other.xml
index 6f922730977..46ba4bd29d2 100755
--- a/indra/newview/skins/default/xui/en/menu_attachment_other.xml
+++ b/indra/newview/skins/default/xui/en/menu_attachment_other.xml
@@ -85,7 +85,7 @@
             <menu_item_call.on_click
              function="Advanced.AppearanceToXML" />
             <menu_item_call.on_visible
-             function="IsGodCustomerService"/>
+             function="Advanced.EnableAppearanceToXML"/>
     </menu_item_call>
 	    <menu_item_call
          label="Zoom In"
diff --git a/indra/newview/skins/default/xui/en/menu_attachment_self.xml b/indra/newview/skins/default/xui/en/menu_attachment_self.xml
index 84e26268bdc..28e032ce5f0 100755
--- a/indra/newview/skins/default/xui/en/menu_attachment_self.xml
+++ b/indra/newview/skins/default/xui/en/menu_attachment_self.xml
@@ -129,7 +129,7 @@ name="Edit Outfit">
             <menu_item_call.on_click
              function="Advanced.AppearanceToXML" />
             <menu_item_call.on_visible
-             function="IsGodCustomerService"/>
+             function="Advanced.EnableAppearanceToXML"/>
     </menu_item_call>
   <menu_item_separator
   layout="topleft" />
diff --git a/indra/newview/skins/default/xui/en/menu_avatar_other.xml b/indra/newview/skins/default/xui/en/menu_avatar_other.xml
index 1c39984625c..e7c2b80da27 100755
--- a/indra/newview/skins/default/xui/en/menu_avatar_other.xml
+++ b/indra/newview/skins/default/xui/en/menu_avatar_other.xml
@@ -85,7 +85,7 @@
             <menu_item_call.on_click
              function="Advanced.AppearanceToXML" />
             <menu_item_call.on_visible
-             function="IsGodCustomerService"/>
+             function="Advanced.EnableAppearanceToXML"/>
     </menu_item_call>
 	    <menu_item_call
          label="Zoom In"
diff --git a/indra/newview/skins/default/xui/en/menu_avatar_self.xml b/indra/newview/skins/default/xui/en/menu_avatar_self.xml
index 0e79b0fee36..c1ff026a74e 100755
--- a/indra/newview/skins/default/xui/en/menu_avatar_self.xml
+++ b/indra/newview/skins/default/xui/en/menu_avatar_self.xml
@@ -267,14 +267,6 @@
             <menu_item_call.on_click
              function="Advanced.AppearanceToXML" />
             <menu_item_call.on_visible
-             function="IsGodCustomerService"/>
-    </menu_item_call>
-    <menu_item_call
-		 label="Dump XML"
-         name="Dump XML">
-            <menu_item_call.on_click
-             function="Advanced.AppearanceToXML" />
-            <menu_item_call.on_visible
-             function="IsGodCustomerService"/>
+             function="Advanced.EnableAppearanceToXML"/>
     </menu_item_call>
 </context_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml b/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml
index 4fdfb2281bb..354ddc31099 100755
--- a/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml
+++ b/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml
@@ -118,7 +118,7 @@
             <menu_item_call.on_click
              function="Advanced.AppearanceToXML" />
             <menu_item_call.on_visible
-             function="IsGodCustomerService"/>
+             function="Advanced.EnableAppearanceToXML"/>
     </menu_item_call>
   <menu_item_call
    label="Find On Map"
diff --git a/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml b/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml
index f935f0f312a..84815caca97 100755
--- a/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml
+++ b/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml
@@ -255,6 +255,6 @@
             <menu_item_call.on_click
              function="Advanced.AppearanceToXML" />
             <menu_item_call.on_visible
-             function="IsGodCustomerService"/>
+             function="Advanced.EnableAppearanceToXML"/>
     </menu_item_call>
 </toggleable_menu>
-- 
GitLab