From 8fae5d49bf211fbbd58511442f91e09e8c4c0458 Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Fri, 7 Jan 2011 18:24:35 -0500
Subject: testing: adding glFlush() each frame for performance testing

---
 indra/llwindow/llwindowmacosx.cpp | 1 +
 indra/llwindow/llwindowsdl.cpp    | 3 +++
 indra/llwindow/llwindowwin32.cpp  | 1 +
 3 files changed, 5 insertions(+)

diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index affd7276cc..fa8ba7bafa 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -1273,6 +1273,7 @@ BOOL LLWindowMacOSX::setSize(const LLCoordScreen size)
 
 void LLWindowMacOSX::swapBuffers()
 {
+	glFlush();
 	aglSwapBuffers(mContext);
 }
 
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index b65287715c..80566b40c0 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -984,7 +984,10 @@ BOOL LLWindowSDL::setSize(const LLCoordScreen size)
 void LLWindowSDL::swapBuffers()
 {
 	if (mWindow)
+	{	
+		glFlush();
 		SDL_GL_SwapBuffers();
+	}
 }
 
 U32 LLWindowSDL::getFSAASamples()
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index ab089081e6..e457e76f55 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -2858,6 +2858,7 @@ BOOL LLWindowWin32::resetDisplayResolution()
 
 void LLWindowWin32::swapBuffers()
 {
+	glFlush();
 	SwapBuffers(mhDC);
 }
 
-- 
cgit v1.2.3


From d1683bd65ae2797de9d92658d720b81c3be80fff Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Thu, 13 Jan 2011 13:46:00 -0500
Subject: glFlush != glFinish. doh.

---
 indra/llwindow/llwindowmacosx.cpp | 2 +-
 indra/llwindow/llwindowsdl.cpp    | 2 +-
 indra/llwindow/llwindowwin32.cpp  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index fa8ba7bafa..db90aaf52a 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -1273,7 +1273,7 @@ BOOL LLWindowMacOSX::setSize(const LLCoordScreen size)
 
 void LLWindowMacOSX::swapBuffers()
 {
-	glFlush();
+	glFinish();
 	aglSwapBuffers(mContext);
 }
 
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index 80566b40c0..e41aa9820f 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -985,7 +985,7 @@ void LLWindowSDL::swapBuffers()
 {
 	if (mWindow)
 	{	
-		glFlush();
+		glFinish();
 		SDL_GL_SwapBuffers();
 	}
 }
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index e457e76f55..aba0dc43eb 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -2858,7 +2858,7 @@ BOOL LLWindowWin32::resetDisplayResolution()
 
 void LLWindowWin32::swapBuffers()
 {
-	glFlush();
+	glFinish();
 	SwapBuffers(mhDC);
 }
 
-- 
cgit v1.2.3


From 01d219ed4c140fbc54069cdcb6d1b671f91e9923 Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Tue, 1 Feb 2011 17:26:23 -0500
Subject: removing particle disabling from performance testing so that I can
 test performance of particles

---
 indra/newview/llviewercontrol.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 444d5cb902..bc34c369da 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -141,7 +141,6 @@ static bool handleRenderPerfTestChanged(const LLSD& newvalue)
                                                                          LLPipeline::RENDER_TYPE_WATER,
                                                                          LLPipeline::RENDER_TYPE_PASS_GRASS,
                                                                          LLPipeline::RENDER_TYPE_HUD,
-                                                                         LLPipeline::RENDER_TYPE_PARTICLES,
                                                                          LLPipeline::RENDER_TYPE_CLOUDS,
                                                                          LLPipeline::RENDER_TYPE_HUD_PARTICLES,
                                                                          LLPipeline::END_RENDER_TYPES); 
@@ -157,7 +156,6 @@ static bool handleRenderPerfTestChanged(const LLSD& newvalue)
                                                                          LLPipeline::RENDER_TYPE_WATER,
                                                                          LLPipeline::RENDER_TYPE_PASS_GRASS,
                                                                          LLPipeline::RENDER_TYPE_HUD,
-                                                                         LLPipeline::RENDER_TYPE_PARTICLES,
                                                                          LLPipeline::RENDER_TYPE_CLOUDS,
                                                                          LLPipeline::RENDER_TYPE_HUD_PARTICLES,
                                                                          LLPipeline::END_RENDER_TYPES);
-- 
cgit v1.2.3


From e3816f4577a74bba42ae9091461125ec9698b583 Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Tue, 8 Feb 2011 17:00:36 -0500
Subject: adding pausing on startup for windows to help debug application not
 starting.

---
 indra/newview/llappviewerwin32.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index d328567a0e..b0bf36f688 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -57,7 +57,7 @@
 
 #include "llcommandlineparser.h"
 #include "lltrans.h"
-
+#include "runtimediagnostics.h"
 #ifndef LL_RELEASE_FOR_DOWNLOAD
 #include "llwindebug.h"
 #endif
@@ -110,6 +110,7 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
                      LPSTR     lpCmdLine,
                      int       nCmdShow)
 {
+	RuntimeDiagnostics::CheckPauseOnStartupOption();
 	LLMemType mt1(LLMemType::MTYPE_STARTUP);
 
 	const S32 MAX_HEAPS = 255;
-- 
cgit v1.2.3


From 9ef62ba2cecbed3db3eff74a294eb252f018399c Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Wed, 9 Feb 2011 14:01:36 -0500
Subject: forgot to add runtimediagnostics.h. whoops.

---
 indra/newview/CMakeLists.txt       |   1 +
 indra/newview/runtimediagnostics.h | 256 +++++++++++++++++++++++++++++++++++++
 2 files changed, 257 insertions(+)
 create mode 100644 indra/newview/runtimediagnostics.h

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 8ea0dd1089..ca408d032a 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1136,6 +1136,7 @@ set(viewer_HEADER_FILES
     macmain.h
     noise.h
     pipeline.h
+    runtimediagnostics.h
     VertexCache.h
     VorbisFramework.h
     )
diff --git a/indra/newview/runtimediagnostics.h b/indra/newview/runtimediagnostics.h
new file mode 100644
index 0000000000..b1c2662958
--- /dev/null
+++ b/indra/newview/runtimediagnostics.h
@@ -0,0 +1,256 @@
+ once
+
+
+
+#include <atlbase.h>
+
+
+
+/* static*/ class RuntimeDiagnostics
+
+{
+
+public:
+
+    static void CheckPauseOnStartupOption(
+
+        )
+
+    {
+
+        DWORD dwPause;
+
+        if (GetExecutionOption(TEXT("PauseOnStartup"), &dwPause) == S_OK && dwPause != 0)
+
+        {
+
+            while (true)
+
+            {
+
+                if (IsDebuggerPresent())
+
+                {
+
+                    __debugbreak();
+
+                    break;
+
+                }
+
+
+
+                Sleep(1000);
+
+            }
+
+        }
+
+    }
+
+
+
+private:
+
+    static HRESULT GetExecutionOption(
+
+        LPCTSTR szOptionName,
+
+        DWORD *pValue
+
+        )
+
+    {
+
+        HRESULT hr;
+
+        DWORD nChar;
+
+
+
+        *pValue = 0;
+
+
+
+        CRegKey rkeyExecutionOptions;
+
+        hr = WIN32_ERROR_CALL( rkeyExecutionOptions.Open(
+
+            HKEY_LOCAL_MACHINE,
+
+            TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options"),
+
+            KEY_READ
+
+            ) );
+
+
+
+        if (hr == S_OK)
+
+        {
+
+            TCHAR szModPath[MAX_PATH + 1];
+
+            nChar = GetModuleFileName(NULL, szModPath, ARRAYSIZE(szModPath));
+
+            hr = WIN32_BOOL_CALL(nChar > 0 && nChar < ARRAYSIZE(szModPath));
+
+
+
+            if (hr == S_OK)
+
+            {
+
+                nChar = GetFileNameCharOffset(szModPath);
+
+
+
+                if (nChar != MAXDWORD)
+
+                {
+
+                    CRegKey rkeyExe;
+
+                    hr = WIN32_ERROR_CALL( rkeyExe.Open(rkeyExecutionOptions, szModPath + nChar, KEY_QUERY_VALUE) );
+
+                    if (hr == S_OK)
+
+                    {
+
+                        hr = WIN32_ERROR_CALL( rkeyExe.QueryDWORDValue(szOptionName, *pValue) );
+
+                    }
+
+                }
+
+                else
+
+                {
+
+                    hr = E_FAIL;
+
+                }
+
+            }
+
+        }
+
+
+
+        return hr;
+
+    }
+
+
+
+    static DWORD GetFileNameCharOffset(LPCTSTR szPath)
+
+    {
+
+        if (!szPath)
+
+        {
+
+            return MAXDWORD;
+
+        }
+
+
+
+        // Find the last slash
+
+        DWORD dwReturn = 0;
+
+        for (DWORD c = 0; szPath[c] != 0; c++)
+
+        {
+
+            if (c >= INT_MAX)
+
+            {
+
+                return MAXDWORD; // string did not terminate
+
+            }
+
+
+
+            if (szPath[c] == '\\' || szPath[c] == '/' || (szPath[c] == ':' && c == 1))
+
+            {
+
+                dwReturn = c + 1;
+
+            }
+
+        }
+
+
+
+        // Make sure that the string doesn't end at the slash
+
+        if (szPath[dwReturn] == 0)
+
+        {
+
+            dwReturn = MAXDWORD;
+
+        }
+
+
+
+        return dwReturn;
+
+    }
+
+
+
+    static inline HRESULT WIN32_ERROR(LONG lError)
+
+    {
+
+        return HRESULT_FROM_WIN32(lError);
+
+    }
+
+
+
+    static inline HRESULT WIN32_LAST_ERROR()
+
+    {
+
+        return WIN32_ERROR(GetLastError());
+
+    }
+
+
+
+    static inline HRESULT WIN32_BOOL_CALL(BOOL rc)
+
+    {
+
+        if (!rc)
+
+            return WIN32_LAST_ERROR();
+
+        return S_OK;
+
+    }
+
+
+
+    static inline HRESULT WIN32_ERROR_CALL(LONG lError)
+
+    {
+
+        if (lError != ERROR_SUCCESS)
+
+            return WIN32_ERROR(lError);
+
+        return S_OK;
+
+    }
+
+};
+
-- 
cgit v1.2.3


From 86a2c4912c72a735f713dfc40a053335a21f3350 Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Wed, 9 Feb 2011 16:10:01 -0500
Subject: header got cut off. ugh.

---
 indra/newview/runtimediagnostics.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/indra/newview/runtimediagnostics.h b/indra/newview/runtimediagnostics.h
index b1c2662958..bf385a6361 100644
--- a/indra/newview/runtimediagnostics.h
+++ b/indra/newview/runtimediagnostics.h
@@ -1,7 +1,4 @@
- once
-
-
-
+#pragma once
 #include <atlbase.h>
 
 
-- 
cgit v1.2.3


From 344ddaf9f5945c63c39774f9619069629430e70b Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Fri, 11 Feb 2011 17:30:09 -0500
Subject: reverting windows debugging commits.

---
 indra/newview/CMakeLists.txt       |   1 -
 indra/newview/llappviewerwin32.cpp |   3 +-
 indra/newview/runtimediagnostics.h | 253 -------------------------------------
 3 files changed, 1 insertion(+), 256 deletions(-)
 delete mode 100644 indra/newview/runtimediagnostics.h

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index ca408d032a..8ea0dd1089 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1136,7 +1136,6 @@ set(viewer_HEADER_FILES
     macmain.h
     noise.h
     pipeline.h
-    runtimediagnostics.h
     VertexCache.h
     VorbisFramework.h
     )
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index b0bf36f688..d328567a0e 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -57,7 +57,7 @@
 
 #include "llcommandlineparser.h"
 #include "lltrans.h"
-#include "runtimediagnostics.h"
+
 #ifndef LL_RELEASE_FOR_DOWNLOAD
 #include "llwindebug.h"
 #endif
@@ -110,7 +110,6 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
                      LPSTR     lpCmdLine,
                      int       nCmdShow)
 {
-	RuntimeDiagnostics::CheckPauseOnStartupOption();
 	LLMemType mt1(LLMemType::MTYPE_STARTUP);
 
 	const S32 MAX_HEAPS = 255;
diff --git a/indra/newview/runtimediagnostics.h b/indra/newview/runtimediagnostics.h
deleted file mode 100644
index bf385a6361..0000000000
--- a/indra/newview/runtimediagnostics.h
+++ /dev/null
@@ -1,253 +0,0 @@
-#pragma once
-#include <atlbase.h>
-
-
-
-/* static*/ class RuntimeDiagnostics
-
-{
-
-public:
-
-    static void CheckPauseOnStartupOption(
-
-        )
-
-    {
-
-        DWORD dwPause;
-
-        if (GetExecutionOption(TEXT("PauseOnStartup"), &dwPause) == S_OK && dwPause != 0)
-
-        {
-
-            while (true)
-
-            {
-
-                if (IsDebuggerPresent())
-
-                {
-
-                    __debugbreak();
-
-                    break;
-
-                }
-
-
-
-                Sleep(1000);
-
-            }
-
-        }
-
-    }
-
-
-
-private:
-
-    static HRESULT GetExecutionOption(
-
-        LPCTSTR szOptionName,
-
-        DWORD *pValue
-
-        )
-
-    {
-
-        HRESULT hr;
-
-        DWORD nChar;
-
-
-
-        *pValue = 0;
-
-
-
-        CRegKey rkeyExecutionOptions;
-
-        hr = WIN32_ERROR_CALL( rkeyExecutionOptions.Open(
-
-            HKEY_LOCAL_MACHINE,
-
-            TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options"),
-
-            KEY_READ
-
-            ) );
-
-
-
-        if (hr == S_OK)
-
-        {
-
-            TCHAR szModPath[MAX_PATH + 1];
-
-            nChar = GetModuleFileName(NULL, szModPath, ARRAYSIZE(szModPath));
-
-            hr = WIN32_BOOL_CALL(nChar > 0 && nChar < ARRAYSIZE(szModPath));
-
-
-
-            if (hr == S_OK)
-
-            {
-
-                nChar = GetFileNameCharOffset(szModPath);
-
-
-
-                if (nChar != MAXDWORD)
-
-                {
-
-                    CRegKey rkeyExe;
-
-                    hr = WIN32_ERROR_CALL( rkeyExe.Open(rkeyExecutionOptions, szModPath + nChar, KEY_QUERY_VALUE) );
-
-                    if (hr == S_OK)
-
-                    {
-
-                        hr = WIN32_ERROR_CALL( rkeyExe.QueryDWORDValue(szOptionName, *pValue) );
-
-                    }
-
-                }
-
-                else
-
-                {
-
-                    hr = E_FAIL;
-
-                }
-
-            }
-
-        }
-
-
-
-        return hr;
-
-    }
-
-
-
-    static DWORD GetFileNameCharOffset(LPCTSTR szPath)
-
-    {
-
-        if (!szPath)
-
-        {
-
-            return MAXDWORD;
-
-        }
-
-
-
-        // Find the last slash
-
-        DWORD dwReturn = 0;
-
-        for (DWORD c = 0; szPath[c] != 0; c++)
-
-        {
-
-            if (c >= INT_MAX)
-
-            {
-
-                return MAXDWORD; // string did not terminate
-
-            }
-
-
-
-            if (szPath[c] == '\\' || szPath[c] == '/' || (szPath[c] == ':' && c == 1))
-
-            {
-
-                dwReturn = c + 1;
-
-            }
-
-        }
-
-
-
-        // Make sure that the string doesn't end at the slash
-
-        if (szPath[dwReturn] == 0)
-
-        {
-
-            dwReturn = MAXDWORD;
-
-        }
-
-
-
-        return dwReturn;
-
-    }
-
-
-
-    static inline HRESULT WIN32_ERROR(LONG lError)
-
-    {
-
-        return HRESULT_FROM_WIN32(lError);
-
-    }
-
-
-
-    static inline HRESULT WIN32_LAST_ERROR()
-
-    {
-
-        return WIN32_ERROR(GetLastError());
-
-    }
-
-
-
-    static inline HRESULT WIN32_BOOL_CALL(BOOL rc)
-
-    {
-
-        if (!rc)
-
-            return WIN32_LAST_ERROR();
-
-        return S_OK;
-
-    }
-
-
-
-    static inline HRESULT WIN32_ERROR_CALL(LONG lError)
-
-    {
-
-        if (lError != ERROR_SUCCESS)
-
-            return WIN32_ERROR(lError);
-
-        return S_OK;
-
-    }
-
-};
-
-- 
cgit v1.2.3


From 4046a9082d793e71cac26a31d44c127decd6821f Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Fri, 11 Feb 2011 17:37:07 -0500
Subject: re-applying render cost changes for experimentations

---
 indra/newview/llfloatertools.cpp |  32 +-----
 indra/newview/llfloatertools.h   |   1 -
 indra/newview/llselectmgr.cpp    |   4 +-
 indra/newview/llvoavatar.cpp     |  16 ++-
 indra/newview/llvovolume.cpp     | 237 ++++++++++++++++++++++++++++++---------
 indra/newview/llvovolume.h       |   5 +-
 6 files changed, 198 insertions(+), 97 deletions(-)

diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index bef830a93e..ceaf3c1449 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -476,7 +476,8 @@ void LLFloaterTools::refresh()
 		if (sShowObjectCost)
 		{
 			std::string prim_cost_string;
-			LLResMgr::getInstance()->getIntegerString(prim_cost_string, calcRenderCost());
+	                S32 cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectRenderCost();
+	                LLResMgr::getInstance()->getIntegerString(prim_cost_string, cost);
 			getChild<LLUICtrl>("RenderingCost")->setTextArg("[COUNT]", prim_cost_string);
 		}
 
@@ -1037,35 +1038,6 @@ void LLFloaterTools::onClickGridOptions()
 	//floaterp->addDependentFloater(LLFloaterBuildOptions::getInstance(), FALSE);
 }
 
-S32 LLFloaterTools::calcRenderCost()
-{
-       S32 cost = 0;
-       std::set<LLUUID> textures;
-
-       for (LLObjectSelection::iterator selection_iter = LLSelectMgr::getInstance()->getSelection()->begin();
-                 selection_iter != LLSelectMgr::getInstance()->getSelection()->end();
-                 ++selection_iter)
-       {
-               LLSelectNode *select_node = *selection_iter;
-               if (select_node)
-               {
-                       LLViewerObject *vobj = select_node->getObject();
-                       if (vobj->getVolume())
-                       {
-                               LLVOVolume* volume = (LLVOVolume*) vobj;
-
-                               cost += volume->getRenderCost(textures);
-							   cost += textures.size() * LLVOVolume::ARC_TEXTURE_COST;
-							   textures.clear();
-                       }
-               }
-       }
-
-
-       return cost;
-}
-
-
 // static
 void LLFloaterTools::setEditTool(void* tool_pointer)
 {
diff --git a/indra/newview/llfloatertools.h b/indra/newview/llfloatertools.h
index 87c3d2ab47..d5595445e0 100644
--- a/indra/newview/llfloatertools.h
+++ b/indra/newview/llfloatertools.h
@@ -114,7 +114,6 @@ private:
 	static bool multipleFacesSelectedConfirm(const LLSD& notification, const LLSD& response);
 	static void setObjectType( LLPCode pcode );
 	void onClickGridOptions();
-	S32 calcRenderCost();
 
 public:
 	LLButton		*mBtnFocus;
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 93c9131424..90c2cf1eb4 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -6391,7 +6391,7 @@ U32 LLObjectSelection::getSelectedObjectTriangleCount()
 	return count;
 }
 
-/*S32 LLObjectSelection::getSelectedObjectRenderCost()
+S32 LLObjectSelection::getSelectedObjectRenderCost()
 {
        S32 cost = 0;
        LLVOVolume::texture_cost_t textures;
@@ -6415,7 +6415,7 @@ U32 LLObjectSelection::getSelectedObjectTriangleCount()
 
 
        return cost;
-}*/
+}
 
 
 //-----------------------------------------------------------------------------
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index a257703b24..950d050f26 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -8241,7 +8241,7 @@ void LLVOAvatar::getImpostorValues(LLVector4a* extents, LLVector3& angle, F32& d
 
 void LLVOAvatar::idleUpdateRenderCost()
 {
-	static const U32 ARC_BODY_PART_COST = 20;
+	static const U32 ARC_BODY_PART_COST = 200;
 	static const U32 ARC_LIMIT = 2048;
 
 	static std::set<LLUUID> all_textures;
@@ -8252,7 +8252,7 @@ void LLVOAvatar::idleUpdateRenderCost()
 	}
 
 	U32 cost = 0;
-	std::set<LLUUID> textures;
+	LLVOVolume::texture_cost_t textures;
 
 	for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++)
 	{
@@ -8293,15 +8293,21 @@ void LLVOAvatar::idleUpdateRenderCost()
 
 	}
 
+	for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter)
+	{
+		// add the cost of each individual texture in the linkset
+		cost += iter->second;
+	}
+
 	// Diagnostic output to identify all avatar-related textures.
 	// Does not affect rendering cost calculation.
 	// Could be wrapped in a debug option if output becomes problematic.
 	if (isSelf())
 	{
 		// print any attachment textures we didn't already know about.
-		for (std::set<LLUUID>::iterator it = textures.begin(); it != textures.end(); ++it)
+		for (LLVOVolume::texture_cost_t::iterator it = textures.begin(); it != textures.end(); ++it)
 		{
-			LLUUID image_id = *it;
+			LLUUID image_id = it->first;
 			if( image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR)
 				continue;
 			if (all_textures.find(image_id) == all_textures.end())
@@ -8333,8 +8339,6 @@ void LLVOAvatar::idleUpdateRenderCost()
 		}
 	}
 
-	cost += textures.size() * LLVOVolume::ARC_TEXTURE_COST;
-
 	setDebugText(llformat("%d", cost));
 	F32 green = 1.f-llclamp(((F32) cost-(F32)ARC_LIMIT)/(F32)ARC_LIMIT, 0.f, 1.f);
 	F32 red = llmin((F32) cost/(F32)ARC_LIMIT, 1.f);
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index be987a2310..01027e6a11 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -2931,24 +2931,35 @@ const LLMatrix4 LLVOVolume::getRenderMatrix() const
 // total cost is returned value + 5 * size of the resulting set.
 // Cannot include cost of textures, as they may be re-used in linked
 // children, and cost should only be increased for unique textures  -Nyx
-U32 LLVOVolume::getRenderCost(std::set<LLUUID> &textures) const
+U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 {
-	// base cost of each prim should be 10 points
-	static const U32 ARC_PRIM_COST = 10;
+	// Get access to params we'll need at various points.  
+	// Skip if this is object doesn't have a volume (e.g. is an avatar).
+	BOOL has_volume = (getVolume() != NULL);
+	LLVolumeParams volume_params;
+	LLPathParams path_params;
+	LLProfileParams profile_params;
+
+	U32 num_triangles = 0;
+
 	// per-prim costs
-	static const U32 ARC_INVISI_COST = 1;
-	static const U32 ARC_SHINY_COST = 1;
-	static const U32 ARC_GLOW_COST = 1;
-	static const U32 ARC_FLEXI_COST = 8;
-	static const U32 ARC_PARTICLE_COST = 16;
-	static const U32 ARC_BUMP_COST = 4;
+	static const U32 ARC_PARTICLE_COST = 1;
+	static const U32 ARC_PARTICLE_MAX = 2048;
+	static const U32 ARC_TEXTURE_COST = 5;
 
-	// per-face costs
-	static const U32 ARC_PLANAR_COST = 1;
-	static const U32 ARC_ANIM_TEX_COST = 4;
-	static const U32 ARC_ALPHA_COST = 4;
+	// per-prim multipliers
+	static const F32 ARC_GLOW_MULT = 1.5f; // tested based on performance
+	static const F32 ARC_BUMP_MULT = 1.25f; // tested based on performance
+	static const F32 ARC_FLEXI_MULT = 4;
+	static const F32 ARC_SHINY_MULT = 1.6f; // tested based on performance
+	static const F32 ARC_INVISI_COST = 1.2f; // tested based on performance
+	static const F32 ARC_WEIGHTED_MESH = 1.2f; 
 
-	U32 shame = ARC_PRIM_COST;
+	static const F32 ARC_PLANAR_COST = 1.2f; // 1.2x max
+	static const F32 ARC_ANIM_TEX_COST = 1.4f; // 1.4x max
+	static const F32 ARC_ALPHA_COST = 4.f; // 4x max
+
+	F32 shame = 0;
 
 	U32 invisi = 0;
 	U32 shiny = 0;
@@ -2957,9 +2968,87 @@ U32 LLVOVolume::getRenderCost(std::set<LLUUID> &textures) const
 	U32 flexi = 0;
 	U32 animtex = 0;
 	U32 particles = 0;
-	U32 scale = 0;
 	U32 bump = 0;
 	U32 planar = 0;
+	U32 weighted_mesh = 0;
+
+	// these multipliers are variable and can be floating point
+	F32 scale = 0.f;
+
+	const LLDrawable* drawablep = mDrawable;
+	U32 num_faces = drawablep->getNumFaces();
+
+	if (has_volume)
+	{
+		volume_params = getVolume()->getParams();
+		path_params = volume_params.getPathParams();
+		profile_params = volume_params.getProfileParams();
+
+		F32 radius = getVolume()->mLODScaleBias.scaledVec(getScale()).length();
+		S32 default_detail = llclamp((S32) (sqrtf(radius)*LLVOVolume::sLODFactor*4.f), 0, 3);
+		if (default_detail == getLOD())
+		{
+			num_triangles = getTriangleCount();
+		}
+		else
+		{
+			LLVolume* default_volume = LLPrimitive::getVolumeManager()->refVolume(volume_params, default_detail);
+			if(default_volume != NULL)
+			{
+				num_triangles = default_volume->getNumTriangles();
+				LLPrimitive::getVolumeManager()->unrefVolume(default_volume);
+				default_volume = NULL;
+			}
+			else
+			{
+				has_volume = false;
+			}
+		}
+	}
+
+	if (isSculpted())
+	{
+		if (isMesh())
+		{
+			// base cost is dependent on mesh complexity
+			// note that 3 is the highest LOD as of the time of this coding.
+			S32 size = gMeshRepo.getMeshSize(volume_params.getSculptID(),3);
+			if ( size > 0)
+			{
+				num_triangles = (U32)(size / 10.f); // avg 1 triangle per 10 bytes
+				if (gMeshRepo.getSkinInfo(volume_params.getSculptID()))
+				{
+					// weighted attachment - 1 point for every 3 bytes
+					weighted_mesh = 1;
+				}
+
+				if (num_triangles == 0)
+				{
+					// someone made a really tiny mesh. Approximate with a tetrahedron.
+					num_triangles = 4;
+				}
+			}
+			else
+			{
+				// something went wrong - user should know their content isn't render-free
+				return 0;
+			}
+		}
+		else
+		{
+			const LLSculptParams *sculpt_params = (LLSculptParams *) getParameterEntry(LLNetworkData::PARAMS_SCULPT);
+			LLUUID sculpt_id = sculpt_params->getSculptTexture();
+			if (textures.find(sculpt_id) == textures.end())
+			{
+				LLViewerFetchedTexture *texture = LLViewerTextureManager::getFetchedTexture(sculpt_id);
+				if (texture)
+				{
+					S32 texture_cost = (S32)(ARC_TEXTURE_COST * (texture->getFullHeight() / 128.f + texture->getFullWidth() / 128.f + 1));
+					textures.insert(texture_cost_t::value_type(sculpt_id, texture_cost));
+				}
+			}
+		}
+	}
 
 	if (isFlexible())
 	{
@@ -2971,18 +3060,12 @@ U32 LLVOVolume::getRenderCost(std::set<LLUUID> &textures) const
 	}
 
 	const LLVector3& sc = getScale();
-	scale += (U32) sc.mV[0] + (U32) sc.mV[1] + (U32) sc.mV[2];
-
-	const LLDrawable* drawablep = mDrawable;
+	scale += (sc.mV[0] + sc.mV[1] + sc.mV[2]) / 4.f; // scale to 1/4 the sum of the size
+	// enforce scale multiplier to be in the range [1,7] (7 was determined to experimentally be a reasonable max)
+	scale = scale > 7.f ? 7.f : scale;
+	scale = scale < 1.f ? 1.f : scale;
 
-	if (isSculpted())
-	{
-		const LLSculptParams *sculpt_params = (LLSculptParams *) getParameterEntry(LLNetworkData::PARAMS_SCULPT);
-		LLUUID sculpt_id = sculpt_params->getSculptTexture();
-		textures.insert(sculpt_id);
-	}
-
-	for (S32 i = 0; i < drawablep->getNumFaces(); ++i)
+	for (S32 i = 0; i < num_faces; ++i)
 	{
 		const LLFace* face = drawablep->getFace(i);
 		const LLTextureEntry* te = face->getTextureEntry();
@@ -2990,12 +3073,16 @@ U32 LLVOVolume::getRenderCost(std::set<LLUUID> &textures) const
 
 		if (img)
 		{
-			textures.insert(img->getID());
+			if (textures.find(img->getID()) == textures.end())
+			{
+				S32 texture_cost = (S32)(ARC_TEXTURE_COST * (img->getFullHeight() / 128.f + img->getFullWidth() / 128.f + 1));
+				textures.insert(texture_cost_t::value_type(img->getID(), texture_cost));
+			}
 		}
 
 		if (face->getPoolType() == LLDrawPool::POOL_ALPHA)
 		{
-			alpha++;
+			alpha = 1;
 		}
 		else if (img && img->getPrimaryFormat() == GL_ALPHA)
 		{
@@ -3006,58 +3093,98 @@ U32 LLVOVolume::getRenderCost(std::set<LLUUID> &textures) const
 		{
 			if (te->getBumpmap())
 			{
+				// bump is a multiplier, don't add per-face
 				bump = 1;
 			}
 			if (te->getShiny())
 			{
+				// shiny is a multiplier, don't add per-face
 				shiny = 1;
 			}
 			if (te->getGlow() > 0.f)
 			{
+				// glow is a multiplier, don't add per-face
 				glow = 1;
 			}
 			if (face->mTextureMatrix != NULL)
 			{
-				animtex++;
+				animtex = 1;
 			}
 			if (te->getTexGen())
 			{
-				planar++;
+				planar = 1;
 			}
 		}
 	}
 
+	// shame currently has the "base" cost of 1 point per 50 triangles, min 2.
+	shame = num_triangles / 50.f;
+	shame = shame < 2.f ? 2.f : shame;
 
-	shame += invisi * ARC_INVISI_COST;
-	shame += shiny * ARC_SHINY_COST;
-	shame += glow * ARC_GLOW_COST;
-	shame += alpha * ARC_ALPHA_COST;
-	shame += flexi * ARC_FLEXI_COST;
-	shame += animtex * ARC_ANIM_TEX_COST;
-	shame += particles * ARC_PARTICLE_COST;
-	shame += bump * ARC_BUMP_COST;
-	shame += planar * ARC_PLANAR_COST;
-	shame += scale;
+	// factor in scale
+	shame *= scale;
 
-	LLViewerObject::const_child_list_t& child_list = getChildren();
-	for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
-		 iter != child_list.end(); 
-		 ++iter)
+	// multiply by per-face modifiers
+	if (planar)
 	{
-		const LLViewerObject* child_objectp = *iter;
-		const LLDrawable* child_drawablep = child_objectp->mDrawable;
-		if (child_drawablep)
-		{
-			const LLVOVolume* child_volumep = child_drawablep->getVOVolume();
-			if (child_volumep)
-			{
-				shame += child_volumep->getRenderCost(textures);
-			}
-		}
+		shame *= planar * ARC_PLANAR_COST;
+	}
+
+	if (animtex)
+	{
+		shame *= animtex * ARC_ANIM_TEX_COST;
+	}
+
+	if (alpha)
+	{
+		shame *= alpha * ARC_ALPHA_COST;
+	}
+
+	if(invisi)
+	{
+		shame *= invisi * ARC_INVISI_COST;
+	}
+
+	if (glow)
+	{
+		shame *= glow * ARC_GLOW_MULT;
+	}
+
+	if (bump)
+	{
+		shame *= bump * ARC_BUMP_MULT;
+	}
+
+	if (shiny)
+	{
+		shame *= shiny * ARC_SHINY_MULT;
 	}
 
-	return shame;
 
+	// multiply shame by multipliers
+	if (weighted_mesh)
+	{
+		shame *= weighted_mesh * ARC_WEIGHTED_MESH;
+	}
+
+	if (flexi)
+	{
+		shame *= flexi * ARC_FLEXI_MULT;
+	}
+
+
+	// add additional costs
+	if (particles)
+	{
+		const LLPartSysData *part_sys_data = &(mPartSourcep->mPartSysData);
+		const LLPartData *part_data = &(part_sys_data->mPartData);
+		U32 num_particles = (U32)(part_sys_data->mBurstPartCount * llceil( part_data->mMaxAge / part_sys_data->mBurstRate));
+		num_particles = num_particles > ARC_PARTICLE_MAX ? ARC_PARTICLE_MAX : num_particles;
+		F32 part_size = (llmax(part_data->mStartScale[0], part_data->mEndScale[0]) + llmax(part_data->mStartScale[1], part_data->mEndScale[1])) / 2.f;
+		shame += num_particles * part_size * ARC_PARTICLE_COST;
+	}
+
+	return (U32)shame;
 }
 
 F32 LLVOVolume::getStreamingCost()
diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h
index 0c12f14832..e02a5d5675 100644
--- a/indra/newview/llvovolume.h
+++ b/indra/newview/llvovolume.h
@@ -129,7 +129,8 @@ public:
 	const LLMatrix4&	getRelativeXform() const				{ return mRelativeXform; }
 	const LLMatrix3&	getRelativeXformInvTrans() const		{ return mRelativeXformInvTrans; }
 	/*virtual*/	const LLMatrix4	getRenderMatrix() const;
-				U32 	getRenderCost(std::set<LLUUID> &textures) const;
+				typedef std::map<LLUUID, S32> texture_cost_t;
+				U32 	getRenderCost(texture_cost_t &textures) const;
 	/*virtual*/	F32		getStreamingCost();
 	/*virtual*/ U32		getTriangleCount() const;
 	/*virtual*/ BOOL lineSegmentIntersect(const LLVector3& start, const LLVector3& end, 
@@ -358,8 +359,6 @@ public:
 	static LLPointer<LLObjectMediaDataClient> sObjectMediaClient;
 	static LLPointer<LLObjectMediaNavigateClient> sObjectMediaNavigateClient;
 
-	static const U32 ARC_TEXTURE_COST = 5;
-
 protected:
 	static S32 sNumLODChanges;
 	
-- 
cgit v1.2.3


From c10494e370f6399deea835964760628b14f7e299 Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Wed, 16 Feb 2011 15:32:48 -0500
Subject: SH-997 FIX verify texture performance stats

Got some better, reproducible numbers, which puts 32x32 textures at 538 points and
1024x1024 textures at 1024 points.
---
 indra/newview/llfloatertools.cpp | 3 ++-
 indra/newview/llvovolume.cpp     | 6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index ceaf3c1449..1410facb53 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -427,7 +427,8 @@ void LLFloaterTools::refresh()
 		if (sShowObjectCost)
 		{
 			std::string prim_cost_string;
-			LLResMgr::getInstance()->getIntegerString(prim_cost_string, calcRenderCost());
+			S32 cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectRenderCost();
+			LLResMgr::getInstance()->getIntegerString(prim_cost_string, cost);
 			getChild<LLUICtrl>("RenderingCost")->setTextArg("[COUNT]", prim_cost_string);
 		}
 		
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 01027e6a11..7703019f99 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -2945,7 +2945,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 	// per-prim costs
 	static const U32 ARC_PARTICLE_COST = 1;
 	static const U32 ARC_PARTICLE_MAX = 2048;
-	static const U32 ARC_TEXTURE_COST = 5;
+	static const U32 ARC_TEXTURE_COST = 32;
 
 	// per-prim multipliers
 	static const F32 ARC_GLOW_MULT = 1.5f; // tested based on performance
@@ -3043,7 +3043,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 				LLViewerFetchedTexture *texture = LLViewerTextureManager::getFetchedTexture(sculpt_id);
 				if (texture)
 				{
-					S32 texture_cost = (S32)(ARC_TEXTURE_COST * (texture->getFullHeight() / 128.f + texture->getFullWidth() / 128.f + 1));
+					S32 texture_cost = 512 + (S32)(ARC_TEXTURE_COST * (texture->getFullHeight() / 128.f + texture->getFullWidth() / 128.f));
 					textures.insert(texture_cost_t::value_type(sculpt_id, texture_cost));
 				}
 			}
@@ -3075,7 +3075,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 		{
 			if (textures.find(img->getID()) == textures.end())
 			{
-				S32 texture_cost = (S32)(ARC_TEXTURE_COST * (img->getFullHeight() / 128.f + img->getFullWidth() / 128.f + 1));
+				S32 texture_cost = 512 + (S32)(ARC_TEXTURE_COST * (img->getFullHeight() / 128.f + img->getFullWidth() / 128.f));
 				textures.insert(texture_cost_t::value_type(img->getID(), texture_cost));
 			}
 		}
-- 
cgit v1.2.3


From 24c353a1ad00366b9f4ce57492059ce8caf84ba0 Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Tue, 22 Feb 2011 17:29:38 -0500
Subject: first pass at clouding avatars that are too complex

---
 indra/newview/llviewercontrol.cpp |  6 ++++++
 indra/newview/llvoavatar.cpp      | 16 ++++++++++++++++
 indra/newview/llvoavatar.h        |  2 ++
 indra/newview/llvovolume.cpp      | 10 +++++-----
 4 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index e319eba0ee..d99f3b6c88 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -165,6 +165,11 @@ static bool handleRenderPerfTestChanged(const LLSD& newvalue)
        return true;
 }
 
+bool handleRenderAvatarComplexityLimitChanged(const LLSD& newvalue)
+{
+	return true;
+}
+
 bool handleRenderTransparentWaterChanged(const LLSD& newvalue)
 {
 	LLWorld::getInstance()->updateWaterObjects();
@@ -586,6 +591,7 @@ void settings_setup_listeners()
 	gSavedSettings.getControl("WindLightUseAtmosShaders")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
 	gSavedSettings.getControl("RenderGammaFull")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
 	gSavedSettings.getControl("RenderAvatarMaxVisible")->getSignal()->connect(boost::bind(&handleAvatarMaxVisibleChanged, _2));
+	gSavedSettings.getControl("RenderAvatarComplexityLimit")->getSignal()->connect(boost::bind(&handleRenderAvatarComplexityLimitChanged, _2));
 	gSavedSettings.getControl("RenderVolumeLODFactor")->getSignal()->connect(boost::bind(&handleVolumeLODChanged, _2));
 	gSavedSettings.getControl("RenderAvatarLODFactor")->getSignal()->connect(boost::bind(&handleAvatarLODChanged, _2));
 	gSavedSettings.getControl("RenderTerrainLODFactor")->getSignal()->connect(boost::bind(&handleTerrainLODChanged, _2));
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 856c068a44..be65af1e71 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -6307,6 +6307,11 @@ BOOL LLVOAvatar::getIsCloud()
 	{
 		return TRUE;
 	}
+
+	if (isTooComplex())
+	{
+		return TRUE;
+	}
 	return FALSE;
 }
 
@@ -6401,6 +6406,16 @@ BOOL LLVOAvatar::isFullyLoaded() const
 		return mFullyLoaded;
 }
 
+bool LLVOAvatar::isTooComplex() const
+{
+	if (gSavedSettings.getS32("RenderAvatarComplexityLimit") > 0 && mVisualComplexity >= gSavedSettings.getS32("RenderAvatarComplexityLimit"))
+	{
+		return true;
+	}
+
+	return false;
+}
+
 
 //-----------------------------------------------------------------------------
 // findMotion()
@@ -8338,6 +8353,7 @@ void LLVOAvatar::idleUpdateRenderCost()
 	}
 
 	setDebugText(llformat("%d", cost));
+	mVisualComplexity = cost;
 	F32 green = 1.f-llclamp(((F32) cost-(F32)ARC_LIMIT)/(F32)ARC_LIMIT, 0.f, 1.f);
 	F32 red = llmin((F32) cost/(F32)ARC_LIMIT, 1.f);
 	mText->setColor(LLColor4(red,green,0,1));
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 1152475383..f41c385894 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -263,6 +263,7 @@ public:
 	//--------------------------------------------------------------------
 public:
 	BOOL			isFullyLoaded() const;
+	bool			isTooComplex() const;
 	bool visualParamWeightsAreDefault();
 protected:
 	virtual BOOL	getIsCloud();
@@ -275,6 +276,7 @@ private:
 	BOOL			mPreviousFullyLoaded;
 	BOOL			mFullyLoadedInitialized;
 	S32				mFullyLoadedFrameCounter;
+	S32				mVisualComplexity;
 	LLFrameTimer	mFullyLoadedTimer;
 	LLFrameTimer	mRuthTimer;
 protected:
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index e3dea5c788..f5b31d25ac 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -2943,9 +2943,9 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 	U32 num_triangles = 0;
 
 	// per-prim costs
-	static const U32 ARC_PARTICLE_COST = 1;
-	static const U32 ARC_PARTICLE_MAX = 2048;
-	static const U32 ARC_TEXTURE_COST = 32;
+	static const U32 ARC_PARTICLE_COST = 1; // determined experimentally
+	static const U32 ARC_PARTICLE_MAX = 2048; // default values
+	static const U32 ARC_TEXTURE_COST = 32; // multiplier for texture resolution - performance tested
 
 	// per-prim multipliers
 	static const F32 ARC_GLOW_MULT = 1.5f; // tested based on performance
@@ -2955,9 +2955,9 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 	static const F32 ARC_INVISI_COST = 1.2f; // tested based on performance
 	static const F32 ARC_WEIGHTED_MESH = 1.2f; 
 
-	static const F32 ARC_PLANAR_COST = 1.2f; // 1.2x max
+	static const F32 ARC_PLANAR_COST = 1.0f; // tested based on performance to have negligible impact
 	static const F32 ARC_ANIM_TEX_COST = 1.4f; // 1.4x max
-	static const F32 ARC_ALPHA_COST = 4.f; // 4x max
+	static const F32 ARC_ALPHA_COST = 4.f; // 4x max - based on performance
 
 	F32 shame = 0;
 
-- 
cgit v1.2.3


From d06cab548d7e4daa7a120692f64c10c05927143f Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Wed, 23 Feb 2011 12:56:05 -0500
Subject: forgot to add the new setting to settings.xml

---
 indra/newview/app_settings/settings.xml | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index d71b84739c..1bae39d5d7 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -7046,7 +7046,18 @@
       <key>Value</key>
       <integer>1</integer>
     </map>
-    <key>RenderAvatarLODFactor</key>
+  <key>RenderAvatarComplexityLimit</key>
+    <map>
+      <key>Comment</key>
+      <string>Max visual complexity of avatars in a scens</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>S32</string>
+      <key>Value</key>
+      <integer>-1</integer>
+    </map>
+  <key>RenderAvatarLODFactor</key>
     <map>
       <key>Comment</key>
       <string>Controls level of detail of avatars (multiplier for current screen area when calculated level of detail)</string>
-- 
cgit v1.2.3


From 77fff26431671ffef8cf482044b1fcd98262d3e0 Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Wed, 23 Feb 2011 17:21:54 -0500
Subject: suppressing particles in overly complex avatars when clouding - they
 should appear as white spheres.

---
 indra/newview/llvoavatar.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index be65af1e71..7dadf34a2a 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -2716,7 +2716,10 @@ void LLVOAvatar::idleUpdateLoadingEffect()
 																 LLPartData::LL_PART_EMISSIVE_MASK | // LLPartData::LL_PART_FOLLOW_SRC_MASK |
 																 LLPartData::LL_PART_TARGET_POS_MASK );
 			
-			setParticleSource(particle_parameters, getID());
+			if (!isTooComplex()) // do not generate particles for overly-complex avatars
+			{
+				setParticleSource(particle_parameters, getID());
+			}
 		}
 	}
 }	
-- 
cgit v1.2.3


From 29dc641fbe7ab77f77fe19e2e7976980f0649b5b Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Tue, 22 Mar 2011 20:39:31 -0400
Subject: initial effort to enable a debug display to show render complexity.
 Using for internal demo, will get it code reviewed if it merges in.

---
 indra/newview/llspatialpartition.cpp               | 38 ++++++++++++++++++++++
 indra/newview/llviewermenu.cpp                     |  4 +++
 indra/newview/llviewerobjectlist.cpp               |  4 +++
 indra/newview/llvovolume.cpp                       | 18 ++++++++--
 indra/newview/llvovolume.h                         | 10 +++++-
 indra/newview/pipeline.h                           |  1 +
 indra/newview/skins/default/xui/en/menu_viewer.xml | 10 ++++++
 .../skins/default/xui/en/panel_region_terrain.xml  | 34 +++++++++++++++++++
 8 files changed, 116 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 5e7af6bbb3..b604908474 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -2792,6 +2792,40 @@ void renderUpdateType(LLDrawable* drawablep)
 	}
 }
 
+void renderComplexityDisplay(LLDrawable* drawablep)
+{
+	LLViewerObject* vobj = drawablep->getVObj();
+	if (!vobj)
+	{
+		return;
+	}
+
+	LLVOVolume *voVol = dynamic_cast<LLVOVolume*>(vobj);
+
+	if (!voVol)
+	{
+		return;
+	}
+
+	LLVOVolume::texture_cost_t textures;
+	F32 cost = (F32) voVol->getRenderCost(textures) / (F32) LLVOVolume::getRenderComplexityMax();
+	
+	LLGLEnable blend(GL_BLEND);
+
+	F32 red = cost;
+	F32 green = 1.0f - cost;
+
+	glColor4f(red,green,0,0.5f);
+
+	S32 num_faces = drawablep->getNumFaces();
+	if (num_faces)
+	{
+		for (S32 i = 0; i < num_faces; ++i)
+		{
+			pushVerts(drawablep->getFace(i), LLVertexBuffer::MAP_VERTEX);
+		}
+	}	
+}
 
 void renderBoundingBox(LLDrawable* drawable, BOOL set_color = TRUE)
 {
@@ -3906,6 +3940,10 @@ public:
 			{
 				renderUpdateType(drawable);
 			}
+			if(gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_RENDER_COMPLEXITY))
+			{
+				renderComplexityDisplay(drawable);
+			}
 
 			LLVOAvatar* avatar = dynamic_cast<LLVOAvatar*>(drawable->getVObj().get());
 			
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index f5b0857425..30be2fb8e0 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -993,6 +993,10 @@ U32 info_display_from_string(std::string info_display)
 	{
 		return LLPipeline::RENDER_DEBUG_AGENT_TARGET;
 	}
+	else if ("" == info_display)
+	{
+		return LLPipeline::RENDER_DEBUG_RENDER_COMPLEXITY;
+	}
 	else
 	{
 		return 0;
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index 0071753831..2e8eb9f4a8 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -58,6 +58,7 @@
 #include "llviewerregion.h"
 #include "llviewerstats.h"
 #include "llviewerstatsrecorder.h"
+#include "llvovolume.h"
 #include "llvoavatarself.h"
 #include "lltoolmgr.h"
 #include "lltoolpie.h"
@@ -997,6 +998,9 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
 	mNumSizeCulled = 0;
 	mNumVisCulled = 0;
 
+	// update max computed render cost
+	LLVOVolume::updateRenderComplexity();
+
 	// compute all sorts of time-based stats
 	// don't factor frames that were paused into the stats
 	if (! mWasPaused)
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index e2d1850e58..7c772ce835 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -87,6 +87,8 @@ F32 LLVOVolume::sLODFactor = 1.f;
 F32	LLVOVolume::sLODSlopDistanceFactor = 0.5f; //Changing this to zero, effectively disables the LOD transition slop 
 F32 LLVOVolume::sDistanceFactor = 1.0f;
 S32 LLVOVolume::sNumLODChanges = 0;
+S32 LLVOVolume::mRenderComplexity_last = 0;
+S32 LLVOVolume::mRenderComplexity_current = 0;
 LLPointer<LLObjectMediaDataClient> LLVOVolume::sObjectMediaClient = NULL;
 LLPointer<LLObjectMediaNavigateClient> LLVOVolume::sObjectMediaNavigateClient = NULL;
 
@@ -3206,6 +3208,11 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 		shame += num_particles * part_size * ARC_PARTICLE_COST;
 	}
 
+	if (shame > mRenderComplexity_current)
+	{
+		mRenderComplexity_current = (S32)shame;
+	}
+
 	return (U32)shame;
 }
 
@@ -3223,7 +3230,14 @@ F32 LLVOVolume::getStreamingCost()
 	return 0.f;
 }
 
-U32 LLVOVolume::getTriangleCount()
+//static 
+void LLVOVolume::updateRenderComplexity()
+{
+	mRenderComplexity_last = mRenderComplexity_current;
+	mRenderComplexity_current = 0;
+}
+
+U32 LLVOVolume::getTriangleCount() const
 {
 	U32 count = 0;
 	LLVolume* volume = getVolume();
@@ -4068,7 +4082,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
 						if ( bindCnt > 0 )
 						{					
 							const int jointCnt = pSkinData->mJointNames.size();
-							const int pelvisZOffset = pSkinData->mPelvisOffset;
+							const int pelvisZOffset = (int)pSkinData->mPelvisOffset;
 							bool fullRig = (jointCnt>=20) ? true : false;
 							if ( fullRig )
 							{
diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h
index 5af88c6cbd..57faee556f 100644
--- a/indra/newview/llvovolume.h
+++ b/indra/newview/llvovolume.h
@@ -132,7 +132,7 @@ public:
 				typedef std::map<LLUUID, S32> texture_cost_t;
 				U32 	getRenderCost(texture_cost_t &textures) const;
 	/*virtual*/	F32		getStreamingCost();
-	/*virtual*/ U32		getTriangleCount();
+	/*virtual*/ U32		getTriangleCount() const;
 	/*virtual*/ BOOL lineSegmentIntersect(const LLVector3& start, const LLVector3& end, 
 										  S32 face = -1,                        // which face to check, -1 = ALL_SIDES
 										  BOOL pick_transparent = FALSE,
@@ -320,11 +320,19 @@ protected:
 	LLFace* addFace(S32 face_index);
 	void updateTEData();
 
+	// stats tracking for render complexity
+	static S32 mRenderComplexity_last;
+	static S32 mRenderComplexity_current;
+
 	void requestMediaDataUpdate(bool isNew);
 	void cleanUpMediaImpls();
 	void addMediaImpl(LLViewerMediaImpl* media_impl, S32 texture_index) ;
 	void removeMediaImpl(S32 texture_index) ;
 public:
+
+	static S32 getRenderComplexityMax() {return mRenderComplexity_last;}
+	static void updateRenderComplexity();
+
 	LLViewerTextureAnim *mTextureAnimp;
 	U8 mTexAnimMode;
 private:
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index be58af947c..02bb6d618e 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -448,6 +448,7 @@ public:
 		RENDER_DEBUG_PHYSICS_SHAPES     = 0x1000000,
 		RENDER_DEBUG_NORMALS	        = 0x2000000,
 		RENDER_DEBUG_LOD_INFO	        = 0x4000000,
+		RENDER_DEBUG_RENDER_COMPLEXITY  = 0x8000000
 	};
 
 public:
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index ea40a08c95..7a227fb5f9 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -2338,6 +2338,16 @@
            function="Advanced.ToggleInfoDisplay"
            parameter="raycast" />
         </menu_item_check>
+        <menu_item_check
+         label="Render Complexity"
+         name="rendercomplexity">
+          <menu_item_check.on_check
+           function="Advanced.CheckInfoDisplay"
+           parameter="rendercomplexity" />
+          <menu_item_check.on_click
+           function="Advanced.ToggleInfoDisplay"
+           parameter="rendercomplexity" />
+        </menu_item_check>
       </menu>
         <menu
          create_jump_keys="true"
diff --git a/indra/newview/skins/default/xui/en/panel_region_terrain.xml b/indra/newview/skins/default/xui/en/panel_region_terrain.xml
index 5093c52129..d7a629e543 100644
--- a/indra/newview/skins/default/xui/en/panel_region_terrain.xml
+++ b/indra/newview/skins/default/xui/en/panel_region_terrain.xml
@@ -115,6 +115,40 @@
      name="apply_btn"
      top="135"
      width="90" />
+    <combo_box
+     height="23"
+     layout="topleft"
+     left="50"
+     name="SkyPresetsCombo"
+     top="165"
+     width="150" />
+    <combo_box
+     height="23"
+     layout="topleft"
+     left="200"
+     name="WaterPresetsCombo"
+     top="165"
+     width="150" />
+    <button
+     enabled="false"
+     follows="left|top"
+     height="20"
+     label="Apply"
+     layout="topleft"
+     left="370"
+     name="wes_apply_btn"
+     top="165"
+     width="90" />
+    <button
+     enabled="false"
+     follows="left|top"
+     height="20"
+     label="Edit Environment"
+     layout="topleft"
+     left="370"
+     name="env_editor_btn"
+     top="195"
+     width="120" />
     <view_border
      bevel_style="none"
      follows="top|left"
-- 
cgit v1.2.3


From 9f2987d995e8a2273f723a387dd587c3dc988056 Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Wed, 23 Mar 2011 16:01:12 -0400
Subject: second pass at render complexity debug display.

---
 indra/llmath/lloctree.h                 |  2 +-
 indra/newview/app_settings/settings.xml | 73 ++++++++++++++++++++++++-
 indra/newview/llchathistory.cpp         |  2 +-
 indra/newview/llspatialpartition.cpp    | 96 +++++++++++++++++++++++++++++----
 indra/newview/llviewermenu.cpp          |  2 +-
 5 files changed, 161 insertions(+), 14 deletions(-)

diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h
index fdfc24f8b7..179ad7ecfd 100644
--- a/indra/llmath/lloctree.h
+++ b/indra/llmath/lloctree.h
@@ -294,7 +294,7 @@ public:
 		//is it here?
 		if (isInside(data->getPositionGroup()))
 		{
-			if ((getElementCount() < LL_OCTREE_MAX_CAPACITY && contains(data->getBinRadius()) ||
+			if (((getElementCount() < LL_OCTREE_MAX_CAPACITY && contains(data->getBinRadius())) ||
 				(data->getBinRadius() > getSize()[0] &&	parent && parent->getElementCount() >= LL_OCTREE_MAX_CAPACITY))) 
 			{ //it belongs here
 #if LL_OCTREE_PARANOIA_CHECK
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 176211773f..bf2d8eda7f 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -7105,7 +7105,78 @@
   <key>RenderAvatarComplexityLimit</key>
     <map>
       <key>Comment</key>
-      <string>Max visual complexity of avatars in a scens</string>
+      <string>Max visual complexity of avatars in a scene</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>S32</string>
+      <key>Value</key>
+      <integer>-1</integer>
+    </map>
+  <key>RenderComplexityColorMin</key>
+    <map>
+      <key>Comment</key>
+      <string>Max visual complexity of avatars in a scene</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Color4</string>
+      <key>Value</key>
+      <array>
+        <real>0.0</real>
+        <real>0.0</real>
+        <real>1.0</real>
+        <real>0.5</real>
+      </array>
+    </map>
+  <key>RenderComplexityColorMid</key>
+    <map>
+      <key>Comment</key>
+      <string>Max visual complexity of avatars in a scene</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Color4</string>
+      <key>Value</key>
+      <array>
+        <real>0.0</real>
+        <real>1.0</real>
+        <real>0.0</real>
+        <real>0.5</real>
+      </array>
+    </map>
+  <key>RenderComplexityColorMax</key>
+    <map>
+      <key>Comment</key>
+      <string>Max visual complexity of avatars in a scene</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Color4</string>
+      <key>Value</key>
+      <array>
+        <real>1.0</real>
+        <real>0.0</real>
+        <real>0.0</real>
+        <real>0.5</real>
+      </array>
+    </map>
+  <key>RenderComplexityThreshold</key>
+    <map>
+      <key>Comment</key>
+      <string>Only color objects higher than render threshold</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>S32</string>
+      <key>Value</key>
+      <integer>-1</integer>
+    </map>
+  <key>RenderComplexityStaticMax</key>
+    <map>
+      <key>Comment</key>
+      <string>Sets a static max value for scaling of RenderComplexity 
+        display (-1 for dynamic scaling)</string>
       <key>Persist</key>
       <integer>1</integer>
       <key>Type</key>
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index d4ec377e03..658eb6eccf 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -255,7 +255,7 @@ public:
 		mSourceType = chat.mSourceType;
 
 		//*TODO overly defensive thing, source type should be maintained out there
-		if((chat.mFromID.isNull() && chat.mFromName.empty()) || chat.mFromName == SYSTEM_FROM && chat.mFromID.isNull())
+		if((chat.mFromID.isNull() && chat.mFromName.empty()) || (chat.mFromName == SYSTEM_FROM && chat.mFromID.isNull()))
 		{
 			mSourceType = CHAT_SOURCE_SYSTEM;
 		}  
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index b604908474..092e48e459 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -2807,24 +2807,99 @@ void renderComplexityDisplay(LLDrawable* drawablep)
 		return;
 	}
 
+	if (!voVol->isRoot())
+	{
+		return;
+	}
+
 	LLVOVolume::texture_cost_t textures;
-	F32 cost = (F32) voVol->getRenderCost(textures) / (F32) LLVOVolume::getRenderComplexityMax();
+	F32 cost = (F32) voVol->getRenderCost(textures);
+
+	// add any child volumes
+	LLViewerObject::const_child_list_t children = voVol->getChildren();
+	for (LLViewerObject::const_child_list_t::const_iterator iter = children.begin(); iter != children.end(); ++iter)
+	{
+		const LLViewerObject *child = *iter;
+		const LLVOVolume *child_volume = dynamic_cast<const LLVOVolume*>(child);
+		if (child_volume)
+		{
+			cost += child_volume->getRenderCost(textures);
+		}
+	}
+
+	// add texture cost
+	for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter)
+	{
+		// add the cost of each individual texture in the linkset
+		cost += iter->second;
+	}
+
+	F32 cost_max = (F32) LLVOVolume::getRenderComplexityMax();
+
+
+
+	// allow user to set a static color scale
+	if (gSavedSettings.getS32("RenderComplexityStaticMax") > 0)
+	{
+		cost_max = gSavedSettings.getS32("RenderComplexityStaticMax");
+	}
+
+	F32 cost_ratio = cost / cost_max;
+	
+	// cap cost ratio at 1.0f in case cost_max is at a low threshold
+	cost_ratio = cost_ratio > 1.0f ? 1.0f : cost_ratio;
 	
 	LLGLEnable blend(GL_BLEND);
 
-	F32 red = cost;
-	F32 green = 1.0f - cost;
+	LLColor4 color;
+	const LLColor4 color_min = gSavedSettings.getColor4("RenderComplexityColorMin");
+	const LLColor4 color_mid = gSavedSettings.getColor4("RenderComplexityColorMid");
+	const LLColor4 color_max = gSavedSettings.getColor4("RenderComplexityColorMax");
+
+	if (cost_ratio < 0.5f)
+	{
+		color = color_min * (1 - cost_ratio * 2) + color_mid * (cost_ratio * 2);
+	}
+	else
+	{
+		color = color_mid * (1 - (cost_ratio - 0.5) * 2) + color_max * ((cost_ratio - 0.5) * 2);
+	}
 
-	glColor4f(red,green,0,0.5f);
+	LLSD color_val = color.getValue();
 
-	S32 num_faces = drawablep->getNumFaces();
-	if (num_faces)
+	// don't highlight objects below the threshold
+	if (cost > gSavedSettings.getS32("RenderComplexityThreshold"))
 	{
-		for (S32 i = 0; i < num_faces; ++i)
+		glColor4f(color[0],color[1],color[2],0.5f);
+
+
+		S32 num_faces = drawablep->getNumFaces();
+		if (num_faces)
 		{
-			pushVerts(drawablep->getFace(i), LLVertexBuffer::MAP_VERTEX);
+			for (S32 i = 0; i < num_faces; ++i)
+			{
+				pushVerts(drawablep->getFace(i), LLVertexBuffer::MAP_VERTEX);
+			}
 		}
-	}	
+		LLViewerObject::const_child_list_t children = voVol->getChildren();
+		for (LLViewerObject::const_child_list_t::const_iterator iter = children.begin(); iter != children.end(); ++iter)
+		{
+			const LLViewerObject *child = *iter;
+			if (child)
+			{
+				num_faces = child->getNumFaces();
+				if (num_faces)
+				{
+					for (S32 i = 0; i < num_faces; ++i)
+					{
+						pushVerts(child->mDrawable->getFace(i), LLVertexBuffer::MAP_VERTEX);
+					}
+				}
+			}
+		}
+	}
+	
+	voVol->setDebugText(llformat("%4.0f", cost));	
 }
 
 void renderBoundingBox(LLDrawable* drawable, BOOL set_color = TRUE)
@@ -4170,7 +4245,8 @@ void LLSpatialPartition::renderDebug()
 									  LLPipeline::RENDER_DEBUG_AVATAR_VOLUME |
 									  LLPipeline::RENDER_DEBUG_AGENT_TARGET |
 									  //LLPipeline::RENDER_DEBUG_BUILD_QUEUE |
-									  LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA)) 
+									  LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA |
+									  LLPipeline::RENDER_DEBUG_RENDER_COMPLEXITY)) 
 	{
 		return;
 	}
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 30be2fb8e0..f3e58ce73d 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -993,7 +993,7 @@ U32 info_display_from_string(std::string info_display)
 	{
 		return LLPipeline::RENDER_DEBUG_AGENT_TARGET;
 	}
-	else if ("" == info_display)
+	else if ("rendercomplexity" == info_display)
 	{
 		return LLPipeline::RENDER_DEBUG_RENDER_COMPLEXITY;
 	}
-- 
cgit v1.2.3


From c57c8c21881f0ee543f63f45b524f442a59fa7d2 Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Tue, 17 May 2011 18:33:59 -0400
Subject: SH-1246 WIP fix render cost in the viewer

Modified avatar display to compute values correctly.
Also changed build tools XML temporarily so build tool
costs can be seen.
---
 indra/newview/llvoavatar.cpp                       | 26 +++++++++++++++++-----
 .../newview/skins/default/xui/en/floater_tools.xml | 22 +++++++++---------
 2 files changed, 32 insertions(+), 16 deletions(-)

diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index a195f0fb68..cd98fe6d7e 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -8282,6 +8282,7 @@ void LLVOAvatar::idleUpdateRenderCost()
 			const LLViewerObject* attached_object = (*attachment_iter);
 			if (attached_object && !attached_object->isHUDAttachment())
 			{
+				textures.clear();
 				const LLDrawable* drawable = attached_object->mDrawable;
 				if (drawable)
 				{
@@ -8289,6 +8290,25 @@ void LLVOAvatar::idleUpdateRenderCost()
 					if (volume)
 					{
 						cost += volume->getRenderCost(textures);
+
+						const_child_list_t children = volume->getChildren();
+						for (const_child_list_t::const_iterator child_iter = children.begin();
+							  child_iter != children.end();
+							  ++child_iter)
+						{
+							LLViewerObject* child_obj = *child_iter;
+							LLVOVolume *child = dynamic_cast<LLVOVolume*>( child_obj );
+							if (child)
+							{
+								cost += volume->getRenderCost(textures);
+							}
+						}
+
+						for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter)
+						{
+							// add the cost of each individual texture in the linkset
+							cost += iter->second;
+						}
 					}
 				}
 			}
@@ -8296,11 +8316,7 @@ void LLVOAvatar::idleUpdateRenderCost()
 
 	}
 
-	for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter)
-	{
-		// add the cost of each individual texture in the linkset
-		cost += iter->second;
-	}
+
 
 	// Diagnostic output to identify all avatar-related textures.
 	// Does not affect rendering cost calculation.
diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml
index 05d47506db..b99a8b6228 100644
--- a/indra/newview/skins/default/xui/en/floater_tools.xml
+++ b/indra/newview/skins/default/xui/en/floater_tools.xml
@@ -788,35 +788,35 @@
      name="linked_set_count"
      top="144"
      width="80">
-        Linked Sets: [COUNT]
+        L: [COUNT]
     </text>
     <text
     text_color="LtGray_50"
      type="string"
      length="1"
-     height="10"
      follows="left|top"
      halign="right"
      layout="topleft"
      top_delta="0"
-     right="-8"
-     name="linked_set_cost"
-     tool_tip="Cost of currently selected linked sets as [prims],[physics complexity]" 
+     right="-100"
+     name="object_count"
      width="80">
-        Cost: [COST] / [PHYSICS]
+        O: [COUNT]
     </text>
     <text
     text_color="LtGray_50"
      type="string"
      length="1"
+     height="10"
      follows="left|top"
      halign="right"
      layout="topleft"
-     top_pad="5"
-     right="-120"
-     name="object_count"
+     top_delta="0"
+     right="-8"
+     name="linked_set_cost"
+     tool_tip="Cost of currently selected linked sets as [prims],[physics complexity]" 
      width="80">
-        Objects: [COUNT]
+        Cost: [COST] / [PHYSICS]
     </text>
     <text
     text_color="LtGray_50"
@@ -825,7 +825,7 @@
      follows="left|top"
      halign="right"
      layout="topleft"
-	 top_delta="0"
+	 top_pad="5"
      right="-8"
      name="object_cost"
      tool_tip="Cost of currently selected objects as [prims] / [physics complexity]"
-- 
cgit v1.2.3


From 90486e89a2d2ab648bf2981590d86dd34b395534 Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Fri, 20 May 2011 18:41:14 -0400
Subject: SH-1564 FIX update performance cost of flexi prims.

Flexi prims are expensive - clocked in at 5x multiplier. Ouch!
---
 indra/newview/llvovolume.cpp | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index c2ccbc4c49..4c8bfaee27 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -2971,15 +2971,15 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 	// per-prim costs
 	static const U32 ARC_PARTICLE_COST = 1; // determined experimentally
 	static const U32 ARC_PARTICLE_MAX = 2048; // default values
-	static const U32 ARC_TEXTURE_COST = 32; // multiplier for texture resolution - performance tested
+	static const U32 ARC_TEXTURE_COST = 16; // multiplier for texture resolution - performance tested
 
 	// per-prim multipliers
 	static const F32 ARC_GLOW_MULT = 1.5f; // tested based on performance
 	static const F32 ARC_BUMP_MULT = 1.25f; // tested based on performance
-	static const F32 ARC_FLEXI_MULT = 4;
+	static const F32 ARC_FLEXI_MULT = 5; // tested based on performance
 	static const F32 ARC_SHINY_MULT = 1.6f; // tested based on performance
 	static const F32 ARC_INVISI_COST = 1.2f; // tested based on performance
-	static const F32 ARC_WEIGHTED_MESH = 1.2f; 
+	static const F32 ARC_WEIGHTED_MESH = 1.2f; // tested based on performance
 
 	static const F32 ARC_PLANAR_COST = 1.0f; // tested based on performance to have negligible impact
 	static const F32 ARC_ANIM_TEX_COST = 1.4f; // 1.4x max
@@ -3069,7 +3069,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 				LLViewerFetchedTexture *texture = LLViewerTextureManager::getFetchedTexture(sculpt_id);
 				if (texture)
 				{
-					S32 texture_cost = 512 + (S32)(ARC_TEXTURE_COST * (texture->getFullHeight() / 128.f + texture->getFullWidth() / 128.f));
+					S32 texture_cost = 256 + (S32)(ARC_TEXTURE_COST * (texture->getFullHeight() / 128.f + texture->getFullWidth() / 128.f));
 					textures.insert(texture_cost_t::value_type(sculpt_id, texture_cost));
 				}
 			}
@@ -3101,7 +3101,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 		{
 			if (textures.find(img->getID()) == textures.end())
 			{
-				S32 texture_cost = 512 + (S32)(ARC_TEXTURE_COST * (img->getFullHeight() / 128.f + img->getFullWidth() / 128.f));
+				S32 texture_cost = 256 + (S32)(ARC_TEXTURE_COST * (img->getFullHeight() / 128.f + img->getFullWidth() / 128.f));
 				textures.insert(texture_cost_t::value_type(img->getID(), texture_cost));
 			}
 		}
@@ -3143,8 +3143,8 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 		}
 	}
 
-	// shame currently has the "base" cost of 1 point per 50 triangles, min 2.
-	shame = num_triangles / 50.f;
+	// shame currently has the "base" cost of 1 point per 15 triangles, min 2.
+	shame = num_triangles / 15.f;
 	shame = shame < 2.f ? 2.f : shame;
 
 	// factor in scale
-- 
cgit v1.2.3


From 6a521b0578d430246c5ae5492a6dc9bc9060c2ff Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Mon, 23 May 2011 11:55:43 -0400
Subject: Changing labeling of avatar render cost to clarify that its a new
 algorithm.

---
 indra/newview/skins/default/xui/en/menu_viewer.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 3d23cee742..3b268a1937 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -1199,7 +1199,7 @@
                  parameter="stats" />
             </menu_item_check>
       <menu_item_check
-        label="Show Avatar Rendering Cost"
+        label="Show Draw Weight for Avatars"
         name="Avatar Rendering Cost">
            <menu_item_check.on_check
             function="Advanced.CheckInfoDisplay"
-- 
cgit v1.2.3


From 85b316e5df41444eafe77964f1a4758ccfd40784 Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Mon, 6 Jun 2011 11:42:04 -0400
Subject: BUILDFIX fixing crash on performance analysis when there is no
 variation

when fasttimers are amazingly consistent, we remove all data as outliers
instead of removing nothing. Probably something else going on here,
but this should fix the crash so we can analyze better.
---
 indra/llmath/llmath.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h
index eea7c977fb..9297bcbac2 100644
--- a/indra/llmath/llmath.h
+++ b/indra/llmath/llmath.h
@@ -510,6 +510,13 @@ inline void ll_remove_outliers(std::vector<VEC_TYPE>& data, F32 k)
 	VEC_TYPE Q1 = data[data.size()/4];
 	VEC_TYPE Q3 = data[data.size()-data.size()/4-1];
 
+	if ((F32)(Q3-Q1) < 1.f)
+	{
+		// not enough variation to detect outliers
+		return;
+	}
+
+
 	VEC_TYPE min = (VEC_TYPE) ((F32) Q1-k * (F32) (Q3-Q1));
 	VEC_TYPE max = (VEC_TYPE) ((F32) Q3+k * (F32) (Q3-Q1));
 
-- 
cgit v1.2.3


From 55f11fdfd17bdd3d9d0944940c62507741ac6a7b Mon Sep 17 00:00:00 2001
From: prep linden <prep@lindenlab.com>
Date: Fri, 8 Jul 2011 17:02:15 -0400
Subject: Fix for sh-1637 and sh-1638

---
 indra/newview/llagent.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 446ded8096..a8918877f9 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -575,7 +575,10 @@ void LLAgent::setFlying(BOOL fly)
 // static
 void LLAgent::toggleFlying()
 {
-	LLToolPie::instance().stopClickToWalk();
+	if ( gAgent.mAutoPilot )
+	{
+		LLToolPie::instance().stopClickToWalk();
+	}
 
 	BOOL fly = !gAgent.getFlying();
 
-- 
cgit v1.2.3


From 9b7165121acd3fc93ef9b17354cca515cd6849cf Mon Sep 17 00:00:00 2001
From: prep <prep@lindenlab.com>
Date: Thu, 14 Jul 2011 11:36:32 -0400
Subject: Fix for Sh-2047: Partial joint arrays are now able to upload

---
 indra/newview/llfloatermodelpreview.cpp | 41 ++++++++-------------------------
 indra/newview/llfloatermodelpreview.h   |  3 ---
 2 files changed, 10 insertions(+), 34 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 0748ed8039..9ef5c6022e 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -2196,15 +2196,11 @@ void LLModelPreview::critiqueRigForUploadApplicability( const std::vector<std::s
 		setRigValidForJointPositionUpload( true );
 	}
 
-	if ( isRigLegacyOK )
-	{
+	if ( isRigLegacyOK) 
+	{	
 		setLegacyRigValid( true );
 	}
 
-	if ( getRigWithSceneParity() && isJointPositionUploadOK )
-	{
-		setResetJointFlag( true );
-	}
 }
 //-----------------------------------------------------------------------------
 // critiqueJointToNodeMappingFromScene()
@@ -2244,12 +2240,7 @@ void LLModelPreview::critiqueJointToNodeMappingFromScene( void  )
 	//2. Partial rig but w/o parity between the scene and joint array
 	if ( result )
 	{		
-		setResetJointFlag( true );
 		setRigWithSceneParity( true );
-	}
-	else
-	{
-		setResetJointFlag( false );
 	}	
 }
 //-----------------------------------------------------------------------------
@@ -3007,13 +2998,7 @@ U32 LLModelPreview::calcResourceCost()
 		if ( uploadingJointPositions && !isRigValidForJointPositionUpload() )
 		{
 			mFMP->childDisable("ok_btn");		
-		}
-		else
-		if ( !isLegacyRigValid() )
-		{
-			mFMP->childDisable("ok_btn");
-		}
-		//ok_btn should not have been changed unless something was wrong with joint list
+		}		
 	}
 	
 	std::set<LLModel*> accounted;
@@ -4224,12 +4209,7 @@ void LLModelPreview::updateStatusMessages()
 		if ( uploadingJointPositions && !isRigValidForJointPositionUpload() )
 		{
 			skinAndRigOk = false;
-		}
-		else
-		if ( !isLegacyRigValid() )
-		{
-			skinAndRigOk = false;
-		}
+		}	
 	}
 	
 	if(upload_ok && mModelLoader)
@@ -4807,8 +4787,12 @@ BOOL LLModelPreview::render()
 		mFMP->childSetValue("upload_joints", false);
 		upload_joints = false;		
 	}	
-	
-	mFMP->childSetEnabled("upload_joints", upload_skin);
+		
+	//Only enable joint offsets if it passed the earlier critiquing
+	if ( isRigValidForJointPositionUpload() )  
+	{
+		mFMP->childSetEnabled("upload_joints", upload_skin);
+	}
 
 	F32 explode = mFMP->childGetValue("physics_explode").asReal();
 
@@ -5468,11 +5452,6 @@ void LLFloaterModelPreview::toggleCalculateButton(bool visible)
 		{
 			mCalculateBtn->setVisible( false );
 		}
-		else
-		if ( !mModelPreview->isLegacyRigValid() )
-		{			
-			mCalculateBtn->setVisible( false );
-		}
 	}
 	
 	mUploadBtn->setVisible(!visible);
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index 3a5f7602fe..c24e171024 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -365,9 +365,6 @@ public:
 	
 	void setLoadState( U32 state ) { mLoadState = state; }
 	U32 getLoadState() { return mLoadState; }
-	//setRestJointFlag: If an asset comes through that changes the joints, we want the reset to persist
-	void setResetJointFlag( bool state ) { if ( !mResetJoints ) mResetJoints = state; }
-	const bool getResetJointFlag( void ) const { return mResetJoints; }
 	void setRigWithSceneParity( bool state ) { mRigParityWithScene = state; }
 	const bool getRigWithSceneParity( void ) const { return mRigParityWithScene; }
 	
-- 
cgit v1.2.3


From a89c58f01bac2bc0bafc69dc31eb6071b6ef8829 Mon Sep 17 00:00:00 2001
From: prep <prep@lindenlab.com>
Date: Thu, 14 Jul 2011 17:18:53 -0400
Subject: Fix for SH-2061 model crashes viewer - fixed an issue where a
 corrupted dae would not disable the calc button

---
 indra/newview/llfloatermodelpreview.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 9ef5c6022e..9237f3a198 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -1396,6 +1396,8 @@ bool LLModelLoader::doLoadModel()
 	
 	if (!dom)
 	{
+		llinfos<<" Error with dae - traditionally indicates a corrupt file."<<llendl;
+		setLoadState( ERROR_PARSING );
 		return false;
 	}
 
@@ -3339,6 +3341,7 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable
 	if ( getLoadState() >= LLModelLoader::ERROR_PARSING )
 	{
 		mFMP->childDisable("ok_btn");
+		mFMP->childDisable( "calculate_btn" );
 	}
 	
 	if (lod == mPreviewLOD)
-- 
cgit v1.2.3


From 5267378577c6e1ca98cdaa6be601550b53b8692f Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Fri, 15 Jul 2011 17:01:25 -0600
Subject: fix for SH-1786: [PUBLIC] Turning off Lights and Shadows disables
 Glow

---
 indra/newview/llviewercontrol.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 87ca80260f..65da232f1c 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -404,7 +404,7 @@ static bool handleRenderDeferredChanged(const LLSD& newvalue)
 		gPipeline.releaseGLBuffers();
 		gPipeline.createGLBuffers();
 		gPipeline.resetVertexBuffers();
-		if (LLPipeline::sRenderDeferred && LLRenderTarget::sUseFBO)
+		if (LLPipeline::sRenderDeferred == (BOOL)LLRenderTarget::sUseFBO)
 		{
 			LLViewerShaderMgr::instance()->setShaders();
 		}
-- 
cgit v1.2.3


From 5707ccf570f71eb8439af775b86d9520dd5862c9 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Mon, 18 Jul 2011 12:09:32 -0600
Subject: fix for SH-1904: Medallion .dae makes viewer crash during upload

---
 indra/newview/llmeshrepository.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 78e2716be2..7ddc0db20d 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -1399,7 +1399,8 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
 
 			instance_entry["face_list"] = LLSD::emptyArray();
 
-			for (S32 face_num = 0; face_num < data.mBaseModel->getNumVolumeFaces(); face_num++)
+			S32 end = llmin((S32)data.mBaseModel->mMaterialList.size(), data.mBaseModel->getNumVolumeFaces()) ;
+			for (S32 face_num = 0; face_num < end; face_num++)
 			{
 				LLImportMaterial& material = instance.mMaterial[data.mBaseModel->mMaterialList[face_num]];
 				LLSD face_entry = LLSD::emptyMap();
-- 
cgit v1.2.3


From f376ec167c86ad8e702c9fcc4c643fe998e18269 Mon Sep 17 00:00:00 2001
From: Don Kjer <don@lindenlab.com>
Date: Mon, 18 Jul 2011 18:50:57 -0700
Subject: Adding support for viewer reading mesh params from an alternative
 param type.

---
 indra/llprimitive/llprimitive.h  | 1 +
 indra/newview/llviewerobject.cpp | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h
index 76faa1b8c5..8903d8e049 100644
--- a/indra/llprimitive/llprimitive.h
+++ b/indra/llprimitive/llprimitive.h
@@ -103,6 +103,7 @@ public:
 		PARAMS_LIGHT    = 0x20,
 		PARAMS_SCULPT   = 0x30,
 		PARAMS_LIGHT_IMAGE = 0x40,
+		PARAMS_MESH     = 0x50,
 	};
 	
 public:
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index bbe929b7f7..b5fdca632b 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -4877,6 +4877,10 @@ void LLViewerObject::adjustAudioGain(const F32 gain)
 
 bool LLViewerObject::unpackParameterEntry(U16 param_type, LLDataPacker *dp)
 {
+	if (LLNetworkData::PARAMS_MESH == param_type)
+	{
+		param_type = LLNetworkData::PARAMS_SCULPT;
+	}
 	ExtraParameter* param = getExtraParameterEntryCreate(param_type);
 	if (param)
 	{
-- 
cgit v1.2.3


From e8b71e0585ab126f9e77da93d6830a1a73a7aa92 Mon Sep 17 00:00:00 2001
From: Don Kjer <don@lindenlab.com>
Date: Mon, 18 Jul 2011 18:57:40 -0700
Subject: Changed mesh param type to not conflict with one in-use on server

---
 indra/llprimitive/llprimitive.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h
index 8903d8e049..998016f8f6 100644
--- a/indra/llprimitive/llprimitive.h
+++ b/indra/llprimitive/llprimitive.h
@@ -103,7 +103,8 @@ public:
 		PARAMS_LIGHT    = 0x20,
 		PARAMS_SCULPT   = 0x30,
 		PARAMS_LIGHT_IMAGE = 0x40,
-		PARAMS_MESH     = 0x50,
+		PARAMS_RESERVED = 0x50, // Used on server-side
+		PARAMS_MESH     = 0x60,
 	};
 	
 public:
-- 
cgit v1.2.3


From 41635a8dfda707d86acb6f38d39a699758d40a8e Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 19 Jul 2011 14:18:03 -0500
Subject: SH-2090 Make meshes that fail to load render as prim proxy.

---
 indra/newview/llvovolume.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 4723ec9bd1..a620244fab 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -966,7 +966,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams &params_in, const S32 detail, bo
 	S32 lod = mLOD;
 
 	BOOL is404 = FALSE;
-
+	
 	if (isSculpted())
 	{
 		// if it's a mesh
@@ -1017,6 +1017,8 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams &params_in, const S32 detail, bo
 	if (is404)
 	{
 		setIcon(LLViewerTextureManager::getFetchedTextureFromFile("icons/Inv_Mesh.png", TRUE, LLViewerTexture::BOOST_UI));
+		//render prim proxy when mesh loading attempts give up
+		volume_params.setSculptID(LLUUID::null, LL_SCULPT_TYPE_NONE);
 	}
 
 	if ((LLPrimitive::setVolume(volume_params, lod, (mVolumeImpl && mVolumeImpl->isVolumeUnique()))) || mSculptChanged)
-- 
cgit v1.2.3


From b730dd63dcc3701eb2e7c5f2972bc22e7a13fa80 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 20 Jul 2011 01:26:53 -0500
Subject: SH-2118 Fix for crash when decomposing bigfoot when SLM is in play.

---
 autobuild.xml | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index 6872af0661..10520b4113 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -1110,9 +1110,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>0db10480362168f075c2af0ae302cb74</string>
+              <string>17083fdd18176c9f0ab0ee6d74527ec2</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/234943/arch/Darwin/installer/llconvexdecomposition-0.1-darwin-20110707.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/236242/arch/Darwin/installer/llconvexdecomposition-0.1-darwin-20110719.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
@@ -1122,9 +1122,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>f3c667dc159c0537a9122ce6e72e16db</string>
+              <string>dce8a5fa75fd95b546c1c7c5b4e58f50</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/234943/arch/Linux/installer/llconvexdecomposition-0.1-linux-20110707.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/236242/arch/Linux/installer/llconvexdecomposition-0.1-linux-20110720.tar.bz2</string>
             </map>
             <key>name</key>
             <string>linux</string>
@@ -1134,9 +1134,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>46cac4d667446bbbc9b5023f2848a5ac</string>
+              <string>bd1791928b31212ef6d64446456dbfbc</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/234943/arch/CYGWIN/installer/llconvexdecomposition-0.1-windows-20110707.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/236242/arch/CYGWIN/installer/llconvexdecomposition-0.1-windows-20110719.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
-- 
cgit v1.2.3


From c37603d9ce2be463b76f8f179177a79537bae399 Mon Sep 17 00:00:00 2001
From: prep <prep@lindenlab.com>
Date: Wed, 20 Jul 2011 14:05:13 -0400
Subject: fix for sh-1847: Removed assert when a vert is outside [-5,5] domain

---
 indra/llprimitive/llmodel.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index 434fb7650b..ea0ea931af 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -2329,8 +2329,6 @@ LLSD LLModel::Decomposition::asLLSD() const
 
 			for (U32 k = 0; k < 3; k++)
 			{
-				llassert(v[k] <= 0.51f && v[k] >= -0.51f);
-
 				//convert to 16-bit normalized across domain
 				U16 val = (U16) (((v[k]-min.mV[k])/range.mV[k])*65535);
 
-- 
cgit v1.2.3


From e0782e32e5c4471fe11395f176d7c496125e3334 Mon Sep 17 00:00:00 2001
From: seth_productengine <none@none>
Date: Wed, 20 Jul 2011 23:36:39 +0300
Subject: =?UTF-8?q?SH-2059=20FIXED=20Mesh=20uploader=20UI=20clean=20up.=20?=
 =?UTF-8?q?-=20When=20the=20=E2=80=9CLoad=20from=20file=E2=80=9D=20radio?=
 =?UTF-8?q?=20is=20selected,=20the=20labels=20uner=20it=20are=20disabled.?=
 =?UTF-8?q?=20-=20Added=20horizontal=20lines=20to=20LoD=20tab=20like=20in?=
 =?UTF-8?q?=20the=20physics=20tab.=20-=20Physics=20tab:=20LoD=20dropdown?=
 =?UTF-8?q?=20moved=20to=20the=20left,=20against=20the=20=E2=80=9CUse=20Le?=
 =?UTF-8?q?vel=20of=20Detail=E2=80=9D=20label.=20-=20Modifiers=20tab:=20fi?=
 =?UTF-8?q?xed=20dimensions=20to=20show=20a=20z=20value.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../skins/default/xui/en/floater_model_preview.xml | 61 ++++++++++++++++++----
 1 file changed, 50 insertions(+), 11 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index 1d4a1d4827..0b7b4c684c 100644
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -173,6 +173,18 @@ L$ [MODEL]
       name="lod_panel"
       help_topic="upload_model_lod">
 
+      <!-- LOD TABLE-->
+      <panel
+        follows="top|left"
+        name="lod table"
+        left="0"
+        top="0"
+        width="300"
+        height="163"
+        visible="true"
+        border="true"
+        bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
+
       <text left="10" width="240" bottom="20" height="15" follows="left|top" name="lod_table_header">
         Select Level of Detail:
       </text>
@@ -210,9 +222,22 @@ L$ [MODEL]
       </text>
 
       <icon height="16" width="16" left="20" follows="left|top" name="lod_status_message_icon"/>
-      <text left_pad="5" width="200" height="28" follows="left|top" top_pad="-15" wrap="true" name="lod_status_message_text"/>
+      <text left_pad="5" width="230" height="28" follows="left|top" top_pad="-15" wrap="true" name="lod_status_message_text"/>
+      </panel>
 
-      <text top_pad="-3" left="10" height="15" follows="left|top">
+      <!-- LOD MESH-->
+      <panel
+        follows="top|left"
+        name="mesh"
+        left="0"
+        top_pad="0"
+        width="300"
+        height="237"
+        visible="true"
+        border="true"
+        bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
+
+      <text top_pad="5" left="10" height="15" follows="left|top">
         Mesh
       </text>
 
@@ -236,10 +261,10 @@ L$ [MODEL]
       <spinner follows="top|left" name="lod_triangle_limit" increment="10" left_pad="5" height="20" width="100" decimal_digits="0" enabled="true"/>
       <spinner left_delta="0" bottom_delta="0" increment="0.01"  follows="top|left" name="lod_error_threshold" min_val="0" max_val="100" height="20" width="100" decimal_digits="3" visible="false" enabled="true"/>
 
-      <text follows="top|left" name="build_operator_text" left="45" top_pad="10" width="100" height="15">
+      <text follows="top|left" name="build_operator_text" left="45" top_pad="10" width="100" height="15" text_readonly_color="LabelDisabledColor">
         Build Operator:  
       </text>
-      <text follows="top|left" name="queue_mode_text" left_pad="5" width="100" height="15">
+      <text follows="top|left" name="queue_mode_text" left_pad="5" width="100" height="15" text_readonly_color="LabelDisabledColor">
         Queue Mode:
       </text>
       <combo_box follows="top|left" name="build_operator" top_pad="5" left="45" width="100" height="20">
@@ -263,11 +288,11 @@ L$ [MODEL]
         </combo_item>
       </combo_box>
 
-      <text top_pad="10" name="border_mode_text" left="45" follows="left|top" width="100" height="15">
+      <text top_pad="10" name="border_mode_text" left="45" follows="left|top" width="100" height="15" text_readonly_color="LabelDisabledColor">
         Border Mode:
       </text>
 
-      <text left_pad="5" name="share_tolderance_text"  follows="left|top" width="100" height="15">
+      <text left_pad="5" name="share_tolderance_text"  follows="left|top" width="100" height="15" text_readonly_color="LabelDisabledColor">
         Share Tolerance:
       </text>
 
@@ -280,14 +305,28 @@ L$ [MODEL]
         </combo_item>
       </combo_box>
       <spinner follows="left|top" name="share_tolerance" left_pad="5" width="100" decimal_digits="5" initial_value="0.00001" height="20"/>
-             
-      <text left="10" top_pad="35" follows="top|left" width="240" height="15">
+      </panel>
+
+      <!-- LOD GENERATE NORMALS-->
+      <panel
+        follows="top|left"
+        name="generate normals"
+        left="0"
+        top_pad="0"
+        width="300"
+        height="46"
+        visible="true"
+        border="true"
+        bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
+
+      <text left="10" top_pad="5" follows="top|left" width="240" height="15">
         Generate Normals
       </text>
       <text left="35" top_pad="5" follows="top|left" width="100" height="15" name="crease_label">
         Crease Angle:
       </text>
       <spinner follows="top|left" left_pad="5" min_val="0" max_val="180" value="75" width="60" height="20" name="crease_angle"/>  
+      </panel>
     </panel>
 
     <!--  PANEL -->
@@ -314,8 +353,8 @@ L$ [MODEL]
           <radio_item bottom="23" name="physics_use_lod" label="Use Level of Detail:"/>
         </radio_group>
 
-        <combo_box left="180" top="10" follows="left|top" height="18"
-	        name="physics_lod_combo" width="110" tool_tip="LOD to use for physics shape">
+        <combo_box left="150" top="10" follows="left|top" height="18"
+	        name="physics_lod_combo" width="130" tool_tip="LOD to use for physics shape">
           <combo_item name="physics_lowest">
             Lowest
           </combo_item>
@@ -448,7 +487,7 @@ L$ [MODEL]
 
       <spinner left="10" height="20" follows="top|left" width="80" top_pad="5" value="1.0" min_val="0.01" max_val="64.0" name="import_scale"/>
 
-      <text left_pad="20" height="15" name="import_dimensions" follows="top|left">
+      <text left_pad="20" height="15" width="140" name="import_dimensions" follows="top|left">
         [X] x [Y] x [Z] m
       </text>
 
-- 
cgit v1.2.3


From f45eb335df21bfacba3de679751627f219760283 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 20 Jul 2011 17:12:49 -0500
Subject: SH-715 Fix for bad "cancel" behavior in physics tab.

---
 indra/newview/llfloatermodelpreview.cpp | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 203be5bb1f..e045cf6729 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -1032,6 +1032,11 @@ void LLFloaterModelPreview::onPhysicsStageCancel(LLUICtrl* ctrl, void*data)
 		}
 
 		sInstance->mCurRequest.clear();
+
+		if (sInstance->mModelPreview)
+		{
+			sInstance->mModelPreview->updateStatusMessages();
+		}
 	}
 }
 
@@ -4296,7 +4301,7 @@ void LLModelPreview::updateStatusMessages()
 
 		//fmp->childSetEnabled("physics_optimize", !use_hull);
 
-		bool enable = phys_tris > 0 || phys_hulls > 0;
+		bool enable = (phys_tris > 0 || phys_hulls > 0) && fmp->mCurRequest.empty();
 		//enable = enable && !use_hull && fmp->childGetValue("physics_optimize").asBoolean();
 
 		//enable/disable "analysis" UI
@@ -4308,7 +4313,7 @@ void LLModelPreview::updateStatusMessages()
 			child = panel->findNextSibling(child);
 		}
 
-		enable = phys_hulls > 0;
+		enable = phys_hulls > 0 && fmp->mCurRequest.empty();
 		//enable/disable "simplification" UI
 		panel = fmp->getChild<LLPanel>("physics simplification");
 		child = panel->getFirstChild();
@@ -4335,6 +4340,11 @@ void LLModelPreview::updateStatusMessages()
 				fmp->childEnable("Decompose");
 			}
 		}
+		else
+		{
+			fmp->childEnable("simplify_cancel");
+			fmp->childEnable("decompose_cancel");
+		}
 	}
 
 	const char* lod_controls[] =
-- 
cgit v1.2.3


From aa40614cd4cf05d3d8e78be2e05a0f5cdcfde5cc Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Thu, 21 Jul 2011 20:31:00 +0300
Subject: SH-2101 FIXED Remove checkbox for per-region mesh disablement

- Remove checkbox for per-region mesh disablement and corresponding code
---
 indra/newview/llfloaterregioninfo.cpp              | 52 +---------------------
 indra/newview/llfloaterregioninfo.h                |  4 --
 .../skins/default/xui/en/panel_region_general.xml  | 12 +----
 3 files changed, 3 insertions(+), 65 deletions(-)

diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index 538c5e3b88..f948fbac5f 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -172,30 +172,9 @@ bool estate_dispatch_initialized = false;
 LLUUID LLFloaterRegionInfo::sRequestInvoice;
 
 
-void LLFloaterRegionInfo::onConsoleReplyReceived(const std::string& output)
-{
-	llwarns << "here is what they're giving us:  " << output << llendl;
-
-	if (output.find("FALSE") != std::string::npos)
-	{
-		getChild<LLUICtrl>("mesh_rez_enabled_check")->setValue(FALSE);
-	}
-	else
-	{
-		getChild<LLUICtrl>("mesh_rez_enabled_check")->setValue(TRUE);
-	}
-}
-
-
 LLFloaterRegionInfo::LLFloaterRegionInfo(const LLSD& seed)
 	: LLFloater(seed)
-{
-	mConsoleReplySignalConnection = LLFloaterRegionDebugConsole::setConsoleReplyCallback(
-	boost::bind(
-		&LLFloaterRegionInfo::onConsoleReplyReceived,
-		this,
-		_1));
-}
+{}
 
 BOOL LLFloaterRegionInfo::postBuild()
 {
@@ -246,9 +225,7 @@ BOOL LLFloaterRegionInfo::postBuild()
 }
 
 LLFloaterRegionInfo::~LLFloaterRegionInfo()
-{
-	mConsoleReplySignalConnection.disconnect();
-}
+{}
 
 void LLFloaterRegionInfo::onOpen(const LLSD& key)
 {
@@ -637,9 +614,6 @@ bool LLPanelRegionGeneralInfo::refreshFromRegion(LLViewerRegion* region)
 	getChildView("im_btn")->setEnabled(allow_modify);
 	getChildView("manage_telehub_btn")->setEnabled(allow_modify);
 
-	const bool enable_mesh = gMeshRepo.meshRezEnabled();
-	getChildView("mesh_rez_enabled_check")->setVisible(enable_mesh);
-	getChildView("mesh_rez_enabled_check")->setEnabled(getChildView("mesh_rez_enabled_check")->getEnabled() && enable_mesh);
 	// Data gets filled in by processRegionInfo
 
 	return LLPanelRegionInfo::refreshFromRegion(region);
@@ -658,7 +632,6 @@ BOOL LLPanelRegionGeneralInfo::postBuild()
 	initCtrl("access_combo");
 	initCtrl("restrict_pushobject");
 	initCtrl("block_parcel_search_check");
-	initCtrl("mesh_rez_enabled_check");
 
 	childSetAction("kick_btn", boost::bind(&LLPanelRegionGeneralInfo::onClickKick, this));
 	childSetAction("kick_all_btn", onClickKickAll, this);
@@ -874,27 +847,6 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate()
 		sendEstateOwnerMessage(gMessageSystem, "setregioninfo", invoice, strings);
 	}
 
-	std::string sim_console_url = gAgent.getRegion()->getCapability("SimConsoleAsync");
-
-	if (!sim_console_url.empty())
-	{
-		std::string update_str = "set mesh_rez_enabled ";
-		if (getChild<LLUICtrl>("mesh_rez_enabled_check")->getValue().asBoolean())
-		{
-			update_str += "true";
-		}
-		else
-		{
-			update_str += "false";
-		}
-
-		LLHTTPClient::post(
-			sim_console_url,
-			LLSD(update_str),
-			new ConsoleUpdateResponder);
-	}
-
-
 	// if we changed access levels, tell user about it
 	LLViewerRegion* region = gAgent.getRegion();
 	if (region && (getChild<LLUICtrl>("access_combo")->getValue().asInteger() != region->getSimAccess()) )
diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h
index c1fef57ac9..c402de66e8 100644
--- a/indra/newview/llfloaterregioninfo.h
+++ b/indra/newview/llfloaterregioninfo.h
@@ -100,10 +100,6 @@ private:
 	
 	LLFloaterRegionInfo(const LLSD& seed);
 	~LLFloaterRegionInfo();
-
-	void onConsoleReplyReceived(const std::string& output);
-
-	boost::signals2::connection mConsoleReplySignalConnection;;
 	
 protected:
 	void onTabSelected(const LLSD& param);
diff --git a/indra/newview/skins/default/xui/en/panel_region_general.xml b/indra/newview/skins/default/xui/en/panel_region_general.xml
index 3f9195d092..44c84e69a1 100644
--- a/indra/newview/skins/default/xui/en/panel_region_general.xml
+++ b/indra/newview/skins/default/xui/en/panel_region_general.xml
@@ -133,17 +133,7 @@
      tool_tip="Let people see this region and its parcels in search results"
      top="190"
      width="80" />
-	<check_box
-     visible="FALSE"
-     height="20"
-     label="Allow Mesh Objects"
-     layout="topleft"
-     left="10"
-     name="mesh_rez_enabled_check"
-     tool_tip="Let people rez mesh objects on this region"
-     top="210"
-     width="80" />
-    <spinner
+	<spinner
      decimal_digits="0"
      follows="left|top"
      height="20"
-- 
cgit v1.2.3


From 50b9c63382121df879680cf43f5be6fc09686607 Mon Sep 17 00:00:00 2001
From: seth_productengine <none@none>
Date: Fri, 22 Jul 2011 22:40:18 +0300
Subject: SH-1868 WIP Added user-supplied metric data for uploading a model.

The mesh category string selected by user within the model data and sent to the server during calculating the upload fee and upload requests.

The accounting info and the upload permissions warning in the bottom left corner of the floater are temporarily made mutually exclusive.
---
 indra/llprimitive/llmodel.h                            |  3 +++
 indra/newview/llfloatermodelpreview.cpp                |  6 ++++++
 indra/newview/llmeshrepository.cpp                     |  8 ++++++++
 .../skins/default/xui/en/floater_model_preview.xml     | 18 +++++++++++++++++-
 4 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h
index 3f58eba07d..35fdf3f3d6 100644
--- a/indra/llprimitive/llmodel.h
+++ b/indra/llprimitive/llmodel.h
@@ -148,6 +148,7 @@ public:
 	static LLModel* loadModelFromDomMesh(domMesh* mesh);
 	static std::string getElementLabel(daeElement* element);
 	std::string getName() const;
+	std::string getMetric() const {return mMetric;}
 	EModelStatus getStatus() const {return mStatus;}
 	static std::string getStatusString(U32 status) ;
 
@@ -234,6 +235,8 @@ public:
 	std::string mRequestedLabel; // name requested in UI, if any.
 	std::string mLabel; // name computed from dae.
 
+	std::string mMetric; // user-supplied metric data for upload
+
 	LLVector3 mNormalizedScale;
 	LLVector3 mNormalizedTranslation;
 
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index e045cf6729..6c01f0c09a 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -3098,6 +3098,7 @@ void LLModelPreview::rebuildUploadData()
 
 	std::string requested_name = mFMP->getChild<LLUICtrl>("description_form")->getValue().asString();
 
+	std::string metric = mFMP->getChild<LLUICtrl>("model_category_combo")->getValue().asString();
 
 	LLSpinCtrl* scale_spinner = mFMP->getChild<LLSpinCtrl>("import_scale");
 
@@ -3159,6 +3160,7 @@ void LLModelPreview::rebuildUploadData()
 			if (base_model)
 			{
 				base_model->mRequestedLabel = requested_name;
+				base_model->mMetric = metric;
 			}
 
 			S32 idx = 0;
@@ -5593,6 +5595,10 @@ void LLFloaterModelPreview::onPermissionsReceived(const LLSD& result)
 	mUploadBtn->setEnabled(mHasUploadPerm && !mUploadModelUrl.empty());
 	getChild<LLTextBox>("warning_title")->setVisible(!mHasUploadPerm);
 	getChild<LLTextBox>("warning_message")->setVisible(!mHasUploadPerm);
+
+	// Hide the accounting info if upload is not permitted.
+	getChild<LLTextBox>("weights_text")->setVisible(mHasUploadPerm);
+	getChild<LLTextBox>("weights")->setVisible(mHasUploadPerm);
 }
 
 void LLFloaterModelPreview::setPermissonsErrorStatus(U32 status, const std::string& reason)
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 7ddc0db20d..b887842652 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -1321,6 +1321,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
 
 	std::map<LLModel*,S32> mesh_index;
 	std::string model_name;
+	std::string model_metric;
 
 	S32 instance_num = 0;
 	
@@ -1342,6 +1343,11 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
 				model_name = data.mBaseModel->getName();
 			}
 
+			if (model_metric.empty())
+			{
+				model_metric = data.mBaseModel->getMetric();
+			}
+
 			std::stringstream ostr;
 			
 			LLModel::Decomposition& decomp =
@@ -1455,6 +1461,8 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
 
 	if (model_name.empty()) model_name = "mesh model";
 	result["name"] = model_name;
+	if (model_metric.empty()) model_metric = "MUT_Other";
+	result["metric"] = model_metric;
 	result["asset_resources"] = res;
 	dump_llsd_to_file(result,make_dump_name("whole_model_",dump_num));
 
diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index 0b7b4c684c..bfa245cbc1 100644
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -32,6 +32,22 @@
   </text>
   <line_editor bottom_delta="20" follows="top|left|right" height="19" max_length_bytes="64" 
 	     name="description_form" prevalidate_callback="ascii" width="290" />
+
+  <text bottom_delta="20" left="15" follows="left|top" height="15" name="model_category_label" text_color="White">
+    What does this model represent?
+  </text>
+  <combo_box top_pad="1" follows="left|top" height="23"
+	     name="model_category_combo"  width="200">
+    <combo_box.drop_down_button
+      label_color="White"/>
+    <combo_item name="Avatar shape" label="Avatar shape" value="MUT_AvatarShape"/>
+    <combo_item name="Avatar attachment" label="Avatar attachment" value="MUT_AvatarAttachment"/>
+    <combo_item name="Building Component" label="Building Component" value="MUT_BuildingComponent"/>
+    <combo_item name="Moving object (vehicle, animal)" label="Moving object (vehicle, animal)" value="MUT_MovingObject"/>
+    <combo_item name="Large, non moving etc" label="Large, non moving etc" value="MUT_LargeStationary"/>
+    <combo_item name="Smaller, non-moving etc" label="Smaller, non-moving etc" value="MUT_SmallStationary"/>
+    <combo_item name="Not really any of these" label="Not really any of these" value="MUT_Other"/>
+  </combo_box>
   
   <text bottom_delta="20" left="15" follows="left|top" height="15" name="lod_label">
     Preview:
@@ -96,7 +112,7 @@
 
   <text
 	height="65"
-	top_delta="45"
+	top_delta="0"
 	left_delta="0"
 	name="weights_text"
 	width="80"
-- 
cgit v1.2.3


From 4a04458ff560b139c9adf50092a531eb0729652b Mon Sep 17 00:00:00 2001
From: prep <prep@lindenlab.com>
Date: Mon, 25 Jul 2011 10:45:05 -0400
Subject: Partial fix for sh-1925.

---
 indra/newview/llfloatermodelpreview.cpp | 53 ++++++++++++++++++++++++---------
 indra/newview/llfloatermodelpreview.h   |  2 +-
 2 files changed, 40 insertions(+), 15 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index e045cf6729..5ea8dd07ff 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -1543,8 +1543,7 @@ bool LLModelLoader::doLoadModel()
 							
 							LLMatrix4 trans = normalized_transformation;
 							trans *= skin_info.mBindShapeMatrix;
-							skin_info.mBindShapeMatrix = trans;
-							
+							skin_info.mBindShapeMatrix = trans;							
 						}
 										
 											
@@ -1747,15 +1746,15 @@ bool LLModelLoader::doLoadModel()
 												}
 											}
 											
-											model->mSkinInfo.mInvBindMatrix.push_back(mat);
+											model->mSkinInfo.mInvBindMatrix.push_back(mat);											
 										}
 									}
 								}
 							}
 						}
 						
-						//Now that we've parsed the joint array, let's determine if we have a full rig
-						//(which means we have all the joints that are required for an avatar versus
+						//Now that we've parsed the jointa werray, let's determine if we have a full rig
+						//(which means we have all the joint sthat are required for an avatar versus
 						//a skinned asset attached to a node in a file that contains an entire skeleton,
 						//but does not use the skeleton).						
 						buildJointToNodeMappingFromScene( root );
@@ -2159,15 +2158,29 @@ void LLModelLoader::processJointToNodeMapping( domNode* pNode )
 			mJointsFromNode.push_front( pNode->getName() );
 		}
 		//2. Handle the kiddo's
-		daeTArray< daeSmartRef<daeElement> > childOfChild = pNode->getChildren();
-		S32 childOfChildCount = childOfChild.getCount();
-		for (S32 i = 0; i < childOfChildCount; ++i)
+		processChildJoints( pNode );
+	}
+	else
+	{
+		//Determine if the're any children wrt to this failed node.
+		//This occurs when an armature is exported and ends up being what essentially amounts to
+		//as the root for the visual_scene
+		processChildJoints( pNode );
+	}
+}
+//-----------------------------------------------------------------------------
+// processChildJoint()
+//-----------------------------------------------------------------------------
+void LLModelLoader::processChildJoints( domNode* pParentNode )
+{	
+	daeTArray< daeSmartRef<daeElement> > childOfChild = pParentNode->getChildren();
+	S32 childOfChildCount = childOfChild.getCount();
+	for (S32 i = 0; i < childOfChildCount; ++i)
+	{
+		domNode* pChildNode = daeSafeCast<domNode>( childOfChild[i] );
+		if ( pChildNode )
 		{
-			domNode* pChildNode = daeSafeCast<domNode>( childOfChild[i] );
-			if ( pChildNode )
-			{
-				processJointToNodeMapping( pChildNode );
-			}
+			processJointToNodeMapping( pChildNode );
 		}
 	}
 }
@@ -2353,8 +2366,20 @@ void LLModelLoader::loadTextures()
 //-----------------------------------------------------------------------------
 bool LLModelLoader::isNodeAJoint( domNode* pNode )
 {
-	if ( !pNode || pNode->getName() == NULL)
+	if ( !pNode )
 	{
+		llinfos<<"Created node is NULL"<<llendl;
+		return false;
+	}
+	
+	if ( pNode->getName() == NULL )
+	{
+		llinfos<<"Parsed node has no name "<<llendl;
+		//Attempt to write the node id, if possible (aids in debugging the visual scene)
+		if ( pNode->getId() )
+		{
+			llinfos<<"Parsed node ID: "<<pNode->getId()<<llendl;
+		}
 		return false;
 	}
 
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index c24e171024..f383b3fe98 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -125,7 +125,7 @@ public:
 
 	void buildJointToNodeMappingFromScene( daeElement* pRoot );
 	void processJointToNodeMapping( domNode* pNode );
-
+	void processChildJoints( domNode* pParentNode );
 
 	//map of avatar joints as named in COLLADA assets to internal joint names
 	std::map<std::string, std::string> mJointMap;
-- 
cgit v1.2.3


From ce0a1f39aa7f05421025fa5e77422169d2603573 Mon Sep 17 00:00:00 2001
From: seth_productengine <none@none>
Date: Mon, 25 Jul 2011 17:58:35 +0300
Subject: SH-1941 FIXED Mesh upload menu enabled when avatar is in the region
 that does not allow building but supports mesh upload.

---
 indra/newview/llmeshrepository.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index b887842652..4b2fafccd4 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -3502,8 +3502,7 @@ void LLMeshRepository::buildPhysicsMesh(LLModel::Decomposition& decomp)
 bool LLMeshRepository::meshUploadEnabled()
 {
 	LLViewerRegion *region = gAgent.getRegion();
-	if(gSavedSettings.getBOOL("MeshEnabled") && 
-	   LLViewerParcelMgr::getInstance()->allowAgentBuild() &&
+	if(gSavedSettings.getBOOL("MeshEnabled") &&
 	   region)
 	{
 		return region->meshUploadEnabled();
-- 
cgit v1.2.3


From 9395bcee52a9786185d90c52a22564b1d975e4ea Mon Sep 17 00:00:00 2001
From: prep <prep@lindenlab.com>
Date: Mon, 25 Jul 2011 17:42:22 -0400
Subject: Fix for sh-2162

---
 indra/newview/llfloatermodelpreview.cpp | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 5ea8dd07ff..62b8d03281 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -4967,18 +4967,22 @@ BOOL LLModelPreview::render()
 
 					if (textures)
 					{
-						const std::string& binding = instance.mModel->mMaterialList[i];
-						const LLImportMaterial& material = instance.mMaterial[binding];
+						int materialCnt = instance.mModel->mMaterialList.size();
+						if ( i < materialCnt )
+						{
+							const std::string& binding = instance.mModel->mMaterialList[i];						
+							const LLImportMaterial& material = instance.mMaterial[binding];
 
-						llassert(binding == model->mMaterialList[i]);
+							llassert(binding == model->mMaterialList[i]);
 						
-						glColor4fv(material.mDiffuseColor.mV);
-						if (material.mDiffuseMap.notNull())
-						{
-							if (material.mDiffuseMap->getDiscardLevel() > -1)
+							glColor4fv(material.mDiffuseColor.mV);
+							if (material.mDiffuseMap.notNull())
 							{
-								gGL.getTexUnit(0)->bind(material.mDiffuseMap, true);
-								mTextureSet.insert(material.mDiffuseMap.get());
+								if (material.mDiffuseMap->getDiscardLevel() > -1)
+								{
+									gGL.getTexUnit(0)->bind(material.mDiffuseMap, true);
+									mTextureSet.insert(material.mDiffuseMap.get());
+								}
 							}
 						}
 					}
-- 
cgit v1.2.3


From b27e860c1e7d3c8ec1b3f7f540a22175b160cea1 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 25 Jul 2011 21:09:40 -0500
Subject: SH-1856 Fix for shininess not working on rigged meshes when hardware
 skinning is disabled.

---
 indra/newview/llviewershadermgr.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index e473901609..5579473b8b 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -166,6 +166,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
 	mShaderList.push_back(&gWLCloudProgram);
 	mShaderList.push_back(&gAvatarProgram);
 	mShaderList.push_back(&gObjectShinyProgram);
+	mShaderList.push_back(&gObjectShinyNonIndexedProgram);
 	mShaderList.push_back(&gWaterProgram);
 	mShaderList.push_back(&gAvatarEyeballProgram); 
 	mShaderList.push_back(&gObjectSimpleProgram);
@@ -190,6 +191,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
 	mShaderList.push_back(&gObjectFullbrightWaterProgram);
 	mShaderList.push_back(&gAvatarWaterProgram);
 	mShaderList.push_back(&gObjectShinyWaterProgram);
+	mShaderList.push_back(&gObjectShinyNonIndexedWaterProgram);
 	mShaderList.push_back(&gUnderWaterProgram);
 	mShaderList.push_back(&gDeferredSunProgram);
 	mShaderList.push_back(&gDeferredBlurLightProgram);
-- 
cgit v1.2.3


From f79a058f3ce50361b732061ab30f4a1923fba445 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 25 Jul 2011 21:23:01 -0500
Subject: SH-1874 Make UI reflect that a mesh cannot be made flexible.

---
 indra/newview/llpanelvolume.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp
index bb87601d20..12eea7844d 100644
--- a/indra/newview/llpanelvolume.cpp
+++ b/indra/newview/llpanelvolume.cpp
@@ -351,7 +351,7 @@ void LLPanelVolume::getState( )
 	getChild<LLUICtrl>("Flexible1D Checkbox Ctrl")->setValue(is_flexible);
 	if (is_flexible || (volobjp && volobjp->canBeFlexible()))
 	{
-		getChildView("Flexible1D Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp);
+		getChildView("Flexible1D Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp && !volobjp->isMesh());
 	}
 	else
 	{
-- 
cgit v1.2.3


From 715d9f20a7b64f5b9f52b4c363f32078f7f5e2fd Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 26 Jul 2011 18:01:31 -0500
Subject: SH-1086 Make physics shape display transparent and fix some
 z-fighting issues.

---
 indra/newview/llfloatermodelpreview.cpp | 255 +++++++++++++++++---------------
 1 file changed, 135 insertions(+), 120 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 62b8d03281..7844afb456 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -4891,6 +4891,8 @@ BOOL LLModelPreview::render()
 													  target_pos);											// point of interest
 
 
+	z_near = llclamp(z_far * 0.001f, 0.001f, 0.1f);
+
 	LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, width, height, FALSE, z_near, z_far);
 
 	stop_glerror();
@@ -5010,184 +5012,197 @@ BOOL LLModelPreview::render()
 			if (physics)
 			{
 				glClear(GL_DEPTH_BUFFER_BIT);
-				LLGLEnable blend(GL_BLEND);
-				gGL.blendFunc(LLRender::BF_ONE, LLRender::BF_ZERO);
-
-				for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter)
+				
+				for (U32 i = 0; i < 2; i++)
 				{
-					LLModelInstance& instance = *iter;
+					if (i == 0)
+					{ //depth only pass
+						gGL.setColorMask(false, false);
+					}
+					else
+					{
+						gGL.setColorMask(true, true);
+					}
 
-					LLModel* model = instance.mLOD[LLModel::LOD_PHYSICS];
+					//enable alpha blending on second pass but not first pass
+					LLGLState blend(GL_BLEND, i); 
+					
+					gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, LLRender::BF_ONE_MINUS_SOURCE_ALPHA);
 
-					if (!model)
+					for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter)
 					{
-						continue;
-					}
+						LLModelInstance& instance = *iter;
 
-					gGL.pushMatrix();
-					LLMatrix4 mat = instance.mTransform;
+						LLModel* model = instance.mLOD[LLModel::LOD_PHYSICS];
 
-					glMultMatrixf((GLfloat*) mat.mMatrix);
+						if (!model)
+						{
+							continue;
+						}
 
+						gGL.pushMatrix();
+						LLMatrix4 mat = instance.mTransform;
 
-					bool render_mesh = true;
+						glMultMatrixf((GLfloat*) mat.mMatrix);
 
-					LLPhysicsDecomp* decomp = gMeshRepo.mDecompThread;
-					if (decomp)
-					{
-						LLMutexLock(decomp->mMutex);
 
-						LLModel::Decomposition& physics = model->mPhysics;
+						bool render_mesh = true;
 
-						if (!physics.mHull.empty())
+						LLPhysicsDecomp* decomp = gMeshRepo.mDecompThread;
+						if (decomp)
 						{
-							render_mesh = false;
+							LLMutexLock(decomp->mMutex);
 
-							if (physics.mMesh.empty())
-							{ //build vertex buffer for physics mesh
-								gMeshRepo.buildPhysicsMesh(physics);
-							}
+							LLModel::Decomposition& physics = model->mPhysics;
+
+							if (!physics.mHull.empty())
+							{
+								render_mesh = false;
+
+								if (physics.mMesh.empty())
+								{ //build vertex buffer for physics mesh
+									gMeshRepo.buildPhysicsMesh(physics);
+								}
 						
-							if (!physics.mMesh.empty())
-							{ //render hull instead of mesh
-								for (U32 i = 0; i < physics.mMesh.size(); ++i)
-								{
-									if (explode > 0.f)
+								if (!physics.mMesh.empty())
+								{ //render hull instead of mesh
+									for (U32 i = 0; i < physics.mMesh.size(); ++i)
 									{
-										gGL.pushMatrix();
+										if (explode > 0.f)
+										{
+											gGL.pushMatrix();
 
-										LLVector3 offset = model->mHullCenter[i]-model->mCenterOfHullCenters;
-										offset *= explode;
+											LLVector3 offset = model->mHullCenter[i]-model->mCenterOfHullCenters;
+											offset *= explode;
 
-										gGL.translatef(offset.mV[0], offset.mV[1], offset.mV[2]);
-									}
+											gGL.translatef(offset.mV[0], offset.mV[1], offset.mV[2]);
+										}
 
-									static std::vector<LLColor4U> hull_colors;
+										static std::vector<LLColor4U> hull_colors;
 
-									if (i+1 >= hull_colors.size())
-									{
-										hull_colors.push_back(LLColor4U(rand()%128+127, rand()%128+127, rand()%128+127, 255));
-									}
+										if (i+1 >= hull_colors.size())
+										{
+											hull_colors.push_back(LLColor4U(rand()%128+127, rand()%128+127, rand()%128+127, 128));
+										}
 
 										glColor4ubv(hull_colors[i].mV);
-									LLVertexBuffer::drawArrays(LLRender::TRIANGLES, physics.mMesh[i].mPositions, physics.mMesh[i].mNormals);
+										LLVertexBuffer::drawArrays(LLRender::TRIANGLES, physics.mMesh[i].mPositions, physics.mMesh[i].mNormals);
 
-									if (explode > 0.f)
-									{
-										gGL.popMatrix();
+										if (explode > 0.f)
+										{
+											gGL.popMatrix();
+										}
 									}
 								}
 							}
 						}
-					}
 
-					if (render_mesh)
-					{
-						if (mVertexBuffer[LLModel::LOD_PHYSICS].empty())
-						{
-							genBuffers(LLModel::LOD_PHYSICS, false);
-						}
-						for (U32 i = 0; i < mVertexBuffer[LLModel::LOD_PHYSICS][model].size(); ++i)
+						if (render_mesh)
 						{
-							LLVertexBuffer* buffer = mVertexBuffer[LLModel::LOD_PHYSICS][model][i];
-
-							buffer->setBuffer(type_mask & buffer->getTypeMask());
+							if (mVertexBuffer[LLModel::LOD_PHYSICS].empty())
+							{
+								genBuffers(LLModel::LOD_PHYSICS, false);
+							}
+							for (U32 i = 0; i < mVertexBuffer[LLModel::LOD_PHYSICS][model].size(); ++i)
+							{
+								LLVertexBuffer* buffer = mVertexBuffer[LLModel::LOD_PHYSICS][model][i];
 
-							buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0);
-							gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
-							glColor4f(0.4f, 0.4f, 0.0f, 0.4f);
+								gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+								glColor4f(0.4f, 0.4f, 0.0f, 0.4f);
 
-							buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0);
+								buffer->setBuffer(type_mask & buffer->getTypeMask());
+								buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0);
 
-							glColor3f(1.f, 1.f, 0.f);
+								glColor3f(1.f, 1.f, 0.f);
 
-							glLineWidth(2.f);
-							glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
-							buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0);
+								glLineWidth(2.f);
+								glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+								buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0);
 
-							glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
-							glLineWidth(1.f);
+								glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+								glLineWidth(1.f);
+							}
 						}
-					}
 
-					gGL.popMatrix();
-				}
-
-				glLineWidth(3.f);
-				glPointSize(8.f);
-				gPipeline.enableLightsFullbright(LLColor4::white);
-				//show degenerate triangles
-				LLGLDepthTest depth(GL_TRUE, GL_TRUE, GL_ALWAYS);
-				LLGLDisable cull(GL_CULL_FACE);
-				glColor4f(1.f,0.f,0.f,1.f);
-				const LLVector4a scale(0.5f);
-
-				for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter)
-				{
-					LLModelInstance& instance = *iter;
+						gGL.popMatrix();
+					}
 
-					LLModel* model = instance.mLOD[LLModel::LOD_PHYSICS];
+					glLineWidth(3.f);
+					glPointSize(8.f);
+					gPipeline.enableLightsFullbright(LLColor4::white);
+					//show degenerate triangles
+					LLGLDepthTest depth(GL_TRUE, GL_TRUE, GL_ALWAYS);
+					LLGLDisable cull(GL_CULL_FACE);
+					glColor4f(1.f,0.f,0.f,1.f);
+					const LLVector4a scale(0.5f);
 
-					if (!model)
+					for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter)
 					{
-						continue;
-					}
+						LLModelInstance& instance = *iter;
 
-					gGL.pushMatrix();
-					LLMatrix4 mat = instance.mTransform;
+						LLModel* model = instance.mLOD[LLModel::LOD_PHYSICS];
 
-					glMultMatrixf((GLfloat*) mat.mMatrix);
+						if (!model)
+						{
+							continue;
+						}
 
+						gGL.pushMatrix();
+						LLMatrix4 mat = instance.mTransform;
 
-					LLPhysicsDecomp* decomp = gMeshRepo.mDecompThread;
-					if (decomp)
-					{
-						LLMutexLock(decomp->mMutex);
+						glMultMatrixf((GLfloat*) mat.mMatrix);
 
-						LLModel::Decomposition& physics = model->mPhysics;
 
-						if (physics.mHull.empty())
+						LLPhysicsDecomp* decomp = gMeshRepo.mDecompThread;
+						if (decomp)
 						{
-							if (mVertexBuffer[LLModel::LOD_PHYSICS].empty())
+							LLMutexLock(decomp->mMutex);
+
+							LLModel::Decomposition& physics = model->mPhysics;
+
+							if (physics.mHull.empty())
 							{
-								genBuffers(LLModel::LOD_PHYSICS, false);
-							}
+								if (mVertexBuffer[LLModel::LOD_PHYSICS].empty())
+								{
+									genBuffers(LLModel::LOD_PHYSICS, false);
+								}
 							
-							for (U32 i = 0; i < mVertexBuffer[LLModel::LOD_PHYSICS][model].size(); ++i)
-							{
-								LLVertexBuffer* buffer = mVertexBuffer[LLModel::LOD_PHYSICS][model][i];
+								for (U32 i = 0; i < mVertexBuffer[LLModel::LOD_PHYSICS][model].size(); ++i)
+								{
+									LLVertexBuffer* buffer = mVertexBuffer[LLModel::LOD_PHYSICS][model][i];
 
-								buffer->setBuffer(type_mask & buffer->getTypeMask());
+									buffer->setBuffer(type_mask & buffer->getTypeMask());
 
-								LLStrider<LLVector3> pos_strider; 
-								buffer->getVertexStrider(pos_strider, 0);
-								LLVector4a* pos = (LLVector4a*) pos_strider.get();
+									LLStrider<LLVector3> pos_strider; 
+									buffer->getVertexStrider(pos_strider, 0);
+									LLVector4a* pos = (LLVector4a*) pos_strider.get();
 							
-								LLStrider<U16> idx;
-								buffer->getIndexStrider(idx, 0);
+									LLStrider<U16> idx;
+									buffer->getIndexStrider(idx, 0);
 
-								for (U32 i = 0; i < buffer->getNumIndices(); i += 3)
-								{
-									LLVector4a v1; v1.setMul(pos[*idx++], scale);
-									LLVector4a v2; v2.setMul(pos[*idx++], scale);
-									LLVector4a v3; v3.setMul(pos[*idx++], scale);
-
-									if (ll_is_degenerate(v1,v2,v3))
+									for (U32 i = 0; i < buffer->getNumIndices(); i += 3)
 									{
-										buffer->draw(LLRender::LINE_LOOP, 3, i);
-										buffer->draw(LLRender::POINTS, 3, i);
+										LLVector4a v1; v1.setMul(pos[*idx++], scale);
+										LLVector4a v2; v2.setMul(pos[*idx++], scale);
+										LLVector4a v3; v3.setMul(pos[*idx++], scale);
+
+										if (ll_is_degenerate(v1,v2,v3))
+										{
+											buffer->draw(LLRender::LINE_LOOP, 3, i);
+											buffer->draw(LLRender::POINTS, 3, i);
+										}
 									}
 								}
 							}
 						}
-					}
 
-					gGL.popMatrix();
+						gGL.popMatrix();
+					}
+					glLineWidth(1.f);
+					glPointSize(1.f);
+					gPipeline.enableLightsPreview();
+					gGL.setSceneBlendType(LLRender::BT_ALPHA);
 				}
-				glLineWidth(1.f);
-				glPointSize(1.f);
-				gPipeline.enableLightsPreview();
-				gGL.setSceneBlendType(LLRender::BT_ALPHA);
 			}
 		}
 		else
-- 
cgit v1.2.3


From ea3d58b3141a7277870b66262ee0afb9c23c3423 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Wed, 27 Jul 2011 21:20:04 +0300
Subject: SH-1868 FIXED Rearranged the accounting info to leave enough room for
 the upload permissions warning. Removed hiding the accounting info when
 warning is displayed.

---
 indra/newview/llfloatermodelpreview.cpp            | 21 +++++-------
 .../skins/default/xui/en/floater_model_preview.xml | 37 +++++++++++++++-------
 2 files changed, 34 insertions(+), 24 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 6c01f0c09a..e68a8cc84a 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -5482,10 +5482,10 @@ void LLFloaterModelPreview::toggleCalculateButton(bool visible)
 	if (visible)
 	{
 		std::string tbd = getString("tbd");
-		childSetTextArg("weights", "[EQ]", tbd);
-		childSetTextArg("weights", "[ST]", tbd);
-		childSetTextArg("weights", "[SIM]", tbd);
-		childSetTextArg("weights", "[PH]", tbd);
+		childSetTextArg("weights_right", "[EQ]", tbd);
+		childSetTextArg("weights_left", "[ST]", tbd);
+		childSetTextArg("weights_right", "[SIM]", tbd);
+		childSetTextArg("weights_left", "[PH]", tbd);
 		childSetTextArg("upload_fee", "[FEE]", tbd);
 		childSetTextArg("price_breakdown", "[STREAMING]", tbd);
 		childSetTextArg("price_breakdown", "[PHYSICS]", tbd);
@@ -5508,17 +5508,16 @@ void LLFloaterModelPreview::handleModelPhysicsFeeReceived()
 	const LLSD& result = mModelPhysicsFee;
 	mUploadModelUrl = result["url"].asString();
 
-	childSetTextArg("weights", "[EQ]", llformat("%0.3f", result["resource_cost"].asReal()));
-	childSetTextArg("weights", "[ST]", llformat("%0.3f", result["model_streaming_cost"].asReal()));
-	childSetTextArg("weights", "[SIM]", llformat("%0.3f", result["simulation_cost"].asReal()));
-	childSetTextArg("weights", "[PH]", llformat("%0.3f", result["physics_cost"].asReal()));
+	childSetTextArg("weights_right", "[EQ]", llformat("%0.3f", result["resource_cost"].asReal()));
+	childSetTextArg("weights_left", "[ST]", llformat("%0.3f", result["model_streaming_cost"].asReal()));
+	childSetTextArg("weights_right", "[SIM]", llformat("%0.3f", result["simulation_cost"].asReal()));
+	childSetTextArg("weights_left", "[PH]", llformat("%0.3f", result["physics_cost"].asReal()));
 	childSetTextArg("upload_fee", "[FEE]", llformat("%d", result["upload_price"].asInteger()));
 	childSetTextArg("price_breakdown", "[STREAMING]", llformat("%d", result["upload_price_breakdown"]["mesh_streaming"].asInteger()));
 	childSetTextArg("price_breakdown", "[PHYSICS]", llformat("%d", result["upload_price_breakdown"]["mesh_physics"].asInteger()));
 	childSetTextArg("price_breakdown", "[INSTANCES]", llformat("%d", result["upload_price_breakdown"]["mesh_instance"].asInteger()));
 	childSetTextArg("price_breakdown", "[TEXTURES]", llformat("%d", result["upload_price_breakdown"]["texture"].asInteger()));
 	childSetTextArg("price_breakdown", "[MODEL]", llformat("%d", result["upload_price_breakdown"]["model"].asInteger()));
-	childSetVisible("weights", true);
 	childSetVisible("upload_fee", true);
 	childSetVisible("price_breakdown", true);
 	mUploadBtn->setEnabled(mHasUploadPerm && !mUploadModelUrl.empty());
@@ -5595,10 +5594,6 @@ void LLFloaterModelPreview::onPermissionsReceived(const LLSD& result)
 	mUploadBtn->setEnabled(mHasUploadPerm && !mUploadModelUrl.empty());
 	getChild<LLTextBox>("warning_title")->setVisible(!mHasUploadPerm);
 	getChild<LLTextBox>("warning_message")->setVisible(!mHasUploadPerm);
-
-	// Hide the accounting info if upload is not permitted.
-	getChild<LLTextBox>("weights_text")->setVisible(mHasUploadPerm);
-	getChild<LLTextBox>("weights")->setVisible(mHasUploadPerm);
 }
 
 void LLFloaterModelPreview::setPermissonsErrorStatus(U32 status, const std::string& reason)
diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index bfa245cbc1..c52f48cfaf 100644
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -111,32 +111,47 @@
      You will not be able to complete the final upload of this model to the Second Life servers. [[VURL] Find out how] to get enabled for mesh model uploads.</text>
 
   <text
-	height="65"
-	top_delta="0"
+	height="26"
+	top_pad="5"
 	left_delta="0"
-	name="weights_text"
+	name="weights_text_left"
 	width="80"
 	word_wrap="true" 
 	>
 Download:
 Physics:
-Server:
-
-Prim equivs:
   </text>
-
   <text
-	height="65"
+	height="26"
 	top_delta="0"
-	left_delta="80"
-	name="weights"
+	left_pad="0"
+	name="weights_left"
 	width="70"
 	word_wrap="true" 
 	>
 [ST]
 [PH]
+  </text>
+  <text
+	height="26"
+	top_delta="0"
+	left_pad="0"
+	name="weights_text_right"
+	width="80"
+	word_wrap="true" 
+	>
+Server:
+Prim equivs:
+  </text>
+  <text
+	height="26"
+	top_delta="0"
+	left_pad="0"
+	name="weights_right"
+	width="70"
+	word_wrap="true" 
+	>
 [SIM]
-
 [EQ]
   </text>
 
-- 
cgit v1.2.3


From 6c7653c65bd3f9907bcd4a8a54e4e5c1d172d15e Mon Sep 17 00:00:00 2001
From: seth_productengine <none@none>
Date: Thu, 28 Jul 2011 18:41:43 +0300
Subject: SH-2169 FIXED New object weights floater added.

---
 indra/newview/CMakeLists.txt                       |   2 +
 indra/newview/llfloaterobjectweights.cpp           |  99 +++++++
 indra/newview/llfloaterobjectweights.h             |  64 +++++
 indra/newview/llfloatertools.cpp                   |   3 +
 indra/newview/llviewerfloaterreg.cpp               |   4 +-
 .../default/xui/en/floater_object_weights.xml      | 310 +++++++++++++++++++++
 .../newview/skins/default/xui/en/floater_tools.xml |   2 +-
 7 files changed, 482 insertions(+), 2 deletions(-)
 create mode 100644 indra/newview/llfloaterobjectweights.cpp
 create mode 100644 indra/newview/llfloaterobjectweights.h
 create mode 100644 indra/newview/skins/default/xui/en/floater_object_weights.xml

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 6292ee97c8..f2a9ccacec 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -213,6 +213,7 @@ set(viewer_SOURCE_FILES
     llfloatermodelwizard.cpp
     llfloaternamedesc.cpp
     llfloaternotificationsconsole.cpp
+    llfloaterobjectweights.cpp
     llfloateropenobject.cpp
     llfloaterpay.cpp
     llfloaterperms.cpp
@@ -775,6 +776,7 @@ set(viewer_HEADER_FILES
     llfloatermodelwizard.h
     llfloaternamedesc.h
     llfloaternotificationsconsole.h
+    llfloaterobjectweights.h
     llfloateropenobject.h
     llfloaterpay.h
     llfloaterperms.h
diff --git a/indra/newview/llfloaterobjectweights.cpp b/indra/newview/llfloaterobjectweights.cpp
new file mode 100644
index 0000000000..93aa8dcf08
--- /dev/null
+++ b/indra/newview/llfloaterobjectweights.cpp
@@ -0,0 +1,99 @@
+/**
+ * @file llfloaterobjectweights.cpp
+ * @brief Object weights advanced view floater
+ *
+ * $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+#include "llviewerprecompiledheaders.h"
+
+#include "llfloaterobjectweights.h"
+
+#include "lltextbox.h"
+
+LLFloaterObjectWeights::LLFloaterObjectWeights(const LLSD& key)
+:	LLFloater(key),
+	mSelectedObjects(NULL),
+	mSelectedPrims(NULL),
+	mSelectedDownloadWeight(NULL),
+	mSelectedPhysicsWeight(NULL),
+	mSelectedServerWeight(NULL),
+	mSelectedDisplayWeight(NULL),
+	mSelectedOnLand(NULL),
+	mRezzedOnLand(NULL),
+	mRemainingCapacity(NULL),
+	mTotalCapacity(NULL)
+{
+}
+
+LLFloaterObjectWeights::~LLFloaterObjectWeights()
+{
+}
+
+// virtual
+BOOL LLFloaterObjectWeights::postBuild()
+{
+	mSelectedObjects = getChild<LLTextBox>("objects");
+	mSelectedPrims = getChild<LLTextBox>("prims");
+
+	mSelectedDownloadWeight = getChild<LLTextBox>("download");
+	mSelectedPhysicsWeight = getChild<LLTextBox>("physics");
+	mSelectedServerWeight = getChild<LLTextBox>("server");
+	mSelectedDisplayWeight = getChild<LLTextBox>("display");
+
+	mSelectedOnLand = getChild<LLTextBox>("used_download_weight");
+	mRezzedOnLand = getChild<LLTextBox>("used_download_weight");
+	mRemainingCapacity = getChild<LLTextBox>("used_download_weight");
+	mTotalCapacity = getChild<LLTextBox>("used_download_weight");
+
+	return TRUE;
+}
+
+// virtual
+void LLFloaterObjectWeights::onOpen(const LLSD& key)
+{
+	updateIfNothingSelected();
+}
+
+void LLFloaterObjectWeights::toggleLoadingIndicators(bool visible)
+{
+	childSetVisible("download_loading_indicator", visible);
+	childSetVisible("physics_loading_indicator", visible);
+	childSetVisible("server_loading_indicator", visible);
+	childSetVisible("display_loading_indicator", visible);
+}
+
+void LLFloaterObjectWeights::updateIfNothingSelected()
+{
+	const std::string text = getString("nothing_selected");
+
+	mSelectedObjects->setText(text);
+	mSelectedPrims->setText(text);
+
+	mSelectedDownloadWeight->setText(text);
+	mSelectedPhysicsWeight->setText(text);
+	mSelectedServerWeight->setText(text);
+	mSelectedDisplayWeight->setText(text);
+
+	mSelectedOnLand->setText(text);
+
+	toggleLoadingIndicators(false);
+}
diff --git a/indra/newview/llfloaterobjectweights.h b/indra/newview/llfloaterobjectweights.h
new file mode 100644
index 0000000000..10e35ad7a7
--- /dev/null
+++ b/indra/newview/llfloaterobjectweights.h
@@ -0,0 +1,64 @@
+/**
+ * @file llfloaterobjectweights.h
+ * @brief Object weights advanced view floater
+ *
+ * $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLFLOATEROBJECTWEIGHTS_H
+#define LL_LLFLOATEROBJECTWEIGHTS_H
+
+#include "llfloater.h"
+
+class LLTextBox;
+
+class LLFloaterObjectWeights : public LLFloater
+{
+public:
+	LOG_CLASS(LLFloaterObjectWeights);
+
+	LLFloaterObjectWeights(const LLSD& key);
+	~LLFloaterObjectWeights();
+
+	/*virtual*/ BOOL postBuild();
+
+	/*virtual*/ void onOpen(const LLSD& key);
+
+private:
+	void toggleLoadingIndicators(bool visible);
+	void updateIfNothingSelected();
+
+	LLTextBox		*mSelectedObjects;
+	LLTextBox		*mSelectedPrims;
+
+	LLTextBox		*mSelectedDownloadWeight;
+	LLTextBox		*mSelectedPhysicsWeight;
+	LLTextBox		*mSelectedServerWeight;
+	LLTextBox		*mSelectedDisplayWeight;
+
+	LLTextBox		*mSelectedOnLand;
+	LLTextBox		*mRezzedOnLand;
+	LLTextBox		*mRemainingCapacity;
+	LLTextBox		*mTotalCapacity;
+};
+
+#endif //LL_LLFLOATEROBJECTWEIGHTS_H
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index 84fb8bd9e7..9121e80a4e 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -826,6 +826,9 @@ void LLFloaterTools::onClose(bool app_quitting)
 
 	//gMenuBarView->setItemVisible("BuildTools", FALSE);
 	LLFloaterReg::hideInstance("media_settings");
+
+	// hide the advanced object weights floater
+	LLFloaterReg::hideInstance("object_weights");
 }
 
 void click_popup_info(void*)
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index 26f05337a4..b0a547cbf1 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -79,6 +79,7 @@
 #include "llfloatermodelwizard.h"
 #include "llfloaternamedesc.h"
 #include "llfloaternotificationsconsole.h"
+#include "llfloaterobjectweights.h"
 #include "llfloateropenobject.h"
 #include "llfloaterpay.h"
 #include "llfloaterperms.h"
@@ -226,6 +227,7 @@ void LLViewerFloaterReg::registerFloaters()
 	LLFloaterReg::add("notifications_console", "floater_notifications_console.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotificationConsole>);
 	LLFloaterReg::add("notification_well_window", "floater_sys_well.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLNotificationWellWindow>);
 
+	LLFloaterReg::add("object_weights", "floater_object_weights.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterObjectWeights>);
 	LLFloaterReg::add("openobject", "floater_openobject.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterOpenObject>);
 	LLFloaterReg::add("outgoing_call", "floater_outgoing_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLOutgoingCallDialog>);
 	LLFloaterPayUtil::registerFloater();
@@ -286,7 +288,7 @@ void LLViewerFloaterReg::registerFloaters()
 	LLFloaterReg::add("voice_controls", "floater_voice_controls.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLCallFloater>);
 	LLFloaterReg::add("voice_effect", "floater_voice_effect.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterVoiceEffect>);
 
-	LLFloaterReg::add("web_content", "floater_web_content.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWebContent>);	
+	LLFloaterReg::add("web_content", "floater_web_content.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWebContent>);
 	LLFloaterReg::add("whitelist_entry", "floater_whitelist_entry.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWhiteListEntry>);	
 	LLFloaterWindowSizeUtil::registerFloater();
 	LLFloaterReg::add("world_map", "floater_world_map.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWorldMap>);	
diff --git a/indra/newview/skins/default/xui/en/floater_object_weights.xml b/indra/newview/skins/default/xui/en/floater_object_weights.xml
new file mode 100644
index 0000000000..f377386679
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_object_weights.xml
@@ -0,0 +1,310 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+ can_close="true"
+ can_tear_off="false"
+ height="315"
+ help_topic="objects_weight_floater"
+ layout="topleft"
+ name="object_weights"
+ save_rect="true"
+ single_instance="true"
+ title="ADVANCED"
+ width="200">
+    <floater.string
+     name="nothing_selected"
+     value="--"/>
+
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="selected_text"
+     text_color="EmphasisColor"
+     top="10"
+     value="SELECTED"
+     width="180" />
+    <text
+     follows="left|top"
+     halign="right"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="objects"
+     top_pad="3"
+     value="--"
+     width="40" />
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left_pad="10"
+     name="objects_label"
+     top_delta="0"
+     value="Objects"
+     width="130" />
+    <text
+     follows="left|top"
+     halign="right"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="prims"
+     top_pad="3"
+     value="--"
+     width="40" />
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left_pad="10"
+     name="prims_label"
+     top_delta="0"
+     value="Prims"
+     width="130" />
+    <view_border
+     bevel_style="none"
+     follows="top|left"
+     height="0"
+     layout="topleft"
+     left="10"
+     name="selected_text_border"
+     top_pad="5"
+     width="180"/>
+
+
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="weights_of_selected_text"
+     text_color="EmphasisColor"
+     top_pad="10"
+     value="WEIGHTS OF SELECTED"
+     width="180" />
+    <text
+     follows="left|top"
+     halign="right"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="download"
+     top_pad="3"
+     value="--"
+     width="40" />
+    <loading_indicator
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="34"
+     name="download_loading_indicator"
+     top_delta="0"
+     width="16" />
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left_pad="10"
+     name="download_label"
+     top_delta="0"
+     value="Download"
+     width="130" />
+    <text
+     follows="left|top"
+     halign="right"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="physics"
+     top_pad="3"
+     value="--"
+     width="40" />
+    <loading_indicator
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="34"
+     name="physics_loading_indicator"
+     top_delta="0"
+     width="16" />
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left_pad="10"
+     name="physics_label"
+     top_delta="0"
+     value="Physics"
+     width="130" />
+    <text
+     follows="left|top"
+     halign="right"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="server"
+     top_pad="3"
+     value="--"
+     width="40" />
+    <loading_indicator
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="34"
+     name="server_loading_indicator"
+     top_delta="0"
+     width="16" />
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left_pad="10"
+     name="server_label"
+     top_delta="0"
+     value="Server"
+     width="130" />
+    <text
+     follows="left|top"
+     halign="right"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="display"
+     top_pad="3"
+     value="--"
+     width="40" />
+    <loading_indicator
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="34"
+     name="display_loading_indicator"
+     top_delta="0"
+     width="16" />
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left_pad="10"
+     name="display_label"
+     top_delta="0"
+     value="Display"
+     width="130" />
+    <view_border
+     bevel_style="none"
+     follows="top|left"
+     height="0"
+     layout="topleft"
+     left="10"
+     name="weights_text_border"
+     top_pad="5"
+     width="180"/>
+
+
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="land_impacts_text"
+     text_color="EmphasisColor"
+     top_pad="10"
+     value="LAND IMPACTS"
+     width="180" />
+    <text
+     follows="left|top"
+     halign="right"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="selected"
+     top_pad="3"
+     value="--"
+     width="40" />
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left_pad="10"
+     name="selected_label"
+     top_delta="0"
+     value="Selected"
+     width="130" />
+    <text
+     follows="left|top"
+     halign="right"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="rezzed_on_land"
+     top_pad="3"
+     value="--"
+     width="40" />
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left_pad="10"
+     name="rezzed_on_land_label"
+     top_delta="0"
+     value="Rezzed on land"
+     width="130" />
+    <text
+     follows="left|top"
+     halign="right"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="remaining_capacity"
+     top_pad="3"
+     value="--"
+     width="40" />
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left_pad="10"
+     name="remaining_capacity"
+     top_delta="0"
+     value="Remaining capacity"
+     width="130" />
+    <text
+     follows="left|top"
+     halign="right"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="total_capacity"
+     top_pad="3"
+     value="--"
+     width="40" />
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left_pad="10"
+     name="total_capacity"
+     top_delta="0"
+     value="Total capacity"
+     width="130" />
+    <view_border
+     bevel_style="none"
+     follows="top|left"
+     height="0"
+     layout="topleft"
+     left="10"
+     name="land_impacts_text_border"
+     top_pad="5"
+     width="180"/>
+
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="total_capacity"
+     top_pad="10"
+     value="[secondlife:///www.secondlife.com What is all this?...]"
+     width="180" />
+</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml
index 8901583799..e794a7067d 100644
--- a/indra/newview/skins/default/xui/en/floater_tools.xml
+++ b/indra/newview/skins/default/xui/en/floater_tools.xml
@@ -742,7 +742,7 @@
 	  top_pad="0"
 	  visible="false"
 	  width="280">
-	  Physics weight [PHYS_WEIGHT], Render Cost [DISP_WEIGHT].
+	  Physics weight [PHYS_WEIGHT], Render Cost [DISP_WEIGHT]. [secondlife:///app/openfloater/object_weights More info]
 	</text>
     <!-- <text -->
     <!-- text_color="LtGray_50" -->
-- 
cgit v1.2.3


From 7fc12cd43dcb21df88be5c47c319d0d3f6498216 Mon Sep 17 00:00:00 2001
From: prep <prep@lindenlab.com>
Date: Thu, 28 Jul 2011 16:09:17 -0400
Subject: Fix for sh-2044, sh-2039 and sh-2166 (Avatar weights were sometimes
 not correctly applied upon import.

---
 indra/llprimitive/llmodel.cpp |  8 ++++----
 indra/llprimitive/llmodel.h   | 18 +++++++++++++++++-
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index ea0ea931af..def276c808 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -1692,13 +1692,13 @@ LLModel::weight_list& LLModel::getJointInfluences(const LLVector3& pos)
 	}
 	else
 	{  //no exact match found, get closest point
-		const F32 epsilon = 2.f/65536;
+		const F32 epsilon = 1e-5f;
 		weight_map::iterator iter_up = mSkinWeights.lower_bound(pos);
 		weight_map::iterator iter_down = ++iter_up;
 
 		weight_map::iterator best = iter_up;
 
-		F32 min_dist = (iter->first - pos).magVecSquared();
+		F32 min_dist = (iter->first - pos).magVec();
 
 		bool done = false;
 		while (!done)
@@ -1709,7 +1709,7 @@ LLModel::weight_list& LLModel::getJointInfluences(const LLVector3& pos)
 			if (iter_up != mSkinWeights.end() && ++iter_up != mSkinWeights.end())
 			{
 				done = false;
-				F32 dist = (iter_up->first - pos).magVecSquared();
+				F32 dist = (iter_up->first - pos).magVec();
 
 				if (dist < epsilon)
 				{
@@ -1727,7 +1727,7 @@ LLModel::weight_list& LLModel::getJointInfluences(const LLVector3& pos)
 			{
 				done = false;
 
-				F32 dist = (iter_down->first - pos).magVecSquared();
+				F32 dist = (iter_down->first - pos).magVec();
 
 				if (dist < epsilon)
 				{
diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h
index 3f58eba07d..9dab3a0400 100644
--- a/indra/llprimitive/llmodel.h
+++ b/indra/llprimitive/llmodel.h
@@ -217,13 +217,29 @@ public:
 		}
 	};
 
+	
+	struct JointPositionalCompare
+	{
+		//Are the doubles the same w/in epsilon specified tolerance
+		bool areEqual( double a, double b )
+		{
+			const float epsilon = 1e-5f;
+			return (abs(a - b) > epsilon) && (a < b);
+		}
+		//Make sure that we return false for any values that are within the tolerance for equivalence
+		bool operator() ( const LLVector3& a, const LLVector3& b )
+		{
+			 return ( areEqual( a[0],b[0]) && areEqual( a[1],b[1] ) && areEqual( a[2],b[2]) ) ? false : true;		
+		}
+	};
+
 	//copy of position array for this model -- mPosition[idx].mV[X,Y,Z]
 	std::vector<LLVector3> mPosition;
 
 	//map of positions to skin weights --- mSkinWeights[pos].mV[0..4] == <joint_index>.<weight>
 	//joint_index corresponds to mJointList
 	typedef std::vector<JointWeight> weight_list;
-	typedef std::map<LLVector3, weight_list > weight_map;
+	typedef std::map<LLVector3, weight_list, JointPositionalCompare > weight_map;
 	weight_map mSkinWeights;
 
 	//get list of weight influences closest to given position
-- 
cgit v1.2.3


From 0713e8c97a75cb209c5d36fba0bdf20dc107a981 Mon Sep 17 00:00:00 2001
From: nyx <none@none>
Date: Fri, 29 Jul 2011 17:21:27 -0400
Subject: BUILDFIX: fixing build for linux, casting doubles as parameters to
 abs

---
 indra/llprimitive/llmodel.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h
index 90c1c252ed..74e5657d28 100644
--- a/indra/llprimitive/llmodel.h
+++ b/indra/llprimitive/llmodel.h
@@ -225,7 +225,7 @@ public:
 		bool areEqual( double a, double b )
 		{
 			const float epsilon = 1e-5f;
-			return (abs(a - b) > epsilon) && (a < b);
+			return (abs((int)(a - b)) > epsilon) && (a < b);
 		}
 		//Make sure that we return false for any values that are within the tolerance for equivalence
 		bool operator() ( const LLVector3& a, const LLVector3& b )
-- 
cgit v1.2.3


From c013c3ab5360f25ad4f9d0c7663c342367105324 Mon Sep 17 00:00:00 2001
From: prep linden <prep@lindenlab.com>
Date: Fri, 29 Jul 2011 17:44:42 -0400
Subject: Removed joint Positional Compare because it was crashing on some rigs

---
 indra/llprimitive/llmodel.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h
index 9dab3a0400..4f4e642f68 100644
--- a/indra/llprimitive/llmodel.h
+++ b/indra/llprimitive/llmodel.h
@@ -224,7 +224,7 @@ public:
 		bool areEqual( double a, double b )
 		{
 			const float epsilon = 1e-5f;
-			return (abs(a - b) > epsilon) && (a < b);
+			return (abs(a - b) < epsilon) && (a < b);
 		}
 		//Make sure that we return false for any values that are within the tolerance for equivalence
 		bool operator() ( const LLVector3& a, const LLVector3& b )
@@ -239,7 +239,7 @@ public:
 	//map of positions to skin weights --- mSkinWeights[pos].mV[0..4] == <joint_index>.<weight>
 	//joint_index corresponds to mJointList
 	typedef std::vector<JointWeight> weight_list;
-	typedef std::map<LLVector3, weight_list, JointPositionalCompare > weight_map;
+	typedef std::map<LLVector3, weight_list > weight_map;
 	weight_map mSkinWeights;
 
 	//get list of weight influences closest to given position
-- 
cgit v1.2.3


From 1b7b319ae22ac7598b7b3d75ccbec75263450e07 Mon Sep 17 00:00:00 2001
From: seth_productengine <none@none>
Date: Tue, 2 Aug 2011 00:16:13 +0300
Subject: SH-2170 WIP Object and land data added to new weights floater.

The data is updated upon object selection change. The land data is displayed for the land containing the primary selected object.
Loading indicators added for land impacts.
---
 indra/newview/llfloaterobjectweights.cpp           | 135 +++++++++++++++++++--
 indra/newview/llfloaterobjectweights.h             |  22 +++-
 .../default/xui/en/floater_object_weights.xml      |  38 +++++-
 3 files changed, 183 insertions(+), 12 deletions(-)

diff --git a/indra/newview/llfloaterobjectweights.cpp b/indra/newview/llfloaterobjectweights.cpp
index 93aa8dcf08..80a753757e 100644
--- a/indra/newview/llfloaterobjectweights.cpp
+++ b/indra/newview/llfloaterobjectweights.cpp
@@ -27,8 +27,34 @@
 
 #include "llfloaterobjectweights.h"
 
+#include "llparcel.h"
+
+#include "llfloaterreg.h"
 #include "lltextbox.h"
 
+#include "llselectmgr.h"
+#include "llviewerparcelmgr.h"
+
+/**
+ * Class LLLandImpactsObserver
+ *
+ * An observer class to monitor parcel selection and update
+ * the land impacts data from a parcel containing the selected object.
+ */
+class LLLandImpactsObserver : public LLParcelObserver
+{
+public:
+	virtual void changed()
+	{
+		LLFloaterObjectWeights* object_weights_floater = LLFloaterReg::getTypedInstance<LLFloaterObjectWeights>("object_weights");
+		if(object_weights_floater)
+		{
+			object_weights_floater->updateLandImpacts();
+		}
+	}
+};
+
+
 LLFloaterObjectWeights::LLFloaterObjectWeights(const LLSD& key)
 :	LLFloater(key),
 	mSelectedObjects(NULL),
@@ -40,12 +66,22 @@ LLFloaterObjectWeights::LLFloaterObjectWeights(const LLSD& key)
 	mSelectedOnLand(NULL),
 	mRezzedOnLand(NULL),
 	mRemainingCapacity(NULL),
-	mTotalCapacity(NULL)
+	mTotalCapacity(NULL),
+	mLandImpactsObserver(NULL)
 {
+	mLandImpactsObserver = new LLLandImpactsObserver();
+	LLViewerParcelMgr::getInstance()->addObserver(mLandImpactsObserver);
 }
 
 LLFloaterObjectWeights::~LLFloaterObjectWeights()
 {
+	mObjectSelection = NULL;
+	mParcelSelection = NULL;
+
+	mSelectMgrConnection.disconnect();
+
+	LLViewerParcelMgr::getInstance()->removeObserver(mLandImpactsObserver);
+	delete mLandImpactsObserver;
 }
 
 // virtual
@@ -59,10 +95,10 @@ BOOL LLFloaterObjectWeights::postBuild()
 	mSelectedServerWeight = getChild<LLTextBox>("server");
 	mSelectedDisplayWeight = getChild<LLTextBox>("display");
 
-	mSelectedOnLand = getChild<LLTextBox>("used_download_weight");
-	mRezzedOnLand = getChild<LLTextBox>("used_download_weight");
-	mRemainingCapacity = getChild<LLTextBox>("used_download_weight");
-	mTotalCapacity = getChild<LLTextBox>("used_download_weight");
+	mSelectedOnLand = getChild<LLTextBox>("selected");
+	mRezzedOnLand = getChild<LLTextBox>("rezzed_on_land");
+	mRemainingCapacity = getChild<LLTextBox>("remaining_capacity");
+	mTotalCapacity = getChild<LLTextBox>("total_capacity");
 
 	return TRUE;
 }
@@ -70,15 +106,94 @@ BOOL LLFloaterObjectWeights::postBuild()
 // virtual
 void LLFloaterObjectWeights::onOpen(const LLSD& key)
 {
-	updateIfNothingSelected();
+	mSelectMgrConnection = LLSelectMgr::instance().mUpdateSignal.connect(boost::bind(&LLFloaterObjectWeights::refresh, this));
+
+	mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();
+	mParcelSelection = LLViewerParcelMgr::getInstance()->getFloatingParcelSelection();
+
+	refresh();
+}
+
+// virtual
+void LLFloaterObjectWeights::onClose(bool app_quitting)
+{
+	mSelectMgrConnection.disconnect();
+
+	mObjectSelection = NULL;
+	mParcelSelection = NULL;
 }
 
-void LLFloaterObjectWeights::toggleLoadingIndicators(bool visible)
+void LLFloaterObjectWeights::updateLandImpacts()
+{
+	LLParcel *parcel = mParcelSelection->getParcel();
+	if (!parcel || LLSelectMgr::getInstance()->getSelection()->isEmpty())
+	{
+		updateIfNothingSelected();
+	}
+	else
+	{
+		S32 selected_prims = parcel->getSelectedPrimCount();
+		S32 rezzed_prims = parcel->getSimWidePrimCount();
+		S32 total_capacity = parcel->getSimWideMaxPrimCapacity();
+
+		mSelectedOnLand->setText(llformat("%d", selected_prims));
+		mRezzedOnLand->setText(llformat("%d", rezzed_prims));
+		mRemainingCapacity->setText(llformat("%d", total_capacity - rezzed_prims));
+		mTotalCapacity->setText(llformat("%d", total_capacity));
+
+		toggleLandImpactsLoadingIndicators(false);
+	}
+}
+
+void LLFloaterObjectWeights::refresh()
+{
+	if (LLSelectMgr::getInstance()->getSelection()->isEmpty())
+	{
+		updateIfNothingSelected();
+	}
+	else
+	{
+		S32 prim_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
+		S32 link_count = LLSelectMgr::getInstance()->getSelection()->getRootObjectCount();
+
+		mSelectedObjects->setText(llformat("%d", link_count));
+		mSelectedPrims->setText(llformat("%d", prim_count));
+
+		LLViewerObject* selected_object = mObjectSelection->getPrimaryObject();
+		if (selected_object)
+		{
+			// Select a parcel at the currently selected object's position.
+			LLViewerParcelMgr::getInstance()->selectParcelAt(selected_object->getPositionGlobal());
+
+			toggleLandImpactsLoadingIndicators(true);
+		}
+	}
+}
+
+void LLFloaterObjectWeights::toggleWeightsLoadingIndicators(bool visible)
 {
 	childSetVisible("download_loading_indicator", visible);
 	childSetVisible("physics_loading_indicator", visible);
 	childSetVisible("server_loading_indicator", visible);
 	childSetVisible("display_loading_indicator", visible);
+
+	mSelectedDownloadWeight->setVisible(!visible);
+	mSelectedPhysicsWeight->setVisible(!visible);
+	mSelectedServerWeight->setVisible(!visible);
+	mSelectedDisplayWeight->setVisible(!visible);
+}
+
+void LLFloaterObjectWeights::toggleLandImpactsLoadingIndicators(bool visible)
+{
+	childSetVisible("selected_loading_indicator", visible);
+	childSetVisible("rezzed_on_land_loading_indicator", visible);
+	childSetVisible("remaining_capacity_loading_indicator", visible);
+	childSetVisible("total_capacity_loading_indicator", visible);
+
+	mSelectedOnLand->setVisible(!visible);
+	mRezzedOnLand->setVisible(!visible);
+	mRemainingCapacity->setVisible(!visible);
+	mTotalCapacity->setVisible(!visible);
 }
 
 void LLFloaterObjectWeights::updateIfNothingSelected()
@@ -94,6 +209,10 @@ void LLFloaterObjectWeights::updateIfNothingSelected()
 	mSelectedDisplayWeight->setText(text);
 
 	mSelectedOnLand->setText(text);
+	mRezzedOnLand->setText(text);
+	mRemainingCapacity->setText(text);
+	mTotalCapacity->setText(text);
 
-	toggleLoadingIndicators(false);
+	toggleWeightsLoadingIndicators(false);
+	toggleLandImpactsLoadingIndicators(false);
 }
diff --git a/indra/newview/llfloaterobjectweights.h b/indra/newview/llfloaterobjectweights.h
index 10e35ad7a7..82743a8aa7 100644
--- a/indra/newview/llfloaterobjectweights.h
+++ b/indra/newview/llfloaterobjectweights.h
@@ -29,6 +29,9 @@
 
 #include "llfloater.h"
 
+class LLLandImpactsObserver;
+class LLObjectSelection;
+class LLParcelSelection;
 class LLTextBox;
 
 class LLFloaterObjectWeights : public LLFloater
@@ -36,15 +39,25 @@ class LLFloaterObjectWeights : public LLFloater
 public:
 	LOG_CLASS(LLFloaterObjectWeights);
 
+	typedef LLSafeHandle<LLObjectSelection> LLObjectSelectionHandle;
+	typedef LLSafeHandle<LLParcelSelection> LLParcelSelectionHandle;
+
 	LLFloaterObjectWeights(const LLSD& key);
 	~LLFloaterObjectWeights();
 
 	/*virtual*/ BOOL postBuild();
 
 	/*virtual*/ void onOpen(const LLSD& key);
+	/*virtual*/ void onClose(bool app_quitting);
+
+	void updateLandImpacts();
 
 private:
-	void toggleLoadingIndicators(bool visible);
+	void refresh();
+
+	void toggleWeightsLoadingIndicators(bool visible);
+	void toggleLandImpactsLoadingIndicators(bool visible);
+
 	void updateIfNothingSelected();
 
 	LLTextBox		*mSelectedObjects;
@@ -59,6 +72,13 @@ private:
 	LLTextBox		*mRezzedOnLand;
 	LLTextBox		*mRemainingCapacity;
 	LLTextBox		*mTotalCapacity;
+
+	LLLandImpactsObserver		*mLandImpactsObserver;
+
+	LLObjectSelectionHandle		mObjectSelection;
+	LLParcelSelectionHandle		mParcelSelection;
+
+	boost::signals2::connection	mSelectMgrConnection;
 };
 
 #endif //LL_LLFLOATEROBJECTWEIGHTS_H
diff --git a/indra/newview/skins/default/xui/en/floater_object_weights.xml b/indra/newview/skins/default/xui/en/floater_object_weights.xml
index f377386679..a73db3af32 100644
--- a/indra/newview/skins/default/xui/en/floater_object_weights.xml
+++ b/indra/newview/skins/default/xui/en/floater_object_weights.xml
@@ -222,6 +222,14 @@
      top_pad="3"
      value="--"
      width="40" />
+    <loading_indicator
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="34"
+     name="selected_loading_indicator"
+     top_delta="0"
+     width="16" />
     <text
      follows="left|top"
      height="16"
@@ -241,6 +249,14 @@
      top_pad="3"
      value="--"
      width="40" />
+    <loading_indicator
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="34"
+     name="rezzed_on_land_loading_indicator"
+     top_delta="0"
+     width="16" />
     <text
      follows="left|top"
      height="16"
@@ -260,12 +276,20 @@
      top_pad="3"
      value="--"
      width="40" />
+    <loading_indicator
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="34"
+     name="remaining_capacity_loading_indicator"
+     top_delta="0"
+     width="16" />
     <text
      follows="left|top"
      height="16"
      layout="topleft"
      left_pad="10"
-     name="remaining_capacity"
+     name="remaining_capacity_label"
      top_delta="0"
      value="Remaining capacity"
      width="130" />
@@ -279,12 +303,20 @@
      top_pad="3"
      value="--"
      width="40" />
+    <loading_indicator
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="34"
+     name="total_capacity_loading_indicator"
+     top_delta="0"
+     width="16" />
     <text
      follows="left|top"
      height="16"
      layout="topleft"
      left_pad="10"
-     name="total_capacity"
+     name="total_capacity_label"
      top_delta="0"
      value="Total capacity"
      width="130" />
@@ -303,7 +335,7 @@
      height="16"
      layout="topleft"
      left="10"
-     name="total_capacity"
+     name="help_SLURL"
      top_pad="10"
      value="[secondlife:///www.secondlife.com What is all this?...]"
      width="180" />
-- 
cgit v1.2.3


From 74d5b08dea093b4728c79cf81fafc0d40c392b10 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Tue, 2 Aug 2011 14:59:30 -0600
Subject: fix for SH-2144: [PUBLIC] Hi-resolution model that don't upload.

---
 indra/newview/llmeshrepository.cpp | 64 +++++++++++++++++++++-----------------
 1 file changed, 35 insertions(+), 29 deletions(-)

diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 4b2fafccd4..7bbb7f2ecd 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -1471,47 +1471,53 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
 
 void LLMeshUploadThread::generateHulls()
 {
+	bool has_valid_requests = false ;
+
 	for (instance_map::iterator iter = mInstance.begin(); iter != mInstance.end(); ++iter)
-		{
-			LLMeshUploadData data;
-			data.mBaseModel = iter->first;
+	{
+		LLMeshUploadData data;
+		data.mBaseModel = iter->first;
 
-			LLModelInstance& instance = *(iter->second.begin());
+		LLModelInstance& instance = *(iter->second.begin());
 
-			for (S32 i = 0; i < 5; i++)
-			{
-				data.mModel[i] = instance.mLOD[i];
-			}
+		for (S32 i = 0; i < 5; i++)
+		{
+			data.mModel[i] = instance.mLOD[i];
+		}
 
-			//queue up models for hull generation
-			LLModel* physics = NULL;
+		//queue up models for hull generation
+		LLModel* physics = NULL;
 
-			if (data.mModel[LLModel::LOD_PHYSICS].notNull())
-			{
-				physics = data.mModel[LLModel::LOD_PHYSICS];
-			}
-			else if (data.mModel[LLModel::LOD_MEDIUM].notNull())
-			{
-				physics = data.mModel[LLModel::LOD_MEDIUM];
-			}
-			else
-			{
-				physics = data.mModel[LLModel::LOD_HIGH];
-			}
+		if (data.mModel[LLModel::LOD_PHYSICS].notNull())
+		{
+			physics = data.mModel[LLModel::LOD_PHYSICS];
+		}
+		else if (data.mModel[LLModel::LOD_MEDIUM].notNull())
+		{
+			physics = data.mModel[LLModel::LOD_MEDIUM];
+		}
+		else
+		{
+			physics = data.mModel[LLModel::LOD_HIGH];
+		}
 
-			llassert(physics != NULL);
+		llassert(physics != NULL);
 
-			DecompRequest* request = new DecompRequest(physics, data.mBaseModel, this);
-			if(request->isValid())
-			{
-				gMeshRepo.mDecompThread->submitRequest(request);
-			}
+		DecompRequest* request = new DecompRequest(physics, data.mBaseModel, this);
+		if(request->isValid())
+		{
+			gMeshRepo.mDecompThread->submitRequest(request);
+			has_valid_requests = true ;
 		}
-
+	}
+		
+	if(has_valid_requests)
+	{
 		while (!mPhysicsComplete)
 		{
 			apr_sleep(100);
 		}
+	}	
 }
 
 void LLMeshUploadThread::doWholeModelUpload()
-- 
cgit v1.2.3


From b9247373fbbbc45aeb82017feb2e6c687d65a5b5 Mon Sep 17 00:00:00 2001
From: prep linden <prep@lindenlab.com>
Date: Tue, 2 Aug 2011 17:01:46 -0400
Subject: Sh-2129 Viewer caps implementation for resource cost selected. Also
 cleanup of old code related to earlier accounting work.

---
 indra/llcommon/CMakeLists.txt              |   2 +-
 indra/llcommon/llaccountingquota.h         |  80 ---------
 indra/llinventory/llparcel.cpp             |   9 -
 indra/llinventory/llparcel.h               |   5 -
 indra/newview/CMakeLists.txt               |   4 +-
 indra/newview/llaccountingcostmanager.cpp  | 170 ++++++++++++++++++
 indra/newview/llaccountingcostmanager.h    |  55 ++++++
 indra/newview/llaccountingquotamanager.cpp | 278 -----------------------------
 indra/newview/llaccountingquotamanager.h   |  55 ------
 indra/newview/llfloatertools.cpp           |   1 -
 indra/newview/llviewerobject.cpp           |   7 -
 indra/newview/llviewerobject.h             |   7 +-
 indra/newview/llviewerobjectlist.cpp       |   9 -
 indra/newview/llviewerobjectlist.h         |   3 -
 indra/newview/llviewerregion.cpp           |   7 +-
 15 files changed, 230 insertions(+), 462 deletions(-)
 delete mode 100644 indra/llcommon/llaccountingquota.h
 create mode 100644 indra/newview/llaccountingcostmanager.cpp
 create mode 100644 indra/newview/llaccountingcostmanager.h
 delete mode 100644 indra/newview/llaccountingquotamanager.cpp
 delete mode 100644 indra/newview/llaccountingquotamanager.h

diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt
index 9910281b64..8d1dd7a606 100644
--- a/indra/llcommon/CMakeLists.txt
+++ b/indra/llcommon/CMakeLists.txt
@@ -115,7 +115,7 @@ set(llcommon_HEADER_FILES
     indra_constants.h
     linden_common.h
     linked_lists.h
-    llaccountingquota.h
+    llaccountingcost.h
     llallocator.h
     llallocator_heap_profile.h
     llagentconstants.h
diff --git a/indra/llcommon/llaccountingquota.h b/indra/llcommon/llaccountingquota.h
deleted file mode 100644
index 140333de07..0000000000
--- a/indra/llcommon/llaccountingquota.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/** 
- * @file llaccountingquota.h
- * @
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2011, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_ACCOUNTINGQUOTA_H
-#define LL_ACCOUNTINGQUOTA_H
-
-struct ParcelQuota
-{
-	ParcelQuota( F32 ownerRenderCost,	 F32 ownerPhysicsCost,	  F32 ownerNetworkCost,	   F32 ownerSimulationCost,
-				 F32 groupRenderCost,	 F32 groupPhysicsCost,	  F32 groupNetworkCost,	   F32 groupSimulationCost,
-				 F32 otherRenderCost,	 F32 otherPhysicsCost,	  F32 otherNetworkCost,	   F32 otherSimulationCost,
-				 F32 tempRenderCost,	 F32 tempPhysicsCost,	  F32 tempNetworkCost,	   F32 tempSimulationCost,
-				 F32 selectedRenderCost, F32 selectedPhysicsCost, F32 selectedNetworkCost, F32 selectedSimulationCost,
-				 F32 parcelCapacity )
-	: mOwnerRenderCost( ownerRenderCost ), mOwnerPhysicsCost( ownerPhysicsCost ) 
-	, mOwnerNetworkCost( ownerNetworkCost ), mOwnerSimulationCost( ownerSimulationCost )
-	, mGroupRenderCost( groupRenderCost ), mGroupPhysicsCost( groupPhysicsCost )
-	, mGroupNetworkCost( groupNetworkCost ), mGroupSimulationCost( groupSimulationCost )
-	, mOtherRenderCost( otherRenderCost ), mOtherPhysicsCost( otherPhysicsCost )
-	, mOtherNetworkCost( otherNetworkCost ), mOtherSimulationCost( otherSimulationCost )
-	, mTempRenderCost( tempRenderCost ), mTempPhysicsCost( tempPhysicsCost ) 
-	, mTempNetworkCost( tempNetworkCost ), mTempSimulationCost( tempSimulationCost )
-	, mSelectedRenderCost( tempRenderCost ), mSelectedPhysicsCost( tempPhysicsCost ) 
-	, mSelectedNetworkCost( tempNetworkCost ), mSelectedSimulationCost( selectedSimulationCost )
-	, mParcelCapacity( parcelCapacity )
-	{
-	}
-
-	ParcelQuota(){}			
-	F32 mOwnerRenderCost, mOwnerPhysicsCost, mOwnerNetworkCost, mOwnerSimulationCost;
-	F32 mGroupRenderCost, mGroupPhysicsCost, mGroupNetworkCost, mGroupSimulationCost;
-	F32 mOtherRenderCost, mOtherPhysicsCost, mOtherNetworkCost, mOtherSimulationCost;
-	F32 mTempRenderCost,  mTempPhysicsCost,  mTempNetworkCost,  mTempSimulationCost;
-	F32 mSelectedRenderCost, mSelectedPhysicsCost, mSelectedNetworkCost, mSelectedSimulationCost;
-	F32 mParcelCapacity;
-};
-
-struct SelectionQuota
-{
-	SelectionQuota( LLUUID localId, F32 renderCost, F32 physicsCost, F32 networkCost, F32 simulationCost )
-	: mLocalId( localId)
-	, mRenderCost( renderCost )
-	, mPhysicsCost( physicsCost )
-	, mNetworkCost( networkCost )
-	, mSimulationCost( simulationCost )
-	{
-	}
-	SelectionQuota() {}
-	
-	F32 mRenderCost, mPhysicsCost, mNetworkCost, mSimulationCost;	
-	LLUUID mLocalId;
-};
-
-#endif
-
-
-
diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp
index c95f922301..433076c7a9 100644
--- a/indra/llinventory/llparcel.cpp
+++ b/indra/llinventory/llparcel.cpp
@@ -1373,12 +1373,3 @@ LLParcel::ECategory category_ui_string_to_category(const std::string& s)
     // is a distinct option from "None" and "Other"
     return LLParcel::C_ANY;
 }
-
-void LLParcel::updateQuota( const LLUUID& objectId,  const ParcelQuota& quota )
-{
-	if ( mID == objectId )
-	{
-		mQuota = quota;
-	}
-}
-
diff --git a/indra/llinventory/llparcel.h b/indra/llinventory/llparcel.h
index ff35caab4c..e36d0b20d2 100644
--- a/indra/llinventory/llparcel.h
+++ b/indra/llinventory/llparcel.h
@@ -34,7 +34,6 @@
 #include "llpermissions.h"
 #include "lltimer.h"
 #include "v3math.h"
-#include "llaccountingquota.h"
 
 // Grid out of which parcels taken is stepped every 4 meters.
 const F32 PARCEL_GRID_STEP_METERS	= 4.f;
@@ -603,9 +602,6 @@ public:
 	BOOL	getSellWithObjects() const		{ return (mParcelFlags & PF_SELL_PARCEL_OBJECTS) ? TRUE : FALSE; }
 	
 	
-			void		 updateQuota( const LLUUID& objectId, const ParcelQuota& quota );
-	const	ParcelQuota& getQuota( void ) { return mQuota; }	
-	
 protected:
 	LLUUID mID;
 	LLUUID				mOwnerID;
@@ -681,7 +677,6 @@ protected:
 	BOOL				mAllowGroupAVSounds;
 	BOOL				mAllowAnyAVSounds;
 	
-	ParcelQuota			mQuota;
 	
 public:
 	// HACK, make private
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index f2a9ccacec..74bda4cb1c 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -77,7 +77,7 @@ include_directories(
 
 set(viewer_SOURCE_FILES
     groupchatlistener.cpp
-    llaccountingquotamanager.cpp
+    llaccountingcostmanager.cpp
     llagent.cpp
     llagentaccess.cpp
     llagentcamera.cpp
@@ -639,7 +639,7 @@ set(viewer_HEADER_FILES
     CMakeLists.txt
     ViewerInstall.cmake
     groupchatlistener.h
-    llaccountingquotamanager.h
+    llaccountingcostmanager.h
     llagent.h
     llagentaccess.h
     llagentcamera.h
diff --git a/indra/newview/llaccountingcostmanager.cpp b/indra/newview/llaccountingcostmanager.cpp
new file mode 100644
index 0000000000..5059efbeec
--- /dev/null
+++ b/indra/newview/llaccountingcostmanager.cpp
@@ -0,0 +1,170 @@
+/** 
+ * @file LLAccountingQuotaManager.cpp
+ * @ Handles the setting and accessing for costs associated with mesh 
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+#include "llaccountingcostmanager.h"
+#include "llagent.h"
+#include "llcurl.h"
+#include "llhttpclient.h"
+
+//===============================================================================
+LLAccountingCostManager::LLAccountingCostManager()
+{	
+}
+//===============================================================================
+class LLAccountingCostResponder : public LLCurl::Responder
+{
+public:
+	LLAccountingCostResponder( const LLSD& objectIDs )
+	: mObjectIDs( objectIDs )
+	{
+	}
+		
+	void clearPendingRequests ( void )
+	{
+		for ( LLSD::array_iterator iter = mObjectIDs.beginArray(); iter != mObjectIDs.endArray(); ++iter )
+		{
+			LLAccountingCostManager::getInstance()->removePendingObject( iter->asUUID() );
+		}
+	}
+	
+	void error( U32 statusNum, const std::string& reason )
+	{
+		llwarns	<< "Transport error "<<reason<<llendl;	
+		clearPendingRequests();
+	}
+	
+	void result( const LLSD& content )
+	{
+		//Check for error
+		if ( !content.isMap() || content.has("error") )
+		{
+			llwarns	<< "Error on fetched data"<< llendl;
+			clearPendingRequests();
+			return;
+		}
+		
+		bool containsSelection = content.has("selected");
+		if ( containsSelection )
+		{
+			S32 dataCount = content["selected"].size();
+				
+			for(S32 i = 0; i < dataCount; i++)
+			{
+				
+				F32 physicsCost		= 0.0f;
+				F32 networkCost		= 0.0f;
+				F32 simulationCost	= 0.0f;
+					
+				//LLTransactionID transactionID;
+					
+				//transactionID	= content["selected"][i]["local_id"].asUUID();
+				physicsCost		= content["selected"][i]["physics"].asReal();
+				networkCost		= content["selected"][i]["streaming"].asReal();
+				simulationCost	= content["selected"][i]["simulation"].asReal();
+					
+				SelectionCost selectionCost( /*transactionID,*/ physicsCost, networkCost, simulationCost );
+					
+				//How do you want to handle the updating of the invoking object/ui element?
+				
+			}
+		}
+	}
+	
+private:
+	//List of posted objects
+	LLSD mObjectIDs;
+};
+//===============================================================================
+void LLAccountingCostManager::fetchCosts( eSelectionType selectionType, const std::string& url )
+{
+	// Invoking system must have already determined capability availability
+	if ( !url.empty() )
+	{
+		LLSD objectList;
+		U32  objectIndex = 0;
+		
+		IDIt IDIter = mObjectList.begin();
+		IDIt IDIterEnd = mObjectList.end();
+		
+		for ( ; IDIter != IDIterEnd; ++IDIter )
+		{
+			// Check to see if a request for this object has already been made.
+			if ( mPendingObjectQuota.find( *IDIter ) ==	mPendingObjectQuota.end() )
+			{
+				mObjectList.insert( *IDIter );	
+				objectList[objectIndex++] = *IDIter;
+			}
+		}
+	
+		mObjectList.clear();
+		
+		//Post results
+		if ( objectList.size() > 0 )
+		{
+			std::string keystr;
+			if ( selectionType == Roots ) 
+			{ 
+				keystr="selected_roots"; 
+			}
+			else
+			if ( selectionType == Prims ) 
+			{ 
+				keystr="prim_roots"; 
+			}
+			else 
+			{
+				llinfos<<"Invalid selection type "<<llendl;
+				mObjectList.clear();
+				mPendingObjectQuota.clear();
+				return;
+			}
+			
+			LLSD dataToPost = LLSD::emptyMap();		
+			dataToPost[keystr.c_str()] = objectList;
+
+			LLHTTPClient::post( url, dataToPost, new LLAccountingCostResponder( objectList ));
+		}
+	}
+	else
+	{
+		//url was empty - warn & continue
+		llwarns<<"Supplied url is empty "<<llendl;
+		mObjectList.clear();
+		mPendingObjectQuota.clear();
+	}
+}
+//===============================================================================
+void LLAccountingCostManager::addObject( const LLUUID& objectID )
+{
+	mObjectList.insert( objectID );
+}
+//===============================================================================
+void LLAccountingCostManager::removePendingObject( const LLUUID& objectID )
+{
+	mPendingObjectQuota.erase( objectID );
+}
+//===============================================================================
diff --git a/indra/newview/llaccountingcostmanager.h b/indra/newview/llaccountingcostmanager.h
new file mode 100644
index 0000000000..8ae696a98d
--- /dev/null
+++ b/indra/newview/llaccountingcostmanager.h
@@ -0,0 +1,55 @@
+/** 
+ * @file lllAccountingQuotaManager.h
+ * @
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_ACCOUNTINGQUOTAMANAGER_H
+#define LL_ACCOUNTINGQUOTAMANAGER_H
+//===============================================================================
+#include "llaccountingcost.h"
+//===============================================================================
+class LLAccountingCostManager : public LLSingleton<LLAccountingCostManager>
+{
+public:
+	//Ctor
+	LLAccountingCostManager();
+	//Store an object that will be eventually fetched
+	void addObject( const LLUUID& objectID );
+	//Request quotas for object list
+	void fetchCosts( eSelectionType selectionType, const std::string& url );
+	//Delete a specific object from the pending list
+	void removePendingObject( const LLUUID& objectID );
+	
+private:
+	//Set of objects that will be used to generate a cost
+	std::set<LLUUID> mObjectList;
+	//During fetchCosts we move object into a the pending set to signify that 
+	//a fetch has been instigated.
+	std::set<LLUUID> mPendingObjectQuota;
+	typedef std::set<LLUUID>::iterator IDIt;
+};
+//===============================================================================
+
+#endif // LLACCOUNTINGCOSTMANAGER
+
diff --git a/indra/newview/llaccountingquotamanager.cpp b/indra/newview/llaccountingquotamanager.cpp
deleted file mode 100644
index a4f5de5632..0000000000
--- a/indra/newview/llaccountingquotamanager.cpp
+++ /dev/null
@@ -1,278 +0,0 @@
-/** 
- * @file LLAccountingQuotaManager.cpp
- * @ Handles the setting and accessing for costs associated with mesh 
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2011, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#include "llviewerprecompiledheaders.h"
-#include "llaccountingquotamanager.h"
-#include "llagent.h"
-#include "llviewerregion.h"
-#include "llviewerobject.h"
-#include "llviewerobjectlist.h"
-#include "llviewerparcelmgr.h"
-#include "llparcel.h"
-
-//===============================================================================
-LLAccountingQuotaManager::LLAccountingQuotaManager()
-{	
-}
-//===============================================================================
-class LLAccountingQuotaResponder : public LLCurl::Responder
-{
-public:
-	LLAccountingQuotaResponder( const LLSD& objectIDs )
-	: mObjectIDs( objectIDs )
-	{
-	}
-		
-	void clearPendingRequests ( void )
-	{
-		for ( LLSD::array_iterator iter = mObjectIDs.beginArray(); iter != mObjectIDs.endArray(); ++iter )
-		{
-			LLAccountingQuotaManager::getInstance()->removePendingObjectQuota( iter->asUUID() );
-		}
-	}
-	
-	void error( U32 statusNum, const std::string& reason )
-	{
-		llwarns	<< "Transport error "<<reason<<llendl;	
-		//prep#do we really want to remove all because of one failure - verify
-		clearPendingRequests();
-	}
-	
-	void result( const LLSD& content )
-	{
-		if ( !content.isMap() || content.has("error") )
-		{
-			llwarns	<< "Error on fetched data"<< llendl;
-			//prep#do we really want to remove all because of one failure - verify
-			clearPendingRequests();
-			return;
-		}
-		
-		//Differentiate what the incoming caps could be from the data	
-		bool containsParcel    = content.has("parcel");
-		bool containsSelection = content.has("selected");
-					
-		//Loop over the stored object ids checking against the incoming data
-		for ( LLSD::array_iterator iter = mObjectIDs.beginArray(); iter != mObjectIDs.endArray(); ++iter )
-		{
-			LLUUID objectID = iter->asUUID();
-						
-			LLAccountingQuotaManager::getInstance()->removePendingObjectQuota( objectID );
-				
-			if ( containsParcel )
-			{
-					//Typically should be one
-					S32 dataCount = content["parcel"].size();
-					for(S32 i = 0; i < dataCount; i++)
-					{
-						//prep#todo verify that this is safe, otherwise just add a bool
-						LLUUID parcelId;
-						//S32 parcelOwner = 0;
-						if ( content["parcel"][i].has("parcel_id") )
-						{
-							parcelId = content["parcel"][i]["parcel_id"].asUUID();
-						}
-						
-						//if ( content["parcel"][i].has("parcel_owner") )
-						//{
-						//	parcelOwner = content["parcel"][i]["parcel_owner"].asInteger();
-						//}
-											
-						F32 ownerRenderCost		= 0;
-						F32 ownerPhysicsCost	= 0;
-						F32 ownerNetworkCost	= 0;
-						F32 ownerSimulationCost = 0;
-						
-						F32 groupRenderCost		= 0;
-						F32 groupPhysicsCost	= 0;
-						F32 groupNetworkCost	= 0;
-						F32 groupSimulationCost = 0;
-						
-						F32 otherRenderCost		= 0;
-						F32 otherPhysicsCost	= 0;
-						F32 otherNetworkCost	= 0;
-						F32 otherSimulationCost = 0;
-						
-						F32 tempRenderCost		= 0;
-						F32 tempPhysicsCost		= 0;
-						F32 tempNetworkCost		= 0;
-						F32 tempSimulationCost  = 0;
-						
-						F32 selectedRenderCost		= 0;
-						F32 selectedPhysicsCost		= 0;
-						F32 selectedNetworkCost		= 0;
-						F32 selectedSimulationCost  = 0;
-						
-						F32 parcelCapacity			= 0;
-
-						if ( content["parcel"][i].has("capacity") )
-						{
-							parcelCapacity =  content["parcel"][i].has("capacity");
-						}
-
-						if ( content["parcel"][i].has("owner") )
-						{
-							ownerRenderCost		= content["parcel"][i]["owner"]["rendering"].asReal();
-							ownerPhysicsCost	= content["parcel"][i]["owner"]["physics"].asReal();
-							ownerNetworkCost	= content["parcel"][i]["owner"]["streaming"].asReal();
-							ownerSimulationCost = content["parcel"][i]["owner"]["simulation"].asReal();							
-						}
-
-						if ( content["parcel"][i].has("group") )
-						{
-							groupRenderCost		= content["parcel"][i]["group"]["rendering"].asReal();
-							groupPhysicsCost	= content["parcel"][i]["group"]["physics"].asReal();
-							groupNetworkCost	= content["parcel"][i]["group"]["streaming"].asReal();
-							groupSimulationCost = content["parcel"][i]["group"]["simulation"].asReal();
-							
-						}
-						if ( content["parcel"][i].has("other") )
-						{
-							otherRenderCost		= content["parcel"][i]["other"]["rendering"].asReal();
-							otherPhysicsCost	= content["parcel"][i]["other"]["physics"].asReal();
-							otherNetworkCost	= content["parcel"][i]["other"]["streaming"].asReal();
-							otherSimulationCost = content["parcel"][i]["other"]["simulation"].asReal();
-						}
-						
-						if ( content["parcel"][i].has("temp") )
-						{
-							tempRenderCost		= content["parcel"][i]["total"]["rendering"].asReal();
-							tempPhysicsCost		= content["parcel"][i]["total"]["physics"].asReal();
-							tempNetworkCost		= content["parcel"][i]["total"]["streaming"].asReal();
-							tempSimulationCost  = content["parcel"][i]["total"]["simulation"].asReal();							
-						}
-
-						if ( content["parcel"][i].has("selected") )
-						{
-							selectedRenderCost		= content["parcel"][i]["total"]["rendering"].asReal();
-							selectedPhysicsCost		= content["parcel"][i]["total"]["physics"].asReal();
-							selectedNetworkCost		= content["parcel"][i]["total"]["streaming"].asReal();
-							selectedSimulationCost  = content["parcel"][i]["total"]["simulation"].asReal();							
-						}
-						
-						ParcelQuota parcelQuota( ownerRenderCost,	 ownerPhysicsCost,	  ownerNetworkCost,    ownerSimulationCost,
-												 groupRenderCost,	 groupPhysicsCost,	  groupNetworkCost,    groupSimulationCost,
-												 otherRenderCost,	 otherPhysicsCost,	  otherNetworkCost,    otherSimulationCost,
-												 tempRenderCost,	 tempPhysicsCost,	  tempNetworkCost,	   tempSimulationCost,
-												 selectedRenderCost, selectedPhysicsCost, selectedNetworkCost, selectedSimulationCost,
-												 parcelCapacity );
-						//Update the Parcel						
-						LLParcel* pParcel = LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel();
-						if ( pParcel )
-						{
-							pParcel->updateQuota( objectID, parcelQuota ); 
-						}
-					}					
-				}
-			else 
-			if ( containsSelection )
-			{
-				S32 dataCount = content["selected"].size();
-				for(S32 i = 0; i < dataCount; i++)
-				{
-					
-					F32 renderCost		= 0;
-					F32 physicsCost		= 0;
-					F32 networkCost		= 0;
-					F32 simulationCost	= 0;
-					
-					LLUUID objectId;
-					
-					objectId		= content["selected"][i]["local_id"].asUUID();
-					renderCost		= content["selected"][i]["rendering"].asReal();
-					physicsCost		= content["selected"][i]["physics"].asReal();
-					networkCost		= content["selected"][i]["streaming"].asReal();
-					simulationCost	= content["selected"][i]["simulation"].asReal();
-					
-					SelectionQuota selectionQuota( objectId, renderCost, physicsCost, networkCost, simulationCost );
-					
-					//Update the objects					
-					gObjectList.updateQuota( objectId, selectionQuota ); 
-					
-				}
-			}
-			else
-			{
-				//Nothing in string 
-				LLAccountingQuotaManager::getInstance()->removePendingObjectQuota( objectID );
-			}
-		}
-	}
-	
-private:
-	//List of posted objects
-	LLSD mObjectIDs;
-};
-//===============================================================================
-void LLAccountingQuotaManager::fetchQuotas( const std::string& url )
-{
-	// Invoking system must have already determined capability availability
-	if ( !url.empty() )
-	{
-		LLSD objectList;
-		U32  objectIndex = 0;
-		IDIt IDIter = mUpdateObjectQuota.begin();
-		IDIt IDIterEnd = mUpdateObjectQuota.end();
-		
-		for ( ; IDIter != IDIterEnd; ++IDIter )
-		{
-			// Check to see if a request for this object has already been made.
-			if ( mPendingObjectQuota.find( *IDIter ) ==	mPendingObjectQuota.end() )
-			{
-				mPendingObjectQuota.insert( *IDIter );	
-				objectList[objectIndex++] = *IDIter;
-			}
-		}
-	
-		mUpdateObjectQuota.clear();
-		
-		//Post results
-		if ( objectList.size() > 0 )
-		{
-			LLSD dataToPost = LLSD::emptyMap();			
-			dataToPost["object_ids"] = objectList;
-			LLHTTPClient::post( url, dataToPost, new LLAccountingQuotaResponder( objectList ));
-		}
-	}
-	else
-	{
-		//url was empty - warn & continue
-		llwarns<<"Supplied url is empty "<<llendl;
-		mUpdateObjectQuota.clear();
-		mPendingObjectQuota.clear();
-	}
-}
-//===============================================================================
-void LLAccountingQuotaManager::updateObjectCost( const LLUUID& objectID )
-{
-	mUpdateObjectQuota.insert( objectID );
-}
-//===============================================================================
-void LLAccountingQuotaManager::removePendingObjectQuota( const LLUUID& objectID )
-{
-	mPendingObjectQuota.erase( objectID );
-}
-//===============================================================================
diff --git a/indra/newview/llaccountingquotamanager.h b/indra/newview/llaccountingquotamanager.h
deleted file mode 100644
index 9251ef9351..0000000000
--- a/indra/newview/llaccountingquotamanager.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/** 
- * @file lllAccountingQuotaManager.h
- * @
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2011, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_ACCOUNTINGQUOTAMANAGER_H
-#define LL_ACCOUNTINGQUOTAMANAGER_H
-//===============================================================================
-#include "llaccountingquota.h"
-//===============================================================================
-class LLAccountingQuotaManager : public LLSingleton<LLAccountingQuotaManager>
-{
-public:
-	//Ctor
-	LLAccountingQuotaManager();
-	//Store an object that will be eventually fetched
-	void updateObjectCost( const LLUUID& objectID );
-	//Request quotas for object list
-	void fetchQuotas( const std::string& url );
-	//Delete a specific object from the pending list
-	void removePendingObjectQuota( const LLUUID& objectID );
-	
-private:
-	//Set of objects that need to update their cost
-	std::set<LLUUID> mUpdateObjectQuota;
-	//During fetchQuota we move object into a the pending set to signify that 
-	//a fetch has been instigated.
-	std::set<LLUUID> mPendingObjectQuota;
-	typedef std::set<LLUUID>::iterator IDIt;
-};
-//===============================================================================
-
-#endif // LLACCOUNTINGQUOTAMANAGER
-
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index 9121e80a4e..00a0da3cde 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -84,7 +84,6 @@
 #include "llviewerwindow.h"
 #include "llvovolume.h"
 #include "lluictrlfactory.h"
-#include "llaccountingquotamanager.h"
 #include "llmeshrepository.h"
 
 // Globals
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index b5fdca632b..af2ceee0b7 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -100,7 +100,6 @@
 #include "lltrans.h"
 #include "llsdutil.h"
 #include "llmediaentry.h"
-#include "llaccountingquota.h"
 
 //#define DEBUG_UPDATE_TYPE
 
@@ -5785,9 +5784,3 @@ public:
 LLHTTPRegistration<ObjectPhysicsProperties>
 	gHTTPRegistrationObjectPhysicsProperties("/message/ObjectPhysicsProperties");
 
-
-void LLViewerObject::updateQuota( const SelectionQuota& quota )
-{
-	//update quotas
-	mSelectionQuota = quota;
-}
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index 1828a64917..cf2975b3b0 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -43,7 +43,6 @@
 #include "v3dmath.h"
 #include "v3math.h"
 #include "llvertexbuffer.h"
-#include "llaccountingquota.h"
 #include "llbbox.h"
 
 class LLAgent;			// TODO: Get rid of this.
@@ -655,9 +654,7 @@ protected:
 	void setParticleSource(const LLPartSysData& particle_parameters, const LLUUID& owner_id);
 	
 public:
-	void  updateQuota(  const SelectionQuota& quota );
-	const SelectionQuota& getQuota( void ) { return mSelectionQuota; }
-	
+		
 private:
 	void setNameValueList(const std::string& list);		// clears nv pairs and then individually adds \n separated NV pairs from \0 terminated string
 	void deleteTEImages(); // correctly deletes list of images
@@ -719,8 +716,6 @@ protected:
 	F32 mPhysicsCost;
 	F32 mLinksetPhysicsCost;
 
-	SelectionQuota mSelectionQuota;
-	
 	bool mCostStale;
 	mutable bool mPhysicsShapeUnknown;
 
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index 9d38954d8b..722bb30023 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -1425,15 +1425,6 @@ void LLViewerObjectList::onObjectCostFetchFailure(const LLUUID& object_id)
 	mPendingObjectCost.erase(object_id);
 }
 
-void LLViewerObjectList::updateQuota( const LLUUID& objectId, const SelectionQuota& quota  )
-{
-	LLViewerObject* pVO = findObject( objectId );
-	if ( pVO )
-	{
-		pVO->updateQuota( quota );
-	}
-}
-
 void LLViewerObjectList::updatePhysicsFlags(const LLViewerObject* object)
 {
 	mStalePhysicsFlags.insert(object->getID());
diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h
index 9d1b5cb56f..c5f2a2c1ee 100644
--- a/indra/newview/llviewerobjectlist.h
+++ b/indra/newview/llviewerobjectlist.h
@@ -36,7 +36,6 @@
 
 // project includes
 #include "llviewerobject.h"
-#include "llaccountingquota.h"
 
 class LLCamera;
 class LLNetMap;
@@ -102,8 +101,6 @@ public:
 									F32 restitution,
 									F32 gravity_multiplier);
 
-	void updateQuota( const LLUUID& objectId, const SelectionQuota& costs );
-	
 	void shiftObjects(const LLVector3 &offset);
 	void repartitionObjects();
 
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 5be2234ec2..ce73164dd2 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1484,8 +1484,6 @@ void LLViewerRegion::unpackRegionHandshake()
 	
 void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
 {
-	capabilityNames.append("AccountingParcel");
-	capabilityNames.append("AccountingSelection");
 	capabilityNames.append("AttachmentResources");
 	capabilityNames.append("AvatarPickerSearch");
 	capabilityNames.append("ChatSessionRequest");
@@ -1525,6 +1523,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
 	capabilityNames.append("ProvisionVoiceAccountRequest");
 	capabilityNames.append("RemoteParcelRequest");
 	capabilityNames.append("RequestTextureDownload");
+	capabilityNames.append("ResourceCostSelected");
 	capabilityNames.append("SearchStatRequest");
 	capabilityNames.append("SearchStatTracking");
 	capabilityNames.append("SendPostcard");
@@ -1550,10 +1549,6 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
 	capabilityNames.append("ViewerMetrics");
 	capabilityNames.append("ViewerStartAuction");
 	capabilityNames.append("ViewerStats");
-	//prep# Finalize these!!!!!!!!!
-	//capabilityNames.append("AccountingVO");	
-	capabilityNames.append("AccountingParcel");
-	capabilityNames.append("AccountingRegion");
 	
 	// Please add new capabilities alphabetically to reduce
 	// merge conflicts.
-- 
cgit v1.2.3


From c29dec3eb6f5a4fd72ab33c3346c2af26c012ebe Mon Sep 17 00:00:00 2001
From: prep linden <prep@lindenlab.com>
Date: Wed, 3 Aug 2011 10:23:22 -0400
Subject: New header for accounting costs

---
 indra/llcommon/llaccountingcost.h | 86 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 86 insertions(+)
 create mode 100644 indra/llcommon/llaccountingcost.h

diff --git a/indra/llcommon/llaccountingcost.h b/indra/llcommon/llaccountingcost.h
new file mode 100644
index 0000000000..0ef3b50c6d
--- /dev/null
+++ b/indra/llcommon/llaccountingcost.h
@@ -0,0 +1,86 @@
+/** 
+ * @file llaccountingcost.h
+ * @
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_ACCOUNTINGQUOTA_H
+#define LL_ACCOUNTINGQUOTA_H
+
+struct ParcelQuota
+{
+	ParcelQuota( F32 ownerRenderCost,	 F32 ownerPhysicsCost,	  F32 ownerNetworkCost,	   F32 ownerSimulationCost,
+				 F32 groupRenderCost,	 F32 groupPhysicsCost,	  F32 groupNetworkCost,	   F32 groupSimulationCost,
+				 F32 otherRenderCost,	 F32 otherPhysicsCost,	  F32 otherNetworkCost,	   F32 otherSimulationCost,
+				 F32 tempRenderCost,	 F32 tempPhysicsCost,	  F32 tempNetworkCost,	   F32 tempSimulationCost,
+				 F32 selectedRenderCost, F32 selectedPhysicsCost, F32 selectedNetworkCost, F32 selectedSimulationCost,
+				 F32 parcelCapacity )
+	: mOwnerRenderCost( ownerRenderCost ), mOwnerPhysicsCost( ownerPhysicsCost ) 
+	, mOwnerNetworkCost( ownerNetworkCost ), mOwnerSimulationCost( ownerSimulationCost )
+	, mGroupRenderCost( groupRenderCost ), mGroupPhysicsCost( groupPhysicsCost )
+	, mGroupNetworkCost( groupNetworkCost ), mGroupSimulationCost( groupSimulationCost )
+	, mOtherRenderCost( otherRenderCost ), mOtherPhysicsCost( otherPhysicsCost )
+	, mOtherNetworkCost( otherNetworkCost ), mOtherSimulationCost( otherSimulationCost )
+	, mTempRenderCost( tempRenderCost ), mTempPhysicsCost( tempPhysicsCost ) 
+	, mTempNetworkCost( tempNetworkCost ), mTempSimulationCost( tempSimulationCost )
+	, mSelectedRenderCost( tempRenderCost ), mSelectedPhysicsCost( tempPhysicsCost ) 
+	, mSelectedNetworkCost( tempNetworkCost ), mSelectedSimulationCost( selectedSimulationCost )
+	, mParcelCapacity( parcelCapacity )
+	{
+	}
+
+	ParcelQuota(){}			
+	F32 mOwnerRenderCost, mOwnerPhysicsCost, mOwnerNetworkCost, mOwnerSimulationCost;
+	F32 mGroupRenderCost, mGroupPhysicsCost, mGroupNetworkCost, mGroupSimulationCost;
+	F32 mOtherRenderCost, mOtherPhysicsCost, mOtherNetworkCost, mOtherSimulationCost;
+	F32 mTempRenderCost,  mTempPhysicsCost,  mTempNetworkCost,  mTempSimulationCost;
+	F32 mSelectedRenderCost, mSelectedPhysicsCost, mSelectedNetworkCost, mSelectedSimulationCost;
+	F32 mParcelCapacity;
+};
+
+//SelectionQuota atm does not require a id
+struct SelectionCost
+{
+	SelectionCost( /*LLTransactionID transactionId, */ F32 physicsCost, F32 networkCost, F32 simulationCost )
+	//: mTransactionId( transactionId)
+	: mPhysicsCost( physicsCost )
+	, mNetworkCost( networkCost )
+	, mSimulationCost( simulationCost )
+	{
+	}
+	SelectionCost()
+	: mPhysicsCost( 0.0f )
+	, mNetworkCost( 0.0f )
+	, mSimulationCost( 0.0f )
+	{}
+	
+	F32 mPhysicsCost, mNetworkCost, mSimulationCost;	
+	//LLTransactionID mTransactionId;
+};
+
+typedef enum { Roots = 0 , Prims } eSelectionType;
+
+#endif
+
+
+
-- 
cgit v1.2.3


From df94d0c778e63ce053cfd1fa4423b180bab6adfb Mon Sep 17 00:00:00 2001
From: prep <prep@lindenlab.com>
Date: Wed, 3 Aug 2011 17:01:34 -0400
Subject: Fixes for sh-2039, sh-1336, and sh-2044. Vertices were having
 incorrect weights assigned.

---
 indra/llprimitive/llmodel.cpp | 13 +++++++++++++
 indra/llprimitive/llmodel.h   | 23 ++++++++++-------------
 2 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index def276c808..d8e4d4a173 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -1679,6 +1679,19 @@ LLSD LLModel::writeModelToStream(std::ostream& ostr, LLSD& mdl, BOOL nowrite, BO
 
 LLModel::weight_list& LLModel::getJointInfluences(const LLVector3& pos)
 {
+	//1. If a vertex has been weighted then we'll find it via pos and return it's weight list
+	weight_map::iterator iterPos = mSkinWeights.begin();
+	weight_map::iterator iterEnd = mSkinWeights.end();
+	
+	for ( ; iterPos!=iterEnd; ++iterPos )
+	{
+		if ( jointPositionalLookup( iterPos->first, pos ) )
+		{
+			return iterPos->second;
+		}
+	}
+	
+	//2. Otherwise we'll use the older implementation
 	weight_map::iterator iter = mSkinWeights.find(pos);
 	
 	if (iter != mSkinWeights.end())
diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h
index b5dd9bf87d..9a7b9fa271 100644
--- a/indra/llprimitive/llmodel.h
+++ b/indra/llprimitive/llmodel.h
@@ -219,20 +219,17 @@ public:
 	};
 
 	
-	struct JointPositionalCompare
+	//Are the doubles the same w/in epsilon specified tolerance
+	bool areEqual( double a, double b ) 
 	{
-		//Are the doubles the same w/in epsilon specified tolerance
-		bool areEqual( double a, double b )
-		{
-			const float epsilon = 1e-5f;
-			return (abs((int)(a - b)) < epsilon) && (a < b);
-		}
-		//Make sure that we return false for any values that are within the tolerance for equivalence
-		bool operator() ( const LLVector3& a, const LLVector3& b )
-		{
-			 return ( areEqual( a[0],b[0]) && areEqual( a[1],b[1] ) && areEqual( a[2],b[2]) ) ? false : true;		
-		}
-	};
+		const float epsilon = 1e-5f;
+		return (fabs((a - b)) < epsilon) ? true : false ;
+	}
+	//Make sure that we return false for any values that are within the tolerance for equivalence
+	bool jointPositionalLookup( const LLVector3& a, const LLVector3& b ) 
+	{
+		 return ( areEqual( a[0],b[0]) && areEqual( a[1],b[1] ) && areEqual( a[2],b[2]) ) ? true : false;
+	}
 
 	//copy of position array for this model -- mPosition[idx].mV[X,Y,Z]
 	std::vector<LLVector3> mPosition;
-- 
cgit v1.2.3


From 7633b3f1f1191443ae153c02d71dd968b46a2334 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 4 Aug 2011 23:42:41 -0500
Subject: SH-2201 Fix for crash when getting mesh estimates.

---
 indra/newview/llfloatermodelpreview.cpp | 5 ++++-
 indra/newview/llmeshrepository.cpp      | 1 -
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 6e3008049f..95dcf8ba1e 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -3106,6 +3106,7 @@ U32 LLModelPreview::calcResourceCost()
 
 void LLFloaterModelPreview::setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost)
 {
+	assert_main_thread();
 	childSetTextArg("import_dimensions", "[X]", llformat("%.3f", x));
 	childSetTextArg("import_dimensions", "[Y]", llformat("%.3f", y));
 	childSetTextArg("import_dimensions", "[Z]", llformat("%.3f", z));
@@ -5569,19 +5570,21 @@ void LLFloaterModelPreview::handleModelPhysicsFeeReceived()
 
 void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason)
 {
-	toggleCalculateButton(true);
 	llwarns << "LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(" << status << " : " << reason << ")" << llendl;
+	doOnIdleOneTime(boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this, true));
 }
 
 /*virtual*/ 
 void LLFloaterModelPreview::onModelUploadSuccess()
 {
+	assert_main_thread();
 	closeFloater(false);
 }
 
 /*virtual*/ 
 void LLFloaterModelPreview::onModelUploadFailure()
 {
+	assert_main_thread();
 	toggleCalculateButton(true);
 }
 
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 7bbb7f2ecd..2473f2d610 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -411,7 +411,6 @@ public:
 			cc = llsd_from_file("fake_upload_error.xml");
 		}
 
-		//assert_main_thread();
 		mThread->mPendingUploads--;
 		dump_llsd_to_file(cc,make_dump_name("whole_model_upload_response_",dump_num));
 		
-- 
cgit v1.2.3


From ef6e51db22ad3aec42b19bcf3e077ff000ba8929 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Sat, 6 Aug 2011 14:28:53 +0300
Subject: SH-2170 FIXED Detecting selection of objects that cross parcel bounds
 added. In this case the land impacts data is not displayed for such
 selection.

---
 indra/newview/llfloaterobjectweights.cpp | 36 ++++++++++++++++---
 indra/newview/llviewerobject.cpp         | 14 ++++++++
 indra/newview/llviewerobject.h           |  4 +++
 indra/newview/llviewerparceloverlay.cpp  | 59 ++++++++++++++++++++++++++++++++
 indra/newview/llviewerparceloverlay.h    |  1 +
 indra/newview/llviewerregion.cpp         |  5 +++
 indra/newview/llviewerregion.h           |  1 +
 7 files changed, 115 insertions(+), 5 deletions(-)

diff --git a/indra/newview/llfloaterobjectweights.cpp b/indra/newview/llfloaterobjectweights.cpp
index 80a753757e..d39a93991f 100644
--- a/indra/newview/llfloaterobjectweights.cpp
+++ b/indra/newview/llfloaterobjectweights.cpp
@@ -34,6 +34,15 @@
 
 #include "llselectmgr.h"
 #include "llviewerparcelmgr.h"
+#include "llviewerregion.h"
+
+struct LLCrossParcelFunctor : public LLSelectedObjectFunctor
+{
+	/*virtual*/ bool apply(LLViewerObject* obj)
+	{
+		return obj->crossesParcelBounds();
+	}
+};
 
 /**
  * Class LLLandImpactsObserver
@@ -159,13 +168,30 @@ void LLFloaterObjectWeights::refresh()
 		mSelectedObjects->setText(llformat("%d", link_count));
 		mSelectedPrims->setText(llformat("%d", prim_count));
 
-		LLViewerObject* selected_object = mObjectSelection->getPrimaryObject();
-		if (selected_object)
+		LLCrossParcelFunctor func;
+		if (LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, true))
 		{
-			// Select a parcel at the currently selected object's position.
-			LLViewerParcelMgr::getInstance()->selectParcelAt(selected_object->getPositionGlobal());
+			// Some of the selected objects cross parcel bounds.
+			// We don't display land impacts in this case.
+			const std::string text = getString("nothing_selected");
+
+			mSelectedOnLand->setText(text);
+			mRezzedOnLand->setText(text);
+			mRemainingCapacity->setText(text);
+			mTotalCapacity->setText(text);
 
-			toggleLandImpactsLoadingIndicators(true);
+			toggleLandImpactsLoadingIndicators(false);
+		}
+		else
+		{
+			LLViewerObject* selected_object = mObjectSelection->getFirstObject();
+			if (selected_object)
+			{
+				// Select a parcel at the currently selected object's position.
+				LLViewerParcelMgr::getInstance()->selectParcelAt(selected_object->getPositionGlobal());
+
+				toggleLandImpactsLoadingIndicators(true);
+			}
 		}
 	}
 }
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index b5fdca632b..34c73ee739 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -628,6 +628,20 @@ void LLViewerObject::constructAndAddReturnable( std::vector<PotentialReturnableO
 	}
 }
 
+bool LLViewerObject::crossesParcelBounds()
+{
+	std::vector<LLBBox> boxes;
+	boxes.push_back(LLBBox(getPositionRegion(), getRotationRegion(), getScale() * -0.5f, getScale() * 0.5f).getAxisAligned());
+	for (child_list_t::iterator iter = mChildList.begin();
+		 iter != mChildList.end(); iter++)
+	{
+		LLViewerObject* child = *iter;
+		boxes.push_back(LLBBox(child->getPositionRegion(), child->getRotationRegion(), child->getScale() * -0.5f, child->getScale() * 0.5f).getAxisAligned());
+	}
+
+	return mRegionp && mRegionp->objectsCrossParcel(boxes);
+}
+
 BOOL LLViewerObject::setParent(LLViewerObject* parent)
 {
 	if(mParent != parent)
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index 1828a64917..f27b825bbe 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -243,6 +243,10 @@ public:
 	void buildReturnablesForChildrenVO( std::vector<PotentialReturnableObject>& returnables, LLViewerObject* pChild, LLViewerRegion* pTargetRegion );
 	void constructAndAddReturnable( std::vector<PotentialReturnableObject>& returnables, LLViewerObject* pChild, LLViewerRegion* pTargetRegion );
 
+	// This method returns true if the object crosses
+	// any parcel bounds in the region.
+	bool crossesParcelBounds();
+
 	/*
 	// This method will scan through this object, and then query the
 	// selection manager to see if the local agent probably has the
diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp
index eff16b6a6e..e619b89f9b 100644
--- a/indra/newview/llviewerparceloverlay.cpp
+++ b/indra/newview/llviewerparceloverlay.cpp
@@ -201,6 +201,65 @@ bool LLViewerParcelOverlay::encroachesOnUnowned(const std::vector<LLBBox>& boxes
 	return false;
 }
 
+bool LLViewerParcelOverlay::encroachesOnNearbyParcel(const std::vector<LLBBox>& boxes) const
+{
+	// boxes are expected to already be axis aligned
+	for (U32 i = 0; i < boxes.size(); ++i)
+	{
+		LLVector3 min = boxes[i].getMinAgent();
+		LLVector3 max = boxes[i].getMaxAgent();
+
+		// If an object crosses region borders it crosses a parcel
+		if (   min.mV[VX] < 0
+			|| min.mV[VY] < 0
+			|| max.mV[VX] > REGION_WIDTH_METERS
+			|| max.mV[VY] > REGION_WIDTH_METERS)
+		{
+			return true;
+		}
+
+		S32 left   = S32(llclamp((min.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
+		S32 right  = S32(llclamp((max.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
+		S32 bottom = S32(llclamp((min.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
+		S32 top    = S32(llclamp((max.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
+
+		const S32 GRIDS_PER_EDGE = mParcelGridsPerEdge;
+
+		for (S32 row = bottom; row <= top; row++)
+		{
+			for (S32 col = left; col <= right; col++)
+			{
+				// This is not the rightmost column
+				if (col < GRIDS_PER_EDGE-1)
+				{
+					U8 east_overlay = mOwnership[row*GRIDS_PER_EDGE+col+1];
+					// If the column to the east of the current one marks
+					// the other parcel's west edge and the box extends
+					// to the west it crosses the parcel border.
+					if ((east_overlay & PARCEL_WEST_LINE) && col < right)
+					{
+						return true;
+					}
+				}
+
+				// This is not the topmost column
+				if (row < GRIDS_PER_EDGE-1)
+				{
+					U8 north_overlay = mOwnership[(row+1)*GRIDS_PER_EDGE+col];
+					// If the row to the north of the current one marks
+					// the other parcel's south edge and the box extends
+					// to the south it crosses the parcel border.
+					if ((north_overlay & PARCEL_SOUTH_LINE) && row < top)
+					{
+						return true;
+					}
+				}
+			}
+		}
+	}
+	return false;
+}
+
 BOOL LLViewerParcelOverlay::isSoundLocal(const LLVector3& pos) const
 {
 	S32 row =    S32(pos.mV[VY] / PARCEL_GRID_STEP_METERS);
diff --git a/indra/newview/llviewerparceloverlay.h b/indra/newview/llviewerparceloverlay.h
index 3c6794e7d0..7445d5bf1d 100644
--- a/indra/newview/llviewerparceloverlay.h
+++ b/indra/newview/llviewerparceloverlay.h
@@ -61,6 +61,7 @@ public:
 	// bounding boxes which isn't perfect, but is close
 	bool encroachesOwned(const std::vector<LLBBox>& boxes) const;
 	bool encroachesOnUnowned(const std::vector<LLBBox>& boxes) const;
+	bool encroachesOnNearbyParcel(const std::vector<LLBBox>& boxes) const;
 	
 	BOOL			isSoundLocal(const LLVector3& pos) const;
 
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 5be2234ec2..7ebfcc2b5a 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1784,6 +1784,11 @@ bool LLViewerRegion::childrenObjectReturnable( const std::vector<LLBBox>& boxes
 	return result;
 }
 
+bool LLViewerRegion::objectsCrossParcel(const std::vector<LLBBox>& boxes) const
+{
+	return mParcelOverlay && mParcelOverlay->encroachesOnNearbyParcel(boxes);
+}
+
 void LLViewerRegion::getNeighboringRegions( std::vector<LLViewerRegion*>& uniqueRegions )
 {
 	mImpl->mLandp->getNeighboringRegions( uniqueRegions );
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index b3c19ea58d..c86c30b93c 100644
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -322,6 +322,7 @@ public:
 
 	bool objectIsReturnable(const LLVector3& pos, const std::vector<LLBBox>& boxes) const;
 	bool childrenObjectReturnable( const std::vector<LLBBox>& boxes ) const;
+	bool objectsCrossParcel(const std::vector<LLBBox>& boxes) const;
 
 	void getNeighboringRegions( std::vector<LLViewerRegion*>& uniqueRegions );
 	
-- 
cgit v1.2.3


From e384ccb5dacc8208506f8849553af66d87950f5c Mon Sep 17 00:00:00 2001
From: prep linden <prep@lindenlab.com>
Date: Tue, 9 Aug 2011 16:31:36 -0400
Subject: Temporarily disallow the upload of non 1.4 dae files

---
 indra/newview/llfloatermodelpreview.cpp | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 95dcf8ba1e..333c0c0000 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -768,6 +768,7 @@ void LLFloaterModelPreview::draw()
 		if ( mModelPreview->getLoadState() == LLModelLoader::ERROR_PARSING )
 		{
 			childSetTextArg("status", "[STATUS]", getString("status_parse_error"));
+			toggleCalculateButton(false);
 		}
 		else
 		{
@@ -776,7 +777,7 @@ void LLFloaterModelPreview::draw()
 	}
 
 	childSetEnabled("ok_btn", mHasUploadPerm && !mUploadModelUrl.empty());
-
+	
 	childSetTextArg("prim_cost", "[PRIM_COST]", llformat("%d", mModelPreview->mResourceCost));
 	childSetTextArg("description_label", "[TEXTURES]", llformat("%d", mModelPreview->mTextureSet.size()));
 
@@ -1395,6 +1396,18 @@ bool LLModelLoader::doLoadModel()
 		return false;
 	}
 
+	//determine if this dae is a valid version.
+	domVersionType docVersion = dom->getVersion();
+
+	if ( docVersion != VERSIONTYPE_1_4_0 )
+	{
+		llinfos<<" Error with dae - unsupported dae version "<<llendl;
+		setLoadState( ERROR_PARSING );
+		return false;
+		
+	}
+	
+	
 	daeDatabase* db = dae.getDatabase();
 	
 	daeInt count = db->getElementCount(NULL, COLLADA_TYPE_MESH);
-- 
cgit v1.2.3


From 0405e91df31b7fed5d994a6d2526a1c5a5bc8c5c Mon Sep 17 00:00:00 2001
From: prep linden <prep@lindenlab.com>
Date: Tue, 9 Aug 2011 17:10:17 -0400
Subject: Reports error of a non compatible dae to the log if not 1.4

---
 indra/newview/llfloatermodelpreview.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 333c0c0000..3aca0f7119 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -1402,8 +1402,8 @@ bool LLModelLoader::doLoadModel()
 	if ( docVersion != VERSIONTYPE_1_4_0 )
 	{
 		llinfos<<" Error with dae - unsupported dae version "<<llendl;
-		setLoadState( ERROR_PARSING );
-		return false;
+		//setLoadState( ERROR_PARSING );
+		//return false;
 		
 	}
 	
-- 
cgit v1.2.3


From 350894fc0b7b3b806350f3409765105cdf73d3e9 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Thu, 11 Aug 2011 02:00:56 +0300
Subject: SH-2064 FIXED 'Upload' button disabled while mesh upload is in
 progress.

---
 indra/newview/llfloatermodelpreview.cpp | 26 ++++----------------------
 1 file changed, 4 insertions(+), 22 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 95dcf8ba1e..dd30671aaa 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -429,8 +429,6 @@ BOOL LLFloaterModelPreview::postBuild()
 
 	childDisable("upload_skin");
 	childDisable("upload_joints");
-	
-	childDisable("ok_btn");
 
 	mViewOptionMenuButton = getChild<LLMenuButton>("options_gear_btn");
 
@@ -775,8 +773,6 @@ void LLFloaterModelPreview::draw()
 		}
 	}
 
-	childSetEnabled("ok_btn", mHasUploadPerm && !mUploadModelUrl.empty());
-
 	childSetTextArg("prim_cost", "[PRIM_COST]", llformat("%d", mModelPreview->mResourceCost));
 	childSetTextArg("description_label", "[TEXTURES]", llformat("%d", mModelPreview->mTextureSet.size()));
 
@@ -3004,14 +3000,6 @@ U32 LLModelPreview::calcResourceCost()
 
 	rebuildUploadData();
 
-	if (mFMP && mModelLoader)
-	{
-		if ( getLoadState() < LLModelLoader::ERROR_PARSING)
-		{
-			mFMP->childEnable("ok_btn");
-		}
-	}
-
 	//Upload skin is selected BUT check to see if the joints coming in from the asset were malformed.
 	if ( mFMP && mFMP->childGetValue("upload_skin").asBoolean() )
 	{
@@ -3140,11 +3128,6 @@ void LLModelPreview::rebuildUploadData()
 
 	F32 max_scale = 0.f;
 
-	if ( mBaseScene.size() > 0)
-	{
-		mFMP->childEnable("ok_btn");
-	}
-
 	//reorder materials to match mBaseModel
 	for (U32 i = 0; i < LLModel::NUM_LODS; i++)
 	{
@@ -4245,11 +4228,7 @@ void LLModelPreview::updateStatusMessages()
 		}
 	}
 
-	if ( upload_ok && !errorStateFromLoader && skinAndRigOk && !has_degenerate)
-	{
-		mFMP->childEnable("ok_btn");
-	}
-	else
+	if (!upload_ok || errorStateFromLoader || !skinAndRigOk || has_degenerate)
 	{
 		mFMP->childDisable("ok_btn");
 	}
@@ -5438,6 +5417,8 @@ void LLFloaterModelPreview::onUpload(void* user_data)
 
 	LLFloaterModelPreview* mp = (LLFloaterModelPreview*) user_data;
 
+	mp->mUploadBtn->setEnabled(false);
+
 	mp->mModelPreview->rebuildUploadData();
 
 	bool upload_skinweights = mp->childGetValue("upload_skin").asBoolean();
@@ -5586,6 +5567,7 @@ void LLFloaterModelPreview::onModelUploadFailure()
 {
 	assert_main_thread();
 	toggleCalculateButton(true);
+	mUploadBtn->setEnabled(true);
 }
 
 S32 LLFloaterModelPreview::DecompRequest::statusCallback(const char* status, S32 p1, S32 p2)
-- 
cgit v1.2.3


From c70a357a274d5acd7921c3185dc34b89069d4e61 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Wed, 10 Aug 2011 18:59:10 +0300
Subject: SH-2076 FIXED Removed the sculpt type 'None' from edit dialog. If a
 prim's sculpt type was set to 'None' it is displayed as 'Plane' in the combo
 box.

---
 indra/newview/llpanelobject.cpp                      | 13 +++++++++++--
 indra/newview/skins/default/xui/en/floater_tools.xml | 12 ++++--------
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp
index c222bbb191..e4b2396bc6 100644
--- a/indra/newview/llpanelobject.cpp
+++ b/indra/newview/llpanelobject.cpp
@@ -1112,7 +1112,16 @@ void LLPanelObject::getState( )
 			
 			if (mCtrlSculptType)
 			{
-				mCtrlSculptType->setCurrentByIndex(sculpt_stitching);
+				if (sculpt_stitching == LL_SCULPT_TYPE_NONE)
+				{
+					// since 'None' is no longer an option in the combo box
+					// use 'Plane' as an equivalent sculpt type
+					mCtrlSculptType->setCurrentByID(LLSD(LL_SCULPT_TYPE_PLANE));
+				}
+				else
+				{
+					mCtrlSculptType->setCurrentByID(LLSD(sculpt_stitching));
+				}
 				mCtrlSculptType->setEnabled(editable && !isMesh);
 			}
 
@@ -1749,7 +1758,7 @@ void LLPanelObject::sendSculpt()
 	U8 sculpt_type = 0;
 	
 	if (mCtrlSculptType)
-		sculpt_type |= mCtrlSculptType->getCurrentIndex();
+		sculpt_type |= mCtrlSculptType->getValue().asInteger();
 
 	bool enabled = sculpt_type != LL_SCULPT_TYPE_MESH;
 
diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml
index e794a7067d..03d6c84266 100644
--- a/indra/newview/skins/default/xui/en/floater_tools.xml
+++ b/indra/newview/skins/default/xui/en/floater_tools.xml
@@ -1999,26 +1999,22 @@ even though the user gets a free copy.
              top_pad="4"
              visible="false"
              width="150">
-                <combo_box.item
-                 label="(none)"
-                 name="None"
-                 value="None" />
                 <combo_box.item
                  label="Sphere"
                  name="Sphere"
-                 value="Sphere" />
+                 value="1" />
                 <combo_box.item
                  label="Torus"
                  name="Torus"
-                 value="Torus" />
+                 value="2" />
                 <combo_box.item
                  label="Plane"
                  name="Plane"
-                 value="Plane" />
+                 value="3" />
                 <combo_box.item
                  label="Cylinder"
                  name="Cylinder"
-                 value="Cylinder" />
+                 value="4" />
               </combo_box>
         </panel>
         <panel
-- 
cgit v1.2.3


From b2da13f46b1d5bb2977f06a6c10ec550920b17a0 Mon Sep 17 00:00:00 2001
From: prep linden <prep@lindenlab.com>
Date: Wed, 10 Aug 2011 12:27:29 -0400
Subject: Joint resolver now constructed from key name (cts-660)

---
 indra/newview/llfloatermodelpreview.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 3aca0f7119..7d34754214 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -1629,7 +1629,7 @@ bool LLModelLoader::doLoadModel()
 								{
 									//Build a joint for the resolver to work with
 									char str[64]={0};
-									sprintf(str,"./%s",(*jointIt).second.c_str() );
+									sprintf(str,"./%s",(*jointIt).first.c_str() );
 									//llwarns<<"Joint "<< str <<llendl;
 									
 									//Setup the resolver
-- 
cgit v1.2.3


From 20c3d8485480487d38500c9b18846ca96d1d6f83 Mon Sep 17 00:00:00 2001
From: prep linden <prep@lindenlab.com>
Date: Wed, 10 Aug 2011 12:50:12 -0400
Subject: Submitted correction for logic error: if decomp fails for single hull
 only execute fallback code

---
 indra/newview/llmeshrepository.cpp | 43 +++++++++++++++++++-------------------
 1 file changed, 22 insertions(+), 21 deletions(-)

diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 2473f2d610..1518fde66b 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -3144,32 +3144,33 @@ void LLPhysicsDecomp::doDecompositionSingleHull()
 		llwarns << "Could not execute decomposition stage when attempting to create single hull." << llendl;
 		make_box(mCurRequest);
 	}
+	else
+	{
+		mMutex->lock();
+		mCurRequest->mHull.clear();
+		mCurRequest->mHull.resize(1);
+		mCurRequest->mHullMesh.clear();
+		mMutex->unlock();
 
-	mMutex->lock();
-	mCurRequest->mHull.clear();
-	mCurRequest->mHull.resize(1);
-	mCurRequest->mHullMesh.clear();
-	mMutex->unlock();
-
-	std::vector<LLVector3> p;
-	LLCDHull hull;
+		std::vector<LLVector3> p;
+		LLCDHull hull;
 		
-	// if LLConvexDecomposition is a stub, num_hulls should have been set to 0 above, and we should not reach this code
-	decomp->getSingleHull(&hull);
+		// if LLConvexDecomposition is a stub, num_hulls should have been set to 0 above, and we should not reach this code
+		decomp->getSingleHull(&hull);
 
-	const F32* v = hull.mVertexBase;
+		const F32* v = hull.mVertexBase;
 
-	for (S32 j = 0; j < hull.mNumVertices; ++j)
-	{
-		LLVector3 vert(v[0], v[1], v[2]); 
-		p.push_back(vert);
-		v = (F32*) (((U8*) v) + hull.mVertexStrideBytes);
-	}
+		for (S32 j = 0; j < hull.mNumVertices; ++j)
+		{
+			LLVector3 vert(v[0], v[1], v[2]); 
+			p.push_back(vert);
+			v = (F32*) (((U8*) v) + hull.mVertexStrideBytes);
+		}
 						
-	mMutex->lock();
-	mCurRequest->mHull[0] = p;
-	mMutex->unlock();	
-			
+		mMutex->lock();
+		mCurRequest->mHull[0] = p;
+		mMutex->unlock();	
+	}		
 #else
 	setMeshData(mesh, false);
 
-- 
cgit v1.2.3


From 0d91c495717ae210aff0248119af6c4ec7ad595d Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Wed, 10 Aug 2011 18:15:07 -0400
Subject: Fix for merge breakages

---
 indra/newview/llviewerobject.h   | 3 ---
 indra/newview/llviewerregion.cpp | 2 --
 2 files changed, 5 deletions(-)

diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index f7620707cf..af96bd8fde 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -243,9 +243,6 @@ public:
 	void buildReturnablesForChildrenVO( std::vector<PotentialReturnableObject>& returnables, LLViewerObject* pChild, LLViewerRegion* pTargetRegion );
 	void constructAndAddReturnable( std::vector<PotentialReturnableObject>& returnables, LLViewerObject* pChild, LLViewerRegion* pTargetRegion );
 
-	void buildReturnablesForChildrenVO( std::vector<PotentialReturnableObject>& returnables, LLViewerObject* pChild, LLViewerRegion* pTargetRegion );
-	void constructAndAddReturnable( std::vector<PotentialReturnableObject>& returnables, LLViewerObject* pChild, LLViewerRegion* pTargetRegion );
-
 	/*
 	// This method will scan through this object, and then query the
 	// selection manager to see if the local agent probably has the
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 415963ff53..a7fac0e29d 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1486,8 +1486,6 @@ void LLViewerRegion::unpackRegionHandshake()
 	msg->sendReliable(host);
 }
 
-void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
-{
 void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
 {
 	capabilityNames.append("AttachmentResources");
-- 
cgit v1.2.3


From 6b70273603e4aa807662c301179d05a1f2f5a224 Mon Sep 17 00:00:00 2001
From: prep linden <prep@lindenlab.com>
Date: Thu, 11 Aug 2011 13:19:58 -0400
Subject: Added support for parsing of collada 1.4.1 location sids

---
 indra/newview/llfloatermodelpreview.cpp | 60 +++++++++++++++++++++++----------
 1 file changed, 42 insertions(+), 18 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 195c70c5a6..737fdd4919 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -184,6 +184,13 @@ std::string lod_label_name[NUM_LOD+1] =
 	"I went off the end of the lod_label_name array.  Me so smart."
 };
 
+std::string colladaVersion[VERSIONTYPE_COUNT+1] = 
+{
+	"1.4.0",
+	"1.4.1",
+	"Unsupported"
+};
+
 
 #define LL_DEGENERACY_TOLERANCE  1e-7f
 
@@ -1395,17 +1402,20 @@ bool LLModelLoader::doLoadModel()
 		setLoadState( ERROR_PARSING );
 		return false;
 	}
-
-	//determine if this dae is a valid version.
+	//Dom version
+	daeString domVersion = dae.getDomVersion();
+	std::string sldom(domVersion);
+	llinfos<<"Collada Importer Version: "<<sldom<<llendl;
+	//Dae version
 	domVersionType docVersion = dom->getVersion();
-
-	if ( docVersion != VERSIONTYPE_1_4_0 )
-	{
-		llinfos<<" Error with dae - unsupported dae version "<<llendl;
-		//setLoadState( ERROR_PARSING );
-		//return false;
-		
-	}
+	//0=1.4
+	//1=1.4.1
+	//2=Currently unsupported, however may work
+	if (docVersion > 1 ) 
+	{ 
+		docVersion = VERSIONTYPE_COUNT;
+	}
+	llinfos<<"Dae version "<<colladaVersion[docVersion]<<llendl;
 	
 	
 	daeDatabase* db = dae.getDatabase();
@@ -1640,15 +1650,22 @@ bool LLModelLoader::doLoadModel()
                                     if ( pJoint )
                                     {
 										//Pull out the translate id and store it in the jointTranslations map
-										daeSIDResolver jointResolver( pJoint, "./translate" );
-										domTranslate* pTranslate = daeSafeCast<domTranslate>( jointResolver.getElement() );
+										daeSIDResolver jointResolverA( pJoint, "./translate" );
+										domTranslate* pTranslateA = daeSafeCast<domTranslate>( jointResolverA.getElement() );
+										daeSIDResolver jointResolverB( pJoint, "./location" );
+										domTranslate* pTranslateB = daeSafeCast<domTranslate>( jointResolverB.getElement() );
 										
 										LLMatrix4 workingTransform;
 										
 										//Translation via SID
-										if ( pTranslate )
+										if ( pTranslateA )
+										{
+											extractTranslation( pTranslateA, workingTransform );
+										}
+										else
+										if ( pTranslateB )
 										{
-											extractTranslation( pTranslate, workingTransform );
+											extractTranslation( pTranslateB, workingTransform );
 										}
 										else
 										{
@@ -2525,13 +2542,20 @@ void LLModelLoader::processJointNode( domNode* pNode, JointTransformMap& jointTr
 	LLMatrix4 workingTransform;
 
 	//Pull out the translate id and store it in the jointTranslations map
-	daeSIDResolver jointResolver( pNode, "./translate" );
-	domTranslate* pTranslate = daeSafeCast<domTranslate>( jointResolver.getElement() );
+	daeSIDResolver jointResolverA( pNode, "./translate" );
+	domTranslate* pTranslateA = daeSafeCast<domTranslate>( jointResolverA.getElement() );
+	daeSIDResolver jointResolverB( pNode, "./location" );
+	domTranslate* pTranslateB = daeSafeCast<domTranslate>( jointResolverB.getElement() );
 
 	//Translation via SID was successful
-	if ( pTranslate )
+	if ( pTranslateA )
+	{
+		extractTranslation( pTranslateA, workingTransform );
+	}
+	else
+	if ( pTranslateB )
 	{
-		extractTranslation( pTranslate, workingTransform );
+		extractTranslation( pTranslateB, workingTransform );
 	}
 	else
 	{
-- 
cgit v1.2.3


From 5c0df02df5abdadbf17235ae5d7208963c25f1ce Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 15 Aug 2011 12:18:06 -0500
Subject: SH-2147 Clarify and quiet log spam on mesh LoD unzip failure.

---
 indra/llmath/llvolume.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 2893e746e9..a0338294c1 100755
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -2408,7 +2408,7 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size)
 	LLSD mdl;
 	if (!unzip_llsd(mdl, is, size))
 	{
-		llwarns << "not a valid mesh asset!" << llendl;
+		LL_DEBUGS("MeshStreaming") << "Failed to unzip LLSD blob for LoD, will probably fetch from sim again." << llendl;
 		return false;
 	}
 	
-- 
cgit v1.2.3


From 2d24203e5912bc6a9c8fa0e5c44cfe0711cb121a Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Mon, 15 Aug 2011 16:59:46 -0400
Subject: SH-2029 FIX - persist the model name in SLM

---
 indra/newview/llfloatermodelpreview.cpp | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 737fdd4919..6783d3d1dc 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -106,7 +106,7 @@
 #include <boost/algorithm/string.hpp>
 
 
-const S32 SLM_SUPPORTED_VERSION = 2;
+const S32 SLM_SUPPORTED_VERSION = 3;
 
 //static
 S32 LLFloaterModelPreview::sUploadAmount = 10;
@@ -2076,6 +2076,14 @@ bool LLModelLoader::loadFromSLM(const std::string& filename)
 		return false;
 	}
 
+	// Set name.
+	std::string name = data["name"];
+	if (!name.empty())
+	{
+		model[LLModel::LOD_HIGH][0]->mLabel = data["name"];
+	}
+	
+
 	//load instance list
 	model_instance_list instance_list;
 
@@ -3295,6 +3303,10 @@ void LLModelPreview::saveUploadData(const std::string& filename, bool save_skinw
 	LLSD data;
 
 	data["version"] = SLM_SUPPORTED_VERSION;
+	if (!mBaseModel.empty())
+	{
+		data["name"] = mBaseModel[0]->getName();
+	}
 
 	S32 mesh_id = 0;
 
-- 
cgit v1.2.3


From 0301feb80bbf23d65cfd1ddbe22f297c3ff61a48 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Mon, 15 Aug 2011 18:54:35 -0400
Subject: SH-2029 FIX - fix for mac build error, hopefully

---
 indra/newview/llfloatermodelpreview.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 6783d3d1dc..0ce8dcd46b 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -2080,7 +2080,7 @@ bool LLModelLoader::loadFromSLM(const std::string& filename)
 	std::string name = data["name"];
 	if (!name.empty())
 	{
-		model[LLModel::LOD_HIGH][0]->mLabel = data["name"];
+		model[LLModel::LOD_HIGH][0]->mLabel = name;
 	}
 	
 
-- 
cgit v1.2.3


From 53187303436d06038e40c5938219863c0d75ae5f Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Tue, 16 Aug 2011 17:51:11 -0400
Subject: FIX SH-859, SH-1274 - added fix for determining triangle count and 
 performance tested impact of animated textures

Also did some cleanup to ensure branch built and ran properly after
last merge.
---
 indra/newview/llfloatertools.cpp   |  3 ++-
 indra/newview/llmeshrepository.cpp |  9 ++++++--
 indra/newview/llmeshrepository.h   |  4 ++--
 indra/newview/llvovolume.cpp       | 44 +++++++++++++-------------------------
 indra/newview/llvovolume.h         |  2 +-
 5 files changed, 27 insertions(+), 35 deletions(-)

diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index c3b5cd4260..e748802738 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -453,6 +453,7 @@ void LLFloaterTools::refresh()
 		F32 link_cost  = LLSelectMgr::getInstance()->getSelection()->getSelectedLinksetCost();
 		S32 prim_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
 		S32 link_count = LLSelectMgr::getInstance()->getSelection()->getRootObjectCount();
+		S32 draw_weight = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectRenderCost();
 
 		LLStringUtil::format_map_t selection_args;
 		selection_args["OBJ_COUNT"] = llformat("%.1d", link_count);
@@ -481,7 +482,7 @@ void LLFloaterTools::refresh()
 			selection_info << ",";
 
 			childSetTextArg("selection_weight", "[PHYS_WEIGHT]", llformat("%.1f", link_phys_cost));
-			childSetTextArg("selection_weight", "[DISP_WEIGHT]", llformat("%.1d", calcRenderCost()));
+			childSetTextArg("selection_weight", "[DISP_WEIGHT]", llformat("%.1d", draw_weight));
 		}
 		else
 		{
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 2b6b2a84e1..fd66d7c515 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -2509,7 +2509,7 @@ S32 LLMeshRepository::getActualMeshLOD(const LLVolumeParams& mesh_params, S32 lo
 	return mThread->getActualMeshLOD(mesh_params, lod);
 }
 
-const LLMeshSkinInfo* LLMeshRepository::getSkinInfo(const LLUUID& mesh_id, LLVOVolume* requesting_obj)
+const LLMeshSkinInfo* LLMeshRepository::getSkinInfo(const LLUUID& mesh_id, const LLVOVolume* requesting_obj)
 {
 	if (mesh_id.notNull())
 	{
@@ -2765,7 +2765,7 @@ void LLMeshRepository::uploadError(LLSD& args)
 }
 
 //static
-F32 LLMeshRepository::getStreamingCost(LLSD& header, F32 radius, S32* bytes, S32* bytes_visible, S32 lod)
+F32 LLMeshRepository::getStreamingCost(LLSD& header, F32 radius, S32* bytes, S32* bytes_visible, S32 lod, F32 *unscaled_value)
 {
 	F32 max_distance = 512.f;
 
@@ -2854,6 +2854,11 @@ F32 LLMeshRepository::getStreamingCost(LLSD& header, F32 radius, S32* bytes, S32
 					   triangles_low*low_area +
 					  triangles_lowest*lowest_area;
 
+	if (unscaled_value)
+	{
+		*unscaled_value = weighted_avg;
+	}
+
 	return weighted_avg/gSavedSettings.getU32("MeshTriangleBudget")*15000.f;
 }
 
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index 35a7314cd5..31b84ea0d9 100755
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -445,7 +445,7 @@ public:
 	static U32 sCacheBytesWritten;
 	static U32 sPeakKbps;
 	
-	static F32 getStreamingCost(LLSD& header, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1);
+	static F32 getStreamingCost(LLSD& header, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1, F32 *unscaled_value = NULL);
 
 	LLMeshRepository();
 
@@ -464,7 +464,7 @@ public:
 
 	S32 getActualMeshLOD(const LLVolumeParams& mesh_params, S32 lod);
 	static S32 getActualMeshLOD(LLSD& header, S32 lod);
-	const LLMeshSkinInfo* getSkinInfo(const LLUUID& mesh_id, LLVOVolume* requesting_obj);
+	const LLMeshSkinInfo* getSkinInfo(const LLUUID& mesh_id, const LLVOVolume* requesting_obj);
 	LLModel::Decomposition* getDecomposition(const LLUUID& mesh_id);
 	void fetchPhysicsShape(const LLUUID& mesh_id);
 	bool hasPhysicsShape(const LLUUID& mesh_id);
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 2882e644c8..373b7f372b 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -2995,7 +2995,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 	static const F32 ARC_WEIGHTED_MESH = 1.2f; // tested based on performance
 
 	static const F32 ARC_PLANAR_COST = 1.0f; // tested based on performance to have negligible impact
-	static const F32 ARC_ANIM_TEX_COST = 1.4f; // 1.4x max
+	static const F32 ARC_ANIM_TEX_COST = 4.f; // tested based on performance
 	static const F32 ARC_ALPHA_COST = 4.f; // 4x max - based on performance
 
 	F32 shame = 0;
@@ -3023,28 +3023,20 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 		path_params = volume_params.getPathParams();
 		profile_params = volume_params.getProfileParams();
 
-		F32 radius = getVolume()->mLODScaleBias.scaledVec(getScale()).length();
-		S32 default_detail = llclamp((S32) (sqrtf(radius)*LLVOVolume::sLODFactor*4.f), 0, 3);
-		if (default_detail == getLOD())
-		{
-			num_triangles = getTriangleCount();
-		}
-		else
+		F32 weighted_triangles = -1.0;
+		getStreamingCost(NULL, NULL, &weighted_triangles);
+
+		if (weighted_triangles > 0.0)
 		{
-			LLVolume* default_volume = LLPrimitive::getVolumeManager()->refVolume(volume_params, default_detail);
-			if(default_volume != NULL)
-			{
-				num_triangles = default_volume->getNumTriangles();
-				LLPrimitive::getVolumeManager()->unrefVolume(default_volume);
-				default_volume = NULL;
-			}
-			else
-			{
-				has_volume = false;
-			}
+			num_triangles = (U32)weighted_triangles;
 		}
 	}
 
+	if (num_triangles == 0)
+	{
+		num_triangles = 4;
+	}
+
 	if (isSculpted())
 	{
 		if (isMesh())
@@ -3054,18 +3046,12 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 			S32 size = gMeshRepo.getMeshSize(volume_params.getSculptID(),3);
 			if ( size > 0)
 			{
-				num_triangles = (U32)(size / 10.f); // avg 1 triangle per 10 bytes
-				if (gMeshRepo.getSkinInfo(volume_params.getSculptID()))
+				if (gMeshRepo.getSkinInfo(volume_params.getSculptID(), this))
 				{
 					// weighted attachment - 1 point for every 3 bytes
 					weighted_mesh = 1;
 				}
 
-				if (num_triangles == 0)
-				{
-					// someone made a really tiny mesh. Approximate with a tetrahedron.
-					num_triangles = 4;
-				}
 			}
 			else
 			{
@@ -3231,7 +3217,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 	return (U32)shame;
 }
 
-F32 LLVOVolume::getStreamingCost(S32* bytes, S32* visible_bytes)
+F32 LLVOVolume::getStreamingCost(S32* bytes, S32* visible_bytes, F32* unscaled_value) const
 {
 	F32 radius = getScale().length()*0.5f;
 
@@ -3239,7 +3225,7 @@ F32 LLVOVolume::getStreamingCost(S32* bytes, S32* visible_bytes)
 	{	
 		LLSD& header = gMeshRepo.getMeshHeader(getVolume()->getParams().getSculptID());
 
-		return LLMeshRepository::getStreamingCost(header, radius, bytes, visible_bytes, mLOD);
+		return LLMeshRepository::getStreamingCost(header, radius, bytes, visible_bytes, mLOD, unscaled_value);
 	}
 	else
 	{
@@ -3253,7 +3239,7 @@ F32 LLVOVolume::getStreamingCost(S32* bytes, S32* visible_bytes)
 		header["medium_lod"]["size"] = counts[2] * 10;
 		header["high_lod"]["size"] = counts[3] * 10;
 
-		return LLMeshRepository::getStreamingCost(header, radius);
+		return LLMeshRepository::getStreamingCost(header, radius, NULL, NULL, -1, unscaled_value);
 	}	
 }
 
diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h
index 6e9c0fbcb0..556497f0fa 100644
--- a/indra/newview/llvovolume.h
+++ b/indra/newview/llvovolume.h
@@ -131,7 +131,7 @@ public:
 	/*virtual*/	const LLMatrix4	getRenderMatrix() const;
 				typedef std::map<LLUUID, S32> texture_cost_t;
 				U32 	getRenderCost(texture_cost_t &textures) const;
-	/*virtual*/	F32		getStreamingCost(S32* bytes = NULL, S32* visible_bytes = NULL);
+	/*virtual*/	F32		getStreamingCost(S32* bytes = NULL, S32* visible_bytes = NULL, F32* unscaled_value = NULL) const;
 
 	/*virtual*/ U32		getTriangleCount() const;
 	/*virtual*/ U32		getHighLODTriangleCount();
-- 
cgit v1.2.3


From 543df6736fb0ae312b9a5e056a35bf8fffd2b6c9 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Wed, 17 Aug 2011 01:42:21 +0300
Subject: SH-2171 FIXED New prim weights added to weights detail floater. -
 Fixed detecting cross-parcel objects selection. - Various fixes in
 LLAccountingCostManager. - getSelectedObjectRenderCost() moved from
 LLFloaterTools to LLObjectSelection where it used to reside. Previous
 commented out implementation of this method removed.

---
 indra/newview/llaccountingcostmanager.cpp |  66 ++++++++++---------
 indra/newview/llaccountingcostmanager.h   |  20 +++++-
 indra/newview/llfloaterobjectweights.cpp  | 102 +++++++++++++++++++++++++++---
 indra/newview/llfloaterobjectweights.h    |   7 +-
 indra/newview/llfloatertools.cpp          |  36 ++---------
 indra/newview/llfloatertools.h            |   1 -
 indra/newview/llselectmgr.cpp             |  34 +++++-----
 7 files changed, 175 insertions(+), 91 deletions(-)

diff --git a/indra/newview/llaccountingcostmanager.cpp b/indra/newview/llaccountingcostmanager.cpp
index 5059efbeec..0669bdfffa 100644
--- a/indra/newview/llaccountingcostmanager.cpp
+++ b/indra/newview/llaccountingcostmanager.cpp
@@ -29,7 +29,6 @@
 #include "llagent.h"
 #include "llcurl.h"
 #include "llhttpclient.h"
-
 //===============================================================================
 LLAccountingCostManager::LLAccountingCostManager()
 {	
@@ -38,8 +37,9 @@ LLAccountingCostManager::LLAccountingCostManager()
 class LLAccountingCostResponder : public LLCurl::Responder
 {
 public:
-	LLAccountingCostResponder( const LLSD& objectIDs )
-	: mObjectIDs( objectIDs )
+	LLAccountingCostResponder( const LLSD& objectIDs, const LLHandle<LLAccountingCostObserver>& observer_handle )
+	: mObjectIDs( objectIDs ),
+	  mObserverHandle( observer_handle )
 	{
 	}
 		
@@ -55,6 +55,12 @@ public:
 	{
 		llwarns	<< "Transport error "<<reason<<llendl;	
 		clearPendingRequests();
+
+		LLAccountingCostObserver* observer = mObserverHandle.get();
+		if (observer)
+		{
+			observer->setErrorStatus(statusNum, reason);
+		}
 	}
 	
 	void result( const LLSD& content )
@@ -63,43 +69,43 @@ public:
 		if ( !content.isMap() || content.has("error") )
 		{
 			llwarns	<< "Error on fetched data"<< llendl;
-			clearPendingRequests();
-			return;
 		}
-		
-		bool containsSelection = content.has("selected");
-		if ( containsSelection )
+		else if (content.has("selected"))
 		{
-			S32 dataCount = content["selected"].size();
-				
-			for(S32 i = 0; i < dataCount; i++)
-			{
+			F32 physicsCost		= 0.0f;
+			F32 networkCost		= 0.0f;
+			F32 simulationCost	= 0.0f;
+
+			//LLTransactionID transactionID;
 				
-				F32 physicsCost		= 0.0f;
-				F32 networkCost		= 0.0f;
-				F32 simulationCost	= 0.0f;
-					
-				//LLTransactionID transactionID;
-					
-				//transactionID	= content["selected"][i]["local_id"].asUUID();
-				physicsCost		= content["selected"][i]["physics"].asReal();
-				networkCost		= content["selected"][i]["streaming"].asReal();
-				simulationCost	= content["selected"][i]["simulation"].asReal();
-					
-				SelectionCost selectionCost( /*transactionID,*/ physicsCost, networkCost, simulationCost );
-					
-				//How do you want to handle the updating of the invoking object/ui element?
+			//transactionID	= content["selected"][i]["local_id"].asUUID();
+			physicsCost		= content["selected"]["physics"].asReal();
+			networkCost		= content["selected"]["streaming"].asReal();
+			simulationCost	= content["selected"]["simulation"].asReal();
 				
+			SelectionCost selectionCost( /*transactionID,*/ physicsCost, networkCost, simulationCost );
+
+			LLAccountingCostObserver* observer = mObserverHandle.get();
+			if (observer)
+			{
+				observer->onWeightsUpdate(selectionCost);
 			}
 		}
+
+		clearPendingRequests();
 	}
 	
 private:
 	//List of posted objects
 	LLSD mObjectIDs;
+
+	// Cost update observer handle
+	LLHandle<LLAccountingCostObserver> mObserverHandle;
 };
 //===============================================================================
-void LLAccountingCostManager::fetchCosts( eSelectionType selectionType, const std::string& url )
+void LLAccountingCostManager::fetchCosts( eSelectionType selectionType,
+										  const std::string& url,
+										  const LLHandle<LLAccountingCostObserver>& observer_handle )
 {
 	// Invoking system must have already determined capability availability
 	if ( !url.empty() )
@@ -115,7 +121,7 @@ void LLAccountingCostManager::fetchCosts( eSelectionType selectionType, const st
 			// Check to see if a request for this object has already been made.
 			if ( mPendingObjectQuota.find( *IDIter ) ==	mPendingObjectQuota.end() )
 			{
-				mObjectList.insert( *IDIter );	
+				mPendingObjectQuota.insert( *IDIter );
 				objectList[objectIndex++] = *IDIter;
 			}
 		}
@@ -133,7 +139,7 @@ void LLAccountingCostManager::fetchCosts( eSelectionType selectionType, const st
 			else
 			if ( selectionType == Prims ) 
 			{ 
-				keystr="prim_roots"; 
+				keystr="selected_prims";
 			}
 			else 
 			{
@@ -146,7 +152,7 @@ void LLAccountingCostManager::fetchCosts( eSelectionType selectionType, const st
 			LLSD dataToPost = LLSD::emptyMap();		
 			dataToPost[keystr.c_str()] = objectList;
 
-			LLHTTPClient::post( url, dataToPost, new LLAccountingCostResponder( objectList ));
+			LLHTTPClient::post( url, dataToPost, new LLAccountingCostResponder( objectList, observer_handle ));
 		}
 	}
 	else
diff --git a/indra/newview/llaccountingcostmanager.h b/indra/newview/llaccountingcostmanager.h
index 8ae696a98d..cccdc2e2d9 100644
--- a/indra/newview/llaccountingcostmanager.h
+++ b/indra/newview/llaccountingcostmanager.h
@@ -27,8 +27,24 @@
 #ifndef LL_ACCOUNTINGQUOTAMANAGER_H
 #define LL_ACCOUNTINGQUOTAMANAGER_H
 //===============================================================================
+#include "llhandle.h"
+
 #include "llaccountingcost.h"
 //===============================================================================
+// An interface class for panels which display the parcel accounting information.
+class LLAccountingCostObserver
+{
+public:
+	LLAccountingCostObserver() { mObserverHandle.bind(this); }
+	virtual ~LLAccountingCostObserver() {}
+	virtual void onWeightsUpdate(const SelectionCost& selection_cost) = 0;
+	virtual void setErrorStatus(U32 status, const std::string& reason) = 0;
+	const LLHandle<LLAccountingCostObserver>& getObserverHandle() const { return mObserverHandle; }
+
+protected:
+	LLRootHandle<LLAccountingCostObserver> mObserverHandle;
+};
+//===============================================================================
 class LLAccountingCostManager : public LLSingleton<LLAccountingCostManager>
 {
 public:
@@ -37,7 +53,8 @@ public:
 	//Store an object that will be eventually fetched
 	void addObject( const LLUUID& objectID );
 	//Request quotas for object list
-	void fetchCosts( eSelectionType selectionType, const std::string& url );
+	void fetchCosts( eSelectionType selectionType, const std::string& url,
+			const LLHandle<LLAccountingCostObserver>& observer_handle );
 	//Delete a specific object from the pending list
 	void removePendingObject( const LLUUID& objectID );
 	
@@ -52,4 +69,3 @@ private:
 //===============================================================================
 
 #endif // LLACCOUNTINGCOSTMANAGER
-
diff --git a/indra/newview/llfloaterobjectweights.cpp b/indra/newview/llfloaterobjectweights.cpp
index d39a93991f..7ad34431fb 100644
--- a/indra/newview/llfloaterobjectweights.cpp
+++ b/indra/newview/llfloaterobjectweights.cpp
@@ -32,16 +32,48 @@
 #include "llfloaterreg.h"
 #include "lltextbox.h"
 
+#include "llagent.h"
 #include "llselectmgr.h"
 #include "llviewerparcelmgr.h"
 #include "llviewerregion.h"
 
+/**
+ * struct LLCrossParcelFunctor
+ *
+ * A functor that checks whether a bounding box for all
+ * selected objects crosses a region or parcel bounds.
+ */
 struct LLCrossParcelFunctor : public LLSelectedObjectFunctor
 {
 	/*virtual*/ bool apply(LLViewerObject* obj)
 	{
-		return obj->crossesParcelBounds();
+		// Add the root object box.
+		mBoundingBox.addBBoxAgent(LLBBox(obj->getPositionRegion(), obj->getRotationRegion(), obj->getScale() * -0.5f, obj->getScale() * 0.5f).getAxisAligned());
+
+		// Extend the bounding box across all the children.
+		LLViewerObject::const_child_list_t children = obj->getChildren();
+		for (LLViewerObject::const_child_list_t::const_iterator iter = children.begin();
+			 iter != children.end(); iter++)
+		{
+			LLViewerObject* child = *iter;
+			mBoundingBox.addBBoxAgent(LLBBox(child->getPositionRegion(), child->getRotationRegion(), child->getScale() * -0.5f, child->getScale() * 0.5f).getAxisAligned());
+		}
+
+		bool result = false;
+
+		LLViewerRegion* region = obj->getRegion();
+		if (region)
+		{
+			std::vector<LLBBox> boxes;
+			boxes.push_back(mBoundingBox);
+			result = region->objectsCrossParcel(boxes);
+		}
+
+		return result;
 	}
+
+private:
+	LLBBox	mBoundingBox;
 };
 
 /**
@@ -132,6 +164,32 @@ void LLFloaterObjectWeights::onClose(bool app_quitting)
 	mParcelSelection = NULL;
 }
 
+// virtual
+void LLFloaterObjectWeights::onWeightsUpdate(const SelectionCost& selection_cost)
+{
+	mSelectedDownloadWeight->setText(llformat("%.1f", selection_cost.mNetworkCost));
+	mSelectedPhysicsWeight->setText(llformat("%.1f", selection_cost.mPhysicsCost));
+	mSelectedServerWeight->setText(llformat("%.1f", selection_cost.mSimulationCost));
+
+	S32 render_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectRenderCost();
+	mSelectedDisplayWeight->setText(llformat("%d", render_cost));
+
+	toggleWeightsLoadingIndicators(false);
+}
+
+//virtual
+void LLFloaterObjectWeights::setErrorStatus(U32 status, const std::string& reason)
+{
+	const std::string text = getString("nothing_selected");
+
+	mSelectedDownloadWeight->setText(text);
+	mSelectedPhysicsWeight->setText(text);
+	mSelectedServerWeight->setText(text);
+	mSelectedDisplayWeight->setText(text);
+
+	toggleWeightsLoadingIndicators(false);
+}
+
 void LLFloaterObjectWeights::updateLandImpacts()
 {
 	LLParcel *parcel = mParcelSelection->getParcel();
@@ -141,11 +199,9 @@ void LLFloaterObjectWeights::updateLandImpacts()
 	}
 	else
 	{
-		S32 selected_prims = parcel->getSelectedPrimCount();
 		S32 rezzed_prims = parcel->getSimWidePrimCount();
 		S32 total_capacity = parcel->getSimWideMaxPrimCapacity();
 
-		mSelectedOnLand->setText(llformat("%d", selected_prims));
 		mRezzedOnLand->setText(llformat("%d", rezzed_prims));
 		mRemainingCapacity->setText(llformat("%d", total_capacity - rezzed_prims));
 		mTotalCapacity->setText(llformat("%d", total_capacity));
@@ -156,26 +212,29 @@ void LLFloaterObjectWeights::updateLandImpacts()
 
 void LLFloaterObjectWeights::refresh()
 {
-	if (LLSelectMgr::getInstance()->getSelection()->isEmpty())
+	LLSelectMgr* sel_mgr = LLSelectMgr::getInstance();
+
+	if (sel_mgr->getSelection()->isEmpty())
 	{
 		updateIfNothingSelected();
 	}
 	else
 	{
-		S32 prim_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
-		S32 link_count = LLSelectMgr::getInstance()->getSelection()->getRootObjectCount();
+		S32 prim_count = sel_mgr->getSelection()->getObjectCount();
+		S32 link_count = sel_mgr->getSelection()->getRootObjectCount();
+		F32 prim_equiv = sel_mgr->getSelection()->getSelectedLinksetCost();
 
 		mSelectedObjects->setText(llformat("%d", link_count));
 		mSelectedPrims->setText(llformat("%d", prim_count));
+		mSelectedOnLand->setText(llformat("%.1d", (S32)prim_equiv));
 
 		LLCrossParcelFunctor func;
-		if (LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, true))
+		if (sel_mgr->getSelection()->applyToRootObjects(&func, true))
 		{
 			// Some of the selected objects cross parcel bounds.
-			// We don't display land impacts in this case.
+			// We don't display object weights and land impacts in this case.
 			const std::string text = getString("nothing_selected");
 
-			mSelectedOnLand->setText(text);
 			mRezzedOnLand->setText(text);
 			mRemainingCapacity->setText(text);
 			mTotalCapacity->setText(text);
@@ -192,6 +251,31 @@ void LLFloaterObjectWeights::refresh()
 
 				toggleLandImpactsLoadingIndicators(true);
 			}
+			else
+			{
+				llwarns << "Failed to get selected object" << llendl;
+			}
+		}
+
+		LLViewerRegion* region = gAgent.getRegion();
+		if (region && region->capabilitiesReceived())
+		{
+			for (LLObjectSelection::valid_root_iterator iter = sel_mgr->getSelection()->valid_root_begin();
+					iter != sel_mgr->getSelection()->valid_root_end(); ++iter)
+			{
+				LLAccountingCostManager::getInstance()->addObject((*iter)->getObject()->getID());
+			}
+
+			std::string url = region->getCapability("ResourceCostSelected");
+			if (!url.empty())
+			{
+				LLAccountingCostManager::getInstance()->fetchCosts(Roots, url, getObserverHandle());
+				toggleWeightsLoadingIndicators(true);
+			}
+		}
+		else
+		{
+			llwarns << "Failed to get region capabilities" << llendl;
 		}
 	}
 }
diff --git a/indra/newview/llfloaterobjectweights.h b/indra/newview/llfloaterobjectweights.h
index 82743a8aa7..50d028909e 100644
--- a/indra/newview/llfloaterobjectweights.h
+++ b/indra/newview/llfloaterobjectweights.h
@@ -29,12 +29,14 @@
 
 #include "llfloater.h"
 
+#include "llaccountingcostmanager.h"
+
 class LLLandImpactsObserver;
 class LLObjectSelection;
 class LLParcelSelection;
 class LLTextBox;
 
-class LLFloaterObjectWeights : public LLFloater
+class LLFloaterObjectWeights : public LLFloater, LLAccountingCostObserver
 {
 public:
 	LOG_CLASS(LLFloaterObjectWeights);
@@ -50,6 +52,9 @@ public:
 	/*virtual*/ void onOpen(const LLSD& key);
 	/*virtual*/ void onClose(bool app_quitting);
 
+	/*virtual*/ void onWeightsUpdate(const SelectionCost& selection_cost);
+	/*virtual*/ void setErrorStatus(U32 status, const std::string& reason);
+
 	void updateLandImpacts();
 
 private:
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index 00a0da3cde..157b66b0ac 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -435,7 +435,8 @@ void LLFloaterTools::refresh()
 		if (sShowObjectCost)
 		{
 			std::string prim_cost_string;
-			LLResMgr::getInstance()->getIntegerString(prim_cost_string, calcRenderCost());
+			S32 render_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectRenderCost();
+			LLResMgr::getInstance()->getIntegerString(prim_cost_string, render_cost);
 			getChild<LLUICtrl>("RenderingCost")->setTextArg("[COUNT]", prim_cost_string);
 		}
 		
@@ -479,8 +480,10 @@ void LLFloaterTools::refresh()
 		{
 			selection_info << ",";
 
+			S32 render_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectRenderCost();
+
 			childSetTextArg("selection_weight", "[PHYS_WEIGHT]", llformat("%.1f", link_phys_cost));
-			childSetTextArg("selection_weight", "[DISP_WEIGHT]", llformat("%.1d", calcRenderCost()));
+			childSetTextArg("selection_weight", "[DISP_WEIGHT]", llformat("%.1d", render_cost));
 		}
 		else
 		{
@@ -1014,35 +1017,6 @@ void LLFloaterTools::onClickGridOptions()
 	//floaterp->addDependentFloater(LLFloaterBuildOptions::getInstance(), FALSE);
 }
 
-S32 LLFloaterTools::calcRenderCost()
-{
-       S32 cost = 0;
-       std::set<LLUUID> textures;
-
-       for (LLObjectSelection::iterator selection_iter = LLSelectMgr::getInstance()->getSelection()->begin();
-                 selection_iter != LLSelectMgr::getInstance()->getSelection()->end();
-                 ++selection_iter)
-       {
-               LLSelectNode *select_node = *selection_iter;
-               if (select_node)
-               {
-                       LLViewerObject *vobj = select_node->getObject();
-                       if (vobj->getVolume())
-                       {
-                               LLVOVolume* volume = (LLVOVolume*) vobj;
-
-                               cost += volume->getRenderCost(textures);
-							   cost += textures.size() * LLVOVolume::ARC_TEXTURE_COST;
-							   textures.clear();
-                       }
-               }
-       }
-
-
-       return cost;
-}
-
-
 // static
 void LLFloaterTools::setEditTool(void* tool_pointer)
 {
diff --git a/indra/newview/llfloatertools.h b/indra/newview/llfloatertools.h
index 69636190fc..8c4cb721d3 100644
--- a/indra/newview/llfloatertools.h
+++ b/indra/newview/llfloatertools.h
@@ -113,7 +113,6 @@ private:
 	static bool multipleFacesSelectedConfirm(const LLSD& notification, const LLSD& response);
 	static void setObjectType( LLPCode pcode );
 	void onClickGridOptions();
-	S32 calcRenderCost();
 
 public:
 	LLButton		*mBtnFocus;
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 8fa4065fa6..7ff58f5d34 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -6522,32 +6522,32 @@ U32 LLObjectSelection::getSelectedObjectTriangleCount()
 	return count;
 }
 
-/*S32 LLObjectSelection::getSelectedObjectRenderCost()
+S32 LLObjectSelection::getSelectedObjectRenderCost()
 {
        S32 cost = 0;
-       LLVOVolume::texture_cost_t textures;
-       for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter)
-       {
-               LLSelectNode* node = *iter;
-               LLVOVolume* object = (LLVOVolume*)node->getObject();
-
-               if (object)
-               {
-                       cost += object->getRenderCost(textures);
-               }
+       std::set<LLUUID> textures;
 
-               for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter)
+       for (list_t::iterator selection_iter = mList.begin(); selection_iter != mList.end();
+                 ++selection_iter)
+       {
+               LLSelectNode *select_node = *selection_iter;
+               if (select_node)
                {
-                       // add the cost of each individual texture in the linkset
-                       cost += iter->second;
+                       LLViewerObject *vobj = select_node->getObject();
+                       if (vobj->getVolume())
+                       {
+                               LLVOVolume* volume = (LLVOVolume*) vobj;
+
+                               cost += volume->getRenderCost(textures);
+							   cost += textures.size() * LLVOVolume::ARC_TEXTURE_COST;
+							   textures.clear();
+                       }
                }
-               textures.clear();
        }
 
 
        return cost;
-}*/
-
+}
 
 //-----------------------------------------------------------------------------
 // getTECount()
-- 
cgit v1.2.3


From 1d4ccaeb74641ebf199072c8568e26f8fe002d32 Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Wed, 17 Aug 2011 16:29:20 +0300
Subject: SH-2285 FIXED Add localization capability to mesh uploader strings

- Added the convex decomposition strings to the strings.xml

- Added names to hardcoded strings.
---
 indra/newview/llfloatermodelpreview.cpp            |  7 +++++-
 .../skins/default/xui/en/floater_model_preview.xml | 28 +++++++++++-----------
 indra/newview/skins/default/xui/en/strings.xml     |  8 +++++++
 3 files changed, 28 insertions(+), 15 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index c8f4c3ac36..609fb42cc6 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -96,6 +96,7 @@
 #include "llsliderctrl.h"
 #include "llspinctrl.h"
 #include "lltoggleablemenu.h"
+#include "lltrans.h"
 #include "llvfile.h"
 #include "llvfs.h"
 #include "llcallbacklist.h"
@@ -1154,7 +1155,11 @@ void LLFloaterModelPreview::initDecompControls()
 						//llinfos << param[i].mDetails.mEnumValues.mEnumsArray[k].mValue
 						//	<< " - " << param[i].mDetails.mEnumValues.mEnumsArray[k].mName << llendl;
 
-						combo_box->add(param[i].mDetails.mEnumValues.mEnumsArray[k].mName,
+						std::string name(param[i].mDetails.mEnumValues.mEnumsArray[k].mName);
+						std::string localized_name;
+						bool is_localized = LLTrans::findString(localized_name, name);
+
+						combo_box->add(is_localized ? localized_name : name,
 							LLSD::Integer(param[i].mDetails.mEnumValues.mEnumsArray[k].mValue));
 					}
 					combo_box->setValue(param[i].mDefault.mIntOrEnumValue);
diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index c52f48cfaf..ec18f1948b 100755
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -220,9 +220,9 @@ L$ [MODEL]
         Select Level of Detail:
       </text>
      
-      <text valign="center" halign="center" bg_visible="true" bottom_delta="16" left="75" width="65" height="18" follows="left|top" value="Triangles"/>
-      <text valign="center" halign="center" bg_visible="true" left_pad="0" width="65" height="18" follows="left|top" value="Vertices"/>
-      <text valign="center" halign="center" left_pad="0" width="65" bg_visible="true" height="18" follows="left|top" value="Status"/>
+      <text valign="center" halign="center" bg_visible="true" bottom_delta="16" left="75" name="triangles" width="65" height="18" follows="left|top" value="Triangles"/>
+      <text valign="center" halign="center" bg_visible="true" left_pad="0" width="65" name="vertices" height="18" follows="left|top" value="Vertices"/>
+      <text valign="center" halign="center" left_pad="0" name="status" width="65" bg_visible="true" height="18" follows="left|top" value="Status"/>
       
       <text valign="center" halign="center" bg_visible="true" name="high_label" left="10" top_pad="0" width="65" height="18" follows="left|top" value="High"/>
       <text valign="center" halign="center" bg_visible="true" name="high_triangles" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
@@ -268,7 +268,7 @@ L$ [MODEL]
         border="true"
         bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
 
-      <text top_pad="5" left="10" height="15" follows="left|top">
+      <text top_pad="5" left="10" name="mesh_label" height="15" follows="left|top">
         Mesh
       </text>
 
@@ -350,7 +350,7 @@ L$ [MODEL]
         border="true"
         bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
 
-      <text left="10" top_pad="5" follows="top|left" width="240" height="15">
+      <text left="10" name="gen_normals_label" top_pad="5" follows="top|left" width="240" height="15">
         Generate Normals
       </text>
       <text left="35" top_pad="5" follows="top|left" width="100" height="15" name="crease_label">
@@ -422,15 +422,15 @@ L$ [MODEL]
        border="true"
        bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
 
-        <text follows="left|top" bottom="40" height="30" left="10" font="SansSerifBig">
+        <text follows="left|top" bottom="40" height="30" left="10" name="method_label" font="SansSerifBig">
           Step 1: Analysis
         </text>
         
-        <text top_pad="5" width="50" follows="top|left" height="15">
+        <text name="analysis_method_label" top_pad="5" width="50" follows="top|left" height="15">
           Method:
         </text>
         <combo_box name="Method" follows="top|left" left_pad="5" bottom_delta="2" height="20" width="80"/>
-        <text left="160" bottom_delta="-2" width="50" follows="top|left" height="15">
+        <text left="160" name="quality_label" bottom_delta="-2" width="50" follows="top|left" height="15">
           Quality:
         </text>
         <combo_box name="Decompose Quality" bottom_delta="2" follows="top|left" left_pad="5" height="20" width="80"/>
@@ -456,11 +456,11 @@ L$ [MODEL]
        border="true"
        bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
 
-        <text follows="left|top" bottom="40" height="30" left="10" font="SansSerifBig">
+        <text follows="left|top" bottom="40" height="30" left="10" name="second_step_label" font="SansSerifBig">
           Step 2: Simplification
         </text>
 
-        <text left="10" top_pad="5" height="15" width="140" follows="top|left">
+        <text left="10" name="simp_method_header" top_pad="5" height="15" width="140" follows="top|left">
           Method:
         </text>
         
@@ -509,10 +509,10 @@ L$ [MODEL]
       name="modifiers_panel"
       help_topic="upload_model_modifiers">
 
-      <text left="10" width="90" bottom="30" follows="top|left" height="15">
+      <text left="10" name="scale_label" width="90" bottom="30" follows="top|left" height="15">
         Scale:
       </text>
-      <text left_pad="5" width="140" follows="top|left" height="15">
+      <text left_pad="5" name="dimensions_label" width="140" follows="top|left" height="15">
         Dimensions:
       </text>
 
@@ -522,7 +522,7 @@ L$ [MODEL]
         [X] x [Y] x [Z] m
       </text>
 
-      <text left="10" top_pad="20" follows="top|left" height="15">
+      <text left="10" name="include_label" top_pad="20" follows="top|left" height="15">
         Include:
       </text>
 
@@ -530,7 +530,7 @@ L$ [MODEL]
       <check_box top_pad="5" name="upload_skin" height="15" follows="top|left" label="Skin weight"/>
       <check_box top_pad="5" left="20" name="upload_joints" height="15" follows="top|left" label="Joint positions"/>
 
-      <text left="10" top_pad="4" width="90" bottom="30" follows="top|left" height="15">
+      <text left="10" name="pelvis_offset_label" top_pad="4" width="90" bottom="30" follows="top|left" height="15">
         Pelvis Z Offset:
       </text>
 
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index f049f857f0..72b412efe2 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -3625,5 +3625,13 @@ Try enclosing path to the editor with double quotes.
   <string name="BeaconSound">Viewing sound beacons (yellow)</string>
   <string name="BeaconMedia">Viewing media beacons (white)</string>
   <string name="ParticleHiding">Hiding Particles</string>
+  
+  <!-- Mesh UI terms -->
+  <string name="Retain%">Retain%</string>
+  <string name="Detail">Detail</string>
+  <string name="Better Detail">Better Detail</string>
+  <string name="Surface">Surface</string>
+  <string name="Solid">Solid</string>
+  <string name="Wrap">Wrap</string>
 
   </strings>
-- 
cgit v1.2.3


From 0540b3b07667698fd50f693b56001fa3f3f00689 Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Wed, 17 Aug 2011 17:59:11 +0300
Subject: SH-1868 FIXED Support initial user-supplied metric data for upload

- Added initial value to the combobox
---
 indra/newview/skins/default/xui/en/floater_model_preview.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index ec18f1948b..7c6896becf 100755
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -40,6 +40,7 @@
 	     name="model_category_combo"  width="200">
     <combo_box.drop_down_button
       label_color="White"/>
+    <combo_item name="Choose one" label="Choose One..." value="MUT_Unspecified"/>
     <combo_item name="Avatar shape" label="Avatar shape" value="MUT_AvatarShape"/>
     <combo_item name="Avatar attachment" label="Avatar attachment" value="MUT_AvatarAttachment"/>
     <combo_item name="Building Component" label="Building Component" value="MUT_BuildingComponent"/>
-- 
cgit v1.2.3


From f7d17cad5cc3784abb0dea4fb5bec967cbc1f81b Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 17 Aug 2011 12:55:32 -0500
Subject: SH-2188 Fix for generally bad vertex buffer updates for rigged
 attachments and fix for viewer always thinking meshes initially have 8
 texture entries.

---
 indra/llmath/llvolume.cpp          | 173 ++-----------------------------------
 indra/llmath/llvolume.h            |   6 +-
 indra/newview/lldrawpoolavatar.cpp |  41 ++++++---
 indra/newview/llmeshrepository.cpp |  14 ++-
 indra/newview/llvovolume.cpp       |  13 ++-
 5 files changed, 47 insertions(+), 200 deletions(-)

diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index a0338294c1..b2fe9ba6c2 100755
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -2078,7 +2078,7 @@ LLVolume::LLVolume(const LLVolumeParams &params, const F32 detail, const BOOL ge
 	mFaceMask = 0x0;
 	mDetail = detail;
 	mSculptLevel = -2;
-	mIsTetrahedron = FALSE;
+	mIsMeshAssetLoaded = FALSE;
 	mLODScaleBias.setVec(1,1,1);
 	mHullPoints = NULL;
 	mHullIndices = NULL;
@@ -2100,7 +2100,7 @@ LLVolume::LLVolume(const LLVolumeParams &params, const F32 detail, const BOOL ge
 
 	generate();
 	
-	if (mParams.getSculptID().isNull() && mParams.getSculptType() == LL_SCULPT_TYPE_NONE)
+	if (mParams.getSculptID().isNull() && mParams.getSculptType() == LL_SCULPT_TYPE_NONE || mParams.getSculptType() == LL_SCULPT_TYPE_MESH)
 	{
 		createVolumeFaces();
 	}
@@ -2706,173 +2706,21 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size)
 	return true;
 }
 
-void tetrahedron_set_normal(LLVolumeFace::VertexData* cv)
-{
-	LLVector4a v0;
-	v0.setSub(cv[1].getPosition(), cv[0].getNormal());
-	LLVector4a v1;
-	v1.setSub(cv[2].getNormal(), cv[0].getPosition());
-	
-	cv[0].getNormal().setCross3(v0,v1);
-	cv[0].getNormal().normalize3fast();
-	cv[1].setNormal(cv[0].getNormal());
-	cv[2].setNormal(cv[1].getNormal());
-}
 
-BOOL LLVolume::isTetrahedron()
+BOOL LLVolume::isMeshAssetLoaded()
 {
-	return mIsTetrahedron;
+	return mIsMeshAssetLoaded;
 }
 
-void LLVolume::makeTetrahedron()
+void LLVolume::setMeshAssetLoaded(BOOL loaded)
 {
-	mVolumeFaces.clear();
-
-	LLVolumeFace face;
-
-	F32 x = 0.25f;
-	LLVector4a p[] = 
-	{ //unit tetrahedron corners
-		LLVector4a(x,x,x),
-		LLVector4a(-x,-x,x),
-		LLVector4a(-x,x,-x),
-		LLVector4a(x,-x,-x)
-	};
-
-	face.mExtents[0].splat(-x);
-	face.mExtents[1].splat(x);
-	
-	LLVolumeFace::VertexData cv[3];
-
-	//set texture coordinates
-	cv[0].mTexCoord = LLVector2(0,0);
-	cv[1].mTexCoord = LLVector2(1,0);
-	cv[2].mTexCoord = LLVector2(0.5f, 0.5f*F_SQRT3);
-
-
-	//side 1
-	cv[0].setPosition(p[1]);
-	cv[1].setPosition(p[0]);
-	cv[2].setPosition(p[2]);
-
-	tetrahedron_set_normal(cv);
-
-	face.resizeVertices(12);
-	face.resizeIndices(12);
-
-	LLVector4a* v = (LLVector4a*) face.mPositions;
-	LLVector4a* n = (LLVector4a*) face.mNormals;
-	LLVector2* tc = (LLVector2*) face.mTexCoords;
-
-	v[0] = cv[0].getPosition();
-	v[1] = cv[1].getPosition();
-	v[2] = cv[2].getPosition();
-	v += 3;
-
-	n[0] = cv[0].getNormal();
-	n[1] = cv[1].getNormal();
-	n[2] = cv[2].getNormal();
-	n += 3;
-
-	if(tc)
-	{
-		tc[0] = cv[0].mTexCoord;
-		tc[1] = cv[1].mTexCoord;
-		tc[2] = cv[2].mTexCoord;
-		tc += 3;
-	}
-	
-	//side 2
-	cv[0].setPosition(p[3]);
-	cv[1].setPosition(p[0]);
-	cv[2].setPosition(p[1]);
-
-	tetrahedron_set_normal(cv);
-
-	v[0] = cv[0].getPosition();
-	v[1] = cv[1].getPosition();
-	v[2] = cv[2].getPosition();
-	v += 3;
-
-	n[0] = cv[0].getNormal();
-	n[1] = cv[1].getNormal();
-	n[2] = cv[2].getNormal();
-	n += 3;
-
-	if(tc)
-	{
-		tc[0] = cv[0].mTexCoord;
-		tc[1] = cv[1].mTexCoord;
-		tc[2] = cv[2].mTexCoord;
-		tc += 3;
-	}
-
-	//side 3
-	cv[0].setPosition(p[3]);
-	cv[1].setPosition(p[1]);
-	cv[2].setPosition(p[2]);
-
-	tetrahedron_set_normal(cv);
-
-	v[0] = cv[0].getPosition();
-	v[1] = cv[1].getPosition();
-	v[2] = cv[2].getPosition();
-	v += 3;
-
-	n[0] = cv[0].getNormal();
-	n[1] = cv[1].getNormal();
-	n[2] = cv[2].getNormal();
-	n += 3;
-
-	if(tc)
-	{
-		tc[0] = cv[0].mTexCoord;
-		tc[1] = cv[1].mTexCoord;
-		tc[2] = cv[2].mTexCoord;
-		tc += 3;
-	}
-	
-	//side 4
-	cv[0].setPosition(p[2]);
-	cv[1].setPosition(p[0]);
-	cv[2].setPosition(p[3]);
-
-	tetrahedron_set_normal(cv);
-
-	v[0] = cv[0].getPosition();
-	v[1] = cv[1].getPosition();
-	v[2] = cv[2].getPosition();
-	v += 3;
-
-	n[0] = cv[0].getNormal();
-	n[1] = cv[1].getNormal();
-	n[2] = cv[2].getNormal();
-	n += 3;
-
-	if(tc)
-	{
-		tc[0] = cv[0].mTexCoord;
-		tc[1] = cv[1].mTexCoord;
-		tc[2] = cv[2].mTexCoord;
-		tc += 3;
-	}
-	
-	//set index buffer
-	for (U16 i = 0; i < 12; i++)
-	{
-		face.mIndices[i] = i;
-	}
-	
-	mVolumeFaces.push_back(face);
-	mSculptLevel = 0;
-	mIsTetrahedron = TRUE;
+	mIsMeshAssetLoaded = loaded;
 }
 
 void LLVolume::copyVolumeFaces(const LLVolume* volume)
 {
 	mVolumeFaces = volume->mVolumeFaces;
 	mSculptLevel = 0;
-	mIsTetrahedron = FALSE;
 }
 
 void LLVolume::cacheOptimize()
@@ -2886,13 +2734,6 @@ void LLVolume::cacheOptimize()
 
 S32	LLVolume::getNumFaces() const
 {
-	U8 sculpt_type = (mParams.getSculptType() & LL_SCULPT_TYPE_MASK);
-
-	if (sculpt_type == LL_SCULPT_TYPE_MESH)
-	{
-		return LL_SCULPT_MESH_MAX_FACES;
-	}
-
 	return (S32)mProfilep->mFaces.size();
 }
 
@@ -7269,7 +7110,7 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build)
 		resizeVertices(num_vertices);
 		resizeIndices(num_indices);
 
-		if ((volume->getParams().getSculptType() & LL_SCULPT_TYPE_MASK) != LL_SCULPT_TYPE_MESH)
+		if (!volume->isMeshAssetLoaded())
 		{
 			mEdge.resize(num_indices);
 		}
diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h
index f67f8f644d..f0e59a3c00 100644
--- a/indra/llmath/llvolume.h
+++ b/indra/llmath/llvolume.h
@@ -1058,14 +1058,14 @@ protected:
 public:
 	virtual bool unpackVolumeFaces(std::istream& is, S32 size);
 
-	virtual void makeTetrahedron();
-	virtual BOOL isTetrahedron();
+	virtual void setMeshAssetLoaded(BOOL loaded);
+	virtual BOOL isMeshAssetLoaded();
 
  protected:
 	BOOL mUnique;
 	F32 mDetail;
 	S32 mSculptLevel;
-	BOOL mIsTetrahedron;
+	BOOL mIsMeshAssetLoaded;
 	
 	LLVolumeParams mParams;
 	LLPath *mPathp;
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index 9f790d03fe..984014f309 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -1283,30 +1283,38 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace*
 		return;
 	}
 
-	LLVertexBuffer* buffer = face->getVertexBuffer();
+	LLPointer<LLVertexBuffer> buffer = face->getVertexBuffer();
+	LLDrawable* drawable = face->getDrawable();
 
 	U32 data_mask = face->getRiggedVertexBufferDataMask();
 	
-	if (!buffer || 
+	if (buffer.isNull() || 
 		buffer->getTypeMask() != data_mask ||
-		buffer->getRequestedVerts() != vol_face.mNumVertices)
+		buffer->getRequestedVerts() != vol_face.mNumVertices ||
+		buffer->getRequestedIndices() != vol_face.mNumIndices ||
+		(drawable && drawable->isState(LLDrawable::REBUILD_ALL)))
 	{
 		face->setGeomIndex(0);
 		face->setIndicesIndex(0);
-		face->setSize(vol_face.mNumVertices, vol_face.mNumIndices, true);
-
-
-		if (sShaderLevel > 0)
-		{
-			buffer = new LLVertexBuffer(data_mask, GL_DYNAMIC_DRAW_ARB);
+		
+		if (buffer.isNull() || buffer->getTypeMask() != data_mask)
+		{ //make a new buffer
+			if (sShaderLevel > 0)
+			{
+				buffer = new LLVertexBuffer(data_mask, GL_DYNAMIC_DRAW_ARB);
+			}
+			else
+			{
+				buffer = new LLVertexBuffer(data_mask, GL_STREAM_DRAW_ARB);
+			}
+			buffer->allocateBuffer(vol_face.mNumVertices, vol_face.mNumIndices, true);
 		}
 		else
-		{
-			buffer = new LLVertexBuffer(data_mask, GL_STREAM_DRAW_ARB);
+		{ //resize existing buffer
+			buffer->resizeBuffer(vol_face.mNumVertices, vol_face.mNumIndices);
 		}
 
-		buffer->allocateBuffer(face->getGeomCount(), face->getIndicesCount(), true);
-
+		face->setSize(vol_face.mNumVertices, vol_face.mNumIndices);
 		face->setVertexBuffer(buffer);
 
 		U16 offset = 0;
@@ -1407,6 +1415,11 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace*
 			}
 		}
 	}
+
+	if (drawable && (face->getTEOffset() == drawable->getNumFaces()-1))
+	{
+		drawable->clearState(LLDrawable::REBUILD_ALL);
+	}
 }
 
 void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
@@ -1437,7 +1450,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
 		LLVolume* volume = vobj->getVolume();
 		S32 te = face->getTEOffset();
 
-		if (!volume || volume->getNumVolumeFaces() <= te)
+		if (!volume || volume->getNumVolumeFaces() <= te || !volume->isMeshAssetLoaded())
 		{
 			continue;
 		}
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 2b6b2a84e1..90a0d5da59 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -1701,6 +1701,7 @@ void LLMeshRepository::cacheOutgoingMesh(LLMeshUploadData& data, LLSD& header)
 		{
 			LLPointer<LLVolume> volume = new LLVolume(volume_params, LLVolumeLODGroup::getVolumeScaleFromDetail(i));
 			volume->copyVolumeFaces(data.mModel[i]);
+			volume->setMeshAssetLoaded(TRUE);
 		}
 	}
 
@@ -2154,11 +2155,6 @@ S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_para
 
 	if (volume)
 	{
-		if (volume->getNumVolumeFaces() == 0 && !volume->isTetrahedron())
-		{
-			volume->makeTetrahedron();
-		}
-
 		LLVolumeParams params = volume->getParams();
 
 		LLVolumeLODGroup* group = LLPrimitive::getVolumeManager()->getGroup(params);
@@ -2169,7 +2165,7 @@ S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_para
 			if (last_lod >= 0)
 			{
 				LLVolume* lod = group->refLOD(last_lod);
-				if (lod && !lod->isTetrahedron() && lod->getNumVolumeFaces() > 0)
+				if (lod && lod->isMeshAssetLoaded() && lod->getNumVolumeFaces() > 0)
 				{
 					group->derefLOD(lod);
 					return last_lod;
@@ -2181,7 +2177,7 @@ S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_para
 			for (S32 i = detail-1; i >= 0; --i)
 			{
 				LLVolume* lod = group->refLOD(i);
-				if (lod && !lod->isTetrahedron() && lod->getNumVolumeFaces() > 0)
+				if (lod && lod->isMeshAssetLoaded() && lod->getNumVolumeFaces() > 0)
 				{
 					group->derefLOD(lod);
 					return i;
@@ -2194,7 +2190,7 @@ S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_para
 			for (S32 i = detail+1; i < 4; ++i)
 			{
 				LLVolume* lod = group->refLOD(i);
-				if (lod && !lod->isTetrahedron() && lod->getNumVolumeFaces() > 0)
+				if (lod && lod->isMeshAssetLoaded() && lod->getNumVolumeFaces() > 0)
 				{
 					group->derefLOD(lod);
 					return i;
@@ -2445,7 +2441,6 @@ void LLMeshRepository::notifyMeshLoaded(const LLVolumeParams& mesh_params, LLVol
 		if (volume->getNumVolumeFaces() <= 0)
 		{
 			llwarns << "Mesh loading returned empty volume." << llendl;
-			volume->makeTetrahedron();
 		}
 		
 		{ //update system volume
@@ -2453,6 +2448,7 @@ void LLMeshRepository::notifyMeshLoaded(const LLVolumeParams& mesh_params, LLVol
 			if (sys_volume)
 			{
 				sys_volume->copyVolumeFaces(volume);
+				sys_volume->setMeshAssetLoaded(TRUE);
 				LLPrimitive::getVolumeManager()->unrefVolume(sys_volume);
 			}
 			else
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index cbfd64cffb..b097ebcc1d 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -367,6 +367,7 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
 		//
 		// Unpack texture entry data
 		//
+
 		S32 result = unpackTEMessage(mesgsys, _PREHASH_ObjectData, block_num);
 		if (result & teDirtyBits)
 		{
@@ -972,12 +973,8 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams &params_in, const S32 detail, bo
 		// if it's a mesh
 		if ((volume_params.getSculptType() & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH)
 		{ //meshes might not have all LODs, get the force detail to best existing LOD
-
 			LLUUID mesh_id = volume_params.getSculptID();
 
-			//profile and path params don't matter for meshes
-			volume_params.setType(LL_PCODE_PROFILE_SQUARE, LL_PCODE_PATH_LINE);
-
 			lod = gMeshRepo.getActualMeshLOD(volume_params, lod);
 			if (lod == -1)
 			{
@@ -1033,14 +1030,13 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams &params_in, const S32 detail, bo
 	
 		updateSculptTexture();
 
-
 		if (isSculpted())
 		{
 			updateSculptTexture();
 			// if it's a mesh
 			if ((volume_params.getSculptType() & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH)
 			{
-				if (getVolume()->getNumVolumeFaces() == 0 || getVolume()->isTetrahedron())
+				if (!getVolume()->isMeshAssetLoaded())
 				{ 
 					//load request not yet issued, request pipeline load this mesh
 					LLUUID asset_id = volume_params.getSculptID();
@@ -3150,7 +3146,7 @@ U32 LLVOVolume::getHighLODTriangleCount()
 	else if (isMesh())
 	{
 		LLVolume* ref = LLPrimitive::getVolumeManager()->refVolume(volume->getParams(), 3);
-		if (ref->isTetrahedron() || ref->getNumVolumeFaces() == 0)
+		if (!ref->isMeshAssetLoaded() || ref->getNumVolumeFaces() == 0)
 		{
 			gMeshRepo.loadMesh(this, volume->getParams(), LLModel::LOD_HIGH);
 		}
@@ -3992,7 +3988,8 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
 
 		LLVOVolume* vobj = drawablep->getVOVolume();
 
-		if (vobj->getVolume() && vobj->getVolume()->isTetrahedron() || (vobj->isMesh() && !gMeshRepo.meshRezEnabled()))
+		if (vobj->isMesh() &&
+			(vobj->getVolume() && !vobj->getVolume()->isMeshAssetLoaded() || !gMeshRepo.meshRezEnabled()))
 		{
 			continue;
 		}
-- 
cgit v1.2.3


From e0bf0e3e2150304e7b26c18c274273c18653965b Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 17 Aug 2011 14:59:22 -0500
Subject: SH-2217 Fix for large models not getting properly clampled by
 importer (odd that server seems to need 240m limit instead of 256m limit)

---
 indra/newview/llfloatermodelpreview.cpp | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 0ce8dcd46b..0c8fd33113 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -3173,11 +3173,6 @@ void LLModelPreview::rebuildUploadData()
 
 	LLSpinCtrl* scale_spinner = mFMP->getChild<LLSpinCtrl>("import_scale");
 
-	if (!scale_spinner)
-	{
-		llerrs << "floater_model_preview.xml MUST contain import_scale spinner." << llendl;
-	}
-
 	F32 scale = scale_spinner->getValue().asReal();
 
 	LLMatrix4 scale_mat;
@@ -3262,7 +3257,14 @@ void LLModelPreview::rebuildUploadData()
 		}
 	}
 
-	F32 max_import_scale = DEFAULT_MAX_PRIM_SCALE/max_scale;
+	F32 max_import_scale = (DEFAULT_MAX_PRIM_SCALE-0.1f)/max_scale;
+
+	F32 max_axis = llmax(mPreviewScale.mV[0], mPreviewScale.mV[1]);
+	max_axis = llmax(max_axis, mPreviewScale.mV[2]);
+	max_axis *= 2.f;
+
+	//clamp scale so that total imported model bounding box is smaller than 240m on a side
+	max_import_scale = llmin(max_import_scale, 240.f/max_axis);
 
 	scale_spinner->setMaxValue(max_import_scale);
 
-- 
cgit v1.2.3


From 94f3432871d8512d04447cec3345694bf04537c9 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Thu, 18 Aug 2011 11:22:55 -0400
Subject: Remove ShowAdvancedBuilderOptions, now always enabled

---
 indra/newview/app_settings/settings.xml | 11 -----------
 indra/newview/llfloatertools.cpp        | 22 ++++++++--------------
 2 files changed, 8 insertions(+), 25 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 01842d1037..48a35a3218 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -9481,17 +9481,6 @@
       <key>Value</key>
       <integer>0</integer>
     </map>
-    <key>ShowAdvancedBuilderOptions</key>
-    <map>
-      <key>Comment</key>
-      <string>Shows physics and display weight</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>0</integer>
-    </map>
     <key>ShowAdvancedGraphicsSettings</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index 157b66b0ac..48aeeafcfd 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -460,7 +460,6 @@ void LLFloaterTools::refresh()
 
 		std::ostringstream selection_info;
 
-		bool show_adv_weight = gSavedSettings.getBOOL("ShowAdvancedBuilderOptions");
 		bool show_mesh_cost = gMeshRepo.meshRezEnabled();
 
 		if (show_mesh_cost)
@@ -476,24 +475,19 @@ void LLFloaterTools::refresh()
 
 		selection_info << getString("status_selectcount", selection_args);
 
-		if (show_adv_weight)
-		{
-			selection_info << ",";
 
-			S32 render_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectRenderCost();
+		selection_info << ",";
+
+		S32 render_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectRenderCost();
+
+		childSetTextArg("selection_weight", "[PHYS_WEIGHT]", llformat("%.1f", link_phys_cost));
+		childSetTextArg("selection_weight", "[DISP_WEIGHT]", llformat("%.1d", render_cost));
 
-			childSetTextArg("selection_weight", "[PHYS_WEIGHT]", llformat("%.1f", link_phys_cost));
-			childSetTextArg("selection_weight", "[DISP_WEIGHT]", llformat("%.1d", render_cost));
-		}
-		else
-		{
-			selection_info<<".";
-		}
 		getChild<LLTextBox>("selection_count")->setText(selection_info.str());
 
 		bool have_selection = !LLSelectMgr::getInstance()->getSelection()->isEmpty();
 		childSetVisible("selection_count",  have_selection);
-		childSetVisible("selection_weight", have_selection && show_adv_weight);
+		childSetVisible("selection_weight", have_selection);
 		childSetVisible("selection_empty", !have_selection);
 	}
 
@@ -764,7 +758,7 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
 	bool have_selection = !LLSelectMgr::getInstance()->getSelection()->isEmpty();
 
 	getChildView("selection_count")->setVisible(!land_visible && have_selection);
-	getChildView("selection_weight")->setVisible(!land_visible && have_selection && gSavedSettings.getBOOL("ShowAdvancedBuilderOptions"));
+	getChildView("selection_weight")->setVisible(!land_visible && have_selection);
 	getChildView("selection_empty")->setVisible(!land_visible && !have_selection);
 	
 	mTab->setVisible(!land_visible);
-- 
cgit v1.2.3


From 1b36b0425119ce1e96eeeb87af7f150a206e62b0 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 18 Aug 2011 14:41:34 -0500
Subject: SH-1180 Log which nodes are problematic when loading a .dae with
 mirrored meshes and report error.

---
 indra/newview/llfloatermodelpreview.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 0c8fd33113..d55849d2fb 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -2705,6 +2705,12 @@ void LLModelLoader::processElement( daeElement* element, bool& badElement )
 				{
 					LLMatrix4 transformation = mTransform;
 
+					if (mTransform.determinant() < 0)
+					{ //negative scales are not supported
+						llinfos << "Negative scale detected, unsupported transform.  domInstance_geometry: " << LLModel::getElementLabel(instance_geo) << llendl;
+						badElement = true;
+					}
+					
 					std::map<std::string, LLImportMaterial> materials = getMaterials(model, instance_geo);
 
 					// adjust the transformation to compensate for mesh normalization
-- 
cgit v1.2.3


From cfe0a3cbe445900574b82e8c843bddc347f1b269 Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Thu, 18 Aug 2011 19:16:08 -0400
Subject: BUILDFIX SH-1246 fixed a bug in the ARC computations, and texture
 cost computations in build tools

Minor bug in ARC display computations, where wrong numbers were being used for child prims
Feature enhancement to not double-count textures reused within a linkset.
---
 indra/newview/llselectmgr.cpp | 62 ++++++++++++++++++++++++++++++++++++-------
 indra/newview/llvoavatar.cpp  |  3 ++-
 2 files changed, 55 insertions(+), 10 deletions(-)

diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 9c85817a28..1880bb87d3 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -6526,24 +6526,68 @@ S32 LLObjectSelection::getSelectedObjectRenderCost()
 {
        S32 cost = 0;
        LLVOVolume::texture_cost_t textures;
+       typedef std::set<LLUUID> uuid_list_t;
+       uuid_list_t computed_objects;
+
+	   typedef std::list<LLPointer<LLViewerObject> > child_list_t;
+	   typedef const child_list_t const_child_list_t;
+
+	   // add render cost of complete linksets first, to get accurate texture counts
        for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter)
        {
                LLSelectNode* node = *iter;
+			   
                LLVOVolume* object = (LLVOVolume*)node->getObject();
 
-               if (object)
-               {
-                       cost += object->getRenderCost(textures);
-               }
-
-               for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter)
+               if (object && object->isRootEdit())
                {
-                       // add the cost of each individual texture in the linkset
-                       cost += iter->second;
+				   cost += object->getRenderCost(textures);
+				   computed_objects.insert(object->getID());
+
+				   const_child_list_t children = object->getChildren();
+				   for (const_child_list_t::const_iterator child_iter = children.begin();
+						 child_iter != children.end();
+						 ++child_iter)
+				   {
+					   LLViewerObject* child_obj = *child_iter;
+					   LLVOVolume *child = dynamic_cast<LLVOVolume*>( child_obj );
+					   if (child)
+					   {
+						   cost += child->getRenderCost(textures);
+						   computed_objects.insert(child->getID());
+					   }
+				   }
+
+				   for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter)
+				   {
+					   // add the cost of each individual texture in the linkset
+					   cost += iter->second;
+				   }
+
+				   textures.clear();
                }
-               textures.clear();
        }
+	
+	   // add any partial linkset objects, texture cost may be slightly misleading
+		for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter)
+		{
+			LLSelectNode* node = *iter;
+			LLVOVolume* object = (LLVOVolume*)node->getObject();
 
+			if (object && computed_objects.find(object->getID()) == computed_objects.end()  )
+			{
+					cost += object->getRenderCost(textures);
+					computed_objects.insert(object->getID());
+			}
+
+			for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter)
+			{
+				// add the cost of each individual texture in the linkset
+				cost += iter->second;
+			}
+
+			textures.clear();
+		}
 
        return cost;
 }
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index c77c4f167b..2efc9060dd 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -8354,6 +8354,7 @@ void LLVOAvatar::idleUpdateRenderCost()
 		}
 	}
 
+
 	for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); 
 		 iter != mAttachmentPoints.end();
 		 ++iter)
@@ -8384,7 +8385,7 @@ void LLVOAvatar::idleUpdateRenderCost()
 							LLVOVolume *child = dynamic_cast<LLVOVolume*>( child_obj );
 							if (child)
 							{
-								cost += volume->getRenderCost(textures);
+								cost += child->getRenderCost(textures);
 							}
 						}
 
-- 
cgit v1.2.3


From ba79c8a3caaac0b37fc2eb9c54849e1ca2a121c2 Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Fri, 19 Aug 2011 18:49:17 +0300
Subject: SH-2285 FIXED Add localization capability to mesh uploader strings

- Added ability to translate "Preview" and "Normal" strings.
---
 indra/newview/skins/default/xui/en/strings.xml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 72b412efe2..23e0da7f7e 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -3633,5 +3633,7 @@ Try enclosing path to the editor with double quotes.
   <string name="Surface">Surface</string>
   <string name="Solid">Solid</string>
   <string name="Wrap">Wrap</string>
+  <string name="Preview">Preview</string>
+  <string name="Normal">Normal</string>
 
   </strings>
-- 
cgit v1.2.3


From a36e8dae40c53e5631cac8efc206d2355a3ff705 Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Fri, 19 Aug 2011 19:33:22 +0300
Subject: SH-2309 WIP Priority modifications to mesh uploader UI

- Swapped left and right sides of the floater
---
 .../skins/default/xui/en/floater_model_preview.xml | 312 ++++++++++++---------
 1 file changed, 174 insertions(+), 138 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index 7c6896becf..8f6058a824 100755
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -27,135 +27,6 @@
   <string name="tbd">TBD</string>
   
 
-  <text left="15" bottom="25" follows="top|left" height="15" name="name_label">
-    Name:
-  </text>
-  <line_editor bottom_delta="20" follows="top|left|right" height="19" max_length_bytes="64" 
-	     name="description_form" prevalidate_callback="ascii" width="290" />
-
-  <text bottom_delta="20" left="15" follows="left|top" height="15" name="model_category_label" text_color="White">
-    What does this model represent?
-  </text>
-  <combo_box top_pad="1" follows="left|top" height="23"
-	     name="model_category_combo"  width="200">
-    <combo_box.drop_down_button
-      label_color="White"/>
-    <combo_item name="Choose one" label="Choose One..." value="MUT_Unspecified"/>
-    <combo_item name="Avatar shape" label="Avatar shape" value="MUT_AvatarShape"/>
-    <combo_item name="Avatar attachment" label="Avatar attachment" value="MUT_AvatarAttachment"/>
-    <combo_item name="Building Component" label="Building Component" value="MUT_BuildingComponent"/>
-    <combo_item name="Moving object (vehicle, animal)" label="Moving object (vehicle, animal)" value="MUT_MovingObject"/>
-    <combo_item name="Large, non moving etc" label="Large, non moving etc" value="MUT_LargeStationary"/>
-    <combo_item name="Smaller, non-moving etc" label="Smaller, non-moving etc" value="MUT_SmallStationary"/>
-    <combo_item name="Not really any of these" label="Not really any of these" value="MUT_Other"/>
-  </combo_box>
-  
-  <text bottom_delta="20" left="15" follows="left|top" height="15" name="lod_label">
-    Preview:
-  </text>
-  <combo_box bottom_delta="20" follows="left|top" height="18"
-	     name="preview_lod_combo" width="240" tool_tip="LOD to view in preview render">
-    <combo_item name="high">
-      Level of Detail: High
-    </combo_item>
-    <combo_item name="medium">
-      Level of Detail: Medium
-    </combo_item>
-    <combo_item name="low">
-      Level of Detail: Low
-    </combo_item>
-    <combo_item name="lowest">
-      Level of Detail: Lowest
-    </combo_item>
-  </combo_box>
-
-    <menu_button follows="top|left" 
-         image_hover_unselected="Toolbar_Left_Over"
-         image_overlay="OptionsMenu_Off"
-         image_selected="Toolbar_Left_Selected"
-         image_unselected="Toolbar_Left_Off"
-         layout="topleft"
-         left_pad="5"
-         name="options_gear_btn"
-         width="31"
-         height="25"/>
-  <!-- Placeholder panel for 3D preview render -->
-  <panel
-    name="preview_panel"
-    left="15"
-    bevel_style="none"
-    border_style="line"
-    border="true"
-    width="290"
-    height="290"
-    follows="all"/>
-    
-    <text
-     font="SansSerif"
-	 bottom_delta="15"
-     left_delta="0"
-     name="warning_title"
-     text_color="Yellow"
-     visible="false">
-     WARNING:
-    </text>
-    <text
-     text_color="White"
-     height="40"
-	 width="290"
-	 top_delta="15"
-     left_delta="0"
-     name="warning_message"
-     parse_urls="true"
-     wrap="true"
-     visible="false">
-     You will not be able to complete the final upload of this model to the Second Life servers. [[VURL] Find out how] to get enabled for mesh model uploads.</text>
-
-  <text
-	height="26"
-	top_pad="5"
-	left_delta="0"
-	name="weights_text_left"
-	width="80"
-	word_wrap="true" 
-	>
-Download:
-Physics:
-  </text>
-  <text
-	height="26"
-	top_delta="0"
-	left_pad="0"
-	name="weights_left"
-	width="70"
-	word_wrap="true" 
-	>
-[ST]
-[PH]
-  </text>
-  <text
-	height="26"
-	top_delta="0"
-	left_pad="0"
-	name="weights_text_right"
-	width="80"
-	word_wrap="true" 
-	>
-Server:
-Prim equivs:
-  </text>
-  <text
-	height="26"
-	top_delta="0"
-	left_pad="0"
-	name="weights_right"
-	width="70"
-	word_wrap="true" 
-	>
-[SIM]
-[EQ]
-  </text>
-
 <!--
   <text
 	height="65"
@@ -188,10 +59,18 @@ L$ [MODEL]
   </text>
     -->
 
+<panel
+ follows="all"
+ height="515"
+ layout="topleft"
+ left="3"
+ name="left_panel"
+ top="0"
+ width="305">
   <tab_container
-    follows="right|top|bottom"
+    follows="all"
     top="15"
-    left="310"
+    left="0"
     height="470"
     width="300"
     name="import_tab"
@@ -551,14 +430,171 @@ L$ [MODEL]
 	>
 	    Upload fee: L$ [FEE]
   </text>
+  </panel>
+
+<panel
+ follows="all"
+ height="515"
+ layout="topleft"
+ left_pad="1"
+ name="right_panel"
+ top="0"
+ width="310">
+
+  <text left="15" bottom="25" follows="top|left" height="15" name="name_label">
+    Name:
+  </text>
+  <line_editor bottom_delta="20" follows="top|left|right" height="19" max_length_bytes="64"
+	     name="description_form" prevalidate_callback="ascii" width="290" />
+
+  <text bottom_delta="20" left="15" follows="left|top" height="15" name="model_category_label" text_color="White">
+    What does this model represent?
+  </text>
+  <combo_box top_pad="1" follows="left|top" height="23"
+	     name="model_category_combo"  width="200">
+    <combo_box.drop_down_button
+      label_color="White"/>
+    <combo_item name="Choose one" label="Choose One..." value="MUT_Unspecified"/>
+    <combo_item name="Avatar shape" label="Avatar shape" value="MUT_AvatarShape"/>
+    <combo_item name="Avatar attachment" label="Avatar attachment" value="MUT_AvatarAttachment"/>
+    <combo_item name="Building Component" label="Building Component" value="MUT_BuildingComponent"/>
+    <combo_item name="Moving object (vehicle, animal)" label="Moving object (vehicle, animal)" value="MUT_MovingObject"/>
+    <combo_item name="Large, non moving etc" label="Large, non moving etc" value="MUT_LargeStationary"/>
+    <combo_item name="Smaller, non-moving etc" label="Smaller, non-moving etc" value="MUT_SmallStationary"/>
+    <combo_item name="Not really any of these" label="Not really any of these" value="MUT_Other"/>
+  </combo_box>
+  
+  <text bottom_delta="20" left="15" follows="left|top" height="15" name="lod_label">
+    Preview:
+  </text>
+  <combo_box bottom_delta="20" follows="left|top" height="18"
+	     name="preview_lod_combo" width="240" tool_tip="LOD to view in preview render">
+    <combo_item name="high">
+      Level of Detail: High
+    </combo_item>
+    <combo_item name="medium">
+      Level of Detail: Medium
+    </combo_item>
+    <combo_item name="low">
+      Level of Detail: Low
+    </combo_item>
+    <combo_item name="lowest">
+      Level of Detail: Lowest
+    </combo_item>
+  </combo_box>
+
+    <menu_button follows="top|left"
+         image_hover_unselected="Toolbar_Left_Over"
+         image_overlay="OptionsMenu_Off"
+         image_selected="Toolbar_Left_Selected"
+         image_unselected="Toolbar_Left_Off"
+         layout="topleft"
+         left_pad="5"
+         name="options_gear_btn"
+         width="31"
+         height="25"/>
+  <!-- Placeholder panel for 3D preview render -->
+  <!--<panel
+    name="preview_panel"
+    left="15"
+    bevel_style="none"
+    border_style="line"
+    border="true"
+    width="290"
+    height="290"
+    follows="all"/>-->
+
+    <text
+     font="SansSerif"
+	 bottom_delta="305"
+     left="15"
+     name="warning_title"
+     text_color="Yellow"
+     visible="true">
+     WARNING:
+    </text>
+    <text
+     text_color="White"
+     height="40"
+	 width="290"
+	 top_delta="15"
+     left_delta="0"
+     name="warning_message"
+     parse_urls="true"
+     wrap="true"
+     visible="true">
+     You will not be able to complete the final upload of this model to the Second Life servers. [[VURL] Find out how] to get enabled for mesh model uploads.</text>
+
+  <text
+	height="26"
+	top_pad="5"
+	left_delta="0"
+	name="weights_text_left"
+	width="80"
+	word_wrap="true"
+	>
+Download:
+Physics:
+  </text>
+  <text
+	height="26"
+	top_delta="0"
+	left_pad="0"
+	name="weights_left"
+	width="70"
+	word_wrap="true"
+	>
+[ST]
+[PH]
+  </text>
+  <text
+	height="26"
+	top_delta="0"
+	left_pad="0"
+	name="weights_text_right"
+	width="80"
+	word_wrap="true"
+	>
+Server:
+Prim equivs:
+  </text>
+  <text
+	height="26"
+	top_delta="0"
+	left_pad="0"
+	name="weights_right"
+	width="70"
+	word_wrap="true" 
+	>
+[SIM]
+[EQ]
+  </text>
+</panel>
+
+<panel
+ follows="bottom|left|right"
+ height="33"
+ layout="topleft"
+ left="0"
+ name="bottom_buttons_panel"
+ top_pad="1"
+ width="610">   
+  <button top="3" left="10"  follows="bottom|left" height="20" label="Set to defaults" width="100" name="reset_btn" tool_tip="Set to defaults"/>
+  <button top="3" left="310"  follows="bottom|right" height="20" label="Calculate weights &amp; fee" width="150" name="calculate_btn" tool_tip="Calculate weights &amp; fee"/>
+  <button top="3" left_delta="0"  follows="bottom|right" height="20" label="Upload" width="80" name="ok_btn" tool_tip="Upload to simulator" visible="false"/>
+  <button top="3" right="-10" follows="right|bottom" height="20" width="80" label="Cancel" name="cancel_btn"/>
+</panel>
   
-  <button bottom="540" left="10"  follows="bottom|left" height="20" label="Set to defaults"
-	     width="100" name="reset_btn" tool_tip="Set to defaults"/>
-  <button left="310"  follows="bottom|right" height="20" label="Calculate weights &amp; fee"
-	     width="150" name="calculate_btn" tool_tip="Calculate weights &amp; fee" top_delta="0"/>
-  <button bottom="540" left="310"  follows="bottom|right" height="20" label="Upload"
-	     width="80" name="ok_btn" tool_tip="Upload to simulator" visible="false"/>
-  <button right="-10" follows="right|bottom" height="20" width="80" label="Cancel" name="cancel_btn" top_delta="0"/>
+<panel
+ name="preview_panel"
+ left="320"
+ top="131"
+ bevel_style="none"
+ border_style="line"
+ border="true"
+ width="290"
+ height="290"
+ follows="all"/>  
   
   <!--
   <button bottom_delta="0" left="10" width="120" name="auto fill" label="Generate LOD" tool_tip="Automatically generate levels of detail"/>
-- 
cgit v1.2.3


From bc400605cab6f353ab4b952a1056c6c22784d4d9 Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Fri, 19 Aug 2011 16:57:56 -0400
Subject: FIX SH-862 SH-1246 SH-1565 SH-1566 Update render cost algorithm

render cost algorithm triangle count is now scaled to be more balanced vs
texture/particle count. In addition added factors for light-emitting and
media texture primitives. Algorithm should be near "final" at this point.
---
 indra/newview/llvovolume.cpp | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 959bce63b1..5c1694078c 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -2981,6 +2981,9 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 	static const U32 ARC_PARTICLE_COST = 1; // determined experimentally
 	static const U32 ARC_PARTICLE_MAX = 2048; // default values
 	static const U32 ARC_TEXTURE_COST = 16; // multiplier for texture resolution - performance tested
+	static const U32 ARC_LIGHT_COST = 500; // static cost for light-producing prims 
+	static const U32 ARC_MEDIA_FACE_COST = 1500; // static cost per media-enabled face 
+
 
 	// per-prim multipliers
 	static const F32 ARC_GLOW_MULT = 1.5f; // tested based on performance
@@ -3006,6 +3009,8 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 	U32 bump = 0;
 	U32 planar = 0;
 	U32 weighted_mesh = 0;
+	U32 produces_light = 0;
+	U32 media_faces = 0;
 
 	// these multipliers are variable and can be floating point
 	F32 scale = 0.f;
@@ -3024,7 +3029,8 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 
 		if (weighted_triangles > 0.0)
 		{
-			num_triangles = (U32)weighted_triangles;
+			num_triangles = (U32)(weighted_triangles * 2); // scale weighted triangles to match the recorded scale.
+															// a complex prim (tortured torus, sculptie) should be 1000-1200 points @ 5 m
 		}
 	}
 
@@ -3080,6 +3086,11 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 		particles = 1;
 	}
 
+	if (getIsLight())
+	{
+		produces_light = 1;
+	}
+
 	const LLVector3& sc = getScale();
 	scale += (sc.mV[0] + sc.mV[1] + sc.mV[2]) / 4.f; // scale to 1/4 the sum of the size
 	// enforce scale multiplier to be in the range [1,7] (7 was determined to experimentally be a reasonable max)
@@ -3109,6 +3120,10 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 		{
 			invisi = 1;
 		}
+		if (face->hasMedia())
+		{
+			media_faces++;
+		}
 
 		if (te)
 		{
@@ -3205,6 +3220,16 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 		shame += num_particles * part_size * ARC_PARTICLE_COST;
 	}
 
+	if (produces_light)
+	{
+		shame += ARC_LIGHT_COST;
+	}
+
+	if (media_faces)
+	{
+		shame += media_faces * ARC_MEDIA_FACE_COST;
+	}
+
 	if (shame > mRenderComplexity_current)
 	{
 		mRenderComplexity_current = (S32)shame;
-- 
cgit v1.2.3


From e64b9269cb385a22c83d1c912e336aed11e40efe Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Fri, 19 Aug 2011 18:56:58 -0400
Subject: BUILDFIX fixing unix line endings on two files to pass policy checks.

---
 indra/newview/llvoavatar.h   |  2200 ++++-----
 indra/newview/llvovolume.cpp | 10124 ++++++++++++++++++++---------------------
 2 files changed, 6162 insertions(+), 6162 deletions(-)

diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 6f14b42513..e53b8e3f4b 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -1,1100 +1,1100 @@
-/**
- * @file llvoavatar.h
- * @brief Declaration of LLVOAvatar class which is a derivation of
- * LLViewerObject
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLVOAVATAR_H
-#define LL_LLVOAVATAR_H
-
-#include <map>
-#include <deque>
-#include <string>
-#include <vector>
-
-#include <boost/signals2.hpp>
-
-#include "imageids.h"			// IMG_INVISIBLE
-#include "llchat.h"
-#include "lldrawpoolalpha.h"
-#include "llviewerobject.h"
-#include "llcharacter.h"
-#include "llviewerjointmesh.h"
-#include "llviewerjointattachment.h"
-#include "llrendertarget.h"
-#include "llvoavatardefines.h"
-#include "lltexglobalcolor.h"
-#include "lldriverparam.h"
-#include "material_codes.h"		// LL_MCODE_END
-
-extern const LLUUID ANIM_AGENT_BODY_NOISE;
-extern const LLUUID ANIM_AGENT_BREATHE_ROT;
-extern const LLUUID ANIM_AGENT_PHYSICS_MOTION;
-extern const LLUUID ANIM_AGENT_EDITING;
-extern const LLUUID ANIM_AGENT_EYE;
-extern const LLUUID ANIM_AGENT_FLY_ADJUST;
-extern const LLUUID ANIM_AGENT_HAND_MOTION;
-extern const LLUUID ANIM_AGENT_HEAD_ROT;
-extern const LLUUID ANIM_AGENT_PELVIS_FIX;
-extern const LLUUID ANIM_AGENT_TARGET;
-extern const LLUUID ANIM_AGENT_WALK_ADJUST;
-
-class LLTexLayerSet;
-class LLVoiceVisualizer;
-class LLHUDNameTag;
-class LLHUDEffectSpiral;
-class LLTexGlobalColor;
-class LLVOAvatarBoneInfo;
-class LLVOAvatarSkeletonInfo;
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// LLVOAvatar
-// 
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-class LLVOAvatar :
-	public LLViewerObject,
-	public LLCharacter,
-	public boost::signals2::trackable
-{
-public:
-	friend class LLVOAvatarSelf;
-protected:
-	struct LLVOAvatarXmlInfo;
-	struct LLMaskedMorph;
-
-/********************************************************************************
- **                                                                            **
- **                    INITIALIZATION
- **/
-
-public:
-	LLVOAvatar(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
-	virtual void		markDead();
-	static void			initClass(); // Initialize data that's only init'd once per class.
-	static void			cleanupClass();	// Cleanup data that's only init'd once per class.
-	virtual void 		initInstance(); // Called after construction to initialize the class.
-protected:
-	virtual				~LLVOAvatar();
-	BOOL				loadSkeletonNode();
-	BOOL				loadMeshNodes();
-	virtual BOOL		loadLayersets();
-
-/**                    Initialization
- **                                                                            **
- *******************************************************************************/
-
-/********************************************************************************
- **                                                                            **
- **                    INHERITED
- **/
-
-	//--------------------------------------------------------------------
-	// LLViewerObject interface and related
-	//--------------------------------------------------------------------
-public:
-	virtual void			updateGL();
-	virtual	LLVOAvatar*		asAvatar();
-	virtual U32    	 	 	processUpdateMessage(LLMessageSystem *mesgsys,
-													 void **user_data,
-													 U32 block_num,
-													 const EObjectUpdateType update_type,
-													 LLDataPacker *dp);
-	virtual BOOL   	 	 	idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time);
-	virtual BOOL   	 	 	updateLOD();
-	BOOL  	 	 	 	 	updateJointLODs();
-	void					updateLODRiggedAttachments( void );
-	virtual BOOL   	 	 	isActive() const; // Whether this object needs to do an idleUpdate.
-	virtual void   	 	 	updateTextures();
-	virtual S32    	 	 	setTETexture(const U8 te, const LLUUID& uuid); // If setting a baked texture, need to request it from a non-local sim.
-	virtual void   	 	 	onShift(const LLVector4a& shift_vector);
-	virtual U32    	 	 	getPartitionType() const;
-	virtual const  	 	 	LLVector3 getRenderPosition() const;
-	virtual void   	 	 	updateDrawable(BOOL force_damped);
-	virtual LLDrawable* 	createDrawable(LLPipeline *pipeline);
-	virtual BOOL   	 	 	updateGeometry(LLDrawable *drawable);
-	virtual void   	 	 	setPixelAreaAndAngle(LLAgent &agent);
-	virtual void   	 	 	updateRegion(LLViewerRegion *regionp);
-	virtual void   	 	 	updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax);
-	virtual void   	 	 	getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax);
-	virtual BOOL   	 	 	lineSegmentIntersect(const LLVector3& start, const LLVector3& end,
-												 S32 face = -1,                    // which face to check, -1 = ALL_SIDES
-												 BOOL pick_transparent = FALSE,
-												 S32* face_hit = NULL,             // which face was hit
-												 LLVector3* intersection = NULL,   // return the intersection point
-												 LLVector2* tex_coord = NULL,      // return the texture coordinates of the intersection point
-												 LLVector3* normal = NULL,         // return the surface normal at the intersection point
-												 LLVector3* bi_normal = NULL);     // return the surface bi-normal at the intersection point
-	LLViewerObject*	lineSegmentIntersectRiggedAttachments(const LLVector3& start, const LLVector3& end,
-												 S32 face = -1,                    // which face to check, -1 = ALL_SIDES
-												 BOOL pick_transparent = FALSE,
-												 S32* face_hit = NULL,             // which face was hit
-												 LLVector3* intersection = NULL,   // return the intersection point
-												 LLVector2* tex_coord = NULL,      // return the texture coordinates of the intersection point
-												 LLVector3* normal = NULL,         // return the surface normal at the intersection point
-												 LLVector3* bi_normal = NULL);     // return the surface bi-normal at the intersection point
-
-	//--------------------------------------------------------------------
-	// LLCharacter interface and related
-	//--------------------------------------------------------------------
-public:
-	virtual LLVector3    	getCharacterPosition();
-	virtual LLQuaternion 	getCharacterRotation();
-	virtual LLVector3    	getCharacterVelocity();
-	virtual LLVector3    	getCharacterAngularVelocity();
-	virtual LLJoint*		getCharacterJoint(U32 num);
-	virtual BOOL			allocateCharacterJoints(U32 num);
-
-	virtual LLUUID			remapMotionID(const LLUUID& id);
-	virtual BOOL			startMotion(const LLUUID& id, F32 time_offset = 0.f);
-	virtual BOOL			stopMotion(const LLUUID& id, BOOL stop_immediate = FALSE);
-	virtual void			stopMotionFromSource(const LLUUID& source_id);
-	virtual void			requestStopMotion(LLMotion* motion);
-	LLMotion*				findMotion(const LLUUID& id) const;
-	void					startDefaultMotions();
-	void					dumpAnimationState();
-
-	virtual LLJoint*		getJoint(const std::string &name);
-	virtual LLJoint*     	getRootJoint() { return &mRoot; }
-	
-	void					resetJointPositions( void );
-	void					resetJointPositionsToDefault( void );
-	void					resetSpecificJointPosition( const std::string& name );
-	
-	virtual const char*		getAnimationPrefix() { return "avatar"; }
-	virtual const LLUUID&   getID();
-	virtual LLVector3		getVolumePos(S32 joint_index, LLVector3& volume_offset);
-	virtual LLJoint*		findCollisionVolume(U32 volume_id);
-	virtual S32				getCollisionVolumeID(std::string &name);
-	virtual void			addDebugText(const std::string& text);
-	virtual F32          	getTimeDilation();
-	virtual void			getGround(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm);
-	virtual F32				getPixelArea() const;
-	virtual LLPolyMesh*		getHeadMesh();
-	virtual LLPolyMesh*		getUpperBodyMesh();
-	virtual LLVector3d		getPosGlobalFromAgent(const LLVector3 &position);
-	virtual LLVector3		getPosAgentFromGlobal(const LLVector3d &position);
-	virtual void			updateVisualParams();
-
-
-/**                    Inherited
- **                                                                            **
- *******************************************************************************/
-
-/********************************************************************************
- **                                                                            **
- **                    STATE
- **/
-
-public:
-	virtual bool 	isSelf() const { return false; } // True if this avatar is for this viewer's agent
-	bool isBuilt() const { return mIsBuilt; }
-
-private: //aligned members
-	LLVector4a	mImpostorExtents[2];
-
-private:
-	BOOL			mSupportsAlphaLayers; // For backwards compatibility, TRUE for 1.23+ clients
-
-	//--------------------------------------------------------------------
-	// Updates
-	//--------------------------------------------------------------------
-public:
-	virtual BOOL 	updateCharacter(LLAgent &agent);
-	void 			idleUpdateVoiceVisualizer(bool voice_enabled);
-	void 			idleUpdateMisc(bool detailed_update);
-	virtual void	idleUpdateAppearanceAnimation();
-	void 			idleUpdateLipSync(bool voice_enabled);
-	void 			idleUpdateLoadingEffect();
-	void 			idleUpdateWindEffect();
-	void 			idleUpdateNameTag(const LLVector3& root_pos_last);
-	void			idleUpdateNameTagText(BOOL new_name);
-	LLVector3		idleUpdateNameTagPosition(const LLVector3& root_pos_last);
-	void			idleUpdateNameTagAlpha(BOOL new_name, F32 alpha);
-	LLColor4		getNameTagColor(bool is_friend);
-	void			clearNameTag();
-	static void		invalidateNameTag(const LLUUID& agent_id);
-	// force all name tags to rebuild, useful when display names turned on/off
-	static void		invalidateNameTags();
-	void			addNameTagLine(const std::string& line, const LLColor4& color, S32 style, const LLFontGL* font);
-	void 			idleUpdateRenderCost();
-	void 			idleUpdateBelowWater();
-
-	//--------------------------------------------------------------------
-	// Static preferences (controlled by user settings/menus)
-	//--------------------------------------------------------------------
-public:
-	static S32		sRenderName;
-	static BOOL		sRenderGroupTitles;
-	static U32		sMaxVisible; //(affected by control "RenderAvatarMaxVisible")
-	static F32		sRenderDistance; //distance at which avatars will render.
-	static BOOL		sShowAnimationDebug; // show animation debug info
-	static BOOL		sUseImpostors; //use impostors for far away avatars
-	static BOOL		sShowFootPlane;	// show foot collision plane reported by server
-	static BOOL		sShowCollisionVolumes;	// show skeletal collision volumes
-	static BOOL		sVisibleInFirstPerson;
-	static S32		sNumLODChangesThisFrame;
-	static S32		sNumVisibleChatBubbles;
-	static BOOL		sDebugInvisible;
-	static BOOL		sShowAttachmentPoints;
-	static F32		sLODFactor; // user-settable LOD factor
-	static F32		sPhysicsLODFactor; // user-settable physics LOD factor
-	static BOOL		sJointDebug; // output total number of joints being touched for each avatar
-	static BOOL		sDebugAvatarRotation;
-
-	//--------------------------------------------------------------------
-	// Region state
-	//--------------------------------------------------------------------
-public:
-	LLHost			getObjectHost() const;
-
-	//--------------------------------------------------------------------
-	// Loading state
-	//--------------------------------------------------------------------
-public:
-	BOOL			isFullyLoaded() const;
-	bool			isTooComplex() const;
-	bool visualParamWeightsAreDefault();
-protected:
-	virtual BOOL	getIsCloud();
-	BOOL			updateIsFullyLoaded();
-	BOOL			processFullyLoadedChange(bool loading);
-	void			updateRuthTimer(bool loading);
-	F32 			calcMorphAmount();
-private:
-	BOOL			mFullyLoaded;
-	BOOL			mPreviousFullyLoaded;
-	BOOL			mFullyLoadedInitialized;
-	S32				mFullyLoadedFrameCounter;
-	S32				mVisualComplexity;
-	LLFrameTimer	mFullyLoadedTimer;
-	LLFrameTimer	mRuthTimer;
-protected:
-	LLFrameTimer    mInvisibleTimer;
-	
-/**                    State
- **                                                                            **
- *******************************************************************************/
-
-/********************************************************************************
- **                                                                            **
- **                    SKELETON
- **/
-
-public:
-	void				updateHeadOffset();
-	F32					getPelvisToFoot() const { return mPelvisToFoot; }
-	void				setPelvisOffset( bool hasOffset, const LLVector3& translation, F32 offset ) ;
-	bool				hasPelvisOffset( void ) { return mHasPelvisOffset; }
-	void				postPelvisSetRecalc( void );
-	void				setPelvisOffset( F32 pelvixFixupAmount );
-
-	bool				mHasPelvisOffset;
-	LLVector3			mPelvisOffset;
-	F32					mLastPelvisToFoot;
-	F32					mPelvisFixup;
-	F32					mLastPelvisFixup;
-
-	LLVector3			mHeadOffset; // current head position
-	LLViewerJoint		mRoot;
-protected:
-	static BOOL			parseSkeletonFile(const std::string& filename);
-	void				buildCharacter();
-	virtual BOOL		loadAvatar();
-
-	BOOL				setupBone(const LLVOAvatarBoneInfo* info, LLViewerJoint* parent, S32 &current_volume_num, S32 &current_joint_num);
-	BOOL				buildSkeleton(const LLVOAvatarSkeletonInfo *info);
-private:
-	BOOL				mIsBuilt; // state of deferred character building
-	S32					mNumJoints;
-	LLViewerJoint*		mSkeleton;
-	
-	//--------------------------------------------------------------------
-	// Pelvis height adjustment members.
-	//--------------------------------------------------------------------
-public:
-	LLVector3			mBodySize;
-	S32					mLastSkeletonSerialNum;
-private:
-	F32					mPelvisToFoot;
-
-	//--------------------------------------------------------------------
-	// Cached pointers to well known joints
-	//--------------------------------------------------------------------
-public:
-	LLViewerJoint* 		mPelvisp;
-	LLViewerJoint* 		mTorsop;
-	LLViewerJoint* 		mChestp;
-	LLViewerJoint* 		mNeckp;
-	LLViewerJoint* 		mHeadp;
-	LLViewerJoint* 		mSkullp;
-	LLViewerJoint* 		mEyeLeftp;
-	LLViewerJoint* 		mEyeRightp;
-	LLViewerJoint* 		mHipLeftp;
-	LLViewerJoint* 		mHipRightp;
-	LLViewerJoint* 		mKneeLeftp;
-	LLViewerJoint* 		mKneeRightp;
-	LLViewerJoint* 		mAnkleLeftp;
-	LLViewerJoint* 		mAnkleRightp;
-	LLViewerJoint* 		mFootLeftp;
-	LLViewerJoint* 		mFootRightp;
-	LLViewerJoint* 		mWristLeftp;
-	LLViewerJoint* 		mWristRightp;
-
-	//--------------------------------------------------------------------
-	// XML parse tree
-	//--------------------------------------------------------------------
-private:
-	static LLXmlTree 	sXMLTree; // avatar config file
-	static LLXmlTree 	sSkeletonXMLTree; // avatar skeleton file
-
-/**                    Skeleton
- **                                                                            **
- *******************************************************************************/
-
-/********************************************************************************
- **                                                                            **
- **                    RENDERING
- **/
-
-public:
-	U32 		renderImpostor(LLColor4U color = LLColor4U(255,255,255,255), S32 diffuse_channel = 0);
-	U32 		renderRigid();
-	U32 		renderSkinned(EAvatarRenderPass pass);
-	F32			getLastSkinTime() { return mLastSkinTime; }
-	U32			renderSkinnedAttachments();
-	U32 		renderTransparent(BOOL first_pass);
-	void 		renderCollisionVolumes();
-	static void	deleteCachedImages(bool clearAll=true);
-	static void	destroyGL();
-	static void	restoreGL();
-	BOOL 		mIsDummy; // for special views
-	S32			mSpecialRenderMode; // special lighting
-private:
-	bool		shouldAlphaMask();
-
-	BOOL 		mNeedsSkin; // avatar has been animated and verts have not been updated
-	F32			mLastSkinTime; //value of gFrameTimeSeconds at last skin update
-
-	S32	 		mUpdatePeriod;
-	S32  		mNumInitFaces; //number of faces generated when creating the avatar drawable, does not inculde splitted faces due to long vertex buffer.
-
-	//--------------------------------------------------------------------
-	// Morph masks
-	//--------------------------------------------------------------------
-public:
-	BOOL 		morphMaskNeedsUpdate(LLVOAvatarDefines::EBakedTextureIndex index = LLVOAvatarDefines::BAKED_NUM_INDICES);
-	void 		addMaskedMorph(LLVOAvatarDefines::EBakedTextureIndex index, LLPolyMorphTarget* morph_target, BOOL invert, std::string layer);
-	void 		applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components, LLVOAvatarDefines::EBakedTextureIndex index = LLVOAvatarDefines::BAKED_NUM_INDICES);
-
-	//--------------------------------------------------------------------
-	// Visibility
-	//--------------------------------------------------------------------
-protected:
-	void 		updateVisibility();
-private:
-	U32	 		mVisibilityRank;
-	BOOL 		mVisible;
-	
-	//--------------------------------------------------------------------
-	// Shadowing
-	//--------------------------------------------------------------------
-public:
-	void 		updateShadowFaces();
-	LLDrawable*	mShadow;
-private:
-	LLFace* 	mShadow0Facep;
-	LLFace* 	mShadow1Facep;
-	LLPointer<LLViewerTexture> mShadowImagep;
-
-	//--------------------------------------------------------------------
-	// Impostors
-	//--------------------------------------------------------------------
-public:
-	BOOL 		isImpostor() const;
-	BOOL 	    needsImpostorUpdate() const;
-	const LLVector3& getImpostorOffset() const;
-	const LLVector2& getImpostorDim() const;
-	void 		getImpostorValues(LLVector4a* extents, LLVector3& angle, F32& distance) const;
-	void 		cacheImpostorValues();
-	void 		setImpostorDim(const LLVector2& dim);
-	static void	resetImpostors();
-	static void updateImpostors();
-	LLRenderTarget mImpostor;
-	BOOL		mNeedsImpostorUpdate;
-private:
-	LLVector3	mImpostorOffset;
-	LLVector2	mImpostorDim;
-	BOOL		mNeedsAnimUpdate;
-	LLVector3	mImpostorAngle;
-	F32			mImpostorDistance;
-	F32			mImpostorPixelArea;
-	LLVector3	mLastAnimExtents[2];  
-
-	//--------------------------------------------------------------------
-	// Wind rippling in clothes
-	//--------------------------------------------------------------------
-public:
-	LLVector4	mWindVec;
-	F32			mRipplePhase;
-	BOOL		mBelowWater;
-private:
-	F32			mWindFreq;
-	LLFrameTimer mRippleTimer;
-	F32			mRippleTimeLast;
-	LLVector3	mRippleAccel;
-	LLVector3	mLastVel;
-
-	//--------------------------------------------------------------------
-	// Culling
-	//--------------------------------------------------------------------
-public:
-	static void	cullAvatarsByPixelArea();
-	BOOL		isCulled() const { return mCulled; }
-private:
-	BOOL		mCulled;
-
-	//--------------------------------------------------------------------
-	// Freeze counter
-	//--------------------------------------------------------------------
-public:
-	static void updateFreezeCounter(S32 counter = 0);
-private:
-	static S32  sFreezeCounter;
-
-	//--------------------------------------------------------------------
-	// Constants
-	//--------------------------------------------------------------------
-public:
-	virtual LLViewerTexture::EBoostLevel 	getAvatarBoostLevel() const { return LLViewerTexture::BOOST_AVATAR; }
-	virtual LLViewerTexture::EBoostLevel 	getAvatarBakedBoostLevel() const { return LLViewerTexture::BOOST_AVATAR_BAKED; }
-	virtual S32 						getTexImageSize() const;
-	virtual S32 						getTexImageArea() const { return getTexImageSize()*getTexImageSize(); }
-
-/**                    Rendering
- **                                                                            **
- *******************************************************************************/
-
-/********************************************************************************
- **                                                                            **
- **                    TEXTURES
- **/
-
-	//--------------------------------------------------------------------
-	// Loading status
-	//--------------------------------------------------------------------
-public:
-	virtual BOOL    isTextureDefined(LLVOAvatarDefines::ETextureIndex type, U32 index = 0) const;
-	virtual BOOL	isTextureVisible(LLVOAvatarDefines::ETextureIndex type, U32 index = 0) const;
-	virtual BOOL	isTextureVisible(LLVOAvatarDefines::ETextureIndex type, LLWearable *wearable) const;
-
-protected:
-	BOOL			isFullyBaked();
-	static BOOL		areAllNearbyInstancesBaked(S32& grey_avatars);
-
-	//--------------------------------------------------------------------
-	// Baked textures
-	//--------------------------------------------------------------------
-public:
-	void			releaseComponentTextures(); // ! BACKWARDS COMPATIBILITY !
-protected:
-	static void		onBakedTextureMasksLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata);
-	static void		onInitialBakedTextureLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata);
-	static void		onBakedTextureLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata);
-	virtual void	removeMissingBakedTextures();
-	void			useBakedTexture(const LLUUID& id);
-
-	typedef std::deque<LLMaskedMorph *> 	morph_list_t;
-	struct BakedTextureData
-	{
-		LLUUID								mLastTextureIndex;
-		LLTexLayerSet* 						mTexLayerSet; // Only exists for self
-		bool								mIsLoaded;
-		bool								mIsUsed;
-		LLVOAvatarDefines::ETextureIndex 	mTextureIndex;
-		U32									mMaskTexName;
-		// Stores pointers to the joint meshes that this baked texture deals with
-		std::vector< LLViewerJointMesh * > 	mMeshes;  // std::vector<LLViewerJointMesh> mJoints[i]->mMeshParts
-		morph_list_t						mMaskedMorphs;
-	};
-	typedef std::vector<BakedTextureData> 	bakedtexturedata_vec_t;
-	bakedtexturedata_vec_t 					mBakedTextureDatas;
-	LLLoadedCallbackEntry::source_callback_list_t mCallbackTextureList ; 
-	BOOL mLoadedCallbacksPaused;
-	//--------------------------------------------------------------------
-	// Local Textures
-	//--------------------------------------------------------------------
-protected:
-	virtual void	setLocalTexture(LLVOAvatarDefines::ETextureIndex type, LLViewerTexture* tex, BOOL baked_version_exits, U32 index = 0);
-	virtual void	addLocalTextureStats(LLVOAvatarDefines::ETextureIndex type, LLViewerFetchedTexture* imagep, F32 texel_area_ratio, BOOL rendered, BOOL covered_by_baked, U32 index = 0);
-	// MULTI-WEARABLE: make self-only?
-	virtual void	setBakedReady(LLVOAvatarDefines::ETextureIndex type, BOOL baked_version_exists, U32 index = 0);
-
-	//--------------------------------------------------------------------
-	// Texture accessors
-	//--------------------------------------------------------------------
-private:
-	virtual	void				setImage(const U8 te, LLViewerTexture *imagep, const U32 index); 
-	virtual LLViewerTexture*	getImage(const U8 te, const U32 index) const;
-
-	virtual const LLTextureEntry* getTexEntry(const U8 te_num) const;
-	virtual void setTexEntry(const U8 index, const LLTextureEntry &te);
-
-	void checkTextureLoading() ;
-	//--------------------------------------------------------------------
-	// Layers
-	//--------------------------------------------------------------------
-protected:
-	void			deleteLayerSetCaches(bool clearAll = true);
-	void			addBakedTextureStats(LLViewerFetchedTexture* imagep, F32 pixel_area, F32 texel_area_ratio, S32 boost_level);
-
-	//--------------------------------------------------------------------
-	// Composites
-	//--------------------------------------------------------------------
-public:
-	virtual void	invalidateComposite(LLTexLayerSet* layerset, BOOL upload_result);
-	virtual void	invalidateAll();
-	virtual void	setCompositeUpdatesEnabled(bool b) {}
-	virtual void 	setCompositeUpdatesEnabled(U32 index, bool b) {}
-	virtual bool 	isCompositeUpdateEnabled(U32 index) { return false; }
-
-	//--------------------------------------------------------------------
-	// Static texture/mesh/baked dictionary
-	//--------------------------------------------------------------------
-public:
-	static BOOL 	isIndexLocalTexture(LLVOAvatarDefines::ETextureIndex i);
-	static BOOL 	isIndexBakedTexture(LLVOAvatarDefines::ETextureIndex i);
-private:
-	static const LLVOAvatarDefines::LLVOAvatarDictionary *getDictionary() { return sAvatarDictionary; }
-	static LLVOAvatarDefines::LLVOAvatarDictionary* sAvatarDictionary;
-	static LLVOAvatarSkeletonInfo* 					sAvatarSkeletonInfo;
-	static LLVOAvatarXmlInfo* 						sAvatarXmlInfo;
-
-	//--------------------------------------------------------------------
-	// Messaging
-	//--------------------------------------------------------------------
-public:
-	void 			onFirstTEMessageReceived();
-private:
-	BOOL			mFirstTEMessageReceived;
-	BOOL			mFirstAppearanceMessageReceived;
-	
-/**                    Textures
- **                                                                            **
- *******************************************************************************/
-
-/********************************************************************************
- **                                                                            **
- **                    MESHES
- **/
-
-public:
-	void 			updateMeshTextures();
-	void 			updateSexDependentLayerSets(BOOL upload_bake);
-	void 			dirtyMesh(); // Dirty the avatar mesh
-	void 			updateMeshData();
-protected:
-	void 			releaseMeshData();
-	virtual void restoreMeshData();
-private:
-	void 			dirtyMesh(S32 priority); // Dirty the avatar mesh, with priority
-	S32 			mDirtyMesh; // 0 -- not dirty, 1 -- morphed, 2 -- LOD
-	BOOL			mMeshTexturesDirty;
-
-	typedef std::multimap<std::string, LLPolyMesh*> polymesh_map_t;
-	polymesh_map_t 									mMeshes;
-	std::vector<LLViewerJoint *> 					mMeshLOD;
-
-	//--------------------------------------------------------------------
-	// Destroy invisible mesh
-	//--------------------------------------------------------------------
-protected:
-	BOOL			mMeshValid;
-	LLFrameTimer	mMeshInvisibleTime;
-
-/**                    Meshes
- **                                                                            **
- *******************************************************************************/
-
-/********************************************************************************
- **                                                                            **
- **                    APPEARANCE
- **/
-
-public:
-	void 			processAvatarAppearance(LLMessageSystem* mesgsys);
-	void 			hideSkirt();
-	void			startAppearanceAnimation();
-	
-	//--------------------------------------------------------------------
-	// Appearance morphing
-	//--------------------------------------------------------------------
-public:
-	BOOL			getIsAppearanceAnimating() const { return mAppearanceAnimating; }
-private:
-	BOOL			mAppearanceAnimating;
-	LLFrameTimer	mAppearanceMorphTimer;
-	F32				mLastAppearanceBlendTime;
-
-	//--------------------------------------------------------------------
-	// Clothing colors (convenience functions to access visual parameters)
-	//--------------------------------------------------------------------
-public:
-	void			setClothesColor(LLVOAvatarDefines::ETextureIndex te, const LLColor4& new_color, BOOL upload_bake);
-	LLColor4		getClothesColor(LLVOAvatarDefines::ETextureIndex te);
-	static BOOL			teToColorParams(LLVOAvatarDefines::ETextureIndex te, U32 *param_name);
-
-	//--------------------------------------------------------------------
-	// Global colors
-	//--------------------------------------------------------------------
-public:
-	LLColor4		getGlobalColor(const std::string& color_name ) const;
-	void			onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake);
-private:
-	LLTexGlobalColor* mTexSkinColor;
-	LLTexGlobalColor* mTexHairColor;
-	LLTexGlobalColor* mTexEyeColor;
-
-	//--------------------------------------------------------------------
-	// Visibility
-	//--------------------------------------------------------------------
-public:
-	BOOL			isVisible() const;
-	void			setVisibilityRank(U32 rank);
-	U32				getVisibilityRank()  const { return mVisibilityRank; } // unused
-	static S32 		sNumVisibleAvatars; // Number of instances of this class
-	static LLColor4 getDummyColor();
-/**                    Appearance
- **                                                                            **
- *******************************************************************************/
-
-/********************************************************************************
- **                                                                            **
- **                    WEARABLES
- **/
-
-public:
-	virtual BOOL			isWearingWearableType(LLWearableType::EType type ) const;
-	
-	//--------------------------------------------------------------------
-	// Attachments
-	//--------------------------------------------------------------------
-public:
-	void 				clampAttachmentPositions();
-	virtual const LLViewerJointAttachment* attachObject(LLViewerObject *viewer_object);
-	virtual BOOL 		detachObject(LLViewerObject *viewer_object);
-	void				cleanupAttachedMesh( LLViewerObject* pVO );
-	static LLVOAvatar*  findAvatarFromAttachment(LLViewerObject* obj);
-protected:
-	LLViewerJointAttachment* getTargetAttachmentPoint(LLViewerObject* viewer_object);
-	void 				lazyAttach();
-	void				rebuildRiggedAttachments( void );
-
-	//--------------------------------------------------------------------
-	// Map of attachment points, by ID
-	//--------------------------------------------------------------------
-public:
-	S32 				getAttachmentCount(); // Warning: order(N) not order(1) // currently used only by -self
-	typedef std::map<S32, LLViewerJointAttachment*> attachment_map_t;
-	attachment_map_t 								mAttachmentPoints;
-	std::vector<LLPointer<LLViewerObject> > 		mPendingAttachment;
-
-	//--------------------------------------------------------------------
-	// HUD functions
-	//--------------------------------------------------------------------
-public:
-	BOOL 				hasHUDAttachment() const;
-	LLBBox 				getHUDBBox() const;
-	void 				rebuildHUD();
-	void 				resetHUDAttachments();
-	BOOL				canAttachMoreObjects() const;
-	BOOL				canAttachMoreObjects(U32 n) const;
-protected:
-	U32					getNumAttachments() const; // O(N), not O(1)
-
-/**                    Wearables
- **                                                                            **
- *******************************************************************************/
-
-/********************************************************************************
- **                                                                            **
- **                    ACTIONS
- **/
-
-	//--------------------------------------------------------------------
-	// Animations
-	//--------------------------------------------------------------------
-public:
-	BOOL 			isAnyAnimationSignaled(const LLUUID *anim_array, const S32 num_anims) const;
-	void 			processAnimationStateChanges();
-protected:
-	BOOL 			processSingleAnimationStateChange(const LLUUID &anim_id, BOOL start);
-	void 			resetAnimations();
-private:
-	LLTimer			mAnimTimer;
-	F32				mTimeLast;	
-
-	//--------------------------------------------------------------------
-	// Animation state data
-	//--------------------------------------------------------------------
-public:
-	typedef std::map<LLUUID, S32>::iterator AnimIterator;
-	std::map<LLUUID, S32> 					mSignaledAnimations; // requested state of Animation name/value
-	std::map<LLUUID, S32> 					mPlayingAnimations; // current state of Animation name/value
-
-	typedef std::multimap<LLUUID, LLUUID> 	AnimationSourceMap;
-	typedef AnimationSourceMap::iterator 	AnimSourceIterator;
-	AnimationSourceMap 						mAnimationSources; // object ids that triggered anim ids
-
-	//--------------------------------------------------------------------
-	// Chat
-	//--------------------------------------------------------------------
-public:
-	void			addChat(const LLChat& chat);
-	void	   		clearChat();
-	void	   		startTyping() { mTyping = TRUE; mTypingTimer.reset(); }
-	void			stopTyping() { mTyping = FALSE; }
-private:
-	BOOL			mVisibleChat;
-
-	//--------------------------------------------------------------------
-	// Lip synch morphs
-	//--------------------------------------------------------------------
-private:
-	bool 		   	mLipSyncActive; // we're morphing for lip sync
-	LLVisualParam* 	mOohMorph; // cached pointers morphs for lip sync
-	LLVisualParam* 	mAahMorph; // cached pointers morphs for lip sync
-
-	//--------------------------------------------------------------------
-	// Flight
-	//--------------------------------------------------------------------
-public:
-	BOOL			mInAir;
-	LLFrameTimer	mTimeInAir;
-
-/**                    Actions
- **                                                                            **
- *******************************************************************************/
-
-/********************************************************************************
- **                                                                            **
- **                    PHYSICS
- **/
-
-private:
-	F32 		mSpeedAccum; // measures speed (for diagnostics mostly).
-	BOOL 		mTurning; // controls hysteresis on avatar rotation
-	F32			mSpeed; // misc. animation repeated state
-
-	//--------------------------------------------------------------------
-	// Collision volumes
-	//--------------------------------------------------------------------
-public:
-  	S32			mNumCollisionVolumes;
-	LLViewerJointCollisionVolume* mCollisionVolumes;
-protected:
-	BOOL		allocateCollisionVolumes(U32 num);
-
-	//--------------------------------------------------------------------
-	// Dimensions
-	//--------------------------------------------------------------------
-public:
-	void 		resolveHeightGlobal(const LLVector3d &inPos, LLVector3d &outPos, LLVector3 &outNorm);
-	bool		distanceToGround( const LLVector3d &startPoint, LLVector3d &collisionPoint, F32 distToIntersectionAlongRay );
-	void 		resolveHeightAgent(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm);
-	void 		resolveRayCollisionAgent(const LLVector3d start_pt, const LLVector3d end_pt, LLVector3d &out_pos, LLVector3 &out_norm);
-	void 		slamPosition(); // Slam position to transmitted position (for teleport);
-protected:
-	void 		computeBodySize();
-
-	//--------------------------------------------------------------------
-	// Material being stepped on
-	//--------------------------------------------------------------------
-private:
-	BOOL		mStepOnLand;
-	U8			mStepMaterial;
-	LLVector3	mStepObjectVelocity;
-
-/**                    Physics
- **                                                                            **
- *******************************************************************************/
-
-/********************************************************************************
- **                                                                            **
- **                    HIERARCHY
- **/
-
-public:
-	virtual BOOL 	setParent(LLViewerObject* parent);
-	virtual void 	addChild(LLViewerObject *childp);
-	virtual void 	removeChild(LLViewerObject *childp);
-
-	//--------------------------------------------------------------------
-	// Sitting
-	//--------------------------------------------------------------------
-public:
-	void			sitDown(BOOL bSitting);
-	BOOL			isSitting(){return mIsSitting;}
-	void 			sitOnObject(LLViewerObject *sit_object);
-	void 			getOffObject();
-private:
-	// set this property only with LLVOAvatar::sitDown method
-	BOOL 			mIsSitting;
-
-/**                    Hierarchy
- **                                                                            **
- *******************************************************************************/
-
-/********************************************************************************
- **                                                                            **
- **                    NAME
- **/
-
-public:
-	std::string		getFullname() const; // Returns "FirstName LastName"
-protected:
-	static void		getAnimLabels(LLDynamicArray<std::string>* labels);
-	static void		getAnimNames(LLDynamicArray<std::string>* names);	
-private:
-	std::string		mNameString;		// UTF-8 title + name + status
-	std::string  	mTitle;
-	bool	  		mNameAway;
-	bool	  		mNameBusy;
-	bool	  		mNameMute;
-	bool      		mNameAppearance;
-	bool			mNameFriend;
-	bool			mNameCloud;
-	F32				mNameAlpha;
-	BOOL      		mRenderGroupTitles;
-
-	//--------------------------------------------------------------------
-	// Display the name (then optionally fade it out)
-	//--------------------------------------------------------------------
-public:
-	LLFrameTimer	mChatTimer;
-	LLPointer<LLHUDNameTag> mNameText;
-private:
-	LLFrameTimer	mTimeVisible;
-	std::deque<LLChat> mChats;
-	BOOL			mTyping;
-	LLFrameTimer	mTypingTimer;
-
-/**                    Name
- **                                                                            **
- *******************************************************************************/
-
-/********************************************************************************
- **                                                                            **
- **                    SOUNDS
- **/
-
-	//--------------------------------------------------------------------
-	// Voice visualizer
-	//--------------------------------------------------------------------
-public:
-	// Responsible for detecting the user's voice signal (and when the
-	// user speaks, it puts a voice symbol over the avatar's head) and gesticulations
-	LLPointer<LLVoiceVisualizer>  mVoiceVisualizer;
-	int					mCurrentGesticulationLevel;
-
-	//--------------------------------------------------------------------
-	// Step sound
-	//--------------------------------------------------------------------
-protected:
-	const LLUUID& 		getStepSound() const;
-private:
-	// Global table of sound ids per material, and the ground
-	const static LLUUID	sStepSounds[LL_MCODE_END];
-	const static LLUUID	sStepSoundOnLand;
-
-	//--------------------------------------------------------------------
-	// Foot step state (for generating sounds)
-	//--------------------------------------------------------------------
-public:
-	void 				setFootPlane(const LLVector4 &plane) { mFootPlane = plane; }
-	LLVector4			mFootPlane;
-private:
-	BOOL				mWasOnGroundLeft;
-	BOOL				mWasOnGroundRight;
-
-/**                    Sounds
- **                                                                            **
- *******************************************************************************/
-
-/********************************************************************************
- **                                                                            **
- **                    DIAGNOSTICS
- **/
-	
-	//--------------------------------------------------------------------
-	// General
-	//--------------------------------------------------------------------
-public:
-	static void			dumpArchetypeXML(void*);
-	static void			dumpBakedStatus();
-	const std::string 	getBakedStatusForPrintout() const;
-	void				dumpAvatarTEs(const std::string& context) const;
-
-	static F32 			sUnbakedTime; // Total seconds with >=1 unbaked avatars
-	static F32 			sUnbakedUpdateTime; // Last time stats were updated (to prevent multiple updates per frame) 
-	static F32 			sGreyTime; // Total seconds with >=1 grey avatars	
-	static F32 			sGreyUpdateTime; // Last time stats were updated (to prevent multiple updates per frame) 
-protected:
-	S32					getUnbakedPixelAreaRank();
-	BOOL				mHasGrey;
-private:
-	F32					mMinPixelArea;
-	F32					mMaxPixelArea;
-	F32					mAdjustedPixelArea;
-	std::string  		mDebugText;
-
-
-	//--------------------------------------------------------------------
-	// Avatar Rez Metrics
-	//--------------------------------------------------------------------
-public:
-	F32				debugGetExistenceTimeElapsedF32() const { return mDebugExistenceTimer.getElapsedTimeF32(); }
-protected:
-	LLFrameTimer	mRuthDebugTimer; // For tracking how long it takes for av to rez
-	LLFrameTimer	mDebugExistenceTimer; // Debugging for how long the avatar has been in memory.
-
-/**                    Diagnostics
- **                                                                            **
- *******************************************************************************/
-
-/********************************************************************************
- **                                                                            **
- **                    SUPPORT CLASSES
- **/
-
-protected: // Shared with LLVOAvatarSelf
-
-	struct LLVOAvatarXmlInfo
-	{
-		LLVOAvatarXmlInfo();
-		~LLVOAvatarXmlInfo();
-
-		BOOL 	parseXmlSkeletonNode(LLXmlTreeNode* root);
-		BOOL 	parseXmlMeshNodes(LLXmlTreeNode* root);
-		BOOL 	parseXmlColorNodes(LLXmlTreeNode* root);
-		BOOL 	parseXmlLayerNodes(LLXmlTreeNode* root);
-		BOOL 	parseXmlDriverNodes(LLXmlTreeNode* root);
-		BOOL	parseXmlMorphNodes(LLXmlTreeNode* root);
-
-		struct LLVOAvatarMeshInfo
-		{
-			typedef std::pair<LLPolyMorphTargetInfo*,BOOL> morph_info_pair_t;
-			typedef std::vector<morph_info_pair_t> morph_info_list_t;
-
-			LLVOAvatarMeshInfo() : mLOD(0), mMinPixelArea(.1f) {}
-			~LLVOAvatarMeshInfo()
-			{
-				morph_info_list_t::iterator iter;
-				for (iter = mPolyMorphTargetInfoList.begin(); iter != mPolyMorphTargetInfoList.end(); iter++)
-				{
-					delete iter->first;
-				}
-				mPolyMorphTargetInfoList.clear();
-			}
-
-			std::string mType;
-			S32			mLOD;
-			std::string	mMeshFileName;
-			std::string	mReferenceMeshName;
-			F32			mMinPixelArea;
-			morph_info_list_t mPolyMorphTargetInfoList;
-		};
-		typedef std::vector<LLVOAvatarMeshInfo*> mesh_info_list_t;
-		mesh_info_list_t mMeshInfoList;
-
-		typedef std::vector<LLPolySkeletalDistortionInfo*> skeletal_distortion_info_list_t;
-		skeletal_distortion_info_list_t mSkeletalDistortionInfoList;
-	
-		struct LLVOAvatarAttachmentInfo
-		{
-			LLVOAvatarAttachmentInfo()
-				: mGroup(-1), mAttachmentID(-1), mPieMenuSlice(-1), mVisibleFirstPerson(FALSE),
-				  mIsHUDAttachment(FALSE), mHasPosition(FALSE), mHasRotation(FALSE) {}
-			std::string mName;
-			std::string mJointName;
-			LLVector3 mPosition;
-			LLVector3 mRotationEuler;
-			S32 mGroup;
-			S32 mAttachmentID;
-			S32 mPieMenuSlice;
-			BOOL mVisibleFirstPerson;
-			BOOL mIsHUDAttachment;
-			BOOL mHasPosition;
-			BOOL mHasRotation;
-		};
-		typedef std::vector<LLVOAvatarAttachmentInfo*> attachment_info_list_t;
-		attachment_info_list_t mAttachmentInfoList;
-	
-		LLTexGlobalColorInfo *mTexSkinColorInfo;
-		LLTexGlobalColorInfo *mTexHairColorInfo;
-		LLTexGlobalColorInfo *mTexEyeColorInfo;
-
-		typedef std::vector<LLTexLayerSetInfo*> layer_info_list_t;
-		layer_info_list_t mLayerInfoList;
-
-		typedef std::vector<LLDriverParamInfo*> driver_info_list_t;
-		driver_info_list_t mDriverInfoList;
-
-		struct LLVOAvatarMorphInfo
-		{
-			LLVOAvatarMorphInfo()
-				: mInvert(FALSE) {}
-			std::string mName;
-			std::string mRegion;
-			std::string mLayer;
-			BOOL mInvert;
-		};
-
-		typedef std::vector<LLVOAvatarMorphInfo*> morph_info_list_t;
-		morph_info_list_t	mMorphMaskInfoList;
-	};
-
-	struct LLMaskedMorph
-	{
-		LLMaskedMorph(LLPolyMorphTarget *morph_target, BOOL invert, std::string layer) :
-			mMorphTarget(morph_target), 
-			mInvert(invert),
-			mLayer(layer)
-		{
-			morph_target->addPendingMorphMask();
-		}
-	
-		LLPolyMorphTarget	*mMorphTarget;
-		BOOL				mInvert;
-		std::string			mLayer;
-	};
-
-/**                    Support classes
- **                                                                            **
- *******************************************************************************/
-
-}; // LLVOAvatar
-extern const F32 SELF_ADDITIONAL_PRI;
-extern const S32 MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL;
-
-#endif // LL_VO_AVATAR_H
+/**
+ * @file llvoavatar.h
+ * @brief Declaration of LLVOAvatar class which is a derivation of
+ * LLViewerObject
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLVOAVATAR_H
+#define LL_LLVOAVATAR_H
+
+#include <map>
+#include <deque>
+#include <string>
+#include <vector>
+
+#include <boost/signals2.hpp>
+
+#include "imageids.h"			// IMG_INVISIBLE
+#include "llchat.h"
+#include "lldrawpoolalpha.h"
+#include "llviewerobject.h"
+#include "llcharacter.h"
+#include "llviewerjointmesh.h"
+#include "llviewerjointattachment.h"
+#include "llrendertarget.h"
+#include "llvoavatardefines.h"
+#include "lltexglobalcolor.h"
+#include "lldriverparam.h"
+#include "material_codes.h"		// LL_MCODE_END
+
+extern const LLUUID ANIM_AGENT_BODY_NOISE;
+extern const LLUUID ANIM_AGENT_BREATHE_ROT;
+extern const LLUUID ANIM_AGENT_PHYSICS_MOTION;
+extern const LLUUID ANIM_AGENT_EDITING;
+extern const LLUUID ANIM_AGENT_EYE;
+extern const LLUUID ANIM_AGENT_FLY_ADJUST;
+extern const LLUUID ANIM_AGENT_HAND_MOTION;
+extern const LLUUID ANIM_AGENT_HEAD_ROT;
+extern const LLUUID ANIM_AGENT_PELVIS_FIX;
+extern const LLUUID ANIM_AGENT_TARGET;
+extern const LLUUID ANIM_AGENT_WALK_ADJUST;
+
+class LLTexLayerSet;
+class LLVoiceVisualizer;
+class LLHUDNameTag;
+class LLHUDEffectSpiral;
+class LLTexGlobalColor;
+class LLVOAvatarBoneInfo;
+class LLVOAvatarSkeletonInfo;
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// LLVOAvatar
+// 
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+class LLVOAvatar :
+	public LLViewerObject,
+	public LLCharacter,
+	public boost::signals2::trackable
+{
+public:
+	friend class LLVOAvatarSelf;
+protected:
+	struct LLVOAvatarXmlInfo;
+	struct LLMaskedMorph;
+
+/********************************************************************************
+ **                                                                            **
+ **                    INITIALIZATION
+ **/
+
+public:
+	LLVOAvatar(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
+	virtual void		markDead();
+	static void			initClass(); // Initialize data that's only init'd once per class.
+	static void			cleanupClass();	// Cleanup data that's only init'd once per class.
+	virtual void 		initInstance(); // Called after construction to initialize the class.
+protected:
+	virtual				~LLVOAvatar();
+	BOOL				loadSkeletonNode();
+	BOOL				loadMeshNodes();
+	virtual BOOL		loadLayersets();
+
+/**                    Initialization
+ **                                                                            **
+ *******************************************************************************/
+
+/********************************************************************************
+ **                                                                            **
+ **                    INHERITED
+ **/
+
+	//--------------------------------------------------------------------
+	// LLViewerObject interface and related
+	//--------------------------------------------------------------------
+public:
+	virtual void			updateGL();
+	virtual	LLVOAvatar*		asAvatar();
+	virtual U32    	 	 	processUpdateMessage(LLMessageSystem *mesgsys,
+													 void **user_data,
+													 U32 block_num,
+													 const EObjectUpdateType update_type,
+													 LLDataPacker *dp);
+	virtual BOOL   	 	 	idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time);
+	virtual BOOL   	 	 	updateLOD();
+	BOOL  	 	 	 	 	updateJointLODs();
+	void					updateLODRiggedAttachments( void );
+	virtual BOOL   	 	 	isActive() const; // Whether this object needs to do an idleUpdate.
+	virtual void   	 	 	updateTextures();
+	virtual S32    	 	 	setTETexture(const U8 te, const LLUUID& uuid); // If setting a baked texture, need to request it from a non-local sim.
+	virtual void   	 	 	onShift(const LLVector4a& shift_vector);
+	virtual U32    	 	 	getPartitionType() const;
+	virtual const  	 	 	LLVector3 getRenderPosition() const;
+	virtual void   	 	 	updateDrawable(BOOL force_damped);
+	virtual LLDrawable* 	createDrawable(LLPipeline *pipeline);
+	virtual BOOL   	 	 	updateGeometry(LLDrawable *drawable);
+	virtual void   	 	 	setPixelAreaAndAngle(LLAgent &agent);
+	virtual void   	 	 	updateRegion(LLViewerRegion *regionp);
+	virtual void   	 	 	updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax);
+	virtual void   	 	 	getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax);
+	virtual BOOL   	 	 	lineSegmentIntersect(const LLVector3& start, const LLVector3& end,
+												 S32 face = -1,                    // which face to check, -1 = ALL_SIDES
+												 BOOL pick_transparent = FALSE,
+												 S32* face_hit = NULL,             // which face was hit
+												 LLVector3* intersection = NULL,   // return the intersection point
+												 LLVector2* tex_coord = NULL,      // return the texture coordinates of the intersection point
+												 LLVector3* normal = NULL,         // return the surface normal at the intersection point
+												 LLVector3* bi_normal = NULL);     // return the surface bi-normal at the intersection point
+	LLViewerObject*	lineSegmentIntersectRiggedAttachments(const LLVector3& start, const LLVector3& end,
+												 S32 face = -1,                    // which face to check, -1 = ALL_SIDES
+												 BOOL pick_transparent = FALSE,
+												 S32* face_hit = NULL,             // which face was hit
+												 LLVector3* intersection = NULL,   // return the intersection point
+												 LLVector2* tex_coord = NULL,      // return the texture coordinates of the intersection point
+												 LLVector3* normal = NULL,         // return the surface normal at the intersection point
+												 LLVector3* bi_normal = NULL);     // return the surface bi-normal at the intersection point
+
+	//--------------------------------------------------------------------
+	// LLCharacter interface and related
+	//--------------------------------------------------------------------
+public:
+	virtual LLVector3    	getCharacterPosition();
+	virtual LLQuaternion 	getCharacterRotation();
+	virtual LLVector3    	getCharacterVelocity();
+	virtual LLVector3    	getCharacterAngularVelocity();
+	virtual LLJoint*		getCharacterJoint(U32 num);
+	virtual BOOL			allocateCharacterJoints(U32 num);
+
+	virtual LLUUID			remapMotionID(const LLUUID& id);
+	virtual BOOL			startMotion(const LLUUID& id, F32 time_offset = 0.f);
+	virtual BOOL			stopMotion(const LLUUID& id, BOOL stop_immediate = FALSE);
+	virtual void			stopMotionFromSource(const LLUUID& source_id);
+	virtual void			requestStopMotion(LLMotion* motion);
+	LLMotion*				findMotion(const LLUUID& id) const;
+	void					startDefaultMotions();
+	void					dumpAnimationState();
+
+	virtual LLJoint*		getJoint(const std::string &name);
+	virtual LLJoint*     	getRootJoint() { return &mRoot; }
+	
+	void					resetJointPositions( void );
+	void					resetJointPositionsToDefault( void );
+	void					resetSpecificJointPosition( const std::string& name );
+	
+	virtual const char*		getAnimationPrefix() { return "avatar"; }
+	virtual const LLUUID&   getID();
+	virtual LLVector3		getVolumePos(S32 joint_index, LLVector3& volume_offset);
+	virtual LLJoint*		findCollisionVolume(U32 volume_id);
+	virtual S32				getCollisionVolumeID(std::string &name);
+	virtual void			addDebugText(const std::string& text);
+	virtual F32          	getTimeDilation();
+	virtual void			getGround(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm);
+	virtual F32				getPixelArea() const;
+	virtual LLPolyMesh*		getHeadMesh();
+	virtual LLPolyMesh*		getUpperBodyMesh();
+	virtual LLVector3d		getPosGlobalFromAgent(const LLVector3 &position);
+	virtual LLVector3		getPosAgentFromGlobal(const LLVector3d &position);
+	virtual void			updateVisualParams();
+
+
+/**                    Inherited
+ **                                                                            **
+ *******************************************************************************/
+
+/********************************************************************************
+ **                                                                            **
+ **                    STATE
+ **/
+
+public:
+	virtual bool 	isSelf() const { return false; } // True if this avatar is for this viewer's agent
+	bool isBuilt() const { return mIsBuilt; }
+
+private: //aligned members
+	LLVector4a	mImpostorExtents[2];
+
+private:
+	BOOL			mSupportsAlphaLayers; // For backwards compatibility, TRUE for 1.23+ clients
+
+	//--------------------------------------------------------------------
+	// Updates
+	//--------------------------------------------------------------------
+public:
+	virtual BOOL 	updateCharacter(LLAgent &agent);
+	void 			idleUpdateVoiceVisualizer(bool voice_enabled);
+	void 			idleUpdateMisc(bool detailed_update);
+	virtual void	idleUpdateAppearanceAnimation();
+	void 			idleUpdateLipSync(bool voice_enabled);
+	void 			idleUpdateLoadingEffect();
+	void 			idleUpdateWindEffect();
+	void 			idleUpdateNameTag(const LLVector3& root_pos_last);
+	void			idleUpdateNameTagText(BOOL new_name);
+	LLVector3		idleUpdateNameTagPosition(const LLVector3& root_pos_last);
+	void			idleUpdateNameTagAlpha(BOOL new_name, F32 alpha);
+	LLColor4		getNameTagColor(bool is_friend);
+	void			clearNameTag();
+	static void		invalidateNameTag(const LLUUID& agent_id);
+	// force all name tags to rebuild, useful when display names turned on/off
+	static void		invalidateNameTags();
+	void			addNameTagLine(const std::string& line, const LLColor4& color, S32 style, const LLFontGL* font);
+	void 			idleUpdateRenderCost();
+	void 			idleUpdateBelowWater();
+
+	//--------------------------------------------------------------------
+	// Static preferences (controlled by user settings/menus)
+	//--------------------------------------------------------------------
+public:
+	static S32		sRenderName;
+	static BOOL		sRenderGroupTitles;
+	static U32		sMaxVisible; //(affected by control "RenderAvatarMaxVisible")
+	static F32		sRenderDistance; //distance at which avatars will render.
+	static BOOL		sShowAnimationDebug; // show animation debug info
+	static BOOL		sUseImpostors; //use impostors for far away avatars
+	static BOOL		sShowFootPlane;	// show foot collision plane reported by server
+	static BOOL		sShowCollisionVolumes;	// show skeletal collision volumes
+	static BOOL		sVisibleInFirstPerson;
+	static S32		sNumLODChangesThisFrame;
+	static S32		sNumVisibleChatBubbles;
+	static BOOL		sDebugInvisible;
+	static BOOL		sShowAttachmentPoints;
+	static F32		sLODFactor; // user-settable LOD factor
+	static F32		sPhysicsLODFactor; // user-settable physics LOD factor
+	static BOOL		sJointDebug; // output total number of joints being touched for each avatar
+	static BOOL		sDebugAvatarRotation;
+
+	//--------------------------------------------------------------------
+	// Region state
+	//--------------------------------------------------------------------
+public:
+	LLHost			getObjectHost() const;
+
+	//--------------------------------------------------------------------
+	// Loading state
+	//--------------------------------------------------------------------
+public:
+	BOOL			isFullyLoaded() const;
+	bool			isTooComplex() const;
+	bool visualParamWeightsAreDefault();
+protected:
+	virtual BOOL	getIsCloud();
+	BOOL			updateIsFullyLoaded();
+	BOOL			processFullyLoadedChange(bool loading);
+	void			updateRuthTimer(bool loading);
+	F32 			calcMorphAmount();
+private:
+	BOOL			mFullyLoaded;
+	BOOL			mPreviousFullyLoaded;
+	BOOL			mFullyLoadedInitialized;
+	S32				mFullyLoadedFrameCounter;
+	S32				mVisualComplexity;
+	LLFrameTimer	mFullyLoadedTimer;
+	LLFrameTimer	mRuthTimer;
+protected:
+	LLFrameTimer    mInvisibleTimer;
+	
+/**                    State
+ **                                                                            **
+ *******************************************************************************/
+
+/********************************************************************************
+ **                                                                            **
+ **                    SKELETON
+ **/
+
+public:
+	void				updateHeadOffset();
+	F32					getPelvisToFoot() const { return mPelvisToFoot; }
+	void				setPelvisOffset( bool hasOffset, const LLVector3& translation, F32 offset ) ;
+	bool				hasPelvisOffset( void ) { return mHasPelvisOffset; }
+	void				postPelvisSetRecalc( void );
+	void				setPelvisOffset( F32 pelvixFixupAmount );
+
+	bool				mHasPelvisOffset;
+	LLVector3			mPelvisOffset;
+	F32					mLastPelvisToFoot;
+	F32					mPelvisFixup;
+	F32					mLastPelvisFixup;
+
+	LLVector3			mHeadOffset; // current head position
+	LLViewerJoint		mRoot;
+protected:
+	static BOOL			parseSkeletonFile(const std::string& filename);
+	void				buildCharacter();
+	virtual BOOL		loadAvatar();
+
+	BOOL				setupBone(const LLVOAvatarBoneInfo* info, LLViewerJoint* parent, S32 &current_volume_num, S32 &current_joint_num);
+	BOOL				buildSkeleton(const LLVOAvatarSkeletonInfo *info);
+private:
+	BOOL				mIsBuilt; // state of deferred character building
+	S32					mNumJoints;
+	LLViewerJoint*		mSkeleton;
+	
+	//--------------------------------------------------------------------
+	// Pelvis height adjustment members.
+	//--------------------------------------------------------------------
+public:
+	LLVector3			mBodySize;
+	S32					mLastSkeletonSerialNum;
+private:
+	F32					mPelvisToFoot;
+
+	//--------------------------------------------------------------------
+	// Cached pointers to well known joints
+	//--------------------------------------------------------------------
+public:
+	LLViewerJoint* 		mPelvisp;
+	LLViewerJoint* 		mTorsop;
+	LLViewerJoint* 		mChestp;
+	LLViewerJoint* 		mNeckp;
+	LLViewerJoint* 		mHeadp;
+	LLViewerJoint* 		mSkullp;
+	LLViewerJoint* 		mEyeLeftp;
+	LLViewerJoint* 		mEyeRightp;
+	LLViewerJoint* 		mHipLeftp;
+	LLViewerJoint* 		mHipRightp;
+	LLViewerJoint* 		mKneeLeftp;
+	LLViewerJoint* 		mKneeRightp;
+	LLViewerJoint* 		mAnkleLeftp;
+	LLViewerJoint* 		mAnkleRightp;
+	LLViewerJoint* 		mFootLeftp;
+	LLViewerJoint* 		mFootRightp;
+	LLViewerJoint* 		mWristLeftp;
+	LLViewerJoint* 		mWristRightp;
+
+	//--------------------------------------------------------------------
+	// XML parse tree
+	//--------------------------------------------------------------------
+private:
+	static LLXmlTree 	sXMLTree; // avatar config file
+	static LLXmlTree 	sSkeletonXMLTree; // avatar skeleton file
+
+/**                    Skeleton
+ **                                                                            **
+ *******************************************************************************/
+
+/********************************************************************************
+ **                                                                            **
+ **                    RENDERING
+ **/
+
+public:
+	U32 		renderImpostor(LLColor4U color = LLColor4U(255,255,255,255), S32 diffuse_channel = 0);
+	U32 		renderRigid();
+	U32 		renderSkinned(EAvatarRenderPass pass);
+	F32			getLastSkinTime() { return mLastSkinTime; }
+	U32			renderSkinnedAttachments();
+	U32 		renderTransparent(BOOL first_pass);
+	void 		renderCollisionVolumes();
+	static void	deleteCachedImages(bool clearAll=true);
+	static void	destroyGL();
+	static void	restoreGL();
+	BOOL 		mIsDummy; // for special views
+	S32			mSpecialRenderMode; // special lighting
+private:
+	bool		shouldAlphaMask();
+
+	BOOL 		mNeedsSkin; // avatar has been animated and verts have not been updated
+	F32			mLastSkinTime; //value of gFrameTimeSeconds at last skin update
+
+	S32	 		mUpdatePeriod;
+	S32  		mNumInitFaces; //number of faces generated when creating the avatar drawable, does not inculde splitted faces due to long vertex buffer.
+
+	//--------------------------------------------------------------------
+	// Morph masks
+	//--------------------------------------------------------------------
+public:
+	BOOL 		morphMaskNeedsUpdate(LLVOAvatarDefines::EBakedTextureIndex index = LLVOAvatarDefines::BAKED_NUM_INDICES);
+	void 		addMaskedMorph(LLVOAvatarDefines::EBakedTextureIndex index, LLPolyMorphTarget* morph_target, BOOL invert, std::string layer);
+	void 		applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components, LLVOAvatarDefines::EBakedTextureIndex index = LLVOAvatarDefines::BAKED_NUM_INDICES);
+
+	//--------------------------------------------------------------------
+	// Visibility
+	//--------------------------------------------------------------------
+protected:
+	void 		updateVisibility();
+private:
+	U32	 		mVisibilityRank;
+	BOOL 		mVisible;
+	
+	//--------------------------------------------------------------------
+	// Shadowing
+	//--------------------------------------------------------------------
+public:
+	void 		updateShadowFaces();
+	LLDrawable*	mShadow;
+private:
+	LLFace* 	mShadow0Facep;
+	LLFace* 	mShadow1Facep;
+	LLPointer<LLViewerTexture> mShadowImagep;
+
+	//--------------------------------------------------------------------
+	// Impostors
+	//--------------------------------------------------------------------
+public:
+	BOOL 		isImpostor() const;
+	BOOL 	    needsImpostorUpdate() const;
+	const LLVector3& getImpostorOffset() const;
+	const LLVector2& getImpostorDim() const;
+	void 		getImpostorValues(LLVector4a* extents, LLVector3& angle, F32& distance) const;
+	void 		cacheImpostorValues();
+	void 		setImpostorDim(const LLVector2& dim);
+	static void	resetImpostors();
+	static void updateImpostors();
+	LLRenderTarget mImpostor;
+	BOOL		mNeedsImpostorUpdate;
+private:
+	LLVector3	mImpostorOffset;
+	LLVector2	mImpostorDim;
+	BOOL		mNeedsAnimUpdate;
+	LLVector3	mImpostorAngle;
+	F32			mImpostorDistance;
+	F32			mImpostorPixelArea;
+	LLVector3	mLastAnimExtents[2];  
+
+	//--------------------------------------------------------------------
+	// Wind rippling in clothes
+	//--------------------------------------------------------------------
+public:
+	LLVector4	mWindVec;
+	F32			mRipplePhase;
+	BOOL		mBelowWater;
+private:
+	F32			mWindFreq;
+	LLFrameTimer mRippleTimer;
+	F32			mRippleTimeLast;
+	LLVector3	mRippleAccel;
+	LLVector3	mLastVel;
+
+	//--------------------------------------------------------------------
+	// Culling
+	//--------------------------------------------------------------------
+public:
+	static void	cullAvatarsByPixelArea();
+	BOOL		isCulled() const { return mCulled; }
+private:
+	BOOL		mCulled;
+
+	//--------------------------------------------------------------------
+	// Freeze counter
+	//--------------------------------------------------------------------
+public:
+	static void updateFreezeCounter(S32 counter = 0);
+private:
+	static S32  sFreezeCounter;
+
+	//--------------------------------------------------------------------
+	// Constants
+	//--------------------------------------------------------------------
+public:
+	virtual LLViewerTexture::EBoostLevel 	getAvatarBoostLevel() const { return LLViewerTexture::BOOST_AVATAR; }
+	virtual LLViewerTexture::EBoostLevel 	getAvatarBakedBoostLevel() const { return LLViewerTexture::BOOST_AVATAR_BAKED; }
+	virtual S32 						getTexImageSize() const;
+	virtual S32 						getTexImageArea() const { return getTexImageSize()*getTexImageSize(); }
+
+/**                    Rendering
+ **                                                                            **
+ *******************************************************************************/
+
+/********************************************************************************
+ **                                                                            **
+ **                    TEXTURES
+ **/
+
+	//--------------------------------------------------------------------
+	// Loading status
+	//--------------------------------------------------------------------
+public:
+	virtual BOOL    isTextureDefined(LLVOAvatarDefines::ETextureIndex type, U32 index = 0) const;
+	virtual BOOL	isTextureVisible(LLVOAvatarDefines::ETextureIndex type, U32 index = 0) const;
+	virtual BOOL	isTextureVisible(LLVOAvatarDefines::ETextureIndex type, LLWearable *wearable) const;
+
+protected:
+	BOOL			isFullyBaked();
+	static BOOL		areAllNearbyInstancesBaked(S32& grey_avatars);
+
+	//--------------------------------------------------------------------
+	// Baked textures
+	//--------------------------------------------------------------------
+public:
+	void			releaseComponentTextures(); // ! BACKWARDS COMPATIBILITY !
+protected:
+	static void		onBakedTextureMasksLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata);
+	static void		onInitialBakedTextureLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata);
+	static void		onBakedTextureLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata);
+	virtual void	removeMissingBakedTextures();
+	void			useBakedTexture(const LLUUID& id);
+
+	typedef std::deque<LLMaskedMorph *> 	morph_list_t;
+	struct BakedTextureData
+	{
+		LLUUID								mLastTextureIndex;
+		LLTexLayerSet* 						mTexLayerSet; // Only exists for self
+		bool								mIsLoaded;
+		bool								mIsUsed;
+		LLVOAvatarDefines::ETextureIndex 	mTextureIndex;
+		U32									mMaskTexName;
+		// Stores pointers to the joint meshes that this baked texture deals with
+		std::vector< LLViewerJointMesh * > 	mMeshes;  // std::vector<LLViewerJointMesh> mJoints[i]->mMeshParts
+		morph_list_t						mMaskedMorphs;
+	};
+	typedef std::vector<BakedTextureData> 	bakedtexturedata_vec_t;
+	bakedtexturedata_vec_t 					mBakedTextureDatas;
+	LLLoadedCallbackEntry::source_callback_list_t mCallbackTextureList ; 
+	BOOL mLoadedCallbacksPaused;
+	//--------------------------------------------------------------------
+	// Local Textures
+	//--------------------------------------------------------------------
+protected:
+	virtual void	setLocalTexture(LLVOAvatarDefines::ETextureIndex type, LLViewerTexture* tex, BOOL baked_version_exits, U32 index = 0);
+	virtual void	addLocalTextureStats(LLVOAvatarDefines::ETextureIndex type, LLViewerFetchedTexture* imagep, F32 texel_area_ratio, BOOL rendered, BOOL covered_by_baked, U32 index = 0);
+	// MULTI-WEARABLE: make self-only?
+	virtual void	setBakedReady(LLVOAvatarDefines::ETextureIndex type, BOOL baked_version_exists, U32 index = 0);
+
+	//--------------------------------------------------------------------
+	// Texture accessors
+	//--------------------------------------------------------------------
+private:
+	virtual	void				setImage(const U8 te, LLViewerTexture *imagep, const U32 index); 
+	virtual LLViewerTexture*	getImage(const U8 te, const U32 index) const;
+
+	virtual const LLTextureEntry* getTexEntry(const U8 te_num) const;
+	virtual void setTexEntry(const U8 index, const LLTextureEntry &te);
+
+	void checkTextureLoading() ;
+	//--------------------------------------------------------------------
+	// Layers
+	//--------------------------------------------------------------------
+protected:
+	void			deleteLayerSetCaches(bool clearAll = true);
+	void			addBakedTextureStats(LLViewerFetchedTexture* imagep, F32 pixel_area, F32 texel_area_ratio, S32 boost_level);
+
+	//--------------------------------------------------------------------
+	// Composites
+	//--------------------------------------------------------------------
+public:
+	virtual void	invalidateComposite(LLTexLayerSet* layerset, BOOL upload_result);
+	virtual void	invalidateAll();
+	virtual void	setCompositeUpdatesEnabled(bool b) {}
+	virtual void 	setCompositeUpdatesEnabled(U32 index, bool b) {}
+	virtual bool 	isCompositeUpdateEnabled(U32 index) { return false; }
+
+	//--------------------------------------------------------------------
+	// Static texture/mesh/baked dictionary
+	//--------------------------------------------------------------------
+public:
+	static BOOL 	isIndexLocalTexture(LLVOAvatarDefines::ETextureIndex i);
+	static BOOL 	isIndexBakedTexture(LLVOAvatarDefines::ETextureIndex i);
+private:
+	static const LLVOAvatarDefines::LLVOAvatarDictionary *getDictionary() { return sAvatarDictionary; }
+	static LLVOAvatarDefines::LLVOAvatarDictionary* sAvatarDictionary;
+	static LLVOAvatarSkeletonInfo* 					sAvatarSkeletonInfo;
+	static LLVOAvatarXmlInfo* 						sAvatarXmlInfo;
+
+	//--------------------------------------------------------------------
+	// Messaging
+	//--------------------------------------------------------------------
+public:
+	void 			onFirstTEMessageReceived();
+private:
+	BOOL			mFirstTEMessageReceived;
+	BOOL			mFirstAppearanceMessageReceived;
+	
+/**                    Textures
+ **                                                                            **
+ *******************************************************************************/
+
+/********************************************************************************
+ **                                                                            **
+ **                    MESHES
+ **/
+
+public:
+	void 			updateMeshTextures();
+	void 			updateSexDependentLayerSets(BOOL upload_bake);
+	void 			dirtyMesh(); // Dirty the avatar mesh
+	void 			updateMeshData();
+protected:
+	void 			releaseMeshData();
+	virtual void restoreMeshData();
+private:
+	void 			dirtyMesh(S32 priority); // Dirty the avatar mesh, with priority
+	S32 			mDirtyMesh; // 0 -- not dirty, 1 -- morphed, 2 -- LOD
+	BOOL			mMeshTexturesDirty;
+
+	typedef std::multimap<std::string, LLPolyMesh*> polymesh_map_t;
+	polymesh_map_t 									mMeshes;
+	std::vector<LLViewerJoint *> 					mMeshLOD;
+
+	//--------------------------------------------------------------------
+	// Destroy invisible mesh
+	//--------------------------------------------------------------------
+protected:
+	BOOL			mMeshValid;
+	LLFrameTimer	mMeshInvisibleTime;
+
+/**                    Meshes
+ **                                                                            **
+ *******************************************************************************/
+
+/********************************************************************************
+ **                                                                            **
+ **                    APPEARANCE
+ **/
+
+public:
+	void 			processAvatarAppearance(LLMessageSystem* mesgsys);
+	void 			hideSkirt();
+	void			startAppearanceAnimation();
+	
+	//--------------------------------------------------------------------
+	// Appearance morphing
+	//--------------------------------------------------------------------
+public:
+	BOOL			getIsAppearanceAnimating() const { return mAppearanceAnimating; }
+private:
+	BOOL			mAppearanceAnimating;
+	LLFrameTimer	mAppearanceMorphTimer;
+	F32				mLastAppearanceBlendTime;
+
+	//--------------------------------------------------------------------
+	// Clothing colors (convenience functions to access visual parameters)
+	//--------------------------------------------------------------------
+public:
+	void			setClothesColor(LLVOAvatarDefines::ETextureIndex te, const LLColor4& new_color, BOOL upload_bake);
+	LLColor4		getClothesColor(LLVOAvatarDefines::ETextureIndex te);
+	static BOOL			teToColorParams(LLVOAvatarDefines::ETextureIndex te, U32 *param_name);
+
+	//--------------------------------------------------------------------
+	// Global colors
+	//--------------------------------------------------------------------
+public:
+	LLColor4		getGlobalColor(const std::string& color_name ) const;
+	void			onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake);
+private:
+	LLTexGlobalColor* mTexSkinColor;
+	LLTexGlobalColor* mTexHairColor;
+	LLTexGlobalColor* mTexEyeColor;
+
+	//--------------------------------------------------------------------
+	// Visibility
+	//--------------------------------------------------------------------
+public:
+	BOOL			isVisible() const;
+	void			setVisibilityRank(U32 rank);
+	U32				getVisibilityRank()  const { return mVisibilityRank; } // unused
+	static S32 		sNumVisibleAvatars; // Number of instances of this class
+	static LLColor4 getDummyColor();
+/**                    Appearance
+ **                                                                            **
+ *******************************************************************************/
+
+/********************************************************************************
+ **                                                                            **
+ **                    WEARABLES
+ **/
+
+public:
+	virtual BOOL			isWearingWearableType(LLWearableType::EType type ) const;
+	
+	//--------------------------------------------------------------------
+	// Attachments
+	//--------------------------------------------------------------------
+public:
+	void 				clampAttachmentPositions();
+	virtual const LLViewerJointAttachment* attachObject(LLViewerObject *viewer_object);
+	virtual BOOL 		detachObject(LLViewerObject *viewer_object);
+	void				cleanupAttachedMesh( LLViewerObject* pVO );
+	static LLVOAvatar*  findAvatarFromAttachment(LLViewerObject* obj);
+protected:
+	LLViewerJointAttachment* getTargetAttachmentPoint(LLViewerObject* viewer_object);
+	void 				lazyAttach();
+	void				rebuildRiggedAttachments( void );
+
+	//--------------------------------------------------------------------
+	// Map of attachment points, by ID
+	//--------------------------------------------------------------------
+public:
+	S32 				getAttachmentCount(); // Warning: order(N) not order(1) // currently used only by -self
+	typedef std::map<S32, LLViewerJointAttachment*> attachment_map_t;
+	attachment_map_t 								mAttachmentPoints;
+	std::vector<LLPointer<LLViewerObject> > 		mPendingAttachment;
+
+	//--------------------------------------------------------------------
+	// HUD functions
+	//--------------------------------------------------------------------
+public:
+	BOOL 				hasHUDAttachment() const;
+	LLBBox 				getHUDBBox() const;
+	void 				rebuildHUD();
+	void 				resetHUDAttachments();
+	BOOL				canAttachMoreObjects() const;
+	BOOL				canAttachMoreObjects(U32 n) const;
+protected:
+	U32					getNumAttachments() const; // O(N), not O(1)
+
+/**                    Wearables
+ **                                                                            **
+ *******************************************************************************/
+
+/********************************************************************************
+ **                                                                            **
+ **                    ACTIONS
+ **/
+
+	//--------------------------------------------------------------------
+	// Animations
+	//--------------------------------------------------------------------
+public:
+	BOOL 			isAnyAnimationSignaled(const LLUUID *anim_array, const S32 num_anims) const;
+	void 			processAnimationStateChanges();
+protected:
+	BOOL 			processSingleAnimationStateChange(const LLUUID &anim_id, BOOL start);
+	void 			resetAnimations();
+private:
+	LLTimer			mAnimTimer;
+	F32				mTimeLast;	
+
+	//--------------------------------------------------------------------
+	// Animation state data
+	//--------------------------------------------------------------------
+public:
+	typedef std::map<LLUUID, S32>::iterator AnimIterator;
+	std::map<LLUUID, S32> 					mSignaledAnimations; // requested state of Animation name/value
+	std::map<LLUUID, S32> 					mPlayingAnimations; // current state of Animation name/value
+
+	typedef std::multimap<LLUUID, LLUUID> 	AnimationSourceMap;
+	typedef AnimationSourceMap::iterator 	AnimSourceIterator;
+	AnimationSourceMap 						mAnimationSources; // object ids that triggered anim ids
+
+	//--------------------------------------------------------------------
+	// Chat
+	//--------------------------------------------------------------------
+public:
+	void			addChat(const LLChat& chat);
+	void	   		clearChat();
+	void	   		startTyping() { mTyping = TRUE; mTypingTimer.reset(); }
+	void			stopTyping() { mTyping = FALSE; }
+private:
+	BOOL			mVisibleChat;
+
+	//--------------------------------------------------------------------
+	// Lip synch morphs
+	//--------------------------------------------------------------------
+private:
+	bool 		   	mLipSyncActive; // we're morphing for lip sync
+	LLVisualParam* 	mOohMorph; // cached pointers morphs for lip sync
+	LLVisualParam* 	mAahMorph; // cached pointers morphs for lip sync
+
+	//--------------------------------------------------------------------
+	// Flight
+	//--------------------------------------------------------------------
+public:
+	BOOL			mInAir;
+	LLFrameTimer	mTimeInAir;
+
+/**                    Actions
+ **                                                                            **
+ *******************************************************************************/
+
+/********************************************************************************
+ **                                                                            **
+ **                    PHYSICS
+ **/
+
+private:
+	F32 		mSpeedAccum; // measures speed (for diagnostics mostly).
+	BOOL 		mTurning; // controls hysteresis on avatar rotation
+	F32			mSpeed; // misc. animation repeated state
+
+	//--------------------------------------------------------------------
+	// Collision volumes
+	//--------------------------------------------------------------------
+public:
+  	S32			mNumCollisionVolumes;
+	LLViewerJointCollisionVolume* mCollisionVolumes;
+protected:
+	BOOL		allocateCollisionVolumes(U32 num);
+
+	//--------------------------------------------------------------------
+	// Dimensions
+	//--------------------------------------------------------------------
+public:
+	void 		resolveHeightGlobal(const LLVector3d &inPos, LLVector3d &outPos, LLVector3 &outNorm);
+	bool		distanceToGround( const LLVector3d &startPoint, LLVector3d &collisionPoint, F32 distToIntersectionAlongRay );
+	void 		resolveHeightAgent(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm);
+	void 		resolveRayCollisionAgent(const LLVector3d start_pt, const LLVector3d end_pt, LLVector3d &out_pos, LLVector3 &out_norm);
+	void 		slamPosition(); // Slam position to transmitted position (for teleport);
+protected:
+	void 		computeBodySize();
+
+	//--------------------------------------------------------------------
+	// Material being stepped on
+	//--------------------------------------------------------------------
+private:
+	BOOL		mStepOnLand;
+	U8			mStepMaterial;
+	LLVector3	mStepObjectVelocity;
+
+/**                    Physics
+ **                                                                            **
+ *******************************************************************************/
+
+/********************************************************************************
+ **                                                                            **
+ **                    HIERARCHY
+ **/
+
+public:
+	virtual BOOL 	setParent(LLViewerObject* parent);
+	virtual void 	addChild(LLViewerObject *childp);
+	virtual void 	removeChild(LLViewerObject *childp);
+
+	//--------------------------------------------------------------------
+	// Sitting
+	//--------------------------------------------------------------------
+public:
+	void			sitDown(BOOL bSitting);
+	BOOL			isSitting(){return mIsSitting;}
+	void 			sitOnObject(LLViewerObject *sit_object);
+	void 			getOffObject();
+private:
+	// set this property only with LLVOAvatar::sitDown method
+	BOOL 			mIsSitting;
+
+/**                    Hierarchy
+ **                                                                            **
+ *******************************************************************************/
+
+/********************************************************************************
+ **                                                                            **
+ **                    NAME
+ **/
+
+public:
+	std::string		getFullname() const; // Returns "FirstName LastName"
+protected:
+	static void		getAnimLabels(LLDynamicArray<std::string>* labels);
+	static void		getAnimNames(LLDynamicArray<std::string>* names);	
+private:
+	std::string		mNameString;		// UTF-8 title + name + status
+	std::string  	mTitle;
+	bool	  		mNameAway;
+	bool	  		mNameBusy;
+	bool	  		mNameMute;
+	bool      		mNameAppearance;
+	bool			mNameFriend;
+	bool			mNameCloud;
+	F32				mNameAlpha;
+	BOOL      		mRenderGroupTitles;
+
+	//--------------------------------------------------------------------
+	// Display the name (then optionally fade it out)
+	//--------------------------------------------------------------------
+public:
+	LLFrameTimer	mChatTimer;
+	LLPointer<LLHUDNameTag> mNameText;
+private:
+	LLFrameTimer	mTimeVisible;
+	std::deque<LLChat> mChats;
+	BOOL			mTyping;
+	LLFrameTimer	mTypingTimer;
+
+/**                    Name
+ **                                                                            **
+ *******************************************************************************/
+
+/********************************************************************************
+ **                                                                            **
+ **                    SOUNDS
+ **/
+
+	//--------------------------------------------------------------------
+	// Voice visualizer
+	//--------------------------------------------------------------------
+public:
+	// Responsible for detecting the user's voice signal (and when the
+	// user speaks, it puts a voice symbol over the avatar's head) and gesticulations
+	LLPointer<LLVoiceVisualizer>  mVoiceVisualizer;
+	int					mCurrentGesticulationLevel;
+
+	//--------------------------------------------------------------------
+	// Step sound
+	//--------------------------------------------------------------------
+protected:
+	const LLUUID& 		getStepSound() const;
+private:
+	// Global table of sound ids per material, and the ground
+	const static LLUUID	sStepSounds[LL_MCODE_END];
+	const static LLUUID	sStepSoundOnLand;
+
+	//--------------------------------------------------------------------
+	// Foot step state (for generating sounds)
+	//--------------------------------------------------------------------
+public:
+	void 				setFootPlane(const LLVector4 &plane) { mFootPlane = plane; }
+	LLVector4			mFootPlane;
+private:
+	BOOL				mWasOnGroundLeft;
+	BOOL				mWasOnGroundRight;
+
+/**                    Sounds
+ **                                                                            **
+ *******************************************************************************/
+
+/********************************************************************************
+ **                                                                            **
+ **                    DIAGNOSTICS
+ **/
+	
+	//--------------------------------------------------------------------
+	// General
+	//--------------------------------------------------------------------
+public:
+	static void			dumpArchetypeXML(void*);
+	static void			dumpBakedStatus();
+	const std::string 	getBakedStatusForPrintout() const;
+	void				dumpAvatarTEs(const std::string& context) const;
+
+	static F32 			sUnbakedTime; // Total seconds with >=1 unbaked avatars
+	static F32 			sUnbakedUpdateTime; // Last time stats were updated (to prevent multiple updates per frame) 
+	static F32 			sGreyTime; // Total seconds with >=1 grey avatars	
+	static F32 			sGreyUpdateTime; // Last time stats were updated (to prevent multiple updates per frame) 
+protected:
+	S32					getUnbakedPixelAreaRank();
+	BOOL				mHasGrey;
+private:
+	F32					mMinPixelArea;
+	F32					mMaxPixelArea;
+	F32					mAdjustedPixelArea;
+	std::string  		mDebugText;
+
+
+	//--------------------------------------------------------------------
+	// Avatar Rez Metrics
+	//--------------------------------------------------------------------
+public:
+	F32				debugGetExistenceTimeElapsedF32() const { return mDebugExistenceTimer.getElapsedTimeF32(); }
+protected:
+	LLFrameTimer	mRuthDebugTimer; // For tracking how long it takes for av to rez
+	LLFrameTimer	mDebugExistenceTimer; // Debugging for how long the avatar has been in memory.
+
+/**                    Diagnostics
+ **                                                                            **
+ *******************************************************************************/
+
+/********************************************************************************
+ **                                                                            **
+ **                    SUPPORT CLASSES
+ **/
+
+protected: // Shared with LLVOAvatarSelf
+
+	struct LLVOAvatarXmlInfo
+	{
+		LLVOAvatarXmlInfo();
+		~LLVOAvatarXmlInfo();
+
+		BOOL 	parseXmlSkeletonNode(LLXmlTreeNode* root);
+		BOOL 	parseXmlMeshNodes(LLXmlTreeNode* root);
+		BOOL 	parseXmlColorNodes(LLXmlTreeNode* root);
+		BOOL 	parseXmlLayerNodes(LLXmlTreeNode* root);
+		BOOL 	parseXmlDriverNodes(LLXmlTreeNode* root);
+		BOOL	parseXmlMorphNodes(LLXmlTreeNode* root);
+
+		struct LLVOAvatarMeshInfo
+		{
+			typedef std::pair<LLPolyMorphTargetInfo*,BOOL> morph_info_pair_t;
+			typedef std::vector<morph_info_pair_t> morph_info_list_t;
+
+			LLVOAvatarMeshInfo() : mLOD(0), mMinPixelArea(.1f) {}
+			~LLVOAvatarMeshInfo()
+			{
+				morph_info_list_t::iterator iter;
+				for (iter = mPolyMorphTargetInfoList.begin(); iter != mPolyMorphTargetInfoList.end(); iter++)
+				{
+					delete iter->first;
+				}
+				mPolyMorphTargetInfoList.clear();
+			}
+
+			std::string mType;
+			S32			mLOD;
+			std::string	mMeshFileName;
+			std::string	mReferenceMeshName;
+			F32			mMinPixelArea;
+			morph_info_list_t mPolyMorphTargetInfoList;
+		};
+		typedef std::vector<LLVOAvatarMeshInfo*> mesh_info_list_t;
+		mesh_info_list_t mMeshInfoList;
+
+		typedef std::vector<LLPolySkeletalDistortionInfo*> skeletal_distortion_info_list_t;
+		skeletal_distortion_info_list_t mSkeletalDistortionInfoList;
+	
+		struct LLVOAvatarAttachmentInfo
+		{
+			LLVOAvatarAttachmentInfo()
+				: mGroup(-1), mAttachmentID(-1), mPieMenuSlice(-1), mVisibleFirstPerson(FALSE),
+				  mIsHUDAttachment(FALSE), mHasPosition(FALSE), mHasRotation(FALSE) {}
+			std::string mName;
+			std::string mJointName;
+			LLVector3 mPosition;
+			LLVector3 mRotationEuler;
+			S32 mGroup;
+			S32 mAttachmentID;
+			S32 mPieMenuSlice;
+			BOOL mVisibleFirstPerson;
+			BOOL mIsHUDAttachment;
+			BOOL mHasPosition;
+			BOOL mHasRotation;
+		};
+		typedef std::vector<LLVOAvatarAttachmentInfo*> attachment_info_list_t;
+		attachment_info_list_t mAttachmentInfoList;
+	
+		LLTexGlobalColorInfo *mTexSkinColorInfo;
+		LLTexGlobalColorInfo *mTexHairColorInfo;
+		LLTexGlobalColorInfo *mTexEyeColorInfo;
+
+		typedef std::vector<LLTexLayerSetInfo*> layer_info_list_t;
+		layer_info_list_t mLayerInfoList;
+
+		typedef std::vector<LLDriverParamInfo*> driver_info_list_t;
+		driver_info_list_t mDriverInfoList;
+
+		struct LLVOAvatarMorphInfo
+		{
+			LLVOAvatarMorphInfo()
+				: mInvert(FALSE) {}
+			std::string mName;
+			std::string mRegion;
+			std::string mLayer;
+			BOOL mInvert;
+		};
+
+		typedef std::vector<LLVOAvatarMorphInfo*> morph_info_list_t;
+		morph_info_list_t	mMorphMaskInfoList;
+	};
+
+	struct LLMaskedMorph
+	{
+		LLMaskedMorph(LLPolyMorphTarget *morph_target, BOOL invert, std::string layer) :
+			mMorphTarget(morph_target), 
+			mInvert(invert),
+			mLayer(layer)
+		{
+			morph_target->addPendingMorphMask();
+		}
+	
+		LLPolyMorphTarget	*mMorphTarget;
+		BOOL				mInvert;
+		std::string			mLayer;
+	};
+
+/**                    Support classes
+ **                                                                            **
+ *******************************************************************************/
+
+}; // LLVOAvatar
+extern const F32 SELF_ADDITIONAL_PRI;
+extern const S32 MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL;
+
+#endif // LL_VO_AVATAR_H
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 5c1694078c..eac2f3d1b0 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1,5062 +1,5062 @@
-/** 
- * @file llvovolume.cpp
- * @brief LLVOVolume class implementation
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-// A "volume" is a box, cylinder, sphere, or other primitive shape.
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llvovolume.h"
-
-#include <sstream>
-
-#include "llviewercontrol.h"
-#include "lldir.h"
-#include "llflexibleobject.h"
-#include "llfloatertools.h"
-#include "llmaterialtable.h"
-#include "llprimitive.h"
-#include "llvolume.h"
-#include "llvolumeoctree.h"
-#include "llvolumemgr.h"
-#include "llvolumemessage.h"
-#include "material_codes.h"
-#include "message.h"
-#include "llpluginclassmedia.h" // for code in the mediaEvent handler
-#include "object_flags.h"
-#include "llagentconstants.h"
-#include "lldrawable.h"
-#include "lldrawpoolavatar.h"
-#include "lldrawpoolbump.h"
-#include "llface.h"
-#include "llspatialpartition.h"
-#include "llhudmanager.h"
-#include "llflexibleobject.h"
-#include "llsky.h"
-#include "lltexturefetch.h"
-#include "llvector4a.h"
-#include "llviewercamera.h"
-#include "llviewertexturelist.h"
-#include "llviewerobjectlist.h"
-#include "llviewerregion.h"
-#include "llviewertextureanim.h"
-#include "llworld.h"
-#include "llselectmgr.h"
-#include "pipeline.h"
-#include "llsdutil.h"
-#include "llmatrix4a.h"
-#include "llmediaentry.h"
-#include "llmediadataclient.h"
-#include "llmeshrepository.h"
-#include "llagent.h"
-#include "llviewermediafocus.h"
-#include "lldatapacker.h"
-#include "llviewershadermgr.h"
-#include "llvoavatar.h"
-#include "llvocache.h"
-
-const S32 MIN_QUIET_FRAMES_COALESCE = 30;
-const F32 FORCE_SIMPLE_RENDER_AREA = 512.f;
-const F32 FORCE_CULL_AREA = 8.f;
-const F32 MAX_LOD_DISTANCE = 24.f;
-
-
-BOOL gAnimateTextures = TRUE;
-//extern BOOL gHideSelectedObjects;
-
-F32 LLVOVolume::sLODFactor = 1.f;
-F32	LLVOVolume::sLODSlopDistanceFactor = 0.5f; //Changing this to zero, effectively disables the LOD transition slop 
-F32 LLVOVolume::sDistanceFactor = 1.0f;
-S32 LLVOVolume::sNumLODChanges = 0;
-S32 LLVOVolume::mRenderComplexity_last = 0;
-S32 LLVOVolume::mRenderComplexity_current = 0;
-LLPointer<LLObjectMediaDataClient> LLVOVolume::sObjectMediaClient = NULL;
-LLPointer<LLObjectMediaNavigateClient> LLVOVolume::sObjectMediaNavigateClient = NULL;
-
-static LLFastTimer::DeclareTimer FTM_GEN_TRIANGLES("Generate Triangles");
-static LLFastTimer::DeclareTimer FTM_GEN_VOLUME("Generate Volumes");
-static LLFastTimer::DeclareTimer FTM_VOLUME_TEXTURES("Volume Textures");
-
-// Implementation class of LLMediaDataClientObject.  See llmediadataclient.h
-class LLMediaDataClientObjectImpl : public LLMediaDataClientObject
-{
-public:
-	LLMediaDataClientObjectImpl(LLVOVolume *obj, bool isNew) : mObject(obj), mNew(isNew) 
-	{
-		mObject->addMDCImpl();
-	}
-	~LLMediaDataClientObjectImpl()
-	{
-		mObject->removeMDCImpl();
-	}
-	
-	virtual U8 getMediaDataCount() const 
-		{ return mObject->getNumTEs(); }
-
-	virtual LLSD getMediaDataLLSD(U8 index) const 
-		{
-			LLSD result;
-			LLTextureEntry *te = mObject->getTE(index); 
-			if (NULL != te)
-			{
-				llassert((te->getMediaData() != NULL) == te->hasMedia());
-				if (te->getMediaData() != NULL)
-				{
-					result = te->getMediaData()->asLLSD();
-					// XXX HACK: workaround bug in asLLSD() where whitelist is not set properly
-					// See DEV-41949
-					if (!result.has(LLMediaEntry::WHITELIST_KEY))
-					{
-						result[LLMediaEntry::WHITELIST_KEY] = LLSD::emptyArray();
-					}
-				}
-			}
-			return result;
-		}
-	virtual bool isCurrentMediaUrl(U8 index, const std::string &url) const
-		{
-			LLTextureEntry *te = mObject->getTE(index); 
-			if (te)
-			{
-				if (te->getMediaData())
-				{
-					return (te->getMediaData()->getCurrentURL() == url);
-				}
-			}
-			return url.empty();
-		}
-
-	virtual LLUUID getID() const
-		{ return mObject->getID(); }
-
-	virtual void mediaNavigateBounceBack(U8 index)
-		{ mObject->mediaNavigateBounceBack(index); }
-	
-	virtual bool hasMedia() const
-		{ return mObject->hasMedia(); }
-	
-	virtual void updateObjectMediaData(LLSD const &data, const std::string &version_string) 
-		{ mObject->updateObjectMediaData(data, version_string); }
-	
-	virtual F64 getMediaInterest() const 
-		{ 
-			F64 interest = mObject->getTotalMediaInterest();
-			if (interest < (F64)0.0)
-			{
-				// media interest not valid yet, try pixel area
-				interest = mObject->getPixelArea();
-				// HACK: force recalculation of pixel area if interest is the "magic default" of 1024.
-				if (interest == 1024.f)
-				{
-					const_cast<LLVOVolume*>(static_cast<LLVOVolume*>(mObject))->setPixelAreaAndAngle(gAgent);
-					interest = mObject->getPixelArea();
-				}
-			}
-			return interest; 
-		}
-	
-	virtual bool isInterestingEnough() const
-		{
-			return LLViewerMedia::isInterestingEnough(mObject, getMediaInterest());
-		}
-
-	virtual std::string getCapabilityUrl(const std::string &name) const
-		{ return mObject->getRegion()->getCapability(name); }
-	
-	virtual bool isDead() const
-		{ return mObject->isDead(); }
-	
-	virtual U32 getMediaVersion() const
-		{ return LLTextureEntry::getVersionFromMediaVersionString(mObject->getMediaURL()); }
-	
-	virtual bool isNew() const
-		{ return mNew; }
-
-private:
-	LLPointer<LLVOVolume> mObject;
-	bool mNew;
-};
-
-
-LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
-	: LLViewerObject(id, pcode, regionp),
-	  mVolumeImpl(NULL)
-{
-	mTexAnimMode = 0;
-	mRelativeXform.setIdentity();
-	mRelativeXformInvTrans.setIdentity();
-
-	mFaceMappingChanged = FALSE;
-	mLOD = MIN_LOD;
-	mTextureAnimp = NULL;
-	mVolumeChanged = FALSE;
-	mVObjRadius = LLVector3(1,1,0.5f).length();
-	mNumFaces = 0;
-	mLODChanged = FALSE;
-	mSculptChanged = FALSE;
-	mSpotLightPriority = 0.f;
-
-	mMediaImplList.resize(getNumTEs());
-	mLastFetchedMediaVersion = -1;
-	mIndexInTex = 0;
-	mMDCImplCount = 0;
-}
-
-LLVOVolume::~LLVOVolume()
-{
-	delete mTextureAnimp;
-	mTextureAnimp = NULL;
-	delete mVolumeImpl;
-	mVolumeImpl = NULL;
-
-	if(!mMediaImplList.empty())
-	{
-		for(U32 i = 0 ; i < mMediaImplList.size() ; i++)
-		{
-			if(mMediaImplList[i].notNull())
-			{
-				mMediaImplList[i]->removeObject(this) ;
-			}
-		}
-	}
-}
-
-void LLVOVolume::markDead()
-{
-	if (!mDead)
-	{
-		if(getMDCImplCount() > 0)
-		{
-			LLMediaDataClientObject::ptr_t obj = new LLMediaDataClientObjectImpl(const_cast<LLVOVolume*>(this), false);
-			if (sObjectMediaClient) sObjectMediaClient->removeFromQueue(obj);
-			if (sObjectMediaNavigateClient) sObjectMediaNavigateClient->removeFromQueue(obj);
-		}
-		
-		// Detach all media impls from this object
-		for(U32 i = 0 ; i < mMediaImplList.size() ; i++)
-		{
-			removeMediaImpl(i);
-		}
-
-		if (mSculptTexture.notNull())
-		{
-			mSculptTexture->removeVolume(this);
-		}
-	}
-	
-	LLViewerObject::markDead();
-}
-
-
-// static
-void LLVOVolume::initClass()
-{
-	// gSavedSettings better be around
-	if (gSavedSettings.getBOOL("PrimMediaMasterEnabled"))
-	{
-		const F32 queue_timer_delay = gSavedSettings.getF32("PrimMediaRequestQueueDelay");
-		const F32 retry_timer_delay = gSavedSettings.getF32("PrimMediaRetryTimerDelay");
-		const U32 max_retries = gSavedSettings.getU32("PrimMediaMaxRetries");
-		const U32 max_sorted_queue_size = gSavedSettings.getU32("PrimMediaMaxSortedQueueSize");
-		const U32 max_round_robin_queue_size = gSavedSettings.getU32("PrimMediaMaxRoundRobinQueueSize");
-		sObjectMediaClient = new LLObjectMediaDataClient(queue_timer_delay, retry_timer_delay, max_retries, 
-														 max_sorted_queue_size, max_round_robin_queue_size);
-		sObjectMediaNavigateClient = new LLObjectMediaNavigateClient(queue_timer_delay, retry_timer_delay, 
-																	 max_retries, max_sorted_queue_size, max_round_robin_queue_size);
-	}
-}
-
-// static
-void LLVOVolume::cleanupClass()
-{
-    sObjectMediaClient = NULL;
-    sObjectMediaNavigateClient = NULL;
-}
-
-U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
-										  void **user_data,
-										  U32 block_num, EObjectUpdateType update_type,
-										  LLDataPacker *dp)
-{
-	LLColor4U color;
-	const S32 teDirtyBits = (TEM_CHANGE_TEXTURE|TEM_CHANGE_COLOR|TEM_CHANGE_MEDIA);
-
-	// Do base class updates...
-	U32 retval = LLViewerObject::processUpdateMessage(mesgsys, user_data, block_num, update_type, dp);
-
-	LLUUID sculpt_id;
-	U8 sculpt_type = 0;
-	if (isSculpted())
-	{
-		LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT);
-		sculpt_id = sculpt_params->getSculptTexture();
-		sculpt_type = sculpt_params->getSculptType();
-	}
-
-	if (!dp)
-	{
-		if (update_type == OUT_FULL)
-		{
-			////////////////////////////////
-			//
-			// Unpack texture animation data
-			//
-			//
-
-			if (mesgsys->getSizeFast(_PREHASH_ObjectData, block_num, _PREHASH_TextureAnim))
-			{
-				if (!mTextureAnimp)
-				{
-					mTextureAnimp = new LLViewerTextureAnim();
-				}
-				else
-				{
-					if (!(mTextureAnimp->mMode & LLTextureAnim::SMOOTH))
-					{
-						mTextureAnimp->reset();
-					}
-				}
-				mTexAnimMode = 0;
-				mTextureAnimp->unpackTAMessage(mesgsys, block_num);
-			}
-			else
-			{
-				if (mTextureAnimp)
-				{
-					delete mTextureAnimp;
-					mTextureAnimp = NULL;
-					gPipeline.markTextured(mDrawable);
-					mFaceMappingChanged = TRUE;
-					mTexAnimMode = 0;
-				}
-			}
-
-			// Unpack volume data
-			LLVolumeParams volume_params;
-			LLVolumeMessage::unpackVolumeParams(&volume_params, mesgsys, _PREHASH_ObjectData, block_num);
-			volume_params.setSculptID(sculpt_id, sculpt_type);
-
-			if (setVolume(volume_params, 0))
-			{
-				markForUpdate(TRUE);
-			}
-		}
-
-		// Sigh, this needs to be done AFTER the volume is set as well, otherwise bad stuff happens...
-		////////////////////////////
-		//
-		// Unpack texture entry data
-		//
-
-		S32 result = unpackTEMessage(mesgsys, _PREHASH_ObjectData, block_num);
-		if (result & teDirtyBits)
-		{
-			updateTEData();
-		}
-		if (result & TEM_CHANGE_MEDIA)
-		{
-			retval |= MEDIA_FLAGS_CHANGED;
-		}
-	}
-	else
-	{
-		// CORY TO DO: Figure out how to get the value here
-		if (update_type != OUT_TERSE_IMPROVED)
-		{
-			LLVolumeParams volume_params;
-			BOOL res = LLVolumeMessage::unpackVolumeParams(&volume_params, *dp);
-			if (!res)
-			{
-				llwarns << "Bogus volume parameters in object " << getID() << llendl;
-				llwarns << getRegion()->getOriginGlobal() << llendl;
-			}
-
-			volume_params.setSculptID(sculpt_id, sculpt_type);
-
-			if (setVolume(volume_params, 0))
-			{
-				markForUpdate(TRUE);
-			}
-			S32 res2 = unpackTEMessage(*dp);
-			if (TEM_INVALID == res2)
-			{
-				// There's something bogus in the data that we're unpacking.
-				dp->dumpBufferToLog();
-				llwarns << "Flushing cache files" << llendl;
-
-				if(LLVOCache::hasInstance() && getRegion())
-				{
-					LLVOCache::getInstance()->removeEntry(getRegion()->getHandle()) ;
-				}
-				
-				llwarns << "Bogus TE data in " << getID() << llendl;
-			}
-			else 
-			{
-				if (res2 & teDirtyBits) 
-				{
-					updateTEData();
-				}
-				if (res2 & TEM_CHANGE_MEDIA)
-				{
-					retval |= MEDIA_FLAGS_CHANGED;
-				}
-			}
-
-			U32 value = dp->getPassFlags();
-
-			if (value & 0x40)
-			{
-				if (!mTextureAnimp)
-				{
-					mTextureAnimp = new LLViewerTextureAnim();
-				}
-				else
-				{
-					if (!(mTextureAnimp->mMode & LLTextureAnim::SMOOTH))
-					{
-						mTextureAnimp->reset();
-					}
-				}
-				mTexAnimMode = 0;
-				mTextureAnimp->unpackTAMessage(*dp);
-			}
-			else if (mTextureAnimp)
-			{
-				delete mTextureAnimp;
-				mTextureAnimp = NULL;
-				gPipeline.markTextured(mDrawable);
-				mFaceMappingChanged = TRUE;
-				mTexAnimMode = 0;
-			}
-		}
-		else
-		{
-			S32 texture_length = mesgsys->getSizeFast(_PREHASH_ObjectData, block_num, _PREHASH_TextureEntry);
-			if (texture_length)
-			{
-				U8							tdpbuffer[1024];
-				LLDataPackerBinaryBuffer	tdp(tdpbuffer, 1024);
-				mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_TextureEntry, tdpbuffer, 0, block_num);
-				S32 result = unpackTEMessage(tdp);
-				if (result & teDirtyBits)
-				{
-					updateTEData();
-				}
-				if (result & TEM_CHANGE_MEDIA)
-				{
-					retval |= MEDIA_FLAGS_CHANGED;
-				}
-			}
-		}
-	}
-	if (retval & (MEDIA_URL_REMOVED | MEDIA_URL_ADDED | MEDIA_URL_UPDATED | MEDIA_FLAGS_CHANGED)) 
-	{
-		// If only the media URL changed, and it isn't a media version URL,
-		// ignore it
-		if ( ! ( retval & (MEDIA_URL_ADDED | MEDIA_URL_UPDATED) &&
-				 mMedia && ! mMedia->mMediaURL.empty() &&
-				 ! LLTextureEntry::isMediaVersionString(mMedia->mMediaURL) ) )
-		{
-			// If the media changed at all, request new media data
-			LL_DEBUGS("MediaOnAPrim") << "Media update: " << getID() << ": retval=" << retval << " Media URL: " <<
-                ((mMedia) ?  mMedia->mMediaURL : std::string("")) << LL_ENDL;
-			requestMediaDataUpdate(retval & MEDIA_FLAGS_CHANGED);
-		}
-        else {
-            LL_INFOS("MediaOnAPrim") << "Ignoring media update for: " << getID() << " Media URL: " <<
-                ((mMedia) ?  mMedia->mMediaURL : std::string("")) << LL_ENDL;
-        }
-	}
-	// ...and clean up any media impls
-	cleanUpMediaImpls();
-
-	return retval;
-}
-
-
-void LLVOVolume::animateTextures()
-{
-	F32 off_s = 0.f, off_t = 0.f, scale_s = 1.f, scale_t = 1.f, rot = 0.f;
-	S32 result = mTextureAnimp->animateTextures(off_s, off_t, scale_s, scale_t, rot);
-	
-	if (result)
-	{
-		if (!mTexAnimMode)
-		{
-			mFaceMappingChanged = TRUE;
-			gPipeline.markTextured(mDrawable);
-		}
-		mTexAnimMode = result | mTextureAnimp->mMode;
-				
-		S32 start=0, end=mDrawable->getNumFaces()-1;
-		if (mTextureAnimp->mFace >= 0 && mTextureAnimp->mFace <= end)
-		{
-			start = end = mTextureAnimp->mFace;
-		}
-		
-		for (S32 i = start; i <= end; i++)
-		{
-			LLFace* facep = mDrawable->getFace(i);
-			if(facep->getVirtualSize() <= MIN_TEX_ANIM_SIZE && facep->mTextureMatrix) continue;
-
-			const LLTextureEntry* te = facep->getTextureEntry();
-			
-			if (!te)
-			{
-				continue;
-			}
-		
-			if (!(result & LLViewerTextureAnim::ROTATE))
-			{
-				te->getRotation(&rot);
-			}
-			if (!(result & LLViewerTextureAnim::TRANSLATE))
-			{
-				te->getOffset(&off_s,&off_t);
-			}			
-			if (!(result & LLViewerTextureAnim::SCALE))
-			{
-				te->getScale(&scale_s, &scale_t);
-			}
-
-			if (!facep->mTextureMatrix)
-			{
-				facep->mTextureMatrix = new LLMatrix4();
-			}
-
-			LLMatrix4& tex_mat = *facep->mTextureMatrix;
-			tex_mat.setIdentity();
-			LLVector3 trans ;
-
-			if(facep->isAtlasInUse())
-			{
-				//
-				//if use atlas for animated texture
-				//apply the following transform to the animation matrix.
-				//
-
-				F32 tcoord_xoffset = 0.f ;
-				F32 tcoord_yoffset = 0.f ;
-				F32 tcoord_xscale = 1.f ;
-				F32 tcoord_yscale = 1.f ;			
-				if(facep->isAtlasInUse())
-				{
-					const LLVector2* tmp = facep->getTexCoordOffset() ;
-					tcoord_xoffset = tmp->mV[0] ; 
-					tcoord_yoffset = tmp->mV[1] ;
-
-					tmp = facep->getTexCoordScale() ;
-					tcoord_xscale = tmp->mV[0] ; 
-					tcoord_yscale = tmp->mV[1] ;	
-				}
-				trans.set(LLVector3(tcoord_xoffset + tcoord_xscale * (off_s+0.5f), tcoord_yoffset + tcoord_yscale * (off_t+0.5f), 0.f));
-
-				tex_mat.translate(LLVector3(-(tcoord_xoffset + tcoord_xscale * 0.5f), -(tcoord_yoffset + tcoord_yscale * 0.5f), 0.f));
-			}
-			else	//non atlas
-			{
-				trans.set(LLVector3(off_s+0.5f, off_t+0.5f, 0.f));			
-				tex_mat.translate(LLVector3(-0.5f, -0.5f, 0.f));
-			}
-
-			LLVector3 scale(scale_s, scale_t, 1.f);			
-			LLQuaternion quat;
-			quat.setQuat(rot, 0, 0, -1.f);
-		
-			tex_mat.rotate(quat);				
-
-			LLMatrix4 mat;
-			mat.initAll(scale, LLQuaternion(), LLVector3());
-			tex_mat *= mat;
-		
-			tex_mat.translate(trans);
-		}
-	}
-	else
-	{
-		if (mTexAnimMode && mTextureAnimp->mRate == 0)
-		{
-			U8 start, count;
-
-			if (mTextureAnimp->mFace == -1)
-			{
-				start = 0;
-				count = getNumTEs();
-			}
-			else
-			{
-				start = (U8) mTextureAnimp->mFace;
-				count = 1;
-			}
-
-			for (S32 i = start; i < start + count; i++)
-			{
-				if (mTexAnimMode & LLViewerTextureAnim::TRANSLATE)
-				{
-					setTEOffset(i, mTextureAnimp->mOffS, mTextureAnimp->mOffT);				
-				}
-				if (mTexAnimMode & LLViewerTextureAnim::SCALE)
-				{
-					setTEScale(i, mTextureAnimp->mScaleS, mTextureAnimp->mScaleT);	
-				}
-				if (mTexAnimMode & LLViewerTextureAnim::ROTATE)
-				{
-					setTERotation(i, mTextureAnimp->mRot);
-				}
-			}
-
-			gPipeline.markTextured(mDrawable);
-			mFaceMappingChanged = TRUE;
-			mTexAnimMode = 0;
-		}
-	}
-}
-BOOL LLVOVolume::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
-{
-	LLViewerObject::idleUpdate(agent, world, time);
-
-	static LLFastTimer::DeclareTimer ftm("Volume");
-	LLFastTimer t(ftm);
-
-	if (mDead || mDrawable.isNull())
-	{
-		return TRUE;
-	}
-	
-	///////////////////////
-	//
-	// Do texture animation stuff
-	//
-
-	if (mTextureAnimp && gAnimateTextures)
-	{
-		animateTextures();
-	}
-
-	// Dispatch to implementation
-	if (mVolumeImpl)
-	{
-		mVolumeImpl->doIdleUpdate(agent, world, time);
-	}
-
-	const S32 MAX_ACTIVE_OBJECT_QUIET_FRAMES = 40;
-
-	if (mDrawable->isActive())
-	{
-		if (mDrawable->isRoot() && 
-			mDrawable->mQuietCount++ > MAX_ACTIVE_OBJECT_QUIET_FRAMES && 
-			(!mDrawable->getParent() || !mDrawable->getParent()->isActive()))
-		{
-			mDrawable->makeStatic();
-		}
-	}
-
-	return TRUE;
-}
-
-void LLVOVolume::updateTextures()
-{
-	const F32 TEXTURE_AREA_REFRESH_TIME = 5.f; // seconds
-	if (mTextureUpdateTimer.getElapsedTimeF32() > TEXTURE_AREA_REFRESH_TIME)
-	{
-		updateTextureVirtualSize();		
-	}
-}
-
-BOOL LLVOVolume::isVisible() const 
-{
-	if(mDrawable.notNull() && mDrawable->isVisible())
-	{
-		return TRUE ;
-	}
-
-	if(isAttachment())
-	{
-		LLViewerObject* objp = (LLViewerObject*)getParent() ;
-		while(objp && !objp->isAvatar())
-		{
-			objp = (LLViewerObject*)objp->getParent() ;
-		}
-
-		return objp && objp->mDrawable.notNull() && objp->mDrawable->isVisible() ;
-	}
-
-	return FALSE ;
-}
-
-void LLVOVolume::updateTextureVirtualSize()
-{
-	LLFastTimer ftm(FTM_VOLUME_TEXTURES);
-	// Update the pixel area of all faces
-
-	if(!isVisible())
-	{
-		return ;
-	}
-
-	if (!gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_SIMPLE))
-	{
-		return;
-	}
-
-	static LLCachedControl<bool> dont_load_textures(gSavedSettings,"TextureDisable");
-		
-	if (dont_load_textures || LLAppViewer::getTextureFetch()->mDebugPause) // || !mDrawable->isVisible())
-	{
-		return;
-	}
-
-	mTextureUpdateTimer.reset();
-	
-	F32 old_area = mPixelArea;
-	mPixelArea = 0.f;
-
-	const S32 num_faces = mDrawable->getNumFaces();
-	F32 min_vsize=999999999.f, max_vsize=0.f;
-	LLViewerCamera* camera = LLViewerCamera::getInstance();
-	for (S32 i = 0; i < num_faces; i++)
-	{
-		LLFace* face = mDrawable->getFace(i);
-		const LLTextureEntry *te = face->getTextureEntry();
-		LLViewerTexture *imagep = face->getTexture();
-		if (!imagep || !te ||			
-			face->mExtents[0].equals3(face->mExtents[1]))
-		{
-			continue;
-		}
-		
-		F32 vsize;
-		F32 old_size = face->getVirtualSize();
-
-		if (isHUDAttachment())
-		{
-			F32 area = (F32) camera->getScreenPixelArea();
-			vsize = area;
-			imagep->setBoostLevel(LLViewerTexture::BOOST_HUD);
- 			face->setPixelArea(area); // treat as full screen
-			face->setVirtualSize(vsize);
-		}
-		else
-		{
-			vsize = face->getTextureVirtualSize();
-		}
-
-		mPixelArea = llmax(mPixelArea, face->getPixelArea());		
-
-		if (face->mTextureMatrix != NULL)
-		{
-			if ((vsize < MIN_TEX_ANIM_SIZE && old_size > MIN_TEX_ANIM_SIZE) ||
-				(vsize > MIN_TEX_ANIM_SIZE && old_size < MIN_TEX_ANIM_SIZE))
-			{
-				gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_TCOORD, FALSE);
-			}
-		}
-				
-		if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_AREA))
-		{
-			if (vsize < min_vsize) min_vsize = vsize;
-			if (vsize > max_vsize) max_vsize = vsize;
-		}
-		else if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY))
-		{
-			LLViewerFetchedTexture* img = LLViewerTextureManager::staticCastToFetchedTexture(imagep) ;
-			if(img)
-			{
-				F32 pri = img->getDecodePriority();
-				pri = llmax(pri, 0.0f);
-				if (pri < min_vsize) min_vsize = pri;
-				if (pri > max_vsize) max_vsize = pri;
-			}
-		}
-		else if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_FACE_AREA))
-		{
-			F32 pri = mPixelArea;
-			if (pri < min_vsize) min_vsize = pri;
-			if (pri > max_vsize) max_vsize = pri;
-		}	
-	}
-	
-	if (isSculpted())
-	{
-		LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT);
-		LLUUID id =  sculpt_params->getSculptTexture();
-		
-		updateSculptTexture();
-		
-		
-
-		if (mSculptTexture.notNull())
-		{
-			mSculptTexture->setBoostLevel(llmax((S32)mSculptTexture->getBoostLevel(),
-												(S32)LLViewerTexture::BOOST_SCULPTED));
-			mSculptTexture->setForSculpt() ;
-			
-			if(!mSculptTexture->isCachedRawImageReady())
-			{
-				S32 lod = llmin(mLOD, 3);
-				F32 lodf = ((F32)(lod + 1.0f)/4.f);
-				F32 tex_size = lodf * LLViewerTexture::sMaxSculptRez ;
-				mSculptTexture->addTextureStats(2.f * tex_size * tex_size, FALSE);
-			
-				//if the sculpty very close to the view point, load first
-				{				
-					LLVector3 lookAt = getPositionAgent() - camera->getOrigin();
-					F32 dist = lookAt.normVec() ;
-					F32 cos_angle_to_view_dir = lookAt * camera->getXAxis() ;				
-					mSculptTexture->setAdditionalDecodePriority(0.8f * LLFace::calcImportanceToCamera(cos_angle_to_view_dir, dist)) ;
-				}
-			}
-	
-			S32 texture_discard = mSculptTexture->getDiscardLevel(); //try to match the texture
-			S32 current_discard = getVolume() ? getVolume()->getSculptLevel() : -2 ;
-
-			if (texture_discard >= 0 && //texture has some data available
-				(texture_discard < current_discard || //texture has more data than last rebuild
-				current_discard < 0)) //no previous rebuild
-			{
-				gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, FALSE);
-				mSculptChanged = TRUE;
-			}
-
-			if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SCULPTED))
-			{
-				setDebugText(llformat("T%d C%d V%d\n%dx%d",
-										  texture_discard, current_discard, getVolume()->getSculptLevel(),
-										  mSculptTexture->getHeight(), mSculptTexture->getWidth()));
-			}
-		}
-
-	}
-
-	if (getLightTextureID().notNull())
-	{
-		LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
-		LLUUID id = params->getLightTexture();
-		mLightTexture = LLViewerTextureManager::getFetchedTexture(id);
-		if (mLightTexture.notNull())
-		{
-			F32 rad = getLightRadius();
-			mLightTexture->addTextureStats(gPipeline.calcPixelArea(getPositionAgent(), 
-																	LLVector3(rad,rad,rad),
-																	*camera));
-		}	
-	}
-	
-	if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_AREA))
-	{
-		setDebugText(llformat("%.0f:%.0f", (F32) sqrt(min_vsize),(F32) sqrt(max_vsize)));
-	}
- 	else if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY))
- 	{
- 		setDebugText(llformat("%.0f:%.0f", (F32) sqrt(min_vsize),(F32) sqrt(max_vsize)));
- 	}
-	else if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_FACE_AREA))
-	{
-		setDebugText(llformat("%.0f:%.0f", (F32) sqrt(min_vsize),(F32) sqrt(max_vsize)));
-	}
-
-	if (mPixelArea == 0)
-	{ //flexi phasing issues make this happen
-		mPixelArea = old_area;
-	}
-}
-
-BOOL LLVOVolume::isActive() const
-{
-	return !mStatic || mTextureAnimp || (mVolumeImpl && mVolumeImpl->isActive()) || 
-		(mDrawable.notNull() && mDrawable->isActive());
-}
-
-BOOL LLVOVolume::setMaterial(const U8 material)
-{
-	BOOL res = LLViewerObject::setMaterial(material);
-	
-	return res;
-}
-
-void LLVOVolume::setTexture(const S32 face)
-{
-	llassert(face < getNumTEs());
-	gGL.getTexUnit(0)->bind(getTEImage(face));
-}
-
-void LLVOVolume::setScale(const LLVector3 &scale, BOOL damped)
-{
-	if (scale != getScale())
-	{
-		// store local radius
-		LLViewerObject::setScale(scale);
-
-		if (mVolumeImpl)
-		{
-			mVolumeImpl->onSetScale(scale, damped);
-		}
-		
-		updateRadius();
-
-		//since drawable transforms do not include scale, changing volume scale
-		//requires an immediate rebuild of volume verts.
-		gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_POSITION, TRUE);
-	}
-}
-
-LLFace* LLVOVolume::addFace(S32 f)
-{
-	const LLTextureEntry* te = getTE(f);
-	LLViewerTexture* imagep = getTEImage(f);
-	return mDrawable->addFace(te, imagep);
-}
-
-LLDrawable *LLVOVolume::createDrawable(LLPipeline *pipeline)
-{
-	pipeline->allocDrawable(this);
-		
-	mDrawable->setRenderType(LLPipeline::RENDER_TYPE_VOLUME);
-
-	S32 max_tes_to_set = getNumTEs();
-	for (S32 i = 0; i < max_tes_to_set; i++)
-	{
-		addFace(i);
-	}
-	mNumFaces = max_tes_to_set;
-
-	if (isAttachment())
-	{
-		mDrawable->makeActive();
-	}
-
-	if (getIsLight())
-	{
-		// Add it to the pipeline mLightSet
-		gPipeline.setLight(mDrawable, TRUE);
-	}
-	
-	updateRadius();
-	bool force_update = true; // avoid non-alpha mDistance update being optimized away
-	mDrawable->updateDistance(*LLViewerCamera::getInstance(), force_update);
-
-	return mDrawable;
-}
-
-BOOL LLVOVolume::setVolume(const LLVolumeParams &params_in, const S32 detail, bool unique_volume)
-{
-	LLVolumeParams volume_params = params_in;
-
-	S32 last_lod = mVolumep.notNull() ? LLVolumeLODGroup::getVolumeDetailFromScale(mVolumep->getDetail()) : -1;
-	S32 lod = mLOD;
-
-	BOOL is404 = FALSE;
-	
-	if (isSculpted())
-	{
-		// if it's a mesh
-		if ((volume_params.getSculptType() & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH)
-		{ //meshes might not have all LODs, get the force detail to best existing LOD
-			LLUUID mesh_id = volume_params.getSculptID();
-
-			lod = gMeshRepo.getActualMeshLOD(volume_params, lod);
-			if (lod == -1)
-			{
-				is404 = TRUE;
-				lod = 0;
-			}
-		}
-	}
-
-	// Check if we need to change implementations
-	bool is_flexible = (volume_params.getPathParams().getCurveType() == LL_PCODE_PATH_FLEXIBLE);
-	if (is_flexible)
-	{
-		setParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE, TRUE, false);
-		if (!mVolumeImpl)
-		{
-			LLFlexibleObjectData* data = (LLFlexibleObjectData*)getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE);
-			mVolumeImpl = new LLVolumeImplFlexible(this, data);
-		}
-	}
-	else
-	{
-		// Mark the parameter not in use
-		setParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE, FALSE, false);
-		if (mVolumeImpl)
-		{
-			delete mVolumeImpl;
-			mVolumeImpl = NULL;
-			if (mDrawable.notNull())
-			{
-				// Undo the damage we did to this matrix
-				mDrawable->updateXform(FALSE);
-			}
-		}
-	}
-	
-	if (is404)
-	{
-		setIcon(LLViewerTextureManager::getFetchedTextureFromFile("icons/Inv_Mesh.png", TRUE, LLViewerTexture::BOOST_UI));
-		//render prim proxy when mesh loading attempts give up
-		volume_params.setSculptID(LLUUID::null, LL_SCULPT_TYPE_NONE);
-
-	}
-
-	if ((LLPrimitive::setVolume(volume_params, lod, (mVolumeImpl && mVolumeImpl->isVolumeUnique()))) || mSculptChanged)
-	{
-		mFaceMappingChanged = TRUE;
-		
-		if (mVolumeImpl)
-		{
-			mVolumeImpl->onSetVolume(volume_params, mLOD);
-		}
-	
-		updateSculptTexture();
-
-		if (isSculpted())
-		{
-			updateSculptTexture();
-			// if it's a mesh
-			if ((volume_params.getSculptType() & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH)
-			{
-				if (!getVolume()->isMeshAssetLoaded())
-				{ 
-					//load request not yet issued, request pipeline load this mesh
-					LLUUID asset_id = volume_params.getSculptID();
-					S32 available_lod = gMeshRepo.loadMesh(this, volume_params, lod, last_lod);
-					if (available_lod != lod)
-					{
-						LLPrimitive::setVolume(volume_params, available_lod);
-					}
-				}
-				
-			}
-			else // otherwise is sculptie
-			{
-				if (mSculptTexture.notNull())
-				{
-					sculpt();
-				}
-			}
-		}
-
-		return TRUE;
-	}
-
-	return FALSE;
-}
-
-void LLVOVolume::updateSculptTexture()
-{
-	LLPointer<LLViewerFetchedTexture> old_sculpt = mSculptTexture;
-
-	if (isSculpted() && !isMesh())
-	{
-		LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT);
-		LLUUID id =  sculpt_params->getSculptTexture();
-		if (id.notNull())
-		{
-			mSculptTexture = LLViewerTextureManager::getFetchedTexture(id, TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
-		}
-	}
-	else
-	{
-		mSculptTexture = NULL;
-	}
-
-	if (mSculptTexture != old_sculpt)
-	{
-		if (old_sculpt.notNull())
-		{
-			old_sculpt->removeVolume(this);
-		}
-		if (mSculptTexture.notNull())
-		{
-			mSculptTexture->addVolume(this);
-		}
-	}
-	
-}
-
-void LLVOVolume::notifyMeshLoaded()
-{ 
-	mSculptChanged = TRUE;
-	gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_GEOMETRY, TRUE);
-}
-
-// sculpt replaces generate() for sculpted surfaces
-void LLVOVolume::sculpt()
-{	
-	if (mSculptTexture.notNull())
-	{				
-		U16 sculpt_height = 0;
-		U16 sculpt_width = 0;
-		S8 sculpt_components = 0;
-		const U8* sculpt_data = NULL;
-	
-		S32 discard_level = mSculptTexture->getDiscardLevel() ;
-		LLImageRaw* raw_image = mSculptTexture->getCachedRawImage() ;
-		
-		S32 max_discard = mSculptTexture->getMaxDiscardLevel();
-		if (discard_level > max_discard)
-			discard_level = max_discard;    // clamp to the best we can do
-
-		S32 current_discard = getVolume()->getSculptLevel() ;
-		if(current_discard < -2)
-		{
-			llwarns << "WARNING!!: Current discard of sculpty at " << current_discard 
-				<< " is less than -2." << llendl;
-			
-			// corrupted volume... don't update the sculpty
-			return;
-		}
-		else if (current_discard > MAX_DISCARD_LEVEL)
-		{
-			llwarns << "WARNING!!: Current discard of sculpty at " << current_discard 
-				<< " is more than than allowed max of " << MAX_DISCARD_LEVEL << llendl;
-			
-			// corrupted volume... don't update the sculpty			
-			return;
-		}
-
-		if (current_discard == discard_level)  // no work to do here
-			return;
-		
-		if(!raw_image)
-		{
-			llassert(discard_level < 0) ;
-
-			sculpt_width = 0;
-			sculpt_height = 0;
-			sculpt_data = NULL ;
-
-			if(LLViewerTextureManager::sTesterp)
-			{
-				LLViewerTextureManager::sTesterp->updateGrayTextureBinding();
-			}
-		}
-		else
-		{					
-			sculpt_height = raw_image->getHeight();
-			sculpt_width = raw_image->getWidth();
-			sculpt_components = raw_image->getComponents();		
-					   
-			sculpt_data = raw_image->getData();
-
-			if(LLViewerTextureManager::sTesterp)
-			{
-				mSculptTexture->updateBindStatsForTester() ;
-			}
-		}
-		getVolume()->sculpt(sculpt_width, sculpt_height, sculpt_components, sculpt_data, discard_level);
-
-		//notify rebuild any other VOVolumes that reference this sculpty volume
-		for (S32 i = 0; i < mSculptTexture->getNumVolumes(); ++i)
-		{
-			LLVOVolume* volume = (*(mSculptTexture->getVolumeList()))[i];
-			if (volume != this && volume->getVolume() == getVolume())
-			{
-				gPipeline.markRebuild(volume->mDrawable, LLDrawable::REBUILD_GEOMETRY, FALSE);
-			}
-		}
-	}
-}
-
-S32	LLVOVolume::computeLODDetail(F32 distance, F32 radius)
-{
-	S32	cur_detail;
-	if (LLPipeline::sDynamicLOD)
-	{
-		// We've got LOD in the profile, and in the twist.  Use radius.
-		F32 tan_angle = (LLVOVolume::sLODFactor*radius)/distance;
-		cur_detail = LLVolumeLODGroup::getDetailFromTan(llround(tan_angle, 0.01f));
-	}
-	else
-	{
-		cur_detail = llclamp((S32) (sqrtf(radius)*LLVOVolume::sLODFactor*4.f), 0, 3);		
-	}
-	return cur_detail;
-}
-
-BOOL LLVOVolume::calcLOD()
-{
-	if (mDrawable.isNull())
-	{
-		return FALSE;
-	}
-
-	S32 cur_detail = 0;
-	
-	F32 radius;
-	F32 distance;
-
-	if (mDrawable->isState(LLDrawable::RIGGED))
-	{
-		LLVOAvatar* avatar = getAvatar(); 
-		distance = avatar->mDrawable->mDistanceWRTCamera;
-		radius = avatar->getBinRadius();
-	}
-	else
-	{
-		distance = mDrawable->mDistanceWRTCamera;
-		radius = getVolume()->mLODScaleBias.scaledVec(getScale()).length();
-	}
-	
-	//hold onto unmodified distance for debugging
-	//F32 debug_distance = distance;
-	
-	distance *= sDistanceFactor;
-
-	F32 rampDist = LLVOVolume::sLODFactor * 2;
-	
-	if (distance < rampDist)
-	{
-		// Boost LOD when you're REALLY close
-		distance *= 1.0f/rampDist;
-		distance *= distance;
-		distance *= rampDist;
-	}
-	
-	// DON'T Compensate for field of view changing on FOV zoom.
-	distance *= F_PI/3.f;
-
-	cur_detail = computeLODDetail(llround(distance, 0.01f), 
-									llround(radius, 0.01f));
-
-
-	if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_LOD_INFO))
-	{
-		//setDebugText(llformat("%.2f:%.2f, %d", debug_distance, radius, cur_detail));
-
-		setDebugText(llformat("%d", mDrawable->getFace(0)->getTextureIndex()));
-	}
-
-	if (cur_detail != mLOD)
-	{
-		mAppAngle = llround((F32) atan2( mDrawable->getRadius(), mDrawable->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f);
-		mLOD = cur_detail;		
-		return TRUE;
-	}
-	else
-	{
-		return FALSE;
-	}
-}
-
-BOOL LLVOVolume::updateLOD()
-{
-	if (mDrawable.isNull())
-	{
-		return FALSE;
-	}
-	
-	BOOL lod_changed = calcLOD();
-
-	if (lod_changed)
-	{
-		gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, FALSE);
-		mLODChanged = TRUE;
-	}
-	else
-	{
-		F32 new_radius = getBinRadius();
-		F32 old_radius = mDrawable->getBinRadius();
-		if (new_radius < old_radius * 0.9f || new_radius > old_radius*1.1f)
-		{
-			gPipeline.markPartitionMove(mDrawable);
-		}
-	}
-
-	lod_changed = lod_changed || LLViewerObject::updateLOD();
-	
-	return lod_changed;
-}
-
-BOOL LLVOVolume::setDrawableParent(LLDrawable* parentp)
-{
-	if (!LLViewerObject::setDrawableParent(parentp))
-	{
-		// no change in drawable parent
-		return FALSE;
-	}
-
-	if (!mDrawable->isRoot())
-	{
-		// rebuild vertices in parent relative space
-		gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE);
-
-		if (mDrawable->isActive() && !parentp->isActive())
-		{
-			parentp->makeActive();
-		}
-		else if (mDrawable->isStatic() && parentp->isActive())
-		{
-			mDrawable->makeActive();
-		}
-	}
-	
-	return TRUE;
-}
-
-void LLVOVolume::updateFaceFlags()
-{
-	for (S32 i = 0; i < getVolume()->getNumFaces(); i++)
-	{
-		LLFace *face = mDrawable->getFace(i);
-		if (!face)
-		{
-			return;
-		}
-
-		BOOL fullbright = getTE(i)->getFullbright();
-		face->clearState(LLFace::FULLBRIGHT | LLFace::HUD_RENDER | LLFace::LIGHT);
-
-		if (fullbright || (mMaterial == LL_MCODE_LIGHT))
-		{
-			face->setState(LLFace::FULLBRIGHT);
-		}
-		if (mDrawable->isLight())
-		{
-			face->setState(LLFace::LIGHT);
-		}
-		if (isHUDAttachment())
-		{
-			face->setState(LLFace::HUD_RENDER);
-		}
-	}
-}
-
-BOOL LLVOVolume::setParent(LLViewerObject* parent)
-{
-	BOOL ret = FALSE ;
-	if (parent != getParent())
-	{
-		ret = LLViewerObject::setParent(parent);
-		if (ret && mDrawable)
-		{
-			gPipeline.markMoved(mDrawable);
-			gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE);
-		}
-	}
-
-	return ret ;
-}
-
-// NOTE: regenFaces() MUST be followed by genTriangles()!
-void LLVOVolume::regenFaces()
-{
-	// remove existing faces
-	BOOL count_changed = mNumFaces != getNumTEs();
-	
-	if (count_changed)
-	{
-		deleteFaces();		
-		// add new faces
-		mNumFaces = getNumTEs();
-	}
-		
-	for (S32 i = 0; i < mNumFaces; i++)
-	{
-		LLFace* facep = count_changed ? addFace(i) : mDrawable->getFace(i);
-		facep->setTEOffset(i);
-		facep->setTexture(getTEImage(i));
-		facep->setViewerObject(this);
-		
-		// If the face had media on it, this will have broken the link between the LLViewerMediaTexture and the face.
-		// Re-establish the link.
-		if((int)mMediaImplList.size() > i)
-		{
-			if(mMediaImplList[i])
-			{
-				LLViewerMediaTexture* media_tex = LLViewerTextureManager::findMediaTexture(mMediaImplList[i]->getMediaTextureID()) ;
-				if(media_tex)
-				{
-					media_tex->addMediaToFace(facep) ;
-				}
-			}
-		}
-	}
-	
-	if (!count_changed)
-	{
-		updateFaceFlags();
-	}
-}
-
-BOOL LLVOVolume::genBBoxes(BOOL force_global)
-{
-	BOOL res = TRUE;
-
-	LLVector4a min,max;
-
-	min.clear();
-	max.clear();
-
-	BOOL rebuild = mDrawable->isState(LLDrawable::REBUILD_VOLUME | LLDrawable::REBUILD_POSITION | LLDrawable::REBUILD_RIGGED);
-
-//	bool rigged = false;
-	LLVolume* volume = mRiggedVolume;
-	if (!volume)
-	{
-		volume = getVolume();
-	}
-
-	for (S32 i = 0; i < getVolume()->getNumVolumeFaces(); i++)
-	{
-		LLFace *face = mDrawable->getFace(i);
-		if (!face)
-		{
-			continue;
-		}
-		res &= face->genVolumeBBoxes(*volume, i,
-										mRelativeXform, mRelativeXformInvTrans,
-										(mVolumeImpl && mVolumeImpl->isVolumeGlobal()) || force_global);
-		
-		if (rebuild)
-		{
-			if (i == 0)
-			{
-				min = face->mExtents[0];
-				max = face->mExtents[1];
-			}
-			else
-			{
-				min.setMin(min, face->mExtents[0]);
-				max.setMax(max, face->mExtents[1]);
-			}
-		}
-	}
-	
-	if (rebuild)
-	{
-		mDrawable->setSpatialExtents(min,max);
-		min.add(max);
-		min.mul(0.5f);
-		mDrawable->setPositionGroup(min);	
-	}
-
-	updateRadius();
-	mDrawable->movePartition();
-			
-	return res;
-}
-
-void LLVOVolume::preRebuild()
-{
-	if (mVolumeImpl != NULL)
-	{
-		mVolumeImpl->preRebuild();
-	}
-}
-
-void LLVOVolume::updateRelativeXform()
-{
-	if (mVolumeImpl)
-	{
-		mVolumeImpl->updateRelativeXform();
-		return;
-	}
-	
-	LLDrawable* drawable = mDrawable;
-	
-	if (drawable->isState(LLDrawable::RIGGED) && mRiggedVolume.notNull())
-	{ //rigged volume (which is in agent space) is used for generating bounding boxes etc
-	  //inverse of render matrix should go to partition space
-		mRelativeXform = getRenderMatrix();
-
-		F32* dst = (F32*) mRelativeXformInvTrans.mMatrix;
-		F32* src = (F32*) mRelativeXform.mMatrix;
-		dst[0] = src[0]; dst[1] = src[1]; dst[2] = src[2];
-		dst[3] = src[4]; dst[4] = src[5]; dst[5] = src[6];
-		dst[6] = src[8]; dst[7] = src[9]; dst[8] = src[10];
-		
-		mRelativeXform.invert();
-		mRelativeXformInvTrans.transpose();
-	}
-	else if (drawable->isActive())
-	{				
-		// setup relative transforms
-		LLQuaternion delta_rot;
-		LLVector3 delta_pos, delta_scale;
-		
-		//matrix from local space to parent relative/global space
-		delta_rot = drawable->isSpatialRoot() ? LLQuaternion() : mDrawable->getRotation();
-		delta_pos = drawable->isSpatialRoot() ? LLVector3(0,0,0) : mDrawable->getPosition();
-		delta_scale = mDrawable->getScale();
-
-		// Vertex transform (4x4)
-		LLVector3 x_axis = LLVector3(delta_scale.mV[VX], 0.f, 0.f) * delta_rot;
-		LLVector3 y_axis = LLVector3(0.f, delta_scale.mV[VY], 0.f) * delta_rot;
-		LLVector3 z_axis = LLVector3(0.f, 0.f, delta_scale.mV[VZ]) * delta_rot;
-
-		mRelativeXform.initRows(LLVector4(x_axis, 0.f),
-								LLVector4(y_axis, 0.f),
-								LLVector4(z_axis, 0.f),
-								LLVector4(delta_pos, 1.f));
-
-		
-		// compute inverse transpose for normals
-		// mRelativeXformInvTrans.setRows(x_axis, y_axis, z_axis);
-		// mRelativeXformInvTrans.invert(); 
-		// mRelativeXformInvTrans.setRows(x_axis, y_axis, z_axis);
-		// grumble - invert is NOT a matrix invert, so we do it by hand:
-
-		LLMatrix3 rot_inverse = LLMatrix3(~delta_rot);
-
-		LLMatrix3 scale_inverse;
-		scale_inverse.setRows(LLVector3(1.0, 0.0, 0.0) / delta_scale.mV[VX],
-							  LLVector3(0.0, 1.0, 0.0) / delta_scale.mV[VY],
-							  LLVector3(0.0, 0.0, 1.0) / delta_scale.mV[VZ]);
-							   
-		
-		mRelativeXformInvTrans = rot_inverse * scale_inverse;
-
-		mRelativeXformInvTrans.transpose();
-	}
-	else
-	{
-		LLVector3 pos = getPosition();
-		LLVector3 scale = getScale();
-		LLQuaternion rot = getRotation();
-	
-		if (mParent)
-		{
-			pos *= mParent->getRotation();
-			pos += mParent->getPosition();
-			rot *= mParent->getRotation();
-		}
-		
-		//LLViewerRegion* region = getRegion();
-		//pos += region->getOriginAgent();
-		
-		LLVector3 x_axis = LLVector3(scale.mV[VX], 0.f, 0.f) * rot;
-		LLVector3 y_axis = LLVector3(0.f, scale.mV[VY], 0.f) * rot;
-		LLVector3 z_axis = LLVector3(0.f, 0.f, scale.mV[VZ]) * rot;
-
-		mRelativeXform.initRows(LLVector4(x_axis, 0.f),
-								LLVector4(y_axis, 0.f),
-								LLVector4(z_axis, 0.f),
-								LLVector4(pos, 1.f));
-
-		// compute inverse transpose for normals
-		LLMatrix3 rot_inverse = LLMatrix3(~rot);
-
-		LLMatrix3 scale_inverse;
-		scale_inverse.setRows(LLVector3(1.0, 0.0, 0.0) / scale.mV[VX],
-							  LLVector3(0.0, 1.0, 0.0) / scale.mV[VY],
-							  LLVector3(0.0, 0.0, 1.0) / scale.mV[VZ]);
-							   
-		
-		mRelativeXformInvTrans = rot_inverse * scale_inverse;
-
-		mRelativeXformInvTrans.transpose();
-	}
-}
-
-static LLFastTimer::DeclareTimer FTM_GEN_FLEX("Generate Flexies");
-static LLFastTimer::DeclareTimer FTM_UPDATE_PRIMITIVES("Update Primitives");
-static LLFastTimer::DeclareTimer FTM_UPDATE_RIGGED_VOLUME("Update Rigged");
-
-BOOL LLVOVolume::updateGeometry(LLDrawable *drawable)
-{
-	LLFastTimer t(FTM_UPDATE_PRIMITIVES);
-	
-	if (mDrawable->isState(LLDrawable::REBUILD_RIGGED))
-	{
-		{
-			LLFastTimer t(FTM_UPDATE_RIGGED_VOLUME);
-			updateRiggedVolume();
-		}
-		genBBoxes(FALSE);
-		mDrawable->clearState(LLDrawable::REBUILD_RIGGED);
-	}
-
-	if (mVolumeImpl != NULL)
-	{
-		BOOL res;
-		{
-			LLFastTimer t(FTM_GEN_FLEX);
-			res = mVolumeImpl->doUpdateGeometry(drawable);
-		}
-		updateFaceFlags();
-		return res;
-	}
-	
-	dirtySpatialGroup(drawable->isState(LLDrawable::IN_REBUILD_Q1));
-
-	BOOL compiled = FALSE;
-			
-	updateRelativeXform();
-	
-	if (mDrawable.isNull()) // Not sure why this is happening, but it is...
-	{
-		return TRUE; // No update to complete
-	}
-
-	if (mVolumeChanged || mFaceMappingChanged )
-	{
-		compiled = TRUE;
-
-		if (mVolumeChanged)
-		{
-			LLFastTimer ftm(FTM_GEN_VOLUME);
-			LLVolumeParams volume_params = getVolume()->getParams();
-			setVolume(volume_params, 0);
-			drawable->setState(LLDrawable::REBUILD_VOLUME);
-		}
-
-		{
-			LLFastTimer t(FTM_GEN_TRIANGLES);
-			regenFaces();
-			genBBoxes(FALSE);
-		}
-	}
-	else if ((mLODChanged) || (mSculptChanged))
-	{
-		LLVolume *old_volumep, *new_volumep;
-		F32 old_lod, new_lod;
-		S32 old_num_faces, new_num_faces ;
-
-		old_volumep = getVolume();
-		old_lod = old_volumep->getDetail();
-		old_num_faces = old_volumep->getNumFaces() ;
-		old_volumep = NULL ;
-
-		{
-			LLFastTimer ftm(FTM_GEN_VOLUME);
-			LLVolumeParams volume_params = getVolume()->getParams();
-			setVolume(volume_params, 0);
-		}
-
-		new_volumep = getVolume();
-		new_lod = new_volumep->getDetail();
-		new_num_faces = new_volumep->getNumFaces() ;
-		new_volumep = NULL ;
-
-		if ((new_lod != old_lod) || mSculptChanged)
-		{
-			compiled = TRUE;
-			sNumLODChanges += new_num_faces ;
-	
-			drawable->setState(LLDrawable::REBUILD_VOLUME); // for face->genVolumeTriangles()
-
-			{
-				LLFastTimer t(FTM_GEN_TRIANGLES);
-				if (new_num_faces != old_num_faces)
-				{
-					regenFaces();
-				}
-				genBBoxes(FALSE);
-
-				if (mSculptChanged)
-				{ //changes in sculpt maps can thrash an object bounding box without 
-				  //triggering a spatial group bounding box update -- force spatial group
-				  //to update bounding boxes
-					LLSpatialGroup* group = mDrawable->getSpatialGroup();
-					if (group)
-					{
-						group->unbound();
-					}
-				}
-			}
-		}
-	}
-	// it has its own drawable (it's moved) or it has changed UVs or it has changed xforms from global<->local
-	else
-	{
-		compiled = TRUE;
-		// All it did was move or we changed the texture coordinate offset
-		LLFastTimer t(FTM_GEN_TRIANGLES);
-		genBBoxes(FALSE);
-	}
-
-	// Update face flags
-	updateFaceFlags();
-	
-	if(compiled)
-	{
-		LLPipeline::sCompiles++;
-	}
-		
-	mVolumeChanged = FALSE;
-	mLODChanged = FALSE;
-	mSculptChanged = FALSE;
-	mFaceMappingChanged = FALSE;
-	
-	return LLViewerObject::updateGeometry(drawable);
-}
-
-void LLVOVolume::updateFaceSize(S32 idx)
-{
-	LLFace* facep = mDrawable->getFace(idx);
-	if (idx >= getVolume()->getNumVolumeFaces())
-	{
-		facep->setSize(0,0, true);
-	}
-	else
-	{
-		const LLVolumeFace& vol_face = getVolume()->getVolumeFace(idx);
-		facep->setSize(vol_face.mNumVertices, vol_face.mNumIndices, 
-						true); // <--- volume faces should be padded for 16-byte alignment
-		
-	}
-}
-
-BOOL LLVOVolume::isRootEdit() const
-{
-	if (mParent && !((LLViewerObject*)mParent)->isAvatar())
-	{
-		return FALSE;
-	}
-	return TRUE;
-}
-
-//virtual
-void LLVOVolume::setNumTEs(const U8 num_tes)
-{
-	const U8 old_num_tes = getNumTEs() ;
-	
-	if(old_num_tes && old_num_tes < num_tes) //new faces added
-	{
-		LLViewerObject::setNumTEs(num_tes) ;
-
-		if(mMediaImplList.size() >= old_num_tes && mMediaImplList[old_num_tes -1].notNull())//duplicate the last media textures if exists.
-		{
-			mMediaImplList.resize(num_tes) ;
-			const LLTextureEntry* te = getTE(old_num_tes - 1) ;
-			for(U8 i = old_num_tes; i < num_tes ; i++)
-			{
-				setTE(i, *te) ;
-				mMediaImplList[i] = mMediaImplList[old_num_tes -1] ;
-			}
-			mMediaImplList[old_num_tes -1]->setUpdated(TRUE) ;
-		}
-	}
-	else if(old_num_tes > num_tes && mMediaImplList.size() > num_tes) //old faces removed
-	{
-		U8 end = mMediaImplList.size() ;
-		for(U8 i = num_tes; i < end ; i++)
-		{
-			removeMediaImpl(i) ;				
-		}
-		mMediaImplList.resize(num_tes) ;
-
-		LLViewerObject::setNumTEs(num_tes) ;
-	}
-	else
-	{
-		LLViewerObject::setNumTEs(num_tes) ;
-	}
-
-	return ;
-}
-
-void LLVOVolume::setTEImage(const U8 te, LLViewerTexture *imagep)
-{
-	BOOL changed = (mTEImages[te] != imagep);
-	LLViewerObject::setTEImage(te, imagep);
-	if (changed)
-	{
-		gPipeline.markTextured(mDrawable);
-		mFaceMappingChanged = TRUE;
-	}
-}
-
-S32 LLVOVolume::setTETexture(const U8 te, const LLUUID &uuid)
-{
-	S32 res = LLViewerObject::setTETexture(te, uuid);
-	if (res)
-	{
-		gPipeline.markTextured(mDrawable);
-		mFaceMappingChanged = TRUE;
-	}
-	return res;
-}
-
-S32 LLVOVolume::setTEColor(const U8 te, const LLColor3& color)
-{
-	return setTEColor(te, LLColor4(color));
-}
-
-S32 LLVOVolume::setTEColor(const U8 te, const LLColor4& color)
-{
-	S32 retval = 0;
-	const LLTextureEntry *tep = getTE(te);
-	if (!tep)
-	{
-		llwarns << "No texture entry for te " << (S32)te << ", object " << mID << llendl;
-	}
-	else if (color != tep->getColor())
-	{
-		if (color.mV[3] != tep->getColor().mV[3])
-		{
-			gPipeline.markTextured(mDrawable);
-		}
-		retval = LLPrimitive::setTEColor(te, color);
-		if (mDrawable.notNull() && retval)
-		{
-			// These should only happen on updates which are not the initial update.
-			mDrawable->setState(LLDrawable::REBUILD_COLOR);
-			dirtyMesh();
-		}
-	}
-
-	return  retval;
-}
-
-S32 LLVOVolume::setTEBumpmap(const U8 te, const U8 bumpmap)
-{
-	S32 res = LLViewerObject::setTEBumpmap(te, bumpmap);
-	if (res)
-	{
-		gPipeline.markTextured(mDrawable);
-		mFaceMappingChanged = TRUE;
-	}
-	return  res;
-}
-
-S32 LLVOVolume::setTETexGen(const U8 te, const U8 texgen)
-{
-	S32 res = LLViewerObject::setTETexGen(te, texgen);
-	if (res)
-	{
-		gPipeline.markTextured(mDrawable);
-		mFaceMappingChanged = TRUE;
-	}
-	return  res;
-}
-
-S32 LLVOVolume::setTEMediaTexGen(const U8 te, const U8 media)
-{
-	S32 res = LLViewerObject::setTEMediaTexGen(te, media);
-	if (res)
-	{
-		gPipeline.markTextured(mDrawable);
-		mFaceMappingChanged = TRUE;
-	}
-	return  res;
-}
-
-S32 LLVOVolume::setTEShiny(const U8 te, const U8 shiny)
-{
-	S32 res = LLViewerObject::setTEShiny(te, shiny);
-	if (res)
-	{
-		gPipeline.markTextured(mDrawable);
-		mFaceMappingChanged = TRUE;
-	}
-	return  res;
-}
-
-S32 LLVOVolume::setTEFullbright(const U8 te, const U8 fullbright)
-{
-	S32 res = LLViewerObject::setTEFullbright(te, fullbright);
-	if (res)
-	{
-		gPipeline.markTextured(mDrawable);
-		mFaceMappingChanged = TRUE;
-	}
-	return  res;
-}
-
-S32 LLVOVolume::setTEBumpShinyFullbright(const U8 te, const U8 bump)
-{
-	S32 res = LLViewerObject::setTEBumpShinyFullbright(te, bump);
-	if (res)
-	{
-		gPipeline.markTextured(mDrawable);
-		mFaceMappingChanged = TRUE;
-	}
-	return res;
-}
-
-S32 LLVOVolume::setTEMediaFlags(const U8 te, const U8 media_flags)
-{
-	S32 res = LLViewerObject::setTEMediaFlags(te, media_flags);
-	if (res)
-	{
-		gPipeline.markTextured(mDrawable);
-		mFaceMappingChanged = TRUE;
-	}
-	return  res;
-}
-
-S32 LLVOVolume::setTEGlow(const U8 te, const F32 glow)
-{
-	S32 res = LLViewerObject::setTEGlow(te, glow);
-	if (res)
-	{
-		gPipeline.markTextured(mDrawable);
-		mFaceMappingChanged = TRUE;
-	}
-	return  res;
-}
-
-S32 LLVOVolume::setTEScale(const U8 te, const F32 s, const F32 t)
-{
-	S32 res = LLViewerObject::setTEScale(te, s, t);
-	if (res)
-	{
-		gPipeline.markTextured(mDrawable);
-		mFaceMappingChanged = TRUE;
-	}
-	return res;
-}
-
-S32 LLVOVolume::setTEScaleS(const U8 te, const F32 s)
-{
-	S32 res = LLViewerObject::setTEScaleS(te, s);
-	if (res)
-	{
-		gPipeline.markTextured(mDrawable);
-		mFaceMappingChanged = TRUE;
-	}
-	return res;
-}
-
-S32 LLVOVolume::setTEScaleT(const U8 te, const F32 t)
-{
-	S32 res = LLViewerObject::setTEScaleT(te, t);
-	if (res)
-	{
-		gPipeline.markTextured(mDrawable);
-		mFaceMappingChanged = TRUE;
-	}
-	return res;
-}
-
-void LLVOVolume::updateTEData()
-{
-	/*if (mDrawable.notNull())
-	{
-		mFaceMappingChanged = TRUE;
-		gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_MATERIAL, TRUE);
-	}*/
-}
-
-bool LLVOVolume::hasMedia() const
-{
-	bool result = false;
-	const U8 numTEs = getNumTEs();
-	for (U8 i = 0; i < numTEs; i++)
-	{
-		const LLTextureEntry* te = getTE(i);
-		if(te->hasMedia())
-		{
-			result = true;
-			break;
-		}
-	}
-	return result;
-}
-
-LLVector3 LLVOVolume::getApproximateFaceNormal(U8 face_id)
-{
-	LLVolume* volume = getVolume();
-	LLVector4a result;
-	result.clear();
-
-	LLVector3 ret;
-
-	if (volume && face_id < volume->getNumVolumeFaces())
-	{
-		const LLVolumeFace& face = volume->getVolumeFace(face_id);
-		for (S32 i = 0; i < (S32)face.mNumVertices; ++i)
-		{
-			result.add(face.mNormals[i]);
-		}
-
-		LLVector3 ret(result.getF32ptr());
-		ret = volumeDirectionToAgent(ret);
-		ret.normVec();
-	}
-	
-	return ret;
-}
-
-void LLVOVolume::requestMediaDataUpdate(bool isNew)
-{
-    if (sObjectMediaClient)
-		sObjectMediaClient->fetchMedia(new LLMediaDataClientObjectImpl(this, isNew));
-}
-
-bool LLVOVolume::isMediaDataBeingFetched() const
-{
-	// I know what I'm doing by const_casting this away: this is just 
-	// a wrapper class that is only going to do a lookup.
-	return (sObjectMediaClient) ? sObjectMediaClient->isInQueue(new LLMediaDataClientObjectImpl(const_cast<LLVOVolume*>(this), false)) : false;
-}
-
-void LLVOVolume::cleanUpMediaImpls()
-{
-	// Iterate through our TEs and remove any Impls that are no longer used
-	const U8 numTEs = getNumTEs();
-	for (U8 i = 0; i < numTEs; i++)
-	{
-		const LLTextureEntry* te = getTE(i);
-		if( ! te->hasMedia())
-		{
-			// Delete the media IMPL!
-			removeMediaImpl(i) ;
-		}
-	}
-}
-
-void LLVOVolume::updateObjectMediaData(const LLSD &media_data_array, const std::string &media_version)
-{
-	// media_data_array is an array of media entry maps
-	// media_version is the version string in the response.
-	U32 fetched_version = LLTextureEntry::getVersionFromMediaVersionString(media_version);
-
-	// Only update it if it is newer!
-	if ( (S32)fetched_version > mLastFetchedMediaVersion)
-	{
-		mLastFetchedMediaVersion = fetched_version;
-		//llinfos << "updating:" << this->getID() << " " << ll_pretty_print_sd(media_data_array) << llendl;
-		
-		LLSD::array_const_iterator iter = media_data_array.beginArray();
-		LLSD::array_const_iterator end = media_data_array.endArray();
-		U8 texture_index = 0;
-		for (; iter != end; ++iter, ++texture_index)
-		{
-			syncMediaData(texture_index, *iter, false/*merge*/, false/*ignore_agent*/);
-		}
-	}
-}
-
-void LLVOVolume::syncMediaData(S32 texture_index, const LLSD &media_data, bool merge, bool ignore_agent)
-{
-	if(mDead)
-	{
-		// If the object has been marked dead, don't process media updates.
-		return;
-	}
-	
-	LLTextureEntry *te = getTE(texture_index);
-	if(!te)
-	{
-		return ;
-	}
-
-	LL_DEBUGS("MediaOnAPrim") << "BEFORE: texture_index = " << texture_index
-		<< " hasMedia = " << te->hasMedia() << " : " 
-		<< ((NULL == te->getMediaData()) ? "NULL MEDIA DATA" : ll_pretty_print_sd(te->getMediaData()->asLLSD())) << llendl;
-
-	std::string previous_url;
-	LLMediaEntry* mep = te->getMediaData();
-	if(mep)
-	{
-		// Save the "current url" from before the update so we can tell if
-		// it changes. 
-		previous_url = mep->getCurrentURL();
-	}
-
-	if (merge)
-	{
-		te->mergeIntoMediaData(media_data);
-	}
-	else {
-		// XXX Question: what if the media data is undefined LLSD, but the
-		// update we got above said that we have media flags??	Here we clobber
-		// that, assuming the data from the service is more up-to-date. 
-		te->updateMediaData(media_data);
-	}
-
-	mep = te->getMediaData();
-	if(mep)
-	{
-		bool update_from_self = false;
-		if (!ignore_agent) 
-		{
-			LLUUID updating_agent = LLTextureEntry::getAgentIDFromMediaVersionString(getMediaURL());
-			update_from_self = (updating_agent == gAgent.getID());
-		}
-		viewer_media_t media_impl = LLViewerMedia::updateMediaImpl(mep, previous_url, update_from_self);
-			
-		addMediaImpl(media_impl, texture_index) ;
-	}
-	else
-	{
-		removeMediaImpl(texture_index);
-	}
-
-	LL_DEBUGS("MediaOnAPrim") << "AFTER: texture_index = " << texture_index
-		<< " hasMedia = " << te->hasMedia() << " : " 
-		<< ((NULL == te->getMediaData()) ? "NULL MEDIA DATA" : ll_pretty_print_sd(te->getMediaData()->asLLSD())) << llendl;
-}
-
-void LLVOVolume::mediaNavigateBounceBack(U8 texture_index)
-{
-	// Find the media entry for this navigate
-	const LLMediaEntry* mep = NULL;
-	viewer_media_t impl = getMediaImpl(texture_index);
-	LLTextureEntry *te = getTE(texture_index);
-	if(te)
-	{
-		mep = te->getMediaData();
-	}
-	
-	if (mep && impl)
-	{
-        std::string url = mep->getCurrentURL();
-		// Look for a ":", if not there, assume "http://"
-		if (!url.empty() && std::string::npos == url.find(':')) 
-		{
-			url = "http://" + url;
-		}
-		// If the url we're trying to "bounce back" to is either empty or not
-		// allowed by the whitelist, try the home url.  If *that* doesn't work,
-		// set the media as failed and unload it
-        if (url.empty() || !mep->checkCandidateUrl(url))
-        {
-            url = mep->getHomeURL();
-			// Look for a ":", if not there, assume "http://"
-			if (!url.empty() && std::string::npos == url.find(':')) 
-			{
-				url = "http://" + url;
-			}
-        }
-        if (url.empty() || !mep->checkCandidateUrl(url))
-		{
-			// The url to navigate back to is not good, and we have nowhere else
-			// to go.
-			LL_WARNS("MediaOnAPrim") << "FAILED to bounce back URL \"" << url << "\" -- unloading impl" << LL_ENDL;
-			impl->setMediaFailed(true);
-		}
-		else {
-			// Okay, navigate now
-            LL_INFOS("MediaOnAPrim") << "bouncing back to URL: " << url << LL_ENDL;
-            impl->navigateTo(url, "", false, true);
-        }
-    }
-}
-
-bool LLVOVolume::hasMediaPermission(const LLMediaEntry* media_entry, MediaPermType perm_type)
-{
-    // NOTE: This logic ALMOST duplicates the logic in the server (in particular, in llmediaservice.cpp).
-    if (NULL == media_entry ) return false; // XXX should we assert here?
-    
-    // The agent has permissions if:
-    // - world permissions are on, or
-    // - group permissions are on, and agent_id is in the group, or
-    // - agent permissions are on, and agent_id is the owner
-    
-	// *NOTE: We *used* to check for modify permissions here (i.e. permissions were
-	// granted if permModify() was true).  However, this doesn't make sense in the
-	// viewer: we don't want to show controls or allow interaction if the author
-	// has deemed it so.  See DEV-42115.
-	
-    U8 media_perms = (perm_type == MEDIA_PERM_INTERACT) ? media_entry->getPermsInteract() : media_entry->getPermsControl();
-    
-    // World permissions
-    if (0 != (media_perms & LLMediaEntry::PERM_ANYONE)) 
-    {
-        return true;
-    }
-    
-    // Group permissions
-    else if (0 != (media_perms & LLMediaEntry::PERM_GROUP))
-    {
-		LLPermissions* obj_perm = LLSelectMgr::getInstance()->findObjectPermissions(this);
-		if (obj_perm && gAgent.isInGroup(obj_perm->getGroup()))
-		{
-			return true;
-		}
-    }
-    
-    // Owner permissions
-    else if (0 != (media_perms & LLMediaEntry::PERM_OWNER) && permYouOwner()) 
-    {
-        return true;
-    }
-    
-    return false;
-    
-}
-
-void LLVOVolume::mediaNavigated(LLViewerMediaImpl *impl, LLPluginClassMedia* plugin, std::string new_location)
-{
-	bool block_navigation = false;
-	// FIXME: if/when we allow the same media impl to be used by multiple faces, the logic here will need to be fixed
-	// to deal with multiple face indices.
-	int face_index = getFaceIndexWithMediaImpl(impl, -1);
-	
-	// Find the media entry for this navigate
-	LLMediaEntry* mep = NULL;
-	LLTextureEntry *te = getTE(face_index);
-	if(te)
-	{
-		mep = te->getMediaData();
-	}
-	
-	if(mep)
-	{
-		if(!mep->checkCandidateUrl(new_location))
-		{
-			block_navigation = true;
-		}
-		if (!block_navigation && !hasMediaPermission(mep, MEDIA_PERM_INTERACT))
-		{
-			block_navigation = true;
-		}
-	}
-	else
-	{
-		LL_WARNS("MediaOnAPrim") << "Couldn't find media entry!" << LL_ENDL;
-	}
-						
-	if(block_navigation)
-	{
-		LL_INFOS("MediaOnAPrim") << "blocking navigate to URI " << new_location << LL_ENDL;
-
-		// "bounce back" to the current URL from the media entry
-		mediaNavigateBounceBack(face_index);
-	}
-	else if (sObjectMediaNavigateClient)
-	{
-		
-		LL_DEBUGS("MediaOnAPrim") << "broadcasting navigate with URI " << new_location << LL_ENDL;
-
-		sObjectMediaNavigateClient->navigate(new LLMediaDataClientObjectImpl(this, false), face_index, new_location);
-	}
-}
-
-void LLVOVolume::mediaEvent(LLViewerMediaImpl *impl, LLPluginClassMedia* plugin, LLViewerMediaObserver::EMediaEvent event)
-{
-	switch(event)
-	{
-		
-		case LLViewerMediaObserver::MEDIA_EVENT_LOCATION_CHANGED:
-		{			
-			switch(impl->getNavState())
-			{
-				case LLViewerMediaImpl::MEDIANAVSTATE_FIRST_LOCATION_CHANGED:
-				{
-					// This is the first location changed event after the start of a non-server-directed nav.  It may need to be broadcast or bounced back.
-					mediaNavigated(impl, plugin, plugin->getLocation());
-				}
-				break;
-				
-				case LLViewerMediaImpl::MEDIANAVSTATE_FIRST_LOCATION_CHANGED_SPURIOUS:
-					// This navigate didn't change the current URL.  
-					LL_DEBUGS("MediaOnAPrim") << "	NOT broadcasting navigate (spurious)" << LL_ENDL;
-				break;
-				
-				case LLViewerMediaImpl::MEDIANAVSTATE_SERVER_FIRST_LOCATION_CHANGED:
-					// This is the first location changed event after the start of a server-directed nav.  Don't broadcast it.
-					LL_INFOS("MediaOnAPrim") << "	NOT broadcasting navigate (server-directed)" << LL_ENDL;
-				break;
-				
-				default:
-					// This is a subsequent location-changed due to a redirect.	 Don't broadcast.
-					LL_INFOS("MediaOnAPrim") << "	NOT broadcasting navigate (redirect)" << LL_ENDL;
-				break;
-			}
-		}
-		break;
-		
-		case LLViewerMediaObserver::MEDIA_EVENT_NAVIGATE_COMPLETE:
-		{
-			switch(impl->getNavState())
-			{
-				case LLViewerMediaImpl::MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED:
-				{
-					// This is the first location changed event after the start of a non-server-directed nav.  It may need to be broadcast or bounced back.
-					mediaNavigated(impl, plugin, plugin->getNavigateURI());
-				}
-				break;
-				
-				case LLViewerMediaImpl::MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED_SPURIOUS:
-					// This navigate didn't change the current URL.  
-					LL_DEBUGS("MediaOnAPrim") << "	NOT broadcasting navigate (spurious)" << LL_ENDL;
-				break;
-
-				case LLViewerMediaImpl::MEDIANAVSTATE_SERVER_COMPLETE_BEFORE_LOCATION_CHANGED:
-					// This is the the navigate complete event from a server-directed nav.  Don't broadcast it.
-					LL_INFOS("MediaOnAPrim") << "	NOT broadcasting navigate (server-directed)" << LL_ENDL;
-				break;
-				
-				default:
-					// For all other states, the navigate should have been handled by LOCATION_CHANGED events already.
-				break;
-			}
-		}
-		break;
-		
-		default:
-		break;
-	}
-
-}
-
-void LLVOVolume::sendMediaDataUpdate()
-{
-    if (sObjectMediaClient)
-		sObjectMediaClient->updateMedia(new LLMediaDataClientObjectImpl(this, false));
-}
-
-void LLVOVolume::removeMediaImpl(S32 texture_index)
-{
-	if(mMediaImplList.size() <= (U32)texture_index || mMediaImplList[texture_index].isNull())
-	{
-		return ;
-	}
-
-	//make the face referencing to mMediaImplList[texture_index] to point back to the old texture.
-	if(mDrawable && texture_index < mDrawable->getNumFaces())
-	{
-		LLFace* facep = mDrawable->getFace(texture_index) ;
-		if(facep)
-		{
-			LLViewerMediaTexture* media_tex = LLViewerTextureManager::findMediaTexture(mMediaImplList[texture_index]->getMediaTextureID()) ;
-			if(media_tex)
-			{
-				media_tex->removeMediaFromFace(facep) ;
-			}
-		}
-	}		
-	
-	//check if some other face(s) of this object reference(s)to this media impl.
-	S32 i ;
-	S32 end = (S32)mMediaImplList.size() ;
-	for(i = 0; i < end ; i++)
-	{
-		if( i != texture_index && mMediaImplList[i] == mMediaImplList[texture_index])
-		{
-			break ;
-		}
-	}
-
-	if(i == end) //this object does not need this media impl.
-	{
-		mMediaImplList[texture_index]->removeObject(this) ;
-	}
-
-	mMediaImplList[texture_index] = NULL ;
-	return ;
-}
-
-void LLVOVolume::addMediaImpl(LLViewerMediaImpl* media_impl, S32 texture_index)
-{
-	if((S32)mMediaImplList.size() < texture_index + 1)
-	{
-		mMediaImplList.resize(texture_index + 1) ;
-	}
-	
-	if(mMediaImplList[texture_index].notNull())
-	{
-		if(mMediaImplList[texture_index] == media_impl)
-		{
-			return ;
-		}
-
-		removeMediaImpl(texture_index) ;
-	}
-
-	mMediaImplList[texture_index] = media_impl;
-	media_impl->addObject(this) ;	
-
-	//add the face to show the media if it is in playing
-	if(mDrawable)
-	{
-		LLFace* facep = mDrawable->getFace(texture_index) ;
-		if(facep)
-		{
-			LLViewerMediaTexture* media_tex = LLViewerTextureManager::findMediaTexture(mMediaImplList[texture_index]->getMediaTextureID()) ;
-			if(media_tex)
-			{
-				media_tex->addMediaToFace(facep) ;
-			}
-		}
-		else //the face is not available now, start media on this face later.
-		{
-			media_impl->setUpdated(TRUE) ;
-		}
-	}
-	return ;
-}
-
-viewer_media_t LLVOVolume::getMediaImpl(U8 face_id) const
-{
-	if(mMediaImplList.size() > face_id)
-	{
-		return mMediaImplList[face_id];
-	}
-	return NULL;
-}
-
-F64 LLVOVolume::getTotalMediaInterest() const
-{
-	// If this object is currently focused, this object has "high" interest
-	if (LLViewerMediaFocus::getInstance()->getFocusedObjectID() == getID())
-		return F64_MAX;
-	
-	F64 interest = (F64)-1.0;  // means not interested;
-    
-	// If this object is selected, this object has "high" interest, but since 
-	// there can be more than one, we still add in calculated impl interest
-	// XXX Sadly, 'contains()' doesn't take a const :(
-	if (LLSelectMgr::getInstance()->getSelection()->contains(const_cast<LLVOVolume*>(this)))
-		interest = F64_MAX / 2.0;
-	
-	int i = 0;
-	const int end = getNumTEs();
-	for ( ; i < end; ++i)
-	{
-		const viewer_media_t &impl = getMediaImpl(i);
-		if (!impl.isNull())
-		{
-			if (interest == (F64)-1.0) interest = (F64)0.0;
-			interest += impl->getInterest();
-		}
-	}
-	return interest;
-}
-
-S32 LLVOVolume::getFaceIndexWithMediaImpl(const LLViewerMediaImpl* media_impl, S32 start_face_id)
-{
-	S32 end = (S32)mMediaImplList.size() ;
-	for(S32 face_id = start_face_id + 1; face_id < end; face_id++)
-	{
-		if(mMediaImplList[face_id] == media_impl)
-		{
-			return face_id ;
-		}
-	}
-	return -1 ;
-}
-
-//----------------------------------------------------------------------------
-
-void LLVOVolume::setLightTextureID(LLUUID id)
-{
-	if (id.notNull())
-	{
-		if (!hasLightTexture())
-		{
-			setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE, TRUE, true);
-		}
-		LLLightImageParams* param_block = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
-		if (param_block && param_block->getLightTexture() != id)
-		{
-			param_block->setLightTexture(id);
-			parameterChanged(LLNetworkData::PARAMS_LIGHT_IMAGE, true);
-		}
-	}
-	else
-	{
-		if (hasLightTexture())
-		{
-			setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE, FALSE, true);
-			mLightTexture = NULL;
-		}
-	}		
-}
-
-void LLVOVolume::setSpotLightParams(LLVector3 params)
-{
-	LLLightImageParams* param_block = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
-	if (param_block && param_block->getParams() != params)
-	{
-		param_block->setParams(params);
-		parameterChanged(LLNetworkData::PARAMS_LIGHT_IMAGE, true);
-	}
-}
-		
-void LLVOVolume::setIsLight(BOOL is_light)
-{
-	if (is_light != getIsLight())
-	{
-		if (is_light)
-		{
-			setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT, TRUE, true);
-		}
-		else
-		{
-			setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT, FALSE, true);
-		}
-
-		if (is_light)
-		{
-			// Add it to the pipeline mLightSet
-			gPipeline.setLight(mDrawable, TRUE);
-		}
-		else
-		{
-			// Not a light.  Remove it from the pipeline's light set.
-			gPipeline.setLight(mDrawable, FALSE);
-		}
-	}
-}
-
-void LLVOVolume::setLightColor(const LLColor3& color)
-{
-	LLLightParams *param_block = (LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
-	if (param_block)
-	{
-		if (param_block->getColor() != color)
-		{
-			param_block->setColor(LLColor4(color, param_block->getColor().mV[3]));
-			parameterChanged(LLNetworkData::PARAMS_LIGHT, true);
-			gPipeline.markTextured(mDrawable);
-			mFaceMappingChanged = TRUE;
-		}
-	}
-}
-
-void LLVOVolume::setLightIntensity(F32 intensity)
-{
-	LLLightParams *param_block = (LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
-	if (param_block)
-	{
-		if (param_block->getColor().mV[3] != intensity)
-		{
-			param_block->setColor(LLColor4(LLColor3(param_block->getColor()), intensity));
-			parameterChanged(LLNetworkData::PARAMS_LIGHT, true);
-		}
-	}
-}
-
-void LLVOVolume::setLightRadius(F32 radius)
-{
-	LLLightParams *param_block = (LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
-	if (param_block)
-	{
-		if (param_block->getRadius() != radius)
-		{
-			param_block->setRadius(radius);
-			parameterChanged(LLNetworkData::PARAMS_LIGHT, true);
-		}
-	}
-}
-
-void LLVOVolume::setLightFalloff(F32 falloff)
-{
-	LLLightParams *param_block = (LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
-	if (param_block)
-	{
-		if (param_block->getFalloff() != falloff)
-		{
-			param_block->setFalloff(falloff);
-			parameterChanged(LLNetworkData::PARAMS_LIGHT, true);
-		}
-	}
-}
-
-void LLVOVolume::setLightCutoff(F32 cutoff)
-{
-	LLLightParams *param_block = (LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
-	if (param_block)
-	{
-		if (param_block->getCutoff() != cutoff)
-		{
-			param_block->setCutoff(cutoff);
-			parameterChanged(LLNetworkData::PARAMS_LIGHT, true);
-		}
-	}
-}
-
-//----------------------------------------------------------------------------
-
-BOOL LLVOVolume::getIsLight() const
-{
-	return getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT);
-}
-
-LLColor3 LLVOVolume::getLightBaseColor() const
-{
-	const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
-	if (param_block)
-	{
-		return LLColor3(param_block->getColor());
-	}
-	else
-	{
-		return LLColor3(1,1,1);
-	}
-}
-
-LLColor3 LLVOVolume::getLightColor() const
-{
-	const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
-	if (param_block)
-	{
-		return LLColor3(param_block->getColor()) * param_block->getColor().mV[3];
-	}
-	else
-	{
-		return LLColor3(1,1,1);
-	}
-}
-
-LLUUID LLVOVolume::getLightTextureID() const
-{
-	if (getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE))
-	{
-		const LLLightImageParams *param_block = (const LLLightImageParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
-		if (param_block)
-		{
-			return param_block->getLightTexture();
-		}
-	}
-	
-	return LLUUID::null;
-}
-
-
-LLVector3 LLVOVolume::getSpotLightParams() const
-{
-	if (getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE))
-	{
-		const LLLightImageParams *param_block = (const LLLightImageParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
-		if (param_block)
-		{
-			return param_block->getParams();
-		}
-	}
-	
-	return LLVector3();
-}
-
-F32 LLVOVolume::getSpotLightPriority() const
-{
-	return mSpotLightPriority;
-}
-
-void LLVOVolume::updateSpotLightPriority()
-{
-	LLVector3 pos = mDrawable->getPositionAgent();
-	LLVector3 at(0,0,-1);
-	at *= getRenderRotation();
-
-	F32 r = getLightRadius()*0.5f;
-
-	pos += at * r;
-
-	at = LLViewerCamera::getInstance()->getAtAxis();
-
-	pos -= at * r;
-	
-	mSpotLightPriority = gPipeline.calcPixelArea(pos, LLVector3(r,r,r), *LLViewerCamera::getInstance());
-
-	if (mLightTexture.notNull())
-	{
-		mLightTexture->addTextureStats(mSpotLightPriority);
-		mLightTexture->setBoostLevel(LLViewerTexture::BOOST_CLOUDS);
-	}
-}
-
-
-bool LLVOVolume::isLightSpotlight() const
-{
-	LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
-	if (params)
-	{
-		return params->isLightSpotlight();
-	}
-	return false;
-}
-
-
-LLViewerTexture* LLVOVolume::getLightTexture()
-{
-	LLUUID id = getLightTextureID();
-
-	if (id.notNull())
-	{
-		if (mLightTexture.isNull() || id != mLightTexture->getID())
-		{
-			mLightTexture = LLViewerTextureManager::getFetchedTexture(id);
-		}
-	}
-	else
-	{
-		mLightTexture = NULL;
-	}
-
-	return mLightTexture;
-}
-
-F32 LLVOVolume::getLightIntensity() const
-{
-	const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
-	if (param_block)
-	{
-		return param_block->getColor().mV[3];
-	}
-	else
-	{
-		return 1.f;
-	}
-}
-
-F32 LLVOVolume::getLightRadius() const
-{
-	const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
-	if (param_block)
-	{
-		return param_block->getRadius();
-	}
-	else
-	{
-		return 0.f;
-	}
-}
-
-F32 LLVOVolume::getLightFalloff() const
-{
-	const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
-	if (param_block)
-	{
-		return param_block->getFalloff();
-	}
-	else
-	{
-		return 0.f;
-	}
-}
-
-F32 LLVOVolume::getLightCutoff() const
-{
-	const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
-	if (param_block)
-	{
-		return param_block->getCutoff();
-	}
-	else
-	{
-		return 0.f;
-	}
-}
-
-U32 LLVOVolume::getVolumeInterfaceID() const
-{
-	if (mVolumeImpl)
-	{
-		return mVolumeImpl->getID();
-	}
-
-	return 0;
-}
-
-BOOL LLVOVolume::isFlexible() const
-{
-	if (getParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE))
-	{
-		LLVolume* volume = getVolume();
-		if (volume && volume->getParams().getPathParams().getCurveType() != LL_PCODE_PATH_FLEXIBLE)
-		{
-			LLVolumeParams volume_params = getVolume()->getParams();
-			U8 profile_and_hole = volume_params.getProfileParams().getCurveType();
-			volume_params.setType(profile_and_hole, LL_PCODE_PATH_FLEXIBLE);
-		}
-		return TRUE;
-	}
-	else
-	{
-		return FALSE;
-	}
-}
-
-BOOL LLVOVolume::isSculpted() const
-{
-	if (getParameterEntryInUse(LLNetworkData::PARAMS_SCULPT))
-	{
-		return TRUE;
-	}
-	
-	return FALSE;
-}
-
-BOOL LLVOVolume::isMesh() const
-{
-	if (isSculpted())
-	{
-		LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT);
-		U8 sculpt_type = sculpt_params->getSculptType();
-
-		if ((sculpt_type & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH)
-			// mesh is a mesh
-		{
-			return TRUE;	
-		}
-	}
-
-	return FALSE;
-}
-
-BOOL LLVOVolume::hasLightTexture() const
-{
-	if (getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE))
-	{
-		return TRUE;
-	}
-
-	return FALSE;
-}
-
-BOOL LLVOVolume::isVolumeGlobal() const
-{
-	if (mVolumeImpl)
-	{
-		return mVolumeImpl->isVolumeGlobal() ? TRUE : FALSE;
-	}
-	else if (mRiggedVolume.notNull())
-	{
-		return TRUE;
-	}
-
-	return FALSE;
-}
-
-BOOL LLVOVolume::canBeFlexible() const
-{
-	U8 path = getVolume()->getParams().getPathParams().getCurveType();
-	return (path == LL_PCODE_PATH_FLEXIBLE || path == LL_PCODE_PATH_LINE);
-}
-
-BOOL LLVOVolume::setIsFlexible(BOOL is_flexible)
-{
-	BOOL res = FALSE;
-	BOOL was_flexible = isFlexible();
-	LLVolumeParams volume_params;
-	if (is_flexible)
-	{
-		if (!was_flexible)
-		{
-			volume_params = getVolume()->getParams();
-			U8 profile_and_hole = volume_params.getProfileParams().getCurveType();
-			volume_params.setType(profile_and_hole, LL_PCODE_PATH_FLEXIBLE);
-			res = TRUE;
-			setFlags(FLAGS_USE_PHYSICS, FALSE);
-			setFlags(FLAGS_PHANTOM, TRUE);
-			setParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE, TRUE, true);
-			if (mDrawable)
-			{
-				mDrawable->makeActive();
-			}
-		}
-	}
-	else
-	{
-		if (was_flexible)
-		{
-			volume_params = getVolume()->getParams();
-			U8 profile_and_hole = volume_params.getProfileParams().getCurveType();
-			volume_params.setType(profile_and_hole, LL_PCODE_PATH_LINE);
-			res = TRUE;
-			setFlags(FLAGS_PHANTOM, FALSE);
-			setParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE, FALSE, true);
-		}
-	}
-	if (res)
-	{
-		res = setVolume(volume_params, 1);
-		if (res)
-		{
-			markForUpdate(TRUE);
-		}
-	}
-	return res;
-}
-
-//----------------------------------------------------------------------------
-
-void LLVOVolume::generateSilhouette(LLSelectNode* nodep, const LLVector3& view_point)
-{
-	LLVolume *volume = getVolume();
-
-	if (volume)
-	{
-		LLVector3 view_vector;
-		view_vector = view_point; 
-
-		//transform view vector into volume space
-		view_vector -= getRenderPosition();
-		mDrawable->mDistanceWRTCamera = view_vector.length();
-		LLQuaternion worldRot = getRenderRotation();
-		view_vector = view_vector * ~worldRot;
-		if (!isVolumeGlobal())
-		{
-			LLVector3 objScale = getScale();
-			LLVector3 invObjScale(1.f / objScale.mV[VX], 1.f / objScale.mV[VY], 1.f / objScale.mV[VZ]);
-			view_vector.scaleVec(invObjScale);
-		}
-		
-		updateRelativeXform();
-		LLMatrix4 trans_mat = mRelativeXform;
-		if (mDrawable->isStatic())
-		{
-			trans_mat.translate(getRegion()->getOriginAgent());
-		}
-
-		volume->generateSilhouetteVertices(nodep->mSilhouetteVertices, nodep->mSilhouetteNormals, view_vector, trans_mat, mRelativeXformInvTrans, nodep->getTESelectMask());
-
-		nodep->mSilhouetteExists = TRUE;
-	}
-}
-
-void LLVOVolume::deleteFaces()
-{
-	S32 face_count = mNumFaces;
-	if (mDrawable.notNull())
-	{
-		mDrawable->deleteFaces(0, face_count);
-	}
-
-	mNumFaces = 0;
-}
-
-void LLVOVolume::updateRadius()
-{
-	if (mDrawable.isNull())
-	{
-		return;
-	}
-	
-	mVObjRadius = getScale().length();
-	mDrawable->setRadius(mVObjRadius);
-}
-
-
-BOOL LLVOVolume::isAttachment() const
-{
-	return mState != 0 ;
-}
-
-BOOL LLVOVolume::isHUDAttachment() const
-{
-	// *NOTE: we assume hud attachment points are in defined range
-	// since this range is constant for backwards compatibility
-	// reasons this is probably a reasonable assumption to make
-	S32 attachment_id = ATTACHMENT_ID_FROM_STATE(mState);
-	return ( attachment_id >= 31 && attachment_id <= 38 );
-}
-
-
-const LLMatrix4 LLVOVolume::getRenderMatrix() const
-{
-	if (mDrawable->isActive() && !mDrawable->isRoot())
-	{
-		return mDrawable->getParent()->getWorldMatrix();
-	}
-	return mDrawable->getWorldMatrix();
-}
-
-// Returns a base cost and adds textures to passed in set.
-// total cost is returned value + 5 * size of the resulting set.
-// Cannot include cost of textures, as they may be re-used in linked
-// children, and cost should only be increased for unique textures  -Nyx
-U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
-{
-	// Get access to params we'll need at various points.  
-	// Skip if this is object doesn't have a volume (e.g. is an avatar).
-	BOOL has_volume = (getVolume() != NULL);
-	LLVolumeParams volume_params;
-	LLPathParams path_params;
-	LLProfileParams profile_params;
-
-	U32 num_triangles = 0;
-
-	// per-prim costs
-	static const U32 ARC_PARTICLE_COST = 1; // determined experimentally
-	static const U32 ARC_PARTICLE_MAX = 2048; // default values
-	static const U32 ARC_TEXTURE_COST = 16; // multiplier for texture resolution - performance tested
-	static const U32 ARC_LIGHT_COST = 500; // static cost for light-producing prims 
-	static const U32 ARC_MEDIA_FACE_COST = 1500; // static cost per media-enabled face 
-
-
-	// per-prim multipliers
-	static const F32 ARC_GLOW_MULT = 1.5f; // tested based on performance
-	static const F32 ARC_BUMP_MULT = 1.25f; // tested based on performance
-	static const F32 ARC_FLEXI_MULT = 5; // tested based on performance
-	static const F32 ARC_SHINY_MULT = 1.6f; // tested based on performance
-	static const F32 ARC_INVISI_COST = 1.2f; // tested based on performance
-	static const F32 ARC_WEIGHTED_MESH = 1.2f; // tested based on performance
-
-	static const F32 ARC_PLANAR_COST = 1.0f; // tested based on performance to have negligible impact
-	static const F32 ARC_ANIM_TEX_COST = 4.f; // tested based on performance
-	static const F32 ARC_ALPHA_COST = 4.f; // 4x max - based on performance
-
-	F32 shame = 0;
-
-	U32 invisi = 0;
-	U32 shiny = 0;
-	U32 glow = 0;
-	U32 alpha = 0;
-	U32 flexi = 0;
-	U32 animtex = 0;
-	U32 particles = 0;
-	U32 bump = 0;
-	U32 planar = 0;
-	U32 weighted_mesh = 0;
-	U32 produces_light = 0;
-	U32 media_faces = 0;
-
-	// these multipliers are variable and can be floating point
-	F32 scale = 0.f;
-
-	const LLDrawable* drawablep = mDrawable;
-	U32 num_faces = drawablep->getNumFaces();
-
-	if (has_volume)
-	{
-		volume_params = getVolume()->getParams();
-		path_params = volume_params.getPathParams();
-		profile_params = volume_params.getProfileParams();
-
-		F32 weighted_triangles = -1.0;
-		getStreamingCost(NULL, NULL, &weighted_triangles);
-
-		if (weighted_triangles > 0.0)
-		{
-			num_triangles = (U32)(weighted_triangles * 2); // scale weighted triangles to match the recorded scale.
-															// a complex prim (tortured torus, sculptie) should be 1000-1200 points @ 5 m
-		}
-	}
-
-	if (num_triangles == 0)
-	{
-		num_triangles = 4;
-	}
-
-	if (isSculpted())
-	{
-		if (isMesh())
-		{
-			// base cost is dependent on mesh complexity
-			// note that 3 is the highest LOD as of the time of this coding.
-			S32 size = gMeshRepo.getMeshSize(volume_params.getSculptID(),3);
-			if ( size > 0)
-			{
-				if (gMeshRepo.getSkinInfo(volume_params.getSculptID(), this))
-				{
-					// weighted attachment - 1 point for every 3 bytes
-					weighted_mesh = 1;
-				}
-
-			}
-			else
-			{
-				// something went wrong - user should know their content isn't render-free
-				return 0;
-			}
-		}
-		else
-		{
-			const LLSculptParams *sculpt_params = (LLSculptParams *) getParameterEntry(LLNetworkData::PARAMS_SCULPT);
-			LLUUID sculpt_id = sculpt_params->getSculptTexture();
-			if (textures.find(sculpt_id) == textures.end())
-			{
-				LLViewerFetchedTexture *texture = LLViewerTextureManager::getFetchedTexture(sculpt_id);
-				if (texture)
-				{
-					S32 texture_cost = 256 + (S32)(ARC_TEXTURE_COST * (texture->getFullHeight() / 128.f + texture->getFullWidth() / 128.f));
-					textures.insert(texture_cost_t::value_type(sculpt_id, texture_cost));
-				}
-			}
-		}
-	}
-
-	if (isFlexible())
-	{
-		flexi = 1;
-	}
-	if (isParticleSource())
-	{
-		particles = 1;
-	}
-
-	if (getIsLight())
-	{
-		produces_light = 1;
-	}
-
-	const LLVector3& sc = getScale();
-	scale += (sc.mV[0] + sc.mV[1] + sc.mV[2]) / 4.f; // scale to 1/4 the sum of the size
-	// enforce scale multiplier to be in the range [1,7] (7 was determined to experimentally be a reasonable max)
-	scale = scale > 7.f ? 7.f : scale;
-	scale = scale < 1.f ? 1.f : scale;
-
-	for (S32 i = 0; i < num_faces; ++i)
-	{
-		const LLFace* face = drawablep->getFace(i);
-		const LLTextureEntry* te = face->getTextureEntry();
-		const LLViewerTexture* img = face->getTexture();
-
-		if (img)
-		{
-			if (textures.find(img->getID()) == textures.end())
-			{
-				S32 texture_cost = 256 + (S32)(ARC_TEXTURE_COST * (img->getFullHeight() / 128.f + img->getFullWidth() / 128.f));
-				textures.insert(texture_cost_t::value_type(img->getID(), texture_cost));
-			}
-		}
-
-		if (face->getPoolType() == LLDrawPool::POOL_ALPHA)
-		{
-			alpha = 1;
-		}
-		else if (img && img->getPrimaryFormat() == GL_ALPHA)
-		{
-			invisi = 1;
-		}
-		if (face->hasMedia())
-		{
-			media_faces++;
-		}
-
-		if (te)
-		{
-			if (te->getBumpmap())
-			{
-				// bump is a multiplier, don't add per-face
-				bump = 1;
-			}
-			if (te->getShiny())
-			{
-				// shiny is a multiplier, don't add per-face
-				shiny = 1;
-			}
-			if (te->getGlow() > 0.f)
-			{
-				// glow is a multiplier, don't add per-face
-				glow = 1;
-			}
-			if (face->mTextureMatrix != NULL)
-			{
-				animtex = 1;
-			}
-			if (te->getTexGen())
-			{
-				planar = 1;
-			}
-		}
-	}
-
-	// shame currently has the "base" cost of 1 point per 15 triangles, min 2.
-	shame = num_triangles / 15.f;
-	shame = shame < 2.f ? 2.f : shame;
-
-	// factor in scale
-	shame *= scale;
-
-	// multiply by per-face modifiers
-	if (planar)
-	{
-		shame *= planar * ARC_PLANAR_COST;
-	}
-
-	if (animtex)
-	{
-		shame *= animtex * ARC_ANIM_TEX_COST;
-	}
-
-	if (alpha)
-	{
-		shame *= alpha * ARC_ALPHA_COST;
-	}
-
-	if(invisi)
-	{
-		shame *= invisi * ARC_INVISI_COST;
-	}
-
-	if (glow)
-	{
-		shame *= glow * ARC_GLOW_MULT;
-	}
-
-	if (bump)
-	{
-		shame *= bump * ARC_BUMP_MULT;
-	}
-
-	if (shiny)
-	{
-		shame *= shiny * ARC_SHINY_MULT;
-	}
-
-
-	// multiply shame by multipliers
-	if (weighted_mesh)
-	{
-		shame *= weighted_mesh * ARC_WEIGHTED_MESH;
-	}
-
-	if (flexi)
-	{
-		shame *= flexi * ARC_FLEXI_MULT;
-	}
-
-
-	// add additional costs
-	if (particles)
-	{
-		const LLPartSysData *part_sys_data = &(mPartSourcep->mPartSysData);
-		const LLPartData *part_data = &(part_sys_data->mPartData);
-		U32 num_particles = (U32)(part_sys_data->mBurstPartCount * llceil( part_data->mMaxAge / part_sys_data->mBurstRate));
-		num_particles = num_particles > ARC_PARTICLE_MAX ? ARC_PARTICLE_MAX : num_particles;
-		F32 part_size = (llmax(part_data->mStartScale[0], part_data->mEndScale[0]) + llmax(part_data->mStartScale[1], part_data->mEndScale[1])) / 2.f;
-		shame += num_particles * part_size * ARC_PARTICLE_COST;
-	}
-
-	if (produces_light)
-	{
-		shame += ARC_LIGHT_COST;
-	}
-
-	if (media_faces)
-	{
-		shame += media_faces * ARC_MEDIA_FACE_COST;
-	}
-
-	if (shame > mRenderComplexity_current)
-	{
-		mRenderComplexity_current = (S32)shame;
-	}
-
-	return (U32)shame;
-}
-
-F32 LLVOVolume::getStreamingCost(S32* bytes, S32* visible_bytes, F32* unscaled_value) const
-{
-	F32 radius = getScale().length()*0.5f;
-
-	if (isMesh())
-	{	
-		LLSD& header = gMeshRepo.getMeshHeader(getVolume()->getParams().getSculptID());
-
-		return LLMeshRepository::getStreamingCost(header, radius, bytes, visible_bytes, mLOD, unscaled_value);
-	}
-	else
-	{
-		LLVolume* volume = getVolume();
-		S32 counts[4];
-		LLVolume::getLoDTriangleCounts(volume->getParams(), counts);
-
-		LLSD header;
-		header["lowest_lod"]["size"] = counts[0] * 10;
-		header["low_lod"]["size"] = counts[1] * 10;
-		header["medium_lod"]["size"] = counts[2] * 10;
-		header["high_lod"]["size"] = counts[3] * 10;
-
-		return LLMeshRepository::getStreamingCost(header, radius, NULL, NULL, -1, unscaled_value);
-	}	
-}
-
-//static 
-void LLVOVolume::updateRenderComplexity()
-{
-	mRenderComplexity_last = mRenderComplexity_current;
-	mRenderComplexity_current = 0;
-}
-
-U32 LLVOVolume::getTriangleCount() const
-{
-	U32 count = 0;
-	LLVolume* volume = getVolume();
-	if (volume)
-	{
-		count = volume->getNumTriangles();
-	}
-
-	return count;
-}
-
-U32 LLVOVolume::getHighLODTriangleCount()
-{
-	U32 ret = 0;
-
-	LLVolume* volume = getVolume();
-
-	if (!isSculpted())
-	{
-		LLVolume* ref = LLPrimitive::getVolumeManager()->refVolume(volume->getParams(), 3);
-		ret = ref->getNumTriangles();
-		LLPrimitive::getVolumeManager()->unrefVolume(ref);
-	}
-	else if (isMesh())
-	{
-		LLVolume* ref = LLPrimitive::getVolumeManager()->refVolume(volume->getParams(), 3);
-		if (!ref->isMeshAssetLoaded() || ref->getNumVolumeFaces() == 0)
-		{
-			gMeshRepo.loadMesh(this, volume->getParams(), LLModel::LOD_HIGH);
-		}
-		ret = ref->getNumTriangles();
-		LLPrimitive::getVolumeManager()->unrefVolume(ref);
-	}
-	else
-	{ //default sculpts have a constant number of triangles
-		ret = 31*2*31;  //31 rows of 31 columns of quads for a 32x32 vertex patch
-	}
-
-	return ret;
-}
-
-//static
-void LLVOVolume::preUpdateGeom()
-{
-	sNumLODChanges = 0;
-}
-
-void LLVOVolume::parameterChanged(U16 param_type, bool local_origin)
-{
-	LLViewerObject::parameterChanged(param_type, local_origin);
-}
-
-void LLVOVolume::parameterChanged(U16 param_type, LLNetworkData* data, BOOL in_use, bool local_origin)
-{
-	LLViewerObject::parameterChanged(param_type, data, in_use, local_origin);
-	if (mVolumeImpl)
-	{
-		mVolumeImpl->onParameterChanged(param_type, data, in_use, local_origin);
-	}
-	if (mDrawable.notNull())
-	{
-		BOOL is_light = getIsLight();
-		if (is_light != mDrawable->isState(LLDrawable::LIGHT))
-		{
-			gPipeline.setLight(mDrawable, is_light);
-		}
-	}
-}
-
-void LLVOVolume::setSelected(BOOL sel)
-{
-	LLViewerObject::setSelected(sel);
-	if (mDrawable.notNull())
-	{
-		markForUpdate(TRUE);
-	}
-}
-
-void LLVOVolume::updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax)
-{		
-}
-
-F32 LLVOVolume::getBinRadius()
-{
-	F32 radius;
-	
-	F32 scale = 1.f;
-
-	S32 size_factor = llmax(gSavedSettings.getS32("OctreeStaticObjectSizeFactor"), 1);
-	S32 attachment_size_factor = llmax(gSavedSettings.getS32("OctreeAttachmentSizeFactor"), 1);
-	LLVector3 distance_factor = gSavedSettings.getVector3("OctreeDistanceFactor");
-	LLVector3 alpha_distance_factor = gSavedSettings.getVector3("OctreeAlphaDistanceFactor");
-	const LLVector4a* ext = mDrawable->getSpatialExtents();
-	
-	BOOL shrink_wrap = mDrawable->isAnimating();
-	BOOL alpha_wrap = FALSE;
-
-	if (!isHUDAttachment())
-	{
-		for (S32 i = 0; i < mDrawable->getNumFaces(); i++)
-		{
-			LLFace* face = mDrawable->getFace(i);
-			if (face->getPoolType() == LLDrawPool::POOL_ALPHA &&
-			    !face->canRenderAsMask())
-			{
-				alpha_wrap = TRUE;
-				break;
-			}
-		}
-	}
-	else
-	{
-		shrink_wrap = FALSE;
-	}
-
-	if (alpha_wrap)
-	{
-		LLVector3 bounds = getScale();
-		radius = llmin(bounds.mV[1], bounds.mV[2]);
-		radius = llmin(radius, bounds.mV[0]);
-		radius *= 0.5f;
-		radius *= 1.f+mDrawable->mDistanceWRTCamera*alpha_distance_factor[1];
-		radius += mDrawable->mDistanceWRTCamera*alpha_distance_factor[0];
-	}
-	else if (shrink_wrap)
-	{
-		LLVector4a rad;
-		rad.setSub(ext[1], ext[0]);
-		
-		radius = rad.getLength3().getF32()*0.5f;
-	}
-	else if (mDrawable->isStatic())
-	{
-		radius = llmax((S32) mDrawable->getRadius(), 1)*size_factor;
-		radius *= 1.f + mDrawable->mDistanceWRTCamera * distance_factor[1];
-		radius += mDrawable->mDistanceWRTCamera * distance_factor[0];
-	}
-	else if (mDrawable->getVObj()->isAttachment())
-	{
-		radius = llmax((S32) mDrawable->getRadius(),1)*attachment_size_factor;
-	}
-	else
-	{
-		radius = mDrawable->getRadius();
-		radius *= 1.f + mDrawable->mDistanceWRTCamera * distance_factor[1];
-		radius += mDrawable->mDistanceWRTCamera * distance_factor[0];
-	}
-
-	return llclamp(radius*scale, 0.5f, 256.f);
-}
-
-const LLVector3 LLVOVolume::getPivotPositionAgent() const
-{
-	if (mVolumeImpl)
-	{
-		return mVolumeImpl->getPivotPosition();
-	}
-	return LLViewerObject::getPivotPositionAgent();
-}
-
-void LLVOVolume::onShift(const LLVector4a &shift_vector)
-{
-	if (mVolumeImpl)
-	{
-		mVolumeImpl->onShift(shift_vector);
-	}
-
-	updateRelativeXform();
-}
-
-const LLMatrix4& LLVOVolume::getWorldMatrix(LLXformMatrix* xform) const
-{
-	if (mVolumeImpl)
-	{
-		return mVolumeImpl->getWorldMatrix(xform);
-	}
-	return xform->getWorldMatrix();
-}
-
-LLVector3 LLVOVolume::agentPositionToVolume(const LLVector3& pos) const
-{
-	LLVector3 ret = pos - getRenderPosition();
-	ret = ret * ~getRenderRotation();
-	LLVector3 objScale = isVolumeGlobal() ? LLVector3(1,1,1) : getScale();
-	LLVector3 invObjScale(1.f / objScale.mV[VX], 1.f / objScale.mV[VY], 1.f / objScale.mV[VZ]);
-	ret.scaleVec(invObjScale);
-	
-	return ret;
-}
-
-LLVector3 LLVOVolume::agentDirectionToVolume(const LLVector3& dir) const
-{
-	LLVector3 ret = dir * ~getRenderRotation();
-	
-	LLVector3 objScale = isVolumeGlobal() ? LLVector3(1,1,1) : getScale();
-	ret.scaleVec(objScale);
-
-	return ret;
-}
-
-LLVector3 LLVOVolume::volumePositionToAgent(const LLVector3& dir) const
-{
-	LLVector3 ret = dir;
-	LLVector3 objScale = isVolumeGlobal() ? LLVector3(1,1,1) : getScale();
-	ret.scaleVec(objScale);
-	ret = ret * getRenderRotation();
-	ret += getRenderPosition();
-	
-	return ret;
-}
-
-LLVector3 LLVOVolume::volumeDirectionToAgent(const LLVector3& dir) const
-{
-	LLVector3 ret = dir;
-	LLVector3 objScale = isVolumeGlobal() ? LLVector3(1,1,1) : getScale();
-	LLVector3 invObjScale(1.f / objScale.mV[VX], 1.f / objScale.mV[VY], 1.f / objScale.mV[VZ]);
-	ret.scaleVec(invObjScale);
-	ret = ret * getRenderRotation();
-
-	return ret;
-}
-
-
-BOOL LLVOVolume::lineSegmentIntersect(const LLVector3& start, const LLVector3& end, S32 face, BOOL pick_transparent, S32 *face_hitp,
-									  LLVector3* intersection,LLVector2* tex_coord, LLVector3* normal, LLVector3* bi_normal)
-	
-{
-	if (!mbCanSelect 
-		|| mDrawable->isDead() 
-		|| !gPipeline.hasRenderType(mDrawable->getRenderType()))
-	{
-		return FALSE;
-	}
-
-	BOOL ret = FALSE;
-
-	LLVolume* volume = getVolume();
-
-	bool transform = true;
-
-	if (mDrawable->isState(LLDrawable::RIGGED))
-	{
-		if (LLFloater::isVisible(gFloaterTools) && getAvatar()->isSelf())
-		{
-			updateRiggedVolume();
-			genBBoxes(FALSE);
-			volume = mRiggedVolume;
-			transform = false;
-		}
-		else
-		{ //cannot pick rigged attachments on other avatars or when not in build mode
-			return FALSE;
-		}
-	}
-	
-	if (volume)
-	{	
-		LLVector3 v_start, v_end, v_dir;
-	
-		if (transform)
-		{
-			v_start = agentPositionToVolume(start);
-			v_end = agentPositionToVolume(end);
-		}
-		else
-		{
-			v_start = start;
-			v_end = end;
-		}
-		
-		LLVector3 p;
-		LLVector3 n;
-		LLVector2 tc;
-		LLVector3 bn;
-
-		if (intersection != NULL)
-		{
-			p = *intersection;
-		}
-
-		if (tex_coord != NULL)
-		{
-			tc = *tex_coord;
-		}
-
-		if (normal != NULL)
-		{
-			n = *normal;
-		}
-
-		if (bi_normal != NULL)
-		{
-			bn = *bi_normal;
-		}
-
-		S32 face_hit = -1;
-
-		S32 start_face, end_face;
-		if (face == -1)
-		{
-			start_face = 0;
-			end_face = volume->getNumVolumeFaces();
-		}
-		else
-		{
-			start_face = face;
-			end_face = face+1;
-		}
-
-		bool special_cursor = specialHoverCursor();
-		for (S32 i = start_face; i < end_face; ++i)
-		{
-			if (!special_cursor && !pick_transparent && getTE(i)->getColor().mV[3] == 0.f)
-			{ //don't attempt to pick completely transparent faces unless
-				//pick_transparent is true
-				continue;
-			}
-
-			face_hit = volume->lineSegmentIntersect(v_start, v_end, i,
-													&p, &tc, &n, &bn);
-			
-			if (face_hit >= 0 && mDrawable->getNumFaces() > face_hit)
-			{
-				LLFace* face = mDrawable->getFace(face_hit);				
-
-				if (pick_transparent || !face->getTexture() || !face->getTexture()->hasGLTexture() || face->getTexture()->getMask(face->surfaceToTexture(tc, p, n)))
-				{
-					v_end = p;
-					if (face_hitp != NULL)
-					{
-						*face_hitp = face_hit;
-					}
-					
-					if (intersection != NULL)
-					{
-						if (transform)
-						{
-							*intersection = volumePositionToAgent(p);  // must map back to agent space
-						}
-						else
-						{
-							*intersection = p;
-						}
-					}
-
-					if (normal != NULL)
-					{
-						if (transform)
-						{
-							*normal = volumeDirectionToAgent(n);
-						}
-						else
-						{
-							*normal = n;
-						}
-
-						(*normal).normVec();
-					}
-
-					if (bi_normal != NULL)
-					{
-						if (transform)
-						{
-							*bi_normal = volumeDirectionToAgent(bn);
-						}
-						else
-						{
-							*bi_normal = bn;
-						}
-						(*bi_normal).normVec();
-					}
-
-					if (tex_coord != NULL)
-					{
-						*tex_coord = tc;
-					}
-					
-					ret = TRUE;
-				}
-			}
-		}
-	}
-		
-	return ret;
-}
-
-bool LLVOVolume::treatAsRigged()
-{
-	return LLFloater::isVisible(gFloaterTools) && 
-			isAttachment() && 
-			getAvatar() &&
-			getAvatar()->isSelf() &&
-			mDrawable.notNull() &&
-			mDrawable->isState(LLDrawable::RIGGED);
-}
-
-LLRiggedVolume* LLVOVolume::getRiggedVolume()
-{
-	return mRiggedVolume;
-}
-
-void LLVOVolume::clearRiggedVolume()
-{
-	if (mRiggedVolume.notNull())
-	{
-		mRiggedVolume = NULL;
-		updateRelativeXform();
-	}
-}
-
-void LLVOVolume::updateRiggedVolume()
-{
-	//Update mRiggedVolume to match current animation frame of avatar. 
-	//Also update position/size in octree.  
-
-	if (!treatAsRigged())
-	{
-		clearRiggedVolume();
-		
-		return;
-	}
-
-	LLVolume* volume = getVolume();
-
-	const LLMeshSkinInfo* skin = gMeshRepo.getSkinInfo(volume->getParams().getSculptID(), this);
-
-	if (!skin)
-	{
-		clearRiggedVolume();
-		return;
-	}
-
-	LLVOAvatar* avatar = getAvatar();
-
-	if (!avatar)
-	{
-		clearRiggedVolume();
-		return;
-	}
-
-	if (!mRiggedVolume)
-	{
-		LLVolumeParams p;
-		mRiggedVolume = new LLRiggedVolume(p);
-		updateRelativeXform();
-	}
-
-	mRiggedVolume->update(skin, avatar, volume);
-
-}
-
-static LLFastTimer::DeclareTimer FTM_SKIN_RIGGED("Skin");
-static LLFastTimer::DeclareTimer FTM_RIGGED_OCTREE("Octree");
-
-void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, const LLVolume* volume)
-{
-	bool copy = false;
-	if (volume->getNumVolumeFaces() != getNumVolumeFaces())
-	{ 
-		copy = true;
-	}
-
-	for (S32 i = 0; i < volume->getNumVolumeFaces() && !copy; ++i)
-	{
-		const LLVolumeFace& src_face = volume->getVolumeFace(i);
-		const LLVolumeFace& dst_face = getVolumeFace(i);
-
-		if (src_face.mNumIndices != dst_face.mNumIndices ||
-			src_face.mNumVertices != dst_face.mNumVertices)
-		{
-			copy = true;
-		}
-	}
-
-	if (copy)
-	{
-		copyVolumeFaces(volume);	
-	}
-
-	//build matrix palette
-	LLMatrix4a mp[64];
-	LLMatrix4* mat = (LLMatrix4*) mp;
-	
-	for (U32 j = 0; j < skin->mJointNames.size(); ++j)
-	{
-		LLJoint* joint = avatar->getJoint(skin->mJointNames[j]);
-		if (joint)
-		{
-			mat[j] = skin->mInvBindMatrix[j];
-			mat[j] *= joint->getWorldMatrix();
-		}
-	}
-
-	for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i)
-	{
-		const LLVolumeFace& vol_face = volume->getVolumeFace(i);
-		
-		LLVolumeFace& dst_face = mVolumeFaces[i];
-		
-		LLVector4a* weight = vol_face.mWeights;
-
-		LLMatrix4a bind_shape_matrix;
-		bind_shape_matrix.loadu(skin->mBindShapeMatrix);
-
-		LLVector4a* pos = dst_face.mPositions;
-
-		{
-			LLFastTimer t(FTM_SKIN_RIGGED);
-
-			for (U32 j = 0; j < dst_face.mNumVertices; ++j)
-			{
-				LLMatrix4a final_mat;
-				final_mat.clear();
-
-				S32 idx[4];
-
-				LLVector4 wght;
-
-				F32 scale = 0.f;
-				for (U32 k = 0; k < 4; k++)
-				{
-					F32 w = weight[j][k];
-
-					idx[k] = (S32) floorf(w);
-					wght[k] = w - floorf(w);
-					scale += wght[k];
-				}
-
-				wght *= 1.f/scale;
-
-				for (U32 k = 0; k < 4; k++)
-				{
-					F32 w = wght[k];
-
-					LLMatrix4a src;
-					src.setMul(mp[idx[k]], w);
-
-					final_mat.add(src);
-				}
-
-				
-				LLVector4a& v = vol_face.mPositions[j];
-				LLVector4a t;
-				LLVector4a dst;
-				bind_shape_matrix.affineTransform(v, t);
-				final_mat.affineTransform(t, dst);
-				pos[j] = dst;
-			}
-
-			//update bounding box
-			LLVector4a& min = dst_face.mExtents[0];
-			LLVector4a& max = dst_face.mExtents[1];
-
-			min = pos[0];
-			max = pos[1];
-
-			for (U32 j = 1; j < dst_face.mNumVertices; ++j)
-			{
-				min.setMin(min, pos[j]);
-				max.setMax(max, pos[j]);
-			}
-
-			dst_face.mCenter->setAdd(dst_face.mExtents[0], dst_face.mExtents[1]);
-			dst_face.mCenter->mul(0.5f);
-
-		}
-
-		{
-			LLFastTimer t(FTM_RIGGED_OCTREE);
-			delete dst_face.mOctree;
-			dst_face.mOctree = NULL;
-
-			LLVector4a size;
-			size.setSub(dst_face.mExtents[1], dst_face.mExtents[0]);
-			size.splat(size.getLength3().getF32()*0.5f);
-			
-			dst_face.createOctree(1.f);
-		}
-	}
-}
-
-U32 LLVOVolume::getPartitionType() const
-{
-	if (isHUDAttachment())
-	{
-		return LLViewerRegion::PARTITION_HUD;
-	}
-
-	return LLViewerRegion::PARTITION_VOLUME;
-}
-
-LLVolumePartition::LLVolumePartition()
-: LLSpatialPartition(LLVOVolume::VERTEX_DATA_MASK, TRUE, GL_DYNAMIC_DRAW_ARB)
-{
-	mLODPeriod = 32;
-	mDepthMask = FALSE;
-	mDrawableType = LLPipeline::RENDER_TYPE_VOLUME;
-	mPartitionType = LLViewerRegion::PARTITION_VOLUME;
-	mSlopRatio = 0.25f;
-	mBufferUsage = GL_DYNAMIC_DRAW_ARB;
-}
-
-LLVolumeBridge::LLVolumeBridge(LLDrawable* drawablep)
-: LLSpatialBridge(drawablep, TRUE, LLVOVolume::VERTEX_DATA_MASK)
-{
-	mDepthMask = FALSE;
-	mLODPeriod = 32;
-	mDrawableType = LLPipeline::RENDER_TYPE_VOLUME;
-	mPartitionType = LLViewerRegion::PARTITION_BRIDGE;
-	
-	mBufferUsage = GL_DYNAMIC_DRAW_ARB;
-
-	mSlopRatio = 0.25f;
-}
-
-bool can_batch_texture(LLFace* facep)
-{
-	if (facep->getTextureEntry()->getBumpmap())
-	{ //bump maps aren't worked into texture batching yet
-		return false;
-	}
-
-	if (facep->getTexture() && facep->getTexture()->getPrimaryFormat() == GL_ALPHA)
-	{ //can't batch invisiprims
-		return false;
-	}
-
-	if (facep->isState(LLFace::TEXTURE_ANIM) && facep->getVirtualSize() > MIN_TEX_ANIM_SIZE)
-	{ //texture animation breaks batches
-		return false;
-	}
-	
-	return true;
-}
-
-void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, U32 type)
-{
-	LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
-
-	if (facep->getViewerObject()->isSelected() && LLSelectMgr::getInstance()->mHideSelectedObjects)
-	{
-		return;
-	}
-
-	//add face to drawmap
-	LLSpatialGroup::drawmap_elem_t& draw_vec = group->mDrawMap[type];	
-
-	S32 idx = draw_vec.size()-1;
-
-	BOOL fullbright = (type == LLRenderPass::PASS_FULLBRIGHT) ||
-		(type == LLRenderPass::PASS_INVISIBLE) ||
-		(type == LLRenderPass::PASS_ALPHA && facep->isState(LLFace::FULLBRIGHT));
-	
-	if (!fullbright && type != LLRenderPass::PASS_GLOW && !facep->getVertexBuffer()->hasDataType(LLVertexBuffer::TYPE_NORMAL))
-	{
-		llwarns << "Non fullbright face has no normals!" << llendl;
-		return;
-	}
-
-	const LLMatrix4* tex_mat = NULL;
-	if (facep->isState(LLFace::TEXTURE_ANIM) && facep->getVirtualSize() > MIN_TEX_ANIM_SIZE)
-	{
-		tex_mat = facep->mTextureMatrix;	
-	}
-
-	const LLMatrix4* model_mat = NULL;
-
-	LLDrawable* drawable = facep->getDrawable();
-	if (drawable->isActive())
-	{
-		model_mat = &(drawable->getRenderMatrix());
-	}
-	else
-	{
-		model_mat = &(drawable->getRegion()->mRenderMatrix);
-		if (model_mat->isIdentity())
-		{
-			model_mat = NULL;
-		}
-	}
-
-	U8 bump = (type == LLRenderPass::PASS_BUMP || type == LLRenderPass::PASS_POST_BUMP) ? facep->getTextureEntry()->getBumpmap() : 0;
-	
-	LLViewerTexture* tex = facep->getTexture();
-
-	U8 index = facep->getTextureIndex();
-
-	bool batchable = false;
-
-	if (index < 255 && idx >= 0)
-	{
-		if (index < draw_vec[idx]->mTextureList.size())
-		{
-			if (draw_vec[idx]->mTextureList[index].isNull())
-			{
-				batchable = true;
-				draw_vec[idx]->mTextureList[index] = tex;
-			}
-			else if (draw_vec[idx]->mTextureList[index] == tex)
-			{ //this face's texture index can be used with this batch
-				batchable = true;
-			}
-		}
-		else
-		{ //texture list can be expanded to fit this texture index
-			batchable = true;
-		}
-	}
-	
-	U8 glow = (U8) (facep->getTextureEntry()->getGlow() * 255);
-
-	if (idx >= 0 && 
-		draw_vec[idx]->mVertexBuffer == facep->getVertexBuffer() &&
-		draw_vec[idx]->mEnd == facep->getGeomIndex()-1 &&
-		(LLPipeline::sTextureBindTest || draw_vec[idx]->mTexture == tex || batchable) &&
-#if LL_DARWIN
-		draw_vec[idx]->mEnd - draw_vec[idx]->mStart + facep->getGeomCount() <= (U32) gGLManager.mGLMaxVertexRange &&
-		draw_vec[idx]->mCount + facep->getIndicesCount() <= (U32) gGLManager.mGLMaxIndexRange &&
-#endif
-		draw_vec[idx]->mGlowColor.mV[3] == glow &&
-		draw_vec[idx]->mFullbright == fullbright &&
-		draw_vec[idx]->mBump == bump &&
-		draw_vec[idx]->mTextureMatrix == tex_mat &&
-		draw_vec[idx]->mModelMatrix == model_mat)
-	{
-		draw_vec[idx]->mCount += facep->getIndicesCount();
-		draw_vec[idx]->mEnd += facep->getGeomCount();
-		draw_vec[idx]->mVSize = llmax(draw_vec[idx]->mVSize, facep->getVirtualSize());
-
-		if (index >= draw_vec[idx]->mTextureList.size())
-		{
-			draw_vec[idx]->mTextureList.resize(index+1);
-			draw_vec[idx]->mTextureList[index] = tex;
-		}
-		draw_vec[idx]->validate();
-		update_min_max(draw_vec[idx]->mExtents[0], draw_vec[idx]->mExtents[1], facep->mExtents[0]);
-		update_min_max(draw_vec[idx]->mExtents[0], draw_vec[idx]->mExtents[1], facep->mExtents[1]);
-	}
-	else
-	{
-		U32 start = facep->getGeomIndex();
-		U32 end = start + facep->getGeomCount()-1;
-		U32 offset = facep->getIndicesStart();
-		U32 count = facep->getIndicesCount();
-		LLPointer<LLDrawInfo> draw_info = new LLDrawInfo(start,end,count,offset, tex, 
-			facep->getVertexBuffer(), fullbright, bump); 
-		draw_info->mGroup = group;
-		draw_info->mVSize = facep->getVirtualSize();
-		draw_vec.push_back(draw_info);
-		draw_info->mTextureMatrix = tex_mat;
-		draw_info->mModelMatrix = model_mat;
-		draw_info->mGlowColor.setVec(0,0,0,glow);
-		if (type == LLRenderPass::PASS_ALPHA)
-		{ //for alpha sorting
-			facep->setDrawInfo(draw_info);
-		}
-		draw_info->mExtents[0] = facep->mExtents[0];
-		draw_info->mExtents[1] = facep->mExtents[1];
-
-		if (LLPipeline::sUseTriStrips)
-		{
-			draw_info->mDrawMode = LLRender::TRIANGLE_STRIP;
-		}
-
-		if (index < 255)
-		{ //initialize texture list for texture batching
-			draw_info->mTextureList.resize(index+1);
-			draw_info->mTextureList[index] = tex;
-		}
-		draw_info->validate();
-	}
-}
-
-void LLVolumeGeometryManager::getGeometry(LLSpatialGroup* group)
-{
-
-}
-
-static LLFastTimer::DeclareTimer FTM_REBUILD_VOLUME_VB("Volume");
-static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt");
-
-static LLDrawPoolAvatar* get_avatar_drawpool(LLViewerObject* vobj)
-{
-	LLVOAvatar* avatar = vobj->getAvatar();
-					
-	if (avatar)
-	{
-		LLDrawable* drawable = avatar->mDrawable;
-		if (drawable && drawable->getNumFaces() > 0)
-		{
-			LLFace* face = drawable->getFace(0);
-			if (face)
-			{
-				LLDrawPool* drawpool = face->getPool();
-				if (drawpool)
-				{
-					if (drawpool->getType() == LLDrawPool::POOL_AVATAR)
-					{
-						return (LLDrawPoolAvatar*) drawpool;
-					}
-				}
-			}
-		}
-	}
-
-	return NULL;
-}
-
-void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
-{
-	if (group->changeLOD())
-	{
-		group->mLastUpdateDistance = group->mDistance;
-	}
-
-	group->mLastUpdateViewAngle = group->mViewAngle;
-
-	if (!group->isState(LLSpatialGroup::GEOM_DIRTY | LLSpatialGroup::ALPHA_DIRTY))
-	{
-		if (group->isState(LLSpatialGroup::MESH_DIRTY) && !LLPipeline::sDelayVBUpdate)
-		{
-			LLFastTimer ftm(FTM_REBUILD_VBO);	
-			LLFastTimer ftm2(FTM_REBUILD_VOLUME_VB);
-		
-			rebuildMesh(group);
-		}
-		return;
-	}
-
-	group->mBuilt = 1.f;
-	LLFastTimer ftm(FTM_REBUILD_VBO);	
-
-	LLFastTimer ftm2(FTM_REBUILD_VOLUME_VB);
-
-	group->clearDrawMap();
-
-	mFaceList.clear();
-
-	std::vector<LLFace*> fullbright_faces;
-	std::vector<LLFace*> bump_faces;
-	std::vector<LLFace*> simple_faces;
-
-	std::vector<LLFace*> alpha_faces;
-	U32 useage = group->mSpatialPartition->mBufferUsage;
-
-	U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcVertexSize(group->mSpatialPartition->mVertexDataMask);
-	U32 max_total = (gSavedSettings.getS32("RenderMaxNodeSize")*1024)/LLVertexBuffer::calcVertexSize(group->mSpatialPartition->mVertexDataMask);
-	max_vertices = llmin(max_vertices, (U32) 65535);
-
-	U32 cur_total = 0;
-
-	//get all the faces into a list
-	for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
-	{
-		LLDrawable* drawablep = *drawable_iter;
-		
-		if (drawablep->isDead() || drawablep->isState(LLDrawable::FORCE_INVISIBLE) )
-		{
-			continue;
-		}
-	
-		if (drawablep->isAnimating())
-		{ //fall back to stream draw for animating verts
-			useage = GL_STREAM_DRAW_ARB;
-		}
-
-		LLVOVolume* vobj = drawablep->getVOVolume();
-
-		if (vobj->isMesh() &&
-			(vobj->getVolume() && !vobj->getVolume()->isMeshAssetLoaded() || !gMeshRepo.meshRezEnabled()))
-		{
-			continue;
-		}
-
-		llassert_always(vobj);
-		vobj->updateTextureVirtualSize();
-		vobj->preRebuild();
-
-		drawablep->clearState(LLDrawable::HAS_ALPHA);
-
-		bool rigged = vobj->isAttachment() && 
-					vobj->isMesh() && 
-					gMeshRepo.getSkinInfo(vobj->getVolume()->getParams().getSculptID(), vobj);
-
-		bool bake_sunlight = LLPipeline::sBakeSunlight && drawablep->isStatic();
-
-		bool is_rigged = false;
-
-		//for each face
-		for (S32 i = 0; i < drawablep->getNumFaces(); i++)
-		{
-			LLFace* facep = drawablep->getFace(i);
-
-			//ALWAYS null out vertex buffer on rebuild -- if the face lands in a render
-			// batch, it will recover its vertex buffer reference from the spatial group
-			facep->setVertexBuffer(NULL);
-			
-			//sum up face verts and indices
-			drawablep->updateFaceSize(i);
-			
-			
-
-			if (rigged) 
-			{
-				if (!facep->isState(LLFace::RIGGED))
-				{ //completely reset vertex buffer
-					facep->clearVertexBuffer();
-				}
-		
-				facep->setState(LLFace::RIGGED);
-				is_rigged = true;
-				
-				//get drawpool of avatar with rigged face
-				LLDrawPoolAvatar* pool = get_avatar_drawpool(vobj);
-				
-				//Determine if we've received skininfo that contains an
-				//alternate bind matrix - if it does then apply the translational component
-				//to the joints of the avatar.
-				LLVOAvatar* pAvatarVO = vobj->getAvatar();
-				bool pelvisGotSet = false;
-
-				if ( pAvatarVO )
-				{
-					LLUUID currentId = vobj->getVolume()->getParams().getSculptID();
-					const LLMeshSkinInfo*  pSkinData = gMeshRepo.getSkinInfo( currentId, vobj );
-					
-					if ( pSkinData )
-					{
-						const int bindCnt = pSkinData->mAlternateBindMatrix.size();								
-						if ( bindCnt > 0 )
-						{					
-							const int jointCnt = pSkinData->mJointNames.size();
-							const F32 pelvisZOffset = pSkinData->mPelvisOffset;
-							bool fullRig = (jointCnt>=20) ? true : false;
-							if ( fullRig )
-							{
-								for ( int i=0; i<jointCnt; ++i )
-								{
-									std::string lookingForJoint = pSkinData->mJointNames[i].c_str();
-									//llinfos<<"joint name "<<lookingForJoint.c_str()<<llendl;
-									LLJoint* pJoint = pAvatarVO->getJoint( lookingForJoint );
-									if ( pJoint && pJoint->getId() != currentId )
-									{   									
-										pJoint->setId( currentId );
-										const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation();									
-										//Set the joint position
-										pJoint->storeCurrentXform( jointPos );																																
-										//If joint is a pelvis then handle old/new pelvis to foot values
-										if ( lookingForJoint == "mPelvis" )
-										{	
-											pJoint->storeCurrentXform( jointPos );																																
-											if ( !pAvatarVO->hasPelvisOffset() )
-											{										
-												pAvatarVO->setPelvisOffset( true, jointPos, pelvisZOffset );
-												//Trigger to rebuild viewer AV
-												pelvisGotSet = true;											
-											}										
-										}										
-									}
-								}
-							}							
-						}
-					}
-				}
-				//If we've set the pelvis to a new position we need to also rebuild some information that the
-				//viewer does at launch (e.g. body size etc.)
-				if ( pelvisGotSet )
-				{
-					pAvatarVO->postPelvisSetRecalc();
-				}
-
-				if (pool)
-				{
-					const LLTextureEntry* te = facep->getTextureEntry();
-
-					//remove face from old pool if it exists
-					LLDrawPool* old_pool = facep->getPool();
-					if (old_pool && old_pool->getType() == LLDrawPool::POOL_AVATAR)
-					{
-						((LLDrawPoolAvatar*) old_pool)->removeRiggedFace(facep);
-					}
-
-					//add face to new pool
-					LLViewerTexture* tex = facep->getTexture();
-					U32 type = gPipeline.getPoolTypeFromTE(te, tex);
-
-					if (type == LLDrawPool::POOL_ALPHA)
-					{
-						if (te->getFullbright())
-						{
-							pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_FULLBRIGHT_ALPHA);
-						}
-						else
-						{
-							pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_ALPHA);
-						}
-					}
-					else if (te->getShiny())
-					{
-						if (te->getFullbright())
-						{
-							pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_FULLBRIGHT_SHINY);
-						}
-						else
-						{
-							if (LLPipeline::sRenderDeferred)
-							{
-								pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_SIMPLE);
-							}
-							else
-							{
-								pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_SHINY);
-							}
-						}
-					}
-					else
-					{
-						if (te->getFullbright())
-						{
-							pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_FULLBRIGHT);
-						}
-						else
-						{
-							pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_SIMPLE);
-						}
-					}
-
-					if (te->getGlow())
-					{
-						pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_GLOW);
-					}
-
-					if (LLPipeline::sRenderDeferred)
-					{
-						if (type != LLDrawPool::POOL_ALPHA && !te->getFullbright())
-						{
-							if (te->getBumpmap())
-							{
-								pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_DEFERRED_BUMP);
-							}
-							else
-							{
-								pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_DEFERRED_SIMPLE);
-							}
-						}
-					}
-				}
-
-				continue;
-			}
-			else
-			{
-				if (facep->isState(LLFace::RIGGED))
-				{ //face is not rigged but used to be, remove from rigged face pool
-					LLDrawPoolAvatar* pool = (LLDrawPoolAvatar*) facep->getPool();
-					if (pool)
-					{
-						pool->removeRiggedFace(facep);
-					}
-					facep->clearState(LLFace::RIGGED);
-				}
-			}
-
-			if (cur_total > max_total || facep->getIndicesCount() <= 0 || facep->getGeomCount() <= 0)
-			{
-				facep->clearVertexBuffer();
-				continue;
-			}
-
-			cur_total += facep->getGeomCount();
-
-			if (facep->hasGeometry() && facep->getPixelArea() > FORCE_CULL_AREA)
-			{
-				const LLTextureEntry* te = facep->getTextureEntry();
-				LLViewerTexture* tex = facep->getTexture();
-
-				if (facep->isState(LLFace::TEXTURE_ANIM))
-				{
-					if (!vobj->mTexAnimMode)
-					{
-						facep->clearState(LLFace::TEXTURE_ANIM);
-					}
-				}
-
-				BOOL force_simple = (facep->getPixelArea() < FORCE_SIMPLE_RENDER_AREA);
-				U32 type = gPipeline.getPoolTypeFromTE(te, tex);
-				if (type != LLDrawPool::POOL_ALPHA && force_simple)
-				{
-					type = LLDrawPool::POOL_SIMPLE;
-				}
-				facep->setPoolType(type);
-
-				if (vobj->isHUDAttachment())
-				{
-					facep->setState(LLFace::FULLBRIGHT);
-				}
-
-				if (vobj->mTextureAnimp && vobj->mTexAnimMode)
-				{
-					if (vobj->mTextureAnimp->mFace <= -1)
-					{
-						S32 face;
-						for (face = 0; face < vobj->getNumTEs(); face++)
-						{
-							drawablep->getFace(face)->setState(LLFace::TEXTURE_ANIM);
-						}
-					}
-					else if (vobj->mTextureAnimp->mFace < vobj->getNumTEs())
-					{
-						drawablep->getFace(vobj->mTextureAnimp->mFace)->setState(LLFace::TEXTURE_ANIM);
-					}
-				}
-
-				if (type == LLDrawPool::POOL_ALPHA)
-				{
-					if (facep->canRenderAsMask())
-					{ //can be treated as alpha mask
-						simple_faces.push_back(facep);
-					}
-					else
-					{
-						drawablep->setState(LLDrawable::HAS_ALPHA);
-						alpha_faces.push_back(facep);
-					}
-				}
-				else
-				{
-					if (drawablep->isState(LLDrawable::REBUILD_VOLUME))
-					{
-						facep->mLastUpdateTime = gFrameTimeSeconds;
-					}
-
-					if (gPipeline.canUseWindLightShadersOnObjects()
-						&& LLPipeline::sRenderBump)
-					{
-						if (te->getBumpmap())
-						{ //needs normal + binormal
-							bump_faces.push_back(facep);
-						}
-						else if (te->getShiny() || !te->getFullbright())
-						{ //needs normal
-							simple_faces.push_back(facep);
-						}
-						else 
-						{ //doesn't need normal
-							facep->setState(LLFace::FULLBRIGHT);
-							fullbright_faces.push_back(facep);
-						}
-					}
-					else
-					{
-						if (te->getBumpmap() && LLPipeline::sRenderBump)
-						{ //needs normal + binormal
-							bump_faces.push_back(facep);
-						}
-						else if ((te->getShiny() && LLPipeline::sRenderBump) ||
-							!(te->getFullbright() || bake_sunlight))
-						{ //needs normal
-							simple_faces.push_back(facep);
-						}
-						else 
-						{ //doesn't need normal
-							facep->setState(LLFace::FULLBRIGHT);
-							fullbright_faces.push_back(facep);
-						}
-					}
-				}
-			}
-			else
-			{	//face has no renderable geometry
-				facep->clearVertexBuffer();
-			}		
-		}
-
-		if (is_rigged)
-		{
-			drawablep->setState(LLDrawable::RIGGED);
-		}
-		else
-		{
-			drawablep->clearState(LLDrawable::RIGGED);
-		}
-	}
-
-	group->mBufferUsage = useage;
-
-	//PROCESS NON-ALPHA FACES
-	U32 simple_mask = LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_COLOR;
-	U32 alpha_mask = simple_mask | 0x80000000; //hack to give alpha verts their own VBO
-	U32 bump_mask = LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_TEXCOORD1 | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_COLOR;
-	U32 fullbright_mask = LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_COLOR;
-
-	bool batch_textures = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT) > 1;
-
-	if (batch_textures)
-	{
-		bump_mask |= LLVertexBuffer::MAP_BINORMAL;
-		genDrawInfo(group, simple_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, simple_faces, FALSE, TRUE);
-		genDrawInfo(group, fullbright_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, fullbright_faces, FALSE, TRUE);
-		genDrawInfo(group, bump_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, bump_faces, FALSE, TRUE);
-		genDrawInfo(group, alpha_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, alpha_faces, TRUE, TRUE);
-	}
-	else
-	{
-		genDrawInfo(group, simple_mask, simple_faces);
-		genDrawInfo(group, fullbright_mask, fullbright_faces);
-		genDrawInfo(group, bump_mask, bump_faces, FALSE, TRUE);
-		genDrawInfo(group, alpha_mask, alpha_faces, TRUE);
-	}
-	
-
-	if (!LLPipeline::sDelayVBUpdate)
-	{
-		//drawables have been rebuilt, clear rebuild status
-		for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
-		{
-			LLDrawable* drawablep = *drawable_iter;
-			drawablep->clearState(LLDrawable::REBUILD_ALL);
-		}
-	}
-
-	group->mLastUpdateTime = gFrameTimeSeconds;
-	group->mBuilt = 1.f;
-	group->clearState(LLSpatialGroup::GEOM_DIRTY | LLSpatialGroup::ALPHA_DIRTY);
-
-	if (LLPipeline::sDelayVBUpdate)
-	{
-		group->setState(LLSpatialGroup::MESH_DIRTY | LLSpatialGroup::NEW_DRAWINFO);
-	}
-
-	mFaceList.clear();
-}
-
-static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM("Volume Geometry");
-static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM_PARTIAL("Terse Rebuild");
-
-void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
-{
-	llassert(group);
-	if (group && group->isState(LLSpatialGroup::MESH_DIRTY) && !group->isState(LLSpatialGroup::GEOM_DIRTY))
-	{
-		LLFastTimer tm(FTM_VOLUME_GEOM);
-		S32 num_mapped_veretx_buffer = LLVertexBuffer::sMappedCount ;
-
-		group->mBuilt = 1.f;
-		
-		std::set<LLVertexBuffer*> mapped_buffers;
-
-		for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
-		{
-			LLFastTimer t(FTM_VOLUME_GEOM_PARTIAL);
-			LLDrawable* drawablep = *drawable_iter;
-
-			if (!drawablep->isDead() && drawablep->isState(LLDrawable::REBUILD_ALL) )
-			{
-				LLVOVolume* vobj = drawablep->getVOVolume();
-				vobj->preRebuild();
-
-				LLVolume* volume = vobj->getVolume();
-				for (S32 i = 0; i < drawablep->getNumFaces(); ++i)
-				{
-					LLFace* face = drawablep->getFace(i);
-					if (face)
-					{
-						LLVertexBuffer* buff = face->getVertexBuffer();
-						if (buff)
-						{
-							face->getGeometryVolume(*volume, face->getTEOffset(), 
-								vobj->getRelativeXform(), vobj->getRelativeXformInvTrans(), face->getGeomIndex());
-
-							if (buff->isLocked())
-							{
-								mapped_buffers.insert(buff);
-							}
-						}
-					}
-				}
-				
-				drawablep->clearState(LLDrawable::REBUILD_ALL);
-			}
-		}
-		
-		for (std::set<LLVertexBuffer*>::iterator iter = mapped_buffers.begin(); iter != mapped_buffers.end(); ++iter)
-		{
-			(*iter)->setBuffer(0);
-		}
-
-		// don't forget alpha
-		if(group != NULL && 
-		   !group->mVertexBuffer.isNull() && 
-		   group->mVertexBuffer->isLocked())
-		{
-			group->mVertexBuffer->setBuffer(0);
-		}
-
-		//if not all buffers are unmapped
-		if(num_mapped_veretx_buffer != LLVertexBuffer::sMappedCount) 
-		{
-			llwarns << "Not all mapped vertex buffers are unmapped!" << llendl ; 
-			for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
-			{
-				LLDrawable* drawablep = *drawable_iter;
-				for (S32 i = 0; i < drawablep->getNumFaces(); ++i)
-				{
-					LLFace* face = drawablep->getFace(i);
-					LLVertexBuffer* buff = face->getVertexBuffer();
-					if (face && buff && buff->isLocked())
-					{
-						buff->setBuffer(0) ;
-					}
-				}
-			} 
-		}
-
-		group->clearState(LLSpatialGroup::MESH_DIRTY | LLSpatialGroup::NEW_DRAWINFO);
-	}
-
-	llassert(!group || !group->isState(LLSpatialGroup::NEW_DRAWINFO));
-}
-
-struct CompareBatchBreakerModified
-{
-	bool operator()(const LLFace* const& lhs, const LLFace* const& rhs)
-	{
-		const LLTextureEntry* lte = lhs->getTextureEntry();
-		const LLTextureEntry* rte = rhs->getTextureEntry();
-
-		if (lte->getBumpmap() != rte->getBumpmap())
-		{
-			return lte->getBumpmap() < rte->getBumpmap();
-		}
-		else if (lte->getFullbright() != rte->getFullbright())
-		{
-			return lte->getFullbright() < rte->getFullbright();
-		}
-		else  if (lte->getGlow() != rte->getGlow())
-		{
-			return lte->getGlow() < rte->getGlow();
-		}
-		else
-		{
-			return lhs->getTexture() < rhs->getTexture();
-		}
-		
-	}
-};
-
-void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector<LLFace*>& faces, BOOL distance_sort, BOOL batch_textures)
-{
-	//calculate maximum number of vertices to store in a single buffer
-	U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcVertexSize(group->mSpatialPartition->mVertexDataMask);
-	max_vertices = llmin(max_vertices, (U32) 65535);
-
-	if (!distance_sort)
-	{
-		//sort faces by things that break batches
-		std::sort(faces.begin(), faces.end(), CompareBatchBreakerModified());
-	}
-	else
-	{
-		//sort faces by distance
-		std::sort(faces.begin(), faces.end(), LLFace::CompareDistanceGreater());
-	}
-				
-	std::vector<LLFace*>::iterator face_iter = faces.begin();
-	
-	LLSpatialGroup::buffer_map_t buffer_map;
-
-	LLViewerTexture* last_tex = NULL;
-	S32 buffer_index = 0;
-
-	if (distance_sort)
-	{
-		buffer_index = -1;
-	}
-
-	S32 texture_index_channels = gGLManager.mNumTextureImageUnits-1; //always reserve one for shiny for now just for simplicity
-	
-	if (gGLManager.mGLVersion < 3.1f)
-	{
-		texture_index_channels = 1;
-	}
-
-	if (LLPipeline::sRenderDeferred && distance_sort)
-	{
-		texture_index_channels = gDeferredAlphaProgram.mFeatures.mIndexedTextureChannels;
-	}
-
-	texture_index_channels = llmin(texture_index_channels, (S32) gSavedSettings.getU32("RenderMaxTextureIndex"));
-	
-
-	while (face_iter != faces.end())
-	{
-		//pull off next face
-		LLFace* facep = *face_iter;
-		LLViewerTexture* tex = facep->getTexture();
-
-		if (distance_sort)
-		{
-			tex = NULL;
-		}
-
-		if (last_tex == tex)
-		{
-			buffer_index++;
-		}
-		else
-		{
-			last_tex = tex;
-			buffer_index = 0;
-		}
-
-		bool bake_sunlight = LLPipeline::sBakeSunlight && facep->getDrawable()->isStatic(); 
-
-		U32 index_count = facep->getIndicesCount();
-		U32 geom_count = facep->getGeomCount();
-
-		//sum up vertices needed for this render batch
-		std::vector<LLFace*>::iterator i = face_iter;
-		++i;
-		
-		std::vector<LLViewerTexture*> texture_list;
-
-		if (batch_textures)
-		{
-			U8 cur_tex = 0;
-			facep->setTextureIndex(cur_tex);
-			texture_list.push_back(tex);
-
-			//if (can_batch_texture(facep))
-			{
-				while (i != faces.end())
-				{
-					facep = *i;
-					if (facep->getTexture() != tex)
-					{
-						if (distance_sort)
-						{ //textures might be out of order, see if texture exists in current batch
-							bool found = false;
-							for (U32 tex_idx = 0; tex_idx < texture_list.size(); ++tex_idx)
-							{
-								if (facep->getTexture() == texture_list[tex_idx])
-								{
-									cur_tex = tex_idx;
-									found = true;
-									break;
-								}
-							}
-
-							if (!found)
-							{
-								cur_tex = texture_list.size();
-							}
-						}
-						else
-						{
-							cur_tex++;
-						}
-
-						if (!can_batch_texture(facep))
-						{ //face is bump mapped or has an animated texture matrix -- can't 
-							//batch more than 1 texture at a time
-							break;
-						}
-
-						if (cur_tex >= texture_index_channels)
-						{ //cut batches when index channels are depleted
-							break;
-						}
-
-						tex = facep->getTexture();
-
-						texture_list.push_back(tex);
-					}
-
-					if (geom_count + facep->getGeomCount() > max_vertices)
-					{ //cut batches on geom count too big
-						break;
-					}
-
-					++i;
-					index_count += facep->getIndicesCount();
-					geom_count += facep->getGeomCount();
-
-					facep->setTextureIndex(cur_tex);
-				}
-			}
-
-			tex = texture_list[0];
-		}
-		else
-		{
-			while (i != faces.end() && 
-				(LLPipeline::sTextureBindTest || (distance_sort || (*i)->getTexture() == tex)))
-			{
-				facep = *i;
-			
-
-				//face has no texture index
-				facep->mDrawInfo = NULL;
-				facep->setTextureIndex(255);
-
-				if (geom_count + facep->getGeomCount() > max_vertices)
-				{ //cut batches on geom count too big
-					break;
-				}
-
-				++i;
-				index_count += facep->getIndicesCount();
-				geom_count += facep->getGeomCount();
-			}
-		}
-	
-		//create/delete/resize vertex buffer if needed
-		LLVertexBuffer* buffer = NULL;
-		LLSpatialGroup::buffer_texture_map_t::iterator found_iter = group->mBufferMap[mask].find(*face_iter);
-		
-		if (found_iter != group->mBufferMap[mask].end())
-		{
-			if ((U32) buffer_index < found_iter->second.size())
-			{
-				buffer = found_iter->second[buffer_index];
-			}
-		}
-						
-		if (!buffer)
-		{ //create new buffer if needed
-			buffer = createVertexBuffer(mask, 
-											group->mBufferUsage);
-			buffer->allocateBuffer(geom_count, index_count, TRUE);
-		}
-		else 
-		{ //resize pre-existing buffer
-			if (LLVertexBuffer::sEnableVBOs && buffer->getUsage() != group->mBufferUsage ||
-				buffer->getTypeMask() != mask)
-			{
-				buffer = createVertexBuffer(mask, 
-											group->mBufferUsage);
-				buffer->allocateBuffer(geom_count, index_count, TRUE);
-			}
-			else
-			{
-				buffer->resizeBuffer(geom_count, index_count);
-			}
-		}
-
-		buffer_map[mask][*face_iter].push_back(buffer);
-
-		//add face geometry
-
-		U32 indices_index = 0;
-		U16 index_offset = 0;
-
-		while (face_iter < i)
-		{ //update face indices for new buffer
-			facep = *face_iter;
-			facep->setIndicesIndex(indices_index);
-			facep->setGeomIndex(index_offset);
-			facep->setVertexBuffer(buffer);	
-			
-			if (batch_textures && facep->getTextureIndex() == 255)
-			{
-				llerrs << "Invalid texture index." << llendl;
-			}
-			
-			{
-				//for debugging, set last time face was updated vs moved
-				facep->updateRebuildFlags();
-
-				if (!LLPipeline::sDelayVBUpdate)
-				{ //copy face geometry into vertex buffer
-					LLDrawable* drawablep = facep->getDrawable();
-					LLVOVolume* vobj = drawablep->getVOVolume();
-					LLVolume* volume = vobj->getVolume();
-
-					U32 te_idx = facep->getTEOffset();
-
-					facep->getGeometryVolume(*volume, te_idx, 
-						vobj->getRelativeXform(), vobj->getRelativeXformInvTrans(), index_offset);
-				}
-			}
-
-			index_offset += facep->getGeomCount();
-			indices_index += facep->getIndicesCount();
-
-
-			//append face to appropriate render batch
-
-			BOOL force_simple = facep->getPixelArea() < FORCE_SIMPLE_RENDER_AREA;
-			BOOL fullbright = facep->isState(LLFace::FULLBRIGHT);
-			if ((mask & LLVertexBuffer::MAP_NORMAL) == 0)
-			{ //paranoia check to make sure GL doesn't try to read non-existant normals
-				fullbright = TRUE;
-			}
-
-			const LLTextureEntry* te = facep->getTextureEntry();
-			tex = facep->getTexture();
-
-			BOOL is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) ? TRUE : FALSE;
-		
-			if (is_alpha)
-			{
-				// can we safely treat this as an alpha mask?
-				if (facep->canRenderAsMask())
-				{
-					if (te->getFullbright() || LLPipeline::sNoAlpha)
-					{
-						registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK);
-					}
-					else
-					{
-						registerFace(group, facep, LLRenderPass::PASS_ALPHA_MASK);
-					}
-				}
-				else
-				{
-					registerFace(group, facep, LLRenderPass::PASS_ALPHA);
-				}
-
-				if (LLPipeline::sRenderDeferred)
-				{
-					registerFace(group, facep, LLRenderPass::PASS_ALPHA_SHADOW);
-				}
-			}
-			else if (gPipeline.canUseVertexShaders()
-				&& group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_HUD 
-				&& LLPipeline::sRenderBump 
-				&& te->getShiny())
-			{ //shiny
-				if (tex->getPrimaryFormat() == GL_ALPHA)
-				{ //invisiprim+shiny
-					registerFace(group, facep, LLRenderPass::PASS_INVISI_SHINY);
-					registerFace(group, facep, LLRenderPass::PASS_INVISIBLE);
-				}
-				else if (LLPipeline::sRenderDeferred)
-				{ //deferred rendering
-					if (te->getFullbright())
-					{ //register in post deferred fullbright shiny pass
-						registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_SHINY);
-						if (te->getBumpmap())
-						{ //register in post deferred bump pass
-							registerFace(group, facep, LLRenderPass::PASS_POST_BUMP);
-						}
-					}
-					else if (te->getBumpmap())
-					{ //register in deferred bump pass
-						registerFace(group, facep, LLRenderPass::PASS_BUMP);
-					}
-					else
-					{ //register in deferred simple pass (deferred simple includes shiny)
-						llassert(mask & LLVertexBuffer::MAP_NORMAL);
-						registerFace(group, facep, LLRenderPass::PASS_SIMPLE);
-					}
-				}
-				else if (fullbright)
-				{	//not deferred, register in standard fullbright shiny pass					
-					registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_SHINY);
-				}
-				else
-				{ //not deferred or fullbright, register in standard shiny pass
-					registerFace(group, facep, LLRenderPass::PASS_SHINY);
-				}
-			}
-			else
-			{ //not alpha and not shiny
-				if (!is_alpha && tex->getPrimaryFormat() == GL_ALPHA)
-				{ //invisiprim
-					registerFace(group, facep, LLRenderPass::PASS_INVISIBLE);
-				}
-				else if (fullbright || bake_sunlight)
-				{ //fullbright
-					registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT);
-					if (LLPipeline::sRenderDeferred && LLPipeline::sRenderBump && te->getBumpmap())
-					{ //if this is the deferred render and a bump map is present, register in post deferred bump
-						registerFace(group, facep, LLRenderPass::PASS_POST_BUMP);
-					}
-				}
-				else
-				{
-					if (LLPipeline::sRenderDeferred && LLPipeline::sRenderBump && te->getBumpmap())
-					{ //non-shiny or fullbright deferred bump
-						registerFace(group, facep, LLRenderPass::PASS_BUMP);
-					}
-					else
-					{ //all around simple
-						llassert(mask & LLVertexBuffer::MAP_NORMAL);
-						registerFace(group, facep, LLRenderPass::PASS_SIMPLE);
-					}
-				}
-				
-				//not sure why this is here -- shiny HUD attachments maybe?  -- davep 5/11/2010
-				if (!is_alpha && te->getShiny() && LLPipeline::sRenderBump)
-				{
-					registerFace(group, facep, LLRenderPass::PASS_SHINY);
-				}
-			}
-			
-			//not sure why this is here, and looks like it might cause bump mapped objects to get rendered redundantly -- davep 5/11/2010
-			if (!is_alpha && !LLPipeline::sRenderDeferred)
-			{
-				llassert((mask & LLVertexBuffer::MAP_NORMAL) || fullbright);
-				facep->setPoolType((fullbright) ? LLDrawPool::POOL_FULLBRIGHT : LLDrawPool::POOL_SIMPLE);
-				
-				if (!force_simple && te->getBumpmap() && LLPipeline::sRenderBump)
-				{
-					registerFace(group, facep, LLRenderPass::PASS_BUMP);
-				}
-			}
-
-			if (!is_alpha && LLPipeline::sRenderGlow && te->getGlow() > 0.f)
-			{
-				registerFace(group, facep, LLRenderPass::PASS_GLOW);
-			}
-						
-			++face_iter;
-		}
-
-		buffer->setBuffer(0);
-	}
-
-	group->mBufferMap[mask].clear();
-	for (LLSpatialGroup::buffer_texture_map_t::iterator i = buffer_map[mask].begin(); i != buffer_map[mask].end(); ++i)
-	{
-		group->mBufferMap[mask][i->first] = i->second;
-	}
-}
-
-void LLGeometryManager::addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32 &index_count)
-{	
-	//initialize to default usage for this partition
-	U32 usage = group->mSpatialPartition->mBufferUsage;
-	
-	//clear off any old faces
-	mFaceList.clear();
-
-	//for each drawable
-	for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
-	{
-		LLDrawable* drawablep = *drawable_iter;
-		
-		if (drawablep->isDead())
-		{
-			continue;
-		}
-	
-		if (drawablep->isAnimating())
-		{ //fall back to stream draw for animating verts
-			usage = GL_STREAM_DRAW_ARB;
-		}
-
-		//for each face
-		for (S32 i = 0; i < drawablep->getNumFaces(); i++)
-		{
-			//sum up face verts and indices
-			drawablep->updateFaceSize(i);
-			LLFace* facep = drawablep->getFace(i);
-			if (facep->hasGeometry() && facep->getPixelArea() > FORCE_CULL_AREA)
-			{
-				vertex_count += facep->getGeomCount();
-				index_count += facep->getIndicesCount();
-				llassert(facep->getIndicesCount() < 65536);
-				//remember face (for sorting)
-				mFaceList.push_back(facep);
-			}
-			else
-			{
-				facep->clearVertexBuffer();
-			}
-		}
-	}
-	
-	group->mBufferUsage = usage;
-}
-
-LLHUDPartition::LLHUDPartition()
-{
-	mPartitionType = LLViewerRegion::PARTITION_HUD;
-	mDrawableType = LLPipeline::RENDER_TYPE_HUD;
-	mSlopRatio = 0.f;
-	mLODPeriod = 1;
-}
-
-void LLHUDPartition::shift(const LLVector4a &offset)
-{
-	//HUD objects don't shift with region crossing.  That would be silly.
-}
-
-
+/** 
+ * @file llvovolume.cpp
+ * @brief LLVOVolume class implementation
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+// A "volume" is a box, cylinder, sphere, or other primitive shape.
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llvovolume.h"
+
+#include <sstream>
+
+#include "llviewercontrol.h"
+#include "lldir.h"
+#include "llflexibleobject.h"
+#include "llfloatertools.h"
+#include "llmaterialtable.h"
+#include "llprimitive.h"
+#include "llvolume.h"
+#include "llvolumeoctree.h"
+#include "llvolumemgr.h"
+#include "llvolumemessage.h"
+#include "material_codes.h"
+#include "message.h"
+#include "llpluginclassmedia.h" // for code in the mediaEvent handler
+#include "object_flags.h"
+#include "llagentconstants.h"
+#include "lldrawable.h"
+#include "lldrawpoolavatar.h"
+#include "lldrawpoolbump.h"
+#include "llface.h"
+#include "llspatialpartition.h"
+#include "llhudmanager.h"
+#include "llflexibleobject.h"
+#include "llsky.h"
+#include "lltexturefetch.h"
+#include "llvector4a.h"
+#include "llviewercamera.h"
+#include "llviewertexturelist.h"
+#include "llviewerobjectlist.h"
+#include "llviewerregion.h"
+#include "llviewertextureanim.h"
+#include "llworld.h"
+#include "llselectmgr.h"
+#include "pipeline.h"
+#include "llsdutil.h"
+#include "llmatrix4a.h"
+#include "llmediaentry.h"
+#include "llmediadataclient.h"
+#include "llmeshrepository.h"
+#include "llagent.h"
+#include "llviewermediafocus.h"
+#include "lldatapacker.h"
+#include "llviewershadermgr.h"
+#include "llvoavatar.h"
+#include "llvocache.h"
+
+const S32 MIN_QUIET_FRAMES_COALESCE = 30;
+const F32 FORCE_SIMPLE_RENDER_AREA = 512.f;
+const F32 FORCE_CULL_AREA = 8.f;
+const F32 MAX_LOD_DISTANCE = 24.f;
+
+
+BOOL gAnimateTextures = TRUE;
+//extern BOOL gHideSelectedObjects;
+
+F32 LLVOVolume::sLODFactor = 1.f;
+F32	LLVOVolume::sLODSlopDistanceFactor = 0.5f; //Changing this to zero, effectively disables the LOD transition slop 
+F32 LLVOVolume::sDistanceFactor = 1.0f;
+S32 LLVOVolume::sNumLODChanges = 0;
+S32 LLVOVolume::mRenderComplexity_last = 0;
+S32 LLVOVolume::mRenderComplexity_current = 0;
+LLPointer<LLObjectMediaDataClient> LLVOVolume::sObjectMediaClient = NULL;
+LLPointer<LLObjectMediaNavigateClient> LLVOVolume::sObjectMediaNavigateClient = NULL;
+
+static LLFastTimer::DeclareTimer FTM_GEN_TRIANGLES("Generate Triangles");
+static LLFastTimer::DeclareTimer FTM_GEN_VOLUME("Generate Volumes");
+static LLFastTimer::DeclareTimer FTM_VOLUME_TEXTURES("Volume Textures");
+
+// Implementation class of LLMediaDataClientObject.  See llmediadataclient.h
+class LLMediaDataClientObjectImpl : public LLMediaDataClientObject
+{
+public:
+	LLMediaDataClientObjectImpl(LLVOVolume *obj, bool isNew) : mObject(obj), mNew(isNew) 
+	{
+		mObject->addMDCImpl();
+	}
+	~LLMediaDataClientObjectImpl()
+	{
+		mObject->removeMDCImpl();
+	}
+	
+	virtual U8 getMediaDataCount() const 
+		{ return mObject->getNumTEs(); }
+
+	virtual LLSD getMediaDataLLSD(U8 index) const 
+		{
+			LLSD result;
+			LLTextureEntry *te = mObject->getTE(index); 
+			if (NULL != te)
+			{
+				llassert((te->getMediaData() != NULL) == te->hasMedia());
+				if (te->getMediaData() != NULL)
+				{
+					result = te->getMediaData()->asLLSD();
+					// XXX HACK: workaround bug in asLLSD() where whitelist is not set properly
+					// See DEV-41949
+					if (!result.has(LLMediaEntry::WHITELIST_KEY))
+					{
+						result[LLMediaEntry::WHITELIST_KEY] = LLSD::emptyArray();
+					}
+				}
+			}
+			return result;
+		}
+	virtual bool isCurrentMediaUrl(U8 index, const std::string &url) const
+		{
+			LLTextureEntry *te = mObject->getTE(index); 
+			if (te)
+			{
+				if (te->getMediaData())
+				{
+					return (te->getMediaData()->getCurrentURL() == url);
+				}
+			}
+			return url.empty();
+		}
+
+	virtual LLUUID getID() const
+		{ return mObject->getID(); }
+
+	virtual void mediaNavigateBounceBack(U8 index)
+		{ mObject->mediaNavigateBounceBack(index); }
+	
+	virtual bool hasMedia() const
+		{ return mObject->hasMedia(); }
+	
+	virtual void updateObjectMediaData(LLSD const &data, const std::string &version_string) 
+		{ mObject->updateObjectMediaData(data, version_string); }
+	
+	virtual F64 getMediaInterest() const 
+		{ 
+			F64 interest = mObject->getTotalMediaInterest();
+			if (interest < (F64)0.0)
+			{
+				// media interest not valid yet, try pixel area
+				interest = mObject->getPixelArea();
+				// HACK: force recalculation of pixel area if interest is the "magic default" of 1024.
+				if (interest == 1024.f)
+				{
+					const_cast<LLVOVolume*>(static_cast<LLVOVolume*>(mObject))->setPixelAreaAndAngle(gAgent);
+					interest = mObject->getPixelArea();
+				}
+			}
+			return interest; 
+		}
+	
+	virtual bool isInterestingEnough() const
+		{
+			return LLViewerMedia::isInterestingEnough(mObject, getMediaInterest());
+		}
+
+	virtual std::string getCapabilityUrl(const std::string &name) const
+		{ return mObject->getRegion()->getCapability(name); }
+	
+	virtual bool isDead() const
+		{ return mObject->isDead(); }
+	
+	virtual U32 getMediaVersion() const
+		{ return LLTextureEntry::getVersionFromMediaVersionString(mObject->getMediaURL()); }
+	
+	virtual bool isNew() const
+		{ return mNew; }
+
+private:
+	LLPointer<LLVOVolume> mObject;
+	bool mNew;
+};
+
+
+LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
+	: LLViewerObject(id, pcode, regionp),
+	  mVolumeImpl(NULL)
+{
+	mTexAnimMode = 0;
+	mRelativeXform.setIdentity();
+	mRelativeXformInvTrans.setIdentity();
+
+	mFaceMappingChanged = FALSE;
+	mLOD = MIN_LOD;
+	mTextureAnimp = NULL;
+	mVolumeChanged = FALSE;
+	mVObjRadius = LLVector3(1,1,0.5f).length();
+	mNumFaces = 0;
+	mLODChanged = FALSE;
+	mSculptChanged = FALSE;
+	mSpotLightPriority = 0.f;
+
+	mMediaImplList.resize(getNumTEs());
+	mLastFetchedMediaVersion = -1;
+	mIndexInTex = 0;
+	mMDCImplCount = 0;
+}
+
+LLVOVolume::~LLVOVolume()
+{
+	delete mTextureAnimp;
+	mTextureAnimp = NULL;
+	delete mVolumeImpl;
+	mVolumeImpl = NULL;
+
+	if(!mMediaImplList.empty())
+	{
+		for(U32 i = 0 ; i < mMediaImplList.size() ; i++)
+		{
+			if(mMediaImplList[i].notNull())
+			{
+				mMediaImplList[i]->removeObject(this) ;
+			}
+		}
+	}
+}
+
+void LLVOVolume::markDead()
+{
+	if (!mDead)
+	{
+		if(getMDCImplCount() > 0)
+		{
+			LLMediaDataClientObject::ptr_t obj = new LLMediaDataClientObjectImpl(const_cast<LLVOVolume*>(this), false);
+			if (sObjectMediaClient) sObjectMediaClient->removeFromQueue(obj);
+			if (sObjectMediaNavigateClient) sObjectMediaNavigateClient->removeFromQueue(obj);
+		}
+		
+		// Detach all media impls from this object
+		for(U32 i = 0 ; i < mMediaImplList.size() ; i++)
+		{
+			removeMediaImpl(i);
+		}
+
+		if (mSculptTexture.notNull())
+		{
+			mSculptTexture->removeVolume(this);
+		}
+	}
+	
+	LLViewerObject::markDead();
+}
+
+
+// static
+void LLVOVolume::initClass()
+{
+	// gSavedSettings better be around
+	if (gSavedSettings.getBOOL("PrimMediaMasterEnabled"))
+	{
+		const F32 queue_timer_delay = gSavedSettings.getF32("PrimMediaRequestQueueDelay");
+		const F32 retry_timer_delay = gSavedSettings.getF32("PrimMediaRetryTimerDelay");
+		const U32 max_retries = gSavedSettings.getU32("PrimMediaMaxRetries");
+		const U32 max_sorted_queue_size = gSavedSettings.getU32("PrimMediaMaxSortedQueueSize");
+		const U32 max_round_robin_queue_size = gSavedSettings.getU32("PrimMediaMaxRoundRobinQueueSize");
+		sObjectMediaClient = new LLObjectMediaDataClient(queue_timer_delay, retry_timer_delay, max_retries, 
+														 max_sorted_queue_size, max_round_robin_queue_size);
+		sObjectMediaNavigateClient = new LLObjectMediaNavigateClient(queue_timer_delay, retry_timer_delay, 
+																	 max_retries, max_sorted_queue_size, max_round_robin_queue_size);
+	}
+}
+
+// static
+void LLVOVolume::cleanupClass()
+{
+    sObjectMediaClient = NULL;
+    sObjectMediaNavigateClient = NULL;
+}
+
+U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
+										  void **user_data,
+										  U32 block_num, EObjectUpdateType update_type,
+										  LLDataPacker *dp)
+{
+	LLColor4U color;
+	const S32 teDirtyBits = (TEM_CHANGE_TEXTURE|TEM_CHANGE_COLOR|TEM_CHANGE_MEDIA);
+
+	// Do base class updates...
+	U32 retval = LLViewerObject::processUpdateMessage(mesgsys, user_data, block_num, update_type, dp);
+
+	LLUUID sculpt_id;
+	U8 sculpt_type = 0;
+	if (isSculpted())
+	{
+		LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT);
+		sculpt_id = sculpt_params->getSculptTexture();
+		sculpt_type = sculpt_params->getSculptType();
+	}
+
+	if (!dp)
+	{
+		if (update_type == OUT_FULL)
+		{
+			////////////////////////////////
+			//
+			// Unpack texture animation data
+			//
+			//
+
+			if (mesgsys->getSizeFast(_PREHASH_ObjectData, block_num, _PREHASH_TextureAnim))
+			{
+				if (!mTextureAnimp)
+				{
+					mTextureAnimp = new LLViewerTextureAnim();
+				}
+				else
+				{
+					if (!(mTextureAnimp->mMode & LLTextureAnim::SMOOTH))
+					{
+						mTextureAnimp->reset();
+					}
+				}
+				mTexAnimMode = 0;
+				mTextureAnimp->unpackTAMessage(mesgsys, block_num);
+			}
+			else
+			{
+				if (mTextureAnimp)
+				{
+					delete mTextureAnimp;
+					mTextureAnimp = NULL;
+					gPipeline.markTextured(mDrawable);
+					mFaceMappingChanged = TRUE;
+					mTexAnimMode = 0;
+				}
+			}
+
+			// Unpack volume data
+			LLVolumeParams volume_params;
+			LLVolumeMessage::unpackVolumeParams(&volume_params, mesgsys, _PREHASH_ObjectData, block_num);
+			volume_params.setSculptID(sculpt_id, sculpt_type);
+
+			if (setVolume(volume_params, 0))
+			{
+				markForUpdate(TRUE);
+			}
+		}
+
+		// Sigh, this needs to be done AFTER the volume is set as well, otherwise bad stuff happens...
+		////////////////////////////
+		//
+		// Unpack texture entry data
+		//
+
+		S32 result = unpackTEMessage(mesgsys, _PREHASH_ObjectData, block_num);
+		if (result & teDirtyBits)
+		{
+			updateTEData();
+		}
+		if (result & TEM_CHANGE_MEDIA)
+		{
+			retval |= MEDIA_FLAGS_CHANGED;
+		}
+	}
+	else
+	{
+		// CORY TO DO: Figure out how to get the value here
+		if (update_type != OUT_TERSE_IMPROVED)
+		{
+			LLVolumeParams volume_params;
+			BOOL res = LLVolumeMessage::unpackVolumeParams(&volume_params, *dp);
+			if (!res)
+			{
+				llwarns << "Bogus volume parameters in object " << getID() << llendl;
+				llwarns << getRegion()->getOriginGlobal() << llendl;
+			}
+
+			volume_params.setSculptID(sculpt_id, sculpt_type);
+
+			if (setVolume(volume_params, 0))
+			{
+				markForUpdate(TRUE);
+			}
+			S32 res2 = unpackTEMessage(*dp);
+			if (TEM_INVALID == res2)
+			{
+				// There's something bogus in the data that we're unpacking.
+				dp->dumpBufferToLog();
+				llwarns << "Flushing cache files" << llendl;
+
+				if(LLVOCache::hasInstance() && getRegion())
+				{
+					LLVOCache::getInstance()->removeEntry(getRegion()->getHandle()) ;
+				}
+				
+				llwarns << "Bogus TE data in " << getID() << llendl;
+			}
+			else 
+			{
+				if (res2 & teDirtyBits) 
+				{
+					updateTEData();
+				}
+				if (res2 & TEM_CHANGE_MEDIA)
+				{
+					retval |= MEDIA_FLAGS_CHANGED;
+				}
+			}
+
+			U32 value = dp->getPassFlags();
+
+			if (value & 0x40)
+			{
+				if (!mTextureAnimp)
+				{
+					mTextureAnimp = new LLViewerTextureAnim();
+				}
+				else
+				{
+					if (!(mTextureAnimp->mMode & LLTextureAnim::SMOOTH))
+					{
+						mTextureAnimp->reset();
+					}
+				}
+				mTexAnimMode = 0;
+				mTextureAnimp->unpackTAMessage(*dp);
+			}
+			else if (mTextureAnimp)
+			{
+				delete mTextureAnimp;
+				mTextureAnimp = NULL;
+				gPipeline.markTextured(mDrawable);
+				mFaceMappingChanged = TRUE;
+				mTexAnimMode = 0;
+			}
+		}
+		else
+		{
+			S32 texture_length = mesgsys->getSizeFast(_PREHASH_ObjectData, block_num, _PREHASH_TextureEntry);
+			if (texture_length)
+			{
+				U8							tdpbuffer[1024];
+				LLDataPackerBinaryBuffer	tdp(tdpbuffer, 1024);
+				mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_TextureEntry, tdpbuffer, 0, block_num);
+				S32 result = unpackTEMessage(tdp);
+				if (result & teDirtyBits)
+				{
+					updateTEData();
+				}
+				if (result & TEM_CHANGE_MEDIA)
+				{
+					retval |= MEDIA_FLAGS_CHANGED;
+				}
+			}
+		}
+	}
+	if (retval & (MEDIA_URL_REMOVED | MEDIA_URL_ADDED | MEDIA_URL_UPDATED | MEDIA_FLAGS_CHANGED)) 
+	{
+		// If only the media URL changed, and it isn't a media version URL,
+		// ignore it
+		if ( ! ( retval & (MEDIA_URL_ADDED | MEDIA_URL_UPDATED) &&
+				 mMedia && ! mMedia->mMediaURL.empty() &&
+				 ! LLTextureEntry::isMediaVersionString(mMedia->mMediaURL) ) )
+		{
+			// If the media changed at all, request new media data
+			LL_DEBUGS("MediaOnAPrim") << "Media update: " << getID() << ": retval=" << retval << " Media URL: " <<
+                ((mMedia) ?  mMedia->mMediaURL : std::string("")) << LL_ENDL;
+			requestMediaDataUpdate(retval & MEDIA_FLAGS_CHANGED);
+		}
+        else {
+            LL_INFOS("MediaOnAPrim") << "Ignoring media update for: " << getID() << " Media URL: " <<
+                ((mMedia) ?  mMedia->mMediaURL : std::string("")) << LL_ENDL;
+        }
+	}
+	// ...and clean up any media impls
+	cleanUpMediaImpls();
+
+	return retval;
+}
+
+
+void LLVOVolume::animateTextures()
+{
+	F32 off_s = 0.f, off_t = 0.f, scale_s = 1.f, scale_t = 1.f, rot = 0.f;
+	S32 result = mTextureAnimp->animateTextures(off_s, off_t, scale_s, scale_t, rot);
+	
+	if (result)
+	{
+		if (!mTexAnimMode)
+		{
+			mFaceMappingChanged = TRUE;
+			gPipeline.markTextured(mDrawable);
+		}
+		mTexAnimMode = result | mTextureAnimp->mMode;
+				
+		S32 start=0, end=mDrawable->getNumFaces()-1;
+		if (mTextureAnimp->mFace >= 0 && mTextureAnimp->mFace <= end)
+		{
+			start = end = mTextureAnimp->mFace;
+		}
+		
+		for (S32 i = start; i <= end; i++)
+		{
+			LLFace* facep = mDrawable->getFace(i);
+			if(facep->getVirtualSize() <= MIN_TEX_ANIM_SIZE && facep->mTextureMatrix) continue;
+
+			const LLTextureEntry* te = facep->getTextureEntry();
+			
+			if (!te)
+			{
+				continue;
+			}
+		
+			if (!(result & LLViewerTextureAnim::ROTATE))
+			{
+				te->getRotation(&rot);
+			}
+			if (!(result & LLViewerTextureAnim::TRANSLATE))
+			{
+				te->getOffset(&off_s,&off_t);
+			}			
+			if (!(result & LLViewerTextureAnim::SCALE))
+			{
+				te->getScale(&scale_s, &scale_t);
+			}
+
+			if (!facep->mTextureMatrix)
+			{
+				facep->mTextureMatrix = new LLMatrix4();
+			}
+
+			LLMatrix4& tex_mat = *facep->mTextureMatrix;
+			tex_mat.setIdentity();
+			LLVector3 trans ;
+
+			if(facep->isAtlasInUse())
+			{
+				//
+				//if use atlas for animated texture
+				//apply the following transform to the animation matrix.
+				//
+
+				F32 tcoord_xoffset = 0.f ;
+				F32 tcoord_yoffset = 0.f ;
+				F32 tcoord_xscale = 1.f ;
+				F32 tcoord_yscale = 1.f ;			
+				if(facep->isAtlasInUse())
+				{
+					const LLVector2* tmp = facep->getTexCoordOffset() ;
+					tcoord_xoffset = tmp->mV[0] ; 
+					tcoord_yoffset = tmp->mV[1] ;
+
+					tmp = facep->getTexCoordScale() ;
+					tcoord_xscale = tmp->mV[0] ; 
+					tcoord_yscale = tmp->mV[1] ;	
+				}
+				trans.set(LLVector3(tcoord_xoffset + tcoord_xscale * (off_s+0.5f), tcoord_yoffset + tcoord_yscale * (off_t+0.5f), 0.f));
+
+				tex_mat.translate(LLVector3(-(tcoord_xoffset + tcoord_xscale * 0.5f), -(tcoord_yoffset + tcoord_yscale * 0.5f), 0.f));
+			}
+			else	//non atlas
+			{
+				trans.set(LLVector3(off_s+0.5f, off_t+0.5f, 0.f));			
+				tex_mat.translate(LLVector3(-0.5f, -0.5f, 0.f));
+			}
+
+			LLVector3 scale(scale_s, scale_t, 1.f);			
+			LLQuaternion quat;
+			quat.setQuat(rot, 0, 0, -1.f);
+		
+			tex_mat.rotate(quat);				
+
+			LLMatrix4 mat;
+			mat.initAll(scale, LLQuaternion(), LLVector3());
+			tex_mat *= mat;
+		
+			tex_mat.translate(trans);
+		}
+	}
+	else
+	{
+		if (mTexAnimMode && mTextureAnimp->mRate == 0)
+		{
+			U8 start, count;
+
+			if (mTextureAnimp->mFace == -1)
+			{
+				start = 0;
+				count = getNumTEs();
+			}
+			else
+			{
+				start = (U8) mTextureAnimp->mFace;
+				count = 1;
+			}
+
+			for (S32 i = start; i < start + count; i++)
+			{
+				if (mTexAnimMode & LLViewerTextureAnim::TRANSLATE)
+				{
+					setTEOffset(i, mTextureAnimp->mOffS, mTextureAnimp->mOffT);				
+				}
+				if (mTexAnimMode & LLViewerTextureAnim::SCALE)
+				{
+					setTEScale(i, mTextureAnimp->mScaleS, mTextureAnimp->mScaleT);	
+				}
+				if (mTexAnimMode & LLViewerTextureAnim::ROTATE)
+				{
+					setTERotation(i, mTextureAnimp->mRot);
+				}
+			}
+
+			gPipeline.markTextured(mDrawable);
+			mFaceMappingChanged = TRUE;
+			mTexAnimMode = 0;
+		}
+	}
+}
+BOOL LLVOVolume::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
+{
+	LLViewerObject::idleUpdate(agent, world, time);
+
+	static LLFastTimer::DeclareTimer ftm("Volume");
+	LLFastTimer t(ftm);
+
+	if (mDead || mDrawable.isNull())
+	{
+		return TRUE;
+	}
+	
+	///////////////////////
+	//
+	// Do texture animation stuff
+	//
+
+	if (mTextureAnimp && gAnimateTextures)
+	{
+		animateTextures();
+	}
+
+	// Dispatch to implementation
+	if (mVolumeImpl)
+	{
+		mVolumeImpl->doIdleUpdate(agent, world, time);
+	}
+
+	const S32 MAX_ACTIVE_OBJECT_QUIET_FRAMES = 40;
+
+	if (mDrawable->isActive())
+	{
+		if (mDrawable->isRoot() && 
+			mDrawable->mQuietCount++ > MAX_ACTIVE_OBJECT_QUIET_FRAMES && 
+			(!mDrawable->getParent() || !mDrawable->getParent()->isActive()))
+		{
+			mDrawable->makeStatic();
+		}
+	}
+
+	return TRUE;
+}
+
+void LLVOVolume::updateTextures()
+{
+	const F32 TEXTURE_AREA_REFRESH_TIME = 5.f; // seconds
+	if (mTextureUpdateTimer.getElapsedTimeF32() > TEXTURE_AREA_REFRESH_TIME)
+	{
+		updateTextureVirtualSize();		
+	}
+}
+
+BOOL LLVOVolume::isVisible() const 
+{
+	if(mDrawable.notNull() && mDrawable->isVisible())
+	{
+		return TRUE ;
+	}
+
+	if(isAttachment())
+	{
+		LLViewerObject* objp = (LLViewerObject*)getParent() ;
+		while(objp && !objp->isAvatar())
+		{
+			objp = (LLViewerObject*)objp->getParent() ;
+		}
+
+		return objp && objp->mDrawable.notNull() && objp->mDrawable->isVisible() ;
+	}
+
+	return FALSE ;
+}
+
+void LLVOVolume::updateTextureVirtualSize()
+{
+	LLFastTimer ftm(FTM_VOLUME_TEXTURES);
+	// Update the pixel area of all faces
+
+	if(!isVisible())
+	{
+		return ;
+	}
+
+	if (!gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_SIMPLE))
+	{
+		return;
+	}
+
+	static LLCachedControl<bool> dont_load_textures(gSavedSettings,"TextureDisable");
+		
+	if (dont_load_textures || LLAppViewer::getTextureFetch()->mDebugPause) // || !mDrawable->isVisible())
+	{
+		return;
+	}
+
+	mTextureUpdateTimer.reset();
+	
+	F32 old_area = mPixelArea;
+	mPixelArea = 0.f;
+
+	const S32 num_faces = mDrawable->getNumFaces();
+	F32 min_vsize=999999999.f, max_vsize=0.f;
+	LLViewerCamera* camera = LLViewerCamera::getInstance();
+	for (S32 i = 0; i < num_faces; i++)
+	{
+		LLFace* face = mDrawable->getFace(i);
+		const LLTextureEntry *te = face->getTextureEntry();
+		LLViewerTexture *imagep = face->getTexture();
+		if (!imagep || !te ||			
+			face->mExtents[0].equals3(face->mExtents[1]))
+		{
+			continue;
+		}
+		
+		F32 vsize;
+		F32 old_size = face->getVirtualSize();
+
+		if (isHUDAttachment())
+		{
+			F32 area = (F32) camera->getScreenPixelArea();
+			vsize = area;
+			imagep->setBoostLevel(LLViewerTexture::BOOST_HUD);
+ 			face->setPixelArea(area); // treat as full screen
+			face->setVirtualSize(vsize);
+		}
+		else
+		{
+			vsize = face->getTextureVirtualSize();
+		}
+
+		mPixelArea = llmax(mPixelArea, face->getPixelArea());		
+
+		if (face->mTextureMatrix != NULL)
+		{
+			if ((vsize < MIN_TEX_ANIM_SIZE && old_size > MIN_TEX_ANIM_SIZE) ||
+				(vsize > MIN_TEX_ANIM_SIZE && old_size < MIN_TEX_ANIM_SIZE))
+			{
+				gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_TCOORD, FALSE);
+			}
+		}
+				
+		if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_AREA))
+		{
+			if (vsize < min_vsize) min_vsize = vsize;
+			if (vsize > max_vsize) max_vsize = vsize;
+		}
+		else if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY))
+		{
+			LLViewerFetchedTexture* img = LLViewerTextureManager::staticCastToFetchedTexture(imagep) ;
+			if(img)
+			{
+				F32 pri = img->getDecodePriority();
+				pri = llmax(pri, 0.0f);
+				if (pri < min_vsize) min_vsize = pri;
+				if (pri > max_vsize) max_vsize = pri;
+			}
+		}
+		else if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_FACE_AREA))
+		{
+			F32 pri = mPixelArea;
+			if (pri < min_vsize) min_vsize = pri;
+			if (pri > max_vsize) max_vsize = pri;
+		}	
+	}
+	
+	if (isSculpted())
+	{
+		LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT);
+		LLUUID id =  sculpt_params->getSculptTexture();
+		
+		updateSculptTexture();
+		
+		
+
+		if (mSculptTexture.notNull())
+		{
+			mSculptTexture->setBoostLevel(llmax((S32)mSculptTexture->getBoostLevel(),
+												(S32)LLViewerTexture::BOOST_SCULPTED));
+			mSculptTexture->setForSculpt() ;
+			
+			if(!mSculptTexture->isCachedRawImageReady())
+			{
+				S32 lod = llmin(mLOD, 3);
+				F32 lodf = ((F32)(lod + 1.0f)/4.f);
+				F32 tex_size = lodf * LLViewerTexture::sMaxSculptRez ;
+				mSculptTexture->addTextureStats(2.f * tex_size * tex_size, FALSE);
+			
+				//if the sculpty very close to the view point, load first
+				{				
+					LLVector3 lookAt = getPositionAgent() - camera->getOrigin();
+					F32 dist = lookAt.normVec() ;
+					F32 cos_angle_to_view_dir = lookAt * camera->getXAxis() ;				
+					mSculptTexture->setAdditionalDecodePriority(0.8f * LLFace::calcImportanceToCamera(cos_angle_to_view_dir, dist)) ;
+				}
+			}
+	
+			S32 texture_discard = mSculptTexture->getDiscardLevel(); //try to match the texture
+			S32 current_discard = getVolume() ? getVolume()->getSculptLevel() : -2 ;
+
+			if (texture_discard >= 0 && //texture has some data available
+				(texture_discard < current_discard || //texture has more data than last rebuild
+				current_discard < 0)) //no previous rebuild
+			{
+				gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, FALSE);
+				mSculptChanged = TRUE;
+			}
+
+			if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SCULPTED))
+			{
+				setDebugText(llformat("T%d C%d V%d\n%dx%d",
+										  texture_discard, current_discard, getVolume()->getSculptLevel(),
+										  mSculptTexture->getHeight(), mSculptTexture->getWidth()));
+			}
+		}
+
+	}
+
+	if (getLightTextureID().notNull())
+	{
+		LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
+		LLUUID id = params->getLightTexture();
+		mLightTexture = LLViewerTextureManager::getFetchedTexture(id);
+		if (mLightTexture.notNull())
+		{
+			F32 rad = getLightRadius();
+			mLightTexture->addTextureStats(gPipeline.calcPixelArea(getPositionAgent(), 
+																	LLVector3(rad,rad,rad),
+																	*camera));
+		}	
+	}
+	
+	if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_AREA))
+	{
+		setDebugText(llformat("%.0f:%.0f", (F32) sqrt(min_vsize),(F32) sqrt(max_vsize)));
+	}
+ 	else if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY))
+ 	{
+ 		setDebugText(llformat("%.0f:%.0f", (F32) sqrt(min_vsize),(F32) sqrt(max_vsize)));
+ 	}
+	else if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_FACE_AREA))
+	{
+		setDebugText(llformat("%.0f:%.0f", (F32) sqrt(min_vsize),(F32) sqrt(max_vsize)));
+	}
+
+	if (mPixelArea == 0)
+	{ //flexi phasing issues make this happen
+		mPixelArea = old_area;
+	}
+}
+
+BOOL LLVOVolume::isActive() const
+{
+	return !mStatic || mTextureAnimp || (mVolumeImpl && mVolumeImpl->isActive()) || 
+		(mDrawable.notNull() && mDrawable->isActive());
+}
+
+BOOL LLVOVolume::setMaterial(const U8 material)
+{
+	BOOL res = LLViewerObject::setMaterial(material);
+	
+	return res;
+}
+
+void LLVOVolume::setTexture(const S32 face)
+{
+	llassert(face < getNumTEs());
+	gGL.getTexUnit(0)->bind(getTEImage(face));
+}
+
+void LLVOVolume::setScale(const LLVector3 &scale, BOOL damped)
+{
+	if (scale != getScale())
+	{
+		// store local radius
+		LLViewerObject::setScale(scale);
+
+		if (mVolumeImpl)
+		{
+			mVolumeImpl->onSetScale(scale, damped);
+		}
+		
+		updateRadius();
+
+		//since drawable transforms do not include scale, changing volume scale
+		//requires an immediate rebuild of volume verts.
+		gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_POSITION, TRUE);
+	}
+}
+
+LLFace* LLVOVolume::addFace(S32 f)
+{
+	const LLTextureEntry* te = getTE(f);
+	LLViewerTexture* imagep = getTEImage(f);
+	return mDrawable->addFace(te, imagep);
+}
+
+LLDrawable *LLVOVolume::createDrawable(LLPipeline *pipeline)
+{
+	pipeline->allocDrawable(this);
+		
+	mDrawable->setRenderType(LLPipeline::RENDER_TYPE_VOLUME);
+
+	S32 max_tes_to_set = getNumTEs();
+	for (S32 i = 0; i < max_tes_to_set; i++)
+	{
+		addFace(i);
+	}
+	mNumFaces = max_tes_to_set;
+
+	if (isAttachment())
+	{
+		mDrawable->makeActive();
+	}
+
+	if (getIsLight())
+	{
+		// Add it to the pipeline mLightSet
+		gPipeline.setLight(mDrawable, TRUE);
+	}
+	
+	updateRadius();
+	bool force_update = true; // avoid non-alpha mDistance update being optimized away
+	mDrawable->updateDistance(*LLViewerCamera::getInstance(), force_update);
+
+	return mDrawable;
+}
+
+BOOL LLVOVolume::setVolume(const LLVolumeParams &params_in, const S32 detail, bool unique_volume)
+{
+	LLVolumeParams volume_params = params_in;
+
+	S32 last_lod = mVolumep.notNull() ? LLVolumeLODGroup::getVolumeDetailFromScale(mVolumep->getDetail()) : -1;
+	S32 lod = mLOD;
+
+	BOOL is404 = FALSE;
+	
+	if (isSculpted())
+	{
+		// if it's a mesh
+		if ((volume_params.getSculptType() & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH)
+		{ //meshes might not have all LODs, get the force detail to best existing LOD
+			LLUUID mesh_id = volume_params.getSculptID();
+
+			lod = gMeshRepo.getActualMeshLOD(volume_params, lod);
+			if (lod == -1)
+			{
+				is404 = TRUE;
+				lod = 0;
+			}
+		}
+	}
+
+	// Check if we need to change implementations
+	bool is_flexible = (volume_params.getPathParams().getCurveType() == LL_PCODE_PATH_FLEXIBLE);
+	if (is_flexible)
+	{
+		setParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE, TRUE, false);
+		if (!mVolumeImpl)
+		{
+			LLFlexibleObjectData* data = (LLFlexibleObjectData*)getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE);
+			mVolumeImpl = new LLVolumeImplFlexible(this, data);
+		}
+	}
+	else
+	{
+		// Mark the parameter not in use
+		setParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE, FALSE, false);
+		if (mVolumeImpl)
+		{
+			delete mVolumeImpl;
+			mVolumeImpl = NULL;
+			if (mDrawable.notNull())
+			{
+				// Undo the damage we did to this matrix
+				mDrawable->updateXform(FALSE);
+			}
+		}
+	}
+	
+	if (is404)
+	{
+		setIcon(LLViewerTextureManager::getFetchedTextureFromFile("icons/Inv_Mesh.png", TRUE, LLViewerTexture::BOOST_UI));
+		//render prim proxy when mesh loading attempts give up
+		volume_params.setSculptID(LLUUID::null, LL_SCULPT_TYPE_NONE);
+
+	}
+
+	if ((LLPrimitive::setVolume(volume_params, lod, (mVolumeImpl && mVolumeImpl->isVolumeUnique()))) || mSculptChanged)
+	{
+		mFaceMappingChanged = TRUE;
+		
+		if (mVolumeImpl)
+		{
+			mVolumeImpl->onSetVolume(volume_params, mLOD);
+		}
+	
+		updateSculptTexture();
+
+		if (isSculpted())
+		{
+			updateSculptTexture();
+			// if it's a mesh
+			if ((volume_params.getSculptType() & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH)
+			{
+				if (!getVolume()->isMeshAssetLoaded())
+				{ 
+					//load request not yet issued, request pipeline load this mesh
+					LLUUID asset_id = volume_params.getSculptID();
+					S32 available_lod = gMeshRepo.loadMesh(this, volume_params, lod, last_lod);
+					if (available_lod != lod)
+					{
+						LLPrimitive::setVolume(volume_params, available_lod);
+					}
+				}
+				
+			}
+			else // otherwise is sculptie
+			{
+				if (mSculptTexture.notNull())
+				{
+					sculpt();
+				}
+			}
+		}
+
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+void LLVOVolume::updateSculptTexture()
+{
+	LLPointer<LLViewerFetchedTexture> old_sculpt = mSculptTexture;
+
+	if (isSculpted() && !isMesh())
+	{
+		LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT);
+		LLUUID id =  sculpt_params->getSculptTexture();
+		if (id.notNull())
+		{
+			mSculptTexture = LLViewerTextureManager::getFetchedTexture(id, TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
+		}
+	}
+	else
+	{
+		mSculptTexture = NULL;
+	}
+
+	if (mSculptTexture != old_sculpt)
+	{
+		if (old_sculpt.notNull())
+		{
+			old_sculpt->removeVolume(this);
+		}
+		if (mSculptTexture.notNull())
+		{
+			mSculptTexture->addVolume(this);
+		}
+	}
+	
+}
+
+void LLVOVolume::notifyMeshLoaded()
+{ 
+	mSculptChanged = TRUE;
+	gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_GEOMETRY, TRUE);
+}
+
+// sculpt replaces generate() for sculpted surfaces
+void LLVOVolume::sculpt()
+{	
+	if (mSculptTexture.notNull())
+	{				
+		U16 sculpt_height = 0;
+		U16 sculpt_width = 0;
+		S8 sculpt_components = 0;
+		const U8* sculpt_data = NULL;
+	
+		S32 discard_level = mSculptTexture->getDiscardLevel() ;
+		LLImageRaw* raw_image = mSculptTexture->getCachedRawImage() ;
+		
+		S32 max_discard = mSculptTexture->getMaxDiscardLevel();
+		if (discard_level > max_discard)
+			discard_level = max_discard;    // clamp to the best we can do
+
+		S32 current_discard = getVolume()->getSculptLevel() ;
+		if(current_discard < -2)
+		{
+			llwarns << "WARNING!!: Current discard of sculpty at " << current_discard 
+				<< " is less than -2." << llendl;
+			
+			// corrupted volume... don't update the sculpty
+			return;
+		}
+		else if (current_discard > MAX_DISCARD_LEVEL)
+		{
+			llwarns << "WARNING!!: Current discard of sculpty at " << current_discard 
+				<< " is more than than allowed max of " << MAX_DISCARD_LEVEL << llendl;
+			
+			// corrupted volume... don't update the sculpty			
+			return;
+		}
+
+		if (current_discard == discard_level)  // no work to do here
+			return;
+		
+		if(!raw_image)
+		{
+			llassert(discard_level < 0) ;
+
+			sculpt_width = 0;
+			sculpt_height = 0;
+			sculpt_data = NULL ;
+
+			if(LLViewerTextureManager::sTesterp)
+			{
+				LLViewerTextureManager::sTesterp->updateGrayTextureBinding();
+			}
+		}
+		else
+		{					
+			sculpt_height = raw_image->getHeight();
+			sculpt_width = raw_image->getWidth();
+			sculpt_components = raw_image->getComponents();		
+					   
+			sculpt_data = raw_image->getData();
+
+			if(LLViewerTextureManager::sTesterp)
+			{
+				mSculptTexture->updateBindStatsForTester() ;
+			}
+		}
+		getVolume()->sculpt(sculpt_width, sculpt_height, sculpt_components, sculpt_data, discard_level);
+
+		//notify rebuild any other VOVolumes that reference this sculpty volume
+		for (S32 i = 0; i < mSculptTexture->getNumVolumes(); ++i)
+		{
+			LLVOVolume* volume = (*(mSculptTexture->getVolumeList()))[i];
+			if (volume != this && volume->getVolume() == getVolume())
+			{
+				gPipeline.markRebuild(volume->mDrawable, LLDrawable::REBUILD_GEOMETRY, FALSE);
+			}
+		}
+	}
+}
+
+S32	LLVOVolume::computeLODDetail(F32 distance, F32 radius)
+{
+	S32	cur_detail;
+	if (LLPipeline::sDynamicLOD)
+	{
+		// We've got LOD in the profile, and in the twist.  Use radius.
+		F32 tan_angle = (LLVOVolume::sLODFactor*radius)/distance;
+		cur_detail = LLVolumeLODGroup::getDetailFromTan(llround(tan_angle, 0.01f));
+	}
+	else
+	{
+		cur_detail = llclamp((S32) (sqrtf(radius)*LLVOVolume::sLODFactor*4.f), 0, 3);		
+	}
+	return cur_detail;
+}
+
+BOOL LLVOVolume::calcLOD()
+{
+	if (mDrawable.isNull())
+	{
+		return FALSE;
+	}
+
+	S32 cur_detail = 0;
+	
+	F32 radius;
+	F32 distance;
+
+	if (mDrawable->isState(LLDrawable::RIGGED))
+	{
+		LLVOAvatar* avatar = getAvatar(); 
+		distance = avatar->mDrawable->mDistanceWRTCamera;
+		radius = avatar->getBinRadius();
+	}
+	else
+	{
+		distance = mDrawable->mDistanceWRTCamera;
+		radius = getVolume()->mLODScaleBias.scaledVec(getScale()).length();
+	}
+	
+	//hold onto unmodified distance for debugging
+	//F32 debug_distance = distance;
+	
+	distance *= sDistanceFactor;
+
+	F32 rampDist = LLVOVolume::sLODFactor * 2;
+	
+	if (distance < rampDist)
+	{
+		// Boost LOD when you're REALLY close
+		distance *= 1.0f/rampDist;
+		distance *= distance;
+		distance *= rampDist;
+	}
+	
+	// DON'T Compensate for field of view changing on FOV zoom.
+	distance *= F_PI/3.f;
+
+	cur_detail = computeLODDetail(llround(distance, 0.01f), 
+									llround(radius, 0.01f));
+
+
+	if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_LOD_INFO))
+	{
+		//setDebugText(llformat("%.2f:%.2f, %d", debug_distance, radius, cur_detail));
+
+		setDebugText(llformat("%d", mDrawable->getFace(0)->getTextureIndex()));
+	}
+
+	if (cur_detail != mLOD)
+	{
+		mAppAngle = llround((F32) atan2( mDrawable->getRadius(), mDrawable->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f);
+		mLOD = cur_detail;		
+		return TRUE;
+	}
+	else
+	{
+		return FALSE;
+	}
+}
+
+BOOL LLVOVolume::updateLOD()
+{
+	if (mDrawable.isNull())
+	{
+		return FALSE;
+	}
+	
+	BOOL lod_changed = calcLOD();
+
+	if (lod_changed)
+	{
+		gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, FALSE);
+		mLODChanged = TRUE;
+	}
+	else
+	{
+		F32 new_radius = getBinRadius();
+		F32 old_radius = mDrawable->getBinRadius();
+		if (new_radius < old_radius * 0.9f || new_radius > old_radius*1.1f)
+		{
+			gPipeline.markPartitionMove(mDrawable);
+		}
+	}
+
+	lod_changed = lod_changed || LLViewerObject::updateLOD();
+	
+	return lod_changed;
+}
+
+BOOL LLVOVolume::setDrawableParent(LLDrawable* parentp)
+{
+	if (!LLViewerObject::setDrawableParent(parentp))
+	{
+		// no change in drawable parent
+		return FALSE;
+	}
+
+	if (!mDrawable->isRoot())
+	{
+		// rebuild vertices in parent relative space
+		gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE);
+
+		if (mDrawable->isActive() && !parentp->isActive())
+		{
+			parentp->makeActive();
+		}
+		else if (mDrawable->isStatic() && parentp->isActive())
+		{
+			mDrawable->makeActive();
+		}
+	}
+	
+	return TRUE;
+}
+
+void LLVOVolume::updateFaceFlags()
+{
+	for (S32 i = 0; i < getVolume()->getNumFaces(); i++)
+	{
+		LLFace *face = mDrawable->getFace(i);
+		if (!face)
+		{
+			return;
+		}
+
+		BOOL fullbright = getTE(i)->getFullbright();
+		face->clearState(LLFace::FULLBRIGHT | LLFace::HUD_RENDER | LLFace::LIGHT);
+
+		if (fullbright || (mMaterial == LL_MCODE_LIGHT))
+		{
+			face->setState(LLFace::FULLBRIGHT);
+		}
+		if (mDrawable->isLight())
+		{
+			face->setState(LLFace::LIGHT);
+		}
+		if (isHUDAttachment())
+		{
+			face->setState(LLFace::HUD_RENDER);
+		}
+	}
+}
+
+BOOL LLVOVolume::setParent(LLViewerObject* parent)
+{
+	BOOL ret = FALSE ;
+	if (parent != getParent())
+	{
+		ret = LLViewerObject::setParent(parent);
+		if (ret && mDrawable)
+		{
+			gPipeline.markMoved(mDrawable);
+			gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE);
+		}
+	}
+
+	return ret ;
+}
+
+// NOTE: regenFaces() MUST be followed by genTriangles()!
+void LLVOVolume::regenFaces()
+{
+	// remove existing faces
+	BOOL count_changed = mNumFaces != getNumTEs();
+	
+	if (count_changed)
+	{
+		deleteFaces();		
+		// add new faces
+		mNumFaces = getNumTEs();
+	}
+		
+	for (S32 i = 0; i < mNumFaces; i++)
+	{
+		LLFace* facep = count_changed ? addFace(i) : mDrawable->getFace(i);
+		facep->setTEOffset(i);
+		facep->setTexture(getTEImage(i));
+		facep->setViewerObject(this);
+		
+		// If the face had media on it, this will have broken the link between the LLViewerMediaTexture and the face.
+		// Re-establish the link.
+		if((int)mMediaImplList.size() > i)
+		{
+			if(mMediaImplList[i])
+			{
+				LLViewerMediaTexture* media_tex = LLViewerTextureManager::findMediaTexture(mMediaImplList[i]->getMediaTextureID()) ;
+				if(media_tex)
+				{
+					media_tex->addMediaToFace(facep) ;
+				}
+			}
+		}
+	}
+	
+	if (!count_changed)
+	{
+		updateFaceFlags();
+	}
+}
+
+BOOL LLVOVolume::genBBoxes(BOOL force_global)
+{
+	BOOL res = TRUE;
+
+	LLVector4a min,max;
+
+	min.clear();
+	max.clear();
+
+	BOOL rebuild = mDrawable->isState(LLDrawable::REBUILD_VOLUME | LLDrawable::REBUILD_POSITION | LLDrawable::REBUILD_RIGGED);
+
+//	bool rigged = false;
+	LLVolume* volume = mRiggedVolume;
+	if (!volume)
+	{
+		volume = getVolume();
+	}
+
+	for (S32 i = 0; i < getVolume()->getNumVolumeFaces(); i++)
+	{
+		LLFace *face = mDrawable->getFace(i);
+		if (!face)
+		{
+			continue;
+		}
+		res &= face->genVolumeBBoxes(*volume, i,
+										mRelativeXform, mRelativeXformInvTrans,
+										(mVolumeImpl && mVolumeImpl->isVolumeGlobal()) || force_global);
+		
+		if (rebuild)
+		{
+			if (i == 0)
+			{
+				min = face->mExtents[0];
+				max = face->mExtents[1];
+			}
+			else
+			{
+				min.setMin(min, face->mExtents[0]);
+				max.setMax(max, face->mExtents[1]);
+			}
+		}
+	}
+	
+	if (rebuild)
+	{
+		mDrawable->setSpatialExtents(min,max);
+		min.add(max);
+		min.mul(0.5f);
+		mDrawable->setPositionGroup(min);	
+	}
+
+	updateRadius();
+	mDrawable->movePartition();
+			
+	return res;
+}
+
+void LLVOVolume::preRebuild()
+{
+	if (mVolumeImpl != NULL)
+	{
+		mVolumeImpl->preRebuild();
+	}
+}
+
+void LLVOVolume::updateRelativeXform()
+{
+	if (mVolumeImpl)
+	{
+		mVolumeImpl->updateRelativeXform();
+		return;
+	}
+	
+	LLDrawable* drawable = mDrawable;
+	
+	if (drawable->isState(LLDrawable::RIGGED) && mRiggedVolume.notNull())
+	{ //rigged volume (which is in agent space) is used for generating bounding boxes etc
+	  //inverse of render matrix should go to partition space
+		mRelativeXform = getRenderMatrix();
+
+		F32* dst = (F32*) mRelativeXformInvTrans.mMatrix;
+		F32* src = (F32*) mRelativeXform.mMatrix;
+		dst[0] = src[0]; dst[1] = src[1]; dst[2] = src[2];
+		dst[3] = src[4]; dst[4] = src[5]; dst[5] = src[6];
+		dst[6] = src[8]; dst[7] = src[9]; dst[8] = src[10];
+		
+		mRelativeXform.invert();
+		mRelativeXformInvTrans.transpose();
+	}
+	else if (drawable->isActive())
+	{				
+		// setup relative transforms
+		LLQuaternion delta_rot;
+		LLVector3 delta_pos, delta_scale;
+		
+		//matrix from local space to parent relative/global space
+		delta_rot = drawable->isSpatialRoot() ? LLQuaternion() : mDrawable->getRotation();
+		delta_pos = drawable->isSpatialRoot() ? LLVector3(0,0,0) : mDrawable->getPosition();
+		delta_scale = mDrawable->getScale();
+
+		// Vertex transform (4x4)
+		LLVector3 x_axis = LLVector3(delta_scale.mV[VX], 0.f, 0.f) * delta_rot;
+		LLVector3 y_axis = LLVector3(0.f, delta_scale.mV[VY], 0.f) * delta_rot;
+		LLVector3 z_axis = LLVector3(0.f, 0.f, delta_scale.mV[VZ]) * delta_rot;
+
+		mRelativeXform.initRows(LLVector4(x_axis, 0.f),
+								LLVector4(y_axis, 0.f),
+								LLVector4(z_axis, 0.f),
+								LLVector4(delta_pos, 1.f));
+
+		
+		// compute inverse transpose for normals
+		// mRelativeXformInvTrans.setRows(x_axis, y_axis, z_axis);
+		// mRelativeXformInvTrans.invert(); 
+		// mRelativeXformInvTrans.setRows(x_axis, y_axis, z_axis);
+		// grumble - invert is NOT a matrix invert, so we do it by hand:
+
+		LLMatrix3 rot_inverse = LLMatrix3(~delta_rot);
+
+		LLMatrix3 scale_inverse;
+		scale_inverse.setRows(LLVector3(1.0, 0.0, 0.0) / delta_scale.mV[VX],
+							  LLVector3(0.0, 1.0, 0.0) / delta_scale.mV[VY],
+							  LLVector3(0.0, 0.0, 1.0) / delta_scale.mV[VZ]);
+							   
+		
+		mRelativeXformInvTrans = rot_inverse * scale_inverse;
+
+		mRelativeXformInvTrans.transpose();
+	}
+	else
+	{
+		LLVector3 pos = getPosition();
+		LLVector3 scale = getScale();
+		LLQuaternion rot = getRotation();
+	
+		if (mParent)
+		{
+			pos *= mParent->getRotation();
+			pos += mParent->getPosition();
+			rot *= mParent->getRotation();
+		}
+		
+		//LLViewerRegion* region = getRegion();
+		//pos += region->getOriginAgent();
+		
+		LLVector3 x_axis = LLVector3(scale.mV[VX], 0.f, 0.f) * rot;
+		LLVector3 y_axis = LLVector3(0.f, scale.mV[VY], 0.f) * rot;
+		LLVector3 z_axis = LLVector3(0.f, 0.f, scale.mV[VZ]) * rot;
+
+		mRelativeXform.initRows(LLVector4(x_axis, 0.f),
+								LLVector4(y_axis, 0.f),
+								LLVector4(z_axis, 0.f),
+								LLVector4(pos, 1.f));
+
+		// compute inverse transpose for normals
+		LLMatrix3 rot_inverse = LLMatrix3(~rot);
+
+		LLMatrix3 scale_inverse;
+		scale_inverse.setRows(LLVector3(1.0, 0.0, 0.0) / scale.mV[VX],
+							  LLVector3(0.0, 1.0, 0.0) / scale.mV[VY],
+							  LLVector3(0.0, 0.0, 1.0) / scale.mV[VZ]);
+							   
+		
+		mRelativeXformInvTrans = rot_inverse * scale_inverse;
+
+		mRelativeXformInvTrans.transpose();
+	}
+}
+
+static LLFastTimer::DeclareTimer FTM_GEN_FLEX("Generate Flexies");
+static LLFastTimer::DeclareTimer FTM_UPDATE_PRIMITIVES("Update Primitives");
+static LLFastTimer::DeclareTimer FTM_UPDATE_RIGGED_VOLUME("Update Rigged");
+
+BOOL LLVOVolume::updateGeometry(LLDrawable *drawable)
+{
+	LLFastTimer t(FTM_UPDATE_PRIMITIVES);
+	
+	if (mDrawable->isState(LLDrawable::REBUILD_RIGGED))
+	{
+		{
+			LLFastTimer t(FTM_UPDATE_RIGGED_VOLUME);
+			updateRiggedVolume();
+		}
+		genBBoxes(FALSE);
+		mDrawable->clearState(LLDrawable::REBUILD_RIGGED);
+	}
+
+	if (mVolumeImpl != NULL)
+	{
+		BOOL res;
+		{
+			LLFastTimer t(FTM_GEN_FLEX);
+			res = mVolumeImpl->doUpdateGeometry(drawable);
+		}
+		updateFaceFlags();
+		return res;
+	}
+	
+	dirtySpatialGroup(drawable->isState(LLDrawable::IN_REBUILD_Q1));
+
+	BOOL compiled = FALSE;
+			
+	updateRelativeXform();
+	
+	if (mDrawable.isNull()) // Not sure why this is happening, but it is...
+	{
+		return TRUE; // No update to complete
+	}
+
+	if (mVolumeChanged || mFaceMappingChanged )
+	{
+		compiled = TRUE;
+
+		if (mVolumeChanged)
+		{
+			LLFastTimer ftm(FTM_GEN_VOLUME);
+			LLVolumeParams volume_params = getVolume()->getParams();
+			setVolume(volume_params, 0);
+			drawable->setState(LLDrawable::REBUILD_VOLUME);
+		}
+
+		{
+			LLFastTimer t(FTM_GEN_TRIANGLES);
+			regenFaces();
+			genBBoxes(FALSE);
+		}
+	}
+	else if ((mLODChanged) || (mSculptChanged))
+	{
+		LLVolume *old_volumep, *new_volumep;
+		F32 old_lod, new_lod;
+		S32 old_num_faces, new_num_faces ;
+
+		old_volumep = getVolume();
+		old_lod = old_volumep->getDetail();
+		old_num_faces = old_volumep->getNumFaces() ;
+		old_volumep = NULL ;
+
+		{
+			LLFastTimer ftm(FTM_GEN_VOLUME);
+			LLVolumeParams volume_params = getVolume()->getParams();
+			setVolume(volume_params, 0);
+		}
+
+		new_volumep = getVolume();
+		new_lod = new_volumep->getDetail();
+		new_num_faces = new_volumep->getNumFaces() ;
+		new_volumep = NULL ;
+
+		if ((new_lod != old_lod) || mSculptChanged)
+		{
+			compiled = TRUE;
+			sNumLODChanges += new_num_faces ;
+	
+			drawable->setState(LLDrawable::REBUILD_VOLUME); // for face->genVolumeTriangles()
+
+			{
+				LLFastTimer t(FTM_GEN_TRIANGLES);
+				if (new_num_faces != old_num_faces)
+				{
+					regenFaces();
+				}
+				genBBoxes(FALSE);
+
+				if (mSculptChanged)
+				{ //changes in sculpt maps can thrash an object bounding box without 
+				  //triggering a spatial group bounding box update -- force spatial group
+				  //to update bounding boxes
+					LLSpatialGroup* group = mDrawable->getSpatialGroup();
+					if (group)
+					{
+						group->unbound();
+					}
+				}
+			}
+		}
+	}
+	// it has its own drawable (it's moved) or it has changed UVs or it has changed xforms from global<->local
+	else
+	{
+		compiled = TRUE;
+		// All it did was move or we changed the texture coordinate offset
+		LLFastTimer t(FTM_GEN_TRIANGLES);
+		genBBoxes(FALSE);
+	}
+
+	// Update face flags
+	updateFaceFlags();
+	
+	if(compiled)
+	{
+		LLPipeline::sCompiles++;
+	}
+		
+	mVolumeChanged = FALSE;
+	mLODChanged = FALSE;
+	mSculptChanged = FALSE;
+	mFaceMappingChanged = FALSE;
+	
+	return LLViewerObject::updateGeometry(drawable);
+}
+
+void LLVOVolume::updateFaceSize(S32 idx)
+{
+	LLFace* facep = mDrawable->getFace(idx);
+	if (idx >= getVolume()->getNumVolumeFaces())
+	{
+		facep->setSize(0,0, true);
+	}
+	else
+	{
+		const LLVolumeFace& vol_face = getVolume()->getVolumeFace(idx);
+		facep->setSize(vol_face.mNumVertices, vol_face.mNumIndices, 
+						true); // <--- volume faces should be padded for 16-byte alignment
+		
+	}
+}
+
+BOOL LLVOVolume::isRootEdit() const
+{
+	if (mParent && !((LLViewerObject*)mParent)->isAvatar())
+	{
+		return FALSE;
+	}
+	return TRUE;
+}
+
+//virtual
+void LLVOVolume::setNumTEs(const U8 num_tes)
+{
+	const U8 old_num_tes = getNumTEs() ;
+	
+	if(old_num_tes && old_num_tes < num_tes) //new faces added
+	{
+		LLViewerObject::setNumTEs(num_tes) ;
+
+		if(mMediaImplList.size() >= old_num_tes && mMediaImplList[old_num_tes -1].notNull())//duplicate the last media textures if exists.
+		{
+			mMediaImplList.resize(num_tes) ;
+			const LLTextureEntry* te = getTE(old_num_tes - 1) ;
+			for(U8 i = old_num_tes; i < num_tes ; i++)
+			{
+				setTE(i, *te) ;
+				mMediaImplList[i] = mMediaImplList[old_num_tes -1] ;
+			}
+			mMediaImplList[old_num_tes -1]->setUpdated(TRUE) ;
+		}
+	}
+	else if(old_num_tes > num_tes && mMediaImplList.size() > num_tes) //old faces removed
+	{
+		U8 end = mMediaImplList.size() ;
+		for(U8 i = num_tes; i < end ; i++)
+		{
+			removeMediaImpl(i) ;				
+		}
+		mMediaImplList.resize(num_tes) ;
+
+		LLViewerObject::setNumTEs(num_tes) ;
+	}
+	else
+	{
+		LLViewerObject::setNumTEs(num_tes) ;
+	}
+
+	return ;
+}
+
+void LLVOVolume::setTEImage(const U8 te, LLViewerTexture *imagep)
+{
+	BOOL changed = (mTEImages[te] != imagep);
+	LLViewerObject::setTEImage(te, imagep);
+	if (changed)
+	{
+		gPipeline.markTextured(mDrawable);
+		mFaceMappingChanged = TRUE;
+	}
+}
+
+S32 LLVOVolume::setTETexture(const U8 te, const LLUUID &uuid)
+{
+	S32 res = LLViewerObject::setTETexture(te, uuid);
+	if (res)
+	{
+		gPipeline.markTextured(mDrawable);
+		mFaceMappingChanged = TRUE;
+	}
+	return res;
+}
+
+S32 LLVOVolume::setTEColor(const U8 te, const LLColor3& color)
+{
+	return setTEColor(te, LLColor4(color));
+}
+
+S32 LLVOVolume::setTEColor(const U8 te, const LLColor4& color)
+{
+	S32 retval = 0;
+	const LLTextureEntry *tep = getTE(te);
+	if (!tep)
+	{
+		llwarns << "No texture entry for te " << (S32)te << ", object " << mID << llendl;
+	}
+	else if (color != tep->getColor())
+	{
+		if (color.mV[3] != tep->getColor().mV[3])
+		{
+			gPipeline.markTextured(mDrawable);
+		}
+		retval = LLPrimitive::setTEColor(te, color);
+		if (mDrawable.notNull() && retval)
+		{
+			// These should only happen on updates which are not the initial update.
+			mDrawable->setState(LLDrawable::REBUILD_COLOR);
+			dirtyMesh();
+		}
+	}
+
+	return  retval;
+}
+
+S32 LLVOVolume::setTEBumpmap(const U8 te, const U8 bumpmap)
+{
+	S32 res = LLViewerObject::setTEBumpmap(te, bumpmap);
+	if (res)
+	{
+		gPipeline.markTextured(mDrawable);
+		mFaceMappingChanged = TRUE;
+	}
+	return  res;
+}
+
+S32 LLVOVolume::setTETexGen(const U8 te, const U8 texgen)
+{
+	S32 res = LLViewerObject::setTETexGen(te, texgen);
+	if (res)
+	{
+		gPipeline.markTextured(mDrawable);
+		mFaceMappingChanged = TRUE;
+	}
+	return  res;
+}
+
+S32 LLVOVolume::setTEMediaTexGen(const U8 te, const U8 media)
+{
+	S32 res = LLViewerObject::setTEMediaTexGen(te, media);
+	if (res)
+	{
+		gPipeline.markTextured(mDrawable);
+		mFaceMappingChanged = TRUE;
+	}
+	return  res;
+}
+
+S32 LLVOVolume::setTEShiny(const U8 te, const U8 shiny)
+{
+	S32 res = LLViewerObject::setTEShiny(te, shiny);
+	if (res)
+	{
+		gPipeline.markTextured(mDrawable);
+		mFaceMappingChanged = TRUE;
+	}
+	return  res;
+}
+
+S32 LLVOVolume::setTEFullbright(const U8 te, const U8 fullbright)
+{
+	S32 res = LLViewerObject::setTEFullbright(te, fullbright);
+	if (res)
+	{
+		gPipeline.markTextured(mDrawable);
+		mFaceMappingChanged = TRUE;
+	}
+	return  res;
+}
+
+S32 LLVOVolume::setTEBumpShinyFullbright(const U8 te, const U8 bump)
+{
+	S32 res = LLViewerObject::setTEBumpShinyFullbright(te, bump);
+	if (res)
+	{
+		gPipeline.markTextured(mDrawable);
+		mFaceMappingChanged = TRUE;
+	}
+	return res;
+}
+
+S32 LLVOVolume::setTEMediaFlags(const U8 te, const U8 media_flags)
+{
+	S32 res = LLViewerObject::setTEMediaFlags(te, media_flags);
+	if (res)
+	{
+		gPipeline.markTextured(mDrawable);
+		mFaceMappingChanged = TRUE;
+	}
+	return  res;
+}
+
+S32 LLVOVolume::setTEGlow(const U8 te, const F32 glow)
+{
+	S32 res = LLViewerObject::setTEGlow(te, glow);
+	if (res)
+	{
+		gPipeline.markTextured(mDrawable);
+		mFaceMappingChanged = TRUE;
+	}
+	return  res;
+}
+
+S32 LLVOVolume::setTEScale(const U8 te, const F32 s, const F32 t)
+{
+	S32 res = LLViewerObject::setTEScale(te, s, t);
+	if (res)
+	{
+		gPipeline.markTextured(mDrawable);
+		mFaceMappingChanged = TRUE;
+	}
+	return res;
+}
+
+S32 LLVOVolume::setTEScaleS(const U8 te, const F32 s)
+{
+	S32 res = LLViewerObject::setTEScaleS(te, s);
+	if (res)
+	{
+		gPipeline.markTextured(mDrawable);
+		mFaceMappingChanged = TRUE;
+	}
+	return res;
+}
+
+S32 LLVOVolume::setTEScaleT(const U8 te, const F32 t)
+{
+	S32 res = LLViewerObject::setTEScaleT(te, t);
+	if (res)
+	{
+		gPipeline.markTextured(mDrawable);
+		mFaceMappingChanged = TRUE;
+	}
+	return res;
+}
+
+void LLVOVolume::updateTEData()
+{
+	/*if (mDrawable.notNull())
+	{
+		mFaceMappingChanged = TRUE;
+		gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_MATERIAL, TRUE);
+	}*/
+}
+
+bool LLVOVolume::hasMedia() const
+{
+	bool result = false;
+	const U8 numTEs = getNumTEs();
+	for (U8 i = 0; i < numTEs; i++)
+	{
+		const LLTextureEntry* te = getTE(i);
+		if(te->hasMedia())
+		{
+			result = true;
+			break;
+		}
+	}
+	return result;
+}
+
+LLVector3 LLVOVolume::getApproximateFaceNormal(U8 face_id)
+{
+	LLVolume* volume = getVolume();
+	LLVector4a result;
+	result.clear();
+
+	LLVector3 ret;
+
+	if (volume && face_id < volume->getNumVolumeFaces())
+	{
+		const LLVolumeFace& face = volume->getVolumeFace(face_id);
+		for (S32 i = 0; i < (S32)face.mNumVertices; ++i)
+		{
+			result.add(face.mNormals[i]);
+		}
+
+		LLVector3 ret(result.getF32ptr());
+		ret = volumeDirectionToAgent(ret);
+		ret.normVec();
+	}
+	
+	return ret;
+}
+
+void LLVOVolume::requestMediaDataUpdate(bool isNew)
+{
+    if (sObjectMediaClient)
+		sObjectMediaClient->fetchMedia(new LLMediaDataClientObjectImpl(this, isNew));
+}
+
+bool LLVOVolume::isMediaDataBeingFetched() const
+{
+	// I know what I'm doing by const_casting this away: this is just 
+	// a wrapper class that is only going to do a lookup.
+	return (sObjectMediaClient) ? sObjectMediaClient->isInQueue(new LLMediaDataClientObjectImpl(const_cast<LLVOVolume*>(this), false)) : false;
+}
+
+void LLVOVolume::cleanUpMediaImpls()
+{
+	// Iterate through our TEs and remove any Impls that are no longer used
+	const U8 numTEs = getNumTEs();
+	for (U8 i = 0; i < numTEs; i++)
+	{
+		const LLTextureEntry* te = getTE(i);
+		if( ! te->hasMedia())
+		{
+			// Delete the media IMPL!
+			removeMediaImpl(i) ;
+		}
+	}
+}
+
+void LLVOVolume::updateObjectMediaData(const LLSD &media_data_array, const std::string &media_version)
+{
+	// media_data_array is an array of media entry maps
+	// media_version is the version string in the response.
+	U32 fetched_version = LLTextureEntry::getVersionFromMediaVersionString(media_version);
+
+	// Only update it if it is newer!
+	if ( (S32)fetched_version > mLastFetchedMediaVersion)
+	{
+		mLastFetchedMediaVersion = fetched_version;
+		//llinfos << "updating:" << this->getID() << " " << ll_pretty_print_sd(media_data_array) << llendl;
+		
+		LLSD::array_const_iterator iter = media_data_array.beginArray();
+		LLSD::array_const_iterator end = media_data_array.endArray();
+		U8 texture_index = 0;
+		for (; iter != end; ++iter, ++texture_index)
+		{
+			syncMediaData(texture_index, *iter, false/*merge*/, false/*ignore_agent*/);
+		}
+	}
+}
+
+void LLVOVolume::syncMediaData(S32 texture_index, const LLSD &media_data, bool merge, bool ignore_agent)
+{
+	if(mDead)
+	{
+		// If the object has been marked dead, don't process media updates.
+		return;
+	}
+	
+	LLTextureEntry *te = getTE(texture_index);
+	if(!te)
+	{
+		return ;
+	}
+
+	LL_DEBUGS("MediaOnAPrim") << "BEFORE: texture_index = " << texture_index
+		<< " hasMedia = " << te->hasMedia() << " : " 
+		<< ((NULL == te->getMediaData()) ? "NULL MEDIA DATA" : ll_pretty_print_sd(te->getMediaData()->asLLSD())) << llendl;
+
+	std::string previous_url;
+	LLMediaEntry* mep = te->getMediaData();
+	if(mep)
+	{
+		// Save the "current url" from before the update so we can tell if
+		// it changes. 
+		previous_url = mep->getCurrentURL();
+	}
+
+	if (merge)
+	{
+		te->mergeIntoMediaData(media_data);
+	}
+	else {
+		// XXX Question: what if the media data is undefined LLSD, but the
+		// update we got above said that we have media flags??	Here we clobber
+		// that, assuming the data from the service is more up-to-date. 
+		te->updateMediaData(media_data);
+	}
+
+	mep = te->getMediaData();
+	if(mep)
+	{
+		bool update_from_self = false;
+		if (!ignore_agent) 
+		{
+			LLUUID updating_agent = LLTextureEntry::getAgentIDFromMediaVersionString(getMediaURL());
+			update_from_self = (updating_agent == gAgent.getID());
+		}
+		viewer_media_t media_impl = LLViewerMedia::updateMediaImpl(mep, previous_url, update_from_self);
+			
+		addMediaImpl(media_impl, texture_index) ;
+	}
+	else
+	{
+		removeMediaImpl(texture_index);
+	}
+
+	LL_DEBUGS("MediaOnAPrim") << "AFTER: texture_index = " << texture_index
+		<< " hasMedia = " << te->hasMedia() << " : " 
+		<< ((NULL == te->getMediaData()) ? "NULL MEDIA DATA" : ll_pretty_print_sd(te->getMediaData()->asLLSD())) << llendl;
+}
+
+void LLVOVolume::mediaNavigateBounceBack(U8 texture_index)
+{
+	// Find the media entry for this navigate
+	const LLMediaEntry* mep = NULL;
+	viewer_media_t impl = getMediaImpl(texture_index);
+	LLTextureEntry *te = getTE(texture_index);
+	if(te)
+	{
+		mep = te->getMediaData();
+	}
+	
+	if (mep && impl)
+	{
+        std::string url = mep->getCurrentURL();
+		// Look for a ":", if not there, assume "http://"
+		if (!url.empty() && std::string::npos == url.find(':')) 
+		{
+			url = "http://" + url;
+		}
+		// If the url we're trying to "bounce back" to is either empty or not
+		// allowed by the whitelist, try the home url.  If *that* doesn't work,
+		// set the media as failed and unload it
+        if (url.empty() || !mep->checkCandidateUrl(url))
+        {
+            url = mep->getHomeURL();
+			// Look for a ":", if not there, assume "http://"
+			if (!url.empty() && std::string::npos == url.find(':')) 
+			{
+				url = "http://" + url;
+			}
+        }
+        if (url.empty() || !mep->checkCandidateUrl(url))
+		{
+			// The url to navigate back to is not good, and we have nowhere else
+			// to go.
+			LL_WARNS("MediaOnAPrim") << "FAILED to bounce back URL \"" << url << "\" -- unloading impl" << LL_ENDL;
+			impl->setMediaFailed(true);
+		}
+		else {
+			// Okay, navigate now
+            LL_INFOS("MediaOnAPrim") << "bouncing back to URL: " << url << LL_ENDL;
+            impl->navigateTo(url, "", false, true);
+        }
+    }
+}
+
+bool LLVOVolume::hasMediaPermission(const LLMediaEntry* media_entry, MediaPermType perm_type)
+{
+    // NOTE: This logic ALMOST duplicates the logic in the server (in particular, in llmediaservice.cpp).
+    if (NULL == media_entry ) return false; // XXX should we assert here?
+    
+    // The agent has permissions if:
+    // - world permissions are on, or
+    // - group permissions are on, and agent_id is in the group, or
+    // - agent permissions are on, and agent_id is the owner
+    
+	// *NOTE: We *used* to check for modify permissions here (i.e. permissions were
+	// granted if permModify() was true).  However, this doesn't make sense in the
+	// viewer: we don't want to show controls or allow interaction if the author
+	// has deemed it so.  See DEV-42115.
+	
+    U8 media_perms = (perm_type == MEDIA_PERM_INTERACT) ? media_entry->getPermsInteract() : media_entry->getPermsControl();
+    
+    // World permissions
+    if (0 != (media_perms & LLMediaEntry::PERM_ANYONE)) 
+    {
+        return true;
+    }
+    
+    // Group permissions
+    else if (0 != (media_perms & LLMediaEntry::PERM_GROUP))
+    {
+		LLPermissions* obj_perm = LLSelectMgr::getInstance()->findObjectPermissions(this);
+		if (obj_perm && gAgent.isInGroup(obj_perm->getGroup()))
+		{
+			return true;
+		}
+    }
+    
+    // Owner permissions
+    else if (0 != (media_perms & LLMediaEntry::PERM_OWNER) && permYouOwner()) 
+    {
+        return true;
+    }
+    
+    return false;
+    
+}
+
+void LLVOVolume::mediaNavigated(LLViewerMediaImpl *impl, LLPluginClassMedia* plugin, std::string new_location)
+{
+	bool block_navigation = false;
+	// FIXME: if/when we allow the same media impl to be used by multiple faces, the logic here will need to be fixed
+	// to deal with multiple face indices.
+	int face_index = getFaceIndexWithMediaImpl(impl, -1);
+	
+	// Find the media entry for this navigate
+	LLMediaEntry* mep = NULL;
+	LLTextureEntry *te = getTE(face_index);
+	if(te)
+	{
+		mep = te->getMediaData();
+	}
+	
+	if(mep)
+	{
+		if(!mep->checkCandidateUrl(new_location))
+		{
+			block_navigation = true;
+		}
+		if (!block_navigation && !hasMediaPermission(mep, MEDIA_PERM_INTERACT))
+		{
+			block_navigation = true;
+		}
+	}
+	else
+	{
+		LL_WARNS("MediaOnAPrim") << "Couldn't find media entry!" << LL_ENDL;
+	}
+						
+	if(block_navigation)
+	{
+		LL_INFOS("MediaOnAPrim") << "blocking navigate to URI " << new_location << LL_ENDL;
+
+		// "bounce back" to the current URL from the media entry
+		mediaNavigateBounceBack(face_index);
+	}
+	else if (sObjectMediaNavigateClient)
+	{
+		
+		LL_DEBUGS("MediaOnAPrim") << "broadcasting navigate with URI " << new_location << LL_ENDL;
+
+		sObjectMediaNavigateClient->navigate(new LLMediaDataClientObjectImpl(this, false), face_index, new_location);
+	}
+}
+
+void LLVOVolume::mediaEvent(LLViewerMediaImpl *impl, LLPluginClassMedia* plugin, LLViewerMediaObserver::EMediaEvent event)
+{
+	switch(event)
+	{
+		
+		case LLViewerMediaObserver::MEDIA_EVENT_LOCATION_CHANGED:
+		{			
+			switch(impl->getNavState())
+			{
+				case LLViewerMediaImpl::MEDIANAVSTATE_FIRST_LOCATION_CHANGED:
+				{
+					// This is the first location changed event after the start of a non-server-directed nav.  It may need to be broadcast or bounced back.
+					mediaNavigated(impl, plugin, plugin->getLocation());
+				}
+				break;
+				
+				case LLViewerMediaImpl::MEDIANAVSTATE_FIRST_LOCATION_CHANGED_SPURIOUS:
+					// This navigate didn't change the current URL.  
+					LL_DEBUGS("MediaOnAPrim") << "	NOT broadcasting navigate (spurious)" << LL_ENDL;
+				break;
+				
+				case LLViewerMediaImpl::MEDIANAVSTATE_SERVER_FIRST_LOCATION_CHANGED:
+					// This is the first location changed event after the start of a server-directed nav.  Don't broadcast it.
+					LL_INFOS("MediaOnAPrim") << "	NOT broadcasting navigate (server-directed)" << LL_ENDL;
+				break;
+				
+				default:
+					// This is a subsequent location-changed due to a redirect.	 Don't broadcast.
+					LL_INFOS("MediaOnAPrim") << "	NOT broadcasting navigate (redirect)" << LL_ENDL;
+				break;
+			}
+		}
+		break;
+		
+		case LLViewerMediaObserver::MEDIA_EVENT_NAVIGATE_COMPLETE:
+		{
+			switch(impl->getNavState())
+			{
+				case LLViewerMediaImpl::MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED:
+				{
+					// This is the first location changed event after the start of a non-server-directed nav.  It may need to be broadcast or bounced back.
+					mediaNavigated(impl, plugin, plugin->getNavigateURI());
+				}
+				break;
+				
+				case LLViewerMediaImpl::MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED_SPURIOUS:
+					// This navigate didn't change the current URL.  
+					LL_DEBUGS("MediaOnAPrim") << "	NOT broadcasting navigate (spurious)" << LL_ENDL;
+				break;
+
+				case LLViewerMediaImpl::MEDIANAVSTATE_SERVER_COMPLETE_BEFORE_LOCATION_CHANGED:
+					// This is the the navigate complete event from a server-directed nav.  Don't broadcast it.
+					LL_INFOS("MediaOnAPrim") << "	NOT broadcasting navigate (server-directed)" << LL_ENDL;
+				break;
+				
+				default:
+					// For all other states, the navigate should have been handled by LOCATION_CHANGED events already.
+				break;
+			}
+		}
+		break;
+		
+		default:
+		break;
+	}
+
+}
+
+void LLVOVolume::sendMediaDataUpdate()
+{
+    if (sObjectMediaClient)
+		sObjectMediaClient->updateMedia(new LLMediaDataClientObjectImpl(this, false));
+}
+
+void LLVOVolume::removeMediaImpl(S32 texture_index)
+{
+	if(mMediaImplList.size() <= (U32)texture_index || mMediaImplList[texture_index].isNull())
+	{
+		return ;
+	}
+
+	//make the face referencing to mMediaImplList[texture_index] to point back to the old texture.
+	if(mDrawable && texture_index < mDrawable->getNumFaces())
+	{
+		LLFace* facep = mDrawable->getFace(texture_index) ;
+		if(facep)
+		{
+			LLViewerMediaTexture* media_tex = LLViewerTextureManager::findMediaTexture(mMediaImplList[texture_index]->getMediaTextureID()) ;
+			if(media_tex)
+			{
+				media_tex->removeMediaFromFace(facep) ;
+			}
+		}
+	}		
+	
+	//check if some other face(s) of this object reference(s)to this media impl.
+	S32 i ;
+	S32 end = (S32)mMediaImplList.size() ;
+	for(i = 0; i < end ; i++)
+	{
+		if( i != texture_index && mMediaImplList[i] == mMediaImplList[texture_index])
+		{
+			break ;
+		}
+	}
+
+	if(i == end) //this object does not need this media impl.
+	{
+		mMediaImplList[texture_index]->removeObject(this) ;
+	}
+
+	mMediaImplList[texture_index] = NULL ;
+	return ;
+}
+
+void LLVOVolume::addMediaImpl(LLViewerMediaImpl* media_impl, S32 texture_index)
+{
+	if((S32)mMediaImplList.size() < texture_index + 1)
+	{
+		mMediaImplList.resize(texture_index + 1) ;
+	}
+	
+	if(mMediaImplList[texture_index].notNull())
+	{
+		if(mMediaImplList[texture_index] == media_impl)
+		{
+			return ;
+		}
+
+		removeMediaImpl(texture_index) ;
+	}
+
+	mMediaImplList[texture_index] = media_impl;
+	media_impl->addObject(this) ;	
+
+	//add the face to show the media if it is in playing
+	if(mDrawable)
+	{
+		LLFace* facep = mDrawable->getFace(texture_index) ;
+		if(facep)
+		{
+			LLViewerMediaTexture* media_tex = LLViewerTextureManager::findMediaTexture(mMediaImplList[texture_index]->getMediaTextureID()) ;
+			if(media_tex)
+			{
+				media_tex->addMediaToFace(facep) ;
+			}
+		}
+		else //the face is not available now, start media on this face later.
+		{
+			media_impl->setUpdated(TRUE) ;
+		}
+	}
+	return ;
+}
+
+viewer_media_t LLVOVolume::getMediaImpl(U8 face_id) const
+{
+	if(mMediaImplList.size() > face_id)
+	{
+		return mMediaImplList[face_id];
+	}
+	return NULL;
+}
+
+F64 LLVOVolume::getTotalMediaInterest() const
+{
+	// If this object is currently focused, this object has "high" interest
+	if (LLViewerMediaFocus::getInstance()->getFocusedObjectID() == getID())
+		return F64_MAX;
+	
+	F64 interest = (F64)-1.0;  // means not interested;
+    
+	// If this object is selected, this object has "high" interest, but since 
+	// there can be more than one, we still add in calculated impl interest
+	// XXX Sadly, 'contains()' doesn't take a const :(
+	if (LLSelectMgr::getInstance()->getSelection()->contains(const_cast<LLVOVolume*>(this)))
+		interest = F64_MAX / 2.0;
+	
+	int i = 0;
+	const int end = getNumTEs();
+	for ( ; i < end; ++i)
+	{
+		const viewer_media_t &impl = getMediaImpl(i);
+		if (!impl.isNull())
+		{
+			if (interest == (F64)-1.0) interest = (F64)0.0;
+			interest += impl->getInterest();
+		}
+	}
+	return interest;
+}
+
+S32 LLVOVolume::getFaceIndexWithMediaImpl(const LLViewerMediaImpl* media_impl, S32 start_face_id)
+{
+	S32 end = (S32)mMediaImplList.size() ;
+	for(S32 face_id = start_face_id + 1; face_id < end; face_id++)
+	{
+		if(mMediaImplList[face_id] == media_impl)
+		{
+			return face_id ;
+		}
+	}
+	return -1 ;
+}
+
+//----------------------------------------------------------------------------
+
+void LLVOVolume::setLightTextureID(LLUUID id)
+{
+	if (id.notNull())
+	{
+		if (!hasLightTexture())
+		{
+			setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE, TRUE, true);
+		}
+		LLLightImageParams* param_block = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
+		if (param_block && param_block->getLightTexture() != id)
+		{
+			param_block->setLightTexture(id);
+			parameterChanged(LLNetworkData::PARAMS_LIGHT_IMAGE, true);
+		}
+	}
+	else
+	{
+		if (hasLightTexture())
+		{
+			setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE, FALSE, true);
+			mLightTexture = NULL;
+		}
+	}		
+}
+
+void LLVOVolume::setSpotLightParams(LLVector3 params)
+{
+	LLLightImageParams* param_block = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
+	if (param_block && param_block->getParams() != params)
+	{
+		param_block->setParams(params);
+		parameterChanged(LLNetworkData::PARAMS_LIGHT_IMAGE, true);
+	}
+}
+		
+void LLVOVolume::setIsLight(BOOL is_light)
+{
+	if (is_light != getIsLight())
+	{
+		if (is_light)
+		{
+			setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT, TRUE, true);
+		}
+		else
+		{
+			setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT, FALSE, true);
+		}
+
+		if (is_light)
+		{
+			// Add it to the pipeline mLightSet
+			gPipeline.setLight(mDrawable, TRUE);
+		}
+		else
+		{
+			// Not a light.  Remove it from the pipeline's light set.
+			gPipeline.setLight(mDrawable, FALSE);
+		}
+	}
+}
+
+void LLVOVolume::setLightColor(const LLColor3& color)
+{
+	LLLightParams *param_block = (LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
+	if (param_block)
+	{
+		if (param_block->getColor() != color)
+		{
+			param_block->setColor(LLColor4(color, param_block->getColor().mV[3]));
+			parameterChanged(LLNetworkData::PARAMS_LIGHT, true);
+			gPipeline.markTextured(mDrawable);
+			mFaceMappingChanged = TRUE;
+		}
+	}
+}
+
+void LLVOVolume::setLightIntensity(F32 intensity)
+{
+	LLLightParams *param_block = (LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
+	if (param_block)
+	{
+		if (param_block->getColor().mV[3] != intensity)
+		{
+			param_block->setColor(LLColor4(LLColor3(param_block->getColor()), intensity));
+			parameterChanged(LLNetworkData::PARAMS_LIGHT, true);
+		}
+	}
+}
+
+void LLVOVolume::setLightRadius(F32 radius)
+{
+	LLLightParams *param_block = (LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
+	if (param_block)
+	{
+		if (param_block->getRadius() != radius)
+		{
+			param_block->setRadius(radius);
+			parameterChanged(LLNetworkData::PARAMS_LIGHT, true);
+		}
+	}
+}
+
+void LLVOVolume::setLightFalloff(F32 falloff)
+{
+	LLLightParams *param_block = (LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
+	if (param_block)
+	{
+		if (param_block->getFalloff() != falloff)
+		{
+			param_block->setFalloff(falloff);
+			parameterChanged(LLNetworkData::PARAMS_LIGHT, true);
+		}
+	}
+}
+
+void LLVOVolume::setLightCutoff(F32 cutoff)
+{
+	LLLightParams *param_block = (LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
+	if (param_block)
+	{
+		if (param_block->getCutoff() != cutoff)
+		{
+			param_block->setCutoff(cutoff);
+			parameterChanged(LLNetworkData::PARAMS_LIGHT, true);
+		}
+	}
+}
+
+//----------------------------------------------------------------------------
+
+BOOL LLVOVolume::getIsLight() const
+{
+	return getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT);
+}
+
+LLColor3 LLVOVolume::getLightBaseColor() const
+{
+	const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
+	if (param_block)
+	{
+		return LLColor3(param_block->getColor());
+	}
+	else
+	{
+		return LLColor3(1,1,1);
+	}
+}
+
+LLColor3 LLVOVolume::getLightColor() const
+{
+	const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
+	if (param_block)
+	{
+		return LLColor3(param_block->getColor()) * param_block->getColor().mV[3];
+	}
+	else
+	{
+		return LLColor3(1,1,1);
+	}
+}
+
+LLUUID LLVOVolume::getLightTextureID() const
+{
+	if (getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE))
+	{
+		const LLLightImageParams *param_block = (const LLLightImageParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
+		if (param_block)
+		{
+			return param_block->getLightTexture();
+		}
+	}
+	
+	return LLUUID::null;
+}
+
+
+LLVector3 LLVOVolume::getSpotLightParams() const
+{
+	if (getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE))
+	{
+		const LLLightImageParams *param_block = (const LLLightImageParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
+		if (param_block)
+		{
+			return param_block->getParams();
+		}
+	}
+	
+	return LLVector3();
+}
+
+F32 LLVOVolume::getSpotLightPriority() const
+{
+	return mSpotLightPriority;
+}
+
+void LLVOVolume::updateSpotLightPriority()
+{
+	LLVector3 pos = mDrawable->getPositionAgent();
+	LLVector3 at(0,0,-1);
+	at *= getRenderRotation();
+
+	F32 r = getLightRadius()*0.5f;
+
+	pos += at * r;
+
+	at = LLViewerCamera::getInstance()->getAtAxis();
+
+	pos -= at * r;
+	
+	mSpotLightPriority = gPipeline.calcPixelArea(pos, LLVector3(r,r,r), *LLViewerCamera::getInstance());
+
+	if (mLightTexture.notNull())
+	{
+		mLightTexture->addTextureStats(mSpotLightPriority);
+		mLightTexture->setBoostLevel(LLViewerTexture::BOOST_CLOUDS);
+	}
+}
+
+
+bool LLVOVolume::isLightSpotlight() const
+{
+	LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
+	if (params)
+	{
+		return params->isLightSpotlight();
+	}
+	return false;
+}
+
+
+LLViewerTexture* LLVOVolume::getLightTexture()
+{
+	LLUUID id = getLightTextureID();
+
+	if (id.notNull())
+	{
+		if (mLightTexture.isNull() || id != mLightTexture->getID())
+		{
+			mLightTexture = LLViewerTextureManager::getFetchedTexture(id);
+		}
+	}
+	else
+	{
+		mLightTexture = NULL;
+	}
+
+	return mLightTexture;
+}
+
+F32 LLVOVolume::getLightIntensity() const
+{
+	const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
+	if (param_block)
+	{
+		return param_block->getColor().mV[3];
+	}
+	else
+	{
+		return 1.f;
+	}
+}
+
+F32 LLVOVolume::getLightRadius() const
+{
+	const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
+	if (param_block)
+	{
+		return param_block->getRadius();
+	}
+	else
+	{
+		return 0.f;
+	}
+}
+
+F32 LLVOVolume::getLightFalloff() const
+{
+	const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
+	if (param_block)
+	{
+		return param_block->getFalloff();
+	}
+	else
+	{
+		return 0.f;
+	}
+}
+
+F32 LLVOVolume::getLightCutoff() const
+{
+	const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
+	if (param_block)
+	{
+		return param_block->getCutoff();
+	}
+	else
+	{
+		return 0.f;
+	}
+}
+
+U32 LLVOVolume::getVolumeInterfaceID() const
+{
+	if (mVolumeImpl)
+	{
+		return mVolumeImpl->getID();
+	}
+
+	return 0;
+}
+
+BOOL LLVOVolume::isFlexible() const
+{
+	if (getParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE))
+	{
+		LLVolume* volume = getVolume();
+		if (volume && volume->getParams().getPathParams().getCurveType() != LL_PCODE_PATH_FLEXIBLE)
+		{
+			LLVolumeParams volume_params = getVolume()->getParams();
+			U8 profile_and_hole = volume_params.getProfileParams().getCurveType();
+			volume_params.setType(profile_and_hole, LL_PCODE_PATH_FLEXIBLE);
+		}
+		return TRUE;
+	}
+	else
+	{
+		return FALSE;
+	}
+}
+
+BOOL LLVOVolume::isSculpted() const
+{
+	if (getParameterEntryInUse(LLNetworkData::PARAMS_SCULPT))
+	{
+		return TRUE;
+	}
+	
+	return FALSE;
+}
+
+BOOL LLVOVolume::isMesh() const
+{
+	if (isSculpted())
+	{
+		LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT);
+		U8 sculpt_type = sculpt_params->getSculptType();
+
+		if ((sculpt_type & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH)
+			// mesh is a mesh
+		{
+			return TRUE;	
+		}
+	}
+
+	return FALSE;
+}
+
+BOOL LLVOVolume::hasLightTexture() const
+{
+	if (getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE))
+	{
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+BOOL LLVOVolume::isVolumeGlobal() const
+{
+	if (mVolumeImpl)
+	{
+		return mVolumeImpl->isVolumeGlobal() ? TRUE : FALSE;
+	}
+	else if (mRiggedVolume.notNull())
+	{
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+BOOL LLVOVolume::canBeFlexible() const
+{
+	U8 path = getVolume()->getParams().getPathParams().getCurveType();
+	return (path == LL_PCODE_PATH_FLEXIBLE || path == LL_PCODE_PATH_LINE);
+}
+
+BOOL LLVOVolume::setIsFlexible(BOOL is_flexible)
+{
+	BOOL res = FALSE;
+	BOOL was_flexible = isFlexible();
+	LLVolumeParams volume_params;
+	if (is_flexible)
+	{
+		if (!was_flexible)
+		{
+			volume_params = getVolume()->getParams();
+			U8 profile_and_hole = volume_params.getProfileParams().getCurveType();
+			volume_params.setType(profile_and_hole, LL_PCODE_PATH_FLEXIBLE);
+			res = TRUE;
+			setFlags(FLAGS_USE_PHYSICS, FALSE);
+			setFlags(FLAGS_PHANTOM, TRUE);
+			setParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE, TRUE, true);
+			if (mDrawable)
+			{
+				mDrawable->makeActive();
+			}
+		}
+	}
+	else
+	{
+		if (was_flexible)
+		{
+			volume_params = getVolume()->getParams();
+			U8 profile_and_hole = volume_params.getProfileParams().getCurveType();
+			volume_params.setType(profile_and_hole, LL_PCODE_PATH_LINE);
+			res = TRUE;
+			setFlags(FLAGS_PHANTOM, FALSE);
+			setParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE, FALSE, true);
+		}
+	}
+	if (res)
+	{
+		res = setVolume(volume_params, 1);
+		if (res)
+		{
+			markForUpdate(TRUE);
+		}
+	}
+	return res;
+}
+
+//----------------------------------------------------------------------------
+
+void LLVOVolume::generateSilhouette(LLSelectNode* nodep, const LLVector3& view_point)
+{
+	LLVolume *volume = getVolume();
+
+	if (volume)
+	{
+		LLVector3 view_vector;
+		view_vector = view_point; 
+
+		//transform view vector into volume space
+		view_vector -= getRenderPosition();
+		mDrawable->mDistanceWRTCamera = view_vector.length();
+		LLQuaternion worldRot = getRenderRotation();
+		view_vector = view_vector * ~worldRot;
+		if (!isVolumeGlobal())
+		{
+			LLVector3 objScale = getScale();
+			LLVector3 invObjScale(1.f / objScale.mV[VX], 1.f / objScale.mV[VY], 1.f / objScale.mV[VZ]);
+			view_vector.scaleVec(invObjScale);
+		}
+		
+		updateRelativeXform();
+		LLMatrix4 trans_mat = mRelativeXform;
+		if (mDrawable->isStatic())
+		{
+			trans_mat.translate(getRegion()->getOriginAgent());
+		}
+
+		volume->generateSilhouetteVertices(nodep->mSilhouetteVertices, nodep->mSilhouetteNormals, view_vector, trans_mat, mRelativeXformInvTrans, nodep->getTESelectMask());
+
+		nodep->mSilhouetteExists = TRUE;
+	}
+}
+
+void LLVOVolume::deleteFaces()
+{
+	S32 face_count = mNumFaces;
+	if (mDrawable.notNull())
+	{
+		mDrawable->deleteFaces(0, face_count);
+	}
+
+	mNumFaces = 0;
+}
+
+void LLVOVolume::updateRadius()
+{
+	if (mDrawable.isNull())
+	{
+		return;
+	}
+	
+	mVObjRadius = getScale().length();
+	mDrawable->setRadius(mVObjRadius);
+}
+
+
+BOOL LLVOVolume::isAttachment() const
+{
+	return mState != 0 ;
+}
+
+BOOL LLVOVolume::isHUDAttachment() const
+{
+	// *NOTE: we assume hud attachment points are in defined range
+	// since this range is constant for backwards compatibility
+	// reasons this is probably a reasonable assumption to make
+	S32 attachment_id = ATTACHMENT_ID_FROM_STATE(mState);
+	return ( attachment_id >= 31 && attachment_id <= 38 );
+}
+
+
+const LLMatrix4 LLVOVolume::getRenderMatrix() const
+{
+	if (mDrawable->isActive() && !mDrawable->isRoot())
+	{
+		return mDrawable->getParent()->getWorldMatrix();
+	}
+	return mDrawable->getWorldMatrix();
+}
+
+// Returns a base cost and adds textures to passed in set.
+// total cost is returned value + 5 * size of the resulting set.
+// Cannot include cost of textures, as they may be re-used in linked
+// children, and cost should only be increased for unique textures  -Nyx
+U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
+{
+	// Get access to params we'll need at various points.  
+	// Skip if this is object doesn't have a volume (e.g. is an avatar).
+	BOOL has_volume = (getVolume() != NULL);
+	LLVolumeParams volume_params;
+	LLPathParams path_params;
+	LLProfileParams profile_params;
+
+	U32 num_triangles = 0;
+
+	// per-prim costs
+	static const U32 ARC_PARTICLE_COST = 1; // determined experimentally
+	static const U32 ARC_PARTICLE_MAX = 2048; // default values
+	static const U32 ARC_TEXTURE_COST = 16; // multiplier for texture resolution - performance tested
+	static const U32 ARC_LIGHT_COST = 500; // static cost for light-producing prims 
+	static const U32 ARC_MEDIA_FACE_COST = 1500; // static cost per media-enabled face 
+
+
+	// per-prim multipliers
+	static const F32 ARC_GLOW_MULT = 1.5f; // tested based on performance
+	static const F32 ARC_BUMP_MULT = 1.25f; // tested based on performance
+	static const F32 ARC_FLEXI_MULT = 5; // tested based on performance
+	static const F32 ARC_SHINY_MULT = 1.6f; // tested based on performance
+	static const F32 ARC_INVISI_COST = 1.2f; // tested based on performance
+	static const F32 ARC_WEIGHTED_MESH = 1.2f; // tested based on performance
+
+	static const F32 ARC_PLANAR_COST = 1.0f; // tested based on performance to have negligible impact
+	static const F32 ARC_ANIM_TEX_COST = 4.f; // tested based on performance
+	static const F32 ARC_ALPHA_COST = 4.f; // 4x max - based on performance
+
+	F32 shame = 0;
+
+	U32 invisi = 0;
+	U32 shiny = 0;
+	U32 glow = 0;
+	U32 alpha = 0;
+	U32 flexi = 0;
+	U32 animtex = 0;
+	U32 particles = 0;
+	U32 bump = 0;
+	U32 planar = 0;
+	U32 weighted_mesh = 0;
+	U32 produces_light = 0;
+	U32 media_faces = 0;
+
+	// these multipliers are variable and can be floating point
+	F32 scale = 0.f;
+
+	const LLDrawable* drawablep = mDrawable;
+	U32 num_faces = drawablep->getNumFaces();
+
+	if (has_volume)
+	{
+		volume_params = getVolume()->getParams();
+		path_params = volume_params.getPathParams();
+		profile_params = volume_params.getProfileParams();
+
+		F32 weighted_triangles = -1.0;
+		getStreamingCost(NULL, NULL, &weighted_triangles);
+
+		if (weighted_triangles > 0.0)
+		{
+			num_triangles = (U32)(weighted_triangles * 2); // scale weighted triangles to match the recorded scale.
+															// a complex prim (tortured torus, sculptie) should be 1000-1200 points @ 5 m
+		}
+	}
+
+	if (num_triangles == 0)
+	{
+		num_triangles = 4;
+	}
+
+	if (isSculpted())
+	{
+		if (isMesh())
+		{
+			// base cost is dependent on mesh complexity
+			// note that 3 is the highest LOD as of the time of this coding.
+			S32 size = gMeshRepo.getMeshSize(volume_params.getSculptID(),3);
+			if ( size > 0)
+			{
+				if (gMeshRepo.getSkinInfo(volume_params.getSculptID(), this))
+				{
+					// weighted attachment - 1 point for every 3 bytes
+					weighted_mesh = 1;
+				}
+
+			}
+			else
+			{
+				// something went wrong - user should know their content isn't render-free
+				return 0;
+			}
+		}
+		else
+		{
+			const LLSculptParams *sculpt_params = (LLSculptParams *) getParameterEntry(LLNetworkData::PARAMS_SCULPT);
+			LLUUID sculpt_id = sculpt_params->getSculptTexture();
+			if (textures.find(sculpt_id) == textures.end())
+			{
+				LLViewerFetchedTexture *texture = LLViewerTextureManager::getFetchedTexture(sculpt_id);
+				if (texture)
+				{
+					S32 texture_cost = 256 + (S32)(ARC_TEXTURE_COST * (texture->getFullHeight() / 128.f + texture->getFullWidth() / 128.f));
+					textures.insert(texture_cost_t::value_type(sculpt_id, texture_cost));
+				}
+			}
+		}
+	}
+
+	if (isFlexible())
+	{
+		flexi = 1;
+	}
+	if (isParticleSource())
+	{
+		particles = 1;
+	}
+
+	if (getIsLight())
+	{
+		produces_light = 1;
+	}
+
+	const LLVector3& sc = getScale();
+	scale += (sc.mV[0] + sc.mV[1] + sc.mV[2]) / 4.f; // scale to 1/4 the sum of the size
+	// enforce scale multiplier to be in the range [1,7] (7 was determined to experimentally be a reasonable max)
+	scale = scale > 7.f ? 7.f : scale;
+	scale = scale < 1.f ? 1.f : scale;
+
+	for (S32 i = 0; i < num_faces; ++i)
+	{
+		const LLFace* face = drawablep->getFace(i);
+		const LLTextureEntry* te = face->getTextureEntry();
+		const LLViewerTexture* img = face->getTexture();
+
+		if (img)
+		{
+			if (textures.find(img->getID()) == textures.end())
+			{
+				S32 texture_cost = 256 + (S32)(ARC_TEXTURE_COST * (img->getFullHeight() / 128.f + img->getFullWidth() / 128.f));
+				textures.insert(texture_cost_t::value_type(img->getID(), texture_cost));
+			}
+		}
+
+		if (face->getPoolType() == LLDrawPool::POOL_ALPHA)
+		{
+			alpha = 1;
+		}
+		else if (img && img->getPrimaryFormat() == GL_ALPHA)
+		{
+			invisi = 1;
+		}
+		if (face->hasMedia())
+		{
+			media_faces++;
+		}
+
+		if (te)
+		{
+			if (te->getBumpmap())
+			{
+				// bump is a multiplier, don't add per-face
+				bump = 1;
+			}
+			if (te->getShiny())
+			{
+				// shiny is a multiplier, don't add per-face
+				shiny = 1;
+			}
+			if (te->getGlow() > 0.f)
+			{
+				// glow is a multiplier, don't add per-face
+				glow = 1;
+			}
+			if (face->mTextureMatrix != NULL)
+			{
+				animtex = 1;
+			}
+			if (te->getTexGen())
+			{
+				planar = 1;
+			}
+		}
+	}
+
+	// shame currently has the "base" cost of 1 point per 15 triangles, min 2.
+	shame = num_triangles / 15.f;
+	shame = shame < 2.f ? 2.f : shame;
+
+	// factor in scale
+	shame *= scale;
+
+	// multiply by per-face modifiers
+	if (planar)
+	{
+		shame *= planar * ARC_PLANAR_COST;
+	}
+
+	if (animtex)
+	{
+		shame *= animtex * ARC_ANIM_TEX_COST;
+	}
+
+	if (alpha)
+	{
+		shame *= alpha * ARC_ALPHA_COST;
+	}
+
+	if(invisi)
+	{
+		shame *= invisi * ARC_INVISI_COST;
+	}
+
+	if (glow)
+	{
+		shame *= glow * ARC_GLOW_MULT;
+	}
+
+	if (bump)
+	{
+		shame *= bump * ARC_BUMP_MULT;
+	}
+
+	if (shiny)
+	{
+		shame *= shiny * ARC_SHINY_MULT;
+	}
+
+
+	// multiply shame by multipliers
+	if (weighted_mesh)
+	{
+		shame *= weighted_mesh * ARC_WEIGHTED_MESH;
+	}
+
+	if (flexi)
+	{
+		shame *= flexi * ARC_FLEXI_MULT;
+	}
+
+
+	// add additional costs
+	if (particles)
+	{
+		const LLPartSysData *part_sys_data = &(mPartSourcep->mPartSysData);
+		const LLPartData *part_data = &(part_sys_data->mPartData);
+		U32 num_particles = (U32)(part_sys_data->mBurstPartCount * llceil( part_data->mMaxAge / part_sys_data->mBurstRate));
+		num_particles = num_particles > ARC_PARTICLE_MAX ? ARC_PARTICLE_MAX : num_particles;
+		F32 part_size = (llmax(part_data->mStartScale[0], part_data->mEndScale[0]) + llmax(part_data->mStartScale[1], part_data->mEndScale[1])) / 2.f;
+		shame += num_particles * part_size * ARC_PARTICLE_COST;
+	}
+
+	if (produces_light)
+	{
+		shame += ARC_LIGHT_COST;
+	}
+
+	if (media_faces)
+	{
+		shame += media_faces * ARC_MEDIA_FACE_COST;
+	}
+
+	if (shame > mRenderComplexity_current)
+	{
+		mRenderComplexity_current = (S32)shame;
+	}
+
+	return (U32)shame;
+}
+
+F32 LLVOVolume::getStreamingCost(S32* bytes, S32* visible_bytes, F32* unscaled_value) const
+{
+	F32 radius = getScale().length()*0.5f;
+
+	if (isMesh())
+	{	
+		LLSD& header = gMeshRepo.getMeshHeader(getVolume()->getParams().getSculptID());
+
+		return LLMeshRepository::getStreamingCost(header, radius, bytes, visible_bytes, mLOD, unscaled_value);
+	}
+	else
+	{
+		LLVolume* volume = getVolume();
+		S32 counts[4];
+		LLVolume::getLoDTriangleCounts(volume->getParams(), counts);
+
+		LLSD header;
+		header["lowest_lod"]["size"] = counts[0] * 10;
+		header["low_lod"]["size"] = counts[1] * 10;
+		header["medium_lod"]["size"] = counts[2] * 10;
+		header["high_lod"]["size"] = counts[3] * 10;
+
+		return LLMeshRepository::getStreamingCost(header, radius, NULL, NULL, -1, unscaled_value);
+	}	
+}
+
+//static 
+void LLVOVolume::updateRenderComplexity()
+{
+	mRenderComplexity_last = mRenderComplexity_current;
+	mRenderComplexity_current = 0;
+}
+
+U32 LLVOVolume::getTriangleCount() const
+{
+	U32 count = 0;
+	LLVolume* volume = getVolume();
+	if (volume)
+	{
+		count = volume->getNumTriangles();
+	}
+
+	return count;
+}
+
+U32 LLVOVolume::getHighLODTriangleCount()
+{
+	U32 ret = 0;
+
+	LLVolume* volume = getVolume();
+
+	if (!isSculpted())
+	{
+		LLVolume* ref = LLPrimitive::getVolumeManager()->refVolume(volume->getParams(), 3);
+		ret = ref->getNumTriangles();
+		LLPrimitive::getVolumeManager()->unrefVolume(ref);
+	}
+	else if (isMesh())
+	{
+		LLVolume* ref = LLPrimitive::getVolumeManager()->refVolume(volume->getParams(), 3);
+		if (!ref->isMeshAssetLoaded() || ref->getNumVolumeFaces() == 0)
+		{
+			gMeshRepo.loadMesh(this, volume->getParams(), LLModel::LOD_HIGH);
+		}
+		ret = ref->getNumTriangles();
+		LLPrimitive::getVolumeManager()->unrefVolume(ref);
+	}
+	else
+	{ //default sculpts have a constant number of triangles
+		ret = 31*2*31;  //31 rows of 31 columns of quads for a 32x32 vertex patch
+	}
+
+	return ret;
+}
+
+//static
+void LLVOVolume::preUpdateGeom()
+{
+	sNumLODChanges = 0;
+}
+
+void LLVOVolume::parameterChanged(U16 param_type, bool local_origin)
+{
+	LLViewerObject::parameterChanged(param_type, local_origin);
+}
+
+void LLVOVolume::parameterChanged(U16 param_type, LLNetworkData* data, BOOL in_use, bool local_origin)
+{
+	LLViewerObject::parameterChanged(param_type, data, in_use, local_origin);
+	if (mVolumeImpl)
+	{
+		mVolumeImpl->onParameterChanged(param_type, data, in_use, local_origin);
+	}
+	if (mDrawable.notNull())
+	{
+		BOOL is_light = getIsLight();
+		if (is_light != mDrawable->isState(LLDrawable::LIGHT))
+		{
+			gPipeline.setLight(mDrawable, is_light);
+		}
+	}
+}
+
+void LLVOVolume::setSelected(BOOL sel)
+{
+	LLViewerObject::setSelected(sel);
+	if (mDrawable.notNull())
+	{
+		markForUpdate(TRUE);
+	}
+}
+
+void LLVOVolume::updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax)
+{		
+}
+
+F32 LLVOVolume::getBinRadius()
+{
+	F32 radius;
+	
+	F32 scale = 1.f;
+
+	S32 size_factor = llmax(gSavedSettings.getS32("OctreeStaticObjectSizeFactor"), 1);
+	S32 attachment_size_factor = llmax(gSavedSettings.getS32("OctreeAttachmentSizeFactor"), 1);
+	LLVector3 distance_factor = gSavedSettings.getVector3("OctreeDistanceFactor");
+	LLVector3 alpha_distance_factor = gSavedSettings.getVector3("OctreeAlphaDistanceFactor");
+	const LLVector4a* ext = mDrawable->getSpatialExtents();
+	
+	BOOL shrink_wrap = mDrawable->isAnimating();
+	BOOL alpha_wrap = FALSE;
+
+	if (!isHUDAttachment())
+	{
+		for (S32 i = 0; i < mDrawable->getNumFaces(); i++)
+		{
+			LLFace* face = mDrawable->getFace(i);
+			if (face->getPoolType() == LLDrawPool::POOL_ALPHA &&
+			    !face->canRenderAsMask())
+			{
+				alpha_wrap = TRUE;
+				break;
+			}
+		}
+	}
+	else
+	{
+		shrink_wrap = FALSE;
+	}
+
+	if (alpha_wrap)
+	{
+		LLVector3 bounds = getScale();
+		radius = llmin(bounds.mV[1], bounds.mV[2]);
+		radius = llmin(radius, bounds.mV[0]);
+		radius *= 0.5f;
+		radius *= 1.f+mDrawable->mDistanceWRTCamera*alpha_distance_factor[1];
+		radius += mDrawable->mDistanceWRTCamera*alpha_distance_factor[0];
+	}
+	else if (shrink_wrap)
+	{
+		LLVector4a rad;
+		rad.setSub(ext[1], ext[0]);
+		
+		radius = rad.getLength3().getF32()*0.5f;
+	}
+	else if (mDrawable->isStatic())
+	{
+		radius = llmax((S32) mDrawable->getRadius(), 1)*size_factor;
+		radius *= 1.f + mDrawable->mDistanceWRTCamera * distance_factor[1];
+		radius += mDrawable->mDistanceWRTCamera * distance_factor[0];
+	}
+	else if (mDrawable->getVObj()->isAttachment())
+	{
+		radius = llmax((S32) mDrawable->getRadius(),1)*attachment_size_factor;
+	}
+	else
+	{
+		radius = mDrawable->getRadius();
+		radius *= 1.f + mDrawable->mDistanceWRTCamera * distance_factor[1];
+		radius += mDrawable->mDistanceWRTCamera * distance_factor[0];
+	}
+
+	return llclamp(radius*scale, 0.5f, 256.f);
+}
+
+const LLVector3 LLVOVolume::getPivotPositionAgent() const
+{
+	if (mVolumeImpl)
+	{
+		return mVolumeImpl->getPivotPosition();
+	}
+	return LLViewerObject::getPivotPositionAgent();
+}
+
+void LLVOVolume::onShift(const LLVector4a &shift_vector)
+{
+	if (mVolumeImpl)
+	{
+		mVolumeImpl->onShift(shift_vector);
+	}
+
+	updateRelativeXform();
+}
+
+const LLMatrix4& LLVOVolume::getWorldMatrix(LLXformMatrix* xform) const
+{
+	if (mVolumeImpl)
+	{
+		return mVolumeImpl->getWorldMatrix(xform);
+	}
+	return xform->getWorldMatrix();
+}
+
+LLVector3 LLVOVolume::agentPositionToVolume(const LLVector3& pos) const
+{
+	LLVector3 ret = pos - getRenderPosition();
+	ret = ret * ~getRenderRotation();
+	LLVector3 objScale = isVolumeGlobal() ? LLVector3(1,1,1) : getScale();
+	LLVector3 invObjScale(1.f / objScale.mV[VX], 1.f / objScale.mV[VY], 1.f / objScale.mV[VZ]);
+	ret.scaleVec(invObjScale);
+	
+	return ret;
+}
+
+LLVector3 LLVOVolume::agentDirectionToVolume(const LLVector3& dir) const
+{
+	LLVector3 ret = dir * ~getRenderRotation();
+	
+	LLVector3 objScale = isVolumeGlobal() ? LLVector3(1,1,1) : getScale();
+	ret.scaleVec(objScale);
+
+	return ret;
+}
+
+LLVector3 LLVOVolume::volumePositionToAgent(const LLVector3& dir) const
+{
+	LLVector3 ret = dir;
+	LLVector3 objScale = isVolumeGlobal() ? LLVector3(1,1,1) : getScale();
+	ret.scaleVec(objScale);
+	ret = ret * getRenderRotation();
+	ret += getRenderPosition();
+	
+	return ret;
+}
+
+LLVector3 LLVOVolume::volumeDirectionToAgent(const LLVector3& dir) const
+{
+	LLVector3 ret = dir;
+	LLVector3 objScale = isVolumeGlobal() ? LLVector3(1,1,1) : getScale();
+	LLVector3 invObjScale(1.f / objScale.mV[VX], 1.f / objScale.mV[VY], 1.f / objScale.mV[VZ]);
+	ret.scaleVec(invObjScale);
+	ret = ret * getRenderRotation();
+
+	return ret;
+}
+
+
+BOOL LLVOVolume::lineSegmentIntersect(const LLVector3& start, const LLVector3& end, S32 face, BOOL pick_transparent, S32 *face_hitp,
+									  LLVector3* intersection,LLVector2* tex_coord, LLVector3* normal, LLVector3* bi_normal)
+	
+{
+	if (!mbCanSelect 
+		|| mDrawable->isDead() 
+		|| !gPipeline.hasRenderType(mDrawable->getRenderType()))
+	{
+		return FALSE;
+	}
+
+	BOOL ret = FALSE;
+
+	LLVolume* volume = getVolume();
+
+	bool transform = true;
+
+	if (mDrawable->isState(LLDrawable::RIGGED))
+	{
+		if (LLFloater::isVisible(gFloaterTools) && getAvatar()->isSelf())
+		{
+			updateRiggedVolume();
+			genBBoxes(FALSE);
+			volume = mRiggedVolume;
+			transform = false;
+		}
+		else
+		{ //cannot pick rigged attachments on other avatars or when not in build mode
+			return FALSE;
+		}
+	}
+	
+	if (volume)
+	{	
+		LLVector3 v_start, v_end, v_dir;
+	
+		if (transform)
+		{
+			v_start = agentPositionToVolume(start);
+			v_end = agentPositionToVolume(end);
+		}
+		else
+		{
+			v_start = start;
+			v_end = end;
+		}
+		
+		LLVector3 p;
+		LLVector3 n;
+		LLVector2 tc;
+		LLVector3 bn;
+
+		if (intersection != NULL)
+		{
+			p = *intersection;
+		}
+
+		if (tex_coord != NULL)
+		{
+			tc = *tex_coord;
+		}
+
+		if (normal != NULL)
+		{
+			n = *normal;
+		}
+
+		if (bi_normal != NULL)
+		{
+			bn = *bi_normal;
+		}
+
+		S32 face_hit = -1;
+
+		S32 start_face, end_face;
+		if (face == -1)
+		{
+			start_face = 0;
+			end_face = volume->getNumVolumeFaces();
+		}
+		else
+		{
+			start_face = face;
+			end_face = face+1;
+		}
+
+		bool special_cursor = specialHoverCursor();
+		for (S32 i = start_face; i < end_face; ++i)
+		{
+			if (!special_cursor && !pick_transparent && getTE(i)->getColor().mV[3] == 0.f)
+			{ //don't attempt to pick completely transparent faces unless
+				//pick_transparent is true
+				continue;
+			}
+
+			face_hit = volume->lineSegmentIntersect(v_start, v_end, i,
+													&p, &tc, &n, &bn);
+			
+			if (face_hit >= 0 && mDrawable->getNumFaces() > face_hit)
+			{
+				LLFace* face = mDrawable->getFace(face_hit);				
+
+				if (pick_transparent || !face->getTexture() || !face->getTexture()->hasGLTexture() || face->getTexture()->getMask(face->surfaceToTexture(tc, p, n)))
+				{
+					v_end = p;
+					if (face_hitp != NULL)
+					{
+						*face_hitp = face_hit;
+					}
+					
+					if (intersection != NULL)
+					{
+						if (transform)
+						{
+							*intersection = volumePositionToAgent(p);  // must map back to agent space
+						}
+						else
+						{
+							*intersection = p;
+						}
+					}
+
+					if (normal != NULL)
+					{
+						if (transform)
+						{
+							*normal = volumeDirectionToAgent(n);
+						}
+						else
+						{
+							*normal = n;
+						}
+
+						(*normal).normVec();
+					}
+
+					if (bi_normal != NULL)
+					{
+						if (transform)
+						{
+							*bi_normal = volumeDirectionToAgent(bn);
+						}
+						else
+						{
+							*bi_normal = bn;
+						}
+						(*bi_normal).normVec();
+					}
+
+					if (tex_coord != NULL)
+					{
+						*tex_coord = tc;
+					}
+					
+					ret = TRUE;
+				}
+			}
+		}
+	}
+		
+	return ret;
+}
+
+bool LLVOVolume::treatAsRigged()
+{
+	return LLFloater::isVisible(gFloaterTools) && 
+			isAttachment() && 
+			getAvatar() &&
+			getAvatar()->isSelf() &&
+			mDrawable.notNull() &&
+			mDrawable->isState(LLDrawable::RIGGED);
+}
+
+LLRiggedVolume* LLVOVolume::getRiggedVolume()
+{
+	return mRiggedVolume;
+}
+
+void LLVOVolume::clearRiggedVolume()
+{
+	if (mRiggedVolume.notNull())
+	{
+		mRiggedVolume = NULL;
+		updateRelativeXform();
+	}
+}
+
+void LLVOVolume::updateRiggedVolume()
+{
+	//Update mRiggedVolume to match current animation frame of avatar. 
+	//Also update position/size in octree.  
+
+	if (!treatAsRigged())
+	{
+		clearRiggedVolume();
+		
+		return;
+	}
+
+	LLVolume* volume = getVolume();
+
+	const LLMeshSkinInfo* skin = gMeshRepo.getSkinInfo(volume->getParams().getSculptID(), this);
+
+	if (!skin)
+	{
+		clearRiggedVolume();
+		return;
+	}
+
+	LLVOAvatar* avatar = getAvatar();
+
+	if (!avatar)
+	{
+		clearRiggedVolume();
+		return;
+	}
+
+	if (!mRiggedVolume)
+	{
+		LLVolumeParams p;
+		mRiggedVolume = new LLRiggedVolume(p);
+		updateRelativeXform();
+	}
+
+	mRiggedVolume->update(skin, avatar, volume);
+
+}
+
+static LLFastTimer::DeclareTimer FTM_SKIN_RIGGED("Skin");
+static LLFastTimer::DeclareTimer FTM_RIGGED_OCTREE("Octree");
+
+void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, const LLVolume* volume)
+{
+	bool copy = false;
+	if (volume->getNumVolumeFaces() != getNumVolumeFaces())
+	{ 
+		copy = true;
+	}
+
+	for (S32 i = 0; i < volume->getNumVolumeFaces() && !copy; ++i)
+	{
+		const LLVolumeFace& src_face = volume->getVolumeFace(i);
+		const LLVolumeFace& dst_face = getVolumeFace(i);
+
+		if (src_face.mNumIndices != dst_face.mNumIndices ||
+			src_face.mNumVertices != dst_face.mNumVertices)
+		{
+			copy = true;
+		}
+	}
+
+	if (copy)
+	{
+		copyVolumeFaces(volume);	
+	}
+
+	//build matrix palette
+	LLMatrix4a mp[64];
+	LLMatrix4* mat = (LLMatrix4*) mp;
+	
+	for (U32 j = 0; j < skin->mJointNames.size(); ++j)
+	{
+		LLJoint* joint = avatar->getJoint(skin->mJointNames[j]);
+		if (joint)
+		{
+			mat[j] = skin->mInvBindMatrix[j];
+			mat[j] *= joint->getWorldMatrix();
+		}
+	}
+
+	for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i)
+	{
+		const LLVolumeFace& vol_face = volume->getVolumeFace(i);
+		
+		LLVolumeFace& dst_face = mVolumeFaces[i];
+		
+		LLVector4a* weight = vol_face.mWeights;
+
+		LLMatrix4a bind_shape_matrix;
+		bind_shape_matrix.loadu(skin->mBindShapeMatrix);
+
+		LLVector4a* pos = dst_face.mPositions;
+
+		{
+			LLFastTimer t(FTM_SKIN_RIGGED);
+
+			for (U32 j = 0; j < dst_face.mNumVertices; ++j)
+			{
+				LLMatrix4a final_mat;
+				final_mat.clear();
+
+				S32 idx[4];
+
+				LLVector4 wght;
+
+				F32 scale = 0.f;
+				for (U32 k = 0; k < 4; k++)
+				{
+					F32 w = weight[j][k];
+
+					idx[k] = (S32) floorf(w);
+					wght[k] = w - floorf(w);
+					scale += wght[k];
+				}
+
+				wght *= 1.f/scale;
+
+				for (U32 k = 0; k < 4; k++)
+				{
+					F32 w = wght[k];
+
+					LLMatrix4a src;
+					src.setMul(mp[idx[k]], w);
+
+					final_mat.add(src);
+				}
+
+				
+				LLVector4a& v = vol_face.mPositions[j];
+				LLVector4a t;
+				LLVector4a dst;
+				bind_shape_matrix.affineTransform(v, t);
+				final_mat.affineTransform(t, dst);
+				pos[j] = dst;
+			}
+
+			//update bounding box
+			LLVector4a& min = dst_face.mExtents[0];
+			LLVector4a& max = dst_face.mExtents[1];
+
+			min = pos[0];
+			max = pos[1];
+
+			for (U32 j = 1; j < dst_face.mNumVertices; ++j)
+			{
+				min.setMin(min, pos[j]);
+				max.setMax(max, pos[j]);
+			}
+
+			dst_face.mCenter->setAdd(dst_face.mExtents[0], dst_face.mExtents[1]);
+			dst_face.mCenter->mul(0.5f);
+
+		}
+
+		{
+			LLFastTimer t(FTM_RIGGED_OCTREE);
+			delete dst_face.mOctree;
+			dst_face.mOctree = NULL;
+
+			LLVector4a size;
+			size.setSub(dst_face.mExtents[1], dst_face.mExtents[0]);
+			size.splat(size.getLength3().getF32()*0.5f);
+			
+			dst_face.createOctree(1.f);
+		}
+	}
+}
+
+U32 LLVOVolume::getPartitionType() const
+{
+	if (isHUDAttachment())
+	{
+		return LLViewerRegion::PARTITION_HUD;
+	}
+
+	return LLViewerRegion::PARTITION_VOLUME;
+}
+
+LLVolumePartition::LLVolumePartition()
+: LLSpatialPartition(LLVOVolume::VERTEX_DATA_MASK, TRUE, GL_DYNAMIC_DRAW_ARB)
+{
+	mLODPeriod = 32;
+	mDepthMask = FALSE;
+	mDrawableType = LLPipeline::RENDER_TYPE_VOLUME;
+	mPartitionType = LLViewerRegion::PARTITION_VOLUME;
+	mSlopRatio = 0.25f;
+	mBufferUsage = GL_DYNAMIC_DRAW_ARB;
+}
+
+LLVolumeBridge::LLVolumeBridge(LLDrawable* drawablep)
+: LLSpatialBridge(drawablep, TRUE, LLVOVolume::VERTEX_DATA_MASK)
+{
+	mDepthMask = FALSE;
+	mLODPeriod = 32;
+	mDrawableType = LLPipeline::RENDER_TYPE_VOLUME;
+	mPartitionType = LLViewerRegion::PARTITION_BRIDGE;
+	
+	mBufferUsage = GL_DYNAMIC_DRAW_ARB;
+
+	mSlopRatio = 0.25f;
+}
+
+bool can_batch_texture(LLFace* facep)
+{
+	if (facep->getTextureEntry()->getBumpmap())
+	{ //bump maps aren't worked into texture batching yet
+		return false;
+	}
+
+	if (facep->getTexture() && facep->getTexture()->getPrimaryFormat() == GL_ALPHA)
+	{ //can't batch invisiprims
+		return false;
+	}
+
+	if (facep->isState(LLFace::TEXTURE_ANIM) && facep->getVirtualSize() > MIN_TEX_ANIM_SIZE)
+	{ //texture animation breaks batches
+		return false;
+	}
+	
+	return true;
+}
+
+void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, U32 type)
+{
+	LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
+
+	if (facep->getViewerObject()->isSelected() && LLSelectMgr::getInstance()->mHideSelectedObjects)
+	{
+		return;
+	}
+
+	//add face to drawmap
+	LLSpatialGroup::drawmap_elem_t& draw_vec = group->mDrawMap[type];	
+
+	S32 idx = draw_vec.size()-1;
+
+	BOOL fullbright = (type == LLRenderPass::PASS_FULLBRIGHT) ||
+		(type == LLRenderPass::PASS_INVISIBLE) ||
+		(type == LLRenderPass::PASS_ALPHA && facep->isState(LLFace::FULLBRIGHT));
+	
+	if (!fullbright && type != LLRenderPass::PASS_GLOW && !facep->getVertexBuffer()->hasDataType(LLVertexBuffer::TYPE_NORMAL))
+	{
+		llwarns << "Non fullbright face has no normals!" << llendl;
+		return;
+	}
+
+	const LLMatrix4* tex_mat = NULL;
+	if (facep->isState(LLFace::TEXTURE_ANIM) && facep->getVirtualSize() > MIN_TEX_ANIM_SIZE)
+	{
+		tex_mat = facep->mTextureMatrix;	
+	}
+
+	const LLMatrix4* model_mat = NULL;
+
+	LLDrawable* drawable = facep->getDrawable();
+	if (drawable->isActive())
+	{
+		model_mat = &(drawable->getRenderMatrix());
+	}
+	else
+	{
+		model_mat = &(drawable->getRegion()->mRenderMatrix);
+		if (model_mat->isIdentity())
+		{
+			model_mat = NULL;
+		}
+	}
+
+	U8 bump = (type == LLRenderPass::PASS_BUMP || type == LLRenderPass::PASS_POST_BUMP) ? facep->getTextureEntry()->getBumpmap() : 0;
+	
+	LLViewerTexture* tex = facep->getTexture();
+
+	U8 index = facep->getTextureIndex();
+
+	bool batchable = false;
+
+	if (index < 255 && idx >= 0)
+	{
+		if (index < draw_vec[idx]->mTextureList.size())
+		{
+			if (draw_vec[idx]->mTextureList[index].isNull())
+			{
+				batchable = true;
+				draw_vec[idx]->mTextureList[index] = tex;
+			}
+			else if (draw_vec[idx]->mTextureList[index] == tex)
+			{ //this face's texture index can be used with this batch
+				batchable = true;
+			}
+		}
+		else
+		{ //texture list can be expanded to fit this texture index
+			batchable = true;
+		}
+	}
+	
+	U8 glow = (U8) (facep->getTextureEntry()->getGlow() * 255);
+
+	if (idx >= 0 && 
+		draw_vec[idx]->mVertexBuffer == facep->getVertexBuffer() &&
+		draw_vec[idx]->mEnd == facep->getGeomIndex()-1 &&
+		(LLPipeline::sTextureBindTest || draw_vec[idx]->mTexture == tex || batchable) &&
+#if LL_DARWIN
+		draw_vec[idx]->mEnd - draw_vec[idx]->mStart + facep->getGeomCount() <= (U32) gGLManager.mGLMaxVertexRange &&
+		draw_vec[idx]->mCount + facep->getIndicesCount() <= (U32) gGLManager.mGLMaxIndexRange &&
+#endif
+		draw_vec[idx]->mGlowColor.mV[3] == glow &&
+		draw_vec[idx]->mFullbright == fullbright &&
+		draw_vec[idx]->mBump == bump &&
+		draw_vec[idx]->mTextureMatrix == tex_mat &&
+		draw_vec[idx]->mModelMatrix == model_mat)
+	{
+		draw_vec[idx]->mCount += facep->getIndicesCount();
+		draw_vec[idx]->mEnd += facep->getGeomCount();
+		draw_vec[idx]->mVSize = llmax(draw_vec[idx]->mVSize, facep->getVirtualSize());
+
+		if (index >= draw_vec[idx]->mTextureList.size())
+		{
+			draw_vec[idx]->mTextureList.resize(index+1);
+			draw_vec[idx]->mTextureList[index] = tex;
+		}
+		draw_vec[idx]->validate();
+		update_min_max(draw_vec[idx]->mExtents[0], draw_vec[idx]->mExtents[1], facep->mExtents[0]);
+		update_min_max(draw_vec[idx]->mExtents[0], draw_vec[idx]->mExtents[1], facep->mExtents[1]);
+	}
+	else
+	{
+		U32 start = facep->getGeomIndex();
+		U32 end = start + facep->getGeomCount()-1;
+		U32 offset = facep->getIndicesStart();
+		U32 count = facep->getIndicesCount();
+		LLPointer<LLDrawInfo> draw_info = new LLDrawInfo(start,end,count,offset, tex, 
+			facep->getVertexBuffer(), fullbright, bump); 
+		draw_info->mGroup = group;
+		draw_info->mVSize = facep->getVirtualSize();
+		draw_vec.push_back(draw_info);
+		draw_info->mTextureMatrix = tex_mat;
+		draw_info->mModelMatrix = model_mat;
+		draw_info->mGlowColor.setVec(0,0,0,glow);
+		if (type == LLRenderPass::PASS_ALPHA)
+		{ //for alpha sorting
+			facep->setDrawInfo(draw_info);
+		}
+		draw_info->mExtents[0] = facep->mExtents[0];
+		draw_info->mExtents[1] = facep->mExtents[1];
+
+		if (LLPipeline::sUseTriStrips)
+		{
+			draw_info->mDrawMode = LLRender::TRIANGLE_STRIP;
+		}
+
+		if (index < 255)
+		{ //initialize texture list for texture batching
+			draw_info->mTextureList.resize(index+1);
+			draw_info->mTextureList[index] = tex;
+		}
+		draw_info->validate();
+	}
+}
+
+void LLVolumeGeometryManager::getGeometry(LLSpatialGroup* group)
+{
+
+}
+
+static LLFastTimer::DeclareTimer FTM_REBUILD_VOLUME_VB("Volume");
+static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt");
+
+static LLDrawPoolAvatar* get_avatar_drawpool(LLViewerObject* vobj)
+{
+	LLVOAvatar* avatar = vobj->getAvatar();
+					
+	if (avatar)
+	{
+		LLDrawable* drawable = avatar->mDrawable;
+		if (drawable && drawable->getNumFaces() > 0)
+		{
+			LLFace* face = drawable->getFace(0);
+			if (face)
+			{
+				LLDrawPool* drawpool = face->getPool();
+				if (drawpool)
+				{
+					if (drawpool->getType() == LLDrawPool::POOL_AVATAR)
+					{
+						return (LLDrawPoolAvatar*) drawpool;
+					}
+				}
+			}
+		}
+	}
+
+	return NULL;
+}
+
+void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
+{
+	if (group->changeLOD())
+	{
+		group->mLastUpdateDistance = group->mDistance;
+	}
+
+	group->mLastUpdateViewAngle = group->mViewAngle;
+
+	if (!group->isState(LLSpatialGroup::GEOM_DIRTY | LLSpatialGroup::ALPHA_DIRTY))
+	{
+		if (group->isState(LLSpatialGroup::MESH_DIRTY) && !LLPipeline::sDelayVBUpdate)
+		{
+			LLFastTimer ftm(FTM_REBUILD_VBO);	
+			LLFastTimer ftm2(FTM_REBUILD_VOLUME_VB);
+		
+			rebuildMesh(group);
+		}
+		return;
+	}
+
+	group->mBuilt = 1.f;
+	LLFastTimer ftm(FTM_REBUILD_VBO);	
+
+	LLFastTimer ftm2(FTM_REBUILD_VOLUME_VB);
+
+	group->clearDrawMap();
+
+	mFaceList.clear();
+
+	std::vector<LLFace*> fullbright_faces;
+	std::vector<LLFace*> bump_faces;
+	std::vector<LLFace*> simple_faces;
+
+	std::vector<LLFace*> alpha_faces;
+	U32 useage = group->mSpatialPartition->mBufferUsage;
+
+	U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcVertexSize(group->mSpatialPartition->mVertexDataMask);
+	U32 max_total = (gSavedSettings.getS32("RenderMaxNodeSize")*1024)/LLVertexBuffer::calcVertexSize(group->mSpatialPartition->mVertexDataMask);
+	max_vertices = llmin(max_vertices, (U32) 65535);
+
+	U32 cur_total = 0;
+
+	//get all the faces into a list
+	for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
+	{
+		LLDrawable* drawablep = *drawable_iter;
+		
+		if (drawablep->isDead() || drawablep->isState(LLDrawable::FORCE_INVISIBLE) )
+		{
+			continue;
+		}
+	
+		if (drawablep->isAnimating())
+		{ //fall back to stream draw for animating verts
+			useage = GL_STREAM_DRAW_ARB;
+		}
+
+		LLVOVolume* vobj = drawablep->getVOVolume();
+
+		if (vobj->isMesh() &&
+			(vobj->getVolume() && !vobj->getVolume()->isMeshAssetLoaded() || !gMeshRepo.meshRezEnabled()))
+		{
+			continue;
+		}
+
+		llassert_always(vobj);
+		vobj->updateTextureVirtualSize();
+		vobj->preRebuild();
+
+		drawablep->clearState(LLDrawable::HAS_ALPHA);
+
+		bool rigged = vobj->isAttachment() && 
+					vobj->isMesh() && 
+					gMeshRepo.getSkinInfo(vobj->getVolume()->getParams().getSculptID(), vobj);
+
+		bool bake_sunlight = LLPipeline::sBakeSunlight && drawablep->isStatic();
+
+		bool is_rigged = false;
+
+		//for each face
+		for (S32 i = 0; i < drawablep->getNumFaces(); i++)
+		{
+			LLFace* facep = drawablep->getFace(i);
+
+			//ALWAYS null out vertex buffer on rebuild -- if the face lands in a render
+			// batch, it will recover its vertex buffer reference from the spatial group
+			facep->setVertexBuffer(NULL);
+			
+			//sum up face verts and indices
+			drawablep->updateFaceSize(i);
+			
+			
+
+			if (rigged) 
+			{
+				if (!facep->isState(LLFace::RIGGED))
+				{ //completely reset vertex buffer
+					facep->clearVertexBuffer();
+				}
+		
+				facep->setState(LLFace::RIGGED);
+				is_rigged = true;
+				
+				//get drawpool of avatar with rigged face
+				LLDrawPoolAvatar* pool = get_avatar_drawpool(vobj);
+				
+				//Determine if we've received skininfo that contains an
+				//alternate bind matrix - if it does then apply the translational component
+				//to the joints of the avatar.
+				LLVOAvatar* pAvatarVO = vobj->getAvatar();
+				bool pelvisGotSet = false;
+
+				if ( pAvatarVO )
+				{
+					LLUUID currentId = vobj->getVolume()->getParams().getSculptID();
+					const LLMeshSkinInfo*  pSkinData = gMeshRepo.getSkinInfo( currentId, vobj );
+					
+					if ( pSkinData )
+					{
+						const int bindCnt = pSkinData->mAlternateBindMatrix.size();								
+						if ( bindCnt > 0 )
+						{					
+							const int jointCnt = pSkinData->mJointNames.size();
+							const F32 pelvisZOffset = pSkinData->mPelvisOffset;
+							bool fullRig = (jointCnt>=20) ? true : false;
+							if ( fullRig )
+							{
+								for ( int i=0; i<jointCnt; ++i )
+								{
+									std::string lookingForJoint = pSkinData->mJointNames[i].c_str();
+									//llinfos<<"joint name "<<lookingForJoint.c_str()<<llendl;
+									LLJoint* pJoint = pAvatarVO->getJoint( lookingForJoint );
+									if ( pJoint && pJoint->getId() != currentId )
+									{   									
+										pJoint->setId( currentId );
+										const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation();									
+										//Set the joint position
+										pJoint->storeCurrentXform( jointPos );																																
+										//If joint is a pelvis then handle old/new pelvis to foot values
+										if ( lookingForJoint == "mPelvis" )
+										{	
+											pJoint->storeCurrentXform( jointPos );																																
+											if ( !pAvatarVO->hasPelvisOffset() )
+											{										
+												pAvatarVO->setPelvisOffset( true, jointPos, pelvisZOffset );
+												//Trigger to rebuild viewer AV
+												pelvisGotSet = true;											
+											}										
+										}										
+									}
+								}
+							}							
+						}
+					}
+				}
+				//If we've set the pelvis to a new position we need to also rebuild some information that the
+				//viewer does at launch (e.g. body size etc.)
+				if ( pelvisGotSet )
+				{
+					pAvatarVO->postPelvisSetRecalc();
+				}
+
+				if (pool)
+				{
+					const LLTextureEntry* te = facep->getTextureEntry();
+
+					//remove face from old pool if it exists
+					LLDrawPool* old_pool = facep->getPool();
+					if (old_pool && old_pool->getType() == LLDrawPool::POOL_AVATAR)
+					{
+						((LLDrawPoolAvatar*) old_pool)->removeRiggedFace(facep);
+					}
+
+					//add face to new pool
+					LLViewerTexture* tex = facep->getTexture();
+					U32 type = gPipeline.getPoolTypeFromTE(te, tex);
+
+					if (type == LLDrawPool::POOL_ALPHA)
+					{
+						if (te->getFullbright())
+						{
+							pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_FULLBRIGHT_ALPHA);
+						}
+						else
+						{
+							pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_ALPHA);
+						}
+					}
+					else if (te->getShiny())
+					{
+						if (te->getFullbright())
+						{
+							pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_FULLBRIGHT_SHINY);
+						}
+						else
+						{
+							if (LLPipeline::sRenderDeferred)
+							{
+								pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_SIMPLE);
+							}
+							else
+							{
+								pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_SHINY);
+							}
+						}
+					}
+					else
+					{
+						if (te->getFullbright())
+						{
+							pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_FULLBRIGHT);
+						}
+						else
+						{
+							pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_SIMPLE);
+						}
+					}
+
+					if (te->getGlow())
+					{
+						pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_GLOW);
+					}
+
+					if (LLPipeline::sRenderDeferred)
+					{
+						if (type != LLDrawPool::POOL_ALPHA && !te->getFullbright())
+						{
+							if (te->getBumpmap())
+							{
+								pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_DEFERRED_BUMP);
+							}
+							else
+							{
+								pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_DEFERRED_SIMPLE);
+							}
+						}
+					}
+				}
+
+				continue;
+			}
+			else
+			{
+				if (facep->isState(LLFace::RIGGED))
+				{ //face is not rigged but used to be, remove from rigged face pool
+					LLDrawPoolAvatar* pool = (LLDrawPoolAvatar*) facep->getPool();
+					if (pool)
+					{
+						pool->removeRiggedFace(facep);
+					}
+					facep->clearState(LLFace::RIGGED);
+				}
+			}
+
+			if (cur_total > max_total || facep->getIndicesCount() <= 0 || facep->getGeomCount() <= 0)
+			{
+				facep->clearVertexBuffer();
+				continue;
+			}
+
+			cur_total += facep->getGeomCount();
+
+			if (facep->hasGeometry() && facep->getPixelArea() > FORCE_CULL_AREA)
+			{
+				const LLTextureEntry* te = facep->getTextureEntry();
+				LLViewerTexture* tex = facep->getTexture();
+
+				if (facep->isState(LLFace::TEXTURE_ANIM))
+				{
+					if (!vobj->mTexAnimMode)
+					{
+						facep->clearState(LLFace::TEXTURE_ANIM);
+					}
+				}
+
+				BOOL force_simple = (facep->getPixelArea() < FORCE_SIMPLE_RENDER_AREA);
+				U32 type = gPipeline.getPoolTypeFromTE(te, tex);
+				if (type != LLDrawPool::POOL_ALPHA && force_simple)
+				{
+					type = LLDrawPool::POOL_SIMPLE;
+				}
+				facep->setPoolType(type);
+
+				if (vobj->isHUDAttachment())
+				{
+					facep->setState(LLFace::FULLBRIGHT);
+				}
+
+				if (vobj->mTextureAnimp && vobj->mTexAnimMode)
+				{
+					if (vobj->mTextureAnimp->mFace <= -1)
+					{
+						S32 face;
+						for (face = 0; face < vobj->getNumTEs(); face++)
+						{
+							drawablep->getFace(face)->setState(LLFace::TEXTURE_ANIM);
+						}
+					}
+					else if (vobj->mTextureAnimp->mFace < vobj->getNumTEs())
+					{
+						drawablep->getFace(vobj->mTextureAnimp->mFace)->setState(LLFace::TEXTURE_ANIM);
+					}
+				}
+
+				if (type == LLDrawPool::POOL_ALPHA)
+				{
+					if (facep->canRenderAsMask())
+					{ //can be treated as alpha mask
+						simple_faces.push_back(facep);
+					}
+					else
+					{
+						drawablep->setState(LLDrawable::HAS_ALPHA);
+						alpha_faces.push_back(facep);
+					}
+				}
+				else
+				{
+					if (drawablep->isState(LLDrawable::REBUILD_VOLUME))
+					{
+						facep->mLastUpdateTime = gFrameTimeSeconds;
+					}
+
+					if (gPipeline.canUseWindLightShadersOnObjects()
+						&& LLPipeline::sRenderBump)
+					{
+						if (te->getBumpmap())
+						{ //needs normal + binormal
+							bump_faces.push_back(facep);
+						}
+						else if (te->getShiny() || !te->getFullbright())
+						{ //needs normal
+							simple_faces.push_back(facep);
+						}
+						else 
+						{ //doesn't need normal
+							facep->setState(LLFace::FULLBRIGHT);
+							fullbright_faces.push_back(facep);
+						}
+					}
+					else
+					{
+						if (te->getBumpmap() && LLPipeline::sRenderBump)
+						{ //needs normal + binormal
+							bump_faces.push_back(facep);
+						}
+						else if ((te->getShiny() && LLPipeline::sRenderBump) ||
+							!(te->getFullbright() || bake_sunlight))
+						{ //needs normal
+							simple_faces.push_back(facep);
+						}
+						else 
+						{ //doesn't need normal
+							facep->setState(LLFace::FULLBRIGHT);
+							fullbright_faces.push_back(facep);
+						}
+					}
+				}
+			}
+			else
+			{	//face has no renderable geometry
+				facep->clearVertexBuffer();
+			}		
+		}
+
+		if (is_rigged)
+		{
+			drawablep->setState(LLDrawable::RIGGED);
+		}
+		else
+		{
+			drawablep->clearState(LLDrawable::RIGGED);
+		}
+	}
+
+	group->mBufferUsage = useage;
+
+	//PROCESS NON-ALPHA FACES
+	U32 simple_mask = LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_COLOR;
+	U32 alpha_mask = simple_mask | 0x80000000; //hack to give alpha verts their own VBO
+	U32 bump_mask = LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_TEXCOORD1 | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_COLOR;
+	U32 fullbright_mask = LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_COLOR;
+
+	bool batch_textures = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT) > 1;
+
+	if (batch_textures)
+	{
+		bump_mask |= LLVertexBuffer::MAP_BINORMAL;
+		genDrawInfo(group, simple_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, simple_faces, FALSE, TRUE);
+		genDrawInfo(group, fullbright_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, fullbright_faces, FALSE, TRUE);
+		genDrawInfo(group, bump_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, bump_faces, FALSE, TRUE);
+		genDrawInfo(group, alpha_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, alpha_faces, TRUE, TRUE);
+	}
+	else
+	{
+		genDrawInfo(group, simple_mask, simple_faces);
+		genDrawInfo(group, fullbright_mask, fullbright_faces);
+		genDrawInfo(group, bump_mask, bump_faces, FALSE, TRUE);
+		genDrawInfo(group, alpha_mask, alpha_faces, TRUE);
+	}
+	
+
+	if (!LLPipeline::sDelayVBUpdate)
+	{
+		//drawables have been rebuilt, clear rebuild status
+		for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
+		{
+			LLDrawable* drawablep = *drawable_iter;
+			drawablep->clearState(LLDrawable::REBUILD_ALL);
+		}
+	}
+
+	group->mLastUpdateTime = gFrameTimeSeconds;
+	group->mBuilt = 1.f;
+	group->clearState(LLSpatialGroup::GEOM_DIRTY | LLSpatialGroup::ALPHA_DIRTY);
+
+	if (LLPipeline::sDelayVBUpdate)
+	{
+		group->setState(LLSpatialGroup::MESH_DIRTY | LLSpatialGroup::NEW_DRAWINFO);
+	}
+
+	mFaceList.clear();
+}
+
+static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM("Volume Geometry");
+static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM_PARTIAL("Terse Rebuild");
+
+void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
+{
+	llassert(group);
+	if (group && group->isState(LLSpatialGroup::MESH_DIRTY) && !group->isState(LLSpatialGroup::GEOM_DIRTY))
+	{
+		LLFastTimer tm(FTM_VOLUME_GEOM);
+		S32 num_mapped_veretx_buffer = LLVertexBuffer::sMappedCount ;
+
+		group->mBuilt = 1.f;
+		
+		std::set<LLVertexBuffer*> mapped_buffers;
+
+		for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
+		{
+			LLFastTimer t(FTM_VOLUME_GEOM_PARTIAL);
+			LLDrawable* drawablep = *drawable_iter;
+
+			if (!drawablep->isDead() && drawablep->isState(LLDrawable::REBUILD_ALL) )
+			{
+				LLVOVolume* vobj = drawablep->getVOVolume();
+				vobj->preRebuild();
+
+				LLVolume* volume = vobj->getVolume();
+				for (S32 i = 0; i < drawablep->getNumFaces(); ++i)
+				{
+					LLFace* face = drawablep->getFace(i);
+					if (face)
+					{
+						LLVertexBuffer* buff = face->getVertexBuffer();
+						if (buff)
+						{
+							face->getGeometryVolume(*volume, face->getTEOffset(), 
+								vobj->getRelativeXform(), vobj->getRelativeXformInvTrans(), face->getGeomIndex());
+
+							if (buff->isLocked())
+							{
+								mapped_buffers.insert(buff);
+							}
+						}
+					}
+				}
+				
+				drawablep->clearState(LLDrawable::REBUILD_ALL);
+			}
+		}
+		
+		for (std::set<LLVertexBuffer*>::iterator iter = mapped_buffers.begin(); iter != mapped_buffers.end(); ++iter)
+		{
+			(*iter)->setBuffer(0);
+		}
+
+		// don't forget alpha
+		if(group != NULL && 
+		   !group->mVertexBuffer.isNull() && 
+		   group->mVertexBuffer->isLocked())
+		{
+			group->mVertexBuffer->setBuffer(0);
+		}
+
+		//if not all buffers are unmapped
+		if(num_mapped_veretx_buffer != LLVertexBuffer::sMappedCount) 
+		{
+			llwarns << "Not all mapped vertex buffers are unmapped!" << llendl ; 
+			for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
+			{
+				LLDrawable* drawablep = *drawable_iter;
+				for (S32 i = 0; i < drawablep->getNumFaces(); ++i)
+				{
+					LLFace* face = drawablep->getFace(i);
+					LLVertexBuffer* buff = face->getVertexBuffer();
+					if (face && buff && buff->isLocked())
+					{
+						buff->setBuffer(0) ;
+					}
+				}
+			} 
+		}
+
+		group->clearState(LLSpatialGroup::MESH_DIRTY | LLSpatialGroup::NEW_DRAWINFO);
+	}
+
+	llassert(!group || !group->isState(LLSpatialGroup::NEW_DRAWINFO));
+}
+
+struct CompareBatchBreakerModified
+{
+	bool operator()(const LLFace* const& lhs, const LLFace* const& rhs)
+	{
+		const LLTextureEntry* lte = lhs->getTextureEntry();
+		const LLTextureEntry* rte = rhs->getTextureEntry();
+
+		if (lte->getBumpmap() != rte->getBumpmap())
+		{
+			return lte->getBumpmap() < rte->getBumpmap();
+		}
+		else if (lte->getFullbright() != rte->getFullbright())
+		{
+			return lte->getFullbright() < rte->getFullbright();
+		}
+		else  if (lte->getGlow() != rte->getGlow())
+		{
+			return lte->getGlow() < rte->getGlow();
+		}
+		else
+		{
+			return lhs->getTexture() < rhs->getTexture();
+		}
+		
+	}
+};
+
+void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector<LLFace*>& faces, BOOL distance_sort, BOOL batch_textures)
+{
+	//calculate maximum number of vertices to store in a single buffer
+	U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcVertexSize(group->mSpatialPartition->mVertexDataMask);
+	max_vertices = llmin(max_vertices, (U32) 65535);
+
+	if (!distance_sort)
+	{
+		//sort faces by things that break batches
+		std::sort(faces.begin(), faces.end(), CompareBatchBreakerModified());
+	}
+	else
+	{
+		//sort faces by distance
+		std::sort(faces.begin(), faces.end(), LLFace::CompareDistanceGreater());
+	}
+				
+	std::vector<LLFace*>::iterator face_iter = faces.begin();
+	
+	LLSpatialGroup::buffer_map_t buffer_map;
+
+	LLViewerTexture* last_tex = NULL;
+	S32 buffer_index = 0;
+
+	if (distance_sort)
+	{
+		buffer_index = -1;
+	}
+
+	S32 texture_index_channels = gGLManager.mNumTextureImageUnits-1; //always reserve one for shiny for now just for simplicity
+	
+	if (gGLManager.mGLVersion < 3.1f)
+	{
+		texture_index_channels = 1;
+	}
+
+	if (LLPipeline::sRenderDeferred && distance_sort)
+	{
+		texture_index_channels = gDeferredAlphaProgram.mFeatures.mIndexedTextureChannels;
+	}
+
+	texture_index_channels = llmin(texture_index_channels, (S32) gSavedSettings.getU32("RenderMaxTextureIndex"));
+	
+
+	while (face_iter != faces.end())
+	{
+		//pull off next face
+		LLFace* facep = *face_iter;
+		LLViewerTexture* tex = facep->getTexture();
+
+		if (distance_sort)
+		{
+			tex = NULL;
+		}
+
+		if (last_tex == tex)
+		{
+			buffer_index++;
+		}
+		else
+		{
+			last_tex = tex;
+			buffer_index = 0;
+		}
+
+		bool bake_sunlight = LLPipeline::sBakeSunlight && facep->getDrawable()->isStatic(); 
+
+		U32 index_count = facep->getIndicesCount();
+		U32 geom_count = facep->getGeomCount();
+
+		//sum up vertices needed for this render batch
+		std::vector<LLFace*>::iterator i = face_iter;
+		++i;
+		
+		std::vector<LLViewerTexture*> texture_list;
+
+		if (batch_textures)
+		{
+			U8 cur_tex = 0;
+			facep->setTextureIndex(cur_tex);
+			texture_list.push_back(tex);
+
+			//if (can_batch_texture(facep))
+			{
+				while (i != faces.end())
+				{
+					facep = *i;
+					if (facep->getTexture() != tex)
+					{
+						if (distance_sort)
+						{ //textures might be out of order, see if texture exists in current batch
+							bool found = false;
+							for (U32 tex_idx = 0; tex_idx < texture_list.size(); ++tex_idx)
+							{
+								if (facep->getTexture() == texture_list[tex_idx])
+								{
+									cur_tex = tex_idx;
+									found = true;
+									break;
+								}
+							}
+
+							if (!found)
+							{
+								cur_tex = texture_list.size();
+							}
+						}
+						else
+						{
+							cur_tex++;
+						}
+
+						if (!can_batch_texture(facep))
+						{ //face is bump mapped or has an animated texture matrix -- can't 
+							//batch more than 1 texture at a time
+							break;
+						}
+
+						if (cur_tex >= texture_index_channels)
+						{ //cut batches when index channels are depleted
+							break;
+						}
+
+						tex = facep->getTexture();
+
+						texture_list.push_back(tex);
+					}
+
+					if (geom_count + facep->getGeomCount() > max_vertices)
+					{ //cut batches on geom count too big
+						break;
+					}
+
+					++i;
+					index_count += facep->getIndicesCount();
+					geom_count += facep->getGeomCount();
+
+					facep->setTextureIndex(cur_tex);
+				}
+			}
+
+			tex = texture_list[0];
+		}
+		else
+		{
+			while (i != faces.end() && 
+				(LLPipeline::sTextureBindTest || (distance_sort || (*i)->getTexture() == tex)))
+			{
+				facep = *i;
+			
+
+				//face has no texture index
+				facep->mDrawInfo = NULL;
+				facep->setTextureIndex(255);
+
+				if (geom_count + facep->getGeomCount() > max_vertices)
+				{ //cut batches on geom count too big
+					break;
+				}
+
+				++i;
+				index_count += facep->getIndicesCount();
+				geom_count += facep->getGeomCount();
+			}
+		}
+	
+		//create/delete/resize vertex buffer if needed
+		LLVertexBuffer* buffer = NULL;
+		LLSpatialGroup::buffer_texture_map_t::iterator found_iter = group->mBufferMap[mask].find(*face_iter);
+		
+		if (found_iter != group->mBufferMap[mask].end())
+		{
+			if ((U32) buffer_index < found_iter->second.size())
+			{
+				buffer = found_iter->second[buffer_index];
+			}
+		}
+						
+		if (!buffer)
+		{ //create new buffer if needed
+			buffer = createVertexBuffer(mask, 
+											group->mBufferUsage);
+			buffer->allocateBuffer(geom_count, index_count, TRUE);
+		}
+		else 
+		{ //resize pre-existing buffer
+			if (LLVertexBuffer::sEnableVBOs && buffer->getUsage() != group->mBufferUsage ||
+				buffer->getTypeMask() != mask)
+			{
+				buffer = createVertexBuffer(mask, 
+											group->mBufferUsage);
+				buffer->allocateBuffer(geom_count, index_count, TRUE);
+			}
+			else
+			{
+				buffer->resizeBuffer(geom_count, index_count);
+			}
+		}
+
+		buffer_map[mask][*face_iter].push_back(buffer);
+
+		//add face geometry
+
+		U32 indices_index = 0;
+		U16 index_offset = 0;
+
+		while (face_iter < i)
+		{ //update face indices for new buffer
+			facep = *face_iter;
+			facep->setIndicesIndex(indices_index);
+			facep->setGeomIndex(index_offset);
+			facep->setVertexBuffer(buffer);	
+			
+			if (batch_textures && facep->getTextureIndex() == 255)
+			{
+				llerrs << "Invalid texture index." << llendl;
+			}
+			
+			{
+				//for debugging, set last time face was updated vs moved
+				facep->updateRebuildFlags();
+
+				if (!LLPipeline::sDelayVBUpdate)
+				{ //copy face geometry into vertex buffer
+					LLDrawable* drawablep = facep->getDrawable();
+					LLVOVolume* vobj = drawablep->getVOVolume();
+					LLVolume* volume = vobj->getVolume();
+
+					U32 te_idx = facep->getTEOffset();
+
+					facep->getGeometryVolume(*volume, te_idx, 
+						vobj->getRelativeXform(), vobj->getRelativeXformInvTrans(), index_offset);
+				}
+			}
+
+			index_offset += facep->getGeomCount();
+			indices_index += facep->getIndicesCount();
+
+
+			//append face to appropriate render batch
+
+			BOOL force_simple = facep->getPixelArea() < FORCE_SIMPLE_RENDER_AREA;
+			BOOL fullbright = facep->isState(LLFace::FULLBRIGHT);
+			if ((mask & LLVertexBuffer::MAP_NORMAL) == 0)
+			{ //paranoia check to make sure GL doesn't try to read non-existant normals
+				fullbright = TRUE;
+			}
+
+			const LLTextureEntry* te = facep->getTextureEntry();
+			tex = facep->getTexture();
+
+			BOOL is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) ? TRUE : FALSE;
+		
+			if (is_alpha)
+			{
+				// can we safely treat this as an alpha mask?
+				if (facep->canRenderAsMask())
+				{
+					if (te->getFullbright() || LLPipeline::sNoAlpha)
+					{
+						registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK);
+					}
+					else
+					{
+						registerFace(group, facep, LLRenderPass::PASS_ALPHA_MASK);
+					}
+				}
+				else
+				{
+					registerFace(group, facep, LLRenderPass::PASS_ALPHA);
+				}
+
+				if (LLPipeline::sRenderDeferred)
+				{
+					registerFace(group, facep, LLRenderPass::PASS_ALPHA_SHADOW);
+				}
+			}
+			else if (gPipeline.canUseVertexShaders()
+				&& group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_HUD 
+				&& LLPipeline::sRenderBump 
+				&& te->getShiny())
+			{ //shiny
+				if (tex->getPrimaryFormat() == GL_ALPHA)
+				{ //invisiprim+shiny
+					registerFace(group, facep, LLRenderPass::PASS_INVISI_SHINY);
+					registerFace(group, facep, LLRenderPass::PASS_INVISIBLE);
+				}
+				else if (LLPipeline::sRenderDeferred)
+				{ //deferred rendering
+					if (te->getFullbright())
+					{ //register in post deferred fullbright shiny pass
+						registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_SHINY);
+						if (te->getBumpmap())
+						{ //register in post deferred bump pass
+							registerFace(group, facep, LLRenderPass::PASS_POST_BUMP);
+						}
+					}
+					else if (te->getBumpmap())
+					{ //register in deferred bump pass
+						registerFace(group, facep, LLRenderPass::PASS_BUMP);
+					}
+					else
+					{ //register in deferred simple pass (deferred simple includes shiny)
+						llassert(mask & LLVertexBuffer::MAP_NORMAL);
+						registerFace(group, facep, LLRenderPass::PASS_SIMPLE);
+					}
+				}
+				else if (fullbright)
+				{	//not deferred, register in standard fullbright shiny pass					
+					registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_SHINY);
+				}
+				else
+				{ //not deferred or fullbright, register in standard shiny pass
+					registerFace(group, facep, LLRenderPass::PASS_SHINY);
+				}
+			}
+			else
+			{ //not alpha and not shiny
+				if (!is_alpha && tex->getPrimaryFormat() == GL_ALPHA)
+				{ //invisiprim
+					registerFace(group, facep, LLRenderPass::PASS_INVISIBLE);
+				}
+				else if (fullbright || bake_sunlight)
+				{ //fullbright
+					registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT);
+					if (LLPipeline::sRenderDeferred && LLPipeline::sRenderBump && te->getBumpmap())
+					{ //if this is the deferred render and a bump map is present, register in post deferred bump
+						registerFace(group, facep, LLRenderPass::PASS_POST_BUMP);
+					}
+				}
+				else
+				{
+					if (LLPipeline::sRenderDeferred && LLPipeline::sRenderBump && te->getBumpmap())
+					{ //non-shiny or fullbright deferred bump
+						registerFace(group, facep, LLRenderPass::PASS_BUMP);
+					}
+					else
+					{ //all around simple
+						llassert(mask & LLVertexBuffer::MAP_NORMAL);
+						registerFace(group, facep, LLRenderPass::PASS_SIMPLE);
+					}
+				}
+				
+				//not sure why this is here -- shiny HUD attachments maybe?  -- davep 5/11/2010
+				if (!is_alpha && te->getShiny() && LLPipeline::sRenderBump)
+				{
+					registerFace(group, facep, LLRenderPass::PASS_SHINY);
+				}
+			}
+			
+			//not sure why this is here, and looks like it might cause bump mapped objects to get rendered redundantly -- davep 5/11/2010
+			if (!is_alpha && !LLPipeline::sRenderDeferred)
+			{
+				llassert((mask & LLVertexBuffer::MAP_NORMAL) || fullbright);
+				facep->setPoolType((fullbright) ? LLDrawPool::POOL_FULLBRIGHT : LLDrawPool::POOL_SIMPLE);
+				
+				if (!force_simple && te->getBumpmap() && LLPipeline::sRenderBump)
+				{
+					registerFace(group, facep, LLRenderPass::PASS_BUMP);
+				}
+			}
+
+			if (!is_alpha && LLPipeline::sRenderGlow && te->getGlow() > 0.f)
+			{
+				registerFace(group, facep, LLRenderPass::PASS_GLOW);
+			}
+						
+			++face_iter;
+		}
+
+		buffer->setBuffer(0);
+	}
+
+	group->mBufferMap[mask].clear();
+	for (LLSpatialGroup::buffer_texture_map_t::iterator i = buffer_map[mask].begin(); i != buffer_map[mask].end(); ++i)
+	{
+		group->mBufferMap[mask][i->first] = i->second;
+	}
+}
+
+void LLGeometryManager::addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32 &index_count)
+{	
+	//initialize to default usage for this partition
+	U32 usage = group->mSpatialPartition->mBufferUsage;
+	
+	//clear off any old faces
+	mFaceList.clear();
+
+	//for each drawable
+	for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
+	{
+		LLDrawable* drawablep = *drawable_iter;
+		
+		if (drawablep->isDead())
+		{
+			continue;
+		}
+	
+		if (drawablep->isAnimating())
+		{ //fall back to stream draw for animating verts
+			usage = GL_STREAM_DRAW_ARB;
+		}
+
+		//for each face
+		for (S32 i = 0; i < drawablep->getNumFaces(); i++)
+		{
+			//sum up face verts and indices
+			drawablep->updateFaceSize(i);
+			LLFace* facep = drawablep->getFace(i);
+			if (facep->hasGeometry() && facep->getPixelArea() > FORCE_CULL_AREA)
+			{
+				vertex_count += facep->getGeomCount();
+				index_count += facep->getIndicesCount();
+				llassert(facep->getIndicesCount() < 65536);
+				//remember face (for sorting)
+				mFaceList.push_back(facep);
+			}
+			else
+			{
+				facep->clearVertexBuffer();
+			}
+		}
+	}
+	
+	group->mBufferUsage = usage;
+}
+
+LLHUDPartition::LLHUDPartition()
+{
+	mPartitionType = LLViewerRegion::PARTITION_HUD;
+	mDrawableType = LLPipeline::RENDER_TYPE_HUD;
+	mSlopRatio = 0.f;
+	mLODPeriod = 1;
+}
+
+void LLHUDPartition::shift(const LLVector4a &offset)
+{
+	//HUD objects don't shift with region crossing.  That would be silly.
+}
+
+
-- 
cgit v1.2.3


From ca8a484f0ee4bcb9b68268f871082d4200062f0e Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Mon, 22 Aug 2011 19:18:36 +0300
Subject: SH-2169 FIXED Land impacts data added to build tools floater. Land
 selection moved from advanced weights floater to build tools floater. Removed
 selection observer from weights floater, selection data update in it is
 initiated from build floater.

---
 indra/newview/llfloaterobjectweights.cpp           | 115 ++++-----------------
 indra/newview/llfloaterobjectweights.h             |  36 ++++---
 indra/newview/llfloatertools.cpp                   | 113 +++++++++++++++-----
 indra/newview/llfloatertools.h                     |   4 +
 .../newview/skins/default/xui/en/floater_tools.xml |  10 +-
 5 files changed, 139 insertions(+), 139 deletions(-)

diff --git a/indra/newview/llfloaterobjectweights.cpp b/indra/newview/llfloaterobjectweights.cpp
index 7ad34431fb..7bfa8454b6 100644
--- a/indra/newview/llfloaterobjectweights.cpp
+++ b/indra/newview/llfloaterobjectweights.cpp
@@ -33,68 +33,36 @@
 #include "lltextbox.h"
 
 #include "llagent.h"
-#include "llselectmgr.h"
 #include "llviewerparcelmgr.h"
 #include "llviewerregion.h"
 
-/**
- * struct LLCrossParcelFunctor
- *
- * A functor that checks whether a bounding box for all
- * selected objects crosses a region or parcel bounds.
- */
-struct LLCrossParcelFunctor : public LLSelectedObjectFunctor
+// virtual
+bool LLCrossParcelFunctor::apply(LLViewerObject* obj)
 {
-	/*virtual*/ bool apply(LLViewerObject* obj)
-	{
-		// Add the root object box.
-		mBoundingBox.addBBoxAgent(LLBBox(obj->getPositionRegion(), obj->getRotationRegion(), obj->getScale() * -0.5f, obj->getScale() * 0.5f).getAxisAligned());
+	// Add the root object box.
+	mBoundingBox.addBBoxAgent(LLBBox(obj->getPositionRegion(), obj->getRotationRegion(), obj->getScale() * -0.5f, obj->getScale() * 0.5f).getAxisAligned());
 
-		// Extend the bounding box across all the children.
-		LLViewerObject::const_child_list_t children = obj->getChildren();
-		for (LLViewerObject::const_child_list_t::const_iterator iter = children.begin();
-			 iter != children.end(); iter++)
-		{
-			LLViewerObject* child = *iter;
-			mBoundingBox.addBBoxAgent(LLBBox(child->getPositionRegion(), child->getRotationRegion(), child->getScale() * -0.5f, child->getScale() * 0.5f).getAxisAligned());
-		}
-
-		bool result = false;
-
-		LLViewerRegion* region = obj->getRegion();
-		if (region)
-		{
-			std::vector<LLBBox> boxes;
-			boxes.push_back(mBoundingBox);
-			result = region->objectsCrossParcel(boxes);
-		}
-
-		return result;
+	// Extend the bounding box across all the children.
+	LLViewerObject::const_child_list_t children = obj->getChildren();
+	for (LLViewerObject::const_child_list_t::const_iterator iter = children.begin();
+		 iter != children.end(); iter++)
+	{
+		LLViewerObject* child = *iter;
+		mBoundingBox.addBBoxAgent(LLBBox(child->getPositionRegion(), child->getRotationRegion(), child->getScale() * -0.5f, child->getScale() * 0.5f).getAxisAligned());
 	}
 
-private:
-	LLBBox	mBoundingBox;
-};
+	bool result = false;
 
-/**
- * Class LLLandImpactsObserver
- *
- * An observer class to monitor parcel selection and update
- * the land impacts data from a parcel containing the selected object.
- */
-class LLLandImpactsObserver : public LLParcelObserver
-{
-public:
-	virtual void changed()
+	LLViewerRegion* region = obj->getRegion();
+	if (region)
 	{
-		LLFloaterObjectWeights* object_weights_floater = LLFloaterReg::getTypedInstance<LLFloaterObjectWeights>("object_weights");
-		if(object_weights_floater)
-		{
-			object_weights_floater->updateLandImpacts();
-		}
+		std::vector<LLBBox> boxes;
+		boxes.push_back(mBoundingBox);
+		result = region->objectsCrossParcel(boxes);
 	}
-};
 
+	return result;
+}
 
 LLFloaterObjectWeights::LLFloaterObjectWeights(const LLSD& key)
 :	LLFloater(key),
@@ -107,22 +75,12 @@ LLFloaterObjectWeights::LLFloaterObjectWeights(const LLSD& key)
 	mSelectedOnLand(NULL),
 	mRezzedOnLand(NULL),
 	mRemainingCapacity(NULL),
-	mTotalCapacity(NULL),
-	mLandImpactsObserver(NULL)
+	mTotalCapacity(NULL)
 {
-	mLandImpactsObserver = new LLLandImpactsObserver();
-	LLViewerParcelMgr::getInstance()->addObserver(mLandImpactsObserver);
 }
 
 LLFloaterObjectWeights::~LLFloaterObjectWeights()
 {
-	mObjectSelection = NULL;
-	mParcelSelection = NULL;
-
-	mSelectMgrConnection.disconnect();
-
-	LLViewerParcelMgr::getInstance()->removeObserver(mLandImpactsObserver);
-	delete mLandImpactsObserver;
 }
 
 // virtual
@@ -147,21 +105,8 @@ BOOL LLFloaterObjectWeights::postBuild()
 // virtual
 void LLFloaterObjectWeights::onOpen(const LLSD& key)
 {
-	mSelectMgrConnection = LLSelectMgr::instance().mUpdateSignal.connect(boost::bind(&LLFloaterObjectWeights::refresh, this));
-
-	mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();
-	mParcelSelection = LLViewerParcelMgr::getInstance()->getFloatingParcelSelection();
-
 	refresh();
-}
-
-// virtual
-void LLFloaterObjectWeights::onClose(bool app_quitting)
-{
-	mSelectMgrConnection.disconnect();
-
-	mObjectSelection = NULL;
-	mParcelSelection = NULL;
+	updateLandImpacts(LLViewerParcelMgr::getInstance()->getFloatingParcelSelection()->getParcel());
 }
 
 // virtual
@@ -190,9 +135,8 @@ void LLFloaterObjectWeights::setErrorStatus(U32 status, const std::string& reaso
 	toggleWeightsLoadingIndicators(false);
 }
 
-void LLFloaterObjectWeights::updateLandImpacts()
+void LLFloaterObjectWeights::updateLandImpacts(const LLParcel* parcel)
 {
-	LLParcel *parcel = mParcelSelection->getParcel();
 	if (!parcel || LLSelectMgr::getInstance()->getSelection()->isEmpty())
 	{
 		updateIfNothingSelected();
@@ -241,21 +185,6 @@ void LLFloaterObjectWeights::refresh()
 
 			toggleLandImpactsLoadingIndicators(false);
 		}
-		else
-		{
-			LLViewerObject* selected_object = mObjectSelection->getFirstObject();
-			if (selected_object)
-			{
-				// Select a parcel at the currently selected object's position.
-				LLViewerParcelMgr::getInstance()->selectParcelAt(selected_object->getPositionGlobal());
-
-				toggleLandImpactsLoadingIndicators(true);
-			}
-			else
-			{
-				llwarns << "Failed to get selected object" << llendl;
-			}
-		}
 
 		LLViewerRegion* region = gAgent.getRegion();
 		if (region && region->capabilitiesReceived())
diff --git a/indra/newview/llfloaterobjectweights.h b/indra/newview/llfloaterobjectweights.h
index 50d028909e..64aa2f2bbe 100644
--- a/indra/newview/llfloaterobjectweights.h
+++ b/indra/newview/llfloaterobjectweights.h
@@ -30,36 +30,45 @@
 #include "llfloater.h"
 
 #include "llaccountingcostmanager.h"
+#include "llselectmgr.h"
 
-class LLLandImpactsObserver;
-class LLObjectSelection;
-class LLParcelSelection;
+class LLParcel;
 class LLTextBox;
 
+/**
+ * struct LLCrossParcelFunctor
+ *
+ * A functor that checks whether a bounding box for all
+ * selected objects crosses a region or parcel bounds.
+ */
+struct LLCrossParcelFunctor : public LLSelectedObjectFunctor
+{
+	/*virtual*/ bool apply(LLViewerObject* obj);
+
+private:
+	LLBBox	mBoundingBox;
+};
+
+
 class LLFloaterObjectWeights : public LLFloater, LLAccountingCostObserver
 {
 public:
 	LOG_CLASS(LLFloaterObjectWeights);
 
-	typedef LLSafeHandle<LLObjectSelection> LLObjectSelectionHandle;
-	typedef LLSafeHandle<LLParcelSelection> LLParcelSelectionHandle;
-
 	LLFloaterObjectWeights(const LLSD& key);
 	~LLFloaterObjectWeights();
 
 	/*virtual*/ BOOL postBuild();
 
 	/*virtual*/ void onOpen(const LLSD& key);
-	/*virtual*/ void onClose(bool app_quitting);
 
 	/*virtual*/ void onWeightsUpdate(const SelectionCost& selection_cost);
 	/*virtual*/ void setErrorStatus(U32 status, const std::string& reason);
 
-	void updateLandImpacts();
-
-private:
+	void updateLandImpacts(const LLParcel* parcel);
 	void refresh();
 
+private:
 	void toggleWeightsLoadingIndicators(bool visible);
 	void toggleLandImpactsLoadingIndicators(bool visible);
 
@@ -77,13 +86,6 @@ private:
 	LLTextBox		*mRezzedOnLand;
 	LLTextBox		*mRemainingCapacity;
 	LLTextBox		*mTotalCapacity;
-
-	LLLandImpactsObserver		*mLandImpactsObserver;
-
-	LLObjectSelectionHandle		mObjectSelection;
-	LLParcelSelectionHandle		mParcelSelection;
-
-	boost::signals2::connection	mSelectMgrConnection;
 };
 
 #endif //LL_LLFLOATEROBJECTWEIGHTS_H
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index 48aeeafcfd..1008b4a6e4 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -41,6 +41,7 @@
 #include "llfloaterbuildoptions.h"
 #include "llfloatermediasettings.h"
 #include "llfloateropenobject.h"
+#include "llfloaterobjectweights.h"
 #include "llfloaterreg.h"
 #include "llfocusmgr.h"
 #include "llmediaentry.h"
@@ -54,6 +55,7 @@
 #include "llpanelobject.h"
 #include "llpanelvolume.h"
 #include "llpanelpermissions.h"
+#include "llparcel.h"
 #include "llradiogroup.h"
 #include "llresmgr.h"
 #include "llselectmgr.h"
@@ -117,6 +119,24 @@ void commit_radio_group_edit(LLUICtrl* ctrl);
 void commit_radio_group_land(LLUICtrl* ctrl);
 void commit_slider_zoom(LLUICtrl *ctrl);
 
+/**
+ * Class LLLandImpactsObserver
+ *
+ * An observer class to monitor parcel selection and update
+ * the land impacts data from a parcel containing the selected object.
+ */
+class LLLandImpactsObserver : public LLParcelObserver
+{
+public:
+	virtual void changed()
+	{
+		LLFloaterTools* tools_floater = LLFloaterReg::getTypedInstance<LLFloaterTools>("build");
+		if(tools_floater)
+		{
+			tools_floater->updateLandImpacts();
+		}
+	}
+};
 
 //static
 void*	LLFloaterTools::createPanelPermissions(void* data)
@@ -344,6 +364,9 @@ LLFloaterTools::LLFloaterTools(const LLSD& key)
 
 	mCostTextBorder(NULL),
 	mTabLand(NULL),
+
+	mLandImpactsObserver(NULL),
+
 	mDirty(TRUE),
 	mNeedMediaTitle(TRUE)
 {
@@ -375,12 +398,17 @@ LLFloaterTools::LLFloaterTools(const LLSD& key)
 	mCommitCallbackRegistrar.add("BuildTool.LinkObjects",		boost::bind(&LLSelectMgr::linkObjects, LLSelectMgr::getInstance()));
 	mCommitCallbackRegistrar.add("BuildTool.UnlinkObjects",		boost::bind(&LLSelectMgr::unlinkObjects, LLSelectMgr::getInstance()));
 
+	mLandImpactsObserver = new LLLandImpactsObserver();
+	LLViewerParcelMgr::getInstance()->addObserver(mLandImpactsObserver);
 }
 
 LLFloaterTools::~LLFloaterTools()
 {
 	// children automatically deleted
 	gFloaterTools = NULL;
+
+	LLViewerParcelMgr::getInstance()->removeObserver(mLandImpactsObserver);
+	delete mLandImpactsObserver;
 }
 
 void LLFloaterTools::setStatusText(const std::string& text)
@@ -449,45 +477,44 @@ void LLFloaterTools::refresh()
 	else
 #endif
 	{
-		F32 link_phys_cost  = LLSelectMgr::getInstance()->getSelection()->getSelectedLinksetPhysicsCost();
 		F32 link_cost  = LLSelectMgr::getInstance()->getSelection()->getSelectedLinksetCost();
-		S32 prim_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
 		S32 link_count = LLSelectMgr::getInstance()->getSelection()->getRootObjectCount();
 
-		LLStringUtil::format_map_t selection_args;
-		selection_args["OBJ_COUNT"] = llformat("%.1d", link_count);
-		selection_args["PRIM_COUNT"] = llformat("%.1d", prim_count);
-
-		std::ostringstream selection_info;
-
-		bool show_mesh_cost = gMeshRepo.meshRezEnabled();
-
-		if (show_mesh_cost)
+		LLCrossParcelFunctor func;
+		if (LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, true))
 		{
-			LLStringUtil::format_map_t prim_equiv_args;
-			prim_equiv_args["SEL_WEIGHT"] = llformat("%.1d", (S32)link_cost);
-			selection_args["PE_STRING"] = getString("status_selectprimequiv", prim_equiv_args);
+			// Selection crosses parcel bounds.
+			// We don't display remaining land capacity in this case.
+			const LLStringExplicit empty_str("");
+			childSetTextArg("remaining_capacity", "[CAPACITY_STRING]", empty_str);
 		}
 		else
 		{
-			selection_args["PE_STRING"] = "";
+			LLViewerObject* selected_object = mObjectSelection->getFirstObject();
+			if (selected_object)
+			{
+				// Select a parcel at the currently selected object's position.
+				LLViewerParcelMgr::getInstance()->selectParcelAt(selected_object->getPositionGlobal());
+			}
+			else
+			{
+				llwarns << "Failed to get selected object" << llendl;
+			}
 		}
 
-		selection_info << getString("status_selectcount", selection_args);
-
-
-		selection_info << ",";
+		LLStringUtil::format_map_t selection_args;
+		selection_args["OBJ_COUNT"] = llformat("%.1d", link_count);
+		selection_args["LAND_IMPACT"] = llformat("%.1d", (S32)link_cost);
 
-		S32 render_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectRenderCost();
+		std::ostringstream selection_info;
 
-		childSetTextArg("selection_weight", "[PHYS_WEIGHT]", llformat("%.1f", link_phys_cost));
-		childSetTextArg("selection_weight", "[DISP_WEIGHT]", llformat("%.1d", render_cost));
+		selection_info << getString("status_selectcount", selection_args);
 
 		getChild<LLTextBox>("selection_count")->setText(selection_info.str());
 
 		bool have_selection = !LLSelectMgr::getInstance()->getSelection()->isEmpty();
 		childSetVisible("selection_count",  have_selection);
-		childSetVisible("selection_weight", have_selection);
+		childSetVisible("remaining_capacity", have_selection);
 		childSetVisible("selection_empty", !have_selection);
 	}
 
@@ -500,6 +527,13 @@ void LLFloaterTools::refresh()
 	refreshMedia();
 	mPanelContents->refresh();
 	mPanelLandInfo->refresh();
+
+	// Refresh the advanced weights floater
+	LLFloaterObjectWeights* object_weights_floater = LLFloaterReg::getTypedInstance<LLFloaterObjectWeights>("object_weights");
+	if(object_weights_floater && object_weights_floater->getVisible())
+	{
+		object_weights_floater->refresh();
+	}
 }
 
 void LLFloaterTools::draw()
@@ -758,7 +792,7 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
 	bool have_selection = !LLSelectMgr::getInstance()->getSelection()->isEmpty();
 
 	getChildView("selection_count")->setVisible(!land_visible && have_selection);
-	getChildView("selection_weight")->setVisible(!land_visible && have_selection);
+	getChildView("remaining_capacity")->setVisible(!land_visible && have_selection);
 	getChildView("selection_empty")->setVisible(!land_visible && !have_selection);
 	
 	mTab->setVisible(!land_visible);
@@ -1086,6 +1120,37 @@ bool LLFloaterTools::selectedMediaEditable()
 	return selected_Media_editable;
 }
 
+void LLFloaterTools::updateLandImpacts()
+{
+	LLParcel *parcel = mParcelSelection->getParcel();
+	if (!parcel)
+	{
+		return;
+	}
+
+	S32 rezzed_prims = parcel->getSimWidePrimCount();
+	S32 total_capacity = parcel->getSimWideMaxPrimCapacity();
+
+	std::string remaining_capacity_str = "";
+
+	bool show_mesh_cost = gMeshRepo.meshRezEnabled();
+	if (show_mesh_cost)
+	{
+		LLStringUtil::format_map_t remaining_capacity_args;
+		remaining_capacity_args["LAND_CAPACITY"] = llformat("%d", total_capacity - rezzed_prims);
+		remaining_capacity_str = getString("status_remaining_capacity", remaining_capacity_args);
+	}
+
+	childSetTextArg("remaining_capacity", "[CAPACITY_STRING]", remaining_capacity_str);
+
+	// Update land impacts info in the weights floater
+	LLFloaterObjectWeights* object_weights_floater = LLFloaterReg::getTypedInstance<LLFloaterObjectWeights>("object_weights");
+	if(object_weights_floater)
+	{
+		object_weights_floater->updateLandImpacts(parcel);
+	}
+}
+
 void LLFloaterTools::getMediaState()
 {
 	LLObjectSelectionHandle selected_objects =LLSelectMgr::getInstance()->getSelection();
diff --git a/indra/newview/llfloatertools.h b/indra/newview/llfloatertools.h
index 8c4cb721d3..63ed9dc82b 100644
--- a/indra/newview/llfloatertools.h
+++ b/indra/newview/llfloatertools.h
@@ -47,6 +47,7 @@ class LLMediaCtrl;
 class LLTool;
 class LLParcelSelection;
 class LLObjectSelection;
+class LLLandImpactsObserver;
 
 typedef LLSafeHandle<LLObjectSelection> LLObjectSelectionHandle;
 
@@ -103,6 +104,7 @@ public:
 	void updateMediaTitle();
 	void navigateToTitleMedia( const std::string url );
 	bool selectedMediaEditable();
+	void updateLandImpacts();
 
 private:
 	void refresh();
@@ -180,6 +182,8 @@ public:
 
 	LLTabContainer*			mTabLand;
 
+	LLLandImpactsObserver*  mLandImpactsObserver;
+
 	LLParcelSelectionHandle	mParcelSelection;
 	LLObjectSelectionHandle	mObjectSelection;
 
diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml
index 03d6c84266..9b02f7d273 100644
--- a/indra/newview/skins/default/xui/en/floater_tools.xml
+++ b/indra/newview/skins/default/xui/en/floater_tools.xml
@@ -48,11 +48,11 @@
     </floater.string>
     <floater.string
      name="status_selectcount">
-        [OBJ_COUNT] objects ( [PRIM_COUNT] prims[PE_STRING] ) selected
+        [OBJ_COUNT] objects selected, land impact [LAND_IMPACT]
     </floater.string>
     <floater.string
-     name="status_selectprimequiv">
-        , [SEL_WEIGHT] prim equivs
+     name="status_remaining_capacity">
+        Remaining capacity [LAND_CAPACITY].
     </floater.string>
     <button
      follows="left|top"
@@ -738,11 +738,11 @@
 	  font="SansSerifSmall"
 	  layout="topleft"
 	  left="10"
-	  name="selection_weight"
+	  name="remaining_capacity"
 	  top_pad="0"
 	  visible="false"
 	  width="280">
-	  Physics weight [PHYS_WEIGHT], Render Cost [DISP_WEIGHT]. [secondlife:///app/openfloater/object_weights More info]
+	  [CAPACITY_STRING] [secondlife:///app/openfloater/object_weights More info]
 	</text>
     <!-- <text -->
     <!-- text_color="LtGray_50" -->
-- 
cgit v1.2.3


From 056015963290e47e03972e17ce6d603f8f940fe3 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Mon, 22 Aug 2011 23:41:54 +0300
Subject: SH-2171 ADDITIONAL FIX Added transaction ID to object weights
 requests to avoid updating the floater upon outdated or mixed up replies
 arrival.

---
 indra/newview/llaccountingcostmanager.cpp | 14 +++++++++++---
 indra/newview/llaccountingcostmanager.h   |  4 ++++
 indra/newview/llfloaterobjectweights.cpp  |  9 +++++++++
 indra/newview/llfloaterobjectweights.h    |  2 ++
 4 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llaccountingcostmanager.cpp b/indra/newview/llaccountingcostmanager.cpp
index 0669bdfffa..3717344aef 100644
--- a/indra/newview/llaccountingcostmanager.cpp
+++ b/indra/newview/llaccountingcostmanager.cpp
@@ -41,8 +41,13 @@ public:
 	: mObjectIDs( objectIDs ),
 	  mObserverHandle( observer_handle )
 	{
+		LLAccountingCostObserver* observer = mObserverHandle.get();
+		if (observer)
+		{
+			mTransactionID = observer->getTransactionID();
+		}
 	}
-		
+
 	void clearPendingRequests ( void )
 	{
 		for ( LLSD::array_iterator iter = mObjectIDs.beginArray(); iter != mObjectIDs.endArray(); ++iter )
@@ -57,7 +62,7 @@ public:
 		clearPendingRequests();
 
 		LLAccountingCostObserver* observer = mObserverHandle.get();
-		if (observer)
+		if (observer && observer->getTransactionID() == mTransactionID)
 		{
 			observer->setErrorStatus(statusNum, reason);
 		}
@@ -86,7 +91,7 @@ public:
 			SelectionCost selectionCost( /*transactionID,*/ physicsCost, networkCost, simulationCost );
 
 			LLAccountingCostObserver* observer = mObserverHandle.get();
-			if (observer)
+			if (observer && observer->getTransactionID() == mTransactionID)
 			{
 				observer->onWeightsUpdate(selectionCost);
 			}
@@ -99,6 +104,9 @@ private:
 	//List of posted objects
 	LLSD mObjectIDs;
 
+	// Current request ID
+	LLUUID mTransactionID;
+
 	// Cost update observer handle
 	LLHandle<LLAccountingCostObserver> mObserverHandle;
 };
diff --git a/indra/newview/llaccountingcostmanager.h b/indra/newview/llaccountingcostmanager.h
index cccdc2e2d9..0bca1f54ef 100644
--- a/indra/newview/llaccountingcostmanager.h
+++ b/indra/newview/llaccountingcostmanager.h
@@ -40,9 +40,13 @@ public:
 	virtual void onWeightsUpdate(const SelectionCost& selection_cost) = 0;
 	virtual void setErrorStatus(U32 status, const std::string& reason) = 0;
 	const LLHandle<LLAccountingCostObserver>& getObserverHandle() const { return mObserverHandle; }
+	const LLUUID& getTransactionID() { return mTransactionID; }
 
 protected:
+	virtual void generateTransactionID() = 0;
+
 	LLRootHandle<LLAccountingCostObserver> mObserverHandle;
+	LLUUID		mTransactionID;
 };
 //===============================================================================
 class LLAccountingCostManager : public LLSingleton<LLAccountingCostManager>
diff --git a/indra/newview/llfloaterobjectweights.cpp b/indra/newview/llfloaterobjectweights.cpp
index 7bfa8454b6..0862cd2897 100644
--- a/indra/newview/llfloaterobjectweights.cpp
+++ b/indra/newview/llfloaterobjectweights.cpp
@@ -198,6 +198,9 @@ void LLFloaterObjectWeights::refresh()
 			std::string url = region->getCapability("ResourceCostSelected");
 			if (!url.empty())
 			{
+				// Update the transaction id before the new fetch request
+				generateTransactionID();
+
 				LLAccountingCostManager::getInstance()->fetchCosts(Roots, url, getObserverHandle());
 				toggleWeightsLoadingIndicators(true);
 			}
@@ -209,6 +212,12 @@ void LLFloaterObjectWeights::refresh()
 	}
 }
 
+// virtual
+void LLFloaterObjectWeights::generateTransactionID()
+{
+	mTransactionID.generate();
+}
+
 void LLFloaterObjectWeights::toggleWeightsLoadingIndicators(bool visible)
 {
 	childSetVisible("download_loading_indicator", visible);
diff --git a/indra/newview/llfloaterobjectweights.h b/indra/newview/llfloaterobjectweights.h
index 64aa2f2bbe..9a244573be 100644
--- a/indra/newview/llfloaterobjectweights.h
+++ b/indra/newview/llfloaterobjectweights.h
@@ -69,6 +69,8 @@ public:
 	void refresh();
 
 private:
+	/*virtual*/ void generateTransactionID();
+
 	void toggleWeightsLoadingIndicators(bool visible);
 	void toggleLandImpactsLoadingIndicators(bool visible);
 
-- 
cgit v1.2.3


From e58d50e509d060320174c80af647da6ff9a3839f Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Tue, 23 Aug 2011 17:21:20 +0300
Subject: SH-2169 ADDITIONAL FIX Fixed SLURL showing context-specific help for
 object weights floater.

---
 indra/newview/skins/default/xui/en/floater_object_weights.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_object_weights.xml b/indra/newview/skins/default/xui/en/floater_object_weights.xml
index a73db3af32..eb283a1043 100644
--- a/indra/newview/skins/default/xui/en/floater_object_weights.xml
+++ b/indra/newview/skins/default/xui/en/floater_object_weights.xml
@@ -3,7 +3,7 @@
  can_close="true"
  can_tear_off="false"
  height="315"
- help_topic="objects_weight_floater"
+ help_topic="object_weights"
  layout="topleft"
  name="object_weights"
  save_rect="true"
@@ -337,6 +337,6 @@
      left="10"
      name="help_SLURL"
      top_pad="10"
-     value="[secondlife:///www.secondlife.com What is all this?...]"
+     value="[secondlife:///app/help/object_weights What is all this?...]"
      width="180" />
 </floater>
-- 
cgit v1.2.3


From 716d2bd2e4a2d556e98a1ac50262a01b5244d442 Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Wed, 24 Aug 2011 14:57:19 +0300
Subject: SH-2309 WIP Priority modifications to mesh uploader UI

- Arranged all controls of the floater (according to the last version of the mockup) except for the tab container content.
---
 indra/newview/llfloatermodelpreview.cpp            |   16 +-
 .../skins/default/xui/en/floater_model_preview.xml | 1315 ++++++++++----------
 2 files changed, 633 insertions(+), 698 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index b1b5e69968..acc8a9b213 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -5570,10 +5570,10 @@ void LLFloaterModelPreview::toggleCalculateButton(bool visible)
 	if (visible)
 	{
 		std::string tbd = getString("tbd");
-		childSetTextArg("weights_right", "[EQ]", tbd);
-		childSetTextArg("weights_left", "[ST]", tbd);
-		childSetTextArg("weights_right", "[SIM]", tbd);
-		childSetTextArg("weights_left", "[PH]", tbd);
+		childSetTextArg("prim_weight", "[EQ]", tbd);
+		childSetTextArg("download_weight", "[ST]", tbd);
+		childSetTextArg("server_weight", "[SIM]", tbd);
+		childSetTextArg("physics_weight", "[PH]", tbd);
 		childSetTextArg("upload_fee", "[FEE]", tbd);
 		childSetTextArg("price_breakdown", "[STREAMING]", tbd);
 		childSetTextArg("price_breakdown", "[PHYSICS]", tbd);
@@ -5596,10 +5596,10 @@ void LLFloaterModelPreview::handleModelPhysicsFeeReceived()
 	const LLSD& result = mModelPhysicsFee;
 	mUploadModelUrl = result["url"].asString();
 
-	childSetTextArg("weights_right", "[EQ]", llformat("%0.3f", result["resource_cost"].asReal()));
-	childSetTextArg("weights_left", "[ST]", llformat("%0.3f", result["model_streaming_cost"].asReal()));
-	childSetTextArg("weights_right", "[SIM]", llformat("%0.3f", result["simulation_cost"].asReal()));
-	childSetTextArg("weights_left", "[PH]", llformat("%0.3f", result["physics_cost"].asReal()));
+	childSetTextArg("prim_weight", "[EQ]", llformat("%0.3f", result["resource_cost"].asReal()));
+	childSetTextArg("download_weight", "[ST]", llformat("%0.3f", result["model_streaming_cost"].asReal()));
+	childSetTextArg("server_weight", "[SIM]", llformat("%0.3f", result["simulation_cost"].asReal()));
+	childSetTextArg("physics_weight", "[PH]", llformat("%0.3f", result["physics_cost"].asReal()));
 	childSetTextArg("upload_fee", "[FEE]", llformat("%d", result["upload_price"].asInteger()));
 	childSetTextArg("price_breakdown", "[STREAMING]", llformat("%d", result["upload_price_breakdown"]["mesh_streaming"].asInteger()));
 	childSetTextArg("price_breakdown", "[PHYSICS]", llformat("%d", result["upload_price_breakdown"]["mesh_physics"].asInteger()));
diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index 8f6058a824..963938e20a 100755
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater can_close="true" can_drag_on_left="false" can_minimize="false"
-     can_resize="true" height="550" min_height="550" min_width="620"
-     name="Model Preview" title="Upload Model" width="620"
+     can_resize="true" height="650" min_height="550" min_width="620"
+     name="Model Preview" title="Upload Model" width="840"
       help_topic="upload_model" >
 
   <string name="status_idle">Idle</string>
@@ -25,718 +25,653 @@
   <string name="decomposing">Analyzing...</string>
   <string name="simplifying">Simplifying...</string>
   <string name="tbd">TBD</string>
-  
-
-<!--
-  <text
-	height="65"
-	top_delta="0"
-	left_delta="70"
-	name="price_breakdown_text"
-	width="80"
-	word_wrap="true" 
-	>
-Streaming:
-Physics:
-Instances:
-Textures:
-Model:
-  </text>
-
-  <text
-	height="65"
-	top_delta="0"
-	left_delta="80"
-	name="price_breakdown"
-	width="65"
-	word_wrap="true" 
-	>
-L$ [STREAMING]
-L$ [PHYSICS]
-L$ [INSTANCES]
-L$ [TEXTURES]
-L$ [MODEL]
-  </text>
-    -->
 
 <panel
- follows="all"
- height="515"
- layout="topleft"
- left="3"
- name="left_panel"
- top="0"
- width="305">
-  <tab_container
-    follows="all"
-    top="15"
-    left="0"
-    height="470"
-    width="300"
-    name="import_tab"
-    border="true"
-    tab_position="top">
-
-    <!-- LOD PANEL -->
+  follows="all"
+  height="625"
+  layout="topleft"
+  left="3"
+  name="left_panel"
+  top_pad="10"
+  width="530">
+    <panel
+      follows="all"
+      height="50"
+      layout="top|left"
+      left="3"
+      name="model_name_representation_panel"
+      width="525">
+        <text
+          follows="top|left"
+          layout="topleft"
+          height="15"
+          left="15"
+          name="name_label"
+          top="0"
+          width="290">
+          Name:
+        </text>
+        <line_editor
+          follows="top|left"
+          layout="topleft"
+          height="19"
+          max_length_bytes="64"
+          name="description_form"
+          prevalidate_callback="ascii"
+          top_pad="5"
+          width="290" />
+        <text
+          follows="left|top"
+          height="15"
+          layout="topleft"
+          left_pad="15"
+          name="model_category_label"
+          text_color="White"
+          top="0"
+          width="200">
+          What does this model represent?
+        </text>
+        <combo_box
+          follows="left|top"
+          height="23"
+          left_pad="10"
+          name="model_category_combo"
+          top_pad="10"
+          width="200">
+        <combo_box.drop_down_button
+          label_color="White"/>
+          <combo_item name="Choose one" label="Choose One..." value="MUT_Unspecified"/>
+          <combo_item name="Avatar shape" label="Avatar shape" value="MUT_AvatarShape"/>
+          <combo_item name="Avatar attachment" label="Avatar attachment" value="MUT_AvatarAttachment"/>
+          <combo_item name="Building Component" label="Building Component" value="MUT_BuildingComponent"/>
+          <combo_item name="Moving object (vehicle, animal)" label="Moving object (vehicle, animal)" value="MUT_MovingObject"/>
+          <combo_item name="Large, non moving etc" label="Large, non moving etc" value="MUT_LargeStationary"/>
+          <combo_item name="Smaller, non-moving etc" label="Smaller, non-moving etc" value="MUT_SmallStationary"/>
+          <combo_item name="Not really any of these" label="Not really any of these" value="MUT_Other"/>
+         </combo_box>
+    </panel>
+    <tab_container
+      follows="all"
+      top_pad="15"
+      left="0"
+      height="470"
+      width="525"
+      name="import_tab"
+      border="true"
+      tab_position="top">
+      <!-- LOD PANEL -->
     <panel
       border="true"
       label="Level of Detail"
       name="lod_panel"
       help_topic="upload_model_lod">
-
-      <!-- LOD TABLE-->
-      <panel
-        follows="top|left"
-        name="lod table"
-        left="0"
-        top="0"
-        width="300"
-        height="163"
-        visible="true"
-        border="true"
-        bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
-
-      <text left="10" width="240" bottom="20" height="15" follows="left|top" name="lod_table_header">
-        Select Level of Detail:
-      </text>
-     
-      <text valign="center" halign="center" bg_visible="true" bottom_delta="16" left="75" name="triangles" width="65" height="18" follows="left|top" value="Triangles"/>
-      <text valign="center" halign="center" bg_visible="true" left_pad="0" width="65" name="vertices" height="18" follows="left|top" value="Vertices"/>
-      <text valign="center" halign="center" left_pad="0" name="status" width="65" bg_visible="true" height="18" follows="left|top" value="Status"/>
-      
-      <text valign="center" halign="center" bg_visible="true" name="high_label" left="10" top_pad="0" width="65" height="18" follows="left|top" value="High"/>
-      <text valign="center" halign="center" bg_visible="true" name="high_triangles" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-      <text valign="center" halign="center" bg_visible="true" name="high_vertices" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-      <text valign="center" halign="center" bg_visible="true" name="high_status" left_pad="0" width="65" height="18" follows="left|top" value=""/>
-      <icon height="16" width="16" image_name="lag_status_critical.tga" mouse_opaque="true" name="status_icon_high" left_delta="20" top_delta="0" />
-
-      <text valign="center" halign="center" bg_visible="true" name="medium_label" left="10" top_pad="0" width="65" height="18" follows="left|top" value="Medium"/>
-      <text valign="center" halign="center" bg_visible="true" name="medium_triangles" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-      <text valign="center" halign="center" bg_visible="true" name="medium_vertices" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-      <text valign="center" halign="center" bg_visible="true" name="medium_status" left_pad="0" width="65" height="18" follows="left|top" value=""/>
-      <icon height="16" width="16" image_name="lag_status_critical.tga" mouse_opaque="true" name="status_icon_medium" left_delta="20" top_delta="0" />
-
-      <text valign="center" halign="center" bg_visible="true" name="low_label" left="10" top_pad="0" width="65" height="18" follows="left|top" value="Low"/>
-      <text valign="center" halign="center" bg_visible="true" name="low_triangles" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-      <text valign="center" halign="center" bg_visible="true" name="low_vertices" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-      <text valign="center" halign="center" bg_visible="true" name="low_status" left_pad="0" width="65" height="18" follows="left|top" value=""/>
-      <icon height="16" width="16" image_name="lag_status_critical.tga" mouse_opaque="true" name="status_icon_low" left_delta="20" top_delta="0" />
-
-      <text valign="center" halign="center" bg_visible="true" name="lowest_label" left="10" top_pad="0" width="65" height="18" follows="left|top" value="Lowest"/>
-      <text valign="center" halign="center" bg_visible="true" name="lowest_triangles" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-      <text valign="center" halign="center" bg_visible="true" name="lowest_vertices" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-      <text valign="center" halign="center" bg_visible="true" name="lowest_status" left_pad="0" width="65" height="18" follows="left|top" value=""/>
-      <icon height="16" width="16" image_name="lag_status_critical.tga" mouse_opaque="true" name="status_icon_lowest" left_delta="20" top_delta="0" />
-      
-      <text left="10" width="240" height="15" top_pad="15" follows="left|top" name="lod_table_footer">
-        Level of Detail: [DETAIL]
-      </text>
-
-      <icon height="16" width="16" left="20" follows="left|top" name="lod_status_message_icon"/>
-      <text left_pad="5" width="230" height="28" follows="left|top" top_pad="-15" wrap="true" name="lod_status_message_text"/>
-      </panel>
-
-      <!-- LOD MESH-->
-      <panel
-        follows="top|left"
-        name="mesh"
-        left="0"
-        top_pad="0"
-        width="300"
-        height="237"
-        visible="true"
-        border="true"
-        bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
-
-      <text top_pad="5" left="10" name="mesh_label" height="15" follows="left|top">
-        Mesh
-      </text>
-
-      <radio_group follows="top|left" height="210" left="30" name="lod_file_or_limit" width="240" value="lod_from_file">
-        <radio_item bottom="195" label="Load from file" name="lod_from_file"/>
-        <radio_item bottom="150" label="Auto generate" name="lod_auto_generate"/>
-        <radio_item bottom="0" label="None" name="lod_none"/>
-      </radio_group>
-
-      <line_editor follows="left|top" bottom_delta="-170" width="140" left="45" value="" name="lod_file" height="20"/>
-      <button bottom_delta="3" name="lod_browse" label="Browse..." left_pad="5" follows="left|top" width="70" height="25"/>
-
-      <combo_box follows="top|left" name="lod_mode" top_pad="22" width="100" left="45" height="20">
-        <combo_item name="triangle_limit">
-          Triangle Limit
-        </combo_item>
-        <combo_item name="error_threshold">
-          Error Threshold
-        </combo_item>
-      </combo_box>
-      <spinner follows="top|left" name="lod_triangle_limit" increment="10" left_pad="5" height="20" width="100" decimal_digits="0" enabled="true"/>
-      <spinner left_delta="0" bottom_delta="0" increment="0.01"  follows="top|left" name="lod_error_threshold" min_val="0" max_val="100" height="20" width="100" decimal_digits="3" visible="false" enabled="true"/>
-
-      <text follows="top|left" name="build_operator_text" left="45" top_pad="10" width="100" height="15" text_readonly_color="LabelDisabledColor">
-        Build Operator:  
-      </text>
-      <text follows="top|left" name="queue_mode_text" left_pad="5" width="100" height="15" text_readonly_color="LabelDisabledColor">
-        Queue Mode:
-      </text>
-      <combo_box follows="top|left" name="build_operator" top_pad="5" left="45" width="100" height="20">
-        <combo_item name="edge_collapse">
-          Edge Collapse
-        </combo_item>
-        <combo_item name="half_edge_collapse">
-          Half Edge Collapse
-        </combo_item>
-      </combo_box>
-
-      <combo_box follows="top|left" name="queue_mode" left_pad="5" width="100" height="20">
-        <combo_item name="greedy">
-          Greedy
-        </combo_item>
-        <combo_item name="lazy">
-          Lazy
-        </combo_item>
-        <combo_item name="independent">
-          Independent
-        </combo_item>
-      </combo_box>
-
-      <text top_pad="10" name="border_mode_text" left="45" follows="left|top" width="100" height="15" text_readonly_color="LabelDisabledColor">
-        Border Mode:
-      </text>
-
-      <text left_pad="5" name="share_tolderance_text"  follows="left|top" width="100" height="15" text_readonly_color="LabelDisabledColor">
-        Share Tolerance:
-      </text>
-
-      <combo_box follows="left|top" left="45" height="20" name="border_mode" width="100">
-        <combo_item name="border_unlock">
-          Unlock
-        </combo_item>
-        <combo_item name="border_lock">
-          Lock
-        </combo_item>
-      </combo_box>
-      <spinner follows="left|top" name="share_tolerance" left_pad="5" width="100" decimal_digits="5" initial_value="0.00001" height="20"/>
-      </panel>
-
-      <!-- LOD GENERATE NORMALS-->
-      <panel
-        follows="top|left"
-        name="generate normals"
-        left="0"
-        top_pad="0"
-        width="300"
-        height="46"
-        visible="true"
-        border="true"
-        bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
-
-      <text left="10" name="gen_normals_label" top_pad="5" follows="top|left" width="240" height="15">
-        Generate Normals
-      </text>
-      <text left="35" top_pad="5" follows="top|left" width="100" height="15" name="crease_label">
-        Crease Angle:
-      </text>
-      <spinner follows="top|left" left_pad="5" min_val="0" max_val="180" value="75" width="60" height="20" name="crease_angle"/>  
-      </panel>
+    <!-- LOD TABLE-->
+    <panel
+      follows="top|left"
+      name="lod table"
+      left="0"
+      top="0"
+      width="300"
+      height="163"
+      visible="true"
+      border="true"
+      bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
+    
+    <text left="10" width="240" bottom="20" height="15" follows="left|top" name="lod_table_header">
+      Select Level of Detail:
+    </text>
+    
+    <text valign="center" halign="center" bg_visible="true" bottom_delta="16" left="75" name="triangles" width="65" height="18" follows="left|top" value="Triangles"/>
+    <text valign="center" halign="center" bg_visible="true" left_pad="0" width="65" name="vertices" height="18" follows="left|top" value="Vertices"/>
+    <text valign="center" halign="center" left_pad="0" name="status" width="65" bg_visible="true" height="18" follows="left|top" value="Status"/>
+    
+    <text valign="center" halign="center" bg_visible="true" name="high_label" left="10" top_pad="0" width="65" height="18" follows="left|top" value="High"/>
+    <text valign="center" halign="center" bg_visible="true" name="high_triangles" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
+    <text valign="center" halign="center" bg_visible="true" name="high_vertices" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
+    <text valign="center" halign="center" bg_visible="true" name="high_status" left_pad="0" width="65" height="18" follows="left|top" value=""/>
+    <icon height="16" width="16" image_name="lag_status_critical.tga" mouse_opaque="true" name="status_icon_high" left_delta="20" top_delta="0" />
+    
+    <text valign="center" halign="center" bg_visible="true" name="medium_label" left="10" top_pad="0" width="65" height="18" follows="left|top" value="Medium"/>
+    <text valign="center" halign="center" bg_visible="true" name="medium_triangles" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
+    <text valign="center" halign="center" bg_visible="true" name="medium_vertices" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
+    <text valign="center" halign="center" bg_visible="true" name="medium_status" left_pad="0" width="65" height="18" follows="left|top" value=""/>
+    <icon height="16" width="16" image_name="lag_status_critical.tga" mouse_opaque="true" name="status_icon_medium" left_delta="20" top_delta="0" />
+    
+    <text valign="center" halign="center" bg_visible="true" name="low_label" left="10" top_pad="0" width="65" height="18" follows="left|top" value="Low"/>
+    <text valign="center" halign="center" bg_visible="true" name="low_triangles" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
+    <text valign="center" halign="center" bg_visible="true" name="low_vertices" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
+    <text valign="center" halign="center" bg_visible="true" name="low_status" left_pad="0" width="65" height="18" follows="left|top" value=""/>
+    <icon height="16" width="16" image_name="lag_status_critical.tga" mouse_opaque="true" name="status_icon_low" left_delta="20" top_delta="0" />
+    
+    <text valign="center" halign="center" bg_visible="true" name="lowest_label" left="10" top_pad="0" width="65" height="18" follows="left|top" value="Lowest"/>
+    <text valign="center" halign="center" bg_visible="true" name="lowest_triangles" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
+    <text valign="center" halign="center" bg_visible="true" name="lowest_vertices" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
+    <text valign="center" halign="center" bg_visible="true" name="lowest_status" left_pad="0" width="65" height="18" follows="left|top" value=""/>
+    <icon height="16" width="16" image_name="lag_status_critical.tga" mouse_opaque="true" name="status_icon_lowest" left_delta="20" top_delta="0" />
+    
+    <text left="10" width="240" height="15" top_pad="15" follows="left|top" name="lod_table_footer">
+      Level of Detail: [DETAIL]
+    </text>
+    
+    <icon height="16" width="16" left="20" follows="left|top" name="lod_status_message_icon"/>
+    <text left_pad="5" width="230" height="28" follows="left|top" top_pad="-15" wrap="true" name="lod_status_message_text"/>
     </panel>
-
-    <!--  PANEL -->
+    
+    <!-- LOD MESH-->
     <panel
+      follows="top|left"
+      name="mesh"
+      left="0"
+      top_pad="0"
+      width="300"
+      height="237"
+      visible="true"
       border="true"
-      label="Physics"
-      name="physics_panel"
-      help_topic="upload_model_physics">
-
-      <!-- PHYSICS GEOMETRY-->
+      bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
+    
+    <text top_pad="5" left="10" name="mesh_label" height="15" follows="left|top">
+      Mesh
+    </text>
+    
+    <radio_group follows="top|left" height="210" left="30" name="lod_file_or_limit" width="240" value="lod_from_file">
+      <radio_item bottom="195" label="Load from file" name="lod_from_file"/>
+      <radio_item bottom="150" label="Auto generate" name="lod_auto_generate"/>
+      <radio_item bottom="0" label="None" name="lod_none"/>
+    </radio_group>
+    
+    <line_editor follows="left|top" bottom_delta="-170" width="140" left="45" value="" name="lod_file" height="20"/>
+    <button bottom_delta="3" name="lod_browse" label="Browse..." left_pad="5" follows="left|top" width="70" height="25"/>
+    
+    <combo_box follows="top|left" name="lod_mode" top_pad="22" width="100" left="45" height="20">
+      <combo_item name="triangle_limit">
+        Triangle Limit
+      </combo_item>
+      <combo_item name="error_threshold">
+        Error Threshold
+      </combo_item>
+    </combo_box>
+    <spinner follows="top|left" name="lod_triangle_limit" increment="10" left_pad="5" height="20" width="100" decimal_digits="0" enabled="true"/>
+    <spinner left_delta="0" bottom_delta="0" increment="0.01"  follows="top|left" name="lod_error_threshold" min_val="0" max_val="100" height="20" width="100" decimal_digits="3" visible="false" enabled="true"/>
+    
+    <text follows="top|left" name="build_operator_text" left="45" top_pad="10" width="100" height="15" text_readonly_color="LabelDisabledColor">
+      Build Operator:  
+    </text>
+    <text follows="top|left" name="queue_mode_text" left_pad="5" width="100" height="15" text_readonly_color="LabelDisabledColor">
+      Queue Mode:
+    </text>
+    <combo_box follows="top|left" name="build_operator" top_pad="5" left="45" width="100" height="20">
+      <combo_item name="edge_collapse">
+        Edge Collapse
+      </combo_item>
+      <combo_item name="half_edge_collapse">
+        Half Edge Collapse
+      </combo_item>
+    </combo_box>
+    
+    <combo_box follows="top|left" name="queue_mode" left_pad="5" width="100" height="20">
+      <combo_item name="greedy">
+        Greedy
+      </combo_item>
+      <combo_item name="lazy">
+        Lazy
+      </combo_item>
+      <combo_item name="independent">
+        Independent
+      </combo_item>
+    </combo_box>
+    
+    <text top_pad="10" name="border_mode_text" left="45" follows="left|top" width="100" height="15" text_readonly_color="LabelDisabledColor">
+      Border Mode:
+    </text>
+    
+    <text left_pad="5" name="share_tolderance_text"  follows="left|top" width="100" height="15" text_readonly_color="LabelDisabledColor">
+      Share Tolerance:
+    </text>
+    
+    <combo_box follows="left|top" left="45" height="20" name="border_mode" width="100">
+      <combo_item name="border_unlock">
+        Unlock
+      </combo_item>
+      <combo_item name="border_lock">
+        Lock
+      </combo_item>
+    </combo_box>
+    <spinner follows="left|top" name="share_tolerance" left_pad="5" width="100" decimal_digits="5" initial_value="0.00001" height="20"/>
+    </panel>
+    
+    <!-- LOD GENERATE NORMALS-->
+    <panel
+      follows="top|left"
+      name="generate normals"
+      left="0"
+      top_pad="0"
+      width="300"
+      height="46"
+      visible="true"
+      border="true"
+      bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
+    
+    <text left="10" name="gen_normals_label" top_pad="5" follows="top|left" width="240" height="15">
+      Generate Normals
+    </text>
+    <text left="35" top_pad="5" follows="top|left" width="100" height="15" name="crease_label">
+      Crease Angle:
+    </text>
+    <spinner follows="top|left" left_pad="5" min_val="0" max_val="180" value="75" width="60" height="20" name="crease_angle"/>  
+    </panel>
+      </panel>
+      <!-- PHYSYCS PANEL -->
       <panel
-        follows="top|left"
-        name="physics geometry"
-        left="0"
-        top="0"
-        width="300"
-        height="65"
-        visible="true"
         border="true"
-        bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
-
-        <radio_group follows="top|left" top="10" width="240" height="40" name="physics_load_radio" value="physics_load_from_file">
-          <radio_item bottom="0" name="physics_load_from_file" label="File:"/>
-          <radio_item bottom="23" name="physics_use_lod" label="Use Level of Detail:"/>
-        </radio_group>
-
-        <combo_box left="150" top="10" follows="left|top" height="18"
-	        name="physics_lod_combo" width="130" tool_tip="LOD to use for physics shape">
-          <combo_item name="physics_lowest">
-            Lowest
-          </combo_item>
-          <combo_item name="physics_low">
-            Low
-          </combo_item>
-          <combo_item name="physics_medium">
-            Medium
-          </combo_item>
-          <combo_item name="physics_high">
-            High
-          </combo_item>
-        </combo_box>
-
-        <line_editor follows="left|top" top_pad="5" width="140" left="60" value="" name="physics_file" height="20"/>
-        <button left_pad="10" name="physics_browse" label="Browse..." follows="left|top" width="70" height="20"/>
-
-        <!--
-        <check_box name="physics_optimize" follows="left|top" width="130" left="10" top_pad="5" height="20" label="Optimize"/>
-        <check_box name="physics_use_hull" follows="left|top" width="130" left_pad="5" height="20" label="Use Convex Hull"/>
-        -->
-     </panel>
-
-
-      <!-- PHYSICS ANALYSIS-->
-      <panel
-       follows="top|left"
-       name="physics analysis"
-       top_pad="0"
-       left="0"
-       width="300"
-       height="130"
-       visible="true"
-       border="true"
-       bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
-
-        <text follows="left|top" bottom="40" height="30" left="10" name="method_label" font="SansSerifBig">
-          Step 1: Analysis
-        </text>
+        label="Physics"
+        name="physics_panel"
+        help_topic="upload_model_physics">
+    
+        <!-- PHYSICS GEOMETRY-->
+        <panel
+          follows="top|left"
+          name="physics geometry"
+          left="0"
+          top="0"
+          width="300"
+          height="65"
+          visible="true"
+          border="true"
+          bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
+    
+          <radio_group follows="top|left" top="10" width="240" height="40" name="physics_load_radio" value="physics_load_from_file">
+            <radio_item bottom="0" name="physics_load_from_file" label="File:"/>
+            <radio_item bottom="23" name="physics_use_lod" label="Use Level of Detail:"/>
+          </radio_group>
+    
+          <combo_box left="150" top="10" follows="left|top" height="18"
+ 	         name="physics_lod_combo" width="130" tool_tip="LOD to use for physics shape">
+            <combo_item name="physics_lowest">
+              Lowest
+            </combo_item>
+            <combo_item name="physics_low">
+              Low
+            </combo_item>
+            <combo_item name="physics_medium">
+              Medium
+            </combo_item>
+            <combo_item name="physics_high">
+              High
+            </combo_item>
+          </combo_box>
+    
+          <line_editor follows="left|top" top_pad="5" width="140" left="60" value="" name="physics_file" height="20"/>
+          <button left_pad="10" name="physics_browse" label="Browse..." follows="left|top" width="70" height="20"/>
+    
+          <!--
+          <check_box name="physics_optimize" follows="left|top" width="130" left="10" top_pad="5" height="20" label="Optimize"/>
+          <check_box name="physics_use_hull" follows="left|top" width="130" left_pad="5" height="20" label="Use Convex Hull"/>
+          -->
+       </panel>
+    
+    
+        <!-- PHYSICS ANALYSIS-->
+        <panel
+         follows="top|left"
+         name="physics analysis"
+         top_pad="0"
+         left="0"
+         width="300"
+         height="130"
+         visible="true"
+         border="true"
+         bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
+    
+          <text follows="left|top" bottom="40" height="30" left="10" name="method_label" font="SansSerifBig">
+            Step 1: Analysis
+          </text>
+          
+          <text name="analysis_method_label" top_pad="5" width="50" follows="top|left" height="15">
+            Method:
+          </text>
+          <combo_box name="Method" follows="top|left" left_pad="5" bottom_delta="2" height="20" width="80"/>
+          <text left="160" name="quality_label" bottom_delta="-2" width="50" follows="top|left" height="15">
+            Quality:
+          </text>
+          <combo_box name="Decompose Quality" bottom_delta="2" follows="top|left" left_pad="5" height="20" width="80"/>
+    
+          <slider name="Smooth" left="10" width="280" follows="top|left" top_pad="10" height="20" label="Smooth:"/>
+    
+          <check_box name="Close Holes (Slow)" follows="top|left" top_pad="10" height="15" label="Close Holes (slow)"/>
+                  
+          <button left="200" bottom_delta="0" width="90" follows="top|left" label="Analyze" name="Decompose" height="20"/>
+          <button left="200" bottom_delta="0" width="90" follows="top|left" label="Cancel" name="decompose_cancel" visble="false" height="20"/>
+        </panel>
         
-        <text name="analysis_method_label" top_pad="5" width="50" follows="top|left" height="15">
-          Method:
-        </text>
-        <combo_box name="Method" follows="top|left" left_pad="5" bottom_delta="2" height="20" width="80"/>
-        <text left="160" name="quality_label" bottom_delta="-2" width="50" follows="top|left" height="15">
-          Quality:
-        </text>
-        <combo_box name="Decompose Quality" bottom_delta="2" follows="top|left" left_pad="5" height="20" width="80"/>
-
-        <slider name="Smooth" left="10" width="280" follows="top|left" top_pad="10" height="20" label="Smooth:"/>
-
-        <check_box name="Close Holes (Slow)" follows="top|left" top_pad="10" height="15" label="Close Holes (slow)"/>
-                
-        <button left="200" bottom_delta="0" width="90" follows="top|left" label="Analyze" name="Decompose" height="20"/>
-        <button left="200" bottom_delta="0" width="90" follows="top|left" label="Cancel" name="decompose_cancel" visble="false" height="20"/>
+    
+        <!-- PHYSICS SIMPLIFICATION -->
+       <panel
+         follows="top|left"
+         name="physics simplification"
+         left="0"
+         top_pad="0"
+         width="300"
+         height="150"
+         visible="true"
+         border="true"
+         bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
+    
+          <text follows="left|top" bottom="40" height="30" left="10" name="second_step_label" font="SansSerifBig">
+            Step 2: Simplification
+          </text>
+    
+          <text left="10" name="simp_method_header" top_pad="5" height="15" width="140" follows="top|left">
+            Method:
+          </text>
+          
+          <combo_box left_pad="5" height="20" width="120" follows="top|left" name="Simplify Method"/>
+    
+          <slider left="10" name="Combine Quality" label="Passes:" label_width="120" width="270" follows="top|left" top_pad="10" height="20"/>
+          <slider name="Detail Scale" label="Detail Scale:" label_width="120" width="270" follows="top|left" top_pad="10" height="20"/>
+          <slider name="Retain%" label="Retain:" label_width="120" width="270" follows="top|left" bottom_delta="0" left_delta="0" visible="false" height="20"/>
+          <button left="190" width="90" follows="top|left" label="Simplify" name="Simplify" height="20"/>
+          <button left="190" bottom_delta="0" width="90" follows="top|left" label="Cancel" name="simplify_cancel" height="20"/>
+          
+        </panel>
+    
+        <!-- INFO PANEL -->
+        <panel
+          left="0"
+          top_pad="0"
+          width="300"
+          height="100"
+          follows="left|top"
+          name="physics info"
+          visible="true"
+          border="true" 
+          bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
+          
+          <text follows="top|left" name="physics_triangles" top_pad="10" height="15" left="10">
+            Triangles: [TRIANGLES]
+          </text>
+          <text follows="top|left" name="physics_points" top_pad="5" height="15">
+            Vertices: [POINTS]
+          </text>
+          <text follows="top|left" name="physics_hulls" top_pad="5" height="15">
+            Hulls: [HULLS]
+          </text>
+    
+    
+        </panel>
       </panel>
-      
-
-      <!-- PHYSICS SIMPLIFICATION -->
-     <panel
-       follows="top|left"
-       name="physics simplification"
-       left="0"
-       top_pad="0"
-       width="300"
-       height="150"
-       visible="true"
-       border="true"
-       bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
-
-        <text follows="left|top" bottom="40" height="30" left="10" name="second_step_label" font="SansSerifBig">
-          Step 2: Simplification
-        </text>
-
-        <text left="10" name="simp_method_header" top_pad="5" height="15" width="140" follows="top|left">
-          Method:
-        </text>
-        
-        <combo_box left_pad="5" height="20" width="120" follows="top|left" name="Simplify Method"/>
-
-        <slider left="10" name="Combine Quality" label="Passes:" label_width="120" width="270" follows="top|left" top_pad="10" height="20"/>
-        <slider name="Detail Scale" label="Detail Scale:" label_width="120" width="270" follows="top|left" top_pad="10" height="20"/>
-        <slider name="Retain%" label="Retain:" label_width="120" width="270" follows="top|left" bottom_delta="0" left_delta="0" visible="false" height="20"/>
-        <button left="190" width="90" follows="top|left" label="Simplify" name="Simplify" height="20"/>
-        <button left="190" bottom_delta="0" width="90" follows="top|left" label="Cancel" name="simplify_cancel" height="20"/>
-        
-      </panel>
-
-      <!-- INFO PANEL -->
+      <!-- MODIFIERS PANEL -->
       <panel
-        left="0"
-        top_pad="0"
-        width="300"
-        height="100"
-        follows="left|top"
-        name="physics info"
-        visible="true"
-        border="true" 
-        bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
-
-        <slider name="physics_explode" follows="top|left" top="10" left="10" label="Preview Spread:" min_val="0.0" max_val="3.0" height="20" width="280"/>
-        
-        <text follows="top|left" name="physics_triangles" top_pad="10" height="15" left="10">
-          Triangles: [TRIANGLES]
-        </text>
-        <text follows="top|left" name="physics_points" top_pad="5" height="15">
-          Vertices: [POINTS]
-        </text>
-        <text follows="top|left" name="physics_hulls" top_pad="5" height="15">
-          Hulls: [HULLS]
-        </text>
-
-
+       border="true"
+       label="Modifiers"
+       name="modifiers_panel"
+       help_topic="upload_model_modifiers">
+         <text left="10" name="scale_label" width="90" bottom="30" follows="top|left" height="15">
+           Scale:
+         </text>
+         <text left_pad="5" name="dimensions_label" width="140" follows="top|left" height="15">
+           Dimensions:
+         </text>
+         
+         <spinner left="10" height="20" follows="top|left" width="80" top_pad="5" value="1.0" min_val="0.01" max_val="64.0" name="import_scale"/>
+         
+         <text left_pad="20" height="15" width="140" name="import_dimensions" follows="top|left">
+           [X] x [Y] x [Z] m
+         </text>
+         
+         <text left="10" name="include_label" top_pad="20" follows="top|left" height="15">
+           Include:
+         </text>
+         
+         <check_box top_pad="5" name="upload_textures" height="15" follows="top|left" label="Textures"/>
+         <check_box top_pad="5" name="upload_skin" height="15" follows="top|left" label="Skin weight"/>
+         <check_box top_pad="5" left="20" name="upload_joints" height="15" follows="top|left" label="Joint positions"/>
+         
+         <text left="10" name="pelvis_offset_label" top_pad="4" width="90" bottom="30" follows="top|left" height="15">
+           Pelvis Z Offset:
+         </text>
+         
+         <spinner left="10" top_pad="4" height="20" follows="top|left" width="80" value="0.0" min_val="-3.00" max_val="3.0" name="pelvis_offset"/>
       </panel>
-    </panel>
-
-    <!-- MODIFIERS PANEL -->
+    </tab_container>
     <panel
-      border="true"
-      label="Modifiers"
-      name="modifiers_panel"
-      help_topic="upload_model_modifiers">
-
-      <text left="10" name="scale_label" width="90" bottom="30" follows="top|left" height="15">
-        Scale:
-      </text>
-      <text left_pad="5" name="dimensions_label" width="140" follows="top|left" height="15">
-        Dimensions:
-      </text>
-
-      <spinner left="10" height="20" follows="top|left" width="80" top_pad="5" value="1.0" min_val="0.01" max_val="64.0" name="import_scale"/>
-
-      <text left_pad="20" height="15" width="140" name="import_dimensions" follows="top|left">
-        [X] x [Y] x [Z] m
-      </text>
-
-      <text left="10" name="include_label" top_pad="20" follows="top|left" height="15">
-        Include:
-      </text>
-
-      <check_box top_pad="5" name="upload_textures" height="15" follows="top|left" label="Textures"/>
-      <check_box top_pad="5" name="upload_skin" height="15" follows="top|left" label="Skin weight"/>
-      <check_box top_pad="5" left="20" name="upload_joints" height="15" follows="top|left" label="Joint positions"/>
-
-      <text left="10" name="pelvis_offset_label" top_pad="4" width="90" bottom="30" follows="top|left" height="15">
-        Pelvis Z Offset:
-      </text>
-
-      <spinner left="10" top_pad="4" height="20" follows="top|left" width="80" value="0.0" min_val="-3.00" max_val="3.0" name="pelvis_offset"/>
-
+     follows="all"
+     height="80"
+     layout="top|left"
+     left="3"
+     name="weights_and_warning_panel"
+     top_pad="3"
+     width="525">
+       <button
+         follows="top|left"
+         label="Calculate weights &amp; fee"
+         layout="topleft"
+         left="3"
+         name="calculate_btn"
+         top="3"
+         height="20"
+         width="150"
+         tool_tip="Calculate weights &amp;fee"/>
+       <button
+         follows="top|left"
+         label="Cancel"
+         layout="topleft"
+         left_pad="6"
+         name="cancel_btn"
+         top="3"
+         height="20"
+         width="80"/>
+       <button
+         follows="top|left"
+         label="Upload"
+         layout="topleft"
+         left="35"
+         name="ok_btn"
+         top="3"
+         height="20"
+         visible="false"
+         width="80"
+         tool_tip="Upload to simulator"/>
+       <button
+         follows="top|right"
+         label="Clear settings &amp; reset form"
+         layout="topleft"
+         name="reset_btn"
+         right="-2"
+         top="3"
+         height="20"
+         width="155"/>
+       <!-- ========== WEIGHTS ==========-->
+       <text
+         follows="top|left"
+         height="15"
+         layout="topleft"
+         left="5"
+         name="upload_fee"
+         top_pad="8"
+         width="130"
+         word_wrap="true">
+         Upload fee: L$ [FEE]
+       </text>
+       <text
+         height="15"
+         layout="topleft"
+         left_pad="0"
+         name="prim_weight"
+         top_delta="0"
+         width="120"
+         word_wrap="true">
+         Land impact: [EQ]
+       </text>
+       <text
+         height="15"
+         layout="topleft"
+         left_pad="0"
+         name="download_weight"
+         top_delta="0"
+         width="100"
+         word_wrap="true">
+         Download: [ST]
+       </text>
+       <text
+         height="15"
+         top_delta="0"
+         layout="topleft"
+         left_pad="0"
+         name="physics_weight"
+         width="90"
+         word_wrap="true">
+         Physics: [PH]
+       </text>
+       <text
+         height="15"
+         top_delta="0"
+         layout="topleft"
+         left_pad="0"
+         name="server_weight"
+         width="83"
+         word_wrap="true">
+         Server: [SIM]
+       </text>
+       <!-- ========== NOTE MESSAGE ========== -->
+       <text
+         font="SansSerif"
+         layout="topleft"
+         left="6"
+         name="warning_title"
+         top_pad="10"
+         text_color="Yellow"
+         visible="true"
+         width="40">
+         NOTE:
+       </text>
+       <text
+         text_color="White"
+         height="20"
+         layout="topleft"
+         left_pad="1"
+         name="warning_message"
+         parse_urls="true"
+         top_delta="0"
+         wrap="true"
+         width="462"
+         visible="true">
+         You dont have rights to upload mesh models. [[VURL] Find out how] to get certified.
+       </text>
     </panel>
-  </tab_container>
-
-  <text
-	height="16"
-	left_delta="5"
-	bottom_delta="30"
-	name="upload_fee"
-	width="300"
-	follows="bottom|right"
-	word_wrap="true" 
-	>
-	    Upload fee: L$ [FEE]
-  </text>
-  </panel>
+</panel>
 
+<text 
+ follows="left|top"
+ layout="topleft"
+ left="540"
+ name="lod_label"
+ top="13"
+ height="15"
+ width="290">
+ Preview:
+ </text>
 <panel
+ border="true"
+ bevel_style="none"
  follows="all"
- height="515"
- layout="topleft"
- left_pad="1"
- name="right_panel"
- top="0"
- width="310">
-
-  <text left="15" bottom="25" follows="top|left" height="15" name="name_label">
-    Name:
-  </text>
-  <line_editor bottom_delta="20" follows="top|left|right" height="19" max_length_bytes="64"
-	     name="description_form" prevalidate_callback="ascii" width="290" />
-
-  <text bottom_delta="20" left="15" follows="left|top" height="15" name="model_category_label" text_color="White">
-    What does this model represent?
-  </text>
-  <combo_box top_pad="1" follows="left|top" height="23"
-	     name="model_category_combo"  width="200">
-    <combo_box.drop_down_button
-      label_color="White"/>
-    <combo_item name="Choose one" label="Choose One..." value="MUT_Unspecified"/>
-    <combo_item name="Avatar shape" label="Avatar shape" value="MUT_AvatarShape"/>
-    <combo_item name="Avatar attachment" label="Avatar attachment" value="MUT_AvatarAttachment"/>
-    <combo_item name="Building Component" label="Building Component" value="MUT_BuildingComponent"/>
-    <combo_item name="Moving object (vehicle, animal)" label="Moving object (vehicle, animal)" value="MUT_MovingObject"/>
-    <combo_item name="Large, non moving etc" label="Large, non moving etc" value="MUT_LargeStationary"/>
-    <combo_item name="Smaller, non-moving etc" label="Smaller, non-moving etc" value="MUT_SmallStationary"/>
-    <combo_item name="Not really any of these" label="Not really any of these" value="MUT_Other"/>
-  </combo_box>
-  
-  <text bottom_delta="20" left="15" follows="left|top" height="15" name="lod_label">
-    Preview:
-  </text>
-  <combo_box bottom_delta="20" follows="left|top" height="18"
-	     name="preview_lod_combo" width="240" tool_tip="LOD to view in preview render">
-    <combo_item name="high">
-      Level of Detail: High
-    </combo_item>
-    <combo_item name="medium">
-      Level of Detail: Medium
-    </combo_item>
-    <combo_item name="low">
-      Level of Detail: Low
-    </combo_item>
-    <combo_item name="lowest">
-      Level of Detail: Lowest
-    </combo_item>
-  </combo_box>
-
-    <menu_button follows="top|left"
-         image_hover_unselected="Toolbar_Left_Over"
-         image_overlay="OptionsMenu_Off"
-         image_selected="Toolbar_Left_Selected"
-         image_unselected="Toolbar_Left_Off"
-         layout="topleft"
-         left_pad="5"
-         name="options_gear_btn"
-         width="31"
-         height="25"/>
-  <!-- Placeholder panel for 3D preview render -->
-  <!--<panel
-    name="preview_panel"
-    left="15"
-    bevel_style="none"
-    border_style="line"
-    border="true"
-    width="290"
-    height="290"
-    follows="all"/>-->
+ name="preview_panel"
+ top_pad="4"
+ width="290"
+ height="290"/>
 
+<panel
+  follows="all"
+  height="130"
+  layout="topleft"
+  name="right_panel"
+  top_pad="5"
+  width="290">
+    <combo_box
+      top_pad="3"
+      follows="left|top"
+      height="18"
+      layout="topleft"
+      name="preview_lod_combo"
+      width="120"
+      tool_tip="LOD to view in preview render">
+        <combo_item name="high">   High  LoD   </combo_item>
+        <combo_item name="medium"> Medium LoD  </combo_item>
+        <combo_item name="low">    Low LoD     </combo_item>
+        <combo_item name="lowest"> Lowest  LoD </combo_item>
+    </combo_box>
+    <menu_button
+      follows="top|left"
+      image_hover_unselected="Toolbar_Left_Over"
+      image_overlay="OptionsMenu_Off"
+      image_selected="Toolbar_Left_Selected"
+      image_unselected="Toolbar_Left_Off"
+      layout="topleft"
+      left_pad="5"
+      top_delta="0"
+      name="options_gear_btn"
+      width="31"
+      height="25"/>
     <text
-     font="SansSerif"
-	 bottom_delta="305"
-     left="15"
-     name="warning_title"
-     text_color="Yellow"
-     visible="true">
-     WARNING:
+      follows="top|left"
+      layout="topleft"
+      top="5"
+      left_pad="10"
+      name="label_display"
+      width="50">
+      Display...
     </text>
+    <check_box
+      follows="top|left"
+      label="Edges"
+      layout="topleft"
+      left_delta="0"
+      name="disp_edges_chb"
+      top_pad="8">
+    </check_box>
+    <check_box
+      follows="top|left"
+      label="Physics"
+      layout="topleft"
+      name="disp_physics_chb"
+      top_pad="8">
+    </check_box>
+    <check_box
+      follows="top|left"
+      label="Textures"
+      layout="topleft"
+      name="disp_textures_chb"
+      top_pad="8">
+    </check_box>
+    <check_box
+      follows="top|left"
+      label="Skin weights"
+      layout="topleft"
+      name="disp_skin_chb"
+      top_pad="8">
+    </check_box>
+    <check_box
+      follows="top|left"
+      label="Joints"
+      layout="topleft"
+      name="disp_joints_chb"
+      top_pad="8">
+    </check_box>
     <text
-     text_color="White"
-     height="40"
-	 width="290"
-	 top_delta="15"
-     left_delta="0"
-     name="warning_message"
-     parse_urls="true"
-     wrap="true"
-     visible="true">
-     You will not be able to complete the final upload of this model to the Second Life servers. [[VURL] Find out how] to get enabled for mesh model uploads.</text>
-
-  <text
-	height="26"
-	top_pad="5"
-	left_delta="0"
-	name="weights_text_left"
-	width="80"
-	word_wrap="true"
-	>
-Download:
-Physics:
-  </text>
-  <text
-	height="26"
-	top_delta="0"
-	left_pad="0"
-	name="weights_left"
-	width="70"
-	word_wrap="true"
-	>
-[ST]
-[PH]
-  </text>
-  <text
-	height="26"
-	top_delta="0"
-	left_pad="0"
-	name="weights_text_right"
-	width="80"
-	word_wrap="true"
-	>
-Server:
-Prim equivs:
-  </text>
-  <text
-	height="26"
-	top_delta="0"
-	left_pad="0"
-	name="weights_right"
-	width="70"
-	word_wrap="true" 
-	>
-[SIM]
-[EQ]
-  </text>
-</panel>
-
-<panel
- follows="bottom|left|right"
- height="33"
- layout="topleft"
- left="0"
- name="bottom_buttons_panel"
- top_pad="1"
- width="610">   
-  <button top="3" left="10"  follows="bottom|left" height="20" label="Set to defaults" width="100" name="reset_btn" tool_tip="Set to defaults"/>
-  <button top="3" left="310"  follows="bottom|right" height="20" label="Calculate weights &amp; fee" width="150" name="calculate_btn" tool_tip="Calculate weights &amp; fee"/>
-  <button top="3" left_delta="0"  follows="bottom|right" height="20" label="Upload" width="80" name="ok_btn" tool_tip="Upload to simulator" visible="false"/>
-  <button top="3" right="-10" follows="right|bottom" height="20" width="80" label="Cancel" name="cancel_btn"/>
+      follows="top|left"
+      layout="topleft"
+      left="2"
+      name="physics_explode_label"
+      top="85">
+      Preview Spread:
+    </text>
+    <slider
+      name="physics_explode"
+      follows="top|left"
+      top="100"
+      left="0"
+      min_val="0.0"
+      max_val="3.0"
+      height="20"
+      width="150"/>
 </panel>
-  
-<panel
- name="preview_panel"
- left="320"
- top="131"
- bevel_style="none"
- border_style="line"
- border="true"
- width="290"
- height="290"
- follows="all"/>  
-  
-  <!--
-  <button bottom_delta="0" left="10" width="120" name="auto fill" label="Generate LOD" tool_tip="Automatically generate levels of detail"/>
-  <button bottom_delta="0" left="140" width="120" name="smooth normals" label="Generate Normals" tool_tip="Regenerate normals based on mesh shape"/>
-  <button bottom_delta="0" left="260" width="120" name="consolidate" label="Consolidate" tool_tip="Combine similar submeshes (reduces number of submeshes)"/>
-  <button bottom_delta="30" left="260" width="120" name="scrub materials" label="Scrub Materials" tool_tip="Remove all material information (clear textures, set all colors to white)."/>
-  
-  <spinner bottom_delta="0" left="140" width="120" height="16" initial_value="75" label_width="60" name="edge threshold" decimal_digits="0" min_val="0" max_val="180" increment="5" label="Hard Angle" tool_tip="Maximum angle that will be smoothed between triangles when using Generate Normals"/>
-
-  <text bottom_delta="30" follows="top|left" height="15" left="10" name="high_lod_label">
-    High LOD:
-  </text>
-  <combo_box bottom_delta="0" left="97" follows="left|top" height="18" 
-             name="high detail combo" width="100" tool_tip="Specify mesh for this level of detail">
-    <combo_item name="high none" value="none">
-      None
-    </combo_item>
-    <combo_item name="high choose file" value="file">
-      Choose File...
-    </combo_item>
-    <combo_item name="high triangle limit" value="limit">
-      Triangle Limit
-    </combo_item>
-  </combo_box>
-  <spinner bottom_delta="-5" left="200" width="120"  name="high limit" decimal_digits="0" increment="1" min_val="0" max_val="100" tool_tip="Triangle budget for this LOD"/>
-  <text bottom_delta="25" follows="top|left" height="15" left="10" name="high info" width="300">
-    [TRIANGLES] Triangles, [VERTICES] Vertices, [SUBMESHES] Submeshes.  
-    [MESSAGE]
-  </text>
-
-  <text bottom_delta="35" follows="top|left" height="15" left="10" name="medium_lod_label">
-    Medium LOD:
-  </text>
-  <combo_box bottom_delta="0" left="97" follows="left|top" height="18"
-             name="medium detail combo" width="100" tool_tip="Specify mesh for this level of detail">
-    <combo_item name="medium none" value="none">
-      None
-    </combo_item>
-    <combo_item name="medium choose file" value="file">
-      Choose File...
-    </combo_item>
-    <combo_item name="medium triangle limit" value="limit">
-      Triangle Limit
-    </combo_item>
-  </combo_box>
-  <spinner bottom_delta="-5" left="200" width="120"  name="medium limit" decimal_digits="0" increment="1" min_val="0" max_val="100" tool_tip="Triangle budget for this LOD"/>
-  <text bottom_delta="25" follows="top|left" height="15" left="10" name="medium info" width="300">
-    [TRIANGLES] Triangles, [VERTICES] Vertices, [SUBMESHES] Submeshes.  
-    [MESSAGE]
-  </text>
-
-  <text bottom_delta="35" follows="top|left" height="15" left="10" name="low_lod_label">
-    Low LOD:
-  </text>
-  <combo_box bottom_delta="0" left="97" follows="left|top" height="18" 
-             name="low detail combo" width="100" tool_tip="Specify mesh for this level of detail">
-    <combo_item name="low none" value="none">
-      None
-    </combo_item>
-    <combo_item name="low choose file" value="file">
-      Choose File...
-    </combo_item>
-    <combo_item name="low triangle limit" value="limit">
-      Triangle Limit
-    </combo_item>
-  </combo_box>
-  <spinner bottom_delta="-5" left="200" width="120"  name="low limit" decimal_digits="0" increment="1" min_val="0" max_val="100" tool_tip="Triangle budget for this LOD"/>
-  <text bottom_delta="25" follows="top|left" height="15" left="10" name="low info" width="300">
-    [TRIANGLES] Triangles, [VERTICES] Vertices, [SUBMESHES] Submeshes
-    [MESSAGE]
-  </text>
-
-  <text bottom_delta="35" follows="top|left" height="15" left="10" name="lowest_lod_label">
-    Lowest LOD:
-  </text>
-  <combo_box bottom_delta="0" left="97" follows="left|top" height="18" 
-             name="lowest detail combo" width="100" tool_tip="Specify mesh for this level of detail">
-    <combo_item name="lowest none" value="none">
-      None
-    </combo_item>
-    <combo_item name="lowest choose file" value="file">
-      Choose File...
-    </combo_item>
-    <combo_item name="lowest triangle limit" value="limit">
-      Triangle Limit
-    </combo_item>
-  </combo_box>
-  <spinner bottom_delta="-5" left="200" width="120"  name="lowest limit" decimal_digits="0" increment="1" min_val="0" max_val="100" tool_tip="Triangle budget for this LOD"/>
-  <text bottom_delta="25" follows="top|left" height="15" left="10" name="lowest info" width="300">
-    [TRIANGLES] Triangles, [VERTICES] Vertices, [SUBMESHES] Submeshes
-    [MESSAGE]
-  </text>
-
-  <text bottom_delta="35" follows="top|left" height="15" left="10" name="physics_lod_label">
-    Physical Shape:
-  </text>
-  <combo_box bottom_delta="0" left="97" follows="left|top" height="18"
-             name="physics detail combo" width="100">
-    <combo_item name="physics none" value="none">
-      None
-    </combo_item>
-    <combo_item name="physics choose file" value="file">
-      Choose File...
-    </combo_item>
-    <combo_item name="physics triangle limit" value="limit">
-      Triangle Limit...
-    </combo_item>
-  </combo_box>
-  <spinner bottom_delta="-5" left="200" width="90"  name="physics limit" decimal_digits="0" increment="1" min_val="0" max_val="100" tool_tip="Triangle budget for this LOD"/>
-  <button bottom_delta="0" left="290" width="30" follows="left|top" height="20" label=">>" 
-          name="decompose_btn" tool_tip="Create convex decomposition."/>
-  <text bottom_delta="25" follows="top|left" height="15" left="10" name="physics info" width="300">
-    [TRIANGLES] Triangles, [HULLS] Hulls, [POINTS] Points
-  </text>
-
-  <text bottom_delta="25" follows="top|left" height="15" left="10" name="include label" width="300">
-    Include:
-  </text>
-
-  <check_box bottom_delta="20" follow="bottom|left" height="20" label="Textures"
-             left="15" width="125" name="upload_textures" tool_tip="Upload associated textures "/>
-
-  <check_box bottom_delta="20" follow="bottom|left" height="20" label="Skin Weights"
-             left="15" width="125" name="upload_skin" tool_tip="Upload vertex skin weighting information."/>
-
-  <check_box bottom_delta="20" follow="bottom|left" height="20" label="Joint Positions"
-             left="15" width="125" name="upload_joints" tool_tip="Upload joint position information (will override avatar joint positions when mesh is worn)."/>
-
-  
-	<button bottom_delta="25" follows="bottom|left" height="20" label="Upload"
-	     left="15" name="ok_btn" width="125" tool_tip="Upload to simulator"/>
-
-  <text bottom_delta="20" left="15" width="280" follows="top|left" height="15" name="description_label" text_color="1 0.82 0.46 1">
-	  (No charge for upload during First Look)
-	</text>
-  <text bottom_delta="20" left="15" width="280" follows="top|left" height="15" name="upload_message">
-    [MESSAGE]
-  </text>
-  
-  <spinner bottom_delta="20" label="Scale" left="15" width="120"  name="debug scale" decimal_digits="3" increment="0.1" min_val="0" max_val="64" initial_value="1" tool_tip="Multiplier for incoming object scale.  If incoming dimensions are very small or very large, modify this value to get dimensions into an acceptable range."/>
-  <text bottom_delta="30" left="15" width="280" follows="top|left" height="15" name="dimensions">
-    Model Dimensions: [X]m x [Y]m x [Z]m
-  </text>
-  -->
 </floater>
-- 
cgit v1.2.3


From 5391410f89bfcc789702aab9fd0caeb21b399577 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Wed, 24 Aug 2011 11:40:43 -0700
Subject: sync with viewer-development

---
 indra/newview/skins/default/xui/da/menu_viewer.xml      |  1 -
 indra/newview/skins/default/xui/da/notifications.xml    |  2 +-
 indra/newview/skins/default/xui/de/menu_viewer.xml      |  1 -
 indra/newview/skins/default/xui/de/notifications.xml    |  2 +-
 indra/newview/skins/default/xui/en/menu_viewer.xml      | 10 ----------
 indra/newview/skins/default/xui/en/notifications.xml    |  2 +-
 indra/newview/skins/default/xui/en/panel_status_bar.xml | 10 +++++-----
 indra/newview/skins/default/xui/en/strings.xml          |  2 +-
 indra/newview/skins/default/xui/es/menu_viewer.xml      |  1 -
 indra/newview/skins/default/xui/es/notifications.xml    |  2 +-
 indra/newview/skins/default/xui/fr/menu_viewer.xml      |  1 -
 indra/newview/skins/default/xui/fr/notifications.xml    |  2 +-
 indra/newview/skins/default/xui/it/menu_viewer.xml      |  1 -
 indra/newview/skins/default/xui/it/notifications.xml    |  2 +-
 indra/newview/skins/default/xui/ja/menu_viewer.xml      |  1 -
 indra/newview/skins/default/xui/ja/notifications.xml    |  2 +-
 indra/newview/skins/default/xui/nl/notifications.xml    |  2 +-
 indra/newview/skins/default/xui/pl/menu_viewer.xml      |  1 -
 indra/newview/skins/default/xui/pl/notifications.xml    |  2 +-
 indra/newview/skins/default/xui/pt/menu_viewer.xml      |  1 -
 indra/newview/skins/default/xui/pt/notifications.xml    |  2 +-
 indra/newview/skins/default/xui/zh/menu_viewer.xml      |  1 -
 indra/newview/skins/default/xui/zh/notifications.xml    |  2 +-
 23 files changed, 17 insertions(+), 36 deletions(-)

diff --git a/indra/newview/skins/default/xui/da/menu_viewer.xml b/indra/newview/skins/default/xui/da/menu_viewer.xml
index d352312d15..c2f7d26dc9 100644
--- a/indra/newview/skins/default/xui/da/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/da/menu_viewer.xml
@@ -140,7 +140,6 @@
 		<menu_item_check label="Fjern kamerabegrænsninger" name="Disable Camera Distance"/>
 		<menu_item_check label="Højopløsningsfoto" name="HighResSnapshot"/>
 		<menu_item_check label="Lydløse fotos til disk" name="QuietSnapshotsToDisk"/>
-		<menu_item_check label="Komprimér fotos til disk" name="CompressSnapshotsToDisk"/>
 		<menu label="Værktøjer til ydelse" name="Performance Tools">
 			<menu_item_call label="Lag meter" name="Lag Meter"/>
 			<menu_item_check label="Statistik bjælke" name="Statistics Bar"/>
diff --git a/indra/newview/skins/default/xui/da/notifications.xml b/indra/newview/skins/default/xui/da/notifications.xml
index c3999501eb..3ccdfc036a 100644
--- a/indra/newview/skins/default/xui/da/notifications.xml
+++ b/indra/newview/skins/default/xui/da/notifications.xml
@@ -1335,7 +1335,7 @@ Prøv igen om lidt.
 	</notification>
 	<notification name="ObjectGiveItem">
 		Et object med navnet &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; ejet af [NAME_SLURL] har givet dig denne [OBJECTTYPE]:
-[ITEM_SLURL]
+&lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;
 		<form name="form">
 			<button name="Keep" text="Behold"/>
 			<button name="Discard" text="Smid væk"/>
diff --git a/indra/newview/skins/default/xui/de/menu_viewer.xml b/indra/newview/skins/default/xui/de/menu_viewer.xml
index de4c269be6..e010844206 100644
--- a/indra/newview/skins/default/xui/de/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/de/menu_viewer.xml
@@ -159,7 +159,6 @@
 		<menu_item_check label="Kamerabeschränkungen deaktivieren" name="Disable Camera Distance"/>
 		<menu_item_check label="Foto (hohe Auflösung)" name="HighResSnapshot"/>
 		<menu_item_check label="Fotos auf Festplatte leise speichern" name="QuietSnapshotsToDisk"/>
-		<menu_item_check label="Fotos auf Festplatte komprimieren" name="CompressSnapshotsToDisk"/>
 		<menu label="Performance Tools" name="Performance Tools">
 			<menu_item_call label="Lag-Anzeige" name="Lag Meter"/>
 			<menu_item_check label="Statistikleiste" name="Statistics Bar"/>
diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml
index abea3442fa..1971061096 100644
--- a/indra/newview/skins/default/xui/de/notifications.xml
+++ b/indra/newview/skins/default/xui/de/notifications.xml
@@ -2432,7 +2432,7 @@ Versuchen Sie es in einigen Minuten erneut.
 	</notification>
 	<notification name="ObjectGiveItem">
 		Ein Objekt namens &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt;, das [NAME_SLURL] gehört, hat Ihnen folgende/n/s [OBJECTTYPE] übergeben:
-[ITEM_SLURL]
+&lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;
 		<form name="form">
 			<button name="Keep" text="Behalten"/>
 			<button name="Discard" text="Verwerfen"/>
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 01699955a6..b08e3abb71 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -1250,16 +1250,6 @@
              function="ToggleControl"
              parameter="QuietSnapshotsToDisk" />
         </menu_item_check>
-        <menu_item_check
-         label="Compress Snapshots to Disk"
-         name="CompressSnapshotsToDisk">
-            <menu_item_check.on_check
-             function="CheckControl"
-             parameter="CompressSnapshotsToDisk" />
-            <menu_item_check.on_click
-             function="ToggleControl"
-             parameter="CompressSnapshotsToDisk" />
-        </menu_item_check>
 
         <menu_item_separator/>
 
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 310616d57e..c9ccd44b83 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -5903,7 +5903,7 @@ No valid parcel could be found.
    name="ObjectGiveItem"
    type="offer">
 An object named &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; owned by [NAME_SLURL] has given you this [OBJECTTYPE]:
-[ITEM_SLURL]
+&lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;
     <form name="form">
       <button
        index="0"
diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml
index f51279adb4..23ad0e9528 100644
--- a/indra/newview/skins/default/xui/en/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml
@@ -81,7 +81,7 @@
      follows="right|top"    
     image_color="0 0 0 0"
     hover_glow_amount="0"
-    left_pad="2"
+    left_pad="5"
     top="0"
     width="55"
     height="18"
@@ -94,14 +94,14 @@
      font="SansSerifSmall"
      text_readonly_color="TimeTextColor"
      follows="right|top"
-     halign="right"
+     halign="center"
      height="16"
      top="5"
      layout="topleft"
-     left_pad="0"
+     left_pad="5"
      name="TimeText"
      tool_tip="Current time (Pacific)"
-     width="70">
+     width="90">
         24:00 AM PST
     </text>
     <button
@@ -112,7 +112,7 @@
      image_pressed="Pause_Press"
      image_pressed_selected="Play_Press"
      is_toggle="true"
-     left_pad="15"
+     left_pad="10"
      top="1"
      name="media_toggle_btn"
      tool_tip="Start/Stop All Media (Music, Video, Web pages)"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index f049f857f0..2094275bed 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -3414,7 +3414,7 @@ Abuse Report</string>
   <string name="Female - Stick tougue out">Female - Stick tougue out</string>
   <string name="Female - Wow">Female - Wow</string>
 
-  <string name="/bow">/bow</string>
+  <string name="/bow1">/bow1</string>
   <string name="/clap">/clap</string>
   <string name="/count">/count</string>
   <string name="/extinguish">/extinguish</string>
diff --git a/indra/newview/skins/default/xui/es/menu_viewer.xml b/indra/newview/skins/default/xui/es/menu_viewer.xml
index 049a89aa06..b0d16d1ca4 100644
--- a/indra/newview/skins/default/xui/es/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/es/menu_viewer.xml
@@ -159,7 +159,6 @@
 		<menu_item_check label="Desactivar los límites de la cámara" name="Disable Camera Distance"/>
 		<menu_item_check label="Foto en Alta Resolución" name="HighResSnapshot"/>
 		<menu_item_check label="Silenciar el Guardar una foto" name="QuietSnapshotsToDisk"/>
-		<menu_item_check label="Comprimir las fotos para el disco duro" name="CompressSnapshotsToDisk"/>
 		<menu label="Herramientas de rendimiento" name="Performance Tools">
 			<menu_item_call label="Medidor de lag" name="Lag Meter"/>
 			<menu_item_check label="Estadísticas" name="Statistics Bar"/>
diff --git a/indra/newview/skins/default/xui/es/notifications.xml b/indra/newview/skins/default/xui/es/notifications.xml
index 1a75beed3f..2ec1b333a9 100644
--- a/indra/newview/skins/default/xui/es/notifications.xml
+++ b/indra/newview/skins/default/xui/es/notifications.xml
@@ -2426,7 +2426,7 @@ Por favor, vuelve a intentarlo en unos momentos.
 	</notification>
 	<notification name="ObjectGiveItem">
 		Un objeto de nombre &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt;, propiedad de [NAME_SLURL], te ha dado este [OBJECTTYPE]:
-[ITEM_SLURL]
+&lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;
 		<form name="form">
 			<button name="Keep" text="Guardar"/>
 			<button name="Discard" text="Descartar"/>
diff --git a/indra/newview/skins/default/xui/fr/menu_viewer.xml b/indra/newview/skins/default/xui/fr/menu_viewer.xml
index ccea1e4570..46adc79a00 100644
--- a/indra/newview/skins/default/xui/fr/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/fr/menu_viewer.xml
@@ -159,7 +159,6 @@
 		<menu_item_check label="Désactiver les contraintes de la caméra" name="Disable Camera Distance"/>
 		<menu_item_check label="Photo haute résolution" name="HighResSnapshot"/>
 		<menu_item_check label="Photos discrètes sur disque" name="QuietSnapshotsToDisk"/>
-		<menu_item_check label="Compresser les photos sur disque" name="CompressSnapshotsToDisk"/>
 		<menu label="Outils de performance" name="Performance Tools">
 			<menu_item_call label="Mesure du lag" name="Lag Meter"/>
 			<menu_item_check label="Barre de statistiques" name="Statistics Bar"/>
diff --git a/indra/newview/skins/default/xui/fr/notifications.xml b/indra/newview/skins/default/xui/fr/notifications.xml
index dd8fdaf50e..ef95a1a389 100644
--- a/indra/newview/skins/default/xui/fr/notifications.xml
+++ b/indra/newview/skins/default/xui/fr/notifications.xml
@@ -2418,7 +2418,7 @@ Veuillez réessayer dans quelques minutes.
 	</notification>
 	<notification name="ObjectGiveItem">
 		Un objet nommé &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; appartenant à [NAME_SLURL] vous a donné un objet de type [OBJECTTYPE] :
-[ITEM_SLURL]
+&lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;
 		<form name="form">
 			<button name="Keep" text="Garder"/>
 			<button name="Discard" text="Jeter"/>
diff --git a/indra/newview/skins/default/xui/it/menu_viewer.xml b/indra/newview/skins/default/xui/it/menu_viewer.xml
index daeda576cc..ef40cbda7c 100644
--- a/indra/newview/skins/default/xui/it/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/it/menu_viewer.xml
@@ -159,7 +159,6 @@
 		<menu_item_check label="Disabilita vincoli fotocamera" name="Disable Camera Distance"/>
 		<menu_item_check label="Foto ad alta risoluzione" name="HighResSnapshot"/>
 		<menu_item_check label="Manda foto su disco senza avvisi" name="QuietSnapshotsToDisk"/>
-		<menu_item_check label="Comprimi le foto su disco" name="CompressSnapshotsToDisk"/>
 		<menu label="Strumenti di performance" name="Performance Tools">
 			<menu_item_call label="Misuratore lag" name="Lag Meter"/>
 			<menu_item_check label="Barra statistiche" name="Statistics Bar"/>
diff --git a/indra/newview/skins/default/xui/it/notifications.xml b/indra/newview/skins/default/xui/it/notifications.xml
index 88625ef4b7..d09f207af2 100644
--- a/indra/newview/skins/default/xui/it/notifications.xml
+++ b/indra/newview/skins/default/xui/it/notifications.xml
@@ -2420,7 +2420,7 @@ Riprova tra qualche istante.
 	</notification>
 	<notification name="ObjectGiveItem">
 		Un oggetto denominato &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; di proprietà di [NAME_SLURL] ti ha dato questo [OBJECTTYPE]:
-[ITEM_SLURL]
+&lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;
 		<form name="form">
 			<button name="Keep" text="Prendi"/>
 			<button name="Discard" text="Rifiuta"/>
diff --git a/indra/newview/skins/default/xui/ja/menu_viewer.xml b/indra/newview/skins/default/xui/ja/menu_viewer.xml
index 09b315b026..223c1e1f11 100644
--- a/indra/newview/skins/default/xui/ja/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/ja/menu_viewer.xml
@@ -159,7 +159,6 @@
 		<menu_item_check label="カメラの距離移動を制限しない" name="Disable Camera Distance"/>
 		<menu_item_check label="高解像度スナップショット" name="HighResSnapshot"/>
 		<menu_item_check label="シャッター音とアニメーションなしでスナップショットをディスクに保存する" name="QuietSnapshotsToDisk"/>
-		<menu_item_check label="圧縮してスナップショットをディスクに保存する" name="CompressSnapshotsToDisk"/>
 		<menu label="パフォーマンスツール" name="Performance Tools">
 			<menu_item_call label="ラグ計測器" name="Lag Meter"/>
 			<menu_item_check label="統計バー" name="Statistics Bar"/>
diff --git a/indra/newview/skins/default/xui/ja/notifications.xml b/indra/newview/skins/default/xui/ja/notifications.xml
index 5f5dad0d3e..6bff82bec4 100644
--- a/indra/newview/skins/default/xui/ja/notifications.xml
+++ b/indra/newview/skins/default/xui/ja/notifications.xml
@@ -2467,7 +2467,7 @@ Web ページにリンクすると、他人がこの場所に簡単にアクセ
 	</notification>
 	<notification name="ObjectGiveItem">
 		[NAME_SLURL] が所有する &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; という名前のオブジェクトが、あなたに [OBJECTTYPE] を渡しました:
-[ITEM_SLURL]
+&lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;
 		<form name="form">
 			<button name="Keep" text="受け取る"/>
 			<button name="Discard" text="破棄"/>
diff --git a/indra/newview/skins/default/xui/nl/notifications.xml b/indra/newview/skins/default/xui/nl/notifications.xml
index f27b83d3f9..06e6d8ae7a 100644
--- a/indra/newview/skins/default/xui/nl/notifications.xml
+++ b/indra/newview/skins/default/xui/nl/notifications.xml
@@ -2698,7 +2698,7 @@ Probeer het alstublieft opnieuw over enkele ogenblikken.
 		Geen geldig perceel kon gevonden worden.
 	</notification>
 	<notification name="ObjectGiveItem">
-		Een object genaamd &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt;, eigendom van [NAME_SLURL], heeft u een [OBJECTTYPE] genaamd [ITEM_SLURL] gegeven.
+		Een object genaamd &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt;, eigendom van [NAME_SLURL], heeft u een [OBJECTTYPE] genaamd &lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt; gegeven.
 		<form name="form">
 			<button name="Keep" text="Behouden"/>
 			<button name="Discard" text="Afwijzen"/>
diff --git a/indra/newview/skins/default/xui/pl/menu_viewer.xml b/indra/newview/skins/default/xui/pl/menu_viewer.xml
index e869806d04..fe4662c5a2 100644
--- a/indra/newview/skins/default/xui/pl/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/pl/menu_viewer.xml
@@ -138,7 +138,6 @@
 		<menu_item_check label="Wyłącz ograniczenia zasięgu kamery" name="Disable Camera Distance"/>
 		<menu_item_check label="Wysoka rozdzielczość zdjęć" name="HighResSnapshot"/>
 		<menu_item_check label="Zapisuj zdjęcia na dysk twardy bez efektu dźwiękowego" name="QuietSnapshotsToDisk"/>
-		<menu_item_check label="Skompresuj zdjęcie na dysk twardy" name="CompressSnapshotsToDisk"/>
 		<menu label="Narzędzia" name="Performance Tools">
 			<menu_item_call label="Pomiar lagów" name="Lag Meter"/>
 			<menu_item_check label="Statystyki" name="Statistics Bar"/>
diff --git a/indra/newview/skins/default/xui/pl/notifications.xml b/indra/newview/skins/default/xui/pl/notifications.xml
index 63f976a314..7d3225ea31 100644
--- a/indra/newview/skins/default/xui/pl/notifications.xml
+++ b/indra/newview/skins/default/xui/pl/notifications.xml
@@ -2385,7 +2385,7 @@ Spróbuj ponowanie za kilka minut.
 	</notification>
 	<notification name="ObjectGiveItem">
 		Obiekt o nazwie &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt;, należący do [NAME_SLURL] dał Tobie [OBJECTTYPE]:
-[ITEM_SLURL]
+&lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;
 		<form name="form">
 			<button name="Keep" text="Zachowaj"/>
 			<button name="Discard" text="Wyrzuć"/>
diff --git a/indra/newview/skins/default/xui/pt/menu_viewer.xml b/indra/newview/skins/default/xui/pt/menu_viewer.xml
index c184fb0af3..ea54afed5e 100644
--- a/indra/newview/skins/default/xui/pt/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/pt/menu_viewer.xml
@@ -159,7 +159,6 @@
 		<menu_item_check label="Disable Camera Constraints" name="Disable Camera Distance"/>
 		<menu_item_check label="Foto de alta resolução" name="HighResSnapshot"/>
 		<menu_item_check label="Compactar fotos para HD" name="QuietSnapshotsToDisk"/>
-		<menu_item_check label="Compactar fotos para HD" name="CompressSnapshotsToDisk"/>
 		<menu label="Ferramentas de desempenho" name="Performance Tools">
 			<menu_item_call label="Medidor de lag" name="Lag Meter"/>
 			<menu_item_check label="Barra de estatísticas" name="Statistics Bar"/>
diff --git a/indra/newview/skins/default/xui/pt/notifications.xml b/indra/newview/skins/default/xui/pt/notifications.xml
index 0bb02a7199..22de7edfdd 100644
--- a/indra/newview/skins/default/xui/pt/notifications.xml
+++ b/indra/newview/skins/default/xui/pt/notifications.xml
@@ -2401,7 +2401,7 @@ Por favor, tente novamente em alguns instantes.
 	</notification>
 	<notification name="ObjectGiveItem">
 		Um objeto chamado &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt;, de [NAME_SLURL], lhe deu este(a) [OBJECTTYPE]:
-[ITEM_SLURL]
+&lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;
 		<form name="form">
 			<button name="Keep" text="Segure"/>
 			<button name="Discard" text="Descarte"/>
diff --git a/indra/newview/skins/default/xui/zh/menu_viewer.xml b/indra/newview/skins/default/xui/zh/menu_viewer.xml
index ce588c7e6b..a51e26c3f4 100644
--- a/indra/newview/skins/default/xui/zh/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/zh/menu_viewer.xml
@@ -139,7 +139,6 @@
 		<menu_item_check label="Disable Camera Constraints" name="Disable Camera Distance"/>
 		<menu_item_check label="高解析度快照" name="HighResSnapshot"/>
 		<menu_item_check label="靜音拍攝快照到硬碟" name="QuietSnapshotsToDisk"/>
-		<menu_item_check label="壓縮快照存到硬碟" name="CompressSnapshotsToDisk"/>
 		<menu label="效能工具" name="Performance Tools">
 			<menu_item_call label="Lag Meter" name="Lag Meter"/>
 			<menu_item_check label="統計列" name="Statistics Bar"/>
diff --git a/indra/newview/skins/default/xui/zh/notifications.xml b/indra/newview/skins/default/xui/zh/notifications.xml
index f819ed35e6..1c89e9b522 100644
--- a/indra/newview/skins/default/xui/zh/notifications.xml
+++ b/indra/newview/skins/default/xui/zh/notifications.xml
@@ -2418,7 +2418,7 @@ Please try again in a few moments.
 	</notification>
 	<notification name="ObjectGiveItem">
 		An object named &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; owned by [NAME_SLURL] has given you this [OBJECTTYPE]:
-[ITEM_SLURL]
+&lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;
 		<form name="form">
 			<button name="Keep" text="Keep"/>
 			<button name="Discard" text="Discard"/>
-- 
cgit v1.2.3


From 59fbf6bfa5f6476d144e60af12a20f582fdf4e18 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Wed, 24 Aug 2011 11:41:37 -0700
Subject: sync with viewer-development

---
 indra/newview/skins/minimal/xui/da/notifications.xml    | 2 +-
 indra/newview/skins/minimal/xui/de/notifications.xml    | 2 +-
 indra/newview/skins/minimal/xui/en/notifications.xml    | 2 +-
 indra/newview/skins/minimal/xui/en/panel_status_bar.xml | 4 ++--
 indra/newview/skins/minimal/xui/es/notifications.xml    | 2 +-
 indra/newview/skins/minimal/xui/fr/notifications.xml    | 2 +-
 indra/newview/skins/minimal/xui/it/notifications.xml    | 2 +-
 indra/newview/skins/minimal/xui/ja/notifications.xml    | 2 +-
 indra/newview/skins/minimal/xui/pl/notifications.xml    | 2 +-
 indra/newview/skins/minimal/xui/pt/notifications.xml    | 2 +-
 10 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/indra/newview/skins/minimal/xui/da/notifications.xml b/indra/newview/skins/minimal/xui/da/notifications.xml
index e77eeee8df..3d003ea3b3 100644
--- a/indra/newview/skins/minimal/xui/da/notifications.xml
+++ b/indra/newview/skins/minimal/xui/da/notifications.xml
@@ -1327,7 +1327,7 @@ Prøv igen om lidt.
 		No valid parcel could be found.
 	</notification>
 	<notification name="ObjectGiveItem">
-		Et objekt ved navn &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; ejet af [NAME_SLURL] tilbyder dig [ITEM_SLURL].  For at bruge denne genstand skal du skifte til avanceret tilstand, hvor du kan finde genstanden i din beholdning. Ønsker du at logge ud for at skifte tilstand? Valg af tilstand findes på login skærmbilledet.
+		Et objekt ved navn &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; ejet af [NAME_SLURL] tilbyder dig &lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;.  For at bruge denne genstand skal du skifte til avanceret tilstand, hvor du kan finde genstanden i din beholdning. Ønsker du at logge ud for at skifte tilstand? Valg af tilstand findes på login skærmbilledet.
 		<form name="form">
 			<button name="Keep" text="Behold genstand"/>
 			<button name="Discard" text="Afvis genstand"/>
diff --git a/indra/newview/skins/minimal/xui/de/notifications.xml b/indra/newview/skins/minimal/xui/de/notifications.xml
index 1eee1d1c9b..9abf8cdbb9 100644
--- a/indra/newview/skins/minimal/xui/de/notifications.xml
+++ b/indra/newview/skins/minimal/xui/de/notifications.xml
@@ -9,7 +9,7 @@
 		</form>
 	</notification>
 	<notification name="ObjectGiveItem">
-		Ein Objekt namens &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt;, das [NAME_SLURL] gehört, bietet Ihnen [ITEM_SLURL] an. Zur Verwendung dieses Artikels müssen Sie in den erweiterten Modus umschalten, wo Sie den Artikel in Ihrem Inventar finden werden. Um in den erweiterten Modus umzuschalten, beenden Sie die Anwendung, starten Sie sie neu und ändern Sie die Moduseinstellung auf dem Anmeldebildschirm.
+		Ein Objekt namens &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt;, das [NAME_SLURL] gehört, bietet Ihnen &lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt; an. Zur Verwendung dieses Artikels müssen Sie in den erweiterten Modus umschalten, wo Sie den Artikel in Ihrem Inventar finden werden. Um in den erweiterten Modus umzuschalten, beenden Sie die Anwendung, starten Sie sie neu und ändern Sie die Moduseinstellung auf dem Anmeldebildschirm.
 		<form name="form">
 			<button name="Keep" text="Artikel behalten"/>
 			<button name="Discard" text="Artikel ablehnen"/>
diff --git a/indra/newview/skins/minimal/xui/en/notifications.xml b/indra/newview/skins/minimal/xui/en/notifications.xml
index 84da9472cc..7b7cdb5fc6 100644
--- a/indra/newview/skins/minimal/xui/en/notifications.xml
+++ b/indra/newview/skins/minimal/xui/en/notifications.xml
@@ -24,7 +24,7 @@
    icon="notify.tga"
    name="ObjectGiveItem"
    type="offer">
-    An object named &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; owned by [NAME_SLURL] is offering you [ITEM_SLURL].  Using this item requires you to switch to Advanced mode where you will find the item in your Inventory. To switch to Advanced mode, quit and restart this application and change the mode setting on the login screen.
+    An object named &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; owned by [NAME_SLURL] is offering you &lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;.  Using this item requires you to switch to Advanced mode where you will find the item in your Inventory. To switch to Advanced mode, quit and restart this application and change the mode setting on the login screen.
     <form name="form">
       <button
        index="0"
diff --git a/indra/newview/skins/minimal/xui/en/panel_status_bar.xml b/indra/newview/skins/minimal/xui/en/panel_status_bar.xml
index c816d97eee..42e6f30d48 100644
--- a/indra/newview/skins/minimal/xui/en/panel_status_bar.xml
+++ b/indra/newview/skins/minimal/xui/en/panel_status_bar.xml
@@ -37,9 +37,9 @@
      follows="right|top"    
     image_color="0 0 0 0"
     hover_glow_amount="0"
-    left="2"
+    left="5"
     top="7"
-    width="50"  
+    width="55"  
     height="18"
     label="Mode ▼"
     tool_tip="Select your mode. Choose Basic for fast, easy exploration and chat. Choose Advanced to access more features."
diff --git a/indra/newview/skins/minimal/xui/es/notifications.xml b/indra/newview/skins/minimal/xui/es/notifications.xml
index b08ebb5f76..78b617c429 100644
--- a/indra/newview/skins/minimal/xui/es/notifications.xml
+++ b/indra/newview/skins/minimal/xui/es/notifications.xml
@@ -9,7 +9,7 @@
 		</form>
 	</notification>
 	<notification name="ObjectGiveItem">
-		Un objeto de nombre &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt;, propiedad de [NAME_SLURL], te ofrece un/a [ITEM_SLURL]. Para utilizar este ítem, cambia al modo Avanzado y búscalo en el inventario. Para cambiar al modo Avanzado, sal de la aplicación, reiníciala y cambia el ajuste de modo en la pantalla de inicio de sesión.
+		Un objeto de nombre &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt;, propiedad de [NAME_SLURL], te ofrece un/a &lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;. Para utilizar este ítem, cambia al modo Avanzado y búscalo en el inventario. Para cambiar al modo Avanzado, sal de la aplicación, reiníciala y cambia el ajuste de modo en la pantalla de inicio de sesión.
 		<form name="form">
 			<button name="Keep" text="Conservar ítem"/>
 			<button name="Discard" text="Rechazar ítem"/>
diff --git a/indra/newview/skins/minimal/xui/fr/notifications.xml b/indra/newview/skins/minimal/xui/fr/notifications.xml
index 41dd42c39f..05fa03cdc1 100644
--- a/indra/newview/skins/minimal/xui/fr/notifications.xml
+++ b/indra/newview/skins/minimal/xui/fr/notifications.xml
@@ -9,7 +9,7 @@
 		</form>
 	</notification>
 	<notification name="ObjectGiveItem">
-		Un objet nommé &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; appartenant à [NAME_SLURL] vous offre [ITEM_SLURL]. Pour utiliser cet article, vous devez passer en mode Avancé. L&apos;article se trouve dans votre inventaire. Pour changer de mode, quittez l&apos;application, redémarrez-la, puis sélectionnez un autre mode sur l&apos;écran de connexion.
+		Un objet nommé &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; appartenant à [NAME_SLURL] vous offre &lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;. Pour utiliser cet article, vous devez passer en mode Avancé. L&apos;article se trouve dans votre inventaire. Pour changer de mode, quittez l&apos;application, redémarrez-la, puis sélectionnez un autre mode sur l&apos;écran de connexion.
 		<form name="form">
 			<button name="Keep" text="Garder l&apos;article"/>
 			<button name="Discard" text="Refuser l&apos;article"/>
diff --git a/indra/newview/skins/minimal/xui/it/notifications.xml b/indra/newview/skins/minimal/xui/it/notifications.xml
index 05e13bc4f3..998e38ff5a 100644
--- a/indra/newview/skins/minimal/xui/it/notifications.xml
+++ b/indra/newview/skins/minimal/xui/it/notifications.xml
@@ -2418,7 +2418,7 @@ Riprova tra qualche istante.
 		Non è stato trovato nessun territorio valido.
 	</notification>
 	<notification name="ObjectGiveItem">
-		Un oggetto denominato &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; di proprietà di [NAME_SLURL] ti ha offerto [ITEM_SLURL]:  Per usare questo oggetto è necessario passare alla modalità Avanzata e cercarlo nell&apos;Inventario. Per passare alla modalità Avanzata, esci e riavvia l&apos;applicazione e cambia le impostazioni della modalità nella schermata di accesso.
+		Un oggetto denominato &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; di proprietà di &lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt; ti ha offerto [ITEM_SLURL]:  Per usare questo oggetto è necessario passare alla modalità Avanzata e cercarlo nell&apos;Inventario. Per passare alla modalità Avanzata, esci e riavvia l&apos;applicazione e cambia le impostazioni della modalità nella schermata di accesso.
 		<form name="form">
 			<button name="Keep" text="Mantieni oggetto"/>
 			<button name="Discard" text="Rifiuta oggetto"/>
diff --git a/indra/newview/skins/minimal/xui/ja/notifications.xml b/indra/newview/skins/minimal/xui/ja/notifications.xml
index 6ad0ed1ac6..43934c9317 100644
--- a/indra/newview/skins/minimal/xui/ja/notifications.xml
+++ b/indra/newview/skins/minimal/xui/ja/notifications.xml
@@ -2465,7 +2465,7 @@ Web ページにリンクすると、他人がこの場所に簡単にアクセ
 		有効な区画が見つかりませんでした。
 	</notification>
 	<notification name="ObjectGiveItem">
-		[NAME_SLURL] が所有する &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; という名前のオブジェクトが、あなたに [ITEM_SLURL] を渡そうとしています。このアイテムを使うにはアドバンスモードへの切り替えが必要です。アドバンスモードでログインしなおすと、あなたの持ち物にこのアイテムが見つかります。アドバンスモードに切り替えるには、このアプリケーションを終了して再起動し、ログイン画面でモード設定を変更してください。
+		[NAME_SLURL] が所有する &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; という名前のオブジェクトが、あなたに &lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt; を渡そうとしています。このアイテムを使うにはアドバンスモードへの切り替えが必要です。アドバンスモードでログインしなおすと、あなたの持ち物にこのアイテムが見つかります。アドバンスモードに切り替えるには、このアプリケーションを終了して再起動し、ログイン画面でモード設定を変更してください。
 		<form name="form">
 			<button name="Keep" text="アイテムを受け取る"/>
 			<button name="Discard" text="アイテムを拒否する"/>
diff --git a/indra/newview/skins/minimal/xui/pl/notifications.xml b/indra/newview/skins/minimal/xui/pl/notifications.xml
index 6e62478ed0..6475a37465 100644
--- a/indra/newview/skins/minimal/xui/pl/notifications.xml
+++ b/indra/newview/skins/minimal/xui/pl/notifications.xml
@@ -2384,7 +2384,7 @@ Spróbuj ponowanie za kilka minut.
 		Nieważana posiadłość.
 	</notification>
 	<notification name="ObjectGiveItem">
-		Obiekt o nazwie &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt;, którego właścicielem jest [NAME_SLURL] oferuje Tobie [ITEM_SLURL].  Korzystanie z tego obieku wymaga przelączenia się na tryb zaawansowany, w którym będzie można odszukać obiekt w Twojej Szafie. W celu przełączenia trybu życia na zaawansowany, zamknij i uruchom ponownie aplikację. Przed ponownym zalogowaniem zmień tryb życia na ekranie logowania.
+		Obiekt o nazwie &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt;, którego właścicielem jest [NAME_SLURL] oferuje Tobie &lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;.  Korzystanie z tego obieku wymaga przelączenia się na tryb zaawansowany, w którym będzie można odszukać obiekt w Twojej Szafie. W celu przełączenia trybu życia na zaawansowany, zamknij i uruchom ponownie aplikację. Przed ponownym zalogowaniem zmień tryb życia na ekranie logowania.
 		<form name="form">
 			<button name="Keep" text="Zaakceptuj obiekt"/>
 			<button name="Discard" text="Odrzuć obiekt"/>
diff --git a/indra/newview/skins/minimal/xui/pt/notifications.xml b/indra/newview/skins/minimal/xui/pt/notifications.xml
index 30ba6f68bf..9e5ff6fe60 100644
--- a/indra/newview/skins/minimal/xui/pt/notifications.xml
+++ b/indra/newview/skins/minimal/xui/pt/notifications.xml
@@ -9,7 +9,7 @@
 		</form>
 	</notification>
 	<notification name="ObjectGiveItem">
-		Um objeto chamado &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt;, de [NAME_SLURL], está lhe oferecendo [ITEM_SLURL].  Esta ação requer o modo Avançado. Passe para o modo Avançado e você verá o item em seu Inventário. Para passar para o modo Avançado, feche e reinicialize esse aplicativo e mude o modo (indicado na tela de login).
+		Um objeto chamado &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt;, de [NAME_SLURL], está lhe oferecendo &lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;.  Esta ação requer o modo Avançado. Passe para o modo Avançado e você verá o item em seu Inventário. Para passar para o modo Avançado, feche e reinicialize esse aplicativo e mude o modo (indicado na tela de login).
 		<form name="form">
 			<button name="Keep" text="Guardar item"/>
 			<button name="Discard" text="Recusar item"/>
-- 
cgit v1.2.3


From 124e4d587491668354cd9910cea07d299464108e Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Thu, 25 Aug 2011 21:33:10 +0300
Subject: SH-2309 WIP Priority modifications to mesh uploader UI

- Updated upload floater according to the UI spec

- Updated Modifiers panel according to the UI spec
---
 indra/newview/llfloatermodelpreview.cpp            |  39 ++--
 indra/newview/llfloatermodelpreview.h              |   7 +-
 .../skins/default/xui/en/floater_model_preview.xml | 213 +++++++++++++--------
 3 files changed, 162 insertions(+), 97 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index acc8a9b213..dd652b32a7 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -435,20 +435,15 @@ BOOL LLFloaterModelPreview::postBuild()
 	//childSetCommitCallback("physics_optimize", refresh, this);
 	//childSetCommitCallback("physics_use_hull", refresh, this);
 
+	getChild<LLCheckBoxCtrl>("show_edges")->setCommitCallback(boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _1));
+	getChild<LLCheckBoxCtrl>("show_physics")->setCommitCallback(boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _1));
+	getChild<LLCheckBoxCtrl>("show_textures")->setCommitCallback(boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _1));
+	getChild<LLCheckBoxCtrl>("show_skin_weight")->setCommitCallback(boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _1));
+	getChild<LLCheckBoxCtrl>("show_joint_positions")->setCommitCallback(boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _1));
+
 	childDisable("upload_skin");
 	childDisable("upload_joints");
 
-	mViewOptionMenuButton = getChild<LLMenuButton>("options_gear_btn");
-
-	mCommitCallbackRegistrar.add("ModelImport.ViewOption.Action", boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _2));
-	mEnableCallbackRegistrar.add("ModelImport.ViewOption.Check", boost::bind(&LLFloaterModelPreview::isViewOptionChecked, this, _2));
-	mEnableCallbackRegistrar.add("ModelImport.ViewOption.Enabled", boost::bind(&LLFloaterModelPreview::isViewOptionEnabled, this, _2));
-
-
-
-	mViewOptionMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_model_import_gear_default.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
-	mViewOptionMenuButton->setMenu(mViewOptionMenu, LLMenuButton::MP_BOTTOM_LEFT);
-
 	initDecompControls();
 
 	LLView* preview_panel = getChild<LLView>("preview_panel");
@@ -541,11 +536,11 @@ void LLFloaterModelPreview::initModelPreview()
 	mModelPreview->setModelUpdatedCallback(boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this, _1));
 }
 
-void LLFloaterModelPreview::onViewOptionChecked(const LLSD& userdata)
+void LLFloaterModelPreview::onViewOptionChecked(LLUICtrl* ctrl)
 {
 	if (mModelPreview)
 	{
-		mModelPreview->mViewOption[userdata.asString()] = !mModelPreview->mViewOption[userdata.asString()];
+		mModelPreview->mViewOption[ctrl->getName()] = !mModelPreview->mViewOption[ctrl->getName()];
 		
 		mModelPreview->refresh();
 	}
@@ -563,12 +558,12 @@ bool LLFloaterModelPreview::isViewOptionChecked(const LLSD& userdata)
 
 bool LLFloaterModelPreview::isViewOptionEnabled(const LLSD& userdata)
 {
-	return !mViewOptionDisabled[userdata.asString()];
+	return childIsEnabled(userdata.asString());
 }
 
 void LLFloaterModelPreview::setViewOptionEnabled(const std::string& option, bool enabled)
 {
-	mViewOptionDisabled[option] = !enabled;
+	childSetEnabled(option, enabled);
 }
 
 void LLFloaterModelPreview::enableViewOption(const std::string& option)
@@ -4357,12 +4352,14 @@ void LLModelPreview::updateStatusMessages()
 			{
 				fmp->enableViewOption("show_physics");
 				mViewOption["show_physics"] = true;
+				fmp->childSetValue("show_physics", true);
 			}
 		}
 		else
 		{
 			fmp->disableViewOption("show_physics");
 			mViewOption["show_physics"] = false;
+			fmp->childSetValue("show_physics", false);
 
 		}
 
@@ -5465,6 +5462,7 @@ void LLFloaterModelPreview::onReset(void* user_data)
 	LLModelPreview* mp = fmp->mModelPreview;
 	std::string filename = mp->mLODFile[3]; 
 
+	fmp->resetDisplayOptions();
 	//reset model preview
 	fmp->initModelPreview();
 
@@ -5583,6 +5581,17 @@ void LLFloaterModelPreview::toggleCalculateButton(bool visible)
 	}
 }
 
+void LLFloaterModelPreview::resetDisplayOptions()
+{
+	std::map<std::string,bool>::iterator option_it = mModelPreview->mViewOption.begin();
+
+	for(;option_it != mModelPreview->mViewOption.end(); ++option_it)
+	{
+		LLUICtrl* ctrl = getChild<LLUICtrl>(option_it->first);
+		ctrl->setValue(false);
+	}
+}
+
 void LLFloaterModelPreview::onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url)
 {
 	mModelPhysicsFee = result;
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index f383b3fe98..9bc8207613 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -187,7 +187,7 @@ public:
 	void			loadModel(S32 lod);
 	void 			loadModel(S32 lod, const std::string& file_name, bool force_disable_slm = false);
 	
-	void onViewOptionChecked(const LLSD& userdata);
+	void onViewOptionChecked(LLUICtrl* ctrl);
 	bool isViewOptionChecked(const LLSD& userdata);
 	bool isViewOptionEnabled(const LLSD& userdata);
 	void setViewOptionEnabled(const std::string& option, bool enabled);
@@ -269,8 +269,6 @@ protected:
 	// 2 - None
 	S32 mLODMode[4];
 
-	LLMenuButton* mViewOptionMenuButton;
-	LLToggleableMenu* mViewOptionMenu;
 	LLMutex* mStatusLock;
 
 	LLSD mModelPhysicsFee;
@@ -282,6 +280,9 @@ private:
 	// Toggles between "Calculate weights & fee" and "Upload" buttons.
 	void toggleCalculateButton(bool visible);
 
+	// resets display options of model preview to their defaults.
+	void resetDisplayOptions();
+
 	LLButton* mUploadBtn;
 	LLButton* mCalculateBtn;
 };
diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index 963938e20a..2436c48b0f 100755
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater can_close="true" can_drag_on_left="false" can_minimize="false"
-     can_resize="true" height="650" min_height="550" min_width="620"
+     can_resize="false" height="480" min_height="480" min_width="840"
      name="Model Preview" title="Upload Model" width="840"
       help_topic="upload_model" >
 
@@ -27,8 +27,8 @@
   <string name="tbd">TBD</string>
 
 <panel
-  follows="all"
-  height="625"
+  follows="top|left"
+  height="455"
   layout="topleft"
   left="3"
   name="left_panel"
@@ -49,7 +49,7 @@
           name="name_label"
           top="0"
           width="290">
-          Name:
+          Model name:
         </text>
         <line_editor
           follows="top|left"
@@ -69,7 +69,7 @@
           text_color="White"
           top="0"
           width="200">
-          What does this model represent?
+          This model represent...
         </text>
         <combo_box
           follows="left|top"
@@ -91,13 +91,12 @@
          </combo_box>
     </panel>
     <tab_container
-      follows="all"
+      follows="top|left"
       top_pad="15"
       left="0"
-      height="470"
+      height="300"
       width="525"
       name="import_tab"
-      border="true"
       tab_position="top">
       <!-- LOD PANEL -->
     <panel
@@ -105,7 +104,7 @@
       label="Level of Detail"
       name="lod_panel"
       help_topic="upload_model_lod">
-    <!-- LOD TABLE-->
+     LOD TABLE
     <panel
       follows="top|left"
       name="lod table"
@@ -157,7 +156,7 @@
     <text left_pad="5" width="230" height="28" follows="left|top" top_pad="-15" wrap="true" name="lod_status_message_text"/>
     </panel>
     
-    <!-- LOD MESH-->
+     LOD MESH
     <panel
       follows="top|left"
       name="mesh"
@@ -239,7 +238,7 @@
     <spinner follows="left|top" name="share_tolerance" left_pad="5" width="100" decimal_digits="5" initial_value="0.00001" height="20"/>
     </panel>
     
-    <!-- LOD GENERATE NORMALS-->
+     LOD GENERATE NORMALS
     <panel
       follows="top|left"
       name="generate normals"
@@ -262,22 +261,28 @@
       </panel>
       <!-- PHYSYCS PANEL -->
       <panel
-        border="true"
         label="Physics"
         name="physics_panel"
         help_topic="upload_model_physics">
-    
-        <!-- PHYSICS GEOMETRY-->
+         <view_border
+          bevel_style="none"
+          follows="top|left"
+          height="275"
+          layout="topleft"
+          left="3"
+          name="physics_tab_border"
+          top_pad="0"
+          width="519"/>
+         PHYSICS GEOMETRY
         <panel
           follows="top|left"
           name="physics geometry"
-          left="0"
+          left="3"
           top="0"
           width="300"
           height="65"
           visible="true"
-          border="true"
-          bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
+          bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
     
           <radio_group follows="top|left" top="10" width="240" height="40" name="physics_load_radio" value="physics_load_from_file">
             <radio_item bottom="0" name="physics_load_from_file" label="File:"/>
@@ -303,14 +308,14 @@
           <line_editor follows="left|top" top_pad="5" width="140" left="60" value="" name="physics_file" height="20"/>
           <button left_pad="10" name="physics_browse" label="Browse..." follows="left|top" width="70" height="20"/>
     
-          <!--
+          
           <check_box name="physics_optimize" follows="left|top" width="130" left="10" top_pad="5" height="20" label="Optimize"/>
           <check_box name="physics_use_hull" follows="left|top" width="130" left_pad="5" height="20" label="Use Convex Hull"/>
-          -->
+          
        </panel>
     
     
-        <!-- PHYSICS ANALYSIS-->
+         PHYSICS ANALYSIS
         <panel
          follows="top|left"
          name="physics analysis"
@@ -319,8 +324,7 @@
          width="300"
          height="130"
          visible="true"
-         border="true"
-         bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
+         bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
     
           <text follows="left|top" bottom="40" height="30" left="10" name="method_label" font="SansSerifBig">
             Step 1: Analysis
@@ -344,7 +348,7 @@
         </panel>
         
     
-        <!-- PHYSICS SIMPLIFICATION -->
+         PHYSICS SIMPLIFICATION 
        <panel
          follows="top|left"
          name="physics simplification"
@@ -353,8 +357,7 @@
          width="300"
          height="150"
          visible="true"
-         border="true"
-         bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
+         bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
     
           <text follows="left|top" bottom="40" height="30" left="10" name="second_step_label" font="SansSerifBig">
             Step 2: Simplification
@@ -374,7 +377,7 @@
           
         </panel>
     
-        <!-- INFO PANEL -->
+         INFO PANEL 
         <panel
           left="0"
           top_pad="0"
@@ -383,8 +386,7 @@
           follows="left|top"
           name="physics info"
           visible="true"
-          border="true" 
-          bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
+          bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
           
           <text follows="top|left" name="physics_triangles" top_pad="10" height="15" left="10">
             Triangles: [TRIANGLES]
@@ -401,43 +403,107 @@
       </panel>
       <!-- MODIFIERS PANEL -->
       <panel
-       border="true"
        label="Modifiers"
        name="modifiers_panel"
        help_topic="upload_model_modifiers">
-         <text left="10" name="scale_label" width="90" bottom="30" follows="top|left" height="15">
-           Scale:
-         </text>
-         <text left_pad="5" name="dimensions_label" width="140" follows="top|left" height="15">
-           Dimensions:
-         </text>
-         
-         <spinner left="10" height="20" follows="top|left" width="80" top_pad="5" value="1.0" min_val="0.01" max_val="64.0" name="import_scale"/>
-         
-         <text left_pad="20" height="15" width="140" name="import_dimensions" follows="top|left">
-           [X] x [Y] x [Z] m
-         </text>
-         
-         <text left="10" name="include_label" top_pad="20" follows="top|left" height="15">
-           Include:
-         </text>
-         
-         <check_box top_pad="5" name="upload_textures" height="15" follows="top|left" label="Textures"/>
-         <check_box top_pad="5" name="upload_skin" height="15" follows="top|left" label="Skin weight"/>
-         <check_box top_pad="5" left="20" name="upload_joints" height="15" follows="top|left" label="Joint positions"/>
-         
-         <text left="10" name="pelvis_offset_label" top_pad="4" width="90" bottom="30" follows="top|left" height="15">
-           Pelvis Z Offset:
-         </text>
-         
-         <spinner left="10" top_pad="4" height="20" follows="top|left" width="80" value="0.0" min_val="-3.00" max_val="3.0" name="pelvis_offset"/>
-      </panel>
+         <view_border
+          bevel_style="none"  
+          follows="top|left"
+          height="275"
+          layout="topleft"
+          left="3"
+          name="border"
+          top_pad="0"
+          width="519"/>
+           <text
+             follows="top|left"
+             height="16"
+             left="10"
+             name="scale_label"
+             top="25"
+             width="140">
+             Scale (1=no change):
+           </text>
+           <spinner
+             height="20"
+             follows="top|left"
+             left_pad="10"
+             max_val="64.0"
+             min_val="0.01"
+             name="import_scale"
+             top_delta="-4"
+             value="1.0"
+             width="80"/>
+           <text
+             follows="top|left"
+             height="15"
+             left_pad="5"
+             name="dimensions_label"
+             width="90">
+             Dimensions:
+           </text>
+           <text
+             follows="top|left"
+             height="15"
+             left_pad="0"
+             name="import_dimensions"
+             width="140">
+             [X] X [Y] X [Z]
+           </text>
+           <text
+             follows="top|left"
+             height="15"
+             left="10"
+             name="include_label"
+             top_pad="20"
+             width="150">
+             Include in upload:
+           </text>
+           <check_box
+             height="15"
+             follows="top|left"
+             name="upload_textures"
+             label="Textures"
+             left_delta="0"
+             top_pad="10"/>
+           <check_box
+             follows="top|left"
+             height="15"
+             label="Skin weight"
+             name="upload_skin"
+             top_pad="10"/>
+           <check_box
+             follows="top|left"
+             height="15"
+             label="Joint positions"
+             name="upload_joints"
+             top_pad="10"/>
+           <text
+             follows="top|left"
+             height="15"
+             layout="topleft"
+             left="200"
+             name="pelvis_offset_label"
+             top="61"
+             width="200">
+             Z Offset (for avatar shapes only):
+           </text>
+           <spinner
+             follows="top|left"
+             height="20"
+             min_val="-3.00"
+             max_val="3.0"
+             name="pelvis_offset"
+             top_pad="10"
+             value="0.0"
+             width="80"/>
+       </panel>
     </tab_container>
     <panel
-     follows="all"
+     follows="top|left"
      height="80"
      layout="top|left"
-     left="3"
+     left="0"
      name="weights_and_warning_panel"
      top_pad="3"
      width="525">
@@ -573,7 +639,7 @@
 <panel
  border="true"
  bevel_style="none"
- follows="all"
+ follows="top|left"
  name="preview_panel"
  top_pad="4"
  width="290"
@@ -592,30 +658,18 @@
       height="18"
       layout="topleft"
       name="preview_lod_combo"
-      width="120"
+      width="150"
       tool_tip="LOD to view in preview render">
         <combo_item name="high">   High  LoD   </combo_item>
         <combo_item name="medium"> Medium LoD  </combo_item>
         <combo_item name="low">    Low LoD     </combo_item>
         <combo_item name="lowest"> Lowest  LoD </combo_item>
     </combo_box>
-    <menu_button
-      follows="top|left"
-      image_hover_unselected="Toolbar_Left_Over"
-      image_overlay="OptionsMenu_Off"
-      image_selected="Toolbar_Left_Selected"
-      image_unselected="Toolbar_Left_Off"
-      layout="topleft"
-      left_pad="5"
-      top_delta="0"
-      name="options_gear_btn"
-      width="31"
-      height="25"/>
     <text
       follows="top|left"
       layout="topleft"
       top="5"
-      left_pad="10"
+      left_pad="20"
       name="label_display"
       width="50">
       Display...
@@ -625,35 +679,35 @@
       label="Edges"
       layout="topleft"
       left_delta="0"
-      name="disp_edges_chb"
+      name="show_edges"
       top_pad="8">
     </check_box>
     <check_box
       follows="top|left"
       label="Physics"
       layout="topleft"
-      name="disp_physics_chb"
+      name="show_physics"
       top_pad="8">
     </check_box>
     <check_box
       follows="top|left"
       label="Textures"
       layout="topleft"
-      name="disp_textures_chb"
+      name="show_textures"
       top_pad="8">
     </check_box>
     <check_box
       follows="top|left"
       label="Skin weights"
       layout="topleft"
-      name="disp_skin_chb"
+      name="show_skin_weight"
       top_pad="8">
     </check_box>
     <check_box
       follows="top|left"
       label="Joints"
       layout="topleft"
-      name="disp_joints_chb"
+      name="show_joint_positions"
       top_pad="8">
     </check_box>
     <text
@@ -661,7 +715,8 @@
       layout="topleft"
       left="2"
       name="physics_explode_label"
-      top="85">
+      top="85"
+      width="150">
       Preview Spread:
     </text>
     <slider
-- 
cgit v1.2.3


From f8d68b088782567c2b0023cf693896368d97babb Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Fri, 26 Aug 2011 18:04:44 -0400
Subject: SH-862 FIX re-scaling render weight algorithm

We were double-counting the factor of scale both through
the streaming cost algorithm, as well as another multiplier
in the render cost algorithm. This caused objects at small scales
to have little cost difference regardless of amount of geometry,
due to minimum costs.

Eliminated extra scale factor, and instead scaled number of triangles
up by a constant factor to keep the balance between geometry and texture
costs sane.
---
 indra/newview/llvovolume.cpp | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index eac2f3d1b0..ddf7d9dd1d 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -3012,9 +3012,6 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 	U32 produces_light = 0;
 	U32 media_faces = 0;
 
-	// these multipliers are variable and can be floating point
-	F32 scale = 0.f;
-
 	const LLDrawable* drawablep = mDrawable;
 	U32 num_faces = drawablep->getNumFaces();
 
@@ -3029,8 +3026,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 
 		if (weighted_triangles > 0.0)
 		{
-			num_triangles = (U32)(weighted_triangles * 2); // scale weighted triangles to match the recorded scale.
-															// a complex prim (tortured torus, sculptie) should be 1000-1200 points @ 5 m
+			num_triangles = (U32)(weighted_triangles); 
 		}
 	}
 
@@ -3091,12 +3087,6 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 		produces_light = 1;
 	}
 
-	const LLVector3& sc = getScale();
-	scale += (sc.mV[0] + sc.mV[1] + sc.mV[2]) / 4.f; // scale to 1/4 the sum of the size
-	// enforce scale multiplier to be in the range [1,7] (7 was determined to experimentally be a reasonable max)
-	scale = scale > 7.f ? 7.f : scale;
-	scale = scale < 1.f ? 1.f : scale;
-
 	for (S32 i = 0; i < num_faces; ++i)
 	{
 		const LLFace* face = drawablep->getFace(i);
@@ -3154,12 +3144,9 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
 	}
 
 	// shame currently has the "base" cost of 1 point per 15 triangles, min 2.
-	shame = num_triangles / 15.f;
+	shame = num_triangles  * 5.f;
 	shame = shame < 2.f ? 2.f : shame;
 
-	// factor in scale
-	shame *= scale;
-
 	// multiply by per-face modifiers
 	if (planar)
 	{
-- 
cgit v1.2.3


From 8cef480b96dc779c5879f74224fb0a185ee550f2 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Mon, 29 Aug 2011 18:15:38 -0600
Subject: fix for SH-2311: crash at LLVOVolume::lineSegmentIntersect line 3435
 and SH-2358: Crash in LLError::crashAndLoop: Invalid face index

---
 indra/llmath/llvolume.cpp    | 2 +-
 indra/newview/llvovolume.cpp | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index b2fe9ba6c2..1a95f9cd46 100755
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -2734,7 +2734,7 @@ void LLVolume::cacheOptimize()
 
 S32	LLVolume::getNumFaces() const
 {
-	return (S32)mProfilep->mFaces.size();
+	return mIsMeshAssetLoaded ? getNumVolumeFaces() : (S32)mProfilep->mFaces.size();
 }
 
 
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index d3ef1771c3..6b0a5d8642 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1660,11 +1660,16 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable)
 			compiled = TRUE;
 			sNumLODChanges += new_num_faces ;
 	
+			if((S32)getNumTEs() != getVolume()->getNumFaces())
+			{
+				setNumTEs(getVolume()->getNumFaces()); //mesh loading may change number of faces.
+			}
+
 			drawable->setState(LLDrawable::REBUILD_VOLUME); // for face->genVolumeTriangles()
 
 			{
 				LLFastTimer t(FTM_GEN_TRIANGLES);
-				if (new_num_faces != old_num_faces)
+				if (new_num_faces != old_num_faces || mNumFaces != (S32)getNumTEs())
 				{
 					regenFaces();
 				}
-- 
cgit v1.2.3


From 71ac45a28b238bac4ac0cf43ee85f04589ffa116 Mon Sep 17 00:00:00 2001
From: prep linden <prep@lindenlab.com>
Date: Tue, 30 Aug 2011 09:32:16 -0400
Subject: Handling of material mismatches - lod materials are required to be a
 subset of the high lod, introduced addEmptyFace() for when parity does not
 exist between model material counts

---
 indra/llprimitive/llmodel.cpp           | 61 +++++++++++++++++++++++++++++++--
 indra/llprimitive/llmodel.h             |  6 ++--
 indra/newview/llfloatermodelpreview.cpp | 57 ++++++++++++++++++++++++++----
 indra/newview/llfloatermodelpreview.h   |  3 +-
 4 files changed, 116 insertions(+), 11 deletions(-)

diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index d8e4d4a173..d13e6b662c 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -1903,14 +1903,70 @@ bool LLModel::loadModel(std::istream& is)
 
 }
 
-void LLModel::matchMaterialOrder(LLModel* ref)
+bool LLModel::isMaterialListSubset( LLModel* ref )
 {
-	llassert(ref->mMaterialList.size() == mMaterialList.size());
+	int refCnt = ref->mMaterialList.size();
+	int modelCnt = mMaterialList.size();
+	
+	for (U32 src = 0; src < modelCnt; ++src)
+	{				
+		bool foundRef = false;
+		
+		for (U32 dst = 0; dst < refCnt; ++dst)
+		{
+			//llinfos<<mMaterialList[src]<<" "<<ref->mMaterialList[dst]<<llendl;
+			foundRef = mMaterialList[src] == ref->mMaterialList[dst];									
+				
+			if ( foundRef )
+			{	
+				break;
+			}										
+		}
+		if (!foundRef)
+		{
+			return false;
+		}
+	}
+	
+	return true;
+}
+
+bool LLModel::needToAddFaces( LLModel* ref, int& refFaceCnt, int& modelFaceCnt )
+{
+	bool changed = false;
+	if ( refFaceCnt< modelFaceCnt )
+	{
+		refFaceCnt += modelFaceCnt - refFaceCnt;
+		changed = true;
+	}
+	else 
+	if ( modelFaceCnt < refFaceCnt )
+	{
+		modelFaceCnt += refFaceCnt - modelFaceCnt;
+		changed = true;
+	}
+	
+	return changed;
+}
 
+bool LLModel::matchMaterialOrder(LLModel* ref, int& refFaceCnt, int& modelFaceCnt )
+{
+	//Is this a subset?
+	//LODs cannot currently add new materials, e.g.
+	//1. ref = a,b,c lod1 = d,e => This is not permitted
+	//2. ref = a,b,c lod1 = c => This would be permitted
+	
+	bool isASubset = isMaterialListSubset( ref );
+	if ( !isASubset )
+	{
+		return false;
+	}
+	
 	std::map<std::string, U32> index_map;
 	
 	//build a map of material slot names to face indexes
 	bool reorder = false;
+
 	std::set<std::string> base_mat;
 	std::set<std::string> cur_mat;
 
@@ -1952,6 +2008,7 @@ void LLModel::matchMaterialOrder(LLModel* ref)
 
 	//override material list with reference model ordering
 	mMaterialList = ref->mMaterialList;
+	return true;
 }
 
 
diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h
index 9a7b9fa271..1cf528fd9f 100644
--- a/indra/llprimitive/llmodel.h
+++ b/indra/llprimitive/llmodel.h
@@ -176,8 +176,10 @@ public:
 	
 	//reorder face list based on mMaterialList in this and reference so 
 	//order matches that of reference (material ordering touchup)
-	void matchMaterialOrder(LLModel* reference);
-
+	bool matchMaterialOrder(LLModel* ref, int& refFaceCnt, int& modelFaceCnt );
+	bool isMaterialListSubset( LLModel* ref );
+	bool needToAddFaces( LLModel* ref, int& refFaceCnt, int& modelFaceCnt );
+	
 	std::vector<std::string> mMaterialList;
 
 	//data used for skin weights
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index b1b5e69968..80db002f0e 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -3186,8 +3186,14 @@ void LLModelPreview::rebuildUploadData()
 		{
 			for (U32 j = 0; j < mBaseModel.size(); ++j)
 			{
-				mModel[i][j]->matchMaterialOrder(mBaseModel[j]);
-				llassert(mModel[i][j]->mMaterialList == mBaseModel[j]->mMaterialList);
+				
+				int refFaceCnt = 0;
+				int modelFaceCnt = 0;
+				
+				if ( !mModel[i][j]->matchMaterialOrder(mBaseModel[j], refFaceCnt, modelFaceCnt ) )
+				{
+					mFMP->childDisable( "calculate_btn" );
+				}
 			}
 		}
 	}
@@ -4765,6 +4771,42 @@ void LLModelPreview::createPreviewAvatar( void )
 	}
 }
 
+void LLModelPreview::addEmptyFace( LLModel* pTarget )
+{
+	U32 type_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0;
+	
+	LLPointer<LLVertexBuffer> buff = new LLVertexBuffer(type_mask, 0);
+	
+	buff->allocateBuffer(1, 3, true);
+	memset( buff->getMappedData(), 0, buff->getSize() );
+	memset( buff->getIndicesPointer(), 0, buff->getIndicesSize() );
+		
+	buff->validateRange( 0, buff->getNumVerts()-1, buff->getNumIndices(), 0 );
+		
+	LLStrider<LLVector3> pos;
+	LLStrider<LLVector3> norm;
+	LLStrider<LLVector2> tc;
+	LLStrider<U16> index;
+		
+	buff->getVertexStrider(pos);
+		
+	if ( type_mask & LLVertexBuffer::MAP_NORMAL )
+	{
+		buff->getNormalStrider(norm);
+	}
+	if ( type_mask & LLVertexBuffer::MAP_TEXCOORD0 )
+	{
+		buff->getTexCoord0Strider(tc);
+	}
+		
+	buff->getIndexStrider(index);
+		
+	//resize face array
+	int faceCnt = pTarget->getNumVolumeFaces();
+	pTarget->setNumVolumeFaces( faceCnt+1 );	
+	pTarget->setVolumeFaceData( faceCnt+1, pos, norm, tc, index, buff->getNumVerts(), buff->getNumIndices() );
+	
+}	
 //-----------------------------------------------------------------------------
 // render()
 //-----------------------------------------------------------------------------
@@ -4976,8 +5018,13 @@ BOOL LLModelPreview::render()
 			{
 				for (U32 j = 0; j < mBaseModel.size(); ++j)
 				{
-					mModel[i][j]->matchMaterialOrder(mBaseModel[j]);
-					llassert(mModel[i][j]->mMaterialList == mBaseModel[j]->mMaterialList);
+					int refFaceCnt = 0;
+					int modelFaceCnt = 0;
+										
+					if ( !mModel[i][j]->matchMaterialOrder(mBaseModel[j], refFaceCnt, modelFaceCnt ) )
+					{
+						mFMP->childDisable( "calculate_btn" );
+					}
 				}
 			}
 		}
@@ -5019,8 +5066,6 @@ BOOL LLModelPreview::render()
 							const std::string& binding = instance.mModel->mMaterialList[i];						
 							const LLImportMaterial& material = instance.mMaterial[binding];
 
-							llassert(binding == model->mMaterialList[i]);
-						
 							glColor4fv(material.mDiffuseColor.mV);
 							if (material.mDiffuseMap.notNull())
 							{
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index f383b3fe98..723e8c48b8 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -336,7 +336,8 @@ public:
 	void updateStatusMessages();
 	void clearGLODGroup();
 	void onLODParamCommit(bool enforce_tri_limit);
-
+	void addEmptyFace( LLModel* pTarget );
+	
 	const bool getModelPivot( void ) const { return mHasPivot; }
 	void setHasPivot( bool val ) { mHasPivot = val; }
 	void setModelPivot( const LLVector3& pivot ) { mModelPivot = pivot; }
-- 
cgit v1.2.3


From 2df669c402b5344397499186e73d0886dd5da4d1 Mon Sep 17 00:00:00 2001
From: prep linden <prep@lindenlab.com>
Date: Tue, 30 Aug 2011 10:46:41 -0400
Subject: Log error message if material list is not a subset of reference model

---
 indra/llprimitive/llmodel.cpp                                | 1 +
 indra/newview/skins/default/xui/en/floater_model_preview.xml | 1 +
 2 files changed, 2 insertions(+)

diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index d13e6b662c..6e4bb7ec97 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -1959,6 +1959,7 @@ bool LLModel::matchMaterialOrder(LLModel* ref, int& refFaceCnt, int& modelFaceCn
 	bool isASubset = isMaterialListSubset( ref );
 	if ( !isASubset )
 	{
+		llinfos<<"Material of model is not a subset of reference."<<llendl;
 		return false;
 	}
 	
diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index 7c6896becf..259d2e70b6 100755
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -21,6 +21,7 @@
   <string name="mesh_status_mesh_mismatch">Levels of detail have a different number of mesh instances.</string>
   <string name="mesh_status_too_many_vertices">Level of detail has too many vertices.</string>
   <string name="mesh_status_missing_lod">Missing required level of detail.</string>
+  <string name="mesh_status_invalid_material_list">LOD materials are not a subset of reference model.</string>
   <string name="layer_all">All</string> <!-- Text to display in physics layer combo box for "all layers" -->
   <string name="decomposing">Analyzing...</string>
   <string name="simplifying">Simplifying...</string>
-- 
cgit v1.2.3


From 5e5869c63a05e3d773fc4d19deaff171efa5014c Mon Sep 17 00:00:00 2001
From: prep linden <prep@lindenlab.com>
Date: Tue, 30 Aug 2011 14:59:52 -0400
Subject: Fix for Sh-2350

---
 indra/newview/llfloatermodelpreview.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 80db002f0e..0f0f593749 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -2204,7 +2204,15 @@ void LLModelLoader::processJointToNodeMapping( domNode* pNode )
 		//Determine if the're any children wrt to this failed node.
 		//This occurs when an armature is exported and ends up being what essentially amounts to
 		//as the root for the visual_scene
-		processChildJoints( pNode );
+		if ( pNode ) 
+		{
+			processChildJoints( pNode );
+		}
+		else 
+		{
+			llinfos<<"Node is NULL"<<llendl;
+		}
+
 	}
 }
 //-----------------------------------------------------------------------------
-- 
cgit v1.2.3


From 55c220779223682260c5299ec13c17d19bf6ca4e Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Wed, 31 Aug 2011 17:02:15 +0300
Subject: SH-2309 WIP Priority modifications to mesh uploader UI

Made next changes according to the last version of UI spec:

- Modified Upload Options tab
- Modified Physics tab
- Modified the floater overall
---
 indra/newview/llfloatermodelpreview.cpp            | 100 ++--
 indra/newview/llfloatermodelpreview.h              |   2 -
 indra/newview/skins/default/colors.xml             |   3 +
 .../skins/default/xui/en/floater_model_preview.xml | 588 ++++++++++++++-------
 4 files changed, 474 insertions(+), 219 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index dd652b32a7..276f513abf 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -431,7 +431,6 @@ BOOL LLFloaterModelPreview::postBuild()
 	childSetCommitCallback("pelvis_offset", onPelvisOffsetCommit, this);
 
 	childSetCommitCallback("lod_file_or_limit", refresh, this);
-	childSetCommitCallback("physics_load_radio", onPhysicsLoadRadioCommit, this);
 	//childSetCommitCallback("physics_optimize", refresh, this);
 	//childSetCommitCallback("physics_use_hull", refresh, this);
 
@@ -640,29 +639,6 @@ void LLFloaterModelPreview::onPelvisOffsetCommit( LLUICtrl*, void* userdata )
 	fp->mModelPreview->refresh();
 }
 
-//static
-void LLFloaterModelPreview::onPhysicsLoadRadioCommit( LLUICtrl*, void *userdata)
-{
-	LLFloaterModelPreview* fmp = LLFloaterModelPreview::sInstance;
-	if (fmp)
-	{
-		if (fmp->childGetValue("physics_use_lod").asBoolean())
-		{
-			onPhysicsUseLOD(NULL,NULL);
-		}
-		if (fmp->childGetValue("physics_load_from_file").asBoolean())
-		{
-			
-		}
-		LLModelPreview *model_preview = fmp->mModelPreview;
-		if (model_preview)
-		{
-			model_preview->refresh();
-			model_preview->updateStatusMessages();
-		}
-	}
-}
-
 //static
 void LLFloaterModelPreview::onUploadJointsCommit(LLUICtrl*,void* userdata)
 {
@@ -935,16 +911,20 @@ void LLFloaterModelPreview::onPhysicsParamCommit(LLUICtrl* ctrl, void* data)
 
 		if (name == "Simplify Method")
 		{
-			 if (ctrl->getValue().asInteger() == 0)
-			 {
-				sInstance->childSetVisible("Retain%", true);
-				sInstance->childSetVisible("Detail Scale", false);
-			 }
-			else
+			bool show_retain = false;
+			bool show_detail = true;
+
+			if (ctrl->getValue().asInteger() == 0)
 			{
-				sInstance->childSetVisible("Retain%", false);
-				sInstance->childSetVisible("Detail Scale", true);
+				 show_retain = true;
+				 show_detail = false;
 			}
+
+			sInstance->childSetVisible("Retain%", show_retain);
+			sInstance->childSetVisible("Retain%_label", show_retain);
+
+			sInstance->childSetVisible("Detail Scale", show_detail);
+			sInstance->childSetVisible("Detail Scale label", show_detail);
 		}
 	}
 }
@@ -1001,13 +981,35 @@ void LLFloaterModelPreview::onPhysicsBrowse(LLUICtrl* ctrl, void* userdata)
 void LLFloaterModelPreview::onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata)
 {
 	S32 which_mode = 3;
+	static S32 previous_mode = which_mode;
+
 	LLCtrlSelectionInterface* iface = sInstance->childGetSelectionInterface("physics_lod_combo");
 	if (iface)
 	{
 		which_mode = iface->getFirstSelectedIndex();
 	}
 
-	sInstance->mModelPreview->setPhysicsFromLOD(which_mode);
+	S32 file_mode = iface->getItemCount() - 1;
+	bool file_browse = which_mode == file_mode;
+	bool lod_to_file = file_browse && (previous_mode != file_mode);
+	bool file_to_lod = !file_browse && (previous_mode == file_mode);
+
+	if (!lod_to_file)
+	{
+		sInstance->mModelPreview->setPhysicsFromLOD(which_mode);
+	}
+
+	if (lod_to_file || file_to_lod)
+	{
+		LLModelPreview *model_preview = sInstance->mModelPreview;
+		if (model_preview)
+		{
+			model_preview->refresh();
+			model_preview->updateStatusMessages();
+		}
+	}
+
+	previous_mode = which_mode;
 }
 
 //static 
@@ -1099,8 +1101,9 @@ void LLFloaterModelPreview::initDecompControls()
 				mDecompParams[param[i].mName] = LLSD(param[i].mDefault.mFloat);
 				//llinfos << "Type: float, Default: " << param[i].mDefault.mFloat << llendl;
 
-				LLSliderCtrl* slider = getChild<LLSliderCtrl>(name);
-				if (slider)
+
+				LLUICtrl* ctrl = getChild<LLUICtrl>(name);
+				if (LLSliderCtrl* slider = dynamic_cast<LLSliderCtrl*>(ctrl))
 				{
 					slider->setMinValue(param[i].mDetails.mRange.mLow.mFloat);
 					slider->setMaxValue(param[i].mDetails.mRange.mHigh.mFloat);
@@ -1108,14 +1111,23 @@ void LLFloaterModelPreview::initDecompControls()
 					slider->setValue(param[i].mDefault.mFloat);
 					slider->setCommitCallback(onPhysicsParamCommit, (void*) &param[i]);
 				}
+				else if (LLSpinCtrl* spinner = dynamic_cast<LLSpinCtrl*>(ctrl))
+				{
+					spinner->setMinValue(param[i].mDetails.mRange.mLow.mFloat);
+					spinner->setMaxValue(param[i].mDetails.mRange.mHigh.mFloat);
+					spinner->setIncrement(param[i].mDetails.mRange.mDelta.mFloat);
+					spinner->setValue(param[i].mDefault.mFloat);
+					spinner->setCommitCallback(onPhysicsParamCommit, (void*) &param[i]);
+				}
 			}
 			else if (param[i].mType == LLCDParam::LLCD_INTEGER)
 			{
 				mDecompParams[param[i].mName] = LLSD(param[i].mDefault.mIntOrEnumValue);
 				//llinfos << "Type: integer, Default: " << param[i].mDefault.mIntOrEnumValue << llendl;
 
-				LLSliderCtrl* slider = getChild<LLSliderCtrl>(name);
-				if (slider)
+
+				LLUICtrl* ctrl = getChild<LLUICtrl>(name);
+				if (LLSliderCtrl* slider = dynamic_cast<LLSliderCtrl*>(ctrl))
 				{
 					slider->setMinValue(param[i].mDetails.mRange.mLow.mIntOrEnumValue);
 					slider->setMaxValue(param[i].mDetails.mRange.mHigh.mIntOrEnumValue);
@@ -1123,6 +1135,16 @@ void LLFloaterModelPreview::initDecompControls()
 					slider->setValue(param[i].mDefault.mIntOrEnumValue);
 					slider->setCommitCallback(onPhysicsParamCommit, (void*) &param[i]);
 				}
+				else if (LLComboBox* combo_box = dynamic_cast<LLComboBox*>(ctrl))
+				{
+					for(int k = param[i].mDetails.mRange.mLow.mIntOrEnumValue; k<=param[i].mDetails.mRange.mHigh.mIntOrEnumValue; k+=param[i].mDetails.mRange.mDelta.mIntOrEnumValue)
+					{
+						std::string name = llformat("%.1d", k);
+						combo_box->add(name, k, ADD_BOTTOM, true);
+					}
+					combo_box->setValue(param[i].mDefault.mIntOrEnumValue);
+					combo_box->setCommitCallback(onPhysicsParamCommit, (void*) &param[i]);
+				}
 			}
 			else if (param[i].mType == LLCDParam::LLCD_BOOLEAN)
 			{
@@ -4528,15 +4550,13 @@ void LLModelPreview::updateStatusMessages()
 		}
 	}
 
-	if (mFMP->childGetValue("physics_load_from_file").asBoolean())
+	if (mFMP->childGetValue("physics_lod_combo").asString() == "From file")
 	{
-		mFMP->childDisable("physics_lod_combo");
 		mFMP->childEnable("physics_file");
 		mFMP->childEnable("physics_browse");
 	}
 	else
 	{
-		mFMP->childEnable("physics_lod_combo");
 		mFMP->childDisable("physics_file");
 		mFMP->childDisable("physics_browse");
 	}
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index 9bc8207613..a8fd02443e 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -217,8 +217,6 @@ protected:
 	static void		onPelvisOffsetCommit(LLUICtrl*, void*);
 	static void		onUploadJointsCommit(LLUICtrl*,void*);
 	static void		onUploadSkinCommit(LLUICtrl*,void*);
-	
-	static void		onPhysicsLoadRadioCommit(LLUICtrl*,void *data);
 
 	static void		onPreviewLODCommit(LLUICtrl*,void*);
 	
diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml
index 31b6fc77f5..041b72a28e 100644
--- a/indra/newview/skins/default/colors.xml
+++ b/indra/newview/skins/default/colors.xml
@@ -84,6 +84,9 @@
 	name="LtYellow"
 	value="1 1 .79 1" />
 	<color
+	name="DrYellow"
+	value="1 0.86 0 1" />
+	<color
 	name="LtOrange"
 	value="1 .85 .73 1" />
 	<color
diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index 2436c48b0f..ac3978938a 100755
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater can_close="true" can_drag_on_left="false" can_minimize="false"
-     can_resize="false" height="480" min_height="480" min_width="840"
-     name="Model Preview" title="Upload Model" width="840"
+     can_resize="false" height="480" min_height="480" min_width="940"
+     name="Model Preview" title="Upload Model" width="940"
       help_topic="upload_model" >
 
   <string name="status_idle">Idle</string>
@@ -33,7 +33,7 @@
   left="3"
   name="left_panel"
   top_pad="10"
-  width="530">
+  width="630">
     <panel
       follows="all"
       height="50"
@@ -47,6 +47,7 @@
           height="15"
           left="15"
           name="name_label"
+          text_color="White"
           top="0"
           width="290">
           Model name:
@@ -83,8 +84,8 @@
           <combo_item name="Choose one" label="Choose One..." value="MUT_Unspecified"/>
           <combo_item name="Avatar shape" label="Avatar shape" value="MUT_AvatarShape"/>
           <combo_item name="Avatar attachment" label="Avatar attachment" value="MUT_AvatarAttachment"/>
-          <combo_item name="Building Component" label="Building Component" value="MUT_BuildingComponent"/>
           <combo_item name="Moving object (vehicle, animal)" label="Moving object (vehicle, animal)" value="MUT_MovingObject"/>
+          <combo_item name="Building Component" label="Building Component" value="MUT_BuildingComponent"/>
           <combo_item name="Large, non moving etc" label="Large, non moving etc" value="MUT_LargeStationary"/>
           <combo_item name="Smaller, non-moving etc" label="Smaller, non-moving etc" value="MUT_SmallStationary"/>
           <combo_item name="Not really any of these" label="Not really any of these" value="MUT_Other"/>
@@ -95,7 +96,7 @@
       top_pad="15"
       left="0"
       height="300"
-      width="525"
+      width="625"
       name="import_tab"
       tab_position="top">
       <!-- LOD PANEL -->
@@ -260,150 +261,356 @@
     </panel>
       </panel>
       <!-- PHYSYCS PANEL -->
-      <panel
-        label="Physics"
-        name="physics_panel"
-        help_topic="upload_model_physics">
-         <view_border
-          bevel_style="none"
-          follows="top|left"
-          height="275"
-          layout="topleft"
-          left="3"
-          name="physics_tab_border"
-          top_pad="0"
-          width="519"/>
-         PHYSICS GEOMETRY
-        <panel
-          follows="top|left"
-          name="physics geometry"
-          left="3"
-          top="0"
-          width="300"
-          height="65"
-          visible="true"
-          bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
-    
-          <radio_group follows="top|left" top="10" width="240" height="40" name="physics_load_radio" value="physics_load_from_file">
-            <radio_item bottom="0" name="physics_load_from_file" label="File:"/>
-            <radio_item bottom="23" name="physics_use_lod" label="Use Level of Detail:"/>
-          </radio_group>
-    
-          <combo_box left="150" top="10" follows="left|top" height="18"
- 	         name="physics_lod_combo" width="130" tool_tip="LOD to use for physics shape">
-            <combo_item name="physics_lowest">
-              Lowest
-            </combo_item>
-            <combo_item name="physics_low">
-              Low
-            </combo_item>
-            <combo_item name="physics_medium">
-              Medium
-            </combo_item>
-            <combo_item name="physics_high">
-              High
-            </combo_item>
-          </combo_box>
-    
-          <line_editor follows="left|top" top_pad="5" width="140" left="60" value="" name="physics_file" height="20"/>
-          <button left_pad="10" name="physics_browse" label="Browse..." follows="left|top" width="70" height="20"/>
-    
-          
-          <check_box name="physics_optimize" follows="left|top" width="130" left="10" top_pad="5" height="20" label="Optimize"/>
-          <check_box name="physics_use_hull" follows="left|top" width="130" left_pad="5" height="20" label="Use Convex Hull"/>
-          
-       </panel>
-    
-    
-         PHYSICS ANALYSIS
-        <panel
-         follows="top|left"
-         name="physics analysis"
-         top_pad="0"
-         left="0"
-         width="300"
-         height="130"
-         visible="true"
-         bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
-    
-          <text follows="left|top" bottom="40" height="30" left="10" name="method_label" font="SansSerifBig">
-            Step 1: Analysis
-          </text>
-          
-          <text name="analysis_method_label" top_pad="5" width="50" follows="top|left" height="15">
-            Method:
-          </text>
-          <combo_box name="Method" follows="top|left" left_pad="5" bottom_delta="2" height="20" width="80"/>
-          <text left="160" name="quality_label" bottom_delta="-2" width="50" follows="top|left" height="15">
-            Quality:
-          </text>
-          <combo_box name="Decompose Quality" bottom_delta="2" follows="top|left" left_pad="5" height="20" width="80"/>
-    
-          <slider name="Smooth" left="10" width="280" follows="top|left" top_pad="10" height="20" label="Smooth:"/>
-    
-          <check_box name="Close Holes (Slow)" follows="top|left" top_pad="10" height="15" label="Close Holes (slow)"/>
-                  
-          <button left="200" bottom_delta="0" width="90" follows="top|left" label="Analyze" name="Decompose" height="20"/>
-          <button left="200" bottom_delta="0" width="90" follows="top|left" label="Cancel" name="decompose_cancel" visble="false" height="20"/>
-        </panel>
-        
-    
-         PHYSICS SIMPLIFICATION 
-       <panel
-         follows="top|left"
-         name="physics simplification"
-         left="0"
-         top_pad="0"
-         width="300"
-         height="150"
-         visible="true"
-         bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
-    
-          <text follows="left|top" bottom="40" height="30" left="10" name="second_step_label" font="SansSerifBig">
-            Step 2: Simplification
-          </text>
-    
-          <text left="10" name="simp_method_header" top_pad="5" height="15" width="140" follows="top|left">
-            Method:
-          </text>
-          
-          <combo_box left_pad="5" height="20" width="120" follows="top|left" name="Simplify Method"/>
-    
-          <slider left="10" name="Combine Quality" label="Passes:" label_width="120" width="270" follows="top|left" top_pad="10" height="20"/>
-          <slider name="Detail Scale" label="Detail Scale:" label_width="120" width="270" follows="top|left" top_pad="10" height="20"/>
-          <slider name="Retain%" label="Retain:" label_width="120" width="270" follows="top|left" bottom_delta="0" left_delta="0" visible="false" height="20"/>
-          <button left="190" width="90" follows="top|left" label="Simplify" name="Simplify" height="20"/>
-          <button left="190" bottom_delta="0" width="90" follows="top|left" label="Cancel" name="simplify_cancel" height="20"/>
-          
-        </panel>
-    
-         INFO PANEL 
         <panel
-          left="0"
-          top_pad="0"
-          width="300"
-          height="100"
-          follows="left|top"
-          name="physics info"
-          visible="true"
-          bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
-          
-          <text follows="top|left" name="physics_triangles" top_pad="10" height="15" left="10">
-            Triangles: [TRIANGLES]
-          </text>
-          <text follows="top|left" name="physics_points" top_pad="5" height="15">
-            Vertices: [POINTS]
-          </text>
-          <text follows="top|left" name="physics_hulls" top_pad="5" height="15">
-            Hulls: [HULLS]
-          </text>
-    
-    
+          help_topic="upload_model_physics"
+          label="Physics"
+          name="physics_panel">
+            
+            <!-- ==== STEP 1: Level of Detail ==== -->
+            <view_border
+              bevel_style="none"
+              follows="top|left"
+              height="275"
+              layout="topleft"
+              left="3"
+              name="physics_tab_border"
+              top_pad="0"
+              width="619"/>
+                <panel
+                  bg_alpha_color="0 0 0 0"
+                  bg_opaque_color="0 0 0 0.3"
+                  follows="top|left"
+                  height="21"
+                  left="18"
+                  name="physics geometry"
+                  top="15"
+                  visible="true"
+                  width="589">
+                    <text
+                      follows="top|left"
+                      font="SansSerif"
+                      height="20"
+                      layout="topleft"
+                      left="0"
+                      name="first_step_name"
+                      text_color="White"
+                      top_pad="0"
+                      width="210">
+                      Step 1: Level of Detail
+                    </text>
+                    <combo_box
+                      follows="left|top"
+                      height="18"
+                      left_pad="10"
+                      name="physics_lod_combo"
+                      width="130"
+                      tool_tip="LOD to use for physics shape">
+                        <combo_item name="physics_lowest"> Lowest </combo_item>
+                        <combo_item name="physics_low">    Low    </combo_item>
+                        <combo_item name="physics_medium"> Medium </combo_item>
+                        <combo_item name="physics_high">   High   </combo_item>
+                        <combo_item name="load_from_file"> From file   </combo_item>
+                    </combo_box>
+                    <line_editor
+                      follows="left|top"
+                      left_pad="10"
+                      value=""
+                      name="physics_file"
+                      height="20"
+                      width="154"/>
+                    <button
+                      follows="left|top"
+                      height="20"
+                      left_pad="4"
+                      name="physics_browse"
+                      label="Browse..."
+                      width="70"/>
+                    <!-- <check_box name="physics_optimize" follows="left|top" width="130" left="10" top_pad="5" height="20" label="Optimize"/>
+                    <check_box name="physics_use_hull" follows="left|top" width="130" left_pad="5" height="20" label="Use Convex Hull"/> -->
+                </panel>
+            
+            <!-- ==== STEP 2: Analyse ==== -->
+            <view_border
+              bevel_style="none"
+              follows="top|left"
+              height="0"
+              layout="topleft"
+              left="18"
+              name="physics_tab_border"
+              top_pad="15"
+              width="589"/>
+                <panel
+                  bg_alpha_color="0 0 0 0"
+                  bg_opaque_color="0 0 0 0.3"
+                  height="65"
+                  follows="top|left"
+                  left="18"
+                  name="physics analysis"
+                  top_pad="15"
+                  visible="true"
+                  width="589">
+                    <text
+                      follows="left|top"
+                      font="SansSerif"
+                      height="20"
+                      layout="topleft"
+                      left="0"
+                      name="method_label"
+                      text_color="White"
+                      top_pad="0">
+                      Step 2: Analyse
+                    </text>
+                    <text
+                      follows="top|left"
+                      height="15"
+                      layout="topleft"
+                      name="analysis_method_label"
+                      top_pad="10"
+                      width="100">
+                      Method:
+                    </text>
+                    <text
+                      follows="top|left"
+                      height="15"
+                      name="quality_label"
+                      layout="topleft"
+                      left_pad="15"
+                      width="100">
+                      Quality:
+                    </text>
+                    <text
+                      follows="top|left"
+                      height="15"
+                      name="smooth_method_label"
+                      layout="topleft"
+                      left_pad="15"
+                      width="100">
+                      Smooth:
+                    </text>
+                    <combo_box
+                      follows="top|left"
+                      layout="topleft"
+                      left="0"
+                      name="Method"
+                      top_pad="0"
+                      height="20"
+                      width="100"/>
+                    <combo_box
+                      follows="top|left"
+                      layout="topleft"
+                      left_pad="15"
+                      name="Decompose Quality"
+                      height="20"
+                      width="100"/>
+                    <combo_box
+                      height="20"
+                      follows="top|left"
+                      layout="topleft"
+                      left_pad="15"
+                      name="Smooth"
+                      width="100"/>
+                    <check_box
+                      follows="top|left"
+                      label="Close Holes"
+                      layout="topleft"
+                      left_pad="10"
+                      name="Close Holes (Slow)"
+                      height="15"/>
+                    <button
+                      bottom="1"
+                      follows="top|right"
+                      height="20"
+                      label="Analyze"
+                      layout="bottomleft"
+                      name="Decompose"
+                      right="-1"
+                      width="90"/>
+                    <button
+                      follows="top|left"
+                      height="20"
+                      label="Cancel"
+                      layout="topleft"
+                      left_delta="0"
+                      name="decompose_cancel"
+                      visible="false"
+                      width="90"/>
+                </panel>
+            
+            <!-- ==== STEP 3: Simplify ==== -->
+            <view_border
+              bevel_style="none"
+              follows="top|left"
+              height="0"
+              layout="topleft"
+              left="18"
+              name="physics_tab_border"
+              top_pad="15"
+              width="589"/>
+                <panel
+                  bg_alpha_color="0 0 0 0"
+                  bg_opaque_color="0 0 0 0.3"
+                  follows="top|left"
+                  height="66"
+                  left="18"
+                  name="physics simplification"
+                  top_pad="15"
+                  width="589">
+                    <text
+                      text_color="White"
+                      follows="left|top"
+                      height="20"
+                      left="0"
+                      name="second_step_label"
+                      top_pad="0"
+                      font="SansSerif">
+                      Step 3: Simplify
+                    </text>
+                    <text
+                      name="simp_method_header"
+                      top_pad="10"
+                      height="15"
+                      width="100"
+                      follows="top|left">
+                      Method:
+                    </text>
+                    <text
+                      follows="top|left"
+                      left_pad="40"
+                      name="pass_method_header"
+                      height="15"
+                      width="41">
+                      Passes:
+                    </text>
+                    <text
+                      follows="top|left"
+                      left_pad="40"
+                      name="Detail Scale label"
+                      height="15"
+                      width="80">
+                      Detail scale:
+                    </text>
+                    <text
+                      follows="top|left"
+                      left_delta="0"
+                      name="Retain%_label"
+                      height="15"
+                      width="80"
+                      visible="false">
+                      Retain:
+                    </text>
+                    <combo_box
+                      follows="top|left"
+                      height="20"
+                      left="0"
+                      name="Simplify Method"
+                      top_pad="0"
+                      width="100"/>
+                    <combo_box
+                      height="20"
+                      follows="top|left"
+                      left_pad="40"
+                      name="Combine Quality"
+                      width="41"
+                      value="1">
+                    </combo_box>
+                    <spinner
+                      follows="top|left"
+                      name="Detail Scale"
+                      height="20"
+                      left_pad="40"
+                      width="60"/>
+                    <spinner
+                      name="Retain%"
+                      width="60"
+                      follows="top|left"
+                      height="20"
+                      left_delta="0"
+                      visible="false"/>
+                    <button
+                      follows="top|left"
+                      height="20"
+                      label="Simplify"
+                      left_pad="40"
+                      name="Simplify"
+                      width="90"/>
+                    <button
+                      follows="top|left"
+                      height="20"
+                      label="Cancel"
+                      layout="topleft"
+                      left_delta="0"
+                      name="simplify_cancel"
+                      width="90"/>
+                </panel>
+            
+            <!-- ==== Results ==== -->
+            <view_border
+              bevel_style="none"
+              follows="top|left"
+              height="0"
+              layout="topleft"
+              left="18"
+              name="physics_tab_border"
+              top_pad="15"
+              width="589"/>
+                <panel
+                  bg_alpha_color="0 0 0 0"
+                  bg_opaque_color="0 0 0 0.3"
+                  follows="left|top"
+                  height="16"
+                  layout="topleft"
+                  left="18"
+                  name="physics info"
+                  top_pad="15"
+                  width="589">
+                    <text
+                      follows="top|left"
+                      height="15"
+                      layout="topleft"
+                      left="0"
+                      text_color="White"
+                      top_pad="0"
+                      name="results_text"
+                      width="60">
+                      Results:
+                    </text>
+                    <text
+                      follows="top|left"
+                      height="15"
+                      layout="topleft"
+                      left_pad="0"
+                      text_color="White"
+                      top_delta="0"
+                      name="physics_triangles"
+                      width="130">
+                      Triangles: [TRIANGLES],
+                    </text>
+                    <text
+                      follows="top|left"
+                      height="15"
+                      layout="topleft"
+                      left_pad="0"
+                      name="physics_points"
+                      top_delta="0"
+                      text_color="White"
+                      width="105">
+                      Vertices: [POINTS],
+                    </text>
+                    <text
+                      follows="top|left"
+                      height="15"
+                      layout="topleft"
+                      left_pad="0"
+                      name="physics_hulls"
+                      top_delta="0"
+                      text_color="White">
+                      Hulls: [HULLS]
+                    </text>
+                </panel>
         </panel>
-      </panel>
       <!-- MODIFIERS PANEL -->
-      <panel
-       label="Modifiers"
+     <panel
+       label="Upload options"
        name="modifiers_panel"
        help_topic="upload_model_modifiers">
          <view_border
@@ -414,15 +621,16 @@
           left="3"
           name="border"
           top_pad="0"
-          width="519"/>
+          width="619"/>
            <text
              follows="top|left"
              height="16"
-             left="10"
+             left="20"
              name="scale_label"
-             top="25"
+             text_color="White"
+             top="15"
              width="140">
-             Scale (1=no change):
+             Scale (1=no scaling):
            </text>
            <spinner
              height="20"
@@ -437,8 +645,9 @@
            <text
              follows="top|left"
              height="15"
-             left_pad="5"
+             left_pad="20"
              name="dimensions_label"
+             text_color="White"
              width="90">
              Dimensions:
            </text>
@@ -447,46 +656,60 @@
              height="15"
              left_pad="0"
              name="import_dimensions"
+             text_color="White"
              width="140">
              [X] X [Y] X [Z]
            </text>
+           <check_box
+             height="15"
+             follows="top|left"
+             name="upload_textures"
+             label="Include textures"
+             label_text.text_color="White"
+             left="20"
+             top_pad="20"/>
+           <view_border
+             bevel_style="none"
+             follows="top|left"
+             height="0"
+             layout="topleft"
+             name="border"
+             top_pad="20"
+             width="579"/>
            <text
              follows="top|left"
              height="15"
-             left="10"
+             left="20"
              name="include_label"
+             text_color="White"
              top_pad="20"
              width="150">
-             Include in upload:
+             For avatar models only:
            </text>
-           <check_box
-             height="15"
-             follows="top|left"
-             name="upload_textures"
-             label="Textures"
-             left_delta="0"
-             top_pad="10"/>
            <check_box
              follows="top|left"
              height="15"
-             label="Skin weight"
+             label="Include skin weight"
+             label_text.text_color="White"
              name="upload_skin"
-             top_pad="10"/>
+             top_pad="15"/>
            <check_box
              follows="top|left"
              height="15"
-             label="Joint positions"
+             label="Include joint positions"
+             label_text.text_color="White"
              name="upload_joints"
-             top_pad="10"/>
+             top_pad="15"/>
            <text
              follows="top|left"
              height="15"
              layout="topleft"
-             left="200"
+             left="220"
              name="pelvis_offset_label"
-             top="61"
+             text_color="White"
+             top="134"
              width="200">
-             Z Offset (for avatar shapes only):
+             Z offset (raise or lower avatar):
            </text>
            <spinner
              follows="top|left"
@@ -497,7 +720,7 @@
              top_pad="10"
              value="0.0"
              width="80"/>
-       </panel>
+     </panel>
     </tab_container>
     <panel
      follows="top|left"
@@ -506,10 +729,11 @@
      left="0"
      name="weights_and_warning_panel"
      top_pad="3"
-     width="525">
+     width="625">
        <button
          follows="top|left"
          label="Calculate weights &amp; fee"
+         label_color="White"
          layout="topleft"
          left="3"
          name="calculate_btn"
@@ -520,6 +744,7 @@
        <button
          follows="top|left"
          label="Cancel"
+         label_color="White"
          layout="topleft"
          left_pad="6"
          name="cancel_btn"
@@ -530,6 +755,7 @@
          follows="top|left"
          label="Upload"
          layout="topleft"
+         label_color="White"
          left="35"
          name="ok_btn"
          top="3"
@@ -540,6 +766,7 @@
        <button
          follows="top|right"
          label="Clear settings &amp; reset form"
+         label_color="White"
          layout="topleft"
          name="reset_btn"
          right="-2"
@@ -553,7 +780,7 @@
          layout="topleft"
          left="5"
          name="upload_fee"
-         top_pad="8"
+         top_pad="10"
          width="130"
          word_wrap="true">
          Upload fee: L$ [FEE]
@@ -605,7 +832,7 @@
          left="6"
          name="warning_title"
          top_pad="10"
-         text_color="Yellow"
+         text_color="DrYellow"
          visible="true"
          width="40">
          NOTE:
@@ -617,7 +844,7 @@
          left_pad="1"
          name="warning_message"
          parse_urls="true"
-         top_delta="0"
+         top_delta="2"
          wrap="true"
          width="462"
          visible="true">
@@ -629,8 +856,9 @@
 <text 
  follows="left|top"
  layout="topleft"
- left="540"
+ left="640"
  name="lod_label"
+ text_color="White"
  top="13"
  height="15"
  width="290">
@@ -660,14 +888,15 @@
       name="preview_lod_combo"
       width="150"
       tool_tip="LOD to view in preview render">
-        <combo_item name="high">   High  LoD   </combo_item>
-        <combo_item name="medium"> Medium LoD  </combo_item>
-        <combo_item name="low">    Low LoD     </combo_item>
-        <combo_item name="lowest"> Lowest  LoD </combo_item>
+        <combo_item name="high">   High   </combo_item>
+        <combo_item name="medium"> Medium </combo_item>
+        <combo_item name="low">    Low    </combo_item>
+        <combo_item name="lowest"> Lowest </combo_item>
     </combo_box>
     <text
       follows="top|left"
       layout="topleft"
+      text_color="White"
       top="5"
       left_pad="20"
       name="label_display"
@@ -677,6 +906,7 @@
     <check_box
       follows="top|left"
       label="Edges"
+      label_text.text_color="White"
       layout="topleft"
       left_delta="0"
       name="show_edges"
@@ -685,6 +915,7 @@
     <check_box
       follows="top|left"
       label="Physics"
+      label_text.text_color="White"
       layout="topleft"
       name="show_physics"
       top_pad="8">
@@ -692,6 +923,7 @@
     <check_box
       follows="top|left"
       label="Textures"
+      label_text.text_color="White"
       layout="topleft"
       name="show_textures"
       top_pad="8">
@@ -699,6 +931,7 @@
     <check_box
       follows="top|left"
       label="Skin weights"
+      label_text.text_color="White"
       layout="topleft"
       name="show_skin_weight"
       top_pad="8">
@@ -706,6 +939,7 @@
     <check_box
       follows="top|left"
       label="Joints"
+      label_text.text_color="White"
       layout="topleft"
       name="show_joint_positions"
       top_pad="8">
-- 
cgit v1.2.3


From da39e2c5e3d660542c6e8eba3abad561a7d30ffc Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Wed, 31 Aug 2011 15:58:15 -0400
Subject: SH-2314 FIX - change RenderVolumeLODFactor back to 1.125 for low
 graphics

---
 indra/newview/featuretable.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 mode change 100644 => 100755 indra/newview/featuretable.txt

diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt
old mode 100644
new mode 100755
index 1f9dc6e4e5..e12c2f7853
--- a/indra/newview/featuretable.txt
+++ b/indra/newview/featuretable.txt
@@ -88,7 +88,7 @@ RenderTerrainLODFactor		1	1
 RenderTransparentWater		1	0
 RenderTreeLODFactor			1	0
 RenderUseImpostors			1	1
-RenderVolumeLODFactor		1	0.5
+RenderVolumeLODFactor		1	1.125
 VertexShaderEnable			1	0
 WindLightUseAtmosShaders	1	0
 WLSkyDetail					1	48
-- 
cgit v1.2.3


From 18b47df3e27bcd93a41699c166deb3df39767963 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Wed, 31 Aug 2011 18:24:56 -0600
Subject: fix for SH-2367: Model upload errors are not displayed

---
 indra/newview/skins/default/xui/en/floater_model_preview.xml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index 259d2e70b6..522ffa7232 100755
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -4,8 +4,8 @@
      name="Model Preview" title="Upload Model" width="620"
       help_topic="upload_model" >
 
-  <string name="status_idle">Idle</string>
-  <string name="status_parse_error">Dae parsing issue - see log for details.</string>
+  <string name="status_idle"></string>
+  <string name="status_parse_error">Error: Dae parsing issue - see log for details.</string>
   <string name="status_reading_file">Loading...</string>
   <string name="status_generating_meshes">Generating Meshes...</string>
   <string name="status_vertex_number_overflow">Error: Vertex number is more than 65534, aborted!</string>
@@ -112,6 +112,8 @@
      visible="false">
      You will not be able to complete the final upload of this model to the Second Life servers. [[VURL] Find out how] to get enabled for mesh model uploads.</text>
 
+  <text text_color="Yellow" left="10" bottom_delta="0" width="290" height="15" follows="bottom|left|right" name="status">[STATUS]</text>
+  
   <text
 	height="26"
 	top_pad="5"
-- 
cgit v1.2.3


From 004de653aa3aa2702c7532d2ff5ce9838636d4ca Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Thu, 1 Sep 2011 19:01:46 +0300
Subject: SH-2309 WIP Priority modifications to mesh uploader UI

- Bind "Cosine%" param with "Smooth" combo box.
- Corrected some wording.
- Little UI polish. Line with results in Physics tab.
- Changed ordering of LOD combo box items.
---
 indra/newview/llfloatermodelpreview.cpp            | 42 ++++++++++++++++++++++
 indra/newview/llfloatermodelpreview.h              |  2 ++
 .../skins/default/xui/en/floater_model_preview.xml | 16 ++++-----
 3 files changed, 52 insertions(+), 8 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 276f513abf..362a40632a 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -980,6 +980,7 @@ void LLFloaterModelPreview::onPhysicsBrowse(LLUICtrl* ctrl, void* userdata)
 //static
 void LLFloaterModelPreview::onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata)
 {
+	S32 num_modes = 3;
 	S32 which_mode = 3;
 	static S32 previous_mode = which_mode;
 
@@ -996,6 +997,7 @@ void LLFloaterModelPreview::onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata)
 
 	if (!lod_to_file)
 	{
+		which_mode = num_modes - which_mode;
 		sInstance->mModelPreview->setPhysicsFromLOD(which_mode);
 	}
 
@@ -1119,6 +1121,29 @@ void LLFloaterModelPreview::initDecompControls()
 					spinner->setValue(param[i].mDefault.mFloat);
 					spinner->setCommitCallback(onPhysicsParamCommit, (void*) &param[i]);
 				}
+				else if (LLComboBox* combo_box = dynamic_cast<LLComboBox*>(ctrl))
+				{
+					float min = param[i].mDetails.mRange.mLow.mFloat;
+					float max = param[i].mDetails.mRange.mHigh.mFloat;
+					float delta = param[i].mDetails.mRange.mDelta.mFloat;
+
+					if ("Cosine%" == name)
+					{
+						createSmoothComboBox(combo_box, min, max);
+					}
+					else
+					{
+						for(float value = min; value <= max; value += delta)
+						{
+							std::string label = llformat("%.1f", value);
+							combo_box->add(label, value, ADD_BOTTOM, true);
+						}
+						combo_box->setValue(param[i].mDefault.mFloat);
+
+					}
+
+					combo_box->setCommitCallback(onPhysicsParamCommit, (void*) &param[i]);
+				}
 			}
 			else if (param[i].mType == LLCDParam::LLCD_INTEGER)
 			{
@@ -1192,6 +1217,23 @@ void LLFloaterModelPreview::initDecompControls()
 	childSetCommitCallback("physics_explode", LLFloaterModelPreview::onExplodeCommit, this);
 }
 
+void LLFloaterModelPreview::createSmoothComboBox(LLComboBox* combo_box, float min, float max)
+{
+	float combo_list_size = 10;
+	float delta = (max - min) / combo_list_size;
+	int ilabel = 0;
+
+	combo_box->add("0 (none)", ADD_BOTTOM, true);
+
+	for(float value = min + delta; value < max; value += delta)
+	{
+		std::string label = (++ilabel == combo_list_size) ? "10 (max)" : llformat("%.1d", ilabel);
+		combo_box->add(label, value, ADD_BOTTOM, true);
+	}
+
+
+}
+
 //-----------------------------------------------------------------------------
 // onMouseCaptureLost()
 //-----------------------------------------------------------------------------
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index a8fd02443e..f93d3b9482 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -281,6 +281,8 @@ private:
 	// resets display options of model preview to their defaults.
 	void resetDisplayOptions();
 
+	void createSmoothComboBox(LLComboBox* combo_box, float min, float max);
+
 	LLButton* mUploadBtn;
 	LLButton* mCalculateBtn;
 };
diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index ac3978938a..d613e42786 100755
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -70,7 +70,7 @@
           text_color="White"
           top="0"
           width="200">
-          This model represent...
+          This model represents...
         </text>
         <combo_box
           follows="left|top"
@@ -305,10 +305,10 @@
                       name="physics_lod_combo"
                       width="130"
                       tool_tip="LOD to use for physics shape">
-                        <combo_item name="physics_lowest"> Lowest </combo_item>
-                        <combo_item name="physics_low">    Low    </combo_item>
-                        <combo_item name="physics_medium"> Medium </combo_item>
                         <combo_item name="physics_high">   High   </combo_item>
+                        <combo_item name="physics_medium"> Medium </combo_item>
+                        <combo_item name="physics_low">    Low    </combo_item>
+                        <combo_item name="physics_lowest"> Lowest </combo_item>
                         <combo_item name="load_from_file"> From file   </combo_item>
                     </combo_box>
                     <line_editor
@@ -407,7 +407,7 @@
                       follows="top|left"
                       layout="topleft"
                       left_pad="15"
-                      name="Smooth"
+                      name="Cosine%"
                       width="100"/>
                     <check_box
                       follows="top|left"
@@ -571,7 +571,7 @@
                       text_color="White"
                       top_pad="0"
                       name="results_text"
-                      width="60">
+                      width="50">
                       Results:
                     </text>
                     <text
@@ -582,7 +582,7 @@
                       text_color="White"
                       top_delta="0"
                       name="physics_triangles"
-                      width="130">
+                      width="90">
                       Triangles: [TRIANGLES],
                     </text>
                     <text
@@ -593,7 +593,7 @@
                       name="physics_points"
                       top_delta="0"
                       text_color="White"
-                      width="105">
+                      width="85">
                       Vertices: [POINTS],
                     </text>
                     <text
-- 
cgit v1.2.3


From 1b51c5850f0217ded59870dee7a28fa77591e6cd Mon Sep 17 00:00:00 2001
From: "Debi King (Dessie)" <dessie@lindenlab.com>
Date: Thu, 1 Sep 2011 15:15:26 -0400
Subject: Removed tag DRTVWR-78_3.0.0-release

---
 .hgtags | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.hgtags b/.hgtags
index 7bf2b04e17..eefd56ed78 100644
--- a/.hgtags
+++ b/.hgtags
@@ -181,3 +181,5 @@ f2412ecd6740803ea9452f1d17fd872e263a0df7 3.0.2-start
 1778f26b6d0ae762dec3ca37140f66620f2485d9 3.0.0-release
 42784bf50fa01974bada2a1af3892ee09c93fcda DRTVWR-83_3.0.2-beta1
 42784bf50fa01974bada2a1af3892ee09c93fcda 3.0.2-beta1
+1778f26b6d0ae762dec3ca37140f66620f2485d9 DRTVWR-78_3.0.0-release
+0000000000000000000000000000000000000000 DRTVWR-78_3.0.0-release
-- 
cgit v1.2.3


From 1b9a39a2e1050bb1366cce5f1140a1608633c473 Mon Sep 17 00:00:00 2001
From: "Debi King (Dessie)" <dessie@lindenlab.com>
Date: Thu, 1 Sep 2011 15:16:32 -0400
Subject: Added tag DRTVWR-77_3.0.0-release for changeset 1778f26b6d0a

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index eefd56ed78..c25727650b 100644
--- a/.hgtags
+++ b/.hgtags
@@ -183,3 +183,4 @@ f2412ecd6740803ea9452f1d17fd872e263a0df7 3.0.2-start
 42784bf50fa01974bada2a1af3892ee09c93fcda 3.0.2-beta1
 1778f26b6d0ae762dec3ca37140f66620f2485d9 DRTVWR-78_3.0.0-release
 0000000000000000000000000000000000000000 DRTVWR-78_3.0.0-release
+1778f26b6d0ae762dec3ca37140f66620f2485d9 DRTVWR-77_3.0.0-release
-- 
cgit v1.2.3


From da7f2af75cc3f14f64fa4bdae83e555be0074a1e Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Thu, 1 Sep 2011 17:47:05 -0400
Subject: Fix for model metrics

---
 indra/newview/llmeshrepository.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index bd18da2251..25ae514274 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -1460,8 +1460,8 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
 
 	if (model_name.empty()) model_name = "mesh model";
 	result["name"] = model_name;
-	if (model_metric.empty()) model_metric = "MUT_Other";
-	result["metric"] = model_metric;
+	if (model_metric.empty()) model_metric = "MUT_Unspecified";
+	res["metric"] = model_metric;
 	result["asset_resources"] = res;
 	dump_llsd_to_file(result,make_dump_name("whole_model_",dump_num));
 
-- 
cgit v1.2.3


From 6ba3952edf3679927ffb17fe26d5f6eeb89e2847 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Thu, 1 Sep 2011 15:20:36 -0700
Subject: sync with viewer-development

---
 .../skins/default/xui/en/floater_postcard.xml      |  12 +-
 .../newview/skins/default/xui/en/notifications.xml | 140 +++++++++++++++++++++
 .../skins/default/xui/en/panel_cof_wearables.xml   |   2 +-
 indra/newview/skins/default/xui/en/panel_login.xml |   3 +-
 .../default/xui/en/panel_preferences_privacy.xml   |   2 +-
 .../default/xui/en/panel_preferences_setup.xml     |  85 +++++--------
 .../skins/default/xui/en/panel_region_terrain.xml  |   2 +-
 .../skins/default/xui/en/panel_status_bar.xml      |   5 +-
 8 files changed, 183 insertions(+), 68 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_postcard.xml b/indra/newview/skins/default/xui/en/floater_postcard.xml
index 8da35e9d7f..c756661ffc 100644
--- a/indra/newview/skins/default/xui/en/floater_postcard.xml
+++ b/indra/newview/skins/default/xui/en/floater_postcard.xml
@@ -7,11 +7,11 @@
  height="380"
  layout="topleft"
  min_height="380"
- min_width="450"
+ min_width="490"
  name="Postcard"
  help_topic="postcard"
  title="EMAIL SNAPSHOT"
- width="450">
+ width="490">
     <floater.string
      name="default_subject">
         Postcard from [SECOND_LIFE].
@@ -40,7 +40,7 @@
      follows="left|top"
      height="20"
      layout="topleft"
-     left_delta="108"
+     left_delta="148"
      name="to_form"
      top_delta="-4"
      width="150" />
@@ -59,7 +59,7 @@
      follows="left|top"
      height="20"
      layout="topleft"
-     left_delta="108"
+     left_delta="148"
      name="from_form"
      top_delta="-4"
      width="150" />
@@ -78,7 +78,7 @@
      follows="left|top"
      height="20"
      layout="topleft"
-     left_delta="108"
+     left_delta="148"
      max_length_bytes="100"
      name="name_form"
      top_delta="-4"
@@ -99,7 +99,7 @@
      height="20"
      label="Type your subject here."
      layout="topleft"
-     left_delta="108"
+     left_delta="148"
      max_length_bytes="100"
      name="subject_form"
      top_delta="-4"
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index c9ccd44b83..251fce2333 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6260,6 +6260,10 @@ Grant this request?
 [NAME]&apos;s &apos;&lt;nolink&gt;[TITLE]&lt;/nolink&gt;&apos;
 [MESSAGE]
     <form name="form">
+      <button
+       index="-2"
+       name="Mute"
+       text="Block"/>
       <button
        index="-1"
        name="Ignore"
@@ -6275,6 +6279,10 @@ Grant this request?
 [GROUPNAME]&apos;s &apos;&lt;nolink&gt;[TITLE]&lt;/nolink&gt;&apos;
 [MESSAGE]
     <form name="form">
+      <button
+       index="-2"
+       name="Mute"
+       text="Block"/>
       <button
        index="-1"
        name="Ignore"
@@ -7156,6 +7164,138 @@ Click and drag anywhere on the world to rotate your view
     </form>
   </notification>
 
+  <notification
+   icon="alertmodal.tga"
+   name="SOCKS_NOT_PERMITTED"
+   type="alertmodal">
+	The SOCKS 5 proxy "[HOST]:[PORT]" refused the connection, not allowed by rule set.
+	<tag>fail</tag>
+   <usetemplate
+     name="okbutton"
+     yestext="OK"/>
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="SOCKS_CONNECT_ERROR"
+   type="alertmodal">
+	The SOCKS 5 proxy "[HOST]:[PORT]" refused the connection, could not open TCP channel.
+	<tag>fail</tag>
+   <usetemplate
+     name="okbutton"
+     yestext="OK"/>	 
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="SOCKS_NOT_ACCEPTABLE"
+   type="alertmodal">
+	The SOCKS 5 proxy "[HOST]:[PORT]" refused the selected authentication system.
+	<tag>fail</tag>
+   <usetemplate
+     name="okbutton"
+     yestext="OK"/>
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="SOCKS_AUTH_FAIL"
+   type="alertmodal">
+	The SOCKS 5 proxy "[HOST]:[PORT]" reported your credentials are invalid.
+	<tag>fail</tag>
+   <usetemplate
+     name="okbutton"
+     yestext="OK"/>
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="SOCKS_UDP_FWD_NOT_GRANTED"
+   type="alertmodal">
+	The SOCKS 5 proxy "[HOST]:[PORT]" refused the UDP associate request.
+	<tag>fail</tag>
+   <usetemplate
+     name="okbutton"
+     yestext="OK"/>
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="SOCKS_HOST_CONNECT_FAILED"
+   type="alertmodal">
+	Could not connect to SOCKS 5 proxy server "[HOST]:[PORT]".
+	<tag>fail</tag>
+   <usetemplate
+     name="okbutton"
+     yestext="OK"/>
+  </notification>
+  
+  <notification
+   icon="alertmodal.tga"
+   name="SOCKS_UNKNOWN_STATUS"
+   type="alertmodal">
+	Unknown proxy error with server "[HOST]:[PORT]".
+	<tag>fail</tag>
+   <usetemplate
+     name="okbutton"
+     yestext="OK"/>
+  </notification>
+  
+  <notification
+   icon="alertmodal.tga"
+   name="SOCKS_INVALID_HOST"
+   type="alertmodal">
+	Invalid SOCKS proxy address or port "[HOST]:[PORT]".
+	<tag>fail</tag>
+   <usetemplate
+     name="okbutton"
+     yestext="OK"/>
+  </notification>
+  
+  <notification
+   icon="alertmodal.tga"
+   name="SOCKS_BAD_CREDS"
+   type="alertmodal">
+	Invalid SOCKS 5 username or password.
+	<tag>fail</tag>
+   <usetemplate
+     name="okbutton"
+     yestext="OK"/>
+  </notification>
+  
+  <notification
+   icon="alertmodal.tga"
+   name="PROXY_INVALID_HTTP_HOST"
+   type="alertmodal">
+    Invalid HTTP proxy address or port "[HOST]:[PORT]".
+	<tag>fail</tag>
+   <usetemplate
+     name="okbutton"
+     yestext="OK"/>
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="PROXY_INVALID_SOCKS_HOST"
+   type="alertmodal">
+	Invalid SOCKS proxy address or port "[HOST]:[PORT]".
+	<tag>fail</tag>
+   <usetemplate
+     name="okbutton"
+     yestext="OK"/>
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="ChangeProxySettings"
+   type="alert">
+	Proxy settings take effect after you restart [APP_NAME].
+	<tag>fail</tag>
+   <usetemplate
+     name="okbutton"
+     yestext="OK"/>
+  </notification>
+
   <notification
   name="AuthRequest"
   type="browser">
diff --git a/indra/newview/skins/default/xui/en/panel_cof_wearables.xml b/indra/newview/skins/default/xui/en/panel_cof_wearables.xml
index 9e70706603..beea53437a 100644
--- a/indra/newview/skins/default/xui/en/panel_cof_wearables.xml
+++ b/indra/newview/skins/default/xui/en/panel_cof_wearables.xml
@@ -52,7 +52,7 @@
              multi_select="true"
              name="list_attachments"
              top="0"
-             width="311"/>
+			 width="311" />
         </accordion_tab>
         <accordion_tab
          layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml
index 0bc1be666e..83f1bff91f 100644
--- a/indra/newview/skins/default/xui/en/panel_login.xml
+++ b/indra/newview/skins/default/xui/en/panel_login.xml
@@ -117,12 +117,13 @@ label="Remember password"
   name="connect_btn"
   top="35"
   width="90" />
+  <!-- Utf code in label is a filled up-pointing triangle -->
   <menu_button
   left_pad="5"
   top="35"
   width="80"
   height="23"
-  label="Mode ▲"
+  label="Mode &#9650;"
   name="mode_menu"  
   tool_tip="Select your mode. Choose Basic for fast, easy exploration and chat. Choose Advanced to access more features."
   menu_filename="menu_mode_change.xml"
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml
index 30be5bc853..47236c1a48 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml
@@ -139,7 +139,7 @@
      height="16"
      label="Add datestamp to log file name."
      layout="topleft"
-     left_detla="5"
+     left_delta="5"
      name="logfile_name_datestamp"
      top_pad="10"
      width="350"/>
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
index e639f0dc9d..a7078ce2e1 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
@@ -70,7 +70,7 @@
    layout="topleft"
    left="77"
    name="connection_port_enabled"
-   top_pad="20"
+   top_pad="10"
    width="256">
     <check_box.commit_callback
      function="Notification.Show"
@@ -79,7 +79,7 @@
   <spinner
    control_name="ConnectionPort"
    enabled_control="ConnectionPortEnabled"
- decimal_digits="0"
+   decimal_digits="0"
    follows="left|top"
    height="23"
    increment="1"
@@ -195,60 +195,6 @@
     name="media_popup_enabled"
     width="400"           
     top_pad="5"/>
-  <check_box
-    top_delta="4"
-    enabled="true"
-    follows="left|top"
-    height="14"
-    initial_value="false"
-    control_name="BrowserProxyEnabled"
-    label="Enable Web Proxy"
-    left_delta="0"
-    mouse_opaque="true"
-    name="web_proxy_enabled"
-    radio_style="false"
-    width="400"           top_pad="5"/>
-  <text
-   type="string"
-   length="1"
-   follows="left|top"
-   height="10"
-   layout="topleft"
-   left_delta="20"
-   name="Proxy location"
-   top_delta="16"
-   width="300">
-    Proxy location:
-  </text>
-  <line_editor
-   control_name="BrowserProxyAddress"
-   enabled_control="BrowserProxyEnabled"
- follows="left|top"
-   font="SansSerif"
-   height="23"
-   layout="topleft"
-   left_delta="0"
-   name="web_proxy_editor"
-   tool_tip="The name or IP address of the proxy you would like to use"
-   top_pad="4"
-   width="200" />
-  <spinner
-   control_name="BrowserProxyPort"
-   enabled_control="BrowserProxyEnabled"
- decimal_digits="0"
-   follows="left|top"
-   height="23"
-   increment="1"
-   initial_value="80"
-   label="Port number:"
-   label_width="95"
-   layout="topleft"
-   left_delta="210"
-   max_val="12000"
-   min_val="10"
-   name="web_proxy_port"
-   top_delta="0"
-   width="145" />
   <text
      type="string"
      length="1"
@@ -286,4 +232,31 @@
          name="Install_manual"
          value="0" />
   </combo_box>
+  <text
+     type="string"
+     length="1"
+     follows="left|top"
+     height="10"
+     layout="topleft"
+     left="30"
+     name="Proxy Settings:"
+     mouse_opaque="false"
+     top_pad="5"
+     width="300">
+		Proxy Settings:
+  </text>
+  <button
+	label="Adjust proxy settings"
+    follows="left|top"
+    height="23"
+	width="140" 
+    label_selected="Browse"
+    layout="topleft"
+    left_delta="50"
+    name="set_proxy"
+    top_pad="5"
+    >
+		<button.commit_callback
+		  function="Pref.Proxy" />
+  </button>
 </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_region_terrain.xml b/indra/newview/skins/default/xui/en/panel_region_terrain.xml
index bbb8b40594..5d060c0a0d 100644
--- a/indra/newview/skins/default/xui/en/panel_region_terrain.xml
+++ b/indra/newview/skins/default/xui/en/panel_region_terrain.xml
@@ -193,7 +193,7 @@
     </text>
     <text
        follows="left|top"
-       height="20"
+       height="60"
        layout="topleft"
        left_delta="0"
        name="height_text_lbl11"
diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml
index 23ad0e9528..f25a73da38 100644
--- a/indra/newview/skins/default/xui/en/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml
@@ -77,15 +77,16 @@
      top="0"
      width="55" />
   </panel>
+  <!-- UTF 9660 code in label below is a down-pointing filled-in triangle -->
   <menu_button
      follows="right|top"    
     image_color="0 0 0 0"
     hover_glow_amount="0"
     left_pad="5"
-    top="0"
+    top="2"
     width="55"
     height="18"
-    label="Mode ▼"
+    label="Mode &#9660;"
     tool_tip="Select your mode. Choose Basic for fast, easy exploration and chat. Choose Advanced to access more features."
     menu_filename="menu_mode_change.xml"
     />
-- 
cgit v1.2.3


From 5da2d4c85370ebe1a14ecbebd8e5df7965e9d02e Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Fri, 2 Sep 2011 17:14:07 +0300
Subject: SH-2309 WIP Priority modifications to mesh uploader UI

- Changed representation of Retain% control values

- Added "Choose one..." item to the LOD combo_box
---
 indra/newview/llfloatermodelpreview.cpp            | 24 ++++++++++++++++------
 .../skins/default/xui/en/floater_model_preview.xml |  2 ++
 2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 362a40632a..2d18c2bb24 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -119,6 +119,7 @@ const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PRE
 const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE;
 const S32 PREF_BUTTON_HEIGHT = 16 + 7 + 16;
 const S32 PREVIEW_TEXTURE_HEIGHT = 300;
+const double RETAIN_COEFFICIENT = 100;
 
 void drawBoxOutline(const LLVector3& pos, const LLVector3& size);
 
@@ -907,7 +908,15 @@ void LLFloaterModelPreview::onPhysicsParamCommit(LLUICtrl* ctrl, void* data)
 	{
 		LLCDParam* param = (LLCDParam*) data;
 		std::string name(param->mName);
-		sInstance->mDecompParams[name] = ctrl->getValue();
+
+		LLSD value = ctrl->getValue();
+
+		if("Retain%" == name)
+		{
+			value = ctrl->getValue().asReal() / RETAIN_COEFFICIENT;
+		}
+
+		sInstance->mDecompParams[name] = value;
 
 		if (name == "Simplify Method")
 		{
@@ -980,7 +989,7 @@ void LLFloaterModelPreview::onPhysicsBrowse(LLUICtrl* ctrl, void* userdata)
 //static
 void LLFloaterModelPreview::onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata)
 {
-	S32 num_modes = 3;
+	S32 num_modes = 4;
 	S32 which_mode = 3;
 	static S32 previous_mode = which_mode;
 
@@ -1115,10 +1124,13 @@ void LLFloaterModelPreview::initDecompControls()
 				}
 				else if (LLSpinCtrl* spinner = dynamic_cast<LLSpinCtrl*>(ctrl))
 				{
-					spinner->setMinValue(param[i].mDetails.mRange.mLow.mFloat);
-					spinner->setMaxValue(param[i].mDetails.mRange.mHigh.mFloat);
-					spinner->setIncrement(param[i].mDetails.mRange.mDelta.mFloat);
-					spinner->setValue(param[i].mDefault.mFloat);
+					bool is_retain_ctrl = "Retain%" == name;
+					double coefficient = is_retain_ctrl ? RETAIN_COEFFICIENT : 1.f;
+
+					spinner->setMinValue(param[i].mDetails.mRange.mLow.mFloat * coefficient);
+					spinner->setMaxValue(param[i].mDetails.mRange.mHigh.mFloat * coefficient);
+					spinner->setIncrement(param[i].mDetails.mRange.mDelta.mFloat * coefficient);
+					spinner->setValue(param[i].mDefault.mFloat * coefficient);
 					spinner->setCommitCallback(onPhysicsParamCommit, (void*) &param[i]);
 				}
 				else if (LLComboBox* combo_box = dynamic_cast<LLComboBox*>(ctrl))
diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index d613e42786..39ef844824 100755
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -305,6 +305,7 @@
                       name="physics_lod_combo"
                       width="130"
                       tool_tip="LOD to use for physics shape">
+                        <combo_item name="choose_one">     Choose one...   </combo_item>
                         <combo_item name="physics_high">   High   </combo_item>
                         <combo_item name="physics_medium"> Medium </combo_item>
                         <combo_item name="physics_low">    Low    </combo_item>
@@ -521,6 +522,7 @@
                       width="60"/>
                     <spinner
                       name="Retain%"
+                      decimal_digits="0"
                       width="60"
                       follows="top|left"
                       height="20"
-- 
cgit v1.2.3


From 028c34e0ffd69eeb99f21f8c0bb9b612bd820b10 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Fri, 2 Sep 2011 17:36:54 +0300
Subject: SH-2309 Model preview floater LoD tab updated. - Combo boxes for LoD
 source added for each level - New option "Use LoD above" added for copying
 the model from higher LoDs. - Various LoD settings and related controls
 removed.

---
 indra/newview/llfloatermodelpreview.cpp            | 389 ++++------
 indra/newview/llfloatermodelpreview.h              |  17 +-
 .../skins/default/xui/en/floater_model_preview.xml | 790 ++++++++++++++++-----
 3 files changed, 780 insertions(+), 416 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 2d18c2bb24..e687b1954c 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -396,21 +396,23 @@ BOOL LLFloaterModelPreview::postBuild()
 		return FALSE;
 	}
 
-	childSetAction("lod_browse", onBrowseLOD, this);
-
 	childSetCommitCallback("cancel_btn", onCancel, this);
 	childSetCommitCallback("crease_angle", onGenerateNormalsCommit, this);
-	childSetCommitCallback("generate_normals", onGenerateNormalsCommit, this);
+	getChild<LLCheckBoxCtrl>("gen_normals")->setCommitCallback(boost::bind(&LLFloaterModelPreview::toggleGenarateNormals, this));
 
 	childSetCommitCallback("lod_generate", onAutoFillCommit, this);
 
-	childSetCommitCallback("lod_mode", onLODParamCommit, this);
-	childSetCommitCallback("lod_error_threshold", onLODParamCommit, this);
-	childSetCommitCallback("lod_triangle_limit", onLODParamCommitTriangleLimit, this);
-	childSetCommitCallback("build_operator", onLODParamCommit, this);
-	childSetCommitCallback("queue_mode", onLODParamCommit, this);
-	childSetCommitCallback("border_mode", onLODParamCommit, this);
-	childSetCommitCallback("share_tolerance", onLODParamCommit, this);
+	for (S32 lod = 0; lod <= LLModel::LOD_HIGH; ++lod)
+	{
+		LLComboBox* lod_source_combo = getChild<LLComboBox>("lod_source_" + lod_name[lod]);
+		lod_source_combo->setCommitCallback(boost::bind(&LLFloaterModelPreview::onLoDSourceCommit, this, lod));
+		lod_source_combo->setCurrentByIndex(mLODMode[lod]);
+
+		getChild<LLButton>("lod_browse_" + lod_name[lod])->setCommitCallback(boost::bind(&LLFloaterModelPreview::onBrowseLOD, this, lod));
+		getChild<LLComboBox>("lod_mode_" + lod_name[lod])->setCommitCallback(boost::bind(&LLFloaterModelPreview::onLODParamCommit, this, lod, false));
+		getChild<LLSpinCtrl>("lod_error_threshold_" + lod_name[lod])->setCommitCallback(boost::bind(&LLFloaterModelPreview::onLODParamCommit, this, lod, false));
+		getChild<LLSpinCtrl>("lod_triangle_limit_" + lod_name[lod])->setCommitCallback(boost::bind(&LLFloaterModelPreview::onLODParamCommit, this, lod, true));
+	}
 
 	childSetCommitCallback("upload_skin", boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this), NULL);
 	childSetCommitCallback("upload_joints", boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this), NULL);
@@ -431,10 +433,6 @@ BOOL LLFloaterModelPreview::postBuild()
 	childSetCommitCallback("import_scale", onImportScaleCommit, this);
 	childSetCommitCallback("pelvis_offset", onPelvisOffsetCommit, this);
 
-	childSetCommitCallback("lod_file_or_limit", refresh, this);
-	//childSetCommitCallback("physics_optimize", refresh, this);
-	//childSetCommitCallback("physics_use_hull", refresh, this);
-
 	getChild<LLCheckBoxCtrl>("show_edges")->setCommitCallback(boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _1));
 	getChild<LLCheckBoxCtrl>("show_physics")->setCommitCallback(boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _1));
 	getChild<LLCheckBoxCtrl>("show_textures")->setCommitCallback(boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _1));
@@ -694,6 +692,12 @@ void LLFloaterModelPreview::onGenerateNormalsCommit(LLUICtrl* ctrl, void* userda
 	fp->mModelPreview->generateNormals();
 }
 
+void LLFloaterModelPreview::toggleGenarateNormals()
+{
+	bool enabled = childGetValue("gen_normals").asBoolean();
+	childSetEnabled("crease_angle", enabled);
+}
+
 //static
 void LLFloaterModelPreview::onExplodeCommit(LLUICtrl* ctrl, void* userdata)
 {
@@ -710,19 +714,9 @@ void LLFloaterModelPreview::onAutoFillCommit(LLUICtrl* ctrl, void* userdata)
 	fp->mModelPreview->genLODs();
 }
 
-//static
-void LLFloaterModelPreview::onLODParamCommit(LLUICtrl* ctrl, void* userdata)
-{
-	LLFloaterModelPreview* fp = (LLFloaterModelPreview*) userdata;
-
-	fp->mModelPreview->onLODParamCommit(false);
-}
-
-//static
-void LLFloaterModelPreview::onLODParamCommitTriangleLimit(LLUICtrl* ctrl, void* userdata)
+void LLFloaterModelPreview::onLODParamCommit(S32 lod, bool enforce_tri_limit)
 {
-	LLFloaterModelPreview* fp = (LLFloaterModelPreview*) userdata;
-	fp->mModelPreview->onLODParamCommit(true);
+	mModelPreview->onLODParamCommit(lod, enforce_tri_limit);
 }
 
 
@@ -3484,7 +3478,7 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable
 	
 	if (lod == mPreviewLOD)
 	{
-		mFMP->childSetText("lod_file", mLODFile[mPreviewLOD]);
+		mFMP->childSetText("lod_file_" + lod_name[lod], mLODFile[lod]);
 	}
 	else if (lod == LLModel::LOD_PHYSICS)
 	{
@@ -3782,21 +3776,21 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim
 
 	U32 lod_mode = 0;
 
-	LLCtrlSelectionInterface* iface = mFMP->childGetSelectionInterface("lod_mode");
+	LLCtrlSelectionInterface* iface = mFMP->childGetSelectionInterface("lod_mode_" + lod_name[which_lod]);
 	if (iface)
 	{
 		lod_mode = iface->getFirstSelectedIndex();
 	}
 	mRequestedLoDMode[mPreviewLOD] = lod_mode;
 
-	F32 lod_error_threshold = mFMP->childGetValue("lod_error_threshold").asReal();
+	F32 lod_error_threshold = mFMP->childGetValue("lod_error_threshold_" + lod_name[which_lod]).asReal();
 
 	if (lod_mode == 0)
 	{
 		lod_mode = GLOD_TRIANGLE_BUDGET;
 		if (which_lod != -1)
 		{
-			limit = mFMP->childGetValue("lod_triangle_limit").asInteger();
+			limit = mFMP->childGetValue("lod_triangle_limit_" + lod_name[which_lod]).asInteger();
 		}
 	}
 	else
@@ -3804,89 +3798,7 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim
 		lod_mode = GLOD_ERROR_THRESHOLD;
 	}
 
-	U32 build_operator = 0;
-
-	iface = mFMP->childGetSelectionInterface("build_operator");
-	if (iface)
-	{
-		build_operator = iface->getFirstSelectedIndex();
-	}
-	mRequestedBuildOperator[mPreviewLOD] = build_operator; 
-
-	if (build_operator == 0)
-	{
-		build_operator = GLOD_OPERATOR_EDGE_COLLAPSE;
-	}
-	else
-	{
-		build_operator = GLOD_OPERATOR_HALF_EDGE_COLLAPSE;
-	}
-
-	U32 queue_mode=0;
-	iface = mFMP->childGetSelectionInterface("queue_mode");
-	if (iface)
-	{
-		queue_mode = iface->getFirstSelectedIndex();
-	}
-	mRequestedQueueMode[mPreviewLOD] = queue_mode;
-
-	if (queue_mode == 0)
-	{
-		queue_mode = GLOD_QUEUE_GREEDY;
-	}
-	else if (queue_mode == 1)
-	{
-		queue_mode = GLOD_QUEUE_LAZY;
-	}
-	else
-	{
-		queue_mode = GLOD_QUEUE_INDEPENDENT;
-	}
-
-	U32 border_mode = 0;
-
-	iface = mFMP->childGetSelectionInterface("border_mode");
-	if (iface)
-	{
-		border_mode = iface->getFirstSelectedIndex();
-	}
-	mRequestedBorderMode[mPreviewLOD] = border_mode;
-
-	if (border_mode == 0)
-	{
-		border_mode = GLOD_BORDER_UNLOCK;
-	}
-	else
-	{
-		border_mode = GLOD_BORDER_LOCK;
-	}
-
 	bool object_dirty = false;
-	if (border_mode != mBuildBorderMode)
-	{
-		mBuildBorderMode = border_mode;
-		object_dirty = true;
-	}
-
-	if (queue_mode != mBuildQueueMode)
-	{
-		mBuildQueueMode = queue_mode;
-		object_dirty = true;
-	}
-
-	if (build_operator != mBuildOperator)
-	{
-		mBuildOperator = build_operator;
-		object_dirty = true;
-	}
-
-	F32 share_tolerance = mFMP->childGetValue("share_tolerance").asReal();
-	if (share_tolerance != mBuildShareTolerance)
-	{
-		mBuildShareTolerance = share_tolerance;
-		object_dirty = true;
-	}
-	mRequestedShareTolerance[mPreviewLOD] = share_tolerance;
 
 	if (mGroup == 0)
 	{
@@ -3936,18 +3848,6 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim
 				stop_gloderror();
 			}
 
-			glodObjectParameteri(mObject[mdl], GLOD_BUILD_OPERATOR, build_operator);
-			stop_gloderror();
-
-			glodObjectParameteri(mObject[mdl], GLOD_BUILD_QUEUE_MODE, queue_mode);
-			stop_gloderror();
-
-			glodObjectParameteri(mObject[mdl], GLOD_BUILD_BORDER_MODE, border_mode);
-			stop_gloderror();
-
-			glodObjectParameterf(mObject[mdl], GLOD_BUILD_SHARE_TOLERANCE, share_tolerance);
-			stop_gloderror();
-
 			glodBuildObject(mObject[mdl]);
 			stop_gloderror();
 		}
@@ -4489,147 +4389,140 @@ void LLModelPreview::updateStatusMessages()
 		}
 	}
 
+	if (mFMP->childGetValue("physics_lod_combo").asString() == "From file")
+	{
+		mFMP->childEnable("physics_file");
+		mFMP->childEnable("physics_browse");
+	}
+	else
+	{
+		mFMP->childDisable("physics_file");
+		mFMP->childDisable("physics_browse");
+	}
+
+	LLSpinCtrl* crease = mFMP->getChild<LLSpinCtrl>("crease_angle");
+	
+	if (mRequestedCreaseAngle[mPreviewLOD] == -1.f)
+	{
+		mFMP->childSetColor("crease_label", LLColor4::grey);
+		crease->forceSetValue(75.f);
+	}
+	else
+	{
+		mFMP->childSetColor("crease_label", LLColor4::white);
+		crease->forceSetValue(mRequestedCreaseAngle[mPreviewLOD]);
+	}
+
+	mModelUpdatedSignal(true);
+
+}
+
+void LLModelPreview::updateLodControls(S32 lod)
+{
 	const char* lod_controls[] =
 	{
-		"lod_mode",
-		"lod_triangle_limit",
-		"lod_error_tolerance",
-		"build_operator_text",
-		"queue_mode_text",
-		"border_mode_text",
-		"share_tolerance_text",
-		"build_operator",
-		"queue_mode",
-		"border_mode",
-		"share_tolerance"
+		"lod_mode_",
+		"lod_triangle_limit_",
 	};
 	const U32 num_lod_controls = sizeof(lod_controls)/sizeof(char*);
 
 	const char* file_controls[] =
 	{
-		"lod_browse",
-		"lod_file"
+		"lod_browse_",
+		"lod_file_",
 	};
 	const U32 num_file_controls = sizeof(file_controls)/sizeof(char*);
 
-	if (fmp)
+	LLFloaterModelPreview* fmp = LLFloaterModelPreview::sInstance;
+	if (!fmp) return;
+
+	LLComboBox* lod_combo = mFMP->findChild<LLComboBox>("lod_source_" + lod_name[lod]);
+	if (!lod_combo) return;
+
+	S32 lod_mode = lod_combo->getCurrentIndex();
+	if (lod_mode == 0) // LoD from file
 	{
-		//enable/disable controls based on radio groups
-		if (mFMP->childGetValue("lod_from_file").asBoolean())
-		{ 
-			fmp->mLODMode[mPreviewLOD] = 0;
-			for (U32 i = 0; i < num_file_controls; ++i)
-			{
-				mFMP->childEnable(file_controls[i]);
-			}
+		fmp->mLODMode[lod] = 0;
+		for (U32 i = 0; i < num_file_controls; ++i)
+		{
+			mFMP->childShow(file_controls[i] + lod_name[lod]);
+		}
 
-			for (U32 i = 0; i < num_lod_controls; ++i)
-			{
-				mFMP->childDisable(lod_controls[i]);
-			}
+		for (U32 i = 0; i < num_lod_controls; ++i)
+		{
+			mFMP->childHide(lod_controls[i] + lod_name[lod]);
+		}
+	}
+	else if (lod_mode == 2) // use LoD above
+	{
+		fmp->mLODMode[lod] = 2;
+		for (U32 i = 0; i < num_file_controls; ++i)
+		{
+			mFMP->childHide(file_controls[i] + lod_name[lod]);
 		}
-		else if (mFMP->childGetValue("lod_none").asBoolean())
+
+		for (U32 i = 0; i < num_lod_controls; ++i)
 		{
-			fmp->mLODMode[mPreviewLOD] = 2;
-			for (U32 i = 0; i < num_file_controls; ++i)
-			{
-				mFMP->childDisable(file_controls[i]);
-			}
+			mFMP->childHide(lod_controls[i] + lod_name[lod]);
+		}
 
-			for (U32 i = 0; i < num_lod_controls; ++i)
-			{
-				mFMP->childDisable(lod_controls[i]);
-			}
+		if (lod < LLModel::LOD_HIGH)
+		{
+			mModel[lod] = mModel[lod + 1];
+			mScene[lod] = mScene[lod + 1];
+			mVertexBuffer[lod].clear();
 
-			if (!mModel[mPreviewLOD].empty())
+			// Also update lower LoD
+			if (lod > LLModel::LOD_IMPOSTOR)
 			{
-				mModel[mPreviewLOD].clear();
-				mScene[mPreviewLOD].clear();
-				mVertexBuffer[mPreviewLOD].clear();
-
-				//this can cause phasing issues with the UI, so reenter this function and return
-				updateStatusMessages();
-				return;
+				updateLodControls(lod - 1);
 			}
 		}
-		else
-		{	// auto generate, also the default case for wizard which has no radio selection
-			fmp->mLODMode[mPreviewLOD] = 1;
+	}
+	else // auto generate, the default case for all LoDs except High
+	{
+		fmp->mLODMode[lod] = 1;
 
-			//don't actually regenerate lod when refreshing UI
-			mLODFrozen = true;
+		//don't actually regenerate lod when refreshing UI
+		mLODFrozen = true;
 
-			for (U32 i = 0; i < num_file_controls; ++i)
-			{
-				mFMP->childDisable(file_controls[i]);
-			}
+		for (U32 i = 0; i < num_file_controls; ++i)
+		{
+			mFMP->childHide(file_controls[i] + lod_name[lod]);
+		}
 
-			for (U32 i = 0; i < num_lod_controls; ++i)
-			{
-				mFMP->childEnable(lod_controls[i]);
-			}
+		for (U32 i = 0; i < num_lod_controls; ++i)
+		{
+			mFMP->childShow(lod_controls[i] + lod_name[lod]);
+		}
 
-			//if (threshold)
-			{	
-				LLSpinCtrl* threshold = mFMP->getChild<LLSpinCtrl>("lod_error_threshold");
-				LLSpinCtrl* limit = mFMP->getChild<LLSpinCtrl>("lod_triangle_limit");
 
-				limit->setMaxValue(mMaxTriangleLimit);
-				limit->forceSetValue(mRequestedTriangleCount[mPreviewLOD]);
+		LLSpinCtrl* threshold = mFMP->getChild<LLSpinCtrl>("lod_error_threshold_" + lod_name[lod]);
+		LLSpinCtrl* limit = mFMP->getChild<LLSpinCtrl>("lod_triangle_limit_" + lod_name[lod]);
 
-				threshold->forceSetValue(mRequestedErrorThreshold[mPreviewLOD]);
+		limit->setMaxValue(mMaxTriangleLimit);
+		limit->forceSetValue(mRequestedTriangleCount[lod]);
 
-				mFMP->getChild<LLComboBox>("lod_mode")->selectNthItem(mRequestedLoDMode[mPreviewLOD]);
-				mFMP->getChild<LLComboBox>("build_operator")->selectNthItem(mRequestedBuildOperator[mPreviewLOD]);
-				mFMP->getChild<LLComboBox>("queue_mode")->selectNthItem(mRequestedQueueMode[mPreviewLOD]);
-				mFMP->getChild<LLComboBox>("border_mode")->selectNthItem(mRequestedBorderMode[mPreviewLOD]);
-				mFMP->getChild<LLSpinCtrl>("share_tolerance")->setValue(mRequestedShareTolerance[mPreviewLOD]);
+		threshold->forceSetValue(mRequestedErrorThreshold[lod]);
 
-				if (mRequestedLoDMode[mPreviewLOD] == 0)
-				{
-					limit->setVisible(true);
-					threshold->setVisible(false);
+		mFMP->getChild<LLComboBox>("lod_mode_" + lod_name[lod])->selectNthItem(mRequestedLoDMode[lod]);
 
-					limit->setMaxValue(mMaxTriangleLimit);
-					limit->setIncrement(mMaxTriangleLimit/32);
-				}
-				else
-				{
-					limit->setVisible(false);
-					threshold->setVisible(true);
-				}
-			}
+		if (mRequestedLoDMode[lod] == 0)
+		{
+			limit->setVisible(true);
+			threshold->setVisible(false);
 
-			mLODFrozen = false;
+			limit->setMaxValue(mMaxTriangleLimit);
+			limit->setIncrement(mMaxTriangleLimit/32);
+		}
+		else
+		{
+			limit->setVisible(false);
+			threshold->setVisible(true);
 		}
-	}
-
-	if (mFMP->childGetValue("physics_lod_combo").asString() == "From file")
-	{
-		mFMP->childEnable("physics_file");
-		mFMP->childEnable("physics_browse");
-	}
-	else
-	{
-		mFMP->childDisable("physics_file");
-		mFMP->childDisable("physics_browse");
-	}
 
-	LLSpinCtrl* crease = mFMP->getChild<LLSpinCtrl>("crease_angle");
-	
-	if (mRequestedCreaseAngle[mPreviewLOD] == -1.f)
-	{
-		mFMP->childSetColor("crease_label", LLColor4::grey);
-		crease->forceSetValue(75.f);
-	}
-	else
-	{
-		mFMP->childSetColor("crease_label", LLColor4::white);
-		crease->forceSetValue(mRequestedCreaseAngle[mPreviewLOD]);
+		mLODFrozen = false;
 	}
-
-	mModelUpdatedSignal(true);
-
 }
 
 void LLModelPreview::setPreviewTarget(F32 distance)
@@ -5484,8 +5377,7 @@ void LLModelPreview::setPreviewLOD(S32 lod)
 
 		LLComboBox* combo_box = mFMP->getChild<LLComboBox>("preview_lod_combo");
 		combo_box->setCurrentByIndex((NUM_LOD-1)-mPreviewLOD); // combo box list of lods is in reverse order
-		mFMP->childSetTextArg("lod_table_footer", "[DETAIL]", mFMP->getString(lod_name[mPreviewLOD]));
-		mFMP->childSetText("lod_file", mLODFile[mPreviewLOD]);
+		mFMP->childSetText("lod_file_" + lod_name[mPreviewLOD], mLODFile[mPreviewLOD]);
 
 		// the wizard has three lod drop downs
 		LLComboBox* combo_box2 = mFMP->getChild<LLComboBox>("preview_lod_combo2");
@@ -5506,25 +5398,16 @@ void LLModelPreview::setPreviewLOD(S32 lod)
 			mFMP->childSetColor(lod_triangles_name[i], color);
 			mFMP->childSetColor(lod_vertices_name[i], color);
 		}
-
-		LLFloaterModelPreview* fmp = LLFloaterModelPreview::sInstance;
-		if (fmp)
-		{
-			LLRadioGroup* radio = fmp->getChild<LLRadioGroup>("lod_file_or_limit");
-			radio->selectNthItem(fmp->mLODMode[mPreviewLOD]);
-		}
 	}
 	refresh();
 	updateStatusMessages();
 }
 
-//static
-void LLFloaterModelPreview::onBrowseLOD(void* data)
+void LLFloaterModelPreview::onBrowseLOD(S32 lod)
 {
 	assert_main_thread();
 
-	LLFloaterModelPreview* mp = (LLFloaterModelPreview*) data;
-	mp->loadModel(mp->mModelPreview->mPreviewLOD);
+	loadModel(lod);
 }
 
 //static
@@ -5566,8 +5449,7 @@ void LLFloaterModelPreview::onUpload(void* user_data)
 }
 
 
-//static
-void LLFloaterModelPreview::refresh(LLUICtrl* ctrl, void* user_data)
+void LLFloaterModelPreview::refresh()
 {
 	sInstance->toggleCalculateButton(true);
 	sInstance->mModelPreview->mDirty = true;
@@ -5588,11 +5470,12 @@ void LLModelPreview::textureLoadedCallback( BOOL success, LLViewerFetchedTexture
 	}
 }
 
-void LLModelPreview::onLODParamCommit(bool enforce_tri_limit)
+void LLModelPreview::onLODParamCommit(S32 lod, bool enforce_tri_limit)
 {
 	if (!mLODFrozen)
 	{
-		genLODs(mPreviewLOD, 3, enforce_tri_limit);
+		genLODs(lod, 3, enforce_tri_limit);
+		updateLodControls(lod);
 		updateStatusMessages();
 		refresh();
 	}
@@ -5655,6 +5538,12 @@ void LLFloaterModelPreview::toggleCalculateButton(bool visible)
 	}
 }
 
+void LLFloaterModelPreview::onLoDSourceCommit(S32 lod)
+{
+	mModelPreview->updateLodControls(lod);
+	refresh();
+}
+
 void LLFloaterModelPreview::resetDisplayOptions()
 {
 	std::map<std::string,bool>::iterator option_it = mModelPreview->mViewOption.begin();
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index f93d3b9482..d93940efc2 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -176,13 +176,13 @@ public:
 
 	void setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost);
 	
-	static void onBrowseLOD(void* data);
+	void onBrowseLOD(S32 lod);
 	
 	static void onReset(void* data);
 
 	static void onUpload(void* data);
 	
-	static void refresh(LLUICtrl* ctrl, void* data);
+	void refresh();
 	
 	void			loadModel(S32 lod);
 	void 			loadModel(S32 lod, const std::string& file_name, bool force_disable_slm = false);
@@ -222,10 +222,12 @@ protected:
 	
 	static void		onGenerateNormalsCommit(LLUICtrl*,void*);
 	
+	void toggleGenarateNormals();
+
 	static void		onAutoFillCommit(LLUICtrl*,void*);
-	static void		onLODParamCommit(LLUICtrl*,void*);
-	static void		onLODParamCommitTriangleLimit(LLUICtrl*,void*);
 	
+	void onLODParamCommit(S32 lod, bool enforce_tri_limit);
+
 	static void		onExplodeCommit(LLUICtrl*, void*);
 	
 	static void onPhysicsParamCommit(LLUICtrl* ctrl, void* userdata);
@@ -264,7 +266,7 @@ protected:
 	//store which lod mode each LOD is using
 	// 0 - load from file
 	// 1 - auto generate
-	// 2 - None
+	// 2 - use LoD above
 	S32 mLODMode[4];
 
 	LLMutex* mStatusLock;
@@ -275,6 +277,8 @@ private:
 	void onClickCalculateBtn();
 	void toggleCalculateButton();
 
+	void onLoDSourceCommit(S32 lod);
+
 	// Toggles between "Calculate weights & fee" and "Upload" buttons.
 	void toggleCalculateButton(bool visible);
 
@@ -335,8 +339,9 @@ public:
 	void saveUploadData(const std::string& filename, bool save_skinweights, bool save_joint_poisitions);
 	void clearIncompatible(S32 lod);
 	void updateStatusMessages();
+	void updateLodControls(S32 lod);
 	void clearGLODGroup();
-	void onLODParamCommit(bool enforce_tri_limit);
+	void onLODParamCommit(S32 lod, bool enforce_tri_limit);
 
 	const bool getModelPivot( void ) const { return mHasPivot; }
 	void setHasPivot( bool val ) { mHasPivot = val; }
diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index 39ef844824..21feb9908e 100755
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -100,166 +100,636 @@
       name="import_tab"
       tab_position="top">
       <!-- LOD PANEL -->
-    <panel
-      border="true"
-      label="Level of Detail"
-      name="lod_panel"
-      help_topic="upload_model_lod">
-     LOD TABLE
-    <panel
-      follows="top|left"
-      name="lod table"
-      left="0"
-      top="0"
-      width="300"
-      height="163"
-      visible="true"
-      border="true"
-      bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
-    
-    <text left="10" width="240" bottom="20" height="15" follows="left|top" name="lod_table_header">
-      Select Level of Detail:
-    </text>
-    
-    <text valign="center" halign="center" bg_visible="true" bottom_delta="16" left="75" name="triangles" width="65" height="18" follows="left|top" value="Triangles"/>
-    <text valign="center" halign="center" bg_visible="true" left_pad="0" width="65" name="vertices" height="18" follows="left|top" value="Vertices"/>
-    <text valign="center" halign="center" left_pad="0" name="status" width="65" bg_visible="true" height="18" follows="left|top" value="Status"/>
-    
-    <text valign="center" halign="center" bg_visible="true" name="high_label" left="10" top_pad="0" width="65" height="18" follows="left|top" value="High"/>
-    <text valign="center" halign="center" bg_visible="true" name="high_triangles" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-    <text valign="center" halign="center" bg_visible="true" name="high_vertices" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-    <text valign="center" halign="center" bg_visible="true" name="high_status" left_pad="0" width="65" height="18" follows="left|top" value=""/>
-    <icon height="16" width="16" image_name="lag_status_critical.tga" mouse_opaque="true" name="status_icon_high" left_delta="20" top_delta="0" />
-    
-    <text valign="center" halign="center" bg_visible="true" name="medium_label" left="10" top_pad="0" width="65" height="18" follows="left|top" value="Medium"/>
-    <text valign="center" halign="center" bg_visible="true" name="medium_triangles" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-    <text valign="center" halign="center" bg_visible="true" name="medium_vertices" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-    <text valign="center" halign="center" bg_visible="true" name="medium_status" left_pad="0" width="65" height="18" follows="left|top" value=""/>
-    <icon height="16" width="16" image_name="lag_status_critical.tga" mouse_opaque="true" name="status_icon_medium" left_delta="20" top_delta="0" />
-    
-    <text valign="center" halign="center" bg_visible="true" name="low_label" left="10" top_pad="0" width="65" height="18" follows="left|top" value="Low"/>
-    <text valign="center" halign="center" bg_visible="true" name="low_triangles" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-    <text valign="center" halign="center" bg_visible="true" name="low_vertices" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-    <text valign="center" halign="center" bg_visible="true" name="low_status" left_pad="0" width="65" height="18" follows="left|top" value=""/>
-    <icon height="16" width="16" image_name="lag_status_critical.tga" mouse_opaque="true" name="status_icon_low" left_delta="20" top_delta="0" />
-    
-    <text valign="center" halign="center" bg_visible="true" name="lowest_label" left="10" top_pad="0" width="65" height="18" follows="left|top" value="Lowest"/>
-    <text valign="center" halign="center" bg_visible="true" name="lowest_triangles" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-    <text valign="center" halign="center" bg_visible="true" name="lowest_vertices" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-    <text valign="center" halign="center" bg_visible="true" name="lowest_status" left_pad="0" width="65" height="18" follows="left|top" value=""/>
-    <icon height="16" width="16" image_name="lag_status_critical.tga" mouse_opaque="true" name="status_icon_lowest" left_delta="20" top_delta="0" />
-    
-    <text left="10" width="240" height="15" top_pad="15" follows="left|top" name="lod_table_footer">
-      Level of Detail: [DETAIL]
-    </text>
-    
-    <icon height="16" width="16" left="20" follows="left|top" name="lod_status_message_icon"/>
-    <text left_pad="5" width="230" height="28" follows="left|top" top_pad="-15" wrap="true" name="lod_status_message_text"/>
-    </panel>
-    
-     LOD MESH
-    <panel
-      follows="top|left"
-      name="mesh"
-      left="0"
-      top_pad="0"
-      width="300"
-      height="237"
-      visible="true"
-      border="true"
-      bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
-    
-    <text top_pad="5" left="10" name="mesh_label" height="15" follows="left|top">
-      Mesh
-    </text>
-    
-    <radio_group follows="top|left" height="210" left="30" name="lod_file_or_limit" width="240" value="lod_from_file">
-      <radio_item bottom="195" label="Load from file" name="lod_from_file"/>
-      <radio_item bottom="150" label="Auto generate" name="lod_auto_generate"/>
-      <radio_item bottom="0" label="None" name="lod_none"/>
-    </radio_group>
-    
-    <line_editor follows="left|top" bottom_delta="-170" width="140" left="45" value="" name="lod_file" height="20"/>
-    <button bottom_delta="3" name="lod_browse" label="Browse..." left_pad="5" follows="left|top" width="70" height="25"/>
-    
-    <combo_box follows="top|left" name="lod_mode" top_pad="22" width="100" left="45" height="20">
-      <combo_item name="triangle_limit">
-        Triangle Limit
-      </combo_item>
-      <combo_item name="error_threshold">
-        Error Threshold
-      </combo_item>
-    </combo_box>
-    <spinner follows="top|left" name="lod_triangle_limit" increment="10" left_pad="5" height="20" width="100" decimal_digits="0" enabled="true"/>
-    <spinner left_delta="0" bottom_delta="0" increment="0.01"  follows="top|left" name="lod_error_threshold" min_val="0" max_val="100" height="20" width="100" decimal_digits="3" visible="false" enabled="true"/>
-    
-    <text follows="top|left" name="build_operator_text" left="45" top_pad="10" width="100" height="15" text_readonly_color="LabelDisabledColor">
-      Build Operator:  
-    </text>
-    <text follows="top|left" name="queue_mode_text" left_pad="5" width="100" height="15" text_readonly_color="LabelDisabledColor">
-      Queue Mode:
-    </text>
-    <combo_box follows="top|left" name="build_operator" top_pad="5" left="45" width="100" height="20">
-      <combo_item name="edge_collapse">
-        Edge Collapse
-      </combo_item>
-      <combo_item name="half_edge_collapse">
-        Half Edge Collapse
-      </combo_item>
-    </combo_box>
-    
-    <combo_box follows="top|left" name="queue_mode" left_pad="5" width="100" height="20">
-      <combo_item name="greedy">
-        Greedy
-      </combo_item>
-      <combo_item name="lazy">
-        Lazy
-      </combo_item>
-      <combo_item name="independent">
-        Independent
-      </combo_item>
-    </combo_box>
-    
-    <text top_pad="10" name="border_mode_text" left="45" follows="left|top" width="100" height="15" text_readonly_color="LabelDisabledColor">
-      Border Mode:
-    </text>
-    
-    <text left_pad="5" name="share_tolderance_text"  follows="left|top" width="100" height="15" text_readonly_color="LabelDisabledColor">
-      Share Tolerance:
-    </text>
-    
-    <combo_box follows="left|top" left="45" height="20" name="border_mode" width="100">
-      <combo_item name="border_unlock">
-        Unlock
-      </combo_item>
-      <combo_item name="border_lock">
-        Lock
-      </combo_item>
-    </combo_box>
-    <spinner follows="left|top" name="share_tolerance" left_pad="5" width="100" decimal_digits="5" initial_value="0.00001" height="20"/>
-    </panel>
-    
-     LOD GENERATE NORMALS
-    <panel
-      follows="top|left"
-      name="generate normals"
-      left="0"
-      top_pad="0"
-      width="300"
-      height="46"
-      visible="true"
-      border="true"
-      bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
-    
-    <text left="10" name="gen_normals_label" top_pad="5" follows="top|left" width="240" height="15">
-      Generate Normals
-    </text>
-    <text left="35" top_pad="5" follows="top|left" width="100" height="15" name="crease_label">
-      Crease Angle:
-    </text>
-    <spinner follows="top|left" left_pad="5" min_val="0" max_val="180" value="75" width="60" height="20" name="crease_angle"/>  
-    </panel>
-      </panel>
+        <panel
+         help_topic="upload_model_lod"
+         label="Level of Detail"
+         layout="topleft"
+         name="lod_panel"
+         title="Level of Detail">
+            <view_border
+             bevel_style="none"
+             follows="top|left"
+             height="275"
+             layout="topleft"
+             left="3"
+             name="lod_tab_border"
+             top_pad="0"
+             width="619" />
+            <text
+             bg_visible="true"
+             follows="left|top"
+             height="18"
+             initial_value="Source"
+             layout="topleft"
+             left="75"
+             name="source"
+             top="15"
+             valign="center"
+             value="Source"
+             width="335" />
+            <text
+             bg_visible="true"
+             follows="left|top"
+             halign="right"
+             height="18"
+             initial_value="Triangles"
+             layout="topleft"
+             left_pad="0"
+             name="triangles"
+             top_delta="0"
+             valign="center"
+             value="Triangles"
+             width="65" />
+            <text
+             bg_visible="true"
+             follows="left|top"
+             halign="right"
+             height="18"
+             initial_value="Vertices"
+             layout="topleft"
+             left_pad="0"
+             name="vertices"
+             valign="center"
+             value="Vertices"
+             width="65" />
+            <text
+             bg_visible="true"
+             follows="left|top"
+             height="18"
+             initial_value="High"
+             layout="topleft"
+             left="10"
+             name="high_label"
+             top_pad="10"
+             valign="center"
+             value="High"
+             width="65" />
+            <combo_box
+             follows="top|left"
+             height="20"
+             layout="topleft"
+             left_pad="0"
+             name="lod_source_high"
+             top_delta="-3"
+             width="135">
+                <item
+                 id="Load from file"
+                 value="Load from file" />
+                <item
+                 id="Generate"
+                 value="Generate" />
+            </combo_box>
+            <line_editor
+             follows="left|top"
+             height="20"
+             initial_value=""
+             layout="topleft"
+             left_pad="5"
+             name="lod_file_high"
+             top_delta="0"
+             value=""
+             width="120" />
+            <button
+             follows="left|top"
+             height="20"
+             label="Browse..."
+             layout="topleft"
+             left_pad="5"
+             name="lod_browse_high"
+             top_delta="0"
+             width="70" />
+            <combo_box
+             follows="top|left"
+             height="20"
+             layout="topleft"
+             left="215"
+             name="lod_mode_high"
+             top_delta="0"
+             visible="false"
+             width="135">
+                <item
+                 id="Triangle Limit"
+                 value="Triangle Limit" />
+                <item
+                 id="Error Threshold"
+                 value="Error Threshold" />
+            </combo_box>
+            <spinner
+             decimal_digits="0"
+             follows="top|left"
+             height="20"
+             increment="10"
+             layout="topleft"
+             left_pad="5"
+             name="lod_triangle_limit_high"
+             visible="false"
+             width="55" />
+            <spinner
+             follows="top|left"
+             height="20"
+             increment="0.01"
+             layout="topleft"
+             left_delta="0"
+             max_val="100"
+             name="lod_error_threshold_high"
+             top_delta="0"
+             visible="false"
+             width="55" />
+            <text
+             bg_visible="true"
+             follows="left|top"
+             halign="right"
+             height="18"
+             initial_value="0"
+             layout="topleft"
+             left_pad="0"
+             name="high_triangles"
+             valign="center"
+             value="0"
+             width="65" />
+            <text
+             bg_visible="true"
+             follows="left|top"
+             halign="right"
+             height="18"
+             initial_value="0"
+             layout="topleft"
+             left_pad="0"
+             name="high_vertices"
+             valign="center"
+             value="0"
+             width="65" />
+            <text
+             bg_visible="true"
+             follows="left|top"
+             halign="center"
+             height="18"
+             initial_value=""
+             layout="topleft"
+             left_pad="0"
+             name="high_status"
+             valign="center"
+             value=""
+             width="65" />
+            <icon
+             height="16"
+             image_name="lag_status_critical.tga"
+             layout="topleft"
+             left_delta="20"
+             mouse_opaque="true"
+             name="status_icon_high"
+             top_delta="0"
+             width="16" />
+            <text
+             bg_visible="true"
+             follows="left|top"
+             height="18"
+             initial_value="Medium"
+             layout="topleft"
+             left="10"
+             name="medium_label"
+             top_pad="15"
+             valign="center"
+             value="Medium"
+             width="65" />
+            <combo_box
+             follows="top|left"
+             height="20"
+             layout="topleft"
+             left_pad="0"
+             name="lod_source_medium"
+             top_delta="-3"
+             width="135">
+                <item
+                 id="Load from file"
+                 value="Load from file" />
+                <item
+                 id="Generate"
+                 value="Generate" />
+                <item
+                 id="Use LoD above"
+                 value="Use LoD above" />
+            </combo_box>
+            <line_editor
+             follows="left|top"
+             height="20"
+             initial_value=""
+             layout="topleft"
+             left_pad="5"
+             name="lod_file_medium"
+             top_delta="0"
+             value=""
+             visible="false"
+             width="120" />
+            <button
+             follows="left|top"
+             height="20"
+             label="Browse..."
+             layout="topleft"
+             left_pad="5"
+             name="lod_browse_medium"
+             top_delta="0"
+             visible="false"
+             width="70" />
+            <combo_box
+             follows="top|left"
+             height="20"
+             layout="topleft"
+             left="215"
+             name="lod_mode_medium"
+             top_delta="0"
+             width="135">
+                <item
+                 id="Triangle Limit"
+                 value="Triangle Limit" />
+                <item
+                 id="Error Threshold"
+                 value="Error Threshold" />
+            </combo_box>
+            <spinner
+             decimal_digits="0"
+             follows="top|left"
+             height="20"
+             increment="10"
+             layout="topleft"
+             left_pad="5"
+             name="lod_triangle_limit_medium"
+             width="55" />
+            <spinner
+             follows="top|left"
+             height="20"
+             increment="0.01"
+             layout="topleft"
+             left_delta="0"
+             max_val="100"
+             name="lod_error_threshold_medium"
+             top_delta="0"
+             visible="false"
+             width="55" />
+            <text
+             bg_visible="true"
+             follows="left|top"
+             halign="right"
+             height="18"
+             initial_value="0"
+             layout="topleft"
+             left_pad="0"
+             name="medium_triangles"
+             valign="center"
+             value="0"
+             width="65" />
+            <text
+             bg_visible="true"
+             follows="left|top"
+             halign="right"
+             height="18"
+             initial_value="0"
+             layout="topleft"
+             left_pad="0"
+             name="medium_vertices"
+             valign="center"
+             value="0"
+             width="65" />
+            <text
+             bg_visible="true"
+             follows="left|top"
+             halign="center"
+             height="18"
+             initial_value=""
+             layout="topleft"
+             left_pad="0"
+             name="medium_status"
+             valign="center"
+             value=""
+             width="65" />
+            <icon
+             height="16"
+             image_name="lag_status_critical.tga"
+             layout="topleft"
+             left_delta="20"
+             mouse_opaque="true"
+             name="status_icon_medium"
+             top_delta="0"
+             width="16" />
+            <text
+             bg_visible="true"
+             follows="left|top"
+             height="18"
+             initial_value="Low"
+             layout="topleft"
+             left="10"
+             name="low_label"
+             top_pad="15"
+             valign="center"
+             value="Low"
+             width="65" />
+            <combo_box
+             follows="top|left"
+             height="20"
+             layout="topleft"
+             left_pad="0"
+             name="lod_source_low"
+             top_delta="-3"
+             width="135">
+                <item
+                 id="Load from file"
+                 value="Load from file" />
+                <item
+                 id="Generate"
+                 value="Generate" />
+                <item
+                 id="Use LoD above"
+                 value="Use LoD above" />
+            </combo_box>
+            <line_editor
+             follows="left|top"
+             height="20"
+             initial_value=""
+             layout="topleft"
+             left_pad="5"
+             name="lod_file_low"
+             top_delta="0"
+             value=""
+             visible="false"
+             width="120" />
+            <button
+             follows="left|top"
+             height="20"
+             label="Browse..."
+             layout="topleft"
+             left_pad="5"
+             name="lod_browse_low"
+             top_delta="0"
+             visible="false"
+             width="70" />
+            <combo_box
+             follows="top|left"
+             height="20"
+             layout="topleft"
+             left="215"
+             name="lod_mode_low"
+             top_delta="0"
+             width="135">
+                <item
+                 id="Triangle Limit"
+                 value="Triangle Limit" />
+                <item
+                 id="Error Threshold"
+                 value="Error Threshold" />
+            </combo_box>
+            <spinner
+             decimal_digits="0"
+             follows="top|left"
+             height="20"
+             increment="10"
+             layout="topleft"
+             left_pad="5"
+             name="lod_triangle_limit_low"
+             width="55" />
+            <spinner
+             follows="top|left"
+             height="20"
+             increment="0.01"
+             layout="topleft"
+             left_delta="0"
+             max_val="100"
+             name="lod_error_threshold_low"
+             top_delta="0"
+             visible="false"
+             width="55" />
+            <text
+             bg_visible="true"
+             follows="left|top"
+             halign="right"
+             height="18"
+             initial_value="0"
+             layout="topleft"
+             left_pad="0"
+             name="low_triangles"
+             valign="center"
+             value="0"
+             width="65" />
+            <text
+             bg_visible="true"
+             follows="left|top"
+             halign="right"
+             height="18"
+             initial_value="0"
+             layout="topleft"
+             left_pad="0"
+             name="low_vertices"
+             valign="center"
+             value="0"
+             width="65" />
+            <text
+             bg_visible="true"
+             follows="left|top"
+             halign="center"
+             height="18"
+             initial_value=""
+             layout="topleft"
+             left_pad="0"
+             name="low_status"
+             valign="center"
+             value=""
+             width="65" />
+            <icon
+             height="16"
+             image_name="lag_status_critical.tga"
+             layout="topleft"
+             left_delta="20"
+             mouse_opaque="true"
+             name="status_icon_low"
+             top_delta="0"
+             width="16" />
+            <text
+             bg_visible="true"
+             follows="left|top"
+             height="18"
+             initial_value="Lowest"
+             layout="topleft"
+             left="10"
+             name="lowest_label"
+             top_pad="15"
+             valign="center"
+             value="Lowest"
+             width="65" />
+            <combo_box
+             follows="top|left"
+             height="20"
+             layout="topleft"
+             left_pad="0"
+             name="lod_source_lowest"
+             top_delta="-3"
+             width="135">
+                <item
+                 id="Load from file"
+                 value="Load from file" />
+                <item
+                 id="Generate"
+                 value="Generate" />
+                <item
+                 id="Use LoD above"
+                 value="Use LoD above" />
+            </combo_box>
+            <line_editor
+             follows="left|top"
+             height="20"
+             initial_value=""
+             layout="topleft"
+             left_pad="5"
+             name="lod_file_lowest"
+             top_delta="0"
+             value=""
+             visible="false"
+             width="120" />
+            <button
+             follows="left|top"
+             height="20"
+             label="Browse..."
+             layout="topleft"
+             left_pad="5"
+             name="lod_browse_lowest"
+             top_delta="0"
+             visible="false"
+             width="70" />
+            <combo_box
+             follows="top|left"
+             height="20"
+             layout="topleft"
+             left="215"
+             name="lod_mode_lowest"
+             top_delta="0"
+             width="135">
+                <item
+                 id="Triangle Limit"
+                 value="Triangle Limit" />
+                <item
+                 id="Error Threshold"
+                 value="Error Threshold" />
+            </combo_box>
+            <spinner
+             decimal_digits="0"
+             follows="top|left"
+             height="20"
+             increment="10"
+             layout="topleft"
+             left_pad="5"
+             name="lod_triangle_limit_lowest"
+             width="55" />
+            <spinner
+             follows="top|left"
+             height="20"
+             increment="0.01"
+             layout="topleft"
+             left_delta="0"
+             max_val="100"
+             name="lod_error_threshold_lowest"
+             top_delta="0"
+             visible="false"
+             width="55" />
+            <text
+             bg_visible="true"
+             follows="left|top"
+             halign="right"
+             height="18"
+             initial_value="0"
+             layout="topleft"
+             left_pad="0"
+             name="lowest_triangles"
+             valign="center"
+             value="0"
+             width="65" />
+            <text
+             bg_visible="true"
+             follows="left|top"
+             halign="right"
+             height="18"
+             initial_value="0"
+             layout="topleft"
+             left_pad="0"
+             name="lowest_vertices"
+             valign="center"
+             value="0"
+             width="65" />
+            <text
+             bg_visible="true"
+             follows="left|top"
+             halign="center"
+             height="18"
+             initial_value=""
+             layout="topleft"
+             left_pad="0"
+             name="lowest_status"
+             valign="center"
+             value=""
+             width="65" />
+            <icon
+             height="16"
+             image_name="lag_status_critical.tga"
+             layout="topleft"
+             left_delta="20"
+             mouse_opaque="true"
+             name="status_icon_lowest"
+             top_delta="0"
+             width="16" />
+            <icon
+             height="16"
+             layout="topleft"
+             left="10"
+             name="lod_status_message_icon"
+             top_pad="20"
+             width="16" />
+            <text
+             follows="left|top"
+             height="16"
+             layout="topleft"
+             left_pad="5"
+             name="lod_status_message_text"
+             top_delta="0"
+             width="584"
+             word_wrap="true"
+             wrap="true" />
+            <view_border
+             bevel_style="none"
+             follows="top|left"
+             height="0"
+             layout="topleft"
+             left="10"
+             name="lod_tab_border"
+             top_pad="20"
+             width="605" />
+            <check_box
+             follows="top|left"
+             height="15"
+             label="Generate Normals"
+             layout="topleft"
+             left="10"
+             name="gen_normals"
+             top_pad="20" />
+            <text
+             enabled="false"
+             follows="top|left"
+             height="15"
+             initial_value="Crease Angle:"
+             layout="topleft"
+             left="200"
+             name="crease_label"
+             top_delta="0"
+             value="Crease Angle:"
+             width="100" />
+            <spinner
+             enabled="false"
+             follows="top|left"
+             height="20"
+             initial_value="75"
+             layout="topleft"
+             left_pad="5"
+             max_val="180"
+             name="crease_angle"
+             value="75"
+             width="60" />
+        </panel>
       <!-- PHYSYCS PANEL -->
         <panel
           help_topic="upload_model_physics"
-- 
cgit v1.2.3


From b782f9b0b48b8cb48b306b871aa02c97f3b82c34 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Fri, 2 Sep 2011 20:04:48 +0300
Subject: SH-2309 WIP Label colors changed in mesh upload floater.

---
 indra/newview/skins/default/colors.xml             |  3 +++
 .../skins/default/xui/en/floater_model_preview.xml | 26 ++++++----------------
 2 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml
index 041b72a28e..e51c50d977 100644
--- a/indra/newview/skins/default/colors.xml
+++ b/indra/newview/skins/default/colors.xml
@@ -510,6 +510,9 @@
     <color
      name="MenuPopupBgColor"
 	  reference="DkGray2" />
+    <color
+     name="ModelUploaderLabels"
+     value="1 0.6 0 1" />	  
     <color
      name="MultiSliderDisabledThumbColor"
      reference="Black" />
diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index 21feb9908e..2fa994dfbf 100755
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -116,19 +116,18 @@
              top_pad="0"
              width="619" />
             <text
-             bg_visible="true"
              follows="left|top"
              height="18"
              initial_value="Source"
              layout="topleft"
              left="75"
              name="source"
+             text_color="ModelUploaderLabels"
              top="15"
              valign="center"
              value="Source"
              width="335" />
             <text
-             bg_visible="true"
              follows="left|top"
              halign="right"
              height="18"
@@ -136,12 +135,12 @@
              layout="topleft"
              left_pad="0"
              name="triangles"
+             text_color="ModelUploaderLabels"
              top_delta="0"
              valign="center"
              value="Triangles"
              width="65" />
             <text
-             bg_visible="true"
              follows="left|top"
              halign="right"
              height="18"
@@ -149,17 +148,18 @@
              layout="topleft"
              left_pad="0"
              name="vertices"
+             text_color="ModelUploaderLabels"
              valign="center"
              value="Vertices"
              width="65" />
             <text
-             bg_visible="true"
              follows="left|top"
              height="18"
              initial_value="High"
              layout="topleft"
              left="10"
              name="high_label"
+             text_color="ModelUploaderLabels"
              top_pad="10"
              valign="center"
              value="High"
@@ -236,7 +236,6 @@
              visible="false"
              width="55" />
             <text
-             bg_visible="true"
              follows="left|top"
              halign="right"
              height="18"
@@ -248,7 +247,6 @@
              value="0"
              width="65" />
             <text
-             bg_visible="true"
              follows="left|top"
              halign="right"
              height="18"
@@ -260,7 +258,6 @@
              value="0"
              width="65" />
             <text
-             bg_visible="true"
              follows="left|top"
              halign="center"
              height="18"
@@ -281,13 +278,13 @@
              top_delta="0"
              width="16" />
             <text
-             bg_visible="true"
              follows="left|top"
              height="18"
              initial_value="Medium"
              layout="topleft"
              left="10"
              name="medium_label"
+             text_color="ModelUploaderLabels"
              top_pad="15"
              valign="center"
              value="Medium"
@@ -367,7 +364,6 @@
              visible="false"
              width="55" />
             <text
-             bg_visible="true"
              follows="left|top"
              halign="right"
              height="18"
@@ -379,7 +375,6 @@
              value="0"
              width="65" />
             <text
-             bg_visible="true"
              follows="left|top"
              halign="right"
              height="18"
@@ -391,7 +386,6 @@
              value="0"
              width="65" />
             <text
-             bg_visible="true"
              follows="left|top"
              halign="center"
              height="18"
@@ -412,13 +406,13 @@
              top_delta="0"
              width="16" />
             <text
-             bg_visible="true"
              follows="left|top"
              height="18"
              initial_value="Low"
              layout="topleft"
              left="10"
              name="low_label"
+             text_color="ModelUploaderLabels"
              top_pad="15"
              valign="center"
              value="Low"
@@ -498,7 +492,6 @@
              visible="false"
              width="55" />
             <text
-             bg_visible="true"
              follows="left|top"
              halign="right"
              height="18"
@@ -510,7 +503,6 @@
              value="0"
              width="65" />
             <text
-             bg_visible="true"
              follows="left|top"
              halign="right"
              height="18"
@@ -522,7 +514,6 @@
              value="0"
              width="65" />
             <text
-             bg_visible="true"
              follows="left|top"
              halign="center"
              height="18"
@@ -543,13 +534,13 @@
              top_delta="0"
              width="16" />
             <text
-             bg_visible="true"
              follows="left|top"
              height="18"
              initial_value="Lowest"
              layout="topleft"
              left="10"
              name="lowest_label"
+             text_color="ModelUploaderLabels"
              top_pad="15"
              valign="center"
              value="Lowest"
@@ -629,7 +620,6 @@
              visible="false"
              width="55" />
             <text
-             bg_visible="true"
              follows="left|top"
              halign="right"
              height="18"
@@ -641,7 +631,6 @@
              value="0"
              width="65" />
             <text
-             bg_visible="true"
              follows="left|top"
              halign="right"
              height="18"
@@ -653,7 +642,6 @@
              value="0"
              width="65" />
             <text
-             bg_visible="true"
              follows="left|top"
              halign="center"
              height="18"
-- 
cgit v1.2.3


From 97c6672634b4c6620ebc320ec05758fc2ea99288 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Fri, 2 Sep 2011 20:08:12 +0300
Subject: SH-2171 Commented-out code cleanup.

---
 indra/newview/llaccountingcostmanager.cpp | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/indra/newview/llaccountingcostmanager.cpp b/indra/newview/llaccountingcostmanager.cpp
index 3717344aef..8767955fcb 100644
--- a/indra/newview/llaccountingcostmanager.cpp
+++ b/indra/newview/llaccountingcostmanager.cpp
@@ -81,9 +81,6 @@ public:
 			F32 networkCost		= 0.0f;
 			F32 simulationCost	= 0.0f;
 
-			//LLTransactionID transactionID;
-				
-			//transactionID	= content["selected"][i]["local_id"].asUUID();
 			physicsCost		= content["selected"]["physics"].asReal();
 			networkCost		= content["selected"]["streaming"].asReal();
 			simulationCost	= content["selected"]["simulation"].asReal();
-- 
cgit v1.2.3


From 080625877d9400ba9cbccdcac28f17115f283428 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Fri, 2 Sep 2011 14:24:20 -0700
Subject: sync with viewer-development

---
 indra/newview/skins/default/xui/en/menu_viewer.xml   | 10 ++++++++++
 indra/newview/skins/default/xui/en/notifications.xml | 14 ++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index b08e3abb71..36ebe73753 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -2133,6 +2133,16 @@
                function="ToggleControl"
                parameter="DebugShowMemory" />
             </menu_item_check>
+	     <menu_item_check
+               label="Show Private Mem Info"
+               name="Show Private Mem Info">
+              <menu_item_check.on_check
+               function="CheckControl"
+               parameter="DebugShowPrivateMem" />
+              <menu_item_check.on_click
+               function="ToggleControl"
+               parameter="DebugShowPrivateMem" />
+            </menu_item_check>
 
             <menu_item_separator/>
 
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 251fce2333..99ab56d10a 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -7147,6 +7147,20 @@ Click and drag anywhere on the world to rotate your view
     <tag>funds</tag>
   </notification>
 
+   <notification
+   icon="alertmodal.tga"
+   name="LowMemory"
+   type="alertmodal">
+    Your memory pool is low. Some functions of SL are disabled to avoid crash. Please close other applications. Restart SL if this persists.
+  </notification>
+
+  <notification
+     icon="alertmodal.tga"
+     name="ForceQuitDueToLowMemory"
+     type="alertmodal">
+    SL will quit in 30 seconds due to out of memory.
+  </notification>
+
   <notification
   name="PopupAttempt"
   icon="Popup_Caution"
-- 
cgit v1.2.3


From 4b773752e63a23953148512d2caec939aae6a0ec Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Fri, 2 Sep 2011 14:25:26 -0700
Subject: sync with viewer-development

---
 .../default/xui/en/floater_preferences_proxy.xml   | 273 +++++++++++++++++++++
 1 file changed, 273 insertions(+)
 create mode 100644 indra/newview/skins/default/xui/en/floater_preferences_proxy.xml

diff --git a/indra/newview/skins/default/xui/en/floater_preferences_proxy.xml b/indra/newview/skins/default/xui/en/floater_preferences_proxy.xml
new file mode 100644
index 0000000000..449731ab89
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_preferences_proxy.xml
@@ -0,0 +1,273 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+ legacy_header_height="18"
+ height="500"
+ layout="topleft"
+ name="Proxy Settings Floater"
+ help_topic="proxysettings"
+ title="Proxy Settings"
+ width="500">
+	<check_box
+	 control_name="BrowserProxyEnabled"
+	 top="38"
+	 enabled="true"
+	 follows="left|top"
+	 height="14"
+	 initial_value="false"
+	 commit_callback.function="Proxy.Change"
+	 label="Use HTTP Proxy for Web pages"
+	 left="22"
+	 mouse_opaque="true"
+	 name="web_proxy_enabled"
+	 radio_style="false"
+	 width="400"
+	 top_pad="5" />
+	<text
+	 type="string"
+	 length="1"
+	 follows="left|top"
+	 height="10"
+	 left_delta="23"
+	 layout="topleft"
+	 name="Proxy location"
+	 top_pad="10"
+	 width="300">
+	    HTTP Proxy:
+	</text>
+	<line_editor
+	 control_name="BrowserProxyAddress"
+	 enabled_control="BrowserProxyEnabled"
+	 follows="left|top"
+	 font="SansSerif"
+	 height="23"
+	 layout="topleft"
+	 left_delta="0"
+	 name="web_proxy_editor"
+	 tool_tip="The DNS name or IP address of the HTTP proxy you would like to use."
+	 top_pad="4"
+	 width="200" />
+	<spinner
+	 control_name="BrowserProxyPort"
+	 enabled_control="BrowserProxyEnabled"
+     decimal_digits="0"
+	 follows="left|top"
+	 height="23"
+	 increment="1"
+	 initial_value="80"
+	 label="Port number:"
+	 label_width="95"
+	 layout="topleft"
+	 left_delta="210"
+	 max_val="12000"
+	 min_val="10"
+	 name="web_proxy_port"
+	 top_delta="0"
+	 tool_tip="The port of the HTTP proxy you would like to use."
+	 width="145" />
+	<check_box
+	 control_name="Socks5ProxyEnabled"
+	 height="16"
+	 label="Use SOCKS 5 Proxy for UDP traffic"
+	 layout="topleft"
+	 left="22"
+	 name="socks_proxy_enabled"
+	 top_pad="32"
+	 width="256"
+	 commit_callback.function="Proxy.Change" />
+	<text
+	 type="string"
+	 length="1"
+	 follows="left|top"
+	 height="10"
+	 layout="topleft"
+	 left_delta="23"
+	 name="Proxy location"
+	 top_pad="10"
+	 width="300">
+	    SOCKS 5 Proxy:
+	</text>
+	<line_editor
+	 control_name="Socks5ProxyHost"
+	 enabled_control="Socks5ProxyEnabled"
+	 follows="left|top"
+	 font="SansSerif"
+	 height="23"
+	 layout="topleft"
+	 left_delta="0"
+	 name="socks_proxy_editor"
+	 tool_tip="The DNS name or IP address of the SOCKS 5 proxy you would like to use."
+	 top_pad="4"
+	 width="200"
+	 commit_callback.function="Proxy.Change" />
+	<spinner
+	 control_name="Socks5ProxyPort"
+	 enabled_control="Socks5ProxyEnabled"
+	 decimal_digits="0"
+	 follows="left|top"
+	 height="23"
+	 increment="1"
+	 initial_value="80"
+	 label="Port number:"
+	 label_width="95"
+	 layout="topleft"
+	 left_delta="210"
+	 max_val="12000"
+	 min_val="10"
+	 name="socks_proxy_port"
+	 top_delta="0"
+	 width="145"
+	 tool_tip="The port of the SOCKS 5 proxy you would like to use."
+	 commit_callback.function="Proxy.Change" />
+	<text
+	 type="string"
+	 length="1"
+	 follows="left|top"
+	 height="10"
+	 layout="topleft"
+	 left="40"
+	 name="Proxy location"
+	 top_pad="15"
+	 width="300">
+	    SOCKS Authentication:
+	</text>
+	<radio_group
+	 control_name="Socks5AuthType"
+	 enabled_control="Socks5ProxyEnabled"
+	 height="50"
+	 layout="topleft"
+	 name="socks5_auth_type"
+	 top_pad="10"
+	 width="120"
+	 commit_callback.function="Proxy.Change" >
+		<radio_item
+		 height="16"
+		 label="No Authentication"
+		 layout="topleft"
+		 name="Socks5NoAuth"
+		 value="None"
+		 tool_tip="Socks5 proxy requires no authentication."
+		 width="120" />
+		<radio_item
+		 height="16"
+		 label="Username/Password"
+		 layout="topleft"
+		 name="Socks5UserPass"
+		 value="UserPass"
+		 tool_tip="Socks5 proxy requires username/password authentication."
+		 width="120" />
+	</radio_group>
+	<text
+	 type="string"
+	 length="1"
+	 follows="left|top"
+	 height="10"
+	 layout="topleft"
+	 left_delta="20"
+	 top_delta="50"
+	 width="200">
+	    Username:
+	</text>
+	<text
+	 type="string"
+	 length="1"
+	 follows="left|top"
+	 height="10"
+	 left_pad="15"
+	 layout="topleft"
+	 width="200">
+	    Password:
+	</text>
+	<line_editor
+	 follows="left|top"
+	 font="SansSerif"
+	 height="23"
+	 layout="topleft"
+	 left="60"
+	 name="socks5_username"
+	 tool_tip="The username used to authenticate with your SOCKS 5 server"
+	 top_pad="4"
+	 width="200"
+	 commit_callback.function="Proxy.Change" />
+	<line_editor
+	 follows="left|top"
+	 font="SansSerif"
+	 height="23"
+	 layout="topleft"
+	 left_pad="15"
+	 name="socks5_password"
+	 tool_tip="The password used to authenticate with your SOCKS 5 server"
+	 top_delta="0"
+	 width="200"
+	 is_password="true"
+	 commit_callback.function="Proxy.Change" />
+	<text
+	 type="string"
+	 length="1"
+	 follows="left|top"
+	 height="10"
+	 layout="topleft"
+	 left="25"
+	 name="Proxy location"
+	 top_pad="18"
+	 width="300">
+	   Other HTTP traffic proxy:
+	</text>
+	<radio_group
+	 control_name="HttpProxyType"
+	 name="other_http_proxy_type"
+	 height="60"
+	 layout="topleft"
+	 top_pad="9"
+	 width="120"
+	 left_delta="15" 
+	 commit_callback.function="Proxy.Change" >
+		<radio_item
+		 height="16"
+		 label="Do not proxy"
+		 layout="topleft"
+		 name="OtherNoProxy"
+		 value="None"
+		 width="120"
+		 tool_tip="Non-web HTTP traffic will NOT be sent to any proxy."/>
+		<radio_item
+		 height="16"
+		 label="Use HTTP Proxy"
+		 layout="topleft"
+		 name="OtherHTTPProxy"
+		 value="Web"
+		 width="120"
+		 enabled_control="BrowserProxyEnabled"
+		 tool_tip="Non-web HTTP will be sent through the configured Web proxy." />
+		<radio_item
+		 height="16"
+		 label="Use SOCKS 5 Proxy"
+		 layout="topleft"
+		 name="OtherSocksProxy"
+		 value="Socks"
+		 width="120"
+		 enabled_control="Socks5ProxyEnabled"
+		 tool_tip="Non-web HTTP traffic will be sent through the configured Socks 5 proxy."/>
+	</radio_group>
+	<button
+	 follows="left|top"
+	 height="22"
+	 label="OK"
+	 label_selected="OK"
+	 layout="topleft"
+	 left="282"
+	 name="OK"
+	 top_pad="36"
+	 width="90"
+	 commit_callback.function="Proxy.OK" />
+	<button
+	 follows="left|top"
+	 height="22"
+	 label="Cancel"
+	 label_selected="Cancel"
+	 layout="topleft"
+	 left_pad="10"
+	 name="Cancel"
+	 top_delta="0"
+	 width="90"
+	 commit_callback.function="Proxy.Cancel" />
+</floater>
-- 
cgit v1.2.3


From d63b72fb538d4a9dc977eae91d99263355fadef3 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Mon, 5 Sep 2011 20:38:17 +0300
Subject: SH-2347 FIXED selecting the value in Stitching Type drop down.

---
 indra/newview/llpanelobject.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp
index e4b2396bc6..1f77e7a602 100644
--- a/indra/newview/llpanelobject.cpp
+++ b/indra/newview/llpanelobject.cpp
@@ -1116,11 +1116,11 @@ void LLPanelObject::getState( )
 				{
 					// since 'None' is no longer an option in the combo box
 					// use 'Plane' as an equivalent sculpt type
-					mCtrlSculptType->setCurrentByID(LLSD(LL_SCULPT_TYPE_PLANE));
+					mCtrlSculptType->setSelectedByValue(LLSD(LL_SCULPT_TYPE_PLANE), true);
 				}
 				else
 				{
-					mCtrlSculptType->setCurrentByID(LLSD(sculpt_stitching));
+					mCtrlSculptType->setSelectedByValue(LLSD(sculpt_stitching), true);
 				}
 				mCtrlSculptType->setEnabled(editable && !isMesh);
 			}
-- 
cgit v1.2.3


From 117bd5af1b535f61e1128cead0dcf2503fe24108 Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Tue, 6 Sep 2011 16:23:53 +0300
Subject: SH-2309 FIXED Priority modifications to mesh uploader UI

- Replaced magic number with constant

- Commented my magic numbers
---
 indra/newview/llfloatermodelpreview.cpp | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index e687b1954c..c2872e7651 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -119,8 +119,20 @@ const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PRE
 const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE;
 const S32 PREF_BUTTON_HEIGHT = 16 + 7 + 16;
 const S32 PREVIEW_TEXTURE_HEIGHT = 300;
+
+// "Retain%" decomp parameter has values from 0.0 to 1.0 by 0.01
+// But according to the UI spec for upload model floater, this parameter
+// should be represented by Retain spinner with values from 1 to 100 by 1.
+// To achieve this, RETAIN_COEFFICIENT is used while creating spinner
+// and when value is requested from spinner.
 const double RETAIN_COEFFICIENT = 100;
 
+// "Cosine%" decomp parameter has values from 0.9 to 1 by 0.001
+// But according to the UI spec for upload model floater, this parameter
+// should be represented by Smooth combobox with only 10 values.
+// So this const is used as a size of Smooth combobox list.
+const S32 SMOOTH_VALUES_NUMBER = 10;
+
 void drawBoxOutline(const LLVector3& pos, const LLVector3& size);
 
 
@@ -1225,15 +1237,14 @@ void LLFloaterModelPreview::initDecompControls()
 
 void LLFloaterModelPreview::createSmoothComboBox(LLComboBox* combo_box, float min, float max)
 {
-	float combo_list_size = 10;
-	float delta = (max - min) / combo_list_size;
+	float delta = (max - min) / SMOOTH_VALUES_NUMBER;
 	int ilabel = 0;
 
 	combo_box->add("0 (none)", ADD_BOTTOM, true);
 
 	for(float value = min + delta; value < max; value += delta)
 	{
-		std::string label = (++ilabel == combo_list_size) ? "10 (max)" : llformat("%.1d", ilabel);
+		std::string label = (++ilabel == SMOOTH_VALUES_NUMBER) ? "10 (max)" : llformat("%.1d", ilabel);
 		combo_box->add(label, value, ADD_BOTTOM, true);
 	}
 
-- 
cgit v1.2.3


From aaee960dd3a2d3da51db6b8ba7a6f5b1f414aef5 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Tue, 6 Sep 2011 20:16:51 +0300
Subject: SH-2309 New icons added to mesh upload floater.

---
 indra/newview/skins/default/textures/green_checkmark.png  | Bin 0 -> 414 bytes
 indra/newview/skins/default/textures/red_x.png            | Bin 0 -> 624 bytes
 indra/newview/skins/default/textures/textures.xml         |   4 ++--
 .../skins/default/xui/en/floater_model_preview.xml        |   8 ++++----
 4 files changed, 6 insertions(+), 6 deletions(-)
 create mode 100644 indra/newview/skins/default/textures/green_checkmark.png
 create mode 100644 indra/newview/skins/default/textures/red_x.png

diff --git a/indra/newview/skins/default/textures/green_checkmark.png b/indra/newview/skins/default/textures/green_checkmark.png
new file mode 100644
index 0000000000..d2a5b348dc
Binary files /dev/null and b/indra/newview/skins/default/textures/green_checkmark.png differ
diff --git a/indra/newview/skins/default/textures/red_x.png b/indra/newview/skins/default/textures/red_x.png
new file mode 100644
index 0000000000..a61202f09b
Binary files /dev/null and b/indra/newview/skins/default/textures/red_x.png differ
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index 799cd907dc..8078766203 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -279,9 +279,9 @@ with the same filename but different name
 
   <texture name="menu_separator" file_name="navbar/FileMenu_Divider.png" scale.left="4" scale.top="166" scale.right="0" scale.bottom="0" />
 
-  <texture name="ModelImport_Status_Good" file_name="lag_status_good.tga" preload="false"/>
+  <texture name="ModelImport_Status_Good" file_name="green_checkmark.png" preload="false"/>
   <texture name="ModelImport_Status_Warning" file_name="lag_status_warning.tga" preload="false"/>
-  <texture name="ModelImport_Status_Error" file_name="lag_status_critical.tga" preload="false"/>
+  <texture name="ModelImport_Status_Error" file_name="red_x.png" preload="false"/>
   
   <texture name="MouseLook_View_Off" file_name="bottomtray/MouseLook_view_off.png" preload="false" />
   <texture name="MouseLook_View_On" file_name="bottomtray/MouseLook_view_on.png" preload="false" />
diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index 2fa994dfbf..9dc928b474 100755
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -270,7 +270,7 @@
              width="65" />
             <icon
              height="16"
-             image_name="lag_status_critical.tga"
+             image_name="red_x.png"
              layout="topleft"
              left_delta="20"
              mouse_opaque="true"
@@ -398,7 +398,7 @@
              width="65" />
             <icon
              height="16"
-             image_name="lag_status_critical.tga"
+             image_name="red_x.png"
              layout="topleft"
              left_delta="20"
              mouse_opaque="true"
@@ -526,7 +526,7 @@
              width="65" />
             <icon
              height="16"
-             image_name="lag_status_critical.tga"
+             image_name="red_x.png"
              layout="topleft"
              left_delta="20"
              mouse_opaque="true"
@@ -654,7 +654,7 @@
              width="65" />
             <icon
              height="16"
-             image_name="lag_status_critical.tga"
+             image_name="red_x.png"
              layout="topleft"
              left_delta="20"
              mouse_opaque="true"
-- 
cgit v1.2.3


From 0e4586a42f754775e27405d0a572ff5962d5a951 Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Wed, 7 Sep 2011 20:53:44 +0300
Subject: SH-2371 FIXED "Not allowed to upload message" flashes when uploader
 dialog comes up

- This is a regression bug caused by changeset:20407
---
 indra/newview/skins/default/xui/en/floater_model_preview.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index df4c66c5b6..cae6445b02 100755
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -1296,7 +1296,7 @@
          name="warning_title"
          top_pad="10"
          text_color="DrYellow"
-         visible="true"
+         visible="false"
          width="40">
          NOTE:
        </text>
@@ -1310,7 +1310,7 @@
          top_delta="2"
          wrap="true"
          width="462"
-         visible="true">
+         visible="false">
          You dont have rights to upload mesh models. [[VURL] Find out how] to get certified.
        </text>
     </panel>
-- 
cgit v1.2.3


From 222908e6d56da661fbb6e2153845b62c983f3bd9 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Wed, 7 Sep 2011 17:07:50 -0700
Subject: sync with viewer-development

---
 .../skins/default/xui/en/menu_media_ctrl.xml       | 12 ++++++++
 indra/newview/skins/default/xui/en/panel_login.xml | 34 +++++++++++++++------
 .../skins/default/xui/en/panel_navigation_bar.xml  |  4 +--
 .../skins/default/xui/en/panel_status_bar.xml      | 35 +++++++++++++---------
 .../skins/default/xui/en/widgets/combo_box.xml     |  3 ++
 5 files changed, 63 insertions(+), 25 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/menu_media_ctrl.xml b/indra/newview/skins/default/xui/en/menu_media_ctrl.xml
index c39c26f25f..960da4bd7a 100644
--- a/indra/newview/skins/default/xui/en/menu_media_ctrl.xml
+++ b/indra/newview/skins/default/xui/en/menu_media_ctrl.xml
@@ -28,4 +28,16 @@
     <menu_item_call.on_enable
      function="Edit.EnablePaste" />
   </menu_item_call>
+  <menu_item_separator
+   layout="topleft"
+   name="debug_separator"
+   visible="false" />
+  <menu_item_call
+   label="Open Web Inspector"
+   layout="topleft"
+   name="open_webinspector"
+   visible="false">
+    <menu_item_call.on_click
+     function="Open.WebInspector" />
+  </menu_item_call>
 </context_menu>
diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml
index 83f1bff91f..983f93cb03 100644
--- a/indra/newview/skins/default/xui/en/panel_login.xml
+++ b/indra/newview/skins/default/xui/en/panel_login.xml
@@ -117,17 +117,33 @@ label="Remember password"
   name="connect_btn"
   top="35"
   width="90" />
-  <!-- Utf code in label is a filled up-pointing triangle -->
-  <menu_button
-  left_pad="5"
-  top="35"
-  width="80"
+  <text
+  follows="left|bottom"
+  font="SansSerifSmall"
+  height="15"
+  left_pad="10"
+  name="mode_selection_text"
+  top="20"
+  width="130">
+    Mode:
+  </text>
+  <combo_box
+    follows="left|bottom"
   height="23"
-  label="Mode &#9650;"
-  name="mode_menu"  
+    max_chars="128"
   tool_tip="Select your mode. Choose Basic for fast, easy exploration and chat. Choose Advanced to access more features."
-  menu_filename="menu_mode_change.xml"
-    />
+    top_pad="0"
+    name="mode_combo"
+    width="110">
+    <combo_box.item
+      label="Basic"
+      name="Basic"
+      value="settings_minimal.xml" />
+    <combo_box.item
+      label="Advanced"
+      name="Advanced"
+      value="" />
+  </combo_box>
   <text
   follows="left|bottom"
   font="SansSerifSmall"
diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
index 8a7bd53054..9749b6fdd4 100644
--- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
@@ -97,7 +97,7 @@
 	     mouse_opaque="false"
 	     name="location_combo"
 	     top_delta="0"
-	     width="266">
+	     width="226">
          <combo_list
          mouse_wheel_opaque="true"/>
 	     <!-- *TODO: Delete.  Let the location_input use the correct art sizes.
@@ -137,7 +137,7 @@
 	     name="search_combo_box"
 	     tool_tip="Search"
 	     top_delta="0"
-	     width="200" >
+	     width="244" >
          <combo_editor
           label="Search [SECOND_LIFE]"
           name="search_combo_editor"/>
diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml
index f25a73da38..c780cf2696 100644
--- a/indra/newview/skins/default/xui/en/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml
@@ -35,7 +35,7 @@
     </panel.string>
   <panel
     height="18"
-    left="-315"
+    left="-355"
     width="95"
     top="1"
     follows="right|top" 
@@ -77,20 +77,28 @@
      top="0"
      width="55" />
   </panel>
-  <!-- UTF 9660 code in label below is a down-pointing filled-in triangle -->
-  <menu_button
-     follows="right|top"    
-    image_color="0 0 0 0"
-    hover_glow_amount="0"
+  <combo_box
+    follows="right|top"   
+    drop_down_button.pad_left="10" 
     left_pad="5"
-    top="2"
-    width="55"
-    height="18"
-    label="Mode &#9660;"
+    top="0"
+    width="120"
+    height="20"
+    pad_left="5"
+    name="mode_combo"
     tool_tip="Select your mode. Choose Basic for fast, easy exploration and chat. Choose Advanced to access more features."
-    menu_filename="menu_mode_change.xml"
-    />
+    >
+    <combo_box.item
+      label="Basic Mode"
+      name="Basic"
+      value="settings_minimal.xml" />
+    <combo_box.item
+      label="Advanced Mode"
+      name="Advanced"
+      value="" />
+  </combo_box>
     <text
+      left_pad="5"
      type="string"
      font="SansSerifSmall"
      text_readonly_color="TimeTextColor"
@@ -99,10 +107,9 @@
      height="16"
      top="5"
      layout="topleft"
-     left_pad="5"
      name="TimeText"
      tool_tip="Current time (Pacific)"
-     width="90">
+     width="75">
         24:00 AM PST
     </text>
     <button
diff --git a/indra/newview/skins/default/xui/en/widgets/combo_box.xml b/indra/newview/skins/default/xui/en/widgets/combo_box.xml
index d1f68a9ef9..82d620d1e6 100644
--- a/indra/newview/skins/default/xui/en/widgets/combo_box.xml
+++ b/indra/newview/skins/default/xui/en/widgets/combo_box.xml
@@ -16,6 +16,9 @@
                               font="SansSerifSmall"
                               scale_image="true"
                               pad_right="24"
+                              halign="left"
+                              tab_stop="true"
+                              follows="all"
                               image_unselected="DropDown_Off"
                               image_selected="DropDown_On"
                               image_pressed="DropDown_Press" 
-- 
cgit v1.2.3


From 616a7b549d21624e6667218efe29c1e552f9b375 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Wed, 7 Sep 2011 23:23:08 -0600
Subject: fix for VWR-26864: Recent commit to Snowstorm project introduces
 frequent errors and crashes associated with private memory pool.

---
 indra/llcommon/llmemory.cpp             | 95 +++++++++++++++++++++++++--------
 indra/llcommon/llmemory.h               | 11 ++--
 indra/newview/app_settings/settings.xml | 11 ++++
 indra/newview/llappviewer.cpp           | 58 ++++----------------
 indra/newview/llviewerdisplay.cpp       |  2 +-
 5 files changed, 101 insertions(+), 76 deletions(-)

diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp
index 8c02ad8290..3b27a1639a 100644
--- a/indra/llcommon/llmemory.cpp
+++ b/indra/llcommon/llmemory.cpp
@@ -165,33 +165,60 @@ void LLMemory::logMemoryInfo(BOOL update)
 	llinfos << "Current allocated page size (KB): " << sAllocatedPageSizeInKB << llendl ;
 	llinfos << "Current availabe physical memory(KB): " << sAvailPhysicalMemInKB << llendl ;
 	llinfos << "Current max usable memory(KB): " << sMaxPhysicalMemInKB << llendl ;
+
+	llinfos << "--- private pool information -- " << llendl ;
+	llinfos << "Total reserved (KB): " << LLPrivateMemoryPoolManager::getInstance()->mTotalReservedSize / 1024 << llendl ;
+	llinfos << "Total allocated (KB): " << LLPrivateMemoryPoolManager::getInstance()->mTotalAllocatedSize / 1024 << llendl ;
 }
 
 //return 0: everything is normal;
 //return 1: the memory pool is low, but not in danger;
 //return -1: the memory pool is in danger, is about to crash.
 //static 
-S32 LLMemory::isMemoryPoolLow()
+bool LLMemory::isMemoryPoolLow()
 {
 	static const U32 LOW_MEMEOY_POOL_THRESHOLD_KB = 64 * 1024 ; //64 MB for emergency use
+	const static U32 MAX_SIZE_CHECKED_MEMORY_BLOCK = 64 * 1024 * 1024 ; //64 MB
+	static void* last_reserved_address = NULL ;
 
 	if(!sEnableMemoryFailurePrevention)
 	{
-		return 0 ; //no memory failure prevention.
+		return false ; //no memory failure prevention.
 	}
 
 	if(sAvailPhysicalMemInKB < (LOW_MEMEOY_POOL_THRESHOLD_KB >> 2)) //out of physical memory
 	{
-		return -1 ;
+		return true ;
 	}
 
 	if(sAllocatedPageSizeInKB + (LOW_MEMEOY_POOL_THRESHOLD_KB >> 2) > sMaxHeapSizeInKB) //out of virtual address space.
 	{
-		return -1 ;
+		return true ;
 	}
 
-	return (S32)(sAvailPhysicalMemInKB < LOW_MEMEOY_POOL_THRESHOLD_KB || 
+	bool is_low = (S32)(sAvailPhysicalMemInKB < LOW_MEMEOY_POOL_THRESHOLD_KB || 
 		sAllocatedPageSizeInKB + LOW_MEMEOY_POOL_THRESHOLD_KB > sMaxHeapSizeInKB) ;
+
+	//check the virtual address space fragmentation
+	if(!is_low)
+	{
+		if(!last_reserved_address)
+		{
+			last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK) ;
+		}
+		else
+		{
+			last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK) ;
+			if(!last_reserved_address) //failed, try once more
+			{
+				last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK) ;
+			}
+		}
+
+		is_low = !last_reserved_address ; //allocation failed
+	}
+
+	return is_low ;
 }
 
 //static 
@@ -1289,15 +1316,13 @@ U16 LLPrivateMemoryPool::LLMemoryChunk::getPageLevel(U32 size)
 //--------------------------------------------------------------------
 const U32 CHUNK_SIZE = 4 << 20 ; //4 MB
 const U32 LARGE_CHUNK_SIZE = 4 * CHUNK_SIZE ; //16 MB
-LLPrivateMemoryPool::LLPrivateMemoryPool(S32 type) :
+LLPrivateMemoryPool::LLPrivateMemoryPool(S32 type, U32 max_pool_size) :
 	mMutexp(NULL),	
 	mReservedPoolSize(0),
 	mHashFactor(1),
-	mType(type)
+	mType(type),
+	mMaxPoolSize(max_pool_size)
 {
-	const U32 MAX_POOL_SIZE = 256 * 1024 * 1024 ; //256 MB
-
-	mMaxPoolSize = MAX_POOL_SIZE ;
 	if(type == STATIC_THREADED || type == VOLATILE_THREADED)
 	{
 		mMutexp = new LLMutex ;
@@ -1362,16 +1387,31 @@ char* LLPrivateMemoryPool::allocate(U32 size)
 				chunk = chunk->mNext ;
 			}
 		}
-
-		chunk = addChunk(chunk_idx) ;
-		if(chunk)
+		else
 		{
-			p = chunk->allocate(size) ;
+			chunk = addChunk(chunk_idx) ;
+			if(chunk)
+			{
+				p = chunk->allocate(size) ;
+			}
 		}
 	}
 
 	unlock() ;
 
+	if(!p) //to get memory from the private pool failed, try the heap directly
+	{
+		static bool to_log = true ;
+		
+		if(to_log)
+		{
+			llwarns << "The memory pool overflows, now using heap directly!" << llendl ;
+			to_log = false ;
+		}
+
+		return (char*)malloc(size) ;
+	}
+
 	return p ;
 }
 
@@ -1472,7 +1512,7 @@ void  LLPrivateMemoryPool::destroyPool()
 	unlock() ;
 }
 
-void  LLPrivateMemoryPool::checkSize(U32 asked_size)
+bool LLPrivateMemoryPool::checkSize(U32 asked_size)
 {
 	if(mReservedPoolSize + asked_size > mMaxPoolSize)
 	{
@@ -1480,8 +1520,12 @@ void  LLPrivateMemoryPool::checkSize(U32 asked_size)
 		llinfos << "Total reserved size: " << mReservedPoolSize + asked_size << llendl ;
 		llinfos << "Total_allocated Size: " << getTotalAllocatedSize() << llendl ;
 
-		llerrs << "The pool is overflowing..." << llendl ;
+		//llerrs << "The pool is overflowing..." << llendl ;
+
+		return false ;
 	}
+
+	return true ;
 }
 
 LLPrivateMemoryPool::LLMemoryChunk* LLPrivateMemoryPool::addChunk(S32 chunk_index)
@@ -1501,7 +1545,11 @@ LLPrivateMemoryPool::LLMemoryChunk* LLPrivateMemoryPool::addChunk(S32 chunk_inde
 			MAX_SLOT_SIZES[chunk_index], MIN_BLOCK_SIZES[chunk_index], MAX_BLOCK_SIZES[chunk_index]) ;
 	}
 
-	checkSize(preferred_size + overhead) ;
+	if(!checkSize(preferred_size + overhead))
+	{
+		return NULL ;
+	}
+
 	mReservedPoolSize += preferred_size + overhead ;
 
 	char* buffer = (char*)malloc(preferred_size + overhead) ;
@@ -1593,7 +1641,7 @@ LLPrivateMemoryPool::LLMemoryChunk* LLPrivateMemoryPool::findChunk(const char* a
 
 void LLPrivateMemoryPool::addToHashTable(LLMemoryChunk* chunk) 
 {
-	static const U16 HASH_FACTORS[] = {41, 83, 193, 317, 419, 523, 0xFFFF}; 
+	static const U16 HASH_FACTORS[] = {41, 83, 193, 317, 419, 523, 719, 997, 1523, 0xFFFF}; 
 	
 	U16 i ;
 	if(mChunkHashList.empty())
@@ -1774,7 +1822,7 @@ void LLPrivateMemoryPool::LLChunkHashElement::remove(LLPrivateMemoryPool::LLMemo
 //--------------------------------------------------------------------
 LLPrivateMemoryPoolManager* LLPrivateMemoryPoolManager::sInstance = NULL ;
 
-LLPrivateMemoryPoolManager::LLPrivateMemoryPoolManager(BOOL enabled) 
+LLPrivateMemoryPoolManager::LLPrivateMemoryPoolManager(BOOL enabled, U32 max_pool_size) 
 {
 	mPoolList.resize(LLPrivateMemoryPool::MAX_TYPES) ;
 
@@ -1784,6 +1832,9 @@ LLPrivateMemoryPoolManager::LLPrivateMemoryPoolManager(BOOL enabled)
 	}
 
 	mPrivatePoolEnabled = enabled ;
+
+	const U32 MAX_POOL_SIZE = 256 * 1024 * 1024 ; //256 MB
+	mMaxPrivatePoolSize = llmax(max_pool_size, MAX_POOL_SIZE) ;
 }
 
 LLPrivateMemoryPoolManager::~LLPrivateMemoryPoolManager() 
@@ -1826,11 +1877,11 @@ LLPrivateMemoryPoolManager::~LLPrivateMemoryPoolManager()
 }
 
 //static 
-void LLPrivateMemoryPoolManager::initClass(BOOL enabled) 
+void LLPrivateMemoryPoolManager::initClass(BOOL enabled, U32 max_pool_size) 
 {
 	llassert_always(!sInstance) ;
 
-	sInstance = new LLPrivateMemoryPoolManager(enabled) ;
+	sInstance = new LLPrivateMemoryPoolManager(enabled, max_pool_size) ;
 }
 
 //static 
@@ -1862,7 +1913,7 @@ LLPrivateMemoryPool* LLPrivateMemoryPoolManager::newPool(S32 type)
 
 	if(!mPoolList[type])
 	{
-		mPoolList[type] = new LLPrivateMemoryPool(type) ;
+		mPoolList[type] = new LLPrivateMemoryPool(type, mMaxPrivatePoolSize) ;
 	}
 
 	return mPoolList[type] ;
diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h
index db753f0d8b..6967edd7e7 100644
--- a/indra/llcommon/llmemory.h
+++ b/indra/llcommon/llmemory.h
@@ -122,7 +122,7 @@ public:
 	static void initMaxHeapSizeGB(F32 max_heap_size_gb, BOOL prevent_heap_failure);
 	static void updateMemoryInfo() ;
 	static void logMemoryInfo(BOOL update = FALSE);
-	static S32  isMemoryPoolLow();
+	static bool isMemoryPoolLow();
 
 	static U32 getAvailableMemKB() ;
 	static U32 getMaxMemKB() ;
@@ -303,7 +303,7 @@ public:
 	} ;
 
 private:
-	LLPrivateMemoryPool(S32 type) ;
+	LLPrivateMemoryPool(S32 type, U32 max_pool_size) ;
 	~LLPrivateMemoryPool() ;
 
 	char *allocate(U32 size) ;
@@ -320,7 +320,7 @@ private:
 	void unlock() ;	
 	S32 getChunkIndex(U32 size) ;
 	LLMemoryChunk*  addChunk(S32 chunk_index) ;
-	void checkSize(U32 asked_size) ;
+	bool checkSize(U32 asked_size) ;
 	void removeChunk(LLMemoryChunk* chunk) ;
 	U16  findHashKey(const char* addr);
 	void addToHashTable(LLMemoryChunk* chunk) ;
@@ -383,12 +383,12 @@ private:
 class LL_COMMON_API LLPrivateMemoryPoolManager
 {
 private:
-	LLPrivateMemoryPoolManager(BOOL enabled) ;
+	LLPrivateMemoryPoolManager(BOOL enabled, U32 max_pool_size) ;
 	~LLPrivateMemoryPoolManager() ;
 
 public:	
 	static LLPrivateMemoryPoolManager* getInstance() ;
-	static void initClass(BOOL enabled) ;
+	static void initClass(BOOL enabled, U32 pool_size) ;
 	static void destroyClass() ;
 
 	LLPrivateMemoryPool* newPool(S32 type) ;
@@ -398,6 +398,7 @@ private:
 	static LLPrivateMemoryPoolManager* sInstance ;
 	std::vector<LLPrivateMemoryPool*> mPoolList ;
 	BOOL mPrivatePoolEnabled;
+	U32  mMaxPrivatePoolSize;
 
 public:
 	//debug and statistics info.
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 6ebb0162a4..3699dbc3ec 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -5646,6 +5646,17 @@
       <key>Value</key>
       <integer>1</integer>
     </map>
+    <key>MemoryPrivatePoolSize</key>
+    <map>
+      <key>Comment</key>
+      <string>Size of the private memory pool in MB (min. value is 256)</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>U32</string>
+      <key>Value</key>
+      <integer>512</integer>
+    </map>
     <key>MemProfiling</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 7e597fe5dc..e6942971f3 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -722,7 +722,7 @@ bool LLAppViewer::init()
 	//set the max heap size.
 	initMaxHeapSize() ;
 
-	LLPrivateMemoryPoolManager::initClass((BOOL)gSavedSettings.getBOOL("MemoryPrivatePoolEnabled")) ;
+	LLPrivateMemoryPoolManager::initClass((BOOL)gSavedSettings.getBOOL("MemoryPrivatePoolEnabled"), (U32)gSavedSettings.getU32("MemoryPrivatePoolSize")) ;
 
 	// write Google Breakpad minidump files to our log directory
 	std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "");
@@ -1122,63 +1122,25 @@ void LLAppViewer::checkMemory()
 {
 	const static F32 MEMORY_CHECK_INTERVAL = 1.0f ; //second
 	//const static F32 MAX_QUIT_WAIT_TIME = 30.0f ; //seconds
-	const static U32 MAX_SIZE_CHECKED_MEMORY_BLOCK = 64 * 1024 * 1024 ; //64 MB
-	//static F32 force_quit_timer = MAX_QUIT_WAIT_TIME + MEMORY_CHECK_INTERVAL ;
-	static void* last_reserved_address = NULL ;
+	//static F32 force_quit_timer = MAX_QUIT_WAIT_TIME + MEMORY_CHECK_INTERVAL ;	
 
-	if(MEMORY_CHECK_INTERVAL > mMemCheckTimer.getElapsedTimeF32())
+	if(!gGLManager.mDebugGPU)
 	{
 		return ;
 	}
-	mMemCheckTimer.reset() ;
-
-	if(gGLManager.mDebugGPU)
-	{
-		//update the availability of memory
-		LLMemory::updateMemoryInfo() ;
-	}
 
-	//check the virtual address space fragmentation
-	if(!last_reserved_address)
-	{
-		last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK) ;
-	}
-	else
+	if(MEMORY_CHECK_INTERVAL > mMemCheckTimer.getElapsedTimeF32())
 	{
-		last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK) ;
-		if(!last_reserved_address) //failed, try once more
-		{
-			last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK) ;
-		}
+		return ;
 	}
+	mMemCheckTimer.reset() ;
 
-	S32 is_low = !last_reserved_address || LLMemory::isMemoryPoolLow() ;
-
-	//if(is_low < 0) //to force quit
-	//{
-	//	if(force_quit_timer > MAX_QUIT_WAIT_TIME) //just hit the limit for the first time
-	//	{
-	//		//send out the notification to tell the viewer is about to quit in 30 seconds.
-	//		LLNotification::Params params("ForceQuitDueToLowMemory");
-	//		LLNotifications::instance().add(params);
+	//update the availability of memory
+	LLMemory::updateMemoryInfo() ;
 
-	//		force_quit_timer = MAX_QUIT_WAIT_TIME - MEMORY_CHECK_INTERVAL ;
-	//	}
-	//	else
-	//	{
-	//		force_quit_timer -= MEMORY_CHECK_INTERVAL ;
-	//		if(force_quit_timer < 0.f)
-	//		{
-	//			forceQuit() ; //quit
-	//		}
-	//	}
-	//}
-	//else
-	//{
-	//	force_quit_timer = MAX_QUIT_WAIT_TIME + MEMORY_CHECK_INTERVAL ;
-	//}
+	bool is_low = LLMemory::isMemoryPoolLow() ;
 
-	LLPipeline::throttleNewMemoryAllocation(!is_low ? FALSE : TRUE) ;		
+	LLPipeline::throttleNewMemoryAllocation(is_low) ;		
 	
 	if(is_low)
 	{
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 6142ee0dd6..19326c4e30 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -202,7 +202,7 @@ void display_stats()
 		gMemoryAllocated = LLMemory::getCurrentRSS();
 		U32 memory = (U32)(gMemoryAllocated / (1024*1024));
 		llinfos << llformat("MEMORY: %d MB", memory) << llendl;
-		LLMemory::logMemoryInfo() ;
+		LLMemory::logMemoryInfo(TRUE) ;
 		gRecentMemoryTime.reset();
 	}
 }
-- 
cgit v1.2.3


From f44b44400bf678b71bbbf50b2af7f80e8133a2c3 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Thu, 8 Sep 2011 18:47:37 +0300
Subject: SH-2309 FIXED 'Triangles limit' combo value updating problem. Fixed
 updating 'Error threshold' spinner control visibility.

---
 indra/newview/llfloatermodelpreview.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index a19e17778a..7362e56434 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -3806,7 +3806,7 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim
 	{
 		lod_mode = iface->getFirstSelectedIndex();
 	}
-	mRequestedLoDMode[mPreviewLOD] = lod_mode;
+	mRequestedLoDMode[which_lod] = lod_mode;
 
 	F32 lod_error_threshold = mFMP->childGetValue("lod_error_threshold_" + lod_name[which_lod]).asReal();
 
@@ -4247,6 +4247,8 @@ void LLModelPreview::updateStatusMessages()
 			icon = mFMP->getChild<LLIconCtrl>("lod_status_message_icon");
 			icon->setImage(img);
 		}
+
+		updateLodControls(lod);
 	}
 
 
@@ -4448,6 +4450,7 @@ void LLModelPreview::updateLodControls(S32 lod)
 	{
 		"lod_mode_",
 		"lod_triangle_limit_",
+		"lod_error_threshold_"
 	};
 	const U32 num_lod_controls = sizeof(lod_controls)/sizeof(char*);
 
@@ -5539,8 +5542,6 @@ void LLModelPreview::onLODParamCommit(S32 lod, bool enforce_tri_limit)
 	if (!mLODFrozen)
 	{
 		genLODs(lod, 3, enforce_tri_limit);
-		updateLodControls(lod);
-		updateStatusMessages();
 		refresh();
 	}
 }
-- 
cgit v1.2.3


From 2e652ce660e86097ce2b47bb82926005bb0482c8 Mon Sep 17 00:00:00 2001
From: prep <prep@lindenlab.com>
Date: Thu, 8 Sep 2011 15:54:52 -0400
Subject: Fix for SH-2210

---
 indra/newview/llfloatermodelpreview.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index b424ad45fb..42186aa247 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -2764,6 +2764,7 @@ void LLModelLoader::processElement( daeElement* element, bool& badElement )
 
 	//process children
 	daeTArray< daeSmartRef<daeElement> > children = element->getChildren();
+	int childCount = children.getCount();
 	for (S32 i = 0; i < children.getCount(); i++)
 	{
 		processElement(children[i],badElement);
@@ -3456,6 +3457,12 @@ void LLModelPreview::setPhysicsFromLOD(S32 lod)
 
 void LLModelPreview::clearIncompatible(S32 lod)
 {
+	//Don't discard models if specified model is the physic rep
+	if ( lod == LLModel::LOD_PHYSICS )
+	{
+		return;
+	}
+
 	for (U32 i = 0; i <= LLModel::LOD_HIGH; i++)
 	{ //clear out any entries that aren't compatible with this model
 		if (i != lod)
-- 
cgit v1.2.3


From b56e4cf0e428187c5ed4037b843c05610ed0da2a Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Mon, 12 Sep 2011 14:51:22 -0400
Subject: BUILDFIX GCC fixing unused variable

---
 indra/newview/llfloatermodelpreview.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 56d1fc49ee..55c4907a74 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -2841,7 +2841,7 @@ void LLModelLoader::processElement( daeElement* element, bool& badElement )
 	//process children
 	daeTArray< daeSmartRef<daeElement> > children = element->getChildren();
 	int childCount = children.getCount();
-	for (S32 i = 0; i < children.getCount(); i++)
+	for (S32 i = 0; i < childCount; i++)
 	{
 		processElement(children[i],badElement);
 	}
-- 
cgit v1.2.3


From 8ed52654d05d981dd8a5d63b7cb5445bdcabb271 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Tue, 13 Sep 2011 03:47:27 +0300
Subject: STORM-1585 FIXED Duplicated/missing XUI IDs in
 floater_preferences_proxy.xml.

---
 .../newview/skins/default/xui/en/floater_preferences_proxy.xml | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_preferences_proxy.xml b/indra/newview/skins/default/xui/en/floater_preferences_proxy.xml
index 449731ab89..93bfe53aae 100644
--- a/indra/newview/skins/default/xui/en/floater_preferences_proxy.xml
+++ b/indra/newview/skins/default/xui/en/floater_preferences_proxy.xml
@@ -29,7 +29,7 @@
 	 height="10"
 	 left_delta="23"
 	 layout="topleft"
-	 name="Proxy location"
+	 name="http_proxy_label"
 	 top_pad="10"
 	 width="300">
 	    HTTP Proxy:
@@ -81,7 +81,7 @@
 	 height="10"
 	 layout="topleft"
 	 left_delta="23"
-	 name="Proxy location"
+	 name="socks5_proxy_label"
 	 top_pad="10"
 	 width="300">
 	    SOCKS 5 Proxy:
@@ -125,7 +125,7 @@
 	 height="10"
 	 layout="topleft"
 	 left="40"
-	 name="Proxy location"
+	 name="socks_auth_label"
 	 top_pad="15"
 	 width="300">
 	    SOCKS Authentication:
@@ -163,6 +163,7 @@
 	 height="10"
 	 layout="topleft"
 	 left_delta="20"
+	 name="socks5_username_label"
 	 top_delta="50"
 	 width="200">
 	    Username:
@@ -174,6 +175,7 @@
 	 height="10"
 	 left_pad="15"
 	 layout="topleft"
+	 name="socks5_password_label"
 	 width="200">
 	    Password:
 	</text>
@@ -207,7 +209,7 @@
 	 height="10"
 	 layout="topleft"
 	 left="25"
-	 name="Proxy location"
+	 name="other_proxy_label"
 	 top_pad="18"
 	 width="300">
 	   Other HTTP traffic proxy:
-- 
cgit v1.2.3


From a21aa5509d1c1069a3562b7339f4d22ae927110d Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Tue, 13 Sep 2011 16:59:30 +0300
Subject: STORM-1595 FIXED Removing a wrong debug assertion.

---
 indra/newview/llsidetray.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp
index a7c4057846..93ea952533 100644
--- a/indra/newview/llsidetray.cpp
+++ b/indra/newview/llsidetray.cpp
@@ -685,7 +685,6 @@ LLSideTrayTab* LLSideTray::getTab(const std::string& name)
 bool LLSideTray::isTabAttached(const std::string& name)
 {
 	LLSideTrayTab* tab = getTab(name);
-	llassert(tab);
 	if (!tab) return false;
 
 	return std::find(mTabs.begin(), mTabs.end(), tab) != mTabs.end();
-- 
cgit v1.2.3


From 95774ade55e83b834add4a8cfe055dcaac2d65a9 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Tue, 13 Sep 2011 18:02:48 +0300
Subject: STORM-1597 FIXED Back button int the object profile panel now sticks
 to the left.

---
 indra/newview/skins/default/xui/en/sidepanel_task_info.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml
index c2394a3fa2..6600339ad7 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml
@@ -55,7 +55,7 @@
                 Mixed Sale
             </panel.string>
     <button
-     follows="top|right"
+     follows="top|left"
      height="24"
      image_hover_unselected="BackButton_Over"
      image_pressed="BackButton_Press"
-- 
cgit v1.2.3


From 2c03ee82ecee87c61546be86b28cff2252fd643a Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Tue, 13 Sep 2011 18:41:15 +0300
Subject: STORM-1599 FIXED Scrolling search history with mouse wheel now
 doesn't zoom the wold view upon reaching the end of list.

---
 indra/newview/skins/default/xui/en/panel_navigation_bar.xml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
index 9749b6fdd4..51ffec4727 100644
--- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
@@ -146,7 +146,8 @@
           border.highlight_light_color="FocusColor"
           border.highlight_dark_color="FocusColor"
           border.shadow_light_color="FocusColor"
-          border.shadow_dark_color="FocusColor"/>
+          border.shadow_dark_color="FocusColor"
+          mouse_wheel_opaque="true" />
         </search_combo_box>
 	</panel>
     <favorites_bar
-- 
cgit v1.2.3


From f74b7274d23b43b967331bf970cf7810ef4067d9 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Tue, 13 Sep 2011 19:45:04 +0300
Subject: SH-2400 FIXED crash on model upload. Added checks for LoD strings
 array index bounds.

---
 indra/newview/llfloatermodelpreview.cpp | 46 ++++++++++++++++++++++++++++-----
 1 file changed, 40 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 55c4907a74..bd4abc1f9f 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -3454,6 +3454,13 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable
 
 	LLMutexLock lock(this);
 
+	if (lod < LLModel::LOD_IMPOSTOR || lod > LLModel::NUM_LODS - 1)
+	{
+		llwarns << "Invalid level of detail: " << lod << llendl;
+		assert(lod >= LLModel::LOD_IMPOSTOR && lod < LLModel::NUM_LODS);
+		return;
+	}
+
 	// This triggers if you bring up the file picker and then hit CANCEL.
 	// Just use the previous model (if any) and ignore that you brought up
 	// the file picker.
@@ -3779,6 +3786,14 @@ void LLModelPreview::generateNormals()
 
 void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_limit)
 {
+	// Allow LoD from -1 to LLModel::LOD_PHYSICS
+	if (which_lod < -1 || which_lod > LLModel::NUM_LODS - 1)
+	{
+		llwarns << "Invalid level of detail: " << which_lod << llendl;
+		assert(which_lod >= -1 && which_lod < LLModel::NUM_LODS);
+		return;
+	}
+
 	if (mBaseModel.empty())
 	{
 		return;
@@ -3808,19 +3823,31 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim
 
 	U32 lod_mode = 0;
 
-	LLCtrlSelectionInterface* iface = mFMP->childGetSelectionInterface("lod_mode_" + lod_name[which_lod]);
-	if (iface)
+	F32 lod_error_threshold = 0;
+
+	// The LoD should be in range from Lowest to High
+	if (which_lod > -1 && which_lod < NUM_LOD)
 	{
-		lod_mode = iface->getFirstSelectedIndex();
+		LLCtrlSelectionInterface* iface = mFMP->childGetSelectionInterface("lod_mode_" + lod_name[which_lod]);
+		if (iface)
+		{
+			lod_mode = iface->getFirstSelectedIndex();
+		}
+
+		lod_error_threshold = mFMP->childGetValue("lod_error_threshold_" + lod_name[which_lod]).asReal();
 	}
-	mRequestedLoDMode[which_lod] = lod_mode;
 
-	F32 lod_error_threshold = mFMP->childGetValue("lod_error_threshold_" + lod_name[which_lod]).asReal();
+	if (which_lod != -1)
+	{
+		mRequestedLoDMode[which_lod] = lod_mode;
+	}
 
 	if (lod_mode == 0)
 	{
 		lod_mode = GLOD_TRIANGLE_BUDGET;
-		if (which_lod != -1)
+
+		// The LoD should be in range from Lowest to High
+		if (which_lod > -1 && which_lod < NUM_LOD)
 		{
 			limit = mFMP->childGetValue("lod_triangle_limit_" + lod_name[which_lod]).asInteger();
 		}
@@ -4453,6 +4480,13 @@ void LLModelPreview::updateStatusMessages()
 
 void LLModelPreview::updateLodControls(S32 lod)
 {
+	if (lod < LLModel::LOD_IMPOSTOR || lod > LLModel::LOD_HIGH)
+	{
+		llwarns << "Invalid level of detail: " << lod << llendl;
+		assert(lod >= LLModel::LOD_IMPOSTOR && lod <= LLModel::LOD_HIGH);
+		return;
+	}
+
 	const char* lod_controls[] =
 	{
 		"lod_mode_",
-- 
cgit v1.2.3


From 0a0ae2dd3f3d1f27b5fe13d02118866aa7cbb7d7 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 13 Sep 2011 12:45:28 -0500
Subject: STORM-1562 Potential fix for crash in LLCurl::run -- don't run
 curl_multi_perform from multiple threads simultaneously.

---
 indra/llcommon/llthread.h               | 3 ++-
 indra/llmessage/llcurl.cpp              | 6 +++++-
 indra/llmessage/llcurl.h                | 1 +
 indra/newview/app_settings/settings.xml | 2 +-
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h
index c732e3bc77..b631b96252 100644
--- a/indra/llcommon/llthread.h
+++ b/indra/llcommon/llthread.h
@@ -195,7 +195,8 @@ public:
 	}
 	~LLMutex()
 	{
-		llassert(!isLocked()); // better not be locked!
+		//this assertion erroneously triggers whenever an LLCondition is destroyed
+		//llassert(!isLocked()); // better not be locked!
 		apr_thread_mutex_destroy(mAPRMutexp);
 		mAPRMutexp = NULL;
 	}
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 14e169c6b1..280a8942a8 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -222,7 +222,7 @@ namespace boost
 std::set<CURL*> LLCurl::Easy::sFreeHandles;
 std::set<CURL*> LLCurl::Easy::sActiveHandles;
 LLMutex* LLCurl::Easy::sHandleMutex = NULL;
-
+LLMutex* LLCurl::Easy::sMultiMutex = NULL;
 
 //static
 CURL* LLCurl::Easy::allocEasyHandle()
@@ -606,6 +606,7 @@ void LLCurl::Multi::run()
 		mPerformState = PERFORM_STATE_PERFORMING;
 		if (!mQuitting)
 		{
+			LLMutexLock lock(LLCurl::Easy::sMultiMutex);
 			doPerform();
 		}
 	}
@@ -1179,6 +1180,7 @@ void LLCurl::initClass(bool multi_threaded)
 	check_curl_code(code);
 	
 	Easy::sHandleMutex = new LLMutex();
+	Easy::sMultiMutex = new LLMutex();
 
 #if SAFE_SSL
 	S32 mutex_count = CRYPTO_num_locks();
@@ -1200,6 +1202,8 @@ void LLCurl::cleanupClass()
 
 	delete Easy::sHandleMutex;
 	Easy::sHandleMutex = NULL;
+	delete Easy::sMultiMutex;
+	Easy::sMultiMutex = NULL;
 
 	for (std::set<CURL*>::iterator iter = Easy::sFreeHandles.begin(); iter != Easy::sFreeHandles.end(); ++iter)
 	{
diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h
index 213b281e72..a876a1562e 100644
--- a/indra/llmessage/llcurl.h
+++ b/indra/llmessage/llcurl.h
@@ -251,6 +251,7 @@ private:
 	static std::set<CURL*> sFreeHandles;
 	static std::set<CURL*> sActiveHandles;
 	static LLMutex* sHandleMutex;
+	static LLMutex* sMultiMutex;
 };
 
 class LLCurl::Multi : public LLThread
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 6ebb0162a4..27598c9aac 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -1858,7 +1858,7 @@
     <key>Type</key>
     <string>Boolean</string>
     <key>Value</key>
-    <integer>0</integer>
+    <integer>1</integer>
   </map>
     <key>Cursor3D</key>
     <map>
-- 
cgit v1.2.3


From 19371a9abed3198f9f6083c3b2483e65778e944a Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 13 Sep 2011 13:09:10 -0500
Subject: STORM-1562 Potential fix for crash in LLCurl::run -- make sure all
 ref counted members of llsecapi are thread safe

---
 indra/newview/llsecapi.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llsecapi.h b/indra/newview/llsecapi.h
index 0935a0005b..db57848320 100644
--- a/indra/newview/llsecapi.h
+++ b/indra/newview/llsecapi.h
@@ -132,7 +132,7 @@ protected:
 // LLCertificates are considered unmodifiable
 // Certificates are pulled out of stores, or created via
 // factory calls
-class LLCertificate : public LLRefCount
+class LLCertificate : public LLThreadSafeRefCount
 {
 	LOG_CLASS(LLCertificate);
 public:
@@ -170,7 +170,7 @@ public:
 	
 	// base iterator implementation class, providing
 	// the functionality needed for the iterator class.
-	class iterator_impl : public LLRefCount
+	class iterator_impl : public LLThreadSafeRefCount
 	{
 	public:
 		iterator_impl() {};
@@ -289,7 +289,7 @@ bool operator!=(const LLCertificateVector::iterator& _lhs, const LLCertificateVe
 // * Persistence of credential information based on grid (for saving username/password)
 // * Serialization to an OGP identifier/authenticator pair
 // 
-class LLCredential  : public LLRefCount
+class LLCredential  : public LLThreadSafeRefCount
 {
 public:
 	
@@ -424,7 +424,7 @@ protected:
 
 // LLSecAPIHandler Class
 // Interface handler class for the various security storage handlers.
-class LLSecAPIHandler : public LLRefCount
+class LLSecAPIHandler : public LLThreadSafeRefCount
 {
 public:
 	
-- 
cgit v1.2.3


From 2c16ad9339107aa23a650f9b22ba269da1fd2034 Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Tue, 13 Sep 2011 15:33:31 -0400
Subject: SH-2420 FIX update labeling in about land floater

About land was still referring to the capacity of land in terms of "prims"
The new terminology refers to this as land capacity, so that we can get
away from the "prim equivalent" terms, as they are confusing.
---
 indra/newview/skins/default/xui/en/floater_about_land.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml
index 07cb4c12f5..e5dcc9bcb5 100644
--- a/indra/newview/skins/default/xui/en/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/en/floater_about_land.xml
@@ -834,7 +834,7 @@
              name="Simulator primitive usage:"
              top_pad="4"
              width="364">
-               Primitive usage:
+               Region capacity:
             </text>
             <text
              type="string"
@@ -858,7 +858,7 @@
              name="Primitives parcel supports:"
              top="44"
              width="152">
-                Prims parcel supports:
+                Parcel land capacity:
             </text>
             <text
              type="string"
@@ -882,7 +882,7 @@
              name="Primitives on parcel:"
              top="64"
              width="152">
-                Prims on parcel:
+                Parcel land impact:
             </text>
             <text
              type="string"
@@ -2179,4 +2179,4 @@ Only large parcels can be listed in search.
              </panel>
         </panel>
     </tab_container>
-</floater>
\ No newline at end of file
+</floater>
-- 
cgit v1.2.3


From a250df980b3f37e245d30e51ab65831ae1de0ce0 Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Tue, 13 Sep 2011 16:03:50 -0400
Subject: SH-1601 SH-1958 FIX large objects cannot always be selected/modified

The selection distance limit was set at 64m. Now that we have 64 meter prims
this means that you can see objects that you couldn't reliably select, or
couldn't always scale up to full scale. Doubled the limit to 128,
and selecting and scaling operations appear to work fine, even for 64m objects.
---
 indra/newview/app_settings/settings.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 16bc88e237..52f6a44051 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -5490,7 +5490,7 @@
       <key>Type</key>
       <string>F32</string>
       <key>Value</key>
-      <real>64.0</real>
+      <real>128.0</real>
     </map>
     <key>MaxWearableWaitTime</key>
     <map>
-- 
cgit v1.2.3


From e78fda00846418b817f6dadb03afceda7deb172e Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Tue, 13 Sep 2011 19:14:24 -0700
Subject: sync with viewer-development

---
 .../default/xui/en/floater_voice_controls.xml      |   1 -
 .../skins/default/xui/en/menu_inventory.xml        |  21 +++-
 .../newview/skins/default/xui/en/notifications.xml |  64 ++++++++++--
 .../skins/default/xui/en/panel_bottomtray.xml      |   6 +-
 .../skins/default/xui/en/panel_inbox_inventory.xml |   2 +-
 indra/newview/skins/default/xui/en/panel_login.xml |   1 -
 .../skins/default/xui/en/panel_main_inventory.xml  |   2 +-
 .../default/xui/en/panel_outbox_inventory.xml      |   7 +-
 .../newview/skins/default/xui/en/panel_people.xml  |   2 +-
 indra/newview/skins/default/xui/en/panel_picks.xml |  23 ++---
 .../newview/skins/default/xui/en/panel_places.xml  |   2 +-
 .../newview/skins/default/xui/en/panel_profile.xml |   2 +-
 .../default/xui/en/panel_sidetray_home_tab.xml     |   1 -
 .../skins/default/xui/en/panel_status_bar.xml      |   3 -
 .../skins/default/xui/en/sidepanel_appearance.xml  |   2 +-
 .../skins/default/xui/en/sidepanel_inventory.xml   | 115 +++++++++++++++------
 indra/newview/skins/default/xui/en/strings.xml     |  33 +++++-
 .../skins/default/xui/en/widgets/accordion.xml     |   2 +-
 .../newview/skins/default/xui/en/widgets/badge.xml |   3 +-
 .../skins/default/xui/en/widgets/button.xml        |   3 +-
 .../skins/default/xui/en/widgets/color_swatch.xml  |   2 +-
 .../skins/default/xui/en/widgets/filter_editor.xml |   1 +
 .../default/xui/en/widgets/folder_view_item.xml    |   2 +
 .../xui/en/widgets/inbox_folder_view_folder.xml    |  12 ++-
 .../newview/skins/default/xui/en/widgets/menu.xml  |   3 +-
 .../default/xui/en/widgets/menu_item_separator.xml |   8 +-
 .../default/xui/en/widgets/menu_item_tear_off.xml  |   9 +-
 .../skins/default/xui/en/widgets/multi_slider.xml  |   9 +-
 .../default/xui/en/widgets/multi_slider_bar.xml    |   7 +-
 .../newview/skins/default/xui/en/widgets/panel.xml |   3 +-
 .../skins/default/xui/en/widgets/radio_group.xml   |   3 +-
 .../skins/default/xui/en/widgets/scroll_bar.xml    |   3 +-
 .../xui/en/widgets/scroll_column_header.xml        |   7 +-
 .../default/xui/en/widgets/scroll_container.xml    |   7 +-
 .../skins/default/xui/en/widgets/scroll_list.xml   |   4 +-
 .../skins/default/xui/en/widgets/search_editor.xml |   1 +
 .../skins/default/xui/en/widgets/slider_bar.xml    |   3 +-
 .../skins/default/xui/en/widgets/tab_container.xml |   4 +-
 .../skins/default/xui/en/widgets/text_editor.xml   |   1 +
 .../default/xui/en/widgets/texture_picker.xml      |   6 +-
 .../skins/default/xui/en/widgets/view_border.xml   |   7 +-
 .../skins/default/xui/en/widgets/web_browser.xml   |   4 +-
 indra/newview/skins/minimal/xui/en/main_view.xml   |   4 +-
 indra/newview/skins/minimal/xui/en/panel_login.xml |  37 +++++--
 .../skins/minimal/xui/en/panel_navigation_bar.xml  |   2 +-
 .../skins/minimal/xui/en/panel_status_bar.xml      |  37 ++++---
 46 files changed, 343 insertions(+), 138 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml
index 1432099590..f017a7ace6 100644
--- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml
@@ -89,7 +89,6 @@
         <layout_panel name="leave_call_panel" height="26" auto_resize="false">
         <layout_stack
          clip="true"
-         auto_resize="false"
          follows="left|top|right"
          height="26"
          layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml
index e91f4458ae..fb85e5278a 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory.xml
@@ -674,7 +674,26 @@
          function="Inventory.DoToSelected"
          parameter="take_off" />
     </menu_item_call>
-    <menu_item_call
+	<menu_item_separator
+	 layout="topleft"
+	 name="Marketplace Separator" />
+	<menu_item_call
+	 label="Copy to Merchant Outbox"
+	 layout="topleft"
+	 name="Merchant Copy">
+		<menu_item_call.on_click
+		 function="Inventory.DoToSelected"
+		 parameter="copy_to_outbox" />
+	</menu_item_call>
+	<menu_item_call
+	 label="Move to Merchant Outbox"
+	 layout="topleft"
+	 name="Merchant Move">
+		<menu_item_call.on_click
+		 function="Inventory.DoToSelected"
+		 parameter="move_to_outbox" />
+	</menu_item_call>
+	<menu_item_call
      label="--no options--"
      layout="topleft"
      name="--no options--" />
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 99ab56d10a..64438fe614 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -200,6 +200,40 @@ Save changes to current clothing/body part?
   </notification>
 
   <notification
+   icon="alertmodal.tga"
+     name="ConfirmNoCopyToOutbox"
+     type="alertmodal">
+        You don't have permission to copy this item to the Marketplace Outbox. Are you sure you want to move the following item?
+        [ITEM_NAME]
+        <usetemplate
+         name="okcancelbuttons"
+         notext="No"
+         yestext="Yes"/>
+    </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="OutboxUploadComplete"
+   type="alertmodal">
+Marketplace upload complete.
+        <usetemplate
+         name="okbutton"
+         yestext="Hooray!"/>
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="OutboxUploadHadErrors"
+   type="alertmodal">
+Marketplace upload completed with errors!  Please correct the problems in your outbox and retry.  Thanks.
+        <usetemplate
+         name="okbutton"
+         yestext="Boo!"/>
+  </notification>
+
+    
+
+    <notification
    icon="alertmodal.tga"
    name="CompileQueueSaveText"
    type="alertmodal">
@@ -5089,7 +5123,7 @@ Topic: [SUBJECT], Message: [MESSAGE]
    name="FriendOnline"
    type="notifytip">
     <tag>friendship</tag>
-&lt;nolink&gt;[NAME]&lt;/nolink&gt; is Online
+[NAME] is Online
   </notification>
 
   <notification
@@ -5097,7 +5131,7 @@ Topic: [SUBJECT], Message: [MESSAGE]
    name="FriendOffline"
    type="notifytip">
     <tag>friendship</tag>
-&lt;nolink&gt;[NAME]&lt;/nolink&gt; is Offline
+[NAME] is Offline
   </notification>
 
   <notification
@@ -5916,7 +5950,25 @@ An object named &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; owned by [NAME_SLU
       <button
        index="2"
        name="Mute"
-       text="Block"/>
+       text="Block Owner"/>
+    </form>
+  </notification>
+
+  <notification
+   icon="notify.tga"
+   name="OwnObjectGiveItem"
+   type="offer">
+Your object named &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; has given you this [OBJECTTYPE]:
+&lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;
+    <form name="form">
+      <button
+       index="0"
+       name="Keep"
+       text="Keep"/>
+      <button
+       index="1"
+       name="Discard"
+       text="Discard"/>
     </form>
   </notification>
 
@@ -5928,7 +5980,7 @@ An object named &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; owned by [NAME_SLU
 [ITEM_SLURL]
     <form name="form">
       <button
-       index="4"
+       index="3"
        name="Show"
        text="Show"/>
       <button
@@ -6818,7 +6870,7 @@ Select residents to share with.
 See the log file for details.
   </notification>
    
-   <notification
+  <notification
     name="MeshUploadPermError"
     icon="alert.tga"
     type="alert">
@@ -6842,7 +6894,7 @@ Are you sure you want to share the following items:
 
 With the following Residents:
 
-&lt;nolink&gt;[RESIDENTS]&lt;/nolink&gt;
+[RESIDENTS]
   <tag>confirm</tag>
 	<usetemplate
      name="okcancelbuttons"
diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml
index c8f8d07701..ec5853649e 100644
--- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml
+++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml
@@ -47,13 +47,13 @@
          mouse_opaque="false"
 		 name="chat_bar_layout_panel"
          user_resize="true"
-     width="310" >
+     width="250" >
           <panel
             name="chat_bar"
             filename="panel_nearby_chat_bar.xml"
             left="0"
             height="28"
-        width="308"
+        width="248"
             top="0"
             mouse_opaque="false"
             follows="left|right"
@@ -341,7 +341,7 @@ Disabled for now.
          height="28"
          layout="topleft"
          min_height="28"
-     min_width="52"
+     min_width="62"
          mouse_opaque="false"
          name="mini_map_btn_panel"
          user_resize="false"
diff --git a/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml
index d06190ec54..383e637ace 100644
--- a/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml
@@ -4,7 +4,7 @@
     start_folder="Received Items"
     follows="all" layout="topleft"
     top="0" left="0" height="165" width="308"
-	top_pad="0"
+    top_pad="0"
     bg_opaque_color="DkGray2"
     bg_alpha_color="DkGray2"
     background_visible="true"
diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml
index 983f93cb03..1c3e08d59b 100644
--- a/indra/newview/skins/default/xui/en/panel_login.xml
+++ b/indra/newview/skins/default/xui/en/panel_login.xml
@@ -27,7 +27,6 @@ bg_opaque_color="Black"
 border_visible="false"
 bottom="600"
 follows="all"
-hide_loading="true"
 left="0"
 name="login_html"
 start_url=""
diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
index 0df9aa2868..888230a00e 100644
--- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
@@ -6,7 +6,7 @@
  height="423"
  label="Things"
  layout="topleft"
- min_height="350"
+ min_height="300"
  min_width="240"
  name="main inventory panel"
  width="330">
diff --git a/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml b/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml
index af32056428..66117615e4 100644
--- a/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<inventory_panel
+<outbox_inventory_panel
     name="inventory_outbox"
     start_folder="Outbox"
     follows="all" layout="topleft"
     top="0" left="0" height="165" width="308"
-	top_pad="0"
+    top_pad="0"
     bg_opaque_color="DkGray2"
     bg_alpha_color="DkGray2"
     background_visible="true"
@@ -12,6 +12,7 @@
     border="false"
     bevel_style="none"
     show_item_link_overlays="true"
+    tool_tip="Drag and drop items here to prepare them for sale on your storefront"
     >
     <scroll reserve_scroll_corner="false" />
-</inventory_panel>
+</outbox_inventory_panel>
diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index cc4522f944..0ebfd9c037 100644
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -66,7 +66,7 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
      layout="topleft"
      left="10"
      label="Filter"
-     max_length="300"
+     max_length_chars="300"
      name="filter_input"
      text_color="Black"
      text_pad_left="10"
diff --git a/indra/newview/skins/default/xui/en/panel_picks.xml b/indra/newview/skins/default/xui/en/panel_picks.xml
index 978b204df9..87e263726d 100644
--- a/indra/newview/skins/default/xui/en/panel_picks.xml
+++ b/indra/newview/skins/default/xui/en/panel_picks.xml
@@ -72,20 +72,19 @@ bg_opaque_color="DkGray2"
     </accordion_tab>
  </accordion>
    <panel
-bg_opaque_color="DkGray2"
+       bg_opaque_color="DkGray2"
        background_visible="true"
        background_opaque="true"
-         bevel_style="none"
-         enabled="false"
-         auto_resize="false"
-         follows="bottom|left|right"
-         left="1"
-         height="27"
-         label="bottom_panel"
-         layout="bottom"
-         name="edit_panel"
-         top_pad="-2"
-         width="313">
+       bevel_style="none"
+       enabled="false"
+       follows="bottom|left|right"
+       left="1"
+       height="27"
+       label="bottom_panel"
+       layout="bottom"
+       name="edit_panel"
+       top_pad="-2"
+       width="313">
          
          <layout_stack
 		  follows="bottom|left|right"
diff --git a/indra/newview/skins/default/xui/en/panel_places.xml b/indra/newview/skins/default/xui/en/panel_places.xml
index b6b8a337a1..5d7334f780 100644
--- a/indra/newview/skins/default/xui/en/panel_places.xml
+++ b/indra/newview/skins/default/xui/en/panel_places.xml
@@ -25,7 +25,7 @@ background_visible="true"
      layout="topleft"
      left="10"
      label="Filter My Places"
-     max_length="300"
+     max_length_chars="300"
      name="Filter"
      top="3"
      width="303" />
diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml
index cb701e03da..f5a9daa994 100644
--- a/indra/newview/skins/default/xui/en/panel_profile.xml
+++ b/indra/newview/skins/default/xui/en/panel_profile.xml
@@ -277,7 +277,7 @@
                initial_value="(retrieving)"
                layout="topleft"
                left="0"
-               link="true"
+               parse_urls="true"
                name="partner_text"
                top="0"
                use_ellipses="true"
diff --git a/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml b/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml
index 72b2f5e84f..912f81f915 100644
--- a/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml
+++ b/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml
@@ -24,7 +24,6 @@
      layout="topleft"
      left_delta="0"
      name="browser_layout"
-     orientation="vertical" 
      top_delta="0"
      width="313">
       <web_browser
diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml
index c780cf2696..5894abd03b 100644
--- a/indra/newview/skins/default/xui/en/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml
@@ -44,7 +44,6 @@
     background_opaque="true" 
     bg_opaque_image="bevel_background">
     <text
-     auto_resize="true"
      halign="center"
      font="SansSerifSmall"
      follows="all"
@@ -58,7 +57,6 @@
      value="L$20" 
      width="40" />
     <button
-     auto_resize="true"
      halign="center"
      font="SansSerifSmall"
      follows="right|top|bottom"
@@ -84,7 +82,6 @@
     top="0"
     width="120"
     height="20"
-    pad_left="5"
     name="mode_combo"
     tool_tip="Select your mode. Choose Basic for fast, easy exploration and chat. Choose Advanced to access more features."
     >
diff --git a/indra/newview/skins/default/xui/en/sidepanel_appearance.xml b/indra/newview/skins/default/xui/en/sidepanel_appearance.xml
index b5839878d5..1d98a84e25 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_appearance.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_appearance.xml
@@ -114,7 +114,7 @@ width="333">
    layout="topleft"
    left="10"
    label="Filter Outfits"
-   max_length="300"
+   max_length_chars="300"
    name="Filter"
    search_button_visible="true"
    top_pad="10"
diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
index 79a0ec7c72..7a176ff367 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
@@ -30,11 +30,12 @@
               width="330">
              <layout_panel
                  name="main_inventory_layout_panel"
+								 layout="topleft"
                  min_dim="150"
                  width="330"
                  follows="bottom|left|right"
                  user_resize="false"
-                 height="480">
+                 height="300">
                  <panel
                       class="panel_main_inventory"
                       filename="panel_main_inventory.xml"
@@ -44,14 +45,36 @@
                       name="panel_main_inventory"
                       top="0"
                       label=""
-                      height="480"
+                      height="300"
                       width="330" />
              </layout_panel>
-             <layout_panel
+					   <layout_panel
                  width="330"
+								 layout="topleft"
                  auto_resize="true"
                  user_resize="false"
                  follows="bottom|left|right"
+                 name="inbox_outbox_layout_panel"
+                 visible="false"
+                 min_dim="35"
+                 max_dim="235"
+                 expanded_min_dim="125"
+                 height="235">
+							 <layout_stack
+										follows="left|right|top|bottom"
+										layout="topleft"
+										left="0"
+										top="0"
+										orientation="vertical"
+										name="inbox_outbox_layout_stack"
+										height="235"
+										width="330">
+								 <layout_panel
+                 width="330"
+								 layout="topleft"
+                 auto_resize="true"
+                 user_resize="false"
+                 follows="left|right|top"
                  name="inbox_layout_panel"
                  visible="false"
                  min_dim="35"
@@ -72,6 +95,7 @@
                      <string name="InboxLabelNoArg">Received Items</string>
                      <button
                         label="Received Items"
+												font="SansSerifMedium"
                         name="inbox_btn"
                         height="35"
                         width="308"
@@ -96,7 +120,6 @@
                         name="inbox_fresh_new_count"
                         font="SansSerifMedium"
                         halign="right"
-                        text_color="EmphasisColor"
                         top_pad="0"
                         width="300">
                         [NUM] New
@@ -129,41 +152,45 @@
                  </panel>
              </layout_panel>
              <layout_panel
-                width="330"
-                auto_resize="true"
-                user_resize="false"
-                follows="bottom|left|right"
-                name="outbox_layout_panel"
-                visible="false"
-                min_dim="35"
-                max_dim="200"
-                expanded_min_dim="90"
-                height="200">
+                 width="330"
+                 layout="topleft"
+                 auto_resize="true"
+                 user_resize="false"
+                 follows="all"
+                 name="outbox_layout_panel"
+                 visible="false"
+                 min_dim="35"
+                 max_dim="200"
+                 expanded_min_dim="90"
+                 height="200">
                  <panel
                       follows="all"
                       layout="topleft"
-                      left="10"
+                      left="0"
                       name="marketplace_outbox"
                       class="panel_marketplace_outbox"
                       top="0"
                       label=""
                       height="200"
-                      width="310">
+                      width="330">
+                     <string name="OutboxLabelWithArg">Merchant Outbox ([NUM])</string>
+                     <string name="OutboxLabelNoArg">Merchant Outbox</string>
                      <button
                         label="Merchant Outbox"
-                        is_toggle="true"
-                        handle_right_mouse="false"
+                        font="SansSerifMedium"
                         name="outbox_btn"
-                        follows="top|left|right"
-                        image_unselected="MarketplaceBtn_Off"
-                        image_selected="MarketplaceBtn_Selected"
                         height="35"
-                        tab_stop="false"
                         width="308"
+                        image_unselected="MarketplaceBtn_Off"
+                        image_selected="MarketplaceBtn_Selected"
                         halign="left"
+                        handle_right_mouse="false"
+                        follows="top|left|right"
+                        is_toggle="true"
+                        tab_stop="false"
                         pad_left="35"
                         top="0"
-                        left="0" />
+                        left="10" />
                      <button
                          image_unselected="OutboxPush_Off"
                          image_selected="OutboxPush_Selected"
@@ -213,24 +240,50 @@
                         bg_opaque_color="InventoryBackgroundColor"
                         background_visible="true"
                         background_opaque="true"
-                        tool_tip="Drag and drop items here to prepare them for sale on your storefront"
                         >
-                        <text
-							name="outbox_inventory_placeholder"
-							type="string"
+						<panel
+							name="outbox_inventory_placeholder_panel"
 							follows="all"
 							layout="topleft"
 							top="0"
 							left="0"
 							width="308"
 							height="165"
-							wrap="true"
-							halign="center">
-							Set up your merchant account to use this feature.
-						</text>
+							bg_opaque_color="InventoryBackgroundColor"
+							background_visible="true"
+							background_opaque="true"
+							>
+							<text
+								name="outbox_inventory_placeholder_title"
+								type="string"
+								follows="all"
+								layout="topleft"
+								top="10"
+								left="0"
+								width="308"
+								height="25"
+								wrap="true"
+								halign="center"
+								font="SansSerifBold">
+								Loading...
+							</text>
+							<text
+								name="outbox_inventory_placeholder_text"
+								type="string"
+								follows="all"
+								layout="topleft"
+								top="35"
+								left="0"
+								width="308"
+								height="130"
+								wrap="true"
+								halign="left" />
+						</panel>
                     </panel>
                  </panel>
              </layout_panel>
+						 </layout_stack>
+						 </layout_panel>
          </layout_stack>
 		<panel
 		     follows="bottom|left|right"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 2094275bed..c0154ae9b3 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -164,12 +164,16 @@ Please try logging in again in a minute.</string>
 	<string name="TooltipLand">Land:</string>
 	<string name="TooltipMustSingleDrop">Only a single item can be dragged here</string>
 	<string name="TooltipPrice" value="L$[AMOUNT]: "/>
-
+	<string name="TooltipOutboxNoTransfer">One or more of these objects cannot be sold or transferred to another user.</string>
+	<string name="TooltipOutboxWorn">You are wearing one or more of these objects. Remove them from your avatar and try moving them again.</string>
+	<string name="TooltipOutboxFolderLevels">This folder has too many levels of subfolders. Rearrange the interior folders to a maximum of 4 levels deep (Root Folder contains A contains B contains C).</string>
+	<string name="TooltipOutboxTooManyObjects">This folder contains more than 200 objects. Box some of the items to reduce the object count.</string>
+	
 	<!-- tooltips for Urls -->
 	<string name="TooltipHttpUrl">Click to view this web page</string>
 	<string name="TooltipSLURL">Click to view this location's information</string>
 	<string name="TooltipAgentUrl">Click to view this Resident's profile</string>
-  <string name="TooltipAgentInspect">Learn more about this Resident</string>
+	<string name="TooltipAgentInspect">Learn more about this Resident</string>
 	<string name="TooltipAgentMute">Click to mute this Resident</string>
 	<string name="TooltipAgentUnmute">Click to unmute this Resident</string>
 	<string name="TooltipAgentIM">Click to IM this Resident</string>
@@ -2025,8 +2029,29 @@ Returns a string with the requested data about the region
 	<string name="FavoritesNoMatchingItems">Drag a landmark here to add it to your favorites.</string>
 	<string name="InventoryNoTexture">You do not have a copy of this texture in your inventory</string>
 	<string name="InventoryInboxNoItems">Items purchased through the marketplace will be delivered here.</string>
-	<string name="InventoryOutboxNoItems">Drag items here in preparation for listing on your marketplace storefront.</string>
-    <!-- use value="" because they have preceding spaces -->
+	<string name="MarketplaceURL">http://marketplace.[DOMAIN_NAME]</string>
+	<string name="MarketplaceURL_CreateStore">http://marketplace.[DOMAIN_NAME]/create_store</string>
+	<string name="MarketplaceURL_LearnMore">http://marketplace.[DOMAIN_NAME]/learn_more</string>
+	<string name="InventoryOutboxCreationErrorTitle">Your Merchant Outbox is not properly configured</string>
+	<string name="InventoryOutboxCreationErrorTooltip">Merchant Outbox configuration error</string>
+	<string name="InventoryOutboxCreationError">Please contact Customer Service to correct the problem.</string>
+	<string name="InventoryOutboxNotMerchantTitle">Anyone can sell items on the Marketplace</string>
+	<string name="InventoryOutboxNotMerchantTooltip">Become a merchant!</string>
+	<string name="InventoryOutboxNotMerchant">[[MARKETPLACE_URL] The Second Life Marketplace] offers more than one million virtual products for sale, all of them created by Residents. You, too, can sell items you create, as well as some of the items you have purchased. It’s easy and setup is free.  [[LEARN_MORE_URL] Learn more] or [[CREATE_STORE_URL] create a store] on the Marketplace to get started.</string>
+	<string name="InventoryOutboxNoItemsTitle">A new way to send items to the Marketplace</string>
+	<string name="InventoryOutboxNoItemsTooltip">Drag and drop items here to prepare them for sale on the Marketplace</string>
+	<string name="InventoryOutboxNoItems">Drag items or folders that you wish to sell into this area.  A copy of the item will appear, leaving your inventory unchanged, unless you have dragged a no-copy item.  When you are ready to send the items to the Marketplace, click the Upload button. Once your items have been moved to your Marketplace Inventory, they will disappear from this folder.</string>
+
+	<string name="Marketplace Error None">No errors</string>
+	<string name="Marketplace Error Not Merchant">Error: Before sending items to the Marketplace you will need to set yourself up as a merchant (free of charge).</string>
+	<string name="Marketplace Error Empty Folder">Error: This folder has no contents.</string>
+	<string name="Marketplace Error Unassociated Products">Error: This item failed to upload because your merchant account has too many items unassociated with products.  To fix this error, login to the marketplace website and reduce your unassociated item count.</string>
+	<string name="Marketplace Error Object Limit">Error: This item contains too many objects.  Fix this error by placing objects together in boxes to reduce the total count to less than 200.</string>
+	<string name="Marketplace Error Folder Depth">Error: This item contains too many levels of nested folders.  Reorganize it to a maximum of 3 levels of nested folders.</string>
+	<string name="Marketplace Error Unsellable Item">Error: This item can not be sold on the marketplace.</string>
+	<string name="Marketplace Error Internal Import">Error: There was a problem with this item.  Try again later.</string>
+
+	<!-- use value="" because they have preceding spaces -->
 	<string name="no_transfer" value=" (no transfer)" />
 	<string name="no_modify"   value=" (no modify)" />
 	<string name="no_copy"     value=" (no copy)" />
diff --git a/indra/newview/skins/default/xui/en/widgets/accordion.xml b/indra/newview/skins/default/xui/en/widgets/accordion.xml
index 1a66f0f5c5..55dde492ca 100644
--- a/indra/newview/skins/default/xui/en/widgets/accordion.xml
+++ b/indra/newview/skins/default/xui/en/widgets/accordion.xml
@@ -16,7 +16,7 @@
      name="no_matched_tabs_msg"
      v_pad="15"
      width="200"
-     wrap="true "/>
+     wrap="true"/>
     <!-- This widget will not be created in viewer. Only its value will be used for empty accordion without filter. -->
     <no_visible_tabs_text
      name="no_visible_tabs_msg"
diff --git a/indra/newview/skins/default/xui/en/widgets/badge.xml b/indra/newview/skins/default/xui/en/widgets/badge.xml
index 2d4c02b092..738d150f64 100644
--- a/indra/newview/skins/default/xui/en/widgets/badge.xml
+++ b/indra/newview/skins/default/xui/en/widgets/badge.xml
@@ -1,7 +1,8 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <!-- Additional attributes:
    -->
-<badge border_image="Badge_Border"
+<badge name="badge"
+       border_image="Badge_Border"
        border_color="BadgeBorderColor"
        font="SansSerifSmall"
        image="Badge_Background"
diff --git a/indra/newview/skins/default/xui/en/widgets/button.xml b/indra/newview/skins/default/xui/en/widgets/button.xml
index 302014eb24..61d36468d7 100644
--- a/indra/newview/skins/default/xui/en/widgets/button.xml
+++ b/indra/newview/skins/default/xui/en/widgets/button.xml
@@ -26,5 +26,6 @@
         height="23"
         scale_image="true"
         handle_right_mouse="true"
-        use_draw_context_alpha="true">
+        use_draw_context_alpha="true"
+        held_down_delay.seconds="0.5">
 </button>
diff --git a/indra/newview/skins/default/xui/en/widgets/color_swatch.xml b/indra/newview/skins/default/xui/en/widgets/color_swatch.xml
index 48b987d7e8..ab3de1eaab 100644
--- a/indra/newview/skins/default/xui/en/widgets/color_swatch.xml
+++ b/indra/newview/skins/default/xui/en/widgets/color_swatch.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <color_swatch alpha_background_image="color_swatch_alpha.tga"
               border_color="ColorSwatchBorderColor"
-              name="color_swatch">
+              name="colorswatch">
   <color_swatch.caption_text name="caption"
                              halign="center"
                              follows="left|right|bottom"
diff --git a/indra/newview/skins/default/xui/en/widgets/filter_editor.xml b/indra/newview/skins/default/xui/en/widgets/filter_editor.xml
index 0720621f0b..2cc4abdd30 100644
--- a/indra/newview/skins/default/xui/en/widgets/filter_editor.xml
+++ b/indra/newview/skins/default/xui/en/widgets/filter_editor.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <filter_editor
+  name="filter_editor"
   clear_button_visible="true"
   search_button_visible="false"
   text_pad_left="7"
diff --git a/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml b/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml
index e6bdcccfdf..6fa74f403d 100644
--- a/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml
+++ b/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml
@@ -5,4 +5,6 @@
   item_height="20" 
   item_top_pad="4"
   selection_image="Rounded_Square"
+  mouse_opaque="true"
+  follows="left|top|right"
   />
diff --git a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml
index 95f5cf2ecd..77d8024cb2 100644
--- a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml
+++ b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml
@@ -10,10 +10,12 @@
         label="New" 
         label_offset_horiz="-1"
         location="right" 
-        padding_horiz="4" 
-        padding_vert="1" 
-        location_percent_hcenter="70"
-        border_image=""
-        image="Badge_Background_New"
+        padding_horiz="12.5" 
+        padding_vert="2"
+        location_offset_hcenter="-23"
+        border_image="New_Tag_Border"
+        border_color="DkGray2"
+        image="New_Tag_Background"
+        image_color="Black"
         />
 </inbox_folder_view_folder>
diff --git a/indra/newview/skins/default/xui/en/widgets/menu.xml b/indra/newview/skins/default/xui/en/widgets/menu.xml
index 58543338f6..13ac84beb2 100644
--- a/indra/newview/skins/default/xui/en/widgets/menu.xml
+++ b/indra/newview/skins/default/xui/en/widgets/menu.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<menu bg_color="MenuDefaultBgColor"
+<menu name="menu" 
+      bg_color="MenuDefaultBgColor"
       bg_visible="true"
       drop_shadow="true"
       tear_off="false"
diff --git a/indra/newview/skins/default/xui/en/widgets/menu_item_separator.xml b/indra/newview/skins/default/xui/en/widgets/menu_item_separator.xml
index e5cea476da..7452d685eb 100644
--- a/indra/newview/skins/default/xui/en/widgets/menu_item_separator.xml
+++ b/indra/newview/skins/default/xui/en/widgets/menu_item_separator.xml
@@ -1,6 +1,8 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <menu_item_separator enabled_color="MenuItemEnabledColor"
-	disabled_color="MenuItemDisabledColor"
-	highlight_bg_color="MenuItemHighlightBgColor"
-  highlight_fg_color="MenuItemHighlightFgColor">
+                     name="separator"
+                     disabled_color="MenuItemDisabledColor"
+                     highlight_bg_color="MenuItemHighlightBgColor"
+                     highlight_fg_color="MenuItemHighlightFgColor"
+                     label="-----------">
 </menu_item_separator>
diff --git a/indra/newview/skins/default/xui/en/widgets/menu_item_tear_off.xml b/indra/newview/skins/default/xui/en/widgets/menu_item_tear_off.xml
index 185ed6ee3e..72af3924c1 100644
--- a/indra/newview/skins/default/xui/en/widgets/menu_item_tear_off.xml
+++ b/indra/newview/skins/default/xui/en/widgets/menu_item_tear_off.xml
@@ -1,7 +1,8 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <!-- Use "disabled color" to make it look like menu separators -->
 <menu_item_tear_off enabled_color="MenuItemDisabledColor"
-	disabled_color="MenuItemDisabledColor"
-	highlight_bg_color="MenuItemHighlightBgColor"
-  highlight_fg_color="MenuItemHighlightFgColor">
-</menu_item_tear_off>
+                    name="tear_off"
+              			label = "~~~~~~~~~~~"
+                    disabled_color="MenuItemDisabledColor"
+                    highlight_bg_color="MenuItemHighlightBgColor"
+                    highlight_fg_color="MenuItemHighlightFgColor"/>
diff --git a/indra/newview/skins/default/xui/en/widgets/multi_slider.xml b/indra/newview/skins/default/xui/en/widgets/multi_slider.xml
index e0900b48f3..90b0625982 100644
--- a/indra/newview/skins/default/xui/en/widgets/multi_slider.xml
+++ b/indra/newview/skins/default/xui/en/widgets/multi_slider.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <multi_slider text_color="LabelTextColor"
-                  text_disabled_color="LabelDisabledColor"
-                  draw_track="true"
-                  use_triangle="false"
-                  font="SansSerifSmall"/>
+              mouse_opaque="true"
+              text_disabled_color="LabelDisabledColor"
+              draw_track="true"
+              use_triangle="false"
+              font="SansSerifSmall"/>
diff --git a/indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml b/indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml
index 04a2cd635c..bbcb008df4 100644
--- a/indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml
+++ b/indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<multi_slider_bar track_color="MultiSliderTrackColor"
+<multi_slider_bar name="multi_slider_bar"
+                  track_color="MultiSliderTrackColor"
                   thumb_disabled_color="MultiSliderDisabledThumbColor"
                   thumb_outline_color="MultiSliderThumbOutlineColor"
                   thumb_center_color="MultiSliderThumbCenterColor"
@@ -7,4 +8,6 @@
                   triangle_color="MultiSliderTriangleColor"
                   draw_track="true"
                   use_triangle="false"
-                  thumb_width="8"/>
+                  thumb_width="8"
+                  mouse_opaque="true"
+                  follows="left|top"/>
diff --git a/indra/newview/skins/default/xui/en/widgets/panel.xml b/indra/newview/skins/default/xui/en/widgets/panel.xml
index 47a210d9b7..b36f723831 100644
--- a/indra/newview/skins/default/xui/en/widgets/panel.xml
+++ b/indra/newview/skins/default/xui/en/widgets/panel.xml
@@ -4,7 +4,8 @@
   bg_opaque_image - image name for "in-front" panel look
   bg_alpha_image - image name for "in-back" or transparent panel look
 -->
-<panel bg_opaque_color="PanelFocusBackgroundColor"
+<panel name="panel"
+       bg_opaque_color="PanelFocusBackgroundColor"
        bg_alpha_color="PanelDefaultBackgroundColor"
        bg_opaque_image_overlay="White"
        bg_alpha_image_overlay="White"
diff --git a/indra/newview/skins/default/xui/en/widgets/radio_group.xml b/indra/newview/skins/default/xui/en/widgets/radio_group.xml
index ad7ef5bffc..ab3184d34b 100644
--- a/indra/newview/skins/default/xui/en/widgets/radio_group.xml
+++ b/indra/newview/skins/default/xui/en/widgets/radio_group.xml
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<radio_group draw_border="false"
-             name="radio_group"
+<radio_group name="radio_group"
              mouse_opaque="false"
              follows="left|top"
              font="SansSerifSmall"/>
diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml b/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml
index e6d4bff8b5..682dcf40d8 100644
--- a/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml
+++ b/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml
@@ -5,7 +5,8 @@
 			track_image_horizontal ="ScrollTrack_Horiz"
 			track_color="ScrollbarTrackColor"
             thumb_color="ScrollbarThumbColor"
-            thickness="15">
+            thickness="15"
+            tab_stop="false">
   <up_button name="up_button"
              image_unselected="ScrollArrow_Up"
              image_selected="ScrollArrow_Up"
diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_column_header.xml b/indra/newview/skins/default/xui/en/widgets/scroll_column_header.xml
index f936a1e208..8a48fcb32d 100644
--- a/indra/newview/skins/default/xui/en/widgets/scroll_column_header.xml
+++ b/indra/newview/skins/default/xui/en/widgets/scroll_column_header.xml
@@ -1,11 +1,12 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<scroll_column_header
-		    image_unselected="SegmentedBtn_Middle_Selected"
+<scroll_column_header name="column_header"
+                      image_unselected="SegmentedBtn_Middle_Selected"
                       image_selected="SegmentedBtn_Middle_Selected"
-		      image_pressed="SegmentedBtn_Middle_Selected_Press"
+                      image_pressed="SegmentedBtn_Middle_Selected_Press"
                       image_disabled="SegmentedBtn_Middle_Disabled"
                       image_disabled_selected="SegmentedBtn_Middle_Selected_Disabled"
                       image_overlay="DisclosureArrow_Opened_Off"
                       image_overlay_alignment="right"
                       halign="left"
+                      tab_stop="false"
                       scale_image="true" />
diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_container.xml b/indra/newview/skins/default/xui/en/widgets/scroll_container.xml
index 86356ff563..a6d096a964 100644
--- a/indra/newview/skins/default/xui/en/widgets/scroll_container.xml
+++ b/indra/newview/skins/default/xui/en/widgets/scroll_container.xml
@@ -1,5 +1,8 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<scroll_container color="black"
+<scroll_container name="scroll_container"
+                  color="black"
                   opaque="false"
                   min_auto_scroll_rate="120"
-                  max_auto_scroll_rate="500"/>
+                  max_auto_scroll_rate="500"
+                  tab_stop="false"
+                  mouse_opaque="true" />
diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_list.xml b/indra/newview/skins/default/xui/en/widgets/scroll_list.xml
index dd93675807..e43989c6c7 100644
--- a/indra/newview/skins/default/xui/en/widgets/scroll_list.xml
+++ b/indra/newview/skins/default/xui/en/widgets/scroll_list.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<scroll_list fg_unselected_color="ScrollUnselectedColor"
+<scroll_list name="scroll_list" 
+             fg_unselected_color="ScrollUnselectedColor"
              fg_selected_color="ScrollSelectedFGColor"
              bg_selected_color="ScrollSelectedBGColor"
              fg_disable_color="ScrollDisabledColor"
@@ -13,6 +14,7 @@
              scroll_bar_bg_visible="false"
              scroll_bar_bg_color="black"
              mouse_wheel_opaque="false"
+             mouse_opaque="true"
              background_visible="true"
              heading_height="23"
              draw_border="false"
diff --git a/indra/newview/skins/default/xui/en/widgets/search_editor.xml b/indra/newview/skins/default/xui/en/widgets/search_editor.xml
index 32e443a058..faa0404b35 100644
--- a/indra/newview/skins/default/xui/en/widgets/search_editor.xml
+++ b/indra/newview/skins/default/xui/en/widgets/search_editor.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <search_editor
+  name="search_editor"
   clear_button_visible="false"
   search_button_visible="true"
   text_pad_left="6" 
diff --git a/indra/newview/skins/default/xui/en/widgets/slider_bar.xml b/indra/newview/skins/default/xui/en/widgets/slider_bar.xml
index ea63cac790..0335213ed6 100644
--- a/indra/newview/skins/default/xui/en/widgets/slider_bar.xml
+++ b/indra/newview/skins/default/xui/en/widgets/slider_bar.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <!--All horizontal sliders are configured to have no highlighted track. See EXT-5939. -->
-<slider_bar track_color="SliderTrackColor"
+<slider_bar follows="left|top"
+            track_color="SliderTrackColor"
             thumb_outline_color="SliderThumbOutlineColor"
             thumb_center_color="SliderThumbCenterColor"
             thumb_image="SliderThumb_Off"
diff --git a/indra/newview/skins/default/xui/en/widgets/tab_container.xml b/indra/newview/skins/default/xui/en/widgets/tab_container.xml
index c37ead0be2..3e2202b20f 100644
--- a/indra/newview/skins/default/xui/en/widgets/tab_container.xml
+++ b/indra/newview/skins/default/xui/en/widgets/tab_container.xml
@@ -3,7 +3,9 @@
 label_pad_bottom - vertical padding under tab button labels
 label_pad_left - padding to the left of tab button labels
 -->
-<tab_container tab_min_width="60"
+<tab_container name="tab_container" 
+               mouse_opaque="false"
+               tab_min_width="60"
                tab_max_width="150"
                use_custom_icon_ctrl="false"
                halign="center"
diff --git a/indra/newview/skins/default/xui/en/widgets/text_editor.xml b/indra/newview/skins/default/xui/en/widgets/text_editor.xml
index 0f7f50b312..100571cc01 100644
--- a/indra/newview/skins/default/xui/en/widgets/text_editor.xml
+++ b/indra/newview/skins/default/xui/en/widgets/text_editor.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <!-- Core parameters are in simple_text_editor.xml -->
 <text_editor
+  name="text_editor"
   parse_urls="false"
   show_context_menu="true"/>
diff --git a/indra/newview/skins/default/xui/en/widgets/texture_picker.xml b/indra/newview/skins/default/xui/en/widgets/texture_picker.xml
index 757f0f49d1..ba2fdf4f1f 100644
--- a/indra/newview/skins/default/xui/en/widgets/texture_picker.xml
+++ b/indra/newview/skins/default/xui/en/widgets/texture_picker.xml
@@ -1,5 +1,9 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<texture_picker border_color="DefaultHighlightLight">
+<texture_picker border_color="DefaultHighlightLight"
+                name="texture picker"
+                mouse_opaque="true"
+                follows="left|top"
+                >
   <multiselect_text font="SansSerifSmall"/>
   <caption_text text="Multiple" 
                 halign="center" 
diff --git a/indra/newview/skins/default/xui/en/widgets/view_border.xml b/indra/newview/skins/default/xui/en/widgets/view_border.xml
index 0b0a9beb95..bf40e3086b 100644
--- a/indra/newview/skins/default/xui/en/widgets/view_border.xml
+++ b/indra/newview/skins/default/xui/en/widgets/view_border.xml
@@ -1,8 +1,11 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<view_border highlight_light_color="DefaultHighlightLight"
+<view_border name="view_border" 
+             highlight_light_color="DefaultHighlightLight"
              highlight_dark_color="DefaultHighlightDark"
              shadow_light_color="DefaultShadowLight"
              shadow_dark_color="DefaultShadowDark"
              border_thickness="1"
              border_style="line"
-             bevel_style="out"/>
\ No newline at end of file
+             bevel_style="out"
+             mouse_opaque="false"
+             follows="all"/>
\ No newline at end of file
diff --git a/indra/newview/skins/default/xui/en/widgets/web_browser.xml b/indra/newview/skins/default/xui/en/widgets/web_browser.xml
index 118d63bbf0..676fafd828 100644
--- a/indra/newview/skins/default/xui/en/widgets/web_browser.xml
+++ b/indra/newview/skins/default/xui/en/widgets/web_browser.xml
@@ -1,2 +1,4 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<web_browser border_visible="true"/>
+<web_browser border_visible="true"
+             tab_stop="false"
+             />
diff --git a/indra/newview/skins/minimal/xui/en/main_view.xml b/indra/newview/skins/minimal/xui/en/main_view.xml
index ec2683880a..0ce6cbc984 100644
--- a/indra/newview/skins/minimal/xui/en/main_view.xml
+++ b/indra/newview/skins/minimal/xui/en/main_view.xml
@@ -187,9 +187,9 @@
        name="status_bar_container"
        tab_stop="false"
        height="30"
-       left="-120"
+       left="-160"
        top="0"
-       width="120"
+       width="160"
        visible="false"/>
   <panel follows="top|bottom"
          height="500"
diff --git a/indra/newview/skins/minimal/xui/en/panel_login.xml b/indra/newview/skins/minimal/xui/en/panel_login.xml
index d89a0c6be1..40d2df78e1 100644
--- a/indra/newview/skins/minimal/xui/en/panel_login.xml
+++ b/indra/newview/skins/minimal/xui/en/panel_login.xml
@@ -118,16 +118,33 @@ label="Remember password"
   name="connect_btn"
   top="35"
   width="90" />
-  <menu_button
-left_pad="10"
-top="35"
-width="80"
-height="23"
-label="Mode ▲"
-name="mode_menu"
-tool_tip="Select your mode. Choose Basic for fast, easy exploration and chat. Choose Advanced to access more features."
-menu_filename="menu_mode_change.xml"
-    />
+  <text
+  follows="left|bottom"
+  font="SansSerifSmall"
+  height="15"
+  left_pad="10"
+  name="mode_selection_text"
+  top="20"
+  width="130">
+    Mode:
+  </text>
+  <combo_box
+  follows="left|bottom"
+  height="23"
+  max_chars="128"
+  tool_tip="Select your mode. Choose Basic for fast, easy exploration and chat. Choose Advanced to access more features."
+  top_pad="0"
+  name="mode_combo"
+  width="110">
+    <combo_box.item
+      label="Basic"
+      name="Basic"
+      value="settings_minimal.xml" />
+    <combo_box.item
+      label="Advanced"
+      name="Advanced"
+      value="" />
+  </combo_box>
 </layout_panel>
 <layout_panel
 tab_stop="false"
diff --git a/indra/newview/skins/minimal/xui/en/panel_navigation_bar.xml b/indra/newview/skins/minimal/xui/en/panel_navigation_bar.xml
index e50911b8d2..73a8564274 100644
--- a/indra/newview/skins/minimal/xui/en/panel_navigation_bar.xml
+++ b/indra/newview/skins/minimal/xui/en/panel_navigation_bar.xml
@@ -63,7 +63,7 @@ width="31" />
      mouse_opaque="false"
      name="location_combo"
      top_delta="0"
-     width="390">
+     width="325">
     </location_input>
     <icon follows="right"
           height="20"
diff --git a/indra/newview/skins/minimal/xui/en/panel_status_bar.xml b/indra/newview/skins/minimal/xui/en/panel_status_bar.xml
index 42e6f30d48..fdd6b5d6ec 100644
--- a/indra/newview/skins/minimal/xui/en/panel_status_bar.xml
+++ b/indra/newview/skins/minimal/xui/en/panel_status_bar.xml
@@ -12,7 +12,7 @@
  name="status"
  top="19"
  tab_stop="false"
- width="120">
+ width="185">
     <panel.string
      name="packet_loss_tooltip">
         Packet Loss
@@ -33,18 +33,27 @@
      name="buycurrencylabel">
         L$ [AMT]
     </panel.string>
-  <menu_button
-     follows="right|top"    
-    image_color="0 0 0 0"
-    hover_glow_amount="0"
-    left="5"
-    top="7"
-    width="55"  
-    height="18"
-    label="Mode ▼"
-    tool_tip="Select your mode. Choose Basic for fast, easy exploration and chat. Choose Advanced to access more features."
-    menu_filename="menu_mode_change.xml"
-    />
+  <combo_box
+   follows="right|top"
+   left_pad="5"
+   drop_down_button.pad_left="10"
+   left="0"
+   top="5"
+   pad_left="5"
+   width="120"
+   height="23"
+   name="mode_combo"
+   tool_tip="Select your mode. Choose Basic for fast, easy exploration and chat. Choose Advanced to access more features."
+    >
+    <combo_box.item
+      label="Basic Mode"
+      name="Basic"
+      value="settings_minimal.xml" />
+    <combo_box.item
+      label="Advanced Mode"
+      name="Advanced"
+      value="" />
+  </combo_box>
      <button
      follows="right|top"
      height="16"
@@ -53,7 +62,7 @@
      image_pressed="Pause_Press"
      image_pressed_selected="Play_Press"
      is_toggle="true"
-     left="65"
+     left_pad="5"
      top="7"
      name="media_toggle_btn"
      tool_tip="Start/Stop All Media (Music, Video, Web pages)"
-- 
cgit v1.2.3


From 349112a6623b008c805f1d2b36406911a9e4ba06 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Tue, 13 Sep 2011 19:14:36 -0700
Subject: sync with viewer-development

---
 indra/newview/skins/default/xui/en/widgets/layout_stack.xml         | 4 ++++
 indra/newview/skins/default/xui/en/widgets/scrolling_panel_list.xml | 2 ++
 2 files changed, 6 insertions(+)
 create mode 100644 indra/newview/skins/default/xui/en/widgets/layout_stack.xml
 create mode 100644 indra/newview/skins/default/xui/en/widgets/scrolling_panel_list.xml

diff --git a/indra/newview/skins/default/xui/en/widgets/layout_stack.xml b/indra/newview/skins/default/xui/en/widgets/layout_stack.xml
new file mode 100644
index 0000000000..48bcb46533
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/widgets/layout_stack.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<!-- Global settings for all widgets ("UI Controls") -->
+<!-- The params in this file aren't currently getting loaded in OSX -->
+<layout_stack name="stack"/> 
diff --git a/indra/newview/skins/default/xui/en/widgets/scrolling_panel_list.xml b/indra/newview/skins/default/xui/en/widgets/scrolling_panel_list.xml
new file mode 100644
index 0000000000..40cbf5977a
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/widgets/scrolling_panel_list.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<scrolling_panel_list name="scrolling_panel_list"/>
\ No newline at end of file
-- 
cgit v1.2.3


From 1d510b73ffa94cb4d7beb456b4e3cc0fd4c9fc3a Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Tue, 13 Sep 2011 19:16:02 -0700
Subject: sync with viewer-development

---
 .../newview/skins/default/xui/en/widgets/menu_bar.xml |  7 +++++++
 .../skins/default/xui/en/widgets/name_list.xml        |  3 +++
 .../xui/en/widgets/outbox_folder_view_folder.xml      | 19 +++++++++++++++++++
 .../default/xui/en/widgets/outbox_inventory_panel.xml |  2 ++
 4 files changed, 31 insertions(+)
 create mode 100644 indra/newview/skins/default/xui/en/widgets/menu_bar.xml
 create mode 100644 indra/newview/skins/default/xui/en/widgets/name_list.xml
 create mode 100644 indra/newview/skins/default/xui/en/widgets/outbox_folder_view_folder.xml
 create mode 100644 indra/newview/skins/default/xui/en/widgets/outbox_inventory_panel.xml

diff --git a/indra/newview/skins/default/xui/en/widgets/menu_bar.xml b/indra/newview/skins/default/xui/en/widgets/menu_bar.xml
new file mode 100644
index 0000000000..27efa72563
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/widgets/menu_bar.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<menu_bar
+			tear_off = "false"
+			keep_fixed_size = "true"
+			horizontal_layout = "true"
+			visible = "true"
+			drop_shadow = "false"/>
diff --git a/indra/newview/skins/default/xui/en/widgets/name_list.xml b/indra/newview/skins/default/xui/en/widgets/name_list.xml
new file mode 100644
index 0000000000..3ae0f68227
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/widgets/name_list.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<name_list name="name_list"
+           />
diff --git a/indra/newview/skins/default/xui/en/widgets/outbox_folder_view_folder.xml b/indra/newview/skins/default/xui/en/widgets/outbox_folder_view_folder.xml
new file mode 100644
index 0000000000..0792996107
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/widgets/outbox_folder_view_folder.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<outbox_folder_view_folder
+  folder_arrow_image="Folder_Arrow"
+  folder_indentation="8"
+  item_height="20" 
+  item_top_pad="4"
+  selection_image="Rounded_Square"
+  >
+  <error_badge 
+    label=" " 
+    label_offset_horiz="-1"
+    location="right" 
+    padding_horiz="12.5" 
+    padding_vert="2"
+    location_offset_hcenter="-23"
+    image="Error_Tag_Background"
+    image_color="Black"
+    />
+</outbox_folder_view_folder>
diff --git a/indra/newview/skins/default/xui/en/widgets/outbox_inventory_panel.xml b/indra/newview/skins/default/xui/en/widgets/outbox_inventory_panel.xml
new file mode 100644
index 0000000000..e3f2072819
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/widgets/outbox_inventory_panel.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<outbox_inventory_panel show_load_status="false" />
-- 
cgit v1.2.3


From a3e092db14cd0ca785ae46b99f6e275eedc0ddc1 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 14 Sep 2011 08:54:07 -0400
Subject: STORM-1578 (viewer side only), STORM-1589 Remove the viewer side
 automatic logout after extended away time. Note, however, that the server
 still logs you out after 30 minutes away: see SVC 7251. Allow more time (10
 seconds vs 2 seconds) after initiating Away status during which mouse
 movements do not remove the Away status.

---
 indra/newview/app_settings/settings.xml | 13 +------------
 indra/newview/llagent.cpp               |  6 +++++-
 indra/newview/llagent.h                 |  3 ++-
 indra/newview/llappviewer.cpp           | 18 ++++--------------
 indra/newview/llviewerjoystick.cpp      | 11 ++++-------
 indra/newview/llviewerwindow.cpp        |  7 +++----
 6 files changed, 19 insertions(+), 39 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 60025707a4..f4535f12f8 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -25,7 +25,7 @@
       <key>Type</key>
       <string>S32</string>
       <key>Value</key>
-      <real>0</real>
+      <real>300</real>
     </map>
     <key>AdminMenu</key>
     <map>
@@ -7116,17 +7116,6 @@
       <key>Value</key>
       <real>0.0</real>
     </map>
-    <key>QuitAfterSecondsOfAFK</key>
-    <map>
-      <key>Comment</key>
-      <string>The duration allowed after being AFK before quitting.</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>F32</string>
-      <key>Value</key>
-      <real>0.0</real>
-    </map>
     <key>QuitOnLoginActivated</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 642a1907f0..296ae8f10b 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -107,7 +107,6 @@ const F64 CHAT_AGE_FAST_RATE = 3.0;
 const F32 MIN_FIDGET_TIME = 8.f; // seconds
 const F32 MAX_FIDGET_TIME = 20.f; // seconds
 
-
 // The agent instance.
 LLAgent gAgent;
 
@@ -115,6 +114,9 @@ LLAgent gAgent;
 // Statics
 //
 
+/// minimum time after setting away state before coming back based on movement
+const F32 LLAgent::MIN_AFK_TIME = 10.0f;
+
 const F32 LLAgent::TYPING_TIMEOUT_SECS = 5.f;
 
 std::map<std::string, std::string> LLAgent::sTeleportErrorMessages;
@@ -1165,6 +1167,7 @@ void LLAgent::setAFK()
 	{
 		sendAnimationRequest(ANIM_AGENT_AWAY, ANIM_REQUEST_START);
 		setControlFlags(AGENT_CONTROL_AWAY | AGENT_CONTROL_STOP);
+		LL_INFOS("AFK") << "Setting Away" << LL_ENDL;
 		gAwayTimer.start();
 		if (gAFKMenu)
 		{
@@ -1188,6 +1191,7 @@ void LLAgent::clearAFK()
 	{
 		sendAnimationRequest(ANIM_AGENT_AWAY, ANIM_REQUEST_STOP);
 		clearControlFlags(AGENT_CONTROL_AWAY);
+		LL_INFOS("AFK") << "Clearing Away" << LL_ENDL;
 		if (gAFKMenu)
 		{
 			gAFKMenu->setLabel(LLTrans::getString("AvatarSetAway"));
diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h
index 67ed1923c0..5e23ced424 100644
--- a/indra/newview/llagent.h
+++ b/indra/newview/llagent.h
@@ -318,7 +318,8 @@ public:
 	void			setAFK();
 	void			clearAFK();
 	BOOL			getAFK() const;
-
+	static const F32 MIN_AFK_TIME;
+	
 	//--------------------------------------------------------------------
 	// Run
 	//--------------------------------------------------------------------
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 4e1ef59765..2e1108d42c 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -247,7 +247,6 @@ extern BOOL gDebugGL;
 
 ////////////////////////////////////////////////////////////
 // All from the last globals push...
-const F32 DEFAULT_AFK_TIMEOUT = 5.f * 60.f; // time with no input before user flagged as Away From Keyboard
 
 F32 gSimLastTime; // Used in LLAppViewer::init and send_stats()
 F32 gSimFrames;
@@ -430,8 +429,11 @@ static bool app_metrics_qa_mode = false;
 void idle_afk_check()
 {
 	// check idle timers
-	if (gSavedSettings.getS32("AFKTimeout") && (gAwayTriggerTimer.getElapsedTimeF32() > gSavedSettings.getS32("AFKTimeout")))
+	F32 current_idle = gAwayTriggerTimer.getElapsedTimeF32();
+	F32 afk_timeout  = gSavedSettings.getS32("AFKTimeout");
+	if (afk_timeout && (current_idle > afk_timeout) && ! gAgent.getAFK())
 	{
+		LL_INFOS("IdleAway") << "Idle more than " << afk_timeout << " seconds: automatically changing to Away status" << LL_ENDL;
 		gAgent.setAFK();
 	}
 }
@@ -4186,18 +4188,6 @@ void LLAppViewer::idle()
 		}
 	}
 
-	// debug setting to quit after N seconds of being AFK - 0 to never do this
-	F32 qas_afk = gSavedSettings.getF32("QuitAfterSecondsOfAFK");
-	if (qas_afk > 0.f)
-	{
-		// idle time is more than setting
-		if ( gAwayTriggerTimer.getElapsedTimeF32() > qas_afk )
-		{
-			// go ahead and just quit gracefully
-			LLAppViewer::instance()->requestQuit();
-		}
-	}
-
 	// Must wait until both have avatar object and mute list, so poll
 	// here.
 	request_initial_instant_messages();
diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp
index fbf11f20db..f6e840adcd 100644
--- a/indra/newview/llviewerjoystick.cpp
+++ b/indra/newview/llviewerjoystick.cpp
@@ -51,9 +51,6 @@
 #define RY_I	5
 #define RZ_I	3
 
-// minimum time after setting away state before coming back
-const F32 MIN_AFK_TIME = 2.f;
-
 F32  LLViewerJoystick::sLastDelta[] = {0,0,0,0,0,0,0};
 F32  LLViewerJoystick::sDelta[] = {0,0,0,0,0,0,0};
 
@@ -551,7 +548,7 @@ void LLViewerJoystick::moveObjects(bool reset)
 	if (!is_zero)
 	{
 		// Clear AFK state if moved beyond the deadzone
-		if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME)
+		if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
 		{
 			gAgent.clearAFK();
 		}
@@ -725,7 +722,7 @@ void LLViewerJoystick::moveAvatar(bool reset)
 	if (!is_zero)
 	{
 		// Clear AFK state if moved beyond the deadzone
-		if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME)
+		if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
 		{
 			gAgent.clearAFK();
 		}
@@ -941,7 +938,7 @@ void LLViewerJoystick::moveFlycam(bool reset)
 	}
 	
 	// Clear AFK state if moved beyond the deadzone
-	if (!is_zero && gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME)
+	if (!is_zero && gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
 	{
 		gAgent.clearAFK();
 	}
@@ -1001,7 +998,7 @@ bool LLViewerJoystick::toggleFlycam()
 		gAgentCamera.changeCameraToDefault();
 	}
 
-	if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME)
+	if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
 	{
 		gAgent.clearAFK();
 	}
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 5893259d96..a7f4209e69 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -240,8 +240,6 @@ BOOL				gDisplayBadge = FALSE;
 static const U8 NO_FACE = 255;
 BOOL gQuietSnapshot = FALSE;
 
-const F32 MIN_AFK_TIME = 2.f; // minimum time after setting away state before coming back
-
 static const F32 MIN_DISPLAY_SCALE = 0.75f;
 
 std::string	LLViewerWindow::sSnapshotBaseName;
@@ -1214,7 +1212,7 @@ void LLViewerWindow::handleMouseMove(LLWindow *window,  LLCoordGL pos, MASK mask
 
 	mWindow->showCursorFromMouseMove();
 
-	if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME)
+	if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
 	{
 		gAgent.clearAFK();
 	}
@@ -1302,7 +1300,7 @@ BOOL LLViewerWindow::handleTranslatedKeyDown(KEY key,  MASK mask, BOOL repeated)
 	// Let the voice chat code check for its PTT key.  Note that this never affects event processing.
 	LLVoiceClient::getInstance()->keyDown(key, mask);
 	
-	if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME)
+	if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
 	{
 		gAgent.clearAFK();
 	}
@@ -1352,6 +1350,7 @@ BOOL LLViewerWindow::handleActivate(LLWindow *window, BOOL activated)
 	{
 		mActive = FALSE;
 				
+		// if the user has chosen to go Away automatically after some time, then go Away when minimizing
 		if (gSavedSettings.getS32("AFKTimeout"))
 		{
 			gAgent.setAFK();
-- 
cgit v1.2.3


From 4efca483d7dc8c8a50ebe247c6c163c263ed20f5 Mon Sep 17 00:00:00 2001
From: prep <prep@lindenlab.com>
Date: Wed, 14 Sep 2011 10:41:26 -0400
Subject: Fix for CTS-804. Added support for parsing translations from
 Blenders(v2.5.9) transform SID's.

---
 indra/newview/llfloatermodelpreview.cpp | 47 ++++++++++++++++++++++++++++++---
 indra/newview/llfloatermodelpreview.h   |  3 ++-
 2 files changed, 45 insertions(+), 5 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 55c4907a74..7ef1ff17ea 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -1754,9 +1754,15 @@ bool LLModelLoader::doLoadModel()
 												missingSkeletonOrScene = true;
 											}
 											else
+											if ( pTranslateElement )
 											{
 												extractTranslationViaElement( pTranslateElement, workingTransform );
 											}
+											else
+											{
+												extractTranslationViaSID( pJoint, workingTransform );
+											}
+
 										}
 										
 										//Store the joint transform w/respect to it's name.
@@ -2612,10 +2618,43 @@ void LLModelLoader::extractTranslation( domTranslate* pTranslate, LLMatrix4& tra
 //-----------------------------------------------------------------------------
 void LLModelLoader::extractTranslationViaElement( daeElement* pTranslateElement, LLMatrix4& transform )
 {
-	domTranslate* pTranslateChild = dynamic_cast<domTranslate*>( pTranslateElement );
-	domFloat3 translateChild = pTranslateChild->getValue();
-	LLVector3 singleJointTranslation( translateChild[0], translateChild[1], translateChild[2] );
-	transform.setTranslation( singleJointTranslation );
+	if ( pTranslateElement )
+	{
+		domTranslate* pTranslateChild = dynamic_cast<domTranslate*>( pTranslateElement );
+		domFloat3 translateChild = pTranslateChild->getValue();
+		LLVector3 singleJointTranslation( translateChild[0], translateChild[1], translateChild[2] );
+		transform.setTranslation( singleJointTranslation );
+	}	
+}
+//-----------------------------------------------------------------------------
+// extractTranslationViaSID()
+//-----------------------------------------------------------------------------
+void LLModelLoader::extractTranslationViaSID( daeElement* pElement, LLMatrix4& transform )
+{
+	if ( pElement )
+	{	
+		daeSIDResolver resolver( pElement, "./transform" );
+		domMatrix* pMatrix = daeSafeCast<domMatrix>( resolver.getElement() );
+		//We are only extracting out the translational component atm
+		LLMatrix4 workingTransform;
+		if ( pMatrix )
+		{
+			domFloat4x4 domArray = pMatrix->getValue();									
+			for ( int i = 0; i < 4; i++ )
+			{
+				for( int j = 0; j < 4; j++ )
+				{
+					workingTransform.mMatrix[i][j] = domArray[i + j*4];
+				}
+			}
+			LLVector3 trans = workingTransform.getTranslation();
+			transform.setTranslation( trans );	
+		}
+	}
+	else
+	{
+		llwarns<<"Element is nonexistent - empty/unsupported node."<<llendl;
+	}
 }
 //-----------------------------------------------------------------------------
 // processJointNode()
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index fc4c0607f9..47de99ce25 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -120,7 +120,8 @@ public:
 	void processJointNode( domNode* pNode, std::map<std::string,LLMatrix4>& jointTransforms );
 	void extractTranslation( domTranslate* pTranslate, LLMatrix4& transform );
 	void extractTranslationViaElement( daeElement* pTranslateElement, LLMatrix4& transform );
-	
+	void extractTranslationViaSID( daeElement* pElement, LLMatrix4& transform );
+
 	void setLoadState(U32 state);
 
 	void buildJointToNodeMappingFromScene( daeElement* pRoot );
-- 
cgit v1.2.3


From 758b936deaa0e6ea397c49afa5024315415eeb93 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Wed, 14 Sep 2011 13:24:31 -0400
Subject: Trying to fix Mac build issue

---
 indra/llmessage/llcurl.h | 1 +
 1 file changed, 1 insertion(+)
 mode change 100644 => 100755 indra/llmessage/llcurl.h

diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h
old mode 100644
new mode 100755
index a876a1562e..87de202717
--- a/indra/llmessage/llcurl.h
+++ b/indra/llmessage/llcurl.h
@@ -232,6 +232,7 @@ public:
 
 private:
 	friend class LLCurl;
+	friend class LLCurl::Multi;
 
 	CURL*				mCurlEasyHandle;
 	struct curl_slist*	mHeaders;
-- 
cgit v1.2.3


From 671a76b40c0669cb8d4b08a6617ec33c47324a49 Mon Sep 17 00:00:00 2001
From: "Debi King (Dessie)" <dessie@lindenlab.com>
Date: Thu, 15 Sep 2011 14:30:19 -0400
Subject: Added tag DRTVWR-89_3.0.3-beta2, 3.0.3-beta2 for changeset
 61aa7974df08

---
 .hgtags | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.hgtags b/.hgtags
index a5c2186e02..07b6046c3c 100644
--- a/.hgtags
+++ b/.hgtags
@@ -186,3 +186,5 @@ e5c9af2d7980a99a71650be3a0cf7b2b3c3b897e 3.0.2-beta2
 b95ddac176ac944efdc85cbee94ac2e1eab44c79 3.0.3-start
 6694f3f062aa45f64ab391d25a3eb3d5eb1b0871 DRTVWR-85_3.0.3-beta1
 6694f3f062aa45f64ab391d25a3eb3d5eb1b0871 3.0.3-beta1
+61aa7974df089e8621fe9a4c69bcdefdb3cc208a DRTVWR-89_3.0.3-beta2
+61aa7974df089e8621fe9a4c69bcdefdb3cc208a 3.0.3-beta2
-- 
cgit v1.2.3


From 6e5ff42f9e469489007f28c089e11d1cc7635021 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Thu, 15 Sep 2011 14:22:50 -0700
Subject: VWR-26937 FIX FR linguistic

---
 indra/newview/skins/default/xui/fr/floater_model_preview.xml | 6 +++---
 indra/newview/skins/default/xui/fr/strings.xml               | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/indra/newview/skins/default/xui/fr/floater_model_preview.xml b/indra/newview/skins/default/xui/fr/floater_model_preview.xml
index 2639339be5..2b8e441ef0 100644
--- a/indra/newview/skins/default/xui/fr/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/fr/floater_model_preview.xml
@@ -131,7 +131,7 @@ Serveur :
 			<button label="Parcourir..." name="lod_browse"/>
 			<combo_box name="lod_mode">
 				<combo_item name="triangle_limit">
-					Limite du triangle
+					Triangles max.
 				</combo_item>
 				<combo_item name="error_threshold">
 					Seuil d&apos;erreur
@@ -141,7 +141,7 @@ Serveur :
 				Opér. construction :
 			</text>
 			<text name="queue_mode_text">
-				Mode fil d&apos;attente :
+				Mode file d&apos;attente :
 			</text>
 			<combo_box name="build_operator">
 				<combo_item name="edge_collapse">
@@ -244,7 +244,7 @@ Serveur :
 		Frais de chargement : [FEE] L$
 	</text>
 	<button label="Réinitialiser" name="reset_btn" tool_tip="Rétablir les paramètres par défaut."/>
-	<button label="Calculer les poids et les frais" name="calculate_btn" tool_tip="Calculer les poids et les frais."/>
+	<button label="Calculer poids et frais" name="calculate_btn" tool_tip="Calculer les poids et les frais."/>
 	<button label="Charger" name="ok_btn" tool_tip="Charger dans le simulateur."/>
 	<button label="Annuler" name="cancel_btn"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml
index e6d407f727..4b4eedab8e 100644
--- a/indra/newview/skins/default/xui/fr/strings.xml
+++ b/indra/newview/skins/default/xui/fr/strings.xml
@@ -4228,7 +4228,7 @@ de l&apos;infraction signalée
 		/fumer
 	</string>
 	<string name="/stretch">
-		/s&apos;étirer
+		/bailler
 	</string>
 	<string name="/whistle">
 		/siffler
-- 
cgit v1.2.3


From 8b7f4d4ea38175ad1ee6cd0fe7d478d1802876c1 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 16 Sep 2011 19:09:37 +0300
Subject: STORM-1600 FIXED Folder view stole "Delete" key presses from the line
 editor when renaming a newly created inventory item.

Reason:
LLFocusMgr::setKeyboardFocus() which is called from LLLineEditor::setFocus()
makes the folder view the edit menu handler, thus it receives the Delete key
presses instead of the line editor.

Fix:
Make sure the line editor becomes the edit menu handler whenever it's focused,
no matter is it a child of a folder view or not.
---
 indra/llui/lllineeditor.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index ebdd47ae80..06dfc90d83 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -198,6 +198,7 @@ LLLineEditor::~LLLineEditor()
 
 void LLLineEditor::onFocusReceived()
 {
+	gEditMenuHandler = this;
 	LLUICtrl::onFocusReceived();
 	updateAllowingLanguageInput();
 }
-- 
cgit v1.2.3


From 832ed49f5bb6683323be0ababf8984b2f0701108 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Fri, 16 Sep 2011 13:03:10 -0400
Subject: SH-2440 FIX - avoid calling initInstance() on LLVOAvatarSelf if it
 already exists

---
 indra/newview/llviewerobject.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
 mode change 100644 => 100755 indra/newview/llviewerobject.cpp

diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
old mode 100644
new mode 100755
index cd71b6d42a..99a641844f
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -140,6 +140,7 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco
 			if (!gAgentAvatarp)
 			{
 				gAgentAvatarp = new LLVOAvatarSelf(id, pcode, regionp);
+				gAgentAvatarp->initInstance();
 			}
 			else 
 			{
@@ -150,8 +151,8 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco
 		else
 		{
 			res = new LLVOAvatar(id, pcode, regionp); 
+			res->initInstance();
 		}
-		static_cast<LLVOAvatar*>(res)->initInstance();
 		break;
 	}
 	case LL_PCODE_LEGACY_GRASS:
-- 
cgit v1.2.3


From 77eb3aae04b276369aea70d2931f6aed7352d823 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Fri, 16 Sep 2011 13:14:30 -0400
Subject: SH-2440 FIX - first build, then test, then commit

---
 indra/newview/llviewerobject.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 99a641844f..db7bb002c1 100755
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -150,8 +150,9 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco
 		}
 		else
 		{
-			res = new LLVOAvatar(id, pcode, regionp); 
-			res->initInstance();
+			LLVOAvatar *avatar = new LLVOAvatar(id, pcode, regionp); 
+			avatar->initInstance();
+			res = avatar;
 		}
 		break;
 	}
-- 
cgit v1.2.3


From 48dd723024439ff2011b9f4f0a808aaf4ac9cf6b Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Fri, 16 Sep 2011 11:49:00 -0700
Subject: sync with viewer-development

---
 .../newview/skins/default/xui/en/floater_preferences_proxy.xml | 10 ++++++----
 indra/newview/skins/default/xui/en/panel_navigation_bar.xml    |  3 ++-
 indra/newview/skins/default/xui/fr/floater_model_preview.xml   |  6 +++---
 indra/newview/skins/default/xui/fr/strings.xml                 |  2 +-
 4 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_preferences_proxy.xml b/indra/newview/skins/default/xui/en/floater_preferences_proxy.xml
index 449731ab89..93bfe53aae 100644
--- a/indra/newview/skins/default/xui/en/floater_preferences_proxy.xml
+++ b/indra/newview/skins/default/xui/en/floater_preferences_proxy.xml
@@ -29,7 +29,7 @@
 	 height="10"
 	 left_delta="23"
 	 layout="topleft"
-	 name="Proxy location"
+	 name="http_proxy_label"
 	 top_pad="10"
 	 width="300">
 	    HTTP Proxy:
@@ -81,7 +81,7 @@
 	 height="10"
 	 layout="topleft"
 	 left_delta="23"
-	 name="Proxy location"
+	 name="socks5_proxy_label"
 	 top_pad="10"
 	 width="300">
 	    SOCKS 5 Proxy:
@@ -125,7 +125,7 @@
 	 height="10"
 	 layout="topleft"
 	 left="40"
-	 name="Proxy location"
+	 name="socks_auth_label"
 	 top_pad="15"
 	 width="300">
 	    SOCKS Authentication:
@@ -163,6 +163,7 @@
 	 height="10"
 	 layout="topleft"
 	 left_delta="20"
+	 name="socks5_username_label"
 	 top_delta="50"
 	 width="200">
 	    Username:
@@ -174,6 +175,7 @@
 	 height="10"
 	 left_pad="15"
 	 layout="topleft"
+	 name="socks5_password_label"
 	 width="200">
 	    Password:
 	</text>
@@ -207,7 +209,7 @@
 	 height="10"
 	 layout="topleft"
 	 left="25"
-	 name="Proxy location"
+	 name="other_proxy_label"
 	 top_pad="18"
 	 width="300">
 	   Other HTTP traffic proxy:
diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
index 9749b6fdd4..51ffec4727 100644
--- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml
@@ -146,7 +146,8 @@
           border.highlight_light_color="FocusColor"
           border.highlight_dark_color="FocusColor"
           border.shadow_light_color="FocusColor"
-          border.shadow_dark_color="FocusColor"/>
+          border.shadow_dark_color="FocusColor"
+          mouse_wheel_opaque="true" />
         </search_combo_box>
 	</panel>
     <favorites_bar
diff --git a/indra/newview/skins/default/xui/fr/floater_model_preview.xml b/indra/newview/skins/default/xui/fr/floater_model_preview.xml
index 2b8e441ef0..2639339be5 100644
--- a/indra/newview/skins/default/xui/fr/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/fr/floater_model_preview.xml
@@ -131,7 +131,7 @@ Serveur :
 			<button label="Parcourir..." name="lod_browse"/>
 			<combo_box name="lod_mode">
 				<combo_item name="triangle_limit">
-					Triangles max.
+					Limite du triangle
 				</combo_item>
 				<combo_item name="error_threshold">
 					Seuil d&apos;erreur
@@ -141,7 +141,7 @@ Serveur :
 				Opér. construction :
 			</text>
 			<text name="queue_mode_text">
-				Mode file d&apos;attente :
+				Mode fil d&apos;attente :
 			</text>
 			<combo_box name="build_operator">
 				<combo_item name="edge_collapse">
@@ -244,7 +244,7 @@ Serveur :
 		Frais de chargement : [FEE] L$
 	</text>
 	<button label="Réinitialiser" name="reset_btn" tool_tip="Rétablir les paramètres par défaut."/>
-	<button label="Calculer poids et frais" name="calculate_btn" tool_tip="Calculer les poids et les frais."/>
+	<button label="Calculer les poids et les frais" name="calculate_btn" tool_tip="Calculer les poids et les frais."/>
 	<button label="Charger" name="ok_btn" tool_tip="Charger dans le simulateur."/>
 	<button label="Annuler" name="cancel_btn"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml
index 4b4eedab8e..e6d407f727 100644
--- a/indra/newview/skins/default/xui/fr/strings.xml
+++ b/indra/newview/skins/default/xui/fr/strings.xml
@@ -4228,7 +4228,7 @@ de l&apos;infraction signalée
 		/fumer
 	</string>
 	<string name="/stretch">
-		/bailler
+		/s&apos;étirer
 	</string>
 	<string name="/whistle">
 		/siffler
-- 
cgit v1.2.3


From be6e26de42af30b7d218d57ca776eccadf23b525 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Fri, 16 Sep 2011 11:51:57 -0700
Subject: VWR-26937 FIX FR linguistic, re-commit

---
 indra/newview/skins/default/xui/fr/floater_model_preview.xml | 6 +++---
 indra/newview/skins/default/xui/fr/strings.xml               | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/indra/newview/skins/default/xui/fr/floater_model_preview.xml b/indra/newview/skins/default/xui/fr/floater_model_preview.xml
index 2639339be5..2b8e441ef0 100644
--- a/indra/newview/skins/default/xui/fr/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/fr/floater_model_preview.xml
@@ -131,7 +131,7 @@ Serveur :
 			<button label="Parcourir..." name="lod_browse"/>
 			<combo_box name="lod_mode">
 				<combo_item name="triangle_limit">
-					Limite du triangle
+					Triangles max.
 				</combo_item>
 				<combo_item name="error_threshold">
 					Seuil d&apos;erreur
@@ -141,7 +141,7 @@ Serveur :
 				Opér. construction :
 			</text>
 			<text name="queue_mode_text">
-				Mode fil d&apos;attente :
+				Mode file d&apos;attente :
 			</text>
 			<combo_box name="build_operator">
 				<combo_item name="edge_collapse">
@@ -244,7 +244,7 @@ Serveur :
 		Frais de chargement : [FEE] L$
 	</text>
 	<button label="Réinitialiser" name="reset_btn" tool_tip="Rétablir les paramètres par défaut."/>
-	<button label="Calculer les poids et les frais" name="calculate_btn" tool_tip="Calculer les poids et les frais."/>
+	<button label="Calculer poids et frais" name="calculate_btn" tool_tip="Calculer les poids et les frais."/>
 	<button label="Charger" name="ok_btn" tool_tip="Charger dans le simulateur."/>
 	<button label="Annuler" name="cancel_btn"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml
index e6d407f727..4b4eedab8e 100644
--- a/indra/newview/skins/default/xui/fr/strings.xml
+++ b/indra/newview/skins/default/xui/fr/strings.xml
@@ -4228,7 +4228,7 @@ de l&apos;infraction signalée
 		/fumer
 	</string>
 	<string name="/stretch">
-		/s&apos;étirer
+		/bailler
 	</string>
 	<string name="/whistle">
 		/siffler
-- 
cgit v1.2.3


From 1a7e1661040c9295c405e72e361307109514fc9b Mon Sep 17 00:00:00 2001
From: prep linden <prep@lindenlab.com>
Date: Fri, 16 Sep 2011 15:10:58 -0400
Subject: Fix for sh-2443

---
 indra/newview/llfloatermodelpreview.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 75e775072b..6bba430425 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -4351,6 +4351,11 @@ void LLModelPreview::updateStatusMessages()
 		{
 			skinAndRigOk = false;
 		}	
+		else
+		if ( !getRigWithSceneParity() )
+		{
+			mFMP->childDisable("calculate_btn");
+		}
 	}
 	
 	if(upload_ok && mModelLoader)
@@ -4954,12 +4959,12 @@ BOOL LLModelPreview::render()
 
 	if (has_skin_weights)
 	{ //model has skin weights, enable view options for skin weights and joint positions
-		if (fmp)
+		if (fmp && getRigWithSceneParity() )
 		{
 			fmp->enableViewOption("show_skin_weight");
 			fmp->setViewOptionEnabled("show_joint_positions", skin_weight);	
+			mFMP->childEnable("upload_skin");
 		}
-		mFMP->childEnable("upload_skin");
 	}
 	else
 	{
-- 
cgit v1.2.3


From 3f0a2cda29607b1114788f54c1147c3bd5c864f8 Mon Sep 17 00:00:00 2001
From: prep linden <prep@lindenlab.com>
Date: Mon, 19 Sep 2011 11:00:11 -0400
Subject: Fix for sh-2443

---
 indra/newview/llfloatermodelpreview.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 6bba430425..5869cf6fee 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -4352,7 +4352,7 @@ void LLModelPreview::updateStatusMessages()
 			skinAndRigOk = false;
 		}	
 		else
-		if ( !getRigWithSceneParity() )
+		if ( !isLegacyRigValid() )
 		{
 			mFMP->childDisable("calculate_btn");
 		}
@@ -4959,7 +4959,7 @@ BOOL LLModelPreview::render()
 
 	if (has_skin_weights)
 	{ //model has skin weights, enable view options for skin weights and joint positions
-		if (fmp && getRigWithSceneParity() )
+		if (fmp && isLegacyRigValid() )
 		{
 			fmp->enableViewOption("show_skin_weight");
 			fmp->setViewOptionEnabled("show_joint_positions", skin_weight);	
-- 
cgit v1.2.3


From aa45b6e480f7ebed09ebaae9584c2cb969b4e968 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 19 Sep 2011 14:48:19 -0400
Subject: VWR-26942: back out 6a0e0684e7af

---
 indra/newview/app_settings/CA.pem | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/indra/newview/app_settings/CA.pem b/indra/newview/app_settings/CA.pem
index a16b4225e5..6140842a7f 100644
--- a/indra/newview/app_settings/CA.pem
+++ b/indra/newview/app_settings/CA.pem
@@ -4587,6 +4587,38 @@ zo9uoV1/A3U05K2JRVRevq4opbs/eHnrc7MKDf2+yfdWrPa37S+bISnHOLaVxATy
 wy39FCqQmbkHzJ8=
 -----END CERTIFICATE-----
 -----BEGIN CERTIFICATE-----
+MIIFijCCA3KgAwIBAgIQDHbanJEMTiye/hXQWJM8TDANBgkqhkiG9w0BAQUFADBf
+MQswCQYDVQQGEwJOTDESMBAGA1UEChMJRGlnaU5vdGFyMRowGAYDVQQDExFEaWdp
+Tm90YXIgUm9vdCBDQTEgMB4GCSqGSIb3DQEJARYRaW5mb0BkaWdpbm90YXIubmww
+HhcNMDcwNTE2MTcxOTM2WhcNMjUwMzMxMTgxOTIxWjBfMQswCQYDVQQGEwJOTDES
+MBAGA1UEChMJRGlnaU5vdGFyMRowGAYDVQQDExFEaWdpTm90YXIgUm9vdCBDQTEg
+MB4GCSqGSIb3DQEJARYRaW5mb0BkaWdpbm90YXIubmwwggIiMA0GCSqGSIb3DQEB
+AQUAA4ICDwAwggIKAoICAQCssFjBAL3YIQgLK5r+blYwBZ8bd5AQQVzDDYcRd46B
+8cp86Yxq7Th0Nbva3/m7wAk3tJZzgX0zGpg595NvlX89ubF1h7pRSOiLcD6VBMXY
+tsMW2YiwsYcdcNqGtA8Ui3rPENF0NqISe3eGSnnme98CEWilToauNFibJBN4ViIl
+HgGLS1Fx+4LMWZZpiFpoU8W5DQI3y0u8ZkqQfioLBQftFl9VkHXYRskbg+IIvvEj
+zJkd1ioPgyAVWCeCLvriIsJJsbkBgWqdbZ1Ad2h2TiEqbYRAhU52mXyC8/O3AlnU
+JgEbjt+tUwbRrhjd4rI6y9eIOI6sWym5GdOY+RgDz0iChmYLG2kPyes4iHomGgVM
+ktck1JbyrFIto0fVUvY//s6EBnCmqj6i8rZWNBhXouSBbefK8GrTx5FrAoNBfBXv
+a5pkXuPQPOWx63tdhvvL5ndJzaNl3Pe5nLjkC1+Tz8wwGjIczhxjlaX56uF0i57p
+K6kwe6AYHw4YC+VbqdPRbB4HZ4+RS6mKvNJmqpMBiLKR+jFc1abBUggJzQpjotMi
+puih2TkGl/VujQKQjBR7P4DNG5y6xFhyI6+2Vp/GekIzKQc/gsnmHwUNzUwoNovT
+yD4cxojvXu6JZOkd69qJfjKmadHdzIif0dDJZiHcBmfFlHqabWJMfczgZICynkeO
+owIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNV
+HQ4EFgQUiGi/4I41xDs4a2L3KDuEgcgM100wDQYJKoZIhvcNAQEFBQADggIBADsC
+jcs8MOhuoK3yc7NfniUTBAXT9uOLuwt5zlPe5JbF0a9zvNXD0EBVfEB/zRtfCdXy
+fJ9oHbtdzno5wozWmHvFg1Wo1X1AyuAe94leY12hE8JdiraKfADzI8PthV9xdvBo
+Y6pFITlIYXg23PFDk9Qlx/KAZeFTAnVR/Ho67zerhChXDNjU1JlWbOOi/lmEtDHo
+M/hklJRRl6s5xUvt2t2AC298KQ3EjopyDedTFLJgQT2EkTFoPSdE2+Xe9PpjRchM
+Ppj1P0G6Tss3DbpmmPHdy59c91Q2gmssvBNhl0L4eLvMyKKfyvBovWsdst+Nbwed
+2o5nx0ceyrm/KkKRt2NTZvFCo+H0Wk1Ya7XkpDOtXHAd3ODy63MUkZoDweoAZbwH
+/M8SESIsrqC9OuCiKthZ6SnTGDWkrBFfGbW1G/8iSlzGeuQX7yCpp/Q/rYqnmgQl
+nQ7KN+ZQ/YxCKQSa7LnPS3K94gg2ryMvYuXKAdNw23yCIywWMQzGNgeQerEfZ1jE
+O1hZibCMjFCz2IbLaKPECudpSyDOwR5WS5WpI2jYMNjD67BVUc3l/Su49bsRn1NU
+9jQZjHkJNsphFyUXC4KYcwx3dMPVDceoEkzHp1RxRy4sGn3J4ys7SN4nhKdjNrN9
+j6BkOSQNPXuHr2ZcdBtLc7LljPCGmbjlxd+Ewbfr
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
 MIIDujCCAqKgAwIBAgIEAJiWijANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJO
 TDEeMBwGA1UEChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSYwJAYDVQQDEx1TdGFh
 dCBkZXIgTmVkZXJsYW5kZW4gUm9vdCBDQTAeFw0wMjEyMTcwOTIzNDlaFw0xNTEy
-- 
cgit v1.2.3


From 83732a7083ef50ddbf2c0e1e99aed8fe65c6a63a Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 19 Sep 2011 16:39:16 -0500
Subject: SH-2445 Potential fix for crash in LLCurl::Multi::~Multi -- lock
 sMultiMutex around curl_multi_ calls in LLCurl::Multi destructor

---
 indra/llmessage/llcurl.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 280a8942a8..6d9213f51b 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -553,6 +553,11 @@ LLCurl::Multi::~Multi()
 {
 	llassert(isStopped());
 
+	if (LLCurl::sMultiThreaded)
+	{
+		LLCurl::Easy::sMultiMutex->lock();
+	}
+
 	delete mSignal;
 	mSignal = NULL;
 
@@ -573,6 +578,11 @@ LLCurl::Multi::~Multi()
 
 	check_curl_multi_code(curl_multi_cleanup(mCurlMultiHandle));
 	--gCurlMultiCount;
+
+	if (LLCurl::sMultiThreaded)
+	{
+		LLCurl::Easy::sMultiMutex->unlock();
+	}
 }
 
 CURLMsg* LLCurl::Multi::info_read(S32* msgs_in_queue)
-- 
cgit v1.2.3


From 6c729db78f26703f168bd1586478425d13579a39 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Tue, 20 Sep 2011 18:42:31 +0300
Subject: STORM-1611 FIXED Untrusted link to server release notes.

Fetch server release notes URL suitable for external browsers from the ServerReleaseNotes capability.
---
 indra/newview/llfloaterabout.cpp                   | 231 +++++++++++++++------
 .../newview/skins/default/xui/en/floater_about.xml |   6 +-
 2 files changed, 170 insertions(+), 67 deletions(-)

diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp
index 849826bb6b..22f500ba15 100644
--- a/indra/newview/llfloaterabout.cpp
+++ b/indra/newview/llfloaterabout.cpp
@@ -70,6 +70,22 @@ extern U32 gPacketsIn;
 
 static std::string get_viewer_release_notes_url();
 
+///----------------------------------------------------------------------------
+/// Class LLServerReleaseNotesURLFetcher
+///----------------------------------------------------------------------------
+class LLServerReleaseNotesURLFetcher : public LLHTTPClient::Responder
+{
+	LOG_CLASS(LLServerReleaseNotesURLFetcher);
+public:
+
+	static void startFetch();
+	/*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content);
+	/*virtual*/ void completedRaw(
+		U32 status,
+		const std::string& reason,
+		const LLChannelDescriptors& channels,
+		const LLIOPipe::buffer_ptr_t& buffer);
+};
 
 ///----------------------------------------------------------------------------
 /// Class LLFloaterAbout
@@ -89,6 +105,11 @@ public:
 	/// separated so that we can programmatically access the same info.
 	static LLSD getInfo();
 	void onClickCopyToClipboard();
+
+	void updateServerReleaseNotesURL(const std::string& url);
+
+private:
+	void setSupportText(const std::string& server_release_notes_url);
 };
 
 
@@ -122,76 +143,17 @@ BOOL LLFloaterAbout::postBuild()
 	getChild<LLUICtrl>("copy_btn")->setCommitCallback(
 		boost::bind(&LLFloaterAbout::onClickCopyToClipboard, this));
 
-#if LL_WINDOWS
-	getWindow()->incBusyCount();
-	getWindow()->setCursor(UI_CURSOR_ARROW);
-#endif
-	LLSD info(getInfo());
-#if LL_WINDOWS
-	getWindow()->decBusyCount();
-	getWindow()->setCursor(UI_CURSOR_ARROW);
-#endif
-
-	std::ostringstream support;
-
-	// Render the LLSD from getInfo() as a format_map_t
-	LLStringUtil::format_map_t args;
-
-	// allow the "Release Notes" URL label to be localized
-	args["ReleaseNotes"] = LLTrans::getString("ReleaseNotes");
-
-	for (LLSD::map_const_iterator ii(info.beginMap()), iend(info.endMap());
-		 ii != iend; ++ii)
-	{
-		if (! ii->second.isArray())
-		{
-			// Scalar value
-			if (ii->second.isUndefined())
-			{
-				args[ii->first] = getString("none");
-			}
-			else
-			{
-				// don't forget to render value asString()
-				args[ii->first] = ii->second.asString();
-			}
-		}
-		else
-		{
-			// array value: build KEY_0, KEY_1 etc. entries
-			for (LLSD::Integer n(0), size(ii->second.size()); n < size; ++n)
-			{
-				args[STRINGIZE(ii->first << '_' << n)] = ii->second[n].asString();
-			}
-		}
-	}
-
-	// Now build the various pieces
-	support << getString("AboutHeader", args);
-	if (info.has("REGION"))
-	{
-		support << "\n\n" << getString("AboutPosition", args);
-	}
-	support << "\n\n" << getString("AboutSystem", args);
-	support << "\n";
-	if (info.has("GRAPHICS_DRIVER_VERSION"))
-	{
-		support << "\n" << getString("AboutDriver", args);
-	}
-	support << "\n" << getString("AboutLibs", args);
-	if (info.has("COMPILER"))
+	if (gAgent.getRegion())
 	{
-		support << "\n" << getString("AboutCompiler", args);
+		// start fetching server release notes URL
+		setSupportText(LLTrans::getString("RetrievingData"));
+		LLServerReleaseNotesURLFetcher::startFetch();
 	}
-	if (info.has("PACKETS_IN"))
+	else // not logged in
 	{
-		support << '\n' << getString("AboutTraffic", args);
+		setSupportText(LLStringUtil::null);
 	}
 
-	support_widget->appendText(support.str(), 
-								FALSE, 
-								LLStyle::Params()
-									.color(LLUIColorTable::instance().getColor("TextFgReadOnlyColor")));
 	support_widget->blockUndo();
 
 	// Fix views
@@ -294,7 +256,6 @@ LLSD LLFloaterAbout::getInfo()
 		info["HOSTNAME"] = gAgent.getRegion()->getHost().getHostName();
 		info["HOSTIP"] = gAgent.getRegion()->getHost().getString();
 		info["SERVER_VERSION"] = gLastVersionChannel;
-		info["SERVER_RELEASE_NOTES_URL"] = LLWeb::escapeURL(region->getCapability("ServerReleaseNotes"));
 	}
 
 	// CPU
@@ -389,6 +350,95 @@ void LLFloaterAbout::onClickCopyToClipboard()
 	support_widget->deselect();
 }
 
+void LLFloaterAbout::updateServerReleaseNotesURL(const std::string& url)
+{
+	setSupportText(url);
+}
+
+void LLFloaterAbout::setSupportText(const std::string& server_release_notes_url)
+{
+#if LL_WINDOWS
+	getWindow()->incBusyCount();
+	getWindow()->setCursor(UI_CURSOR_ARROW);
+#endif
+	LLSD info(getInfo());
+#if LL_WINDOWS
+	getWindow()->decBusyCount();
+	getWindow()->setCursor(UI_CURSOR_ARROW);
+#endif
+
+	if (LLStringUtil::startsWith(server_release_notes_url, "http")) // it's an URL
+	{
+		info["SERVER_RELEASE_NOTES_URL"] = "[" + LLWeb::escapeURL(server_release_notes_url) + " " + LLTrans::getString("ReleaseNotes") + "]";
+	}
+	else
+	{
+		info["SERVER_RELEASE_NOTES_URL"] = server_release_notes_url;
+	}
+
+	LLViewerTextEditor *support_widget =
+		getChild<LLViewerTextEditor>("support_editor", true);
+
+	std::ostringstream support;
+
+	// Render the LLSD from getInfo() as a format_map_t
+	LLStringUtil::format_map_t args;
+
+	for (LLSD::map_const_iterator ii(info.beginMap()), iend(info.endMap());
+		 ii != iend; ++ii)
+	{
+		if (! ii->second.isArray())
+		{
+			// Scalar value
+			if (ii->second.isUndefined())
+			{
+				args[ii->first] = getString("none");
+			}
+			else
+			{
+				// don't forget to render value asString()
+				args[ii->first] = ii->second.asString();
+			}
+		}
+		else
+		{
+			// array value: build KEY_0, KEY_1 etc. entries
+			for (LLSD::Integer n(0), size(ii->second.size()); n < size; ++n)
+			{
+				args[STRINGIZE(ii->first << '_' << n)] = ii->second[n].asString();
+			}
+		}
+	}
+
+	// Now build the various pieces
+	support << getString("AboutHeader", args);
+	if (info.has("REGION"))
+	{
+		support << "\n\n" << getString("AboutPosition", args);
+	}
+	support << "\n\n" << getString("AboutSystem", args);
+	support << "\n";
+	if (info.has("GRAPHICS_DRIVER_VERSION"))
+	{
+		support << "\n" << getString("AboutDriver", args);
+	}
+	support << "\n" << getString("AboutLibs", args);
+	if (info.has("COMPILER"))
+	{
+		support << "\n" << getString("AboutCompiler", args);
+	}
+	if (info.has("PACKETS_IN"))
+	{
+		support << '\n' << getString("AboutTraffic", args);
+	}
+
+	support_widget->clear();
+	support_widget->appendText(support.str(),
+								FALSE,
+								LLStyle::Params()
+									.color(LLUIColorTable::instance().getColor("TextFgReadOnlyColor")));
+}
+
 ///----------------------------------------------------------------------------
 /// LLFloaterAboutUtil
 ///----------------------------------------------------------------------------
@@ -398,3 +448,52 @@ void LLFloaterAboutUtil::registerFloater()
 		&LLFloaterReg::build<LLFloaterAbout>);
 
 }
+
+///----------------------------------------------------------------------------
+/// Class LLServerReleaseNotesURLFetcher implementation
+///----------------------------------------------------------------------------
+// static
+void LLServerReleaseNotesURLFetcher::startFetch()
+{
+	LLViewerRegion* region = gAgent.getRegion();
+	if (!region) return;
+
+	// We cannot display the URL returned by the ServerReleaseNotes capability
+	// because opening it in an external browser will trigger a warning about untrusted
+	// SSL certificate.
+	// So we query the URL ourselves, expecting to find
+	// an URL suitable for external browsers in the "Location:" HTTP header.
+	std::string cap_url = region->getCapability("ServerReleaseNotes");
+	LLHTTPClient::get(cap_url, new LLServerReleaseNotesURLFetcher);
+}
+
+// virtual
+void LLServerReleaseNotesURLFetcher::completedHeader(U32 status, const std::string& reason, const LLSD& content)
+{
+	lldebugs << "Status: " << status << llendl;
+	lldebugs << "Reason: " << reason << llendl;
+	lldebugs << "Headers: " << content << llendl;
+
+	LLFloaterAbout* floater_about = LLFloaterReg::getTypedInstance<LLFloaterAbout>("sl_about");
+	if (floater_about)
+	{
+		std::string location = content["location"].asString();
+		if (location.empty())
+		{
+			location = floater_about->getString("ErrorFetchingServerReleaseNotesURL");
+		}
+		floater_about->updateServerReleaseNotesURL(location);
+	}
+}
+
+// virtual
+void LLServerReleaseNotesURLFetcher::completedRaw(
+	U32 status,
+	const std::string& reason,
+	const LLChannelDescriptors& channels,
+	const LLIOPipe::buffer_ptr_t& buffer)
+{
+	// Do nothing.
+	// We're overriding just because the base implementation tries to
+	// deserialize LLSD which triggers warnings.
+}
diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml
index 3dd394bac1..2580c06344 100644
--- a/indra/newview/skins/default/xui/en/floater_about.xml
+++ b/indra/newview/skins/default/xui/en/floater_about.xml
@@ -23,7 +23,7 @@ Built with [COMPILER] version [COMPILER_VERSION]
      name="AboutPosition">
 You are at [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] in [REGION] located at &lt;nolink&gt;[HOSTNAME]&lt;/nolink&gt; ([HOSTIP])
 [SERVER_VERSION]
-[[SERVER_RELEASE_NOTES_URL] [ReleaseNotes]]
+[SERVER_RELEASE_NOTES_URL]
 
 </floater.string>
   <!-- *NOTE: Do not translate text like GPU, Graphics Card, etc -
@@ -58,6 +58,10 @@ Voice Server Version: [VOICE_VERSION]
   <floater.string
      name="AboutTraffic">
 Packets Lost: [PACKETS_LOST,number,0]/[PACKETS_IN,number,0] ([PACKETS_PCT,number,1]%)
+</floater.string>
+<floater.string
+     name="ErrorFetchingServerReleaseNotesURL">
+Error fetching server release notes URL.
 </floater.string>
   <tab_container
     follows="all" 
-- 
cgit v1.2.3


From c989abf9ccfd3330c24a423eea9909866e62f679 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Tue, 20 Sep 2011 18:52:49 +0300
Subject: STORM-1603 FIXED Increased max classified price from L$99,999 to
 L$999,999.

---
 indra/newview/skins/default/xui/en/floater_publish_classified.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/floater_publish_classified.xml b/indra/newview/skins/default/xui/en/floater_publish_classified.xml
index 6ce9ed6e77..322e34272c 100644
--- a/indra/newview/skins/default/xui/en/floater_publish_classified.xml
+++ b/indra/newview/skins/default/xui/en/floater_publish_classified.xml
@@ -36,7 +36,7 @@ Remember, Classified fees are non-refundable.
      left="15"
      value="50"
      min_val="50"
-     max_val="99999"
+     max_val="999999"
      name="price_for_listing"
      top_pad="10"
      tool_tip="Price for listing."
-- 
cgit v1.2.3


From 0db01825c5895b4bbee15abea5f0e24b9aa93021 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Wed, 21 Sep 2011 00:34:35 +0300
Subject: STORM-1614 FIXED Untranslatable gesture: /bow

Backed out changeset ed2791ae1cf0.
---
 indra/newview/llviewerinventory.cpp            | 2 +-
 indra/newview/skins/default/xui/en/strings.xml | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index ad65a8846c..b22c6d2fd4 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -141,7 +141,7 @@ public:
 		mInventoryItemsDict["Female - Wow"]				= LLTrans::getString("Female - Wow");
 
 		//common
-		mInventoryItemsDict["/bow1"]					= LLTrans::getString("/bow1");
+		mInventoryItemsDict["/bow"]						= LLTrans::getString("/bow");
 		mInventoryItemsDict["/clap"]					= LLTrans::getString("/clap");
 		mInventoryItemsDict["/count"]					= LLTrans::getString("/count");
 		mInventoryItemsDict["/extinguish"]				= LLTrans::getString("/extinguish");
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index c0154ae9b3..1351ad6e52 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -3439,7 +3439,7 @@ Abuse Report</string>
   <string name="Female - Stick tougue out">Female - Stick tougue out</string>
   <string name="Female - Wow">Female - Wow</string>
 
-  <string name="/bow1">/bow1</string>
+  <string name="/bow">/bow</string>
   <string name="/clap">/clap</string>
   <string name="/count">/count</string>
   <string name="/extinguish">/extinguish</string>
-- 
cgit v1.2.3


From 0d9e46ab0b065d72e0c8d45a773ebbbd71563060 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Wed, 21 Sep 2011 11:16:26 -0400
Subject: SH-2432 FIX - moved status line to lower part of dialog

---
 indra/newview/skins/default/xui/en/floater_model_preview.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 mode change 100644 => 100755 indra/newview/skins/default/xui/en/floater_model_preview.xml

diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
old mode 100644
new mode 100755
index cae6445b02..2eea286c8b
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -27,8 +27,6 @@
   <string name="simplifying">Simplifying...</string>
   <string name="tbd">TBD</string>
 
-  <text text_color="Yellow" left="10" bottom_delta="0" width="290" height="15" follows="bottom|left|right" name="status">[STATUS]</text>
-  
 <panel
   follows="top|left"
   height="455"
@@ -1313,6 +1311,8 @@
          visible="false">
          You dont have rights to upload mesh models. [[VURL] Find out how] to get certified.
        </text>
+       <text text_color="Yellow" layout="topleft" top_delta="20" left="6" name="status">[STATUS]</text>
+  
     </panel>
 </panel>
 
-- 
cgit v1.2.3


From 5bdfc97152a2ce8aece891711532226049d9d267 Mon Sep 17 00:00:00 2001
From: Roxie Linden <roxie@lindenlab.com>
Date: Wed, 21 Sep 2011 15:28:45 -0400
Subject: VWR-26942: Nederland CA was causing issues when it was mid-CA.pem,
 moved to end for testing.  We are still investigating the real issue, but
 this may be a sufficient patch

---
 indra/newview/app_settings/CA.pem | 388 +++-----------------------------------
 1 file changed, 22 insertions(+), 366 deletions(-)

diff --git a/indra/newview/app_settings/CA.pem b/indra/newview/app_settings/CA.pem
index 6140842a7f..8c1b9a1f37 100644
--- a/indra/newview/app_settings/CA.pem
+++ b/indra/newview/app_settings/CA.pem
@@ -2792,188 +2792,6 @@ KWss5nbZqSl9Mt3JNjy9rjXxEZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv
 2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwPDPafepE39peC4N1xaf92P2BNPM/3
 mfnGV/TJVTl4uix5yaaIK/QI
 -----END CERTIFICATE-----
-cp . `md5 -q .`.pem
-cp ./.pem `md5 -q ./.pem`.pem
-cp ./cert000.pem `md5 -q ./cert000.pem`.pem
-cp ./cert001.pem `md5 -q ./cert001.pem`.pem
-cp ./cert002.pem `md5 -q ./cert002.pem`.pem
-cp ./cert003.pem `md5 -q ./cert003.pem`.pem
-cp ./cert004.pem `md5 -q ./cert004.pem`.pem
-cp ./cert005.pem `md5 -q ./cert005.pem`.pem
-cp ./cert006.pem `md5 -q ./cert006.pem`.pem
-cp ./cert007.pem `md5 -q ./cert007.pem`.pem
-cp ./cert008.pem `md5 -q ./cert008.pem`.pem
-cp ./cert009.pem `md5 -q ./cert009.pem`.pem
-cp ./cert010.pem `md5 -q ./cert010.pem`.pem
-cp ./cert011.pem `md5 -q ./cert011.pem`.pem
-cp ./cert012.pem `md5 -q ./cert012.pem`.pem
-cp ./cert013.pem `md5 -q ./cert013.pem`.pem
-cp ./cert014.pem `md5 -q ./cert014.pem`.pem
-cp ./cert015.pem `md5 -q ./cert015.pem`.pem
-cp ./cert016.pem `md5 -q ./cert016.pem`.pem
-cp ./cert017.pem `md5 -q ./cert017.pem`.pem
-cp ./cert018.pem `md5 -q ./cert018.pem`.pem
-cp ./cert019.pem `md5 -q ./cert019.pem`.pem
-cp ./cert020.pem `md5 -q ./cert020.pem`.pem
-cp ./cert021.pem `md5 -q ./cert021.pem`.pem
-cp ./cert022.pem `md5 -q ./cert022.pem`.pem
-cp ./cert023.pem `md5 -q ./cert023.pem`.pem
-cp ./cert024.pem `md5 -q ./cert024.pem`.pem
-cp ./cert025.pem `md5 -q ./cert025.pem`.pem
-cp ./cert026.pem `md5 -q ./cert026.pem`.pem
-cp ./cert027.pem `md5 -q ./cert027.pem`.pem
-cp ./cert028.pem `md5 -q ./cert028.pem`.pem
-cp ./cert029.pem `md5 -q ./cert029.pem`.pem
-cp ./cert030.pem `md5 -q ./cert030.pem`.pem
-cp ./cert031.pem `md5 -q ./cert031.pem`.pem
-cp ./cert032.pem `md5 -q ./cert032.pem`.pem
-cp ./cert033.pem `md5 -q ./cert033.pem`.pem
-cp ./cert034.pem `md5 -q ./cert034.pem`.pem
-cp ./cert035.pem `md5 -q ./cert035.pem`.pem
-cp ./cert036.pem `md5 -q ./cert036.pem`.pem
-cp ./cert037.pem `md5 -q ./cert037.pem`.pem
-cp ./cert038.pem `md5 -q ./cert038.pem`.pem
-cp ./cert039.pem `md5 -q ./cert039.pem`.pem
-cp ./cert040.pem `md5 -q ./cert040.pem`.pem
-cp ./cert041.pem `md5 -q ./cert041.pem`.pem
-cp ./cert042.pem `md5 -q ./cert042.pem`.pem
-cp ./cert043.pem `md5 -q ./cert043.pem`.pem
-cp ./cert044.pem `md5 -q ./cert044.pem`.pem
-cp ./cert045.pem `md5 -q ./cert045.pem`.pem
-cp ./cert046.pem `md5 -q ./cert046.pem`.pem
-cp ./cert047.pem `md5 -q ./cert047.pem`.pem
-cp ./cert048.pem `md5 -q ./cert048.pem`.pem
-cp ./cert049.pem `md5 -q ./cert049.pem`.pem
-cp ./cert050.pem `md5 -q ./cert050.pem`.pem
-cp ./cert051.pem `md5 -q ./cert051.pem`.pem
-cp ./cert052.pem `md5 -q ./cert052.pem`.pem
-cp ./cert053.pem `md5 -q ./cert053.pem`.pem
-cp ./cert054.pem `md5 -q ./cert054.pem`.pem
-cp ./cert055.pem `md5 -q ./cert055.pem`.pem
-cp ./cert056.pem `md5 -q ./cert056.pem`.pem
-cp ./cert057.pem `md5 -q ./cert057.pem`.pem
-cp ./cert058.pem `md5 -q ./cert058.pem`.pem
-cp ./cert059.pem `md5 -q ./cert059.pem`.pem
-cp ./cert060.pem `md5 -q ./cert060.pem`.pem
-cp ./cert061.pem `md5 -q ./cert061.pem`.pem
-cp ./cert062.pem `md5 -q ./cert062.pem`.pem
-cp ./cert063.pem `md5 -q ./cert063.pem`.pem
-cp ./cert064.pem `md5 -q ./cert064.pem`.pem
-cp ./cert065.pem `md5 -q ./cert065.pem`.pem
-cp ./cert066.pem `md5 -q ./cert066.pem`.pem
-cp ./cert067.pem `md5 -q ./cert067.pem`.pem
-cp ./cert068.pem `md5 -q ./cert068.pem`.pem
-cp ./cert069.pem `md5 -q ./cert069.pem`.pem
-cp ./cert070.pem `md5 -q ./cert070.pem`.pem
-cp ./cert071.pem `md5 -q ./cert071.pem`.pem
-cp ./cert072.pem `md5 -q ./cert072.pem`.pem
-cp ./cert073.pem `md5 -q ./cert073.pem`.pem
-cp ./cert074.pem `md5 -q ./cert074.pem`.pem
-cp ./cert075.pem `md5 -q ./cert075.pem`.pem
-cp ./cert076.pem `md5 -q ./cert076.pem`.pem
-cp ./cert077.pem `md5 -q ./cert077.pem`.pem
-cp ./cert078.pem `md5 -q ./cert078.pem`.pem
-cp ./cert079.pem `md5 -q ./cert079.pem`.pem
-cp ./cert080.pem `md5 -q ./cert080.pem`.pem
-cp ./cert081.pem `md5 -q ./cert081.pem`.pem
-cp ./cert082.pem `md5 -q ./cert082.pem`.pem
-cp ./cert083.pem `md5 -q ./cert083.pem`.pem
-cp ./cert084.pem `md5 -q ./cert084.pem`.pem
-cp ./cert085.pem `md5 -q ./cert085.pem`.pem
-cp ./cert086.pem `md5 -q ./cert086.pem`.pem
-cp ./cert087.pem `md5 -q ./cert087.pem`.pem
-cp ./cert088.pem `md5 -q ./cert088.pem`.pem
-cp ./cert089.pem `md5 -q ./cert089.pem`.pem
-cp ./cert090.pem `md5 -q ./cert090.pem`.pem
-cp ./cert091.pem `md5 -q ./cert091.pem`.pem
-cp ./cert092.pem `md5 -q ./cert092.pem`.pem
-cp ./cert093.pem `md5 -q ./cert093.pem`.pem
-cp ./cert094.pem `md5 -q ./cert094.pem`.pem
-cp ./cert095.pem `md5 -q ./cert095.pem`.pem
-cp ./cert096.pem `md5 -q ./cert096.pem`.pem
-cp ./cert097.pem `md5 -q ./cert097.pem`.pem
-cp ./cert098.pem `md5 -q ./cert098.pem`.pem
-cp ./cert099.pem `md5 -q ./cert099.pem`.pem
-cp ./cert100.pem `md5 -q ./cert100.pem`.pem
-cp ./cert101.pem `md5 -q ./cert101.pem`.pem
-cp ./cert102.pem `md5 -q ./cert102.pem`.pem
-cp ./cert103.pem `md5 -q ./cert103.pem`.pem
-cp ./cert104.pem `md5 -q ./cert104.pem`.pem
-cp ./cert105.pem `md5 -q ./cert105.pem`.pem
-cp ./cert106.pem `md5 -q ./cert106.pem`.pem
-cp ./cert107.pem `md5 -q ./cert107.pem`.pem
-cp ./cert108.pem `md5 -q ./cert108.pem`.pem
-cp ./cert109.pem `md5 -q ./cert109.pem`.pem
-cp ./cert110.pem `md5 -q ./cert110.pem`.pem
-cp ./cert111.pem `md5 -q ./cert111.pem`.pem
-cp ./cert112.pem `md5 -q ./cert112.pem`.pem
-cp ./cert113.pem `md5 -q ./cert113.pem`.pem
-cp ./cert114.pem `md5 -q ./cert114.pem`.pem
-cp ./cert115.pem `md5 -q ./cert115.pem`.pem
-cp ./cert116.pem `md5 -q ./cert116.pem`.pem
-cp ./cert117.pem `md5 -q ./cert117.pem`.pem
-cp ./cert118.pem `md5 -q ./cert118.pem`.pem
-cp ./cert119.pem `md5 -q ./cert119.pem`.pem
-cp ./cert120.pem `md5 -q ./cert120.pem`.pem
-cp ./cert121.pem `md5 -q ./cert121.pem`.pem
-cp ./cert122.pem `md5 -q ./cert122.pem`.pem
-cp ./cert123.pem `md5 -q ./cert123.pem`.pem
-cp ./cert124.pem `md5 -q ./cert124.pem`.pem
-cp ./cert125.pem `md5 -q ./cert125.pem`.pem
-cp ./cert126.pem `md5 -q ./cert126.pem`.pem
-cp ./cert127.pem `md5 -q ./cert127.pem`.pem
-cp ./cert128.pem `md5 -q ./cert128.pem`.pem
-cp ./cert129.pem `md5 -q ./cert129.pem`.pem
-cp ./cert130.pem `md5 -q ./cert130.pem`.pem
-cp ./cert131.pem `md5 -q ./cert131.pem`.pem
-cp ./cert132.pem `md5 -q ./cert132.pem`.pem
-cp ./cert133.pem `md5 -q ./cert133.pem`.pem
-cp ./cert134.pem `md5 -q ./cert134.pem`.pem
-cp ./cert135.pem `md5 -q ./cert135.pem`.pem
-cp ./cert136.pem `md5 -q ./cert136.pem`.pem
-cp ./cert137.pem `md5 -q ./cert137.pem`.pem
-cp ./cert138.pem `md5 -q ./cert138.pem`.pem
-cp ./cert139.pem `md5 -q ./cert139.pem`.pem
-cp ./cert140.pem `md5 -q ./cert140.pem`.pem
-cp ./cert141.pem `md5 -q ./cert141.pem`.pem
-cp ./cert142.pem `md5 -q ./cert142.pem`.pem
-cp ./cert143.pem `md5 -q ./cert143.pem`.pem
-cp ./cert144.pem `md5 -q ./cert144.pem`.pem
-cp ./cert145.pem `md5 -q ./cert145.pem`.pem
-cp ./cert146.pem `md5 -q ./cert146.pem`.pem
-cp ./cert147.pem `md5 -q ./cert147.pem`.pem
-cp ./cert148.pem `md5 -q ./cert148.pem`.pem
-cp ./cert149.pem `md5 -q ./cert149.pem`.pem
-cp ./cert150.pem `md5 -q ./cert150.pem`.pem
-cp ./cert151.pem `md5 -q ./cert151.pem`.pem
-cp ./cert152.pem `md5 -q ./cert152.pem`.pem
-cp ./cert153.pem `md5 -q ./cert153.pem`.pem
-cp ./cert154.pem `md5 -q ./cert154.pem`.pem
-cp ./cert155.pem `md5 -q ./cert155.pem`.pem
-cp ./cert156.pem `md5 -q ./cert156.pem`.pem
-cp ./cert157.pem `md5 -q ./cert157.pem`.pem
-cp ./cert158.pem `md5 -q ./cert158.pem`.pem
-cp ./cert159.pem `md5 -q ./cert159.pem`.pem
-cp ./cert160.pem `md5 -q ./cert160.pem`.pem
-cp ./cert161.pem `md5 -q ./cert161.pem`.pem
-cp ./cert162.pem `md5 -q ./cert162.pem`.pem
-cp ./cert163.pem `md5 -q ./cert163.pem`.pem
-cp ./cert164.pem `md5 -q ./cert164.pem`.pem
-cp ./cert165.pem `md5 -q ./cert165.pem`.pem
-cp ./cert166.pem `md5 -q ./cert166.pem`.pem
-cp ./cert167.pem `md5 -q ./cert167.pem`.pem
-cp ./cert168.pem `md5 -q ./cert168.pem`.pem
-cp ./cert169.pem `md5 -q ./cert169.pem`.pem
-cp ./cert170.pem `md5 -q ./cert170.pem`.pem
-cp ./cert171.pem `md5 -q ./cert171.pem`.pem
-cp ./cert172.pem `md5 -q ./cert172.pem`.pem
-cp ./cert173.pem `md5 -q ./cert173.pem`.pem
-cp ./cert174.pem `md5 -q ./cert174.pem`.pem
-cp ./cert175.pem `md5 -q ./cert175.pem`.pem
-cp ./cert176.pem `md5 -q ./cert176.pem`.pem
-cp ./cert177.pem `md5 -q ./cert177.pem`.pem
-cp ./cert178.pem `md5 -q ./cert178.pem`.pem
-cp ./foo.sh `md5 -q ./foo.sh`.pem
 -----BEGIN CERTIFICATE-----
 MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x
 GTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJv
@@ -3012,136 +2830,6 @@ Wy10QJLZYxkNc91pvGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeT
 mJlglFwjz1onl14LBQaTNx47aTbrqZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK
 4SVhM7JZG+Ju1zdXtg2pEto=
 -----END CERTIFICATE-----
-cp . `md5 -q .`.pem
-cp ./cert000 `md5 -q ./cert000`.pem
-cp ./cert001 `md5 -q ./cert001`.pem
-cp ./cert002 `md5 -q ./cert002`.pem
-cp ./cert003 `md5 -q ./cert003`.pem
-cp ./cert004 `md5 -q ./cert004`.pem
-cp ./cert005 `md5 -q ./cert005`.pem
-cp ./cert006 `md5 -q ./cert006`.pem
-cp ./cert007 `md5 -q ./cert007`.pem
-cp ./cert008 `md5 -q ./cert008`.pem
-cp ./cert009 `md5 -q ./cert009`.pem
-cp ./cert010 `md5 -q ./cert010`.pem
-cp ./cert011 `md5 -q ./cert011`.pem
-cp ./cert012 `md5 -q ./cert012`.pem
-cp ./cert013 `md5 -q ./cert013`.pem
-cp ./cert014 `md5 -q ./cert014`.pem
-cp ./cert015 `md5 -q ./cert015`.pem
-cp ./cert016 `md5 -q ./cert016`.pem
-cp ./cert017 `md5 -q ./cert017`.pem
-cp ./cert018 `md5 -q ./cert018`.pem
-cp ./cert019 `md5 -q ./cert019`.pem
-cp ./cert020 `md5 -q ./cert020`.pem
-cp ./cert021 `md5 -q ./cert021`.pem
-cp ./cert022 `md5 -q ./cert022`.pem
-cp ./cert023 `md5 -q ./cert023`.pem
-cp ./cert024 `md5 -q ./cert024`.pem
-cp ./cert025 `md5 -q ./cert025`.pem
-cp ./cert026 `md5 -q ./cert026`.pem
-cp ./cert027 `md5 -q ./cert027`.pem
-cp ./cert028 `md5 -q ./cert028`.pem
-cp ./cert029 `md5 -q ./cert029`.pem
-cp ./cert030 `md5 -q ./cert030`.pem
-cp ./cert031 `md5 -q ./cert031`.pem
-cp ./cert032 `md5 -q ./cert032`.pem
-cp ./cert033 `md5 -q ./cert033`.pem
-cp ./cert034 `md5 -q ./cert034`.pem
-cp ./cert035 `md5 -q ./cert035`.pem
-cp ./cert036 `md5 -q ./cert036`.pem
-cp ./cert037 `md5 -q ./cert037`.pem
-cp ./cert038 `md5 -q ./cert038`.pem
-cp ./cert039 `md5 -q ./cert039`.pem
-cp ./cert040 `md5 -q ./cert040`.pem
-cp ./cert041 `md5 -q ./cert041`.pem
-cp ./cert042 `md5 -q ./cert042`.pem
-cp ./cert043 `md5 -q ./cert043`.pem
-cp ./cert044 `md5 -q ./cert044`.pem
-cp ./cert045 `md5 -q ./cert045`.pem
-cp ./cert046 `md5 -q ./cert046`.pem
-cp ./cert047 `md5 -q ./cert047`.pem
-cp ./cert048 `md5 -q ./cert048`.pem
-cp ./cert049 `md5 -q ./cert049`.pem
-cp ./cert050 `md5 -q ./cert050`.pem
-cp ./cert051 `md5 -q ./cert051`.pem
-cp ./cert052 `md5 -q ./cert052`.pem
-cp ./cert053 `md5 -q ./cert053`.pem
-cp ./cert054 `md5 -q ./cert054`.pem
-cp ./cert055 `md5 -q ./cert055`.pem
-cp ./cert056 `md5 -q ./cert056`.pem
-cp ./cert057 `md5 -q ./cert057`.pem
-cp ./cert058 `md5 -q ./cert058`.pem
-cp ./cert059 `md5 -q ./cert059`.pem
-cp ./cert060 `md5 -q ./cert060`.pem
-cp ./cert061 `md5 -q ./cert061`.pem
-cp ./cert062 `md5 -q ./cert062`.pem
-cp ./cert063 `md5 -q ./cert063`.pem
-cp ./cert064 `md5 -q ./cert064`.pem
-cp ./cert065 `md5 -q ./cert065`.pem
-cp ./cert066 `md5 -q ./cert066`.pem
-cp ./cert067 `md5 -q ./cert067`.pem
-cp ./cert068 `md5 -q ./cert068`.pem
-cp ./cert069 `md5 -q ./cert069`.pem
-cp ./cert070 `md5 -q ./cert070`.pem
-cp ./cert071 `md5 -q ./cert071`.pem
-cp ./cert072 `md5 -q ./cert072`.pem
-cp ./cert073 `md5 -q ./cert073`.pem
-cp ./cert074 `md5 -q ./cert074`.pem
-cp ./cert075 `md5 -q ./cert075`.pem
-cp ./cert076 `md5 -q ./cert076`.pem
-cp ./cert077 `md5 -q ./cert077`.pem
-cp ./cert078 `md5 -q ./cert078`.pem
-cp ./cert079 `md5 -q ./cert079`.pem
-cp ./cert080 `md5 -q ./cert080`.pem
-cp ./cert081 `md5 -q ./cert081`.pem
-cp ./cert082 `md5 -q ./cert082`.pem
-cp ./cert083 `md5 -q ./cert083`.pem
-cp ./cert084 `md5 -q ./cert084`.pem
-cp ./cert085 `md5 -q ./cert085`.pem
-cp ./cert086 `md5 -q ./cert086`.pem
-cp ./cert087 `md5 -q ./cert087`.pem
-cp ./cert088 `md5 -q ./cert088`.pem
-cp ./cert089 `md5 -q ./cert089`.pem
-cp ./cert090 `md5 -q ./cert090`.pem
-cp ./cert091 `md5 -q ./cert091`.pem
-cp ./cert092 `md5 -q ./cert092`.pem
-cp ./cert093 `md5 -q ./cert093`.pem
-cp ./cert094 `md5 -q ./cert094`.pem
-cp ./cert095 `md5 -q ./cert095`.pem
-cp ./cert096 `md5 -q ./cert096`.pem
-cp ./cert097 `md5 -q ./cert097`.pem
-cp ./cert098 `md5 -q ./cert098`.pem
-cp ./cert099 `md5 -q ./cert099`.pem
-cp ./cert100 `md5 -q ./cert100`.pem
-cp ./cert101 `md5 -q ./cert101`.pem
-cp ./cert102 `md5 -q ./cert102`.pem
-cp ./cert103 `md5 -q ./cert103`.pem
-cp ./cert104 `md5 -q ./cert104`.pem
-cp ./cert105 `md5 -q ./cert105`.pem
-cp ./cert106 `md5 -q ./cert106`.pem
-cp ./cert107 `md5 -q ./cert107`.pem
-cp ./cert108 `md5 -q ./cert108`.pem
-cp ./cert109 `md5 -q ./cert109`.pem
-cp ./cert110 `md5 -q ./cert110`.pem
-cp ./cert111 `md5 -q ./cert111`.pem
-cp ./cert112 `md5 -q ./cert112`.pem
-cp ./cert113 `md5 -q ./cert113`.pem
-cp ./cert114 `md5 -q ./cert114`.pem
-cp ./cert115 `md5 -q ./cert115`.pem
-cp ./cert116 `md5 -q ./cert116`.pem
-cp ./cert117 `md5 -q ./cert117`.pem
-cp ./cert118 `md5 -q ./cert118`.pem
-cp ./cert119 `md5 -q ./cert119`.pem
-cp ./cert120 `md5 -q ./cert120`.pem
-cp ./cert121 `md5 -q ./cert121`.pem
-cp ./cert122 `md5 -q ./cert122`.pem
-cp ./cert123 `md5 -q ./cert123`.pem
-cp ./cert124 `md5 -q ./cert124`.pem
-cp ./cert125 `md5 -q ./cert125`.pem
-cp ./cert126 `md5 -q ./cert126`.pem
-cp ./cert127 `md5 -q ./cert127`.pem
-cp ./foo.sh `md5 -q ./foo.sh`.pem
 -----BEGIN CERTIFICATE-----
 MIIEDzCCAvegAwIBAgIBATANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQGEwJTSzET
 MBEGA1UEBxMKQnJhdGlzbGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UE
@@ -4587,60 +4275,6 @@ zo9uoV1/A3U05K2JRVRevq4opbs/eHnrc7MKDf2+yfdWrPa37S+bISnHOLaVxATy
 wy39FCqQmbkHzJ8=
 -----END CERTIFICATE-----
 -----BEGIN CERTIFICATE-----
-MIIFijCCA3KgAwIBAgIQDHbanJEMTiye/hXQWJM8TDANBgkqhkiG9w0BAQUFADBf
-MQswCQYDVQQGEwJOTDESMBAGA1UEChMJRGlnaU5vdGFyMRowGAYDVQQDExFEaWdp
-Tm90YXIgUm9vdCBDQTEgMB4GCSqGSIb3DQEJARYRaW5mb0BkaWdpbm90YXIubmww
-HhcNMDcwNTE2MTcxOTM2WhcNMjUwMzMxMTgxOTIxWjBfMQswCQYDVQQGEwJOTDES
-MBAGA1UEChMJRGlnaU5vdGFyMRowGAYDVQQDExFEaWdpTm90YXIgUm9vdCBDQTEg
-MB4GCSqGSIb3DQEJARYRaW5mb0BkaWdpbm90YXIubmwwggIiMA0GCSqGSIb3DQEB
-AQUAA4ICDwAwggIKAoICAQCssFjBAL3YIQgLK5r+blYwBZ8bd5AQQVzDDYcRd46B
-8cp86Yxq7Th0Nbva3/m7wAk3tJZzgX0zGpg595NvlX89ubF1h7pRSOiLcD6VBMXY
-tsMW2YiwsYcdcNqGtA8Ui3rPENF0NqISe3eGSnnme98CEWilToauNFibJBN4ViIl
-HgGLS1Fx+4LMWZZpiFpoU8W5DQI3y0u8ZkqQfioLBQftFl9VkHXYRskbg+IIvvEj
-zJkd1ioPgyAVWCeCLvriIsJJsbkBgWqdbZ1Ad2h2TiEqbYRAhU52mXyC8/O3AlnU
-JgEbjt+tUwbRrhjd4rI6y9eIOI6sWym5GdOY+RgDz0iChmYLG2kPyes4iHomGgVM
-ktck1JbyrFIto0fVUvY//s6EBnCmqj6i8rZWNBhXouSBbefK8GrTx5FrAoNBfBXv
-a5pkXuPQPOWx63tdhvvL5ndJzaNl3Pe5nLjkC1+Tz8wwGjIczhxjlaX56uF0i57p
-K6kwe6AYHw4YC+VbqdPRbB4HZ4+RS6mKvNJmqpMBiLKR+jFc1abBUggJzQpjotMi
-puih2TkGl/VujQKQjBR7P4DNG5y6xFhyI6+2Vp/GekIzKQc/gsnmHwUNzUwoNovT
-yD4cxojvXu6JZOkd69qJfjKmadHdzIif0dDJZiHcBmfFlHqabWJMfczgZICynkeO
-owIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNV
-HQ4EFgQUiGi/4I41xDs4a2L3KDuEgcgM100wDQYJKoZIhvcNAQEFBQADggIBADsC
-jcs8MOhuoK3yc7NfniUTBAXT9uOLuwt5zlPe5JbF0a9zvNXD0EBVfEB/zRtfCdXy
-fJ9oHbtdzno5wozWmHvFg1Wo1X1AyuAe94leY12hE8JdiraKfADzI8PthV9xdvBo
-Y6pFITlIYXg23PFDk9Qlx/KAZeFTAnVR/Ho67zerhChXDNjU1JlWbOOi/lmEtDHo
-M/hklJRRl6s5xUvt2t2AC298KQ3EjopyDedTFLJgQT2EkTFoPSdE2+Xe9PpjRchM
-Ppj1P0G6Tss3DbpmmPHdy59c91Q2gmssvBNhl0L4eLvMyKKfyvBovWsdst+Nbwed
-2o5nx0ceyrm/KkKRt2NTZvFCo+H0Wk1Ya7XkpDOtXHAd3ODy63MUkZoDweoAZbwH
-/M8SESIsrqC9OuCiKthZ6SnTGDWkrBFfGbW1G/8iSlzGeuQX7yCpp/Q/rYqnmgQl
-nQ7KN+ZQ/YxCKQSa7LnPS3K94gg2ryMvYuXKAdNw23yCIywWMQzGNgeQerEfZ1jE
-O1hZibCMjFCz2IbLaKPECudpSyDOwR5WS5WpI2jYMNjD67BVUc3l/Su49bsRn1NU
-9jQZjHkJNsphFyUXC4KYcwx3dMPVDceoEkzHp1RxRy4sGn3J4ys7SN4nhKdjNrN9
-j6BkOSQNPXuHr2ZcdBtLc7LljPCGmbjlxd+Ewbfr
------END CERTIFICATE-----
------BEGIN CERTIFICATE-----
-MIIDujCCAqKgAwIBAgIEAJiWijANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJO
-TDEeMBwGA1UEChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSYwJAYDVQQDEx1TdGFh
-dCBkZXIgTmVkZXJsYW5kZW4gUm9vdCBDQTAeFw0wMjEyMTcwOTIzNDlaFw0xNTEy
-MTYwOTE1MzhaMFUxCzAJBgNVBAYTAk5MMR4wHAYDVQQKExVTdGFhdCBkZXIgTmVk
-ZXJsYW5kZW4xJjAkBgNVBAMTHVN0YWF0IGRlciBOZWRlcmxhbmRlbiBSb290IENB
-MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmNK1URF6gaYUmHFtvszn
-ExvWJw56s2oYHLZhWtVhCb/ekBPHZ+7d89rFDBKeNVU+LCeIQGv33N0iYfXCxw71
-9tV2U02PjLwYdjeFnejKScfST5gTCaI+Ioicf9byEGW07l8Y1Rfj+MX94p2i71MO
-hXeiD+EwR+4A5zN9RGcaC1Hoi6CeUJhoNFIfLm0B8mBF8jHrqTFoKbt6QZ7GGX+U
-tFE5A3+y3qcym7RHjm+0Sq7lr7HcsBthvJly3uSJt3omXdozSVtSnA71iq3DuD3o
-BmrC1SoLbHuEvVYFy4ZlkuxEK7COudxwC0barbxjiDn622r+I/q85Ej0ZytqERAh
-SQIDAQABo4GRMIGOMAwGA1UdEwQFMAMBAf8wTwYDVR0gBEgwRjBEBgRVHSAAMDww
-OgYIKwYBBQUHAgEWLmh0dHA6Ly93d3cucGtpb3ZlcmhlaWQubmwvcG9saWNpZXMv
-cm9vdC1wb2xpY3kwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSofeu8Y6R0E3QA
-7Jbg0zTBLL9s+DANBgkqhkiG9w0BAQUFAAOCAQEABYSHVXQ2YcG70dTGFagTtJ+k
-/rvuFbQvBgwp8qiSpGEN/KtcCFtREytNwiphyPgJWPwtArI5fZlmgb9uXJVFIGzm
-eafR2Bwp/MIgJ1HI8XxdNGdphREwxgDS1/PTfLbwMVcoEoJz6TMvplW0C5GUR5z6
-u3pCMuiufi3IvKwUv9kP2Vv8wfl6leF9fpb8cbDCTMjfRTTJzg3ynGQI0DvDKcWy
-7ZAEwbEpkcUwb8GpcjPM/l0WFywRaed+/sWDCN+83CI6LiBpIzlWYGeQiy52OfsR
-iJf2fL1LuCAWZwWN4jvBcj+UlTfHXbme2JOhF4//DGYVwSR8MnwDHTuhWEUykw==
------END CERTIFICATE-----
------BEGIN CERTIFICATE-----
 MIIDpDCCAoygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEc
 MBoGA1UEChMTQW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBP
 bmxpbmUgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAxMB4XDTAyMDUyODA2
@@ -5915,3 +5549,25 @@ na9aEhbKmVv8b20OxaAehsmR0FyYgl9jDIpaq9iVpszLita/ZEuOyoqysOkhMp6q
 qIWYNIE5ITuoOlIyPfZrN4YGWhWY3PARZv40ILcD9EEQfTmEeZZyY7aWAuVrua0Z
 TbvGRNs2yyqcjg==
 -----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDujCCAqKgAwIBAgIEAJiWijANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJO
+TDEeMBwGA1UEChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSYwJAYDVQQDEx1TdGFh
+dCBkZXIgTmVkZXJsYW5kZW4gUm9vdCBDQTAeFw0wMjEyMTcwOTIzNDlaFw0xNTEy
+MTYwOTE1MzhaMFUxCzAJBgNVBAYTAk5MMR4wHAYDVQQKExVTdGFhdCBkZXIgTmVk
+ZXJsYW5kZW4xJjAkBgNVBAMTHVN0YWF0IGRlciBOZWRlcmxhbmRlbiBSb290IENB
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmNK1URF6gaYUmHFtvszn
+ExvWJw56s2oYHLZhWtVhCb/ekBPHZ+7d89rFDBKeNVU+LCeIQGv33N0iYfXCxw71
+9tV2U02PjLwYdjeFnejKScfST5gTCaI+Ioicf9byEGW07l8Y1Rfj+MX94p2i71MO
+hXeiD+EwR+4A5zN9RGcaC1Hoi6CeUJhoNFIfLm0B8mBF8jHrqTFoKbt6QZ7GGX+U
+tFE5A3+y3qcym7RHjm+0Sq7lr7HcsBthvJly3uSJt3omXdozSVtSnA71iq3DuD3o
+BmrC1SoLbHuEvVYFy4ZlkuxEK7COudxwC0barbxjiDn622r+I/q85Ej0ZytqERAh
+SQIDAQABo4GRMIGOMAwGA1UdEwQFMAMBAf8wTwYDVR0gBEgwRjBEBgRVHSAAMDww
+OgYIKwYBBQUHAgEWLmh0dHA6Ly93d3cucGtpb3ZlcmhlaWQubmwvcG9saWNpZXMv
+cm9vdC1wb2xpY3kwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSofeu8Y6R0E3QA
+7Jbg0zTBLL9s+DANBgkqhkiG9w0BAQUFAAOCAQEABYSHVXQ2YcG70dTGFagTtJ+k
+/rvuFbQvBgwp8qiSpGEN/KtcCFtREytNwiphyPgJWPwtArI5fZlmgb9uXJVFIGzm
+eafR2Bwp/MIgJ1HI8XxdNGdphREwxgDS1/PTfLbwMVcoEoJz6TMvplW0C5GUR5z6
+u3pCMuiufi3IvKwUv9kP2Vv8wfl6leF9fpb8cbDCTMjfRTTJzg3ynGQI0DvDKcWy
+7ZAEwbEpkcUwb8GpcjPM/l0WFywRaed+/sWDCN+83CI6LiBpIzlWYGeQiy52OfsR
+iJf2fL1LuCAWZwWN4jvBcj+UlTfHXbme2JOhF4//DGYVwSR8MnwDHTuhWEUykw==
+-----END CERTIFICATE-----
-- 
cgit v1.2.3


From 2ae5e8db53e6d89e741cda0ce45e8cf65595bd16 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 21 Sep 2011 15:29:22 -0400
Subject: Added tag 3.0.5-start for changeset 92a3aa047754

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 10109c2e1e..491bf47e08 100644
--- a/.hgtags
+++ b/.hgtags
@@ -192,3 +192,4 @@ b95ddac176ac944efdc85cbee94ac2e1eab44c79 3.0.3-start
 6694f3f062aa45f64ab391d25a3eb3d5eb1b0871 3.0.3-beta1
 61aa7974df089e8621fe9a4c69bcdefdb3cc208a DRTVWR-89_3.0.3-beta2
 61aa7974df089e8621fe9a4c69bcdefdb3cc208a 3.0.3-beta2
+92a3aa04775438226399b19deee12ac3b5a62838 3.0.5-start
-- 
cgit v1.2.3


From f8442cef72dd35a713dd111ad7f055d696f4d7ae Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 21 Sep 2011 15:31:39 -0400
Subject: increment viewer version to 3.0.6

---
 indra/llcommon/llversionviewer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index ef55cfec89..a4b2e06908 100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
@@ -29,7 +29,7 @@
 
 const S32 LL_VERSION_MAJOR = 3;
 const S32 LL_VERSION_MINOR = 0;
-const S32 LL_VERSION_PATCH = 5;
+const S32 LL_VERSION_PATCH = 6;
 const S32 LL_VERSION_BUILD = 0;
 
 const char * const LL_CHANNEL = "Second Life Developer";
-- 
cgit v1.2.3


From a001a63a45feffb53dd8e30c87eb093afa196b1f Mon Sep 17 00:00:00 2001
From: "Debi King (Dessie)" <dessie@lindenlab.com>
Date: Wed, 21 Sep 2011 15:53:13 -0400
Subject: Added tag DRTVWR-84_3.0.3-release, 3.0.3-release for changeset
 0496d2f74043

---
 .hgtags | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.hgtags b/.hgtags
index cc9e7fc2c7..aa2aed3367 100644
--- a/.hgtags
+++ b/.hgtags
@@ -191,3 +191,5 @@ b95ddac176ac944efdc85cbee94ac2e1eab44c79 3.0.3-start
 6694f3f062aa45f64ab391d25a3eb3d5eb1b0871 3.0.3-beta1
 61aa7974df089e8621fe9a4c69bcdefdb3cc208a DRTVWR-89_3.0.3-beta2
 61aa7974df089e8621fe9a4c69bcdefdb3cc208a 3.0.3-beta2
+0496d2f74043cf4e6058e76ac3db03d44cff42ce DRTVWR-84_3.0.3-release
+0496d2f74043cf4e6058e76ac3db03d44cff42ce 3.0.3-release
-- 
cgit v1.2.3


From 2091ce3ae745b15c979e78f853eb0d1777efff18 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Wed, 21 Sep 2011 16:25:34 -0400
Subject: SH-2472 FIX - avoid accessing nonexistent texture entries in
 lineSegmentItersect

---
 indra/newview/llvovolume.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 mode change 100644 => 100755 indra/newview/llvovolume.cpp

diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
old mode 100644
new mode 100755
index 6b0a5d8642..380d63c77b
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -3579,7 +3579,7 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector3& start, const LLVector3& e
 		bool special_cursor = specialHoverCursor();
 		for (S32 i = start_face; i < end_face; ++i)
 		{
-			if (!special_cursor && !pick_transparent && getTE(i)->getColor().mV[3] == 0.f)
+			if (!special_cursor && !pick_transparent && getTE(i) && getTE(i)->getColor().mV[3] == 0.f)
 			{ //don't attempt to pick completely transparent faces unless
 				//pick_transparent is true
 				continue;
-- 
cgit v1.2.3


From 7d7d0e696a59b7af22abc5aed7cf4fd0bd7d4550 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 21 Sep 2011 18:01:44 -0400
Subject: STORM-1616: Change default initial mode to Advanced

---
 indra/newview/llappviewer.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 2e1108d42c..12795a1ec6 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2326,7 +2326,7 @@ bool LLAppViewer::initConfiguration()
 
 	if (gSavedSettings.getBOOL("FirstRunThisInstall"))
 	{
-		gSavedSettings.setString("SessionSettingsFile", "settings_minimal.xml");
+		gSavedSettings.setString("SessionSettingsFile", "settings.xml");
 		gSavedSettings.setBOOL("FirstRunThisInstall", FALSE);
 	}
 
-- 
cgit v1.2.3


From d63ba05e1dd226e2b8e0b610ed9134c934bf6612 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Wed, 21 Sep 2011 15:43:00 -0700
Subject: sync with viewer-development

---
 .../skins/default/xui/en/floater_fast_timers.xml   | 28 ++++++++++++++++++++++
 .../skins/default/xui/en/panel_main_inventory.xml  |  5 ++--
 .../default/xui/en/widgets/inventory_panel.xml     | 11 +++++----
 3 files changed, 37 insertions(+), 7 deletions(-)
 create mode 100644 indra/newview/skins/default/xui/en/floater_fast_timers.xml

diff --git a/indra/newview/skins/default/xui/en/floater_fast_timers.xml b/indra/newview/skins/default/xui/en/floater_fast_timers.xml
new file mode 100644
index 0000000000..49aa8f3840
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_fast_timers.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+ legacy_header_height="18"
+ can_minimize="false"
+ can_tear_off="false"
+ can_resize="true"
+ can_drag_on_left="false"
+ can_close="true"
+ height="500"
+ layout="topleft"
+ name="fast_timers"
+ save_rect="true"
+ save_visibility="false"
+ single_instance="true" 
+ min_width="400"
+ width="700">
+  <string name="pause" >Pause</string>
+  <string name="run">Run</string>
+  <button follows="top|right" 
+          name="pause_btn"
+          left="-200"
+          top="5"
+          width="180"
+          height="40"
+          pad_bottom="-5"
+          label="Pause"
+          font="SansSerifHuge"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
index 888230a00e..e6c5110999 100644
--- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
@@ -82,10 +82,11 @@
      left="0"
      name="All Items"
      sort_order_setting="InventorySortOrder"
-	 show_item_link_overlays="true"
+     show_item_link_overlays="true"
      top="16"
      width="288" />
     <recent_inventory_panel
+     accepts_drag_and_drop="false"
      bg_opaque_color="DkGray2"
      bg_alpha_color="DkGray2"
      background_visible="true"
@@ -99,7 +100,7 @@
      layout="topleft"
      left_delta="0"
      name="Recent Items"
-	 show_item_link_overlays="true"
+     show_item_link_overlays="true"
      width="290" />
   </tab_container>
   <layout_stack
diff --git a/indra/newview/skins/default/xui/en/widgets/inventory_panel.xml b/indra/newview/skins/default/xui/en/widgets/inventory_panel.xml
index 00f4c43915..eaf148c5e4 100644
--- a/indra/newview/skins/default/xui/en/widgets/inventory_panel.xml
+++ b/indra/newview/skins/default/xui/en/widgets/inventory_panel.xml
@@ -4,11 +4,12 @@
   background_visible="true"
   background_opaque="true"
   show_load_status="true"
+  accepts_drag_and_drop="true"
   >
     <scroll
-		name="Inventory Scroller"
-        follows="all"
-		reserve_scroll_corner="true"
-        tab_stop="true"
-        />
+      name="Inventory Scroller"
+      follows="all"
+      reserve_scroll_corner="true"
+      tab_stop="true"
+    />
 </panel>
-- 
cgit v1.2.3


From 7e4e4175ff9feae2a0f98a61c533edb9237947b3 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Thu, 22 Sep 2011 22:02:02 +0300
Subject: STORM-1620 FIXED Re-enabled saving settings.

Reason: settings.xml was mistakenly marked as a per session (not saved)
settings file. See description of the "SessionSettingsFile" setting.

Fix: It looks like the proper way to make the Advanced mode default
is to leave the setting value empty, which is what this change does.
It also re-fixes STORM-1616.
---
 indra/newview/llappviewer.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 12795a1ec6..11e2e1e607 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2326,7 +2326,7 @@ bool LLAppViewer::initConfiguration()
 
 	if (gSavedSettings.getBOOL("FirstRunThisInstall"))
 	{
-		gSavedSettings.setString("SessionSettingsFile", "settings.xml");
+		// Note that the "FirstRunThisInstall" settings is currently unused.
 		gSavedSettings.setBOOL("FirstRunThisInstall", FALSE);
 	}
 
-- 
cgit v1.2.3


From 94943e2c828c161358ceb62879b5a40db9738788 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Thu, 22 Sep 2011 18:08:17 -0700
Subject: sync with viewer-development

---
 .../skins/default/xui/en/floater_about_land.xml    |    8 +-
 .../skins/default/xui/en/floater_build_options.xml |    2 +-
 .../skins/default/xui/en/floater_model_preview.xml | 2002 ++++++++++++++------
 .../skins/default/xui/en/floater_model_wizard.xml  |   89 +-
 .../default/xui/en/floater_object_weights.xml      |  342 ++++
 .../newview/skins/default/xui/en/floater_tools.xml |   22 +-
 indra/newview/skins/default/xui/en/menu_viewer.xml |   12 +-
 .../skins/default/xui/en/panel_region_general.xml  |   12 +-
 indra/newview/skins/default/xui/en/strings.xml     |   10 +
 9 files changed, 1818 insertions(+), 681 deletions(-)
 create mode 100644 indra/newview/skins/default/xui/en/floater_object_weights.xml

diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml
index 07cb4c12f5..e5dcc9bcb5 100644
--- a/indra/newview/skins/default/xui/en/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/en/floater_about_land.xml
@@ -834,7 +834,7 @@
              name="Simulator primitive usage:"
              top_pad="4"
              width="364">
-               Primitive usage:
+               Region capacity:
             </text>
             <text
              type="string"
@@ -858,7 +858,7 @@
              name="Primitives parcel supports:"
              top="44"
              width="152">
-                Prims parcel supports:
+                Parcel land capacity:
             </text>
             <text
              type="string"
@@ -882,7 +882,7 @@
              name="Primitives on parcel:"
              top="64"
              width="152">
-                Prims on parcel:
+                Parcel land impact:
             </text>
             <text
              type="string"
@@ -2179,4 +2179,4 @@ Only large parcels can be listed in search.
              </panel>
         </panel>
     </tab_container>
-</floater>
\ No newline at end of file
+</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_build_options.xml b/indra/newview/skins/default/xui/en/floater_build_options.xml
index afb7917043..c247a12e7a 100644
--- a/indra/newview/skins/default/xui/en/floater_build_options.xml
+++ b/indra/newview/skins/default/xui/en/floater_build_options.xml
@@ -37,7 +37,7 @@
      layout="topleft"
      left="10"
      tool_tip="Grid opacity"
-     name="grid_mode_label"
+     name="grid_opacity_label"
      top_pad="30"
      width="123">
         Mode
diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index 1d4a1d4827..2eea286c8b 100644
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater can_close="true" can_drag_on_left="false" can_minimize="false"
-     can_resize="true" height="550" min_height="550" min_width="620"
-     name="Model Preview" title="Upload Model" width="620"
+     can_resize="false" height="480" min_height="480" min_width="940"
+     name="Model Preview" title="Upload Model" width="940"
       help_topic="upload_model" >
 
-  <string name="status_idle">Idle</string>
-  <string name="status_parse_error">Dae parsing issue - see log for details.</string>
+  <string name="status_idle"></string>
+  <string name="status_parse_error">Error: Dae parsing issue - see log for details.</string>
   <string name="status_reading_file">Loading...</string>
   <string name="status_generating_meshes">Generating Meshes...</string>
   <string name="status_vertex_number_overflow">Error: Vertex number is more than 65534, aborted!</string>
@@ -21,615 +21,1409 @@
   <string name="mesh_status_mesh_mismatch">Levels of detail have a different number of mesh instances.</string>
   <string name="mesh_status_too_many_vertices">Level of detail has too many vertices.</string>
   <string name="mesh_status_missing_lod">Missing required level of detail.</string>
+  <string name="mesh_status_invalid_material_list">LOD materials are not a subset of reference model.</string>
   <string name="layer_all">All</string> <!-- Text to display in physics layer combo box for "all layers" -->
   <string name="decomposing">Analyzing...</string>
   <string name="simplifying">Simplifying...</string>
   <string name="tbd">TBD</string>
-  
-
-  <text left="15" bottom="25" follows="top|left" height="15" name="name_label">
-    Name:
-  </text>
-  <line_editor bottom_delta="20" follows="top|left|right" height="19" max_length_bytes="64" 
-	     name="description_form" prevalidate_callback="ascii" width="290" />
-  
-  <text bottom_delta="20" left="15" follows="left|top" height="15" name="lod_label">
-    Preview:
-  </text>
-  <combo_box bottom_delta="20" follows="left|top" height="18"
-	     name="preview_lod_combo" width="240" tool_tip="LOD to view in preview render">
-    <combo_item name="high">
-      Level of Detail: High
-    </combo_item>
-    <combo_item name="medium">
-      Level of Detail: Medium
-    </combo_item>
-    <combo_item name="low">
-      Level of Detail: Low
-    </combo_item>
-    <combo_item name="lowest">
-      Level of Detail: Lowest
-    </combo_item>
-  </combo_box>
-
-    <menu_button follows="top|left" 
-         image_hover_unselected="Toolbar_Left_Over"
-         image_overlay="OptionsMenu_Off"
-         image_selected="Toolbar_Left_Selected"
-         image_unselected="Toolbar_Left_Off"
-         layout="topleft"
-         left_pad="5"
-         name="options_gear_btn"
-         width="31"
-         height="25"/>
-  <!-- Placeholder panel for 3D preview render -->
-  <panel
-    name="preview_panel"
-    left="15"
-    bevel_style="none"
-    border_style="line"
-    border="true"
-    width="290"
-    height="290"
-    follows="all"/>
-    
-    <text
-     font="SansSerif"
-	 bottom_delta="15"
-     left_delta="0"
-     name="warning_title"
-     text_color="Yellow"
-     visible="false">
-     WARNING:
-    </text>
-    <text
-     text_color="White"
-     height="40"
-	 width="290"
-	 top_delta="15"
-     left_delta="0"
-     name="warning_message"
-     parse_urls="true"
-     wrap="true"
-     visible="false">
-     You will not be able to complete the final upload of this model to the Second Life servers. [[VURL] Find out how] to get enabled for mesh model uploads.</text>
-
-  <text
-	height="65"
-	top_delta="45"
-	left_delta="0"
-	name="weights_text"
-	width="80"
-	word_wrap="true" 
-	>
-Download:
-Physics:
-Server:
-
-Prim equivs:
-  </text>
-
-  <text
-	height="65"
-	top_delta="0"
-	left_delta="80"
-	name="weights"
-	width="70"
-	word_wrap="true" 
-	>
-[ST]
-[PH]
-[SIM]
-
-[EQ]
-  </text>
-
-<!--
-  <text
-	height="65"
-	top_delta="0"
-	left_delta="70"
-	name="price_breakdown_text"
-	width="80"
-	word_wrap="true" 
-	>
-Streaming:
-Physics:
-Instances:
-Textures:
-Model:
-  </text>
-
-  <text
-	height="65"
-	top_delta="0"
-	left_delta="80"
-	name="price_breakdown"
-	width="65"
-	word_wrap="true" 
-	>
-L$ [STREAMING]
-L$ [PHYSICS]
-L$ [INSTANCES]
-L$ [TEXTURES]
-L$ [MODEL]
-  </text>
-    -->
 
-  <tab_container
-    follows="right|top|bottom"
-    top="15"
-    left="310"
-    height="470"
-    width="300"
-    name="import_tab"
-    border="true"
-    tab_position="top">
-
-    <!-- LOD PANEL -->
+<panel
+  follows="top|left"
+  height="455"
+  layout="topleft"
+  left="3"
+  name="left_panel"
+  top_pad="10"
+  width="630">
     <panel
-      border="true"
-      label="Level of Detail"
-      name="lod_panel"
-      help_topic="upload_model_lod">
-
-      <text left="10" width="240" bottom="20" height="15" follows="left|top" name="lod_table_header">
-        Select Level of Detail:
-      </text>
-     
-      <text valign="center" halign="center" bg_visible="true" bottom_delta="16" left="75" width="65" height="18" follows="left|top" value="Triangles"/>
-      <text valign="center" halign="center" bg_visible="true" left_pad="0" width="65" height="18" follows="left|top" value="Vertices"/>
-      <text valign="center" halign="center" left_pad="0" width="65" bg_visible="true" height="18" follows="left|top" value="Status"/>
-      
-      <text valign="center" halign="center" bg_visible="true" name="high_label" left="10" top_pad="0" width="65" height="18" follows="left|top" value="High"/>
-      <text valign="center" halign="center" bg_visible="true" name="high_triangles" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-      <text valign="center" halign="center" bg_visible="true" name="high_vertices" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-      <text valign="center" halign="center" bg_visible="true" name="high_status" left_pad="0" width="65" height="18" follows="left|top" value=""/>
-      <icon height="16" width="16" image_name="lag_status_critical.tga" mouse_opaque="true" name="status_icon_high" left_delta="20" top_delta="0" />
-
-      <text valign="center" halign="center" bg_visible="true" name="medium_label" left="10" top_pad="0" width="65" height="18" follows="left|top" value="Medium"/>
-      <text valign="center" halign="center" bg_visible="true" name="medium_triangles" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-      <text valign="center" halign="center" bg_visible="true" name="medium_vertices" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-      <text valign="center" halign="center" bg_visible="true" name="medium_status" left_pad="0" width="65" height="18" follows="left|top" value=""/>
-      <icon height="16" width="16" image_name="lag_status_critical.tga" mouse_opaque="true" name="status_icon_medium" left_delta="20" top_delta="0" />
-
-      <text valign="center" halign="center" bg_visible="true" name="low_label" left="10" top_pad="0" width="65" height="18" follows="left|top" value="Low"/>
-      <text valign="center" halign="center" bg_visible="true" name="low_triangles" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-      <text valign="center" halign="center" bg_visible="true" name="low_vertices" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-      <text valign="center" halign="center" bg_visible="true" name="low_status" left_pad="0" width="65" height="18" follows="left|top" value=""/>
-      <icon height="16" width="16" image_name="lag_status_critical.tga" mouse_opaque="true" name="status_icon_low" left_delta="20" top_delta="0" />
-
-      <text valign="center" halign="center" bg_visible="true" name="lowest_label" left="10" top_pad="0" width="65" height="18" follows="left|top" value="Lowest"/>
-      <text valign="center" halign="center" bg_visible="true" name="lowest_triangles" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-      <text valign="center" halign="center" bg_visible="true" name="lowest_vertices" left_pad="0" width="65" height="18" follows="left|top" value="0"/>
-      <text valign="center" halign="center" bg_visible="true" name="lowest_status" left_pad="0" width="65" height="18" follows="left|top" value=""/>
-      <icon height="16" width="16" image_name="lag_status_critical.tga" mouse_opaque="true" name="status_icon_lowest" left_delta="20" top_delta="0" />
-      
-      <text left="10" width="240" height="15" top_pad="15" follows="left|top" name="lod_table_footer">
-        Level of Detail: [DETAIL]
-      </text>
-
-      <icon height="16" width="16" left="20" follows="left|top" name="lod_status_message_icon"/>
-      <text left_pad="5" width="200" height="28" follows="left|top" top_pad="-15" wrap="true" name="lod_status_message_text"/>
-
-      <text top_pad="-3" left="10" height="15" follows="left|top">
-        Mesh
-      </text>
-
-      <radio_group follows="top|left" height="210" left="30" name="lod_file_or_limit" width="240" value="lod_from_file">
-        <radio_item bottom="195" label="Load from file" name="lod_from_file"/>
-        <radio_item bottom="150" label="Auto generate" name="lod_auto_generate"/>
-        <radio_item bottom="0" label="None" name="lod_none"/>
-      </radio_group>
-
-      <line_editor follows="left|top" bottom_delta="-170" width="140" left="45" value="" name="lod_file" height="20"/>
-      <button bottom_delta="3" name="lod_browse" label="Browse..." left_pad="5" follows="left|top" width="70" height="25"/>
-
-      <combo_box follows="top|left" name="lod_mode" top_pad="22" width="100" left="45" height="20">
-        <combo_item name="triangle_limit">
-          Triangle Limit
-        </combo_item>
-        <combo_item name="error_threshold">
-          Error Threshold
-        </combo_item>
-      </combo_box>
-      <spinner follows="top|left" name="lod_triangle_limit" increment="10" left_pad="5" height="20" width="100" decimal_digits="0" enabled="true"/>
-      <spinner left_delta="0" bottom_delta="0" increment="0.01"  follows="top|left" name="lod_error_threshold" min_val="0" max_val="100" height="20" width="100" decimal_digits="3" visible="false" enabled="true"/>
-
-      <text follows="top|left" name="build_operator_text" left="45" top_pad="10" width="100" height="15">
-        Build Operator:  
-      </text>
-      <text follows="top|left" name="queue_mode_text" left_pad="5" width="100" height="15">
-        Queue Mode:
-      </text>
-      <combo_box follows="top|left" name="build_operator" top_pad="5" left="45" width="100" height="20">
-        <combo_item name="edge_collapse">
-          Edge Collapse
-        </combo_item>
-        <combo_item name="half_edge_collapse">
-          Half Edge Collapse
-        </combo_item>
-      </combo_box>
-
-      <combo_box follows="top|left" name="queue_mode" left_pad="5" width="100" height="20">
-        <combo_item name="greedy">
-          Greedy
-        </combo_item>
-        <combo_item name="lazy">
-          Lazy
-        </combo_item>
-        <combo_item name="independent">
-          Independent
-        </combo_item>
-      </combo_box>
-
-      <text top_pad="10" name="border_mode_text" left="45" follows="left|top" width="100" height="15">
-        Border Mode:
-      </text>
-
-      <text left_pad="5" name="share_tolderance_text"  follows="left|top" width="100" height="15">
-        Share Tolerance:
-      </text>
-
-      <combo_box follows="left|top" left="45" height="20" name="border_mode" width="100">
-        <combo_item name="border_unlock">
-          Unlock
-        </combo_item>
-        <combo_item name="border_lock">
-          Lock
-        </combo_item>
-      </combo_box>
-      <spinner follows="left|top" name="share_tolerance" left_pad="5" width="100" decimal_digits="5" initial_value="0.00001" height="20"/>
-             
-      <text left="10" top_pad="35" follows="top|left" width="240" height="15">
-        Generate Normals
-      </text>
-      <text left="35" top_pad="5" follows="top|left" width="100" height="15" name="crease_label">
-        Crease Angle:
-      </text>
-      <spinner follows="top|left" left_pad="5" min_val="0" max_val="180" value="75" width="60" height="20" name="crease_angle"/>  
-    </panel>
-
-    <!--  PANEL -->
-    <panel
-      border="true"
-      label="Physics"
-      name="physics_panel"
-      help_topic="upload_model_physics">
-
-      <!-- PHYSICS GEOMETRY-->
-      <panel
-        follows="top|left"
-        name="physics geometry"
-        left="0"
-        top="0"
-        width="300"
-        height="65"
-        visible="true"
-        border="true"
-        bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
-
-        <radio_group follows="top|left" top="10" width="240" height="40" name="physics_load_radio" value="physics_load_from_file">
-          <radio_item bottom="0" name="physics_load_from_file" label="File:"/>
-          <radio_item bottom="23" name="physics_use_lod" label="Use Level of Detail:"/>
-        </radio_group>
-
-        <combo_box left="180" top="10" follows="left|top" height="18"
-	        name="physics_lod_combo" width="110" tool_tip="LOD to use for physics shape">
-          <combo_item name="physics_lowest">
-            Lowest
-          </combo_item>
-          <combo_item name="physics_low">
-            Low
-          </combo_item>
-          <combo_item name="physics_medium">
-            Medium
-          </combo_item>
-          <combo_item name="physics_high">
-            High
-          </combo_item>
-        </combo_box>
-
-        <line_editor follows="left|top" top_pad="5" width="140" left="60" value="" name="physics_file" height="20"/>
-        <button left_pad="10" name="physics_browse" label="Browse..." follows="left|top" width="70" height="20"/>
-
-        <!--
-        <check_box name="physics_optimize" follows="left|top" width="130" left="10" top_pad="5" height="20" label="Optimize"/>
-        <check_box name="physics_use_hull" follows="left|top" width="130" left_pad="5" height="20" label="Use Convex Hull"/>
-        -->
-     </panel>
-
-
-      <!-- PHYSICS ANALYSIS-->
-      <panel
-       follows="top|left"
-       name="physics analysis"
-       top_pad="0"
-       left="0"
-       width="300"
-       height="130"
-       visible="true"
-       border="true"
-       bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
-
-        <text follows="left|top" bottom="40" height="30" left="10" font="SansSerifBig">
-          Step 1: Analysis
+      follows="all"
+      height="50"
+      layout="top|left"
+      left="3"
+      name="model_name_representation_panel"
+      width="525">
+        <text
+          follows="top|left"
+          layout="topleft"
+          height="15"
+          left="15"
+          name="name_label"
+          text_color="White"
+          top="0"
+          width="290">
+          Model name:
         </text>
-        
-        <text top_pad="5" width="50" follows="top|left" height="15">
-          Method:
+        <line_editor
+          follows="top|left"
+          layout="topleft"
+          height="19"
+          max_length_bytes="64"
+          name="description_form"
+          prevalidate_callback="ascii"
+          top_pad="5"
+          width="290" />
+        <text
+          follows="left|top"
+          height="15"
+          layout="topleft"
+          left_pad="15"
+          name="model_category_label"
+          text_color="White"
+          top="0"
+          width="200">
+          This model represents...
         </text>
-        <combo_box name="Method" follows="top|left" left_pad="5" bottom_delta="2" height="20" width="80"/>
-        <text left="160" bottom_delta="-2" width="50" follows="top|left" height="15">
-          Quality:
-        </text>
-        <combo_box name="Decompose Quality" bottom_delta="2" follows="top|left" left_pad="5" height="20" width="80"/>
-
-        <slider name="Smooth" left="10" width="280" follows="top|left" top_pad="10" height="20" label="Smooth:"/>
-
-        <check_box name="Close Holes (Slow)" follows="top|left" top_pad="10" height="15" label="Close Holes (slow)"/>
-                
-        <button left="200" bottom_delta="0" width="90" follows="top|left" label="Analyze" name="Decompose" height="20"/>
-        <button left="200" bottom_delta="0" width="90" follows="top|left" label="Cancel" name="decompose_cancel" visble="false" height="20"/>
-      </panel>
-      
-
-      <!-- PHYSICS SIMPLIFICATION -->
-     <panel
-       follows="top|left"
-       name="physics simplification"
-       left="0"
-       top_pad="0"
-       width="300"
-       height="150"
-       visible="true"
-       border="true"
-       bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
-
-        <text follows="left|top" bottom="40" height="30" left="10" font="SansSerifBig">
-          Step 2: Simplification
-        </text>
-
-        <text left="10" top_pad="5" height="15" width="140" follows="top|left">
-          Method:
-        </text>
-        
-        <combo_box left_pad="5" height="20" width="120" follows="top|left" name="Simplify Method"/>
-
-        <slider left="10" name="Combine Quality" label="Passes:" label_width="120" width="270" follows="top|left" top_pad="10" height="20"/>
-        <slider name="Detail Scale" label="Detail Scale:" label_width="120" width="270" follows="top|left" top_pad="10" height="20"/>
-        <slider name="Retain%" label="Retain:" label_width="120" width="270" follows="top|left" bottom_delta="0" left_delta="0" visible="false" height="20"/>
-        <button left="190" width="90" follows="top|left" label="Simplify" name="Simplify" height="20"/>
-        <button left="190" bottom_delta="0" width="90" follows="top|left" label="Cancel" name="simplify_cancel" height="20"/>
-        
-      </panel>
-
-      <!-- INFO PANEL -->
-      <panel
-        left="0"
-        top_pad="0"
-        width="300"
-        height="100"
-        follows="left|top"
-        name="physics info"
-        visible="true"
-        border="true" 
-        bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
-
-        <slider name="physics_explode" follows="top|left" top="10" left="10" label="Preview Spread:" min_val="0.0" max_val="3.0" height="20" width="280"/>
-        
-        <text follows="top|left" name="physics_triangles" top_pad="10" height="15" left="10">
-          Triangles: [TRIANGLES]
-        </text>
-        <text follows="top|left" name="physics_points" top_pad="5" height="15">
-          Vertices: [POINTS]
-        </text>
-        <text follows="top|left" name="physics_hulls" top_pad="5" height="15">
-          Hulls: [HULLS]
-        </text>
-
-
-      </panel>
+        <combo_box
+          follows="left|top"
+          height="23"
+          left_pad="10"
+          name="model_category_combo"
+          top_pad="10"
+          width="200">
+        <combo_box.drop_down_button
+          label_color="White"/>
+          <combo_item name="Choose one" label="Choose One..." value="MUT_Unspecified"/>
+          <combo_item name="Avatar shape" label="Avatar shape" value="MUT_AvatarShape"/>
+          <combo_item name="Avatar attachment" label="Avatar attachment" value="MUT_AvatarAttachment"/>
+          <combo_item name="Moving object (vehicle, animal)" label="Moving object (vehicle, animal)" value="MUT_MovingObject"/>
+          <combo_item name="Building Component" label="Building Component" value="MUT_BuildingComponent"/>
+          <combo_item name="Large, non moving etc" label="Large, non moving etc" value="MUT_LargeStationary"/>
+          <combo_item name="Smaller, non-moving etc" label="Smaller, non-moving etc" value="MUT_SmallStationary"/>
+          <combo_item name="Not really any of these" label="Not really any of these" value="MUT_Other"/>
+         </combo_box>
     </panel>
-
-    <!-- MODIFIERS PANEL -->
+    <tab_container
+      follows="top|left"
+      top_pad="15"
+      left="0"
+      height="300"
+      width="625"
+      name="import_tab"
+      tab_position="top">
+      <!-- LOD PANEL -->
+        <panel
+         help_topic="upload_model_lod"
+         label="Level of Detail"
+         layout="topleft"
+         name="lod_panel"
+         title="Level of Detail">
+            <view_border
+             bevel_style="none"
+             follows="top|left"
+             height="275"
+             layout="topleft"
+             left="3"
+             name="lod_tab_border"
+             top_pad="0"
+             width="619" />
+            <text
+             follows="left|top"
+             height="18"
+             initial_value="Source"
+             layout="topleft"
+             left="75"
+             name="source"
+             text_color="ModelUploaderLabels"
+             top="15"
+             valign="center"
+             value="Source"
+             width="335" />
+            <text
+             follows="left|top"
+             halign="right"
+             height="18"
+             initial_value="Triangles"
+             layout="topleft"
+             left_pad="0"
+             name="triangles"
+             text_color="ModelUploaderLabels"
+             top_delta="0"
+             valign="center"
+             value="Triangles"
+             width="65" />
+            <text
+             follows="left|top"
+             halign="right"
+             height="18"
+             initial_value="Vertices"
+             layout="topleft"
+             left_pad="0"
+             name="vertices"
+             text_color="ModelUploaderLabels"
+             valign="center"
+             value="Vertices"
+             width="65" />
+            <text
+             follows="left|top"
+             height="18"
+             initial_value="High"
+             layout="topleft"
+             left="10"
+             name="high_label"
+             text_color="ModelUploaderLabels"
+             top_pad="10"
+             valign="center"
+             value="High"
+             width="65" />
+            <combo_box
+             follows="top|left"
+             height="20"
+             layout="topleft"
+             left_pad="0"
+             name="lod_source_high"
+             top_delta="-3"
+             width="135">
+                <item
+                 id="Load from file"
+                 value="Load from file" />
+                <item
+                 id="Generate"
+                 value="Generate" />
+            </combo_box>
+            <line_editor
+             follows="left|top"
+             height="20"
+             initial_value=""
+             layout="topleft"
+             left_pad="5"
+             name="lod_file_high"
+             top_delta="0"
+             value=""
+             width="120" />
+            <button
+             follows="left|top"
+             height="20"
+             label="Browse..."
+             layout="topleft"
+             left_pad="5"
+             name="lod_browse_high"
+             top_delta="0"
+             width="70" />
+            <combo_box
+             follows="top|left"
+             height="20"
+             layout="topleft"
+             left="215"
+             name="lod_mode_high"
+             top_delta="0"
+             visible="false"
+             width="135">
+                <item
+                 id="Triangle Limit"
+                 value="Triangle Limit" />
+                <item
+                 id="Error Threshold"
+                 value="Error Threshold" />
+            </combo_box>
+            <spinner
+             decimal_digits="0"
+             follows="top|left"
+             height="20"
+             increment="10"
+             layout="topleft"
+             left_pad="5"
+             name="lod_triangle_limit_high"
+             visible="false"
+             width="55" />
+            <spinner
+             follows="top|left"
+             height="20"
+             increment="0.01"
+             layout="topleft"
+             left_delta="0"
+             max_val="100"
+             name="lod_error_threshold_high"
+             top_delta="0"
+             visible="false"
+             width="55" />
+            <text
+             follows="left|top"
+             halign="right"
+             height="18"
+             initial_value="0"
+             layout="topleft"
+             left_pad="0"
+             name="high_triangles"
+             valign="center"
+             value="0"
+             width="65" />
+            <text
+             follows="left|top"
+             halign="right"
+             height="18"
+             initial_value="0"
+             layout="topleft"
+             left_pad="0"
+             name="high_vertices"
+             valign="center"
+             value="0"
+             width="65" />
+            <text
+             follows="left|top"
+             halign="center"
+             height="18"
+             initial_value=""
+             layout="topleft"
+             left_pad="0"
+             name="high_status"
+             valign="center"
+             value=""
+             width="65" />
+            <icon
+             height="16"
+             image_name="red_x.png"
+             layout="topleft"
+             left_delta="20"
+             mouse_opaque="true"
+             name="status_icon_high"
+             top_delta="0"
+             width="16" />
+            <text
+             follows="left|top"
+             height="18"
+             initial_value="Medium"
+             layout="topleft"
+             left="10"
+             name="medium_label"
+             text_color="ModelUploaderLabels"
+             top_pad="15"
+             valign="center"
+             value="Medium"
+             width="65" />
+            <combo_box
+             follows="top|left"
+             height="20"
+             layout="topleft"
+             left_pad="0"
+             name="lod_source_medium"
+             top_delta="-3"
+             width="135">
+                <item
+                 id="Load from file"
+                 value="Load from file" />
+                <item
+                 id="Generate"
+                 value="Generate" />
+                <item
+                 id="Use LoD above"
+                 value="Use LoD above" />
+            </combo_box>
+            <line_editor
+             follows="left|top"
+             height="20"
+             initial_value=""
+             layout="topleft"
+             left_pad="5"
+             name="lod_file_medium"
+             top_delta="0"
+             value=""
+             visible="false"
+             width="120" />
+            <button
+             follows="left|top"
+             height="20"
+             label="Browse..."
+             layout="topleft"
+             left_pad="5"
+             name="lod_browse_medium"
+             top_delta="0"
+             visible="false"
+             width="70" />
+            <combo_box
+             follows="top|left"
+             height="20"
+             layout="topleft"
+             left="215"
+             name="lod_mode_medium"
+             top_delta="0"
+             width="135">
+                <item
+                 id="Triangle Limit"
+                 value="Triangle Limit" />
+                <item
+                 id="Error Threshold"
+                 value="Error Threshold" />
+            </combo_box>
+            <spinner
+             decimal_digits="0"
+             follows="top|left"
+             height="20"
+             increment="10"
+             layout="topleft"
+             left_pad="5"
+             name="lod_triangle_limit_medium"
+             width="55" />
+            <spinner
+             follows="top|left"
+             height="20"
+             increment="0.01"
+             layout="topleft"
+             left_delta="0"
+             max_val="100"
+             name="lod_error_threshold_medium"
+             top_delta="0"
+             visible="false"
+             width="55" />
+            <text
+             follows="left|top"
+             halign="right"
+             height="18"
+             initial_value="0"
+             layout="topleft"
+             left_pad="0"
+             name="medium_triangles"
+             valign="center"
+             value="0"
+             width="65" />
+            <text
+             follows="left|top"
+             halign="right"
+             height="18"
+             initial_value="0"
+             layout="topleft"
+             left_pad="0"
+             name="medium_vertices"
+             valign="center"
+             value="0"
+             width="65" />
+            <text
+             follows="left|top"
+             halign="center"
+             height="18"
+             initial_value=""
+             layout="topleft"
+             left_pad="0"
+             name="medium_status"
+             valign="center"
+             value=""
+             width="65" />
+            <icon
+             height="16"
+             image_name="red_x.png"
+             layout="topleft"
+             left_delta="20"
+             mouse_opaque="true"
+             name="status_icon_medium"
+             top_delta="0"
+             width="16" />
+            <text
+             follows="left|top"
+             height="18"
+             initial_value="Low"
+             layout="topleft"
+             left="10"
+             name="low_label"
+             text_color="ModelUploaderLabels"
+             top_pad="15"
+             valign="center"
+             value="Low"
+             width="65" />
+            <combo_box
+             follows="top|left"
+             height="20"
+             layout="topleft"
+             left_pad="0"
+             name="lod_source_low"
+             top_delta="-3"
+             width="135">
+                <item
+                 id="Load from file"
+                 value="Load from file" />
+                <item
+                 id="Generate"
+                 value="Generate" />
+                <item
+                 id="Use LoD above"
+                 value="Use LoD above" />
+            </combo_box>
+            <line_editor
+             follows="left|top"
+             height="20"
+             initial_value=""
+             layout="topleft"
+             left_pad="5"
+             name="lod_file_low"
+             top_delta="0"
+             value=""
+             visible="false"
+             width="120" />
+            <button
+             follows="left|top"
+             height="20"
+             label="Browse..."
+             layout="topleft"
+             left_pad="5"
+             name="lod_browse_low"
+             top_delta="0"
+             visible="false"
+             width="70" />
+            <combo_box
+             follows="top|left"
+             height="20"
+             layout="topleft"
+             left="215"
+             name="lod_mode_low"
+             top_delta="0"
+             width="135">
+                <item
+                 id="Triangle Limit"
+                 value="Triangle Limit" />
+                <item
+                 id="Error Threshold"
+                 value="Error Threshold" />
+            </combo_box>
+            <spinner
+             decimal_digits="0"
+             follows="top|left"
+             height="20"
+             increment="10"
+             layout="topleft"
+             left_pad="5"
+             name="lod_triangle_limit_low"
+             width="55" />
+            <spinner
+             follows="top|left"
+             height="20"
+             increment="0.01"
+             layout="topleft"
+             left_delta="0"
+             max_val="100"
+             name="lod_error_threshold_low"
+             top_delta="0"
+             visible="false"
+             width="55" />
+            <text
+             follows="left|top"
+             halign="right"
+             height="18"
+             initial_value="0"
+             layout="topleft"
+             left_pad="0"
+             name="low_triangles"
+             valign="center"
+             value="0"
+             width="65" />
+            <text
+             follows="left|top"
+             halign="right"
+             height="18"
+             initial_value="0"
+             layout="topleft"
+             left_pad="0"
+             name="low_vertices"
+             valign="center"
+             value="0"
+             width="65" />
+            <text
+             follows="left|top"
+             halign="center"
+             height="18"
+             initial_value=""
+             layout="topleft"
+             left_pad="0"
+             name="low_status"
+             valign="center"
+             value=""
+             width="65" />
+            <icon
+             height="16"
+             image_name="red_x.png"
+             layout="topleft"
+             left_delta="20"
+             mouse_opaque="true"
+             name="status_icon_low"
+             top_delta="0"
+             width="16" />
+            <text
+             follows="left|top"
+             height="18"
+             initial_value="Lowest"
+             layout="topleft"
+             left="10"
+             name="lowest_label"
+             text_color="ModelUploaderLabels"
+             top_pad="15"
+             valign="center"
+             value="Lowest"
+             width="65" />
+            <combo_box
+             follows="top|left"
+             height="20"
+             layout="topleft"
+             left_pad="0"
+             name="lod_source_lowest"
+             top_delta="-3"
+             width="135">
+                <item
+                 id="Load from file"
+                 value="Load from file" />
+                <item
+                 id="Generate"
+                 value="Generate" />
+                <item
+                 id="Use LoD above"
+                 value="Use LoD above" />
+            </combo_box>
+            <line_editor
+             follows="left|top"
+             height="20"
+             initial_value=""
+             layout="topleft"
+             left_pad="5"
+             name="lod_file_lowest"
+             top_delta="0"
+             value=""
+             visible="false"
+             width="120" />
+            <button
+             follows="left|top"
+             height="20"
+             label="Browse..."
+             layout="topleft"
+             left_pad="5"
+             name="lod_browse_lowest"
+             top_delta="0"
+             visible="false"
+             width="70" />
+            <combo_box
+             follows="top|left"
+             height="20"
+             layout="topleft"
+             left="215"
+             name="lod_mode_lowest"
+             top_delta="0"
+             width="135">
+                <item
+                 id="Triangle Limit"
+                 value="Triangle Limit" />
+                <item
+                 id="Error Threshold"
+                 value="Error Threshold" />
+            </combo_box>
+            <spinner
+             decimal_digits="0"
+             follows="top|left"
+             height="20"
+             increment="10"
+             layout="topleft"
+             left_pad="5"
+             name="lod_triangle_limit_lowest"
+             width="55" />
+            <spinner
+             follows="top|left"
+             height="20"
+             increment="0.01"
+             layout="topleft"
+             left_delta="0"
+             max_val="100"
+             name="lod_error_threshold_lowest"
+             top_delta="0"
+             visible="false"
+             width="55" />
+            <text
+             follows="left|top"
+             halign="right"
+             height="18"
+             initial_value="0"
+             layout="topleft"
+             left_pad="0"
+             name="lowest_triangles"
+             valign="center"
+             value="0"
+             width="65" />
+            <text
+             follows="left|top"
+             halign="right"
+             height="18"
+             initial_value="0"
+             layout="topleft"
+             left_pad="0"
+             name="lowest_vertices"
+             valign="center"
+             value="0"
+             width="65" />
+            <text
+             follows="left|top"
+             halign="center"
+             height="18"
+             initial_value=""
+             layout="topleft"
+             left_pad="0"
+             name="lowest_status"
+             valign="center"
+             value=""
+             width="65" />
+            <icon
+             height="16"
+             image_name="red_x.png"
+             layout="topleft"
+             left_delta="20"
+             mouse_opaque="true"
+             name="status_icon_lowest"
+             top_delta="0"
+             width="16" />
+            <icon
+             height="16"
+             layout="topleft"
+             left="10"
+             name="lod_status_message_icon"
+             top_pad="20"
+             width="16" />
+            <text
+             follows="left|top"
+             height="16"
+             layout="topleft"
+             left_pad="5"
+             name="lod_status_message_text"
+             top_delta="0"
+             width="584"
+             word_wrap="true"
+             wrap="true" />
+            <view_border
+             bevel_style="none"
+             follows="top|left"
+             height="0"
+             layout="topleft"
+             left="10"
+             name="lod_tab_border"
+             top_pad="20"
+             width="605" />
+            <check_box
+             follows="top|left"
+             height="15"
+             label="Generate Normals"
+             layout="topleft"
+             left="10"
+             name="gen_normals"
+             top_pad="20" />
+            <text
+             enabled="false"
+             follows="top|left"
+             height="15"
+             initial_value="Crease Angle:"
+             layout="topleft"
+             left="200"
+             name="crease_label"
+             top_delta="0"
+             value="Crease Angle:"
+             width="100" />
+            <spinner
+             enabled="false"
+             follows="top|left"
+             height="20"
+             initial_value="75"
+             layout="topleft"
+             left_pad="5"
+             max_val="180"
+             name="crease_angle"
+             value="75"
+             width="60" />
+        </panel>
+      <!-- PHYSYCS PANEL -->
+        <panel
+          help_topic="upload_model_physics"
+          label="Physics"
+          name="physics_panel">
+            
+            <!-- ==== STEP 1: Level of Detail ==== -->
+            <view_border
+              bevel_style="none"
+              follows="top|left"
+              height="275"
+              layout="topleft"
+              left="3"
+              name="physics_tab_border"
+              top_pad="0"
+              width="619"/>
+                <panel
+                  bg_alpha_color="0 0 0 0"
+                  bg_opaque_color="0 0 0 0.3"
+                  follows="top|left"
+                  height="21"
+                  left="18"
+                  name="physics geometry"
+                  top="15"
+                  visible="true"
+                  width="589">
+                    <text
+                      follows="top|left"
+                      font="SansSerif"
+                      height="20"
+                      layout="topleft"
+                      left="0"
+                      name="first_step_name"
+                      text_color="White"
+                      top_pad="0"
+                      width="210">
+                      Step 1: Level of Detail
+                    </text>
+                    <combo_box
+                      follows="left|top"
+                      height="18"
+                      left_pad="10"
+                      name="physics_lod_combo"
+                      width="130"
+                      tool_tip="LOD to use for physics shape">
+                        <combo_item name="choose_one">     Choose one...   </combo_item>
+                        <combo_item name="physics_high">   High   </combo_item>
+                        <combo_item name="physics_medium"> Medium </combo_item>
+                        <combo_item name="physics_low">    Low    </combo_item>
+                        <combo_item name="physics_lowest"> Lowest </combo_item>
+                        <combo_item name="load_from_file"> From file   </combo_item>
+                    </combo_box>
+                    <line_editor
+                      follows="left|top"
+                      left_pad="10"
+                      value=""
+                      name="physics_file"
+                      height="20"
+                      width="154"/>
+                    <button
+                      follows="left|top"
+                      height="20"
+                      left_pad="4"
+                      name="physics_browse"
+                      label="Browse..."
+                      width="70"/>
+                    <!-- <check_box name="physics_optimize" follows="left|top" width="130" left="10" top_pad="5" height="20" label="Optimize"/>
+                    <check_box name="physics_use_hull" follows="left|top" width="130" left_pad="5" height="20" label="Use Convex Hull"/> -->
+                </panel>
+            
+            <!-- ==== STEP 2: Analyse ==== -->
+            <view_border
+              bevel_style="none"
+              follows="top|left"
+              height="0"
+              layout="topleft"
+              left="18"
+              name="physics_tab_border"
+              top_pad="15"
+              width="589"/>
+                <panel
+                  bg_alpha_color="0 0 0 0"
+                  bg_opaque_color="0 0 0 0.3"
+                  height="65"
+                  follows="top|left"
+                  left="18"
+                  name="physics analysis"
+                  top_pad="15"
+                  visible="true"
+                  width="589">
+                    <text
+                      follows="left|top"
+                      font="SansSerif"
+                      height="20"
+                      layout="topleft"
+                      left="0"
+                      name="method_label"
+                      text_color="White"
+                      top_pad="0">
+                      Step 2: Analyse
+                    </text>
+                    <text
+                      follows="top|left"
+                      height="15"
+                      layout="topleft"
+                      name="analysis_method_label"
+                      top_pad="10"
+                      width="100">
+                      Method:
+                    </text>
+                    <text
+                      follows="top|left"
+                      height="15"
+                      name="quality_label"
+                      layout="topleft"
+                      left_pad="15"
+                      width="100">
+                      Quality:
+                    </text>
+                    <text
+                      follows="top|left"
+                      height="15"
+                      name="smooth_method_label"
+                      layout="topleft"
+                      left_pad="15"
+                      width="100">
+                      Smooth:
+                    </text>
+                    <combo_box
+                      follows="top|left"
+                      layout="topleft"
+                      left="0"
+                      name="Method"
+                      top_pad="0"
+                      height="20"
+                      width="100"/>
+                    <combo_box
+                      follows="top|left"
+                      layout="topleft"
+                      left_pad="15"
+                      name="Decompose Quality"
+                      height="20"
+                      width="100"/>
+                    <combo_box
+                      height="20"
+                      follows="top|left"
+                      layout="topleft"
+                      left_pad="15"
+                      name="Cosine%"
+                      width="100"/>
+                    <check_box
+                      follows="top|left"
+                      label="Close Holes"
+                      layout="topleft"
+                      left_pad="10"
+                      name="Close Holes (Slow)"
+                      height="15"/>
+                    <button
+                      bottom="1"
+                      follows="top|right"
+                      height="20"
+                      label="Analyze"
+                      layout="bottomleft"
+                      name="Decompose"
+                      right="-1"
+                      width="90"/>
+                    <button
+                      follows="top|left"
+                      height="20"
+                      label="Cancel"
+                      layout="topleft"
+                      left_delta="0"
+                      name="decompose_cancel"
+                      visible="false"
+                      width="90"/>
+                </panel>
+            
+            <!-- ==== STEP 3: Simplify ==== -->
+            <view_border
+              bevel_style="none"
+              follows="top|left"
+              height="0"
+              layout="topleft"
+              left="18"
+              name="physics_tab_border"
+              top_pad="15"
+              width="589"/>
+                <panel
+                  bg_alpha_color="0 0 0 0"
+                  bg_opaque_color="0 0 0 0.3"
+                  follows="top|left"
+                  height="66"
+                  left="18"
+                  name="physics simplification"
+                  top_pad="15"
+                  width="589">
+                    <text
+                      text_color="White"
+                      follows="left|top"
+                      height="20"
+                      left="0"
+                      name="second_step_label"
+                      top_pad="0"
+                      font="SansSerif">
+                      Step 3: Simplify
+                    </text>
+                    <text
+                      name="simp_method_header"
+                      top_pad="10"
+                      height="15"
+                      width="100"
+                      follows="top|left">
+                      Method:
+                    </text>
+                    <text
+                      follows="top|left"
+                      left_pad="40"
+                      name="pass_method_header"
+                      height="15"
+                      width="41">
+                      Passes:
+                    </text>
+                    <text
+                      follows="top|left"
+                      left_pad="40"
+                      name="Detail Scale label"
+                      height="15"
+                      width="80">
+                      Detail scale:
+                    </text>
+                    <text
+                      follows="top|left"
+                      left_delta="0"
+                      name="Retain%_label"
+                      height="15"
+                      width="80"
+                      visible="false">
+                      Retain:
+                    </text>
+                    <combo_box
+                      follows="top|left"
+                      height="20"
+                      left="0"
+                      name="Simplify Method"
+                      top_pad="0"
+                      width="100"/>
+                    <combo_box
+                      height="20"
+                      follows="top|left"
+                      left_pad="40"
+                      name="Combine Quality"
+                      width="41"
+                      value="1">
+                    </combo_box>
+                    <spinner
+                      follows="top|left"
+                      name="Detail Scale"
+                      height="20"
+                      left_pad="40"
+                      width="60"/>
+                    <spinner
+                      name="Retain%"
+                      decimal_digits="0"
+                      width="60"
+                      follows="top|left"
+                      height="20"
+                      left_delta="0"
+                      visible="false"/>
+                    <button
+                      follows="top|left"
+                      height="20"
+                      label="Simplify"
+                      left_pad="40"
+                      name="Simplify"
+                      width="90"/>
+                    <button
+                      follows="top|left"
+                      height="20"
+                      label="Cancel"
+                      layout="topleft"
+                      left_delta="0"
+                      name="simplify_cancel"
+                      width="90"/>
+                </panel>
+            
+            <!-- ==== Results ==== -->
+            <view_border
+              bevel_style="none"
+              follows="top|left"
+              height="0"
+              layout="topleft"
+              left="18"
+              name="physics_tab_border"
+              top_pad="15"
+              width="589"/>
+                <panel
+                  bg_alpha_color="0 0 0 0"
+                  bg_opaque_color="0 0 0 0.3"
+                  follows="left|top"
+                  height="16"
+                  layout="topleft"
+                  left="18"
+                  name="physics info"
+                  top_pad="15"
+                  width="589">
+                    <text
+                      follows="top|left"
+                      height="15"
+                      layout="topleft"
+                      left="0"
+                      text_color="White"
+                      top_pad="0"
+                      name="results_text"
+                      width="50">
+                      Results:
+                    </text>
+                    <text
+                      follows="top|left"
+                      height="15"
+                      layout="topleft"
+                      left_pad="0"
+                      text_color="White"
+                      top_delta="0"
+                      name="physics_triangles"
+                      width="90">
+                      Triangles: [TRIANGLES],
+                    </text>
+                    <text
+                      follows="top|left"
+                      height="15"
+                      layout="topleft"
+                      left_pad="0"
+                      name="physics_points"
+                      top_delta="0"
+                      text_color="White"
+                      width="85">
+                      Vertices: [POINTS],
+                    </text>
+                    <text
+                      follows="top|left"
+                      height="15"
+                      layout="topleft"
+                      left_pad="0"
+                      name="physics_hulls"
+                      top_delta="0"
+                      text_color="White">
+                      Hulls: [HULLS]
+                    </text>
+                </panel>
+        </panel>
+      <!-- MODIFIERS PANEL -->
+     <panel
+       label="Upload options"
+       name="modifiers_panel"
+       help_topic="upload_model_modifiers">
+         <view_border
+          bevel_style="none"  
+          follows="top|left"
+          height="275"
+          layout="topleft"
+          left="3"
+          name="border"
+          top_pad="0"
+          width="619"/>
+           <text
+             follows="top|left"
+             height="16"
+             left="20"
+             name="scale_label"
+             text_color="White"
+             top="15"
+             width="140">
+             Scale (1=no scaling):
+           </text>
+           <spinner
+             height="20"
+             follows="top|left"
+             left_pad="10"
+             max_val="64.0"
+             min_val="0.01"
+             name="import_scale"
+             top_delta="-4"
+             value="1.0"
+             width="80"/>
+           <text
+             follows="top|left"
+             height="15"
+             left_pad="20"
+             name="dimensions_label"
+             text_color="White"
+             width="90">
+             Dimensions:
+           </text>
+           <text
+             follows="top|left"
+             height="15"
+             left_pad="0"
+             name="import_dimensions"
+             text_color="White"
+             width="140">
+             [X] X [Y] X [Z]
+           </text>
+           <check_box
+             height="15"
+             follows="top|left"
+             name="upload_textures"
+             label="Include textures"
+             label_text.text_color="White"
+             left="20"
+             top_pad="20"/>
+           <view_border
+             bevel_style="none"
+             follows="top|left"
+             height="0"
+             layout="topleft"
+             name="border"
+             top_pad="20"
+             width="579"/>
+           <text
+             follows="top|left"
+             height="15"
+             left="20"
+             name="include_label"
+             text_color="White"
+             top_pad="20"
+             width="150">
+             For avatar models only:
+           </text>
+           <check_box
+             follows="top|left"
+             height="15"
+             label="Include skin weight"
+             label_text.text_color="White"
+             name="upload_skin"
+             top_pad="15"/>
+           <check_box
+             follows="top|left"
+             height="15"
+             label="Include joint positions"
+             label_text.text_color="White"
+             name="upload_joints"
+             top_pad="15"/>
+           <text
+             follows="top|left"
+             height="15"
+             layout="topleft"
+             left="220"
+             name="pelvis_offset_label"
+             text_color="White"
+             top="134"
+             width="200">
+             Z offset (raise or lower avatar):
+           </text>
+           <spinner
+             follows="top|left"
+             height="20"
+             min_val="-3.00"
+             max_val="3.0"
+             name="pelvis_offset"
+             top_pad="10"
+             value="0.0"
+             width="80"/>
+     </panel>
+    </tab_container>
     <panel
-      border="true"
-      label="Modifiers"
-      name="modifiers_panel"
-      help_topic="upload_model_modifiers">
-
-      <text left="10" width="90" bottom="30" follows="top|left" height="15">
-        Scale:
-      </text>
-      <text left_pad="5" width="140" follows="top|left" height="15">
-        Dimensions:
-      </text>
-
-      <spinner left="10" height="20" follows="top|left" width="80" top_pad="5" value="1.0" min_val="0.01" max_val="64.0" name="import_scale"/>
-
-      <text left_pad="20" height="15" name="import_dimensions" follows="top|left">
-        [X] x [Y] x [Z] m
-      </text>
-
-      <text left="10" top_pad="20" follows="top|left" height="15">
-        Include:
-      </text>
-
-      <check_box top_pad="5" name="upload_textures" height="15" follows="top|left" label="Textures"/>
-      <check_box top_pad="5" name="upload_skin" height="15" follows="top|left" label="Skin weight"/>
-      <check_box top_pad="5" left="20" name="upload_joints" height="15" follows="top|left" label="Joint positions"/>
-
-      <text left="10" top_pad="4" width="90" bottom="30" follows="top|left" height="15">
-        Pelvis Z Offset:
-      </text>
-
-      <spinner left="10" top_pad="4" height="20" follows="top|left" width="80" value="0.0" min_val="-3.00" max_val="3.0" name="pelvis_offset"/>
-
-    </panel>
-  </tab_container>
-
-  <text
-	height="16"
-	left_delta="5"
-	bottom_delta="30"
-	name="upload_fee"
-	width="300"
-	follows="bottom|right"
-	word_wrap="true" 
-	>
-	    Upload fee: L$ [FEE]
-  </text>
-  
-  <button bottom="540" left="10"  follows="bottom|left" height="20" label="Set to defaults"
-	     width="100" name="reset_btn" tool_tip="Set to defaults"/>
-  <button left="310"  follows="bottom|right" height="20" label="Calculate weights &amp; fee"
-	     width="150" name="calculate_btn" tool_tip="Calculate weights &amp; fee" top_delta="0"/>
-  <button bottom="540" left="310"  follows="bottom|right" height="20" label="Upload"
-	     width="80" name="ok_btn" tool_tip="Upload to simulator" visible="false"/>
-  <button right="-10" follows="right|bottom" height="20" width="80" label="Cancel" name="cancel_btn" top_delta="0"/>
-  
-  <!--
-  <button bottom_delta="0" left="10" width="120" name="auto fill" label="Generate LOD" tool_tip="Automatically generate levels of detail"/>
-  <button bottom_delta="0" left="140" width="120" name="smooth normals" label="Generate Normals" tool_tip="Regenerate normals based on mesh shape"/>
-  <button bottom_delta="0" left="260" width="120" name="consolidate" label="Consolidate" tool_tip="Combine similar submeshes (reduces number of submeshes)"/>
-  <button bottom_delta="30" left="260" width="120" name="scrub materials" label="Scrub Materials" tool_tip="Remove all material information (clear textures, set all colors to white)."/>
-  
-  <spinner bottom_delta="0" left="140" width="120" height="16" initial_value="75" label_width="60" name="edge threshold" decimal_digits="0" min_val="0" max_val="180" increment="5" label="Hard Angle" tool_tip="Maximum angle that will be smoothed between triangles when using Generate Normals"/>
-
-  <text bottom_delta="30" follows="top|left" height="15" left="10" name="high_lod_label">
-    High LOD:
-  </text>
-  <combo_box bottom_delta="0" left="97" follows="left|top" height="18" 
-             name="high detail combo" width="100" tool_tip="Specify mesh for this level of detail">
-    <combo_item name="high none" value="none">
-      None
-    </combo_item>
-    <combo_item name="high choose file" value="file">
-      Choose File...
-    </combo_item>
-    <combo_item name="high triangle limit" value="limit">
-      Triangle Limit
-    </combo_item>
-  </combo_box>
-  <spinner bottom_delta="-5" left="200" width="120"  name="high limit" decimal_digits="0" increment="1" min_val="0" max_val="100" tool_tip="Triangle budget for this LOD"/>
-  <text bottom_delta="25" follows="top|left" height="15" left="10" name="high info" width="300">
-    [TRIANGLES] Triangles, [VERTICES] Vertices, [SUBMESHES] Submeshes.  
-    [MESSAGE]
-  </text>
-
-  <text bottom_delta="35" follows="top|left" height="15" left="10" name="medium_lod_label">
-    Medium LOD:
-  </text>
-  <combo_box bottom_delta="0" left="97" follows="left|top" height="18"
-             name="medium detail combo" width="100" tool_tip="Specify mesh for this level of detail">
-    <combo_item name="medium none" value="none">
-      None
-    </combo_item>
-    <combo_item name="medium choose file" value="file">
-      Choose File...
-    </combo_item>
-    <combo_item name="medium triangle limit" value="limit">
-      Triangle Limit
-    </combo_item>
-  </combo_box>
-  <spinner bottom_delta="-5" left="200" width="120"  name="medium limit" decimal_digits="0" increment="1" min_val="0" max_val="100" tool_tip="Triangle budget for this LOD"/>
-  <text bottom_delta="25" follows="top|left" height="15" left="10" name="medium info" width="300">
-    [TRIANGLES] Triangles, [VERTICES] Vertices, [SUBMESHES] Submeshes.  
-    [MESSAGE]
-  </text>
-
-  <text bottom_delta="35" follows="top|left" height="15" left="10" name="low_lod_label">
-    Low LOD:
-  </text>
-  <combo_box bottom_delta="0" left="97" follows="left|top" height="18" 
-             name="low detail combo" width="100" tool_tip="Specify mesh for this level of detail">
-    <combo_item name="low none" value="none">
-      None
-    </combo_item>
-    <combo_item name="low choose file" value="file">
-      Choose File...
-    </combo_item>
-    <combo_item name="low triangle limit" value="limit">
-      Triangle Limit
-    </combo_item>
-  </combo_box>
-  <spinner bottom_delta="-5" left="200" width="120"  name="low limit" decimal_digits="0" increment="1" min_val="0" max_val="100" tool_tip="Triangle budget for this LOD"/>
-  <text bottom_delta="25" follows="top|left" height="15" left="10" name="low info" width="300">
-    [TRIANGLES] Triangles, [VERTICES] Vertices, [SUBMESHES] Submeshes
-    [MESSAGE]
-  </text>
-
-  <text bottom_delta="35" follows="top|left" height="15" left="10" name="lowest_lod_label">
-    Lowest LOD:
-  </text>
-  <combo_box bottom_delta="0" left="97" follows="left|top" height="18" 
-             name="lowest detail combo" width="100" tool_tip="Specify mesh for this level of detail">
-    <combo_item name="lowest none" value="none">
-      None
-    </combo_item>
-    <combo_item name="lowest choose file" value="file">
-      Choose File...
-    </combo_item>
-    <combo_item name="lowest triangle limit" value="limit">
-      Triangle Limit
-    </combo_item>
-  </combo_box>
-  <spinner bottom_delta="-5" left="200" width="120"  name="lowest limit" decimal_digits="0" increment="1" min_val="0" max_val="100" tool_tip="Triangle budget for this LOD"/>
-  <text bottom_delta="25" follows="top|left" height="15" left="10" name="lowest info" width="300">
-    [TRIANGLES] Triangles, [VERTICES] Vertices, [SUBMESHES] Submeshes
-    [MESSAGE]
-  </text>
-
-  <text bottom_delta="35" follows="top|left" height="15" left="10" name="physics_lod_label">
-    Physical Shape:
-  </text>
-  <combo_box bottom_delta="0" left="97" follows="left|top" height="18"
-             name="physics detail combo" width="100">
-    <combo_item name="physics none" value="none">
-      None
-    </combo_item>
-    <combo_item name="physics choose file" value="file">
-      Choose File...
-    </combo_item>
-    <combo_item name="physics triangle limit" value="limit">
-      Triangle Limit...
-    </combo_item>
-  </combo_box>
-  <spinner bottom_delta="-5" left="200" width="90"  name="physics limit" decimal_digits="0" increment="1" min_val="0" max_val="100" tool_tip="Triangle budget for this LOD"/>
-  <button bottom_delta="0" left="290" width="30" follows="left|top" height="20" label=">>" 
-          name="decompose_btn" tool_tip="Create convex decomposition."/>
-  <text bottom_delta="25" follows="top|left" height="15" left="10" name="physics info" width="300">
-    [TRIANGLES] Triangles, [HULLS] Hulls, [POINTS] Points
-  </text>
-
-  <text bottom_delta="25" follows="top|left" height="15" left="10" name="include label" width="300">
-    Include:
-  </text>
-
-  <check_box bottom_delta="20" follow="bottom|left" height="20" label="Textures"
-             left="15" width="125" name="upload_textures" tool_tip="Upload associated textures "/>
-
-  <check_box bottom_delta="20" follow="bottom|left" height="20" label="Skin Weights"
-             left="15" width="125" name="upload_skin" tool_tip="Upload vertex skin weighting information."/>
-
-  <check_box bottom_delta="20" follow="bottom|left" height="20" label="Joint Positions"
-             left="15" width="125" name="upload_joints" tool_tip="Upload joint position information (will override avatar joint positions when mesh is worn)."/>
-
-  
-	<button bottom_delta="25" follows="bottom|left" height="20" label="Upload"
-	     left="15" name="ok_btn" width="125" tool_tip="Upload to simulator"/>
-
-  <text bottom_delta="20" left="15" width="280" follows="top|left" height="15" name="description_label" text_color="1 0.82 0.46 1">
-	  (No charge for upload during First Look)
-	</text>
-  <text bottom_delta="20" left="15" width="280" follows="top|left" height="15" name="upload_message">
-    [MESSAGE]
-  </text>
+     follows="top|left"
+     height="80"
+     layout="top|left"
+     left="0"
+     name="weights_and_warning_panel"
+     top_pad="3"
+     width="625">
+       <button
+         follows="top|left"
+         label="Calculate weights &amp; fee"
+         label_color="White"
+         layout="topleft"
+         left="3"
+         name="calculate_btn"
+         top="3"
+         height="20"
+         width="150"
+         tool_tip="Calculate weights &amp;fee"/>
+       <button
+         follows="top|left"
+         label="Cancel"
+         label_color="White"
+         layout="topleft"
+         left_pad="6"
+         name="cancel_btn"
+         top="3"
+         height="20"
+         width="80"/>
+       <button
+         follows="top|left"
+         label="Upload"
+         layout="topleft"
+         label_color="White"
+         left="35"
+         name="ok_btn"
+         top="3"
+         height="20"
+         visible="false"
+         width="80"
+         tool_tip="Upload to simulator"/>
+       <button
+         follows="top|right"
+         label="Clear settings &amp; reset form"
+         label_color="White"
+         layout="topleft"
+         name="reset_btn"
+         right="-2"
+         top="3"
+         height="20"
+         width="155"/>
+       <!-- ========== WEIGHTS ==========-->
+       <text
+         follows="top|left"
+         height="15"
+         layout="topleft"
+         left="5"
+         name="upload_fee"
+         top_pad="10"
+         width="130"
+         word_wrap="true">
+         Upload fee: L$ [FEE]
+       </text>
+       <text
+         height="15"
+         layout="topleft"
+         left_pad="0"
+         name="prim_weight"
+         top_delta="0"
+         width="120"
+         word_wrap="true">
+         Land impact: [EQ]
+       </text>
+       <text
+         height="15"
+         layout="topleft"
+         left_pad="0"
+         name="download_weight"
+         top_delta="0"
+         width="100"
+         word_wrap="true">
+         Download: [ST]
+       </text>
+       <text
+         height="15"
+         top_delta="0"
+         layout="topleft"
+         left_pad="0"
+         name="physics_weight"
+         width="90"
+         word_wrap="true">
+         Physics: [PH]
+       </text>
+       <text
+         height="15"
+         top_delta="0"
+         layout="topleft"
+         left_pad="0"
+         name="server_weight"
+         width="83"
+         word_wrap="true">
+         Server: [SIM]
+       </text>
+       <!-- ========== NOTE MESSAGE ========== -->
+       <text
+         font="SansSerif"
+         layout="topleft"
+         left="6"
+         name="warning_title"
+         top_pad="10"
+         text_color="DrYellow"
+         visible="false"
+         width="40">
+         NOTE:
+       </text>
+       <text
+         text_color="White"
+         height="20"
+         layout="topleft"
+         left_pad="1"
+         name="warning_message"
+         parse_urls="true"
+         top_delta="2"
+         wrap="true"
+         width="462"
+         visible="false">
+         You dont have rights to upload mesh models. [[VURL] Find out how] to get certified.
+       </text>
+       <text text_color="Yellow" layout="topleft" top_delta="20" left="6" name="status">[STATUS]</text>
   
-  <spinner bottom_delta="20" label="Scale" left="15" width="120"  name="debug scale" decimal_digits="3" increment="0.1" min_val="0" max_val="64" initial_value="1" tool_tip="Multiplier for incoming object scale.  If incoming dimensions are very small or very large, modify this value to get dimensions into an acceptable range."/>
-  <text bottom_delta="30" left="15" width="280" follows="top|left" height="15" name="dimensions">
-    Model Dimensions: [X]m x [Y]m x [Z]m
-  </text>
-  -->
+    </panel>
+</panel>
+
+<text 
+ follows="left|top"
+ layout="topleft"
+ left="640"
+ name="lod_label"
+ text_color="White"
+ top="13"
+ height="15"
+ width="290">
+ Preview:
+ </text>
+<panel
+ border="true"
+ bevel_style="none"
+ follows="top|left"
+ name="preview_panel"
+ top_pad="4"
+ width="290"
+ height="290"/>
+
+<panel
+  follows="all"
+  height="130"
+  layout="topleft"
+  name="right_panel"
+  top_pad="5"
+  width="290">
+    <combo_box
+      top_pad="3"
+      follows="left|top"
+      height="18"
+      layout="topleft"
+      name="preview_lod_combo"
+      width="150"
+      tool_tip="LOD to view in preview render">
+        <combo_item name="high">   High   </combo_item>
+        <combo_item name="medium"> Medium </combo_item>
+        <combo_item name="low">    Low    </combo_item>
+        <combo_item name="lowest"> Lowest </combo_item>
+    </combo_box>
+    <text
+      follows="top|left"
+      layout="topleft"
+      text_color="White"
+      top="5"
+      left_pad="20"
+      name="label_display"
+      width="50">
+      Display...
+    </text>
+    <check_box
+      follows="top|left"
+      label="Edges"
+      label_text.text_color="White"
+      layout="topleft"
+      left_delta="0"
+      name="show_edges"
+      top_pad="8">
+    </check_box>
+    <check_box
+      follows="top|left"
+      label="Physics"
+      label_text.text_color="White"
+      layout="topleft"
+      name="show_physics"
+      top_pad="8">
+    </check_box>
+    <check_box
+      follows="top|left"
+      label="Textures"
+      label_text.text_color="White"
+      layout="topleft"
+      name="show_textures"
+      top_pad="8">
+    </check_box>
+    <check_box
+      follows="top|left"
+      label="Skin weights"
+      label_text.text_color="White"
+      layout="topleft"
+      name="show_skin_weight"
+      top_pad="8">
+    </check_box>
+    <check_box
+      follows="top|left"
+      label="Joints"
+      label_text.text_color="White"
+      layout="topleft"
+      name="show_joint_positions"
+      top_pad="8">
+    </check_box>
+    <text
+      follows="top|left"
+      layout="topleft"
+      left="2"
+      name="physics_explode_label"
+      top="85"
+      width="150">
+      Preview Spread:
+    </text>
+    <slider
+      name="physics_explode"
+      follows="top|left"
+      top="100"
+      left="0"
+      min_val="0.0"
+      max_val="3.0"
+      height="20"
+      width="150"/>
+</panel>
 </floater>
diff --git a/indra/newview/skins/default/xui/en/floater_model_wizard.xml b/indra/newview/skins/default/xui/en/floater_model_wizard.xml
index 3d16ccbc45..b5a5ff5342 100644
--- a/indra/newview/skins/default/xui/en/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_wizard.xml
@@ -108,7 +108,7 @@
 		 height="22"
 		 top_pad="15"
 		 width="505"
-		 name="choose_file_header_panel"
+		 name="header_panel"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
 		 background_opaque="true"
@@ -117,7 +117,7 @@
 			 width="200"
 			 left="10"
 			 top="3"
-			 name="choose_file_header_text"
+			 name="header_text"
 			 text_color="White"
 			 height="10"
 			 font="SansSerifBig"
@@ -130,7 +130,7 @@
 		 left="15"
 		 height="310"
 		 width="505"
-		 name="choose_file_content_panel"
+		 name="content"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
 		 background_opaque="true">
@@ -163,7 +163,7 @@
 			 height="10"
 			 layout="topleft"
 			 left_delta="0"
-			 name="choose_model_file_label"
+			 name="Cache location"
 			 width="320">
 				Choose model file to upload
 			</text>
@@ -199,7 +199,7 @@
 			 height="10"
 			 layout="topleft"
 			 left="10"
-			 name="support_collada_text"
+			 name="Cache location"
 			 width="320">
 				Second Life supports COLLADA (.dae) files
 			</text>
@@ -221,7 +221,6 @@
 			 width="130"
 			 height="14"
 			 left_delta="0"
-			 name="dimensions_label"
 			 text_color="White"
 			 word_wrap="true">
 				Dimensions (meters):
@@ -288,7 +287,7 @@
 		<panel
 		 height="22"
 		 top_pad="15"
-		 name="optimize_header_panel"
+		 name="header_panel"
 		 width="505"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
@@ -297,7 +296,7 @@
 			<text
 			 width="200"
 			 left="10"
-			 name="optimize_header_text"
+			 name="header_text"
 			 top="3"
 			 text_color="White"
 			 height="10"
@@ -312,7 +311,7 @@
 		 height="20"
 		 font="SansSerifSmall"
 		 layout="topleft"
-		 name="optimize_hint"
+		 name="description"
 		 word_wrap="true"
 		 left_delta="5">
 			We have optimized the model for performance. Adjust it further if you wish.
@@ -323,12 +322,11 @@
 		 left="15"
 		 height="270"
 		 width="505"
-		 name="optimize_content_panel"
+		 name="content"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
 		 background_opaque="true">
 			<text
-			 name="generating_lod_label"
 			 top="20"
 			 width="300"
 			 height="12"
@@ -403,12 +401,12 @@
 				 bg_opaque_color="DkGray2"
 				 background_visible="true"
 				 background_opaque="true">
-			<text name="optimize_performance_text" top="69" left="10" text_color="White" font="SansSerifSmallBold" width="120" height="16" wrap="true">Performance</text>
-			<text name="optimize_faster_rendering_text" top="85" left="10" width="120" word_wrap="true" font="SansSerifSmall" height="40">Faster rendering
+			<text top="69" left="10" text_color="White" font="SansSerifSmallBold" width="120" height="16" wrap="true">Performance</text>
+			<text top="85" left="10" width="120" word_wrap="true" font="SansSerifSmall" height="40">Faster rendering
 Less detail
 Lower prim weight</text>
-			<text name="optimize_accuracy_text" top="69" left="184" text_color="White" font="SansSerifSmallBold" width="120" height="16" wrap="true">Accuracy</text>
-			<text name="optimize_slower_rendering_text" top="85" left="184" width="120" word_wrap="true" font="SansSerifSmall" height="40">Slower rendering
+			<text top="69" left="184" text_color="White" font="SansSerifSmallBold" width="120" height="16" wrap="true">Accuracy</text>
+			<text top="85" left="184" width="120" word_wrap="true" font="SansSerifSmall" height="40">Slower rendering
 More detail
 Higher prim weight</text>
 
@@ -426,24 +424,21 @@ Higher prim weight</text>
 		   top="130"
 		   width="290" />
           <text 
-			font="SansSerifSmall"
-			name="accuracy_slider_mark1" 
+			font="SansSerifSmall" 
 			top_pad="0"  
 			width="5" 
 			left_delta="6" 
 			height="4">'  
           </text>
           <text 
-			font="SansSerifSmall"
-			name="accuracy_slider_mark2" 
+			font="SansSerifSmall" 
 			top_delta="0"  
 			width="5" 
 			left_delta="137" 
 			height="4">'  
           </text>
           <text 
-			font="SansSerifSmall"
-			name="accuracy_slider_mark3" 
+			font="SansSerifSmall" 
 			top_delta="0"  
 			width="5" 
 			left_delta="137" 
@@ -459,7 +454,7 @@ Higher prim weight</text>
 			top_pad="15"
             width="150">
           </button>
-			<text top="10" right="-10" width="185" text_color="White" follows="left|top" height="15" name="geometry_preview_label">
+			<text top="10" right="-10" width="185" text_color="White" follows="left|top" height="15" name="lod_label">
 				Geometry preview
 			</text>
 			<panel
@@ -476,16 +471,16 @@ Higher prim weight</text>
 			</panel>
 			<combo_box left_delta="75" top_pad="10"  follows="left|top" list_position="below" height="22"
 	     name="preview_lod_combo" width="110" tool_tip="LOD to view in preview render">
-				<combo_item name="preview_lod_high">
+				<combo_item name="high">
 					High detail
 				</combo_item>
-				<combo_item name="preview_lod_medium">
+				<combo_item name="medium">
 					Medium detail
 				</combo_item>
-				<combo_item name="preview_lod_low">
+				<combo_item name="low">
 					Low detail
 				</combo_item>
-				<combo_item name="preview_lod_lowest">
+				<combo_item name="lowest">
 					Lowest detail
 				</combo_item>
 			</combo_box>
@@ -502,7 +497,7 @@ Higher prim weight</text>
 		<panel
 		 height="22"
 		 top_pad="15"
-		 name="physics_header_panel"
+		 name="header_panel"
 		 width="505"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
@@ -511,7 +506,7 @@ Higher prim weight</text>
 			<text
 			 width="200"
 			 left="10"
-			 name="physics_header_text"
+			 name="header_text"
 			 top="3"
 			 height="10"
 			 font="SansSerifBig"
@@ -526,7 +521,7 @@ Higher prim weight</text>
 		 height="50"
 		 font="SansSerifSmall"
 		 layout="topleft"
-		 name="physics_hint"
+		 name="description"
 		 word_wrap="true"
 		 left_delta="5">
 			We will create a shape for the outer hull of the model. Adjust the shape's detail level as needed for the intended purpose of your model.
@@ -536,16 +531,16 @@ Higher prim weight</text>
 		 left="15"
 		 height="270"
 		 width="505"
-		 name="physics_content_panel"
+		 name="content"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
 		 background_opaque="true">
-      <text name="physics_performance_text" top="10" left="10" text_color="White" font="SansSerifSmallBold" width="120" halign="right" height="16" wrap="true">Performance</text>
-      <text name="physics_faster_rendering_text" top="26" left="10" width="120" word_wrap="true" font="SansSerifSmall" halign="right" height="40">Faster rendering
+      <text top="10" left="10" text_color="White" font="SansSerifSmallBold" width="120" halign="right" height="16" wrap="true">Performance</text>
+      <text top="26" left="10" width="120" word_wrap="true" font="SansSerifSmall" halign="right" height="40">Faster rendering
 Less detail
 Lower prim weight</text>
-      <text name="physics_accuracy_text" top="174" left="10" text_color="White" font="SansSerifSmallBold" width="120" halign="right" height="16" wrap="true">Accuracy</text>
-      <text name="physics_slower_dendering_text" top="190" left="10" width="120" word_wrap="true" font="SansSerifSmall" halign="right" height="40">Slower rendering
+      <text top="174" left="10" text_color="White" font="SansSerifSmallBold" width="120" halign="right" height="16" wrap="true">Accuracy</text>
+      <text top="190" left="10" width="120" word_wrap="true" font="SansSerifSmall" halign="right" height="40">Slower rendering
 More detail
 Higher prim weight</text>
 
@@ -563,15 +558,15 @@ Higher prim weight</text>
 		   show_text="false"
 		   top="25"
 		   width="22" />
-      <text name="physics_example_1" top="10" width="120" word_wrap="true" left_pad="10" height="50">Examples:
+      <text top="10" width="120" word_wrap="true" left_pad="10" height="50">Examples:
 Moving objects
 Flying objects
 Vehicles</text>
-      <text name="physics_example_2" top="95" width="120" word_wrap="true" left_delta="0" height="50">Examples:
+      <text top="95" width="120" word_wrap="true" left_delta="0" height="50">Examples:
 Small static objects
 Less detailed objects
 Simple furniture</text>
-      <text name="physics_example_3" top="180" width="120" word_wrap="true" left_delta="0" height="50">Examples:
+      <text top="180" width="120" word_wrap="true" left_delta="0" height="50">Examples:
 Static objects
 Detailed objects
 Buildings</text>
@@ -597,7 +592,7 @@ Buildings</text>
 			visible="false"
             width="150">
           </button>
-			<text top="10" right="-10" width="185" text_color="White" follows="left|top" height="15" name="physics_preview_label">
+			<text top="10" right="-10" width="185" text_color="White" follows="left|top" height="15" name="lod_label">
 				Physics preview
 			</text>
 			<panel
@@ -614,16 +609,16 @@ Buildings</text>
 			</panel>
 			<combo_box left_delta="75" top_pad="10"  follows="left|top" list_position="below" height="22"
 	     name="preview_lod_combo2" width="110" tool_tip="LOD to view in preview render">
-				<combo_item name="preview_lod2_high">
+				<combo_item name="high">
 					High detail
 				</combo_item>
-				<combo_item name="preview_lod2_medium">
+				<combo_item name="medium">
 					Medium detail
 				</combo_item>
-				<combo_item name="preview_lod2_low">
+				<combo_item name="low">
 					Low detail
 				</combo_item>
-				<combo_item name="preview_lod2_lowest">
+				<combo_item name="lowest">
 					Lowest detail
 				</combo_item>
 			</combo_box>
@@ -640,7 +635,7 @@ Buildings</text>
 		<panel
 		 height="22"
 		 top_pad="15"
-		 name="review_header_panel"
+		 name="header_panel"
 		 width="505"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
@@ -649,7 +644,7 @@ Buildings</text>
 			<text
 			 width="200"
 			 left="10"
-			 name="review_header_text"
+			 name="header_text"
 			 text_color="White" 
 			 top="3"
 			 height="10"
@@ -663,7 +658,7 @@ Buildings</text>
 		 left="15"
 		 height="310"
 		 width="505"
-		 name="review_content_panel"
+		 name="content"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
 		 background_opaque="true">
@@ -711,7 +706,7 @@ Buildings</text>
 		<panel
 		 height="22"
 		 top_pad="15"
-		 name="upload_header_panel"
+		 name="header_panel"
 		 width="505"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
@@ -720,7 +715,7 @@ Buildings</text>
 			<text
 			 width="200"
 			 left="10"
-			 name="upload_header_text"
+			 name="header_text"
 			 top="3"
 			 text_color="White" 
 			 height="10"
diff --git a/indra/newview/skins/default/xui/en/floater_object_weights.xml b/indra/newview/skins/default/xui/en/floater_object_weights.xml
new file mode 100644
index 0000000000..eb283a1043
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_object_weights.xml
@@ -0,0 +1,342 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+ can_close="true"
+ can_tear_off="false"
+ height="315"
+ help_topic="object_weights"
+ layout="topleft"
+ name="object_weights"
+ save_rect="true"
+ single_instance="true"
+ title="ADVANCED"
+ width="200">
+    <floater.string
+     name="nothing_selected"
+     value="--"/>
+
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="selected_text"
+     text_color="EmphasisColor"
+     top="10"
+     value="SELECTED"
+     width="180" />
+    <text
+     follows="left|top"
+     halign="right"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="objects"
+     top_pad="3"
+     value="--"
+     width="40" />
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left_pad="10"
+     name="objects_label"
+     top_delta="0"
+     value="Objects"
+     width="130" />
+    <text
+     follows="left|top"
+     halign="right"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="prims"
+     top_pad="3"
+     value="--"
+     width="40" />
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left_pad="10"
+     name="prims_label"
+     top_delta="0"
+     value="Prims"
+     width="130" />
+    <view_border
+     bevel_style="none"
+     follows="top|left"
+     height="0"
+     layout="topleft"
+     left="10"
+     name="selected_text_border"
+     top_pad="5"
+     width="180"/>
+
+
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="weights_of_selected_text"
+     text_color="EmphasisColor"
+     top_pad="10"
+     value="WEIGHTS OF SELECTED"
+     width="180" />
+    <text
+     follows="left|top"
+     halign="right"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="download"
+     top_pad="3"
+     value="--"
+     width="40" />
+    <loading_indicator
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="34"
+     name="download_loading_indicator"
+     top_delta="0"
+     width="16" />
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left_pad="10"
+     name="download_label"
+     top_delta="0"
+     value="Download"
+     width="130" />
+    <text
+     follows="left|top"
+     halign="right"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="physics"
+     top_pad="3"
+     value="--"
+     width="40" />
+    <loading_indicator
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="34"
+     name="physics_loading_indicator"
+     top_delta="0"
+     width="16" />
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left_pad="10"
+     name="physics_label"
+     top_delta="0"
+     value="Physics"
+     width="130" />
+    <text
+     follows="left|top"
+     halign="right"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="server"
+     top_pad="3"
+     value="--"
+     width="40" />
+    <loading_indicator
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="34"
+     name="server_loading_indicator"
+     top_delta="0"
+     width="16" />
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left_pad="10"
+     name="server_label"
+     top_delta="0"
+     value="Server"
+     width="130" />
+    <text
+     follows="left|top"
+     halign="right"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="display"
+     top_pad="3"
+     value="--"
+     width="40" />
+    <loading_indicator
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="34"
+     name="display_loading_indicator"
+     top_delta="0"
+     width="16" />
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left_pad="10"
+     name="display_label"
+     top_delta="0"
+     value="Display"
+     width="130" />
+    <view_border
+     bevel_style="none"
+     follows="top|left"
+     height="0"
+     layout="topleft"
+     left="10"
+     name="weights_text_border"
+     top_pad="5"
+     width="180"/>
+
+
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="land_impacts_text"
+     text_color="EmphasisColor"
+     top_pad="10"
+     value="LAND IMPACTS"
+     width="180" />
+    <text
+     follows="left|top"
+     halign="right"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="selected"
+     top_pad="3"
+     value="--"
+     width="40" />
+    <loading_indicator
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="34"
+     name="selected_loading_indicator"
+     top_delta="0"
+     width="16" />
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left_pad="10"
+     name="selected_label"
+     top_delta="0"
+     value="Selected"
+     width="130" />
+    <text
+     follows="left|top"
+     halign="right"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="rezzed_on_land"
+     top_pad="3"
+     value="--"
+     width="40" />
+    <loading_indicator
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="34"
+     name="rezzed_on_land_loading_indicator"
+     top_delta="0"
+     width="16" />
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left_pad="10"
+     name="rezzed_on_land_label"
+     top_delta="0"
+     value="Rezzed on land"
+     width="130" />
+    <text
+     follows="left|top"
+     halign="right"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="remaining_capacity"
+     top_pad="3"
+     value="--"
+     width="40" />
+    <loading_indicator
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="34"
+     name="remaining_capacity_loading_indicator"
+     top_delta="0"
+     width="16" />
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left_pad="10"
+     name="remaining_capacity_label"
+     top_delta="0"
+     value="Remaining capacity"
+     width="130" />
+    <text
+     follows="left|top"
+     halign="right"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="total_capacity"
+     top_pad="3"
+     value="--"
+     width="40" />
+    <loading_indicator
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="34"
+     name="total_capacity_loading_indicator"
+     top_delta="0"
+     width="16" />
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left_pad="10"
+     name="total_capacity_label"
+     top_delta="0"
+     value="Total capacity"
+     width="130" />
+    <view_border
+     bevel_style="none"
+     follows="top|left"
+     height="0"
+     layout="topleft"
+     left="10"
+     name="land_impacts_text_border"
+     top_pad="5"
+     width="180"/>
+
+    <text
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="10"
+     name="help_SLURL"
+     top_pad="10"
+     value="[secondlife:///app/help/object_weights What is all this?...]"
+     width="180" />
+</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml
index 8901583799..9b02f7d273 100644
--- a/indra/newview/skins/default/xui/en/floater_tools.xml
+++ b/indra/newview/skins/default/xui/en/floater_tools.xml
@@ -48,11 +48,11 @@
     </floater.string>
     <floater.string
      name="status_selectcount">
-        [OBJ_COUNT] objects ( [PRIM_COUNT] prims[PE_STRING] ) selected
+        [OBJ_COUNT] objects selected, land impact [LAND_IMPACT]
     </floater.string>
     <floater.string
-     name="status_selectprimequiv">
-        , [SEL_WEIGHT] prim equivs
+     name="status_remaining_capacity">
+        Remaining capacity [LAND_CAPACITY].
     </floater.string>
     <button
      follows="left|top"
@@ -738,11 +738,11 @@
 	  font="SansSerifSmall"
 	  layout="topleft"
 	  left="10"
-	  name="selection_weight"
+	  name="remaining_capacity"
 	  top_pad="0"
 	  visible="false"
 	  width="280">
-	  Physics weight [PHYS_WEIGHT], Render Cost [DISP_WEIGHT].
+	  [CAPACITY_STRING] [secondlife:///app/openfloater/object_weights More info]
 	</text>
     <!-- <text -->
     <!-- text_color="LtGray_50" -->
@@ -1999,26 +1999,22 @@ even though the user gets a free copy.
              top_pad="4"
              visible="false"
              width="150">
-                <combo_box.item
-                 label="(none)"
-                 name="None"
-                 value="None" />
                 <combo_box.item
                  label="Sphere"
                  name="Sphere"
-                 value="Sphere" />
+                 value="1" />
                 <combo_box.item
                  label="Torus"
                  name="Torus"
-                 value="Torus" />
+                 value="2" />
                 <combo_box.item
                  label="Plane"
                  name="Plane"
-                 value="Plane" />
+                 value="3" />
                 <combo_box.item
                  label="Cylinder"
                  name="Cylinder"
-                 value="Cylinder" />
+                 value="4" />
               </combo_box>
         </panel>
         <panel
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 36ebe73753..16f48f3a4e 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -1277,7 +1277,7 @@
                  parameter="stats" />
             </menu_item_check>
       <menu_item_check
-        label="Show Avatar Rendering Cost"
+        label="Show Draw Weight for Avatars"
         name="Avatar Rendering Cost">
            <menu_item_check.on_check
             function="Advanced.CheckInfoDisplay"
@@ -2434,6 +2434,16 @@
           <menu_item_check.on_click
            function="Advanced.ToggleInfoDisplay"
            parameter="raycast" />
+        </menu_item_check>
+        <menu_item_check
+         label="Render Complexity"
+         name="rendercomplexity">
+          <menu_item_check.on_check
+           function="Advanced.CheckInfoDisplay"
+           parameter="rendercomplexity" />
+          <menu_item_check.on_click
+           function="Advanced.ToggleInfoDisplay"
+           parameter="rendercomplexity" />
         </menu_item_check>
 		<menu_item_check
          label="Sculpt"
diff --git a/indra/newview/skins/default/xui/en/panel_region_general.xml b/indra/newview/skins/default/xui/en/panel_region_general.xml
index 3f9195d092..44c84e69a1 100644
--- a/indra/newview/skins/default/xui/en/panel_region_general.xml
+++ b/indra/newview/skins/default/xui/en/panel_region_general.xml
@@ -133,17 +133,7 @@
      tool_tip="Let people see this region and its parcels in search results"
      top="190"
      width="80" />
-	<check_box
-     visible="FALSE"
-     height="20"
-     label="Allow Mesh Objects"
-     layout="topleft"
-     left="10"
-     name="mesh_rez_enabled_check"
-     tool_tip="Let people rez mesh objects on this region"
-     top="210"
-     width="80" />
-    <spinner
+	<spinner
      decimal_digits="0"
      follows="left|top"
      height="20"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index c0154ae9b3..5d2db8cc4c 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -3650,5 +3650,15 @@ Try enclosing path to the editor with double quotes.
   <string name="BeaconSound">Viewing sound beacons (yellow)</string>
   <string name="BeaconMedia">Viewing media beacons (white)</string>
   <string name="ParticleHiding">Hiding Particles</string>
+  
+  <!-- Mesh UI terms -->
+  <string name="Retain%">Retain%</string>
+  <string name="Detail">Detail</string>
+  <string name="Better Detail">Better Detail</string>
+  <string name="Surface">Surface</string>
+  <string name="Solid">Solid</string>
+  <string name="Wrap">Wrap</string>
+  <string name="Preview">Preview</string>
+  <string name="Normal">Normal</string>
 
   </strings>
-- 
cgit v1.2.3


From da4fccdb7c16d1f4a6b08f17bb0ad68b5dc5be8c Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Thu, 22 Sep 2011 18:20:07 -0700
Subject: INTL-74 FIX translation for 6 languages for Set27 and Basic Set6

---
 .../newview/skins/default/xui/de/floater_about.xml | 26 ++++---
 .../default/xui/de/floater_preferences_proxy.xml   | 40 +++++++++++
 .../skins/default/xui/de/menu_inventory.xml        |  2 +
 .../skins/default/xui/de/menu_media_ctrl.xml       |  1 +
 .../skins/default/xui/de/menu_mode_change.xml      |  5 ++
 indra/newview/skins/default/xui/de/menu_viewer.xml |  2 +-
 .../newview/skins/default/xui/de/notifications.xml | 79 ++++++++++++++++++++-
 .../default/xui/de/panel_outbox_inventory.xml      |  2 +
 .../default/xui/de/panel_preferences_setup.xml     | 21 ++----
 .../skins/default/xui/de/panel_status_bar.xml      | 10 ++-
 .../skins/default/xui/de/sidepanel_inventory.xml   | 70 +++++++++++--------
 indra/newview/skins/default/xui/de/strings.xml     | 73 ++++++++++++++++++-
 .../newview/skins/default/xui/es/floater_about.xml | 26 ++++---
 .../default/xui/es/floater_preferences_proxy.xml   | 40 +++++++++++
 .../skins/default/xui/es/menu_inventory.xml        |  2 +
 .../skins/default/xui/es/menu_media_ctrl.xml       |  1 +
 .../skins/default/xui/es/menu_mode_change.xml      |  5 ++
 indra/newview/skins/default/xui/es/menu_viewer.xml |  2 +-
 .../newview/skins/default/xui/es/notifications.xml | 79 ++++++++++++++++++++-
 .../default/xui/es/panel_outbox_inventory.xml      |  2 +
 .../default/xui/es/panel_preferences_setup.xml     | 21 ++----
 .../skins/default/xui/es/panel_status_bar.xml      | 10 ++-
 .../skins/default/xui/es/sidepanel_inventory.xml   | 70 +++++++++++--------
 indra/newview/skins/default/xui/es/strings.xml     | 75 +++++++++++++++++++-
 .../newview/skins/default/xui/fr/floater_about.xml | 26 ++++---
 .../default/xui/fr/floater_preferences_proxy.xml   | 40 +++++++++++
 .../skins/default/xui/fr/menu_inventory.xml        |  2 +
 .../skins/default/xui/fr/menu_media_ctrl.xml       |  1 +
 .../skins/default/xui/fr/menu_mode_change.xml      |  5 ++
 indra/newview/skins/default/xui/fr/menu_viewer.xml |  2 +-
 .../newview/skins/default/xui/fr/notifications.xml | 79 ++++++++++++++++++++-
 .../default/xui/fr/panel_outbox_inventory.xml      |  2 +
 .../default/xui/fr/panel_preferences_setup.xml     | 21 ++----
 .../skins/default/xui/fr/panel_status_bar.xml      | 10 ++-
 .../skins/default/xui/fr/sidepanel_inventory.xml   | 70 +++++++++++--------
 indra/newview/skins/default/xui/fr/strings.xml     | 73 ++++++++++++++++++-
 .../newview/skins/default/xui/it/floater_about.xml | 26 ++++---
 .../default/xui/it/floater_preferences_proxy.xml   | 40 +++++++++++
 .../skins/default/xui/it/menu_inventory.xml        |  2 +
 .../skins/default/xui/it/menu_media_ctrl.xml       |  1 +
 .../skins/default/xui/it/menu_mode_change.xml      |  5 ++
 indra/newview/skins/default/xui/it/menu_viewer.xml |  2 +-
 .../newview/skins/default/xui/it/notifications.xml | 79 ++++++++++++++++++++-
 .../default/xui/it/panel_outbox_inventory.xml      |  2 +
 .../default/xui/it/panel_preferences_setup.xml     | 21 ++----
 .../skins/default/xui/it/panel_status_bar.xml      | 10 ++-
 .../skins/default/xui/it/sidepanel_inventory.xml   | 70 +++++++++++--------
 indra/newview/skins/default/xui/it/strings.xml     | 73 ++++++++++++++++++-
 .../newview/skins/default/xui/ja/floater_about.xml | 26 ++++---
 .../default/xui/ja/floater_preferences_proxy.xml   | 40 +++++++++++
 .../skins/default/xui/ja/menu_inventory.xml        |  2 +
 .../skins/default/xui/ja/menu_media_ctrl.xml       |  1 +
 .../skins/default/xui/ja/menu_mode_change.xml      |  5 ++
 indra/newview/skins/default/xui/ja/menu_viewer.xml |  2 +-
 .../newview/skins/default/xui/ja/notifications.xml | 79 ++++++++++++++++++++-
 .../default/xui/ja/panel_outbox_inventory.xml      |  2 +
 .../default/xui/ja/panel_preferences_setup.xml     | 21 ++----
 .../skins/default/xui/ja/panel_status_bar.xml      | 10 ++-
 .../skins/default/xui/ja/sidepanel_inventory.xml   | 70 +++++++++++--------
 indra/newview/skins/default/xui/ja/strings.xml     | 75 +++++++++++++++++++-
 .../newview/skins/default/xui/pt/floater_about.xml | 26 ++++---
 .../default/xui/pt/floater_preferences_proxy.xml   | 40 +++++++++++
 .../skins/default/xui/pt/menu_inventory.xml        |  2 +
 .../skins/default/xui/pt/menu_media_ctrl.xml       |  1 +
 .../skins/default/xui/pt/menu_mode_change.xml      |  5 ++
 indra/newview/skins/default/xui/pt/menu_viewer.xml |  2 +-
 .../newview/skins/default/xui/pt/notifications.xml | 81 +++++++++++++++++++++-
 .../default/xui/pt/panel_outbox_inventory.xml      |  2 +
 .../default/xui/pt/panel_preferences_setup.xml     | 21 ++----
 .../skins/default/xui/pt/panel_status_bar.xml      | 10 ++-
 .../skins/default/xui/pt/sidepanel_inventory.xml   | 70 +++++++++++--------
 indra/newview/skins/default/xui/pt/strings.xml     | 73 ++++++++++++++++++-
 .../newview/skins/minimal/xui/de/notifications.xml |  2 +-
 .../skins/minimal/xui/de/panel_status_bar.xml      | 17 ++---
 .../skins/minimal/xui/es/panel_status_bar.xml      | 17 ++---
 .../skins/minimal/xui/fr/panel_status_bar.xml      | 17 ++---
 .../newview/skins/minimal/xui/it/notifications.xml |  2 +-
 .../skins/minimal/xui/it/panel_status_bar.xml      | 17 ++---
 .../skins/minimal/xui/ja/panel_status_bar.xml      | 17 ++---
 .../newview/skins/minimal/xui/pt/notifications.xml |  2 +-
 .../skins/minimal/xui/pt/panel_status_bar.xml      | 17 ++---
 81 files changed, 1626 insertions(+), 474 deletions(-)
 create mode 100644 indra/newview/skins/default/xui/de/floater_preferences_proxy.xml
 create mode 100644 indra/newview/skins/default/xui/de/menu_mode_change.xml
 create mode 100644 indra/newview/skins/default/xui/de/panel_outbox_inventory.xml
 create mode 100644 indra/newview/skins/default/xui/es/floater_preferences_proxy.xml
 create mode 100644 indra/newview/skins/default/xui/es/menu_mode_change.xml
 create mode 100644 indra/newview/skins/default/xui/es/panel_outbox_inventory.xml
 create mode 100644 indra/newview/skins/default/xui/fr/floater_preferences_proxy.xml
 create mode 100644 indra/newview/skins/default/xui/fr/menu_mode_change.xml
 create mode 100644 indra/newview/skins/default/xui/fr/panel_outbox_inventory.xml
 create mode 100644 indra/newview/skins/default/xui/it/floater_preferences_proxy.xml
 create mode 100644 indra/newview/skins/default/xui/it/menu_mode_change.xml
 create mode 100644 indra/newview/skins/default/xui/it/panel_outbox_inventory.xml
 create mode 100644 indra/newview/skins/default/xui/ja/floater_preferences_proxy.xml
 create mode 100644 indra/newview/skins/default/xui/ja/menu_mode_change.xml
 create mode 100644 indra/newview/skins/default/xui/ja/panel_outbox_inventory.xml
 create mode 100644 indra/newview/skins/default/xui/pt/floater_preferences_proxy.xml
 create mode 100644 indra/newview/skins/default/xui/pt/menu_mode_change.xml
 create mode 100644 indra/newview/skins/default/xui/pt/panel_outbox_inventory.xml

diff --git a/indra/newview/skins/default/xui/de/floater_about.xml b/indra/newview/skins/default/xui/de/floater_about.xml
index 578dcd50e5..519efe9ce8 100644
--- a/indra/newview/skins/default/xui/de/floater_about.xml
+++ b/indra/newview/skins/default/xui/de/floater_about.xml
@@ -42,15 +42,23 @@ Voice-Serverversion: [VOICE_VERSION]
 			<button label="In Zwischenablage kopieren" name="copy_btn"/>
 		</panel>
 		<panel label="Danksagung" name="credits_panel">
-			<text_editor name="credits_editor">
-				Second Life wird Ihnen präsentiert von Philip, Tessa, Andrew, Cory, Ian, James, Phoenix, Ryan, Haney, Dan, Char, Ben, John, Tanya, Eddie, Richard, Mitch, Doug, Eric, Frank, Bruce, Aaron, Peter, Alice, Charlie, Debra, Eileen, Helen, Janet, Steffan, Steve, Tom, Mark, Hunter, Xenon, Burgess, Bill, Jim, Lee, Hamlet, Daniel, Jeff, Todd, Sarah, Tim, Stephanie, Colin, Michael, Evan, Nicolas, Catherine, Rachelle, Dave, Holly, Bub, Kelly, Ramzi, Don, Sabin, Jill, Rheya, Jeska, Torley, Kona, Callum, Charity, Jack, Vektor, Chris, Nicole, Mick, Reuben, Blue, Babbage, Yedwab, Deana, Lauren, Brent, Pathfinder, Chadrick, Jesse, David, Tess, Lizzie, Patsy, Isaac, Lawrence, Cyn, Bo, Gia, Annette, Marius, Tbone, Jonathan, Karen, Ginsu, Yuko, Makiko, Thomas, Harry, Seth, Brian, Guy, Runitai, Ethan, Data, Cornelius, Kenny, Swiss, Zero, Brad, Natria, Wendy, Stephen, Teeple, Thumper, Lucy, Dee, Mia, Liana, Warren, Branka, Aura, Beez, Milo, Hermia, Red, Thrax, Gulliver, Joe, Sally, Paul, Jose, Rejean, Dore, Henrik, Lexie, Amber, Logan, Xan, Nora, Morpheus, Donovan, Leyla, MichaelFrancis, Beast, Cube, Bucky, Joshua, Stryfe, Harmony, Teresa, Claudia, Walker, Glenn, Fritz, Fordak, June, Cleopetra, Ivy, Betsy, Roosevelt, Spike, Ken, Which, Tofu, Chiyo, Rob, Zee, Dustin, George, Del, Matthew, Cat, Jacqui, Adrian, Viola, Alfred, Noel, Irfan, Yool, Rika, Jane, Frontier, Neo, Siobhan, Yoz, Justin, Elle, Qarl, Benjamin, Isabel, Everett, Christopher, Izzy, Stephany, Garry, Sejong, Sean, Tobin, Iridium, Meta, Jeremy, JP, Jake, Anthony, Maurice, Madhavi, Leopard, Kyle, Joon, Bert, Belinda, Jon, Kristi, Bridie, Pramod, Socrates, Maria, Aric, Adreanne, Jay, Kari, Ceren, Coco, Durl, Jenny, Periapse, Kartic, Storrs, Lotte, Sandy, Colossus, Zen, BigPapi, Pastrami, Kurz, Mani, Neuro, Mel, Sardonyx, MJ, Rowan, Sgt, Elvis, Samuel, Leo, Bryan, Niko, Austin, Soft, Poppy, Rachel, Aki, Banzai, Alexa, Sue, Bender, CG, Angelo, Gillian, Pelle, Nick, Echo, Zara, Christine, Shamiran, Emma, Blake, Keiko, Plexus, Joppa, Sidewinder, Erica, Ashlei, Twilight, Kristen, Brett, Q, Enus, Simon, Bevis, Kraft, Kip, Chandler, Ron, LauraP, Ram, KyleJM, Scouse, Prospero, Melissa, Marty, Nat, Hamilton, Kend, Lordan, Jimmy, Kosmo, Seraph, Green, Ekim, Wiggo, JT, Rome, Doris, Miz, Benoc, Whump, Trinity, Patch, Kate, TJ, Bao, Joohwan, Christy, Sofia, Matias, Cogsworth, Johan, Oreh, Cheah, Angela, Brandy, Mango, Lan, Aleks, Gloria, Mitchell, Space, Colton, Bambers, Einstein, Maggie, Malbers, Rose, Rothman, Niall, Marin, Allison, Katie, Dawn, Dusty, Katt, Judy, Andrea, Ambroff, Infinity, Rico, Gail, Kalpana, Raymond, Yi, William, Christa, M, Teagan, Scout, Molly, Dante, Corr, Dynamike, Usi, Kaylee, Lil, Danica, Sascha, Kelv, Jacob, Nya, Rodney, Brandon, Elsie, Blondin, Grant, Katrin, Nyx, Gabriel, Locklainn, Claire, Devin, Minerva, Monty, Bradford, Si, Keira, H, Caitlin, Dita, Makai, Jenn, Ann, Meredith, Clare, Joy, Praveen, Cody, Edmund, Ruthe, Sirena, Gayathri, Spider, FJ, Davidoff, Tian, Jennie, Louise, Oskar, Landon, Noelle, Jarv, Ingrid, Al, Sommer, Doc, Aria, Huin, Gray, Lili, Vir, DJ, Maestro, Simone, Yang, T, Shannon, Nelson, Khanh, Scott, Courtney, Charlene, Quixote, Susan, Zed, Amanda, Katelin, Enkidu, Roxie, Esbee, JoRoan, Scarlet, Tay, Kevin, Wolfgang, Johnny, Ray, Andren, Merov, Bob, Rand, Howard, Callen, Heff, Galen, Newell, Dessie, Les, Michon, Jenelle, Geo, Siz, Shapiro, Pete, Calyle, Selene, Allen, Phoebe, Goldin, Kimmora, Dakota, Slaton, Lindquist, Zoey, Hari, Othello, Rohit, Sheldon, Petra, Viale, Gordon, Kaye, Pink, Ferny, Emerson, Davy, Bri, Chan, Juan, Robert, Terrence, Nathan, Carl, Ashley, JessieAnn, Huseby, Karina, Paris, Kurt, Rick, Lis, Kotler, Theeba, Lynx, Murphy, Doten, Taka, Norm, Jillian, Marcus, Mae, Novack, Esther, Perry, Dana, Ducot, Javier, Porter, Madison, Gecko, Dough, JR, Gisele, Crimp, Norie, Arch, Kimi, Fisher, Barbara, Jason, Peggy, Bernard, Jules, Leroy, Eva, Khederian, Campbell, Vogt, Masido, Karel, Torres, Lo, Breezer, Delby, Rountree, Anna, Servus, Rue, Itiaes, Chuck, Luna, Novella, Zaza, Wen, Gino, Lex, Cassandra, Limey, Nancy, Anukul, Silver, Brodesky, Jinsai, Squid, Gez, Rakesh, Ladan, Edelman, Marcet, Squire, Tatem, Tony, Jerm, Tia, Falcon, BK, Tiggs, Driscoll, Bacon, Timothee, Cru, Carmilla, Coyot, Webb, Kazu, Rudas, LJ, Sea, Ali Wallace, Bewest, Pup, Drub, Dragon, Inoshiro, Byron, Rhett, Xandix, Aimee, Fredrik, Thor, Teddy, Baron, Nelly, Ghengis, Epic, Eli, Stone, Grapes, Irie, Prep, Scobu, Valerie, Alain und vielen anderen.
-
-Wir bedanken uns bei folgenden Einwohnern, die uns geholfen haben, dies zur bisher besten Version zu machen: Drew Dwi, Zai Lynch, Latif Khalifa, Ellla McMahon, Harleen Gretzky, Squirrel Wood, Malarthi Behemoth, Dante Tucker, Buckaroo Mu, Eddi Decosta, Dirk, Talamasca, Torben Trautman, Irene Muni, Aralara Rajal, Aura Dirval, Cayu Cluny, Eva Rau, FreeSL Aeon, Frontera Thor, Inma Rau, Lunita Savira, Minerva Memel, Polo Gufler, Xiki Luik, Lilly Zenovka, Vick Forcella, Sasy Scarborough, Gentle Welinder, Elric Anatine, Techwolf Lupindo, Dusan Writer, WolfPup Lowenhar, Marianne McCann, Fiachra Lach, Sitearm Madonna, Sudane Erato, Sahkolihaa Contepomi, Sachi Vixen, Questar Utu, Dimitrio Lewis, Matto Destiny, Scrim Pinion, Radio Signals, Psi Merlin, Pixel Gausman, Mel Vanbeeck, Laurent Bechir, Lamorna Proctor, Lares Carter, Gwyneth Llewelyn, Hydra Shaftoe, Holger Gilruth, Gentle Heron, Carla Broek, Boroondas Gupte, Fury Rosewood, Flower Ducatillon, Colpo Wexler, gwampa Lomu, Borg Capalini, Beansy Twine, Ardy Lay, , 45ms Zhong, Adeon Writer, Aeonix Aeon, Ai Austin, Aiko Ying, Alexandrea Fride, Alliez Mysterio, Annie Milestone, Annika Genezzia, Ansariel Hiller, ArminasX Saiman, Arya Braveheart, Asaeda Meltingdots, Asturkon Jua, Avallyn Oakleaf, Avatar Quinzet, BabyA Littlething, Bacchus Ireto, Bazaar, Riva, Benjamin Bigdipper, Beth Walcher, Bezilon Kasei, Biancaluce Robbiani, Bill Walach, blakopal Galicia, Blitzckreed Levenque, Bryn Oh, Callipygian Christensen, Cap Carver, Carr Arbenlow, Chantal Harvey, Charles Courtois, Charlie Sazaland, Cherry Cheevers, ChickyBabes Zuzu, Christopher  Organiser, Ciaran Laval, Clara Young, Celierra Darling, Corinne Helendale, Corro Moseley, Coughdrop Littlething, Darien Caldwell, Dartagan Shepherd, Debs Regent, Decro Schmooz, Denim Kamachi, DiJodi Dubratt, Dil Spitz, Edgware Marker, Egehan Dryke, Emma Portilo, Emmie Fairymeadow, Evangelista Emerald, Faelon Swordthain, Frenchimmo Sabra, Gaberoonie Zanzibar, Ganymedes Costagravas, Gene Frostbite, GeneJ Composer, Giggles Littlebird, Grady Echegaray, Guni Greenstein, Gypsy Tripsa, Hackshaven Harford, Ham Rambler, Han Shuffle, Hanglow Short, Hatzfeld Runo, herina Bode, Horatio Freund, Hypatia Callisto, Hypatia Pickens, Identity Euler, Imnotgoing Sideways, Innula Zenovka, Iyoba Tarantal, Jack Abraham, Jagga Meredith, Jennifer Boyle, Jeremy Marquez, Jessica Qin, Jinx Nordberg, Jo Bernandes, Jocial Sonnenkern, Joel Savard, Jondan Lundquist, Josef Munster, Josette Windlow, Juilan Tripsa, Juro Kothari, Justin RiversRunRed, Kagehi Kohn, Kaimen Takahe, Keklily Longfall, Ken Lavender, Kestral Karas, Khisme Nitely, Kimar Coba, Kithrak Kirkorian, Kitty Barnett, Kolor Fall, Komiko Okamoto, Korvel Noh, Larry Pixel, Leal Choche, len Starship, Lenae Munz, Lexi Frua, Lillie Cordeaux, Lizzy Macarthur, LSL Scientist, Luban Yiyuan, Luc Starsider, Maccus McCullough, Madison Blanc, Maggie Darwin, Mallory Destiny, Manx Wharton, Marc Claridge, Marc2 Sands, Matthew Anthony, Maxim RiversRunRed, Medhue Simoni, Melinda Latynina, Mencius Watts, Michi Lumin, Midian Farspire, Miles Glaz, Mindy Mathy, Mitch Wagner, Mo Hax, Mourna Biziou, Nao Noe, naofan Teardrop, Naomah Beaumont, Nathiel Siamendes, Nber Medici, Neko Link, Netpat Igaly, Neutron Chesnokov, Newfie Pendragon, Nicholai Laviscu, Nick Rhodes, Nicoladie Gymnast, Ollie Kubrick, Orenj Marat, Orion Delphis, Oryx Tempel, Parvati Silverweb, PeterPunk Mooney, Pixel Scientist, Pounce Teazle, Professor Noarlunga, Quantum Destiny, Quicksilver Hermes, Ralf Setsuko, RAT Quan, RedMokum Bravin, Revolution Perenti, Rezit Sideways, Rich Grainger, Rosco Teardrop, Rose Evans, Rudee Voom, RufusTT Horsefly, Saii Hallard, SaintLEOlions Zimer, Samm Larkham, Satanello Miami, SexySteven Morrisey, Sheet Spotter, Shnurui Troughton, sicarius Thorne, Sicarius Toxx, Sini Nubalo, SLB Wirefly, snowy Sidran, Soupa Segura, ST Mensing, Starshine Halasy, Stickman Ingmann, Synystyr Texan, Takeda Terrawyng, Tali Rosca, Templar Merlin, Tezcatlipoca Bisiani, Tiel Stonecutter, Tony Kembia, TouchaHoney Perhaps, Trey Reanimator, TriloByte Zanzibar, Trinity Dechou, Trinity Dejavu, Unlikely Quintessa, UsikuFarasi Kanarik, Veritas Raymaker, Vex Streeter, Viaticus Speculaas, Villain Baroque, Vixie Durant, Void Singer, Watty Berkson, Westley Schridde, Westley Streeter, Whimsy Winx, Winter Ventura, Wundur Primbee, xstorm Radek, YongYong Francois, Zak Westminster, Zana Kohime, Zaren Alexander, Zeja Pyle, ZenMondo Wormser, Zoex Flanagan und vielen anderen.
-
-
-
-
-„Die Arbeit beginnt aufs Neue, die Hoffnung lebt weiter, und der Traum wird niemals sterben.“ - Edward Kennedy
+			<text name="linden_intro">
+				Second Life wird präsentiert von den Lindens:
+			</text>
+			<text_editor name="linden_names">
+				Philip, Andrew, Doug, Richard, Phoenix, Ian, Mark, Robin, Dan, Char, Ryan, Eric, Jim, Lee, Jeff, Michael, Kelly, Steve, Catherine, Bub, Ramzi, Jill, Jeska, Don, Kona, Callum, Charity, Jack, Shawn, babbage, James, Lauren, Blue, Brent, Reuben, Pathfinder, Jesse, Patsy, Torley, Bo, Cyn, Jonathan, Gia, Annette, Ginsu, Harry, Lex, Runitai, Guy, Cornelius, Beth, Swiss, Thumper, Wendy, Teeple, Seth, Dee, Mia, Sally, Liana, Aura, Beez, Milo, Red, Gulliver, Marius, Joe, Jose, Dore, Justin, Nora, Morpheus, Lexie, Amber, Chris, Xan, Leyla, Walker, Sabin, Joshua, Hiromi, Tofu, Fritz, June, Jean, Ivy, Dez, Ken, Betsy, Which, Spike, Rob, Zee, Dustin, George, Claudia, del, Matthew, jane, jay, Adrian, Yool, Rika, Yoz, siobhan, Qarl, Benjamin, Beast, Everett, madhavi, Christopher, Izzy, stephany, Jeremy, sean, adreanne, Pramod, Tobin, sejong, Iridium, maurice, kj, Meta, kari, JP, bert, kyle, Jon, Socrates, Bridie, Ivan, maria, Aric, Coco, Periapse, sandy, Storrs, Lotte, Colossus, Brad, Pastrami, Zen, BigPapi, Banzai, Sardonyx, Mani, Garry, Jaime, Neuro, Samuel, Niko, CeeLo, Austin, Soft, Poppy, emma, tessa, angelo, kurz, alexa, Sue, CG, Blake, Erica, Brett, Bevis, kristen, Q, simon, Enus, MJ, laurap, Kip, Scouse, Ron, Ram, kend, Marty, Prospero, melissa, kraft, Nat, Seraph, Hamilton, Lordan, Green, miz, Ashlei, Trinity, Ekim, Echo, Charlie, Rowan, Rome, Jt, Doris, benoc, Christy, Bao, Kate, Tj, Patch, Cheah, Johan, Brandy, Angela, Oreh, Cogsworth, Lan, Mitchell, Space, Bambers, Einstein, Bender, Malbers, Matias, Maggie, Rothman, Milton, Niall, Marin, Allison, Mango, Andrea, Katt, Yi, Ambroff, Rico, Raymond, Gail, Christa, William, Dawn, Usi, Dynamike, M, Corr, Dante, Molly, kaylee, Danica, Kelv, Lil, jacob, Nya, Rodney, elsie, Blondin, Grant, Nyx, Devin, Monty, Minerva, Keira, Katie, Jenn, Makai, Clare, Joy, Cody, Gayathri, FJ, spider, Oskar, Landon, Jarv, Noelle, Al, Doc, Gray, Vir, t, Maestro, Simone, Shannon, yang, Courtney, Scott, charlene, Quixote, Susan, Zed, Amanda, Katelin, Esbee, JoRoan, Enkidu, roxie, Scarlet, Merov, Kevin, Judy, Rand, Newell, Les, Dessie, Galen, Michon, Geo, Siz, Calyle, Pete, Praveen, Callen, Sheldon, Pink, Nelson, jenelle, Terrence, Nathan, Juan, Sascha, Huseby, Karina, Kaye, Kotler, Lis, Darv, Charrell, Dakota, Kimmora, Theeba, Taka, Mae, Perry, Ducot, dana, Esther, Dough, gisele, Doten, Viale, Fisher, jessieann, ashley, Torres, delby, rountree, kurt, Slaton, Madison, Rue, Gino, Wen, Casssandra, Brodesky, Squid, Gez, Rakesh, Gecko, Ladan, Tony, Tatem, Squire, Falcon, BK, Crimp, Tiggs, Bacon, Coyot, Carmilla, Webb, Sea, Arch, Jillian, Jason, Bernard, Vogt, Peggy, dragon, Pup, xandix, Wallace, Bewest, Inoshiro, Rhett, AG, Aimee, Ghengis, Itiaes, Eli, Steffan, Epic, Grapes, Stone, Prep, Scobu, Robert, Alain, Carla, Vicky, Tia, Alec, Taras, Lisa, Oz, Ariane, Log, House, Kazu, Kim, Drofnas, Tyler, Campbell, Michele, Madeline, Nelly, Baron, Thor, Lori, Hele, Fredrik, Teddy, Pixie, Berry, Gabrielle, Alfonso, Brooke, Wolf, Ringo, Cru, Charlar, Rodvik, Gibson, Elise, Bagman, Greger, Leonidas, Jerm, Leslie, CB, Brenda, Durian, Carlo, mm, Zeeshan, Caleb, Max, Elikak, Mercille, Steph, Chase
+			</text_editor>
+			<text name="contrib_intro">
+				mit Open-Source-Beiträgen von:
+			</text>
+			<text_editor name="contrib_names">
+				Dummy-Name wird zur Laufzeit ersetzt
+			</text_editor>
+			<text name="trans_intro">
+				mit Übersetzungen von:
+			</text>
+			<text_editor name="trans_names">
+				Dummy Name wird zur Laufzeit ersetzt
 			</text_editor>
 		</panel>
 		<panel label="Lizenzen" name="licenses_panel">
diff --git a/indra/newview/skins/default/xui/de/floater_preferences_proxy.xml b/indra/newview/skins/default/xui/de/floater_preferences_proxy.xml
new file mode 100644
index 0000000000..cdefb470c2
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/floater_preferences_proxy.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Proxy Settings Floater" title="Proxy-Einstellungen">
+	<check_box initial_value="false" label="HTTP-Proxy für Webseiten verwenden" name="web_proxy_enabled"/>
+	<text name="http_proxy_label">
+		HTTP-Proxy:
+	</text>
+	<line_editor name="web_proxy_editor" tool_tip="DNS-Name oder IP-Adresse des gewünschten HTTP-Proxys."/>
+	<spinner label="Portnummer:" name="web_proxy_port" tool_tip="Portnummer des gewünschten HTTP-Proxys."/>
+	<check_box label="SOCKS 5-Proxy für UDP-Verkehr verwenden" name="socks_proxy_enabled"/>
+	<text name="socks5_proxy_label">
+		SOCKS 5-Proxy:
+	</text>
+	<line_editor name="socks_proxy_editor" tool_tip="DNS-Name oder IP-Adresse des gewünschten SOCKS 5-Proxys."/>
+	<spinner label="Portnummer:" name="socks_proxy_port" tool_tip="Portnummer des gewünschten SOCKS 5-Proxys."/>
+	<text name="socks_auth_label">
+		SOCKS-Authentifizierung:
+	</text>
+	<radio_group name="socks5_auth_type">
+		<radio_item label="Keine Authentifizierung" name="Socks5NoAuth" tool_tip="SOCKS 5-Proxy erfordert keine Authentifizierung." value="Keine"/>
+		<radio_item label="Benutzername/Kennwort" name="Socks5UserPass" tool_tip="SOCKS 5-Proxy erfordert Authentifizierung per Benutzername/Kennwort." value="UserPass"/>
+	</radio_group>
+	<text name="socks5_username_label">
+		Benutzername:
+	</text>
+	<text name="socks5_password_label">
+		Kennwort:
+	</text>
+	<line_editor name="socks5_username" tool_tip="Benutzername zur Authentifizierung über Ihren SOCKS 5-Server"/>
+	<line_editor name="socks5_password" tool_tip="Kennwort zur Authentifizierung über Ihren SOCKS 5-Server"/>
+	<text name="other_proxy_label">
+		Anderer HTTP-Verkehrs-Proxy:
+	</text>
+	<radio_group name="other_http_proxy_type">
+		<radio_item label="Keinen Proxy verwenden" name="OtherNoProxy" tool_tip="Nicht-Web-HTTP-Verkehr wird an KEINEN Proxy weitergeleitet." value="Keiner"/>
+		<radio_item label="HTTP-Proxy verwenden" name="OtherHTTPProxy" tool_tip="Nicht-Web-HTTP-Verkehr wird über den konfigurierten Web-Proxy weitergeleitet." value="Web"/>
+		<radio_item label="SOCKS 5-Proxy verwenden" name="OtherSocksProxy" tool_tip="Nicht-Web-HTTP-Verkehr wird über den konfigurierten SOCKS 5-Proxy weitergeleitet." value="SOCKS"/>
+	</radio_group>
+	<button label="OK" label_selected="OK" name="OK"/>
+	<button label="Abbrechen" label_selected="Abbrechen" name="Cancel"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/de/menu_inventory.xml b/indra/newview/skins/default/xui/de/menu_inventory.xml
index 9fcd41e62a..733a0b85c3 100644
--- a/indra/newview/skins/default/xui/de/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/de/menu_inventory.xml
@@ -83,5 +83,7 @@
 	<menu_item_call label="Bearbeiten" name="Wearable Edit"/>
 	<menu_item_call label="Hinzufügen" name="Wearable Add"/>
 	<menu_item_call label="Ausziehen" name="Take Off"/>
+	<menu_item_call label="In Händler-Outbox kopieren" name="Merchant Copy"/>
+	<menu_item_call label="In Händler-Outbox verschieben" name="Merchant Move"/>
 	<menu_item_call label="--keine Optionen--" name="--no options--"/>
 </menu>
diff --git a/indra/newview/skins/default/xui/de/menu_media_ctrl.xml b/indra/newview/skins/default/xui/de/menu_media_ctrl.xml
index 781796670a..59c1c2ee86 100644
--- a/indra/newview/skins/default/xui/de/menu_media_ctrl.xml
+++ b/indra/newview/skins/default/xui/de/menu_media_ctrl.xml
@@ -3,4 +3,5 @@
 	<menu_item_call label="Ausschneiden" name="Cut"/>
 	<menu_item_call label="Kopieren" name="Copy"/>
 	<menu_item_call label="Einfügen" name="Paste"/>
+	<menu_item_call label="Webinspektor öffnen" name="open_webinspector"/>
 </context_menu>
diff --git a/indra/newview/skins/default/xui/de/menu_mode_change.xml b/indra/newview/skins/default/xui/de/menu_mode_change.xml
new file mode 100644
index 0000000000..b8090018b7
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/menu_mode_change.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<toggleable_menu name="Mode Change">
+	<menu_item_check label="Basis" name="BasicMode"/>
+	<menu_item_check label="Erweitert" name="AdvancedMode"/>
+</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/de/menu_viewer.xml b/indra/newview/skins/default/xui/de/menu_viewer.xml
index e010844206..7c6918a4ee 100644
--- a/indra/newview/skins/default/xui/de/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/de/menu_viewer.xml
@@ -138,7 +138,6 @@
 			<menu_item_call label="Sound ([COST] L$)..." name="Upload Sound"/>
 			<menu_item_call label="Animation ([COST] L$)..." name="Upload Animation"/>
 			<menu_item_call label="Modell..." name="Upload Model"/>
-			<menu_item_call label="Modellassistent..." name="Upload Model Wizard"/>
 			<menu_item_call label="Mehrfach-Upload ([COST] L$ pro Datei)..." name="Bulk Upload"/>
 		</menu>
 		<menu_item_call label="Rückgängig" name="Undo"/>
@@ -253,6 +252,7 @@
 			<menu_item_check label="Matrizen anzeigen" name="Show Matrices"/>
 			<menu_item_check label="Farbe unter Cursor anzeigen" name="Show Color Under Cursor"/>
 			<menu_item_check label="Speicher anzeigen" name="Show Memory"/>
+			<menu_item_check label="Info über privaten Speicher anzeigen" name="Show Private Mem Info"/>
 			<menu_item_check label="Akutalisierungen an Objekten anzeigen" name="Show Updates"/>
 		</menu>
 		<menu label="Fehler erzwingen" name="Force Errors">
diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml
index 1971061096..4c53c40d86 100644
--- a/indra/newview/skins/default/xui/de/notifications.xml
+++ b/indra/newview/skins/default/xui/de/notifications.xml
@@ -85,6 +85,19 @@ Stellen Sie sicher, dass Ihre Internetverbindung funktioniert.
 		Änderung an aktueller Kleidung/Körperteil speichern?
 		<usetemplate canceltext="Abbrechen" name="yesnocancelbuttons" notext="Nicht speichern" yestext="Speichern"/>
 	</notification>
+	<notification name="ConfirmNoCopyToOutbox">
+		Ihnen fehlt die Berechtigung zum Kopieren dieses Artikels in die Händler-Outbox. Möchten Sie wirklich den folgenden Artikel verschieben?
+        [ITEM_NAME]
+		<usetemplate name="okcancelbuttons" notext="Nein" yestext="Ja"/>
+	</notification>
+	<notification name="OutboxUploadComplete">
+		Marktplatz-Upload abgeschlossen.
+		<usetemplate name="okbutton" yestext="Hurra!"/>
+	</notification>
+	<notification name="OutboxUploadHadErrors">
+		Marktplatz-Upload mit Fehlern abgeschlossen. Korrigieren Sie die Fehler in Ihrer Outbox und versuchen Sie es erneut. Vielen Dank!
+		<usetemplate name="okbutton" yestext="Erneut versuchen"/>
+	</notification>
 	<notification name="CompileQueueSaveText">
 		Der Text für ein Skript konnte aus folgendem Grund nicht hochgeladen werden: [REASON]. Bitte versuchen Sie es erneut.
 	</notification>
@@ -2436,7 +2449,15 @@ Versuchen Sie es in einigen Minuten erneut.
 		<form name="form">
 			<button name="Keep" text="Behalten"/>
 			<button name="Discard" text="Verwerfen"/>
-			<button name="Mute" text="Ignorieren"/>
+			<button name="Mute" text="Eigentümer blockieren"/>
+		</form>
+	</notification>
+	<notification name="OwnObjectGiveItem">
+		Ein Objekt namens &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; hat Ihnen folgende/n/s [OBJECTTYPE] übergeben:
+&lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;
+		<form name="form">
+			<button name="Keep" text="Beibehalten"/>
+			<button name="Discard" text="Verwerfen"/>
 		</form>
 	</notification>
 	<notification name="UserGiveItem">
@@ -2580,6 +2601,7 @@ Anfrage gestatten?
 		„&lt;nolink&gt;[TITLE]&lt;/nolink&gt;“ von [NAME]
 [MESSAGE]
 		<form name="form">
+			<button name="Mute" text="Blockieren"/>
 			<button name="Ignore" text="Ignorieren"/>
 		</form>
 	</notification>
@@ -2587,6 +2609,7 @@ Anfrage gestatten?
 		„&lt;nolink&gt;[TITLE]&lt;/nolink&gt;“ von [GROUPNAME]
 [MESSAGE]
 		<form name="form">
+			<button name="Mute" text="Blockieren"/>
 			<button name="Ignore" text="Ignorieren"/>
 		</form>
 	</notification>
@@ -2915,6 +2938,12 @@ Durch Ausblenden der Schaltfläche „Sprechen“ wird die Sprechfunktion deakti
 	<notification label="Sie haben Linden-Dollar!" name="HintLindenDollar">
 		Hier wird Ihr aktueller L$-Kontostand angezeigt. Klicken Sie auf „L$ kaufen“, um mehr Linden-Dollar zu kaufen.
 	</notification>
+	<notification name="LowMemory">
+		Nicht genügend Arbeitsspeicher. Einige SL-Funktionen werden deaktiviert, um einen Absturz zu verhindern. Schließen Sie andere Anwendungen. Starten Sie SL neu, falls dieser Fehler erneut auftritt.
+	</notification>
+	<notification name="ForceQuitDueToLowMemory">
+		SL wird wegen Speichermangel in 30 Sekunden beendet.
+	</notification>
 	<notification name="PopupAttempt">
 		Ein Popup konnte nicht geöffnet werden.
 		<form name="form">
@@ -2922,6 +2951,54 @@ Durch Ausblenden der Schaltfläche „Sprechen“ wird die Sprechfunktion deakti
 			<button name="open" text="Popup-Fenster öffnen"/>
 		</form>
 	</notification>
+	<notification name="SOCKS_NOT_PERMITTED">
+		SOCKS 5-Proxy „[HOST]:[PORT]“ hat Verbindungsverbindung abgewiesen, da laut Regelsatz nicht zulässig.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_CONNECT_ERROR">
+		SOCKS 5-Proxy „[HOST]:[PORT]“ hat den Verbindungsversuch abgewiesen. Der TCP-Kanal konnte nicht geöffnet werden.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_NOT_ACCEPTABLE">
+		SOCKS 5-Proxy „[HOST]:[PORT]“ hat das ausgewählte Authentifizierungssystem abgewiesen.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_AUTH_FAIL">
+		SOCKS 5-Proxy „[HOST]:[PORT]“ hat gemeldet, dass Ihre Angaben ungültig sind.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_UDP_FWD_NOT_GRANTED">
+		SOCKS 5-Proxy „[HOST]:[PORT]“ hat die Anforderung UDP ASSOCIATE abgewiesen.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_HOST_CONNECT_FAILED">
+		Keine Verbindung möglich zum SOCKS 5-Proxy-Server „[HOST]:[PORT]“.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_UNKNOWN_STATUS">
+		Unbekannter Proxy-Fehler bei Server „[HOST]:[PORT]“.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_INVALID_HOST">
+		SOCKS-Proxy-Address oder Port „[HOST]:[PORT]“ ungültig.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_BAD_CREDS">
+		SOCKS 5-Benutzername oder -Kennwort ungültig.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="PROXY_INVALID_HTTP_HOST">
+		HTTP-Proxy-Address oder Port „[HOST]:[PORT]“ ungültig.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="PROXY_INVALID_SOCKS_HOST">
+		SOCKS-Proxy-Address oder Port „[HOST]:[PORT]“ ungültig.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="ChangeProxySettings">
+		Proxy-Einstellungen treten nach Neustart von [APP_NAME] in Kraft.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
 	<notification name="AuthRequest">
 		Für die Site „&lt;nolink&gt;[HOST_NAME]&lt;/nolink&gt;“ in der Domäne „[REALM]“ ist ein Benutzername und Kennwort erforderlich.
 		<form name="form">
diff --git a/indra/newview/skins/default/xui/de/panel_outbox_inventory.xml b/indra/newview/skins/default/xui/de/panel_outbox_inventory.xml
new file mode 100644
index 0000000000..4006022ffc
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/panel_outbox_inventory.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<outbox_inventory_panel name="inventory_outbox" tool_tip="Legen Sie Artikel hier ab, um sie zum Verkauf in Ihrem Laden vorzubereiten"/>
diff --git a/indra/newview/skins/default/xui/de/panel_preferences_setup.xml b/indra/newview/skins/default/xui/de/panel_preferences_setup.xml
index 490cead17d..8b18bf8659 100644
--- a/indra/newview/skins/default/xui/de/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/de/panel_preferences_setup.xml
@@ -11,17 +11,6 @@
 	</text>
 	<check_box label="Eigener Port" name="connection_port_enabled"/>
 	<spinner label="Port-Nummer:" name="connection_port"/>
-	<text name="cache_size_label_l">
-		Cachegröße
-	</text>
-	<text name="text_box5">
-		MB
-	</text>
-	<text name="Cache location">
-		Cache-Ordner:
-	</text>
-	<button label="Durchsuchen" label_selected="Durchsuchen" name="set_cache"/>
-	<button label="Zurücksetzen" label_selected="Zurücksetzen" name="reset_cache"/>
 	<text name="Web:">
 		Web:
 	</text>
@@ -33,12 +22,6 @@
 	<check_box initial_value="true" label="Cookies annehmen" name="cookies_enabled"/>
 	<check_box initial_value="true" label="Javascript aktivieren" name="browser_javascript_enabled"/>
 	<check_box initial_value="false" label="Medienbrowser-Popups aktivieren" name="media_popup_enabled"/>
-	<check_box initial_value="false" label="Web-Proxy aktivieren" name="web_proxy_enabled"/>
-	<text name="Proxy location">
-		Proxy-Standort:
-	</text>
-	<line_editor name="web_proxy_editor" tool_tip="Name oder IP Adresse des Proxyservers, den Sie benutzen möchten"/>
-	<spinner label="Portnummer:" name="web_proxy_port"/>
 	<text name="Software updates:">
 		Softwareupdates:
 	</text>
@@ -46,4 +29,8 @@
 		<combo_box.item label="Automatisch installieren" name="Install_automatically"/>
 		<combo_box.item label="Updates manuell herunterladen und installieren" name="Install_manual"/>
 	</combo_box>
+	<text name="Proxy Settings:">
+		Proxy-Einstellungen:
+	</text>
+	<button label="Proxy-Einstellungen ändern" label_selected="Durchsuchen" name="set_proxy"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/de/panel_status_bar.xml b/indra/newview/skins/default/xui/de/panel_status_bar.xml
index 04ed58f944..e9de350ee7 100644
--- a/indra/newview/skins/default/xui/de/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/de/panel_status_bar.xml
@@ -1,11 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="status">
-	<panel.string name="StatBarDaysOfWeek">
-		Sonntag:Montag:Dienstag:Mittwoch:Donnerstag:Freitag:Samstag
-	</panel.string>
-	<panel.string name="StatBarMonthsOfYear">
-		Januar:Februar:März:April:Mai:Juni:Juli:August:September:Oktober:November:Dezember
-	</panel.string>
 	<panel.string name="packet_loss_tooltip">
 		Paketverlust
 	</panel.string>
@@ -25,6 +19,10 @@
 		<text name="balance" tool_tip="Klicken, um L$-Guthaben zu aktualisieren" value="20 L$"/>
 		<button label="L$ kaufen" name="buyL" tool_tip="Hier klicken, um mehr L$ zu kaufen"/>
 	</panel>
+	<combo_box name="mode_combo" tool_tip="Wählen Sie den gewünschten Modus aus. Basismodus: Second Life schnell und einfach erkunden und chatten. Erweiterter Modus: Zugriff auf zusätzliche Funktionen.">
+		<combo_box.item label="Basismodus" name="Basic"/>
+		<combo_box.item label="Erweiterter Modus" name="Advanced"/>
+	</combo_box>
 	<text name="TimeText" tool_tip="Aktuelle Zeit (Pazifik)">
 		24:00 H PST
 	</text>
diff --git a/indra/newview/skins/default/xui/de/sidepanel_inventory.xml b/indra/newview/skins/default/xui/de/sidepanel_inventory.xml
index 3dd1bfb357..674ea3376b 100644
--- a/indra/newview/skins/default/xui/de/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/de/sidepanel_inventory.xml
@@ -2,35 +2,47 @@
 <panel label="Sonstiges" name="objects panel">
 	<panel label="" name="sidepanel__inventory_panel">
 		<layout_stack name="inventory_layout_stack">
-			<layout_panel name="inbox_layout_panel">
-				<panel label="" name="marketplace_inbox">
-					<string name="InboxLabelWithArg">
-						Erhaltene Objekte ([NUM])
-					</string>
-					<string name="InboxLabelNoArg">
-						Erhaltene Objekte
-					</string>
-					<button label="Erhaltene Objekte" name="inbox_btn"/>
-					<text name="inbox_fresh_new_count">
-						[NUM] neu
-					</text>
-					<panel tool_tip="Drag and drop items to your inventory to manage and use them">
-						<text name="inbox_inventory_placeholder">
-							Einkäufe auf dem Marktplatz werden hierher geliefert.
-						</text>
-					</panel>
-				</panel>
-			</layout_panel>
-			<layout_panel name="outbox_layout_panel">
-				<panel label="" name="marketplace_outbox">
-					<button label="Händler-Outbox" name="outbox_btn"/>
-					<button label="" name="outbox_sync_btn" tool_tip="Zu meiner Marktplatz-Storefront verschieben"/>
-					<panel tool_tip="Drag and drop items here to prepare them for sale on your storefront">
-						<text name="outbox_inventory_placeholder">
-							Richtigen Sie ein Händlerkonto ein, um diese Funktion zu verwenden.
-						</text>
-					</panel>
-				</panel>
+			<layout_panel name="inbox_outbox_layout_panel">
+				<layout_stack name="inbox_outbox_layout_stack">
+					<layout_panel name="inbox_layout_panel">
+						<panel label="" name="marketplace_inbox">
+							<string name="InboxLabelWithArg">
+								Erhaltene Artikel ([NUM])
+							</string>
+							<string name="InboxLabelNoArg">
+								Erhaltene Artikel
+							</string>
+							<button label="Erhaltene Artikel" name="inbox_btn"/>
+							<text name="inbox_fresh_new_count">
+								[NUM] neu
+							</text>
+							<panel tool_tip="Drag and drop items to your inventory to manage and use them">
+								<text name="inbox_inventory_placeholder">
+									Einkäufe auf dem Marktplatz werden hierher geliefert.
+								</text>
+							</panel>
+						</panel>
+					</layout_panel>
+					<layout_panel name="outbox_layout_panel">
+						<panel label="" name="marketplace_outbox">
+							<string name="OutboxLabelWithArg">
+								Händler-Outbox ([NUM])
+							</string>
+							<string name="OutboxLabelNoArg">
+								Händler-Outbox
+							</string>
+							<button label="Händler-Outbox" name="outbox_btn"/>
+							<button label="" name="outbox_sync_btn" tool_tip="In meinen Marktplatz-Laden verschieben"/>
+							<panel>
+								<panel name="outbox_inventory_placeholder_panel">
+									<text name="outbox_inventory_placeholder_title">
+										Laden...
+									</text>
+								</panel>
+							</panel>
+						</panel>
+					</layout_panel>
+				</layout_stack>
 			</layout_panel>
 		</layout_stack>
 		<panel name="button_panel">
diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml
index 902f97efab..435f3494b0 100644
--- a/indra/newview/skins/default/xui/de/strings.xml
+++ b/indra/newview/skins/default/xui/de/strings.xml
@@ -339,6 +339,18 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden.
 		Sie können nur ein einzelnes Objekt hierher ziehen
 	</string>
 	<string name="TooltipPrice" value="[AMOUNT] L$"/>
+	<string name="TooltipOutboxNoTransfer">
+		Eines oder mehrere dieser Objekte können nicht verkauft oder an einen anderen Benutzer übertragen werden.
+	</string>
+	<string name="TooltipOutboxWorn">
+		Sie tragen eines oder mehrere dieser Objekte. Nehmen Sie es/sie von Ihrem Avatar ab und versuchen Sie dann erneut, es/sie zu verschieben.
+	</string>
+	<string name="TooltipOutboxFolderLevels">
+		Dieser Ordner hat zu viele Unterordnerebenen. Ordnen Sie die Unterordner so an, dass maximal vier Verschachtelungsebenen vorhanden sind (Stammordner enthält A enthält B enthält C).
+	</string>
+	<string name="TooltipOutboxTooManyObjects">
+		Dieser Ordner enthält mehr als 200 Objekte. Verpacken Sie einige dieser Artikel in Behältern, um die Anzahl zu verringern.
+	</string>
 	<string name="TooltipHttpUrl">
 		Anklicken, um Webseite anzuzeigen
 	</string>
@@ -1204,8 +1216,65 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden.
 	<string name="InventoryInboxNoItems">
 		Objekte, die auf dem Marktplatz gekauft wurden, werden hierher geliefert.
 	</string>
+	<string name="MarketplaceURL">
+		http://marketplace.[DOMAIN_NAME]
+	</string>
+	<string name="MarketplaceURL_CreateStore">
+		http://marketplace.[DOMAIN_NAME]/create_store
+	</string>
+	<string name="MarketplaceURL_LearnMore">
+		http://marketplace.[DOMAIN_NAME]/learn_more
+	</string>
+	<string name="InventoryOutboxCreationErrorTitle">
+		Ihre Händler-Outbox ist nicht richtig konfiguriert
+	</string>
+	<string name="InventoryOutboxCreationErrorTooltip">
+		Konfigurationsfehler in Händler-Outbox
+	</string>
+	<string name="InventoryOutboxCreationError">
+		Wenden Sie sich zur Behebung des Problems an den Kundendienst.
+	</string>
+	<string name="InventoryOutboxNotMerchantTitle">
+		Jeder kann Artikel im Marktplatz verkaufen
+	</string>
+	<string name="InventoryOutboxNotMerchantTooltip">
+		Werden Sie Händler!
+	</string>
+	<string name="InventoryOutboxNotMerchant">
+		[[MARKETPLACE_URL] Im Second Life Marktplatz] werden über eine Million virtuelle Produkte zum Verkauf angeboten, die alle von Einwohnern erstellt wurden. Auch Sie können selbst erstellte Artikel sowie bestimmte gekaufte Artikel verkaufen. Die Einrichtung eines Händlerkontos geht blitzschnell und ist kostenlos. [[LEARN_MORE_URL] Lesen Sie weitere Informationen] oder [[CREATE_STORE_URL] öffnen Sie einen Laden] im Marktplatz, um Ihre Objekte zu verkaufen.
+	</string>
+	<string name="InventoryOutboxNoItemsTitle">
+		Eine neue Methode, um Artikel in den Marktplatz zu übertragen
+	</string>
+	<string name="InventoryOutboxNoItemsTooltip">
+		Legen Sie Artikel hier ab, um sie zum Verkauf im Marktplatz vorzubereiten
+	</string>
 	<string name="InventoryOutboxNoItems">
-		Objekte hierher ziehen, um Sie in Ihrer Marktplatz-Storefront zum Verkauf anzubieten.
+		Ziehen Sie zu verkaufende Artikel oder Ordner in diesen Bereich. Es erscheinen Kopien der Artikel; Ihr Inventar bleibt unverändert, es sei denn, es handelt sich um einen nicht kopierbaren Artikel. Wenn die Artikel in den Marktplatz übertragen werden sollen, klicken Sie auf die Schaltfläche „Hochladen“. Nach Übertragung der Artikel in Ihr Marktplatz-Inventar verschwinden sie aus diesem Ordner.
+	</string>
+	<string name="Marketplace Error None">
+		Keine Fehler
+	</string>
+	<string name="Marketplace Error Not Merchant">
+		Fehler: Bevor Sie Artikel in den Marktplatz übertragen können, müssen Sie sich als Händler registrieren (kostenlos).
+	</string>
+	<string name="Marketplace Error Empty Folder">
+		Fehler: Dieser Ordner ist leer.
+	</string>
+	<string name="Marketplace Error Unassociated Products">
+		Fehler: Dieser Artikel konnte nicht hochgeladen werden, da in Ihrem Händlerkonto zu viele Artikel nicht mit Produkten verknüpft sind. Um diesen Fehler zu beheben, melden Sie sich auf der Marktplatz-Website an und reduzieren Sie die Anzahl von Artikeln, die nicht mit Produkten verknüpft sind.
+	</string>
+	<string name="Marketplace Error Object Limit">
+		Fehler: Dieser Artikel enthält zu viele Objekte. Beheben Sie diesen Fehler, indem Sie Objekte zusammen in Behältern verpacken, um die Objektanzahl auf unter 200 zu verringern.
+	</string>
+	<string name="Marketplace Error Folder Depth">
+		Fehler: Dieser Artikel enthält zu viele verschachtelte Ordnerebenen. Organisieren Sie ihn neu, sodass maximal drei verschachtelte Ordnerebenen vorhanden sind.
+	</string>
+	<string name="Marketplace Error Unsellable Item">
+		Fehler: Dieser Artikel kann nicht im Marktplatz verkauft werden.
+	</string>
+	<string name="Marketplace Error Internal Import">
+		Fehler: Bei diesem Artikel ist ein Problem aufgetreten. Versuchen Sie es später erneut.
 	</string>
 	<string name="no_transfer" value=" (kein Transferieren)"/>
 	<string name="no_modify" value=" (kein Bearbeiten)"/>
@@ -4185,7 +4254,7 @@ Missbrauchsbericht
 	<string name="Female - Wow">
 		Weiblich - Wow
 	</string>
-	<string name="/bow">
+	<string name="/bow1">
 		/verbeugen
 	</string>
 	<string name="/clap">
diff --git a/indra/newview/skins/default/xui/es/floater_about.xml b/indra/newview/skins/default/xui/es/floater_about.xml
index 125eb79d04..93bb8444b4 100644
--- a/indra/newview/skins/default/xui/es/floater_about.xml
+++ b/indra/newview/skins/default/xui/es/floater_about.xml
@@ -42,15 +42,23 @@ Versión del servidor de voz: [VOICE_VERSION]
 			<button label="Copiar al portapapeles" name="copy_btn" width="165"/>
 		</panel>
 		<panel label="Créditos" name="credits_panel">
-			<text_editor name="credits_editor">
-				Te ofrecen Second Life Philip, Tessa, Andrew, Cory, Ian, James, Phoenix, Ryan, Haney, Dan, Char, Ben, John, Tanya, Eddie, Richard, Mitch, Doug, Eric, Frank, Bruce, Aaron, Peter, Alice, Charlie, Debra, Eileen, Helen, Janet, Steffan, Steve, Tom, Mark, Hunter, Xenon, Burgess, Bill, Jim, Lee, Hamlet, Daniel, Jeff, Todd, Sarah, Tim, Stephanie, Colin, Michael, Evan, Nicolas, Catherine, Rachelle, Dave, Holly, Bub, Kelly, Ramzi, Don, Sabin, Jill, Rheya, Jeska, Torley, Kona, Callum, Charity, Jack, Vektor, Chris, Nicole, Mick, Reuben, Blue, Babbage, Yedwab, Deana, Lauren, Brent, Pathfinder, Chadrick, Jesse, David, Tess, Lizzie, Patsy, Isaac, Lawrence, Cyn, Bo, Gia, Annette, Marius, Tbone, Jonathan, Karen, Ginsu, Yuko, Makiko, Thomas, Harry, Seth, Brian, Guy, Runitai, Ethan, Data, Cornelius, Kenny, Swiss, Zero, Brad, Natria, Wendy, Stephen, Teeple, Thumper, Lucy, Dee, Mia, Liana, Warren, Branka, Aura, Beez, Milo, Hermia, Red, Thrax, Gulliver, Joe, Sally, Paul, Jose, Rejean, Dore, Henrik, Lexie, Amber, Logan, Xan, Nora, Morpheus, Donovan, Leyla, MichaelFrancis, Beast, Cube, Bucky, Joshua, Stryfe, Harmony, Teresa, Claudia, Walker, Glenn, Fritz, Fordak, June, Cleopetra, Ivy, Betsy, Roosevelt, Spike, Ken, Which, Tofu, Chiyo, Rob, Zee, Dustin, George, Del, Matthew, Cat, Jacqui, Adrian, Viola, Alfred, Noel, Irfan, Yool, Rika, Jane, Frontier, Neo, Siobhan, Yoz, Justin, Elle, Qarl, Benjamin, Isabel, Everett, Christopher, Izzy, Stephany, Garry, Sejong, Sean, Tobin, Iridium, Meta, Jeremy, JP, Jake, Anthony, Maurice, Madhavi, Leopard, Kyle, Joon, Bert, Belinda, Jon, Kristi, Bridie, Pramod, Socrates, Maria, Aric, Adreanne, Jay, Kari, Ceren, Coco, Durl, Jenny, Periapse, Kartic, Storrs, Lotte, Sandy, Colossus, Zen, BigPapi, Pastrami, Kurz, Mani, Neuro, Mel, Sardonyx, MJ, Rowan, Sgt, Elvis, Samuel, Leo, Bryan, Niko, Austin, Soft, Poppy, Rachel, Aki, Banzai, Alexa, Sue, Bender, CG, Angelo, Gillian, Pelle, Nick, Echo, Zara, Christine, Shamiran, Emma, Blake, Keiko, Plexus, Joppa, Sidewinder, Erica, Ashlei, Twilight, Kristen, Brett, Q, Enus, Simon, Bevis, Kraft, Kip, Chandler, Ron, LauraP, Ram, KyleJM, Scouse, Prospero, Melissa, Marty, Nat, Hamilton, Kend, Lordan, Jimmy, Kosmo, Seraph, Green, Ekim, Wiggo, JT, Rome, Doris, Miz, Benoc, Whump, Trinity, Patch, Kate, TJ, Bao, Joohwan, Christy, Sofia, Matias, Cogsworth, Johan, Oreh, Cheah, Angela, Brandy, Mango, Lan, Aleks, Gloria, Mitchell, Space, Colton, Bambers, Einstein, Maggie, Malbers, Rose, Rothman, Niall, Marin, Allison, Katie, Dawn, Dusty, Katt, Judy, Andrea, Ambroff, Infinity, Rico, Gail, Kalpana, Raymond, Yi, William, Christa, M, Teagan, Scout, Molly, Dante, Corr, Dynamike, Usi, Kaylee, Lil, Danica, Sascha, Kelv, Jacob, Nya, Rodney, Brandon, Elsie, Blondin, Grant, Katrin, Nyx, Gabriel, Locklainn, Claire, Devin, Minerva, Monty, Bradford, Si, Keira, H, Caitlin, Dita, Makai, Jenn, Ann, Meredith, Clare, Joy, Praveen, Cody, Edmund, Ruthe, Sirena, Gayathri, Spider, FJ, Davidoff, Tian, Jennie, Louise, Oskar, Landon, Noelle, Jarv, Ingrid, Al, Sommer, Doc, Aria, Huin, Gray, Lili, Vir, DJ, Maestro, Simone, Yang, T, Shannon, Nelson, Khanh, Scott, Courtney, Charlene, Quixote, Susan, Zed, Amanda, Katelin, Enkidu, Roxie, Esbee, JoRoan, Scarlet, Tay, Kevin, Wolfgang, Johnny, Ray, Andren, Merov, Bob, Rand, Howard, Callen, Heff, Galen, Newell, Dessie, Les, Michon, Jenelle, Geo, Siz, Shapiro, Pete, Calyle, Selene, Allen, Phoebe, Goldin, Kimmora, Dakota, Slaton, Lindquist, Zoey, Hari, Othello, Rohit, Sheldon, Petra, Viale, Gordon, Kaye, Pink, Ferny, Emerson, Davy, Bri, Chan, Juan, Robert, Terrence, Nathan, Carl, Ashley, JessieAnn, Huseby, Karina, Paris, Kurt, Rick, Lis, Kotler, Theeba, Lynx, Murphy, Doten, Taka, Norm, Jillian, Marcus, Mae, Novack, Esther, Perry, Dana, Ducot, Javier, Porter, Madison, Gecko, Dough, JR, Gisele, Crimp, Norie, Arch, Kimi, Fisher, Barbara, Jason, Peggy, Bernard, Jules, Leroy, Eva, Khederian, Campbell, Vogt, Masido, Karel, Torres, Lo, Breezer, Delby, Rountree, Anna, Servus, Rue, Itiaes, Chuck, Luna, Novella, Zaza, Wen, Gino, Lex, Cassandra, Limey, Nancy, Anukul, Silver, Brodesky, Jinsai, Squid, Gez, Rakesh, Ladan, Edelman, Marcet, Squire, Tatem, Tony, Jerm, Tia, Falcon, BK, Tiggs, Driscoll, Bacon, Timothee, Cru, Carmilla, Coyot, Webb, Kazu, Rudas, LJ, Sea, Ali Wallace, Bewest, Pup, Drub, Dragon, Inoshiro, Byron, Rhett, Xandix, Aimee, Fredrik, Thor, Teddy, Baron, Nelly, Ghengis, Epic, Eli, Stone, Grapes, Irie, Prep, Scobu, Valerie, Alain, y muchos otros.
-
-Gracias a estos Residentes por ayudarnos a estar seguros de que, con todo, esta es la mejor versión: Drew Dwi, Zai Lynch, Latif Khalifa, Ellla McMahon, Harleen Gretzky, Squirrel Wood, Malarthi Behemoth, Dante Tucker, Buckaroo Mu, Eddi Decosta, Dirk Talamasca, Torben Trautman, Irene Muni, Aralara Rajal, Aura Dirval, Cayu Cluny, Eva Rau, FreeSL Aeon, Frontera Thor, Inma Rau, Lunita Savira, Minerva Memel, Polo Gufler, Xiki Luik, Lilly Zenovka, Vick Forcella, Sasy Scarborough, Gentle Welinder, Elric Anatine, Techwolf Lupindo, Dusan Writer, WolfPup Lowenhar, Marianne McCann, Fiachra Lach, Sitearm Madonna, Sudane Erato, Sahkolihaa Contepomi, Sachi Vixen, Questar Utu, Dimitrio Lewis, Matto Destiny, Scrim Pinion, Radio Signals, Psi Merlin, Pixel Gausman, Mel Vanbeeck, Laurent Bechir, Lamorna Proctor, Lares Carter, Gwyneth Llewelyn, Hydra Shaftoe, Holger Gilruth, Gentle Heron, Carla Broek, Boroondas Gupte, Fury Rosewood, Flower Ducatillon, Colpo Wexler, gwampa Lomu, Borg Capalini, Beansy Twine, Ardy Lay, 45ms Zhong, Adeon Writer, Aeonix Aeon, Ai Austin, Aiko Ying, Alexandrea Fride, Alliez Mysterio, Annie Milestone, Annika Genezzia, Ansariel Hiller, ArminasX Saiman, Arya Braveheart, Asaeda Meltingdots, Asturkon Jua, Avallyn Oakleaf, Avatar Quinzet, BabyA Littlething, Bacchus Ireto, Bazaar, Riva, Benjamin Bigdipper, Beth Walcher, Bezilon Kasei, Biancaluce Robbiani, Bill Walach, blakopal Galicia, Blitzckreed Levenque, Bryn Oh, Callipygian Christensen, Cap Carver, Carr Arbenlow, Chantal Harvey, Charles Courtois, Charlie Sazaland, Cherry Cheevers, ChickyBabes Zuzu, Christopher  Organiser, Ciaran Laval, Clara Young, Celierra Darling, Corinne Helendale, Corro Moseley, Coughdrop Littlething, Darien Caldwell, Dartagan Shepherd, Debs Regent, Decro Schmooz, Denim Kamachi, DiJodi Dubratt, Dil Spitz, Edgware Marker, Egehan Dryke, Emma Portilo, Emmie Fairymeadow, Evangelista Emerald, Faelon Swordthain, Frenchimmo Sabra, Gaberoonie Zanzibar, Ganymedes Costagravas, Gene Frostbite, GeneJ Composer, Giggles Littlebird, Grady Echegaray, Guni Greenstein, Gypsy Tripsa, Hackshaven Harford, Ham Rambler, Han Shuffle, Hanglow Short, Hatzfeld Runo, herina Bode, Horatio Freund, Hypatia Callisto, Hypatia Pickens, Identity Euler, Imnotgoing Sideways, Innula Zenovka, Iyoba Tarantal, Jack Abraham, Jagga Meredith, Jennifer Boyle, Jeremy Marquez, Jessica Qin, Jinx Nordberg, Jo Bernandes, Jocial Sonnenkern, Joel Savard, Jondan Lundquist, Josef Munster, Josette Windlow, Juilan Tripsa, Juro Kothari, Justin RiversRunRed, Kagehi Kohn, Kaimen Takahe, Keklily Longfall, Ken Lavender, Kestral Karas, Khisme Nitely, Kimar Coba, Kithrak Kirkorian, Kitty Barnett, Kolor Fall, Komiko Okamoto, Korvel Noh, Larry Pixel, Leal Choche, len Starship, Lenae Munz, Lexi Frua, Lillie Cordeaux, Lizzy Macarthur, LSL Scientist, Luban Yiyuan, Luc Starsider, Maccus McCullough, Madison Blanc, Maggie Darwin, Mallory Destiny, Manx Wharton, Marc Claridge, Marc2 Sands, Matthew Anthony, Maxim RiversRunRed, Medhue Simoni, Melinda Latynina, Mencius Watts, Michi Lumin, Midian Farspire, Miles Glaz, Mindy Mathy, Mitch Wagner, Mo Hax, Mourna Biziou, Nao Noe, naofan Teardrop, Naomah Beaumont, Nathiel Siamendes, Nber Medici, Neko Link, Netpat Igaly, Neutron Chesnokov, Newfie Pendragon, Nicholai Laviscu, Nick Rhodes, Nicoladie Gymnast, Ollie Kubrick, Orenj Marat, Orion Delphis, Oryx Tempel, Parvati Silverweb, PeterPunk Mooney, Pixel Scientist, Pounce Teazle, Professor Noarlunga, Quantum Destiny, Quicksilver Hermes, Ralf Setsuko, RAT Quan, RedMokum Bravin, Revolution Perenti, Rezit Sideways, Rich Grainger, Rosco Teardrop, Rose Evans, Rudee Voom, RufusTT Horsefly, Saii Hallard, SaintLEOlions Zimer, Samm Larkham, Satanello Miami, SexySteven Morrisey, Sheet Spotter, Shnurui Troughton, sicarius Thorne, Sicarius Toxx, Sini Nubalo, SLB Wirefly, snowy Sidran, Soupa Segura, ST Mensing, Starshine Halasy, Stickman Ingmann, Synystyr Texan, Takeda Terrawyng, Tali Rosca, Templar Merlin, Tezcatlipoca Bisiani, Tiel Stonecutter, Tony Kembia, TouchaHoney Perhaps, Trey Reanimator, TriloByte Zanzibar, Trinity Dechou, Trinity Dejavu, Unlikely Quintessa, UsikuFarasi Kanarik, Veritas Raymaker, Vex Streeter, Viaticus Speculaas, Villain Baroque, Vixie Durant, Void Singer, Watty Berkson, Westley Schridde, Westley Streeter, Whimsy Winx, Winter Ventura, Wundur Primbee, xstorm Radek, YongYong Francois, Zak Westminster, Zana Kohime, Zaren Alexander, Zeja Pyle, ZenMondo Wormser, Zoex Flanagan, y muchos otros.
-
-
-
-
-&quot;El trabajo sigue avanzando, la causa perdura, la esperanza aún vive, y los sueños no morirán jamás&quot; - Edward Kennedy
+			<text name="linden_intro">
+				Second Life ofrecido por los Lindens:
+			</text>
+			<text_editor name="linden_names">
+				Philip, Andrew, Doug, Richard, Phoenix, Ian, Mark, Robin, Dan, Char, Ryan, Eric, Jim, Lee, Jeff, Michael, Kelly, Steve, Catherine, Bub, Ramzi, Jill, Jeska, Don, Kona, Callum, Charity, Jack, Shawn, babbage, James, Lauren, Blue, Brent, Reuben, Pathfinder, Jesse, Patsy, Torley, Bo, Cyn, Jonathan, Gia, Annette, Ginsu, Harry, Lex, Runitai, Guy, Cornelius, Beth, Swiss, Thumper, Wendy, Teeple, Seth, Dee, Mia, Sally, Liana, Aura, Beez, Milo, Red, Gulliver, Marius, Joe, Jose, Dore, Justin, Nora, Morpheus, Lexie, Amber, Chris, Xan, Leyla, Walker, Sabin, Joshua, Hiromi, Tofu, Fritz, June, Jean, Ivy, Dez, Ken, Betsy, Which, Spike, Rob, Zee, Dustin, George, Claudia, del, Matthew, jane, jay, Adrian, Yool, Rika, Yoz, siobhan, Qarl, Benjamin, Beast, Everett, madhavi, Christopher, Izzy, stephany, Jeremy, sean, adreanne, Pramod, Tobin, sejong, Iridium, maurice, kj, Meta, kari, JP, bert, kyle, Jon, Socrates, Bridie, Ivan, maria, Aric, Coco, Periapse, sandy, Storrs, Lotte, Colossus, Brad, Pastrami, Zen, BigPapi, Banzai, Sardonyx, Mani, Garry, Jaime, Neuro, Samuel, Niko, CeeLo, Austin, Soft, Poppy, emma, tessa, angelo, kurz, alexa, Sue, CG, Blake, Erica, Brett, Bevis, kristen, Q, simon, Enus, MJ, laurap, Kip, Scouse, Ron, Ram, kend, Marty, Prospero, melissa, kraft, Nat, Seraph, Hamilton, Lordan, Green, miz, Ashlei, Trinity, Ekim, Echo, Charlie, Rowan, Rome, Jt, Doris, benoc, Christy, Bao, Kate, Tj, Patch, Cheah, Johan, Brandy, Angela, Oreh, Cogsworth, Lan, Mitchell, Space, Bambers, Einstein, Bender, Malbers, Matias, Maggie, Rothman, Milton, Niall, Marin, Allison, Mango, Andrea, Katt, Yi, Ambroff, Rico, Raymond, Gail, Christa, William, Dawn, Usi, Dynamike, M, Corr, Dante, Molly, kaylee, Danica, Kelv, Lil, jacob, Nya, Rodney, elsie, Blondin, Grant, Nyx, Devin, Monty, Minerva, Keira, Katie, Jenn, Makai, Clare, Joy, Cody, Gayathri, FJ, spider, Oskar, Landon, Jarv, Noelle, Al, Doc, Gray, Vir, t, Maestro, Simone, Shannon, yang, Courtney, Scott, charlene, Quixote, Susan, Zed, Amanda, Katelin, Esbee, JoRoan, Enkidu, roxie, Scarlet, Merov, Kevin, Judy, Rand, Newell, Les, Dessie, Galen, Michon, Geo, Siz, Calyle, Pete, Praveen, Callen, Sheldon, Pink, Nelson, jenelle, Terrence, Nathan, Juan, Sascha, Huseby, Karina, Kaye, Kotler, Lis, Darv, Charrell, Dakota, Kimmora, Theeba, Taka, Mae, Perry, Ducot, dana, Esther, Dough, gisele, Doten, Viale, Fisher, jessieann, ashley, Torres, delby, rountree, kurt, Slaton, Madison, Rue, Gino, Wen, Casssandra, Brodesky, Squid, Gez, Rakesh, Gecko, Ladan, Tony, Tatem, Squire, Falcon, BK, Crimp, Tiggs, Bacon, Coyot, Carmilla, Webb, Sea, Arch, Jillian, Jason, Bernard, Vogt, Peggy, dragon, Pup, xandix, Wallace, Bewest, Inoshiro, Rhett, AG, Aimee, Ghengis, Itiaes, Eli, Steffan, Epic, Grapes, Stone, Prep, Scobu, Robert, Alain, Carla, Vicky, Tia, Alec, Taras, Lisa, Oz, Ariane, Log, House, Kazu, Kim, Drofnas, Tyler, Campbell, Michele, Madeline, Nelly, Baron, Thor, Lori, Hele, Fredrik, Teddy, Pixie, Berry, Gabrielle, Alfonso, Brooke, Wolf, Ringo, Cru, Charlar, Rodvik, Gibson, Elise, Bagman, Greger, Leonidas, Jerm, Leslie, CB, Brenda, Durian, Carlo, mm, Zeeshan, Caleb, Max, Elikak, Mercille, Steph, Chase
+			</text_editor>
+			<text name="contrib_intro">
+				con contribuciones de código abierto de:
+			</text>
+			<text_editor name="contrib_names">
+				Dummy Name sustituido durante la ejecución
+			</text_editor>
+			<text name="trans_intro">
+				y traducido por:
+			</text>
+			<text_editor name="trans_names">
+				Dummy Name sustituido durante la ejecución
 			</text_editor>
 		</panel>
 		<panel label="Licencias" name="licenses_panel">
diff --git a/indra/newview/skins/default/xui/es/floater_preferences_proxy.xml b/indra/newview/skins/default/xui/es/floater_preferences_proxy.xml
new file mode 100644
index 0000000000..f656f5d662
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/floater_preferences_proxy.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Proxy Settings Floater" title="Configuración de proxy">
+	<check_box initial_value="false" label="Usar proxy HTTP para páginas web" name="web_proxy_enabled"/>
+	<text name="http_proxy_label">
+		Proxy HTTP:
+	</text>
+	<line_editor name="web_proxy_editor" tool_tip="El nombre DNS o la dirección IP del proxy HTTP que quieres usar."/>
+	<spinner label="Nº del puerto:" name="web_proxy_port" tool_tip="El puerto del proxy HTTP que quieres usar."/>
+	<check_box label="Usar proxy SOCKS 5 para el tráfico UDP" name="socks_proxy_enabled"/>
+	<text name="socks5_proxy_label">
+		Proxy SOCKS 5:
+	</text>
+	<line_editor name="socks_proxy_editor" tool_tip="El nombre DNS o la dirección IP del proxy SOCKS 5 que quieres usar."/>
+	<spinner label="Nº del puerto:" name="socks_proxy_port" tool_tip="El puerto del proxy SOCKS 5 que quieres usar."/>
+	<text name="socks_auth_label">
+		Autenticación SOCKS:
+	</text>
+	<radio_group name="socks5_auth_type">
+		<radio_item label="Sin autenticación" name="Socks5NoAuth" tool_tip="El proxy Socks5 no necesita autenticación." value="Ninguno"/>
+		<radio_item label="Nombre de usuario/contraseña" name="Socks5UserPass" tool_tip="El proxy Socks5 necesita autenticación con nombre de usuario y contraseña." value="UserPass"/>
+	</radio_group>
+	<text name="socks5_username_label">
+		Nombre de usuario:
+	</text>
+	<text name="socks5_password_label">
+		Contraseña:
+	</text>
+	<line_editor name="socks5_username" tool_tip="El nombre de usuario utilizado para la autenticación con tu servidor SOCKS 5"/>
+	<line_editor name="socks5_password" tool_tip="La contraseña utilizada para la autenticación con tu servidor SOCKS 5"/>
+	<text name="other_proxy_label">
+		Otro proxy de tráfico HTTP:
+	</text>
+	<radio_group name="other_http_proxy_type">
+		<radio_item label="No usar proxy" name="OtherNoProxy" tool_tip="El tráfico HTTP no web NO se enviará a un proxy." value="Ninguno"/>
+		<radio_item label="Usar proxy HTTP" name="OtherHTTPProxy" tool_tip="HTTP no web se transmitirá a través del proxy web configurado." value="Web"/>
+		<radio_item label="Usar Proxy SOCKS 5" name="OtherSocksProxy" tool_tip="El tráfico HTTP no web se transmitirá a través del proxy Socks 5 configurado." value="Socks"/>
+	</radio_group>
+	<button label="OK" label_selected="OK" name="OK"/>
+	<button label="Cancelar" label_selected="Cancelar" name="Cancel"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/es/menu_inventory.xml b/indra/newview/skins/default/xui/es/menu_inventory.xml
index e873d31580..f1f1ef091f 100644
--- a/indra/newview/skins/default/xui/es/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/es/menu_inventory.xml
@@ -83,5 +83,7 @@
 	<menu_item_call label="Editar" name="Wearable Edit"/>
 	<menu_item_call label="Añadir" name="Wearable Add"/>
 	<menu_item_call label="Quitarse" name="Take Off"/>
+	<menu_item_call label="Copiar al Buzón de salida de comerciante" name="Merchant Copy"/>
+	<menu_item_call label="Mover al Buzón de salida de comerciante" name="Merchant Move"/>
 	<menu_item_call label="--sin opciones--" name="--no options--"/>
 </menu>
diff --git a/indra/newview/skins/default/xui/es/menu_media_ctrl.xml b/indra/newview/skins/default/xui/es/menu_media_ctrl.xml
index 8ea9286d8e..b4dfe9907a 100644
--- a/indra/newview/skins/default/xui/es/menu_media_ctrl.xml
+++ b/indra/newview/skins/default/xui/es/menu_media_ctrl.xml
@@ -3,4 +3,5 @@
 	<menu_item_call label="Cortar" name="Cut"/>
 	<menu_item_call label="Copiar" name="Copy"/>
 	<menu_item_call label="Pegar" name="Paste"/>
+	<menu_item_call label="Abrir el inspector web" name="open_webinspector"/>
 </context_menu>
diff --git a/indra/newview/skins/default/xui/es/menu_mode_change.xml b/indra/newview/skins/default/xui/es/menu_mode_change.xml
new file mode 100644
index 0000000000..608505d192
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/menu_mode_change.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<toggleable_menu name="Mode Change">
+	<menu_item_check label="Básico" name="BasicMode"/>
+	<menu_item_check label="Avanzado" name="AdvancedMode"/>
+</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/es/menu_viewer.xml b/indra/newview/skins/default/xui/es/menu_viewer.xml
index b0d16d1ca4..bc8a5731ab 100644
--- a/indra/newview/skins/default/xui/es/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/es/menu_viewer.xml
@@ -138,7 +138,6 @@
 			<menu_item_call label="Sonido ([COST] L$)..." name="Upload Sound"/>
 			<menu_item_call label="Animación ([COST] L$)..." name="Upload Animation"/>
 			<menu_item_call label="Modelo..." name="Upload Model"/>
-			<menu_item_call label="Asistente de modelo..." name="Upload Model Wizard"/>
 			<menu_item_call label="Masivo ([COST] L$ por archivo)..." name="Bulk Upload"/>
 		</menu>
 		<menu_item_call label="Deshacer" name="Undo"/>
@@ -248,6 +247,7 @@
 			<menu_item_check label="Mostrar información de textura" name="Show Texture Info"/>
 			<menu_item_check label="Show Color Under Cursor" name="Show Color Under Cursor"/>
 			<menu_item_check label="Mostrar la memoria" name="Show Memory"/>
+			<menu_item_check label="Mostrar información de memoria privada" name="Show Private Mem Info"/>
 			<menu_item_check label="Show Updates to Objects" name="Show Updates"/>
 		</menu>
 		<menu label="Force an Error" name="Force Errors">
diff --git a/indra/newview/skins/default/xui/es/notifications.xml b/indra/newview/skins/default/xui/es/notifications.xml
index 2ec1b333a9..4fb29b9427 100644
--- a/indra/newview/skins/default/xui/es/notifications.xml
+++ b/indra/newview/skins/default/xui/es/notifications.xml
@@ -85,6 +85,19 @@ Asegúrate de que tu conexión a Internet está funcionando adecuadamente.
 		¿Guardar los cambios en las ropas o partes del cuerpo actuales?
 		<usetemplate canceltext="Cancelar" name="yesnocancelbuttons" notext="No guardarlos" yestext="Guardarlos"/>
 	</notification>
+	<notification name="ConfirmNoCopyToOutbox">
+		No tienes permiso para copiar este objeto en el Buzón de salida de comerciante. ¿Estás seguro de que quieres mover el objeto siguiente?
+        [ITEM_NAME]
+		<usetemplate name="okcancelbuttons" notext="No" yestext="Sí"/>
+	</notification>
+	<notification name="OutboxUploadComplete">
+		Envío al mercado finalizado.
+		<usetemplate name="okbutton" yestext="¡Hurra!"/>
+	</notification>
+	<notification name="OutboxUploadHadErrors">
+		El envío al mercado ha tenido errores. Corrige los problemas de tu buzón de salida y repite la operación. Muchas gracias.
+		<usetemplate name="okbutton" yestext="Reintentar"/>
+	</notification>
 	<notification name="CompileQueueSaveText">
 		Hubo un problema al subir el texto de un script por la siguiente razón: [REASON]. Por favor, inténtalo más tarde.
 	</notification>
@@ -2430,7 +2443,15 @@ Por favor, vuelve a intentarlo en unos momentos.
 		<form name="form">
 			<button name="Keep" text="Guardar"/>
 			<button name="Discard" text="Descartar"/>
-			<button name="Mute" text="Ignorar"/>
+			<button name="Mute" text="Ignorar al propietario"/>
+		</form>
+	</notification>
+	<notification name="OwnObjectGiveItem">
+		Tu objeto de nombre &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; te ha dado este [OBJECTTYPE]:
+&lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;
+		<form name="form">
+			<button name="Keep" text="Guardar"/>
+			<button name="Discard" text="Descartar"/>
 		</form>
 	</notification>
 	<notification name="UserGiveItem">
@@ -2574,6 +2595,7 @@ Si no confias en este objeto y en su creador, deberías rehusar esta petición.
 		&apos;&lt;nolink&gt;[TITLE]&lt;/nolink&gt;&apos; de [NAME]
 [MESSAGE]
 		<form name="form">
+			<button name="Mute" text="Ignorar"/>
 			<button name="Ignore" text="Ignorar"/>
 		</form>
 	</notification>
@@ -2581,6 +2603,7 @@ Si no confias en este objeto y en su creador, deberías rehusar esta petición.
 		&apos;&lt;nolink&gt;[TITLE]&lt;/nolink&gt;&apos; de [GROUPNAME]
 [MESSAGE]
 		<form name="form">
+			<button name="Mute" text="Ignorar"/>
 			<button name="Ignore" text="Ignorar"/>
 		</form>
 	</notification>
@@ -2906,6 +2929,12 @@ Al ocultar el botón Hablar se desactiva la función de voz.
 	<notification label="¡Tienes dólares Linden!" name="HintLindenDollar">
 		Éste es tu saldo actual de L$. Haz clic en Comprar L$ para comprar más dólares Linden.
 	</notification>
+	<notification name="LowMemory">
+		Tu bloque de memoria es insuficiente. Algunas funciones de SL se han desactivado para evitar una caída. Por favor cierra otras aplicaciones. Si el problema continúa, reinicia SL.
+	</notification>
+	<notification name="ForceQuitDueToLowMemory">
+		SL saldrá en 30 segundos porque no hay memoria suficiente.
+	</notification>
 	<notification name="PopupAttempt">
 		Se ha impedido que se abriera una ventana emergente.
 		<form name="form">
@@ -2913,6 +2942,54 @@ Al ocultar el botón Hablar se desactiva la función de voz.
 			<button name="open" text="Abrir ventana emergente"/>
 		</form>
 	</notification>
+	<notification name="SOCKS_NOT_PERMITTED">
+		El proxy SOCKS 5 &quot;[HOST]:[PORT]&quot; ha rechazado la conexión, no está permitida por el juego de reglas.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_CONNECT_ERROR">
+		El proxy SOCKS 5 &quot;[HOST]:[PORT]&quot; ha rechazado la conexión, no se ha podido abrir el canal TCP.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_NOT_ACCEPTABLE">
+		El proxy SOCKS 5 &quot;[HOST]:[PORT]&quot; ha rechazado el sistema de autenticación seleccionado.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_AUTH_FAIL">
+		El proxy SOCKS 5 &quot;[HOST]:[PORT]&quot; contestó que tus credenciales no son válidas.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_UDP_FWD_NOT_GRANTED">
+		El proxy SOCKS 5 &quot;[HOST]:[PORT]&quot; ha rechazado la petición asociada de UDP.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_HOST_CONNECT_FAILED">
+		No se pudo establecer una conexión con el servidor proxy SOCKS 5 &quot;[HOST]:[PORT]&quot;.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_UNKNOWN_STATUS">
+		Error de proxy desconocido con el servidor &quot;[HOST]:[PORT]&quot;.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_INVALID_HOST">
+		Dirección o puerto de proxy SOCKS no válidos &quot;[HOST]:[PORT]&quot;.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_BAD_CREDS">
+		Nombre de usuario o contraseña de SOCKS 5 no válidos.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="PROXY_INVALID_HTTP_HOST">
+		Dirección o puerto de proxy HTTP no válidos &quot;[HOST]:[PORT]&quot;.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="PROXY_INVALID_SOCKS_HOST">
+		Dirección o puerto de proxy SOCKS no válidos &quot;[HOST]:[PORT]&quot;.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="ChangeProxySettings">
+		La configuración del puerto se activará cuando reinicies [APP_NAME].
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
 	<notification name="AuthRequest">
 		El sitio en &apos;&lt;nolink&gt;[HOST_NAME]&lt;/nolink&gt;&apos; de la plataforma &apos;[REALM]&apos; requiere un nombre de usuario y una contraseña.
 		<form name="form">
diff --git a/indra/newview/skins/default/xui/es/panel_outbox_inventory.xml b/indra/newview/skins/default/xui/es/panel_outbox_inventory.xml
new file mode 100644
index 0000000000..9e2f3c3adc
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/panel_outbox_inventory.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<outbox_inventory_panel name="inventory_outbox" tool_tip="Arrastra y coloca aquí los objetos que desees preparar para venderlos en tu tienda"/>
diff --git a/indra/newview/skins/default/xui/es/panel_preferences_setup.xml b/indra/newview/skins/default/xui/es/panel_preferences_setup.xml
index 9b453fd807..3de18654b5 100644
--- a/indra/newview/skins/default/xui/es/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/es/panel_preferences_setup.xml
@@ -11,17 +11,6 @@
 	</text>
 	<check_box label="Personalizar el puerto" name="connection_port_enabled"/>
 	<spinner label="Nº del puerto:" name="connection_port"/>
-	<text name="cache_size_label_l">
-		Tamaño de la caché
-	</text>
-	<text name="text_box5">
-		MB
-	</text>
-	<text name="Cache location">
-		Localización de la caché:
-	</text>
-	<button label="Elegir" label_selected="Elegir" name="set_cache"/>
-	<button label="Recuperar" label_selected="Reconfigurar" name="reset_cache"/>
 	<text name="Web:">
 		Web:
 	</text>
@@ -33,12 +22,6 @@
 	<check_box initial_value="true" label="Aceptar las &apos;cookies&apos;" name="cookies_enabled"/>
 	<check_box initial_value="true" label="Activar Javascript" name="browser_javascript_enabled"/>
 	<check_box initial_value="falso" label="Permitir las ventanas emergentes en el navegador" name="media_popup_enabled"/>
-	<check_box initial_value="false" label="Activar web proxy" name="web_proxy_enabled"/>
-	<text name="Proxy location">
-		Localización del proxy:
-	</text>
-	<line_editor name="web_proxy_editor" tool_tip="Nombre o dirección IP del proxy que quieres usar"/>
-	<spinner label="Nº del puerto:" name="web_proxy_port"/>
 	<text name="Software updates:">
 		Actualizaciones de software:
 	</text>
@@ -46,4 +29,8 @@
 		<combo_box.item label="Instalar automáticamente" name="Install_automatically"/>
 		<combo_box.item label="Descargar e instalar actualizaciones manualmente" name="Install_manual"/>
 	</combo_box>
+	<text name="Proxy Settings:">
+		Configuración de proxy:
+	</text>
+	<button label="Ajustar la configuración de proxy" label_selected="Elegir" name="set_proxy"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/es/panel_status_bar.xml b/indra/newview/skins/default/xui/es/panel_status_bar.xml
index ab76d3f994..0391258b75 100644
--- a/indra/newview/skins/default/xui/es/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/es/panel_status_bar.xml
@@ -1,11 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="status">
-	<panel.string name="StatBarDaysOfWeek">
-		Domingo:Lunes:Martes:Miércoles:Jueves:Viernes:Sábado
-	</panel.string>
-	<panel.string name="StatBarMonthsOfYear">
-		Enero:Febrero:Marzo:Abril:Mayo:Junio:Julio:Agosto:Septiembre:Octubre:Noviembre:Diciembre
-	</panel.string>
 	<panel.string name="packet_loss_tooltip">
 		Pérdida de paquetes
 	</panel.string>
@@ -25,6 +19,10 @@
 		<text name="balance" tool_tip="Haz clic para actualizar tu saldo en L$" value="20 L$"/>
 		<button label="COMPRAR L$" name="buyL" tool_tip="Pulsa para comprar más L$"/>
 	</panel>
+	<combo_box name="mode_combo" tool_tip="Selecciona el modo. Elige Básico para una exploración rápida y fácil y para chatear. Elige Avanzado para tener acceso a más funciones.">
+		<combo_box.item label="Modo Básico" name="Basic"/>
+		<combo_box.item label="Modo Avanzado" name="Advanced"/>
+	</combo_box>
 	<text name="TimeText" tool_tip="Hora actual (Pacífico)">
 		24:00 AM PST
 	</text>
diff --git a/indra/newview/skins/default/xui/es/sidepanel_inventory.xml b/indra/newview/skins/default/xui/es/sidepanel_inventory.xml
index 84d19c703b..aae9bfc113 100644
--- a/indra/newview/skins/default/xui/es/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/es/sidepanel_inventory.xml
@@ -2,35 +2,47 @@
 <panel label="Cosas" name="objects panel">
 	<panel label="" name="sidepanel__inventory_panel">
 		<layout_stack name="inventory_layout_stack">
-			<layout_panel name="inbox_layout_panel">
-				<panel label="" name="marketplace_inbox">
-					<string name="InboxLabelWithArg">
-						Objetos recibidos ([NUM])
-					</string>
-					<string name="InboxLabelNoArg">
-						Objetos recibidos
-					</string>
-					<button label="Objetos recibidos" name="inbox_btn"/>
-					<text name="inbox_fresh_new_count">
-						[NUM] Nuevos
-					</text>
-					<panel tool_tip="Drag and drop items to your inventory to manage and use them">
-						<text name="inbox_inventory_placeholder">
-							Aquí se entregarán las compras realizadas en el mercado.
-						</text>
-					</panel>
-				</panel>
-			</layout_panel>
-			<layout_panel name="outbox_layout_panel">
-				<panel label="" name="marketplace_outbox">
-					<button label="Buzón de salida de comerciante" name="outbox_btn"/>
-					<button label="" name="outbox_sync_btn" tool_tip="Poner en el escaparate de Mi Mercado"/>
-					<panel tool_tip="Drag and drop items here to prepare them for sale on your storefront">
-						<text name="outbox_inventory_placeholder">
-							Configura tu cuenta de comerciante para utilizar esta función.
-						</text>
-					</panel>
-				</panel>
+			<layout_panel name="inbox_outbox_layout_panel">
+				<layout_stack name="inbox_outbox_layout_stack">
+					<layout_panel name="inbox_layout_panel">
+						<panel label="" name="marketplace_inbox">
+							<string name="InboxLabelWithArg">
+								Objetos recibidos ([NUM])
+							</string>
+							<string name="InboxLabelNoArg">
+								Objetos recibidos
+							</string>
+							<button label="Objetos recibidos" name="inbox_btn"/>
+							<text name="inbox_fresh_new_count">
+								[NUM] Nuevos
+							</text>
+							<panel tool_tip="Drag and drop items to your inventory to manage and use them">
+								<text name="inbox_inventory_placeholder">
+									Aquí se entregarán las compras realizadas en el mercado.
+								</text>
+							</panel>
+						</panel>
+					</layout_panel>
+					<layout_panel name="outbox_layout_panel">
+						<panel label="" name="marketplace_outbox">
+							<string name="OutboxLabelWithArg">
+								Buzón de salida de comerciante ([NUM])
+							</string>
+							<string name="OutboxLabelNoArg">
+								Buzón de salida de comerciante
+							</string>
+							<button label="Buzón de salida de comerciante" name="outbox_btn"/>
+							<button label="" name="outbox_sync_btn" tool_tip="Poner en el escaparate de Mi Mercado"/>
+							<panel>
+								<panel name="outbox_inventory_placeholder_panel">
+									<text name="outbox_inventory_placeholder_title">
+										Cargando...
+									</text>
+								</panel>
+							</panel>
+						</panel>
+					</layout_panel>
+				</layout_stack>
 			</layout_panel>
 		</layout_stack>
 		<panel name="button_panel">
diff --git a/indra/newview/skins/default/xui/es/strings.xml b/indra/newview/skins/default/xui/es/strings.xml
index 2c33177ab4..cc044ba416 100644
--- a/indra/newview/skins/default/xui/es/strings.xml
+++ b/indra/newview/skins/default/xui/es/strings.xml
@@ -327,6 +327,18 @@ Intenta iniciar sesión de nuevo en unos instantes.
 		Aquí se puede arrastrar sólo un ítem
 	</string>
 	<string name="TooltipPrice" value="[AMOUNT] L$:"/>
+	<string name="TooltipOutboxNoTransfer">
+		Uno o varios de estos objetos no se pueden vender o transferir a otro usuario.
+	</string>
+	<string name="TooltipOutboxWorn">
+		Llevas puestos uno o más de estos objetos. Quítatelos del avatar y vuelve a intentar moverlos.
+	</string>
+	<string name="TooltipOutboxFolderLevels">
+		Esta carpeta tiene demasiados niveles de subcarpetas. Reorganiza las carpetas interiores de forma que tengas como máximo 4 niveles de profundidad (la carpeta raíz contiene A, que contiene B, que contiene C).
+	</string>
+	<string name="TooltipOutboxTooManyObjects">
+		Esta carpeta contiene más de 200 objetos. Guarda algunos objetos en una caja para disminuir su cantidad.
+	</string>
 	<string name="TooltipHttpUrl">
 		Pulsa para ver esta página web
 	</string>
@@ -1183,8 +1195,65 @@ Intenta iniciar sesión de nuevo en unos instantes.
 	<string name="InventoryInboxNoItems">
 		Aquí se entregarán los objetos comprados en el mercado.
 	</string>
+	<string name="MarketplaceURL">
+		http://marketplace.[DOMAIN_NAME]
+	</string>
+	<string name="MarketplaceURL_CreateStore">
+		http://marketplace.[DOMAIN_NAME]/create_store
+	</string>
+	<string name="MarketplaceURL_LearnMore">
+		http://marketplace.[DOMAIN_NAME]/learn_more
+	</string>
+	<string name="InventoryOutboxCreationErrorTitle">
+		Tu Buzón de salida de comerciante no está configurado correctamente
+	</string>
+	<string name="InventoryOutboxCreationErrorTooltip">
+		Error de configuración del Buzón de salida de comerciante
+	</string>
+	<string name="InventoryOutboxCreationError">
+		Ponte en contacto con el servicio de atención al cliente para resolver el problema.
+	</string>
+	<string name="InventoryOutboxNotMerchantTitle">
+		Cualquiera puede vender objetos en el mercado
+	</string>
+	<string name="InventoryOutboxNotMerchantTooltip">
+		¡Hazte comerciante!
+	</string>
+	<string name="InventoryOutboxNotMerchant">
+		[[MARKETPLACE_URL] El Mercado de Second Life] pone en venta más de un millón de productos virtuales, todos ellos creados por residentes. Tú también puedes vender los objetos que crees, así como algunos de los objetos que hayas comprado. Es fácil y es gratuito. [[LEARN_MORE_URL] Más información] o [[CREATE_STORE_URL] crea una tienda] en el mercado para empezar.
+	</string>
+	<string name="InventoryOutboxNoItemsTitle">
+		Una nueva forma para enviar objetos al mercado
+	</string>
+	<string name="InventoryOutboxNoItemsTooltip">
+		Arrastra y coloca aquí los objetos que desees preparar para venderlos en el mercado
+	</string>
 	<string name="InventoryOutboxNoItems">
-		Arrastra objetos aquí para preparar una lista del escaparate de tu mercado.
+		Arrastra a esta zona los objetos o carpetas que desees vender. Aparecerá una copia del objeto, sin quitarlo de tu inventario, salvo que el objeto arrastrado sea &quot;no copiable&quot;. Cuando estés listo para enviar los objetos al mercado, pulsa en el botón Subir. Cuando se hayan trasladado los objetos a tu inventario en el mercado, desaparecerán de esta carpeta.
+	</string>
+	<string name="Marketplace Error None">
+		Sin errores
+	</string>
+	<string name="Marketplace Error Not Merchant">
+		Error: Para poder enviar objetos al mercado, debes registrarte como comerciante (es gratis).
+	</string>
+	<string name="Marketplace Error Empty Folder">
+		Error: Esta carpeta está vacía.
+	</string>
+	<string name="Marketplace Error Unassociated Products">
+		Error: Este objeto no se pudo subir porque tu cuenta de comerciante tiene demasiados objetos que no están asociados a productos. Para corregirlo, inicia sesión en la página web del mercado y asocia más objetos.
+	</string>
+	<string name="Marketplace Error Object Limit">
+		Error: Este elemento contiene demasiados objetos. Para corregir el error, guarda objetos en cajas de forma que el total de objetos sea menor que 200.
+	</string>
+	<string name="Marketplace Error Folder Depth">
+		Error: Este objeto contiene demasiados niveles de carpetas anidadas. Reorganízalo de forma que tenga como máximo 3 niveles de carpetas anidadas.
+	</string>
+	<string name="Marketplace Error Unsellable Item">
+		Error: Este objeto no se puede vender en el mercado.
+	</string>
+	<string name="Marketplace Error Internal Import">
+		Error: Este objeto tiene un problema. Vuelve a intentarlo más tarde.
 	</string>
 	<string name="no_transfer" value="(no transferible)"/>
 	<string name="no_modify" value="(no modificable)"/>
@@ -4089,8 +4158,8 @@ Denuncia de infracción
 	<string name="Female - Wow">
 		Mujer - Admiración
 	</string>
-	<string name="/bow">
-		/reverencia
+	<string name="/bow1">
+		/reverencia1
 	</string>
 	<string name="/clap">
 		/aplaudir
diff --git a/indra/newview/skins/default/xui/fr/floater_about.xml b/indra/newview/skins/default/xui/fr/floater_about.xml
index e3e3169161..d088cb3244 100644
--- a/indra/newview/skins/default/xui/fr/floater_about.xml
+++ b/indra/newview/skins/default/xui/fr/floater_about.xml
@@ -42,15 +42,23 @@ Version serveur vocal : [VOICE_VERSION]
 			<button label="Copier dans le presse-papiers" name="copy_btn"/>
 		</panel>
 		<panel label="Remerciements" name="credits_panel">
-			<text_editor name="credits_editor">
-				Second Life existe grâce aux efforts de Philip, Tessa, Andrew, Cory, Ian, James, Phoenix, Ryan, Haney, Dan, Char, Ben, John, Tanya, Eddie, Richard, Mitch, Doug, Eric, Frank, Bruce, Aaron, Peter, Alice, Charlie, Debra, Eileen, Helen, Janet, Steffan, Steve, Tom, Mark, Hunter, Xenon, Burgess, Bill, Jim, Lee, Hamlet, Daniel, Jeff, Todd, Sarah, Tim, Stephanie, Colin, Michael, Evan, Nicolas, Catherine, Rachelle, Dave, Holly, Bub, Kelly, Ramzi, Don, Sabin, Jill, Rheya, Jeska, Torley, Kona, Callum, Charity, Jack, Vektor, Chris, Nicole, Mick, Reuben, Blue, Babbage, Yedwab, Deana, Lauren, Brent, Pathfinder, Chadrick, Jesse, David, Tess, Lizzie, Patsy, Isaac, Lawrence, Cyn, Bo, Gia, Annette, Marius, Tbone, Jonathan, Karen, Ginsu, Yuko, Makiko, Thomas, Harry, Seth, Brian, Guy, Runitai, Ethan, Data, Cornelius, Kenny, Swiss, Zero, Brad, Natria, Wendy, Stephen, Teeple, Thumper, Lucy, Dee, Mia, Liana, Warren, Branka, Aura, Beez, Milo, Hermia, Red, Thrax, Gulliver, Joe, Sally, Paul, Jose, Rejean, Dore, Henrik, Lexie, Amber, Logan, Xan, Nora, Morpheus, Donovan, Leyla, MichaelFrancis, Beast, Cube, Bucky, Joshua, Stryfe, Harmony, Teresa, Claudia, Walker, Glenn, Fritz, Fordak, June, Cleopetra, Ivy, Betsy, Roosevelt, Spike, Ken, Which, Tofu, Chiyo, Rob, Zee, Dustin, George, Del, Matthew, Cat, Jacqui, Adrian, Viola, Alfred, Noel, Irfan, Yool, Rika, Jane, Frontier, Neo, Siobhan, Yoz, Justin, Elle, Qarl, Benjamin, Isabel, Everett, Christopher, Izzy, Stephany, Garry, Sejong, Sean, Tobin, Iridium, Meta, Jeremy, JP, Jake, Anthony, Maurice, Madhavi, Leopard, Kyle, Joon, Bert, Belinda, Jon, Kristi, Bridie, Pramod, Socrates, Maria, Aric, Adreanne, Jay, Kari, Ceren, Coco, Durl, Jenny, Periapse, Kartic, Storrs, Lotte, Sandy, Colossus, Zen, BigPapi, Pastrami, Kurz, Mani, Neuro, Mel, Sardonyx, MJ, Rowan, Sgt, Elvis, Samuel, Leo, Bryan, Niko, Austin, Soft, Poppy, Rachel, Aki, Banzai, Alexa, Sue, Bender, CG, Angelo, Gillian, Pelle, Nick, Echo, Zara, Christine, Shamiran, Emma, Blake, Keiko, Plexus, Joppa, Sidewinder, Erica, Ashlei, Twilight, Kristen, Brett, Q, Enus, Simon, Bevis, Kraft, Kip, Chandler, Ron, LauraP, Ram, KyleJM, Scouse, Prospero, Melissa, Marty, Nat, Hamilton, Kend, Lordan, Jimmy, Kosmo, Seraph, Green, Ekim, Wiggo, JT, Rome, Doris, Miz, Benoc, Whump, Trinity, Patch, Kate, TJ, Bao, Joohwan, Christy, Sofia, Matias, Cogsworth, Johan, Oreh, Cheah, Angela, Brandy, Mango, Lan, Aleks, Gloria, Mitchell, Space, Colton, Bambers, Einstein, Maggie, Malbers, Rose, Rothman, Niall, Marin, Allison, Katie, Dawn, Dusty, Katt, Judy, Andrea, Ambroff, Infinity, Rico, Gail, Kalpana, Raymond, Yi, William, Christa, M, Teagan, Scout, Molly, Dante, Corr, Dynamike, Usi, Kaylee, Lil, Danica, Sascha, Kelv, Jacob, Nya, Rodney, Brandon, Elsie, Blondin, Grant, Katrin, Nyx, Gabriel, Locklainn, Claire, Devin, Minerva, Monty, Bradford, Si, Keira, H, Caitlin, Dita, Makai, Jenn, Ann, Meredith, Clare, Joy, Praveen, Cody, Edmund, Ruthe, Sirena, Gayathri, Spider, FJ, Davidoff, Tian, Jennie, Louise, Oskar, Landon, Noelle, Jarv, Ingrid, Al, Sommer, Doc, Aria, Huin, Gray, Lili, Vir, DJ, Maestro, Simone, Yang, T, Shannon, Nelson, Khanh, Scott, Courtney, Charlene, Quixote, Susan, Zed, Amanda, Katelin, Enkidu, Roxie, Esbee, JoRoan, Scarlet, Tay, Kevin, Wolfgang, Johnny, Ray, Andren, Merov, Bob, Rand, Howard, Callen, Heff, Galen, Newell, Dessie, Les, Michon, Jenelle, Geo, Siz, Shapiro, Pete, Calyle, Selene, Allen, Phoebe, Goldin, Kimmora, Dakota, Slaton, Lindquist, Zoey, Hari, Othello, Rohit, Sheldon, Petra, Viale, Gordon, Kaye, Pink, Ferny, Emerson, Davy, Bri, Chan, Juan, Robert, Terrence, Nathan, Carl, Ashley, JessieAnn, Huseby, Karina, Paris, Kurt, Rick, Lis, Kotler, Theeba, Lynx, Murphy, Doten, Taka, Norm, Jillian, Marcus, Mae, Novack, Esther, Perry, Dana, Ducot, Javier, Porter, Madison, Gecko, Dough, JR, Gisele, Crimp, Norie, Arch, Kimi, Fisher, Barbara, Jason, Peggy, Bernard, Jules, Leroy, Eva, Khederian, Campbell, Vogt, Masido, Karel, Torres, Lo, Breezer, Delby, Rountree, Anna, Servus, Rue, Itiaes, Chuck, Luna, Novella, Zaza, Wen, Gino, Lex, Cassandra, Limey, Nancy, Anukul, Silver, Brodesky, Jinsai, Squid, Gez, Rakesh, Ladan, Edelman, Marcet, Squire, Tatem, Tony, Jerm, Tia, Falcon, BK, Tiggs, Driscoll, Bacon, Timothee, Cru, Carmilla, Coyot, Webb, Kazu, Rudas, LJ, Sea, Ali Wallace, Bewest, Pup, Drub, Dragon, Inoshiro, Byron, Rhett, Xandix, Aimee, Fredrik, Thor, Teddy, Baron, Nelly, Ghengis, Epic, Eli, Stone, Grapes, Irie, Prep, Scobu, Valerie, Alain et bien d&apos;autres.
-
-Tous nos remerciements aux résidents suivants pour avoir testé cette version (la meilleure qui soit jusqu&apos;à présent) : Drew Dwi, Zai Lynch, Latif Khalifa, Ellla McMahon, Harleen Gretzky, Squirrel Wood, Malarthi Behemoth, Dante Tucker, Buckaroo Mu, Eddi Decosta, Dirk, Talamasca, Torben Trautman, Irene Muni, Aralara Rajal, Aura Dirval, Cayu Cluny, Eva Rau, FreeSL Aeon, Frontera Thor, Inma Rau, Lunita Savira, Minerva Memel, Polo Gufler, Xiki Luik, Lilly Zenovka, Vick Forcella, Sasy Scarborough, Gentle Welinder, Elric Anatine, Techwolf Lupindo, Dusan Writer, WolfPup Lowenhar, Marianne McCann, Fiachra Lach, Sitearm Madonna, Sudane Erato, Sahkolihaa Contepomi, Sachi Vixen, Questar Utu, Dimitrio Lewis, Matto Destiny, Scrim Pinion, Radio Signals, Psi Merlin, Pixel Gausman, Mel Vanbeeck, Laurent Bechir, Lamorna Proctor, Lares Carter, Gwyneth Llewelyn, Hydra Shaftoe, Holger Gilruth, Gentle Heron, Carla Broek, Boroondas Gupte, Fury Rosewood, Flower Ducatillon, Colpo Wexler, gwampa Lomu, Borg Capalini, Beansy Twine, Ardy Lay, , 45ms Zhong, Adeon Writer, Aeonix Aeon, Ai Austin, Aiko Ying, Alexandrea Fride, Alliez Mysterio, Annie Milestone, Annika Genezzia, Ansariel Hiller, ArminasX Saiman, Arya Braveheart, Asaeda Meltingdots, Asturkon Jua, Avallyn Oakleaf, Avatar Quinzet, BabyA Littlething, Bacchus Ireto, Bazaar, Riva, Benjamin Bigdipper, Beth Walcher, Bezilon Kasei, Biancaluce Robbiani, Bill Walach, blakopal Galicia, Blitzckreed Levenque, Bryn Oh, Callipygian Christensen, Cap Carver, Carr Arbenlow, Chantal Harvey, Charles Courtois, Charlie Sazaland, Cherry Cheevers, ChickyBabes Zuzu, Christopher  Organiser, Ciaran Laval, Clara Young, Celierra Darling, Corinne Helendale, Corro Moseley, Coughdrop Littlething, Darien Caldwell, Dartagan Shepherd, Debs Regent, Decro Schmooz, Denim Kamachi, DiJodi Dubratt, Dil Spitz, Edgware Marker, Egehan Dryke, Emma Portilo, Emmie Fairymeadow, Evangelista Emerald, Faelon Swordthain, Frenchimmo Sabra, Gaberoonie Zanzibar, Ganymedes Costagravas, Gene Frostbite, GeneJ Composer, Giggles Littlebird, Grady Echegaray, Guni Greenstein, Gypsy Tripsa, Hackshaven Harford, Ham Rambler, Han Shuffle, Hanglow Short, Hatzfeld Runo, herina Bode, Horatio Freund, Hypatia Callisto, Hypatia Pickens, Identity Euler, Imnotgoing Sideways, Innula Zenovka, Iyoba Tarantal, Jack Abraham, Jagga Meredith, Jennifer Boyle, Jeremy Marquez, Jessica Qin, Jinx Nordberg, Jo Bernandes, Jocial Sonnenkern, Joel Savard, Jondan Lundquist, Josef Munster, Josette Windlow, Juilan Tripsa, Juro Kothari, Justin RiversRunRed, Kagehi Kohn, Kaimen Takahe, Keklily Longfall, Ken Lavender, Kestral Karas, Khisme Nitely, Kimar Coba, Kithrak Kirkorian, Kitty Barnett, Kolor Fall, Komiko Okamoto, Korvel Noh, Larry Pixel, Leal Choche, len Starship, Lenae Munz, Lexi Frua, Lillie Cordeaux, Lizzy Macarthur, LSL Scientist, Luban Yiyuan, Luc Starsider, Maccus McCullough, Madison Blanc, Maggie Darwin, Mallory Destiny, Manx Wharton, Marc Claridge, Marc2 Sands, Matthew Anthony, Maxim RiversRunRed, Medhue Simoni, Melinda Latynina, Mencius Watts, Michi Lumin, Midian Farspire, Miles Glaz, Mindy Mathy, Mitch Wagner, Mo Hax, Mourna Biziou, Nao Noe, naofan Teardrop, Naomah Beaumont, Nathiel Siamendes, Nber Medici, Neko Link, Netpat Igaly, Neutron Chesnokov, Newfie Pendragon, Nicholai Laviscu, Nick Rhodes, Nicoladie Gymnast, Ollie Kubrick, Orenj Marat, Orion Delphis, Oryx Tempel, Parvati Silverweb, PeterPunk Mooney, Pixel Scientist, Pounce Teazle, Professor Noarlunga, Quantum Destiny, Quicksilver Hermes, Ralf Setsuko, RAT Quan, RedMokum Bravin, Revolution Perenti, Rezit Sideways, Rich Grainger, Rosco Teardrop, Rose Evans, Rudee Voom, RufusTT Horsefly, Saii Hallard, SaintLEOlions Zimer, Samm Larkham, Satanello Miami, SexySteven Morrisey, Sheet Spotter, Shnurui Troughton, sicarius Thorne, Sicarius Toxx, Sini Nubalo, SLB Wirefly, snowy Sidran, Soupa Segura, ST Mensing, Starshine Halasy, Stickman Ingmann, Synystyr Texan, Takeda Terrawyng, Tali Rosca, Templar Merlin, Tezcatlipoca Bisiani, Tiel Stonecutter, Tony Kembia, TouchaHoney Perhaps, Trey Reanimator, TriloByte Zanzibar, Trinity Dechou, Trinity Dejavu, Unlikely Quintessa, UsikuFarasi Kanarik, Veritas Raymaker, Vex Streeter, Viaticus Speculaas, Villain Baroque, Vixie Durant, Void Singer, Watty Berkson, Westley Schridde, Westley Streeter, Whimsy Winx, Winter Ventura, Wundur Primbee, xstorm Radek, YongYong Francois, Zak Westminster, Zana Kohime, Zaren Alexander, Zeja Pyle, ZenMondo Wormser, Zoex Flanagan et bien d&apos;autres.
-
-
-
-
-« Le travail continue, la cause demeure, l&apos;espoir vit encore et le rêve ne mourra jamais » - Edward Kennedy
+			<text name="linden_intro">
+				Second Life vous est proposé par les Linden :
+			</text>
+			<text_editor name="linden_names">
+				Philip, Andrew, Doug, Richard, Phoenix, Ian, Mark, Robin, Dan, Char, Ryan, Eric, Jim, Lee, Jeff, Michael, Kelly, Steve, Catherine, Bub, Ramzi, Jill, Jeska, Don, Kona, Callum, Charity, Jack, Shawn, babbage, James, Lauren, Blue, Brent, Reuben, Pathfinder, Jesse, Patsy, Torley, Bo, Cyn, Jonathan, Gia, Annette, Ginsu, Harry, Lex, Runitai, Guy, Cornelius, Beth, Swiss, Thumper, Wendy, Teeple, Seth, Dee, Mia, Sally, Liana, Aura, Beez, Milo, Red, Gulliver, Marius, Joe, Jose, Dore, Justin, Nora, Morpheus, Lexie, Amber, Chris, Xan, Leyla, Walker, Sabin, Joshua, Hiromi, Tofu, Fritz, June, Jean, Ivy, Dez, Ken, Betsy, Which, Spike, Rob, Zee, Dustin, George, Claudia, del, Matthew, jane, jay, Adrian, Yool, Rika, Yoz, siobhan, Qarl, Benjamin, Beast, Everett, madhavi, Christopher, Izzy, stephany, Jeremy, sean, adreanne, Pramod, Tobin, sejong, Iridium, maurice, kj, Meta, kari, JP, bert, kyle, Jon, Socrates, Bridie, Ivan, maria, Aric, Coco, Periapse, sandy, Storrs, Lotte, Colossus, Brad, Pastrami, Zen, BigPapi, Banzai, Sardonyx, Mani, Garry, Jaime, Neuro, Samuel, Niko, CeeLo, Austin, Soft, Poppy, emma, tessa, angelo, kurz, alexa, Sue, CG, Blake, Erica, Brett, Bevis, kristen, Q, simon, Enus, MJ, laurap, Kip, Scouse, Ron, Ram, kend, Marty, Prospero, melissa, kraft, Nat, Seraph, Hamilton, Lordan, Green, miz, Ashlei, Trinity, Ekim, Echo, Charlie, Rowan, Rome, Jt, Doris, benoc, Christy, Bao, Kate, Tj, Patch, Cheah, Johan, Brandy, Angela, Oreh, Cogsworth, Lan, Mitchell, Space, Bambers, Einstein, Bender, Malbers, Matias, Maggie, Rothman, Milton, Niall, Marin, Allison, Mango, Andrea, Katt, Yi, Ambroff, Rico, Raymond, Gail, Christa, William, Dawn, Usi, Dynamike, M, Corr, Dante, Molly, kaylee, Danica, Kelv, Lil, jacob, Nya, Rodney, elsie, Blondin, Grant, Nyx, Devin, Monty, Minerva, Keira, Katie, Jenn, Makai, Clare, Joy, Cody, Gayathri, FJ, spider, Oskar, Landon, Jarv, Noelle, Al, Doc, Gray, Vir, t, Maestro, Simone, Shannon, yang, Courtney, Scott, charlene, Quixote, Susan, Zed, Amanda, Katelin, Esbee, JoRoan, Enkidu, roxie, Scarlet, Merov, Kevin, Judy, Rand, Newell, Les, Dessie, Galen, Michon, Geo, Siz, Calyle, Pete, Praveen, Callen, Sheldon, Pink, Nelson, jenelle, Terrence, Nathan, Juan, Sascha, Huseby, Karina, Kaye, Kotler, Lis, Darv, Charrell, Dakota, Kimmora, Theeba, Taka, Mae, Perry, Ducot, dana, Esther, Dough, gisele, Doten, Viale, Fisher, jessieann, ashley, Torres, delby, rountree, kurt, Slaton, Madison, Rue, Gino, Wen, Casssandra, Brodesky, Squid, Gez, Rakesh, Gecko, Ladan, Tony, Tatem, Squire, Falcon, BK, Crimp, Tiggs, Bacon, Coyot, Carmilla, Webb, Sea, Arch, Jillian, Jason, Bernard, Vogt, Peggy, dragon, Pup, xandix, Wallace, Bewest, Inoshiro, Rhett, AG, Aimee, Ghengis, Itiaes, Eli, Steffan, Epic, Grapes, Stone, Prep, Scobu, Robert, Alain, Carla, Vicky, Tia, Alec, Taras, Lisa, Oz, Ariane, Log, House, Kazu, Kim, Drofnas, Tyler, Campbell, Michele, Madeline, Nelly, Baron, Thor, Lori, Hele, Fredrik, Teddy, Pixie, Berry, Gabrielle, Alfonso, Brooke, Wolf, Ringo, Cru, Charlar, Rodvik, Gibson, Elise, Bagman, Greger, Leonidas, Jerm, Leslie, CB, Brenda, Durian, Carlo, mm, Zeeshan, Caleb, Max, Elikak, Mercille, Steph, Chase
+			</text_editor>
+			<text name="contrib_intro">
+				Contributions Open Source :
+			</text>
+			<text_editor name="contrib_names">
+				Dummy Name remplacé au moment de l&apos;exécution
+			</text_editor>
+			<text name="trans_intro">
+				Participation aux traductions :
+			</text>
+			<text_editor name="trans_names">
+				Dummy Name remplacé au moment de l&apos;exécution
 			</text_editor>
 		</panel>
 		<panel label="Licences" name="licenses_panel">
diff --git a/indra/newview/skins/default/xui/fr/floater_preferences_proxy.xml b/indra/newview/skins/default/xui/fr/floater_preferences_proxy.xml
new file mode 100644
index 0000000000..020bdf928b
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/floater_preferences_proxy.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Proxy Settings Floater" title="Paramètres de proxy">
+	<check_box initial_value="false" label="Utiliser le proxy HTTP pour les pages Web" name="web_proxy_enabled"/>
+	<text name="http_proxy_label">
+		Proxy HTTP :
+	</text>
+	<line_editor name="web_proxy_editor" tool_tip="Nom DNS ou adresse IP du proxy HTTP que vous souhaitez utiliser."/>
+	<spinner label="Numéro de port :" name="web_proxy_port" tool_tip="Port du proxy HTTP que vous souhaitez utiliser."/>
+	<check_box label="Utiliser le proxy SOCKS 5 pour le trafic UDP" name="socks_proxy_enabled"/>
+	<text name="socks5_proxy_label">
+		Proxy SOCKS 5 :
+	</text>
+	<line_editor name="socks_proxy_editor" tool_tip="Nom DNS ou adresse IP du proxy SOCKS 5 que vous souhaitez utiliser."/>
+	<spinner label="Numéro de port :" name="socks_proxy_port" tool_tip="Port du proxy SOCKS 5 que vous souhaitez utiliser."/>
+	<text name="socks_auth_label">
+		Authentification SOCKS :
+	</text>
+	<radio_group name="socks5_auth_type">
+		<radio_item label="Aucune authentification" name="Socks5NoAuth" tool_tip="Aucune authentification requise pour le proxy SOCKS 5." value="Aucune"/>
+		<radio_item label="Nom d&apos;utilisateur/Mot de passe" name="Socks5UserPass" tool_tip="Authentification par nom d&apos;utilisateur/mot de passe requise pour le proxy SOCKS 5." value="UserPass"/>
+	</radio_group>
+	<text name="socks5_username_label">
+		Nom d&apos;utilisateur :
+	</text>
+	<text name="socks5_password_label">
+		Mot de passe :
+	</text>
+	<line_editor name="socks5_username" tool_tip="Nom d&apos;utilisateur d&apos;authentification avec votre serveur SOCKS 5."/>
+	<line_editor name="socks5_password" tool_tip="Mot de passe d&apos;authentification avec votre serveur SOCKS 5."/>
+	<text name="other_proxy_label">
+		Autre proxy de trafic HTTP :
+	</text>
+	<radio_group name="other_http_proxy_type">
+		<radio_item label="Pas de proxy" name="OtherNoProxy" tool_tip="Le trafic HTTP hors Web ne sera PAS envoyé à un proxy." value="Aucun"/>
+		<radio_item label="Utiliser le proxy HTTP" name="OtherHTTPProxy" tool_tip="Le trafic HTTP hors Web sera envoyé via le proxy Web configuré." value="Web"/>
+		<radio_item label="Utiliser le proxy SOCKS 5" name="OtherSocksProxy" tool_tip="Le trafic HTTP hors Web sera envoyé via le proxy SOCKS 5 configuré." value="Socks"/>
+	</radio_group>
+	<button label="OK" label_selected="OK" name="OK"/>
+	<button label="Annuler" label_selected="Annuler" name="Cancel"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/fr/menu_inventory.xml b/indra/newview/skins/default/xui/fr/menu_inventory.xml
index fa0e264d14..53df8d11da 100644
--- a/indra/newview/skins/default/xui/fr/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/fr/menu_inventory.xml
@@ -83,5 +83,7 @@
 	<menu_item_call label="Modifier" name="Wearable Edit"/>
 	<menu_item_call label="Ajouter" name="Wearable Add"/>
 	<menu_item_call label="Enlever" name="Take Off"/>
+	<menu_item_call label="Copier vers la boîte d&apos;envoi vendeur" name="Merchant Copy"/>
+	<menu_item_call label="Déplacer vers la boîte d&apos;envoi vendeur" name="Merchant Move"/>
 	<menu_item_call label="--aucune option--" name="--no options--"/>
 </menu>
diff --git a/indra/newview/skins/default/xui/fr/menu_media_ctrl.xml b/indra/newview/skins/default/xui/fr/menu_media_ctrl.xml
index 787a5b3af2..1941ad2cbf 100644
--- a/indra/newview/skins/default/xui/fr/menu_media_ctrl.xml
+++ b/indra/newview/skins/default/xui/fr/menu_media_ctrl.xml
@@ -3,4 +3,5 @@
 	<menu_item_call label="Couper" name="Cut"/>
 	<menu_item_call label="Copier" name="Copy"/>
 	<menu_item_call label="Coller" name="Paste"/>
+	<menu_item_call label="Ouvrir l&apos;inspecteur Web" name="open_webinspector"/>
 </context_menu>
diff --git a/indra/newview/skins/default/xui/fr/menu_mode_change.xml b/indra/newview/skins/default/xui/fr/menu_mode_change.xml
new file mode 100644
index 0000000000..982a331c5b
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/menu_mode_change.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<toggleable_menu name="Mode Change">
+	<menu_item_check label="Basique" name="BasicMode"/>
+	<menu_item_check label="Avancé" name="AdvancedMode"/>
+</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/fr/menu_viewer.xml b/indra/newview/skins/default/xui/fr/menu_viewer.xml
index 46adc79a00..cf1dac2f3a 100644
--- a/indra/newview/skins/default/xui/fr/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/fr/menu_viewer.xml
@@ -138,7 +138,6 @@
 			<menu_item_call label="Son ([COST] L$)..." name="Upload Sound"/>
 			<menu_item_call label="Animation ([COST] L$)..." name="Upload Animation"/>
 			<menu_item_call label="Modèle..." name="Upload Model"/>
-			<menu_item_call label="Assistant Modèle..." name="Upload Model Wizard"/>
 			<menu_item_call label="Lot ([COST] L$ par fichier)..." name="Bulk Upload"/>
 		</menu>
 		<menu_item_call label="Annuler" name="Undo"/>
@@ -253,6 +252,7 @@
 			<menu_item_check label="Afficher les matrices" name="Show Matrices"/>
 			<menu_item_check label="Afficher la couleur sous le curseur" name="Show Color Under Cursor"/>
 			<menu_item_check label="Afficher la mémoire" name="Show Memory"/>
+			<menu_item_check label="Afficher les infos de mémoire privées" name="Show Private Mem Info"/>
 			<menu_item_check label="Afficher les mises à jour des objets" name="Show Updates"/>
 		</menu>
 		<menu label="Forcer une erreur" name="Force Errors">
diff --git a/indra/newview/skins/default/xui/fr/notifications.xml b/indra/newview/skins/default/xui/fr/notifications.xml
index ef95a1a389..1389c49f5b 100644
--- a/indra/newview/skins/default/xui/fr/notifications.xml
+++ b/indra/newview/skins/default/xui/fr/notifications.xml
@@ -85,6 +85,19 @@ Veuillez vérifier votre connexion Internet.
 		Enregistrer les changements dans la partie du corps/les habits actuels ?
 		<usetemplate canceltext="Cancel" name="yesnocancelbuttons" notext="Ne pas enregistrer" yestext="Enregistrer"/>
 	</notification>
+	<notification name="ConfirmNoCopyToOutbox">
+		Vous n&apos;êtes pas autorisé à copier cet article dans la boîte d&apos;envoi vers la Place du marché. Voulez-vous vraiment déplacer l&apos;article suivant ?
+        [ITEM_NAME]
+		<usetemplate name="okcancelbuttons" notext="Non" yestext="Oui"/>
+	</notification>
+	<notification name="OutboxUploadComplete">
+		Chargement sur la Place du marché terminé.
+		<usetemplate name="okbutton" yestext="Hourra !"/>
+	</notification>
+	<notification name="OutboxUploadHadErrors">
+		Chargement sur la Place du marché effectué avec des erreurs ! Corrigez les problèmes dans votre boîte d&apos;envoi et réessayez. Merci !
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
 	<notification name="CompileQueueSaveText">
 		Une erreur est survenue lors du chargement du texte pour un script, suite au problème suivant : [REASON]. Veuillez réessayer ultérieurement.
 	</notification>
@@ -2422,7 +2435,15 @@ Veuillez réessayer dans quelques minutes.
 		<form name="form">
 			<button name="Keep" text="Garder"/>
 			<button name="Discard" text="Jeter"/>
-			<button name="Mute" text="Ignorer"/>
+			<button name="Mute" text="Ignorer le propriétaire"/>
+		</form>
+	</notification>
+	<notification name="OwnObjectGiveItem">
+		Votre objet nommé &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; vous a donné un objet de type [OBJECTTYPE] :
+&lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;
+		<form name="form">
+			<button name="Keep" text="Garder"/>
+			<button name="Discard" text="Jeter"/>
 		</form>
 	</notification>
 	<notification name="UserGiveItem">
@@ -2566,6 +2587,7 @@ Accepter cette requête ?
 		&lt;nolink&gt;[TITLE]&lt;/nolink&gt; de [NAME]
 [MESSAGE]
 		<form name="form">
+			<button name="Mute" text="Ignorer"/>
 			<button name="Ignore" text="Ignorer"/>
 		</form>
 	</notification>
@@ -2573,6 +2595,7 @@ Accepter cette requête ?
 		&lt;nolink&gt;[TITLE]&lt;/nolink&gt; de [GROUPNAME]
 [MESSAGE]
 		<form name="form">
+			<button name="Mute" text="Ignorer"/>
 			<button name="Ignore" text="Ignorer"/>
 		</form>
 	</notification>
@@ -2902,6 +2925,12 @@ Cliquez sur un point dans le monde et faites glisser votre souris pour faire tou
 	<notification label="Vous possédez des Linden dollars !" name="HintLindenDollar">
 		Votre solde actuel en L$ est celui-ci. Pour y ajouter d&apos;autres Linden dollars, cliquez sur Acheter L$.
 	</notification>
+	<notification name="LowMemory">
+		Pool de mémoire faible. Certaines fonctions de SL ont été désactivées afin d&apos;éviter un plantage. Veuillez fermer les autres applications. Si le problème persiste, redémarrez SL.
+	</notification>
+	<notification name="ForceQuitDueToLowMemory">
+		Mémoire insuffisante : fermeture de SL dans 30 secondes.
+	</notification>
 	<notification name="PopupAttempt">
 		Impossible d&apos;ouvrir une fenêtre popup.
 		<form name="form">
@@ -2909,6 +2938,54 @@ Cliquez sur un point dans le monde et faites glisser votre souris pour faire tou
 			<button name="open" text="Ouvrir la fenêtre popup"/>
 		</form>
 	</notification>
+	<notification name="SOCKS_NOT_PERMITTED">
+		Le proxy SOCKS 5 &quot;[HOST]:[PORT]&quot; a refusé la connexion, non autorisée par le jeu de règles défini.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_CONNECT_ERROR">
+		Le proxy SOCKS 5 &quot;[HOST]:[PORT]&quot; a refusé la connexion. Impossible d&apos;ouvrir le canal TCP.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_NOT_ACCEPTABLE">
+		Le proxy SOCKS 5 &quot;[HOST]:[PORT]&quot; a refusé le système d&apos;authentification sélectionné.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_AUTH_FAIL">
+		Le proxy SOCKS 5 &quot;[HOST]:[PORT]&quot; indique que vos identifiants ne sont pas valides.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_UDP_FWD_NOT_GRANTED">
+		Le proxy SOCKS 5 &quot;[HOST]:[PORT]&quot; a refusé la demande d&apos;association UDP (UDP ASSOCIATE).
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_HOST_CONNECT_FAILED">
+		Connexion au serveur de proxy SOCKS 5 &quot;[HOST]:[PORT]&quot; impossible.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_UNKNOWN_STATUS">
+		Erreur de proxy inconnue avec le serveur &quot;[HOST]:[PORT]&quot;.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_INVALID_HOST">
+		Adresse ou port &quot;[HOST]:[PORT]&quot; de proxy SOCKS non valide.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_BAD_CREDS">
+		Nom d&apos;utilisateur ou mot de passe SOCKS 5 non valide.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="PROXY_INVALID_HTTP_HOST">
+		Adresse ou port &quot;[HOST]:[PORT]&quot; de proxy HTTP non valide.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="PROXY_INVALID_SOCKS_HOST">
+		Adresse ou port &quot;[HOST]:[PORT]&quot; de proxy SOCKS non valide.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="ChangeProxySettings">
+		Les paramètres de proxy seront appliqués au redémarrage de [APP_NAME].
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
 	<notification name="AuthRequest">
 		Nom d&apos;utilisateur et mot de passe requis pour le site se trouvant à l&apos;emplacement suivant : &apos;&lt;nolink&gt;[HOST_NAME]&lt;/nolink&gt;&apos;, domaine &apos;[REALM]&apos;.
 		<form name="form">
diff --git a/indra/newview/skins/default/xui/fr/panel_outbox_inventory.xml b/indra/newview/skins/default/xui/fr/panel_outbox_inventory.xml
new file mode 100644
index 0000000000..d947dbceb8
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/panel_outbox_inventory.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<outbox_inventory_panel name="inventory_outbox" tool_tip="Glisser-déposer des articles ici afin de les préparer à la vente sur votre vitrine."/>
diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_setup.xml b/indra/newview/skins/default/xui/fr/panel_preferences_setup.xml
index bfe0defd56..82780c27c5 100644
--- a/indra/newview/skins/default/xui/fr/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/fr/panel_preferences_setup.xml
@@ -11,17 +11,6 @@
 	</text>
 	<check_box label="Port de connexion" name="connection_port_enabled"/>
 	<spinner label="Numéro :" name="connection_port"/>
-	<text name="cache_size_label_l">
-		Taille de la mémoire
-	</text>
-	<text name="text_box5">
-		Mo
-	</text>
-	<text name="Cache location">
-		Emplacement du cache :
-	</text>
-	<button label="Parcourir" label_selected="Parcourir" name="set_cache"/>
-	<button label="Réinitialiser" label_selected="Réinitialiser" name="reset_cache"/>
 	<text name="Web:">
 		Web :
 	</text>
@@ -33,12 +22,6 @@
 	<check_box initial_value="true" label="Accepter les cookies" name="cookies_enabled"/>
 	<check_box initial_value="true" label="Activer Javascript" name="browser_javascript_enabled"/>
 	<check_box initial_value="false" label="Activer les fenêtres popup de navigateur de médias" name="media_popup_enabled"/>
-	<check_box initial_value="false" label="Activer le proxy Web" name="web_proxy_enabled"/>
-	<text name="Proxy location">
-		Emplacement du proxy :
-	</text>
-	<line_editor name="web_proxy_editor" tool_tip="Le nom ou adresse IP du proxy que vous souhaitez utiliser"/>
-	<spinner label="Numéro de port :" label_width="95" name="web_proxy_port" width="170"/>
 	<text name="Software updates:">
 		Mises à jour logicielles :
 	</text>
@@ -46,4 +29,8 @@
 		<combo_box.item label="Installation automatique" name="Install_automatically"/>
 		<combo_box.item label="Téléchargement et installation manuels" name="Install_manual"/>
 	</combo_box>
+	<text name="Proxy Settings:">
+		Paramètres de proxy :
+	</text>
+	<button label="Définir" label_selected="Parcourir" name="set_proxy"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_status_bar.xml b/indra/newview/skins/default/xui/fr/panel_status_bar.xml
index 69aec99e1d..2dd5c06e4d 100644
--- a/indra/newview/skins/default/xui/fr/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/fr/panel_status_bar.xml
@@ -1,11 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="status">
-	<panel.string name="StatBarDaysOfWeek">
-		Sunday:Monday:Tuesday:Wednesday:Thursday:Friday:Saturday
-	</panel.string>
-	<panel.string name="StatBarMonthsOfYear">
-		January:February:March:April:May:June:July:August:September:October:November:December
-	</panel.string>
 	<panel.string name="packet_loss_tooltip">
 		Perte de paquets
 	</panel.string>
@@ -25,6 +19,10 @@
 		<text name="balance" tool_tip="Cliquer sur ce bouton pour actualiser votre solde en L$." value="20 L$"/>
 		<button label="ACHETER L$" name="buyL" tool_tip="Cliquer pour acheter plus de L$"/>
 	</panel>
+	<combo_box name="mode_combo" tool_tip="Sélectionnez un mode. Pour une exploration facile et rapide avec chat, choisissez Basique. Pour accéder à plus de fonctionnalités, choisissez Avancé.">
+		<combo_box.item label="Mode basique" name="Basic"/>
+		<combo_box.item label="Mode avancé" name="Advanced"/>
+	</combo_box>
 	<text name="TimeText" tool_tip="Heure actuelle (Pacifique)">
 		00h00 PST
 	</text>
diff --git a/indra/newview/skins/default/xui/fr/sidepanel_inventory.xml b/indra/newview/skins/default/xui/fr/sidepanel_inventory.xml
index 83543e3d0b..969bd1ac44 100644
--- a/indra/newview/skins/default/xui/fr/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/fr/sidepanel_inventory.xml
@@ -2,35 +2,47 @@
 <panel label="Choses" name="objects panel">
 	<panel label="" name="sidepanel__inventory_panel">
 		<layout_stack name="inventory_layout_stack">
-			<layout_panel name="inbox_layout_panel">
-				<panel label="" name="marketplace_inbox">
-					<string name="InboxLabelWithArg">
-						Articles reçus ([NUM])
-					</string>
-					<string name="InboxLabelNoArg">
-						Articles reçus
-					</string>
-					<button label="Articles reçus" name="inbox_btn"/>
-					<text name="inbox_fresh_new_count">
-						[NUM] nouv.
-					</text>
-					<panel tool_tip="Drag and drop items to your inventory to manage and use them">
-						<text name="inbox_inventory_placeholder">
-							Ici seront livrés les achats effectués sur la Place du marché.
-						</text>
-					</panel>
-				</panel>
-			</layout_panel>
-			<layout_panel name="outbox_layout_panel">
-				<panel label="" name="marketplace_outbox">
-					<button label="Boîte d&apos;envoi vendeur" name="outbox_btn"/>
-					<button label="" name="outbox_sync_btn" tool_tip="Vers ma vitrine de la Place du marché"/>
-					<panel tool_tip="Drag and drop items here to prepare them for sale on your storefront">
-						<text name="outbox_inventory_placeholder">
-							Configurez votre compte de vendeur de façon à pouvoir utiliser cette fonctionnalité.
-						</text>
-					</panel>
-				</panel>
+			<layout_panel name="inbox_outbox_layout_panel">
+				<layout_stack name="inbox_outbox_layout_stack">
+					<layout_panel name="inbox_layout_panel">
+						<panel label="" name="marketplace_inbox">
+							<string name="InboxLabelWithArg">
+								Articles reçus ([NUM])
+							</string>
+							<string name="InboxLabelNoArg">
+								Articles reçus
+							</string>
+							<button label="Articles reçus" name="inbox_btn"/>
+							<text name="inbox_fresh_new_count">
+								[NUM] nouv.
+							</text>
+							<panel tool_tip="Drag and drop items to your inventory to manage and use them">
+								<text name="inbox_inventory_placeholder">
+									Ici seront livrés les achats effectués sur la Place du marché.
+								</text>
+							</panel>
+						</panel>
+					</layout_panel>
+					<layout_panel name="outbox_layout_panel">
+						<panel label="" name="marketplace_outbox">
+							<string name="OutboxLabelWithArg">
+								Boîte d&apos;envoi vendeur ([NUM])
+							</string>
+							<string name="OutboxLabelNoArg">
+								Boîte d&apos;envoi vendeur
+							</string>
+							<button label="Boîte d&apos;envoi vendeur" name="outbox_btn"/>
+							<button label="" name="outbox_sync_btn" tool_tip="Vers ma vitrine de la Place du marché"/>
+							<panel>
+								<panel name="outbox_inventory_placeholder_panel">
+									<text name="outbox_inventory_placeholder_title">
+										Chargement...
+									</text>
+								</panel>
+							</panel>
+						</panel>
+					</layout_panel>
+				</layout_stack>
 			</layout_panel>
 		</layout_stack>
 		<panel name="button_panel">
diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml
index 4b4eedab8e..7d349f27a6 100644
--- a/indra/newview/skins/default/xui/fr/strings.xml
+++ b/indra/newview/skins/default/xui/fr/strings.xml
@@ -339,6 +339,18 @@ Veuillez réessayer de vous connecter dans une minute.
 		Impossible de faire glisser plus d&apos;un objet ici
 	</string>
 	<string name="TooltipPrice" value="[AMOUNT] L$ :"/>
+	<string name="TooltipOutboxNoTransfer">
+		Impossible de vendre ou de transférer un ou plusieurs de ces objets à un autre utilisateur.
+	</string>
+	<string name="TooltipOutboxWorn">
+		Vous portez un ou plusieurs de ces objets. Retirez-les de votre avatar, puis réessayez de les déplacer.
+	</string>
+	<string name="TooltipOutboxFolderLevels">
+		Trop de niveaux de sous-dossiers dans ce dossier. Réorganisez-le de sorte qu&apos;un maximum de 4 niveaux soit utilisé (dossier racine contenant A contenant B contenant C).
+	</string>
+	<string name="TooltipOutboxTooManyObjects">
+		Ce dossier contient plus de 200 objets. Regroupez une partie des articles dans un paquet afin de réduire le nombre d&apos;objets.
+	</string>
 	<string name="TooltipHttpUrl">
 		Cliquez pour afficher cette page web
 	</string>
@@ -1204,8 +1216,65 @@ Veuillez réessayer de vous connecter dans une minute.
 	<string name="InventoryInboxNoItems">
 		Ici seront livrés les articles achetés sur la Place du marché.
 	</string>
+	<string name="MarketplaceURL">
+		http://marketplace.[DOMAIN_NAME]
+	</string>
+	<string name="MarketplaceURL_CreateStore">
+		http://marketplace.[DOMAIN_NAME]/create_store
+	</string>
+	<string name="MarketplaceURL_LearnMore">
+		http://marketplace.[DOMAIN_NAME]/learn_more
+	</string>
+	<string name="InventoryOutboxCreationErrorTitle">
+		Configuration incorrecte de votre boîte d&apos;envoi vendeur
+	</string>
+	<string name="InventoryOutboxCreationErrorTooltip">
+		Erreur de configuration de la boîte d&apos;envoi vendeur
+	</string>
+	<string name="InventoryOutboxCreationError">
+		Veuillez contacter le service clientèle pour résoudre le problème.
+	</string>
+	<string name="InventoryOutboxNotMerchantTitle">
+		Tout le monde peut vendre des articles sur la Place du marché
+	</string>
+	<string name="InventoryOutboxNotMerchantTooltip">
+		Devenez vendeur !
+	</string>
+	<string name="InventoryOutboxNotMerchant">
+		[[MARKETPLACE_URL] La Place du marché Second Life] comprend plus d&apos;un million de produits virtuels à vendre, tous créés par des résidents. Vous aussi pouvez vendre les articles que vous créez, ainsi que certains articles que vous avez achetés. Le processus est simple et la configuration gratuite. [[LEARN_MORE_URL] En savoir plus] ou [[CREATE_STORE_URL] créer une boutique] sur la Place du marché pour démarrer
+	</string>
+	<string name="InventoryOutboxNoItemsTitle">
+		Un nouveau moyen d&apos;envoyer des articles sur la Place du marché
+	</string>
+	<string name="InventoryOutboxNoItemsTooltip">
+		Glisser-déposer des articles ici afin de les préparer à la vente sur la Place du marché.
+	</string>
 	<string name="InventoryOutboxNoItems">
-		Faites glisser des articles ici en vue de les publier sur votre vitrine de la Place du marché.
+		Faites glisser les articles ou dossiers d&apos;articles à vendre dans cette zone. Une copie de l&apos;article s&apos;affiche, sans que votre inventaire ne soit modifié, sauf si vous avez fait glisser un article pour lequel la copie est interdite. Une fois prêt à envoyer les articles vers la Place du marché, cliquez sur le bouton Charger. Les articles disparaissent de ce dossier lorsqu&apos;ils ont été déplacés vers l&apos;inventaire de la Place du marché.
+	</string>
+	<string name="Marketplace Error None">
+		Aucune erreur
+	</string>
+	<string name="Marketplace Error Not Merchant">
+		Erreur : avant d&apos;envoyer des articles vers la Place du marché, vous devez vous configurer comme vendeur (gratuit).
+	</string>
+	<string name="Marketplace Error Empty Folder">
+		Erreur : ce dossier est vide.
+	</string>
+	<string name="Marketplace Error Unassociated Products">
+		Erreur : le chargement de cet article a échoué en raison d&apos;un nombre trop important d&apos;articles non associés à des produits au niveau de votre compte de vendeur. Pour résoudre ce problème, connectez-vous au site Web de la Place du marché et réduisez le nombre d&apos;articles non associés.
+	</string>
+	<string name="Marketplace Error Object Limit">
+		Erreur : cet article contient trop d&apos;objets. Pour résoudre le problème, regroupez des objets dans des paquets afin de réduire le nombre total à moins de 200.
+	</string>
+	<string name="Marketplace Error Folder Depth">
+		Erreur : trop de niveaux de dossiers imbriqués concernant cet article. Réorganisez le tout afin qu&apos;un maximum de 3 niveaux soit utilisé.
+	</string>
+	<string name="Marketplace Error Unsellable Item">
+		Erreur : cet article ne peut pas être vendu sur la Place du marché.
+	</string>
+	<string name="Marketplace Error Internal Import">
+		Erreur : un problème est survenu concernant cet article. Veuillez réessayer ultérieurement.
 	</string>
 	<string name="no_transfer" value=" (pas de transfert)"/>
 	<string name="no_modify" value=" (pas de modification)"/>
@@ -4185,7 +4254,7 @@ de l&apos;infraction signalée
 	<string name="Female - Wow">
 		Femme - Ouah !
 	</string>
-	<string name="/bow">
+	<string name="/bow1">
 		/s&apos;incliner
 	</string>
 	<string name="/clap">
diff --git a/indra/newview/skins/default/xui/it/floater_about.xml b/indra/newview/skins/default/xui/it/floater_about.xml
index 214ae96373..db4dbe02e2 100644
--- a/indra/newview/skins/default/xui/it/floater_about.xml
+++ b/indra/newview/skins/default/xui/it/floater_about.xml
@@ -42,15 +42,23 @@ Versione Server voice: [VOICE_VERSION]
 			<button label="Copia negli appunti" name="copy_btn"/>
 		</panel>
 		<panel label="Ringraziamenti" name="credits_panel">
-			<text_editor name="credits_editor">
-				Second Life ti è offerto da Philip, Tessa, Andrew, Cory, Ian, James, Phoenix, Ryan, Haney, Dan, Char, Ben, John, Tanya, Eddie, Richard, Mitch, Doug, Eric, Frank, Bruce, Aaron, Peter, Alice, Charlie, Debra, Eileen, Helen, Janet, Steffan, Steve, Tom, Mark, Hunter, Xenon, Burgess, Bill, Jim, Lee, Hamlet, Daniel, Jeff, Todd, Sarah, Tim, Stephanie, Colin, Michael, Evan, Nicolas, Catherine, Rachelle, Dave, Holly, Bub, Kelly, Ramzi, Don, Sabin, Jill, Rheya, Jeska, Torley, Kona, Callum, Charity, Jack, Vektor, Chris, Nicole, Mick, Reuben, Blue, Babbage, Yedwab, Deana, Lauren, Brent, Pathfinder, Chadrick, Jesse, David, Tess, Lizzie, Patsy, Isaac, Lawrence, Cyn, Bo, Gia, Annette, Marius, Tbone, Jonathan, Karen, Ginsu, Yuko, Makiko, Thomas, Harry, Seth, Brian, Guy, Runitai, Ethan, Data, Cornelius, Kenny, Swiss, Zero, Brad, Natria, Wendy, Stephen, Teeple, Thumper, Lucy, Dee, Mia, Liana, Warren, Branka, Aura, Beez, Milo, Hermia, Red, Thrax, Gulliver, Joe, Sally, Paul, Jose, Rejean, Dore, Henrik, Lexie, Amber, Logan, Xan, Nora, Morpheus, Donovan, Leyla, MichaelFrancis, Beast, Cube, Bucky, Joshua, Stryfe, Harmony, Teresa, Claudia, Walker, Glenn, Fritz, Fordak, June, Cleopetra, Ivy, Betsy, Roosevelt, Spike, Ken, Which, Tofu, Chiyo, Rob, Zee, Dustin, George, Del, Matthew, Cat, Jacqui, Adrian, Viola, Alfred, Noel, Irfan, Yool, Rika, Jane, Frontier, Neo, Siobhan, Yoz, Justin, Elle, Qarl, Benjamin, Isabel, Everett, Christopher, Izzy, Stephany, Garry, Sejong, Sean, Tobin, Iridium, Meta, Jeremy, JP, Jake, Anthony, Maurice, Madhavi, Leopard, Kyle, Joon, Bert, Belinda, Jon, Kristi, Bridie, Pramod, Socrates, Maria, Aric, Adreanne, Jay, Kari, Ceren, Coco, Durl, Jenny, Periapse, Kartic, Storrs, Lotte, Sandy, Colossus, Zen, BigPapi, Pastrami, Kurz, Mani, Neuro, Mel, Sardonyx, MJ, Rowan, Sgt, Elvis, Samuel, Leo, Bryan, Niko, Austin, Soft, Poppy, Rachel, Aki, Banzai, Alexa, Sue, Bender, CG, Angelo, Gillian, Pelle, Nick, Echo, Zara, Christine, Shamiran, Emma, Blake, Keiko, Plexus, Joppa, Sidewinder, Erica, Ashlei, Twilight, Kristen, Brett, Q, Enus, Simon, Bevis, Kraft, Kip, Chandler, Ron, LauraP, Ram, KyleJM, Scouse, Prospero, Melissa, Marty, Nat, Hamilton, Kend, Lordan, Jimmy, Kosmo, Seraph, Green, Ekim, Wiggo, JT, Rome, Doris, Miz, Benoc, Whump, Trinity, Patch, Kate, TJ, Bao, Joohwan, Christy, Sofia, Matias, Cogsworth, Johan, Oreh, Cheah, Angela, Brandy, Mango, Lan, Aleks, Gloria, Mitchell, Space, Colton, Bambers, Einstein, Maggie, Malbers, Rose, Rothman, Niall, Marin, Allison, Katie, Dawn, Dusty, Katt, Judy, Andrea, Ambroff, Infinity, Rico, Gail, Kalpana, Raymond, Yi, William, Christa, M, Teagan, Scout, Molly, Dante, Corr, Dynamike, Usi, Kaylee, Lil, Danica, Sascha, Kelv, Jacob, Nya, Rodney, Brandon, Elsie, Blondin, Grant, Katrin, Nyx, Gabriel, Locklainn, Claire, Devin, Minerva, Monty, Bradford, Si, Keira, H, Caitlin, Dita, Makai, Jenn, Ann, Meredith, Clare, Joy, Praveen, Cody, Edmund, Ruthe, Sirena, Gayathri, Spider, FJ, Davidoff, Tian, Jennie, Louise, Oskar, Landon, Noelle, Jarv, Ingrid, Al, Sommer, Doc, Aria, Huin, Gray, Lili, Vir, DJ, Maestro, Simone, Yang, T, Shannon, Nelson, Khanh, Scott, Courtney, Charlene, Quixote, Susan, Zed, Amanda, Katelin, Enkidu, Roxie, Esbee, JoRoan, Scarlet, Tay, Kevin, Wolfgang, Johnny, Ray, Andren, Merov, Bob, Rand, Howard, Callen, Heff, Galen, Newell, Dessie, Les, Michon, Jenelle, Geo, Siz, Shapiro, Pete, Calyle, Selene, Allen, Phoebe, Goldin, Kimmora, Dakota, Slaton, Lindquist, Zoey, Hari, Othello, Rohit, Sheldon, Petra, Viale, Gordon, Kaye, Pink, Ferny, Emerson, Davy, Bri, Chan, Juan, Robert, Terrence, Nathan, Carl, Ashley, JessieAnn, Huseby, Karina, Paris, Kurt, Rick, Lis, Kotler, Theeba, Lynx, Murphy, Doten, Taka, Norm, Jillian, Marcus, Mae, Novack, Esther, Perry, Dana, Ducot, Javier, Porter, Madison, Gecko, Dough, JR, Gisele, Crimp, Norie, Arch, Kimi, Fisher, Barbara, Jason, Peggy, Bernard, Jules, Leroy, Eva, Khederian, Campbell, Vogt, Masido, Karel, Torres, Lo, Breezer, Delby, Rountree, Anna, Servus, Rue, Itiaes, Chuck, Luna, Novella, Zaza, Wen, Gino, Lex, Cassandra, Limey, Nancy, Anukul, Silver, Brodesky, Jinsai, Squid, Gez, Rakesh, Ladan, Edelman, Marcet, Squire, Tatem, Tony, Jerm, Tia, Falcon, BK, Tiggs, Driscoll, Bacon, Timothee, Cru, Carmilla, Coyot, Webb, Kazu, Rudas, LJ, Sea, Ali Wallace, Bewest, Pup, Drub, Dragon, Inoshiro, Byron, Rhett, Xandix, Aimee, Fredrik, Thor, Teddy, Baron, Nelly, Ghengis, Epic, Eli, Stone, Grapes, Irie, Prep, Scobu, Valerie, Alain e molti altri ancora.
-
-Si ringraziano i seguenti residenti per aver contribuito a rendere questa versione la migliore possibile: Drew Dwi, Zai Lynch, Latif Khalifa, Ellla McMahon, Harleen Gretzky, Squirrel Wood, Malarthi Behemoth, Dante Tucker, Buckaroo Mu, Eddi Decosta, Dirk, Talamasca, Torben Trautman, Irene Muni, Aralara Rajal, Aura Dirval, Cayu Cluny, Eva Rau, FreeSL Aeon, Frontera Thor, Inma Rau, Lunita Savira, Minerva Memel, Polo Gufler, Xiki Luik, Lilly Zenovka, Vick Forcella, Sasy Scarborough, Gentle Welinder, Elric Anatine, Techwolf Lupindo, Dusan Writer, WolfPup Lowenhar, Marianne McCann, Fiachra Lach, Sitearm Madonna, Sudane Erato, Sahkolihaa Contepomi, Sachi Vixen, Questar Utu, Dimitrio Lewis, Matto Destiny, Scrim Pinion, Radio Signals, Psi Merlin, Pixel Gausman, Mel Vanbeeck, Laurent Bechir, Lamorna Proctor, Lares Carter, Gwyneth Llewelyn, Hydra Shaftoe, Holger Gilruth, Gentle Heron, Carla Broek, Boroondas Gupte, Fury Rosewood, Flower Ducatillon, Colpo Wexler, gwampa Lomu, Borg Capalini, Beansy Twine, Ardy Lay, , 45ms Zhong, Adeon Writer, Aeonix Aeon, Ai Austin, Aiko Ying, Alexandrea Fride, Alliez Mysterio, Annie Milestone, Annika Genezzia, Ansariel Hiller, ArminasX Saiman, Arya Braveheart, Asaeda Meltingdots, Asturkon Jua, Avallyn Oakleaf, Avatar Quinzet, BabyA Littlething, Bacchus Ireto, Bazaar, Riva, Benjamin Bigdipper, Beth Walcher, Bezilon Kasei, Biancaluce Robbiani, Bill Walach, blakopal Galicia, Blitzckreed Levenque, Bryn Oh, Callipygian Christensen, Cap Carver, Carr Arbenlow, Chantal Harvey, Charles Courtois, Charlie Sazaland, Cherry Cheevers, ChickyBabes Zuzu, Christopher  Organiser, Ciaran Laval, Clara Young, Celierra Darling, Corinne Helendale, Corro Moseley, Coughdrop Littlething, Darien Caldwell, Dartagan Shepherd, Debs Regent, Decro Schmooz, Denim Kamachi, DiJodi Dubratt, Dil Spitz, Edgware Marker, Egehan Dryke, Emma Portilo, Emmie Fairymeadow, Evangelista Emerald, Faelon Swordthain, Frenchimmo Sabra, Gaberoonie Zanzibar, Ganymedes Costagravas, Gene Frostbite, GeneJ Composer, Giggles Littlebird, Grady Echegaray, Guni Greenstein, Gypsy Tripsa, Hackshaven Harford, Ham Rambler, Han Shuffle, Hanglow Short, Hatzfeld Runo, herina Bode, Horatio Freund, Hypatia Callisto, Hypatia Pickens, Identity Euler, Imnotgoing Sideways, Innula Zenovka, Iyoba Tarantal, Jack Abraham, Jagga Meredith, Jennifer Boyle, Jeremy Marquez, Jessica Qin, Jinx Nordberg, Jo Bernandes, Jocial Sonnenkern, Joel Savard, Jondan Lundquist, Josef Munster, Josette Windlow, Juilan Tripsa, Juro Kothari, Justin RiversRunRed, Kagehi Kohn, Kaimen Takahe, Keklily Longfall, Ken Lavender, Kestral Karas, Khisme Nitely, Kimar Coba, Kithrak Kirkorian, Kitty Barnett, Kolor Fall, Komiko Okamoto, Korvel Noh, Larry Pixel, Leal Choche, len Starship, Lenae Munz, Lexi Frua, Lillie Cordeaux, Lizzy Macarthur, LSL Scientist, Luban Yiyuan, Luc Starsider, Maccus McCullough, Madison Blanc, Maggie Darwin, Mallory Destiny, Manx Wharton, Marc Claridge, Marc2 Sands, Matthew Anthony, Maxim RiversRunRed, Medhue Simoni, Melinda Latynina, Mencius Watts, Michi Lumin, Midian Farspire, Miles Glaz, Mindy Mathy, Mitch Wagner, Mo Hax, Mourna Biziou, Nao Noe, naofan Teardrop, Naomah Beaumont, Nathiel Siamendes, Nber Medici, Neko Link, Netpat Igaly, Neutron Chesnokov, Newfie Pendragon, Nicholai Laviscu, Nick Rhodes, Nicoladie Gymnast, Ollie Kubrick, Orenj Marat, Orion Delphis, Oryx Tempel, Parvati Silverweb, PeterPunk Mooney, Pixel Scientist, Pounce Teazle, Professor Noarlunga, Quantum Destiny, Quicksilver Hermes, Ralf Setsuko, RAT Quan, RedMokum Bravin, Revolution Perenti, Rezit Sideways, Rich Grainger, Rosco Teardrop, Rose Evans, Rudee Voom, RufusTT Horsefly, Saii Hallard, SaintLEOlions Zimer, Samm Larkham, Satanello Miami, SexySteven Morrisey, Sheet Spotter, Shnurui Troughton, sicarius Thorne, Sicarius Toxx, Sini Nubalo, SLB Wirefly, snowy Sidran, Soupa Segura, ST Mensing, Starshine Halasy, Stickman Ingmann, Synystyr Texan, Takeda Terrawyng, Tali Rosca, Templar Merlin, Tezcatlipoca Bisiani, Tiel Stonecutter, Tony Kembia, TouchaHoney Perhaps, Trey Reanimator, TriloByte Zanzibar, Trinity Dechou, Trinity Dejavu, Unlikely Quintessa, UsikuFarasi Kanarik, Veritas Raymaker, Vex Streeter, Viaticus Speculaas, Villain Baroque, Vixie Durant, Void Singer, Watty Berkson, Westley Schridde, Westley Streeter, Whimsy Winx, Winter Ventura, Wundur Primbee, xstorm Radek, YongYong Francois, Zak Westminster, Zana Kohime, Zaren Alexander, Zeja Pyle, ZenMondo Wormser, Zoex Flanagan e molti altri ancora.
-
-
-
-
-&quot;Il lavoro continua, la causa sussiste, la speranza vive ancora e i sogni non svaniranno mai&quot; - Edward Kennedy
+			<text name="linden_intro">
+				Second Life vi è offerto dai Linden:
+			</text>
+			<text_editor name="linden_names">
+				Philip, Andrew, Doug, Richard, Phoenix, Ian, Mark, Robin, Dan, Char, Ryan, Eric, Jim, Lee, Jeff, Michael, Kelly, Steve, Catherine, Bub, Ramzi, Jill, Jeska, Don, Kona, Callum, Charity, Jack, Shawn, babbage, James, Lauren, Blue, Brent, Reuben, Pathfinder, Jesse, Patsy, Torley, Bo, Cyn, Jonathan, Gia, Annette, Ginsu, Harry, Lex, Runitai, Guy, Cornelius, Beth, Swiss, Thumper, Wendy, Teeple, Seth, Dee, Mia, Sally, Liana, Aura, Beez, Milo, Red, Gulliver, Marius, Joe, Jose, Dore, Justin, Nora, Morpheus, Lexie, Amber, Chris, Xan, Leyla, Walker, Sabin, Joshua, Hiromi, Tofu, Fritz, June, Jean, Ivy, Dez, Ken, Betsy, Which, Spike, Rob, Zee, Dustin, George, Claudia, del, Matthew, jane, jay, Adrian, Yool, Rika, Yoz, siobhan, Qarl, Benjamin, Beast, Everett, madhavi, Christopher, Izzy, stephany, Jeremy, sean, adreanne, Pramod, Tobin, sejong, Iridium, maurice, kj, Meta, kari, JP, bert, kyle, Jon, Socrates, Bridie, Ivan, maria, Aric, Coco, Periapse, sandy, Storrs, Lotte, Colossus, Brad, Pastrami, Zen, BigPapi, Banzai, Sardonyx, Mani, Garry, Jaime, Neuro, Samuel, Niko, CeeLo, Austin, Soft, Poppy, emma, tessa, angelo, kurz, alexa, Sue, CG, Blake, Erica, Brett, Bevis, kristen, Q, simon, Enus, MJ, laurap, Kip, Scouse, Ron, Ram, kend, Marty, Prospero, melissa, kraft, Nat, Seraph, Hamilton, Lordan, Green, miz, Ashlei, Trinity, Ekim, Echo, Charlie, Rowan, Rome, Jt, Doris, benoc, Christy, Bao, Kate, Tj, Patch, Cheah, Johan, Brandy, Angela, Oreh, Cogsworth, Lan, Mitchell, Space, Bambers, Einstein, Bender, Malbers, Matias, Maggie, Rothman, Milton, Niall, Marin, Allison, Mango, Andrea, Katt, Yi, Ambroff, Rico, Raymond, Gail, Christa, William, Dawn, Usi, Dynamike, M, Corr, Dante, Molly, kaylee, Danica, Kelv, Lil, jacob, Nya, Rodney, elsie, Blondin, Grant, Nyx, Devin, Monty, Minerva, Keira, Katie, Jenn, Makai, Clare, Joy, Cody, Gayathri, FJ, spider, Oskar, Landon, Jarv, Noelle, Al, Doc, Gray, Vir, t, Maestro, Simone, Shannon, yang, Courtney, Scott, charlene, Quixote, Susan, Zed, Amanda, Katelin, Esbee, JoRoan, Enkidu, roxie, Scarlet, Merov, Kevin, Judy, Rand, Newell, Les, Dessie, Galen, Michon, Geo, Siz, Calyle, Pete, Praveen, Callen, Sheldon, Pink, Nelson, jenelle, Terrence, Nathan, Juan, Sascha, Huseby, Karina, Kaye, Kotler, Lis, Darv, Charrell, Dakota, Kimmora, Theeba, Taka, Mae, Perry, Ducot, dana, Esther, Dough, gisele, Doten, Viale, Fisher, jessieann, ashley, Torres, delby, rountree, kurt, Slaton, Madison, Rue, Gino, Wen, Casssandra, Brodesky, Squid, Gez, Rakesh, Gecko, Ladan, Tony, Tatem, Squire, Falcon, BK, Crimp, Tiggs, Bacon, Coyot, Carmilla, Webb, Sea, Arch, Jillian, Jason, Bernard, Vogt, Peggy, dragon, Pup, xandix, Wallace, Bewest, Inoshiro, Rhett, AG, Aimee, Ghengis, Itiaes, Eli, Steffan, Epic, Grapes, Stone, Prep, Scobu, Robert, Alain, Carla, Vicky, Tia, Alec, Taras, Lisa, Oz, Ariane, Log, House, Kazu, Kim, Drofnas, Tyler, Campbell, Michele, Madeline, Nelly, Baron, Thor, Lori, Hele, Fredrik, Teddy, Pixie, Berry, Gabrielle, Alfonso, Brooke, Wolf, Ringo, Cru, Charlar, Rodvik, Gibson, Elise, Bagman, Greger, Leonidas, Jerm, Leslie, CB, Brenda, Durian, Carlo, mm, Zeeshan, Caleb, Max, Elikak, Mercille, Steph, Chase
+			</text_editor>
+			<text name="contrib_intro">
+				con contributi open source da:
+			</text>
+			<text_editor name="contrib_names">
+				Dummy Name sostituito all&apos;avvio
+			</text_editor>
+			<text name="trans_intro">
+				e le traduzioni da:
+			</text>
+			<text_editor name="trans_names">
+				Dummy Name sostituito all&apos;avvio
 			</text_editor>
 		</panel>
 		<panel label="Licenze" name="licenses_panel">
diff --git a/indra/newview/skins/default/xui/it/floater_preferences_proxy.xml b/indra/newview/skins/default/xui/it/floater_preferences_proxy.xml
new file mode 100644
index 0000000000..86ea8064b1
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/floater_preferences_proxy.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Proxy Settings Floater" title="Impostazioni proxy">
+	<check_box initial_value="false" label="Usa proxy HTTP per le pagine Web" name="web_proxy_enabled"/>
+	<text name="http_proxy_label">
+		Proxy HTTP:
+	</text>
+	<line_editor name="web_proxy_editor" tool_tip="Il nome DNS o l&apos;indirizzo IP del proxy HTTP che preferisci usare."/>
+	<spinner label="Numero porta:" name="web_proxy_port" tool_tip="La porta del proxy HTTP che preferisci usare."/>
+	<check_box label="Usa Proxy SOCKS 5 per il traffico UDP" name="socks_proxy_enabled"/>
+	<text name="socks5_proxy_label">
+		Proxy SOCKS 5:
+	</text>
+	<line_editor name="socks_proxy_editor" tool_tip="Il nome DNS o l&apos;indirizzo IP del proxy SOCKS 5 che preferisci usare."/>
+	<spinner label="Numero porta:" name="socks_proxy_port" tool_tip="La porta del proxy SOCKS 5 che preferisci usare."/>
+	<text name="socks_auth_label">
+		Autenticazione SOCKS:
+	</text>
+	<radio_group name="socks5_auth_type">
+		<radio_item label="Nessuna autenticazione" name="Socks5NoAuth" tool_tip="Il proxy Socks5 non richiede autenticazione." value="Nessuna"/>
+		<radio_item label="Nome utente e password" name="Socks5UserPass" tool_tip="Il proxy Socks5 richiede autenticazione con nome utente e password." value="NomePassword"/>
+	</radio_group>
+	<text name="socks5_username_label">
+		Nome utente:
+	</text>
+	<text name="socks5_password_label">
+		Password:
+	</text>
+	<line_editor name="socks5_username" tool_tip="Il nome utente usato per l&apos;autenticazione con il server SOCKS 5"/>
+	<line_editor name="socks5_password" tool_tip="La password usata per l&apos;autenticazione con il server SOCKS 5"/>
+	<text name="other_proxy_label">
+		Altro traffico proxy HTTP:
+	</text>
+	<radio_group name="other_http_proxy_type">
+		<radio_item label="Senza proxy" name="OtherNoProxy" tool_tip="Il traffico HTTP non Web NON verrà inviato ad alcun proxy." value="Nessuna"/>
+		<radio_item label="Usa proxy HTTP" name="OtherHTTPProxy" tool_tip="Il traffico HTTP non Web verrà inviato attraverso un proxy Web configurato." value="Web"/>
+		<radio_item label="Usa proxy SOCKS 5:" name="OtherSocksProxy" tool_tip="Il traffico HTTP non Web verrà inviato attraverso il proxy Socks 5 configurato." value="Socks"/>
+	</radio_group>
+	<button label="OK" label_selected="OK" name="OK"/>
+	<button label="Annulla" label_selected="Annulla" name="Cancel"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/it/menu_inventory.xml b/indra/newview/skins/default/xui/it/menu_inventory.xml
index f18ddb595c..57aa4dc97d 100644
--- a/indra/newview/skins/default/xui/it/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/it/menu_inventory.xml
@@ -83,5 +83,7 @@
 	<menu_item_call label="Modifica" name="Wearable Edit"/>
 	<menu_item_call label="Aggiungi" name="Wearable Add"/>
 	<menu_item_call label="Togli" name="Take Off"/>
+	<menu_item_call label="Copia nella casella venditore in uscita" name="Merchant Copy"/>
+	<menu_item_call label="Passa alla casella venditore in uscita" name="Merchant Move"/>
 	<menu_item_call label="--nessuna opzione--" name="--no options--"/>
 </menu>
diff --git a/indra/newview/skins/default/xui/it/menu_media_ctrl.xml b/indra/newview/skins/default/xui/it/menu_media_ctrl.xml
index a0e7370efd..aa9e583f8e 100644
--- a/indra/newview/skins/default/xui/it/menu_media_ctrl.xml
+++ b/indra/newview/skins/default/xui/it/menu_media_ctrl.xml
@@ -3,4 +3,5 @@
 	<menu_item_call label="Taglia" name="Cut"/>
 	<menu_item_call label="Copia" name="Copy"/>
 	<menu_item_call label="Incolla" name="Paste"/>
+	<menu_item_call label="Strumento ispezione Web aperto" name="open_webinspector"/>
 </context_menu>
diff --git a/indra/newview/skins/default/xui/it/menu_mode_change.xml b/indra/newview/skins/default/xui/it/menu_mode_change.xml
new file mode 100644
index 0000000000..499dcf1873
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/menu_mode_change.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<toggleable_menu name="Mode Change">
+	<menu_item_check label="Di base" name="BasicMode"/>
+	<menu_item_check label="Avanzata" name="AdvancedMode"/>
+</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/it/menu_viewer.xml b/indra/newview/skins/default/xui/it/menu_viewer.xml
index ef40cbda7c..7e3b344117 100644
--- a/indra/newview/skins/default/xui/it/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/it/menu_viewer.xml
@@ -138,7 +138,6 @@
 			<menu_item_call label="Suono ([COST] L$)..." name="Upload Sound"/>
 			<menu_item_call label="Animazione ([COST] L$)..." name="Upload Animation"/>
 			<menu_item_call label="Modella..." name="Upload Model"/>
-			<menu_item_call label="Procedura guidata modellazione..." name="Upload Model Wizard"/>
 			<menu_item_call label="In blocco ([COST] L$ per file)..." name="Bulk Upload"/>
 		</menu>
 		<menu_item_call label="Annulla" name="Undo"/>
@@ -248,6 +247,7 @@
 			<menu_item_check label="Mostra info sulla texture" name="Show Texture Info"/>
 			<menu_item_check label="Mostra colore sotto il cursore" name="Show Color Under Cursor"/>
 			<menu_item_check label="Mostra memoria" name="Show Memory"/>
+			<menu_item_check label="Mostra info mem privata" name="Show Private Mem Info"/>
 			<menu_item_check label="Mostra aggiornamenti agli oggetti" name="Show Updates"/>
 		</menu>
 		<menu label="Forza un errore" name="Force Errors">
diff --git a/indra/newview/skins/default/xui/it/notifications.xml b/indra/newview/skins/default/xui/it/notifications.xml
index d09f207af2..ab9de43e6e 100644
--- a/indra/newview/skins/default/xui/it/notifications.xml
+++ b/indra/newview/skins/default/xui/it/notifications.xml
@@ -85,6 +85,19 @@ Accertati che la tua connessione Internet stia funzionando correttamente.
 		Salva i cambiamenti all&apos;attuale parte del corpo/abito?
 		<usetemplate canceltext="Annulla" name="yesnocancelbuttons" notext="Non salvare" yestext="Salva"/>
 	</notification>
+	<notification name="ConfirmNoCopyToOutbox">
+		Non hai l&apos;autorizzazione necessaria per copiare questo oggetto nella casella in uscita di Marketplace. Sei sicuro di volere spostare gli oggetti seguenti?
+        [ITEM_NAME]
+		<usetemplate name="okcancelbuttons" notext="No" yestext="Sì"/>
+	</notification>
+	<notification name="OutboxUploadComplete">
+		Caricamento di Marketplace completato.
+		<usetemplate name="okbutton" yestext="Ottimo!"/>
+	</notification>
+	<notification name="OutboxUploadHadErrors">
+		Caricamento di Marketplace completato senza errori.  Correggi i problemi nella casella in uscita e riprova. Grazie.
+		<usetemplate name="okbutton" yestext="Riprova"/>
+	</notification>
 	<notification name="CompileQueueSaveText">
 		C&apos;è stato un problema importando il testo di uno script per la seguente ragione: [REASON]. Riprova più tardi.
 	</notification>
@@ -2424,7 +2437,15 @@ Riprova tra qualche istante.
 		<form name="form">
 			<button name="Keep" text="Prendi"/>
 			<button name="Discard" text="Rifiuta"/>
-			<button name="Mute" text="Blocca"/>
+			<button name="Mute" text="Blocca Proprietario"/>
+		</form>
+	</notification>
+	<notification name="OwnObjectGiveItem">
+		L&apos;oggetto denominato &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; ti ha dato questo [OBJECTTYPE]:
+&lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;
+		<form name="form">
+			<button name="Keep" text="Mantieni"/>
+			<button name="Discard" text="Elimina"/>
 		</form>
 	</notification>
 	<notification name="UserGiveItem">
@@ -2568,6 +2589,7 @@ Concedi questa richiesta?
 		&apos;&lt;nolink&gt;[TITLE]&lt;/nolink&gt;&apos; di [NAME]
 [MESSAGE]
 		<form name="form">
+			<button name="Mute" text="Blocca"/>
 			<button name="Ignore" text="Ignora"/>
 		</form>
 	</notification>
@@ -2575,6 +2597,7 @@ Concedi questa richiesta?
 		&apos;&lt;nolink&gt;[TITLE]&lt;/nolink&gt;&apos; di [GROUPNAME]
 [MESSAGE]
 		<form name="form">
+			<button name="Mute" text="Blocca"/>
 			<button name="Ignore" text="Ignora"/>
 		</form>
 	</notification>
@@ -2904,6 +2927,12 @@ Clicca e trascina dovunque nel mondo per ruotare la visuale
 	<notification label="Hai dollari Linden!" name="HintLindenDollar">
 		Ecco il saldo attuale in L$. Clicca su Acquista L$ per acquistare altri dollari Linden.
 	</notification>
+	<notification name="LowMemory">
+		L&apos;allocazione di memoria è quasi esaurita. Alcune funzioni di SL sono state disattivate per evitare un crash. Chiudi le altre applicazioni. Se il problema persiste, riavvia SL.
+	</notification>
+	<notification name="ForceQuitDueToLowMemory">
+		SL verrà interrotto tra 30 secondi a causa di spazio di memoria insufficiente.
+	</notification>
 	<notification name="PopupAttempt">
 		Non è stato possibile aprire una finestra pop-up.
 		<form name="form">
@@ -2911,6 +2940,54 @@ Clicca e trascina dovunque nel mondo per ruotare la visuale
 			<button name="open" text="Apri finestra pop-up"/>
 		</form>
 	</notification>
+	<notification name="SOCKS_NOT_PERMITTED">
+		Il proxy SOCKS 5 &quot;[HOST]:[PORT]&quot; ha rifiutato il collegamento, che non è consentito dalle regole.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_CONNECT_ERROR">
+		Il proxy SOCKS 5 &quot;[HOST]:[PORT]&quot; ha rifiutato il collegamento. Non è stato possibile aprire il canale TCP.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_NOT_ACCEPTABLE">
+		Il proxy SOCKS 5 &quot;[HOST]:[PORT]&quot; ha rifiutato il sistema di autenticazione selezionato.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_AUTH_FAIL">
+		Il proxy SOCKS 5 &quot;[HOST]:[PORT]&quot; ha indicato che le credenziali non sono valide.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_UDP_FWD_NOT_GRANTED">
+		Il proxy SOCKS 5 &quot;[HOST]:[PORT]&quot; ha rifiutato la richiesta associata UDP.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_HOST_CONNECT_FAILED">
+		Collegamento non riuscito al server proxy SOCKS 5 &quot;[HOST]:[PORT]&quot;.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_UNKNOWN_STATUS">
+		Errore proxy sconosciuto per il server &quot;[HOST]:[PORT]&quot;.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_INVALID_HOST">
+		Indirizzo proxy SOCKS o porta &quot;[HOST]:[PORT]&quot; non validi.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_BAD_CREDS">
+		Nome utente o password SOCKS 5 non validi.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="PROXY_INVALID_HTTP_HOST">
+		Indirizzo proxy HTTP o porta &quot;[HOST]:[PORT]&quot; non validi.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="PROXY_INVALID_SOCKS_HOST">
+		Indirizzo proxy SOCKS o porta &quot;[HOST]:[PORT]&quot; non validi.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="ChangeProxySettings">
+		Le impostazioni proxy avranno effetto dopo il riavvio di [APP_NAME].
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
 	<notification name="AuthRequest">
 		Il sito &apos;&lt;nolink&gt;[HOST_NAME]&lt;/nolink&gt;&apos; nel reame &apos;[REALM]&apos; richiede un nome utente e una password.
 		<form name="form">
diff --git a/indra/newview/skins/default/xui/it/panel_outbox_inventory.xml b/indra/newview/skins/default/xui/it/panel_outbox_inventory.xml
new file mode 100644
index 0000000000..af5e05336e
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/panel_outbox_inventory.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<outbox_inventory_panel name="inventory_outbox" tool_tip="Trascina gli oggetti qui per prepararli per la vendita nel tuo negozio"/>
diff --git a/indra/newview/skins/default/xui/it/panel_preferences_setup.xml b/indra/newview/skins/default/xui/it/panel_preferences_setup.xml
index 67fa32a960..bf78432110 100644
--- a/indra/newview/skins/default/xui/it/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/it/panel_preferences_setup.xml
@@ -11,17 +11,6 @@
 	</text>
 	<check_box label="Porta personalizzata" name="connection_port_enabled"/>
 	<spinner label="Numero porta:" name="connection_port"/>
-	<text name="cache_size_label_l">
-		Dimensioni cache
-	</text>
-	<text name="text_box5">
-		MB
-	</text>
-	<text name="Cache location">
-		Ubicazione della cache:
-	</text>
-	<button label="Sfoglia" label_selected="Sfoglia" name="set_cache"/>
-	<button label="Reimposta" label_selected="Reimposta" name="reset_cache"/>
 	<text name="Web:">
 		Web:
 	</text>
@@ -33,12 +22,6 @@
 	<check_box initial_value="true" label="Accetta cookie" name="cookies_enabled"/>
 	<check_box initial_value="true" label="Abilita Javascript" name="browser_javascript_enabled"/>
 	<check_box initial_value="falso" label="Consenti pop-up nel browser media" name="media_popup_enabled"/>
-	<check_box initial_value="false" label="Abilita proxy Web" name="web_proxy_enabled"/>
-	<text name="Proxy location">
-		Ubicazione proxy:
-	</text>
-	<line_editor name="web_proxy_editor" tool_tip="Il nome o l&apos;indirizzo IP del proxy che preferisci usare"/>
-	<spinner label="Numero porta:" name="web_proxy_port"/>
 	<text name="Software updates:">
 		Aggiornamenti software:
 	</text>
@@ -46,4 +29,8 @@
 		<combo_box.item label="Installa automaticamente" name="Install_automatically"/>
 		<combo_box.item label="Scarica e installa manualmente gli aggiornamenti" name="Install_manual"/>
 	</combo_box>
+	<text name="Proxy Settings:">
+		Impostazioni proxy:
+	</text>
+	<button label="Regola impostazioni proxy" label_selected="Sfoglia" name="set_proxy"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/it/panel_status_bar.xml b/indra/newview/skins/default/xui/it/panel_status_bar.xml
index 4353eb9d50..0569107999 100644
--- a/indra/newview/skins/default/xui/it/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/it/panel_status_bar.xml
@@ -1,11 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="status">
-	<panel.string name="StatBarDaysOfWeek">
-		Domenica:Lunedì:Martedì:Mercoledì:Giovedì:Venerdì:Sabato
-	</panel.string>
-	<panel.string name="StatBarMonthsOfYear">
-		Gennaio:Febbraio:Marzo:Aprile:Maggio:Giugno:Luglio:Agosto:Settembre:Ottobre:Novembre:Dicembre
-	</panel.string>
 	<panel.string name="packet_loss_tooltip">
 		Perdita di pacchetti
 	</panel.string>
@@ -25,6 +19,10 @@
 		<text name="balance" tool_tip="Clicca per aggiornare il tuo saldo in L$" value="L$ 20"/>
 		<button label="ACQUISTA L$" name="buyL" tool_tip="Clicca per acquistare più L$"/>
 	</panel>
+	<combo_box name="mode_combo" tool_tip="Seleziona la modalità. Seleziona Di base per esplorare facilmente e rapidamente e per la chat. Seleziona Avanzata per accedere ad altre funzionalità.">
+		<combo_box.item label="Modalità di base" name="Basic"/>
+		<combo_box.item label="Modalità Avanzata" name="Advanced"/>
+	</combo_box>
 	<text name="TimeText" tool_tip="Orario attuale (Pacifico)">
 		24:00, ora del Pacifico
 	</text>
diff --git a/indra/newview/skins/default/xui/it/sidepanel_inventory.xml b/indra/newview/skins/default/xui/it/sidepanel_inventory.xml
index 72ca2f6d68..54fa6df407 100644
--- a/indra/newview/skins/default/xui/it/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/it/sidepanel_inventory.xml
@@ -2,35 +2,47 @@
 <panel label="Cose" name="objects panel">
 	<panel label="" name="sidepanel__inventory_panel">
 		<layout_stack name="inventory_layout_stack">
-			<layout_panel name="inbox_layout_panel">
-				<panel label="" name="marketplace_inbox">
-					<string name="InboxLabelWithArg">
-						Elementi ricevuti ([NUM])
-					</string>
-					<string name="InboxLabelNoArg">
-						Elementi ricevuti
-					</string>
-					<button label="Elementi ricevuti" name="inbox_btn"/>
-					<text name="inbox_fresh_new_count">
-						[NUM] nuovi
-					</text>
-					<panel tool_tip="Drag and drop items to your inventory to manage and use them">
-						<text name="inbox_inventory_placeholder">
-							Gli acquisti dal mercato verranno consegnati qui.
-						</text>
-					</panel>
-				</panel>
-			</layout_panel>
-			<layout_panel name="outbox_layout_panel">
-				<panel label="" name="marketplace_outbox">
-					<button label="Casella uscita commercianti" name="outbox_btn"/>
-					<button label="" name="outbox_sync_btn" tool_tip="Sposta al mercato"/>
-					<panel tool_tip="Drag and drop items here to prepare them for sale on your storefront">
-						<text name="outbox_inventory_placeholder">
-							Imposta il tuo account commercianti per usare questa funzione.
-						</text>
-					</panel>
-				</panel>
+			<layout_panel name="inbox_outbox_layout_panel">
+				<layout_stack name="inbox_outbox_layout_stack">
+					<layout_panel name="inbox_layout_panel">
+						<panel label="" name="marketplace_inbox">
+							<string name="InboxLabelWithArg">
+								Oggetti ricevuti ([NUM])
+							</string>
+							<string name="InboxLabelNoArg">
+								Oggetti ricevuti
+							</string>
+							<button label="Oggetti ricevuti" name="inbox_btn"/>
+							<text name="inbox_fresh_new_count">
+								[NUM] Nuovo
+							</text>
+							<panel tool_tip="Drag and drop items to your inventory to manage and use them">
+								<text name="inbox_inventory_placeholder">
+									Gli acquisti dal mercato verranno consegnati qui.
+								</text>
+							</panel>
+						</panel>
+					</layout_panel>
+					<layout_panel name="outbox_layout_panel">
+						<panel label="" name="marketplace_outbox">
+							<string name="OutboxLabelWithArg">
+								Casella venditore in uscita ([NUM])
+							</string>
+							<string name="OutboxLabelNoArg">
+								Casella venditore in uscita
+							</string>
+							<button label="Casella venditore in uscita" name="outbox_btn"/>
+							<button label="" name="outbox_sync_btn" tool_tip="Push su negozio Marketplace"/>
+							<panel>
+								<panel name="outbox_inventory_placeholder_panel">
+									<text name="outbox_inventory_placeholder_title">
+										Caricamento in corso...
+									</text>
+								</panel>
+							</panel>
+						</panel>
+					</layout_panel>
+				</layout_stack>
 			</layout_panel>
 		</layout_stack>
 		<panel name="button_panel">
diff --git a/indra/newview/skins/default/xui/it/strings.xml b/indra/newview/skins/default/xui/it/strings.xml
index 1d335e55a6..9918934e12 100644
--- a/indra/newview/skins/default/xui/it/strings.xml
+++ b/indra/newview/skins/default/xui/it/strings.xml
@@ -333,6 +333,18 @@ Prova ad accedere nuovamente tra un minuto.
 		Solo un singolo oggetto può essere creato qui
 	</string>
 	<string name="TooltipPrice" value="L$ [AMOUNT]:"/>
+	<string name="TooltipOutboxNoTransfer">
+		Almeno un oggetto non può essere venduto o trasferito a un altro utente.
+	</string>
+	<string name="TooltipOutboxWorn">
+		Stai indossando almeno uno degli oggetti. Rimuovili dall&apos;avatar e prova nuovamente a spostarli.
+	</string>
+	<string name="TooltipOutboxFolderLevels">
+		Questa cartella contiene troppi livelli di cartelle nidificate. Riordina le cartelle interne in modo che non ci siano più di 4 livelli (cartella principale che contiene la cartella A, che contiene la cartella B, che contiene la cartella C).
+	</string>
+	<string name="TooltipOutboxTooManyObjects">
+		Questa cartella contiene più di 200 oggetti. Inserisci alcuni oggetti in scatole per ridurne il numero.
+	</string>
 	<string name="TooltipHttpUrl">
 		Clicca per visitare questa pagina web
 	</string>
@@ -1189,8 +1201,65 @@ Prova ad accedere nuovamente tra un minuto.
 	<string name="InventoryInboxNoItems">
 		Gli elementi acquistati attraverso il mercato verranno consegnati qui
 	</string>
+	<string name="MarketplaceURL">
+		http://marketplace.[DOMAIN_NAME]/learn_more
+	</string>
+	<string name="MarketplaceURL_CreateStore">
+		http://marketplace.[DOMAIN_NAME]/create_store
+	</string>
+	<string name="MarketplaceURL_LearnMore">
+		http://marketplace.[DOMAIN_NAME]/learn_more
+	</string>
+	<string name="InventoryOutboxCreationErrorTitle">
+		La casella in uscita del rivenditore non è configurata correttamente
+	</string>
+	<string name="InventoryOutboxCreationErrorTooltip">
+		Errore di configurazione della casella in uscita del rivenditore
+	</string>
+	<string name="InventoryOutboxCreationError">
+		Contatta l&apos;Assistenza clienti per correggere il problema.
+	</string>
+	<string name="InventoryOutboxNotMerchantTitle">
+		Chiunque può vendere oggetti nel Marketplace
+	</string>
+	<string name="InventoryOutboxNotMerchantTooltip">
+		Diventa un rivenditore!
+	</string>
+	<string name="InventoryOutboxNotMerchant">
+		[[MARKETPLACE_URL] Second Life Marketplace] offre in vendita più di un milione di prodotti virtuali, tutti creati da Residenti. Anche tu puoi vendere gli oggetti che crei, oltre ad alcuni degli oggetti che hai acquistato. È facile da usare e l&apos;impostazione è gratuita. [[LEARN_MORE_URL] Leggi ulteriori informazioni] oppure [[CREATE_STORE_URL] crea un negozio] sul Marketplace per cominciare.
+	</string>
+	<string name="InventoryOutboxNoItemsTitle">
+		Un nuovo modo di inviare oggetti al Marketplace
+	</string>
+	<string name="InventoryOutboxNoItemsTooltip">
+		Trascina gli oggetti qui per prepararli per la vendita nel Marketplace
+	</string>
 	<string name="InventoryOutboxNoItems">
-		Trascina gli elementi qui per poi elencarli nel tuo mercato.
+		Trascina elementi o cartelle che desideri vendere in quest&apos;area. Verrà visualizzata una copia dell&apos;elemento, senza che venga modificato l&apos;inventario, tranne nel caso in cui venga trascinato un oggetto per cui non è permessa la copia. Clicca sul pulsante Carica per caricare gli elementi su Marketplace. Dopo aver spostato gli elementi nell&apos;inventario di Marketplace, non saranno più visibili in questa cartella.
+	</string>
+	<string name="Marketplace Error None">
+		Nessun errore
+	</string>
+	<string name="Marketplace Error Not Merchant">
+		Errore: Prima di inviare elementi al Marketplace devi essere impostato come rivenditore (gratis).
+	</string>
+	<string name="Marketplace Error Empty Folder">
+		Errore: questa cartella non include alcun contenuto.
+	</string>
+	<string name="Marketplace Error Unassociated Products">
+		Errore: Oggetto non caricato perché il tuo account venditore ha troppi oggetti che non sono associati con dei prodotti. Per risolvere questo errore, esegui l&apos;accesso al sito di Marketplace e riduci il numero di oggetti non associati.
+	</string>
+	<string name="Marketplace Error Object Limit">
+		Errore: questo elemento contiene troppi oggetti. Per risolvere questo problema, inserisci più oggetti insieme in una scatola per ridurre a meno di 200 il numero totale di oggetti.
+	</string>
+	<string name="Marketplace Error Folder Depth">
+		Errore: questo elemento contiene troppi livelli di cartelle nidificate. Riorganizzalo per ottenere un massimo di 3 livelli di cartelle nidificate.
+	</string>
+	<string name="Marketplace Error Unsellable Item">
+		Errore: Questo elemento non può essere venduto nel Marketplace.
+	</string>
+	<string name="Marketplace Error Internal Import">
+		Errore: problema con questo elemento. Riprova più tardi.
 	</string>
 	<string name="no_transfer" value="(nessun trasferimento)"/>
 	<string name="no_modify" value="(nessuna modifica)"/>
@@ -4089,7 +4158,7 @@ Segnala abuso
 	<string name="Female - Wow">
 		Femmina - Accipicchia
 	</string>
-	<string name="/bow">
+	<string name="/bow1">
 		/inchino
 	</string>
 	<string name="/clap">
diff --git a/indra/newview/skins/default/xui/ja/floater_about.xml b/indra/newview/skins/default/xui/ja/floater_about.xml
index 56708001c2..47bb2455cf 100644
--- a/indra/newview/skins/default/xui/ja/floater_about.xml
+++ b/indra/newview/skins/default/xui/ja/floater_about.xml
@@ -42,15 +42,23 @@ Qt Webkit バージョン: [QT_WEBKIT_VERSION]
 			<button label="クリップボードにコピー" name="copy_btn"/>
 		</panel>
 		<panel label="クレジット" name="credits_panel">
-			<text_editor name="credits_editor">
-				Second Life は、Philip, Tessa, Andrew, Cory, Ian, James, Phoenix, Ryan, Haney, Dan, Char, Ben, John, Tanya, Eddie, Richard, Mitch, Doug, Eric, Frank, Bruce, Aaron, Peter, Alice, Charlie, Debra, Eileen, Helen, Janet, Steffan, Steve, Tom, Mark, Hunter, Xenon, Burgess, Bill, Jim, Lee, Hamlet, Daniel, Jeff, Todd, Sarah, Tim, Stephanie, Colin, Michael, Evan, Nicolas, Catherine, Rachelle, Dave, Holly, Bub, Kelly, Ramzi, Don, Sabin, Jill, Rheya, Jeska, Torley, Kona, Callum, Charity, Jack, Vektor, Chris, Nicole, Mick, Reuben, Blue, Babbage, Yedwab, Deana, Lauren, Brent, Pathfinder, Chadrick, Jesse, David, Tess, Lizzie, Patsy, Isaac, Lawrence, Cyn, Bo, Gia, Annette, Marius, Tbone, Jonathan, Karen, Ginsu, Yuko, Makiko, Thomas, Harry, Seth, Brian, Guy, Runitai, Ethan, Data, Cornelius, Kenny, Swiss, Zero, Brad, Natria, Wendy, Stephen, Teeple, Thumper, Lucy, Dee, Mia, Liana, Warren, Branka, Aura, Beez, Milo, Hermia, Red, Thrax, Gulliver, Joe, Sally, Paul, Jose, Rejean, Dore, Henrik, Lexie, Amber, Logan, Xan, Nora, Morpheus, Donovan, Leyla, MichaelFrancis, Beast, Cube, Bucky, Joshua, Stryfe, Harmony, Teresa, Claudia, Walker, Glenn, Fritz, Fordak, June, Cleopetra, Ivy, Betsy, Roosevelt, Spike, Ken, Which, Tofu, Chiyo, Rob, Zee, Dustin, George, Del, Matthew, Cat, Jacqui, Adrian, Viola, Alfred, Noel, Irfan, Yool, Rika, Jane, Frontier, Neo, Siobhan, Yoz, Justin, Elle, Qarl, Benjamin, Isabel, Everett, Christopher, Izzy, Stephany, Garry, Sejong, Sean, Tobin, Iridium, Meta, Jeremy, JP, Jake, Anthony, Maurice, Madhavi, Leopard, Kyle, Joon, Bert, Belinda, Jon, Kristi, Bridie, Pramod, Socrates, Maria, Aric, Adreanne, Jay, Kari, Ceren, Coco, Durl, Jenny, Periapse, Kartic, Storrs, Lotte, Sandy, Colossus, Zen, BigPapi, Pastrami, Kurz, Mani, Neuro, Mel, Sardonyx, MJ, Rowan, Sgt, Elvis, Samuel, Leo, Bryan, Niko, Austin, Soft, Poppy, Rachel, Aki, Banzai, Alexa, Sue, Bender, CG, Angelo, Gillian, Pelle, Nick, Echo, Zara, Christine, Shamiran, Emma, Blake, Keiko, Plexus, Joppa, Sidewinder, Erica, Ashlei, Twilight, Kristen, Brett, Q, Enus, Simon, Bevis, Kraft, Kip, Chandler, Ron, LauraP, Ram, KyleJM, Scouse, Prospero, Melissa, Marty, Nat, Hamilton, Kend, Lordan, Jimmy, Kosmo, Seraph, Green, Ekim, Wiggo, JT, Rome, Doris, Miz, Benoc, Whump, Trinity, Patch, Kate, TJ, Bao, Joohwan, Christy, Sofia, Matias, Cogsworth, Johan, Oreh, Cheah, Angela, Brandy, Mango, Lan, Aleks, Gloria, Mitchell, Space, Colton, Bambers, Einstein, Maggie, Malbers, Rose, Rothman, Niall, Marin, Allison, Katie, Dawn, Dusty, Katt, Judy, Andrea, Ambroff, Infinity, Rico, Gail, Kalpana, Raymond, Yi, William, Christa, M, Teagan, Scout, Molly, Dante, Corr, Dynamike, Usi, Kaylee, Lil, Danica, Sascha, Kelv, Jacob, Nya, Rodney, Brandon, Elsie, Blondin, Grant, Katrin, Nyx, Gabriel, Locklainn, Claire, Devin, Minerva, Monty, Bradford, Si, Keira, H, Caitlin, Dita, Makai, Jenn, Ann, Meredith, Clare, Joy, Praveen, Cody, Edmund, Ruthe, Sirena, Gayathri, Spider, FJ, Davidoff, Tian, Jennie, Louise, Oskar, Landon, Noelle, Jarv, Ingrid, Al, Sommer, Doc, Aria, Huin, Gray, Lili, Vir, DJ, Maestro, Simone, Yang, T, Shannon, Nelson, Khanh, Scott, Courtney, Charlene, Quixote, Susan, Zed, Amanda, Katelin, Enkidu, Roxie, Esbee, JoRoan, Scarlet, Tay, Kevin, Wolfgang, Johnny, Ray, Andren, Merov, Bob, Rand, Howard, Callen, Heff, Galen, Newell, Dessie, Les, Michon, Jenelle, Geo, Siz, Shapiro, Pete, Calyle, Selene, Allen, Phoebe, Goldin, Kimmora, Dakota, Slaton, Lindquist, Zoey, Hari, Othello, Rohit, Sheldon, Petra, Viale, Gordon, Kaye, Pink, Ferny, Emerson, Davy, Bri, Chan, Juan, Robert, Terrence, Nathan, Carl, Ashley, JessieAnn, Huseby, Karina, Paris, Kurt, Rick, Lis, Kotler, Theeba, Lynx, Murphy, Doten, Taka, Norm, Jillian, Marcus, Mae, Novack, Esther, Perry, Dana, Ducot, Javier, Porter, Madison, Gecko, Dough, JR, Gisele, Crimp, Norie, Arch, Kimi, Fisher, Barbara, Jason, Peggy, Bernard, Jules, Leroy, Eva, Khederian, Campbell, Vogt, Masido, Karel, Torres, Lo, Breezer, Delby, Rountree, Anna, Servus, Rue, Itiaes, Chuck, Luna, Novella, Zaza, Wen, Gino, Lex, Cassandra, Limey, Nancy, Anukul, Silver, Brodesky, Jinsai, Squid, Gez, Rakesh, Ladan, Edelman, Marcet, Squire, Tatem, Tony, Jerm, Tia, Falcon, BK, Tiggs, Driscoll, Bacon, Timothee, Cru, Carmilla, Coyot, Webb, Kazu, Rudas, LJ, Sea, Ali Wallace, Bewest, Pup, Drub, Dragon, Inoshiro, Byron, Rhett, Xandix, Aimee, Fredrik, Thor, Teddy, Baron, Nelly, Ghengis, Epic, Eli, Stone, Grapes, Irie, Prep, Scobu, Valerie, Alain その他大勢の方々によって提供されています。
-
-現在最も優れたバージョンとなるようご協力いただいた次の住人の皆様に深く感謝いたします。 Drew Dwi, Zai Lynch, Latif Khalifa, Ellla McMahon, Harleen Gretzky, Squirrel Wood, Malarthi Behemoth, Dante Tucker, Buckaroo Mu, Eddi Decosta, Dirk, Talamasca, Torben Trautman, Irene Muni, Aralara Rajal, Aura Dirval, Cayu Cluny, Eva Rau, FreeSL Aeon, Frontera Thor, Inma Rau, Lunita Savira, Minerva Memel, Polo Gufler, Xiki Luik, Lilly Zenovka, Vick Forcella, Sasy Scarborough, Gentle Welinder, Elric Anatine, Techwolf Lupindo, Dusan Writer, WolfPup Lowenhar, Marianne McCann, Fiachra Lach, Sitearm Madonna, Sudane Erato, Sahkolihaa Contepomi, Sachi Vixen, Questar Utu, Dimitrio Lewis, Matto Destiny, Scrim Pinion, Radio Signals, Psi Merlin, Pixel Gausman, Mel Vanbeeck, Laurent Bechir, Lamorna Proctor, Lares Carter, Gwyneth Llewelyn, Hydra Shaftoe, Holger Gilruth, Gentle Heron, Carla Broek, Boroondas Gupte, Fury Rosewood, Flower Ducatillon, Colpo Wexler, gwampa Lomu, Borg Capalini, Beansy Twine, Ardy Lay, , 45ms Zhong, Adeon Writer, Aeonix Aeon, Ai Austin, Aiko Ying, Alexandrea Fride, Alliez Mysterio, Annie Milestone, Annika Genezzia, Ansariel Hiller, ArminasX Saiman, Arya Braveheart, Asaeda Meltingdots, Asturkon Jua, Avallyn Oakleaf, Avatar Quinzet, BabyA Littlething, Bacchus Ireto, Bazaar, Riva, Benjamin Bigdipper, Beth Walcher, Bezilon Kasei, Biancaluce Robbiani, Bill Walach, blakopal Galicia, Blitzckreed Levenque, Bryn Oh, Callipygian Christensen, Cap Carver, Carr Arbenlow, Chantal Harvey, Charles Courtois, Charlie Sazaland, Cherry Cheevers, ChickyBabes Zuzu, Christopher  Organiser, Ciaran Laval, Clara Young, Celierra Darling, Corinne Helendale, Corro Moseley, Coughdrop Littlething, Darien Caldwell, Dartagan Shepherd, Debs Regent, Decro Schmooz, Denim Kamachi, DiJodi Dubratt, Dil Spitz, Edgware Marker, Egehan Dryke, Emma Portilo, Emmie Fairymeadow, Evangelista Emerald, Faelon Swordthain, Frenchimmo Sabra, Gaberoonie Zanzibar, Ganymedes Costagravas, Gene Frostbite, GeneJ Composer, Giggles Littlebird, Grady Echegaray, Guni Greenstein, Gypsy Tripsa, Hackshaven Harford, Ham Rambler, Han Shuffle, Hanglow Short, Hatzfeld Runo, herina Bode, Horatio Freund, Hypatia Callisto, Hypatia Pickens, Identity Euler, Imnotgoing Sideways, Innula Zenovka, Iyoba Tarantal, Jack Abraham, Jagga Meredith, Jennifer Boyle, Jeremy Marquez, Jessica Qin, Jinx Nordberg, Jo Bernandes, Jocial Sonnenkern, Joel Savard, Jondan Lundquist, Josef Munster, Josette Windlow, Juilan Tripsa, Juro Kothari, Justin RiversRunRed, Kagehi Kohn, Kaimen Takahe, Keklily Longfall, Ken Lavender, Kestral Karas, Khisme Nitely, Kimar Coba, Kithrak Kirkorian, Kitty Barnett, Kolor Fall, Komiko Okamoto, Korvel Noh, Larry Pixel, Leal Choche, len Starship, Lenae Munz, Lexi Frua, Lillie Cordeaux, Lizzy Macarthur, LSL Scientist, Luban Yiyuan, Luc Starsider, Maccus McCullough, Madison Blanc, Maggie Darwin, Mallory Destiny, Manx Wharton, Marc Claridge, Marc2 Sands, Matthew Anthony, Maxim RiversRunRed, Medhue Simoni, Melinda Latynina, Mencius Watts, Michi Lumin, Midian Farspire, Miles Glaz, Mindy Mathy, Mitch Wagner, Mo Hax, Mourna Biziou, Nao Noe, naofan Teardrop, Naomah Beaumont, Nathiel Siamendes, Nber Medici, Neko Link, Netpat Igaly, Neutron Chesnokov, Newfie Pendragon, Nicholai Laviscu, Nick Rhodes, Nicoladie Gymnast, Ollie Kubrick, Orenj Marat, Orion Delphis, Oryx Tempel, Parvati Silverweb, PeterPunk Mooney, Pixel Scientist, Pounce Teazle, Professor Noarlunga, Quantum Destiny, Quicksilver Hermes, Ralf Setsuko, RAT Quan, RedMokum Bravin, Revolution Perenti, Rezit Sideways, Rich Grainger, Rosco Teardrop, Rose Evans, Rudee Voom, RufusTT Horsefly, Saii Hallard, SaintLEOlions Zimer, Samm Larkham, Satanello Miami, SexySteven Morrisey, Sheet Spotter, Shnurui Troughton, sicarius Thorne, Sicarius Toxx, Sini Nubalo, SLB Wirefly, snowy Sidran, Soupa Segura, ST Mensing, Starshine Halasy, Stickman Ingmann, Synystyr Texan, Takeda Terrawyng, Tali Rosca, Templar Merlin, Tezcatlipoca Bisiani, Tiel Stonecutter, Tony Kembia, TouchaHoney Perhaps, Trey Reanimator, TriloByte Zanzibar, Trinity Dechou, Trinity Dejavu, Unlikely Quintessa, UsikuFarasi Kanarik, Veritas Raymaker, Vex Streeter, Viaticus Speculaas, Villain Baroque, Vixie Durant, Void Singer, Watty Berkson, Westley Schridde, Westley Streeter, Whimsy Winx, Winter Ventura, Wundur Primbee, xstorm Radek, YongYong Francois, Zak Westminster, Zana Kohime, Zaren Alexander, Zeja Pyle, ZenMondo Wormser, Zoex Flanagan その他大勢の方々。
-
-
-
-
-「努力は続く。目標は持続する。希望は残されている。夢は決して消えない。」 - エドワード・ケネディ
+			<text name="linden_intro">
+				Second Life の提供元: Lindens の:
+			</text>
+			<text_editor name="linden_names">
+				Philip, Andrew, Doug, Richard, Phoenix, Ian, Mark, Robin, Dan, Char, Ryan, Eric, Jim, Lee, Jeff, Michael, Kelly, Steve, Catherine, Bub, Ramzi, Jill, Jeska, Don, Kona, Callum, Charity, Jack, Shawn, babbage, James, Lauren, Blue, Brent, Reuben, Pathfinder, Jesse, Patsy, Torley, Bo, Cyn, Jonathan, Gia, Annette, Ginsu, Harry, Lex, Runitai, Guy, Cornelius, Beth, Swiss, Thumper, Wendy, Teeple, Seth, Dee, Mia, Sally, Liana, Aura, Beez, Milo, Red, Gulliver, Marius, Joe, Jose, Dore, Justin, Nora, Morpheus, Lexie, Amber, Chris, Xan, Leyla, Walker, Sabin, Joshua, Hiromi, Tofu, Fritz, June, Jean, Ivy, Dez, Ken, Betsy, Which, Spike, Rob, Zee, Dustin, George, Claudia, del, Matthew, jane, jay, Adrian, Yool, Rika, Yoz, siobhan, Qarl, Benjamin, Beast, Everett, madhavi, Christopher, Izzy, stephany, Jeremy, sean, adreanne, Pramod, Tobin, sejong, Iridium, maurice, kj, Meta, kari, JP, bert, kyle, Jon, Socrates, Bridie, Ivan, maria, Aric, Coco, Periapse, sandy, Storrs, Lotte, Colossus, Brad, Pastrami, Zen, BigPapi, Banzai, Sardonyx, Mani, Garry, Jaime, Neuro, Samuel, Niko, CeeLo, Austin, Soft, Poppy, emma, tessa, angelo, kurz, alexa, Sue, CG, Blake, Erica, Brett, Bevis, kristen, Q, simon, Enus, MJ, laurap, Kip, Scouse, Ron, Ram, kend, Marty, Prospero, melissa, kraft, Nat, Seraph, Hamilton, Lordan, Green, miz, Ashlei, Trinity, Ekim, Echo, Charlie, Rowan, Rome, Jt, Doris, benoc, Christy, Bao, Kate, Tj, Patch, Cheah, Johan, Brandy, Angela, Oreh, Cogsworth, Lan, Mitchell, Space, Bambers, Einstein, Bender, Malbers, Matias, Maggie, Rothman, Milton, Niall, Marin, Allison, Mango, Andrea, Katt, Yi, Ambroff, Rico, Raymond, Gail, Christa, William, Dawn, Usi, Dynamike, M, Corr, Dante, Molly, kaylee, Danica, Kelv, Lil, jacob, Nya, Rodney, elsie, Blondin, Grant, Nyx, Devin, Monty, Minerva, Keira, Katie, Jenn, Makai, Clare, Joy, Cody, Gayathri, FJ, spider, Oskar, Landon, Jarv, Noelle, Al, Doc, Gray, Vir, t, Maestro, Simone, Shannon, yang, Courtney, Scott, charlene, Quixote, Susan, Zed, Amanda, Katelin, Esbee, JoRoan, Enkidu, roxie, Scarlet, Merov, Kevin, Judy, Rand, Newell, Les, Dessie, Galen, Michon, Geo, Siz, Calyle, Pete, Praveen, Callen, Sheldon, Pink, Nelson, jenelle, Terrence, Nathan, Juan, Sascha, Huseby, Karina, Kaye, Kotler, Lis, Darv, Charrell, Dakota, Kimmora, Theeba, Taka, Mae, Perry, Ducot, dana, Esther, Dough, gisele, Doten, Viale, Fisher, jessieann, ashley, Torres, delby, rountree, kurt, Slaton, Madison, Rue, Gino, Wen, Casssandra, Brodesky, Squid, Gez, Rakesh, Gecko, Ladan, Tony, Tatem, Squire, Falcon, BK, Crimp, Tiggs, Bacon, Coyot, Carmilla, Webb, Sea, Arch, Jillian, Jason, Bernard, Vogt, Peggy, dragon, Pup, xandix, Wallace, Bewest, Inoshiro, Rhett, AG, Aimee, Ghengis, Itiaes, Eli, Steffan, Epic, Grapes, Stone, Prep, Scobu, Robert, Alain, Carla, Vicky, Tia, Alec, Taras, Lisa, Oz, Ariane, Log, House, Kazu, Kim, Drofnas, Tyler, Campbell, Michele, Madeline, Nelly, Baron, Thor, Lori, Hele, Fredrik, Teddy, Pixie, Berry, Gabrielle, Alfonso, Brooke, Wolf, Ringo, Cru, Charlar, Rodvik, Gibson, Elise, Bagman, Greger, Leonidas, Jerm, Leslie, CB, Brenda, Durian, Carlo, mm, Zeeshan, Caleb, Max, Elikak, Mercille, Steph, Chase
+			</text_editor>
+			<text name="contrib_intro">
+				オープンソースの提供:
+			</text>
+			<text_editor name="contrib_names">
+				Dummy Name は実行時間に置き換え
+			</text_editor>
+			<text name="trans_intro">
+				翻訳会社:
+			</text>
+			<text_editor name="trans_names">
+				Dummy Name は実行時間に置き換え
 			</text_editor>
 		</panel>
 		<panel label="ライセンス" name="licenses_panel">
diff --git a/indra/newview/skins/default/xui/ja/floater_preferences_proxy.xml b/indra/newview/skins/default/xui/ja/floater_preferences_proxy.xml
new file mode 100644
index 0000000000..4638fd002e
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/floater_preferences_proxy.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Proxy Settings Floater" title="プロキシ設定">
+	<check_box initial_value="false" label="ウェブページに HTTP プロキシを使う" name="web_proxy_enabled"/>
+	<text name="http_proxy_label">
+		HTTP プロキシ:
+	</text>
+	<line_editor name="web_proxy_editor" tool_tip="使用する HTTP プロキシの DNS 名または IP アドレス。"/>
+	<spinner label="ポート番号:" name="web_proxy_port" tool_tip="使用する HTTP プロキシポート。"/>
+	<check_box label="UDP トラフィックに SOCKS 5 プロキシを使う" name="socks_proxy_enabled"/>
+	<text name="socks5_proxy_label">
+		SOCKS 5 プロキシ:
+	</text>
+	<line_editor name="socks_proxy_editor" tool_tip="使用する SOCKS 5 プロキシの DNS 名または IP アドレス。"/>
+	<spinner label="ポート番号:" name="socks_proxy_port" tool_tip="使用する SOCKS 5 プロキシポート。"/>
+	<text name="socks_auth_label">
+		SOCKS 認証:
+	</text>
+	<radio_group name="socks5_auth_type">
+		<radio_item label="認証なし" name="Socks5NoAuth" tool_tip="Socks 5 プロキシは認証の必要がありません。" value="なし"/>
+		<radio_item label="ユーザー名/パスワード" name="Socks5UserPass" tool_tip="Socks5 プロキシはユーザー名/パスワードの認証が必要です。" value="UserPass"/>
+	</radio_group>
+	<text name="socks5_username_label">
+		ユーザー名:
+	</text>
+	<text name="socks5_password_label">
+		パスワード:
+	</text>
+	<line_editor name="socks5_username" tool_tip="SOCKS 5 サーバーの認証に使用されたユーザー名"/>
+	<line_editor name="socks5_password" tool_tip="SOCKS 5 サーバーの認証に使用されたパスワード"/>
+	<text name="other_proxy_label">
+		他の HTTP トラフィックプロキシ:
+	</text>
+	<radio_group name="other_http_proxy_type">
+		<radio_item label="プロキシしない" name="OtherNoProxy" tool_tip="ウェブ以外の HTTP トラフィックはいずれのプロキシにもルーティングされません。" value="なし"/>
+		<radio_item label="HTTP プロキシを使う" name="OtherHTTPProxy" tool_tip="ウェブ以外の HTTP は設定済みウェブプロキシを通してルーティングされます。" value="Web"/>
+		<radio_item label="SOCKS 5 プロキシを使う" name="OtherSocksProxy" tool_tip="ウェブ以外の HTTP トラフィックは設定済みの Socks 5 プロキシを通してルーティングされます。" value="Socks"/>
+	</radio_group>
+	<button label="OK" label_selected="OK" name="OK"/>
+	<button label="取り消し" label_selected="取り消し" name="Cancel"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/ja/menu_inventory.xml b/indra/newview/skins/default/xui/ja/menu_inventory.xml
index f78ec09e5e..9449e61274 100644
--- a/indra/newview/skins/default/xui/ja/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/ja/menu_inventory.xml
@@ -83,5 +83,7 @@
 	<menu_item_call label="編集" name="Wearable Edit"/>
 	<menu_item_call label="追加" name="Wearable Add"/>
 	<menu_item_call label="取り外す" name="Take Off"/>
+	<menu_item_call label="マーチャントのアウトボックスにコピー" name="Merchant Copy"/>
+	<menu_item_call label="マーチャントのアウトボックスに移動" name="Merchant Move"/>
 	<menu_item_call label="--オプションなし--" name="--no options--"/>
 </menu>
diff --git a/indra/newview/skins/default/xui/ja/menu_media_ctrl.xml b/indra/newview/skins/default/xui/ja/menu_media_ctrl.xml
index d155dc17e0..faae4ef717 100644
--- a/indra/newview/skins/default/xui/ja/menu_media_ctrl.xml
+++ b/indra/newview/skins/default/xui/ja/menu_media_ctrl.xml
@@ -3,4 +3,5 @@
 	<menu_item_call label="カット" name="Cut"/>
 	<menu_item_call label="コピー" name="Copy"/>
 	<menu_item_call label="貼り付け" name="Paste"/>
+	<menu_item_call label="ウェブインスペクターを開く" name="open_webinspector"/>
 </context_menu>
diff --git a/indra/newview/skins/default/xui/ja/menu_mode_change.xml b/indra/newview/skins/default/xui/ja/menu_mode_change.xml
new file mode 100644
index 0000000000..dff3392bd5
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/menu_mode_change.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<toggleable_menu name="Mode Change">
+	<menu_item_check label="ベーシック" name="BasicMode"/>
+	<menu_item_check label="アドバンス" name="AdvancedMode"/>
+</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/ja/menu_viewer.xml b/indra/newview/skins/default/xui/ja/menu_viewer.xml
index 223c1e1f11..edce5c50fc 100644
--- a/indra/newview/skins/default/xui/ja/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/ja/menu_viewer.xml
@@ -138,7 +138,6 @@
 			<menu_item_call label="サウンド(L$[COST])..." name="Upload Sound"/>
 			<menu_item_call label="アニメーション(L$[COST])..." name="Upload Animation"/>
 			<menu_item_call label="モデル" name="Upload Model"/>
-			<menu_item_call label="モデルウィザード" name="Upload Model Wizard"/>
 			<menu_item_call label="一括 (ファイルにつきL$[COST])..." name="Bulk Upload"/>
 		</menu>
 		<menu_item_call label="元に戻す" name="Undo"/>
@@ -253,6 +252,7 @@
 			<menu_item_check label="マトリックスを表示する" name="Show Matrices"/>
 			<menu_item_check label="カーソルを乗せた場所の色を表示する" name="Show Color Under Cursor"/>
 			<menu_item_check label="メモリを表示:" name="Show Memory"/>
+			<menu_item_check label="プライベートメモリ情報を表示" name="Show Private Mem Info"/>
 			<menu_item_check label="オブジェクトのアップデートを表示する" name="Show Updates"/>
 		</menu>
 		<menu label="エラー実行" name="Force Errors">
diff --git a/indra/newview/skins/default/xui/ja/notifications.xml b/indra/newview/skins/default/xui/ja/notifications.xml
index 6bff82bec4..c138aeb383 100644
--- a/indra/newview/skins/default/xui/ja/notifications.xml
+++ b/indra/newview/skins/default/xui/ja/notifications.xml
@@ -84,6 +84,19 @@
 		現在の衣類、身体部位の変更を保存しますか?
 		<usetemplate canceltext="キャンセル" name="yesnocancelbuttons" notext="保存しない" yestext="保存"/>
 	</notification>
+	<notification name="ConfirmNoCopyToOutbox">
+		マーチャントのアウトボックスにこれをコピーする権限があります。次のアイテムを移動しますか?
+[ITEM_NAME]
+		<usetemplate name="okcancelbuttons" notext="いいえ" yestext="はい"/>
+	</notification>
+	<notification name="OutboxUploadComplete">
+		マーケットプレイスへのアップロードが完了しました。
+		<usetemplate name="okbutton" yestext="やったあ!"/>
+	</notification>
+	<notification name="OutboxUploadHadErrors">
+		マーケットプレイスへのアップロードの完了時にエラーが発生しました。アウトボックスの問題を解決して、もう一度お試しください。ありがとうございます。
+		<usetemplate name="okbutton" yestext="再トライ!"/>
+	</notification>
 	<notification name="CompileQueueSaveText">
 		次の理由で、スクリプト用テキストのアップロード時に問題が起こりました。
 [REASON]
@@ -2471,7 +2484,15 @@ Web ページにリンクすると、他人がこの場所に簡単にアクセ
 		<form name="form">
 			<button name="Keep" text="受け取る"/>
 			<button name="Discard" text="破棄"/>
-			<button name="Mute" text="ブロック"/>
+			<button name="Mute" text="所有者をブロック"/>
+		</form>
+	</notification>
+	<notification name="OwnObjectGiveItem">
+		&lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; という名前のオブジェクトが、あなたに [OBJECTTYPE] を渡しました:
+&lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;
+		<form name="form">
+			<button name="Keep" text="キープ"/>
+			<button name="Discard" text="処分する"/>
 		</form>
 	</notification>
 	<notification name="UserGiveItem">
@@ -2615,6 +2636,7 @@ Web ページにリンクすると、他人がこの場所に簡単にアクセ
 		[NAME] の「&lt;nolink&gt;[TITLE]&lt;/nolink&gt;」
 [MESSAGE]
 		<form name="form">
+			<button name="Mute" text="ブロック"/>
 			<button name="Ignore" text="無視する"/>
 		</form>
 	</notification>
@@ -2622,6 +2644,7 @@ Web ページにリンクすると、他人がこの場所に簡単にアクセ
 		[GROUPNAME] の「&lt;nolink&gt;[TITLE]&lt;/nolink&gt;」
 [MESSAGE]
 		<form name="form">
+			<button name="Mute" text="ブロック"/>
 			<button name="Ignore" text="無視する"/>
 		</form>
 	</notification>
@@ -2948,6 +2971,12 @@ M キーを押して変更します。
 	<notification label="あなたのリンデンドル" name="HintLindenDollar">
 		これがあなたの L$ 残高です。リンデンドルを購入するには「L$ の購入」をクリックします。
 	</notification>
+	<notification name="LowMemory">
+		メモリプール残量が少なくなっています。クラッシュを避けるため SL の機能の一部は無効になりました。他のアプリケーションを終了し、状況が継続または再発する場合には SL を再起動してください。
+	</notification>
+	<notification name="ForceQuitDueToLowMemory">
+		メモリ不足のため 30 秒以内に SL は終了します。
+	</notification>
 	<notification name="PopupAttempt">
 		ポップアップがブロックされました。
 		<form name="form">
@@ -2955,6 +2984,54 @@ M キーを押して変更します。
 			<button name="open" text="ポップアップウィンドウを開く"/>
 		</form>
 	</notification>
+	<notification name="SOCKS_NOT_PERMITTED">
+		ルールセットによって許可されていないため、SOCKS 5 プロキシ &quot;[HOST]:[PORT]&quot; が接続を拒絶しました。
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_CONNECT_ERROR">
+		SOCKS 5 プロキシ &quot;[HOST]:[PORT]&quot; が接続を拒絶したため、TCP チャンネルを開くことができませんでした。
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_NOT_ACCEPTABLE">
+		SOCKS 5 プロキシ &quot;[HOST]:[PORT]&quot; は選択された認証システムを拒絶しました。
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_AUTH_FAIL">
+		SOCKS 5 プロキシ &quot;[HOST]:[PORT]&quot; はあなたの資格が無効だと報告しました。
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_UDP_FWD_NOT_GRANTED">
+		SOCKS 5 プロキシ &quot;[HOST]:[PORT]&quot; は UDP アソシエートのリクエストを拒絶しました。
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_HOST_CONNECT_FAILED">
+		SOCKS 5 プロキシサーバー &quot;[HOST]:[PORT]&quot; に接続できませんでした。
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_UNKNOWN_STATUS">
+		不明のプロキシエラーがサーバー &quot;[HOST]:[PORT]&quot; で発生しました。
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_INVALID_HOST">
+		SOCKS プロキシのアドレスまたはポート &quot;[HOST]:[PORT]&quot;が無効です。
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_BAD_CREDS">
+		SOCKS 5 のユーザー名またはパスワードが正しくありません。
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="PROXY_INVALID_HTTP_HOST">
+		HTTP プロキシのアドレスまたはポート &quot;[HOST]:[PORT]&quot;が無効です。
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="PROXY_INVALID_SOCKS_HOST">
+		SOCKS プロキシのアドレスまたはポート &quot;[HOST]:[PORT]&quot;が無効です。
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="ChangeProxySettings">
+		プロキシの設定は [APP_NAME] を再起動後に反映されます。
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
 	<notification name="AuthRequest">
 		「[REALM]」にある「&lt;nolink&gt;[HOST_NAME]&lt;/nolink&gt;」のサイトにはユーザー名とパスワードが必要です。
 		<form name="form">
diff --git a/indra/newview/skins/default/xui/ja/panel_outbox_inventory.xml b/indra/newview/skins/default/xui/ja/panel_outbox_inventory.xml
new file mode 100644
index 0000000000..47f570ab86
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/panel_outbox_inventory.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<outbox_inventory_panel name="inventory_outbox" tool_tip="商品をここにドラッグアンドドロップすると、あなたの店頭に並びます"/>
diff --git a/indra/newview/skins/default/xui/ja/panel_preferences_setup.xml b/indra/newview/skins/default/xui/ja/panel_preferences_setup.xml
index 18c41cea38..7877c0495f 100644
--- a/indra/newview/skins/default/xui/ja/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/ja/panel_preferences_setup.xml
@@ -11,17 +11,6 @@
 	</text>
 	<check_box label="カスタムポート" name="connection_port_enabled"/>
 	<spinner label="ポート番号:" name="connection_port"/>
-	<text name="cache_size_label_l">
-		キャッシュサイズ
-	</text>
-	<text name="text_box5">
-		MB
-	</text>
-	<text name="Cache location">
-		キャッシュの保存場所:
-	</text>
-	<button label="参照" label_selected="参照" name="set_cache"/>
-	<button label="リセット" label_selected="リセット" name="reset_cache"/>
 	<text name="Web:">
 		Web:
 	</text>
@@ -33,12 +22,6 @@
 	<check_box initial_value="true" label="Cookie を受け入れる" name="cookies_enabled"/>
 	<check_box initial_value="true" label="Javascript を有効にする" name="browser_javascript_enabled"/>
 	<check_box initial_value="false" label="メディアブラウザのポップアップを有効にする" name="media_popup_enabled"/>
-	<check_box initial_value="false" label="Web プロキシを有効にする" name="web_proxy_enabled"/>
-	<text name="Proxy location">
-		プロキシ:
-	</text>
-	<line_editor name="web_proxy_editor" tool_tip="使用するプロキシのホスト名または IP アドレス"/>
-	<spinner label="ポート番号:" name="web_proxy_port"/>
 	<text name="Software updates:">
 		ソフトウェアアップデート:
 	</text>
@@ -46,4 +29,8 @@
 		<combo_box.item label="自動的にインストール" name="Install_automatically"/>
 		<combo_box.item label="手動でアップデートをダウンロード&amp;インストール" name="Install_manual"/>
 	</combo_box>
+	<text name="Proxy Settings:">
+		プロキシ設定:
+	</text>
+	<button label="プロキシ設定を調整" label_selected="参照" name="set_proxy"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_status_bar.xml b/indra/newview/skins/default/xui/ja/panel_status_bar.xml
index 163064484b..35c1148cc1 100644
--- a/indra/newview/skins/default/xui/ja/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/ja/panel_status_bar.xml
@@ -1,11 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="status">
-	<panel.string name="StatBarDaysOfWeek">
-		日曜日:月曜日:火曜日:水曜日:木曜日:金曜日:土曜日
-	</panel.string>
-	<panel.string name="StatBarMonthsOfYear">
-		1月:2月:3月:4月:5月:6月:7月:8月:9月:10月:11月:12月
-	</panel.string>
 	<panel.string name="packet_loss_tooltip">
 		パケット損失
 	</panel.string>
@@ -25,6 +19,10 @@
 		<text name="balance" tool_tip="クリックして L$ 残高を更新" value="L$20"/>
 		<button label="L$ の購入" name="buyL" tool_tip="クリックして L$ を購入します"/>
 	</panel>
+	<combo_box name="mode_combo" tool_tip="モードを選択します。ベーシックモードでは探索やチャットをすばやく簡単に実行でき、アドバンスモードでは、より多くの機能が利用できます。">
+		<combo_box.item label="ベーシックモード" name="Basic"/>
+		<combo_box.item label="アドバンスモード" name="Advanced"/>
+	</combo_box>
 	<text name="TimeText" tool_tip="現在時刻(太平洋)">
 		24:00 AM PST
 	</text>
diff --git a/indra/newview/skins/default/xui/ja/sidepanel_inventory.xml b/indra/newview/skins/default/xui/ja/sidepanel_inventory.xml
index 7edda6e1a3..fc0293307b 100644
--- a/indra/newview/skins/default/xui/ja/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/ja/sidepanel_inventory.xml
@@ -2,35 +2,47 @@
 <panel label="もの" name="objects panel">
 	<panel label="" name="sidepanel__inventory_panel">
 		<layout_stack name="inventory_layout_stack">
-			<layout_panel name="inbox_layout_panel">
-				<panel label="" name="marketplace_inbox">
-					<string name="InboxLabelWithArg">
-						受け取った商品([NUM])
-					</string>
-					<string name="InboxLabelNoArg">
-						受け取った商品
-					</string>
-					<button label="受け取った商品" name="inbox_btn"/>
-					<text name="inbox_fresh_new_count">
-						[NUM] 新登場
-					</text>
-					<panel tool_tip="Drag and drop items to your inventory to manage and use them">
-						<text name="inbox_inventory_placeholder">
-							マーケットプレイスから購入した商品はここに配達されます。
-						</text>
-					</panel>
-				</panel>
-			</layout_panel>
-			<layout_panel name="outbox_layout_panel">
-				<panel label="" name="marketplace_outbox">
-					<button label="マーチャントのアウトボックス" name="outbox_btn"/>
-					<button label="" name="outbox_sync_btn" tool_tip="自分のマーケットプレイス店頭に移動"/>
-					<panel tool_tip="Drag and drop items here to prepare them for sale on your storefront">
-						<text name="outbox_inventory_placeholder">
-							この機能を使用するには、マーチャントアカウントをセットアップしてください。
-						</text>
-					</panel>
-				</panel>
+			<layout_panel name="inbox_outbox_layout_panel">
+				<layout_stack name="inbox_outbox_layout_stack">
+					<layout_panel name="inbox_layout_panel">
+						<panel label="" name="marketplace_inbox">
+							<string name="InboxLabelWithArg">
+								受け取った商品([NUM])
+							</string>
+							<string name="InboxLabelNoArg">
+								受け取った商品
+							</string>
+							<button label="受け取った商品" name="inbox_btn"/>
+							<text name="inbox_fresh_new_count">
+								[NUM] 個の新商品
+							</text>
+							<panel tool_tip="Drag and drop items to your inventory to manage and use them">
+								<text name="inbox_inventory_placeholder">
+									マーケットプレイスから購入した商品はここに配達されます。
+								</text>
+							</panel>
+						</panel>
+					</layout_panel>
+					<layout_panel name="outbox_layout_panel">
+						<panel label="" name="marketplace_outbox">
+							<string name="OutboxLabelWithArg">
+								マーチャントのアウトボックス ([NUM])
+							</string>
+							<string name="OutboxLabelNoArg">
+								マーチャントのアウトボックス
+							</string>
+							<button label="マーチャントのアウトボックス" name="outbox_btn"/>
+							<button label="" name="outbox_sync_btn" tool_tip="自分のマーケットプレイス店頭に移動"/>
+							<panel>
+								<panel name="outbox_inventory_placeholder_panel">
+									<text name="outbox_inventory_placeholder_title">
+										ローディング...
+									</text>
+								</panel>
+							</panel>
+						</panel>
+					</layout_panel>
+				</layout_stack>
 			</layout_panel>
 		</layout_stack>
 		<panel name="button_panel">
diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml
index f0c0d99a8e..41dc098ba2 100644
--- a/indra/newview/skins/default/xui/ja/strings.xml
+++ b/indra/newview/skins/default/xui/ja/strings.xml
@@ -339,6 +339,18 @@ support@secondlife.com にお問い合わせください。
 		アイテムは 1 つだけここにドラッグできます
 	</string>
 	<string name="TooltipPrice" value="L$[AMOUNT]:"/>
+	<string name="TooltipOutboxNoTransfer">
+		これらオブジェクトの 1 つまたは複数は、別のユーザーに売り渡したり譲渡できないものです。
+	</string>
+	<string name="TooltipOutboxWorn">
+		あなたはこれらオブジェクトの 1 つまたは複数を装着しています。アバターからそれらを取り外し、再び移動してみてください。
+	</string>
+	<string name="TooltipOutboxFolderLevels">
+		このフォルダにあるサブフォルダの階層が多すぎます。サブフォルダは4階層以内(ルートフォルダの下にA、その下にB、その下にCという風に)にまとめ直してください。
+	</string>
+	<string name="TooltipOutboxTooManyObjects">
+		このフォルダには 200 個以上のオブジェクトが含まれます。商品のいつかをボックスに入れ、オブジェクト数を減らしてください。
+	</string>
 	<string name="TooltipHttpUrl">
 		クリックしてこの Web ページを見ます
 	</string>
@@ -1204,8 +1216,65 @@ support@secondlife.com にお問い合わせください。
 	<string name="InventoryInboxNoItems">
 		マーケットプレイスで購入した商品はここに配達されます。
 	</string>
+	<string name="MarketplaceURL">
+		http://marketplace.[DOMAIN_NAME]
+	</string>
+	<string name="MarketplaceURL_CreateStore">
+		http://marketplace.[DOMAIN_NAME]/create_store
+	</string>
+	<string name="MarketplaceURL_LearnMore">
+		http://marketplace.[DOMAIN_NAME]/learn_more
+	</string>
+	<string name="InventoryOutboxCreationErrorTitle">
+		マーチャントアウトボックスが正しく設定されていません
+	</string>
+	<string name="InventoryOutboxCreationErrorTooltip">
+		マーチャントアウトボックスの設定エラー
+	</string>
+	<string name="InventoryOutboxCreationError">
+		問題を解決するにはカスタマーサービスにお問い合わせください。
+	</string>
+	<string name="InventoryOutboxNotMerchantTitle">
+		マーケットプレイスは皆の売り場です
+	</string>
+	<string name="InventoryOutboxNotMerchantTooltip">
+		あなたもマーチャントに!
+	</string>
+	<string name="InventoryOutboxNotMerchant">
+		[[MARKETPLACE_URL] Second Life マーケットプレイス] では、SL 住人が制作した商品 100 万点以上が販売されています。あなたもご自分の自信作や、あなたが購入したアイテムを商品として売ってみませんか。その手順は簡単で、セットアップは無料です。[[LEARN_MORE_URL] こちらで詳細を確かめ]、マーケットプレイスに[[CREATE_STORE_URL] ストアを作成] しましょう。
+	</string>
+	<string name="InventoryOutboxNoItemsTitle">
+		マーケットプレイスへの新しい出荷方法
+	</string>
+	<string name="InventoryOutboxNoItemsTooltip">
+		商品をここにドラッグアンドドロップするだけで、マーケットプレイスの売り物となります
+	</string>
 	<string name="InventoryOutboxNoItems">
-		マーケットプレイス店頭に掲載するための準備として、ここに商品をドラッグします。
+		販売する商品またはフォルダをこのエリアにドラッグします。コピー不可のアイテムでない限り、ドラッグした商品のコピーが表示されるだけで、あなたの持ち物から商品が実際に移動するわけではありません。マーケットプレイスに商品を送る準備が整ったら、「アップロード」ボタンをクリックします。商品はマーケットプレイスインベントリに移動した時点でこのフォルダから削除されます。
+	</string>
+	<string name="Marketplace Error None">
+		エラーなし
+	</string>
+	<string name="Marketplace Error Not Merchant">
+		エラー:マーケットプレイスに商品を送る前に、あなた自身をマーチャント登録する必要があります(登録は無料です)。
+	</string>
+	<string name="Marketplace Error Empty Folder">
+		エラー:このフォルダは空です。
+	</string>
+	<string name="Marketplace Error Unassociated Products">
+		エラー:あなたのマーチャントアカウントには、商品と無関係のアイテムが多すぎるため、このアイテムをアップロードできませんでした。このエラーを解消するには、マーケットプレイスのウェブサイトにログインし、商品に関係のないアイテム数を減らしてください。
+	</string>
+	<string name="Marketplace Error Object Limit">
+		エラー:この商品に含まれるオブジェクトが多すぎます。オブジェクトをいくつかボックスにまとめ、オブジェクト数を200以下に減らしてください。
+	</string>
+	<string name="Marketplace Error Folder Depth">
+		エラー:この商品はネスト入りフォルダの階層が多すぎます。ネスト入りフォルダを 3 階層以内にまとめ直してください。
+	</string>
+	<string name="Marketplace Error Unsellable Item">
+		エラー:この項目をマーケットプレイスで販売することはできません。
+	</string>
+	<string name="Marketplace Error Internal Import">
+		エラー:この商品に関して問題が発生しました。しばらくしてからお試しください。
 	</string>
 	<string name="no_transfer" value=" (再販・プレゼント不可)"/>
 	<string name="no_modify" value=" (編集不可)"/>
@@ -4185,8 +4254,8 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ
 	<string name="Female - Wow">
 		女性 - Wow
 	</string>
-	<string name="/bow">
-		/おじぎする
+	<string name="/bow1">
+		/bow1
 	</string>
 	<string name="/clap">
 		/拍手
diff --git a/indra/newview/skins/default/xui/pt/floater_about.xml b/indra/newview/skins/default/xui/pt/floater_about.xml
index 6ea2daced9..508635cd6e 100644
--- a/indra/newview/skins/default/xui/pt/floater_about.xml
+++ b/indra/newview/skins/default/xui/pt/floater_about.xml
@@ -41,15 +41,23 @@ Versão do servidor de voz: [VOICE_VERSION]
 			<button label="Copiar" name="copy_btn"/>
 		</panel>
 		<panel label="Créditos" name="credits_panel">
-			<text_editor name="credits_editor">
-				O Second Life é o resultado do trabalho de Philip, Tessa, Andrew, Cory, James, Ben, Char, Charlie, Colin, Dan, Daniel, Doug, Eric, Hamlet, Haney, Eve, Hunter, Ian, Jeff, Jennifer, Jim, John, Lee, Mark, Peter, Phoenix, Richard, Robin, Xenon, Steve, Tanya, Eddie, Avi, Frank, Bruce, Aaron, Alice, Bob, Debra, Eileen, Helen, Janet, Louie, Leviathania, Stefan, Ray, Kevin, Tom, Mikeb, MikeT, Burgess, Elena, Tracy, Bill, Todd, Ryan, Zach, Sarah, Nova, Tim, Stephanie, Michael, Evan, Nicolas, Catherine, Rachelle, Dave, Holly, Bub, Kelly, Magellan, Ramzi, Don, Sabin, Jill, Rheya, Jeska, Torley, Kona, Callum, Charity, Ventrella, Jack, Vektor, Iris, Chris, Nicole, Mick, Reuben, Blue, Babbage, Yedwab, Deana, Lauren, Brent, Pathfinder, Chadrick, Altruima, Jesse, Teeny, Monroe, Icculus, David, Tess, Lizzie, Patsy, Isaac, Lawrence, Cyn, Bo, Gia, Annette, Marius, Tbone, Jonathan, Karen, Ginsu, Satoko, Yuko, Makiko, Thomas, Harry, Seth, Alexei, Brian, Guy, Runitai, Ethan, Data, Cornelius, Kenny, Swiss, Zero, Natria, Wendy, Stephen, Teeple, Thumper, Lucy, Dee, Mia, Liana, Warren, Branka, Aura, beez, Milo, Hermia, Red, Thrax, Joe, Sally, Magenta, Mogura, Paul, Jose, Rejean, Henrik, Lexie, Amber, Logan, Xan, Nora, Morpheus, Donovan, Leyla, MichaelFrancis, Beast, Cube, Bucky, Joshua, Stryfe, Harmony, Teresa, Claudia, Walker, Glenn, Fritz, Fordak, June, Cleopetra, Jean, Ivy, Betsy, Roosevelt, Spike, Ken, Which, Tofu, Chiyo, Rob, Zee, dustin, George, Del, Matthew, Cat, Jacqui, Lightfoot, Adrian, Viola, Alfred, Noel, Irfan, Sunil, Yool, Rika, Jane, Xtreme, Frontier, a2, Neo, Siobhan, Yoz, Justin, Elle, Qarl, Benjamin, Isabel, Gulliver, Everett, Christopher, Izzy, Stephany, Garry, Sejong, Sean, Tobin, Iridium, Meta, Anthony, Jeremy, JP, Jake, Maurice, Madhavi, Leopard, Kyle, Joon, Kari, Bert, Belinda, Jon, Kristi, Bridie, Pramod, KJ, Socrates, Maria, Ivan, Aric, Yamasaki, Adreanne, Jay, MitchK, Ceren, Coco, Durl, Jenny, Periapse, Kartic, Storrs, Lotte, Sandy, Rohn, Colossus, Zen, BigPapi, Brad, Pastrami, Kurz, Mani, Neuro, Jaime, MJ, Rowan, Sgt, Elvis, Gecko, Samuel, Sardonyx, Leo, Bryan, Niko, Soft, Poppy, Rachel, Aki, Angelo, Banzai, Alexa, Sue, CeeLo, Bender, CG, Gillian, Pelle, Nick, Echo, Zara, Christine, Shamiran, Emma, Blake, Keiko, Plexus, Joppa, Sidewinder, Erica, Ashlei, Twilight, Kristen, Brett, Q, Enus, Simon, Bevis, Kraft, Kip, Chandler, Ron, LauraP, Ram, KyleJM, Scouse, Prospero, Melissa, Marty, Nat, Hamilton, Kend, Lordan, Jimmy, Kosmo, Seraph, Green, Ekim, Wiggo, JT, Rome, Doris, Miz, Benoc, Whump, Trinity, Patch, Kate, TJ, Bao, Joohwan, Christy, Sofia, Matias, Cogsworth, Johan, Oreh, Cheah, Angela, Brandy, Mango, Lan, Aleks, Gloria, Heidy, Mitchell, Space, Colton, Bambers, Einstein, Maggie, Malbers, Rose, Winnie, Stella, Milton, Rothman, Niall, Marin, Allison, Katie, Dawn, Katt, Dusty, Kalpana, Judy, Andrea, Ambroff, Infinity, Gail, Rico, Raymond, Yi, William, Christa, M, Teagan, Scout, Molly, Dante, Corr, Dynamike, Usi, Kaylee, Vidtuts, Lil, Danica, Sascha, Kelv, Jacob, Nya, Rodney, Brandon, Elsie, Blondin, Grant, Katrin, Nyx, Gabriel, Locklainn, Claire, Devin, Minerva, Monty, Austin, Bradford, Si, Keira, H, Caitlin, Dita, Makai, Jenn, Ann, Meredith, Clare, Joy, Praveen, Cody, Edmund, Ruthe, Sirena, Gayathri, Spider, FJ, Davidoff, Tian, Jennie, Louise, Oskar, Landon, Noelle, Jarv, Ingrid, Al, Sommer, Doc, Aria, Huin, Gray, Lili, Vir, DJ, Yang, T, Simone, Maestro, Scott, Charlene, Quixote, Amanda, Susan, Zed, Anne, Enkidu, Esbee, Joroan, Katelin, Roxie, Tay, Scarlet, Kevin, Johnny, Wolfgang, Andren, Bob, Howard, Merov, Rand, Ray, Michon, Newell, Galen, Dessie, Les e muitos mais.
-
-Agradecemos também aos seguintes residentes por sua colaboração na mais nova versão do Second Life: Drew Dwi, Zai Lynch, Latif Khalifa, Ellla McMahon, Harleen Gretzky, Squirrel Wood, Malarthi Behemoth, Dante Tucker, Buckaroo Mu, Eddi Decosta, Dirk, Talamasca, Torben Trautman, Irene Muni, Aralara Rajal, Aura Dirval, Cayu Cluny, Eva Rau, FreeSL Aeon, Frontera Thor, Inma Rau, Lunita Savira, Minerva Memel, Polo Gufler, Xiki Luik, Lilly Zenovka, Vick Forcella, Sasy Scarborough, Gentle Welinder, Elric Anatine, Techwolf Lupindo, Dusan Writer, WolfPup Lowenhar, Marianne McCann, Fiachra Lach, Sitearm Madonna, Sudane Erato, Sahkolihaa Contepomi, Sachi Vixen, Questar Utu, Dimitrio Lewis, Matto Destiny, Scrim Pinion, Radio Signals, Psi Merlin, Pixel Gausman, Mel Vanbeeck, Laurent Bechir, Lamorna Proctor, Lares Carter, Gwyneth Llewelyn, Hydra Shaftoe, Holger Gilruth, Gentle Heron, Carla Broek, Boroondas Gupte, Fury Rosewood, Flower Ducatillon, Colpo Wexler, gwampa Lomu, Borg Capalini, Beansy Twine, Ardy Lay, , 45ms Zhong, Adeon Writer, Aeonix Aeon, Ai Austin, Aiko Ying, Alexandrea Fride, Alliez Mysterio, Annie Milestone, Annika Genezzia, Ansariel Hiller, ArminasX Saiman, Arya Braveheart, Asaeda Meltingdots, Asturkon Jua, Avallyn Oakleaf, Avatar Quinzet, BabyA Littlething, Bacchus Ireto, Bazaar, Riva, Benjamin Bigdipper, Beth Walcher, Bezilon Kasei, Biancaluce Robbiani, Bill Walach, blakopal Galicia, Blitzckreed Levenque, Bryn Oh, Callipygian Christensen, Cap Carver, Carr Arbenlow, Chantal Harvey, Charles Courtois, Charlie Sazaland, Cherry Cheevers, ChickyBabes Zuzu, Christopher  Organiser, Ciaran Laval, Clara Young, Celierra Darling, Corinne Helendale, Corro Moseley, Coughdrop Littlething, Darien Caldwell, Dartagan Shepherd, Debs Regent, Decro Schmooz, Denim Kamachi, DiJodi Dubratt, Dil Spitz, Edgware Marker, Egehan Dryke, Emma Portilo, Emmie Fairymeadow, Evangelista Emerald, Faelon Swordthain, Frenchimmo Sabra, Gaberoonie Zanzibar, Ganymedes Costagravas, Gene Frostbite, GeneJ Composer, Giggles Littlebird, Grady Echegaray, Guni Greenstein, Gypsy Tripsa, Hackshaven Harford, Ham Rambler, Han Shuffle, Hanglow Short, Hatzfeld Runo, herina Bode, Horatio Freund, Hypatia Callisto, Hypatia Pickens, Identity Euler, Imnotgoing Sideways, Innula Zenovka, Iyoba Tarantal, Jack Abraham, Jagga Meredith, Jennifer Boyle, Jeremy Marquez, Jessica Qin, Jinx Nordberg, Jo Bernandes, Jocial Sonnenkern, Joel Savard, Jondan Lundquist, Josef Munster, Josette Windlow, Juilan Tripsa, Juro Kothari, Justin RiversRunRed, Kagehi Kohn, Kaimen Takahe, Keklily Longfall, Ken Lavender, Kestral Karas, Khisme Nitely, Kimar Coba, Kithrak Kirkorian, Kitty Barnett, Kolor Fall, Komiko Okamoto, Korvel Noh, Larry Pixel, Leal Choche, len Starship, Lenae Munz, Lexi Frua, Lillie Cordeaux, Lizzy Macarthur, LSL Scientist, Luban Yiyuan, Luc Starsider, Maccus McCullough, Madison Blanc, Maggie Darwin, Mallory Destiny, Manx Wharton, Marc Claridge, Marc2 Sands, Matthew Anthony, Maxim RiversRunRed, Medhue Simoni, Melinda Latynina, Mencius Watts, Michi Lumin, Midian Farspire, Miles Glaz, Mindy Mathy, Mitch Wagner, Mo Hax, Mourna Biziou, Nao Noe, naofan Teardrop, Naomah Beaumont, Nathiel Siamendes, Nber Medici, Neko Link, Netpat Igaly, Neutron Chesnokov, Newfie Pendragon, Nicholai Laviscu, Nick Rhodes, Nicoladie Gymnast, Ollie Kubrick, Orenj Marat, Orion Delphis, Oryx Tempel, Parvati Silverweb, PeterPunk Mooney, Pixel Scientist, Pounce Teazle, Professor Noarlunga, Quantum Destiny, Quicksilver Hermes, Ralf Setsuko, RAT Quan, RedMokum Bravin, Revolution Perenti, Rezit Sideways, Rich Grainger, Rosco Teardrop, Rose Evans, Rudee Voom, RufusTT Horsefly, Saii Hallard, SaintLEOlions Zimer, Samm Larkham, Satanello Miami, SexySteven Morrisey, Sheet Spotter, Shnurui Troughton, sicarius Thorne, Sicarius Toxx, Sini Nubalo, SLB Wirefly, snowy Sidran, Soupa Segura, ST Mensing, Starshine Halasy, Stickman Ingmann, Synystyr Texan, Takeda Terrawyng, Tali Rosca, Templar Merlin, Tezcatlipoca Bisiani, Tiel Stonecutter, Tony Kembia, TouchaHoney Perhaps, Trey Reanimator, TriloByte Zanzibar, Trinity Dechou, Trinity Dejavu, Unlikely Quintessa, UsikuFarasi Kanarik, Veritas Raymaker, Vex Streeter, Viaticus Speculaas, Villain Baroque, Vixie Durant, Void Singer, Watty Berkson, Westley Schridde, Westley Streeter, Whimsy Winx, Winter Ventura, Wundur Primbee, xstorm Radek, YongYong Francois, Zak Westminster, Zana Kohime, Zaren Alexander, Zeja Pyle, ZenMondo Wormser, Zoex Flanagan e muitos mais.
-
-
-
-
-&quot;O trabalho continua, a causa vive, a esperança persiste, e os sonhos nunca morrem&quot; - Edward Kennedy
+			<text name="linden_intro">
+				O Second Life é trazido a você pela Lindens:
+			</text>
+			<text_editor name="linden_names">
+				Philip, Andrew, Doug, Richard, Phoenix, Ian, Mark, Robin, Dan, Char, Ryan, Eric, Jim, Lee, Jeff, Michael, Kelly, Steve, Catherine, Bub, Ramzi, Jill, Jeska, Don, Kona, Callum, Charity, Jack, Shawn, babbage, James, Lauren, Blue, Brent, Reuben, Pathfinder, Jesse, Patsy, Torley, Bo, Cyn, Jonathan, Gia, Annette, Ginsu, Harry, Lex, Runitai, Guy, Cornelius, Beth, Swiss, Thumper, Wendy, Teeple, Seth, Dee, Mia, Sally, Liana, Aura, Beez, Milo, Red, Gulliver, Marius, Joe, Jose, Dore, Justin, Nora, Morpheus, Lexie, Amber, Chris, Xan, Leyla, Walker, Sabin, Joshua, Hiromi, Tofu, Fritz, June, Jean, Ivy, Dez, Ken, Betsy, Which, Spike, Rob, Zee, Dustin, George, Claudia, del, Matthew, jane, jay, Adrian, Yool, Rika, Yoz, siobhan, Qarl, Benjamin, Beast, Everett, madhavi, Christopher, Izzy, stephany, Jeremy, sean, adreanne, Pramod, Tobin, sejong, Iridium, maurice, kj, Meta, kari, JP, bert, kyle, Jon, Socrates, Bridie, Ivan, maria, Aric, Coco, Periapse, sandy, Storrs, Lotte, Colossus, Brad, Pastrami, Zen, BigPapi, Banzai, Sardonyx, Mani, Garry, Jaime, Neuro, Samuel, Niko, CeeLo, Austin, Soft, Poppy, emma, tessa, angelo, kurz, alexa, Sue, CG, Blake, Erica, Brett, Bevis, kristen, Q, simon, Enus, MJ, laurap, Kip, Scouse, Ron, Ram, kend, Marty, Prospero, melissa, kraft, Nat, Seraph, Hamilton, Lordan, Green, miz, Ashlei, Trinity, Ekim, Echo, Charlie, Rowan, Rome, Jt, Doris, benoc, Christy, Bao, Kate, Tj, Patch, Cheah, Johan, Brandy, Angela, Oreh, Cogsworth, Lan, Mitchell, Space, Bambers, Einstein, Bender, Malbers, Matias, Maggie, Rothman, Milton, Niall, Marin, Allison, Mango, Andrea, Katt, Yi, Ambroff, Rico, Raymond, Gail, Christa, William, Dawn, Usi, Dynamike, M, Corr, Dante, Molly, kaylee, Danica, Kelv, Lil, jacob, Nya, Rodney, elsie, Blondin, Grant, Nyx, Devin, Monty, Minerva, Keira, Katie, Jenn, Makai, Clare, Joy, Cody, Gayathri, FJ, spider, Oskar, Landon, Jarv, Noelle, Al, Doc, Gray, Vir, t, Maestro, Simone, Shannon, yang, Courtney, Scott, charlene, Quixote, Susan, Zed, Amanda, Katelin, Esbee, JoRoan, Enkidu, roxie, Scarlet, Merov, Kevin, Judy, Rand, Newell, Les, Dessie, Galen, Michon, Geo, Siz, Calyle, Pete, Praveen, Callen, Sheldon, Pink, Nelson, jenelle, Terrence, Nathan, Juan, Sascha, Huseby, Karina, Kaye, Kotler, Lis, Darv, Charrell, Dakota, Kimmora, Theeba, Taka, Mae, Perry, Ducot, dana, Esther, Dough, gisele, Doten, Viale, Fisher, jessieann, ashley, Torres, delby, rountree, kurt, Slaton, Madison, Rue, Gino, Wen, Casssandra, Brodesky, Squid, Gez, Rakesh, Gecko, Ladan, Tony, Tatem, Squire, Falcon, BK, Crimp, Tiggs, Bacon, Coyot, Carmilla, Webb, Sea, Arch, Jillian, Jason, Bernard, Vogt, Peggy, dragon, Pup, xandix, Wallace, Bewest, Inoshiro, Rhett, AG, Aimee, Ghengis, Itiaes, Eli, Steffan, Epic, Grapes, Stone, Prep, Scobu, Robert, Alain, Carla, Vicky, Tia, Alec, Taras, Lisa, Oz, Ariane, Log, House, Kazu, Kim, Drofnas, Tyler, Campbell, Michele, Madeline, Nelly, Baron, Thor, Lori, Hele, Fredrik, Teddy, Pixie, Berry, Gabrielle, Alfonso, Brooke, Wolf, Ringo, Cru, Charlar, Rodvik, Gibson, Elise, Bagman, Greger, Leonidas, Jerm, Leslie, CB, Brenda, Durian, Carlo, mm, Zeeshan, Caleb, Max, Elikak, Mercille, Steph, Chase
+			</text_editor>
+			<text name="contrib_intro">
+				com contribuições de código aberto de:
+			</text>
+			<text_editor name="contrib_names">
+				Dummy Name substituído durante a execução
+			</text_editor>
+			<text name="trans_intro">
+				e traduções de:
+			</text>
+			<text_editor name="trans_names">
+				Dummy Name substituído durante a execução
 			</text_editor>
 		</panel>
 		<panel label="Licenças" name="licenses_panel">
diff --git a/indra/newview/skins/default/xui/pt/floater_preferences_proxy.xml b/indra/newview/skins/default/xui/pt/floater_preferences_proxy.xml
new file mode 100644
index 0000000000..3aaee2d4a7
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/floater_preferences_proxy.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Proxy Settings Floater" title="Configurações de proxy">
+	<check_box initial_value="false" label="Use proxy HTTP para páginas da Web" name="web_proxy_enabled"/>
+	<text name="http_proxy_label">
+		Proxy HTTP:
+	</text>
+	<line_editor name="web_proxy_editor" tool_tip="O nome DNS ou endereço IP do proxy HTTP que você deseja usar."/>
+	<spinner label="Porta:" name="web_proxy_port" tool_tip="A porta do proxy HTTP que você deseja usar."/>
+	<check_box label="Use o proxy SOCKS 5 para tráfego de UDP" name="socks_proxy_enabled"/>
+	<text name="socks5_proxy_label">
+		Proxy SOCKS 5:
+	</text>
+	<line_editor name="socks_proxy_editor" tool_tip="O nome DNS ou endereço IP do proxy SOCKS 5 que você deseja usar."/>
+	<spinner label="Porta:" name="socks_proxy_port" tool_tip="A porta do proxy SOCKS 5 que você deseja usar."/>
+	<text name="socks_auth_label">
+		Autenticação SOCKS:
+	</text>
+	<radio_group name="socks5_auth_type">
+		<radio_item label="Sem autenticação" name="Socks5NoAuth" tool_tip="O proxy Socks5 não requer autenticação." value="Nenhum"/>
+		<radio_item label="Nome de usuário/senha" name="Socks5UserPass" tool_tip="O proxy Socks5 requer autenticação de nome de usuário/senha." value="UserPass"/>
+	</radio_group>
+	<text name="socks5_username_label">
+		Nome de usuário:
+	</text>
+	<text name="socks5_password_label">
+		Senha:
+	</text>
+	<line_editor name="socks5_username" tool_tip="O nome de usuário usado para autenticar seu servidor SOCKS 5"/>
+	<line_editor name="socks5_password" tool_tip="A senha usada para autenticar seu servidor SOCKS 5"/>
+	<text name="other_proxy_label">
+		Outro proxy de tráfego HTTP:
+	</text>
+	<radio_group name="other_http_proxy_type">
+		<radio_item label="Não enviar para proxy" name="OtherNoProxy" tool_tip="O tráfego HTTP que não seja da Web NÃO será enviado a qualquer proxy." value="Nenhum"/>
+		<radio_item label="Usar proxy HTTP" name="OtherHTTPProxy" tool_tip="O HTTP que não seja da Web será enviado por meio do proxy da Web configurado." value="Web"/>
+		<radio_item label="Usar proxy SOCKS 5" name="OtherSocksProxy" tool_tip="O HTTP que não seja da Web será enviado por meio do proxy Socks 5 configurado." value="Socks"/>
+	</radio_group>
+	<button label="OK" label_selected="OK" name="OK"/>
+	<button label="Cancelar" label_selected="Cancelar" name="Cancel"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/pt/menu_inventory.xml b/indra/newview/skins/default/xui/pt/menu_inventory.xml
index 7aa3b836a4..ba3879b5a1 100644
--- a/indra/newview/skins/default/xui/pt/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/pt/menu_inventory.xml
@@ -83,5 +83,7 @@
 	<menu_item_call label="Editar" name="Wearable Edit"/>
 	<menu_item_call label="Adicionar" name="Wearable Add"/>
 	<menu_item_call label="Tirar" name="Take Off"/>
+	<menu_item_call label="Copiar para Caixa de saída do lojista" name="Merchant Copy"/>
+	<menu_item_call label="Mover para Caixa de saída do lojista" name="Merchant Move"/>
 	<menu_item_call label="--Sem opções--" name="--no options--"/>
 </menu>
diff --git a/indra/newview/skins/default/xui/pt/menu_media_ctrl.xml b/indra/newview/skins/default/xui/pt/menu_media_ctrl.xml
index 44117c8865..ac84b02870 100644
--- a/indra/newview/skins/default/xui/pt/menu_media_ctrl.xml
+++ b/indra/newview/skins/default/xui/pt/menu_media_ctrl.xml
@@ -3,4 +3,5 @@
 	<menu_item_call label="Cortar" name="Cut"/>
 	<menu_item_call label="Cortar" name="Copy"/>
 	<menu_item_call label="Colar" name="Paste"/>
+	<menu_item_call label="Abrir o Web Inspector" name="open_webinspector"/>
 </context_menu>
diff --git a/indra/newview/skins/default/xui/pt/menu_mode_change.xml b/indra/newview/skins/default/xui/pt/menu_mode_change.xml
new file mode 100644
index 0000000000..314d3e409b
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/menu_mode_change.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<toggleable_menu name="Mode Change">
+	<menu_item_check label="Básico" name="BasicMode"/>
+	<menu_item_check label="Avançado" name="AdvancedMode"/>
+</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/pt/menu_viewer.xml b/indra/newview/skins/default/xui/pt/menu_viewer.xml
index ea54afed5e..e1d066261a 100644
--- a/indra/newview/skins/default/xui/pt/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/pt/menu_viewer.xml
@@ -138,7 +138,6 @@
 			<menu_item_call label="Som (L$[COST])..." name="Upload Sound"/>
 			<menu_item_call label="Animação (L$[COST])..." name="Upload Animation"/>
 			<menu_item_call label="Modelar..." name="Upload Model"/>
-			<menu_item_call label="Assistente de modelagem..." name="Upload Model Wizard"/>
 			<menu_item_call label="Volume (L$[COST] por arquivo)..." name="Bulk Upload"/>
 		</menu>
 		<menu_item_call label="Desfazer" name="Undo"/>
@@ -248,6 +247,7 @@
 			<menu_item_check label="Mostrar info da textura" name="Show Texture Info"/>
 			<menu_item_check label="Mostrar cor sob o cursor" name="Show Color Under Cursor"/>
 			<menu_item_check label="Mostrar memória" name="Show Memory"/>
+			<menu_item_check label="Exibir informações de memória privadas" name="Show Private Mem Info"/>
 			<menu_item_check label="Mostrar mudanças a objetos" name="Show Updates"/>
 		</menu>
 		<menu label="Force an Error" name="Force Errors">
diff --git a/indra/newview/skins/default/xui/pt/notifications.xml b/indra/newview/skins/default/xui/pt/notifications.xml
index 22de7edfdd..70d882822d 100644
--- a/indra/newview/skins/default/xui/pt/notifications.xml
+++ b/indra/newview/skins/default/xui/pt/notifications.xml
@@ -84,6 +84,19 @@ Verifique se a conexão à internet está funcionando.
 		Salvar modificações?
 		<usetemplate canceltext="Cancelar" name="yesnocancelbuttons" notext="Não salvar" yestext="Salvar"/>
 	</notification>
+	<notification name="ConfirmNoCopyToOutbox">
+		Você não tem permissão para copiar este item para a Caixa de saída do lojista. Tem certeza de que deseja mover o itens a seguir?
+        [ITEM_NAME]
+		<usetemplate name="okcancelbuttons" notext="Não" yestext="Sim"/>
+	</notification>
+	<notification name="OutboxUploadComplete">
+		Envio para Mercado concluído.
+		<usetemplate name="okbutton" yestext="Viva!"/>
+	</notification>
+	<notification name="OutboxUploadHadErrors">
+		Envio para Mercado concluído com erros!  Corrija os problemas em sua caixa de saída e tente novamente. Obrigado.
+		<usetemplate name="okbutton" yestext="Tudo bem!"/>
+	</notification>
 	<notification name="CompileQueueSaveText">
 		Houve um problema com o carregamento do texto para um script devido à seguinte razão: [REASON]. Por favor, tente novamente mais tarde.
 	</notification>
@@ -2400,12 +2413,20 @@ Por favor, tente novamente em alguns instantes.
 		Nenhum lote válido foi encontrado.
 	</notification>
 	<notification name="ObjectGiveItem">
-		Um objeto chamado &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt;, de [NAME_SLURL], lhe deu este(a) [OBJECTTYPE]:
+		Um objeto chamado &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt;, de [NAME_SLURL], obteve este(a) [OBJECTTYPE]:
 &lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;
 		<form name="form">
 			<button name="Keep" text="Segure"/>
 			<button name="Discard" text="Descarte"/>
-			<button name="Mute" text="Bloquear"/>
+			<button name="Mute" text="Bloquear proprietário"/>
+		</form>
+	</notification>
+	<notification name="OwnObjectGiveItem">
+		O objeto chamado &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt;, de [NAME_SLURL], obteve este(a) [OBJECTTYPE]:
+&lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;
+		<form name="form">
+			<button name="Keep" text="Manter"/>
+			<button name="Discard" text="Descartar"/>
 		</form>
 	</notification>
 	<notification name="UserGiveItem">
@@ -2549,6 +2570,7 @@ Deseja aceitar?
 		&apos;&lt;nolink&gt;[TITLE]&lt;/nolink&gt;&apos; de [NAME]
 [MESSAGE]
 		<form name="form">
+			<button name="Mute" text="Bloquear"/>
 			<button name="Ignore" text="Ignorar"/>
 		</form>
 	</notification>
@@ -2556,6 +2578,7 @@ Deseja aceitar?
 		&lt;nolink&gt;[TITLE]&lt;/nolink&gt;&apos; de [GROUPNAME]&apos;
 [MESSAGE]
 		<form name="form">
+			<button name="Mute" text="Bloquear"/>
 			<button name="Ignore" text="Ignorar"/>
 		</form>
 	</notification>
@@ -2883,6 +2906,12 @@ Se o botão Falar for ocultado, o recurso de voz será desabilitado.
 	<notification label="Você tem dólares Linden!" name="HintLindenDollar">
 		Seu saldo de L$ está aqui.  Clique em Comprar L$ para trocar mais dólares Linden.
 	</notification>
+	<notification name="LowMemory">
+		Seu pool de memória está baixo. Algumas funções do SL foram desativadas para evitar falhas. Encerre os outros aplicativos. Reinicie o SL se o problema persistir.
+	</notification>
+	<notification name="ForceQuitDueToLowMemory">
+		O SL será encerrado em 30 segundos devido falta de memória.
+	</notification>
 	<notification name="PopupAttempt">
 		Um pop-up foi bloqueado.
 		<form name="form">
@@ -2890,6 +2919,54 @@ Se o botão Falar for ocultado, o recurso de voz será desabilitado.
 			<button name="open" text="Abrir pop-up"/>
 		</form>
 	</notification>
+	<notification name="SOCKS_NOT_PERMITTED">
+		O proxy SOCKS 5 &quot;[HOST]:[PORT]&quot; recusou a conexão, não permitida pelo conjunto de regras.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_CONNECT_ERROR">
+		O proxy SOCKS 5 &quot;[HOST]:[PORT]&quot; recusou a conexão. Não foi possível abrir o canal TCP.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_NOT_ACCEPTABLE">
+		O proxy SOCKS 5 &quot;[HOST]:[PORT]&quot; recusou o sistema de autenticação selecionado.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_AUTH_FAIL">
+		O proxy SOCKS 5 &quot;[HOST]:[PORT]&quot; informou que suas credenciais são inválidas.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_UDP_FWD_NOT_GRANTED">
+		O proxy SOCKS 5 &quot;[HOST]:[PORT]&quot; recusou a solicitação de UDP ASSOCIATE.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_HOST_CONNECT_FAILED">
+		Não foi possível conectar-se ao servidor de proxy SOCKS 5 &quot;[HOST]:[PORT]&quot;.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_UNKNOWN_STATUS">
+		Erro desconhecido de proxy com o servidor &quot;[HOST]:[PORT]&quot;.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_INVALID_HOST">
+		Endereço de proxy SOCKS ou porta &quot;[HOST]:[PORT]&quot; inválidos.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="SOCKS_BAD_CREDS">
+		Nome de usuário ou senha de SOCKS 5 inválidos.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="PROXY_INVALID_HTTP_HOST">
+		Endereço de proxy HTTP ou porta &quot;[HOST]:[PORT]&quot; inválidos.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="PROXY_INVALID_SOCKS_HOST">
+		Endereço de proxy SOCKS ou porta &quot;[HOST]:[PORT]&quot; inválidos.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
+	<notification name="ChangeProxySettings">
+		As configurações de proxy terão efeito depois que [APP_NAME] for reiniciado.
+		<usetemplate name="okbutton" yestext="OK"/>
+	</notification>
 	<notification name="AuthRequest">
 		O site em &apos;&lt;nolink&gt;[HOST_NAME]&lt;/nolink&gt;&apos; em &apos;[REALM]&apos; requer nome e senha.
 		<form name="form">
diff --git a/indra/newview/skins/default/xui/pt/panel_outbox_inventory.xml b/indra/newview/skins/default/xui/pt/panel_outbox_inventory.xml
new file mode 100644
index 0000000000..442622035a
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/panel_outbox_inventory.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<outbox_inventory_panel name="inventory_outbox" tool_tip="Arraste e solte os itens aqui para prepará-los para venda na frente da sua loja"/>
diff --git a/indra/newview/skins/default/xui/pt/panel_preferences_setup.xml b/indra/newview/skins/default/xui/pt/panel_preferences_setup.xml
index d8d4a8fc1c..9259c0ed56 100644
--- a/indra/newview/skins/default/xui/pt/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/pt/panel_preferences_setup.xml
@@ -11,17 +11,6 @@
 	</text>
 	<check_box label="Personalizar porta" name="connection_port_enabled"/>
 	<spinner label="Número da porta:" name="connection_port"/>
-	<text name="cache_size_label_l">
-		Tamanho do cache
-	</text>
-	<text name="text_box5">
-		MB
-	</text>
-	<text name="Cache location">
-		Localização do cache:
-	</text>
-	<button label="Procurar" label_selected="Procurar" name="set_cache"/>
-	<button label="Redefinir" label_selected="Redefinir" name="reset_cache"/>
 	<text name="Web:">
 		Web:
 	</text>
@@ -33,12 +22,6 @@
 	<check_box initial_value="true" label="Aceitar cookies" name="cookies_enabled"/>
 	<check_box initial_value="true" label="Habilitar Javascript" name="browser_javascript_enabled"/>
 	<check_box initial_value="falso" label="Ativar pop-ups no navegador de mídia" name="media_popup_enabled"/>
-	<check_box initial_value="false" label="Ativar web proxy" name="web_proxy_enabled"/>
-	<text name="Proxy location">
-		Localização do proxy:
-	</text>
-	<line_editor name="web_proxy_editor" tool_tip="O nome ou endereço IP do proxy da sua preferência"/>
-	<spinner label="Porta:" name="web_proxy_port"/>
 	<text name="Software updates:">
 		Atualizações de software:
 	</text>
@@ -46,4 +29,8 @@
 		<combo_box.item label="Instalar automaticamente" name="Install_automatically"/>
 		<combo_box.item label="Baixar e instalar atualizações manualmente" name="Install_manual"/>
 	</combo_box>
+	<text name="Proxy Settings:">
+		Configurações de proxy:
+	</text>
+	<button label="Ajustar configurações de proxy" label_selected="Procurar" name="set_proxy"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_status_bar.xml b/indra/newview/skins/default/xui/pt/panel_status_bar.xml
index f7890ae57d..0d0f8cbf19 100644
--- a/indra/newview/skins/default/xui/pt/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/pt/panel_status_bar.xml
@@ -1,11 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="status">
-	<panel.string name="StatBarDaysOfWeek">
-		Domingo:Segunda-feira:Terça-feira:Quarta-feira:Quinta-feira:Sexta-feira:Sábado
-	</panel.string>
-	<panel.string name="StatBarMonthsOfYear">
-		Janeiro:Fevereiro:Março:Abril:Maio:Junho:Julho:Agosto:Setembro:Outubro:Novembro:Dezembro
-	</panel.string>
 	<panel.string name="packet_loss_tooltip">
 		Perda de pacote
 	</panel.string>
@@ -25,6 +19,10 @@
 		<text name="balance" tool_tip="Atualizar saldo de L$" value="L$20"/>
 		<button label="Comprar L$" name="buyL" tool_tip="Comprar mais L$"/>
 	</panel>
+	<combo_box name="mode_combo" tool_tip="Selecione o modo. O modo Básico é mais rápido e ideal para explorar e conversar. Use o modo Avançado para acessar mais recursos.">
+		<combo_box.item label="Modo básico" name="Basic"/>
+		<combo_box.item label="Modo avançado" name="Advanced"/>
+	</combo_box>
 	<text name="TimeText" tool_tip="Hora atual (Pacífico)">
 		24:00 AM PST
 	</text>
diff --git a/indra/newview/skins/default/xui/pt/sidepanel_inventory.xml b/indra/newview/skins/default/xui/pt/sidepanel_inventory.xml
index 988e7c7076..77c552a852 100644
--- a/indra/newview/skins/default/xui/pt/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/pt/sidepanel_inventory.xml
@@ -2,35 +2,47 @@
 <panel label="Coisas" name="objects panel">
 	<panel label="" name="sidepanel__inventory_panel">
 		<layout_stack name="inventory_layout_stack">
-			<layout_panel name="inbox_layout_panel">
-				<panel label="" name="marketplace_inbox">
-					<string name="InboxLabelWithArg">
-						Itens recebidos ([NUM])
-					</string>
-					<string name="InboxLabelNoArg">
-						Itens recebidos
-					</string>
-					<button label="Itens recebidos" name="inbox_btn"/>
-					<text name="inbox_fresh_new_count">
-						[NUM] novos
-					</text>
-					<panel tool_tip="Drag and drop items to your inventory to manage and use them">
-						<text name="inbox_inventory_placeholder">
-							Compras do marketplace serão entregues aqui.
-						</text>
-					</panel>
-				</panel>
-			</layout_panel>
-			<layout_panel name="outbox_layout_panel">
-				<panel label="" name="marketplace_outbox">
-					<button label="Caixa de saída de comerciante" name="outbox_btn"/>
-					<button label="" name="outbox_sync_btn" tool_tip="Enviar para minha vitrine no Marketplace"/>
-					<panel tool_tip="Drag and drop items here to prepare them for sale on your storefront">
-						<text name="outbox_inventory_placeholder">
-							Abra uma conta de comerciante para usar este recurso.
-						</text>
-					</panel>
-				</panel>
+			<layout_panel name="inbox_outbox_layout_panel">
+				<layout_stack name="inbox_outbox_layout_stack">
+					<layout_panel name="inbox_layout_panel">
+						<panel label="" name="marketplace_inbox">
+							<string name="InboxLabelWithArg">
+								Itens recebidos ([NUM])
+							</string>
+							<string name="InboxLabelNoArg">
+								Itens recebidos
+							</string>
+							<button label="Itens recebidos" name="inbox_btn"/>
+							<text name="inbox_fresh_new_count">
+								[NUM] novo(s)
+							</text>
+							<panel tool_tip="Drag and drop items to your inventory to manage and use them">
+								<text name="inbox_inventory_placeholder">
+									Compras do marketplace serão entregues aqui.
+								</text>
+							</panel>
+						</panel>
+					</layout_panel>
+					<layout_panel name="outbox_layout_panel">
+						<panel label="" name="marketplace_outbox">
+							<string name="OutboxLabelWithArg">
+								Caixa de saída do lojista ([NUM])
+							</string>
+							<string name="OutboxLabelNoArg">
+								Caixa de saída do lojista
+							</string>
+							<button label="Caixa de saída do lojista" name="outbox_btn"/>
+							<button label="" name="outbox_sync_btn" tool_tip="Enviar para a frente do meu mercado"/>
+							<panel>
+								<panel name="outbox_inventory_placeholder_panel">
+									<text name="outbox_inventory_placeholder_title">
+										Carregando...
+									</text>
+								</panel>
+							</panel>
+						</panel>
+					</layout_panel>
+				</layout_stack>
 			</layout_panel>
 		</layout_stack>
 		<panel name="button_panel">
diff --git a/indra/newview/skins/default/xui/pt/strings.xml b/indra/newview/skins/default/xui/pt/strings.xml
index 2f3b438564..cffe92461b 100644
--- a/indra/newview/skins/default/xui/pt/strings.xml
+++ b/indra/newview/skins/default/xui/pt/strings.xml
@@ -288,6 +288,18 @@ Titulares de contas gratuitas não poderão acessar o Second Life para acomodar
 		Apenas um item único pode ser arrastado para este local
 	</string>
 	<string name="TooltipPrice" value="L$[AMOUNT]"/>
+	<string name="TooltipOutboxNoTransfer">
+		Um ou mais objetos não podem ser vendidos ou transferidos para outros usuário.
+	</string>
+	<string name="TooltipOutboxWorn">
+		Você está usando um ou mais desses objetos. Remova-os de seu avatar e tente movê-los novamente.
+	</string>
+	<string name="TooltipOutboxFolderLevels">
+		Esta pasta tem muitos níveis de subpastas. Reorganize as pastas internas em até 4 níveis no máximo (Pasta raiz contém A que contém B que contém C).
+	</string>
+	<string name="TooltipOutboxTooManyObjects">
+		Esta pasta contém mais de 200 objetos. Embale alguns dos itens para reduzir a contagem de objetos.
+	</string>
 	<string name="TooltipHttpUrl">
 		Clique para ver a página web
 	</string>
@@ -1144,8 +1156,65 @@ Titulares de contas gratuitas não poderão acessar o Second Life para acomodar
 	<string name="InventoryInboxNoItems">
 		Compras do marketplace serão entregues aqui.
 	</string>
+	<string name="MarketplaceURL">
+		http://marketplace.[DOMAIN_NAME]
+	</string>
+	<string name="MarketplaceURL_CreateStore">
+		http://marketplace.[DOMAIN_NAME]/create_store
+	</string>
+	<string name="MarketplaceURL_LearnMore">
+		http://marketplace.[DOMAIN_NAME]/learn_more
+	</string>
+	<string name="InventoryOutboxCreationErrorTitle">
+		Sua Caixa de saída do lojista não está configurada corretamente
+	</string>
+	<string name="InventoryOutboxCreationErrorTooltip">
+		Erro de configuração na Caixa de saída do lojista
+	</string>
+	<string name="InventoryOutboxCreationError">
+		Entre em contato com o Atendimento para corrigir o problema.
+	</string>
+	<string name="InventoryOutboxNotMerchantTitle">
+		Qualquer um pode vender itens no Mercado
+	</string>
+	<string name="InventoryOutboxNotMerchantTooltip">
+		Torne-se um lojista!
+	</string>
+	<string name="InventoryOutboxNotMerchant">
+		[[MARKETPLACE_URL] O Mercado do Second Life] oferece mais de um milhão de produtos virtuais para venda, todos criados pelos residentes. Você também pode vender os itens que você cria, além de alguns itens que comprou. É fácil e a configuração é gratuita. [[LEARN_MORE_URL] Saiba mais] ou [[CREATE_STORE_URL] crie uma loja] no Mercado para começar.
+	</string>
+	<string name="InventoryOutboxNoItemsTitle">
+		Uma nova maneira de vender os itens no Mercado
+	</string>
+	<string name="InventoryOutboxNoItemsTooltip">
+		Arraste e solte os itens aqui para prepará-los para venda no Mercado
+	</string>
 	<string name="InventoryOutboxNoItems">
-		Arraste seus itens aqui para preparar sua listagem na sua vitrine do Marketplace.
+		Arraste os itens ou pastas que deseja vender para esta área. Será exibida uma cópia deles, deixando seu inventário inalterado, a menos que você arraste um item que não permita cópia. Quando estiver pronto para enviar os itens para o Mercado, clique no botão Enviar. Quando os itens tiverem sido movidos para seu Inventário de mercado, eles desaparecerão desta pasta.
+	</string>
+	<string name="Marketplace Error None">
+		Sem erros
+	</string>
+	<string name="Marketplace Error Not Merchant">
+		Erro: antes de enviar os itens para o Mercado, é necessário que você se defina como um lojista (sem custos).
+	</string>
+	<string name="Marketplace Error Empty Folder">
+		Erro: esta pasta está vazia.
+	</string>
+	<string name="Marketplace Error Unassociated Products">
+		Erro: ocorreu uma falha ao enviar este item, pois sua conta de lojista tem muitos itens não associados a produtos. Para corrigir esse erro, faça o login no site do mercado e reduza a contagem de itens não associados.
+	</string>
+	<string name="Marketplace Error Object Limit">
+		Erro: este item contém muitos objetos. Corrija esse erro unindo os objetos em caixa para reduzir a contagem total a menos de 200.
+	</string>
+	<string name="Marketplace Error Folder Depth">
+		Erro: este item contém muitos níveis de pastas aninhadas. Reorganize-o em até 3 níveis de pastas aninhadas, no máximo.
+	</string>
+	<string name="Marketplace Error Unsellable Item">
+		Erro: este item não pode ser vendido no mercado.
+	</string>
+	<string name="Marketplace Error Internal Import">
+		Erro: ocorreu um problema com este item. Tente novamente mais tarde.
 	</string>
 	<string name="no_transfer" value="(não transferível)"/>
 	<string name="no_modify" value="(não modificável)"/>
@@ -4046,7 +4115,7 @@ Denunciar abuso
 	<string name="Female - Wow">
 		Wow - feminino
 	</string>
-	<string name="/bow">
+	<string name="/bow1">
 		/reverência
 	</string>
 	<string name="/clap">
diff --git a/indra/newview/skins/minimal/xui/de/notifications.xml b/indra/newview/skins/minimal/xui/de/notifications.xml
index 9abf8cdbb9..195d5105c5 100644
--- a/indra/newview/skins/minimal/xui/de/notifications.xml
+++ b/indra/newview/skins/minimal/xui/de/notifications.xml
@@ -9,7 +9,7 @@
 		</form>
 	</notification>
 	<notification name="ObjectGiveItem">
-		Ein Objekt namens &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt;, das [NAME_SLURL] gehört, bietet Ihnen &lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt; an. Zur Verwendung dieses Artikels müssen Sie in den erweiterten Modus umschalten, wo Sie den Artikel in Ihrem Inventar finden werden. Um in den erweiterten Modus umzuschalten, beenden Sie die Anwendung, starten Sie sie neu und ändern Sie die Moduseinstellung auf dem Anmeldebildschirm.
+		Ein Objekt namens &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt;, das [NAME_SLURL] gehört, bietet Ihnen &lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt; an. Zur Verwendung dieses Artikels müssen Sie in den erweiterten Modus umschalten, wo Sie den Artikel in Ihrem Inventar finden werden. Um in den erweiterten Modus zu wechseln, beenden Sie die Anwendung, starten Sie sie neu und ändern Sie die Moduseinstellung auf dem Anmeldebildschirm.
 		<form name="form">
 			<button name="Keep" text="Artikel behalten"/>
 			<button name="Discard" text="Artikel ablehnen"/>
diff --git a/indra/newview/skins/minimal/xui/de/panel_status_bar.xml b/indra/newview/skins/minimal/xui/de/panel_status_bar.xml
index 04ed58f944..2f8dc938c5 100644
--- a/indra/newview/skins/minimal/xui/de/panel_status_bar.xml
+++ b/indra/newview/skins/minimal/xui/de/panel_status_bar.xml
@@ -1,11 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="status">
-	<panel.string name="StatBarDaysOfWeek">
-		Sonntag:Montag:Dienstag:Mittwoch:Donnerstag:Freitag:Samstag
-	</panel.string>
-	<panel.string name="StatBarMonthsOfYear">
-		Januar:Februar:März:April:Mai:Juni:Juli:August:September:Oktober:November:Dezember
-	</panel.string>
 	<panel.string name="packet_loss_tooltip">
 		Paketverlust
 	</panel.string>
@@ -21,13 +15,10 @@
 	<panel.string name="buycurrencylabel">
 		[AMT] L$
 	</panel.string>
-	<panel name="balance_bg">
-		<text name="balance" tool_tip="Klicken, um L$-Guthaben zu aktualisieren" value="20 L$"/>
-		<button label="L$ kaufen" name="buyL" tool_tip="Hier klicken, um mehr L$ zu kaufen"/>
-	</panel>
-	<text name="TimeText" tool_tip="Aktuelle Zeit (Pazifik)">
-		24:00 H PST
-	</text>
+	<combo_box name="mode_combo" tool_tip="Wählen Sie den gewünschten Modus aus. Basismodus: Second Life schnell und einfach erkunden und chatten. Erweiterter Modus: Zugriff auf zusätzliche Funktionen.">
+		<combo_box.item label="Basismodus" name="Basic"/>
+		<combo_box.item label="Erweiterter Modus" name="Advanced"/>
+	</combo_box>
 	<button name="media_toggle_btn" tool_tip="Alle Medien starten/stoppen (Musik, Video, Webseiten)"/>
 	<button name="volume_btn" tool_tip="Steuerung der Gesamtlautstärke"/>
 </panel>
diff --git a/indra/newview/skins/minimal/xui/es/panel_status_bar.xml b/indra/newview/skins/minimal/xui/es/panel_status_bar.xml
index ab76d3f994..f3db35e8ec 100644
--- a/indra/newview/skins/minimal/xui/es/panel_status_bar.xml
+++ b/indra/newview/skins/minimal/xui/es/panel_status_bar.xml
@@ -1,11 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="status">
-	<panel.string name="StatBarDaysOfWeek">
-		Domingo:Lunes:Martes:Miércoles:Jueves:Viernes:Sábado
-	</panel.string>
-	<panel.string name="StatBarMonthsOfYear">
-		Enero:Febrero:Marzo:Abril:Mayo:Junio:Julio:Agosto:Septiembre:Octubre:Noviembre:Diciembre
-	</panel.string>
 	<panel.string name="packet_loss_tooltip">
 		Pérdida de paquetes
 	</panel.string>
@@ -21,13 +15,10 @@
 	<panel.string name="buycurrencylabel">
 		[AMT] L$
 	</panel.string>
-	<panel name="balance_bg">
-		<text name="balance" tool_tip="Haz clic para actualizar tu saldo en L$" value="20 L$"/>
-		<button label="COMPRAR L$" name="buyL" tool_tip="Pulsa para comprar más L$"/>
-	</panel>
-	<text name="TimeText" tool_tip="Hora actual (Pacífico)">
-		24:00 AM PST
-	</text>
+	<combo_box name="mode_combo" tool_tip="Selecciona el modo. Elige Básico para una exploración rápida y fácil y para chatear. Elige Avanzado para tener acceso a más funciones.">
+		<combo_box.item label="Modo Básico" name="Basic"/>
+		<combo_box.item label="Modo Avanzado" name="Advanced"/>
+	</combo_box>
 	<button name="media_toggle_btn" tool_tip="Iniciar/Parar todos los media (música, vídeo, páginas web)"/>
 	<button name="volume_btn" tool_tip="Control general del volumen"/>
 </panel>
diff --git a/indra/newview/skins/minimal/xui/fr/panel_status_bar.xml b/indra/newview/skins/minimal/xui/fr/panel_status_bar.xml
index 69aec99e1d..9e814ee7ab 100644
--- a/indra/newview/skins/minimal/xui/fr/panel_status_bar.xml
+++ b/indra/newview/skins/minimal/xui/fr/panel_status_bar.xml
@@ -1,11 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="status">
-	<panel.string name="StatBarDaysOfWeek">
-		Sunday:Monday:Tuesday:Wednesday:Thursday:Friday:Saturday
-	</panel.string>
-	<panel.string name="StatBarMonthsOfYear">
-		January:February:March:April:May:June:July:August:September:October:November:December
-	</panel.string>
 	<panel.string name="packet_loss_tooltip">
 		Perte de paquets
 	</panel.string>
@@ -21,13 +15,10 @@
 	<panel.string name="buycurrencylabel">
 		[AMT] L$
 	</panel.string>
-	<panel name="balance_bg">
-		<text name="balance" tool_tip="Cliquer sur ce bouton pour actualiser votre solde en L$." value="20 L$"/>
-		<button label="ACHETER L$" name="buyL" tool_tip="Cliquer pour acheter plus de L$"/>
-	</panel>
-	<text name="TimeText" tool_tip="Heure actuelle (Pacifique)">
-		00h00 PST
-	</text>
+	<combo_box name="mode_combo" tool_tip="Sélectionnez un mode. Pour une exploration facile et rapide avec chat, choisissez Basique. Pour accéder à plus de fonctionnalités, choisissez Avancé.">
+		<combo_box.item label="Mode basique" name="Basic"/>
+		<combo_box.item label="Mode avancé" name="Advanced"/>
+	</combo_box>
 	<button name="media_toggle_btn" tool_tip="Arrêter tous les médias (musique, vidéo, pages web)"/>
 	<button name="volume_btn" tool_tip="Contrôle du volume global"/>
 </panel>
diff --git a/indra/newview/skins/minimal/xui/it/notifications.xml b/indra/newview/skins/minimal/xui/it/notifications.xml
index 998e38ff5a..cf24d6cbf5 100644
--- a/indra/newview/skins/minimal/xui/it/notifications.xml
+++ b/indra/newview/skins/minimal/xui/it/notifications.xml
@@ -2418,7 +2418,7 @@ Riprova tra qualche istante.
 		Non è stato trovato nessun territorio valido.
 	</notification>
 	<notification name="ObjectGiveItem">
-		Un oggetto denominato &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; di proprietà di &lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt; ti ha offerto [ITEM_SLURL]:  Per usare questo oggetto è necessario passare alla modalità Avanzata e cercarlo nell&apos;Inventario. Per passare alla modalità Avanzata, esci e riavvia l&apos;applicazione e cambia le impostazioni della modalità nella schermata di accesso.
+		Un oggetto denominato &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; di proprietà di [NAME_SLURL] ti ha offerto &lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;. Per usare questo oggetto è necessario passare alla modalità Avanzata e cercarlo nell&apos;Inventario. Per passare alla modalità Avanzata, esci e riavvia l&apos;applicazione e cambia le impostazioni della modalità nella schermata di accesso.
 		<form name="form">
 			<button name="Keep" text="Mantieni oggetto"/>
 			<button name="Discard" text="Rifiuta oggetto"/>
diff --git a/indra/newview/skins/minimal/xui/it/panel_status_bar.xml b/indra/newview/skins/minimal/xui/it/panel_status_bar.xml
index 4353eb9d50..cde495ba97 100644
--- a/indra/newview/skins/minimal/xui/it/panel_status_bar.xml
+++ b/indra/newview/skins/minimal/xui/it/panel_status_bar.xml
@@ -1,11 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="status">
-	<panel.string name="StatBarDaysOfWeek">
-		Domenica:Lunedì:Martedì:Mercoledì:Giovedì:Venerdì:Sabato
-	</panel.string>
-	<panel.string name="StatBarMonthsOfYear">
-		Gennaio:Febbraio:Marzo:Aprile:Maggio:Giugno:Luglio:Agosto:Settembre:Ottobre:Novembre:Dicembre
-	</panel.string>
 	<panel.string name="packet_loss_tooltip">
 		Perdita di pacchetti
 	</panel.string>
@@ -21,13 +15,10 @@
 	<panel.string name="buycurrencylabel">
 		L$ [AMT]
 	</panel.string>
-	<panel name="balance_bg">
-		<text name="balance" tool_tip="Clicca per aggiornare il tuo saldo in L$" value="L$ 20"/>
-		<button label="ACQUISTA L$" name="buyL" tool_tip="Clicca per acquistare più L$"/>
-	</panel>
-	<text name="TimeText" tool_tip="Orario attuale (Pacifico)">
-		24:00, ora del Pacifico
-	</text>
+	<combo_box name="mode_combo" tool_tip="Seleziona la modalità. Seleziona Di base per esplorare facilmente e rapidamente e per la chat. Seleziona Avanzata per accedere ad altre funzionalità.">
+		<combo_box.item label="Modalità di base" name="Basic"/>
+		<combo_box.item label="Modalità Avanzata" name="Advanced"/>
+	</combo_box>
 	<button name="media_toggle_btn" tool_tip="Attiva/ferma tutti i media (musica, video, pagine Web)"/>
 	<button name="volume_btn" tool_tip="Regolazione del volume globale"/>
 </panel>
diff --git a/indra/newview/skins/minimal/xui/ja/panel_status_bar.xml b/indra/newview/skins/minimal/xui/ja/panel_status_bar.xml
index 163064484b..7d1298c6c0 100644
--- a/indra/newview/skins/minimal/xui/ja/panel_status_bar.xml
+++ b/indra/newview/skins/minimal/xui/ja/panel_status_bar.xml
@@ -1,11 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="status">
-	<panel.string name="StatBarDaysOfWeek">
-		日曜日:月曜日:火曜日:水曜日:木曜日:金曜日:土曜日
-	</panel.string>
-	<panel.string name="StatBarMonthsOfYear">
-		1月:2月:3月:4月:5月:6月:7月:8月:9月:10月:11月:12月
-	</panel.string>
 	<panel.string name="packet_loss_tooltip">
 		パケット損失
 	</panel.string>
@@ -21,13 +15,10 @@
 	<panel.string name="buycurrencylabel">
 		L$ [AMT]
 	</panel.string>
-	<panel name="balance_bg">
-		<text name="balance" tool_tip="クリックして L$ 残高を更新" value="L$20"/>
-		<button label="L$ の購入" name="buyL" tool_tip="クリックして L$ を購入します"/>
-	</panel>
-	<text name="TimeText" tool_tip="現在時刻(太平洋)">
-		24:00 AM PST
-	</text>
+	<combo_box name="mode_combo" tool_tip="モードを選択します。ベーシックモードでは探索やチャットをすばやく簡単に実行でき、アドバンスモードでは、より多くの機能が利用できます。">
+		<combo_box.item label="ベーシックモード" name="Basic"/>
+		<combo_box.item label="アドバンスモード" name="Advanced"/>
+	</combo_box>
 	<button name="media_toggle_btn" tool_tip="すべてのメディアを開始・停止(音楽、ビデオ、Web ページ)"/>
 	<button name="volume_btn" tool_tip="グローバル音量設定"/>
 </panel>
diff --git a/indra/newview/skins/minimal/xui/pt/notifications.xml b/indra/newview/skins/minimal/xui/pt/notifications.xml
index 9e5ff6fe60..69c4cb3b3e 100644
--- a/indra/newview/skins/minimal/xui/pt/notifications.xml
+++ b/indra/newview/skins/minimal/xui/pt/notifications.xml
@@ -9,7 +9,7 @@
 		</form>
 	</notification>
 	<notification name="ObjectGiveItem">
-		Um objeto chamado &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt;, de [NAME_SLURL], está lhe oferecendo &lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;.  Esta ação requer o modo Avançado. Passe para o modo Avançado e você verá o item em seu Inventário. Para passar para o modo Avançado, feche e reinicialize esse aplicativo e mude o modo (indicado na tela de login).
+		Um objeto chamado &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt;, de [NAME_SLURL], está oferecendo &lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt; a você. Esta ação requer o modo Avançado. Passe para o modo Avançado e você verá o item em seu Inventário. Para passar para o modo Avançado, feche e reinicialize esse aplicativo e mude o modo (indicado na tela de login).
 		<form name="form">
 			<button name="Keep" text="Guardar item"/>
 			<button name="Discard" text="Recusar item"/>
diff --git a/indra/newview/skins/minimal/xui/pt/panel_status_bar.xml b/indra/newview/skins/minimal/xui/pt/panel_status_bar.xml
index f7890ae57d..db564d2aaa 100644
--- a/indra/newview/skins/minimal/xui/pt/panel_status_bar.xml
+++ b/indra/newview/skins/minimal/xui/pt/panel_status_bar.xml
@@ -1,11 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="status">
-	<panel.string name="StatBarDaysOfWeek">
-		Domingo:Segunda-feira:Terça-feira:Quarta-feira:Quinta-feira:Sexta-feira:Sábado
-	</panel.string>
-	<panel.string name="StatBarMonthsOfYear">
-		Janeiro:Fevereiro:Março:Abril:Maio:Junho:Julho:Agosto:Setembro:Outubro:Novembro:Dezembro
-	</panel.string>
 	<panel.string name="packet_loss_tooltip">
 		Perda de pacote
 	</panel.string>
@@ -21,13 +15,10 @@
 	<panel.string name="buycurrencylabel">
 		L$ [AMT]
 	</panel.string>
-	<panel name="balance_bg">
-		<text name="balance" tool_tip="Atualizar saldo de L$" value="L$20"/>
-		<button label="Comprar L$" name="buyL" tool_tip="Comprar mais L$"/>
-	</panel>
-	<text name="TimeText" tool_tip="Hora atual (Pacífico)">
-		24:00 AM PST
-	</text>
+	<combo_box name="mode_combo" tool_tip="Selecione o modo. O modo Básico é mais rápido e ideal para explorar e conversar. Use o modo Avançado para acessar mais recursos.">
+		<combo_box.item label="Modo básico" name="Basic"/>
+		<combo_box.item label="Modo avançado" name="Advanced"/>
+	</combo_box>
 	<button name="media_toggle_btn" tool_tip="Tocar/Pausar todas mídias (música, vídeo, páginas web)"/>
 	<button name="volume_btn" tool_tip="Volume geral"/>
 </panel>
-- 
cgit v1.2.3


From c80df5ac39e31fb17fa8a1158cbea2de8faf0319 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 23 Sep 2011 18:00:35 +0300
Subject:  STORM-1612 FIXED Implemented click-to-walk in Advanced mode.

Changes:
* Click and double click in-world can now trigger click-to-walk or
  click-to-teleport actions, depending on preferences.
* Grouped keyboard- and mouse-related settings in Preferences -> Move.
---
 indra/newview/app_settings/settings.xml            |  11 ++
 indra/newview/llfloaterpreference.cpp              | 166 +++++++++++++--------
 indra/newview/llfloaterpreference.h                |  27 ++--
 indra/newview/lltoolpie.cpp                        | 157 ++++++++++++++-----
 indra/newview/lltoolpie.h                          |   8 +
 .../default/xui/en/panel_preferences_move.xml      | 148 ++++++++++++++----
 6 files changed, 384 insertions(+), 133 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 8804c40aff..5ffbbc6163 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -13564,6 +13564,17 @@
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
+      <integer>1</integer>
+    </map>
+    <key>ClickToTeleport</key>
+    <map>
+      <key>Comment</key>
+      <string>Click in world to teleport to location</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
       <integer>0</integer>
     </map>
     <key>ShowOfferedInventory</key>
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index d65928e385..5dd1cc3b97 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -304,7 +304,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
 	mOriginalIMViaEmail(false),
 	mLanguageChanged(false),
 	mAvatarDataInitialized(false),
-	mDoubleClickActionDirty(false)
+	mClickActionDirty(false)
 {
 	
 	//Build Floater is now Called from 	LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreference>);
@@ -348,8 +348,10 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
 	
 	sSkin = gSavedSettings.getString("SkinCurrent");
 
-	mCommitCallbackRegistrar.add("Pref.CommitDoubleClickChekbox",	boost::bind(&LLFloaterPreference::onDoubleClickCheckBox, this, _1));
-	mCommitCallbackRegistrar.add("Pref.CommitRadioDoubleClick",	boost::bind(&LLFloaterPreference::onDoubleClickRadio, this));
+	mCommitCallbackRegistrar.add("Pref.CommitClickToWalkCheckbox",		boost::bind(&LLFloaterPreference::onWalkCheckboxCommit, this));
+	mCommitCallbackRegistrar.add("Pref.CommitClickToTeleportCheckbox",	boost::bind(&LLFloaterPreference::onTeleportCheckboxCommit, this));
+	mCommitCallbackRegistrar.add("Pref.CommitWalkTriggerRadio",			boost::bind(&LLFloaterPreference::onWalkTriggerRadioCommit, this));
+	mCommitCallbackRegistrar.add("Pref.CommitTeleportTriggerRadio",		boost::bind(&LLFloaterPreference::onTeleportTriggerRadioCommit, this));
 
 	gSavedSettings.getControl("NameTagShowUsernames")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged,  _2));	
 	gSavedSettings.getControl("NameTagShowFriends")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged,  _2));	
@@ -439,8 +441,6 @@ BOOL LLFloaterPreference::postBuild()
 	if (!tabcontainer->selectTab(gSavedSettings.getS32("LastPrefTab")))
 		tabcontainer->selectFirstTab();
 
-	updateDoubleClickControls();
-
 	getChild<LLUICtrl>("cache_location")->setEnabled(FALSE); // make it read-only but selectable (STORM-227)
 	std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "");
 	setCacheLocation(cache_location);
@@ -581,10 +581,10 @@ void LLFloaterPreference::apply()
 
 	saveAvatarProperties();
 
-	if (mDoubleClickActionDirty)
+	if (mClickActionDirty)
 	{
-		updateDoubleClickSettings();
-		mDoubleClickActionDirty = false;
+		updateClickActionSettings();
+		mClickActionDirty = false;
 	}
 }
 
@@ -613,11 +613,12 @@ void LLFloaterPreference::cancel()
 	// reverts any changes to current skin
 	gSavedSettings.setString("SkinCurrent", sSkin);
 
-	if (mDoubleClickActionDirty)
+	if (mClickActionDirty)
 	{
-		updateDoubleClickControls();
-		mDoubleClickActionDirty = false;
+		updateClickActionControls();
+		mClickActionDirty = false;
 	}
+
 	LLFloaterPreferenceProxy * advanced_proxy_settings = LLFloaterReg::findTypedInstance<LLFloaterPreferenceProxy>("prefs_proxy");
 	if (advanced_proxy_settings)
 	{
@@ -681,6 +682,9 @@ void LLFloaterPreference::onOpen(const LLSD& key)
 
 	// Display selected maturity icons.
 	onChangeMaturity();
+
+	// Load (double-)click to walk/teleport settings.
+	updateClickActionControls();
 	
 	// Enabled/disabled popups, might have been changed by user actions
 	// while preferences floater was closed.
@@ -1503,72 +1507,116 @@ void LLFloaterPreference::onClickBlockList()
 	}
 }
 
-void LLFloaterPreference::onDoubleClickCheckBox(LLUICtrl* ctrl)
+void LLFloaterPreference::onClickProxySettings()
 {
-	if (!ctrl) return;
-	mDoubleClickActionDirty = true;
-	LLRadioGroup* radio_double_click_action = getChild<LLRadioGroup>("double_click_action");
-	if (!radio_double_click_action) return;
-	// select default value("teleport") in radio-group.
-	radio_double_click_action->setSelectedIndex(0);
-	// set radio-group enabled depending on state of checkbox
-	radio_double_click_action->setEnabled(ctrl->getValue());
+	LLFloaterReg::showInstance("prefs_proxy");
 }
 
-void LLFloaterPreference::onDoubleClickRadio()
+void LLFloaterPreference::onWalkCheckboxCommit()
 {
-	mDoubleClickActionDirty = true;
+	LLCheckBoxCtrl* walk_trigger_cb		= getChild<LLCheckBoxCtrl>("walk_to_chkbox");
+	LLRadioGroup* walk_trigger_radio	= getChild<LLRadioGroup>("walk_trigger_radio");
+	const bool checked = walk_trigger_cb->getValue().asBoolean();
+
+	mClickActionDirty = true;
+	walk_trigger_radio->setEnabled(checked);
+	if (checked)
+	{
+		fixWalkRadioValue(); // don't allow two actions on click or double click
+	}
 }
 
-void LLFloaterPreference::updateDoubleClickSettings()
+void LLFloaterPreference::onTeleportCheckboxCommit()
 {
-	LLCheckBoxCtrl* double_click_action_cb = getChild<LLCheckBoxCtrl>("double_click_chkbox");
-	if (!double_click_action_cb) return;
-	bool enable = double_click_action_cb->getValue().asBoolean();
+	LLCheckBoxCtrl* teleport_trigger_cb		= getChild<LLCheckBoxCtrl>("teleport_to_chkbox");
+	LLRadioGroup* teleport_trigger_radio	= getChild<LLRadioGroup>("teleport_trigger_radio");
+	const bool checked = teleport_trigger_cb->getValue().asBoolean();
 
-	LLRadioGroup* radio_double_click_action = getChild<LLRadioGroup>("double_click_action");
-	if (!radio_double_click_action) return;
-	
-	// enable double click radio-group depending on state of checkbox
-	radio_double_click_action->setEnabled(enable);
-	
-	if (!enable)
+	mClickActionDirty = true;
+	teleport_trigger_radio->setEnabled(checked);
+	if (checked)
 	{
-		// set double click action settings values to false if checkbox was unchecked
-		gSavedSettings.setBOOL("DoubleClickAutoPilot", false);
-		gSavedSettings.setBOOL("DoubleClickTeleport", false);
-	}
-	else
-	{
-		std::string selected = radio_double_click_action->getValue().asString();
-		bool teleport_selected = selected == "radio_teleport";
-		// set double click action settings values depending on chosen radio-button
-		gSavedSettings.setBOOL( "DoubleClickTeleport", teleport_selected );
-		gSavedSettings.setBOOL( "DoubleClickAutoPilot", !teleport_selected );
+		fixTeleportRadioValue(); // don't allow two actions on click or double click
 	}
 }
 
-void LLFloaterPreference::onClickProxySettings()
+void LLFloaterPreference::onWalkTriggerRadioCommit()
 {
-	LLFloaterReg::showInstance("prefs_proxy");
+	mClickActionDirty = true;
+	fixTeleportRadioValue();
+}
+
+void LLFloaterPreference::onTeleportTriggerRadioCommit()
+{
+	mClickActionDirty = true;
+	fixWalkRadioValue();
+}
+
+void LLFloaterPreference::fixWalkRadioValue()
+{
+	LLRadioGroup* walk_trigger_radio		= getChild<LLRadioGroup>("walk_trigger_radio");
+	LLRadioGroup* teleport_trigger_radio	= getChild<LLRadioGroup>("teleport_trigger_radio");
+
+	walk_trigger_radio->setSelectedIndex(!teleport_trigger_radio->getSelectedIndex());
+}
+
+
+void LLFloaterPreference::fixTeleportRadioValue()
+{
+	LLRadioGroup* walk_trigger_radio		= getChild<LLRadioGroup>("walk_trigger_radio");
+	LLRadioGroup* teleport_trigger_radio	= getChild<LLRadioGroup>("teleport_trigger_radio");
+
+	teleport_trigger_radio->setSelectedIndex(!walk_trigger_radio->getSelectedIndex());
+}
+
+void LLFloaterPreference::updateClickActionSettings()
+{
+	const bool walk_trigger_enabled = getChild<LLCheckBoxCtrl>("walk_to_chkbox")->getValue().asBoolean();
+	const bool teleport_trigger_enabled = getChild<LLCheckBoxCtrl>("teleport_to_chkbox")->getValue().asBoolean();
+
+	const bool walk_on_dbl_click = (bool) getChild<LLRadioGroup>("walk_trigger_radio")->getSelectedIndex();
+	const bool teleport_on_dbl_click = (bool) getChild<LLRadioGroup>("teleport_trigger_radio")->getSelectedIndex();
+
+	gSavedSettings.setBOOL("ClickToWalk", walk_trigger_enabled && !walk_on_dbl_click);
+	gSavedSettings.setBOOL("ClickToTeleport", teleport_trigger_enabled && !teleport_on_dbl_click);
+	gSavedSettings.setBOOL("DoubleClickAutoPilot", walk_trigger_enabled && walk_on_dbl_click);
+	gSavedSettings.setBOOL("DoubleClickTeleport", teleport_trigger_enabled && teleport_on_dbl_click);
 }
 
-void LLFloaterPreference::updateDoubleClickControls()
+void LLFloaterPreference::updateClickActionControls()
 {
-	// check is one of double-click actions settings enabled
-	bool double_click_action_enabled = gSavedSettings.getBOOL("DoubleClickAutoPilot") || gSavedSettings.getBOOL("DoubleClickTeleport");
-	LLCheckBoxCtrl* double_click_action_cb = getChild<LLCheckBoxCtrl>("double_click_chkbox");
-	if (double_click_action_cb)
+	LLCheckBoxCtrl* walk_trigger_cb		= getChild<LLCheckBoxCtrl>("walk_to_chkbox");
+	LLCheckBoxCtrl* teleport_trigger_cb	= getChild<LLCheckBoxCtrl>("teleport_to_chkbox");
+
+	LLRadioGroup* walk_trigger_radio		= getChild<LLRadioGroup>("walk_trigger_radio");
+	LLRadioGroup* teleport_trigger_radio	= getChild<LLRadioGroup>("teleport_trigger_radio");
+
+	const bool click_to_walk = gSavedSettings.getBOOL("ClickToWalk");
+	const bool click_to_teleport = gSavedSettings.getBOOL("ClickToTeleport");
+	const bool dbl_click_to_walk = gSavedSettings.getBOOL("DoubleClickAutoPilot");
+	const bool dbl_click_to_teleport = gSavedSettings.getBOOL("DoubleClickTeleport");
+
+	const bool walk_trigger_enabled = click_to_walk || dbl_click_to_walk;
+	const bool teleport_trigger_enabled = click_to_teleport || dbl_click_to_teleport;
+
+	walk_trigger_cb->setValue(walk_trigger_enabled);
+	teleport_trigger_cb->setValue(teleport_trigger_enabled);
+
+	walk_trigger_radio->setEnabled(walk_trigger_enabled);
+	walk_trigger_radio->setSelectedIndex(dbl_click_to_walk);
+
+	teleport_trigger_radio->setEnabled(teleport_trigger_enabled);
+	teleport_trigger_radio->setSelectedIndex(dbl_click_to_teleport);
+
+	// Make sure it doesn't look like there is more than one action per trigger.
+	if (teleport_trigger_enabled)
+	{
+		fixWalkRadioValue();
+	}
+	else
 	{
-		// check checkbox if one of double-click actions settings enabled, uncheck otherwise
-		double_click_action_cb->setValue(double_click_action_enabled);
+		fixTeleportRadioValue();
 	}
-	LLRadioGroup* double_click_action_radio = getChild<LLRadioGroup>("double_click_action");
-	if (!double_click_action_radio) return;
-	// set radio-group enabled if one of double-click actions settings enabled
-	double_click_action_radio->setEnabled(double_click_action_enabled);
-	// select button in radio-group depending on setting
-	double_click_action_radio->setSelectedIndex(gSavedSettings.getBOOL("DoubleClickAutoPilot"));
 }
 
 void LLFloaterPreference::applyUIColor(LLUICtrl* ctrl, const LLSD& param)
diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h
index ef9bc2dd53..b7263f0ac3 100644
--- a/indra/newview/llfloaterpreference.h
+++ b/indra/newview/llfloaterpreference.h
@@ -104,14 +104,23 @@ protected:
 	void setHardwareDefaults();
 	// callback for when client turns on shaders
 	void onVertexShaderEnable();
-	// callback for changing double click action checkbox
-	void onDoubleClickCheckBox(LLUICtrl* ctrl);
-	// callback for selecting double click action radio-button
-	void onDoubleClickRadio();
-	// updates double-click action settings depending on controls from preferences
-	void updateDoubleClickSettings();
-	// updates double-click action controls depending on values from settings.xml
-	void updateDoubleClickControls();
+
+	// callback for clicking the "Walk to Click Point" checkbox
+	void onWalkCheckboxCommit();
+	// callback for clicking the "Teleport to Click Point" checkbox
+	void onTeleportCheckboxCommit();
+	// callback for selecting trigger for "Walk to Click Point"
+	void onWalkTriggerRadioCommit();
+	// callback for selecting trigger for "Teleport to Click Point"
+	void onTeleportTriggerRadioCommit();
+	// make sure the radio buttons have mutually exclusive values
+	void fixWalkRadioValue();
+	// make sure the radio buttons have mutually exclusive values
+	void fixTeleportRadioValue();
+	// updates click/double-click action settings depending on controls values
+	void updateClickActionSettings();
+	// updates click/double-click action controls depending on values from settings.xml
+	void updateClickActionControls();
 	
 	// This function squirrels away the current values of the controls so that
 	// cancel() can restore them.	
@@ -166,7 +175,7 @@ private:
 	static std::string sSkin;
 	// set true if state of double-click action checkbox or radio-group was changed by user
 	// (reset back to false on apply or cancel)
-	bool mDoubleClickActionDirty;
+	bool mClickActionDirty; ///< Set to true when the click/double-click options get changed by user.
 	bool mGotPersonalInfo;
 	bool mOriginalIMViaEmail;
 	bool mLanguageChanged;
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index c38c8bad80..e614fe23d0 100644
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -35,7 +35,7 @@
 #include "llagent.h"
 #include "llagentcamera.h"
 #include "llavatarnamecache.h"
-#include "llviewercontrol.h"
+#include "lleventtimer.h"
 #include "llfocusmgr.h"
 #include "llfirstuse.h"
 #include "llfloaterland.h"
@@ -57,6 +57,7 @@
 #include "lltrans.h"
 #include "llviewercamera.h"
 #include "llviewerparcelmedia.h"
+#include "llviewercontrol.h"
 #include "llviewermenu.h"
 #include "llviewerobjectlist.h"
 #include "llviewerobject.h"
@@ -76,6 +77,41 @@ static void handle_click_action_play();
 static void handle_click_action_open_media(LLPointer<LLViewerObject> objectp);
 static ECursorType cursor_from_parcel_media(U8 click_action);
 
+/**
+ * Schedule teleport to the specified location when user clicks in world.
+ *
+ * Deferring teleport is needed for double-click-to-walk to work.
+ * If double click in the world view occurs, teleport gets canceled.
+ */
+class LLClickToTeleportTimer : public LLEventTimer
+{
+	LOG_CLASS(LLClickToTeleportTimer);
+public:
+	LLClickToTeleportTimer(const LLVector3d& pos);
+	~LLClickToTeleportTimer();
+	/*virtual*/ BOOL tick();
+
+private:
+	LLVector3d mTeleportPos;
+};
+
+LLClickToTeleportTimer::LLClickToTeleportTimer(const LLVector3d& pos)
+:	LLEventTimer(0.33) // should be greater than double click interval
+,	mTeleportPos(pos)
+{
+};
+
+LLClickToTeleportTimer::~LLClickToTeleportTimer()
+{
+	LLToolPie::instance().mClickToTeleportTimer = NULL;
+}
+
+BOOL LLClickToTeleportTimer::tick()
+{
+	lldebugs << "Teleporting to " << mTeleportPos << llendl;
+	gAgent.teleportViaLocationLookAt(mTeleportPos);
+	return TRUE; // destroy the timer
+}
 
 LLToolPie::LLToolPie()
 :	LLTool(std::string("Pie")),
@@ -84,6 +120,8 @@ LLToolPie::LLToolPie()
 	mMouseSteerX(-1),
 	mMouseSteerY(-1),
 	mBlockClickToWalk(false),
+	mBlockClickToTeleport(false),
+	mClickToTeleportTimer(NULL),
 	mClickAction(0),
 	mClickActionBuyEnabled( gSavedSettings.getBOOL("ClickActionBuyEnabled") ),
 	mClickActionPayEnabled( gSavedSettings.getBOOL("ClickActionPayEnabled") )
@@ -479,6 +517,18 @@ void LLToolPie::resetSelection()
 	mClickAction = 0;
 }
 
+void LLToolPie::walkToClickedLocation()
+{
+	if(mAutoPilotDestination) { mAutoPilotDestination->markDead(); }
+	mAutoPilotDestination = (LLHUDEffectBlob *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BLOB, FALSE);
+	mAutoPilotDestination->setPositionGlobal(mPick.mPosGlobal);
+	mAutoPilotDestination->setPixelSize(5);
+	mAutoPilotDestination->setColor(LLColor4U(170, 210, 190));
+	mAutoPilotDestination->setDuration(3.f);
+
+	handle_go_to();
+}
+
 // When we get object properties after left-clicking on an object
 // with left-click = buy, if it's the same object, do the buy.
 
@@ -637,44 +687,64 @@ BOOL LLToolPie::handleMouseUp(S32 x, S32 y, MASK mask)
 	mMouseButtonDown = false;
 
 	if (click_action == CLICK_ACTION_NONE				// not doing 1-click action
-		&& gSavedSettings.getBOOL("ClickToWalk")		// click to walk enabled
 		&& !gAgent.getFlying()							// don't auto-navigate while flying until that works
 		&& gAgentAvatarp
 		&& !gAgentAvatarp->isSitting()
-		&& !mBlockClickToWalk							// another behavior hasn't cancelled click to walk
 		&& !mPick.mPosGlobal.isExactlyZero()			// valid coordinates for pick
 		&& (mPick.mPickType == LLPickInfo::PICK_LAND	// we clicked on land
 			|| mPick.mObjectID.notNull()))				// or on an object
 	{
-		// handle special cases of steering picks
-		LLViewerObject* avatar_object = mPick.getObject();
-
-		// get pointer to avatar
-		while (avatar_object && !avatar_object->isAvatar())
+		if (gSavedSettings.getBOOL("ClickToWalk")
+			&& !mBlockClickToWalk)						// another behavior hasn't cancelled click to walk
 		{
-			avatar_object = (LLViewerObject*)avatar_object->getParent();
-		}
+			// handle special cases of steering picks
+			LLViewerObject* avatar_object = mPick.getObject();
 
-		if (avatar_object && ((LLVOAvatar*)avatar_object)->isSelf())
-		{
-			const F64 SELF_CLICK_WALK_DISTANCE = 3.0;
-			// pretend we picked some point a bit in front of avatar
-			mPick.mPosGlobal = gAgent.getPositionGlobal() + LLVector3d(LLViewerCamera::instance().getAtAxis()) * SELF_CLICK_WALK_DISTANCE;
+			// get pointer to avatar
+			while (avatar_object && !avatar_object->isAvatar())
+			{
+				avatar_object = (LLViewerObject*)avatar_object->getParent();
+			}
+
+			if (avatar_object && ((LLVOAvatar*)avatar_object)->isSelf())
+			{
+				const F64 SELF_CLICK_WALK_DISTANCE = 3.0;
+				// pretend we picked some point a bit in front of avatar
+				mPick.mPosGlobal = gAgent.getPositionGlobal() + LLVector3d(LLViewerCamera::instance().getAtAxis()) * SELF_CLICK_WALK_DISTANCE;
+			}
+			gAgentCamera.setFocusOnAvatar(TRUE, TRUE);
+			walkToClickedLocation();
+			LLFirstUse::notMoving(false);
+
+			return TRUE;
 		}
-		gAgentCamera.setFocusOnAvatar(TRUE, TRUE);
-		if(mAutoPilotDestination) { mAutoPilotDestination->markDead(); }
-		mAutoPilotDestination = (LLHUDEffectBlob *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BLOB, FALSE);
-		mAutoPilotDestination->setPositionGlobal(mPick.mPosGlobal);
-		mAutoPilotDestination->setPixelSize(5);
-		mAutoPilotDestination->setColor(LLColor4U(170, 210, 190));
-		mAutoPilotDestination->setDuration(3.f);
+		else if (gSavedSettings.getBOOL("ClickToTeleport") && !mBlockClickToTeleport)
+		{
+			LLViewerObject* objp = mPick.getObject();
+			LLViewerObject* parentp = objp ? objp->getRootEdit() : NULL;
 
-		handle_go_to();
-		LLFirstUse::notMoving(false);
+			bool is_in_world = mPick.mObjectID.notNull() && objp && !objp->isHUDAttachment();
+			bool is_land = mPick.mPickType == LLPickInfo::PICK_LAND;
+			bool has_touch_handler = (objp && objp->flagHandleTouch()) || (parentp && parentp->flagHandleTouch());
+			bool has_click_action = final_click_action(objp);
 
-		mBlockClickToWalk = false;
+			if (is_land || (is_in_world && !has_touch_handler && !has_click_action))
+			{
+				LLVector3d pos = mPick.mPosGlobal;
+				pos.mdV[VZ] += gAgentAvatarp->getPelvisToFoot();
 
-		return TRUE;
+				if (gSavedSettings.getBOOL("DoubleClickAutoPilot"))
+				{
+					// defer for more than the double click interval.
+					scheduleTeleport(pos);
+				}
+				else
+				{
+					gAgent.teleportViaLocationLookAt(pos);
+				}
+				return TRUE;
+			}
+		}
 	}
 	gViewerWindow->setCursor(UI_CURSOR_ARROW);
 	if (hasMouseCapture())
@@ -686,6 +756,7 @@ BOOL LLToolPie::handleMouseUp(S32 x, S32 y, MASK mask)
 	gAgentCamera.setLookAt(LOOKAT_TARGET_CONVERSATION, obj); // maybe look at object/person clicked on
 
 	mBlockClickToWalk = false;
+	mBlockClickToTeleport = false;
 	return LLTool::handleMouseUp(x, y, mask);
 }
 
@@ -706,18 +777,17 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask)
 		llinfos << "LLToolPie handleDoubleClick (becoming mouseDown)" << llendl;
 	}
 
+	cancelScheduledTeleport();
+
 	if (gSavedSettings.getBOOL("DoubleClickAutoPilot"))
 	{
-		if (mPick.mPickType == LLPickInfo::PICK_LAND
-			&& !mPick.mPosGlobal.isExactlyZero())
-		{
-			handle_go_to();
-			return TRUE;
-		}
-		else if (mPick.mObjectID.notNull()
-				 && !mPick.mPosGlobal.isExactlyZero())
+		// Avoid teleporting for the second time when user releases mouse button after double click.
+		mBlockClickToTeleport = true;
+
+		if ((mPick.mPickType == LLPickInfo::PICK_LAND && !mPick.mPosGlobal.isExactlyZero()) ||
+			(mPick.mObjectID.notNull()  && !mPick.mPosGlobal.isExactlyZero()))
 		{
-			handle_go_to();
+			walkToClickedLocation();
 			return TRUE;
 		}
 	}
@@ -1373,6 +1443,23 @@ bool LLToolPie::inCameraSteerMode()
 	return mMouseButtonDown && mMouseOutsideSlop && gSavedSettings.getBOOL("ClickToWalk");
 }
 
+void LLToolPie::scheduleTeleport(const LLVector3d& pos)
+{
+	// cancel previously scheduled teleport (if any)
+	cancelScheduledTeleport();
+
+	// and schedule new one
+	mClickToTeleportTimer = new LLClickToTeleportTimer(pos);
+}
+
+void LLToolPie::cancelScheduledTeleport()
+{
+	if (mClickToTeleportTimer)
+	{
+		delete mClickToTeleportTimer;
+	}
+}
+
 // true if x,y outside small box around start_x,start_y
 BOOL LLToolPie::outsideSlop(S32 x, S32 y, S32 start_x, S32 start_y)
 {
diff --git a/indra/newview/lltoolpie.h b/indra/newview/lltoolpie.h
index d7c79ee223..7e84170549 100644
--- a/indra/newview/lltoolpie.h
+++ b/indra/newview/lltoolpie.h
@@ -32,6 +32,7 @@
 #include "llviewerwindow.h" // for LLPickInfo
 #include "llhudeffectblob.h" // for LLPointer<LLHudEffectBlob>, apparently
 
+class LLClickToTeleportTimer;
 class LLViewerObject;
 class LLObjectSelection;
 
@@ -66,6 +67,7 @@ public:
 	LLViewerObject*		getClickActionObject() { return mClickActionObject; }
 	LLObjectSelection*	getLeftClickSelection() { return (LLObjectSelection*)mLeftClickSelection; }
 	void 				resetSelection();
+	void				walkToClickedLocation();
 	void				blockClickToWalk() { mBlockClickToWalk = true; }
 	void				stopClickToWalk();
 	
@@ -96,8 +98,12 @@ private:
 	void startCameraSteering();
 	void stopCameraSteering();
 	bool inCameraSteerMode();
+	void scheduleTeleport(const LLVector3d& pos);
+	void cancelScheduledTeleport();
 
 private:
+	friend class LLClickToTeleportTimer;
+
 	bool				mMouseButtonDown;
 	bool				mMouseOutsideSlop;		// for this drag, has mouse moved outside slop region
 	S32					mMouseDownX;
@@ -108,6 +114,8 @@ private:
 	LLPointer<LLHUDEffectBlob>	mMouseSteerGrabPoint;
 	bool				mClockwise;			
 	bool				mBlockClickToWalk;
+	bool				mBlockClickToTeleport;
+	LLClickToTeleportTimer*	mClickToTeleportTimer;
 	LLUUID				mMediaMouseCaptureID;
 	LLPickInfo			mPick;
 	LLPickInfo			mHoverPick;
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_move.xml b/indra/newview/skins/default/xui/en/panel_preferences_move.xml
index 1a8aae7f91..5a70acddeb 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_move.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_move.xml
@@ -105,16 +105,61 @@
 	 mouse_opaque="false"
 	 visible="true"
 	 width="18"
-   top_pad="2"
+   top_pad="10"
    left="30" />
+  <text
+   follows="left|top"
+   type="string"
+   length="1"
+   height="10"
+   layout="topleft"
+   left="78"
+   name="keyboard_lbl"
+   width="270"
+   top_delta="2">
+   Keyboard:
+  </text>
+  <check_box
+   control_name="ArrowKeysAlwaysMove"
+   follows="left|top"
+   height="20"
+   label="Arrow keys always move me"
+   layout="topleft"
+   left_delta="5"
+   name="arrow_keys_move_avatar_check"
+   width="237"
+   top_pad="5"/>
+  <check_box
+   control_name="AllowTapTapHoldRun"
+   follows="left|top"
+   height="20"
+   label="Tap-tap-hold to run"
+   layout="topleft"
+   left_delta="0"
+   name="tap_tap_hold_to_run"
+   width="237"
+   top_pad="0"/>
+  <text
+   follows="left|top"
+   type="string"
+   length="1"
+   height="10"
+   layout="topleft"
+   left="78"
+   name="mouse_lbl"
+   width="270"
+   top_pad="15">
+   Mouse:
+  </text>
   <check_box
    control_name="FirstPersonAvatarVisible"
    follows="left|top"
    height="20"
    label="Show me in Mouselook"
    layout="topleft"
-   left_pad="30"
+   left_delta="5"
    name="first_person_avatar_visible"
+   top_pad="5"
    width="256" />
   <text
    type="string"
@@ -136,7 +181,7 @@
    initial_value="2"
    layout="topleft"
    show_text="false"
-   left_pad="5"
+   left_pad="0"
    max_val="15"
    name="mouse_sensitivity"
    top_delta="-1"
@@ -150,62 +195,105 @@
    name="invert_mouse"
    top_delta="0"
    width="128" />
-  <check_box
-   control_name="ArrowKeysAlwaysMove"
+  <text
    follows="left|top"
-   height="20"
-   label="Arrow keys always move me"
+   type="string"
+   length="1"
+   height="10"
    layout="topleft"
-   left="78"
-   name="arrow_keys_move_avatar_check"
-   width="237"
-   top_pad="10"/>
+   left="259"
+   name="single_click_lbl"
+   width="100"
+   top_pad="10">
+   Single-Click
+  </text>
+  <text
+   follows="left|top"
+   type="string"
+   length="1"
+   height="10"
+   layout="topleft"
+   left="368"
+   name="double_click_lbl"
+   width="100"
+   top_delta="0">
+   Double-Click
+  </text>
   <check_box
-   control_name="AllowTapTapHoldRun"
    follows="left|top"
    height="20"
-   label="Tap-tap-hold to run"
+   label="Walk to Click Point:"
    layout="topleft"
-   left_delta="0"
-   name="tap_tap_hold_to_run"
+   left="83"
+   name="walk_to_chkbox"
    width="237"
-   top_pad="0"/>
+   top_pad="7">
+   <check_box.commit_callback
+    function="Pref.CommitClickToWalkCheckbox"/>
+  </check_box>
+  <radio_group
+   height="20"
+   layout="topleft"
+   left="280"
+   top_delta="3"
+   name="walk_trigger_radio"
+   width="200">
+    <radio_item
+     height="16"
+     label=""
+     layout="topleft"
+     left="0"
+     name="walk_single_click"
+     top_delta="20"
+     width="110" />
+    <radio_item
+     height="16"
+     label=""
+     left_pad="0"
+     layout="topleft"
+     name="walk_double_click"
+     top_delta="0"
+     width="75" />
+    <radio_group.commit_callback
+	     function="Pref.CommitWalkTriggerRadio"/>
+  </radio_group>
   <check_box
    follows="left|top"
    height="20"
-   label="Double-Click to:"
+   label="Teleport to Click Point:"
    layout="topleft"
-   left_delta="0"
-   name="double_click_chkbox"
+   left="83"
+   name="teleport_to_chkbox"
    width="237"
    top_pad="0">
    <check_box.commit_callback
-    function="Pref.CommitDoubleClickChekbox"/>
+    function="Pref.CommitClickToTeleportCheckbox"/>
   </check_box>
   <radio_group
-     height="20"
-     layout="topleft"
-     left_delta="17"
-     top_pad="2"
-     name="double_click_action">
+   height="20"
+   layout="topleft"
+   left="280"
+   top_delta="3"
+   name="teleport_trigger_radio"
+   width="200">
     <radio_item
      height="16"
-     label="Teleport"
+     label=""
      layout="topleft"
      left="0"
-     name="radio_teleport"
+     name="teleport_single_click"
      top_delta="20"
      width="110" />
     <radio_item
      height="16"
-     label="Auto-pilot"
+     label=""
      left_pad="0"
      layout="topleft"
-     name="radio_autopilot"
+     name="teleport_double_click"
      top_delta="0"
      width="75" />
     <radio_group.commit_callback
-	     function="Pref.CommitRadioDoubleClick"/>
+	     function="Pref.CommitTeleportTriggerRadio"/>
   </radio_group>
   <button
    height="23"
-- 
cgit v1.2.3


From bcdd0b52dd3f0b2e0f5d7310526dca79aea7b146 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 23 Sep 2011 21:46:55 +0300
Subject: STORM-1612 FOLLOWUP Trivial Windows compilation fix.

---
 indra/newview/lltoolpie.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index e614fe23d0..a05fc9536e 100644
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -96,7 +96,7 @@ private:
 };
 
 LLClickToTeleportTimer::LLClickToTeleportTimer(const LLVector3d& pos)
-:	LLEventTimer(0.33) // should be greater than double click interval
+:	LLEventTimer(0.33f) // should be greater than double click interval
 ,	mTeleportPos(pos)
 {
 };
-- 
cgit v1.2.3


From 7d6ea9814e51d818c176dfd5ed9a3ffc0a1737d1 Mon Sep 17 00:00:00 2001
From: "simon@Simon-PC.lindenlab.com" <simon@Simon-PC.lindenlab.com>
Date: Tue, 27 Sep 2011 09:32:36 -0700
Subject: ER-70:  from a sim bug, but object can also crash viewer.  Fixed
 NULL.  Reviewed by Kelly

---
 indra/llprimitive/llmaterialtable.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llprimitive/llmaterialtable.cpp b/indra/llprimitive/llmaterialtable.cpp
index 99f32e4109..b4539ebee9 100644
--- a/indra/llprimitive/llmaterialtable.cpp
+++ b/indra/llprimitive/llmaterialtable.cpp
@@ -538,7 +538,7 @@ std::string LLMaterialTable::getName(U8 mcode)
 		}
 	}
 
-	return NULL;
+	return std::string();
 }
 
 
-- 
cgit v1.2.3


From 503c8ab78980515e02e8e7cb411061cc0429062e Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Wed, 28 Sep 2011 15:51:08 -0700
Subject: VWR-27039 FIX FR linguistic

---
 .../newview/skins/default/xui/fr/panel_preferences_chat.xml  |  2 +-
 .../skins/default/xui/fr/panel_preferences_graphics1.xml     |  6 +++---
 .../skins/default/xui/fr/panel_preferences_privacy.xml       |  4 ++--
 indra/newview/skins/default/xui/fr/strings.xml               | 12 ++++++------
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_chat.xml b/indra/newview/skins/default/xui/fr/panel_preferences_chat.xml
index e9e6e6350f..1644eefbee 100644
--- a/indra/newview/skins/default/xui/fr/panel_preferences_chat.xml
+++ b/indra/newview/skins/default/xui/fr/panel_preferences_chat.xml
@@ -8,7 +8,7 @@
 		<radio_item label="Moyenne" name="radio2" value="1"/>
 		<radio_item label="Grande" name="radio3" value="2"/>
 	</radio_group>
-	<check_box initial_value="true" label="Jouer l&apos;animation clavier quand vous écrivez" name="play_typing_animation"/>
+	<check_box initial_value="true" label="Exécuter l&apos;animation clavier quand vous écrivez" name="play_typing_animation"/>
 	<check_box label="M&apos;envoyer les IM par e-mail une fois déconnecté" name="send_im_to_email"/>
 	<check_box label="Activer l&apos;historique des chats et des IM en texte brut" name="plain_text_chat_history"/>
 	<check_box label="Bulles de chat" name="bubble_text_chat"/>
diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/fr/panel_preferences_graphics1.xml
index 5bf2ef72f5..a738b2d43f 100644
--- a/indra/newview/skins/default/xui/fr/panel_preferences_graphics1.xml
+++ b/indra/newview/skins/default/xui/fr/panel_preferences_graphics1.xml
@@ -51,7 +51,7 @@
 			<combo_box.item label="Tous les objets et avatars" name="3"/>
 			<combo_box.item label="Tout" name="4"/>
 		</combo_box>
-		<slider label="Propriétés physiques de l&apos;avatar :" name="AvatarPhysicsDetail"/>
+		<slider label="Prop. physiques avatar :" name="AvatarPhysicsDetail"/>
 		<text name="AvatarPhysicsDetailText">
 			Faible
 		</text>
@@ -102,8 +102,8 @@
 			Rendu du terrain :
 		</text>
 		<radio_group name="TerrainDetailRadio">
-			<radio_item label="Bas" name="0"/>
-			<radio_item label="Haut" name="2"/>
+			<radio_item label="Faible" name="0"/>
+			<radio_item label="Élevé" name="2"/>
 		</radio_group>
 		--&gt;
 	</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/fr/panel_preferences_privacy.xml
index 202ec779f5..3123a4c6fe 100644
--- a/indra/newview/skins/default/xui/fr/panel_preferences_privacy.xml
+++ b/indra/newview/skins/default/xui/fr/panel_preferences_privacy.xml
@@ -3,9 +3,9 @@
 	<panel.string name="log_in_to_change">
 		se connecter pour changer
 	</panel.string>
-	<button label="Vider le cache" name="clear_cache" tool_tip="Effacer l&apos;image de connexion, le dernier lieu, l&apos;historique des téléportations et la texture du cache."/>
+	<button label="Vider l'historique" name="clear_cache" tool_tip="Effacer le cache de l&apos;image de connexion, du dernier lieu, de l&apos;historique des téléportations, Web et de texture."/>
 	<text name="cache_size_label_l">
-		(Endroits, images, web, historique des recherches)
+		(endroits, images, web, historique des recherches)
 	</text>
 	<check_box label="M&apos;afficher dans les résultats de recherche" name="online_searchresults"/>
 	<check_box label="Seuls mes amis et groupes voient quand je suis en ligne" name="online_visibility"/>
diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml
index 7d349f27a6..3a0553461a 100644
--- a/indra/newview/skins/default/xui/fr/strings.xml
+++ b/indra/newview/skins/default/xui/fr/strings.xml
@@ -2510,7 +2510,7 @@ Si ce message persiste, veuillez aller sur la page [SUPPORT_SITE].
 		Effet max.
 	</string>
 	<string name="Breast Physics InOut Spring">
-		Vibration
+		Élasticité
 	</string>
 	<string name="Breast Physics InOut Gain">
 		Amplification
@@ -2522,7 +2522,7 @@ Si ce message persiste, veuillez aller sur la page [SUPPORT_SITE].
 		Effet max.
 	</string>
 	<string name="Breast Physics UpDown Spring">
-		Vibration
+		Élasticité
 	</string>
 	<string name="Breast Physics UpDown Gain">
 		Amplification
@@ -2534,7 +2534,7 @@ Si ce message persiste, veuillez aller sur la page [SUPPORT_SITE].
 		Effet max.
 	</string>
 	<string name="Breast Physics LeftRight Spring">
-		Vibration
+		Élasticité
 	</string>
 	<string name="Breast Physics LeftRight Gain">
 		Amplification
@@ -2558,7 +2558,7 @@ Si ce message persiste, veuillez aller sur la page [SUPPORT_SITE].
 		Effet max.
 	</string>
 	<string name="Belly Physics UpDown Spring">
-		Vibration
+		Élasticité
 	</string>
 	<string name="Belly Physics UpDown Gain">
 		Amplification
@@ -2582,7 +2582,7 @@ Si ce message persiste, veuillez aller sur la page [SUPPORT_SITE].
 		Effet max.
 	</string>
 	<string name="Butt Physics UpDown Spring">
-		Vibration
+		Élasticité
 	</string>
 	<string name="Butt Physics UpDown Gain">
 		Amplification
@@ -2594,7 +2594,7 @@ Si ce message persiste, veuillez aller sur la page [SUPPORT_SITE].
 		Effet max.
 	</string>
 	<string name="Butt Physics LeftRight Spring">
-		Vibration
+		Élasticité
 	</string>
 	<string name="Butt Physics LeftRight Gain">
 		Amplification
-- 
cgit v1.2.3


From f6a8a2c5460c8f61b37154de01cd2f9575ef87de Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Thu, 29 Sep 2011 15:35:02 +0300
Subject: STORM-1612 WIP Implemented new click-to-walk/teleport preferences
 design.

---
 indra/newview/app_settings/settings.xml            |  11 --
 indra/newview/llfloaterpreference.cpp              | 103 ++--------------
 indra/newview/llfloaterpreference.h                |  16 +--
 indra/newview/lltoolpie.cpp                        | 127 +++-----------------
 indra/newview/lltoolpie.h                          |   7 --
 .../default/xui/en/panel_preferences_move.xml      | 132 ++++++++-------------
 6 files changed, 77 insertions(+), 319 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 5ffbbc6163..be4ec93946 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -13566,17 +13566,6 @@
       <key>Value</key>
       <integer>1</integer>
     </map>
-    <key>ClickToTeleport</key>
-    <map>
-      <key>Comment</key>
-      <string>Click in world to teleport to location</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>0</integer>
-    </map>
     <key>ShowOfferedInventory</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 5dd1cc3b97..9630d7b29f 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -348,10 +348,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
 	
 	sSkin = gSavedSettings.getString("SkinCurrent");
 
-	mCommitCallbackRegistrar.add("Pref.CommitClickToWalkCheckbox",		boost::bind(&LLFloaterPreference::onWalkCheckboxCommit, this));
-	mCommitCallbackRegistrar.add("Pref.CommitClickToTeleportCheckbox",	boost::bind(&LLFloaterPreference::onTeleportCheckboxCommit, this));
-	mCommitCallbackRegistrar.add("Pref.CommitWalkTriggerRadio",			boost::bind(&LLFloaterPreference::onWalkTriggerRadioCommit, this));
-	mCommitCallbackRegistrar.add("Pref.CommitTeleportTriggerRadio",		boost::bind(&LLFloaterPreference::onTeleportTriggerRadioCommit, this));
+	mCommitCallbackRegistrar.add("Pref.ClickActionChange",				boost::bind(&LLFloaterPreference::onClickActionChange, this));
 
 	gSavedSettings.getControl("NameTagShowUsernames")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged,  _2));	
 	gSavedSettings.getControl("NameTagShowFriends")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged,  _2));	
@@ -1512,111 +1509,29 @@ void LLFloaterPreference::onClickProxySettings()
 	LLFloaterReg::showInstance("prefs_proxy");
 }
 
-void LLFloaterPreference::onWalkCheckboxCommit()
-{
-	LLCheckBoxCtrl* walk_trigger_cb		= getChild<LLCheckBoxCtrl>("walk_to_chkbox");
-	LLRadioGroup* walk_trigger_radio	= getChild<LLRadioGroup>("walk_trigger_radio");
-	const bool checked = walk_trigger_cb->getValue().asBoolean();
-
-	mClickActionDirty = true;
-	walk_trigger_radio->setEnabled(checked);
-	if (checked)
-	{
-		fixWalkRadioValue(); // don't allow two actions on click or double click
-	}
-}
-
-void LLFloaterPreference::onTeleportCheckboxCommit()
-{
-	LLCheckBoxCtrl* teleport_trigger_cb		= getChild<LLCheckBoxCtrl>("teleport_to_chkbox");
-	LLRadioGroup* teleport_trigger_radio	= getChild<LLRadioGroup>("teleport_trigger_radio");
-	const bool checked = teleport_trigger_cb->getValue().asBoolean();
-
-	mClickActionDirty = true;
-	teleport_trigger_radio->setEnabled(checked);
-	if (checked)
-	{
-		fixTeleportRadioValue(); // don't allow two actions on click or double click
-	}
-}
-
-void LLFloaterPreference::onWalkTriggerRadioCommit()
-{
-	mClickActionDirty = true;
-	fixTeleportRadioValue();
-}
-
-void LLFloaterPreference::onTeleportTriggerRadioCommit()
+void LLFloaterPreference::onClickActionChange()
 {
 	mClickActionDirty = true;
-	fixWalkRadioValue();
-}
-
-void LLFloaterPreference::fixWalkRadioValue()
-{
-	LLRadioGroup* walk_trigger_radio		= getChild<LLRadioGroup>("walk_trigger_radio");
-	LLRadioGroup* teleport_trigger_radio	= getChild<LLRadioGroup>("teleport_trigger_radio");
-
-	walk_trigger_radio->setSelectedIndex(!teleport_trigger_radio->getSelectedIndex());
-}
-
-
-void LLFloaterPreference::fixTeleportRadioValue()
-{
-	LLRadioGroup* walk_trigger_radio		= getChild<LLRadioGroup>("walk_trigger_radio");
-	LLRadioGroup* teleport_trigger_radio	= getChild<LLRadioGroup>("teleport_trigger_radio");
-
-	teleport_trigger_radio->setSelectedIndex(!walk_trigger_radio->getSelectedIndex());
 }
 
 void LLFloaterPreference::updateClickActionSettings()
 {
-	const bool walk_trigger_enabled = getChild<LLCheckBoxCtrl>("walk_to_chkbox")->getValue().asBoolean();
-	const bool teleport_trigger_enabled = getChild<LLCheckBoxCtrl>("teleport_to_chkbox")->getValue().asBoolean();
-
-	const bool walk_on_dbl_click = (bool) getChild<LLRadioGroup>("walk_trigger_radio")->getSelectedIndex();
-	const bool teleport_on_dbl_click = (bool) getChild<LLRadioGroup>("teleport_trigger_radio")->getSelectedIndex();
+	const int single_clk_action = getChild<LLComboBox>("single_click_action_combo")->getValue().asInteger();
+	const int double_clk_action = getChild<LLComboBox>("double_click_action_combo")->getValue().asInteger();
 
-	gSavedSettings.setBOOL("ClickToWalk", walk_trigger_enabled && !walk_on_dbl_click);
-	gSavedSettings.setBOOL("ClickToTeleport", teleport_trigger_enabled && !teleport_on_dbl_click);
-	gSavedSettings.setBOOL("DoubleClickAutoPilot", walk_trigger_enabled && walk_on_dbl_click);
-	gSavedSettings.setBOOL("DoubleClickTeleport", teleport_trigger_enabled && teleport_on_dbl_click);
+	gSavedSettings.setBOOL("ClickToWalk",			single_clk_action == 1);
+	gSavedSettings.setBOOL("DoubleClickAutoPilot",	double_clk_action == 1);
+	gSavedSettings.setBOOL("DoubleClickTeleport",	double_clk_action == 2);
 }
 
 void LLFloaterPreference::updateClickActionControls()
 {
-	LLCheckBoxCtrl* walk_trigger_cb		= getChild<LLCheckBoxCtrl>("walk_to_chkbox");
-	LLCheckBoxCtrl* teleport_trigger_cb	= getChild<LLCheckBoxCtrl>("teleport_to_chkbox");
-
-	LLRadioGroup* walk_trigger_radio		= getChild<LLRadioGroup>("walk_trigger_radio");
-	LLRadioGroup* teleport_trigger_radio	= getChild<LLRadioGroup>("teleport_trigger_radio");
-
 	const bool click_to_walk = gSavedSettings.getBOOL("ClickToWalk");
-	const bool click_to_teleport = gSavedSettings.getBOOL("ClickToTeleport");
 	const bool dbl_click_to_walk = gSavedSettings.getBOOL("DoubleClickAutoPilot");
 	const bool dbl_click_to_teleport = gSavedSettings.getBOOL("DoubleClickTeleport");
 
-	const bool walk_trigger_enabled = click_to_walk || dbl_click_to_walk;
-	const bool teleport_trigger_enabled = click_to_teleport || dbl_click_to_teleport;
-
-	walk_trigger_cb->setValue(walk_trigger_enabled);
-	teleport_trigger_cb->setValue(teleport_trigger_enabled);
-
-	walk_trigger_radio->setEnabled(walk_trigger_enabled);
-	walk_trigger_radio->setSelectedIndex(dbl_click_to_walk);
-
-	teleport_trigger_radio->setEnabled(teleport_trigger_enabled);
-	teleport_trigger_radio->setSelectedIndex(dbl_click_to_teleport);
-
-	// Make sure it doesn't look like there is more than one action per trigger.
-	if (teleport_trigger_enabled)
-	{
-		fixWalkRadioValue();
-	}
-	else
-	{
-		fixTeleportRadioValue();
-	}
+	getChild<LLComboBox>("single_click_action_combo")->setValue((int)click_to_walk);
+	getChild<LLComboBox>("double_click_action_combo")->setValue(dbl_click_to_teleport ? 2 : (int)dbl_click_to_walk);
 }
 
 void LLFloaterPreference::applyUIColor(LLUICtrl* ctrl, const LLSD& param)
diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h
index b7263f0ac3..5c74e9f60c 100644
--- a/indra/newview/llfloaterpreference.h
+++ b/indra/newview/llfloaterpreference.h
@@ -105,18 +105,8 @@ protected:
 	// callback for when client turns on shaders
 	void onVertexShaderEnable();
 
-	// callback for clicking the "Walk to Click Point" checkbox
-	void onWalkCheckboxCommit();
-	// callback for clicking the "Teleport to Click Point" checkbox
-	void onTeleportCheckboxCommit();
-	// callback for selecting trigger for "Walk to Click Point"
-	void onWalkTriggerRadioCommit();
-	// callback for selecting trigger for "Teleport to Click Point"
-	void onTeleportTriggerRadioCommit();
-	// make sure the radio buttons have mutually exclusive values
-	void fixWalkRadioValue();
-	// make sure the radio buttons have mutually exclusive values
-	void fixTeleportRadioValue();
+	// callback for commit in the "Single click on land" and "Double click on land" comboboxes.
+	void onClickActionChange();
 	// updates click/double-click action settings depending on controls values
 	void updateClickActionSettings();
 	// updates click/double-click action controls depending on values from settings.xml
@@ -173,8 +163,6 @@ public:
 	static void refreshSkin(void* data);
 private:
 	static std::string sSkin;
-	// set true if state of double-click action checkbox or radio-group was changed by user
-	// (reset back to false on apply or cancel)
 	bool mClickActionDirty; ///< Set to true when the click/double-click options get changed by user.
 	bool mGotPersonalInfo;
 	bool mOriginalIMViaEmail;
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index a05fc9536e..b0d9bd5d70 100644
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -35,7 +35,6 @@
 #include "llagent.h"
 #include "llagentcamera.h"
 #include "llavatarnamecache.h"
-#include "lleventtimer.h"
 #include "llfocusmgr.h"
 #include "llfirstuse.h"
 #include "llfloaterland.h"
@@ -77,42 +76,6 @@ static void handle_click_action_play();
 static void handle_click_action_open_media(LLPointer<LLViewerObject> objectp);
 static ECursorType cursor_from_parcel_media(U8 click_action);
 
-/**
- * Schedule teleport to the specified location when user clicks in world.
- *
- * Deferring teleport is needed for double-click-to-walk to work.
- * If double click in the world view occurs, teleport gets canceled.
- */
-class LLClickToTeleportTimer : public LLEventTimer
-{
-	LOG_CLASS(LLClickToTeleportTimer);
-public:
-	LLClickToTeleportTimer(const LLVector3d& pos);
-	~LLClickToTeleportTimer();
-	/*virtual*/ BOOL tick();
-
-private:
-	LLVector3d mTeleportPos;
-};
-
-LLClickToTeleportTimer::LLClickToTeleportTimer(const LLVector3d& pos)
-:	LLEventTimer(0.33f) // should be greater than double click interval
-,	mTeleportPos(pos)
-{
-};
-
-LLClickToTeleportTimer::~LLClickToTeleportTimer()
-{
-	LLToolPie::instance().mClickToTeleportTimer = NULL;
-}
-
-BOOL LLClickToTeleportTimer::tick()
-{
-	lldebugs << "Teleporting to " << mTeleportPos << llendl;
-	gAgent.teleportViaLocationLookAt(mTeleportPos);
-	return TRUE; // destroy the timer
-}
-
 LLToolPie::LLToolPie()
 :	LLTool(std::string("Pie")),
 	mMouseButtonDown( false ),
@@ -120,8 +83,6 @@ LLToolPie::LLToolPie()
 	mMouseSteerX(-1),
 	mMouseSteerY(-1),
 	mBlockClickToWalk(false),
-	mBlockClickToTeleport(false),
-	mClickToTeleportTimer(NULL),
 	mClickAction(0),
 	mClickActionBuyEnabled( gSavedSettings.getBOOL("ClickActionBuyEnabled") ),
 	mClickActionPayEnabled( gSavedSettings.getBOOL("ClickActionPayEnabled") )
@@ -687,64 +648,35 @@ BOOL LLToolPie::handleMouseUp(S32 x, S32 y, MASK mask)
 	mMouseButtonDown = false;
 
 	if (click_action == CLICK_ACTION_NONE				// not doing 1-click action
+		&& gSavedSettings.getBOOL("ClickToWalk")		// click to walk enabled
 		&& !gAgent.getFlying()							// don't auto-navigate while flying until that works
 		&& gAgentAvatarp
 		&& !gAgentAvatarp->isSitting()
+		&& !mBlockClickToWalk							// another behavior hasn't cancelled click to walk
 		&& !mPick.mPosGlobal.isExactlyZero()			// valid coordinates for pick
 		&& (mPick.mPickType == LLPickInfo::PICK_LAND	// we clicked on land
 			|| mPick.mObjectID.notNull()))				// or on an object
 	{
-		if (gSavedSettings.getBOOL("ClickToWalk")
-			&& !mBlockClickToWalk)						// another behavior hasn't cancelled click to walk
-		{
-			// handle special cases of steering picks
-			LLViewerObject* avatar_object = mPick.getObject();
-
-			// get pointer to avatar
-			while (avatar_object && !avatar_object->isAvatar())
-			{
-				avatar_object = (LLViewerObject*)avatar_object->getParent();
-			}
-
-			if (avatar_object && ((LLVOAvatar*)avatar_object)->isSelf())
-			{
-				const F64 SELF_CLICK_WALK_DISTANCE = 3.0;
-				// pretend we picked some point a bit in front of avatar
-				mPick.mPosGlobal = gAgent.getPositionGlobal() + LLVector3d(LLViewerCamera::instance().getAtAxis()) * SELF_CLICK_WALK_DISTANCE;
-			}
-			gAgentCamera.setFocusOnAvatar(TRUE, TRUE);
-			walkToClickedLocation();
-			LLFirstUse::notMoving(false);
+		// handle special cases of steering picks
+		LLViewerObject* avatar_object = mPick.getObject();
 
-			return TRUE;
-		}
-		else if (gSavedSettings.getBOOL("ClickToTeleport") && !mBlockClickToTeleport)
+		// get pointer to avatar
+		while (avatar_object && !avatar_object->isAvatar())
 		{
-			LLViewerObject* objp = mPick.getObject();
-			LLViewerObject* parentp = objp ? objp->getRootEdit() : NULL;
-
-			bool is_in_world = mPick.mObjectID.notNull() && objp && !objp->isHUDAttachment();
-			bool is_land = mPick.mPickType == LLPickInfo::PICK_LAND;
-			bool has_touch_handler = (objp && objp->flagHandleTouch()) || (parentp && parentp->flagHandleTouch());
-			bool has_click_action = final_click_action(objp);
-
-			if (is_land || (is_in_world && !has_touch_handler && !has_click_action))
-			{
-				LLVector3d pos = mPick.mPosGlobal;
-				pos.mdV[VZ] += gAgentAvatarp->getPelvisToFoot();
+			avatar_object = (LLViewerObject*)avatar_object->getParent();
+		}
 
-				if (gSavedSettings.getBOOL("DoubleClickAutoPilot"))
-				{
-					// defer for more than the double click interval.
-					scheduleTeleport(pos);
-				}
-				else
-				{
-					gAgent.teleportViaLocationLookAt(pos);
-				}
-				return TRUE;
-			}
+		if (avatar_object && ((LLVOAvatar*)avatar_object)->isSelf())
+		{
+			const F64 SELF_CLICK_WALK_DISTANCE = 3.0;
+			// pretend we picked some point a bit in front of avatar
+			mPick.mPosGlobal = gAgent.getPositionGlobal() + LLVector3d(LLViewerCamera::instance().getAtAxis()) * SELF_CLICK_WALK_DISTANCE;
 		}
+		gAgentCamera.setFocusOnAvatar(TRUE, TRUE);
+		walkToClickedLocation();
+		LLFirstUse::notMoving(false);
+
+		return TRUE;
 	}
 	gViewerWindow->setCursor(UI_CURSOR_ARROW);
 	if (hasMouseCapture())
@@ -756,7 +688,6 @@ BOOL LLToolPie::handleMouseUp(S32 x, S32 y, MASK mask)
 	gAgentCamera.setLookAt(LOOKAT_TARGET_CONVERSATION, obj); // maybe look at object/person clicked on
 
 	mBlockClickToWalk = false;
-	mBlockClickToTeleport = false;
 	return LLTool::handleMouseUp(x, y, mask);
 }
 
@@ -777,13 +708,8 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask)
 		llinfos << "LLToolPie handleDoubleClick (becoming mouseDown)" << llendl;
 	}
 
-	cancelScheduledTeleport();
-
 	if (gSavedSettings.getBOOL("DoubleClickAutoPilot"))
 	{
-		// Avoid teleporting for the second time when user releases mouse button after double click.
-		mBlockClickToTeleport = true;
-
 		if ((mPick.mPickType == LLPickInfo::PICK_LAND && !mPick.mPosGlobal.isExactlyZero()) ||
 			(mPick.mObjectID.notNull()  && !mPick.mPosGlobal.isExactlyZero()))
 		{
@@ -1443,23 +1369,6 @@ bool LLToolPie::inCameraSteerMode()
 	return mMouseButtonDown && mMouseOutsideSlop && gSavedSettings.getBOOL("ClickToWalk");
 }
 
-void LLToolPie::scheduleTeleport(const LLVector3d& pos)
-{
-	// cancel previously scheduled teleport (if any)
-	cancelScheduledTeleport();
-
-	// and schedule new one
-	mClickToTeleportTimer = new LLClickToTeleportTimer(pos);
-}
-
-void LLToolPie::cancelScheduledTeleport()
-{
-	if (mClickToTeleportTimer)
-	{
-		delete mClickToTeleportTimer;
-	}
-}
-
 // true if x,y outside small box around start_x,start_y
 BOOL LLToolPie::outsideSlop(S32 x, S32 y, S32 start_x, S32 start_y)
 {
diff --git a/indra/newview/lltoolpie.h b/indra/newview/lltoolpie.h
index 7e84170549..68fe8bc4a5 100644
--- a/indra/newview/lltoolpie.h
+++ b/indra/newview/lltoolpie.h
@@ -32,7 +32,6 @@
 #include "llviewerwindow.h" // for LLPickInfo
 #include "llhudeffectblob.h" // for LLPointer<LLHudEffectBlob>, apparently
 
-class LLClickToTeleportTimer;
 class LLViewerObject;
 class LLObjectSelection;
 
@@ -98,12 +97,8 @@ private:
 	void startCameraSteering();
 	void stopCameraSteering();
 	bool inCameraSteerMode();
-	void scheduleTeleport(const LLVector3d& pos);
-	void cancelScheduledTeleport();
 
 private:
-	friend class LLClickToTeleportTimer;
-
 	bool				mMouseButtonDown;
 	bool				mMouseOutsideSlop;		// for this drag, has mouse moved outside slop region
 	S32					mMouseDownX;
@@ -114,8 +109,6 @@ private:
 	LLPointer<LLHUDEffectBlob>	mMouseSteerGrabPoint;
 	bool				mClockwise;			
 	bool				mBlockClickToWalk;
-	bool				mBlockClickToTeleport;
-	LLClickToTeleportTimer*	mClickToTeleportTimer;
 	LLUUID				mMediaMouseCaptureID;
 	LLPickInfo			mPick;
 	LLPickInfo			mHoverPick;
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_move.xml b/indra/newview/skins/default/xui/en/panel_preferences_move.xml
index 5a70acddeb..cb547d7c6b 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_move.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_move.xml
@@ -201,100 +201,64 @@
    length="1"
    height="10"
    layout="topleft"
-   left="259"
-   name="single_click_lbl"
-   width="100"
-   top_pad="10">
-   Single-Click
+   left="86"
+   name="single_click_action_lbl"
+   width="150"
+   top_pad="20">
+   Single click on land:
   </text>
+  <combo_box
+   height="23"
+   layout="topleft"
+   left_pad="10"
+   top_delta="-6"
+   name="single_click_action_combo"
+   width="200">
+    <combo_box.item
+     label="No action"
+     name="0"
+     value="0"/>
+    <combo_box.item
+     label="Move to clicked point"
+     name="1"
+     value="1"/>
+    <combo_box.commit_callback
+     function="Pref.ClickActionChange"/>
+  </combo_box>
   <text
    follows="left|top"
    type="string"
    length="1"
    height="10"
    layout="topleft"
-   left="368"
-   name="double_click_lbl"
-   width="100"
-   top_delta="0">
-   Double-Click
+   left="86"
+   name="double_click_action_lbl"
+   width="150"
+   top_pad="12">
+   Double click on land:
   </text>
-  <check_box
-   follows="left|top"
-   height="20"
-   label="Walk to Click Point:"
-   layout="topleft"
-   left="83"
-   name="walk_to_chkbox"
-   width="237"
-   top_pad="7">
-   <check_box.commit_callback
-    function="Pref.CommitClickToWalkCheckbox"/>
-  </check_box>
-  <radio_group
-   height="20"
-   layout="topleft"
-   left="280"
-   top_delta="3"
-   name="walk_trigger_radio"
-   width="200">
-    <radio_item
-     height="16"
-     label=""
-     layout="topleft"
-     left="0"
-     name="walk_single_click"
-     top_delta="20"
-     width="110" />
-    <radio_item
-     height="16"
-     label=""
-     left_pad="0"
-     layout="topleft"
-     name="walk_double_click"
-     top_delta="0"
-     width="75" />
-    <radio_group.commit_callback
-	     function="Pref.CommitWalkTriggerRadio"/>
-  </radio_group>
-  <check_box
-   follows="left|top"
-   height="20"
-   label="Teleport to Click Point:"
-   layout="topleft"
-   left="83"
-   name="teleport_to_chkbox"
-   width="237"
-   top_pad="0">
-   <check_box.commit_callback
-    function="Pref.CommitClickToTeleportCheckbox"/>
-  </check_box>
-  <radio_group
-   height="20"
+  <combo_box
+   height="23"
    layout="topleft"
-   left="280"
-   top_delta="3"
-   name="teleport_trigger_radio"
+   left_pad="10"
+   top_delta="-6"
+   name="double_click_action_combo"
    width="200">
-    <radio_item
-     height="16"
-     label=""
-     layout="topleft"
-     left="0"
-     name="teleport_single_click"
-     top_delta="20"
-     width="110" />
-    <radio_item
-     height="16"
-     label=""
-     left_pad="0"
-     layout="topleft"
-     name="teleport_double_click"
-     top_delta="0"
-     width="75" />
-    <radio_group.commit_callback
-	     function="Pref.CommitTeleportTriggerRadio"/>
-  </radio_group>
+    <combo_box.item
+     label="No action"
+     name="0"
+     value="0"/>
+    <combo_box.item
+     label="Move to clicked point"
+     name="1"
+     value="1"/>
+    <combo_box.item
+     label="Teleport to clicked point"
+     name="2"
+     value="2"/>
+    <combo_box.commit_callback
+     function="Pref.ClickActionChange"/>
+  </combo_box>
   <button
    height="23"
    label="Other Devices"
-- 
cgit v1.2.3


From 71362ea705f60eb4fdc38cc7a0f3535cb1028800 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Fri, 30 Sep 2011 13:18:49 -0700
Subject: sync with viewer-development

---
 .../newview/skins/default/xui/en/floater_about.xml |   6 +-
 .../default/xui/en/panel_preferences_move.xml      | 162 ++++++++++++++-------
 .../skins/default/xui/en/sidepanel_task_info.xml   |   2 +-
 indra/newview/skins/default/xui/en/strings.xml     |   2 +-
 4 files changed, 114 insertions(+), 58 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml
index 3dd394bac1..2580c06344 100644
--- a/indra/newview/skins/default/xui/en/floater_about.xml
+++ b/indra/newview/skins/default/xui/en/floater_about.xml
@@ -23,7 +23,7 @@ Built with [COMPILER] version [COMPILER_VERSION]
      name="AboutPosition">
 You are at [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] in [REGION] located at &lt;nolink&gt;[HOSTNAME]&lt;/nolink&gt; ([HOSTIP])
 [SERVER_VERSION]
-[[SERVER_RELEASE_NOTES_URL] [ReleaseNotes]]
+[SERVER_RELEASE_NOTES_URL]
 
 </floater.string>
   <!-- *NOTE: Do not translate text like GPU, Graphics Card, etc -
@@ -58,6 +58,10 @@ Voice Server Version: [VOICE_VERSION]
   <floater.string
      name="AboutTraffic">
 Packets Lost: [PACKETS_LOST,number,0]/[PACKETS_IN,number,0] ([PACKETS_PCT,number,1]%)
+</floater.string>
+<floater.string
+     name="ErrorFetchingServerReleaseNotesURL">
+Error fetching server release notes URL.
 </floater.string>
   <tab_container
     follows="all" 
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_move.xml b/indra/newview/skins/default/xui/en/panel_preferences_move.xml
index 1a8aae7f91..cb547d7c6b 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_move.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_move.xml
@@ -105,16 +105,61 @@
 	 mouse_opaque="false"
 	 visible="true"
 	 width="18"
-   top_pad="2"
+   top_pad="10"
    left="30" />
+  <text
+   follows="left|top"
+   type="string"
+   length="1"
+   height="10"
+   layout="topleft"
+   left="78"
+   name="keyboard_lbl"
+   width="270"
+   top_delta="2">
+   Keyboard:
+  </text>
+  <check_box
+   control_name="ArrowKeysAlwaysMove"
+   follows="left|top"
+   height="20"
+   label="Arrow keys always move me"
+   layout="topleft"
+   left_delta="5"
+   name="arrow_keys_move_avatar_check"
+   width="237"
+   top_pad="5"/>
+  <check_box
+   control_name="AllowTapTapHoldRun"
+   follows="left|top"
+   height="20"
+   label="Tap-tap-hold to run"
+   layout="topleft"
+   left_delta="0"
+   name="tap_tap_hold_to_run"
+   width="237"
+   top_pad="0"/>
+  <text
+   follows="left|top"
+   type="string"
+   length="1"
+   height="10"
+   layout="topleft"
+   left="78"
+   name="mouse_lbl"
+   width="270"
+   top_pad="15">
+   Mouse:
+  </text>
   <check_box
    control_name="FirstPersonAvatarVisible"
    follows="left|top"
    height="20"
    label="Show me in Mouselook"
    layout="topleft"
-   left_pad="30"
+   left_delta="5"
    name="first_person_avatar_visible"
+   top_pad="5"
    width="256" />
   <text
    type="string"
@@ -136,7 +181,7 @@
    initial_value="2"
    layout="topleft"
    show_text="false"
-   left_pad="5"
+   left_pad="0"
    max_val="15"
    name="mouse_sensitivity"
    top_delta="-1"
@@ -150,63 +195,70 @@
    name="invert_mouse"
    top_delta="0"
    width="128" />
-  <check_box
-   control_name="ArrowKeysAlwaysMove"
+  <text
    follows="left|top"
-   height="20"
-   label="Arrow keys always move me"
+   type="string"
+   length="1"
+   height="10"
    layout="topleft"
-   left="78"
-   name="arrow_keys_move_avatar_check"
-   width="237"
-   top_pad="10"/>
-  <check_box
-   control_name="AllowTapTapHoldRun"
-   follows="left|top"
-   height="20"
-   label="Tap-tap-hold to run"
+   left="86"
+   name="single_click_action_lbl"
+   width="150"
+   top_pad="20">
+   Single click on land:
+  </text>
+  <combo_box
+   height="23"
    layout="topleft"
-   left_delta="0"
-   name="tap_tap_hold_to_run"
-   width="237"
-   top_pad="0"/>
-  <check_box
+   left_pad="10"
+   top_delta="-6"
+   name="single_click_action_combo"
+   width="200">
+    <combo_box.item
+     label="No action"
+     name="0"
+     value="0"/>
+    <combo_box.item
+     label="Move to clicked point"
+     name="1"
+     value="1"/>
+    <combo_box.commit_callback
+     function="Pref.ClickActionChange"/>
+  </combo_box>
+  <text
    follows="left|top"
-   height="20"
-   label="Double-Click to:"
+   type="string"
+   length="1"
+   height="10"
    layout="topleft"
-   left_delta="0"
-   name="double_click_chkbox"
-   width="237"
-   top_pad="0">
-   <check_box.commit_callback
-    function="Pref.CommitDoubleClickChekbox"/>
-  </check_box>
-  <radio_group
-     height="20"
-     layout="topleft"
-     left_delta="17"
-     top_pad="2"
-     name="double_click_action">
-    <radio_item
-     height="16"
-     label="Teleport"
-     layout="topleft"
-     left="0"
-     name="radio_teleport"
-     top_delta="20"
-     width="110" />
-    <radio_item
-     height="16"
-     label="Auto-pilot"
-     left_pad="0"
-     layout="topleft"
-     name="radio_autopilot"
-     top_delta="0"
-     width="75" />
-    <radio_group.commit_callback
-	     function="Pref.CommitRadioDoubleClick"/>
-  </radio_group>
+   left="86"
+   name="double_click_action_lbl"
+   width="150"
+   top_pad="12">
+   Double click on land:
+  </text>
+  <combo_box
+   height="23"
+   layout="topleft"
+   left_pad="10"
+   top_delta="-6"
+   name="double_click_action_combo"
+   width="200">
+    <combo_box.item
+     label="No action"
+     name="0"
+     value="0"/>
+    <combo_box.item
+     label="Move to clicked point"
+     name="1"
+     value="1"/>
+    <combo_box.item
+     label="Teleport to clicked point"
+     name="2"
+     value="2"/>
+    <combo_box.commit_callback
+     function="Pref.ClickActionChange"/>
+  </combo_box>
   <button
    height="23"
    label="Other Devices"
diff --git a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml
index c2394a3fa2..6600339ad7 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml
@@ -55,7 +55,7 @@
                 Mixed Sale
             </panel.string>
     <button
-     follows="top|right"
+     follows="top|left"
      height="24"
      image_hover_unselected="BackButton_Over"
      image_pressed="BackButton_Press"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 5d2db8cc4c..a41330c9f6 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -3439,7 +3439,7 @@ Abuse Report</string>
   <string name="Female - Stick tougue out">Female - Stick tougue out</string>
   <string name="Female - Wow">Female - Wow</string>
 
-  <string name="/bow1">/bow1</string>
+  <string name="/bow">/bow</string>
   <string name="/clap">/clap</string>
   <string name="/count">/count</string>
   <string name="/extinguish">/extinguish</string>
-- 
cgit v1.2.3


From e033824f8a8782f2da2e5dd71f5703fc4cf7915b Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Fri, 30 Sep 2011 13:26:25 -0700
Subject: WIP INTL-46 Update translation for Traditional Chinese

---
 .../skins/default/xui/zh/floater_about_land.xml    |  80 ++++-----
 .../default/xui/zh/floater_animation_preview.xml   |   4 +-
 .../skins/default/xui/zh/floater_build_options.xml |   4 +-
 .../newview/skins/default/xui/zh/floater_bumps.xml |   2 +-
 .../skins/default/xui/zh/floater_buy_currency.xml  |   2 +-
 .../skins/default/xui/zh/floater_buy_land.xml      |   6 +-
 .../skins/default/xui/zh/floater_critical.xml      |   2 +-
 .../default/xui/zh/floater_day_cycle_options.xml   |   2 +-
 .../skins/default/xui/zh/floater_display_name.xml  |   6 +-
 .../skins/default/xui/zh/floater_image_preview.xml |  14 +-
 .../skins/default/xui/zh/floater_incoming_call.xml |   4 +-
 .../skins/default/xui/zh/floater_inspect.xml       |   6 +-
 .../xui/zh/floater_inventory_view_finder.xml       |   2 +-
 .../skins/default/xui/zh/floater_outgoing_call.xml |   6 +-
 .../default/xui/zh/floater_preview_animation.xml   |   4 +-
 .../skins/default/xui/zh/floater_preview_sound.xml |   4 +-
 .../skins/default/xui/zh/floater_texture_ctrl.xml  |   2 +-
 .../newview/skins/default/xui/zh/floater_tools.xml |  52 +++---
 .../skins/default/xui/zh/floater_url_entry.xml     |   2 +-
 .../default/xui/zh/floater_voice_controls.xml      |   6 +-
 .../skins/default/xui/zh/menu_inventory.xml        |  28 +--
 .../default/xui/zh/menu_inventory_gear_default.xml |   2 +-
 indra/newview/skins/default/xui/zh/menu_viewer.xml | 103 +++++------
 indra/newview/skins/default/xui/zh/mime_types.xml  |   8 +-
 .../skins/default/xui/zh/mime_types_linux.xml      |   8 +-
 .../skins/default/xui/zh/mime_types_mac.xml        |   4 +-
 .../newview/skins/default/xui/zh/notifications.xml | 196 ++++++++++-----------
 .../skins/default/xui/zh/panel_bottomtray.xml      |   2 +-
 .../skins/default/xui/zh/panel_edit_alpha.xml      |  10 +-
 .../skins/default/xui/zh/panel_edit_eyes.xml       |   2 +-
 .../skins/default/xui/zh/panel_edit_gloves.xml     |   2 +-
 .../skins/default/xui/zh/panel_edit_hair.xml       |   2 +-
 .../skins/default/xui/zh/panel_edit_jacket.xml     |   4 +-
 .../skins/default/xui/zh/panel_edit_pants.xml      |   2 +-
 .../skins/default/xui/zh/panel_edit_profile.xml    |   4 +-
 .../skins/default/xui/zh/panel_edit_shirt.xml      |   2 +-
 .../skins/default/xui/zh/panel_edit_shoes.xml      |   2 +-
 .../skins/default/xui/zh/panel_edit_skin.xml       |   6 +-
 .../skins/default/xui/zh/panel_edit_skirt.xml      |   2 +-
 .../skins/default/xui/zh/panel_edit_socks.xml      |   2 +-
 .../skins/default/xui/zh/panel_edit_tattoo.xml     |   4 +-
 .../skins/default/xui/zh/panel_edit_underpants.xml |   2 +-
 .../skins/default/xui/zh/panel_edit_undershirt.xml |   2 +-
 .../skins/default/xui/zh/panel_group_general.xml   |   4 +-
 .../default/xui/zh/panel_group_land_money.xml      |   6 +-
 .../skins/default/xui/zh/panel_main_inventory.xml  |   2 +-
 .../xui/zh/panel_media_settings_general.xml        |   4 +-
 .../xui/zh/panel_media_settings_permissions.xml    |   6 +-
 .../skins/default/xui/zh/panel_my_profile.xml      |   2 +-
 indra/newview/skins/default/xui/zh/panel_notes.xml |   4 +-
 .../default/xui/zh/panel_outfits_inventory.xml     |   2 +-
 .../newview/skins/default/xui/zh/panel_people.xml  |   2 +-
 .../skins/default/xui/zh/panel_place_profile.xml   |   6 +-
 .../default/xui/zh/panel_preferences_graphics1.xml |   4 +-
 .../default/xui/zh/panel_preferences_move.xml      |   2 +-
 .../default/xui/zh/panel_preferences_privacy.xml   |   2 +-
 .../default/xui/zh/panel_prim_media_controls.xml   |  14 +-
 .../skins/default/xui/zh/panel_profile_view.xml    |   8 +-
 .../skins/default/xui/zh/panel_region_general.xml  |   2 +-
 .../skins/default/xui/zh/panel_region_terrain.xml  |  14 +-
 .../skins/default/xui/zh/panel_script_ed.xml       |   2 +-
 .../skins/default/xui/zh/panel_side_tray.xml       |   2 +-
 .../newview/skins/default/xui/zh/role_actions.xml  |   4 +-
 .../skins/default/xui/zh/sidepanel_inventory.xml   |   6 +-
 .../skins/default/xui/zh/sidepanel_task_info.xml   |  16 +-
 indra/newview/skins/default/xui/zh/strings.xml     | 140 +++++++--------
 66 files changed, 432 insertions(+), 431 deletions(-)

diff --git a/indra/newview/skins/default/xui/zh/floater_about_land.xml b/indra/newview/skins/default/xui/zh/floater_about_land.xml
index e59a23fda0..2568d492f0 100644
--- a/indra/newview/skins/default/xui/zh/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/zh/floater_about_land.xml
@@ -90,19 +90,19 @@
 				群組:
 			</text>
 			<button label="設定" name="Set..."/>
-			<check_box label="Allow Deed to Group" name="check deed" tool_tip="A group officer can deed this land to the group, so it will be supported by the group&apos;s land allocation."/>
-			<button label="Deed" name="Deed..." tool_tip="You may only deed land if you are an officer in the selected group."/>
+			<check_box label="允許讓渡給群組" name="check deed" tool_tip="A group officer can deed this land to the group, so it will be supported by the group&apos;s land allocation."/>
+			<button label="讓渡" name="Deed..." tool_tip="You may only deed land if you are an officer in the selected group."/>
 			<check_box label="Owner Makes Contribution With Deed" name="check contrib" tool_tip="When the land is deeded to the group, the former owner contributes enough land allocation to support it."/>
 			<text name="For Sale:">
 				出售:
 			</text>
 			<text name="Not for sale.">
-				Not for sale
+				不出售
 			</text>
 			<text name="For Sale: Price L$[PRICE].">
 				Price: L$[PRICE] (L$[PRICE_PER_SQM]/m²)
 			</text>
-			<button label="Sell Land" name="Sell Land..."/>
+			<button label="出售土地" name="Sell Land..."/>
 			<text name="For sale to">
 				出售給:[BUYER]
 			</text>
@@ -134,7 +134,7 @@
 			<button label="購買土地" name="Buy Land..."/>
 			<button label="腳本資訊" name="Scripts..."/>
 			<button label="為群組購買" name="Buy For Group..."/>
-			<button label="購買通行權" name="Buy Pass..." tool_tip="A pass gives you temporary access to this land."/>
+			<button label="購買通行權" name="Buy Pass..." tool_tip="通行權允許你暫時可出入這塊土地。"/>
 			<button label="放棄土地" name="Abandon Land..."/>
 			<button label="Reclaim Land" name="Reclaim Land..."/>
 			<button label="Linden Sale" name="Linden Sale..." tool_tip="Land must be owned, set content, and not already for auction."/>
@@ -212,31 +212,31 @@
 				Region Object Bonus Factor: [BONUS]
 			</text>
 			<text name="Simulator primitive usage:">
-				Primitive usage:
+				幾何元件使用:
 			</text>
 			<text name="objects_available">
-				[COUNT] out of [MAX] ([AVAILABLE] available)
+				使用 [MAX] 中的 [COUNT] (剩餘 [AVAILABLE] 可用)
 			</text>
 			<text name="Primitives parcel supports:">
-				Prims parcel supports:
+				地段所提供的幾何元件數:
 			</text>
 			<text name="object_contrib_text">
 				[COUNT]
 			</text>
 			<text name="Primitives on parcel:">
-				Prims on parcel:
+				地段上的幾何元件數:
 			</text>
 			<text name="total_objects_text">
 				[COUNT]
 			</text>
 			<text name="Owned by parcel owner:">
-				Owned by parcel owner:
+				地段擁有者所擁有:
 			</text>
 			<text name="owner_objects_text">
 				[COUNT]
 			</text>
 			<button label="顯示" label_selected="顯示" name="ShowOwner"/>
-			<button label="退回" name="ReturnOwner..." tool_tip="Return objects to their owners."/>
+			<button label="退回" name="ReturnOwner..." tool_tip="退回物件給它們的擁有者。"/>
 			<text name="Set to group:">
 				設定群組:
 			</text>
@@ -244,15 +244,15 @@
 				[COUNT]
 			</text>
 			<button label="顯示" label_selected="顯示" name="ShowGroup"/>
-			<button label="退回" name="ReturnGroup..." tool_tip="Return objects to their owners."/>
+			<button label="退回" name="ReturnGroup..." tool_tip="退回物件給它們的擁有者。"/>
 			<text name="Owned by others:">
-				Owned by others:
+				其他人所擁有:
 			</text>
 			<text name="other_objects_text">
 				[COUNT]
 			</text>
 			<button label="顯示" label_selected="顯示" name="ShowOther"/>
-			<button label="退回" name="ReturnOther..." tool_tip="Return objects to their owners."/>
+			<button label="退回" name="ReturnOther..." tool_tip="退回物件給它們的擁有者。"/>
 			<text name="Selected / sat upon:">
 				Selected / sat upon:
 			</text>
@@ -263,9 +263,9 @@
 				Auto return other Residents&apos; objects (minutes, 0 for off):
 			</text>
 			<text name="Object Owners:">
-				Object Owners:
+				物件擁有者:
 			</text>
-			<button name="Refresh List" tool_tip="Refresh Object List"/>
+			<button name="Refresh List" tool_tip="刷新物件清單"/>
 			<button label="退回物件" name="Return objects..."/>
 			<name_list name="owner list">
 				<name_list.columns label="Type" name="type"/>
@@ -276,14 +276,14 @@
 		</panel>
 		<panel label="選項" name="land_options_panel">
 			<panel.string name="search_enabled_tooltip">
-				Let people see this parcel in search results
+				讓其他人可以在搜尋結果中看到這塊地段
 			</panel.string>
 			<panel.string name="search_disabled_small_tooltip">
 				This option is disabled because this parcel&apos;s area is 128 m² or smaller.
 Only large parcels can be listed in search.
 			</panel.string>
 			<panel.string name="search_disabled_permissions_tooltip">
-				This option is disabled because you cannot modify this parcel&apos;s options.
+				這個選項已關閉因為你不能修改這個地段的選項。
 			</panel.string>
 			<panel.string name="mature_check_mature">
 				適度成人內容
@@ -331,35 +331,35 @@ Only large parcels can be listed in search.
 			</text>
 			<check_box label="安全(無傷害)" name="check safe" tool_tip="若勾選則設應土地為安全的,傷害性的戰鬥將被關閉。清除勾選後才能進行傷害性的戰鬥。"/>
 			<check_box label="禁止推撞" name="PushRestrictCheck" tool_tip="防止使用腳本推撞。勾選這個選項將可以有效防止你土地上的破壞行為。"/>
-			<check_box label="將地點刊登顯示在搜尋中(L$30 / 每週)" name="ShowDirectoryCheck" tool_tip="Let people see this parcel in search results"/>
+			<check_box label="將地點刊登顯示在搜尋中(L$30 / 每週)" name="ShowDirectoryCheck" tool_tip="讓其他人可以在搜尋結果中看到這塊地段"/>
 			<combo_box name="land category with adult">
 				<combo_box.item label="任何類別" name="item0"/>
 				<combo_box.item label="Linden Location" name="item1"/>
 				<combo_box.item label="完全成人" name="item2"/>
-				<combo_box.item label="Arts &amp; Culture" name="item3"/>
-				<combo_box.item label="Business" name="item4"/>
-				<combo_box.item label="Educational" name="item5"/>
-				<combo_box.item label="Gaming" name="item6"/>
+				<combo_box.item label="藝術與文化" name="item3"/>
+				<combo_box.item label="商業" name="item4"/>
+				<combo_box.item label="教育" name="item5"/>
+				<combo_box.item label="遊戲" name="item6"/>
 				<combo_box.item label="聚會所" name="item7"/>
-				<combo_box.item label="Newcomer Friendly" name="item8"/>
-				<combo_box.item label="Parks &amp; Nature" name="item9"/>
-				<combo_box.item label="Residential" name="item10"/>
-				<combo_box.item label="Shopping" name="item11"/>
+				<combo_box.item label="新手友善" name="item8"/>
+				<combo_box.item label="公園與自然" name="item9"/>
+				<combo_box.item label="住宅" name="item10"/>
+				<combo_box.item label="採購" name="item11"/>
 				<combo_box.item label="Rental" name="item13"/>
 				<combo_box.item label="Other" name="item12"/>
 			</combo_box>
 			<combo_box name="land category">
 				<combo_box.item label="任何類別" name="item0"/>
 				<combo_box.item label="Linden Location" name="item1"/>
-				<combo_box.item label="Arts &amp; Culture" name="item3"/>
-				<combo_box.item label="Business" name="item4"/>
-				<combo_box.item label="Educational" name="item5"/>
-				<combo_box.item label="Gaming" name="item6"/>
+				<combo_box.item label="藝術與文化" name="item3"/>
+				<combo_box.item label="商業" name="item4"/>
+				<combo_box.item label="教育" name="item5"/>
+				<combo_box.item label="遊戲" name="item6"/>
 				<combo_box.item label="聚會所" name="item7"/>
-				<combo_box.item label="Newcomer Friendly" name="item8"/>
-				<combo_box.item label="Parks &amp; Nature" name="item9"/>
-				<combo_box.item label="Residential" name="item10"/>
-				<combo_box.item label="Shopping" name="item11"/>
+				<combo_box.item label="新手友善" name="item8"/>
+				<combo_box.item label="公園與自然" name="item9"/>
+				<combo_box.item label="住宅" name="item10"/>
+				<combo_box.item label="採購" name="item11"/>
 				<combo_box.item label="Rental" name="item13"/>
 				<combo_box.item label="Other" name="item12"/>
 			</combo_box>
@@ -367,7 +367,7 @@ Only large parcels can be listed in search.
 			<text name="Snapshot:">
 				快照:
 			</text>
-			<texture_picker name="snapshot_ctrl" tool_tip="點擊以挑選圖片"/>
+			<texture_picker name="snapshot_ctrl" tool_tip="點擊以挑選圖像"/>
 			<text name="landing_point">
 				登陸點:[LANDING]
 			</text>
@@ -398,7 +398,7 @@ Only large parcels can be listed in search.
 			<text name="Media texture:">
 				取代材質:
 			</text>
-			<texture_picker name="media texture" tool_tip="點擊以挑選圖片"/>
+			<texture_picker name="media texture" tool_tip="點擊以挑選圖像"/>
 			<text name="replace_texture_help">
 				Objects using this texture will show the movie or web page after you click the play arrow.  Select the thumbnail to choose a different texture.
 			</text>
@@ -412,7 +412,7 @@ Only large parcels can be listed in search.
 				像素
 			</text>
 			<text name="Options:">
-				Options:
+				選項:
 			</text>
 			<check_box label="Loop" name="media_loop" tool_tip="Play media in a loop.  When the media has finished playing, it will restart from the beginning."/>
 		</panel>
@@ -442,14 +442,14 @@ Only large parcels can be listed in search.
 				One or more of these options is set at the estate level
 			</panel.string>
 			<text name="Limit access to this parcel to:">
-				Access To This Parcel
+				出入此地段
 			</text>
 			<text name="Only Allow">
 				Restrict Access to Residents verified by:
 			</text>
 			<check_box label="Payment Information on File [ESTATE_PAYMENT_LIMIT]" name="limit_payment" tool_tip="Ban unidentified Residents."/>
 			<check_box label="年齡驗證 [ESTATE_AGE_LIMIT]" name="limit_age_verified" tool_tip="Ban Residents who have not verified their age. See the [SUPPORT_SITE] for more information."/>
-			<check_box label="允許出入的群組:[GROUP]" name="GroupCheck" tool_tip="Set group in the General tab."/>
+			<check_box label="允許出入的群組:[GROUP]" name="GroupCheck" tool_tip="設定群組於一般頁籤。"/>
 			<check_box label="出售通行權給:" name="PassCheck" tool_tip="允許暫時出入這個地段"/>
 			<combo_box name="pass_combo">
 				<combo_box.item label="Anyone" name="Anyone"/>
diff --git a/indra/newview/skins/default/xui/zh/floater_animation_preview.xml b/indra/newview/skins/default/xui/zh/floater_animation_preview.xml
index baf68ffce6..c5e2eac446 100644
--- a/indra/newview/skins/default/xui/zh/floater_animation_preview.xml
+++ b/indra/newview/skins/default/xui/zh/floater_animation_preview.xml
@@ -173,8 +173,8 @@ Maximum animation length is [MAX_LENGTH] seconds.
 	</combo_box>
 	<spinner label="淡入(秒)" name="ease_in_time" tool_tip="Amount of time (in seconds) over which animations blends in"/>
 	<spinner label="淡出(秒)" name="ease_out_time" tool_tip="Amount of time (in seconds) over which animations blends out"/>
-	<button name="play_btn" tool_tip="Play your animation"/>
-	<button name="pause_btn" tool_tip="Pause your animation"/>
+	<button name="play_btn" tool_tip="播放你的動作"/>
+	<button name="pause_btn" tool_tip="暫停你的動做"/>
 	<button name="stop_btn" tool_tip="Stop animation playback"/>
 	<text name="bad_animation_text">
 		Unable to read animation file.
diff --git a/indra/newview/skins/default/xui/zh/floater_build_options.xml b/indra/newview/skins/default/xui/zh/floater_build_options.xml
index 95211b746c..b9d3b6b849 100644
--- a/indra/newview/skins/default/xui/zh/floater_build_options.xml
+++ b/indra/newview/skins/default/xui/zh/floater_build_options.xml
@@ -4,7 +4,7 @@
 	<spinner label="Grid Extents (meters)" name="GridDrawSize"/>
 	<check_box label="貼齊至子單位" name="GridSubUnit"/>
 	<check_box label="View cross-sections" name="GridCrossSection"/>
-	<text name="grid_opacity_label" tool_tip="Grid opacity">
-		Opacity:
+	<text name="grid_opacity_label" tool_tip="格線不透明度">
+		不透明度:
 	</text>
 </floater>
diff --git a/indra/newview/skins/default/xui/zh/floater_bumps.xml b/indra/newview/skins/default/xui/zh/floater_bumps.xml
index 64c11af953..2d76a9f831 100644
--- a/indra/newview/skins/default/xui/zh/floater_bumps.xml
+++ b/indra/newview/skins/default/xui/zh/floater_bumps.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="floater_bumps" title="BUMPS, PUSHES &amp; HITS">
+<floater name="floater_bumps" title="碰撞、推擠與打擊">
 	<floater.string name="none_detected">
 		未偵測到
 	</floater.string>
diff --git a/indra/newview/skins/default/xui/zh/floater_buy_currency.xml b/indra/newview/skins/default/xui/zh/floater_buy_currency.xml
index f187a1ab40..d63e73c6f1 100644
--- a/indra/newview/skins/default/xui/zh/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/zh/floater_buy_currency.xml
@@ -55,7 +55,7 @@
 		Confirming this purchase only buys L$, not the object.
 	</text>
 	<text name="purchase_warning_notenough">
-		You aren&apos;t buying enough L$. Please increase the amount.
+		你並未購買足夠的林登幣,請先添加一些數量。
 	</text>
 	<button label="立即購買" name="buy_btn"/>
 	<button label="取消" name="cancel_btn"/>
diff --git a/indra/newview/skins/default/xui/zh/floater_buy_land.xml b/indra/newview/skins/default/xui/zh/floater_buy_land.xml
index c4a5d174ef..336d14747d 100644
--- a/indra/newview/skins/default/xui/zh/floater_buy_land.xml
+++ b/indra/newview/skins/default/xui/zh/floater_buy_land.xml
@@ -26,10 +26,10 @@ Try selecting a smaller area.
 		You do not have permission to buy land for your active group.
 	</floater.string>
 	<floater.string name="parcel_not_for_sale">
-		The selected parcel is not for sale.
+		所選擇的地段不出售。.
 	</floater.string>
 	<floater.string name="group_already_owns">
-		The group already owns the parcel.
+		這個群組已擁有這個地段。
 	</floater.string>
 	<floater.string name="you_already_own">
 		你已經擁有這個地段。
@@ -62,7 +62,7 @@ Try selecting a smaller area.
 		Cannot buy now:
 	</floater.string>
 	<floater.string name="not_for_sale">
-		Not for sale:
+		不出售:
 	</floater.string>
 	<floater.string name="none_needed">
 		none needed
diff --git a/indra/newview/skins/default/xui/zh/floater_critical.xml b/indra/newview/skins/default/xui/zh/floater_critical.xml
index da357bde56..7d08fe8af2 100644
--- a/indra/newview/skins/default/xui/zh/floater_critical.xml
+++ b/indra/newview/skins/default/xui/zh/floater_critical.xml
@@ -2,7 +2,7 @@
 <floater name="modal container">
 	<button label="繼續" label_selected="繼續" name="Continue"/>
 	<text name="tos_heading">
-		Please read the following message carefully.
+		請仔細閱讀下列的訊息。
 	</text>
 	<text_editor name="tos_text">
 		TOS_TEXT
diff --git a/indra/newview/skins/default/xui/zh/floater_day_cycle_options.xml b/indra/newview/skins/default/xui/zh/floater_day_cycle_options.xml
index 28d2ba6ed4..84186c5836 100644
--- a/indra/newview/skins/default/xui/zh/floater_day_cycle_options.xml
+++ b/indra/newview/skins/default/xui/zh/floater_day_cycle_options.xml
@@ -85,7 +85,7 @@
 			<text name="DayCycleText3">
 				預覽:
 			</text>
-			<button label="Play" label_selected="Play" name="WLAnimSky"/>
+			<button label="播放" label_selected="播放" name="WLAnimSky"/>
 			<button label="停止!" label_selected="停止" name="WLStopAnimSky"/>
 			<button label="Use Estate Time" label_selected="Go to Estate Time" name="WLUseLindenTime"/>
 			<button label="Save Test Day" label_selected="Save Test Day" name="WLSaveDayCycle"/>
diff --git a/indra/newview/skins/default/xui/zh/floater_display_name.xml b/indra/newview/skins/default/xui/zh/floater_display_name.xml
index 39abfe0b8b..01b5088794 100644
--- a/indra/newview/skins/default/xui/zh/floater_display_name.xml
+++ b/indra/newview/skins/default/xui/zh/floater_display_name.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Display Name" title="CHANGE DISPLAY NAME">
+<floater name="Display Name" title="變更顯示名稱">
 	<text name="info_text">
 		The name you give your avatar is called your Display Name. You can change it once a week.
 	</text>
@@ -7,12 +7,12 @@
 		You cannot change your Display Name until: [TIME].
 	</text>
 	<text name="set_name_label">
-		New Display Name:
+		新顯示名稱:
 	</text>
 	<text name="name_confirm_label">
 		Type your new name again to confirm:
 	</text>
-	<button label="儲存" name="save_btn" tool_tip="Save your new Display Name"/>
+	<button label="儲存" name="save_btn" tool_tip="儲存你的新顯示名稱"/>
 	<button label="重設" name="reset_btn" tool_tip="Make Display Name the same as Username"/>
 	<button label="取消" name="cancel_btn"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/zh/floater_image_preview.xml b/indra/newview/skins/default/xui/zh/floater_image_preview.xml
index d7e9a7704c..1260601f90 100644
--- a/indra/newview/skins/default/xui/zh/floater_image_preview.xml
+++ b/indra/newview/skins/default/xui/zh/floater_image_preview.xml
@@ -12,14 +12,14 @@
 	<combo_box label="服裝類型" name="clothing_type_combo">
 		<item label="圖像" name="Image" value="圖像"/>
 		<item label="頭髮" name="Hair" value="頭髮"/>
-		<item label="Female Head" name="FemaleHead" value="Female Head"/>
-		<item label="Female Upper Body" name="FemaleUpperBody" value="Female Upper Body"/>
-		<item label="Female Lower Body" name="FemaleLowerBody" value="Female Lower Body"/>
-		<item label="Male Head" name="MaleHead" value="Male Head"/>
-		<item label="Male Upper Body" name="MaleUpperBody" value="Male Upper Body"/>
-		<item label="Male Lower Body" name="MaleLowerBody" value="Male Lower Body"/>
+		<item label="女性頭部" name="FemaleHead" value="女性頭部"/>
+		<item label="女性上半身" name="FemaleUpperBody" value="女性上半身"/>
+		<item label="女性下半身" name="FemaleLowerBody" value="女性下半身"/>
+		<item label="男性頭部" name="MaleHead" value="男性頭部"/>
+		<item label="男性上半身" name="MaleUpperBody" value="男性上半身"/>
+		<item label="男性下半身" name="MaleLowerBody" value="男性下半身"/>
 		<item label="裙子" name="Skirt" value="裙子"/>
-		<item label="Sculpted Prim" name="SculptedPrim" value="Sculpted Prim"/>
+		<item label="雕刻的幾何元件" name="SculptedPrim" value="雕刻的幾何元件"/>
 	</combo_box>
 	<text name="bad_image_text">
 		無法讀取圖像。
diff --git a/indra/newview/skins/default/xui/zh/floater_incoming_call.xml b/indra/newview/skins/default/xui/zh/floater_incoming_call.xml
index 123cdd9f2c..a0f31fa11f 100644
--- a/indra/newview/skins/default/xui/zh/floater_incoming_call.xml
+++ b/indra/newview/skins/default/xui/zh/floater_incoming_call.xml
@@ -13,10 +13,10 @@
 		通話中。
 	</floater.string>
 	<floater.string name="VoiceInviteAdHoc">
-		has joined a Voice Chat call with a conference chat.
+		已加訴入會議交談中的語音聊天。
 	</floater.string>
 	<floater.string name="VoiceInviteGroup">
-		just joined &apos;[GROUP]&apos; voice channel.
+		剛加入 &apos;[GROUP]&apos; 語音頻道。
 	</floater.string>
 	<floater.string name="VoiceInviteQuestionGroup">
 		Would you like to leave [CURRENT_CHAT] and join the call with &apos;[GROUP]&apos;?
diff --git a/indra/newview/skins/default/xui/zh/floater_inspect.xml b/indra/newview/skins/default/xui/zh/floater_inspect.xml
index 295538f797..ea3d9d0c3e 100644
--- a/indra/newview/skins/default/xui/zh/floater_inspect.xml
+++ b/indra/newview/skins/default/xui/zh/floater_inspect.xml
@@ -5,9 +5,9 @@
 	</floater.string>
 	<scroll_list name="object_list" tool_tip="Select an object from this list to highlight it in-world">
 		<scroll_list.columns label="物件名稱" name="object_name"/>
-		<scroll_list.columns label="Owner Name" name="owner_name"/>
-		<scroll_list.columns label="Creator Name" name="creator_name"/>
-		<scroll_list.columns label="Creation Date" name="creation_date"/>
+		<scroll_list.columns label="擁有者名稱" name="owner_name"/>
+		<scroll_list.columns label="創造者名稱" name="creator_name"/>
+		<scroll_list.columns label="創造日期" name="creation_date"/>
 	</scroll_list>
 	<button label="察看擁有者檔案..." name="button owner" tool_tip="See profile of the highlighted object&apos;s owner"/>
 	<button label="察看創造者檔案..." name="button creator" tool_tip="See profile of the highlighted object&apos;s original creator"/>
diff --git a/indra/newview/skins/default/xui/zh/floater_inventory_view_finder.xml b/indra/newview/skins/default/xui/zh/floater_inventory_view_finder.xml
index 370ab32b9f..d698edf5e5 100644
--- a/indra/newview/skins/default/xui/zh/floater_inventory_view_finder.xml
+++ b/indra/newview/skins/default/xui/zh/floater_inventory_view_finder.xml
@@ -5,7 +5,7 @@
 	<check_box label="服裝" name="check_clothing"/>
 	<check_box label="姿勢" name="check_gesture"/>
 	<check_box label="地標" name="check_landmark"/>
-	<check_box label="Notecards" name="check_notecard"/>
+	<check_box label="記事卡" name="check_notecard"/>
 	<check_box label="Objects" name="check_object"/>
 	<check_box label="腳本" name="check_script"/>
 	<check_box label="Sounds" name="check_sound"/>
diff --git a/indra/newview/skins/default/xui/zh/floater_outgoing_call.xml b/indra/newview/skins/default/xui/zh/floater_outgoing_call.xml
index 8b15668e3b..63da47f4de 100644
--- a/indra/newview/skins/default/xui/zh/floater_outgoing_call.xml
+++ b/indra/newview/skins/default/xui/zh/floater_outgoing_call.xml
@@ -4,10 +4,10 @@
 		5
 	</floater.string>
 	<floater.string name="localchat">
-		Nearby Voice Chat
+		附近的語音聊天
 	</floater.string>
 	<floater.string name="anonymous">
-		anonymous
+		匿名
 	</floater.string>
 	<floater.string name="VoiceInviteP2P">
 		通話中。
@@ -22,7 +22,7 @@
 		Calling [CALLEE_NAME]
 	</text>
 	<text name="noanswer">
-		No Answer.  Please try again later.
+		無應答,請稍候再試。
 	</text>
 	<text name="nearby">
 		You have been disconnected from [VOICE_CHANNEL_NAME].  [RECONNECT_NEARBY]
diff --git a/indra/newview/skins/default/xui/zh/floater_preview_animation.xml b/indra/newview/skins/default/xui/zh/floater_preview_animation.xml
index ead8dc49a6..c435ddc0bd 100644
--- a/indra/newview/skins/default/xui/zh/floater_preview_animation.xml
+++ b/indra/newview/skins/default/xui/zh/floater_preview_animation.xml
@@ -6,6 +6,6 @@
 	<text name="desc txt">
 		描述:
 	</text>
-	<button label="Play Inworld" label_selected="停止" name="Anim play btn" tool_tip="Play this animation so that others can see it"/>
-	<button label="Play Locally" label_selected="停止" name="Anim audition btn" tool_tip="Play this animation so that only you can see it"/>
+	<button label="播放於虛擬世界" label_selected="停止" name="Anim play btn" tool_tip="Play this animation so that others can see it"/>
+	<button label="播放於本地" label_selected="停止" name="Anim audition btn" tool_tip="Play this animation so that only you can see it"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/zh/floater_preview_sound.xml b/indra/newview/skins/default/xui/zh/floater_preview_sound.xml
index d99d13669f..46844349de 100644
--- a/indra/newview/skins/default/xui/zh/floater_preview_sound.xml
+++ b/indra/newview/skins/default/xui/zh/floater_preview_sound.xml
@@ -6,6 +6,6 @@
 	<text name="desc txt">
 		描述:
 	</text>
-	<button label="Play Inworld" label_selected="Play Inworld" name="Sound play btn" tool_tip="Play this sound so that others can hear it"/>
-	<button label="Play Locally" label_selected="Play Locally" name="Sound audition btn" tool_tip="Play this sound so that only you can hear it"/>
+	<button label="播放於虛擬世界" label_selected="播放於虛擬世界" name="Sound play btn" tool_tip="Play this sound so that others can hear it"/>
+	<button label="播放於本地" label_selected="播放於本地" name="Sound audition btn" tool_tip="Play this sound so that only you can hear it"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/zh/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/zh/floater_texture_ctrl.xml
index fc00b0b4a2..01586ac153 100644
--- a/indra/newview/skins/default/xui/zh/floater_texture_ctrl.xml
+++ b/indra/newview/skins/default/xui/zh/floater_texture_ctrl.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="texture picker" title="PICK: TEXTURE">
 	<floater.string name="choose_picture">
-		點擊以挑選圖片
+		點擊以挑選圖像
 	</floater.string>
 	<floater.string name="pick title">
 		Pick:
diff --git a/indra/newview/skins/default/xui/zh/floater_tools.xml b/indra/newview/skins/default/xui/zh/floater_tools.xml
index c70e70451e..2db98eb3d7 100644
--- a/indra/newview/skins/default/xui/zh/floater_tools.xml
+++ b/indra/newview/skins/default/xui/zh/floater_tools.xml
@@ -48,7 +48,7 @@
 		Drag to move, shift-drag to copy
 	</text>
 	<radio_group name="focus_radio_group">
-		<radio_item label="Zoom" name="radio zoom"/>
+		<radio_item label="縮放" name="radio zoom"/>
 		<radio_item label="環繞(Ctrl)" name="radio orbit"/>
 		<radio_item label="平移(Ctrl+Shift)" name="radio pan"/>
 	</radio_group>
@@ -75,10 +75,10 @@
 	</text>
 	<check_box initial_value="true" label="伸展材質" name="checkbox stretch textures"/>
 	<check_box initial_value="true" label="貼齊格線" name="checkbox snap to grid"/>
-	<combo_box name="combobox grid mode" tool_tip="Choose the type of grid ruler for positioning the object">
-		<combo_box.item label="World grid" name="World"/>
-		<combo_box.item label="Local grid" name="Local"/>
-		<combo_box.item label="Reference grid" name="Reference"/>
+	<combo_box name="combobox grid mode" tool_tip="選擇物件定位參考的格線尺度類型">
+		<combo_box.item label="世界格線" name="World"/>
+		<combo_box.item label="地方格線" name="Local"/>
+		<combo_box.item label="參考格線" name="Reference"/>
 	</combo_box>
 	<button name="Options..." tool_tip="察看更多格線選項"/>
 	<button name="ToolCube" tool_tip="Cube"/>
@@ -125,15 +125,15 @@
 		物件: [COUNT]
 	</text>
 	<text name="prim_count">
-		Prims: [COUNT]
+		幾何元件: [COUNT]
 	</text>
 	<tab_container name="Object Info Tabs">
 		<panel label="一般" name="General">
 			<panel.string name="text deed continued">
-				Deed
+				讓渡
 			</panel.string>
 			<panel.string name="text deed">
-				Deed
+				讓渡
 			</panel.string>
 			<panel.string name="text modify info 1">
 				你能修改這個物件
@@ -183,7 +183,7 @@
 			<name_box initial_value="載入中..." name="Group Name Proxy"/>
 			<button name="button set group" tool_tip="選擇一個群組以分享這物件權限"/>
 			<check_box label="分享" name="checkbox share with group" tool_tip="Allow all members of the set group to share your modify permissions for this object. You must Deed to enable role restrictions."/>
-			<button label="Deed" label_selected="Deed" name="button deed" tool_tip="Deeding gives this item away with next owner permissions. Group shared objects can be deeded by a group officer."/>
+			<button label="讓渡" label_selected="讓渡" name="button deed" tool_tip="Deeding gives this item away with next owner permissions. Group shared objects can be deeded by a group officer."/>
 			<text name="label click action">
 				點擊以:
 			</text>
@@ -272,7 +272,7 @@
 				<combo_box.item label="Sculpted" name="Sculpted"/>
 			</combo_box>
 			<combo_box name="material">
-				<combo_box.item label="Stone" name="Stone"/>
+				<combo_box.item label="石頭" name="Stone"/>
 				<combo_box.item label="金屬" name="Metal"/>
 				<combo_box.item label="玻璃" name="Glass"/>
 				<combo_box.item label="木頭" name="Wood"/>
@@ -340,7 +340,7 @@
 			<text name="text revolutions">
 				Revolutions
 			</text>
-			<texture_picker label="Sculpt Texture" name="sculpt texture control" tool_tip="點擊以挑選圖片"/>
+			<texture_picker label="Sculpt Texture" name="sculpt texture control" tool_tip="點擊以挑選圖像"/>
 			<check_box label="Mirror" name="sculpt mirror control" tool_tip="Flips sculpted prim along the X axis"/>
 			<check_box label="Inside-out" name="sculpt invert control" tool_tip="Inverts the sculpted prims normals, making it appear inside-out"/>
 			<text name="label sculpt type">
@@ -356,28 +356,28 @@
 		</panel>
 		<panel label="特性" name="Features">
 			<text name="select_single">
-				Select only one primitive to edit features.
+				只能選擇一個幾何元件去編輯細節。
 			</text>
 			<text name="edit_object">
 				編輯物件特性:
 			</text>
-			<check_box label="Flexible Path" name="Flexible1D Checkbox Ctrl" tool_tip="Allows object to flex about the Z axis (Client-side only)"/>
-			<spinner label="Softness" name="FlexNumSections"/>
-			<spinner label="Gravity" name="FlexGravity"/>
-			<spinner label="Drag" name="FlexFriction"/>
-			<spinner label="Wind" name="FlexWind"/>
-			<spinner label="Tension" name="FlexTension"/>
-			<spinner label="Force X" name="FlexForceX"/>
-			<spinner label="Force Y" name="FlexForceY"/>
-			<spinner label="Force Z" name="FlexForceZ"/>
-			<check_box label="Light" name="Light Checkbox Ctrl" tool_tip="Causes object to emit light"/>
+			<check_box label="彈性路徑" name="Flexible1D Checkbox Ctrl" tool_tip="Allows object to flex about the Z axis (Client-side only)"/>
+			<spinner label="柔軟" name="FlexNumSections"/>
+			<spinner label="重力" name="FlexGravity"/>
+			<spinner label="拖曳" name="FlexFriction"/>
+			<spinner label="風力" name="FlexWind"/>
+			<spinner label="張力" name="FlexTension"/>
+			<spinner label="強制 X 軸" name="FlexForceX"/>
+			<spinner label="強制 Y 軸" name="FlexForceY"/>
+			<spinner label="強制 Z 軸" name="FlexForceZ"/>
+			<check_box label="光源" name="Light Checkbox Ctrl" tool_tip="導致物件發光"/>
 			<color_swatch name="colorswatch" tool_tip="點擊以開啟顏色挑選器"/>
 			<texture_picker label="" name="light texture control" tool_tip="Click to choose a projection image (only has effect with deferred rendering enabled)"/>
-			<spinner label="Intensity" name="Light Intensity"/>
+			<spinner label="強度" name="Light Intensity"/>
 			<spinner label="FOV" name="Light FOV"/>
-			<spinner label="Radius" name="Light Radius"/>
+			<spinner label="半徑" name="Light Radius"/>
 			<spinner label="Focus" name="Light Focus"/>
-			<spinner label="Falloff" name="Light Falloff"/>
+			<spinner label="衰減" name="Light Falloff"/>
 			<spinner label="Ambiance" name="Light Ambiance"/>
 		</panel>
 		<panel label="材質" name="Texture">
@@ -387,7 +387,7 @@
 			<panel.string name="string repeats per face">
 				每一面重覆次數
 			</panel.string>
-			<texture_picker label="材質" name="texture control" tool_tip="點擊以挑選圖片"/>
+			<texture_picker label="材質" name="texture control" tool_tip="點擊以挑選圖像"/>
 			<color_swatch label="顏色" name="colorswatch" tool_tip="點擊以開啟顏色挑選器"/>
 			<text name="color trans">
 				透明度 %
diff --git a/indra/newview/skins/default/xui/zh/floater_url_entry.xml b/indra/newview/skins/default/xui/zh/floater_url_entry.xml
index 65f6a9cb95..9e3f3cd47d 100644
--- a/indra/newview/skins/default/xui/zh/floater_url_entry.xml
+++ b/indra/newview/skins/default/xui/zh/floater_url_entry.xml
@@ -3,7 +3,7 @@
 	<text name="media_label">
 		媒體 URL:
 	</text>
-	<button label="" name="ok_btn"/>
+	<button label="確定" name="ok_btn"/>
 	<button label="取消" name="cancel_btn"/>
 	<button label="清除" name="clear_btn"/>
 	<text name="loading_label">
diff --git a/indra/newview/skins/default/xui/zh/floater_voice_controls.xml b/indra/newview/skins/default/xui/zh/floater_voice_controls.xml
index c27b80e9c5..24b7efea4f 100644
--- a/indra/newview/skins/default/xui/zh/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/zh/floater_voice_controls.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="floater_voice_controls" title="Voice Controls">
+<floater name="floater_voice_controls" title="語音控制">
 	<string name="title_nearby">
-		NEARBY VOICE
+		附近的語音
 	</string>
 	<string name="title_group">
 		與 [GROUP] 進行群組通話
@@ -13,7 +13,7 @@
 		與 [NAME] 進行通話
 	</string>
 	<string name="no_one_near">
-		No one near has voice enabled
+		附近沒有一人開啟語音
 	</string>
 	<layout_stack name="my_call_stack">
 		<layout_panel name="my_panel">
diff --git a/indra/newview/skins/default/xui/zh/menu_inventory.xml b/indra/newview/skins/default/xui/zh/menu_inventory.xml
index 49a50c97c6..87d769af0d 100644
--- a/indra/newview/skins/default/xui/zh/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/zh/menu_inventory.xml
@@ -2,17 +2,17 @@
 <menu name="Popup">
 	<menu_item_call label="分享" name="Share"/>
 	<menu_item_call label="購買" name="Task Buy"/>
-	<menu_item_call label="Open" name="Task Open"/>
-	<menu_item_call label="Play" name="Task Play"/>
-	<menu_item_call label="Properties" name="Task Properties"/>
+	<menu_item_call label="開啟" name="Task Open"/>
+	<menu_item_call label="播放" name="Task Play"/>
+	<menu_item_call label="屬性" name="Task Properties"/>
 	<menu_item_call label="更名" name="Task Rename"/>
 	<menu_item_call label="刪除" name="Task Remove"/>
 	<menu_item_call label="清空垃圾筒" name="Empty Trash"/>
-	<menu_item_call label="Empty Lost And Found" name="Empty Lost And Found"/>
+	<menu_item_call label="清空 Lost And Found" name="Empty Lost And Found"/>
 	<menu_item_call label="新資料夾" name="New Folder"/>
-	<menu_item_call label="New Script" name="New Script"/>
-	<menu_item_call label="New Notecard" name="New Note"/>
-	<menu_item_call label="New Gesture" name="New Gesture"/>
+	<menu_item_call label="新腳本" name="New Script"/>
+	<menu_item_call label="新記事卡" name="New Note"/>
+	<menu_item_call label="新姿勢" name="New Gesture"/>
 	<menu label="新衣服" name="New Clothes">
 		<menu_item_call label="新襯衫" name="New Shirt"/>
 		<menu_item_call label="新褲子" name="New Pants"/>
@@ -52,11 +52,11 @@
 	<menu_item_call label="添加到目前裝扮" name="Add To Outfit"/>
 	<menu_item_call label="由目前的裝扮移除" name="Remove From Outfit"/>
 	<menu_item_call label="尋找原件" name="Find Original"/>
-	<menu_item_call label="Purge Item" name="Purge Item"/>
-	<menu_item_call label="Restore Item" name="Restore Item"/>
+	<menu_item_call label="清空物品" name="Purge Item"/>
+	<menu_item_call label="恢復物品" name="Restore Item"/>
 	<menu_item_call label="開啟" name="Open"/>
-	<menu_item_call label="Open Original" name="Open Original"/>
-	<menu_item_call label="Properties" name="Properties"/>
+	<menu_item_call label="開啟原件" name="Open Original"/>
+	<menu_item_call label="屬性" name="Properties"/>
 	<menu_item_call label="更名" name="Rename"/>
 	<menu_item_call label="覆製資產 UUID" name="Copy Asset UUID"/>
 	<menu_item_call label="覆製" name="Copy"/>
@@ -68,11 +68,11 @@
 	<menu_item_call label="Start Conference Chat" name="Conference Chat Folder"/>
 	<menu_item_call label="播放" name="Sound Play"/>
 	<menu_item_call label="添加地標" name="About Landmark"/>
-	<menu_item_call label="Play Inworld" name="Animation Play"/>
-	<menu_item_call label="Play Locally" name="Animation Audition"/>
+	<menu_item_call label="播放於虛擬世界" name="Animation Play"/>
+	<menu_item_call label="播放於本地" name="Animation Audition"/>
 	<menu_item_call label="送出即時訊息" name="Send Instant Message"/>
 	<menu_item_call label="發給瞬間傳送請求..." name="Offer Teleport..."/>
-	<menu_item_call label="Start Conference Chat" name="Conference Chat"/>
+	<menu_item_call label="開始會議交談" name="Conference Chat"/>
 	<menu_item_call label="Activate" name="Activate"/>
 	<menu_item_call label="Deactivate" name="Deactivate"/>
 	<menu_item_call label="另存" name="Save As"/>
diff --git a/indra/newview/skins/default/xui/zh/menu_inventory_gear_default.xml b/indra/newview/skins/default/xui/zh/menu_inventory_gear_default.xml
index 74b90ada5e..8ad0e7324f 100644
--- a/indra/newview/skins/default/xui/zh/menu_inventory_gear_default.xml
+++ b/indra/newview/skins/default/xui/zh/menu_inventory_gear_default.xml
@@ -6,7 +6,7 @@
 	<menu_item_check label="總是由名稱排序資料夾" name="sort_folders_by_name"/>
 	<menu_item_check label="系統資料夾排序到最上方" name="sort_system_folders_to_top"/>
 	<menu_item_call label="顯示過濾器" name="show_filters"/>
-	<menu_item_call label="Reset Filters" name="reset_filters"/>
+	<menu_item_call label="重設過濾器" name="reset_filters"/>
 	<menu_item_call label="關閉全部資料夾" name="close_folders"/>
 	<menu_item_call label="清空 Lost and Found" name="empty_lostnfound"/>
 	<menu_item_call label="儲存材質為" name="Save Texture As"/>
diff --git a/indra/newview/skins/default/xui/zh/menu_viewer.xml b/indra/newview/skins/default/xui/zh/menu_viewer.xml
index a51e26c3f4..f7be781cac 100644
--- a/indra/newview/skins/default/xui/zh/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/zh/menu_viewer.xml
@@ -139,45 +139,46 @@
 		<menu_item_check label="Disable Camera Constraints" name="Disable Camera Distance"/>
 		<menu_item_check label="高解析度快照" name="HighResSnapshot"/>
 		<menu_item_check label="靜音拍攝快照到硬碟" name="QuietSnapshotsToDisk"/>
+		<menu_item_check label="壓縮快照存到硬碟" name="CompressSnapshotsToDisk"/>
 		<menu label="效能工具" name="Performance Tools">
 			<menu_item_call label="Lag Meter" name="Lag Meter"/>
 			<menu_item_check label="統計列" name="Statistics Bar"/>
 			<menu_item_check label="Show Avatar Rendering Cost" name="Avatar Rendering Cost"/>
 		</menu>
-		<menu label="Highlighting and Visibility" name="Highlighting and Visibility">
+		<menu label="高亮顯示與可見度" name="Highlighting and Visibility">
 			<menu_item_check label="Cheesy Beacon" name="Cheesy Beacon"/>
-			<menu_item_check label="Hide Particles" name="Hide Particles"/>
-			<menu_item_check label="Hide Selected" name="Hide Selected"/>
+			<menu_item_check label="隱藏粒子效果" name="Hide Particles"/>
+			<menu_item_check label="隱藏所選擇的" name="Hide Selected"/>
 			<menu_item_check label="高亮顯示透明物件" name="Highlight Transparent"/>
 			<menu_item_check label="顯示 HUD 附件" name="Show HUD Attachments"/>
-			<menu_item_check label="Show Mouselook Crosshairs" name="ShowCrosshairs"/>
+			<menu_item_check label="顯示第一人稱視角準星" name="ShowCrosshairs"/>
 		</menu>
 		<menu label="Rendering Types" name="Rendering Types">
-			<menu_item_check label="Simple" name="Simple"/>
+			<menu_item_check label="簡單" name="Simple"/>
 			<menu_item_check label="半透明" name="Alpha"/>
-			<menu_item_check label="Tree" name="Tree"/>
-			<menu_item_check label="Avatars" name="Character"/>
-			<menu_item_check label="SurfacePath" name="SurfacePath"/>
-			<menu_item_check label="Sky" name="Sky"/>
-			<menu_item_check label="Water" name="Water"/>
-			<menu_item_check label="Ground" name="Ground"/>
-			<menu_item_check label="Volume" name="Volume"/>
-			<menu_item_check label="Grass" name="Grass"/>
-			<menu_item_check label="Clouds" name="Clouds"/>
-			<menu_item_check label="Particles" name="Particles"/>
-			<menu_item_check label="Bump" name="Bump"/>
+			<menu_item_check label="樹木" name="Tree"/>
+			<menu_item_check label="化身" name="Character"/>
+			<menu_item_check label="地表" name="SurfacePath"/>
+			<menu_item_check label="天空" name="Sky"/>
+			<menu_item_check label="水文" name="Water"/>
+			<menu_item_check label="地面" name="Ground"/>
+			<menu_item_check label="體積" name="Volume"/>
+			<menu_item_check label="草地" name="Grass"/>
+			<menu_item_check label="雲彩" name="Clouds"/>
+			<menu_item_check label="粒子效果" name="Particles"/>
+			<menu_item_check label="碰撞" name="Bump"/>
 		</menu>
 		<menu label="Rendering Features" name="Rendering Features">
 			<menu_item_check label="UI" name="UI"/>
 			<menu_item_check label="Selected" name="Selected"/>
 			<menu_item_check label="Highlighted" name="Highlighted"/>
 			<menu_item_check label="Dynamic Textures" name="Dynamic Textures"/>
-			<menu_item_check label="Foot Shadows" name="Foot Shadows"/>
-			<menu_item_check label="Fog" name="Fog"/>
+			<menu_item_check label="腳步陰影" name="Foot Shadows"/>
+			<menu_item_check label="霧氣" name="Fog"/>
 			<menu_item_check label="Test FRInfo" name="Test FRInfo"/>
-			<menu_item_check label="Flexible Objects" name="Flexible Objects"/>
+			<menu_item_check label="彈性物件" name="Flexible Objects"/>
 		</menu>
-		<menu_item_check label="Use Plugin Read Thread" name="Use Plugin Read Thread"/>
+		<menu_item_check label="使用外卦讀取緒" name="Use Plugin Read Thread"/>
 		<menu_item_call label="清除群組快取資料" name="ClearGroupCache"/>
 		<menu_item_check label="滑鼠平滑移動" name="Mouse Smoothing"/>
 		<menu label="快速鍵" name="Shortcuts">
@@ -213,13 +214,13 @@
 			<menu_item_check label="除錯控制台" name="Debug Console"/>
 			<menu_item_call label="通知控制台" name="Notifications"/>
 			<menu_item_check label="材質尺寸控制台" name="Texture Size"/>
-			<menu_item_check label="Texture Category Console" name="Texture Category"/>
-			<menu_item_check label="Fast Timers" name="Fast Timers"/>
+			<menu_item_check label="材質分類控制台" name="Texture Category"/>
+			<menu_item_check label="快速碼錶" name="Fast Timers"/>
 			<menu_item_check label="記憶體" name="Memory"/>
-			<menu_item_call label="Region Info to Debug Console" name="Region Info to Debug Console"/>
+			<menu_item_call label="地區資訊傳至除錯控制台" name="Region Info to Debug Console"/>
 			<menu_item_call label="群組資訊至除錯控制台" name="Group Info to Debug Console"/>
 			<menu_item_call label="Capabilities Info to Debug Console" name="Capabilities Info to Debug Console"/>
-			<menu_item_check label="Camera" name="Camera"/>
+			<menu_item_check label="攝影機" name="Camera"/>
 			<menu_item_check label="風力" name="Wind"/>
 			<menu_item_check label="FOV" name="FOV"/>
 			<menu_item_check label="Badge" name="Badge"/>
@@ -244,7 +245,7 @@
 			<menu_item_call label="模擬記憶體不足" name="Memory Leaking Simulation"/>
 		</menu>
 		<menu label="Render Tests" name="Render Tests">
-			<menu_item_check label="Camera Offset" name="Camera Offset"/>
+			<menu_item_check label="攝影機位移" name="Camera Offset"/>
 			<menu_item_check label="Randomize Framerate" name="Randomize Framerate"/>
 			<menu_item_check label="Periodic Slow Frame" name="Periodic Slow Frame"/>
 			<menu_item_check label="Frame Test" name="Frame Test"/>
@@ -275,12 +276,12 @@
 			<menu_item_check label="Shadows from Sun/Moon/Projectors" name="Shadows from Sun/Moon/Projectors"/>
 			<menu_item_check label="SSAO and Shadow Smoothing" name="SSAO and Shadow Smoothing"/>
 			<menu_item_check label="Global Illumination (experimental)" name="Global Illumination"/>
-			<menu_item_check label="Debug GL" name="Debug GL"/>
-			<menu_item_check label="Debug Pipeline" name="Debug Pipeline"/>
+			<menu_item_check label="GL 除錯" name="Debug GL"/>
+			<menu_item_check label="管線除錯" name="Debug Pipeline"/>
 			<menu_item_check label="自動半透明遮罩(遞延)" name="Automatic Alpha Masks (deferred)"/>
 			<menu_item_check label="自動半透明遮罩(非遞延)" name="Automatic Alpha Masks (non-deferred)"/>
 			<menu_item_check label="Animation Textures" name="Animation Textures"/>
-			<menu_item_check label="Disable Textures" name="Disable Textures"/>
+			<menu_item_check label="關閉材質" name="Disable Textures"/>
 			<menu_item_check label="Full Res Textures" name="Rull Res Textures"/>
 			<menu_item_check label="Audit Textures" name="Audit Textures"/>
 			<menu_item_check label="Texture Atlas (experimental)" name="Texture Atlas"/>
@@ -297,30 +298,30 @@
 			<menu_item_call label="Drop a Packet" name="Drop a Packet"/>
 		</menu>
 		<menu_item_call label="Dump Scripted Camera" name="Dump Scripted Camera"/>
-		<menu_item_call label="Bumps, Pushes &amp; Hits" name="Bumps, Pushes &amp;amp; Hits"/>
-		<menu label="Recorder" name="Recorder">
-			<menu_item_call label="Start Playback" name="Start Playback"/>
-			<menu_item_call label="Stop Playback" name="Stop Playback"/>
-			<menu_item_check label="Loop Playback" name="Loop Playback"/>
-			<menu_item_call label="Start Record" name="Start Record"/>
-			<menu_item_call label="Stop Record" name="Stop Record"/>
-		</menu>
-		<menu label="World" name="World">
-			<menu_item_check label="Sim Sun Override" name="Sim Sun Override"/>
+		<menu_item_call label="碰撞、推擠與打擊" name="Bumps, Pushes &amp;amp; Hits"/>
+		<menu label="錄製器" name="Recorder">
+			<menu_item_call label="開始播放" name="Start Playback"/>
+			<menu_item_call label="停止播放" name="Stop Playback"/>
+			<menu_item_check label="循環播放" name="Loop Playback"/>
+			<menu_item_call label="開始錄製" name="Start Record"/>
+			<menu_item_call label="停止錄製" name="Stop Record"/>
+		</menu>
+		<menu label="世界" name="World">
+			<menu_item_check label="模擬器太陽設定覆蓋" name="Sim Sun Override"/>
 			<menu_item_check label="Cheesy Beacon" name="Cheesy Beacon"/>
-			<menu_item_check label="Fixed Weather" name="Fixed Weather"/>
+			<menu_item_check label="固定天氣" name="Fixed Weather"/>
 			<menu_item_call label="傾印地區物件快取" name="Dump Region Object Cache"/>
 		</menu>
 		<menu label="UI" name="UI">
-			<menu_item_call label="Media Browser Test" name="Web Browser Test"/>
-			<menu_item_call label="Web Content Browser" name="Web Content Browser"/>
+			<menu_item_call label="測試媒體瀏覽器" name="Web Browser Test"/>
+			<menu_item_call label="網頁內容瀏覽器" name="Web Content Browser"/>
 			<menu_item_call label="Dump SelectMgr" name="Dump SelectMgr"/>
 			<menu_item_call label="傾印收納區" name="Dump Inventory"/>
-			<menu_item_call label="Dump Timers" name="Dump Timers"/>
+			<menu_item_call label="傾印碼錶" name="Dump Timers"/>
 			<menu_item_call label="Dump Focus Holder" name="Dump Focus Holder"/>
 			<menu_item_call label="Print Selected Object Info" name="Print Selected Object Info"/>
 			<menu_item_call label="Print Agent Info" name="Print Agent Info"/>
-			<menu_item_call label="Memory Stats" name="Memory Stats"/>
+			<menu_item_call label="計憶體狀態" name="Memory Stats"/>
 			<menu_item_check label="Region Debug Console" name="Region Debug Console"/>
 			<menu_item_check label="Debug SelectMgr" name="Debug SelectMgr"/>
 			<menu_item_check label="Debug Clicks" name="Debug Clicks"/>
@@ -331,9 +332,9 @@
 			<menu_item_check label="Debug WindowProc" name="Debug WindowProc"/>
 		</menu>
 		<menu label="XUI" name="XUI">
-			<menu_item_call label="Reload Color Settings" name="Reload Color Settings"/>
-			<menu_item_call label="Show Font Test" name="Show Font Test"/>
-			<menu_item_check label="Show XUI Names" name="Show XUI Names"/>
+			<menu_item_call label="重新載入顏色設定" name="Reload Color Settings"/>
+			<menu_item_call label="顯示字型測試" name="Show Font Test"/>
+			<menu_item_check label="顯示 XUI 名稱" name="Show XUI Names"/>
 			<menu_item_call label="送出測試 IMs" name="Send Test IMs"/>
 			<menu_item_call label="沖洗名稱快取資料" name="Flush Names Caches"/>
 		</menu>
@@ -348,12 +349,12 @@
 			<menu label="Character Tests" name="Character Tests">
 				<menu_item_call label="Appearance To XML" name="Appearance To XML"/>
 				<menu_item_call label="Toggle Character Geometry" name="Toggle Character Geometry"/>
-				<menu_item_call label="Test Male" name="Test Male"/>
-				<menu_item_call label="Test Female" name="Test Female"/>
-				<menu_item_call label="Toggle PG" name="Toggle PG"/>
-				<menu_item_check label="Allow Select Avatar" name="Allow Select Avatar"/>
+				<menu_item_call label="男性測試" name="Test Male"/>
+				<menu_item_call label="女性測試" name="Test Female"/>
+				<menu_item_call label="PG 切換" name="Toggle PG"/>
+				<menu_item_check label="允許選擇化身" name="Allow Select Avatar"/>
 			</menu>
-			<menu_item_call label="Force Params to Default" name="Force Params to Default"/>
+			<menu_item_call label="強制參數為預設值" name="Force Params to Default"/>
 			<menu_item_check label="動作資訊" name="Animation Info"/>
 			<menu_item_check label="慢動作" name="Slow Motion Animations"/>
 			<menu_item_check label="顯示注視在" name="Show Look At"/>
diff --git a/indra/newview/skins/default/xui/zh/mime_types.xml b/indra/newview/skins/default/xui/zh/mime_types.xml
index 89fe92fabc..8ac1bf6920 100644
--- a/indra/newview/skins/default/xui/zh/mime_types.xml
+++ b/indra/newview/skins/default/xui/zh/mime_types.xml
@@ -27,10 +27,10 @@
 			圖像
 		</label>
 		<tooltip name="image_tooltip">
-			There is an image at this location
+			有一個圖像在此位置
 		</tooltip>
 		<playtip name="image_playtip">
-			View this location&apos;s image
+			察看這個位置的圖像
 		</playtip>
 	</widgetset>
 	<widgetset name="audio">
@@ -38,10 +38,10 @@
 			音頻
 		</label>
 		<tooltip name="audio_tooltip">
-			There is audio at this location
+			有一個音頻在此位置
 		</tooltip>
 		<playtip name="audio_playtip">
-			Play this location&apos;s audio
+			播放這個硾的音頻
 		</playtip>
 	</widgetset>
 	<scheme name="rtsp">
diff --git a/indra/newview/skins/default/xui/zh/mime_types_linux.xml b/indra/newview/skins/default/xui/zh/mime_types_linux.xml
index 08839abe6a..90f17b841c 100644
--- a/indra/newview/skins/default/xui/zh/mime_types_linux.xml
+++ b/indra/newview/skins/default/xui/zh/mime_types_linux.xml
@@ -30,7 +30,7 @@
 			There is an image at this location
 		</tooltip>
 		<playtip name="image_playtip">
-			View this location&apos;s image
+			察看這個位置的圖像
 		</playtip>
 	</widgetset>
 	<widgetset name="audio">
@@ -38,10 +38,10 @@
 			音頻
 		</label>
 		<tooltip name="audio_tooltip">
-			There is audio at this location
+			有一個音頻在此位置
 		</tooltip>
 		<playtip name="audio_playtip">
-			Play this location&apos;s audio
+			播放這個位置的音頻
 		</playtip>
 	</widgetset>
 	<scheme name="rtsp">
@@ -66,7 +66,7 @@
 	</mimetype>
 	<mimetype name="video/*">
 		<label name="video2_label">
-			Video
+			影片
 		</label>
 	</mimetype>
 	<mimetype name="image/*">
diff --git a/indra/newview/skins/default/xui/zh/mime_types_mac.xml b/indra/newview/skins/default/xui/zh/mime_types_mac.xml
index 7958f64219..b8105c145c 100644
--- a/indra/newview/skins/default/xui/zh/mime_types_mac.xml
+++ b/indra/newview/skins/default/xui/zh/mime_types_mac.xml
@@ -27,10 +27,10 @@
 			圖像
 		</label>
 		<tooltip name="image_tooltip">
-			有一個影像在此位置
+			有一個圖像在此位置
 		</tooltip>
 		<playtip name="image_playtip">
-			察看在此位置的影像
+			察看在此位置的圖像
 		</playtip>
 	</widgetset>
 	<widgetset name="audio">
diff --git a/indra/newview/skins/default/xui/zh/notifications.xml b/indra/newview/skins/default/xui/zh/notifications.xml
index 1c89e9b522..2d309a2af0 100644
--- a/indra/newview/skins/default/xui/zh/notifications.xml
+++ b/indra/newview/skins/default/xui/zh/notifications.xml
@@ -758,16 +758,16 @@ No parcel selected.
 No region selected.
 	</notification>
 	<notification name="CannotReleaseLandNothingSelected">
-		Unable to abandon land:
-No parcel selected.
+		無法放棄土地:
+無地段被選擇。
 	</notification>
 	<notification name="CannotReleaseLandNoRegion">
 		無法放棄土地:
 無法尋找地區。
 	</notification>
 	<notification name="CannotBuyLandNothingSelected">
-		Unable to buy land:
-No parcel selected.
+		無法購買土地:
+無地段被選擇。
 	</notification>
 	<notification name="CannotBuyLandNoRegion">
 		Unable to buy land:
@@ -777,121 +777,121 @@ Cannot find the region this land is in.
 		You cannot close the Buy Land window until [APP_NAME] estimates the price of this transaction.
 	</notification>
 	<notification name="CannotDeedLandNothingSelected">
-		Unable to deed land:
+		無法讓渡土地:
 無地段被選取。
 	</notification>
 	<notification name="CannotDeedLandNoGroup">
-		Unable to deed land:
+		無法讓渡土地:
 無群組被選取。
 	</notification>
 	<notification name="CannotDeedLandNoRegion">
-		Unable to deed land:
-Cannot find the region this land is in.
+		無法讓渡土地:
+無法發現這塊土地所在的地區。
 	</notification>
 	<notification name="CannotDeedLandMultipleSelected">
-		Unable to deed land:
-Multiple parcels selected.
+		無法讓渡土地:
+複數地段被選取。
 
-Try selecting a single parcel.
+請試著選取單一地段。
 	</notification>
 	<notification name="CannotDeedLandWaitingForServer">
-		Unable to deed land:
-Waiting for server to report ownership.
+		無法讓渡土地:
+等候伺服器報告擁有權。
 
-Please try again.
+請再試一次。
 	</notification>
 	<notification name="CannotDeedLandNoTransfer">
-		Unable to deed land:
-The region [REGION] does not allow transfer of land.
+		無法讓渡土地:
+此 [REGION] 地區並不允許土地轉移。
 	</notification>
 	<notification name="CannotReleaseLandWatingForServer">
-		Unable to abandon land:
-Waiting for server to update parcel information.
+		無法放棄土地:
+等候伺服器更新地段資訊。
 
-Try again in a few seconds.
+請稍後幾秒再試一次。
 	</notification>
 	<notification name="CannotReleaseLandSelected">
-		Unable to abandon land:
-You do not own all the parcels selected.
+		無法放棄土地:
+你並位擁有所選擇的全部土地。
 
-Please select a single parcel.
+請選擇一個單一地段。
 	</notification>
 	<notification name="CannotReleaseLandDontOwn">
-		Unable to abandon land:
-You don&apos;t have permission to release this parcel.
-Parcels you own appear in green.
+		無法放棄土地:
+你並沒有權限去釋出這個地段。
+你所擁有的地段將呈現綠色。
 	</notification>
 	<notification name="CannotReleaseLandRegionNotFound">
-		Unable to abandon land:
-Cannot find the region this land is in.
+		無法放棄土地:
+無法發現這快土地所在的地區。
 	</notification>
 	<notification name="CannotReleaseLandNoTransfer">
-		Unable to abandon land:
-The region [REGION] does not allow transfer of land.
+		無法放棄土地:
+此 [REGION] 地區並不許土地轉移。
 	</notification>
 	<notification name="CannotReleaseLandPartialSelection">
-		Unable to abandon land:
-You must select an entire parcel to release it.
+		無法放棄土地:
+你必須選取一整個地段以釋出它。
 
-Select an entire parcel, or divide your parcel first.
+選取一整個地段,或先進行分割。
 	</notification>
 	<notification name="ReleaseLandWarning">
-		You are about to release [AREA] m² of land.
-Releasing this parcel will remove it from your land holdings, but will not grant any L$.
+		你釋出約 [AREA] m² 面積土地。
+釋出個地段將會由你所持有的土地中移除,但不會給予任何 L$。
 
-Release this land?
+你確定要釋出這塊土地?
 		<usetemplate name="okcancelbuttons" notext="取消" yestext="確定"/>
 	</notification>
 	<notification name="CannotDivideLandNothingSelected">
-		Unable to divide land:
+		無法分割土地:
 
-No parcels selected.
+無地段被選取。
 	</notification>
 	<notification name="CannotDivideLandPartialSelection">
-		Unable to divide land:
+		無法分割土地:
 
-You have an entire parcel selected.
-Try selecting a part of the parcel.
+你現在選取整個地段。
+請試著選取其中部分地段。
 	</notification>
 	<notification name="LandDivideWarning">
-		Dividing this land will split this parcel into two and each parcel can have its own settings. Some settings will be reset to defaults after the operation.
+		分割土地會將佌地段一分為二,每一個地段將都各自有其設定。 在這個操作之後,一些設定值將會回復到預設值。
 
-Divide land?
+進行分割土地?
 		<usetemplate name="okcancelbuttons" notext="取消" yestext="確定"/>
 	</notification>
 	<notification name="CannotDivideLandNoRegion">
-		Unable to divide land:
-Cannot find the region this land is in.
+		無法分割土地:
+無法發現這塊土地所在的地區。
 	</notification>
 	<notification name="CannotJoinLandNoRegion">
-		Unable to join land:
-Cannot find the region this land is in.
+		無法合併土地:
+無法發現這塊土地所在的地區。
 	</notification>
 	<notification name="CannotJoinLandNothingSelected">
-		Unable to join land:
-No parcels selected.
+		無法合併土地:
+無地段被選取。
 	</notification>
 	<notification name="CannotJoinLandEntireParcelSelected">
-		Unable to join land:
-You only have one parcel selected.
+		無法合併土地:
+你只有選取一個地段。
 
-Select land across both parcels.
+請跨越兩個地段選取土地。
 	</notification>
 	<notification name="CannotJoinLandSelection">
-		Unable to join land:
-You must select more than one parcel.
+		無法合併土地:
+你必須選取超過一個地段。
 
-Select land across both parcels.
+請跨越兩個地段選取土地。
 	</notification>
 	<notification name="JoinLandWarning">
-		Joining this land will create one large parcel out of all parcels intersecting the selected rectangle.
-You will need to reset the name and options of the new parcel.
+		合併土地將會在選取的全部地段範圍裡產生一個巨大的地段。
+你將會需要重設這個新地段的名稱與設定選項。
 
-Join land?
+進行土地合併?
 		<usetemplate name="okcancelbuttons" notext="取消" yestext="確定"/>
 	</notification>
 	<notification name="ConfirmNotecardSave">
-		This notecard needs to be saved before the item can be copied or viewed. Save notecard?
+		在物品能被覆製或察看前,這記事卡必須先進行儲存。儲存記事卡?
 		<usetemplate name="okcancelbuttons" notext="取消" yestext="確定"/>
 	</notification>
 	<notification name="ConfirmItemCopy">
@@ -1377,7 +1377,7 @@ We must restart [APP_NAME] to install the update.
 	<notification name="DeedObjectToGroup">
 		Deeding this object will cause the group to:
 * Receive L$ paid into the object
-		<usetemplate ignoretext="在我讓渡一個物件給群組前確認" name="okcancelignore" notext="取消" yestext="Deed"/>
+		<usetemplate ignoretext="在我讓渡一個物件給群組前確認" name="okcancelignore" notext="取消" yestext="讓渡"/>
 	</notification>
 	<notification name="WebLaunchExternalTarget">
 		你確定要開啟網頁瀏覽器去察看這個內容?
@@ -1457,7 +1457,7 @@ Chat and instant messages will be hidden. Instant messages will get your Busy mo
 	<notification name="JoinedTooManyGroupsMember">
 		You have reached your maximum number of groups. Please leave another group before joining this one, or decline the offer.
 [NAME] has invited you to join a group as a member.
-		<usetemplate name="okcancelbuttons" notext="Decline" yestext="加入"/>
+		<usetemplate name="okcancelbuttons" notext="謝絕" yestext="加入"/>
 	</notification>
 	<notification name="JoinedTooManyGroups">
 		You have reached your maximum number of groups. Please leave some group before joining or creating a new one.
@@ -1509,12 +1509,12 @@ Chat and instant messages will be hidden. Instant messages will get your Busy mo
 Just like in real life, it takes a while for everyone to learn about a new name.  Please allow several days for [http://wiki.secondlife.com/wiki/Setting_your_display_name your name to update] in objects, scripts, search, etc.
 	</notification>
 	<notification name="SetDisplayNameBlocked">
-		Sorry, you cannot change your display name. If you feel this is in error, please contact support.
+		抱歉,你不可以變更你的顯示名稱。如果你覺得這是錯誤,請連繫支援廠商。
 	</notification>
 	<notification name="SetDisplayNameFailedLength">
-		Sorry, that name is too long.  Display names can have a maximum of [LENGTH] characters.
+		抱歉,這名稱太長。顯示名稱最大長度為 [LENGTH] 字元。
 
-Please try a shorter name.
+請嘗試短一些的名稱。
 	</notification>
 	<notification name="SetDisplayNameFailedGeneric">
 		Sorry, we could not set your display name.  Please try again later.
@@ -1890,7 +1890,7 @@ Move the inventory item(s)?
 	</notification>
 	<notification name="ConfirmQuit">
 		你確定你要結束退出?
-		<usetemplate ignoretext="當我結束退出時進行確認" name="okcancelignore" notext="不結束退出" yestext="結束退出"/>
+		<usetemplate ignoretext="當我結束退出時進行確認" name="okcancelignore" notext="不要結束退出" yestext="結束退出"/>
 	</notification>
 	<notification name="DeleteItems">
 		[QUESTION]
@@ -1941,11 +1941,11 @@ Linden Lab
 		The following required components are missing from [FLOATER]:
 [COMPONENTS]
 	</notification>
-	<notification label="Replace Existing Attachment" name="ReplaceAttachment">
+	<notification label="取代現有的附件" name="ReplaceAttachment">
 		There is already an object attached to this point on your body.
 Do you want to replace it with the selected object?
 		<form name="form">
-			<ignore name="ignore" text="Replace an existing attachment with the selected item"/>
+			<ignore name="ignore" text="以所選擇的物品取代現有的附加物"/>
 			<button ignore="自動取代" name="Yes" text="確定"/>
 			<button ignore="絕不取代" name="No" text="取消"/>
 		</form>
@@ -2109,10 +2109,10 @@ Link to this from a web page to give others easy access to this location, or try
 		Topic: [SUBJECT], Message: [MESSAGE]
 	</notification>
 	<notification name="FriendOnline">
-		[NAME] is Online
+		[NAME] 上線
 	</notification>
 	<notification name="FriendOffline">
-		[NAME] is Offline
+		[NAME] 離線
 	</notification>
 	<notification name="AddSelfFriend">
 		Although you&apos;re very nice, you can&apos;t add yourself as a friend.
@@ -2208,7 +2208,7 @@ Please select a single object.
 		[NAME] 接收到你提供的收納區物品。
 	</notification>
 	<notification name="InventoryDeclined">
-		[NAME] 拒絕你提供的收納區物品。
+		[NAME] 謝絕你提供的收納區物品。
 	</notification>
 	<notification name="ObjectMessage">
 		[NAME]: [MESSAGE]
@@ -2418,7 +2418,7 @@ Please try again in a few moments.
 	</notification>
 	<notification name="ObjectGiveItem">
 		An object named &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; owned by [NAME_SLURL] has given you this [OBJECTTYPE]:
-&lt;nolink&gt;[ITEM_SLURL]&lt;/nolink&gt;
+[ITEM_SLURL]
 		<form name="form">
 			<button name="Keep" text="Keep"/>
 			<button name="Discard" text="Discard"/>
@@ -2443,7 +2443,7 @@ Please try again in a few moments.
 		[MESSAGE]
 		<form name="form">
 			<button name="Join" text="加入"/>
-			<button name="Decline" text="Decline"/>
+			<button name="Decline" text="謝絕"/>
 			<button name="Info" text="資訊"/>
 		</form>
 	</notification>
@@ -2475,7 +2475,7 @@ Please try again in a few moments.
 (By default, you will be able to see each other&apos;s online status.)
 		<form name="form">
 			<button name="Accept" text="接受"/>
-			<button name="Decline" text="Decline"/>
+			<button name="Decline" text="謝絕"/>
 		</form>
 	</notification>
 	<notification name="FriendshipOffered">
@@ -2487,27 +2487,27 @@ Please try again in a few moments.
 (By default, you will be able to see each other&apos;s online status.)
 		<form name="form">
 			<button name="Accept" text="接受"/>
-			<button name="Decline" text="Decline"/>
+			<button name="Decline" text="謝絕"/>
 		</form>
 	</notification>
 	<notification name="FriendshipAccepted">
 		[NAME] accepted your friendship offer.
 	</notification>
 	<notification name="FriendshipDeclined">
-		[NAME] declined your friendship offer.
+		[NAME] 謝絕你的交友邀請。
 	</notification>
 	<notification name="FriendshipAcceptedByMe">
-		Friendship offer accepted.
+		交友邀請被接受。
 	</notification>
 	<notification name="FriendshipDeclinedByMe">
-		Friendship offer declined.
+		交友邀請被謝絕。
 	</notification>
 	<notification name="OfferCallingCard">
 		[NAME] is offering their calling card.
 This will add a bookmark in your inventory so you can quickly IM this Resident.
 		<form name="form">
 			<button name="Accept" text="接受"/>
-			<button name="Decline" text="Decline"/>
+			<button name="Decline" text="謝絕"/>
 		</form>
 	</notification>
 	<notification name="RegionRestartMinutes">
@@ -2559,7 +2559,7 @@ Grant this request?
 		<form name="form">
 			<button name="Grant" text="Grant"/>
 			<button name="Deny" text="Deny"/>
-			<button name="Details" text="Details..."/>
+			<button name="Details" text="細節..."/>
 		</form>
 	</notification>
 	<notification name="ScriptDialog">
@@ -2602,7 +2602,7 @@ Things you build here will be deleted after you leave, so don&apos;t forget to r
 Click Accept to join the call or Decline to decline the invitation. Click Block to block this caller.
 		<form name="form">
 			<button name="Accept" text="接受"/>
-			<button name="Decline" text="Decline"/>
+			<button name="Decline" text="謝絕"/>
 			<button name="Mute" text="Block"/>
 		</form>
 	</notification>
@@ -2620,7 +2620,7 @@ Click Accept to join the call or Decline to decline the invitation. Click Block
 Click Accept to join the call or Decline to decline the invitation. Click Block to block this caller.
 		<form name="form">
 			<button name="Accept" text="接受"/>
-			<button name="Decline" text="Decline"/>
+			<button name="Decline" text="謝絕"/>
 			<button name="Mute" text="Block"/>
 		</form>
 	</notification>
@@ -2629,7 +2629,7 @@ Click Accept to join the call or Decline to decline the invitation. Click Block
 Click Accept to join the call or Decline to decline the invitation. Click Block to block this caller.
 		<form name="form">
 			<button name="Accept" text="接受"/>
-			<button name="Decline" text="Decline"/>
+			<button name="Decline" text="謝絕"/>
 			<button name="Mute" text="Block"/>
 		</form>
 	</notification>
@@ -2638,7 +2638,7 @@ Click Accept to join the call or Decline to decline the invitation. Click Block
 Click Accept to join the chat or Decline to decline the invitation. Click Block to block this caller.
 		<form name="form">
 			<button name="Accept" text="接受"/>
-			<button name="Decline" text="Decline"/>
+			<button name="Decline" text="謝絕"/>
 			<button name="Mute" text="Block"/>
 		</form>
 	</notification>
@@ -2757,10 +2757,10 @@ With the following Residents:
 		<usetemplate name="okcancelbuttons" notext="取消" yestext="確定"/>
 	</notification>
 	<notification name="ItemsShared">
-		Items successfully shared.
+		物品已成功分享。
 	</notification>
 	<notification name="DeedToGroupFail">
-		Deed to group failed.
+		讓渡給群組失敗。
 	</notification>
 	<notification name="AvatarRezNotification">
 		( [EXISTENCE] seconds alive )
@@ -2822,7 +2822,7 @@ You uploaded a [RESOLUTION] baked texture for &apos;[BODYREGION]&apos; after [TI
 You locally updated a [RESOLUTION] baked texture for &apos;[BODYREGION]&apos; after [TIME] seconds.
 	</notification>
 	<notification name="ConfirmLeaveCall">
-		Are you sure you want to leave this call?
+		你確定要離開這段通話?
 		<usetemplate ignoretext="我結束通話前進行確認" name="okcancelignore" notext="否" yestext="是"/>
 	</notification>
 	<notification name="ConfirmMuteAll">
@@ -2846,7 +2846,7 @@ Click on the up arrow to see the voice control panel.
 
 Hiding the Speak button will disable the voice feature.
 	</notification>
-	<notification label="Explore the World" name="HintDestinationGuide">
+	<notification label="探索世界" name="HintDestinationGuide">
 		The Destination Guide contains thousands of new places to discover. Select a location and choose Teleport to start exploring.
 	</notification>
 	<notification label="側邊欄" name="HintSidePanel">
@@ -2862,7 +2862,7 @@ Click anywhere on the ground to walk to that spot.
 2. Click and Drag to Rotate View
 Click and drag anywhere on the world to rotate your view
 	</notification>
-	<notification label="Display Name" name="HintDisplayName">
+	<notification label="顯示名稱" name="HintDisplayName">
 		Set your customizable display name here. This is in addition to your unique username, which can&apos;t be changed. You can change how you see other people&apos;s names in your preferences.
 	</notification>
 	<notification label="View" name="HintView">
@@ -2871,7 +2871,7 @@ Click and drag anywhere on the world to rotate your view
 	<notification label="收納區" name="HintInventory">
 		Check your inventory to find items. Newest items can be easily found in the Recent tab.
 	</notification>
-	<notification label="You&apos;ve got Linden Dollars!" name="HintLindenDollar">
+	<notification label="你得到林登幣!" name="HintLindenDollar">
 		Here&apos;s your current balance of L$. Click Buy L$ to purchase more Linden Dollars.
 	</notification>
 	<notification name="PopupAttempt">
@@ -2892,38 +2892,38 @@ Click and drag anywhere on the world to rotate your view
 	</notification>
 	<notification label="" name="ModeChange">
 		改變劉覽器模式要求你必須結束退出並重新啟動。
-		<usetemplate name="okcancelbuttons" notext="不結束退出" yestext="結束退出"/>
+		<usetemplate name="okcancelbuttons" notext="不要結束退出" yestext="結束退出"/>
 	</notification>
 	<notification label="" name="NoClassifieds">
 		Creation and editing of Classifieds is only available in Advanced mode. Would you like to quit and change modes? The mode selector can be found on the login screen.
-		<usetemplate name="okcancelbuttons" notext="不結束退出" yestext="結束退出"/>
+		<usetemplate name="okcancelbuttons" notext="不要結束退出" yestext="結束退出"/>
 	</notification>
 	<notification label="" name="NoGroupInfo">
 		Creation and editing of Groups is only available in Advanced mode. Would you like to quit and change modes? The mode selector can be found on the login screen.
-		<usetemplate name="okcancelbuttons" notext="不結束退出" yestext="結束退出"/>
+		<usetemplate name="okcancelbuttons" notext="不要結束退出" yestext="結束退出"/>
 	</notification>
 	<notification label="" name="NoPicks">
 		Creation and editing of Picks is only available in Advanced mode. Would you like to quit and change modes? The mode selector can be found on the login screen.
-		<usetemplate name="okcancelbuttons" notext="不結束退出" yestext="結束退出"/>
+		<usetemplate name="okcancelbuttons" notext="不要結束退出" yestext="結束退出"/>
 	</notification>
 	<notification label="" name="NoWorldMap">
 		Viewing of the world map is only available in Advanced mode. Would you like to quit and change modes? The mode selector can be found on the login screen.
-		<usetemplate name="okcancelbuttons" notext="不結束退出" yestext="結束退出"/>
+		<usetemplate name="okcancelbuttons" notext="不要結束退出" yestext="結束退出"/>
 	</notification>
 	<notification label="" name="NoVoiceCall">
 		Voice calls are only available in Advanced mode. Would you like to logout and change modes?
-		<usetemplate name="okcancelbuttons" notext="不結束退出" yestext="結束退出"/>
+		<usetemplate name="okcancelbuttons" notext="不要結束退出" yestext="結束退出"/>
 	</notification>
 	<notification label="" name="NoAvatarShare">
 		Sharing is only available in Advanced mode. Would you like to logout and change modes?
-		<usetemplate name="okcancelbuttons" notext="不結束退出" yestext="結束退出"/>
+		<usetemplate name="okcancelbuttons" notext="不要結束退出" yestext="結束退出"/>
 	</notification>
 	<notification label="" name="NoAvatarPay">
 		Paying other residents is only available in Advanced mode. Would you like to logout and change modes?
-		<usetemplate name="okcancelbuttons" notext="不結束退出" yestext="結束退出"/>
+		<usetemplate name="okcancelbuttons" notext="不要結束退出" yestext="結束退出"/>
 	</notification>
 	<global name="UnsupportedCPU">
-		- Your CPU speed does not meet the minimum requirements.
+		- 你的 CPU 運算速度未達到系統最低配備要求。
 	</global>
 	<global name="UnsupportedGLRequirements">
 		You do not appear to have the proper hardware requirements for [APP_NAME]. [APP_NAME] requires an OpenGL graphics card that has multitexture support. If this is the case, you may want to make sure that you have the latest drivers for your graphics card, and service packs and patches for your operating system.
@@ -2940,7 +2940,7 @@ If you continue to have problems, please visit the [SUPPORT_SITE].
 		- 你的顯示卡未達系統最低配備要求。
 	</global>
 	<global name="UnsupportedRAM">
-		- Your system memory does not meet the minimum requirements.
+		- 你的系統記憶體卡未達系統最低配備要求。
 	</global>
 	<global name="You can only set your &apos;Home Location&apos; on your land or at a mainland Infohub.">
 		若你擁有一塊土地,你可以標記它成為你的家的位置。
diff --git a/indra/newview/skins/default/xui/zh/panel_bottomtray.xml b/indra/newview/skins/default/xui/zh/panel_bottomtray.xml
index 2b0cd7c0a6..734b83e6cc 100644
--- a/indra/newview/skins/default/xui/zh/panel_bottomtray.xml
+++ b/indra/newview/skins/default/xui/zh/panel_bottomtray.xml
@@ -16,7 +16,7 @@
 			<bottomtray_button label="移動" name="movement_btn" tool_tip="顯示 / 隱藏 移動控制"/>
 		</layout_panel>
 		<layout_panel name="cam_panel">
-			<bottomtray_button label="View" name="camera_btn" tool_tip="顯示 / 隱藏 攝影機控制"/>
+			<bottomtray_button label="視角" name="camera_btn" tool_tip="顯示 / 隱藏 攝影機控制"/>
 		</layout_panel>
 		<layout_panel name="snapshot_panel">
 			<bottomtray_button name="snapshots" tool_tip="拍攝快照"/>
diff --git a/indra/newview/skins/default/xui/zh/panel_edit_alpha.xml b/indra/newview/skins/default/xui/zh/panel_edit_alpha.xml
index 6b17302bf1..eda4e99a13 100644
--- a/indra/newview/skins/default/xui/zh/panel_edit_alpha.xml
+++ b/indra/newview/skins/default/xui/zh/panel_edit_alpha.xml
@@ -2,11 +2,11 @@
 <panel name="edit_alpha_panel">
 	<scroll_container name="avatar_alpha_color_panel_scroll">
 		<panel name="avatar_alpha_color_panel">
-			<texture_picker label="下半身半透明" name="Lower Alpha" tool_tip="點擊以挑選圖片"/>
-			<texture_picker label="上半身半透明" name="Upper Alpha" tool_tip="點擊以挑選圖片"/>
-			<texture_picker label="頭部半透明" name="Head Alpha" tool_tip="點擊以挑選圖片"/>
-			<texture_picker label="眼睛半透明" name="Eye Alpha" tool_tip="點擊以挑選圖片"/>
-			<texture_picker label="頭髮半透明" name="Hair Alpha" tool_tip="點擊以挑選圖片"/>
+			<texture_picker label="下半身半透明" name="Lower Alpha" tool_tip="點擊以挑選圖像"/>
+			<texture_picker label="上半身半透明" name="Upper Alpha" tool_tip="點擊以挑選圖像"/>
+			<texture_picker label="頭部半透明" name="Head Alpha" tool_tip="點擊以挑選圖像"/>
+			<texture_picker label="眼睛半透明" name="Eye Alpha" tool_tip="點擊以挑選圖像"/>
+			<texture_picker label="頭髮半透明" name="Hair Alpha" tool_tip="點擊以挑選圖像"/>
 		</panel>
 	</scroll_container>
 </panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_edit_eyes.xml b/indra/newview/skins/default/xui/zh/panel_edit_eyes.xml
index 99e2874319..40dd61971a 100644
--- a/indra/newview/skins/default/xui/zh/panel_edit_eyes.xml
+++ b/indra/newview/skins/default/xui/zh/panel_edit_eyes.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="edit_eyes_panel">
 	<panel name="avatar_eye_color_panel">
-		<texture_picker label="Iris" name="Iris" tool_tip="點擊以挑選圖片"/>
+		<texture_picker label="Iris" name="Iris" tool_tip="點擊以挑選圖像"/>
 	</panel>
 	<panel name="accordion_panel">
 		<accordion name="wearable_accordion">
diff --git a/indra/newview/skins/default/xui/zh/panel_edit_gloves.xml b/indra/newview/skins/default/xui/zh/panel_edit_gloves.xml
index 9c542366bc..7b39e33a9b 100644
--- a/indra/newview/skins/default/xui/zh/panel_edit_gloves.xml
+++ b/indra/newview/skins/default/xui/zh/panel_edit_gloves.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="edit_gloves_panel">
 	<panel name="avatar_gloves_color_panel">
-		<texture_picker label="材質" name="Fabric" tool_tip="點擊以挑選圖片"/>
+		<texture_picker label="材質" name="Fabric" tool_tip="點擊以挑選圖像"/>
 		<color_swatch label="Color/Tint" name="Color/Tint" tool_tip="Click to open color picker"/>
 	</panel>
 	<panel name="accordion_panel">
diff --git a/indra/newview/skins/default/xui/zh/panel_edit_hair.xml b/indra/newview/skins/default/xui/zh/panel_edit_hair.xml
index d9ddafac3b..a7440093bc 100644
--- a/indra/newview/skins/default/xui/zh/panel_edit_hair.xml
+++ b/indra/newview/skins/default/xui/zh/panel_edit_hair.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="edit_hair_panel">
 	<panel name="avatar_hair_color_panel">
-		<texture_picker label="材質" name="Texture" tool_tip="點擊以挑選圖片"/>
+		<texture_picker label="材質" name="Texture" tool_tip="點擊以挑選圖像"/>
 	</panel>
 	<panel name="accordion_panel">
 		<accordion name="wearable_accordion">
diff --git a/indra/newview/skins/default/xui/zh/panel_edit_jacket.xml b/indra/newview/skins/default/xui/zh/panel_edit_jacket.xml
index df85f7deb2..dcef070e2e 100644
--- a/indra/newview/skins/default/xui/zh/panel_edit_jacket.xml
+++ b/indra/newview/skins/default/xui/zh/panel_edit_jacket.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="edit_jacket_panel">
 	<panel name="avatar_jacket_color_panel">
-		<texture_picker label="上半身材質" name="Upper Fabric" tool_tip="點擊以挑選圖片"/>
-		<texture_picker label="下半身材質" name="Lower Fabric" tool_tip="點擊以挑選圖片"/>
+		<texture_picker label="上半身材質" name="Upper Fabric" tool_tip="點擊以挑選圖像"/>
+		<texture_picker label="下半身材質" name="Lower Fabric" tool_tip="點擊以挑選圖像"/>
 		<color_swatch label="Color/Tint" name="Color/Tint" tool_tip="Click to open color picker"/>
 	</panel>
 	<panel name="accordion_panel">
diff --git a/indra/newview/skins/default/xui/zh/panel_edit_pants.xml b/indra/newview/skins/default/xui/zh/panel_edit_pants.xml
index 76560256f7..01b875f1bd 100644
--- a/indra/newview/skins/default/xui/zh/panel_edit_pants.xml
+++ b/indra/newview/skins/default/xui/zh/panel_edit_pants.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="edit_pants_panel">
 	<panel name="avatar_pants_color_panel">
-		<texture_picker label="材質" name="Fabric" tool_tip="點擊以挑選圖片"/>
+		<texture_picker label="材質" name="Fabric" tool_tip="點擊以挑選圖像"/>
 		<color_swatch label="Color/Tint" name="Color/Tint" tool_tip="點擊以開啟顏色挑選器"/>
 	</panel>
 	<panel name="accordion_panel">
diff --git a/indra/newview/skins/default/xui/zh/panel_edit_profile.xml b/indra/newview/skins/default/xui/zh/panel_edit_profile.xml
index 2258e51b85..7734c3a417 100644
--- a/indra/newview/skins/default/xui/zh/panel_edit_profile.xml
+++ b/indra/newview/skins/default/xui/zh/panel_edit_profile.xml
@@ -26,9 +26,9 @@
 	<scroll_container name="profile_scroll">
 		<panel name="scroll_content_panel">
 			<panel name="data_panel">
-				<text name="display_name_label" value="Display Name:"/>
+				<text name="display_name_label" value="顯示名稱:"/>
 				<text name="solo_username_label" value="使用者名稱:"/>
-				<button name="set_name" tool_tip="Set Display Name"/>
+				<button name="set_name" tool_tip="設定顯示名稱"/>
 				<text name="user_label" value="使用者名稱:"/>
 				<panel name="lifes_images_panel">
 					<panel name="second_life_image_panel">
diff --git a/indra/newview/skins/default/xui/zh/panel_edit_shirt.xml b/indra/newview/skins/default/xui/zh/panel_edit_shirt.xml
index ecfc1e2fad..f8ff76aa9b 100644
--- a/indra/newview/skins/default/xui/zh/panel_edit_shirt.xml
+++ b/indra/newview/skins/default/xui/zh/panel_edit_shirt.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="edit_shirt_panel">
 	<panel name="avatar_shirt_color_panel">
-		<texture_picker label="材質" name="Fabric" tool_tip="點擊以挑選圖片"/>
+		<texture_picker label="材質" name="Fabric" tool_tip="點擊以挑選圖像"/>
 		<color_swatch label="Color/Tint" name="Color/Tint" tool_tip="點擊以開啟顏色挑選器"/>
 	</panel>
 	<panel name="accordion_panel">
diff --git a/indra/newview/skins/default/xui/zh/panel_edit_shoes.xml b/indra/newview/skins/default/xui/zh/panel_edit_shoes.xml
index 675caf9e2e..97e43f5753 100644
--- a/indra/newview/skins/default/xui/zh/panel_edit_shoes.xml
+++ b/indra/newview/skins/default/xui/zh/panel_edit_shoes.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="edit_shoes_panel">
 	<panel name="avatar_shoes_color_panel">
-		<texture_picker label="材質" name="Fabric" tool_tip="點擊以挑選圖片"/>
+		<texture_picker label="材質" name="Fabric" tool_tip="點擊以挑選圖像"/>
 		<color_swatch label="顏色/色調" name="Color/Tint" tool_tip="點擊以開啟顏色挑選器"/>
 	</panel>
 	<panel name="accordion_panel">
diff --git a/indra/newview/skins/default/xui/zh/panel_edit_skin.xml b/indra/newview/skins/default/xui/zh/panel_edit_skin.xml
index 22f0279060..fdd6d05ca5 100644
--- a/indra/newview/skins/default/xui/zh/panel_edit_skin.xml
+++ b/indra/newview/skins/default/xui/zh/panel_edit_skin.xml
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="edit_skin_panel">
 	<panel name="avatar_skin_color_panel">
-		<texture_picker label="Head Tattoos" name="Head Tattoos" tool_tip="點擊以挑選圖片"/>
-		<texture_picker label="Upper Tattoos" name="Upper Tattoos" tool_tip="點擊以挑選圖片"/>
-		<texture_picker label="Lower Tattoos" name="Lower Tattoos" tool_tip="點擊以挑選圖片"/>
+		<texture_picker label="Head Tattoos" name="Head Tattoos" tool_tip="點擊以挑選圖像"/>
+		<texture_picker label="Upper Tattoos" name="Upper Tattoos" tool_tip="點擊以挑選圖像"/>
+		<texture_picker label="Lower Tattoos" name="Lower Tattoos" tool_tip="點擊以挑選圖像"/>
 	</panel>
 	<panel name="accordion_panel">
 		<accordion name="wearable_accordion">
diff --git a/indra/newview/skins/default/xui/zh/panel_edit_skirt.xml b/indra/newview/skins/default/xui/zh/panel_edit_skirt.xml
index 5c46f94fe9..10432c16b1 100644
--- a/indra/newview/skins/default/xui/zh/panel_edit_skirt.xml
+++ b/indra/newview/skins/default/xui/zh/panel_edit_skirt.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="edit_skirt_panel">
 	<panel name="avatar_skirt_color_panel">
-		<texture_picker label="材質" name="Fabric" tool_tip="點擊以挑選圖片"/>
+		<texture_picker label="材質" name="Fabric" tool_tip="點擊以挑選圖像"/>
 		<color_swatch label="Color/Tint" name="Color/Tint" tool_tip="點擊以開啟顏色挑選器"/>
 	</panel>
 	<panel name="accordion_panel">
diff --git a/indra/newview/skins/default/xui/zh/panel_edit_socks.xml b/indra/newview/skins/default/xui/zh/panel_edit_socks.xml
index 09c888f226..6727781740 100644
--- a/indra/newview/skins/default/xui/zh/panel_edit_socks.xml
+++ b/indra/newview/skins/default/xui/zh/panel_edit_socks.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="edit_socks_panel">
 	<panel name="avatar_socks_color_panel">
-		<texture_picker label="材質" name="Fabric" tool_tip="點擊以挑選圖片"/>
+		<texture_picker label="材質" name="Fabric" tool_tip="點擊以挑選圖像"/>
 		<color_swatch label="Color/Tint" name="Color/Tint" tool_tip="點擊以開啟顏色挑選器"/>
 	</panel>
 	<panel name="accordion_panel">
diff --git a/indra/newview/skins/default/xui/zh/panel_edit_tattoo.xml b/indra/newview/skins/default/xui/zh/panel_edit_tattoo.xml
index 946f8b22dc..1b34a0e0ee 100644
--- a/indra/newview/skins/default/xui/zh/panel_edit_tattoo.xml
+++ b/indra/newview/skins/default/xui/zh/panel_edit_tattoo.xml
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="edit_tattoo_panel">
 	<panel name="avatar_tattoo_color_panel">
-		<texture_picker label="頭部刺青" name="Head Tattoo" tool_tip="點擊以挑選圖片"/>
+		<texture_picker label="頭部刺青" name="Head Tattoo" tool_tip="點擊以挑選圖像"/>
 		<texture_picker label="上半身刺青" name="Upper Tattoo" tool_tip="點擊以挑選照片"/>
-		<texture_picker label="下半身刺青" name="Lower Tattoo" tool_tip="點擊以挑選圖片"/>
+		<texture_picker label="下半身刺青" name="Lower Tattoo" tool_tip="點擊以挑選圖像"/>
 		<color_swatch label="Color/Tint" name="Color/Tint" tool_tip="點擊以開啟顏色挑選器"/>
 	</panel>
 </panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_edit_underpants.xml b/indra/newview/skins/default/xui/zh/panel_edit_underpants.xml
index 82ab70bafc..15cae8d233 100644
--- a/indra/newview/skins/default/xui/zh/panel_edit_underpants.xml
+++ b/indra/newview/skins/default/xui/zh/panel_edit_underpants.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="edit_underpants_panel">
 	<panel name="avatar_underpants_color_panel">
-		<texture_picker label="材質" name="Fabric" tool_tip="點擊以挑選圖片"/>
+		<texture_picker label="材質" name="Fabric" tool_tip="點擊以挑選圖像"/>
 		<color_swatch label="Color/Tint" name="Color/Tint" tool_tip="Click to open color picker"/>
 	</panel>
 	<panel name="accordion_panel">
diff --git a/indra/newview/skins/default/xui/zh/panel_edit_undershirt.xml b/indra/newview/skins/default/xui/zh/panel_edit_undershirt.xml
index b284668777..486175eb64 100644
--- a/indra/newview/skins/default/xui/zh/panel_edit_undershirt.xml
+++ b/indra/newview/skins/default/xui/zh/panel_edit_undershirt.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="edit_undershirt_panel">
 	<panel name="avatar_undershirt_color_panel">
-		<texture_picker label="材質" name="Fabric" tool_tip="點擊以挑選圖片"/>
+		<texture_picker label="材質" name="Fabric" tool_tip="點擊以挑選圖像"/>
 		<color_swatch label="Color/Tint" name="Color/Tint" tool_tip="Click to open Color Picker"/>
 	</panel>
 	<panel name="accordion_panel">
diff --git a/indra/newview/skins/default/xui/zh/panel_group_general.xml b/indra/newview/skins/default/xui/zh/panel_group_general.xml
index f70fbf22a8..55cbf5a617 100644
--- a/indra/newview/skins/default/xui/zh/panel_group_general.xml
+++ b/indra/newview/skins/default/xui/zh/panel_group_general.xml
@@ -12,7 +12,7 @@ Hover your mouse over the options for more help.
 		Retrieving member data
 	</panel.string>
 	<panel name="group_info_top">
-		<texture_picker label="" name="insignia" tool_tip="點擊以挑選圖片"/>
+		<texture_picker label="" name="insignia" tool_tip="點擊以挑選圖像"/>
 		<text name="prepend_founded_by">
 			創辦人:
 		</text>
@@ -52,6 +52,6 @@ Hover your mouse over the options for more help.
 			<combo_box.item label="適度成人內容" name="mature"/>
 			<combo_box.item label="一般普級內容" name="pg"/>
 		</combo_box>
-		<check_box initial_value="true" label="顯示在搜尋中" name="show_in_group_list" tool_tip="Let people see this group in search results"/>
+		<check_box initial_value="true" label="顯示在搜尋中" name="show_in_group_list" tool_tip="讓其他人可以在搜尋結果中看到這個群組"/>
 	</panel>
 </panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_group_land_money.xml b/indra/newview/skins/default/xui/zh/panel_group_land_money.xml
index 1bf3929683..5ac7410c8b 100644
--- a/indra/newview/skins/default/xui/zh/panel_group_land_money.xml
+++ b/indra/newview/skins/default/xui/zh/panel_group_land_money.xml
@@ -52,7 +52,7 @@
 			m²
 		</text>
 		<text name="your_contribution_max_value">
-			([AMOUNT] max)
+			([AMOUNT] 最大)
 		</text>
 		<text name="group_over_limit_text">
 			More land credits are needed to support land in use
@@ -67,14 +67,14 @@
 				載入中...
 			</text_editor>
 		</panel>
-		<panel label="DETAILS" name="group_money_details_tab">
+		<panel label="細節" name="group_money_details_tab">
 			<text_editor name="group_money_details_text">
 				載入中...
 			</text_editor>
 			<button name="earlier_details_button" tool_tip="Back"/>
 			<button name="later_details_button" tool_tip="Next"/>
 		</panel>
-		<panel label="SALES" name="group_money_sales_tab">
+		<panel label="銷售" name="group_money_sales_tab">
 			<text_editor name="group_money_sales_text">
 				載入中...
 			</text_editor>
diff --git a/indra/newview/skins/default/xui/zh/panel_main_inventory.xml b/indra/newview/skins/default/xui/zh/panel_main_inventory.xml
index f7dada226f..53ecf3eb19 100644
--- a/indra/newview/skins/default/xui/zh/panel_main_inventory.xml
+++ b/indra/newview/skins/default/xui/zh/panel_main_inventory.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Things" name="main inventory panel">
+<panel label="事物" name="main inventory panel">
 	<panel.string name="ItemcountFetching">
 		Fetching [ITEM_COUNT] Items... [FILTER]
 	</panel.string>
diff --git a/indra/newview/skins/default/xui/zh/panel_media_settings_general.xml b/indra/newview/skins/default/xui/zh/panel_media_settings_general.xml
index 3e44f2a584..321c003acd 100644
--- a/indra/newview/skins/default/xui/zh/panel_media_settings_general.xml
+++ b/indra/newview/skins/default/xui/zh/panel_media_settings_general.xml
@@ -17,8 +17,8 @@
 	<button label="重設" name="current_url_reset_btn"/>
 	<check_box initial_value="false" label="Auto Loop" name="auto_loop"/>
 	<check_box initial_value="false" label="First Click Interacts" name="first_click_interact"/>
-	<check_box initial_value="false" label="Auto Zoom" name="auto_zoom"/>
-	<check_box initial_value="false" label="Auto Play Media" name="auto_play"/>
+	<check_box initial_value="false" label="自動縮放" name="auto_zoom"/>
+	<check_box initial_value="false" label="自動播放媒體" name="auto_play"/>
 	<text name="media_setting_note">
 		Note: Residents can override this setting
 	</text>
diff --git a/indra/newview/skins/default/xui/zh/panel_media_settings_permissions.xml b/indra/newview/skins/default/xui/zh/panel_media_settings_permissions.xml
index ec62b61c54..173edc76f6 100644
--- a/indra/newview/skins/default/xui/zh/panel_media_settings_permissions.xml
+++ b/indra/newview/skins/default/xui/zh/panel_media_settings_permissions.xml
@@ -14,16 +14,16 @@
 	<text name="owner_label">
 		擁有者
 	</text>
-	<check_box initial_value="false" label="Allow Navigation &amp; Interactivity" name="perms_owner_interact"/>
+	<check_box initial_value="false" label="允許導航與互動" name="perms_owner_interact"/>
 	<check_box initial_value="false" label="顯示控制列" name="perms_owner_control"/>
 	<text name="group_label">
 		群組:
 	</text>
-	<check_box initial_value="false" label="Allow Navigation &amp; Interactivity" name="perms_group_interact"/>
+	<check_box initial_value="false" label="允許導航與互動" name="perms_group_interact"/>
 	<check_box initial_value="false" label="顯示控制列" name="perms_group_control"/>
 	<text name="anyone_label">
 		任何人
 	</text>
-	<check_box initial_value="false" label="Allow Navigation &amp; Interactivity" name="perms_anyone_interact"/>
+	<check_box initial_value="false" label="允許導航與互動" name="perms_anyone_interact"/>
 	<check_box initial_value="false" label="顯示控制列" name="perms_anyone_control"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_my_profile.xml b/indra/newview/skins/default/xui/zh/panel_my_profile.xml
index e26ccdef73..79817d7be9 100644
--- a/indra/newview/skins/default/xui/zh/panel_my_profile.xml
+++ b/indra/newview/skins/default/xui/zh/panel_my_profile.xml
@@ -31,7 +31,7 @@
 							User name
 						</text>
 						<text name="name_descr_text">
-							Display Name
+							顯示名稱
 						</text>
 						<button label="檔案" name="see_profile_btn" tool_tip="察看這位化身的檔案"/>
 					</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_notes.xml b/indra/newview/skins/default/xui/zh/panel_notes.xml
index 5d0e6760ff..875c6bb328 100644
--- a/indra/newview/skins/default/xui/zh/panel_notes.xml
+++ b/indra/newview/skins/default/xui/zh/panel_notes.xml
@@ -15,7 +15,7 @@
 		<layout_panel name="notes_buttons_panel">
 			<layout_stack name="bottom_bar_ls">
 				<layout_panel name="add_friend_btn_lp">
-					<button label="加為朋友" name="add_friend" tool_tip="Offer friendship to the Resident"/>
+					<button label="加為朋友" name="add_friend" tool_tip="向這個居民提出交友邀請"/>
 				</layout_panel>
 				<layout_panel name="im_btn_lp">
 					<button label="IM" name="im" tool_tip="開啟即時訊息會話"/>
@@ -24,7 +24,7 @@
 					<button label="通話" name="call" tool_tip="與這位居民通話"/>
 				</layout_panel>
 				<layout_panel name="show_on_map_btn_lp">
-					<button label="地圖" name="show_on_map_btn" tool_tip="Show the Resident on the map"/>
+					<button label="地圖" name="show_on_map_btn" tool_tip="在地圖上顯示這個居民"/>
 				</layout_panel>
 				<layout_panel name="teleport_btn_lp">
 					<button label="瞬間傳送" name="teleport" tool_tip="發給瞬間傳送請求"/>
diff --git a/indra/newview/skins/default/xui/zh/panel_outfits_inventory.xml b/indra/newview/skins/default/xui/zh/panel_outfits_inventory.xml
index dfd81a85cc..d9718d8294 100644
--- a/indra/newview/skins/default/xui/zh/panel_outfits_inventory.xml
+++ b/indra/newview/skins/default/xui/zh/panel_outfits_inventory.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Things" name="Outfits">
+<panel label="事物" name="Outfits">
 	<panel.string name="wear_outfit_tooltip">
 		穿上所選擇的裝扮
 	</panel.string>
diff --git a/indra/newview/skins/default/xui/zh/panel_people.xml b/indra/newview/skins/default/xui/zh/panel_people.xml
index c97ff2ae96..9c265622fa 100644
--- a/indra/newview/skins/default/xui/zh/panel_people.xml
+++ b/indra/newview/skins/default/xui/zh/panel_people.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <!-- Side tray panel -->
-<panel label="People" name="people_panel">
+<panel label="人群" name="people_panel">
 	<string name="no_recent_people" value="No recent people. Looking for people to hang out with? Try [secondlife:///app/search/people Search] or the [secondlife:///app/worldmap World Map]."/>
 	<string name="no_filtered_recent_people" value="Didn&apos;t find what you&apos;re looking for? Try [secondlife:///app/search/people/[SEARCH_TERM] Search]."/>
 	<string name="no_one_near" value="No one nearby. Looking for people to hang out with? Try [secondlife:///app/search/people Search] or the [secondlife:///app/worldmap World Map]."/>
diff --git a/indra/newview/skins/default/xui/zh/panel_place_profile.xml b/indra/newview/skins/default/xui/zh/panel_place_profile.xml
index d7bcb0d027..1772b65434 100644
--- a/indra/newview/skins/default/xui/zh/panel_place_profile.xml
+++ b/indra/newview/skins/default/xui/zh/panel_place_profile.xml
@@ -66,7 +66,7 @@
 						<text name="build_value" value="On"/>
 						<text name="scripts_label" value="腳本:"/>
 						<text name="scripts_value" value="On"/>
-						<text name="damage_label" value="商害:"/>
+						<text name="damage_label" value="傷害:"/>
 						<text name="damage_value" value="Off"/>
 						<button label="關於土地" name="about_land_btn"/>
 					</panel>
@@ -102,11 +102,11 @@
 						<text name="sales_price_label" value="價格:"/>
 						<text name="area_label" value="面積:"/>
 						<text name="traffic_label" value="流量:"/>
-						<text name="primitives_label" value="Primitives:"/>
+						<text name="primitives_label" value="幾何元件:"/>
 						<text name="parcel_scripts_label" value="腳本:"/>
 						<text name="terraform_limits_label" value="土地變形限制:"/>
 						<text name="subdivide_label" value="分割土地/合併土地能力:"/>
-						<text name="resale_label" value="ReSale ability:"/>
+						<text name="resale_label" value="轉售能力:"/>
 						<text name="sale_to_label" value="出售給:"/>
 					</panel>
 				</accordion_tab>
diff --git a/indra/newview/skins/default/xui/zh/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/zh/panel_preferences_graphics1.xml
index ee8cd9794a..874fb6b218 100644
--- a/indra/newview/skins/default/xui/zh/panel_preferences_graphics1.xml
+++ b/indra/newview/skins/default/xui/zh/panel_preferences_graphics1.xml
@@ -47,14 +47,14 @@
 		<text name="DrawDistanceMeterText2">
 			m
 		</text>
-		<slider label="Max. particle count:" name="MaxParticleCount"/>
+		<slider label="最大粒子效果數量:" name="MaxParticleCount"/>
 		<slider label="Max. # of non-impostor avatars:" name="MaxNumberAvatarDrawn"/>
 		<slider label="後製品質:" name="RenderPostProcess"/>
 		<text name="MeshDetailText">
 			網面細節:
 		</text>
 		<slider label="物件:" name="ObjectMeshDetail"/>
-		<slider label="Flexiprims:" name="FlexibleMeshDetail"/>
+		<slider label="彈性幾何元件:" name="FlexibleMeshDetail"/>
 		<slider label="樹木:" name="TreeMeshDetail"/>
 		<slider label="化身:" name="AvatarMeshDetail"/>
 		<slider label="地形:" name="TerrainMeshDetail"/>
diff --git a/indra/newview/skins/default/xui/zh/panel_preferences_move.xml b/indra/newview/skins/default/xui/zh/panel_preferences_move.xml
index 57e3540b3d..ce176b1e3c 100644
--- a/indra/newview/skins/default/xui/zh/panel_preferences_move.xml
+++ b/indra/newview/skins/default/xui/zh/panel_preferences_move.xml
@@ -15,7 +15,7 @@
 	<check_box label="反轉" name="invert_mouse"/>
 	<check_box label="總是使用方向鍵移動" name="arrow_keys_move_avatar_check"/>
 	<check_box label="連點按住後跑步" name="tap_tap_hold_to_run"/>
-	<check_box label="雙擊以D:" name="double_click_chkbox"/>
+	<check_box label="雙擊以:" name="double_click_chkbox"/>
 	<radio_group name="double_click_action">
 		<radio_item label="瞬間傳送" name="radio_teleport"/>
 		<radio_item label="自動導航駕駛" name="radio_autopilot"/>
diff --git a/indra/newview/skins/default/xui/zh/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/zh/panel_preferences_privacy.xml
index bd6d465572..07fdfd87e3 100644
--- a/indra/newview/skins/default/xui/zh/panel_preferences_privacy.xml
+++ b/indra/newview/skins/default/xui/zh/panel_preferences_privacy.xml
@@ -8,7 +8,7 @@
 		(位置、圖像、網頁、搜尋的歷史紀錄)
 	</text>
 	<check_box label="將我顯示在搜尋的結果中" name="online_searchresults"/>
-	<check_box label="只有我的朋友和群組知道我在線上" name="online_visibility"/>
+	<check_box label="只有我的朋友和群組知道我上線" name="online_visibility"/>
 	<check_box label="只有我的朋友和群組可以 IM 或與我通話。" name="voice_call_friends_only_check"/>
 	<check_box label="當通話結束時關閉麥克風" name="auto_disengage_mic_check"/>
 	<check_box label="登入時顯示我最愛的地標位置(經由 &apos;開始於&apos; 的下拉式選單)" name="favorites_on_login_check"/>
diff --git a/indra/newview/skins/default/xui/zh/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/zh/panel_prim_media_controls.xml
index 8d0e2a6355..df1a1b73a1 100644
--- a/indra/newview/skins/default/xui/zh/panel_prim_media_controls.xml
+++ b/indra/newview/skins/default/xui/zh/panel_prim_media_controls.xml
@@ -37,28 +37,28 @@
 			<button name="fwd_btn" tool_tip="Navigate forward"/>
 		</layout_panel>
 		<layout_panel name="home">
-			<button name="home_btn" tool_tip="Home page"/>
+			<button name="home_btn" tool_tip="首頁"/>
 		</layout_panel>
 		<layout_panel name="media_stop">
 			<button name="media_stop_btn" tool_tip="停止媒體"/>
 		</layout_panel>
 		<layout_panel name="reload">
-			<button name="reload_btn" tool_tip="Reload"/>
+			<button name="reload_btn" tool_tip="重新載入"/>
 		</layout_panel>
 		<layout_panel name="stop">
-			<button name="stop_btn" tool_tip="Stop loading"/>
+			<button name="stop_btn" tool_tip="停止載入"/>
 		</layout_panel>
 		<layout_panel name="play">
-			<button name="play_btn" tool_tip="Play media"/>
+			<button name="play_btn" tool_tip="播放媒體"/>
 		</layout_panel>
 		<layout_panel name="pause">
-			<button name="pause_btn" tool_tip="Pause media"/>
+			<button name="pause_btn" tool_tip="暫停媒體"/>
 		</layout_panel>
 		<layout_panel name="media_address">
-			<line_editor name="media_address_url" tool_tip="Media URL"/>
+			<line_editor name="media_address_url" tool_tip="媒體網址"/>
 			<layout_stack name="media_address_url_icons">
 				<layout_panel>
-					<icon name="media_whitelist_flag" tool_tip="White List enabled"/>
+					<icon name="media_whitelist_flag" tool_tip="白名單已啟用"/>
 				</layout_panel>
 				<layout_panel>
 					<icon name="media_secure_lock_flag" tool_tip="Secured Browsing"/>
diff --git a/indra/newview/skins/default/xui/zh/panel_profile_view.xml b/indra/newview/skins/default/xui/zh/panel_profile_view.xml
index 12fe776e45..2684287692 100644
--- a/indra/newview/skins/default/xui/zh/panel_profile_view.xml
+++ b/indra/newview/skins/default/xui/zh/panel_profile_view.xml
@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="panel_target_profile">
 	<string name="status_online">
-		Online
+		上線
 	</string>
 	<string name="status_offline">
-		Offline
+		離線
 	</string>
-	<text name="display_name_label" value="Display Name:"/>
+	<text name="display_name_label" value="顯示名稱:"/>
 	<text name="solo_username_label" value="使用者名稱:"/>
-	<text name="status" value="Online"/>
+	<text name="status" value="上線"/>
 	<text name="user_name_small" value="Jack oh look at me this is a super duper long name"/>
 	<button name="copy_to_clipboard" tool_tip="覆製到剪貼簿"/>
 	<text name="user_label" value="使用者名稱:"/>
diff --git a/indra/newview/skins/default/xui/zh/panel_region_general.xml b/indra/newview/skins/default/xui/zh/panel_region_general.xml
index 38fde494aa..a441b8898d 100644
--- a/indra/newview/skins/default/xui/zh/panel_region_general.xml
+++ b/indra/newview/skins/default/xui/zh/panel_region_general.xml
@@ -24,7 +24,7 @@
 	<check_box label="限制推撞" name="restrict_pushobject"/>
 	<check_box label="允許土地轉售" name="allow_land_resell_check"/>
 	<check_box label="允許土地 合併/分割" name="allow_parcel_changes_check"/>
-	<check_box label="阻擋土地顯示於搜尋中" name="block_parcel_search_check" tool_tip="Let people see this region and its parcels in search results"/>
+	<check_box label="阻擋土地顯示於搜尋中" name="block_parcel_search_check" tool_tip="讓其他人可以在搜尋結果中看到這個地區與其中的地段"/>
 	<spinner label="人數上限" name="agent_limit_spin"/>
 	<spinner label="Object Bonus" name="object_bonus_spin"/>
 	<text label="Maturity" name="access_text">
diff --git a/indra/newview/skins/default/xui/zh/panel_region_terrain.xml b/indra/newview/skins/default/xui/zh/panel_region_terrain.xml
index 0622cb4e73..7cae8fe8cf 100644
--- a/indra/newview/skins/default/xui/zh/panel_region_terrain.xml
+++ b/indra/newview/skins/default/xui/zh/panel_region_terrain.xml
@@ -6,14 +6,14 @@
 	<text name="region_text">
 		未知
 	</text>
-	<spinner label="Water Height" name="water_height_spin"/>
-	<spinner label="Terrain Raise Limit" name="terrain_raise_spin"/>
-	<spinner label="Terrain Lower Limit" name="terrain_lower_spin"/>
-	<check_box label="Use Estate Sun" name="use_estate_sun_check"/>
-	<check_box label="Fixed Sun" name="fixed_sun_check"/>
+	<spinner label="水文高度" name="water_height_spin"/>
+	<spinner label="地形提升限制" name="terrain_raise_spin"/>
+	<spinner label="地形降低限制" name="terrain_lower_spin"/>
+	<check_box label="使用領地的太陽設定" name="use_estate_sun_check"/>
+	<check_box label="固定太陽" name="fixed_sun_check"/>
 	<slider label="Phase" name="sun_hour_slider"/>
 	<button label="套用" name="apply_btn"/>
-	<button label="Download RAW terrain..." name="download_raw_btn" tool_tip="Available only to estate owners, not managers"/>
-	<button label="上傳 RAW 地形檔..." name="upload_raw_btn" tool_tip="Available only to estate owners, not managers"/>
+	<button label="下載 RAW 地形..." name="download_raw_btn" tool_tip="只允許領地擁有者而非管理者進行操作"/>
+	<button label="上傳 RAW 地形檔..." name="upload_raw_btn" tool_tip="只允許領地擁有者而非管理者進行操作"/>
 	<button label="Bake Terrain" name="bake_terrain_btn" tool_tip="Set current terrain as mid-point for raise/lower limits"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_script_ed.xml b/indra/newview/skins/default/xui/zh/panel_script_ed.xml
index 1dc7c1e089..cc2b0fc673 100644
--- a/indra/newview/skins/default/xui/zh/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/zh/panel_script_ed.xml
@@ -4,7 +4,7 @@
 		載入中...
 	</panel.string>
 	<panel.string name="can_not_view">
-		你不察看或編輯此腳本,自從它被設定為 &quot;no copy&quot; 後。你需要完整權限去察看或編輯有包含腳本在內的物件。
+		你不能察看或編輯此腳本,自從它被設定為 &quot;no copy&quot; 後。你需要完整權限去察看或編輯有包含腳本在內的物件。
 	</panel.string>
 	<panel.string name="public_objects_can_not_run">
 		公開物件不能執行腳本
diff --git a/indra/newview/skins/default/xui/zh/panel_side_tray.xml b/indra/newview/skins/default/xui/zh/panel_side_tray.xml
index b706f1839a..e5c7deb7d6 100644
--- a/indra/newview/skins/default/xui/zh/panel_side_tray.xml
+++ b/indra/newview/skins/default/xui/zh/panel_side_tray.xml
@@ -11,7 +11,7 @@
 			<panel label="自己" name="panel_me"/>
 		</panel_container>
 	</sidetray_tab>
-	<sidetray_tab description="Find your friends, contacts and people nearby." name="sidebar_people" tab_title="People">
+	<sidetray_tab description="Find your friends, contacts and people nearby." name="sidebar_people" tab_title="人群">
 		<panel_container name="panel_container">
 			<panel label="群組檔案" name="panel_group_info_sidetray"/>
 			<panel label="Blocked Residents &amp; Objects" name="panel_block_list_sidetray"/>
diff --git a/indra/newview/skins/default/xui/zh/role_actions.xml b/indra/newview/skins/default/xui/zh/role_actions.xml
index d5c3096b22..32bf0d22d8 100644
--- a/indra/newview/skins/default/xui/zh/role_actions.xml
+++ b/indra/newview/skins/default/xui/zh/role_actions.xml
@@ -18,7 +18,7 @@
 		<action description="Change Charter, Insignia, and &apos;Show in search&apos;" longdescription="Change Charter, Insignia, and &apos;Show in search&apos;. This is done in the General section." name="group change identity" value="11"/>
 	</action_set>
 	<action_set description="These Abilities include powers to deed, modify, and sell land in this group&apos;s land holdings. To get to the About Land window, right-click the ground and select &apos;About Land&apos;, or click the &apos;i&apos; icon in the Navigation Bar." name="Parcel Management">
-		<action description="Deed land and buy land for group" longdescription="Deed land and buy land for group. This is done in About Land &gt; General tab." name="land deed" value="12"/>
+		<action description="讓渡土地或購買土地給群組" longdescription="Deed land and buy land for group. This is done in About Land &gt; General tab." name="land deed" value="12"/>
 		<action description="Abandon land to Governor Linden" longdescription="Abandon land to Governor Linden. *WARNING* Any Member in a Role with this Ability can abandon group-owned land in About Land &gt; General tab, reverting it to Linden ownership without a sale! Be sure you know what you&apos;re doing before assigning this Ability." name="land release" value="13"/>
 		<action description="Set land for sale info" longdescription="Set land for sale info. *WARNING* Any Member in a Role with this Ability can sell group-owned land in About Land &gt; General tab as they wish! Be sure you know what you&apos;re doing before assigning this Ability." name="land set sale info" value="14"/>
 		<action description="Subdivide and join parcels" longdescription="Subdivide and join parcels. This is done by right-clicking the ground, &apos;Edit Terrain&apos;, and dragging your mouse on the land to make a selection. To subdivide, select what you want to split and click &apos;Subdivide&apos;. To join, select two or more contiguous parcels and click &apos;Join&apos;." name="land divide join" value="15"/>
@@ -54,7 +54,7 @@
 		<action description="Landscaping using Linden plants" longdescription="Landscaping ability to place and move Linden trees, plants, and grasses. These items can be found in your inventory&apos;s Library &gt; Objects folder, or they can be created via the Build menu." name="land gardening" value="35"/>
 	</action_set>
 	<action_set description="These Abilities include powers to deed, modify, and sell group-owned objects. These changes are done in the Build Tools &gt; General tab. Right-click an object and Edit to see its settings." name="Object Management">
-		<action description="Deed objects to group" longdescription="Deed objects to group in the Build Tools &gt; General tab." name="object deed" value="36"/>
+		<action description="讓渡物件給群組" longdescription="Deed objects to group in the Build Tools &gt; General tab." name="object deed" value="36"/>
 		<action description="Manipulate (move, copy, modify) group-owned objects" longdescription="Manipulate (move, copy, modify) group-owned objects in the Build Tools &gt; General tab." name="object manipulate" value="38"/>
 		<action description="Set group-owned objects for sale" longdescription="Set group-owned objects for sale in the Build Tools &gt; General tab." name="object set sale" value="39"/>
 	</action_set>
diff --git a/indra/newview/skins/default/xui/zh/sidepanel_inventory.xml b/indra/newview/skins/default/xui/zh/sidepanel_inventory.xml
index 4cc16ed250..7abe95a402 100644
--- a/indra/newview/skins/default/xui/zh/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/zh/sidepanel_inventory.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<panel label="Things" name="objects panel">
+<panel label="事物" name="objects panel">
 	<panel label="" name="sidepanel__inventory_panel">
 		<panel name="button_panel">
 			<layout_stack name="button_panel_ls">
@@ -11,8 +11,8 @@
 				</layout_panel>
 				<layout_panel name="shop_btn_lp">
 					<button label="Shop" name="shop_btn" tool_tip="Open Marketplace webpage"/>
-					<button label="Wear" name="wear_btn" tool_tip="穿上所選擇的裝扮"/>
-					<button label="Play" name="play_btn"/>
+					<button label="穿上" name="wear_btn" tool_tip="穿上所選擇的裝扮"/>
+					<button label="播放" name="play_btn"/>
 					<button label="瞬間傳送" name="teleport_btn" tool_tip="瞬間傳送到所選的區域"/>
 				</layout_panel>
 			</layout_stack>
diff --git a/indra/newview/skins/default/xui/zh/sidepanel_task_info.xml b/indra/newview/skins/default/xui/zh/sidepanel_task_info.xml
index 5aad4568bd..3d46e52726 100644
--- a/indra/newview/skins/default/xui/zh/sidepanel_task_info.xml
+++ b/indra/newview/skins/default/xui/zh/sidepanel_task_info.xml
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="object properties" title="物件檔案">
 	<panel.string name="text deed continued">
-		Deed
+		讓渡
 	</panel.string>
 	<panel.string name="text deed">
-		Deed
+		讓渡
 	</panel.string>
 	<panel.string name="text modify info 1">
 		你可以修改這個物件
@@ -56,7 +56,7 @@
 		</text>
 		<button name="button set group" tool_tip="選擇一個群組以分享這個物件的權限"/>
 		<name_box initial_value="載入中..." name="Group Name Proxy"/>
-		<button label="Deed" label_selected="Deed" name="button deed" tool_tip="Deeding gives this item away with next owner permissions. Group shared objects can be deeded by a group officer."/>
+		<button label="讓渡" label_selected="讓渡" name="button deed" tool_tip="Deeding gives this item away with next owner permissions. Group shared objects can be deeded by a group officer."/>
 		<text name="label click action">
 			點擊以:
 		</text>
@@ -85,16 +85,16 @@
 			</text>
 			<check_box label="修改" name="checkbox next owner can modify"/>
 			<check_box label="覆製" name="checkbox next owner can copy"/>
-			<check_box label="轉移" name="checkbox next owner can transfer" tool_tip="Next owner can give away or resell this object"/>
+			<check_box label="轉移" name="checkbox next owner can transfer" tool_tip="下一個擁有者可以送出或轉售這個物件"/>
 		</panel>
 		<check_box label="出售" name="checkbox for sale"/>
 		<combo_box name="sale type">
-			<combo_box.item label="Copy" name="Copy"/>
-			<combo_box.item label="Contents" name="Contents"/>
-			<combo_box.item label="Original" name="Original"/>
+			<combo_box.item label="副本" name="Copy"/>
+			<combo_box.item label="內容" name="Contents"/>
+			<combo_box.item label="原件" name="Original"/>
 		</combo_box>
 		<spinner label="價格: L$" name="Edit Cost"/>
-		<check_box label="顯示在搜尋中" name="search_check" tool_tip="Let people see this object in search results"/>
+		<check_box label="顯示在搜尋中" name="search_check" tool_tip="讓其他人可以在搜尋結果中察看到此物件"/>
 		<text name="B:">
 			B:
 		</text>
diff --git a/indra/newview/skins/default/xui/zh/strings.xml b/indra/newview/skins/default/xui/zh/strings.xml
index 0949e61fa1..6dbe44d32e 100644
--- a/indra/newview/skins/default/xui/zh/strings.xml
+++ b/indra/newview/skins/default/xui/zh/strings.xml
@@ -1042,10 +1042,10 @@
 		按下 ESC 鍵回復到世界的視角
 	</string>
 	<string name="InventoryNoMatchingItems">
-		Didn&apos;t find what you&apos;re looking for? Try [secondlife:///app/search/all/[SEARCH_TERM] Search].
+		沒有發現你想要找的嗎?試試 [secondlife:///app/search/all/[SEARCH_TERM] 搜尋]。
 	</string>
 	<string name="PlacesNoMatchingItems">
-		Didn&apos;t find what you&apos;re looking for? Try [secondlife:///app/search/places/[SEARCH_TERM] Search].
+		沒有發現你想要找的嗎?試試 [secondlife:///app/search/places/[SEARCH_TERM] 搜尋]。
 	</string>
 	<string name="FavoritesNoMatchingItems">
 		Drag a landmark here to add it to your favorites.
@@ -1190,25 +1190,25 @@
 		Buy for L$
 	</string>
 	<string name="Stone">
-		Stone
+		石頭
 	</string>
 	<string name="Metal">
-		Metal
+		金屬
 	</string>
 	<string name="Glass">
-		Glass
+		玻璃
 	</string>
 	<string name="Wood">
-		Wood
+		木頭
 	</string>
 	<string name="Flesh">
-		Flesh
+		肌肉
 	</string>
 	<string name="Plastic">
-		Plastic
+		塑膠
 	</string>
 	<string name="Rubber">
-		Rubber
+		橡膠
 	</string>
 	<string name="Light">
 		Light
@@ -1385,7 +1385,7 @@
 		Charter Member
 	</string>
 	<string name="AcctTypeEmployee">
-		Linden Lab Employee
+		林登實驗室員工
 	</string>
 	<string name="PaymentInfoUsed">
 		Payment Info Used
@@ -1433,7 +1433,7 @@
 		伺服器上未發現腳本。
 	</string>
 	<string name="CompileQueueProblemDownloading">
-		Problem downloading
+		問題下載中
 	</string>
 	<string name="CompileQueueInsufficientPermDownload">
 		Insufficient permissions to download a script.
@@ -1491,7 +1491,7 @@
 		(未知)
 	</string>
 	<string name="SummaryForTheWeek" value="Summary for this week, beginning on"/>
-	<string name="NextStipendDay" value="The next stipend day is"/>
+	<string name="NextStipendDay" value="下一個發薪日為"/>
 	<string name="GroupIndividualShare" value="Group       Individual Share"/>
 	<string name="GroupColumn" value="群組"/>
 	<string name="Balance">
@@ -1507,7 +1507,7 @@
 		Total
 	</string>
 	<string name="NoGroupDataFound">
-		No group data found for group
+		無群組資料發現
 	</string>
 	<string name="IMParentEstate">
 		parent estate
@@ -1540,13 +1540,13 @@
 		地段腳本記憶體
 	</string>
 	<string name="ScriptLimitsParcelsOwned">
-		Parcels Listed: [PARCELS]
+		地段清單:[PARCELS]
 	</string>
 	<string name="ScriptLimitsMemoryUsed">
-		Memory used: [COUNT] kb out of [MAX] kb; [AVAILABLE] kb available
+		計憶體用量:使用 [MAX] kb 中的 [COUNT] kb ;剩餘 [AVAILABLE] kb 可用
 	</string>
 	<string name="ScriptLimitsMemoryUsedSimple">
-		Memory used: [COUNT] kb
+		記憶體用量:[COUNT] kb
 	</string>
 	<string name="ScriptLimitsParcelScriptURLs">
 		地段腳本 URLs
@@ -1573,7 +1573,7 @@
 		You do not have permission to examine this parcel
 	</string>
 	<string name="SITTING_ON">
-		Sitting On
+		坐在
 	</string>
 	<string name="ATTACH_CHEST">
 		胸部
@@ -1759,7 +1759,7 @@
 		預覽
 	</string>
 	<string name="MultiPropertiesTitle">
-		Properties
+		屬性
 	</string>
 	<string name="InvOfferAnObjectNamed">
 		An object named
@@ -1889,40 +1889,40 @@
 		PDT
 	</string>
 	<string name="Direction_Forward">
-		Forward
+		向前
 	</string>
 	<string name="Direction_Left">
-		Left
+		向左
 	</string>
 	<string name="Direction_Right">
-		Right
+		向右
 	</string>
 	<string name="Direction_Back">
-		Back
+		向後
 	</string>
 	<string name="Direction_North">
-		North
+		北
 	</string>
 	<string name="Direction_South">
-		South
+		南
 	</string>
 	<string name="Direction_West">
-		West
+		西
 	</string>
 	<string name="Direction_East">
-		East
+		東
 	</string>
 	<string name="Direction_Up">
-		Up
+		向上
 	</string>
 	<string name="Direction_Down">
-		Down
+		向下
 	</string>
 	<string name="Any Category">
 		任何類別
 	</string>
 	<string name="Shopping">
-		Shopping
+		採購
 	</string>
 	<string name="Land Rental">
 		Land Rental
@@ -1958,28 +1958,28 @@
 		完全成人
 	</string>
 	<string name="Arts&amp;Culture">
-		Arts &amp; Culture
+		藝術與文化
 	</string>
 	<string name="Business">
-		Business
+		商業
 	</string>
 	<string name="Educational">
-		Educational
+		教育
 	</string>
 	<string name="Gaming">
-		Gaming
+		遊戲
 	</string>
 	<string name="Hangout">
 		聚會所
 	</string>
 	<string name="Newcomer Friendly">
-		Newcomer Friendly
+		新手友善
 	</string>
 	<string name="Parks&amp;Nature">
-		Parks &amp; Nature
+		公園與自然
 	</string>
 	<string name="Residential">
-		Residential
+		住宅
 	</string>
 	<string name="Stage">
 		Stage
@@ -2024,36 +2024,36 @@
 		---
 	</string>
 	<string name="Multiple Media">
-		Multiple Media
+		多媒體
 	</string>
 	<string name="Play Media">
-		Play/Pause Media
+		播放/暫停 媒體
 	</string>
 	<string name="MBCmdLineError">
-		An error was found parsing the command line.
-Please see: http://wiki.secondlife.com/wiki/Client_parameters
-Error:
+		解析命令列時發現錯誤。
+請參閱: http://wiki.secondlife.com/wiki/Client_parameters
+錯誤:
 	</string>
 	<string name="MBCmdLineUsg">
-		[APP_NAME] Command line usage:
+		[APP_NAME] 命令列用法:
 	</string>
 	<string name="MBUnableToAccessFile">
-		[APP_NAME] is unable to access a file that it needs.
+		[APP_NAME] 無法存取它所需要的檔案。
 
 This can be because you somehow have multiple copies running, or your system incorrectly thinks a file is open.
 If this message persists, restart your computer and try again.
 If it continues to persist, you may need to completely uninstall [APP_NAME] and reinstall it.
 	</string>
 	<string name="MBFatalError">
-		Fatal Error
+		致命錯誤
 	</string>
 	<string name="MBRequiresAltiVec">
 		[APP_NAME] requires a processor with AltiVec (G4 or later).
 	</string>
 	<string name="MBAlreadyRunning">
-		[APP_NAME] is already running.
-Check your task bar for a minimized copy of the program.
-If this message persists, restart your computer.
+		[APP_NAME] 已經在執行中。
+請檢查你的工作列裡是否有其他最小化的相同程式。
+如果這個訊息持續出現,請重新啟動你的電腦。
 	</string>
 	<string name="MBFrozenCrashed">
 		[APP_NAME] appears to have frozen or crashed on the previous run.
@@ -2082,8 +2082,8 @@ Please download the latest version from www.secondlife.com.
 		錯誤
 	</string>
 	<string name="MBFullScreenErr">
-		Unable to run fullscreen at [WIDTH] x [HEIGHT].
-Running in window.
+		無法執行全螢幕於 [WIDTH] x [HEIGHT].
+執行於視窗中。
 	</string>
 	<string name="MBDestroyWinFailed">
 		Shutdown Error while destroying window (DestroyWindow() failed)
@@ -2111,7 +2111,7 @@ Also be sure your monitor is set to True Color (32-bit) in Control Panels &gt; D
 If you continue to receive this message, contact the [SUPPORT_SITE].
 	</string>
 	<string name="MBPixelFmtSetErr">
-		Can&apos;t set pixel format
+		無法設定像素格式
 	</string>
 	<string name="MBGLContextErr">
 		Can&apos;t create GL rendering context
@@ -2920,7 +2920,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
 		Middle Part
 	</string>
 	<string name="More">
-		More
+		更多
 	</string>
 	<string name="More Blush">
 		More Blush
@@ -3559,7 +3559,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
 		購買這塊土地
 	</string>
 	<string name="LocationCtrlVoiceTooltip">
-		Voice not available here
+		此地並不允許語音
 	</string>
 	<string name="LocationCtrlFlyTooltip">
 		不允許飛行
@@ -3568,13 +3568,13 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
 		禁止推撞
 	</string>
 	<string name="LocationCtrlBuildTooltip">
-		Building/dropping objects not allowed
+		建造/丟棄 物件不被允許
 	</string>
 	<string name="LocationCtrlScriptsTooltip">
-		Scripts not allowed
+		腳本不被允許
 	</string>
 	<string name="LocationCtrlDamageTooltip">
-		Health
+		健康
 	</string>
 	<string name="LocationCtrlAdultIconTooltip">
 		完全成人地區
@@ -3628,7 +3628,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
 		[NAME] 正在輸入...
 	</string>
 	<string name="Unnamed">
-		(Unnamed)
+		(未命名)
 	</string>
 	<string name="IM_moderated_chat_label">
 		(Moderated: Voices off by default)
@@ -3670,10 +3670,10 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
 		Connected, click Leave Call to hang up
 	</string>
 	<string name="hang_up-im">
-		Left voice call
+		離開語音通話
 	</string>
 	<string name="answering-im">
-		Connecting...
+		聯接中...
 	</string>
 	<string name="conference-title">
 		Ad-hoc Conference
@@ -3715,10 +3715,10 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
 		此會話不再存在
 	</string>
 	<string name="no_ability_error">
-		You do not have that ability.
+		你並不具有這個能力。
 	</string>
 	<string name="no_ability">
-		You do not have that ability.
+		你並不具有這個能力。
 	</string>
 	<string name="not_a_mod_error">
 		You are not a session moderator.
@@ -3903,7 +3903,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
 		內容
 	</string>
 	<string name="Gesture">
-		Gesture
+		姿勢
 	</string>
 	<string name="Male Gestures">
 		男性姿勢
@@ -4048,7 +4048,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
 		US$ [AMOUNT]
 	</string>
 	<string name="Membership">
-		Membership
+		成員資格
 	</string>
 	<string name="Roles">
 		角色
@@ -4057,13 +4057,13 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
 		Group Identity
 	</string>
 	<string name="Parcel Management">
-		Parcel Management
+		地段管理
 	</string>
 	<string name="Parcel Identity">
 		Parcel Identity
 	</string>
 	<string name="Parcel Settings">
-		Parcel Settings
+		地段設定
 	</string>
 	<string name="Parcel Powers">
 		Parcel Powers
@@ -4075,10 +4075,10 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
 		Parcel Content
 	</string>
 	<string name="Object Management">
-		Object Management
+		物件管理
 	</string>
 	<string name="Accounting">
-		Accounting
+		會計
 	</string>
 	<string name="Notices">
 		通知
@@ -4087,16 +4087,16 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
 		聊天
 	</string>
 	<string name="DeleteItems">
-		Delete selected items?
+		刪除所選取的物品?
 	</string>
 	<string name="DeleteItem">
-		Delete selected item?
+		刪除所選取的物品?
 	</string>
 	<string name="EmptyOutfitText">
 		沒有任何物品在這個裝扮內
 	</string>
 	<string name="ExternalEditorNotSet">
-		Select an editor using the ExternalEditor setting.
+		選擇一個編輯器使用 ExternalEditor 設定。
 	</string>
 	<string name="ExternalEditorNotFound">
 		Cannot find the external editor you specified.
@@ -4107,7 +4107,7 @@ Try enclosing path to the editor with double quotes.
 		Error parsing the external editor command.
 	</string>
 	<string name="ExternalEditorFailedToRun">
-		External editor failed to run.
+		執行外部編輯器失敗。
 	</string>
 	<string name="Esc">
 		Esc
-- 
cgit v1.2.3


From a8b74a17cdf357987624eebdd8cf5e544487293a Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Tue, 27 Sep 2011 18:16:11 -0400
Subject: statically link libcrypto in the Mac build

---
 indra/cmake/OpenSSL.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake
index 5982ee9a49..2704912eb5 100644
--- a/indra/cmake/OpenSSL.cmake
+++ b/indra/cmake/OpenSSL.cmake
@@ -11,7 +11,7 @@ else (STANDALONE)
   if (WINDOWS)
     set(OPENSSL_LIBRARIES ssleay32 libeay32)
   else (WINDOWS)
-    set(OPENSSL_LIBRARIES ssl)
+    set(OPENSSL_LIBRARIES ssl crypto)
   endif (WINDOWS)
   set(OPENSSL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
 endif (STANDALONE)
-- 
cgit v1.2.3


From 6eb09ab2ae9c90b23c8af1929e7d0a2088a6e76e Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 28 Sep 2011 16:59:46 -0700
Subject: Removing time offset hack for 'new' tag

---
 indra/newview/llpanelmarketplaceinboxinventory.cpp | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp
index faba6dc0cf..2e4bf55d51 100644
--- a/indra/newview/llpanelmarketplaceinboxinventory.cpp
+++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp
@@ -196,15 +196,12 @@ void LLInboxFolderViewFolder::computeFreshness()
 
 	if (last_expansion_utc > 0)
 	{
-		const U32 time_offset_for_pdt = 7 * 60 * 60;
-		const U32 last_expansion = last_expansion_utc - time_offset_for_pdt;
-
-		mFresh = (mCreationDate > last_expansion);
+		mFresh = (mCreationDate > last_expansion_utc);
 
 #if DEBUGGING_FRESHNESS
 		if (mFresh)
 		{
-			llinfos << "Item is fresh! -- creation " << mCreationDate << ", saved_freshness_date " << last_expansion << llendl;
+			llinfos << "Item is fresh! -- creation " << mCreationDate << ", saved_freshness_date " << last_expansion_utc << llendl;
 		}
 #endif
 	}
-- 
cgit v1.2.3


From 530c44c798253c978a0b1a8f0aed876f3f8ba159 Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Mon, 3 Oct 2011 17:41:07 -0700
Subject: Update LLQtWebKit libraries to version with *ONLY* SSL fix for Mac.

---
 autobuild.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index 347ef419ed..9a68a70470 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -1206,9 +1206,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>9cd66e879908f047d9af665b92946ecc</string>
+              <string>1b92a69f5eba7cd8b017180659076db5</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/239803/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20110830.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/roxie_3p-llqtwebkit/rev/242182/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20111003.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
@@ -1230,9 +1230,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>ab9393795515cbbe9526bde33b41bf2a</string>
+              <string>1e7f24b69b0fc751c7e86efe7c621882</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/239670/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20110829.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/roxie_3p-llqtwebkit/rev/242182/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20111003.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
-- 
cgit v1.2.3


From 4e228b7d661b49d4949bb64d36b2aad2e893e193 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Tue, 4 Oct 2011 06:52:55 -0400
Subject: increment viewer version to 3.1.0

---
 indra/llcommon/llversionviewer.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index a4b2e06908..3377465bb6 100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
@@ -28,8 +28,8 @@
 #define LL_LLVERSIONVIEWER_H
 
 const S32 LL_VERSION_MAJOR = 3;
-const S32 LL_VERSION_MINOR = 0;
-const S32 LL_VERSION_PATCH = 6;
+const S32 LL_VERSION_MINOR = 1;
+const S32 LL_VERSION_PATCH = 0;
 const S32 LL_VERSION_BUILD = 0;
 
 const char * const LL_CHANNEL = "Second Life Developer";
-- 
cgit v1.2.3


From bba1141facb9b0e0ed6bb73535fca1f20ddcfa59 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Tue, 4 Oct 2011 06:53:06 -0400
Subject: Added tag 3.1.0-start for changeset c7282e59f374

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index d9c1bbbb81..e3edb9f17e 100644
--- a/.hgtags
+++ b/.hgtags
@@ -195,3 +195,4 @@ b95ddac176ac944efdc85cbee94ac2e1eab44c79 3.0.3-start
 0496d2f74043cf4e6058e76ac3db03d44cff42ce DRTVWR-84_3.0.3-release
 0496d2f74043cf4e6058e76ac3db03d44cff42ce 3.0.3-release
 92a3aa04775438226399b19deee12ac3b5a62838 3.0.5-start
+c7282e59f374ee904bd793c3c444455e3399b0c5 3.1.0-start
-- 
cgit v1.2.3


From d0e36ade5bb16e9e5a6aca9ee4f02fbe995cdfd8 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Tue, 4 Oct 2011 06:53:34 -0400
Subject: increment viewer version to 3.1.1

---
 indra/llcommon/llversionviewer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index 3377465bb6..e4ad7f4f54 100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
@@ -29,7 +29,7 @@
 
 const S32 LL_VERSION_MAJOR = 3;
 const S32 LL_VERSION_MINOR = 1;
-const S32 LL_VERSION_PATCH = 0;
+const S32 LL_VERSION_PATCH = 1;
 const S32 LL_VERSION_BUILD = 0;
 
 const char * const LL_CHANNEL = "Second Life Developer";
-- 
cgit v1.2.3


From 50c0447808f7041d5af5017c847a462e9599bdb5 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 4 Oct 2011 13:26:54 -0700
Subject: disabled min and max windows macros another attempt at fixing gcc
 builds

---
 indra/llcommon/llapr.h             |  3 +++
 indra/llcommon/llprocesslauncher.h |  1 +
 indra/llrender/llglheaders.h       |  1 +
 indra/llui/llui.h                  | 33 ++++++++++++++++-----------------
 indra/llwindow/lldragdropwin32.h   |  2 ++
 indra/llwindow/llwindowwin32.h     |  1 +
 indra/win_crash_logger/StdAfx.h    |  2 +-
 7 files changed, 25 insertions(+), 18 deletions(-)

diff --git a/indra/llcommon/llapr.h b/indra/llcommon/llapr.h
index 3f846f1314..286fc43a77 100644
--- a/indra/llcommon/llapr.h
+++ b/indra/llcommon/llapr.h
@@ -37,6 +37,9 @@
 	// If you get undefined symbols, find the appropriate
 	// Windows header file and include that in your .cpp file.
 	#define WIN32_LEAN_AND_MEAN
+	// do not define min() and max() macros, which collide with
+	// things like numeric_limits<T>
+	#define NOMINMAX
 	#include <winsock2.h>
 	#include <windows.h>
 #endif
diff --git a/indra/llcommon/llprocesslauncher.h b/indra/llcommon/llprocesslauncher.h
index 954c249147..23e48b1823 100644
--- a/indra/llcommon/llprocesslauncher.h
+++ b/indra/llcommon/llprocesslauncher.h
@@ -28,6 +28,7 @@
 #define LL_LLPROCESSLAUNCHER_H
 
 #if LL_WINDOWS
+#define NOMINMAX
 #include <windows.h>
 #endif
 
diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h
index 851a75629e..b936fd30f8 100644
--- a/indra/llrender/llglheaders.h
+++ b/indra/llrender/llglheaders.h
@@ -520,6 +520,7 @@ extern PFNGLSAMPLEMASKIPROC glSampleMaski;
 
 // windows gl headers depend on things like APIENTRY, so include windows.
 #define WIN32_LEAN_AND_MEAN
+#define NOMINMAX
 #include <winsock2.h>
 #include <windows.h>
 
diff --git a/indra/llui/llui.h b/indra/llui/llui.h
index 8cec1a16f4..af8f239657 100644
--- a/indra/llui/llui.h
+++ b/indra/llui/llui.h
@@ -41,6 +41,7 @@
 #include <boost/signals2.hpp>
 #include "lllazyvalue.h"
 #include "llframetimer.h"
+#include <limits>
 
 // LLUIFactory
 #include "llsd.h"
@@ -150,27 +151,25 @@ public:
 	//
 	// Classes
 	//
+	template <typename T>
+	struct RangeParams : public LLInitParam::Block<RangeParams<T> >
+	{
+		Optional<T>	minimum,
+					maximum;
+
+		RangeParams()
+		:	minimum("min", T()),
+			maximum("max", std::numeric_limits<T>::max())
+		{}
+	};
 
 	template <typename T>
 	struct Range 
 	{
 		typedef Range<T> self_t;
 
-		struct Params : public LLInitParam::Block<Params>
-		{
-			typename Optional<T>	minimum,
-									maximum;
-
-			Params()
-			:	minimum("min", 0),
-				maximum("max", S32_MAX)
-			{
-
-			}
-		};
-
 		// correct for inverted params
-		Range(const Params& p = Params())
+		Range(const RangeParams<T>& p = RangeParams<T>())
 			:	mMin(p.minimum),
 			mMax(p.maximum)
 		{
@@ -228,12 +227,12 @@ public:
 	{
 		typedef Range<T> range_t;
 
-		struct Params : public LLInitParam::Block<Params, typename range_t::Params>
+		struct Params : public LLInitParam::Block<Params, RangeParams<T> >
 		{
-			Mandatory<S32> value;
+			Mandatory<T> value;
 
 			Params()
-			:	value("", 0)
+			:	value("", T())
 			{
 				addSynonym(value, "value");
 			}
diff --git a/indra/llwindow/lldragdropwin32.h b/indra/llwindow/lldragdropwin32.h
index 929e7f9e37..63054bffec 100644
--- a/indra/llwindow/lldragdropwin32.h
+++ b/indra/llwindow/lldragdropwin32.h
@@ -31,6 +31,7 @@
 #ifndef LL_LLDRAGDROP32_H
 #define LL_LLDRAGDROP32_H
 
+#define NOMINMAX
 #include <windows.h>
 #include <ole2.h>
 
@@ -54,6 +55,7 @@ class LLDragDropWin32
 #ifndef LL_LLDRAGDROP32_H
 #define LL_LLDRAGDROP32_H
 
+#define NOMINMAX
 #include <windows.h>
 #include <ole2.h>
 
diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h
index 387e4cbdb6..dc1950fb31 100644
--- a/indra/llwindow/llwindowwin32.h
+++ b/indra/llwindow/llwindowwin32.h
@@ -29,6 +29,7 @@
 
 // Limit Windows API to small and manageable set.
 #define WIN32_LEAN_AND_MEAN
+#define NOMINMAX
 #include <winsock2.h>
 #include <windows.h>
 
diff --git a/indra/win_crash_logger/StdAfx.h b/indra/win_crash_logger/StdAfx.h
index ce70fe2994..71faf88bad 100644
--- a/indra/win_crash_logger/StdAfx.h
+++ b/indra/win_crash_logger/StdAfx.h
@@ -37,7 +37,7 @@
 #endif // _MSC_VER > 1000
 
 #define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
-
+#define NOMINMAX				// don't define min and max macros
 
 // Windows Header Files:
 #include <windows.h>
-- 
cgit v1.2.3


From db2e763ff0537785336a330d03bb9307478cb79a Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 4 Oct 2011 14:09:03 -0700
Subject: * Modified commands to add functions for is_enabled, is_running and
 is_starting,   currently not hooked to any functionality.

---
 indra/llui/llcommandmanager.cpp         | 24 ++++++---
 indra/llui/llcommandmanager.h           | 43 ++++++++++++---
 indra/llui/lltoolbar.cpp                |  4 +-
 indra/newview/app_settings/commands.xml | 92 ++++++++++++++++-----------------
 indra/newview/llfloatertoybox.cpp       | 34 +++---------
 indra/newview/llfloatertoybox.h         |  4 --
 6 files changed, 109 insertions(+), 92 deletions(-)

diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp
index b1147134c2..922f243806 100644
--- a/indra/llui/llcommandmanager.cpp
+++ b/indra/llui/llcommandmanager.cpp
@@ -48,24 +48,36 @@ const LLCommandId LLCommandId::null("null command");
 //
 
 LLCommand::Params::Params()
-	: function("function")
-	, available_in_toybox("available_in_toybox", false)
+	: available_in_toybox("available_in_toybox", false)
 	, icon("icon")
 	, label_ref("label_ref")
 	, name("name")
-	, parameter("parameter")
 	, tooltip_ref("tooltip_ref")
+	, execute_function("execute_function")
+	, execute_parameters("execute_parameters")
+	, is_enabled_function("is_enabled_function")
+	, is_enabled_parameters("is_enabled_parameters")
+	, is_running_function("is_running_function")
+	, is_running_parameters("is_running_parameters")
+	, is_starting_function("is_starting_function")
+	, is_starting_parameters("is_starting_parameters")
 {
 }
 
 LLCommand::LLCommand(const LLCommand::Params& p)
-	: mFunction(p.function)
-	, mAvailableInToybox(p.available_in_toybox)
+	: mAvailableInToybox(p.available_in_toybox)
 	, mIcon(p.icon)
 	, mIdentifier(p.name)
 	, mLabelRef(p.label_ref)
-	, mParameter(p.parameter)
 	, mTooltipRef(p.tooltip_ref)
+	, mExecuteFunction(p.execute_function)
+	, mExecuteParameters(p.execute_parameters)
+	, mIsEnabledFunction(p.is_enabled_function)
+	, mIsEnabledParameters(p.is_enabled_parameters)
+	, mIsRunningFunction(p.is_running_function)
+	, mIsRunningParameters(p.is_running_parameters)
+	, mIsStartingFunction(p.is_starting_function)
+	, mIsStartingParameters(p.is_starting_parameters)
 {
 }
 
diff --git a/indra/llui/llcommandmanager.h b/indra/llui/llcommandmanager.h
index 6481a05689..3ac5548a0d 100644
--- a/indra/llui/llcommandmanager.h
+++ b/indra/llui/llcommandmanager.h
@@ -83,41 +83,72 @@ private:
 
 typedef std::list<LLCommandId> command_id_list_t;
 
+
 class LLCommand
 {
 public:
 	struct Params : public LLInitParam::Block<Params>
 	{
 		Mandatory<bool>			available_in_toybox;
-		Mandatory<std::string>	function;
 		Mandatory<std::string>	icon;
 		Mandatory<std::string>	label_ref;
 		Mandatory<std::string>	name;
-		Optional<LLSD>			parameter;
 		Mandatory<std::string>	tooltip_ref;
 
+		Mandatory<std::string>	execute_function;
+		Optional<LLSD>			execute_parameters;
+
+		Optional<std::string>	is_enabled_function;
+		Optional<LLSD>			is_enabled_parameters;
+
+		Optional<std::string>	is_running_function;
+		Optional<LLSD>			is_running_parameters;
+
+		Optional<std::string>	is_starting_function;
+		Optional<LLSD>			is_starting_parameters;
+
 		Params();
 	};
 
 	LLCommand(const LLCommand::Params& p);
 
 	const bool availableInToybox() const { return mAvailableInToybox; }
-	const std::string& functionName() const { return mFunction; }
 	const std::string& icon() const { return mIcon; }
 	const LLCommandId& id() const { return mIdentifier; }
 	const std::string& labelRef() const { return mLabelRef; }
-	const LLSD& parameter() const { return mParameter; }
 	const std::string& tooltipRef() const { return mTooltipRef; }
 
+	const std::string& executeFunctionName() const { return mExecuteFunction; }
+	const LLSD& executeParameters() const { return mExecuteParameters; }
+
+	const std::string& isEnabledFunctionName() const { return mIsEnabledFunction; }
+	const LLSD& isEnabledParameters() const { return mIsEnabledParameters; }
+
+	const std::string& isRunningFunctionName() const { return mIsRunningFunction; }
+	const LLSD& isRunningParameters() const { return mIsRunningParameters; }
+
+	const std::string& isStartingFunctionName() const { return mIsStartingFunction; }
+	const LLSD& isStartingParameters() const { return mIsStartingParameters; }
+
 private:
 	LLCommandId mIdentifier;
 
 	bool        mAvailableInToybox;
-	std::string mFunction;
 	std::string mIcon;
 	std::string mLabelRef;
-	LLSD        mParameter;
 	std::string mTooltipRef;
+
+	std::string mExecuteFunction;
+	LLSD        mExecuteParameters;
+
+	std::string mIsEnabledFunction;
+	LLSD        mIsEnabledParameters;
+
+	std::string mIsRunningFunction;
+	LLSD        mIsRunningParameters;
+
+	std::string mIsStartingFunction;
+	LLSD        mIsStartingParameters;
 };
 
 
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index efa077ffa1..a544aa9ec7 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -525,8 +525,8 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id)
 	if (!mReadOnly)
 	{
 		LLUICtrl::CommitCallbackParam cbParam;
-		cbParam.function_name = commandp->functionName();
-		cbParam.parameter = commandp->parameter();
+		cbParam.function_name = commandp->executeFunctionName();
+		cbParam.parameter = commandp->executeParameters();
 		button->setCommitCallback(cbParam);
 		button->setStartDragCallback(mStartDragItemCallback);
 		button->setHandleDragCallback(mHandleDragItemCallback);
diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml
index 77bf7cace3..3a91ef490d 100644
--- a/indra/newview/app_settings/commands.xml
+++ b/indra/newview/app_settings/commands.xml
@@ -5,183 +5,183 @@
            icon="Command_AboutLand_Icon"
            label_ref="Command_AboutLand_Label"
            tooltip_ref="Command_AboutLand_Tooltip"
-           function="Floater.ToolbarToggle"
-           parameter="about_land"
+           execute_function="Floater.ToolbarToggle"
+           execute_parameters="about_land"
            />
   <command name="appearance"
            available_in_toybox="true"
            icon="Command_Appearance_Icon"
            label_ref="Command_Appearance_Label"
            tooltip_ref="Command_Appearance_Tooltip"
-           function="Floater.ToolbarToggle"
-           parameter="appearance"
+           execute_function="Floater.ToolbarToggle"
+           execute_parameters="appearance"
            />
   <command name="avatar"
            available_in_toybox="true"
            icon="Command_Avatar_Icon"
            label_ref="Command_Avatar_Label"
            tooltip_ref="Command_Avatar_Tooltip"
-           function="Floater.ToolbarToggle"
-           parameter="avatar_picker"
+           execute_function="Floater.ToolbarToggle"
+           execute_parameters="avatar_picker"
            />
   <command name="build"
            available_in_toybox="true"
            icon="Command_Build_Icon"
            label_ref="Command_Build_Label"
            tooltip_ref="Command_Build_Tooltip"
-           function="Floater.ToolbarToggle"
-           parameter="build"
+           execute_function="Floater.ToolbarToggle"
+           execute_parameters="build"
            />
   <command name="chat"
            available_in_toybox="true"
            icon="Command_Chat_Icon"
            label_ref="Command_Chat_Label"
            tooltip_ref="Command_Chat_Tooltip"
-           function="Floater.ToolbarToggle"
-           parameter="chat_bar"
+           execute_function="Floater.ToolbarToggle"
+           execute_parameters="chat_bar"
            />
   <command name="compass"
            available_in_toybox="false"
            icon="Command_Compass_Icon"
            label_ref="Command_Compass_Label"
            tooltip_ref="Command_Compass_Tooltip"
-           function="Floater.ToolbarToggle"
-           parameter="compass"
+           execute_function="Floater.ToolbarToggle"
+           execute_parameters="compass"
            />
   <command name="destinations"
            available_in_toybox="true"
            icon="Command_Destinations_Icon"
            label_ref="Command_Destinations_Label"
            tooltip_ref="Command_Destinations_Tooltip"
-           function="Floater.ToolbarToggle"
-           parameter="destinations"
+           execute_function="Floater.ToolbarToggle"
+           execute_parameters="destinations"
            />
   <command name="gestures"
            available_in_toybox="true"
            icon="Command_Gestures_Icon"
            label_ref="Command_Gestures_Label"
            tooltip_ref="Command_Gestures_Tooltip"
-           function="Floater.ToolbarToggle"
-           parameter="gestures"
+           execute_function="Floater.ToolbarToggle"
+           execute_parameters="gestures"
            />
   <command name="howto"
            available_in_toybox="true"
            icon="Command_HowTo_Icon"
            label_ref="Command_HowTo_Label"
            tooltip_ref="Command_HowTo_Tooltip"
-           function="Floater.ToolbarToggle"
-           parameter="help_browser"
+           execute_function="Floater.ToolbarToggle"
+           execute_parameters="help_browser"
            />
   <command name="inventory"
            available_in_toybox="true"
            icon="Command_Inventory_Icon"
            label_ref="Command_Inventory_Label"
            tooltip_ref="Command_Inventory_Tooltip"
-           function="Floater.ToolbarToggle"
-           parameter="inventory"
+           execute_function="Floater.ToolbarToggle"
+           execute_parameters="inventory"
            />
   <command name="map"
            available_in_toybox="true"
            icon="Command_Map_Icon"
            label_ref="Command_Map_Label"
            tooltip_ref="Command_Map_Tooltip"
-           function="Floater.ToolbarToggle"
-           parameter="world_map"
+           execute_function="Floater.ToolbarToggle"
+           execute_parameters="world_map"
            />
   <command name="marketplace"
            available_in_toybox="true"
            icon="Command_Marketplace_Icon"
            label_ref="Command_Marketplace_Label"
            tooltip_ref="Command_Marketplace_Tooltip"
-           function="Floater.ToolbarToggle"
-           parameter="marketplace"
+           execute_function="Floater.ToolbarToggle"
+           execute_parameters="marketplace"
            />
   <command name="minimap"
            available_in_toybox="true"
            icon="Command_MiniMap_Icon"
            label_ref="Command_MiniMap_Label"
            tooltip_ref="Command_MiniMap_Tooltip"
-           function="Floater.ToolbarToggle"
-           parameter="mini_map"
+           execute_function="Floater.ToolbarToggle"
+           execute_parameters="mini_map"
            />
   <command name="move"
            available_in_toybox="true"
            icon="Command_Move_Icon"
            label_ref="Command_Move_Label"
            tooltip_ref="Command_Move_Tooltip"
-           function="Floater.ToolbarToggle"
-           parameter="moveview"
+           execute_function="Floater.ToolbarToggle"
+           execute_parameters="moveview"
            />
   <command name="people"
            available_in_toybox="true"
            icon="Command_People_Icon"
            label_ref="Command_People_Label"
            tooltip_ref="Command_People_Tooltip"
-           function="Floater.ToolbarToggle"
-           parameter="people"
+           execute_function="Floater.ToolbarToggle"
+           execute_parameters="people"
            />
   <command name="places"
            available_in_toybox="true"
            icon="Command_Places_Icon"
            label_ref="Command_Places_Label"
            tooltip_ref="Command_Places_Tooltip"
-           function="Floater.ToolbarToggle"
-           parameter="places"
+           execute_function="Floater.ToolbarToggle"
+           execute_parameters="places"
            />
   <command name="preferences"
            available_in_toybox="true"
            icon="Command_Preferences_Icon"
            label_ref="Command_Preferences_Label"
            tooltip_ref="Command_Preferences_Tooltip"
-           function="Floater.ToolbarToggle"
-           parameter="preferences"
+           execute_function="Floater.ToolbarToggle"
+           execute_parameters="preferences"
            />
   <command name="profile"
            available_in_toybox="true"
            icon="Command_Profile_Icon"
            label_ref="Command_Profile_Label"
            tooltip_ref="Command_Profile_Tooltip"
-           function="Floater.ToolbarToggle"
-           parameter="my_profile"
+           execute_function="Floater.ToolbarToggle"
+           execute_parameters="my_profile"
            />
   <command name="search"
            available_in_toybox="true"
            icon="Command_Search_Icon"
            label_ref="Command_Search_Label"
            tooltip_ref="Command_Search_Tooltip"
-           function="Floater.ToolbarToggle"
-           parameter="search"
+           execute_function="Floater.ToolbarToggle"
+           execute_parameters="search"
            />
   <command name="snapshot"
            available_in_toybox="true"
            icon="Command_Snapshot_Icon"
            label_ref="Command_Snapshot_Label"
            tooltip_ref="Command_Snapshot_Tooltip"
-           function="Floater.ToolbarToggle"
-           parameter="snapshot"
+           execute_function="Floater.ToolbarToggle"
+           execute_parameters="snapshot"
            />
   <command name="speak"
            available_in_toybox="true"
            icon="Command_Speak_Icon"
            label_ref="Command_Speak_Label"
            tooltip_ref="Command_Speak_Tooltip"
-           function="Floater.ToolbarToggle"
-           parameter="speak"
+           execute_function="Floater.ToolbarToggle"
+           execute_parameters="speak"
            />
   <command name="view"
            available_in_toybox="true"
            icon="Command_View_Icon"
            label_ref="Command_View_Label"
            tooltip_ref="Command_View_Tooltip"
-           function="Floater.ToolbarToggle"
-           parameter="camera"
+           execute_function="Floater.ToolbarToggle"
+           execute_parameters="camera"
            />
   <command name="voice"
            available_in_toybox="true"
            icon="Command_Voice_Icon"
            label_ref="Command_Voice_Label"
            tooltip_ref="Command_Voice_Tooltip"
-           function="Floater.ToolbarToggle"
-           parameter="voice_controls"
+           execute_function="Floater.ToolbarToggle"
+           execute_parameters="voice_controls"
            />
 </commands>
diff --git a/indra/newview/llfloatertoybox.cpp b/indra/newview/llfloatertoybox.cpp
index 7a6afb4e33..cf22e071aa 100644
--- a/indra/newview/llfloatertoybox.cpp
+++ b/indra/newview/llfloatertoybox.cpp
@@ -61,8 +61,6 @@ BOOL LLFloaterToybox::postBuild()
 	center();
 
 	mBtnRestoreDefaults = getChild<LLButton>("btn_restore_defaults");
-	mBtnRestoreDefaults->setCommitCallback(boost::bind(&LLToolBarView::loadDefaultToolbars));
-
 	mToolBar = getChild<LLToolBar>("toybox_toolbar");
 
 	LLCommandManager& cmdMgr = LLCommandManager::instance();
@@ -97,46 +95,26 @@ BOOL LLFloaterToybox::postBuild()
 	return TRUE;
 }
 
-void LLFloaterToybox::onOpen(const LLSD& key)
-{
-
-}
-
-BOOL LLFloaterToybox::canClose()
-{
-	return TRUE;
-}
-
-void LLFloaterToybox::onClose(bool app_quitting)
-{
-
-}
-
 void LLFloaterToybox::draw()
 {
 	llassert(gToolBarView != NULL);
 
-	LLCommandManager& cmdMgr = LLCommandManager::instance();
+	const command_id_list_t& command_list = mToolBar->getCommandsList();
 
-	for (U32 i = 0; i < cmdMgr.commandCount(); i++)
+	for (command_id_list_t::const_iterator it = command_list.begin(); it != command_list.end(); ++it)
 	{
-		LLCommand * command = cmdMgr.getCommand(i);
+		const LLCommandId& id = *it;
 
-		if (command->availableInToybox())
-		{
-			mToolBar->enableCommand(command->id(), !gToolBarView->hasCommand(command->id()));
-		}
+		const bool commandOnToolbar = gToolBarView->hasCommand(id);
+		mToolBar->enableCommand(id, !commandOnToolbar);
 	}
 
 	LLFloater::draw();
 }
 
-void LLFloaterToybox::onFocusReceived()
-{
-}
-
 void LLFloaterToybox::onBtnRestoreDefaults()
 {
+	LLToolBarView::loadDefaultToolbars();
 }
 
 
diff --git a/indra/newview/llfloatertoybox.h b/indra/newview/llfloatertoybox.h
index 3574e060bf..f7245506c5 100644
--- a/indra/newview/llfloatertoybox.h
+++ b/indra/newview/llfloatertoybox.h
@@ -42,11 +42,7 @@ public:
 
 	// virtuals
 	BOOL postBuild();
-	void onOpen(const LLSD& key);
-	BOOL canClose();
-	void onClose(bool app_quitting);
 	void draw();
-	void onFocusReceived();
 
 protected:
 	void onBtnRestoreDefaults();
-- 
cgit v1.2.3


From a8fcfc5e19811ce579799d415a9ad63a0f1f6dc7 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Tue, 4 Oct 2011 14:11:45 -0700
Subject: removed attempt at templating LLUI::Clamp values in order to get
 build working again

---
 indra/llcommon/llapr.h             |  3 --
 indra/llcommon/llprocesslauncher.h |  1 -
 indra/llrender/llglheaders.h       |  1 -
 indra/llui/lltoolbar.h             |  4 +--
 indra/llui/llui.h                  | 72 +++++++++++++++++---------------------
 indra/llwindow/lldragdropwin32.h   |  2 --
 indra/llwindow/llwindowwin32.h     |  1 -
 indra/win_crash_logger/StdAfx.h    |  1 -
 8 files changed, 34 insertions(+), 51 deletions(-)

diff --git a/indra/llcommon/llapr.h b/indra/llcommon/llapr.h
index 286fc43a77..3f846f1314 100644
--- a/indra/llcommon/llapr.h
+++ b/indra/llcommon/llapr.h
@@ -37,9 +37,6 @@
 	// If you get undefined symbols, find the appropriate
 	// Windows header file and include that in your .cpp file.
 	#define WIN32_LEAN_AND_MEAN
-	// do not define min() and max() macros, which collide with
-	// things like numeric_limits<T>
-	#define NOMINMAX
 	#include <winsock2.h>
 	#include <windows.h>
 #endif
diff --git a/indra/llcommon/llprocesslauncher.h b/indra/llcommon/llprocesslauncher.h
index 23e48b1823..954c249147 100644
--- a/indra/llcommon/llprocesslauncher.h
+++ b/indra/llcommon/llprocesslauncher.h
@@ -28,7 +28,6 @@
 #define LL_LLPROCESSLAUNCHER_H
 
 #if LL_WINDOWS
-#define NOMINMAX
 #include <windows.h>
 #endif
 
diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h
index b936fd30f8..851a75629e 100644
--- a/indra/llrender/llglheaders.h
+++ b/indra/llrender/llglheaders.h
@@ -520,7 +520,6 @@ extern PFNGLSAMPLEMASKIPROC glSampleMaski;
 
 // windows gl headers depend on things like APIENTRY, so include windows.
 #define WIN32_LEAN_AND_MEAN
-#define NOMINMAX
 #include <winsock2.h>
 #include <windows.h>
 
diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h
index 407cbde7d2..3c317e10a2 100644
--- a/indra/llui/lltoolbar.h
+++ b/indra/llui/lltoolbar.h
@@ -45,7 +45,7 @@ class LLToolBarButton : public LLButton
 public:
 	struct Params : public LLInitParam::Block<Params, LLButton::Params>
 	{
-		Optional<LLUI::Range<S32> >	button_width;
+		Optional<LLUI::RangeS32>	button_width;
 		Optional<S32>				desired_height;
 
 		Params()
@@ -67,7 +67,7 @@ private:
 	LLCommandId		mId;
 	S32				mMouseDownX;
 	S32				mMouseDownY;
-	LLUI::Range<S32> mWidthRange;
+	LLUI::RangeS32	mWidthRange;
 	S32				mDesiredHeight;
 	bool						mIsDragged;
 	startdrag_callback_t		mStartDragItemCallback;
diff --git a/indra/llui/llui.h b/indra/llui/llui.h
index af8f239657..28e84fa444 100644
--- a/indra/llui/llui.h
+++ b/indra/llui/llui.h
@@ -151,46 +151,43 @@ public:
 	//
 	// Classes
 	//
-	template <typename T>
-	struct RangeParams : public LLInitParam::Block<RangeParams<T> >
-	{
-		Optional<T>	minimum,
-					maximum;
 
-		RangeParams()
-		:	minimum("min", T()),
-			maximum("max", std::numeric_limits<T>::max())
-		{}
-	};
-
-	template <typename T>
-	struct Range 
+	struct RangeS32 
 	{
-		typedef Range<T> self_t;
+		struct Params : public LLInitParam::Block<Params>
+		{
+			Optional<S32>	minimum,
+							maximum;
+
+			Params()
+			:	minimum("min", 0),
+				maximum("max", S32_MAX)
+			{}
+		};
 
 		// correct for inverted params
-		Range(const RangeParams<T>& p = RangeParams<T>())
-			:	mMin(p.minimum),
+		RangeS32(const Params& p = Params())
+		:	mMin(p.minimum),
 			mMax(p.maximum)
 		{
 			sanitizeRange();
 		}
 
-		Range(T minimum, T maximum)
-			:	mMin(minimum),
+		RangeS32(S32 minimum, S32 maximum)
+		:	mMin(minimum),
 			mMax(maximum)
 		{
 			sanitizeRange();
 		}
 
-		S32 clamp(T input)
+		S32 clamp(S32 input)
 		{
 			if (input < mMin) return mMin;
 			if (input > mMax) return mMax;
 			return input;
 		}
 
-		void setRange(T minimum, T maximum)
+		void setRange(S32 minimum, S32 maximum)
 		{
 			mMin = minimum;
 			mMax = maximum;
@@ -200,7 +197,7 @@ public:
 		S32 getMin() { return mMin; }
 		S32 getMax() { return mMax; }
 
-		bool operator==(const self_t& other) const
+		bool operator==(const RangeS32& other) const
 		{
 			return mMin == other.mMin 
 				&& mMax == other.mMax;
@@ -218,60 +215,55 @@ public:
 		}
 
 
-		T	mMin,
+		S32	mMin,
 			mMax;
 	};
 
-	template<typename T>
-	struct ClampedValue : public Range<T>
+	struct ClampedS32 : public RangeS32
 	{
-		typedef Range<T> range_t;
-
-		struct Params : public LLInitParam::Block<Params, RangeParams<T> >
+		struct Params : public LLInitParam::Block<Params, RangeS32::Params>
 		{
-			Mandatory<T> value;
+			Mandatory<S32> value;
 
 			Params()
-			:	value("", T())
+			:	value("", 0)
 			{
 				addSynonym(value, "value");
 			}
 		};
 
-		ClampedValue(const Params& p)
-		:	range_t(p)
+		ClampedS32(const Params& p)
+		:	RangeS32(p)
 		{}
 
-		ClampedValue(const range_t& range)
-		:	range_t(range)
+		ClampedS32(const RangeS32& range)
+		:	RangeS32(range)
 		{
 			// set value here, after range has been sanitized
 			mValue = clamp(0);
 		}
 
-		ClampedValue(T value, const range_t& range = range_t())
-		:	range_t(range)
+		ClampedS32(S32 value, const RangeS32& range = RangeS32())
+		:	RangeS32(range)
 		{
 			mValue = clamp(value);
 		}
 
-		T get()
+		S32 get()
 		{
 			return mValue;
 		}
 
-		void set(T value)
+		void set(S32 value)
 		{
 			mValue = clamp(value);
 		}
 
 
 	private:
-		T mValue;
+		S32 mValue;
 	};
 
-	typedef ClampedValue<S32> ClampedS32;
-
 	//
 	// Methods
 	//
diff --git a/indra/llwindow/lldragdropwin32.h b/indra/llwindow/lldragdropwin32.h
index 63054bffec..929e7f9e37 100644
--- a/indra/llwindow/lldragdropwin32.h
+++ b/indra/llwindow/lldragdropwin32.h
@@ -31,7 +31,6 @@
 #ifndef LL_LLDRAGDROP32_H
 #define LL_LLDRAGDROP32_H
 
-#define NOMINMAX
 #include <windows.h>
 #include <ole2.h>
 
@@ -55,7 +54,6 @@ class LLDragDropWin32
 #ifndef LL_LLDRAGDROP32_H
 #define LL_LLDRAGDROP32_H
 
-#define NOMINMAX
 #include <windows.h>
 #include <ole2.h>
 
diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h
index dc1950fb31..387e4cbdb6 100644
--- a/indra/llwindow/llwindowwin32.h
+++ b/indra/llwindow/llwindowwin32.h
@@ -29,7 +29,6 @@
 
 // Limit Windows API to small and manageable set.
 #define WIN32_LEAN_AND_MEAN
-#define NOMINMAX
 #include <winsock2.h>
 #include <windows.h>
 
diff --git a/indra/win_crash_logger/StdAfx.h b/indra/win_crash_logger/StdAfx.h
index 71faf88bad..35976658ac 100644
--- a/indra/win_crash_logger/StdAfx.h
+++ b/indra/win_crash_logger/StdAfx.h
@@ -37,7 +37,6 @@
 #endif // _MSC_VER > 1000
 
 #define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
-#define NOMINMAX				// don't define min and max macros
 
 // Windows Header Files:
 #include <windows.h>
-- 
cgit v1.2.3


From 05879242832607795040573791b0790891367b81 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 4 Oct 2011 14:55:55 -0700
Subject: * Updating "Move" floater to be more FUI-like

---
 indra/newview/llmoveview.cpp                            | 2 --
 indra/newview/skins/default/xui/en/floater_moveview.xml | 5 +++--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp
index 142ee40cc8..a29526777a 100644
--- a/indra/newview/llmoveview.cpp
+++ b/indra/newview/llmoveview.cpp
@@ -92,8 +92,6 @@ LLFloaterMove::~LLFloaterMove()
 // virtual
 BOOL LLFloaterMove::postBuild()
 {
-	setIsChrome(TRUE);
-	setTitleVisible(TRUE); // restore title visibility after chrome applying
 	updateTransparency(TT_ACTIVE); // force using active floater transparency (STORM-730)
 	
 	LLDockableFloater::postBuild();
diff --git a/indra/newview/skins/default/xui/en/floater_moveview.xml b/indra/newview/skins/default/xui/en/floater_moveview.xml
index 6f29255a6b..3c0905a2a5 100644
--- a/indra/newview/skins/default/xui/en/floater_moveview.xml
+++ b/indra/newview/skins/default/xui/en/floater_moveview.xml
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
  legacy_header_height="18"
- can_dock="true"
+ can_dock="false"
  can_minimize="true"
- can_close="false"
+ can_close="true"
  follows="bottom"
  height="110"
  layout="topleft"
@@ -12,6 +12,7 @@
  save_rect="true"
  save_visibility="true"
  save_dock_state="true"
+ title="Move"
  width="133">
     <string
      name="walk_forward_tooltip">
-- 
cgit v1.2.3


From 4ee79abdca66f73aaba25ebf0b874bd422db46f6 Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Tue, 4 Oct 2011 15:21:13 -0700
Subject: Renamed PREFERENCES

---
 indra/newview/skins/default/xui/en/floater_preferences.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/floater_preferences.xml b/indra/newview/skins/default/xui/en/floater_preferences.xml
index dcfa8bc060..c8a139904a 100644
--- a/indra/newview/skins/default/xui/en/floater_preferences.xml
+++ b/indra/newview/skins/default/xui/en/floater_preferences.xml
@@ -8,7 +8,7 @@
  name="Preferences"
  help_topic="preferences"
  single_instance="true"
- title="PREFERENCES"
+ title="Preferences"
  width="658">
     <button
      follows="right|bottom"
-- 
cgit v1.2.3


From 3b3a13707309eb4b7d6ed5d309081c99e5f28eca Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Wed, 5 Oct 2011 11:18:17 -0700
Subject: EXP-1286 : DaD is functional though has bugs... Working on it...

---
 indra/llui/llcommandmanager.cpp |  18 ++++++-
 indra/llui/llcommandmanager.h   |  13 ++++-
 indra/llui/lltoolbar.cpp        | 103 ++++++++++++++++++++++++++++++++++------
 indra/llui/lltoolbar.h          |  38 ++++++++-------
 indra/newview/lltoolbarview.cpp |  54 ++++++++++-----------
 indra/newview/lltoolbarview.h   |   2 +-
 6 files changed, 165 insertions(+), 63 deletions(-)

diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp
index b1147134c2..a8127ab3e3 100644
--- a/indra/llui/llcommandmanager.cpp
+++ b/indra/llui/llcommandmanager.cpp
@@ -112,9 +112,25 @@ LLCommand * LLCommandManager::getCommand(const LLCommandId& commandId)
 	return command_match;
 }
 
+LLCommand * LLCommandManager::getCommand(const LLUUID& commandUUID)
+{
+	LLCommand * command_match = NULL;
+	
+	CommandUUIDMap::const_iterator found = mCommandUUIDs.find(commandUUID);
+	
+	if (found != mCommandUUIDs.end())
+	{
+		command_match = mCommands[found->second];
+	}
+	
+	return command_match;
+}
+
 void LLCommandManager::addCommand(LLCommand * command)
 {
-	mCommandIndices[command->id()] = mCommands.size();
+	LLCommandId command_id = command->id();
+	mCommandIndices[command_id] = mCommands.size();
+	mCommandUUIDs[command_id.uuid()] = mCommands.size();
 	mCommands.push_back(command);
 
 	lldebugs << "Successfully added command: " << command->id().name() << llendl;
diff --git a/indra/llui/llcommandmanager.h b/indra/llui/llcommandmanager.h
index 6481a05689..c3d2cccd73 100644
--- a/indra/llui/llcommandmanager.h
+++ b/indra/llui/llcommandmanager.h
@@ -52,13 +52,18 @@ public:
 
 	LLCommandId(const std::string& name)
 		: mName(name)
-	{}
+	{
+		mUUID = LLUUID::LLUUID::generateNewID(name);
+	}
 
 	LLCommandId(const Params& p)
 	:	mName(p.name)
-	{}
+	{
+		mUUID = LLUUID::LLUUID::generateNewID(p.name);
+	}
 
 	const std::string& name() const { return mName; }
+	const LLUUID& uuid() const { return mUUID; }
 
 	bool operator!=(const LLCommandId& command) const
 	{
@@ -79,6 +84,7 @@ public:
 
 private:
 	std::string mName;
+	LLUUID		mUUID;
 };
 
 typedef std::list<LLCommandId> command_id_list_t;
@@ -141,6 +147,7 @@ public:
 	U32 commandCount() const;
 	LLCommand * getCommand(U32 commandIndex);
 	LLCommand * getCommand(const LLCommandId& commandId);
+	LLCommand * getCommand(const LLUUID& commandUUID);
 
 	static bool load();
 
@@ -148,11 +155,13 @@ protected:
 	void addCommand(LLCommand * command);
 
 private:
+	typedef std::map<LLUUID, U32>	    CommandUUIDMap;
 	typedef std::map<LLCommandId, U32>	CommandIndexMap;
 	typedef std::vector<LLCommand *>	CommandVector;
 	
 	CommandVector	mCommands;
 	CommandIndexMap	mCommandIndices;
+	CommandUUIDMap	mCommandUUIDs;
 };
 
 
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 199574629f..c349bbcf2e 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -107,7 +107,6 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p)
 {
 	mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_WITH_TEXT] = p.button_icon_and_text;
 	mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_ONLY] = p.button_icon;
-	mUUID = LLUUID::LLUUID::generateNewID(p.name);
 }
 
 LLToolBar::~LLToolBar()
@@ -193,21 +192,71 @@ void LLToolBar::initFromParams(const LLToolBar::Params& p)
 	mNeedsLayout = true;
 }
 
-bool LLToolBar::addCommand(const LLCommandId& commandId)
+bool LLToolBar::addCommand(const LLCommandId& commandId, int rank)
 {
 	LLCommand * command = LLCommandManager::instance().getCommand(commandId);
 	if (!command) return false;
 
-		mButtonCommands.push_back(commandId);
+	// Create the button and do the things that don't need ordering
 	LLToolBarButton* button = createButton(commandId);
-	mButtons.push_back(button);
 	mButtonPanel->addChild(button);
 	mButtonMap.insert(std::make_pair(commandId, button));
+
+	// Insert the command and button in the right place in their respective lists
+	if ((rank >= mButtonCommands.size()) || (rank < 0))
+	{
+		// In that case, back load
+		mButtonCommands.push_back(commandId);
+		mButtons.push_back(button);
+	}
+	else 
+	{
+		// Insert in place: iterate to the right spot...
+		std::list<LLToolBarButton*>::iterator it_button = mButtons.begin();
+		command_id_list_t::iterator it_command = mButtonCommands.begin();
+		while (rank > 0)
+		{
+			++it_button;
+			++it_command;
+			rank--;
+		}
+		// ...then insert
+		mButtonCommands.insert(it_command,commandId);
+		mButtons.insert(it_button,button);
+	}
+
 	mNeedsLayout = true;
 
 	return true;
 }
 
+bool LLToolBar::removeCommand(const LLCommandId& commandId)
+{
+	if (!hasCommand(commandId)) return false;
+	
+	// First erase the map record
+	command_id_map::iterator it = mButtonMap.find(commandId);
+	mButtonMap.erase(it);
+	
+	// Now iterate on the commands and buttons to identify the relevant records
+	std::list<LLToolBarButton*>::iterator it_button = mButtons.begin();
+	command_id_list_t::iterator it_command = mButtonCommands.begin();
+	while (*it_command != commandId)
+	{
+		++it_button;
+		++it_command;
+	}
+	
+	// Delete the button and erase the command and button records
+	delete (*it_button);
+	mButtonCommands.erase(it_command);
+	mButtons.erase(it_button);
+
+	mNeedsLayout = true;
+	
+	return true;
+}
+
 void LLToolBar::clearCommandsList()
 {
 	// Clears the commands list
@@ -328,6 +377,33 @@ void LLToolBar::resizeButtonsInRow(std::vector<LLToolBarButton*>& buttons_in_row
 	}
 }
 
+int LLToolBar::getRankFromPosition(S32 x, S32 y)
+{
+	int rank = 0;
+
+	LLLayoutStack::ELayoutOrientation orientation = getOrientation(mSideType);
+
+	// Simply compare the passed coord with the buttons outbound box
+	std::list<LLToolBarButton*>::iterator it_button = mButtons.begin();
+	std::list<LLToolBarButton*>::iterator end_button = mButtons.end();
+	while (it_button != end_button)
+	{
+		LLRect button_rect = (*it_button)->getRect();
+		if (((orientation == LLLayoutStack::HORIZONTAL) && (button_rect.mRight > x)) ||
+			((orientation == LLLayoutStack::VERTICAL)   && (button_rect.mTop   > y))    )
+		{
+			llinfos << "Merov debug : rank compute: orientation = " << orientation << ", x = " << x << ", y = " << y << llendl;
+			llinfos << "Merov debug : rank compute: rect = " << button_rect.mLeft << ", " << button_rect.mTop << ", " << button_rect.mRight << ", " << button_rect.mBottom << llendl;
+			break;
+		}
+		rank++;
+		++it_button;
+	}
+	llinfos << "Merov debug : rank = " << rank << llendl;
+
+	return rank;
+}
+
 void LLToolBar::updateLayoutAsNeeded()
 {
 	if (!mNeedsLayout) return;
@@ -494,6 +570,7 @@ void LLToolBar::createButtons()
 		delete button;
 	}
 	mButtons.clear();
+	mButtonMap.clear();
 	
 	BOOST_FOREACH(LLCommandId& command_id, mButtonCommands)
 	{
@@ -503,7 +580,6 @@ void LLToolBar::createButtons()
 		mButtonMap.insert(std::make_pair(command_id, button));
 	}
 	mNeedsLayout = true;
-
 }
 
 LLToolBarButton* LLToolBar::createButton(const LLCommandId& id)
@@ -543,20 +619,20 @@ BOOL LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 										EAcceptance* accept,
 										std::string& tooltip_msg)
 {
-	llinfos << "Merov debug : handleDragAndDrop. drop = " << drop << ", tooltip = " << tooltip_msg << llendl;
+	llinfos << "Merov debug : handleDragAndDrop. drop = " << drop << ", x = " << x << ", y = " << y << llendl;
 	// If we have a drop callback, that means that we can handle the drop
 	BOOL handled = (mHandleDropCallback ? TRUE : FALSE);
 	
-	// if drop, time to call the drop callback to get the operation done
+	// if drop is set, it's time to call the callback to get the operation done
 	if (handled && drop)
 	{
-		handled = mHandleDropCallback(cargo_type,cargo_data,mUUID);
+		handled = mHandleDropCallback(cargo_data, x, y ,this);
 	}
 	
-	// We accept multi drop by default
-	*accept = (handled ? ACCEPT_YES_MULTI : ACCEPT_NO);
+	// We accept only single tool drop on toolbars
+	*accept = (handled ? ACCEPT_YES_SINGLE : ACCEPT_NO);
 	
-	// We'll use that flag to change the visual aspect of the target on draw()
+	// We'll use that flag to change the visual aspect of the toolbar target on draw()
 	mDragAndDropTarget = handled;
 	
 	return handled;
@@ -571,7 +647,6 @@ LLToolBarButton::LLToolBarButton(const Params& p)
 	mDesiredHeight(p.desired_height),
 	mId("")
 {
-	mUUID = LLUUID::LLUUID::generateNewID(p.name);
 }
 
 BOOL LLToolBarButton::handleMouseDown(S32 x, S32 y, MASK mask)
@@ -590,13 +665,13 @@ BOOL LLToolBarButton::handleHover( S32 x, S32 y, MASK mask )
 	{
 		if (!mIsDragged)
 		{
-			mStartDragItemCallback(x,y,mUUID);
+			mStartDragItemCallback(x,y,mId.uuid());
 			mIsDragged = true;
 			handled = TRUE;
 		}
 		else 
 		{
-			handled = mHandleDragItemCallback(x,y,mUUID,LLAssetType::AT_WIDGET);
+			handled = mHandleDragItemCallback(x,y,mId.uuid(),LLAssetType::AT_WIDGET);
 		}
 	}
 	else
diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h
index 10e5f49c0f..ddf2e048b6 100644
--- a/indra/llui/lltoolbar.h
+++ b/indra/llui/lltoolbar.h
@@ -35,9 +35,11 @@
 #include "llcommandmanager.h"
 #include "llassettype.h"
 
-typedef boost::function<void (S32 x, S32 y, const LLUUID& uuid)> startdrag_callback_t;
-typedef boost::function<BOOL (S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type)> handledrag_callback_t;
-typedef boost::function<BOOL (EDragAndDropType type, void* data, const LLUUID& uuid)> handledrop_callback_t;
+class LLToolBar;
+
+typedef boost::function<void (S32 x, S32 y, const LLUUID& uuid)> tool_startdrag_callback_t;
+typedef boost::function<BOOL (S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type)> tool_handledrag_callback_t;
+typedef boost::function<BOOL (void* data, S32 x, S32 y, LLToolBar* toolbar)> tool_handledrop_callback_t;
 
 class LLToolBarButton : public LLButton
 {
@@ -63,8 +65,8 @@ public:
 	BOOL handleHover(S32 x, S32 y, MASK mask);
 	void setCommandId(const LLCommandId& id) { mId = id; }
 
-	void setStartDragCallback(startdrag_callback_t cb) { mStartDragItemCallback = cb; }
-	void setHandleDragCallback(handledrag_callback_t cb) { mHandleDragItemCallback = cb; }
+	void setStartDragCallback(tool_startdrag_callback_t cb)   { mStartDragItemCallback  = cb; }
+	void setHandleDragCallback(tool_handledrag_callback_t cb) { mHandleDragItemCallback = cb; }
 private:
 	LLCommandId		mId;
 	S32				mMouseDownX;
@@ -72,10 +74,9 @@ private:
 	S32				mMinWidth;
 	S32				mMaxWidth;
 	S32				mDesiredHeight;
-	bool						mIsDragged;
-	startdrag_callback_t		mStartDragItemCallback;
-	handledrag_callback_t		mHandleDragItemCallback;
-	LLUUID						mUUID;
+	bool							mIsDragged;
+	tool_startdrag_callback_t		mStartDragItemCallback;
+	tool_handledrag_callback_t		mHandleDragItemCallback;
 };
 
 
@@ -146,6 +147,7 @@ public:
 	// virtuals
 	void draw();
 	void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
+	int  getRankFromPosition(S32 x, S32 y);	
 	BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
 	virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 								   EDragAndDropType cargo_type,
@@ -153,12 +155,13 @@ public:
 								   EAcceptance* accept,
 								   std::string& tooltip_msg);
 	
-	bool addCommand(const LLCommandId& commandId);
+	bool addCommand(const LLCommandId& commandId, int rank = -1);
+	bool removeCommand(const LLCommandId& commandId);
 	bool hasCommand(const LLCommandId& commandId) const;
 	bool enableCommand(const LLCommandId& commandId, bool enabled);
-	void setStartDragCallback(startdrag_callback_t cb) { mStartDragItemCallback = cb; }
-	void setHandleDragCallback(handledrag_callback_t cb) { mHandleDragItemCallback = cb; }
-	void setHandleDropCallback(handledrop_callback_t cb) { mHandleDropCallback = cb; }
+	void setStartDragCallback(tool_startdrag_callback_t cb)   { mStartDragItemCallback  = cb; }
+	void setHandleDragCallback(tool_handledrag_callback_t cb) { mHandleDragItemCallback = cb; }
+	void setHandleDropCallback(tool_handledrop_callback_t cb) { mHandleDropCallback     = cb; }
 
 	LLToolBarButton* createButton(const LLCommandId& id);
 
@@ -168,10 +171,10 @@ protected:
 	~LLToolBar();
 
 	void initFromParams(const Params&);
-	startdrag_callback_t		mStartDragItemCallback;
-	handledrag_callback_t		mHandleDragItemCallback;
-	handledrop_callback_t		mHandleDropCallback;
-	bool						mDragAndDropTarget;
+	tool_startdrag_callback_t		mStartDragItemCallback;
+	tool_handledrag_callback_t		mHandleDragItemCallback;
+	tool_handledrop_callback_t		mHandleDropCallback;
+	bool							mDragAndDropTarget;
 
 public:
 	// Methods used in loading and saving toolbar settings
@@ -188,7 +191,6 @@ private:
 	BOOL isSettingChecked(const LLSD& userdata);
 	void onSettingEnable(const LLSD& userdata);
 
-	LLUUID							mUUID;
 	const bool						mReadOnly;
 
 	std::list<LLToolBarButton*>		mButtons;
diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp
index 5822f682df..a0ea1f43e3 100644
--- a/indra/newview/lltoolbarview.cpp
+++ b/indra/newview/lltoolbarview.cpp
@@ -82,15 +82,15 @@ BOOL LLToolBarView::postBuild()
 
 	mToolbarLeft->setStartDragCallback(boost::bind(LLToolBarView::startDragItem,_1,_2,_3));
 	mToolbarLeft->setHandleDragCallback(boost::bind(LLToolBarView::handleDragItem,_1,_2,_3,_4));
-	mToolbarLeft->setHandleDropCallback(boost::bind(LLToolBarView::handleDrop,_1,_2,_3));
+	mToolbarLeft->setHandleDropCallback(boost::bind(LLToolBarView::handleDrop,_1,_2,_3,_4));
 	
 	mToolbarRight->setStartDragCallback(boost::bind(LLToolBarView::startDragItem,_1,_2,_3));
 	mToolbarRight->setHandleDragCallback(boost::bind(LLToolBarView::handleDragItem,_1,_2,_3,_4));
-	mToolbarRight->setHandleDropCallback(boost::bind(LLToolBarView::handleDrop,_1,_2,_3));
+	mToolbarRight->setHandleDropCallback(boost::bind(LLToolBarView::handleDrop,_1,_2,_3,_4));
 	
 	mToolbarBottom->setStartDragCallback(boost::bind(LLToolBarView::startDragItem,_1,_2,_3));
 	mToolbarBottom->setHandleDragCallback(boost::bind(LLToolBarView::handleDragItem,_1,_2,_3,_4));
-	mToolbarBottom->setHandleDropCallback(boost::bind(LLToolBarView::handleDrop,_1,_2,_3));
+	mToolbarBottom->setHandleDropCallback(boost::bind(LLToolBarView::handleDrop,_1,_2,_3,_4));
 	
 	return TRUE;
 }
@@ -286,10 +286,6 @@ void LLToolBarView::addToToolset(command_id_list_t& command_list, Toolbar& toolb
 
 void LLToolBarView::draw()
 {
-	static bool debug_print = true;
-	static S32 old_width = 0;
-	static S32 old_height = 0;
-
 	//LLPanel* sizer_left = getChild<LLPanel>("sizer_left");
 	
 	LLRect bottom_rect, left_rect, right_rect;
@@ -310,19 +306,6 @@ void LLToolBarView::draw()
 		mToolbarRight->localRectToOtherView(mToolbarRight->getLocalRect(), &right_rect, this);
 	}
 	
-	if ((old_width != getRect().getWidth()) || (old_height != getRect().getHeight()))
-		debug_print = true;
-	if (debug_print)
-	{
-		LLRect ctrl_rect = getRect();
-		llinfos << "Merov debug : draw control rect = " << ctrl_rect.mLeft << ", " << ctrl_rect.mTop << ", " << ctrl_rect.mRight << ", " << ctrl_rect.mBottom << llendl; 
-		llinfos << "Merov debug : draw bottom  rect = " << bottom_rect.mLeft << ", " << bottom_rect.mTop << ", " << bottom_rect.mRight << ", " << bottom_rect.mBottom << llendl; 
-		llinfos << "Merov debug : draw left    rect = " << left_rect.mLeft << ", " << left_rect.mTop << ", " << left_rect.mRight << ", " << left_rect.mBottom << llendl; 
-		llinfos << "Merov debug : draw right   rect = " << right_rect.mLeft << ", " << right_rect.mTop << ", " << right_rect.mRight << ", " << right_rect.mBottom << llendl; 
-		old_width = ctrl_rect.getWidth();
-		old_height = ctrl_rect.getHeight();
-		debug_print = false;
-	}
 	// Debug draw
 	LLColor4 back_color = LLColor4::blue;
 	LLColor4 back_color_vert = LLColor4::red;
@@ -365,7 +348,7 @@ BOOL LLToolBarView::handleDragItem( S32 x, S32 y, const LLUUID& uuid, LLAssetTyp
 			gClipboard.setSourceObject(uuid,LLAssetType::AT_WIDGET);
 			LLToolDragAndDrop::ESource src = LLToolDragAndDrop::SOURCE_VIEWER;
 			LLUUID srcID;
-			llinfos << "Merov debug: handleDragItem() :  beginMultiDrag()" << llendl;
+			llinfos << "Merov debug: handleDragItem() : beginMultiDrag()" << llendl;
 			LLToolDragAndDrop::getInstance()->beginMultiDrag(types, cargo_ids, src, srcID);
 			sDragStarted = true;
 			return TRUE;
@@ -379,18 +362,35 @@ BOOL LLToolBarView::handleDragItem( S32 x, S32 y, const LLUUID& uuid, LLAssetTyp
 	return FALSE;
 }
 
-BOOL LLToolBarView::handleDrop( EDragAndDropType cargo_type, void* cargo_data, const LLUUID& toolbar_id)
+BOOL LLToolBarView::handleDrop( void* cargo_data, S32 x, S32 y, LLToolBar* toolbar)
 {
 	LLInventoryItem* inv_item = (LLInventoryItem*)cargo_data;
-	llinfos << "Merov debug : handleDrop. Drop " << inv_item->getUUID() << " named " << inv_item->getName() << " of type " << inv_item->getType() << " to toolbar " << toolbar_id << " under cargo type " << cargo_type << llendl;
+	llinfos << "Merov debug : handleDrop. Drop " << inv_item->getUUID() << " named " << inv_item->getName() << " of type " << inv_item->getType() << llendl;
 		
 	LLAssetType::EType type = inv_item->getType();
 	if (type == LLAssetType::AT_WIDGET)
 	{
-		llinfos << "Merov debug : handleDrop. Drop source is a widget -> that's where we'll get code in..." << llendl;
-		// Find out if he command is in one of the toolbar
-		// If it is, pull it out of the toolbar
-		// Now insert it in the toolbar in the correct spot...
+		llinfos << "Merov debug : handleDrop. Drop source is a widget -> drop it in place..." << llendl;
+		// Get the command from its uuid
+		LLCommandManager& mgr = LLCommandManager::instance();
+		LLCommand* command = mgr.getCommand(inv_item->getUUID());
+		if (command)
+		{
+			// Convert the (x,y) position in rank in toolbar
+			int rank = toolbar->getRankFromPosition(x,y);
+			// Suppress the command from the toolbars (including the one it's dropped in, 
+			// this will handle move position).
+			gToolBarView->mToolbarLeft->removeCommand(command->id());
+			gToolBarView->mToolbarRight->removeCommand(command->id());
+			gToolBarView->mToolbarBottom->removeCommand(command->id());
+			// Now insert it in the toolbar at the detected rank
+			toolbar->addCommand(command->id(),rank);
+		}
+		else
+		{
+			llwarns << "Merov debug : handleDrop failing: command couldn't be found in manager" << llendl;
+		}
+
 	}
 	else
 	{
diff --git a/indra/newview/lltoolbarview.h b/indra/newview/lltoolbarview.h
index b7d3a4033a..3d488f837f 100644
--- a/indra/newview/lltoolbarview.h
+++ b/indra/newview/lltoolbarview.h
@@ -76,7 +76,7 @@ public:
 
 	static void startDragItem( S32 x, S32 y, const LLUUID& uuid);
 	static BOOL handleDragItem( S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type);
-	static BOOL handleDrop(	EDragAndDropType cargo_type, void* cargo_data, const LLUUID& folder_id);
+	static BOOL handleDrop(	void* cargo_data, S32 x, S32 y, LLToolBar* toolbar);
 	
 protected:
 	friend class LLUICtrlFactory;
-- 
cgit v1.2.3


From ba60e0906549840b8632d72f17b3f9bcda65e882 Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Wed, 5 Oct 2011 12:52:40 -0700
Subject: Fix for typo that broke build.

---
 indra/llui/llcommandmanager.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llui/llcommandmanager.h b/indra/llui/llcommandmanager.h
index b11f905574..8e5abd6461 100644
--- a/indra/llui/llcommandmanager.h
+++ b/indra/llui/llcommandmanager.h
@@ -53,13 +53,13 @@ public:
 	LLCommandId(const std::string& name)
 		: mName(name)
 	{
-		mUUID = LLUUID::LLUUID::generateNewID(name);
+		mUUID = LLUUID::generateNewID(name);
 	}
 
 	LLCommandId(const Params& p)
 	:	mName(p.name)
 	{
-		mUUID = LLUUID::LLUUID::generateNewID(p.name);
+		mUUID = LLUUID::generateNewID(p.name);
 	}
 
 	const std::string& name() const { return mName; }
-- 
cgit v1.2.3


From eda12bd009d8f71eb82b6e6238335a172d6e5fb0 Mon Sep 17 00:00:00 2001
From: Richard Nelson <richard@lindenlab.com>
Date: Wed, 5 Oct 2011 13:37:39 -0700
Subject: fixed bad xml merge

---
 .../default/xui/en/panel_preferences_move.xml      | 101 +++++++++++++--------
 1 file changed, 64 insertions(+), 37 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/panel_preferences_move.xml b/indra/newview/skins/default/xui/en/panel_preferences_move.xml
index d06ba1bc01..d9067b41c7 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_move.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_move.xml
@@ -107,7 +107,7 @@
    name="keyboard_lbl"
    width="270"
    top_delta="2">
-   Keyboard:
+    Keyboard:
   </text>
   <check_box
    control_name="ArrowKeysAlwaysMove"
@@ -139,7 +139,7 @@
    name="mouse_lbl"
    width="270"
    top_pad="15">
-   Mouse:
+    Mouse:
   </text>
   <check_box
    control_name="FirstPersonAvatarVisible"
@@ -185,43 +185,70 @@
    name="invert_mouse"
    top_delta="0"
    width="128" />
-  <check_box
+  <text
    follows="left|top"
-   height="20"
-   label="Double-Click to:"
+   type="string"
+   length="1"
+   height="10"
    layout="topleft"
-   left_delta="0"
-   name="double_click_chkbox"
-   width="237"
-   top_pad="0">
-   <check_box.commit_callback
-    function="Pref.CommitDoubleClickChekbox"/>
-  </check_box>
-  <radio_group
-     height="20"
-     layout="topleft"
-     left_delta="17"
-     top_pad="2"
-     name="double_click_action">
-    <radio_item
-     height="16"
-     label="Teleport"
-   layout="topleft"
-     left="0"
-     name="radio_teleport"
-     top_delta="20"
-     width="110" />
-    <radio_item
-     height="16"
-     label="Auto-pilot"
-     left_pad="0"
-     layout="topleft"
-     name="radio_autopilot"
-     top_delta="0"
-     width="75" />
-    <radio_group.commit_callback
-	     function="Pref.CommitRadioDoubleClick"/>
-  </radio_group>
+   left="86"
+   name="single_click_action_lbl"
+   width="150"
+   top_pad="20">
+    Single click on land:
+  </text>
+  <combo_box
+   height="23"
+   layout="topleft"
+   left_pad="10"
+   top_delta="-6"
+   name="single_click_action_combo"
+   width="200">
+    <combo_box.item
+     label="No action"
+     name="0"
+     value="0"/>
+    <combo_box.item
+     label="Move to clicked point"
+     name="1"
+     value="1"/>
+    <combo_box.commit_callback
+     function="Pref.ClickActionChange"/>
+  </combo_box>
+  <text
+   follows="left|top"
+   type="string"
+   length="1"
+   height="10"
+   layout="topleft"
+   left="86"
+   name="double_click_action_lbl"
+   width="150"
+   top_pad="12">
+    Double click on land:
+  </text>
+  <combo_box
+   height="23"
+   layout="topleft"
+   left_pad="10"
+   top_delta="-6"
+   name="double_click_action_combo"
+   width="200">
+    <combo_box.item
+     label="No action"
+     name="0"
+     value="0"/>
+    <combo_box.item
+     label="Move to clicked point"
+     name="1"
+     value="1"/>
+    <combo_box.item
+     label="Teleport to clicked point"
+     name="2"
+     value="2"/>
+    <combo_box.commit_callback
+     function="Pref.ClickActionChange"/>
+  </combo_box>
   <button
    height="23"
    label="Other Devices"
-- 
cgit v1.2.3