From ec6be3fdb91ed5f4fb0e50977a7b0814a678af0a Mon Sep 17 00:00:00 2001
From: prep linden <prep@lindenlab.com>
Date: Fri, 17 Jun 2011 10:47:33 -0400
Subject: Fix for sh-1586 & sh-1654 # Alt-zooming camera flipping

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

(limited to 'indra/newview')

diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp
index c30d3b9aa3..f195c985c0 100644
--- a/indra/newview/llagentcamera.cpp
+++ b/indra/newview/llagentcamera.cpp
@@ -393,8 +393,6 @@ LLVector3 LLAgentCamera::calcFocusOffset(LLViewerObject *object, LLVector3 origi
 	
 	LLQuaternion inv_obj_rot = ~obj_rot; // get inverse of rotation
 	LLVector3 object_extents = object->getScale();	
-	const LLVector4a* oe4 = object->mDrawable->getSpatialExtents();
-	object_extents.set( oe4[1][0], oe4[1][1], oe4[1][2] );
 	
 	// make sure they object extents are non-zero
 	object_extents.clamp(0.001f, F32_MAX);
-- 
cgit v1.2.3


From fe022adfa637d4f4f08d48576c75b5148573c8ed Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Fri, 17 Jun 2011 09:59:37 -0600
Subject: fix for SH-1783: [PUBLIC] Crash when adding a physics shape.

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

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index ab6753b4be..75728fdeeb 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -3107,18 +3107,20 @@ void LLModelPreview::rebuildUploadData()
 				}
 			}
 
-			for (U32 i = 0; i < LLModel::NUM_LODS; i++)
-			{ //fill LOD slots based on reference model index
-				if (!mModel[i].empty())
-				{
-					instance.mLOD[i] = mModel[i][idx];
-				}
-				else
-				{
-					instance.mLOD[i] = NULL;
+			if(idx < mBaseModel.size())
+			{
+				for (U32 i = 0; i < LLModel::NUM_LODS; i++)
+				{ //fill LOD slots based on reference model index
+					if (mModel[i].size() > idx)
+					{
+						instance.mLOD[i] = mModel[i][idx];
+					}
+					else
+					{
+						instance.mLOD[i] = NULL;
+					}
 				}
 			}
-
 			instance.mTransform = mat;
 			mUploadData.push_back(instance);
 		}
-- 
cgit v1.2.3


From 1b01476dad70a01246df3456e40557bc0512d2d4 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Sat, 18 Jun 2011 01:00:14 -0500
Subject: Fix for annoying assert that gets triggered when your first login
 attempt fails.

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

(limited to 'indra/newview')

diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 1b53348b43..4a9756bb88 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -1123,7 +1123,10 @@ void LLVOAvatar::initClass()
 	// Process XML data
 
 	// avatar_skeleton.xml
-	llassert(!sAvatarSkeletonInfo);
+	if (sAvatarSkeletonInfo)
+	{ //this can happen if a login attempt failed
+		delete sAvatarSkeletonInfo;
+	}
 	sAvatarSkeletonInfo = new LLVOAvatarSkeletonInfo;
 	if (!sAvatarSkeletonInfo->parseXml(sSkeletonXMLTree.getRoot()))
 	{
-- 
cgit v1.2.3


From 15235061e8a8f64dd94640d27eadfce23ccb76f6 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Sat, 18 Jun 2011 01:02:03 -0500
Subject: SH-828 Fix for using uninitialized data when normals or texture
 coordinates are absent from collada file (can now upload meshes without
 normals or texture coordinates).

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

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 866cc39eec..a4683b4874 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -3719,7 +3719,9 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim
 			U32 tri_count = 0;
 			for (U32 i = 0; i < mVertexBuffer[5][mdl].size(); ++i)
 			{
-				mVertexBuffer[5][mdl][i]->setBuffer(type_mask);
+				LLVertexBuffer* buff = mVertexBuffer[5][mdl][i];
+				buff->setBuffer(type_mask & buff->getTypeMask());
+				
 				U32 num_indices = mVertexBuffer[5][mdl][i]->getNumIndices();
 				if (num_indices > 2)
 				{
@@ -3841,6 +3843,8 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim
 
 			for (GLint i = 0; i < patch_count; ++i)
 			{
+				type_mask = mVertexBuffer[5][base][i]->getTypeMask();
+
 				LLPointer<LLVertexBuffer> buff = new LLVertexBuffer(type_mask, 0);
 
 				if (sizes[i*2+1] > 0 && sizes[i*2] > 0)
@@ -3865,8 +3869,15 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim
 				LLStrider<U16> index;
 
 				buff->getVertexStrider(pos);
-				buff->getNormalStrider(norm);
-				buff->getTexCoord0Strider(tc);
+				if (type_mask & LLVertexBuffer::MAP_NORMAL)
+				{
+					buff->getNormalStrider(norm);
+				}
+				if (type_mask & LLVertexBuffer::MAP_TEXCOORD0)
+				{
+					buff->getTexCoord0Strider(tc);
+				}
+
 				buff->getIndexStrider(index);
 
 				target_model->setVolumeFaceData(names[i], pos, norm, tc, index, buff->getNumVerts(), buff->getNumIndices());
@@ -4462,7 +4473,16 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights)
 
 			bool skinned = include_skin_weights && !mdl->mSkinWeights.empty();
 
-			U32 mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0;
+			U32 mask = LLVertexBuffer::MAP_VERTEX;
+			
+			if (vf.mNormals)
+			{
+				mask |= LLVertexBuffer::MAP_NORMAL;
+			}
+			if (vf.mTexCoords)
+			{
+				mask |= LLVertexBuffer::MAP_TEXCOORD0;
+			}
 
 			if (skinned)
 			{
@@ -4480,8 +4500,6 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights)
 			LLStrider<LLVector4> weights_strider;
 
 			vb->getVertexStrider(vertex_strider);
-			vb->getNormalStrider(normal_strider);
-			vb->getTexCoord0Strider(tc_strider);
 			vb->getIndexStrider(index_strider);
 
 			if (skinned)
@@ -4490,8 +4508,18 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights)
 			}
 
 			LLVector4a::memcpyNonAliased16((F32*) vertex_strider.get(), (F32*) vf.mPositions, num_vertices*4*sizeof(F32));
-			LLVector4a::memcpyNonAliased16((F32*) tc_strider.get(), (F32*) vf.mTexCoords, num_vertices*2*sizeof(F32));
-			LLVector4a::memcpyNonAliased16((F32*) normal_strider.get(), (F32*) vf.mNormals, num_vertices*4*sizeof(F32));
+			
+			if (vf.mTexCoords)
+			{
+				vb->getTexCoord0Strider(tc_strider);
+				LLVector4a::memcpyNonAliased16((F32*) tc_strider.get(), (F32*) vf.mTexCoords, num_vertices*2*sizeof(F32));
+			}
+			
+			if (vf.mNormals)
+			{
+				vb->getNormalStrider(normal_strider);
+				LLVector4a::memcpyNonAliased16((F32*) normal_strider.get(), (F32*) vf.mNormals, num_vertices*4*sizeof(F32));
+			}
 
 			if (skinned)
 			{
@@ -4750,6 +4778,8 @@ BOOL LLModelPreview::render()
 	const F32 BRIGHTNESS = 0.9f;
 	gGL.color3f(BRIGHTNESS, BRIGHTNESS, BRIGHTNESS);
 
+	const U32 type_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0;
+
 	LLGLEnable normalize(GL_NORMALIZE);
 
 	if (!mBaseModel.empty() && mVertexBuffer[5].empty())
@@ -4798,8 +4828,8 @@ BOOL LLModelPreview::render()
 				for (U32 i = 0; i < mVertexBuffer[mPreviewLOD][model].size(); ++i)
 				{
 					LLVertexBuffer* buffer = mVertexBuffer[mPreviewLOD][model][i];
-
-					buffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0);
+				
+					buffer->setBuffer(type_mask & buffer->getTypeMask());
 
 					if (textures)
 					{
@@ -4918,7 +4948,7 @@ BOOL LLModelPreview::render()
 						{
 							LLVertexBuffer* buffer = mVertexBuffer[LLModel::LOD_PHYSICS][model][i];
 
-							buffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0);
+							buffer->setBuffer(type_mask & buffer->getTypeMask());
 
 							buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0);
 							gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
@@ -4984,7 +5014,7 @@ BOOL LLModelPreview::render()
 							{
 								LLVertexBuffer* buffer = mVertexBuffer[LLModel::LOD_PHYSICS][model][i];
 
-								buffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0);
+								buffer->setBuffer(type_mask & buffer->getTypeMask());
 
 								LLStrider<LLVector3> pos_strider; 
 								buffer->getVertexStrider(pos_strider, 0);
@@ -5109,7 +5139,7 @@ BOOL LLModelPreview::render()
 								position[j] = v;
 							}
 
-							buffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0);
+							buffer->setBuffer(type_mask & buffer->getTypeMask());
 							glColor4fv(instance.mMaterial[i].mDiffuseColor.mV);
 							gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 							buffer->draw(LLRender::TRIANGLES, buffer->getNumIndices(), 0);
-- 
cgit v1.2.3


From aba4f7ddc89c9d28bdd4b02735134101f40634ed Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Mon, 20 Jun 2011 14:01:32 -0600
Subject: fix for SH-1870: can not upload book_collection_1.dae when include
 textures

---
 indra/newview/app_settings/settings.xml | 11 +++++++++++
 indra/newview/llmeshrepository.cpp      | 10 ++++++----
 indra/newview/llmeshrepository.h        |  3 +++
 3 files changed, 20 insertions(+), 4 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 76fecdf05e..52064c96f2 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -5611,6 +5611,17 @@
     <key>Value</key>
     <real>0</real>
   </map>
+  <key>MeshUploadTimeOut</key>
+  <map>
+    <key>Comment</key>
+    <string>Maximum time in seconds for llcurl to execute a mesh uoloading request</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>S32</string>
+    <key>Value</key>
+    <real>600</real>
+  </map>
   <key>MigrateCacheDirectory</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 6e0722bcf9..2b340fc54d 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -1383,6 +1383,8 @@ LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data,
 	mWholeModelFeeCapability = gAgent.getRegion()->getCapability("NewFileAgentInventory");
 
 	mOrigin += gAgent.getAtAxis() * scale.magVec();
+
+	mMeshUploadTimeOut = gSavedSettings.getS32("MeshUploadTimeOut") ;
 }
 
 LLMeshUploadThread::~LLMeshUploadThread()
@@ -1686,7 +1688,7 @@ void LLMeshUploadThread::doWholeModelUpload()
 	mPendingUploads++;
 	LLCurlRequest::headers_t headers;
 	mCurlRequest->post(mWholeModelFeeCapability, headers, model_data,
-					   new LLWholeModelFeeResponder(this,model_data));
+					   new LLWholeModelFeeResponder(this,model_data), mMeshUploadTimeOut);
 
 	do
 	{
@@ -1705,7 +1707,7 @@ void LLMeshUploadThread::doWholeModelUpload()
 		LLSD body = full_model_data["asset_resources"];
 		dump_llsd_to_file(body,make_dump_name("whole_model_body_",dump_num));
 		mCurlRequest->post(mWholeModelUploadURL, headers, body,
-						   new LLWholeModelUploadResponder(this, model_data));
+						   new LLWholeModelUploadResponder(this, model_data), mMeshUploadTimeOut);
 		do
 		{
 			mCurlRequest->process();
@@ -2874,7 +2876,7 @@ void LLMeshUploadThread::doUploadModel(LLMeshUploadData& data)
 		LLCurlRequest::headers_t headers;
 		mPendingUploads++;
 
-		mCurlRequest->post(data.mRSVP, headers, data.mAssetData, new LLMeshUploadResponder(data, this));
+		mCurlRequest->post(data.mRSVP, headers, data.mAssetData, new LLMeshUploadResponder(data, this), mMeshUploadTimeOut);
 	}
 }
 
@@ -2906,7 +2908,7 @@ void LLMeshUploadThread::doUploadTexture(LLTextureUploadData& data)
 		LLCurlRequest::headers_t headers;
 		mPendingUploads++;
 
-		mCurlRequest->post(data.mRSVP, headers, data.mAssetData, new LLTextureUploadResponder(data, this));
+		mCurlRequest->post(data.mRSVP, headers, data.mAssetData, new LLTextureUploadResponder(data, this), mMeshUploadTimeOut);
 	}
 }
 
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index f237c3a60e..f56734a7de 100644
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -356,6 +356,9 @@ public:
 
 class LLMeshUploadThread : public LLThread 
 {
+private:
+	S32 mMeshUploadTimeOut ; //maximum time in seconds to execute an uploading request.
+
 public:
 	class DecompRequest : public LLPhysicsDecomp::Request
 	{
-- 
cgit v1.2.3


From 9afc77ba0affee16d9dbee312417aaef541eabba Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Tue, 21 Jun 2011 21:00:06 +0300
Subject: SH-1719 FIXED Viewer side cleanup of presentation of accounting data
 in build tools

- Moved grid mode combo box to the grid options floater

- Updated UI of the build floater according to the spec

- Fixed "conflict" between LLFloaterOpenHandler and LLFloaterHandler command handlers
---
 indra/newview/app_settings/settings.xml            |  11 ++
 indra/newview/llfloaterbuildoptions.cpp            |  68 ++++++-
 indra/newview/llfloaterbuildoptions.h              |  23 ++-
 indra/newview/llfloatertools.cpp                   | 142 +++++---------
 indra/newview/llfloatertools.h                     |   4 +-
 indra/newview/llviewerfloaterreg.cpp               |   4 +-
 indra/newview/llviewermenu.cpp                     |   7 +-
 indra/newview/llviewerwindow.cpp                   |   6 +
 .../skins/default/xui/en/floater_build_options.xml |  73 +++++++-
 .../skins/default/xui/en/floater_model_wizard.xml  |   2 +-
 .../newview/skins/default/xui/en/floater_tools.xml | 203 +++++++--------------
 11 files changed, 296 insertions(+), 247 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 52064c96f2..cf07350d85 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -9398,6 +9398,17 @@
       <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/llfloaterbuildoptions.cpp b/indra/newview/llfloaterbuildoptions.cpp
index 4b6fe4a115..86c1bf0534 100644
--- a/indra/newview/llfloaterbuildoptions.cpp
+++ b/indra/newview/llfloaterbuildoptions.cpp
@@ -34,15 +34,81 @@
 #include "llfloaterbuildoptions.h"
 #include "lluictrlfactory.h"
 
+#include "llcombobox.h"
+#include "llselectmgr.h"
+
 //
 // Methods
 //
+
+void commit_grid_mode(LLUICtrl *);
+
 LLFloaterBuildOptions::LLFloaterBuildOptions(const LLSD& key)
-  : LLFloater(key)
+  : LLFloater(key),
+    mComboGridMode(NULL)
 {
+	mCommitCallbackRegistrar.add("GridOptions.gridMode", boost::bind(&commit_grid_mode,_1));
 }
 
 LLFloaterBuildOptions::~LLFloaterBuildOptions()
+{}
+
+BOOL LLFloaterBuildOptions::postBuild()
+{
+	mComboGridMode = getChild<LLComboBox>("combobox grid mode");
+
+	return TRUE;
+}
+
+void LLFloaterBuildOptions::setGridMode(EGridMode mode)
+{
+	mComboGridMode->setCurrentByIndex((S32)mode);
+}
+
+void LLFloaterBuildOptions::updateGridMode()
 {
+	if (mComboGridMode)
+	{
+		S32 index = mComboGridMode->getCurrentIndex();
+		mComboGridMode->removeall();
+
+		switch (mObjectSelection->getSelectType())
+		{
+		case SELECT_TYPE_HUD:
+		  mComboGridMode->add(getString("grid_screen_text"));
+		  mComboGridMode->add(getString("grid_local_text"));
+		  break;
+		case SELECT_TYPE_WORLD:
+		  mComboGridMode->add(getString("grid_world_text"));
+		  mComboGridMode->add(getString("grid_local_text"));
+		  mComboGridMode->add(getString("grid_reference_text"));
+		  break;
+		case SELECT_TYPE_ATTACHMENT:
+		  mComboGridMode->add(getString("grid_attachment_text"));
+		  mComboGridMode->add(getString("grid_local_text"));
+		  mComboGridMode->add(getString("grid_reference_text"));
+		  break;
+		}
+
+		mComboGridMode->setCurrentByIndex(index);
+	}
+}
+
+// virtual
+void LLFloaterBuildOptions::onOpen(const LLSD& key)
+{
+	mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();
 }
 
+// virtual
+void LLFloaterBuildOptions::onClose(bool app_quitting)
+{
+	mObjectSelection = NULL;
+}
+
+void commit_grid_mode(LLUICtrl *ctrl)
+{
+	LLComboBox* combo = (LLComboBox*)ctrl;
+
+	LLSelectMgr::getInstance()->setGridMode((EGridMode)combo->getCurrentIndex());
+}
diff --git a/indra/newview/llfloaterbuildoptions.h b/indra/newview/llfloaterbuildoptions.h
index 164944d7bc..7f3811bf1c 100644
--- a/indra/newview/llfloaterbuildoptions.h
+++ b/indra/newview/llfloaterbuildoptions.h
@@ -33,15 +33,34 @@
 #define LL_LLFLOATERBUILDOPTIONS_H
 
 #include "llfloater.h"
+#include "llselectmgr.h"
 
+class LLComboBox;
+class LLObjectSelection;
+
+typedef LLSafeHandle<LLObjectSelection> LLObjectSelectionHandle;
 
 class LLFloaterBuildOptions
 	:	public LLFloater
 {
-	friend class LLFloaterReg;
+public:
+
+	virtual BOOL postBuild();
+
+	/*virtual*/ void onOpen(const LLSD& key);
+	/*virtual*/	void onClose(bool app_quitting);
+
+	void setGridMode(EGridMode mode);
+	void updateGridMode();
+
 private:
+
+	friend class LLFloaterReg;
+
 	LLFloaterBuildOptions(const LLSD& key);
 	~LLFloaterBuildOptions();
-};
 
+	LLComboBox*	mComboGridMode;
+	LLObjectSelectionHandle	mObjectSelection;
+};
 #endif
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index 0d798afdcc..3e98cff9e6 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -36,7 +36,6 @@
 #include "llagentcamera.h"
 #include "llbutton.h"
 #include "llcheckboxctrl.h"
-#include "llcombobox.h"
 #include "lldraghandle.h"
 #include "llerror.h"
 #include "llfloaterbuildoptions.h"
@@ -101,6 +100,7 @@ const std::string PANEL_NAMES[LLFloaterTools::PANEL_COUNT] =
 	std::string("Content"),	// PANEL_CONTENTS,
 };
 
+
 // Local prototypes
 void commit_select_component(void *data);
 void click_show_more(void*);
@@ -116,7 +116,6 @@ void commit_radio_group_focus(LLUICtrl* ctrl);
 void commit_radio_group_move(LLUICtrl* ctrl);
 void commit_radio_group_edit(LLUICtrl* ctrl);
 void commit_radio_group_land(LLUICtrl* ctrl);
-void commit_grid_mode(LLUICtrl *);
 void commit_slider_zoom(LLUICtrl *ctrl);
 
 
@@ -234,7 +233,6 @@ BOOL	LLFloaterTools::postBuild()
 	getChild<LLUICtrl>("checkbox uniform")->setValue((BOOL)gSavedSettings.getBOOL("ScaleUniform"));
 	mCheckStretchTexture	= getChild<LLCheckBoxCtrl>("checkbox stretch textures");
 	getChild<LLUICtrl>("checkbox stretch textures")->setValue((BOOL)gSavedSettings.getBOOL("ScaleStretchTextures"));
-	mComboGridMode			= getChild<LLComboBox>("combobox grid mode");
 	mCheckStretchUniformLabel = getChild<LLTextBox>("checkbox uniform label");
 
 	//
@@ -269,6 +267,8 @@ BOOL	LLFloaterTools::postBuild()
 	// the setting stores the actual force multiplier, but the slider is logarithmic, so we convert here
 	getChild<LLUICtrl>("slider force")->setValue(log10(gSavedSettings.getF32("LandBrushForce")));
 
+	mCostTextBorder = getChild<LLViewBorder>("cost_text_border");
+
 	mTab = getChild<LLTabContainer>("Object Info Tabs");
 	if(mTab)
 	{
@@ -311,7 +311,6 @@ LLFloaterTools::LLFloaterTools(const LLSD& key)
 	mCheckSnapToGrid(NULL),
 	mBtnGridOptions(NULL),
 	mTitleMedia(NULL),
-	mComboGridMode(NULL),
 	mCheckStretchUniform(NULL),
 	mCheckStretchTexture(NULL),
 	mCheckStretchUniformLabel(NULL),
@@ -344,6 +343,7 @@ LLFloaterTools::LLFloaterTools(const LLSD& key)
 	mPanelFace(NULL),
 	mPanelLandInfo(NULL),
 
+	mCostTextBorder(NULL),
 	mTabLand(NULL),
 	mDirty(TRUE),
 	mNeedMediaTitle(TRUE)
@@ -367,7 +367,6 @@ LLFloaterTools::LLFloaterTools(const LLSD& key)
 	mCommitCallbackRegistrar.add("BuildTool.selectComponent",	boost::bind(&commit_select_component, this));
 	mCommitCallbackRegistrar.add("BuildTool.gridOptions",		boost::bind(&LLFloaterTools::onClickGridOptions,this));
 	mCommitCallbackRegistrar.add("BuildTool.applyToSelection",	boost::bind(&click_apply_to_selection, this));
-	mCommitCallbackRegistrar.add("BuildTool.gridMode",			boost::bind(&commit_grid_mode,_1));
 	mCommitCallbackRegistrar.add("BuildTool.commitRadioLand",	boost::bind(&commit_radio_group_land,_1));
 	mCommitCallbackRegistrar.add("BuildTool.LandBrushForce",	boost::bind(&commit_slider_dozer_force,_1));
 	mCommitCallbackRegistrar.add("BuildTool.AddMedia",			boost::bind(&LLFloaterTools::onClickBtnAddMedia,this));
@@ -429,10 +428,10 @@ void LLFloaterTools::refresh()
 	{		
 		std::string obj_count_string;
 		LLResMgr::getInstance()->getIntegerString(obj_count_string, LLSelectMgr::getInstance()->getSelection()->getRootObjectCount());
-		getChild<LLUICtrl>("obj_count")->setTextArg("[COUNT]", obj_count_string);	
+		getChild<LLUICtrl>("selection_count")->setTextArg("[OBJ_COUNT]", obj_count_string);
 		std::string prim_count_string;
 		LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount());
-		getChild<LLUICtrl>("prim_count")->setTextArg("[COUNT]", prim_count_string);
+		getChild<LLUICtrl>("selection_count")->setTextArg("[PRIM_COUNT]", prim_count_string);
 
 		// calculate selection rendering cost
 		if (sShowObjectCost)
@@ -451,55 +450,46 @@ void LLFloaterTools::refresh()
 	else
 #endif
 	{
-		// Get the number of objects selected
-		std::string root_object_count_string;
-		std::string object_count_string;
-
-		LLResMgr::getInstance()->getIntegerString(
-			root_object_count_string,
-			LLSelectMgr::getInstance()->getSelection()->getRootObjectCount());
-		LLResMgr::getInstance()->getIntegerString(
-			object_count_string,
-			LLSelectMgr::getInstance()->getSelection()->getObjectCount());
-
-		F32 obj_cost =
-			LLSelectMgr::getInstance()->getSelection()->getSelectedObjectCost();
-		F32 link_cost =
-			LLSelectMgr::getInstance()->getSelection()->getSelectedLinksetCost();
-		F32 obj_physics_cost =
-			LLSelectMgr::getInstance()->getSelection()->getSelectedPhysicsCost();
-		F32 link_physics_cost =
-			LLSelectMgr::getInstance()->getSelection()->getSelectedLinksetPhysicsCost();
-
-		// Update the text for the counts
-		childSetTextArg(
-			"linked_set_count",
-			"[COUNT]",
-			root_object_count_string);
-		childSetTextArg("object_count", "[COUNT]", object_count_string);
-
-		// Update the text for the resource costs
-		childSetTextArg("linked_set_cost","[COST]",llformat("%.1f", link_cost));
-		childSetTextArg("object_cost", "[COST]", llformat("%.1f", obj_cost));
-		childSetTextArg("linked_set_cost","[PHYSICS]",llformat("%.1f", link_physics_cost));
-		childSetTextArg("object_cost", "[PHYSICS]", llformat("%.1f", obj_physics_cost));
-
-		// Display rendering cost if needed
-		if (sShowObjectCost)
+		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 args;
+		args["OBJ_COUNT"] = llformat("%.1d", link_count);
+		args["PRIM_COUNT"] = llformat("%.1d", prim_count);
+
+		std::ostringstream selection_info;
+		selection_info << getString("status_selectcount", args);
+
+		bool show_prim_equiv = (link_cost != prim_count) && link_cost;
+		bool show_adv_weight = gSavedSettings.getBOOL("ShowAdvancedBuilderOptions");
+		bool show_mesh_cost = gMeshRepo.meshRezEnabled();
+
+		if (show_prim_equiv && show_mesh_cost)
 		{
-			std::string prim_cost_string;
-			LLResMgr::getInstance()->getIntegerString(prim_cost_string, calcRenderCost());
-			getChild<LLUICtrl>("RenderingCost")->setTextArg("[COUNT]", prim_cost_string);
+			selection_info << ": ";
+			args["SEL_WEIGHT"] = llformat("%.1f", link_cost);
+			selection_info << getString("status_selectprimequiv", args);
 		}
 
+		if (show_adv_weight)
+		{
+			show_prim_equiv ? (selection_info << ",") : (selection_info << ".");
 
-		// disable the object and prim counts if nothing selected
-		bool have_selection = ! LLSelectMgr::getInstance()->getSelection()->isEmpty();
-		childSetEnabled("linked_set_count", have_selection);
-		childSetEnabled("object_count", have_selection);
-		childSetEnabled("linked_set_cost", have_selection);
-		childSetEnabled("object_cost", have_selection);
-		getChildView("RenderingCost")->setEnabled(have_selection && sShowObjectCost);
+			childSetTextArg("selection_weight", "[PHYS_WEIGHT]", llformat("%.1f", link_phys_cost));
+			childSetTextArg("selection_weight", "[DISP_WEIGHT]", llformat("%.1d", calcRenderCost()));
+		}
+		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_empty", !have_selection);
 	}
 
 
@@ -664,33 +654,6 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
 		mRadioGroupEdit->setValue("radio select face");
 	}
 
-	if (mComboGridMode) 
-	{
-		mComboGridMode->setVisible( edit_visible );
-		S32 index = mComboGridMode->getCurrentIndex();
-		mComboGridMode->removeall();
-
-		switch (mObjectSelection->getSelectType())
-		{
-		case SELECT_TYPE_HUD:
-		  mComboGridMode->add(getString("grid_screen_text"));
-		  mComboGridMode->add(getString("grid_local_text"));
-		  //mComboGridMode->add(getString("grid_reference_text"));
-		  break;
-		case SELECT_TYPE_WORLD:
-		  mComboGridMode->add(getString("grid_world_text"));
-		  mComboGridMode->add(getString("grid_local_text"));
-		  mComboGridMode->add(getString("grid_reference_text"));
-		  break;
-		case SELECT_TYPE_ATTACHMENT:
-		  mComboGridMode->add(getString("grid_attachment_text"));
-		  mComboGridMode->add(getString("grid_local_text"));
-		  mComboGridMode->add(getString("grid_reference_text"));
-		  break;
-		}
-
-		mComboGridMode->setCurrentByIndex(index);
-	}
 	// Snap to grid disabled for grab tool - very confusing
 	if (mCheckSnapToGrid) mCheckSnapToGrid->setVisible( edit_visible /* || tool == LLToolGrab::getInstance() */ );
 	if (mBtnGridOptions) mBtnGridOptions->setVisible( edit_visible /* || tool == LLToolGrab::getInstance() */ );
@@ -739,6 +702,8 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
 	// Land buttons
 	BOOL land_visible = (tool == LLToolBrushLand::getInstance() || tool == LLToolSelectLand::getInstance() );
 
+	mCostTextBorder->setVisible(!land_visible);
+
 	if (mBtnLand)	mBtnLand	->setToggleState( land_visible );
 
 	mRadioGroupLand->setVisible( land_visible );
@@ -791,15 +756,11 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
 		getChildView("Strength:")->setVisible( land_visible);
 	}
 
-	bool show_mesh_cost = gMeshRepo.meshRezEnabled();
+	bool have_selection = !LLSelectMgr::getInstance()->getSelection()->isEmpty();
 
-	getChildView("obj_count")->setVisible( !land_visible && !show_mesh_cost);
-	getChildView("prim_count")->setVisible( !land_visible && !show_mesh_cost);
-	getChildView("linked_set_count")->setVisible( !land_visible && show_mesh_cost);
-	getChildView("linked_set_cost")->setVisible( !land_visible && show_mesh_cost);
-	getChildView("object_count")->setVisible( !land_visible && show_mesh_cost);
-	getChildView("object_cost")->setVisible( !land_visible && show_mesh_cost);
-	getChildView("RenderingCost")->setVisible( !land_visible && sShowObjectCost);
+	getChildView("selection_count")->setVisible(!land_visible && have_selection);
+	getChildView("selection_weight")->setVisible(!land_visible && have_selection && gSavedSettings.getBOOL("ShowAdvancedBuilderOptions"));
+	getChildView("selection_empty")->setVisible(!land_visible && !have_selection);
 	
 	mTab->setVisible(!land_visible);
 	mPanelLandInfo->setVisible(land_visible);
@@ -1032,13 +993,6 @@ void commit_select_component(void *data)
 	}
 }
 
-void commit_grid_mode(LLUICtrl *ctrl)   
-{   
-	LLComboBox* combo = (LLComboBox*)ctrl;   
-    
-	LLSelectMgr::getInstance()->setGridMode((EGridMode)combo->getCurrentIndex());
-} 
-
 // static 
 void LLFloaterTools::setObjectType( LLPCode pcode )
 {
diff --git a/indra/newview/llfloatertools.h b/indra/newview/llfloatertools.h
index fd81a75397..69636190fc 100644
--- a/indra/newview/llfloatertools.h
+++ b/indra/newview/llfloatertools.h
@@ -32,7 +32,6 @@
 #include "llparcelselection.h"
 
 class LLButton;
-class LLComboBox;
 class LLCheckBoxCtrl;
 class LLPanelPermissions;
 class LLPanelObject;
@@ -140,7 +139,6 @@ public:
 
 	LLCheckBoxCtrl*	mCheckSnapToGrid;
 	LLButton*		mBtnGridOptions;
-	LLComboBox*		mComboGridMode;
 	LLCheckBoxCtrl*	mCheckStretchUniform;
 	LLCheckBoxCtrl*	mCheckStretchTexture;
 
@@ -179,6 +177,8 @@ public:
 	LLPanelFace				*mPanelFace;
 	LLPanelLandInfo			*mPanelLandInfo;
 
+	LLViewBorder*			mCostTextBorder;
+
 	LLTabContainer*			mTabLand;
 
 	LLParcelSelectionHandle	mParcelSelection;
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index a1c2c926af..f3b22eab40 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -129,12 +129,12 @@
 
 // *NOTE: Please add files in alphabetical order to keep merges easy.
 
-// handle secondlife:///app/floater/{NAME} URLs
+// handle secondlife:///app/openfloater/{NAME} URLs
 class LLFloaterOpenHandler : public LLCommandHandler
 {
 public:
 	// requires trusted browser to trigger
-	LLFloaterOpenHandler() : LLCommandHandler("floater", UNTRUSTED_THROTTLE) { }
+	LLFloaterOpenHandler() : LLCommandHandler("openfloater", UNTRUSTED_THROTTLE) { }
 
 	bool handle(const LLSD& params, const LLSD& query_map,
 				LLMediaCtrl* web)
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 41d8b57f36..4bf5454905 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -60,6 +60,7 @@
 #include "llfloatersnapshot.h"
 #include "llfloatertools.h"
 #include "llfloaterworldmap.h"
+#include "llfloaterbuildoptions.h"
 #include "llavataractions.h"
 #include "lllandmarkactions.h"
 #include "llgroupmgr.h"
@@ -7159,9 +7160,11 @@ class LLToolsUseSelectionForGrid : public view_listener_t
 		} func;
 		LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func);
 		LLSelectMgr::getInstance()->setGridMode(GRID_MODE_REF_OBJECT);
-		if (gFloaterTools)
+
+		LLFloaterBuildOptions* build_options_floater = LLFloaterReg::getTypedInstance<LLFloaterBuildOptions>("build_options");
+		if (build_options_floater && build_options_floater->getVisible())
 		{
-			gFloaterTools->mComboGridMode->setCurrentByIndex((S32)GRID_MODE_REF_OBJECT);
+			build_options_floater->setGridMode(GRID_MODE_REF_OBJECT);
 		}
 		return true;
 	}
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index b1441cc281..1dffb9e5e3 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -3142,6 +3142,12 @@ void LLViewerWindow::updateLayout()
 		//gMenuBarView->setItemVisible("BuildTools", gFloaterTools->getVisible());
 	}
 
+	LLFloaterBuildOptions* build_options_floater = LLFloaterReg::getTypedInstance<LLFloaterBuildOptions>("build_options");
+	if (build_options_floater && build_options_floater->getVisible())
+	{
+		build_options_floater->updateGridMode();
+	}
+
 	// Always update console
 	if(gConsole)
 	{
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 56230e912c..c247a12e7a 100644
--- a/indra/newview/skins/default/xui/en/floater_build_options.xml
+++ b/indra/newview/skins/default/xui/en/floater_build_options.xml
@@ -2,27 +2,84 @@
 <floater
  legacy_header_height="18"
  follows="right"
- height="170"
+ height="198"
  layout="topleft"
  name="build options floater"
  help_topic="build_options_floater"
  save_rect="true"
  title="GRID OPTIONS"
  width="264">
+ 	<floater.string
+     name="grid_screen_text">
+        Screen
+    </floater.string>
+    <floater.string
+     name="grid_local_text">
+        Local
+    </floater.string>
+    <floater.string
+     name="grid_world_text">
+        World
+    </floater.string>
+    <floater.string
+     name="grid_reference_text">
+        Reference
+    </floater.string>
+    <floater.string
+     name="grid_attachment_text">
+        Attachment
+    </floater.string>
+    <text
+     type="string"
+     length="1"
+     follows="left|top"
+     height="16"
+     layout="topleft"
+     left="10"
+     tool_tip="Grid opacity"
+     name="grid_opacity_label"
+     top_pad="30"
+     width="123">
+        Mode
+    </text>
+    <combo_box
+     height="23"
+     layout="topleft"
+     left_pad="9"
+     follows="left|top"
+     name="combobox grid mode"
+     tool_tip="Choose the type of grid ruler for positioning the object"
+     top_delta="-3"
+     width="108">
+      <combo_box.item
+       label="World grid"
+       name="World"
+       value="World" />
+      <combo_box.item
+       label="Local grid"
+       name="Local"
+       value="Local" />
+      <combo_box.item
+       label="Reference grid"
+       name="Reference"
+       value="Reference" />
+       <combo_box.commit_callback
+      function="GridOptions.gridMode"/>
+    </combo_box>
     <spinner
      control_name="GridResolution"
      follows="left|top"
      height="23"
      initial_value="1"
-     label="Grid Units (meters)"
-     label_width="160"
+     label="Units (meters)"
+     label_width="130"
      layout="topleft"
      left="10"
      max_val="5"
      min_val="0.01"
      name="GridResolution"
-     top="25"
-     width="230" />
+     top_pad="4"
+     width="200" />
     <spinner
      control_name="GridDrawSize"
      decimal_digits="1"
@@ -30,15 +87,15 @@
      height="23"
      increment="0.5"
      initial_value="5"
-     label="Grid Extents (meters)"
-     label_width="160"
+     label="Extents (meters)"
+     label_width="130"
      layout="topleft"
      left_delta="0"
      max_val="50"
      min_val="1"
      name="GridDrawSize"
      top_pad="0"
-     width="230" />
+     width="200" />
     <check_box
      control_name="GridSubUnit"
      height="16"
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 8603682e3a..c3f7b70ca7 100644
--- a/indra/newview/skins/default/xui/en/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_wizard.xml
@@ -281,7 +281,7 @@
 			 height="40"
 			 left="10"
 			 word_wrap="true">
-Advanced users familiar with 3d content creation tools may prefer to use the [secondlife:///app/floater/upload_model Advanced Mesh Import Window] .
+Advanced users familiar with 3d content creation tools may prefer to use the [secondlife:///app/openfloater/upload_model Advanced Mesh Import Window] .
 			</text>
 		</panel>
 	</panel>
diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml
index 7441b2cd9c..aad94f5b47 100644
--- a/indra/newview/skins/default/xui/en/floater_tools.xml
+++ b/indra/newview/skins/default/xui/en/floater_tools.xml
@@ -47,24 +47,12 @@
         Click and drag to select land
     </floater.string>
     <floater.string
-     name="grid_screen_text">
-        Screen
+     name="status_selectcount">
+        [OBJ_COUNT] objects ( [PRIM_COUNT] prims ) selected
     </floater.string>
     <floater.string
-     name="grid_local_text">
-        Local
-    </floater.string>
-    <floater.string
-     name="grid_world_text">
-        World
-    </floater.string>
-    <floater.string
-     name="grid_reference_text">
-        Reference
-    </floater.string>
-    <floater.string
-     name="grid_attachment_text">
-        Attachment
+     name="status_selectprimequiv">
+        PE weight [SEL_WEIGHT]
     </floater.string>
     <button
      follows="left|top"
@@ -221,7 +209,7 @@
 	<radio_group
      follows="left|top"
 	 left="5"
-	 top="59"
+	 top="55"
 	 height="70"
      layout="topleft"
 	 name="edit_radio_group">
@@ -255,18 +243,18 @@
      label="Edit linked"
      layout="topleft"
      name="checkbox edit linked parts"
-     top_pad="-10">
+     top_pad="-18">
 		  <check_box.commit_callback
 			function="BuildTool.selectComponent"/>
 	</check_box>
 
    <button
      follows="left|top"
-     height="23"
+     height="20"
      label="Link"
-     top_pad="2"
+     top="108"
      layout="topleft"
-     left="5"
+     left="143"
      name="link_btn"
      width="50">
 	  <button.commit_callback
@@ -274,7 +262,7 @@
     </button>
     <button
      follows="left|top"
-     height="23"
+     height="20"
      label="Unlink"
      layout="topleft"
      left_pad="2"
@@ -302,7 +290,7 @@
      layout="topleft"
      left="143"
      name="checkbox uniform"
-     top="50"
+     top="48"
      width="20" />
     <text
      height="19"
@@ -324,53 +312,29 @@
      layout="topleft"
      left="143"
      name="checkbox stretch textures"
-     top_pad="-6"
+     top_pad="-4"
      follows="left|top"
      width="134" />
    <check_box
      control_name="SnapEnabled"
      height="18"
      initial_value="true"
-     label="Snap to grid"
+     label="Snap"
      layout="topleft"
      top_pad="0"
      name="checkbox snap to grid"
      width="134" />
-    <combo_box
-     height="23"
-     layout="topleft"
-     follows="left|top"
-     name="combobox grid mode"
-     tool_tip="Choose the type of grid ruler for positioning the object"
-     top_pad="0"
-     width="108">
-        <combo_box.item
-         label="World grid"
-         name="World"
-         value="World" />
-        <combo_box.item
-         label="Local grid"
-         name="Local"
-         value="Local" />
-        <combo_box.item
-         label="Reference grid"
-         name="Reference"
-         value="Reference" />
-		 <combo_box.commit_callback
-	     function="BuildTool.gridMode"/>
-    </combo_box>
     <button
      left_pad="0"
-     image_selected="ForwardArrow_Press"
-     image_unselected="ForwardArrow_Off"
+     label="Options..."
      layout="topleft"
      follows="top|left"
      name="Options..."
      tool_tip="See more grid options"
-     top_pad="-22"
-     right="-10"
-     width="18"
-     height="23" >
+     top="83"
+     right="-35"
+     width="65"
+     height="21" >
 	 <button.commit_callback
 	     function="BuildTool.gridOptions"/>
 	</button>
@@ -385,7 +349,7 @@
      left="10"
      name="ToolCube"
      tool_tip="Cube"
-     top="51"
+     top="58"
      width="20" />
     <button
      follows="left|top"
@@ -447,10 +411,10 @@
      image_selected="Object_Hemi_Cylinder_Selected"
      image_unselected="Object_Hemi_Cylinder"
      layout="topleft"
-     left_delta="29"
+     left="10"
      name="ToolHemiCylinder"
      tool_tip="Hemicylinder"
-     top_delta="0"
+     top="84"
      width="20" />
     <button
      follows="left|top"
@@ -515,7 +479,7 @@
      left="10"
      name="ToolTorus"
      tool_tip="Torus"
-     top="77"
+     top="109"
      width="20" />
     <button
      follows="left|top"
@@ -575,9 +539,9 @@
      height="19"
      label="Keep Tool selected"
      layout="topleft"
-     left="4"
+     left="155"
      name="checkbox sticky"
-     top="101"
+     top="55"
      width="128" />
     <check_box
      control_name="CreateToolCopySelection"
@@ -596,7 +560,7 @@
      layout="topleft"
      left_delta="18"
      name="checkbox copy centers"
-     top="132"
+     top="85"
      width="134" />
     <check_box
      control_name="CreateToolCopyRotates"
@@ -749,89 +713,49 @@
 	  <button.commit_callback
 	     function="BuildTool.applyToSelection"/>
     </button>
+    <text
+	 text_color="LtGray_50"
+	  type="string"
+	  length="1"
+	  height="16"
+	  follows="left|top"
+	  font="SansSerifSmall"
+	  layout="topleft"
+	  left="10"
+	  name="selection_empty"
+	  top_pad="0"
+	  width="100">
+		Nothing selected.
+	</text>
 	<text
 	 text_color="LtGray_50"
 	  type="string"
 	  length="1"
-	  height="10"
+	  height="16"
 	  follows="left|top"
-	  halign="right"
+	  font="SansSerifSmall"
 	  layout="topleft"
-	  right="-10"
-	  name="obj_count"
-	  top_pad="5"
-	  width="143">
-		Objects: [COUNT]
+	  left="10"
+	  name="selection_count"
+	  top_delta="0"
+	  visible="false"
+	  width="280">
 	</text>
 	<text
-    text_color="LtGray_50"
-     type="string"
-     length="1"
-	height="10" 
-     follows="left|top"
-     halign="right"
-     layout="topleft"
-     right="-10"
-     name="prim_count"
-     width="143">
-		Prims: [COUNT]
+	 text_color="LtGray_50"
+	  type="string"
+	  length="1"
+	  height="16"
+	  follows="left|top"
+	  font="SansSerifSmall"
+	  layout="topleft"
+	  left="10"
+	  name="selection_weight"
+	  top_pad="0"
+	  visible="false"
+	  width="280">
+	  Physics weight [PHYS_WEIGHT], Display weight [DISP_WEIGHT].
 	</text>
-    <text
-    text_color="LtGray_50"
-     type="string"
-     length="1"
-     height="10"
-     follows="left|top"
-     halign="right"
-     layout="topleft"
-     right="-120"
-     name="linked_set_count"
-     top="144"
-     width="80">
-        Linked Sets: [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]" 
-     width="80">
-        Cost: [COST] / [PHYSICS]
-    </text>
-    <text
-    text_color="LtGray_50"
-     type="string"
-     length="1"
-     follows="left|top"
-     halign="right"
-     layout="topleft"
-     top_pad="5"
-     right="-120"
-     name="object_count"
-     width="80">
-        Objects: [COUNT]
-    </text>
-    <text
-    text_color="LtGray_50"
-     type="string"
-     length="1"
-     follows="left|top"
-     halign="right"
-     layout="topleft"
-	 top_delta="0"
-     right="-8"
-     name="object_cost"
-     tool_tip="Cost of currently selected objects as [prims] / [physics complexity]"
-     width="80">
-        Cost: [COST] / [PHYSICS]
-    </text>
     <!-- <text -->
     <!-- text_color="LtGray_50" -->
     <!--  type="string" -->
@@ -858,6 +782,15 @@
     <!--  width="143"> -->
     <!--     Prims: [COUNT] -->
     <!-- </text> -->
+    <view_border
+    bevel_style="none"
+    follows="top|left"
+    height="0"
+    layout="topleft"
+    left="6"
+    name="cost_text_border"
+    top="135"
+    width="282"/>
     <tab_container
      follows="left|top"
      height="410"
-- 
cgit v1.2.3


From 969a6f9be2eadcdc93fec3ace3be06a8cdbc509d Mon Sep 17 00:00:00 2001
From: Don Kjer <don@lindenlab.com>
Date: Tue, 21 Jun 2011 15:02:34 -0700
Subject: Fix for memory leak & extra inventory observers in
 start_new_inventory_observer.  Reviewed by Richard

---
 indra/newview/llviewermessage.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 7ab335314a..b840991bbc 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -936,7 +936,6 @@ protected:
 
 //one global instance to bind them
 LLOpenTaskOffer* gNewInventoryObserver=NULL;
-
 class LLNewInventoryHintObserver : public LLInventoryAddedObserver
 {
 protected:
@@ -946,6 +945,8 @@ protected:
 	}
 };
 
+LLNewInventoryHintObserver* gNewInventoryHintObserver=NULL;
+
 void start_new_inventory_observer()
 {
 	if (!gNewInventoryObserver) //task offer observer 
@@ -962,7 +963,12 @@ void start_new_inventory_observer()
 		gInventory.addObserver(gInventoryMoveObserver);
 	}
 
-	gInventory.addObserver(new LLNewInventoryHintObserver());
+	if (!gNewInventoryHintObserver)
+	{
+		// Observer is deleted by gInventory
+		gNewInventoryHintObserver = new LLNewInventoryHintObserver();
+		gInventory.addObserver(gNewInventoryHintObserver);
+	}
 }
 
 class LLDiscardAgentOffer : public LLInventoryFetchItemsObserver
-- 
cgit v1.2.3


From d625706d84cbb69d99497d3ee328105907867181 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Wed, 22 Jun 2011 19:31:03 +0300
Subject: SH-1725 WIP Floater upload model wizard update: - XUI changed
 according to latest mockups - Added switching to advanced upload floater -
 Added "Recalculate geometry" and "Recalculate physics" buttons

---
 indra/newview/llfloatermodelpreview.cpp            |   7 +
 indra/newview/llfloatermodelpreview.h              |   1 +
 indra/newview/llfloatermodelwizard.cpp             | 146 ++--
 indra/newview/llfloatermodelwizard.h               |  12 +-
 .../skins/default/xui/en/floater_model_wizard.xml  | 771 ++++++++-------------
 5 files changed, 390 insertions(+), 547 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 9721fc9224..06a1225905 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -544,6 +544,13 @@ void LLFloaterModelPreview::loadModel(S32 lod)
 	(new LLMeshFilePicker(mModelPreview, lod))->getFile();
 }
 
+void LLFloaterModelPreview::loadModel(S32 lod, const std::string& file_name)
+{
+	mModelPreview->mLoading = true;
+
+	mModelPreview->loadModel(file_name, lod);
+}
+
 //static
 void LLFloaterModelPreview::onImportScaleCommit(LLUICtrl*,void* userdata)
 {
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index ccd6fef953..d78135779e 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -185,6 +185,7 @@ public:
 	void updateResourceCost();
 	
 	void			loadModel(S32 lod);
+	void 			loadModel(S32 lod, const std::string& file_name);
 	
 	void onViewOptionChecked(const LLSD& userdata);
 	bool isViewOptionChecked(const LLSD& userdata);
diff --git a/indra/newview/llfloatermodelwizard.cpp b/indra/newview/llfloatermodelwizard.cpp
index 707c8288df..61b8032625 100644
--- a/indra/newview/llfloatermodelwizard.cpp
+++ b/indra/newview/llfloatermodelwizard.cpp
@@ -46,12 +46,18 @@ static	const std::string stateNames[]={
 	"choose_file",
 	"optimize",
 	"physics",
-	"physics2",
 	"review",
 	"upload"};
 
+static void swap_controls(LLUICtrl* first_ctrl, LLUICtrl* second_ctrl, bool first_ctr_visible);
+
 LLFloaterModelWizard::LLFloaterModelWizard(const LLSD& key)
 	: LLFloater(key)
+	 ,mRecalculateGeometryBtn(NULL)
+	 ,mRecalculatePhysicsBtn(NULL)
+	 ,mRecalculatingPhysicsBtn(NULL)
+	 ,mCalculateWeightsBtn(NULL)
+	 ,mCalculatingWeightsBtn(NULL)
 {
 	mLastEnabledState = CHOOSE_FILE;
 	sInstance = this;
@@ -59,7 +65,6 @@ LLFloaterModelWizard::LLFloaterModelWizard(const LLSD& key)
 	mCommitCallbackRegistrar.add("Wizard.Choose", boost::bind(&LLFloaterModelWizard::setState, this, CHOOSE_FILE));
 	mCommitCallbackRegistrar.add("Wizard.Optimize", boost::bind(&LLFloaterModelWizard::setState, this, OPTIMIZE));
 	mCommitCallbackRegistrar.add("Wizard.Physics", boost::bind(&LLFloaterModelWizard::setState, this, PHYSICS));
-	mCommitCallbackRegistrar.add("Wizard.Physics2", boost::bind(&LLFloaterModelWizard::setState, this, PHYSICS2));
 	mCommitCallbackRegistrar.add("Wizard.Review", boost::bind(&LLFloaterModelWizard::setState, this, REVIEW));
 	mCommitCallbackRegistrar.add("Wizard.Upload", boost::bind(&LLFloaterModelWizard::setState, this, UPLOAD));
 }
@@ -91,6 +96,8 @@ void LLFloaterModelWizard::setState(int state)
 		getChildView("next")->setVisible(true);
 		getChildView("upload")->setVisible(false);
 		getChildView("cancel")->setVisible(true);
+		mCalculateWeightsBtn->setVisible(false);
+		mCalculatingWeightsBtn->setVisible(false);
 	}
 
 	if (state == OPTIMIZE)
@@ -108,6 +115,8 @@ void LLFloaterModelWizard::setState(int state)
 		getChildView("next")->setVisible(true);
 		getChildView("upload")->setVisible(false);
 		getChildView("cancel")->setVisible(true);
+		mCalculateWeightsBtn->setVisible(false);
+		mCalculatingWeightsBtn->setVisible(false);
 	}
 
 	if (state == PHYSICS)
@@ -119,30 +128,14 @@ void LLFloaterModelWizard::setState(int state)
 
 		mModelPreview->mViewOption["show_physics"] = true;
 
-		getChildView("next")->setVisible(true);
-		getChildView("upload")->setVisible(false);
-		getChildView("close")->setVisible(false);
-		getChildView("back")->setVisible(true);
-		getChildView("back")->setEnabled(true);
-		getChildView("cancel")->setVisible(true);
-	}
-
-	if (state == PHYSICS2)
-	{
-		if (mLastEnabledState < state)
-		{
-			executePhysicsStage("Decompose");
-		}
-
-		mModelPreview->mViewOption["show_physics"] = true;
-
-		getChildView("next")->setVisible(true);
-		getChildView("next")->setEnabled(true);
+		getChildView("next")->setVisible(false);
 		getChildView("upload")->setVisible(false);
 		getChildView("close")->setVisible(false);
 		getChildView("back")->setVisible(true);
 		getChildView("back")->setEnabled(true);
 		getChildView("cancel")->setVisible(true);
+		mCalculateWeightsBtn->setVisible(true);
+		mCalculatingWeightsBtn->setVisible(false);
 	}
 
 	if (state == REVIEW)
@@ -156,6 +149,8 @@ void LLFloaterModelWizard::setState(int state)
 		getChildView("back")->setEnabled(true);
 		getChildView("upload")->setVisible(true);
 		getChildView("cancel")->setVisible(true);
+		mCalculateWeightsBtn->setVisible(false);
+		mCalculatingWeightsBtn->setVisible(false);
 	}
 
 	if (state == UPLOAD)
@@ -165,6 +160,8 @@ void LLFloaterModelWizard::setState(int state)
 		getChildView("back")->setVisible(false);
 		getChildView("upload")->setVisible(false);
 		getChildView("cancel")->setVisible(false);
+		mCalculateWeightsBtn->setVisible(false);
+		mCalculatingWeightsBtn->setVisible(false);
 	}
 
 	updateButtons();
@@ -198,18 +195,48 @@ void LLFloaterModelWizard::updateButtons()
 			button->setEnabled(FALSE);
 		}
 	}
+}
 
-	LLButton *physics_button = getChild<LLButton>(stateNames[PHYSICS]+"_btn");
-	
-	if (mState == PHYSICS2)
+void LLFloaterModelWizard::onClickSwitchToAdvanced()
+{
+	LLFloaterModelPreview* floater_preview = LLFloaterReg::getTypedInstance<LLFloaterModelPreview>("upload_model");
+	if (!floater_preview)
 	{
-		physics_button->setVisible(false);
+		llwarns << "FLoater model preview not found." << llendl;
+		return;
 	}
-	else
+
+	// Open floater model preview
+	floater_preview->openFloater();
+
+	// Close the wizard
+	closeFloater();
+
+	std::string filename = getChild<LLUICtrl>("lod_file")->getValue().asString();
+	if (!filename.empty())
 	{
-		physics_button->setVisible(true);
+		// Re-load the model to the floater model preview if it has been loaded
+		// into the wizard.
+		floater_preview->loadModel(3, filename);
 	}
+}
+
+void LLFloaterModelWizard::onClickRecalculateGeometry()
+{
+	S32 val = getChild<LLUICtrl>("accuracy_slider")->getValue().asInteger();
+
+	mModelPreview->genLODs(-1, NUM_LOD - val);
 
+	mModelPreview->refresh();
+}
+
+void LLFloaterModelWizard::onClickRecalculatePhysics()
+{
+	// Hide the "Recalculate physics" button and show the "Recalculating..."
+	// button instead.
+	swap_controls(mRecalculatePhysicsBtn, mRecalculatingPhysicsBtn, false);
+
+	executePhysicsStage("Decompose");
 }
 
 void LLFloaterModelWizard::loadModel()
@@ -471,6 +498,11 @@ void LLFloaterModelWizard::DecompRequest::completed()
 	{
 		executePhysicsStage("Simplify");
 	}
+	else
+	{
+		// Decomp request is complete so we can enable the "Recalculate physics" button again.
+		swap_controls(sInstance->mRecalculatePhysicsBtn, sInstance->mRecalculatingPhysicsBtn, true);
+	}
 }
 
 
@@ -488,10 +520,22 @@ BOOL LLFloaterModelWizard::postBuild()
 	getChild<LLUICtrl>("next")->setCommitCallback(boost::bind(&LLFloaterModelWizard::onClickNext, this));
 	getChild<LLUICtrl>("preview_lod_combo")->setCommitCallback(boost::bind(&LLFloaterModelWizard::onPreviewLODCommit, this, _1));
 	getChild<LLUICtrl>("preview_lod_combo2")->setCommitCallback(boost::bind(&LLFloaterModelWizard::onPreviewLODCommit, this, _1));
-	getChild<LLUICtrl>("preview_lod_combo3")->setCommitCallback(boost::bind(&LLFloaterModelWizard::onPreviewLODCommit, this, _1));
-	getChild<LLUICtrl>("accuracy_slider")->setCommitCallback(boost::bind(&LLFloaterModelWizard::onAccuracyPerformance, this, _2));
 	getChild<LLUICtrl>("upload")->setCommitCallback(boost::bind(&LLFloaterModelWizard::onUpload, this));
-	getChild<LLUICtrl>("physics_slider")->setCommitCallback(boost::bind(&LLFloaterModelWizard::onPhysicsChanged, this));
+	getChild<LLUICtrl>("switch_to_advanced")->setCommitCallback(boost::bind(&LLFloaterModelWizard::onClickSwitchToAdvanced, this));
+
+	mRecalculateGeometryBtn = getChild<LLButton>("recalculate_geometry_btn");
+	mRecalculateGeometryBtn->setCommitCallback(boost::bind(&LLFloaterModelWizard::onClickRecalculateGeometry, this));
+
+	mRecalculatePhysicsBtn = getChild<LLButton>("recalculate_physics_btn");
+	mRecalculatePhysicsBtn->setCommitCallback(boost::bind(&LLFloaterModelWizard::onClickRecalculatePhysics, this));
+
+	mRecalculatingPhysicsBtn = getChild<LLButton>("recalculating_physics_btn");
+
+	mCalculateWeightsBtn = getChild<LLButton>("calculate");
+	// *TODO: Change the callback to upload fee request.
+	mCalculateWeightsBtn->setCommitCallback(boost::bind(&LLFloaterModelWizard::onClickNext, this));
+
+	mCalculatingWeightsBtn = getChild<LLButton>("calculating");
 
 	LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
 	
@@ -532,22 +576,19 @@ void LLFloaterModelWizard::setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F
 			panel->childSetText("dimension_x", llformat("%.1f", x));
 			panel->childSetText("dimension_y", llformat("%.1f", y));
 			panel->childSetText("dimension_z", llformat("%.1f", z));
-			panel->childSetTextArg("streaming cost", "[COST]", llformat("%.3f", streaming_cost));
-			panel->childSetTextArg("physics cost", "[COST]", llformat("%.3f", physics_cost));	
 		}
 	}
+
+	childSetTextArg("review_prim_equiv", "[EQUIV]", llformat("%d", mModelPreview->mResourceCost));
+
+	// *TODO: Get the actual upload fee.
+	childSetTextArg("review_fee", "[FEE]", llformat("%d", 0));
+	childSetTextArg("charged_fee", "[FEE]", llformat("%d", 0));
 }
 
 void LLFloaterModelWizard::modelLoadedCallback()
 {
 	mLastEnabledState = CHOOSE_FILE;
-	getChild<LLCheckBoxCtrl>("confirm_checkbox")->set(FALSE);
-	updateButtons();
-}
-
-void LLFloaterModelWizard::onPhysicsChanged()
-{
-	mLastEnabledState = PHYSICS;
 	updateButtons();
 }
 
@@ -562,16 +603,6 @@ void LLFloaterModelWizard::onUpload()
 	
 }
 
-void LLFloaterModelWizard::onAccuracyPerformance(const LLSD& data)
-{
-	int val = (int) data.asInteger();
-
-	mModelPreview->genLODs(-1, NUM_LOD-val);
-
-	mModelPreview->refresh();
-}
-
-
 void LLFloaterModelWizard::onPreviewLODCommit(LLUICtrl* ctrl)
 {
 	if (!mModelPreview)
@@ -601,11 +632,6 @@ void LLFloaterModelWizard::refresh()
 		
 		getChildView("next")->setEnabled(model_loaded);
 	}
-	if (mState == REVIEW)
-	{
-		getChildView("upload")->setEnabled(getChild<LLCheckBoxCtrl>("confirm_checkbox")->getValue().asBoolean());
-	}
-
 }
 
 void LLFloaterModelWizard::draw()
@@ -613,12 +639,11 @@ void LLFloaterModelWizard::draw()
 	refresh();
 
 	LLFloater::draw();
-	LLRect r = getRect();
-	
-	mModelPreview->update();
 
 	if (mModelPreview)
 	{
+		mModelPreview->update();
+
 		gGL.color3f(1.f, 1.f, 1.f);
 		
 		gGL.getTexUnit(0)->bind(mModelPreview);
@@ -652,3 +677,10 @@ void LLFloaterModelWizard::draw()
 		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 	}
 }
+
+// static
+void swap_controls(LLUICtrl* first_ctrl, LLUICtrl* second_ctrl, bool first_ctr_visible)
+{
+	first_ctrl->setVisible(first_ctr_visible);
+	second_ctrl->setVisible(!first_ctr_visible);
+}
diff --git a/indra/newview/llfloatermodelwizard.h b/indra/newview/llfloatermodelwizard.h
index b166d26295..c32977f4b0 100644
--- a/indra/newview/llfloatermodelwizard.h
+++ b/indra/newview/llfloatermodelwizard.h
@@ -66,7 +66,6 @@ public:
 
 	void setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost);
 	void modelLoadedCallback();
-	void onPhysicsChanged();
 	void initDecompControls();
 	
 	LLPhysicsDecomp::decomp_params mDecompParams;
@@ -80,13 +79,15 @@ private:
 		CHOOSE_FILE = 0,
 		OPTIMIZE,
 		PHYSICS,
-		PHYSICS2,
 		REVIEW,
 		UPLOAD
 	};
 
 	void setState(int state);
 	void updateButtons();
+	void onClickSwitchToAdvanced();
+	void onClickRecalculateGeometry();
+	void onClickRecalculatePhysics();
 	void onClickCancel();
 	void onClickBack();
 	void onClickNext();
@@ -94,7 +95,6 @@ private:
 	bool onEnableBack();
 	void loadModel();
 	void onPreviewLODCommit(LLUICtrl*);
-	void onAccuracyPerformance(const LLSD& data);
 	void onUpload();
 
 	LLModelPreview*	mModelPreview;
@@ -106,7 +106,11 @@ private:
 
 	U32			    mLastEnabledState;
 
-
+	LLButton*		mRecalculateGeometryBtn;
+	LLButton*		mRecalculatePhysicsBtn;
+	LLButton*		mRecalculatingPhysicsBtn;
+	LLButton*		mCalculateWeightsBtn;
+	LLButton*		mCalculatingWeightsBtn;
 };
 
 
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 c3f7b70ca7..1d6ded5391 100644
--- a/indra/newview/skins/default/xui/en/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_wizard.xml
@@ -45,24 +45,6 @@
 		<button.commit_callback
 		function="Wizard.Review"/>
 	</button>
-	<button
-	 top="32"
-	 left="210"
-	 height="32"
-	 name="physics2_btn"
-	 label="3. Physics"
-	 tab_stop="false"
-	 enabled="false"
-	 border="false"
-	 image_unselected="BreadCrumbBtn_Middle_Off"
-	 image_selected="BreadCrumbBtn_Middle_Press"
-	 image_hover_unselected="BreadCrumbBtn_Middle_Over"
-	 image_disabled="BreadCrumbBtn_Middle_Disabled"
-	 image_disabled_selected="BreadCrumbBtn_Middle_Disabled"
-	 width="110">
-		<button.commit_callback
-		function="Wizard.Physics2"/>
-	</button>
 	<button
 	 top="32"
 	 left="210"
@@ -140,41 +122,50 @@
 			 height="10"
 			 font="SansSerifBig"
 			 layout="topleft">
-				Upload Model
+				Choose model file
 			</text>
 		</panel>
-		<text
-		 top_pad="14"
-		 width="460"
-		 height="20"
-		 name="description"
-		 font="SansSerifSmall"
-		 layout="topleft"
-		 word_wrap="true"
-		 left_delta="5">
-			This wizard will help you import mesh models to Second Life.  First specify a file containing the model you wish to import.  Second Life supports COLLADA (.dae) files.
-		</text>
 		<panel
-		 top_delta="40"
+		 top="14"
 		 left="15"
-		 height="270"
+		 height="310"
 		 width="505"
 		 name="content"
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
 		 background_opaque="true">
+            <text
+			 height="32"
+			 left="10"
+			 name="advanced_users_text"
+			 text_color="White"
+			 top="15"
+			 width="320"
+			 word_wrap="true">
+				Advanced users: If you are familiar with 3D content creation tools you may wish to use the Advanced Uploader.
+			</text>
+			<button
+			 follows="left|top"
+			 height="20"
+			 label="Switch to Advanced"
+			 layout="topleft"
+			 left_delta="0"
+			 name="switch_to_advanced"
+			 top_pad="5"
+			 width="130">
+			</button>
 			<text
 			 type="string"
 			 length="1"
 			 text_color="White" 
 			 follows="left|top"
-			 top="10"
+			 top_pad="30"
 			 height="10"
 			 layout="topleft"
-			 left_delta="10"
+			 left_delta="0"
 			 name="Cache location"
-			 width="300">
-				Filename:
+			 width="320">
+				Choose model file to upload
 			</text>
 			<line_editor
 			 border_style="line"
@@ -187,7 +178,7 @@
 			 max_length="4096"
 			 name="lod_file"
 			 top_pad="5"
-			 width="220" />
+			 width="230" />
 			<button
 			 follows="left|top"
 			 height="23"
@@ -200,23 +191,27 @@
 			 width="85">
 			</button>
 			<text
-			 top_delta="-15"
-			 width="200"
-			 height="15"
-			 font="SansSerifSmall"
+			 type="string"
+			 length="1"
+			 text_color="White" 
+			 follows="left|top"
+			 top_pad="5"
+			 height="10"
 			 layout="topleft"
-			 text_color="White"
-			 left_pad="19">
-				Model Preview:
+			 left="10"
+			 name="Cache location"
+			 width="320">
+				Second Life supports COLLADA (.dae) files
 			</text>
 			<!-- Placeholder panel for 3D preview render -->
 			<panel
-			 left_delta="0"
-			 top_pad="0"
+			 top="30"
+			 right="-10"
 			 name="preview_panel"
 			 bevel_style="none"
 			 highlight_light_color="0.09 0.09 0.09 1"
 			 border="true"
+			 border_style="line"
 			 height="150"
 			 follows="all"
 			 width="150">
@@ -225,7 +220,7 @@
 			 top_pad="10"
 			 width="130"
 			 height="14"
-			 left="340"
+			 left_delta="0"
 			 text_color="White"
 			 word_wrap="true">
 				Dimensions (meters):
@@ -238,15 +233,7 @@
 			 text_color="White"
 			 name="dimensions"
 			 left_delta="0">
-				X:         Y:         Z: 
-			</text>
-			<text
-			 top_delta="0"
-			 width="160"
-			 height="15"
-			 name="dimension_dividers"
-			 left_delta="41">
-				 |               |   
+				X         Y         Z 
 			</text>
 			<text
 			 top_delta="0"
@@ -266,23 +253,26 @@
 			 height="15"
 			 name="dimension_z"
 			 left="450"/>
-			<text
-			 top="100"
-			 width="320"
-			 height="15"
-			 left="10"
-			 text_color="White" 
-			 word_wrap="true">
-				Note:
-			</text>
-			<text
-			 top_pad="0"
-			 width="320"
-			 height="40"
-			 left="10"
-			 word_wrap="true">
-Advanced users familiar with 3d content creation tools may prefer to use the [secondlife:///app/openfloater/upload_model Advanced Mesh Import Window] .
-			</text>
+            <text
+             height="16"
+             left="10"
+             name="warning_label"
+             text_color="Yellow"
+             top="200"
+             visible="false"
+             width="320">
+                WARNING:
+            </text>
+            <text
+             height="40"
+             left="10"
+             name="warning_text"
+             top_pad="0"
+             visible="false"
+             width="320"
+             word_wrap="true">
+                You will not be able to complete the final step of uploading this model to the Second Life servers. [secondlife:///app/floater/learn_more Find out how] to set up y
+            </text>
 		</panel>
 	</panel>
 
@@ -291,7 +281,7 @@ Advanced users familiar with 3d content creation tools may prefer to use the [se
 		 height="388"
 		 top_delta="0"
 		 name="optimize_panel"
-		 visible="false"
+		 visible="true"
 		 width="535"
 		 left="0">
 		<panel
@@ -312,7 +302,7 @@ Advanced users familiar with 3d content creation tools may prefer to use the [se
 			 height="10"
 			 font="SansSerifBig"
 			 layout="topleft">
-				Optimize
+				Optimize model
 			</text>
 		</panel>
 		<text
@@ -324,7 +314,7 @@ Advanced users familiar with 3d content creation tools may prefer to use the [se
 		 name="description"
 		 word_wrap="true"
 		 left_delta="5">
-			This wizard has optimized your model to improve performance. You may adjust the results of the optimization process bellow or click Next to continue.
+			We have optimized the model for performance. Adjust it further if you wish.
 		</text>
 		<panel
 		 top_delta="40"
@@ -411,116 +401,89 @@ Advanced users familiar with 3d content creation tools may prefer to use the [se
 				 bg_opaque_color="DkGray2"
 				 background_visible="true"
 				 background_opaque="true">
-			<text top="10" left="10" width="85" text_color="White" follows="left|top" height="15" name="lod_label">
-				Model Preview:
-			</text>
-			<combo_box left_pad="5" top_delta="-5"  follows="left|top" list_position="below" height="22"
-	     name="preview_lod_combo2" width="90" 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>
-			<panel
-				 left="10"
-				 top_pad="5"
-				 name="preview_panel"
-				 bevel_style="none"
-				 highlight_light_color="0.09 0.09 0.09 1"
-				 border_style="line"
-				 border="true"
-				 height="185"
-				 follows="all"
-				 width="185">
-			</panel>
-			<text top="45" left="214" text_color="White" font="SansSerifSmallBold" halign="center" width="110" height="30" wrap="true">Higher Performance</text>
-			<text top="75" left="204" halign="center" width="130" word_wrap="true"   font="SansSerifSmall" height="80">Faster rendering but less detailed; lowers Resource (prim) cost.</text>
-			<text top="45" left="378" text_color="White" font="SansSerifSmallBold" halign="center" width="90" height="30" wrap="true">Higher Accuracy</text>
-			<text top="75" left="364" halign="center" width="130" word_wrap="true"   font="SansSerifSmall" height="80">More detailed model but slower; increases Resource (prim) cost.</text>
+			<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 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>
 
-			<slider
+          <slider
 		   follows="left|top"
 		   height="20"
 		   increment="1"
 		   layout="topleft"
-		   left="204"
-		   max_val="3"
-		   initial_value="2"
+		   left="10"
+		   max_val="2"
+		   initial_value="1"
 		   min_val="0"
 		   name="accuracy_slider"
 		   show_text="false"
 		   top="130"
 		   width="290" />
-			<text 
+          <text 
 			font="SansSerifSmall" 
 			top_pad="0"  
-			width="300" 
+			width="5" 
 			left_delta="6" 
 			height="4">'  
-      </text>
-
-
-			<icon
-				 top_pad="14"
-				 left_delta="0"
-				 width="280"
-				 height="2"
-				 image_name="model_wizard\divider_line.png"/>
-	
-			<text top_delta="20" width="200" text_color="White" left_delta="50" name="streaming cost"  height="20">Resource Cost:    [COST]</text>
-			<text
-						 top_pad="15"
-						 width="130"
-						 height="14"
-						 left="10"
-						 text_color="White"
-						 word_wrap="true">
-				Dimensions (meters):
-			</text>
-			<text
-			 top_pad="0"
-			 width="160"
-			 height="15"
-			 font="SansSerifSmallBold"
-			 text_color="White"
-			 name="dimensions"
-			 left_delta="0">
-				X:         Y:         Z:
-			</text>
-			<text
-			 top_delta="0"
-			 width="160"
-			 height="15"
-			 name="dimension_dividers"
-			 left_delta="41">
-				|               |
+          </text>
+          <text 
+			font="SansSerifSmall" 
+			top_delta="0"  
+			width="5" 
+			left_delta="137" 
+			height="4">'  
+          </text>
+          <text 
+			font="SansSerifSmall" 
+			top_delta="0"  
+			width="5" 
+			left_delta="137" 
+			height="4">'  
+          </text>
+          <button
+			follows="left|top"
+			height="20"
+			label="Recalculate Geometry"
+			layout="topleft"
+			left="80"
+			name="recalculate_geometry_btn"
+			top_pad="15"
+            width="150">
+          </button>
+			<text top="10" right="-10" width="185" text_color="White" follows="left|top" height="15" name="lod_label">
+				Geometry preview
 			</text>
-			<text
-			 top_delta="0"
-			 width="160"
-			 height="15"
-			 name="dimension_x"
-			 left_delta="-25"/>
-			<text
-			 top_delta="0"
-			 width="160"
-			 height="15"
-			 name="dimension_y"
-			 left_delta="46"/>
-			<text
-			 top_delta="0"
-			 width="160"
-			 height="15"
-			 name="dimension_z"
-			 left_delta="46"/>
+			<panel
+				 right="-10"
+				 top="32"
+				 name="preview_panel"
+				 bevel_style="none"
+				 highlight_light_color="0.09 0.09 0.09 1"
+				 border_style="line"
+				 border="true"
+				 height="185"
+				 follows="all"
+				 width="185">
+			</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="high">
+					High detail
+				</combo_item>
+				<combo_item name="medium">
+					Medium detail
+				</combo_item>
+				<combo_item name="low">
+					Low detail
+				</combo_item>
+				<combo_item name="lowest">
+					Lowest detail
+				</combo_item>
+			</combo_box>
 		</panel>
 	</panel>
 
@@ -549,7 +512,7 @@ Advanced users familiar with 3d content creation tools may prefer to use the [se
 			 font="SansSerifBig"
 			 text_color="White" 
 			 layout="topleft">
-				Physics
+				Adjust physics
 			</text>
 		</panel>
 		<text
@@ -561,7 +524,7 @@ Advanced users familiar with 3d content creation tools may prefer to use the [se
 		 name="description"
 		 word_wrap="true"
 		 left_delta="5">
-			The wizard will create a physical shape, which determines how the object interacts with other objects and avatars. Set the slider to the detail level most appropriate for how your object will be used:
+			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.
 		</text>
     <panel
 		 top_delta="44"
@@ -572,172 +535,94 @@ Advanced users familiar with 3d content creation tools may prefer to use the [se
 		 bg_opaque_color="DkGray2"
 		 background_visible="true"
 		 background_opaque="true">
-      <text top="15" left="20" text_color="White" font="SansSerifSmallBold" width="110" height="30" wrap="true" halign="center">Higher Performance</text>
-      <text top="45" left="10" halign="center" width="130" word_wrap="true"   font="SansSerifSmall" height="80">Faster rendering but less detailed; lowers Resource (prim) cost.</text>
-      <text top="15" left="372" text_color="White" font="SansSerifSmallBold" width="90" height="30" wrap="true" halign="center">Higher Accuracy</text>
-      <text top="45" left="360" halign="center" width="130" word_wrap="true"   font="SansSerifSmall" height="80">More detailed model but slower; increases Resource (prim) cost.</text>
+      <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 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>
 
       <slider
 		   follows="left|top"
-		   height="22"
+		   height="190"
 		   increment=".1"
 		   layout="topleft"
-		   left="20"
+		   left="140"
 		   max_val="1"
 		   initial_value="0.5"
 		   min_val="0"
 		   name="physics_slider"
+		   orientation="vertical"
 		   show_text="false"
-		   top="90"
-		   width="440" />
-      <text
-			font="SansSerifSmall"
-			top_pad="0"
-			width="500"
-			left_delta="6"
-			height="4">'             '             '             '             '              '             '             '             '              '             '</text>
-      <text top_pad="10" width="110" halign="center" word_wrap="true" left="25"  height="40">Recommended for solid objects</text>
-      <text top_delta="0" width="110" halign="center" word_wrap="true" left="190"  height="40">Recommended for buildings</text>
-      <text top_delta="0" width="110" halign="center" word_wrap="true" left="350"  height="40">Recommended for vehicles</text>
-
-
-		<icon
-			 top_pad="5"
-			 left="15"
-			 width="470"
-			 height="2"
-			 image_name="model_wizard\divider_line.png"/>
-		
-	<text top_delta="30" width="180" text_color="White" left="160" name="streaming cost"  height="20">Resource Cost:       [COST]</text>
- 
-    </panel>
-	</panel>
-
-	<panel
-		 height="388"
-		 top_delta="0"
-		 name="physics2_panel"
-		 visible="true"
-		 width="535"
-		 left="0">
-		<panel
-		 height="22"
-		 top_pad="15"
-		 name="header_panel"
-		 width="505"
-		 bg_opaque_color="DkGray2"
-		 background_visible="true"
-		 background_opaque="true"
-		 left="15">
-			<text
-			 width="200"
-			 left="10"
-			 name="header_text"
-			 text_color="White"
-			 top="3"
-			 height="10"
-			 font="SansSerifBig"
-			 layout="topleft">
-				Physics
-			</text>
-		</panel>
-		<text
-		 top_pad="14"
-		 width="475"
-		 height="50"
-		 font="SansSerifSmall"
-		 layout="topleft"
-		 name="description"
-		 word_wrap="true"
-		 left_delta="5">
-			Preview the physics shape below then click Next to continue.  To modify the physics shape, click the Back button.
-		</text>
-		<panel
-			 top_delta="40"
-			 left="15"
-			 height="270"
-			 width="505"
-			 name="content"
-			 bg_opaque_color="DkGray2"
-			 background_visible="true"
-			 background_opaque="true">
-			<text top="10" left="10" width="85" text_color="White" follows="left|top" height="15" name="lod_label">
-				Model Preview:
+		   top="25"
+		   width="22" />
+      <text top="10" width="120" word_wrap="true" left_pad="10" height="50">Examples:
+Moving objects
+Flying objects
+Vehicles</text>
+      <text top="95" width="120" word_wrap="true" left_delta="0" height="50">Examples:
+Small static objects
+Less detailed objects
+Simple furniture</text>
+      <text top="180" width="120" word_wrap="true" left_delta="0" height="50">Examples:
+Static objects
+Detailed objects
+Buildings</text>
+          <button
+			follows="left|top"
+			height="20"
+			label="Recalculate physics"
+			layout="topleft"
+			left="80"
+			name="recalculate_physics_btn"
+			top_pad="10"
+            width="150">
+          </button>
+          <button
+            enabled="false"
+			follows="left|top"
+			height="20"
+			label="Recalculating..."
+			layout="topleft"
+			left_delta="0"
+			name="recalculating_physics_btn"
+			top_delta="0"
+			visible="false"
+            width="150">
+          </button>
+			<text top="10" right="-10" width="185" text_color="White" follows="left|top" height="15" name="lod_label">
+				Physics preview
 			</text>
-			<combo_box left_pad="5" top_delta="-5"  follows="left|top" list_position="below" height="22"
-			   name="preview_lod_combo3" width="90" tool_tip="LOD to view in preview render">
+			<panel
+				 right="-10"
+				 top="32"
+				 name="preview_panel"
+				 bevel_style="none"
+				 highlight_light_color="0.09 0.09 0.09 1"
+				 border_style="line"
+				 border="true"
+				 height="185"
+				 follows="all"
+				 width="185">
+			</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="high">
-					High
+					High detail
 				</combo_item>
 				<combo_item name="medium">
-					Medium
+					Medium detail
 				</combo_item>
 				<combo_item name="low">
-					Low
+					Low detail
 				</combo_item>
 				<combo_item name="lowest">
-					Lowest
+					Lowest detail
 				</combo_item>
 			</combo_box>
-			<panel
-					   left="10"
-					   top_pad="10"
-					   name="preview_panel"
-					   bevel_style="none"
-					   highlight_light_color="0.09 0.09 0.09 1"
-					   border_style="line"
-					   border="true"
-					   height="190"
-					   follows="all"
-					   width="190">
-			</panel>
-			<text
-						 top_pad="8"
-						 width="130"
-						 height="14"
-						 left="10"
-						 text_color="White"
-						 word_wrap="true">
-				Dimensions (meters):
-			</text>
-			<text
-			 top_pad="0"
-			 width="160"
-			 height="15"
-			 font="SansSerifSmallBold"
-			 text_color="White"
-			 name="dimensions"
-			 left_delta="0">
-				X:         Y:         Z:
-			</text>
-			<text
-			 top_delta="0"
-			 width="160"
-			 height="15"
-			 name="dimension_dividers"
-			 left_delta="41">
-				|               |
-			</text>
-			<text
-			 top_delta="0"
-			 width="160"
-			 height="15"
-			 name="dimension_x"
-			 left_delta="-25"/>
-			<text
-			 top_delta="0"
-			 width="160"
-			 height="15"
-			 name="dimension_y"
-			 left_delta="46"/>
-			<text
-			 top_delta="0"
-			 width="160"
-			 height="15"
-			 name="dimension_z"
-			 left_delta="46"/>
-			<text top="60" width="180" text_color="White" left="225" name="streaming cost"  height="20">Resource Cost:       [COST]</text>
-		</panel>
+    </panel>
 	</panel>
 
 	<panel
@@ -768,162 +653,44 @@ Advanced users familiar with 3d content creation tools may prefer to use the [se
 				Review
 			</text>
 		</panel>
-		<text
+		<panel
 		 top_pad="14"
-		 width="470"
-		 height="24"
-		 font="SansSerifSmall"
-		 layout="topleft"
-		 name="description"
-		 word_wrap="true"
-		 left_delta="5">
-			Review the details below then click. Upload to upload your model. Your L$ balance will be charged when you click Upload.
-		</text>
-		<icon
-			 top_pad="10"
-			 left="20"
-			 width="495"
-			 height="2"
-			 image_name="model_wizard\divider_line.png"/>
-    <panel
-		 top_pad="5"
 		 left="15"
-		 height="270"
+		 height="310"
 		 width="505"
-		 name="content">
-      <text top="10" left="10" width="85" text_color="White" follows="left|top" height="15" name="lod_label">
-        Model Preview:
-      </text>
-      <combo_box left_pad="5" top_delta="-5"  follows="left|top" list_position="below" height="22"
-	     name="preview_lod_combo" width="90" 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>
-      <panel
-				 left="10"
-				 top_pad="10"
-				 name="preview_panel"
-				 bevel_style="none"
-				 highlight_light_color="0.09 0.09 0.09 1"
-				 border_style="line"
-				 border="true"
-				 height="190"
-				 follows="all"
-				 width="190">
-			</panel>
-		<text
-					 top_pad="8"
-					 width="130"
-					 height="14"
-					 left="10"
-					 text_color="White"
-					 word_wrap="true">
-			Dimensions (meters):
-		</text>
-		<text
-		 top_pad="0"
-		 width="160"
-		 height="15"
-		 font="SansSerifSmallBold"
-		 text_color="White"
-		 name="dimensions"
-		 left_delta="0">
-			X:         Y:         Z:
-		</text>
-		<text
-		 top_delta="0"
-		 width="160"
-		 height="15"
-		 name="dimension_dividers"
-		 left_delta="41">
-			|               |
-		</text>
-		<text
-		 top_delta="0"
-		 width="160"
-		 height="15"
-		 name="dimension_x"
-		 left_delta="-25"/>
-		<text
-		 top_delta="0"
-		 width="160"
-		 height="15"
-		 name="dimension_y"
-		 left_delta="46"/>
-		<text
-		 top_delta="0"
-		 width="160"
-		 height="15"
-		 name="dimension_z"
-		 left_delta="46"/>
+		 name="content"
+		 bg_opaque_color="DkGray2"
+		 background_visible="true"
+		 background_opaque="true">
+			<text
+			 top="20"
+			 width="485"
+			 font="SansSerifMedium"
+			 text_color="White"
+			 left="10"
+			 name="review_prim_equiv"
+			 height="16">Impact to parcel/region: [EQUIV] prim equivalents
+			</text>
+			<text
+			 top_pad="20"
+			 width="485"
+			 font="SansSerifMedium"
+			 text_color="White"
+			 left="10"
+			 name="review_fee"
+			 height="16">Your account will be charged an upload fee of L$ [FEE].
+			</text>
+			<text 
+			 top_pad="20"
+			 width="485"
+			 font="SansSerifMedium"
+			 text_color="White"
+			 left="10"
+			 name="review_confirmation"
+			 height="32"
+			 word_wrap="true">By clicking the upload button, you confirm that you have the appropriate rights to the material contained in the model.
+			</text>
       </panel>
-    <text
-      width="300"
-      height="12"
-      top="125" 
-	  name="streaming cost" 
-      left="230" 
-      font="SansSerifSmallBold" 
-      text_color="White">Resource Cost:         [COST]</text>
-    <text
-      width="285"
-      height="30"
-      top_pad="0"
-      left_delta="0"
-      word_wrap="true"
-      font="SansSerifItalic">This is the cost to your Region's prim/object limit, at default scale</text>
-	<text
-	 width="300"
-	 height="12"
-	 name="physics cost" 
-	 top_pad="10"
-		 left_delta="0"
-	 font="SansSerifSmallBold"
-	 text_color="White">Physics Cost:        [COST]</text>
-	<text
-	  width="285"
-	  height="30"
-	  top_pad="0"
-		  left_delta="0"
-	  word_wrap="true"
-	  font="SansSerifItalic">This is the cost to your Region's prim/object limit, at default scale</text>
-		<text
-		 width="200"
-		 height="12"
-		 top_pad="10"
-		left_delta="0"
-		 font="SansSerifSmallBold"
-		 text_color="White">Upload Fee:</text>
-		<text
-		  width="285"
-		  height="26"
-		  top_pad="0"
-		  left_delta="0"
-		  word_wrap="true"
-		  font="SansSerifItalic">This is the amount the upload will cost.</text>
-		<check_box
-			height="16"
-			layout="topleft"
-			left_delta="0"
-			name="confirm_checkbox"
-			top_pad="15"
-			width="16" />
-		<text
-		  height="100"
-		  width="240"
-		  word_wrap="true" 
-		  left_delta="25"
-		  top_delta="0">I confirm that I have the appropriate rights to the material contained in this model. [secondlife:///app/floater/learn_more Learn more]</text>
 	</panel>
 
 
@@ -954,44 +721,76 @@ Advanced users familiar with 3d content creation tools may prefer to use the [se
 			 height="10"
 			 font="SansSerifBig"
 			 layout="topleft">
-				Upload Complete!
+				Upload complete
 			</text>
 		</panel>
 		<text
 		 top_pad="14"
-		 width="474"
-		 height="20"
-		 font="SansSerifSmall"
+		 width="495"
+		 height="16"
+		 font="SansSerifMedium"
 		 layout="topleft"
-		 name="description"
+		 name="model_uploaded_text"
+		 text_color="White"
 		 word_wrap="true"
-		 left_delta="5">
-			Congratulations! Your model has been sucessfully uploaded.  You will find the model in the Objects folder in your inventory.
+		 left="25">
+			Your model has been uploaded.
+		</text>
+		<text
+		 top_pad="5"
+		 width="495"
+		 height="16"
+		 font="SansSerifMedium"
+		 layout="topleft"
+		 name="inventory_text"
+		 text_color="White"
+		 word_wrap="true"
+		 left="25">
+			You will find it in the Objects folder in your inventory.
+		</text>
+		<text
+		 top_pad="20"
+		 width="495"
+		 font="SansSerifMedium"
+		 text_color="White"
+		 left="25"
+		 name="charged_fee"
+		 height="16">Your account has been charged L$ [FEE].
 		</text>
-		<icon
-			 top_pad="15"
-			 left_delta="0"
-			 width="495"
-			 height="2"
-			 image_name="model_wizard\divider_line.png"/>
 	</panel>
 
 
 
 	<button
 	 top="440"
-	 right="-245"
+	 right="-285"
 	 width="90"
 	 height="22"
 	 name="back"
 	 label="&lt;&lt; Back" />
 	<button
 	 top_delta="0"
-	 right="-150"
+	 right="-190"
 	 width="90"
 	 height="22"
 	 name="next"
 	 label="Next &gt;&gt; " />
+	<button
+	 top_delta="0"
+	 left_delta="0"
+	 width="160"
+	 height="22"
+	 name="calculate"
+	 label="Calculate weights &amp; fee &gt;&gt; " />
+	<button
+	 enabled="false"
+	 visible="false"
+	 top_delta="0"
+	 left_delta="0"
+	 width="160"
+	 height="22"
+	 name="calculating"
+	 label="Calculating... " />
 	<button
 	 top_delta="0"
 	 right="-150"
-- 
cgit v1.2.3


From 4caf151c5ad1e07f819bc8e5ab8eda584f41420b Mon Sep 17 00:00:00 2001
From: prep linden <prep@lindenlab.com>
Date: Wed, 22 Jun 2011 13:36:21 -0400
Subject: WIP for SH-1791

---
 indra/newview/llsurface.cpp      | 11 ++++++
 indra/newview/llsurface.h        |  3 ++
 indra/newview/llviewerobject.cpp | 84 ++++++++++++++++++++++++++++++++++++++--
 indra/newview/llviewerobject.h   | 11 +++++-
 indra/newview/llviewerregion.cpp | 13 +++++++
 indra/newview/llviewerregion.h   |  4 ++
 6 files changed, 121 insertions(+), 5 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp
index bccabe21a8..66df7dae3e 100644
--- a/indra/newview/llsurface.cpp
+++ b/indra/newview/llsurface.cpp
@@ -334,6 +334,17 @@ void LLSurface::setOriginGlobal(const LLVector3d &origin_global)
 	}
 }
 
+void LLSurface::getNeighboringRegions( std::vector<LLViewerRegion*>& uniqueRegions )
+{
+	S32 i;
+	for (i = 0; i < 8; i++)
+	{
+		if ( mNeighbors[i] != NULL )
+		{
+			uniqueRegions.push_back( mNeighbors[i]->getRegion() );
+		}
+	}	
+}
 
 void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction)
 {
diff --git a/indra/newview/llsurface.h b/indra/newview/llsurface.h
index 673ee83fe3..a4ef4fe2de 100644
--- a/indra/newview/llsurface.h
+++ b/indra/newview/llsurface.h
@@ -140,6 +140,9 @@ public:
 
 	friend class LLSurfacePatch;
 	friend std::ostream& operator<<(std::ostream &s, const LLSurface &S);
+	
+	void getNeighboringRegions( std::vector<LLViewerRegion*>& uniqueRegions );
+	
 public:
 	// Number of grid points on one side of a region, including +1 buffer for
 	// north and east edge.
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index be9ff872c0..3185625094 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -104,6 +104,7 @@
 #include "llaccountingquota.h"
 
 //#define DEBUG_UPDATE_TYPE
+//#define EXTENDED_ENCROACHMENT_CHECK //temp:
 
 BOOL		LLViewerObject::sVelocityInterpolate = TRUE;
 BOOL		LLViewerObject::sPingInterpolate = TRUE; 
@@ -519,7 +520,6 @@ void LLViewerObject::setNameValueList(const std::string& name_value_list)
 	}
 }
 
-
 // This method returns true if the object is over land owned by the
 // agent.
 bool LLViewerObject::isReturnable()
@@ -534,11 +534,87 @@ bool LLViewerObject::isReturnable()
 		 iter != mChildList.end(); iter++)
 	{
 		LLViewerObject* child = *iter;
-		boxes.push_back(LLBBox(child->getPositionRegion(), child->getRotationRegion(), child->getScale() * -0.5f, child->getScale() * 0.5f).getAxisAligned());
+		boxes.push_back( LLBBox(child->getPositionRegion(), child->getRotationRegion(), child->getScale() * -0.5f, child->getScale() * 0.5f).getAxisAligned());
+	}
+
+	bool result = (mRegionp && mRegionp->objectIsReturnable(getPositionRegion(), boxes)) ? 1 : 0;
+#ifdef EXTENDED_ENCROACHMENT_CHECK	
+	//Get list of neighboring regions
+	std::vector<LLViewerRegion*> uniqueRegions;
+	//Store this vo's region
+	uniqueRegions.push_back( mRegionp );
+	//Build list of neighboring regions realtive to this vo's region
+	mRegionp->getNeighboringRegions( uniqueRegions );
+	
+	//Build aabb's - for root and all children
+	std::vector<PotentialReturnableObject> returnables;
+	if ( !result )
+	{
+		//Current region 
+		PotentialReturnableObject returnableObj;
+		returnableObj.box = LLBBox( getPositionRegion(), getRotationRegion(), getScale() * -0.5f, getScale() * 0.5f).getAxisAligned() ;
+		returnableObj.pRegion = getRegion();
+		
+		for (child_list_t::iterator iter = mChildList.begin();  iter != mChildList.end(); iter++)
+		{
+			LLViewerObject* pChild = *iter;		
+			buildReturnablesForChildrenVO( returnables, pChild );
+		}
+	}
+	
+	//TBD# Should probably create a region -> box map 
+	typedef std::vector<PotentialReturnableObject>::iterator ReturnablesIt;
+	ReturnablesIt retCurrentIt = returnables.begin();
+	ReturnablesIt retEndIt = returnables.end();
+	
+	for ( ; retCurrentIt !=retEndIt; ++retCurrentIt )
+	{
+		boxes.clear();
+		LLViewerRegion* pRegion = (*retCurrentIt).pRegion;
+		boxes.push_back( (*retCurrentIt).box );	
+		//LLVector3 boxPos = (*retCurrentIt).box.getPositionAgent();
+		//TBD# Should we just use pRegion->objectIsReturnable, instead? 
+		//As it does various other checks, childrenObjectReturnable does not.
+		bool retResult = (mRegionp && pRegion->childrenObjectReturnable( boxes )) ? 1 : 0;
+		if ( retResult )
+		{ 
+			result = true;
+			break;
+		}
+	}
+#endif
+	return result;
+}
+
+void LLViewerObject::buildReturnablesForChildrenVO( std::vector<PotentialReturnableObject>& returnables, LLViewerObject* pChild )
+{
+	if ( !pChild )
+	{
+		llerrs<<"child viewerobject is NULL "<<llendl;
 	}
+	
+	constructAndAddReturnable( returnables, pChild );
+	
+	//We want to handle any children VO's.
+	for (child_list_t::iterator iter = pChild->mChildList.begin();  iter != pChild->mChildList.end(); iter++)
+	{
+		LLViewerObject* pChildofChild = *iter;
+		buildReturnablesForChildrenVO( returnables, pChildofChild );
+	}
+}
 
-	return mRegionp
-		&& mRegionp->objectIsReturnable(getPositionRegion(), boxes);
+void LLViewerObject::constructAndAddReturnable( std::vector<PotentialReturnableObject>& returnables, LLViewerObject* pChild )
+{
+	PotentialReturnableObject returnableObj;
+	LLViewerRegion* pRegion = pChild->getRegion();	
+		
+	LLVector3d posGlobal		= pRegion->getPosGlobalFromRegion( pChild->getPositionRegion() );
+	LLVector3 targetRegionPos	= pRegion->getPosRegionFromGlobal( posGlobal );
+	
+	returnableObj.box = LLBBox( targetRegionPos, pChild->getRotationRegion(), pChild->getScale() * -0.5f, 
+							    pChild->getScale() * 0.5f).getAxisAligned();
+	returnableObj.pRegion		= pRegion;
+	returnables.push_back( returnableObj );
 }
 
 BOOL LLViewerObject::setParent(LLViewerObject* parent)
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index a0ad52df6b..a7d0933dc3 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -44,11 +44,11 @@
 #include "v3math.h"
 #include "llvertexbuffer.h"
 #include "llaccountingquota.h"
+#include "llbbox.h"
 
 class LLAgent;			// TODO: Get rid of this.
 class LLAudioSource;
 class LLAudioSourceVO;
-class LLBBox;
 class LLDataPacker;
 class LLColor4;
 class LLFrameTimer;
@@ -112,6 +112,12 @@ public:
 	LLColor4	mColor;
 };
 
+struct PotentialReturnableObject
+{
+	LLBBox			box;
+	LLViewerRegion* pRegion;
+};
+
 //============================================================================
 
 class LLViewerObject : public LLPrimitive, public LLRefCount, public LLGLUpdate
@@ -234,6 +240,9 @@ public:
 	// anti-encroachment is enabled
 	bool isReturnable();
 
+	void buildReturnablesForChildrenVO( std::vector<PotentialReturnableObject>& returnables, LLViewerObject* pChild );
+	void constructAndAddReturnable( std::vector<PotentialReturnableObject>& returnables, LLViewerObject* pChild );
+
 	/*
 	// 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 002e0567e4..0df97d6050 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1699,6 +1699,19 @@ bool LLViewerRegion::objectIsReturnable(const LLVector3& pos, const std::vector<
 				&& mParcelOverlay->encroachesOwned(boxes)) );
 }
 
+bool LLViewerRegion::childrenObjectReturnable( const std::vector<LLBBox>& boxes ) const
+{
+	bool result = false;
+	//TBD# Do we need similar checks to objectIsReturnable? if so just use objectisreturnable
+	result = ( mParcelOverlay && mParcelOverlay->encroachesOwned( boxes ) ) ? 1 : 0;
+	return result;
+}
+
+void LLViewerRegion::getNeighboringRegions( std::vector<LLViewerRegion*>& uniqueRegions )
+{
+	mImpl->mLandp->getNeighboringRegions( uniqueRegions );
+}
+
 void LLViewerRegion::showReleaseNotes()
 {
 	std::string url = this->getCapability("ServerReleaseNotes");
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index 3811b989e7..68662c99bd 100644
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -318,6 +318,10 @@ public:
 	LLSpatialPartition* getSpatialPartition(U32 type);
 
 	bool objectIsReturnable(const LLVector3& pos, const std::vector<LLBBox>& boxes) const;
+	bool childrenObjectReturnable( const std::vector<LLBBox>& boxes ) const;
+
+	void getNeighboringRegions( std::vector<LLViewerRegion*>& uniqueRegions );
+	
 public:
 	struct CompareDistance
 	{
-- 
cgit v1.2.3


From 13202345d5d4aee652e160a437ec765090f3ec63 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Wed, 22 Jun 2011 15:43:57 -0400
Subject: SH-989 FIX - only reject LOD if vertex total is too high, rather than
 checking mesh-by-mesh.  This should make rejections much less common.

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

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 9721fc9224..1c48795ea7 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -4100,18 +4100,20 @@ void LLModelPreview::updateStatusMessages()
 			}
 			else if (!verts[lod].empty())
 			{
+				S32 sum_verts_higher_lod = 0;
+				S32 sum_verts_this_lod = 0;
 				for (U32 i = 0; i < verts[lod].size(); ++i)
 				{
-					S32 max_verts = i < verts[lod+1].size() ? verts[lod+1][i] : 0;
+					sum_verts_higher_lod += ((i < verts[lod+1].size()) ? verts[lod+1][i] : 0);
+					sum_verts_this_lod += verts[lod][i];
+				}
 
-					if (max_verts > 0)
-					{
-						if (verts[lod][i] > max_verts)
-						{ //too many vertices in this lod
-							message = "mesh_status_too_many_vertices";
-							upload_status[lod] = 2;
-						}
-					}
+				if ((sum_verts_higher_lod > 0) &&
+					(sum_verts_this_lod > sum_verts_higher_lod))
+				{
+					//too many vertices in this lod
+					message = "mesh_status_too_many_vertices";
+					upload_status[lod] = 2;
 				}
 			}
 		}
-- 
cgit v1.2.3


From 0961c3baaa6f5be42d4c3996c0563f905a8df053 Mon Sep 17 00:00:00 2001
From: prep <prep@lindenlab.com>
Date: Wed, 22 Jun 2011 15:54:16 -0400
Subject: WIP SH-1791 - constructAndAddReturnable() now accepts target region

---
 indra/newview/llviewerobject.cpp | 95 ++++++++++++++++++++--------------------
 indra/newview/llviewerobject.h   |  4 +-
 2 files changed, 50 insertions(+), 49 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 3185625094..a3a6ef1888 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -104,7 +104,7 @@
 #include "llaccountingquota.h"
 
 //#define DEBUG_UPDATE_TYPE
-//#define EXTENDED_ENCROACHMENT_CHECK //temp:
+#define EXTENDED_ENCROACHMENT_CHECK //temp:
 
 BOOL		LLViewerObject::sVelocityInterpolate = TRUE;
 BOOL		LLViewerObject::sPingInterpolate = TRUE; 
@@ -538,82 +538,83 @@ bool LLViewerObject::isReturnable()
 	}
 
 	bool result = (mRegionp && mRegionp->objectIsReturnable(getPositionRegion(), boxes)) ? 1 : 0;
+
 #ifdef EXTENDED_ENCROACHMENT_CHECK	
-	//Get list of neighboring regions
-	std::vector<LLViewerRegion*> uniqueRegions;
-	//Store this vo's region
-	uniqueRegions.push_back( mRegionp );
-	//Build list of neighboring regions realtive to this vo's region
-	mRegionp->getNeighboringRegions( uniqueRegions );
 	
-	//Build aabb's - for root and all children
-	std::vector<PotentialReturnableObject> returnables;
 	if ( !result )
-	{
-		//Current region 
-		PotentialReturnableObject returnableObj;
-		returnableObj.box = LLBBox( getPositionRegion(), getRotationRegion(), getScale() * -0.5f, getScale() * 0.5f).getAxisAligned() ;
-		returnableObj.pRegion = getRegion();
-		
-		for (child_list_t::iterator iter = mChildList.begin();  iter != mChildList.end(); iter++)
-		{
-			LLViewerObject* pChild = *iter;		
-			buildReturnablesForChildrenVO( returnables, pChild );
-		}
-	}
+	{		
+		std::vector<LLViewerRegion*> uniqueRegions;
+		//Get list of neighboring regions relative to this vo's region
+		mRegionp->getNeighboringRegions( uniqueRegions );
+	
+		//Build aabb's - for root and all children
+		std::vector<PotentialReturnableObject> returnables;
+		typedef std::vector<LLViewerRegion*>::iterator RegionIt;
+		RegionIt regionStart = uniqueRegions.begin();
+		RegionIt regionEnd   = uniqueRegions.end();
+		for (; regionStart != regionEnd; ++regionStart )
+		{
+			LLViewerRegion* pTargetRegion = *regionStart;
+			for (child_list_t::iterator iter = mChildList.begin();  iter != mChildList.end(); iter++)
+			{
+				LLViewerObject* pChild = *iter;		
+				buildReturnablesForChildrenVO( returnables, pChild, pTargetRegion );
+			}
+		}	
 	
-	//TBD# Should probably create a region -> box map 
-	typedef std::vector<PotentialReturnableObject>::iterator ReturnablesIt;
-	ReturnablesIt retCurrentIt = returnables.begin();
-	ReturnablesIt retEndIt = returnables.end();
+		//TBD# Should probably create a region -> box list map 
+		typedef std::vector<PotentialReturnableObject>::iterator ReturnablesIt;
+		ReturnablesIt retCurrentIt = returnables.begin();
+		ReturnablesIt retEndIt = returnables.end();
 	
-	for ( ; retCurrentIt !=retEndIt; ++retCurrentIt )
-	{
-		boxes.clear();
-		LLViewerRegion* pRegion = (*retCurrentIt).pRegion;
-		boxes.push_back( (*retCurrentIt).box );	
-		//LLVector3 boxPos = (*retCurrentIt).box.getPositionAgent();
-		//TBD# Should we just use pRegion->objectIsReturnable, instead? 
-		//As it does various other checks, childrenObjectReturnable does not.
-		bool retResult = (mRegionp && pRegion->childrenObjectReturnable( boxes )) ? 1 : 0;
-		if ( retResult )
-		{ 
-			result = true;
-			break;
+		for ( ; retCurrentIt !=retEndIt; ++retCurrentIt )
+		{
+			boxes.clear();
+			LLViewerRegion* pRegion = (*retCurrentIt).pRegion;
+			boxes.push_back( (*retCurrentIt).box );	
+			//LLVector3 boxPos = (*retCurrentIt).box.getPositionAgent();
+			//TBD# Should we just use pRegion->objectIsReturnable, instead? 
+			//As it does various other checks, childrenObjectReturnable does not.
+			bool retResult = (mRegionp && pRegion->childrenObjectReturnable( boxes )) ? 1 : 0;
+			if ( retResult )
+			{ 
+				result = true;
+				break;
+			}
 		}
 	}
 #endif
 	return result;
 }
 
-void LLViewerObject::buildReturnablesForChildrenVO( std::vector<PotentialReturnableObject>& returnables, LLViewerObject* pChild )
+void LLViewerObject::buildReturnablesForChildrenVO( std::vector<PotentialReturnableObject>& returnables, LLViewerObject* pChild, LLViewerRegion* pTargetRegion )
 {
 	if ( !pChild )
 	{
 		llerrs<<"child viewerobject is NULL "<<llendl;
 	}
 	
-	constructAndAddReturnable( returnables, pChild );
+	constructAndAddReturnable( returnables, pChild, pTargetRegion );
 	
-	//We want to handle any children VO's.
+	//We want to handle any children VO's as well
 	for (child_list_t::iterator iter = pChild->mChildList.begin();  iter != pChild->mChildList.end(); iter++)
 	{
 		LLViewerObject* pChildofChild = *iter;
-		buildReturnablesForChildrenVO( returnables, pChildofChild );
+		buildReturnablesForChildrenVO( returnables, pChildofChild, pTargetRegion );
 	}
 }
 
-void LLViewerObject::constructAndAddReturnable( std::vector<PotentialReturnableObject>& returnables, LLViewerObject* pChild )
+void LLViewerObject::constructAndAddReturnable( std::vector<PotentialReturnableObject>& returnables, LLViewerObject* pChild, LLViewerRegion* pTargetRegion )
 {
 	PotentialReturnableObject returnableObj;
-	LLViewerRegion* pRegion = pChild->getRegion();	
-		
+
+	LLViewerRegion* pRegion		= pChild->getRegion();			
 	LLVector3d posGlobal		= pRegion->getPosGlobalFromRegion( pChild->getPositionRegion() );
-	LLVector3 targetRegionPos	= pRegion->getPosRegionFromGlobal( posGlobal );
+	LLVector3 targetRegionPos	= pTargetRegion->getPosRegionFromGlobal( posGlobal );
 	
 	returnableObj.box = LLBBox( targetRegionPos, pChild->getRotationRegion(), pChild->getScale() * -0.5f, 
 							    pChild->getScale() * 0.5f).getAxisAligned();
-	returnableObj.pRegion		= pRegion;
+	returnableObj.pRegion		= pTargetRegion;
 	returnables.push_back( returnableObj );
 }
 
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index a7d0933dc3..f75a3d996d 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -240,8 +240,8 @@ public:
 	// anti-encroachment is enabled
 	bool isReturnable();
 
-	void buildReturnablesForChildrenVO( std::vector<PotentialReturnableObject>& returnables, LLViewerObject* pChild );
-	void constructAndAddReturnable( std::vector<PotentialReturnableObject>& returnables, LLViewerObject* pChild );
+	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
-- 
cgit v1.2.3


From f8f0fa041087e64abb0b7bc54c14999da9d55ab1 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Wed, 22 Jun 2011 15:02:07 -0600
Subject: fix for STORM-1417: [crashhunters] crash at [0]
 LLTexUnit::setTextureFilteringOption(LLTexUnit::eTextureFilterOptions)
 [secondlife-bin llrender.cpp]

---
 indra/newview/lldrawpoolwlsky.cpp | 28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index 409b18d522..ec74769fa1 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -60,13 +60,24 @@ LLDrawPoolWLSky::LLDrawPoolWLSky(void) :
 		llerrs << "Error: Failed to load cloud noise image " << cloudNoiseFilename << llendl;
 	}
 
-	cloudNoiseFile->load(cloudNoiseFilename);
-
-	sCloudNoiseRawImage = new LLImageRaw();
+	if(cloudNoiseFile->load(cloudNoiseFilename))
+	{
+		sCloudNoiseRawImage = new LLImageRaw();
 
-	cloudNoiseFile->decode(sCloudNoiseRawImage, 0.0f);
+		if(cloudNoiseFile->decode(sCloudNoiseRawImage, 0.0f))
+		{
+			//debug use			
+			llinfos << "cloud noise raw image width: " << sCloudNoiseRawImage->getWidth() << " : height: " << sCloudNoiseRawImage->getHeight() << " : components: " << 
+				(S32)sCloudNoiseRawImage->getComponents() << " : data size: " << sCloudNoiseRawImage->getDataSize() << llendl ;
+			llassert_always(sCloudNoiseRawImage->getData()) ;
 
-	sCloudNoiseTexture = LLViewerTextureManager::getLocalTexture(sCloudNoiseRawImage.get(), TRUE);
+			sCloudNoiseTexture = LLViewerTextureManager::getLocalTexture(sCloudNoiseRawImage.get(), TRUE);
+		}
+		else
+		{
+			sCloudNoiseRawImage = NULL ;
+		}
+	}
 
 	LLWLParamManager::instance()->propagateParameters();
 }
@@ -201,7 +212,7 @@ void LLDrawPoolWLSky::renderStars(void) const
 
 void LLDrawPoolWLSky::renderSkyClouds(F32 camHeightLocal) const
 {
-	if (gPipeline.canUseWindLightShaders() && gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS))
+	if (gPipeline.canUseWindLightShaders() && gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS) && sCloudNoiseTexture.notNull())
 	{
 		LLGLEnable blend(GL_BLEND);
 		gGL.setSceneBlendType(LLRender::BT_ALPHA);
@@ -373,5 +384,8 @@ void LLDrawPoolWLSky::cleanupGL()
 //static
 void LLDrawPoolWLSky::restoreGL()
 {
-	sCloudNoiseTexture = LLViewerTextureManager::getLocalTexture(sCloudNoiseRawImage.get(), TRUE);
+	if(sCloudNoiseRawImage.notNull())
+	{
+		sCloudNoiseTexture = LLViewerTextureManager::getLocalTexture(sCloudNoiseRawImage.get(), TRUE);
+	}
 }
-- 
cgit v1.2.3


From b0fdc4495153523ff417334499ca466b0d8987c8 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 22 Jun 2011 16:08:23 -0500
Subject: SH-1815 Fix for crash when using old version slm

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

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 1c48795ea7..77713b6ebb 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -1970,7 +1970,7 @@ bool LLModelLoader::loadFromSLM(const std::string& filename)
 			}
 			else
 			{
-				llassert(model[lod].empty());
+				return false;
 			}
 		}
 	}	
-- 
cgit v1.2.3


From e7c5913c0541c9c5ebcab93ec5fe4e8b1102eb23 Mon Sep 17 00:00:00 2001
From: prep linden <prep@lindenlab.com>
Date: Fri, 24 Jun 2011 15:21:50 -0400
Subject: Bug fixes for SH-1791

---
 indra/newview/llviewerobject.cpp        | 47 ++++++++++++++++++++-------------
 indra/newview/llviewerparceloverlay.cpp | 27 +++++++++++++++++++
 indra/newview/llviewerparceloverlay.h   |  1 +
 indra/newview/llviewerregion.cpp        |  3 +--
 4 files changed, 58 insertions(+), 20 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index a3a6ef1888..c3a7d345f5 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -104,7 +104,6 @@
 #include "llaccountingquota.h"
 
 //#define DEBUG_UPDATE_TYPE
-#define EXTENDED_ENCROACHMENT_CHECK //temp:
 
 BOOL		LLViewerObject::sVelocityInterpolate = TRUE;
 BOOL		LLViewerObject::sPingInterpolate = TRUE; 
@@ -528,6 +527,7 @@ bool LLViewerObject::isReturnable()
 	{
 		return false;
 	}
+		
 	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();
@@ -538,13 +538,11 @@ bool LLViewerObject::isReturnable()
 	}
 
 	bool result = (mRegionp && mRegionp->objectIsReturnable(getPositionRegion(), boxes)) ? 1 : 0;
-
-#ifdef EXTENDED_ENCROACHMENT_CHECK	
 	
 	if ( !result )
 	{		
-		std::vector<LLViewerRegion*> uniqueRegions;
 		//Get list of neighboring regions relative to this vo's region
+		std::vector<LLViewerRegion*> uniqueRegions;
 		mRegionp->getNeighboringRegions( uniqueRegions );
 	
 		//Build aabb's - for root and all children
@@ -552,9 +550,14 @@ bool LLViewerObject::isReturnable()
 		typedef std::vector<LLViewerRegion*>::iterator RegionIt;
 		RegionIt regionStart = uniqueRegions.begin();
 		RegionIt regionEnd   = uniqueRegions.end();
+		
 		for (; regionStart != regionEnd; ++regionStart )
 		{
 			LLViewerRegion* pTargetRegion = *regionStart;
+			//Add the root vo as there may be no children and we still want
+			//to test for any edge overlap
+			buildReturnablesForChildrenVO( returnables, this, pTargetRegion );
+			//Add it's children
 			for (child_list_t::iterator iter = mChildList.begin();  iter != mChildList.end(); iter++)
 			{
 				LLViewerObject* pChild = *iter;		
@@ -562,7 +565,7 @@ bool LLViewerObject::isReturnable()
 			}
 		}	
 	
-		//TBD# Should probably create a region -> box list map 
+		//TBD#Eventually create a region -> box list map 
 		typedef std::vector<PotentialReturnableObject>::iterator ReturnablesIt;
 		ReturnablesIt retCurrentIt = returnables.begin();
 		ReturnablesIt retEndIt = returnables.end();
@@ -572,10 +575,7 @@ bool LLViewerObject::isReturnable()
 			boxes.clear();
 			LLViewerRegion* pRegion = (*retCurrentIt).pRegion;
 			boxes.push_back( (*retCurrentIt).box );	
-			//LLVector3 boxPos = (*retCurrentIt).box.getPositionAgent();
-			//TBD# Should we just use pRegion->objectIsReturnable, instead? 
-			//As it does various other checks, childrenObjectReturnable does not.
-			bool retResult = (mRegionp && pRegion->childrenObjectReturnable( boxes )) ? 1 : 0;
+			bool retResult = (pRegion && pRegion->childrenObjectReturnable( boxes )) ? 1 : 0;
 			if ( retResult )
 			{ 
 				result = true;
@@ -583,7 +583,6 @@ bool LLViewerObject::isReturnable()
 			}
 		}
 	}
-#endif
 	return result;
 }
 
@@ -606,16 +605,28 @@ void LLViewerObject::buildReturnablesForChildrenVO( std::vector<PotentialReturna
 
 void LLViewerObject::constructAndAddReturnable( std::vector<PotentialReturnableObject>& returnables, LLViewerObject* pChild, LLViewerRegion* pTargetRegion )
 {
-	PotentialReturnableObject returnableObj;
-
-	LLViewerRegion* pRegion		= pChild->getRegion();			
-	LLVector3d posGlobal		= pRegion->getPosGlobalFromRegion( pChild->getPositionRegion() );
-	LLVector3 targetRegionPos	= pTargetRegion->getPosRegionFromGlobal( posGlobal );
 	
-	returnableObj.box = LLBBox( targetRegionPos, pChild->getRotationRegion(), pChild->getScale() * -0.5f, 
+	LLVector3 targetRegionPos;
+	targetRegionPos.setVec( pChild->getPositionGlobal() );	
+	
+	LLBBox childBBox = LLBBox( targetRegionPos, pChild->getRotationRegion(), pChild->getScale() * -0.5f, 
 							    pChild->getScale() * 0.5f).getAxisAligned();
-	returnableObj.pRegion		= pTargetRegion;
-	returnables.push_back( returnableObj );
+	
+	LLVector3 edgeA = targetRegionPos + childBBox.getMinLocal();
+	LLVector3 edgeB = targetRegionPos + childBBox.getMaxLocal();
+	
+	LLVector3d edgeAd, edgeBd;
+	edgeAd.setVec(edgeA);
+	edgeBd.setVec(edgeB);
+	
+	//Only add the box when either of the extents are in a neighboring region
+	if ( pTargetRegion->pointInRegionGlobal( edgeAd ) || pTargetRegion->pointInRegionGlobal( edgeBd ) )
+	{
+		PotentialReturnableObject returnableObj;
+		returnableObj.box		= childBBox;
+		returnableObj.pRegion	= pTargetRegion;
+		returnables.push_back( returnableObj );
+	}
 }
 
 BOOL LLViewerObject::setParent(LLViewerObject* parent)
diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp
index 26765bdd01..eff16b6a6e 100644
--- a/indra/newview/llviewerparceloverlay.cpp
+++ b/indra/newview/llviewerparceloverlay.cpp
@@ -173,6 +173,33 @@ bool LLViewerParcelOverlay::encroachesOwned(const std::vector<LLBBox>& boxes) co
 	}
 	return false;
 }
+bool LLViewerParcelOverlay::encroachesOnUnowned(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();
+		
+		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 top    = S32(llclamp((min.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
+		S32 bottom = S32(llclamp((max.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
+		
+		for (S32 row = top; row <= bottom; row++)
+		{
+			for (S32 column = left; column <= right; column++)
+			{
+				U8 type = ownership(row, column);
+				if ((PARCEL_SELF != type))
+				{
+					return true;
+				}
+			}
+		}
+	}
+	return false;
+}
 
 BOOL LLViewerParcelOverlay::isSoundLocal(const LLVector3& pos) const
 {
diff --git a/indra/newview/llviewerparceloverlay.h b/indra/newview/llviewerparceloverlay.h
index c80baedda6..3c6794e7d0 100644
--- a/indra/newview/llviewerparceloverlay.h
+++ b/indra/newview/llviewerparceloverlay.h
@@ -60,6 +60,7 @@ public:
 	// might be in another parcel. for now, we simply test axis aligned 
 	// 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			isSoundLocal(const LLVector3& pos) const;
 
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 0df97d6050..85b4b60bf7 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1702,8 +1702,7 @@ bool LLViewerRegion::objectIsReturnable(const LLVector3& pos, const std::vector<
 bool LLViewerRegion::childrenObjectReturnable( const std::vector<LLBBox>& boxes ) const
 {
 	bool result = false;
-	//TBD# Do we need similar checks to objectIsReturnable? if so just use objectisreturnable
-	result = ( mParcelOverlay && mParcelOverlay->encroachesOwned( boxes ) ) ? 1 : 0;
+	result = ( mParcelOverlay && mParcelOverlay->encroachesOnUnowned( boxes ) ) ? 1 : 0;
 	return result;
 }
 
-- 
cgit v1.2.3


From f83b08b69c84d6df9cebb79167804cd295555481 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Fri, 24 Jun 2011 15:09:10 -0600
Subject: fix for SH-1878: Viewer hang in GLOD_Group::adaptTriangleBudget
 during LLModelPreview::genLODs; SH-1891: viewer crashes while previewing
 "RYOMA 3D XML File.dae"; SH-1890: Crash loading palm tree

---
 indra/newview/llfloatermodelpreview.cpp | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 77713b6ebb..0006e3423b 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -4500,16 +4500,7 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights)
 
 			bool skinned = include_skin_weights && !mdl->mSkinWeights.empty();
 
-			U32 mask = LLVertexBuffer::MAP_VERTEX;
-			
-			if (vf.mNormals)
-			{
-				mask |= LLVertexBuffer::MAP_NORMAL;
-			}
-			if (vf.mTexCoords)
-			{
-				mask |= LLVertexBuffer::MAP_TEXCOORD0;
-			}
+			U32 mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0 ;
 
 			if (skinned)
 			{
-- 
cgit v1.2.3


From d46d74dbea0cbf4a680cd4611ff99c356fcbc030 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Fri, 24 Jun 2011 17:42:34 -0600
Subject: fix for SH-1904: Medallion .dae makes viewer crash during upload

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

(limited to 'indra/newview')

diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 2b340fc54d..97c64f7761 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -1575,6 +1575,11 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
 
 			for (S32 face_num = 0; face_num < data.mBaseModel->getNumVolumeFaces(); face_num++)
 			{
+				if(face_num >= instance.mMaterial.size())
+				{
+					break ;
+				}
+
 				LLImportMaterial& material = instance.mMaterial[face_num];
 				LLSD face_entry = LLSD::emptyMap();
 				LLViewerFetchedTexture *texture = material.mDiffuseMap.get();
-- 
cgit v1.2.3


From d5c784be4ed949b49aeea427c01ba5867f235ae4 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 27 Jun 2011 10:39:41 -0500
Subject: SH-680 Apply a 128-byte discount per LoD block to cover the cost of
 metadata.

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

(limited to 'indra/newview')

diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 2b340fc54d..04bda46edc 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -3164,10 +3164,13 @@ F32 LLMeshRepository::getStreamingCost(LLSD& header, F32 radius, S32* bytes, S32
 	F32 dlow = llmin(radius/0.06f, 256.f);
 	F32 dmid = llmin(radius/0.24f, 256.f);
 	
-	F32 bytes_lowest = header["lowest_lod"]["size"].asReal()/1024.f;
-	F32 bytes_low = header["low_lod"]["size"].asReal()/1024.f;
-	F32 bytes_mid = header["medium_lod"]["size"].asReal()/1024.f;
-	F32 bytes_high = header["high_lod"]["size"].asReal()/1024.f;
+	F32 METADATA_DISCOUNT = 128.f;  //discount 128 bytes to cover the cost of LLSD tags and compression domain overhead
+	F32 MINIMUM_SIZE = 32.f; //make sure nothing is "free"
+
+	F32 bytes_lowest = llmax((F32) header["lowest_lod"]["size"].asReal()-METADATA_DISCOUNT, MINIMUM_SIZE)/1024.f;
+	F32 bytes_low = llmax((F32) header["low_lod"]["size"].asReal()/-METADATA_DISCOUNT, MINIMUM_SIZE)/1024.f;
+	F32 bytes_mid = llmax((F32) header["medium_lod"]["size"].asReal()-METADATA_DISCOUNT, MINIMUM_SIZE)/1024.f;
+	F32 bytes_high = llmax((F32) header["high_lod"]["size"].asReal()-METADATA_DISCOUNT, MINIMUM_SIZE)/1024.f;
 
 	if (bytes)
 	{
-- 
cgit v1.2.3


From 4df70b55233ecf6bd6ed89a42281ce62d90c672f Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 27 Jun 2011 12:22:28 -0500
Subject: SH-1899 Check mesh asset version before attempting to parse.

---
 indra/newview/llmeshrepository.cpp | 100 ++++++++++++++++++++++---------------
 1 file changed, 60 insertions(+), 40 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 00eba285ec..4da5da9493 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -78,6 +78,14 @@ LLMeshRepository gMeshRepo;
 
 const U32 MAX_MESH_REQUESTS_PER_SECOND = 100;
 
+// Maximum mesh version to support.  Three least significant digits are reserved for the minor version, 
+// with major version changes indicating a format change that is not backwards compatible and should not
+// be parsed by viewers that don't specifically support that version. For example, if the integer "1" is 
+// present, the version is 0.001. A viewer that can parse version 0.001 can also parse versions up to 0.999, 
+// but not 1.0 (integer 1000).
+// See wiki at https://wiki.secondlife.com/wiki/Mesh/Mesh_Asset_Format
+const S32 MAX_MESH_VERSION = 999;
+
 U32 LLMeshRepository::sBytesReceived = 0;
 U32 LLMeshRepository::sHTTPRequestCount = 0;
 U32 LLMeshRepository::sHTTPRetryCount = 0;
@@ -843,12 +851,13 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id)
 
 	if (header_size > 0)
 	{
+		S32 version = mMeshHeader[mesh_id]["version"].asInteger();
 		S32 offset = header_size + mMeshHeader[mesh_id]["skin"]["offset"].asInteger();
 		S32 size = mMeshHeader[mesh_id]["skin"]["size"].asInteger();
 
 		mHeaderMutex->unlock();
 
-		if (offset >= 0 && size > 0)
+		if (version <= MAX_MESH_VERSION && offset >= 0 && size > 0)
 		{
 			//check VFS for mesh skin info
 			LLVFile file(gVFS, mesh_id, LLAssetType::AT_MESH);
@@ -915,12 +924,13 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id)
 
 	if (header_size > 0)
 	{
+		S32 version = mMeshHeader[mesh_id]["version"].asInteger();
 		S32 offset = header_size + mMeshHeader[mesh_id]["physics_convex"]["offset"].asInteger();
 		S32 size = mMeshHeader[mesh_id]["physics_convex"]["size"].asInteger();
 
 		mHeaderMutex->unlock();
 
-		if (offset >= 0 && size > 0)
+		if (version <= MAX_MESH_VERSION && offset >= 0 && size > 0)
 		{
 			//check VFS for mesh skin info
 			LLVFile file(gVFS, mesh_id, LLAssetType::AT_MESH);
@@ -987,12 +997,13 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id)
 
 	if (header_size > 0)
 	{
+		S32 version = mMeshHeader[mesh_id]["version"].asInteger();
 		S32 offset = header_size + mMeshHeader[mesh_id]["physics_mesh"]["offset"].asInteger();
 		S32 size = mMeshHeader[mesh_id]["physics_mesh"]["size"].asInteger();
 
 		mHeaderMutex->unlock();
 
-		if (offset >= 0 && size > 0)
+		if (version <= MAX_MESH_VERSION && offset >= 0 && size > 0)
 		{
 			//check VFS for mesh physics shape info
 			LLVFile file(gVFS, mesh_id, LLAssetType::AT_MESH);
@@ -1103,10 +1114,12 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod)
 
 	if (header_size > 0)
 	{
+		S32 version = mMeshHeader[mesh_id]["version"].asInteger();
 		S32 offset = header_size + mMeshHeader[mesh_id][header_lod[lod]]["offset"].asInteger();
 		S32 size = mMeshHeader[mesh_id][header_lod[lod]]["size"].asInteger();
 		mHeaderMutex->unlock();
-		if (offset >= 0 && size > 0)
+				
+		if (version <= MAX_MESH_VERSION && offset >= 0 && size > 0)
 		{
 
 			//check VFS for mesh asset
@@ -1806,7 +1819,9 @@ S32 LLMeshRepository::getActualMeshLOD(LLSD& header, S32 lod)
 {
 	lod = llclamp(lod, 0, 3);
 
-	if (header.has("404"))
+	S32 version = header["version"];
+
+	if (header.has("404") || version > MAX_MESH_VERSION)
 	{
 		return -1;
 	}
@@ -2142,54 +2157,59 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason,
 		LLUUID mesh_id = mMeshParams.getSculptID();
 		LLSD header = gMeshRepo.mThread->mMeshHeader[mesh_id];
 
-		std::stringstream str;
+		S32 version = header["version"].asInteger();
 
-		S32 lod_bytes = 0;
+		if (version <= MAX_MESH_VERSION)
+		{
+			std::stringstream str;
 
-		for (U32 i = 0; i < LLModel::LOD_PHYSICS; ++i)
-		{ //figure out how many bytes we'll need to reserve in the file
-			std::string lod_name = header_lod[i];
-			lod_bytes = llmax(lod_bytes, header[lod_name]["offset"].asInteger()+header[lod_name]["size"].asInteger());
-		}
+			S32 lod_bytes = 0;
+
+			for (U32 i = 0; i < LLModel::LOD_PHYSICS; ++i)
+			{ //figure out how many bytes we'll need to reserve in the file
+				std::string lod_name = header_lod[i];
+				lod_bytes = llmax(lod_bytes, header[lod_name]["offset"].asInteger()+header[lod_name]["size"].asInteger());
+			}
 		
-		//just in case skin info or decomposition is at the end of the file (which it shouldn't be)
-		lod_bytes = llmax(lod_bytes, header["skin"]["offset"].asInteger() + header["skin"]["size"].asInteger());
-		lod_bytes = llmax(lod_bytes, header["physics_convex"]["offset"].asInteger() + header["physics_convex"]["size"].asInteger());
+			//just in case skin info or decomposition is at the end of the file (which it shouldn't be)
+			lod_bytes = llmax(lod_bytes, header["skin"]["offset"].asInteger() + header["skin"]["size"].asInteger());
+			lod_bytes = llmax(lod_bytes, header["physics_convex"]["offset"].asInteger() + header["physics_convex"]["size"].asInteger());
 
-		S32 header_bytes = (S32) gMeshRepo.mThread->mMeshHeaderSize[mesh_id];
-		S32 bytes = lod_bytes + header_bytes; 
+			S32 header_bytes = (S32) gMeshRepo.mThread->mMeshHeaderSize[mesh_id];
+			S32 bytes = lod_bytes + header_bytes; 
 
 		
-		//it's possible for the remote asset to have more data than is needed for the local cache
-		//only allocate as much space in the VFS as is needed for the local cache
-		data_size = llmin(data_size, bytes);
+			//it's possible for the remote asset to have more data than is needed for the local cache
+			//only allocate as much space in the VFS as is needed for the local cache
+			data_size = llmin(data_size, bytes);
 
-		LLVFile file(gVFS, mesh_id, LLAssetType::AT_MESH, LLVFile::WRITE);
-		if (file.getMaxSize() >= bytes || file.setMaxSize(bytes))
-		{
-			LLMeshRepository::sCacheBytesWritten += data_size;
+			LLVFile file(gVFS, mesh_id, LLAssetType::AT_MESH, LLVFile::WRITE);
+			if (file.getMaxSize() >= bytes || file.setMaxSize(bytes))
+			{
+				LLMeshRepository::sCacheBytesWritten += data_size;
 
-			file.write((const U8*) data, data_size);
+				file.write((const U8*) data, data_size);
 			
-			//zero out the rest of the file 
-			U8 block[4096];
-			memset(block, 0, 4096);
+				//zero out the rest of the file 
+				U8 block[4096];
+				memset(block, 0, 4096);
 
-			while (bytes-file.tell() > 4096)
-			{
-				file.write(block, 4096);
-			}
+				while (bytes-file.tell() > 4096)
+				{
+					file.write(block, 4096);
+				}
 
-			S32 remaining = bytes-file.tell();
+				S32 remaining = bytes-file.tell();
 
-			if (remaining < 0 || remaining > 4096)
-			{
-				llerrs << "Bad padding of mesh asset cache entry." << llendl;
-			}
+				if (remaining < 0 || remaining > 4096)
+				{
+					llerrs << "Bad padding of mesh asset cache entry." << llendl;
+				}
 
-			if (remaining > 0)
-			{
-				file.write(block, remaining);
+				if (remaining > 0)
+				{
+					file.write(block, remaining);
+				}
 			}
 		}
 	}
-- 
cgit v1.2.3


From 57581b682f91a8e7358f36dddcb66f5796fa85be Mon Sep 17 00:00:00 2001
From: prep linden <prep@lindenlab.com>
Date: Tue, 28 Jun 2011 11:10:40 -0400
Subject: Fix for SH-1919 - help button added

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

(limited to 'indra/newview')

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 f58595b3c5..07958b762e 100644
--- 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,8 @@
 <?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">
+     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>
-- 
cgit v1.2.3


From c5a60ba865e593d4028fcf22322c07b6aa7f94ce Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Tue, 28 Jun 2011 18:14:17 +0300
Subject: SH-1725 WIP Fixed model preview panels cursor change.

---
 indra/newview/llfloatermodelpreview.cpp            | 13 ++++-
 indra/newview/llfloatermodelwizard.cpp             | 55 +++++++++++++---------
 indra/newview/llfloatermodelwizard.h               |  6 +++
 .../skins/default/xui/en/floater_model_wizard.xml  |  6 +--
 4 files changed, 54 insertions(+), 26 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 06a1225905..8e0ad54931 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -4765,7 +4765,18 @@ BOOL LLModelPreview::render()
 
 	glClear(GL_DEPTH_BUFFER_BIT);
 
-	LLRect preview_rect = mFMP->getChildView("preview_panel")->getRect();
+	LLRect preview_rect;
+
+	LLFloaterModelWizard* floater_wizard = dynamic_cast<LLFloaterModelWizard*>(mFMP);
+	if (floater_wizard)
+	{
+		preview_rect = floater_wizard->getPreviewRect();
+	}
+	else
+	{
+		preview_rect = mFMP->getChildView("preview_panel")->getRect();
+	}
+
 	F32 aspect = (F32) preview_rect.getWidth()/preview_rect.getHeight();
 
 	LLViewerCamera::getInstance()->setAspect(aspect);
diff --git a/indra/newview/llfloatermodelwizard.cpp b/indra/newview/llfloatermodelwizard.cpp
index 61b8032625..32b8850803 100644
--- a/indra/newview/llfloatermodelwizard.cpp
+++ b/indra/newview/llfloatermodelwizard.cpp
@@ -58,6 +58,9 @@ LLFloaterModelWizard::LLFloaterModelWizard(const LLSD& key)
 	 ,mRecalculatingPhysicsBtn(NULL)
 	 ,mCalculateWeightsBtn(NULL)
 	 ,mCalculatingWeightsBtn(NULL)
+	 ,mChooseFilePreviewPanel(NULL)
+	 ,mOptimizePreviewPanel(NULL)
+	 ,mPhysicsPreviewPanel(NULL)
 {
 	mLastEnabledState = CHOOSE_FILE;
 	sInstance = this;
@@ -86,10 +89,14 @@ void LLFloaterModelWizard::setState(int state)
 		}
 	}
 
+	LLView* current_preview_panel = NULL;
+
 	if (state == CHOOSE_FILE)
 	{
 		mModelPreview->mViewOption["show_physics"] = false;
 
+		current_preview_panel = mChooseFilePreviewPanel;
+
 		getChildView("close")->setVisible(false);
 		getChildView("back")->setVisible(true);
 		getChildView("back")->setEnabled(false);
@@ -109,6 +116,8 @@ void LLFloaterModelWizard::setState(int state)
 
 		mModelPreview->mViewOption["show_physics"] = false;
 
+		current_preview_panel = mOptimizePreviewPanel;
+
 		getChildView("back")->setVisible(true);
 		getChildView("back")->setEnabled(true);
 		getChildView("close")->setVisible(false);
@@ -128,6 +137,8 @@ void LLFloaterModelWizard::setState(int state)
 
 		mModelPreview->mViewOption["show_physics"] = true;
 
+		current_preview_panel = mPhysicsPreviewPanel;
+
 		getChildView("next")->setVisible(false);
 		getChildView("upload")->setVisible(false);
 		getChildView("close")->setVisible(false);
@@ -164,6 +175,20 @@ void LLFloaterModelWizard::setState(int state)
 		mCalculatingWeightsBtn->setVisible(false);
 	}
 
+	if (current_preview_panel)
+	{
+		LLRect rect;
+		current_preview_panel->localRectToOtherView(current_preview_panel->getLocalRect(), &rect, this);
+
+		// Reduce the preview rect by 1 px to fit the borders
+		rect.stretch(-1);
+
+		if (rect != mPreviewRect)
+		{
+			mPreviewRect = rect;
+			mModelPreview->refresh();
+		}
+	}
 	updateButtons();
 }
 
@@ -508,8 +533,6 @@ void LLFloaterModelWizard::DecompRequest::completed()
 
 BOOL LLFloaterModelWizard::postBuild()
 {
-	LLView* preview_panel = getChildView("preview_panel");
-
 	childSetValue("import_scale", (F32) 0.67335826);
 
 	getChild<LLUICtrl>("browse")->setCommitCallback(boost::bind(&LLFloaterModelWizard::loadModel, this));
@@ -537,13 +560,14 @@ BOOL LLFloaterModelWizard::postBuild()
 
 	mCalculatingWeightsBtn = getChild<LLButton>("calculating");
 
+	mChooseFilePreviewPanel = getChild<LLView>("choose_file_preview_panel");
+	mOptimizePreviewPanel = getChild<LLView>("optimize_preview_panel");
+	mPhysicsPreviewPanel = getChild<LLView>("physics_preview_panel");
+
 	LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
 	
 	enable_registrar.add("Next.OnEnable", boost::bind(&LLFloaterModelWizard::onEnableNext, this));
 	enable_registrar.add("Back.OnEnable", boost::bind(&LLFloaterModelWizard::onEnableBack, this));
-
-
-	mPreviewRect = preview_panel->getRect();
 	
 	mModelPreview = new LLModelPreview(512, 512, this);
 	mModelPreview->setPreviewTarget(16.f);
@@ -648,29 +672,16 @@ void LLFloaterModelWizard::draw()
 		
 		gGL.getTexUnit(0)->bind(mModelPreview);
 		
-		LLView *view = getChildView(stateNames[mState]+"_panel");
-		LLView* preview_panel = view->getChildView("preview_panel");
-
-		LLRect rect = preview_panel->getRect();
-		if (rect != mPreviewRect)
-		{
-			mModelPreview->refresh();
-			mPreviewRect = preview_panel->getRect();
-		}
-		
-		LLRect item_rect;
-		preview_panel->localRectToOtherView(preview_panel->getLocalRect(), &item_rect, this);
-	
 		gGL.begin( LLRender::QUADS );
 		{
 			gGL.texCoord2f(0.f, 1.f);
-			gGL.vertex2i(item_rect.mLeft, item_rect.mTop-1);
+			gGL.vertex2i(mPreviewRect.mLeft, mPreviewRect.mTop);
 			gGL.texCoord2f(0.f, 0.f);
-			gGL.vertex2i(item_rect.mLeft, item_rect.mBottom);
+			gGL.vertex2i(mPreviewRect.mLeft, mPreviewRect.mBottom);
 			gGL.texCoord2f(1.f, 0.f);
-			gGL.vertex2i(item_rect.mRight-1, item_rect.mBottom);
+			gGL.vertex2i(mPreviewRect.mRight, mPreviewRect.mBottom);
 			gGL.texCoord2f(1.f, 1.f);
-			gGL.vertex2i(item_rect.mRight-1, item_rect.mTop-1);
+			gGL.vertex2i(mPreviewRect.mRight, mPreviewRect.mTop);
 		}
 		gGL.end();
 		
diff --git a/indra/newview/llfloatermodelwizard.h b/indra/newview/llfloatermodelwizard.h
index c32977f4b0..409451e1b6 100644
--- a/indra/newview/llfloatermodelwizard.h
+++ b/indra/newview/llfloatermodelwizard.h
@@ -68,6 +68,8 @@ public:
 	void modelLoadedCallback();
 	void initDecompControls();
 	
+	const LLRect& getPreviewRect() const { return mPreviewRect; }
+
 	LLPhysicsDecomp::decomp_params mDecompParams;
 	std::set<LLPointer<DecompRequest> > mCurRequest;
 	std::string mStatusMessage;
@@ -111,6 +113,10 @@ private:
 	LLButton*		mRecalculatingPhysicsBtn;
 	LLButton*		mCalculateWeightsBtn;
 	LLButton*		mCalculatingWeightsBtn;
+
+	LLView*		mChooseFilePreviewPanel;
+	LLView*		mOptimizePreviewPanel;
+	LLView*		mPhysicsPreviewPanel;
 };
 
 
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 1d6ded5391..9f7c79ada4 100644
--- a/indra/newview/skins/default/xui/en/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_wizard.xml
@@ -207,7 +207,7 @@
 			<panel
 			 top="30"
 			 right="-10"
-			 name="preview_panel"
+			 name="choose_file_preview_panel"
 			 bevel_style="none"
 			 highlight_light_color="0.09 0.09 0.09 1"
 			 border="true"
@@ -460,7 +460,7 @@ Higher prim weight</text>
 			<panel
 				 right="-10"
 				 top="32"
-				 name="preview_panel"
+				 name="optimize_preview_panel"
 				 bevel_style="none"
 				 highlight_light_color="0.09 0.09 0.09 1"
 				 border_style="line"
@@ -598,7 +598,7 @@ Buildings</text>
 			<panel
 				 right="-10"
 				 top="32"
-				 name="preview_panel"
+				 name="physics_preview_panel"
 				 bevel_style="none"
 				 highlight_light_color="0.09 0.09 0.09 1"
 				 border_style="line"
-- 
cgit v1.2.3


From 12e08417bfdf5d50feea544a54bbb333ad01acce Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 28 Jun 2011 12:41:12 -0500
Subject: SH-1169 Fix for convex decompositions not working post
 mesh-asset-deprecation work. (also default SLM usage to on)

---
 indra/newview/app_settings/settings.xml |  2 +-
 indra/newview/llfloatermodelpreview.cpp | 10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index cf07350d85..3c309f93bc 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -5587,7 +5587,7 @@
     <key>Type</key>
     <string>Boolean</string>
     <key>Value</key>
-    <real>0</real>
+    <real>1</real>
   </map>
   <key>MeshUploadLogXML</key>
   <map>
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 0006e3423b..67841620ea 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -1968,10 +1968,6 @@ bool LLModelLoader::loadFromSLM(const std::string& filename)
 					mPreview->critiqueRigForUploadApplicability( loaded_model->mSkinInfo.mJointNames );					
 				}
 			}
-			else
-			{
-				return false;
-			}
 		}
 	}	
 
@@ -1980,6 +1976,12 @@ bool LLModelLoader::loadFromSLM(const std::string& filename)
 		return false;
 	}
 
+	if (model[LLModel::LOD_PHYSICS].empty())
+	{ //no explicit physics block, copy HIGH_LOD into physics array to recover convex decomp
+		model[LLModel::LOD_PHYSICS] = model[LLModel::LOD_HIGH];
+	}
+
+
 	//load instance list
 	model_instance_list instance_list;
 
-- 
cgit v1.2.3


From 83c277afe8d2f7c3066fe611cda50a8bc22ccc87 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Tue, 28 Jun 2011 20:46:52 +0300
Subject: SH-1725 WIP Fixed the physics detail slider value. Inverted the min
 value to the "performance" end of the slider and the max value to the
 "accuracy" end.

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

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelwizard.cpp b/indra/newview/llfloatermodelwizard.cpp
index 32b8850803..9efebbd336 100644
--- a/indra/newview/llfloatermodelwizard.cpp
+++ b/indra/newview/llfloatermodelwizard.cpp
@@ -458,7 +458,9 @@ void LLFloaterModelWizard::executePhysicsStage(std::string stage_name)
 {
 	if (sInstance)
 	{
-		F64 physics_accuracy = sInstance->getChild<LLSliderCtrl>("physics_slider")->getValue().asReal();
+		// Invert the slider value so that "performance" end is giving the least detailed physics,
+		// and the "accuracy" end is giving the most detailed physics
+		F64 physics_accuracy = 1 - sInstance->getChild<LLSliderCtrl>("physics_slider")->getValue().asReal();
 
 		sInstance->mDecompParams["Retain%"] = physics_accuracy;
 
-- 
cgit v1.2.3


From 0528723d0fcd926e2243d543aa51bf5261f09103 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Tue, 28 Jun 2011 21:24:17 +0300
Subject: SH-1725 WIP Fixed preview model display on two last wizard steps.

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

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelwizard.cpp b/indra/newview/llfloatermodelwizard.cpp
index 9efebbd336..97b54c4c74 100644
--- a/indra/newview/llfloatermodelwizard.cpp
+++ b/indra/newview/llfloatermodelwizard.cpp
@@ -666,7 +666,7 @@ void LLFloaterModelWizard::draw()
 
 	LLFloater::draw();
 
-	if (mModelPreview)
+	if (mModelPreview && mState < REVIEW)
 	{
 		mModelPreview->update();
 
-- 
cgit v1.2.3


From 41f3080d93c0a6efdf415981a2f168bbc55dd73a Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Tue, 28 Jun 2011 15:36:26 -0400
Subject: SH-1917 SH-1935 FIX PE cost is not always shown, includes unnecessary
 digits

Reformatted line showing prim equiv values, formatted to an integer,
removed old Render Cost display, and updated label of new display.
---
 indra/newview/llfloatertools.cpp                   | 24 +++++++++++++---------
 .../newview/skins/default/xui/en/floater_tools.xml | 18 +++-------------
 2 files changed, 17 insertions(+), 25 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index 3e98cff9e6..1b6feddb6c 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -455,27 +455,31 @@ void LLFloaterTools::refresh()
 		S32 prim_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
 		S32 link_count = LLSelectMgr::getInstance()->getSelection()->getRootObjectCount();
 
-		LLStringUtil::format_map_t args;
-		args["OBJ_COUNT"] = llformat("%.1d", link_count);
-		args["PRIM_COUNT"] = llformat("%.1d", prim_count);
+		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;
-		selection_info << getString("status_selectcount", args);
 
-		bool show_prim_equiv = (link_cost != prim_count) && link_cost;
 		bool show_adv_weight = gSavedSettings.getBOOL("ShowAdvancedBuilderOptions");
 		bool show_mesh_cost = gMeshRepo.meshRezEnabled();
 
-		if (show_prim_equiv && show_mesh_cost)
+		if (show_mesh_cost)
 		{
-			selection_info << ": ";
-			args["SEL_WEIGHT"] = llformat("%.1f", link_cost);
-			selection_info << getString("status_selectprimequiv", args);
+			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);
 		}
+		else
+		{
+			selection_args["PE_STRING"] = "";
+		}
+
+		selection_info << getString("status_selectcount", selection_args);
 
 		if (show_adv_weight)
 		{
-			show_prim_equiv ? (selection_info << ",") : (selection_info << ".");
+			selection_info << ",";
 
 			childSetTextArg("selection_weight", "[PHYS_WEIGHT]", llformat("%.1f", link_phys_cost));
 			childSetTextArg("selection_weight", "[DISP_WEIGHT]", llformat("%.1d", calcRenderCost()));
diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml
index aad94f5b47..10db871917 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 ) selected
+        [OBJ_COUNT] objects ( [PRIM_COUNT] prims[PE_STRING] ) selected
     </floater.string>
     <floater.string
      name="status_selectprimequiv">
-        PE weight [SEL_WEIGHT]
+        , [SEL_WEIGHT] prim equivs
     </floater.string>
     <button
      follows="left|top"
@@ -271,18 +271,6 @@
 	  <button.commit_callback
 	     function="BuildTool.UnlinkObjects"/>
     </button>
-    <text
-	   text_color="LtGray_50"
-	   follows="top|left"
-	   halign="left"
-	   left_pad="3"
-	   name="RenderingCost"
-	   tool_tip="Shows the rendering cost calculated for this object"
-	   top_delta="11"
-	   type="string"
-	   width="100">
-	   þ: [COUNT]
-	   </text>
     <check_box
      control_name="ScaleUniform"
      height="19"
@@ -754,7 +742,7 @@
 	  top_pad="0"
 	  visible="false"
 	  width="280">
-	  Physics weight [PHYS_WEIGHT], Display weight [DISP_WEIGHT].
+	  Physics weight [PHYS_WEIGHT], Render Cost [DISP_WEIGHT].
 	</text>
     <!-- <text -->
     <!-- text_color="LtGray_50" -->
-- 
cgit v1.2.3


From fc6f0f31be53d6adbc8e364ffdd4119943312578 Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Wed, 29 Jun 2011 17:22:18 +0300
Subject: SH-1726 FIXED (Viewer modifications to advanced model upload to
 accommodate upload fee & prim equivalency)

- Changed XUI according to the spec
- Added requesting upload permission, physics weight and fee weight
- Split requesting fee and uploading model steps in mesh repository
---
 indra/newview/CMakeLists.txt                       |   4 +
 indra/newview/llfloatermodelpreview.cpp            | 118 ++++++++++++---
 indra/newview/llfloatermodelpreview.h              |  22 ++-
 indra/newview/llfloatermodeluploadbase.cpp         |  56 +++++++
 indra/newview/llfloatermodeluploadbase.h           |  57 ++++++++
 indra/newview/llfloatermodelwizard.cpp             |  20 ++-
 indra/newview/llfloatermodelwizard.h               |  13 +-
 indra/newview/llmeshrepository.cpp                 | 161 +++++++++++++--------
 indra/newview/llmeshrepository.h                   |  15 +-
 indra/newview/lluploadfloaterobservers.cpp         |  56 +++++++
 indra/newview/lluploadfloaterobservers.h           |  79 ++++++++++
 .../skins/default/xui/en/floater_model_preview.xml |  75 +++++-----
 .../newview/skins/default/xui/en/notifications.xml |  14 ++
 13 files changed, 570 insertions(+), 120 deletions(-)
 create mode 100644 indra/newview/llfloatermodeluploadbase.cpp
 create mode 100644 indra/newview/llfloatermodeluploadbase.h
 create mode 100644 indra/newview/lluploadfloaterobservers.cpp
 create mode 100644 indra/newview/lluploadfloaterobservers.h

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 523ea8a394..c4018cd79c 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -204,6 +204,7 @@ set(viewer_SOURCE_FILES
     llfloatermediasettings.cpp
     llfloatermemleak.cpp
     llfloatermodelpreview.cpp
+    llfloatermodeluploadbase.cpp
     llfloatermodelwizard.cpp
     llfloaternamedesc.cpp
     llfloaternotificationsconsole.cpp
@@ -496,6 +497,7 @@ set(viewer_SOURCE_FILES
     lltranslate.cpp
     lluilistener.cpp
     lluploaddialog.cpp
+    lluploadfloaterobservers.cpp
     llurl.cpp
     llurldispatcher.cpp
     llurldispatcherlistener.cpp
@@ -758,6 +760,7 @@ set(viewer_HEADER_FILES
     llfloatermediasettings.h
     llfloatermemleak.h
     llfloatermodelpreview.h
+    llfloatermodeluploadbase.h
     llfloatermodelwizard.h
     llfloaternamedesc.h
     llfloaternotificationsconsole.h
@@ -1047,6 +1050,7 @@ set(viewer_HEADER_FILES
     lluiconstants.h
     lluilistener.h
     lluploaddialog.h
+    lluploadfloaterobservers.h
     llurl.h
     llurldispatcher.h
     llurldispatcherlistener.h
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index d000248e8e..ea85dc0052 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -71,6 +71,7 @@
 #include "llmatrix4a.h"
 #include "llmenubutton.h"
 #include "llmeshrepository.h"
+#include "llnotificationsutil.h"
 #include "llsdutil_math.h"
 #include "lltextbox.h"
 #include "lltoolmgr.h"
@@ -353,7 +354,9 @@ void LLMeshFilePicker::notify(const std::string& filename)
 // LLFloaterModelPreview()
 //-----------------------------------------------------------------------------
 LLFloaterModelPreview::LLFloaterModelPreview(const LLSD& key) :
-LLFloater(key)
+LLFloaterModelUploadBase(key),
+mUploadBtn(NULL),
+mCalculateBtn(NULL)
 {
 	sInstance = this;
 	mLastMouseX = 0;
@@ -422,8 +425,6 @@ BOOL LLFloaterModelPreview::postBuild()
 	
 	childDisable("ok_btn");
 
-	childSetCommitCallback("confirm_checkbox", refresh, this);
-
 	mViewOptionMenuButton = getChild<LLMenuButton>("options_gear_btn");
 
 	mCommitCallbackRegistrar.add("ModelImport.ViewOption.Action", boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _2));
@@ -473,6 +474,13 @@ BOOL LLFloaterModelPreview::postBuild()
 		}
 	}
 
+	mUploadBtn = getChild<LLButton>("ok_btn");
+	mCalculateBtn = getChild<LLButton>("calculate_btn");
+
+	mCalculateBtn->setClickedCallback(boost::bind(&LLFloaterModelPreview::onClickCalculateBtn, this));
+
+	toggleCalculateButton(true);
+
 	return TRUE;
 }
 
@@ -551,6 +559,26 @@ void LLFloaterModelPreview::loadModel(S32 lod, const std::string& file_name)
 	mModelPreview->loadModel(file_name, lod);
 }
 
+void LLFloaterModelPreview::onClickCalculateBtn()
+{
+	childSetTextArg("weights", "[EQ]", llformat("%d", mModelPreview->mResourceCost));
+
+	mModelPreview->rebuildUploadData();
+
+	bool upload_skinweights = childGetValue("upload_skin").asBoolean();
+	bool upload_joint_positions = childGetValue("upload_joints").asBoolean();
+
+	mUploadModelUrl.clear();
+	LLMeshUploadThread* thread = new LLMeshUploadThread(mModelPreview->mUploadData, mModelPreview->mPreviewScale,
+			childGetValue("upload_textures").asBoolean(), upload_skinweights, upload_joint_positions, mUploadModelUrl, false);
+
+	thread->setObserverHandle(getWholeModelFeeObserverHandle());
+
+	gMeshRepo.mUploadWaitList.push_back(thread);
+
+	toggleCalculateButton(false);
+}
+
 //static
 void LLFloaterModelPreview::onImportScaleCommit(LLUICtrl*,void* userdata)
 {
@@ -561,7 +589,8 @@ void LLFloaterModelPreview::onImportScaleCommit(LLUICtrl*,void* userdata)
 		return;
 	}
 
-	fp->mModelPreview->calcResourceCost();
+	fp->toggleCalculateButton(true);
+
 	fp->mModelPreview->refresh();
 }
 //static
@@ -573,7 +602,9 @@ void LLFloaterModelPreview::onPelvisOffsetCommit( LLUICtrl*, void* userdata )
 	{
 		return;
 	}
-	fp->mModelPreview->calcResourceCost();
+
+	fp->toggleCalculateButton(true);
+
 	fp->mModelPreview->refresh();
 }
 
@@ -623,7 +654,8 @@ void LLFloaterModelPreview::onUploadSkinCommit(LLUICtrl*,void* userdata)
 		return;
 	}
 	
-	fp->mModelPreview->calcResourceCost();
+	fp->toggleCalculateButton(true);
+
 	fp->mModelPreview->refresh();
 	fp->mModelPreview->resetPreviewTarget();
 	fp->mModelPreview->clearBuffers();
@@ -653,6 +685,7 @@ void LLFloaterModelPreview::onGenerateNormalsCommit(LLUICtrl* ctrl, void* userda
 {
 	LLFloaterModelPreview* fp = (LLFloaterModelPreview*) userdata;
 
+	fp->toggleCalculateButton(true);
 	fp->mModelPreview->generateNormals();
 }
 
@@ -676,6 +709,8 @@ void LLFloaterModelPreview::onAutoFillCommit(LLUICtrl* ctrl, void* userdata)
 void LLFloaterModelPreview::onLODParamCommit(LLUICtrl* ctrl, void* userdata)
 {
 	LLFloaterModelPreview* fp = (LLFloaterModelPreview*) userdata;
+
+	fp->toggleCalculateButton(true);
 	fp->mModelPreview->onLODParamCommit(false);
 }
 
@@ -683,6 +718,7 @@ void LLFloaterModelPreview::onLODParamCommit(LLUICtrl* ctrl, void* userdata)
 void LLFloaterModelPreview::onLODParamCommitTriangleLimit(LLUICtrl* ctrl, void* userdata)
 {
 	LLFloaterModelPreview* fp = (LLFloaterModelPreview*) userdata;
+	fp->toggleCalculateButton(true);
 	fp->mModelPreview->onLODParamCommit(true);
 }
 
@@ -714,6 +750,8 @@ void LLFloaterModelPreview::draw()
 		}
 	}
 
+	childSetEnabled("ok_btn", mHasUploadPerm);
+
 	childSetTextArg("prim_cost", "[PRIM_COST]", llformat("%d", mModelPreview->mResourceCost));
 	childSetTextArg("description_label", "[TEXTURES]", llformat("%d", mModelPreview->mTextureSet.size()));
 
@@ -871,6 +909,12 @@ BOOL LLFloaterModelPreview::handleScrollWheel(S32 x, S32 y, S32 clicks)
 	return TRUE;
 }
 
+/*virtual*/
+void LLFloaterModelPreview::onOpen(const LLSD& key)
+{
+	requestAgentUploadPermissions();
+}
+
 //static
 void LLFloaterModelPreview::onPhysicsParamCommit(LLUICtrl* ctrl, void* data)
 {
@@ -2926,8 +2970,7 @@ U32 LLModelPreview::calcResourceCost()
 
 	if (mFMP && mModelLoader)
 	{
-		const BOOL confirmed_checkbox = mFMP->getChild<LLCheckBoxCtrl>("confirm_checkbox")->getValue().asBoolean();
-		if ( getLoadState() < LLModelLoader::ERROR_PARSING && confirmed_checkbox )
+		if ( getLoadState() < LLModelLoader::ERROR_PARSING)
 		{
 			mFMP->childEnable("ok_btn");
 		}
@@ -3038,8 +3081,6 @@ void LLFloaterModelPreview::setDetails(F32 x, F32 y, F32 z, F32 streaming_cost,
 	childSetTextArg("import_dimensions", "[X]", llformat("%.3f", x));
 	childSetTextArg("import_dimensions", "[Y]", llformat("%.3f", y));
 	childSetTextArg("import_dimensions", "[Z]", llformat("%.3f", z));
-	childSetTextArg("streaming cost", "[COST]", llformat("%.3f", streaming_cost));
-	childSetTextArg("physics cost", "[COST]", llformat("%.3f", physics_cost));	
 }
 
 
@@ -3069,8 +3110,7 @@ void LLModelPreview::rebuildUploadData()
 
 	F32 max_scale = 0.f;
 
-	const BOOL confirmed_checkbox = mFMP->getChild<LLCheckBoxCtrl>("confirm_checkbox")->getValue().asBoolean();
-	if ( mBaseScene.size() > 0 && confirmed_checkbox )
+	if ( mBaseScene.size() > 0)
 	{
 		mFMP->childEnable("ok_btn");
 	}
@@ -3476,8 +3516,7 @@ void LLModelPreview::loadModelCallback(S32 lod)
 	}
 
 	mLoading = false;
-	if (mFMP)
-		mFMP->getChild<LLCheckBoxCtrl>("confirm_checkbox")->set(FALSE);
+
 	refresh();
 
 	mModelLoadedSignal();
@@ -4185,8 +4224,7 @@ void LLModelPreview::updateStatusMessages()
 		}
 	}
 
-	const BOOL confirmed_checkbox = mFMP->getChild<LLCheckBoxCtrl>("confirm_checkbox")->getValue().asBoolean();
-	if ( upload_ok && !errorStateFromLoader && skinAndRigOk && !has_degenerate && confirmed_checkbox)
+	if ( upload_ok && !errorStateFromLoader && skinAndRigOk && !has_degenerate)
 	{
 		mFMP->childEnable("ok_btn");
 	}
@@ -5314,7 +5352,7 @@ void LLFloaterModelPreview::onUpload(void* user_data)
 	mp->mModelPreview->saveUploadData(upload_skinweights, upload_joint_positions);
 
 	gMeshRepo.uploadModel(mp->mModelPreview->mUploadData, mp->mModelPreview->mPreviewScale,
-						  mp->childGetValue("upload_textures").asBoolean(), upload_skinweights, upload_joint_positions);
+						  mp->childGetValue("upload_textures").asBoolean(), upload_skinweights, upload_joint_positions, mp->mUploadModelUrl);
 
 	mp->closeFloater(false);
 }
@@ -5330,6 +5368,7 @@ void LLFloaterModelPreview::onClearMaterials(void* user_data)
 //static
 void LLFloaterModelPreview::refresh(LLUICtrl* ctrl, void* user_data)
 {
+	sInstance->toggleCalculateButton(true);
 	sInstance->mModelPreview->mDirty = true;
 }
 
@@ -5382,6 +5421,34 @@ void LLFloaterModelPreview::setStatusMessage(const std::string& msg)
 	mStatusMessage = msg;
 }
 
+void LLFloaterModelPreview::toggleCalculateButton(bool visible)
+{
+	mCalculateBtn->setVisible(visible);
+	mUploadBtn->setVisible(!visible);
+	mUploadBtn->setEnabled(mHasUploadPerm);
+
+	if (visible)
+	{
+		std::string tbd = getString("tbd");
+		childSetTextArg("weights", "[EQ]", tbd);
+		childSetTextArg("weights", "[PH]", tbd);
+		childSetTextArg("weights", "[FEE]", tbd);
+	}
+}
+
+void LLFloaterModelPreview::onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url)
+{
+	mUploadModelUrl = upload_url;
+	childSetTextArg("weights", "[PH]", llformat("%.3f", physics));
+	childSetTextArg("weights", "[FEE]", llformat("%d", fee));
+	childSetVisible("weights", true);
+}
+
+void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason)
+{
+	llwarns << "LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(" << status << " : " << reason << ")" << llendl;
+}
+
 S32 LLFloaterModelPreview::DecompRequest::statusCallback(const char* status, S32 p1, S32 p2)
 {
 	if (mContinue)
@@ -5421,3 +5488,20 @@ void LLFloaterModelPreview::DecompRequest::completed()
 		llassert(sInstance->mCurRequest.find(this) == sInstance->mCurRequest.end());
 	}
 }
+
+void LLFloaterModelPreview::onPermReceived(const LLSD& result)
+{
+	std::string upload_status = result["mesh_upload_status"].asString();
+	mHasUploadPerm = "valid" == upload_status;
+
+	mUploadBtn->setEnabled(mHasUploadPerm);
+	getChild<LLTextBox>("warning_title")->setVisible(mHasUploadPerm);
+	getChild<LLTextBox>("warning_message")->setVisible(mHasUploadPerm);
+}
+
+void LLFloaterModelPreview::setPermErrorStatus(U32 status, const std::string& reason)
+{
+	llwarns << "LLFloaterModelPreview::setPermErrors(" << status << " : " << reason << ")" << llendl;
+
+	LLNotificationsUtil::add("MeshUploadPermError");
+}
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index ab50890fb9..62878812c3 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -140,7 +140,7 @@ private:
 	static bool isAlive(LLModelLoader* loader) ;
 };
 
-class LLFloaterModelPreview : public LLFloater
+class LLFloaterModelPreview : public LLFloaterModelUploadBase
 {
 public:
 	
@@ -167,6 +167,8 @@ public:
 	BOOL handleHover(S32 x, S32 y, MASK mask);
 	BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); 
 	
+	/*virtual*/ void onOpen(const LLSD& key);
+
 	static void onMouseCaptureLostModelPreview(LLMouseHandler*);
 	static void setUploadAmount(S32 amount) { sUploadAmount = amount; }
 
@@ -194,6 +196,16 @@ public:
 	void enableViewOption(const std::string& option);
 	void disableViewOption(const std::string& option);
 
+	// shows warning message if agent has no permissions to upload model
+	/*virtual*/ void onPermReceived(const LLSD& result);
+
+	// called when error occurs during permissions request
+	/*virtual*/ void setPermErrorStatus(U32 status, const std::string& reason);
+
+	/*virtual*/ void onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url);
+
+	/*virtual*/ void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason);
+
 protected:
 	friend class LLModelPreview;
 	friend class LLMeshFilePicker;
@@ -259,6 +271,14 @@ protected:
 	LLToggleableMenu* mViewOptionMenu;
 	LLMutex* mStatusLock;
 
+private:
+	void onClickCalculateBtn();
+
+	// Toggles between "Calculate weights & fee" and "Upload" buttons.
+	void toggleCalculateButton(bool visible);
+
+	LLButton* mUploadBtn;
+	LLButton* mCalculateBtn;
 };
 
 class LLMeshFilePicker : public LLFilePickerThread
diff --git a/indra/newview/llfloatermodeluploadbase.cpp b/indra/newview/llfloatermodeluploadbase.cpp
new file mode 100644
index 0000000000..56c6447792
--- /dev/null
+++ b/indra/newview/llfloatermodeluploadbase.cpp
@@ -0,0 +1,56 @@
+/**
+ * @file llfloatermodeluploadbase.cpp
+ * @brief LLFloaterUploadModelBase class definition
+ *
+ * $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 "llfloatermodeluploadbase.h"
+#include "llagent.h"
+#include "llviewerregion.h"
+#include "llnotificationsutil.h"
+
+LLFloaterModelUploadBase::LLFloaterModelUploadBase(const LLSD& key)
+:LLFloater(key),
+ mHasUploadPerm(false)
+{
+}
+
+void LLFloaterModelUploadBase::requestAgentUploadPermissions()
+{
+	std::string capability = "MeshUploadFlag";
+	std::string url = gAgent.getRegion()->getCapability(capability);
+
+	if (!url.empty())
+	{
+		llinfos<< typeid(*this).name() <<"::requestAgentUploadPermissions() requesting for upload model permissions from: "<< url <<llendl;
+		LLHTTPClient::get(url, new LLUploadModelPremissionsResponder(getPermObserverHandle()));
+	}
+	else
+	{
+		LLSD args;
+		args["CAPABILITY"] = capability;
+		LLNotificationsUtil::add("RegionCapabilityRequestError", args);
+	}
+}
diff --git a/indra/newview/llfloatermodeluploadbase.h b/indra/newview/llfloatermodeluploadbase.h
new file mode 100644
index 0000000000..a4e300563d
--- /dev/null
+++ b/indra/newview/llfloatermodeluploadbase.h
@@ -0,0 +1,57 @@
+/**
+ * @file llfloatermodeluploadbase.h
+ * @brief LLFloaterUploadModelBase class declaration
+ *
+ * $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 LLFLOATERMODELUPLOADBASE_H_
+#define LLFLOATERMODELUPLOADBASE_H_
+
+#include "lluploadfloaterobservers.h"
+
+class LLFloaterModelUploadBase : public LLFloater, public LLUploadPermissionsObserver, public LLWholeModelFeeObserver
+{
+public:
+
+	LLFloaterModelUploadBase(const LLSD& key);
+
+	virtual ~LLFloaterModelUploadBase(){};
+
+	virtual void setPermissonsErrorStatus(U32 status, const std::string& reason){};
+
+	virtual void onPermissionsReceived(const LLSD& result){};
+
+	virtual void onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url){};
+
+	virtual void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason){};
+
+protected:
+
+	// requests agent's permissions to upload model
+	void requestAgentUploadPermissions();
+
+	std::string mUploadModelUrl;
+	bool mHasUploadPerm;
+};
+
+#endif /* LLFLOATERMODELUPLOADBASE_H_ */
diff --git a/indra/newview/llfloatermodelwizard.cpp b/indra/newview/llfloatermodelwizard.cpp
index 97b54c4c74..3c0ce96864 100644
--- a/indra/newview/llfloatermodelwizard.cpp
+++ b/indra/newview/llfloatermodelwizard.cpp
@@ -52,7 +52,7 @@ static	const std::string stateNames[]={
 static void swap_controls(LLUICtrl* first_ctrl, LLUICtrl* second_ctrl, bool first_ctr_visible);
 
 LLFloaterModelWizard::LLFloaterModelWizard(const LLSD& key)
-	: LLFloater(key)
+	: LLFloaterModelUploadBase(key)
 	 ,mRecalculateGeometryBtn(NULL)
 	 ,mRecalculatePhysicsBtn(NULL)
 	 ,mRecalculatingPhysicsBtn(NULL)
@@ -396,6 +396,13 @@ BOOL LLFloaterModelWizard::handleScrollWheel(S32 x, S32 y, S32 clicks)
 	return TRUE;
 }
 
+
+/*virtual*/
+void LLFloaterModelWizard::onOpen(const LLSD& key)
+{
+	requestAgentUploadPermissions();
+}
+
 void LLFloaterModelWizard::initDecompControls()
 {
 	LLSD key;
@@ -453,6 +460,15 @@ void LLFloaterModelWizard::initDecompControls()
 	mDecompParams["Simplify Method"] = 0; // set it to retain %
 }
 
+void LLFloaterModelWizard::onPermReceived(const LLSD& result)
+{
+}
+
+void LLFloaterModelWizard::setPermErrorStatus(U32 status, const std::string& reason)
+{
+	llwarns << "LLFloaterModelWizard::setPermErrors(" << status << " : " << reason << ")" << llendl;
+}
+
 //static
 void LLFloaterModelWizard::executePhysicsStage(std::string stage_name)
 {
@@ -623,7 +639,7 @@ void LLFloaterModelWizard::onUpload()
 	mModelPreview->rebuildUploadData();
 	
 	gMeshRepo.uploadModel(mModelPreview->mUploadData, mModelPreview->mPreviewScale, 
-						  true, false, false);
+						  true, false, false, mUploadModelUrl, true);
 	
 	setState(UPLOAD);
 	
diff --git a/indra/newview/llfloatermodelwizard.h b/indra/newview/llfloatermodelwizard.h
index 409451e1b6..9930e0c4e6 100644
--- a/indra/newview/llfloatermodelwizard.h
+++ b/indra/newview/llfloatermodelwizard.h
@@ -30,12 +30,13 @@
 #include "llmeshrepository.h"
 #include "llmodel.h"
 #include "llthread.h"
+#include "llfloatermodeluploadbase.h"
 
 
 class LLModelPreview;
 
 
-class LLFloaterModelWizard : public LLFloater
+class LLFloaterModelWizard : public LLFloaterModelUploadBase
 {
 public:
 	
@@ -62,12 +63,20 @@ public:
 	BOOL handleMouseDown(S32 x, S32 y, MASK mask);
 	BOOL handleMouseUp(S32 x, S32 y, MASK mask);
 	BOOL handleHover(S32 x, S32 y, MASK mask);
-	BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); 
+	BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
+
+	/*virtual*/ void onOpen(const LLSD& key);
 
 	void setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost);
 	void modelLoadedCallback();
 	void initDecompControls();
 	
+	// shows warning message if agent has no permissions to upload model
+	void onPermReceived(const LLSD& result);
+
+	// called when error occurs during permissions request
+	void setPermErrorStatus(U32 status, const std::string& reason);
+
 	const LLRect& getPreviewRect() const { return mPreviewRect; }
 
 	LLPhysicsDecomp::decomp_params mDecompParams;
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 4da5da9493..49bcbf860a 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -62,6 +62,7 @@
 #include "llinventorymodel.h"
 #include "llfoldertype.h"
 #include "llviewerparcelmgr.h"
+#include "lluploadfloaterobservers.h"
 
 #include "boost/lexical_cast.hpp"
 
@@ -554,10 +555,12 @@ class LLWholeModelFeeResponder: public LLCurl::Responder
 {
 	LLMeshUploadThread* mThread;
 	LLSD mModelData;
+	LLHandle<LLWholeModelFeeObserver> mObserverHandle;
 public:
-	LLWholeModelFeeResponder(LLMeshUploadThread* thread, LLSD& model_data):
+	LLWholeModelFeeResponder(LLMeshUploadThread* thread, LLSD& model_data, LLHandle<LLWholeModelFeeObserver> observer_handle):
 		mThread(thread),
-		mModelData(model_data)
+		mModelData(model_data),
+		mObserverHandle(observer_handle)
 	{
 	}
 	virtual void completed(U32 status,
@@ -573,11 +576,21 @@ public:
 		llinfos << "completed" << llendl;
 		mThread->mPendingUploads--;
 		dump_llsd_to_file(cc,make_dump_name("whole_model_fee_response_",dump_num));
+
 		if (isGoodStatus(status) &&
 			cc["state"].asString() == "upload")
 		{
 			llinfos << "fee request succeeded" << llendl;
-			mThread->mWholeModelUploadURL = cc["uploader"].asString(); 
+			mThread->mWholeModelUploadURL = cc["uploader"].asString();
+
+			LLWholeModelFeeObserver* observer = mObserverHandle.get();
+			if (observer)
+			{
+				S32 fee = cc["upload_price"].asInteger();
+				F64 phys = cc["data"]["physics_cost"].asReal();
+
+				observer->onModelPhysicsFeeReceived(phys, fee, mThread->mWholeModelUploadURL);
+			}
 		}
 		else
 		{
@@ -1376,9 +1389,11 @@ bool LLMeshRepoThread::physicsShapeReceived(const LLUUID& mesh_id, U8* data, S32
 }
 
 LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data, LLVector3& scale, bool upload_textures,
-										bool upload_skin, bool upload_joints)
+										bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload)
 : LLThread("mesh upload"),
-	mDiscarded(FALSE)
+	mDiscarded(FALSE),
+	mDoUpload(do_upload),
+	mWholeModelUploadURL(upload_url)
 {
 	mInstanceList = data;
 	mUploadTextures = upload_textures;
@@ -1456,7 +1471,14 @@ BOOL LLMeshUploadThread::isDiscarded()
 
 void LLMeshUploadThread::run()
 {
-	doWholeModelUpload();
+	if (mDoUpload)
+	{
+		doWholeModelUpload();
+	}
+	else
+	{
+		requestWholeModelFee();
+	}
 }
 
 void dump_llsd_to_file(const LLSD& content, std::string filename)
@@ -1650,69 +1672,54 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
 	dest = result;
 }
 
-void LLMeshUploadThread::doWholeModelUpload()
+void LLMeshUploadThread::queueUpModels()
 {
-	dump_num++;
-	
-	mCurlRequest = new LLCurlRequest();	
-
-	// Queue up models for hull generation (viewer-side)
 	for (instance_map::iterator iter = mInstance.begin(); iter != mInstance.end(); ++iter)
-	{
-		LLMeshUploadData data;
-		data.mBaseModel = iter->first;
-
-		LLModelInstance& instance = *(iter->second.begin());
-
-		for (S32 i = 0; i < 5; i++)
 		{
-			data.mModel[i] = instance.mLOD[i];
-		}
+			LLMeshUploadData data;
+			data.mBaseModel = iter->first;
 
-		//queue up models for hull generation
-		LLModel* physics = NULL;
+			LLModelInstance& instance = *(iter->second.begin());
 
-		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];
-		}
+			for (S32 i = 0; i < 5; i++)
+			{
+				data.mModel[i] = instance.mLOD[i];
+			}
 
-		llassert(physics != NULL);
-		
-		DecompRequest* request = new DecompRequest(physics, data.mBaseModel, this);
-		if(request->isValid())
-		{
-			gMeshRepo.mDecompThread->submitRequest(request);
-		}		
-	}
+			//queue up models for hull generation
+			LLModel* physics = NULL;
 
-	while (!mPhysicsComplete)
-	{
-		apr_sleep(100);
-	}
+			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];
+			}
 
-	LLSD model_data;
-	wholeModelToLLSD(model_data,false);
-	dump_llsd_to_file(model_data,make_dump_name("whole_model_fee_request_",dump_num));
+			llassert(physics != NULL);
 
-	mPendingUploads++;
-	LLCurlRequest::headers_t headers;
-	mCurlRequest->post(mWholeModelFeeCapability, headers, model_data,
-					   new LLWholeModelFeeResponder(this,model_data), mMeshUploadTimeOut);
+			DecompRequest* request = new DecompRequest(physics, data.mBaseModel, this);
+			if(request->isValid())
+			{
+				gMeshRepo.mDecompThread->submitRequest(request);
+			}
+		}
 
-	do
-	{
-		mCurlRequest->process();
-	} while (mCurlRequest->getQueued() > 0);
+		while (!mPhysicsComplete)
+		{
+			apr_sleep(100);
+		}
+}
 
+void LLMeshUploadThread::doWholeModelUpload()
+{
+	mCurlRequest = new LLCurlRequest();
 
 	if (mWholeModelUploadURL.empty())
 	{
@@ -1720,12 +1727,15 @@ void LLMeshUploadThread::doWholeModelUpload()
 	}
 	else
 	{
+		queueUpModels();
+
 		LLSD full_model_data;
 		wholeModelToLLSD(full_model_data, true);
 		LLSD body = full_model_data["asset_resources"];
 		dump_llsd_to_file(body,make_dump_name("whole_model_body_",dump_num));
+		LLCurlRequest::headers_t headers;
 		mCurlRequest->post(mWholeModelUploadURL, headers, body,
-						   new LLWholeModelUploadResponder(this, model_data), mMeshUploadTimeOut);
+						   new LLWholeModelUploadResponder(this, full_model_data), mMeshUploadTimeOut);
 		do
 		{
 			mCurlRequest->process();
@@ -1739,6 +1749,35 @@ void LLMeshUploadThread::doWholeModelUpload()
 	mFinished = true;
 }
 
+void LLMeshUploadThread::requestWholeModelFee()
+{
+	dump_num++;
+
+	mCurlRequest = new LLCurlRequest();
+
+	queueUpModels();
+
+	LLSD model_data;
+	wholeModelToLLSD(model_data,false);
+	dump_llsd_to_file(model_data,make_dump_name("whole_model_fee_request_",dump_num));
+
+	mPendingUploads++;
+	LLCurlRequest::headers_t headers;
+	mCurlRequest->post(mWholeModelFeeCapability, headers, model_data,
+					   new LLWholeModelFeeResponder(this,model_data, mObserverHandle), mMeshUploadTimeOut);
+
+	do
+	{
+		mCurlRequest->process();
+	} while (mCurlRequest->getQueued() > 0);
+
+	delete mCurlRequest;
+	mCurlRequest = NULL;
+
+	// Currently a no-op.
+	mFinished = true;
+}
+
 void LLMeshUploadThread::uploadModel(LLMeshUploadData& data)
 { //called from arbitrary thread
 	{
@@ -2836,9 +2875,9 @@ LLSD& LLMeshRepoThread::getMeshHeader(const LLUUID& mesh_id)
 
 
 void LLMeshRepository::uploadModel(std::vector<LLModelInstance>& data, LLVector3& scale, bool upload_textures,
-									bool upload_skin, bool upload_joints)
+									bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload)
 {
-	LLMeshUploadThread* thread = new LLMeshUploadThread(data, scale, upload_textures, upload_skin, upload_joints);
+	LLMeshUploadThread* thread = new LLMeshUploadThread(data, scale, upload_textures, upload_skin, upload_joints, upload_url, do_upload);
 	mUploadWaitList.push_back(thread);
 }
 
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index f56734a7de..03993c6f2c 100644
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -36,6 +36,7 @@
 #define LLCONVEXDECOMPINTER_STATIC 1
 
 #include "llconvexdecomposition.h"
+#include "lluploadfloaterobservers.h"
 
 class LLVOVolume;
 class LLMeshResponder;
@@ -412,7 +413,7 @@ public:
 	std::map<LLViewerFetchedTexture*, LLTextureUploadData> mTextureMap;
 
 	LLMeshUploadThread(instance_list& data, LLVector3& scale, bool upload_textures,
-			bool upload_skin, bool upload_joints);
+			bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload = true);
 	~LLMeshUploadThread();
 
 	void uploadTexture(LLTextureUploadData& data);
@@ -433,7 +434,11 @@ public:
 	void discard() ;
 	BOOL isDiscarded();
 
+	// Queue up models for hull generation (viewer-side)
+	void queueUpModels();
+
 	void doWholeModelUpload();
+	void requestWholeModelFee();
 
 	void wholeModelToLLSD(LLSD& dest, bool include_textures);
 
@@ -441,6 +446,12 @@ public:
 							 LLVector3& result_pos,
 							 LLQuaternion& result_rot,
 							 LLVector3& result_scale);
+
+	void setObserverHandle(LLHandle<LLWholeModelFeeObserver> observer_handle) { mObserverHandle = observer_handle; }
+
+private:
+	LLHandle<LLWholeModelFeeObserver> mObserverHandle;
+	bool mDoUpload; // if FALSE only model data will be requested, otherwise the model will be uploaded
 };
 
 class LLMeshRepository
@@ -491,7 +502,7 @@ public:
 	LLSD& getMeshHeader(const LLUUID& mesh_id);
 
 	void uploadModel(std::vector<LLModelInstance>& data, LLVector3& scale, bool upload_textures,
-			bool upload_skin, bool upload_joints);
+			bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload = true);
 
 	S32 getMeshSize(const LLUUID& mesh_id, S32 lod);
 
diff --git a/indra/newview/lluploadfloaterobservers.cpp b/indra/newview/lluploadfloaterobservers.cpp
new file mode 100644
index 0000000000..2d418ee00d
--- /dev/null
+++ b/indra/newview/lluploadfloaterobservers.cpp
@@ -0,0 +1,56 @@
+/**
+ * @file lluploadfloaterobservers.cpp
+ * @brief LLUploadModelPremissionsResponder definition
+ *
+ * $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 "lluploadfloaterobservers.h"
+
+LLUploadModelPremissionsResponder::LLUploadModelPremissionsResponder(const LLHandle<LLUploadPermissionsObserver>& observer)
+:mObserverHandle(observer)
+{
+}
+
+void LLUploadModelPremissionsResponder::error(U32 status, const std::string& reason)
+{
+	llwarns << "LLUploadModelPremissionsResponder::error("<< status << ": " << reason << ")" << llendl;
+
+	LLUploadPermissionsObserver* observer = mObserverHandle.get();
+
+	if (observer)
+	{
+		observer->setPermErrorStatus(status, reason);
+	}
+}
+
+void LLUploadModelPremissionsResponder::result(const LLSD& content)
+{
+	LLUploadPermissionsObserver* observer = mObserverHandle.get();
+
+	if (observer)
+	{
+		observer->onPermReceived(content);
+	}
+}
diff --git a/indra/newview/lluploadfloaterobservers.h b/indra/newview/lluploadfloaterobservers.h
new file mode 100644
index 0000000000..f27687e12e
--- /dev/null
+++ b/indra/newview/lluploadfloaterobservers.h
@@ -0,0 +1,79 @@
+/**
+ * @file lluploadfloaterobservers.h
+ * @brief LLUploadModelPremissionsResponder declaration
+ *
+ * $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 LLUPLOADFLOATEROBSERVERS_H_
+#define LLUPLOADFLOATEROBSERVERS_H_
+
+#include "llfloater.h"
+#include "llhttpclient.h"
+#include "llhandle.h"
+
+class LLUploadPermissionsObserver
+{
+public:
+
+	LLUploadPermissionsObserver(){mUploadPermObserverHandle.bind(this);}
+	virtual ~LLUploadPermissionsObserver() {}
+
+	virtual void onPermReceived(const LLSD& result) = 0;
+	virtual void setPermErrorStatus(U32 status, const std::string& reason) = 0;
+
+	LLHandle<LLUploadPermissionsObserver> getPermObserverHandle() const {return mUploadPermObserverHandle;}
+
+protected:
+	LLRootHandle<LLUploadPermissionsObserver> mUploadPermObserverHandle;
+};
+
+class LLWholeModelFeeObserver
+{
+public:
+	LLWholeModelFeeObserver() { mWholeModelFeeObserverHandle.bind(this); }
+	virtual ~LLWholeModelFeeObserver() {}
+
+	virtual void onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url) = 0;
+	virtual void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason) = 0;
+
+	LLHandle<LLWholeModelFeeObserver> getWholeModelFeeObserverHandle() const { return mWholeModelFeeObserverHandle; }
+
+protected:
+	LLRootHandle<LLWholeModelFeeObserver> mWholeModelFeeObserverHandle;
+};
+
+class LLUploadModelPremissionsResponder : public LLHTTPClient::Responder
+{
+public:
+
+	LLUploadModelPremissionsResponder(const LLHandle<LLUploadPermissionsObserver>& observer);
+
+	void error(U32 status, const std::string& reason);
+
+	void result(const LLSD& content);
+
+private:
+	LLHandle<LLUploadPermissionsObserver> mObserverHandle;
+};
+
+#endif /* LLUPLOADFLOATEROBSERVERS_H_ */
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 f58595b3c5..ab46a13098 100644
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -23,6 +23,7 @@
   <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">
@@ -70,43 +71,29 @@
     width="290"
     height="290"
     follows="all"/>
-
-  <text bottom_delta="25" left="25" width="100" follows="bottom|left">Upload Details</text>
-  <panel top_pad="5" border="true" left="15" width="290" height="70" follows="bottom|left"
-          bevel_style="none" bg_alpha_color="0 0 0 0" bg_opaque_color="0 0 0 0.3">
-    <text left="25" follows="bottom|left" width="140" height="15" name="streaming cost">
-      Resource Cost: [COST]
-    </text>
-    <text left="25" top_pad="5" width="140" follows="bottom|left" height="15" name="physics cost">
-      Physics Cost: [COST]
+    
+    <text
+     follows="top|left"
+     font="SansSerif"
+     left_delta="0"
+     name="warning_title"
+     text_color="Yellow"
+     top_pad="10"
+     visible="false">
+     WARNING:
     </text>
-    <text left="25" top_pad="5" follows="bottom|left" height="15" name="upload fee">
-      Upload Fee: N/A
+    <text
+     follows="top|left"
+     text_color="White"
+     height="50"
+     left_delta="0"
+     name="warning_message"
+     parse_urls="true"
+     top_pad="5"
+     wrap="true"
+     visible="false">
+     You will not be able to complete the final upload of this model to the Second Life servers. Find out how to get certifed for mesh model uploads.
     </text>
-  </panel>
-
-  <check_box
-	height="16"
-	left_delta="0"
-	name="confirm_checkbox"
-	top_pad="15"
-	follows="bottom|left"
-	width="16" />
-
-  <text
-	height="30"
-	width="570"
-	word_wrap="true" 
-	left_delta="25"
-	top_delta="0">I confirm that I have the appropriate rights to the material contained in this model. [secondlife:///app/floater/learn_more Learn more]</text>
-  <text left="10" bottom="540" width="290" height="15" follows="bottom|left|right" name="status">[STATUS]</text>
-
-  
-  <button bottom="540" left="300"  follows="bottom|right" height="20" label="Defaults"
-	     width="80" name="reset_btn" tool_tip="Reset to defaults"/>
-  <button bottom="540" left="430"  follows="bottom|right" height="20" label="Upload"
-	     width="80" name="ok_btn" tool_tip="Upload to simulator"/>
-  <button left_pad="10" follows="right|bottom" height="20" width="80" label="Cancel" name="cancel_btn"/>
 
   <tab_container
     follows="right|top|bottom"
@@ -416,6 +403,24 @@
 
     </panel>
   </tab_container>
+
+  <text
+	height="16"
+	left="310"
+	name="weights"
+	width="300"
+	word_wrap="true" 
+	top_pad="7">
+	    Prim equivs: [EQ] Physics: [PH] Upload fee: [FEE] L$
+  </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"/>
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 09105c1d28..d3d78e63b0 100755
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6828,6 +6828,20 @@ Select residents to share with.
 See the log file for details.
   </notification>
    
+   <notification
+    name="MeshUploadPermError"
+    icon="alert.tga"
+    type="alert">
+    Error while requesting mesh upload permissons.
+  </notification>
+  
+  <notification
+    name="RegionCapabilityRequestError"
+    icon="alert.tga"
+    type="alert">
+    Could not get region capability &apos;[CAPABILITY]&apos;.
+  </notification>
+   
   <notification
    icon="notifytip.tga"
    name="ShareItemsConfirmation"
-- 
cgit v1.2.3


From 19c13b55d70976f74072ddcc412e9929f516d746 Mon Sep 17 00:00:00 2001
From: seth_productengine <none@none>
Date: Wed, 29 Jun 2011 17:10:30 +0300
Subject: SH-1873 FIXED updating L$ balance after uploading meshes.

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

(limited to 'indra/newview')

diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 49bcbf860a..743a8d53ed 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -2480,7 +2480,7 @@ void LLMeshRepository::notifyLoadedMeshes()
 				data.mPostData["name"],
 				data.mPostData["description"],
 				data.mResponse,
-				0);
+				data.mResponse["upload_price"]);
 			
 			mInventoryQ.pop();
 		}
-- 
cgit v1.2.3


From ac09873cf605e5970464682602bb70c0d16cadf2 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Wed, 29 Jun 2011 13:32:10 -0400
Subject: Added MeshUploadFlag to list of requested caps

---
 indra/newview/llviewerregion.cpp | 1 +
 1 file changed, 1 insertion(+)

(limited to 'indra/newview')

diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 85b4b60bf7..3569035c0d 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1525,6 +1525,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
 	capabilityNames.append("LandResources");
 	capabilityNames.append("MapLayer");
 	capabilityNames.append("MapLayerGod");
+	capabilityNames.append("MeshUploadFlag");
 	capabilityNames.append("NewFileAgentInventory");
 	capabilityNames.append("ParcelPropertiesUpdate");
 	capabilityNames.append("ParcelMediaURLFilterList");
-- 
cgit v1.2.3


From 0c05ea2740b63c824fba2bab37f67ca2188f0d07 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Wed, 29 Jun 2011 15:14:49 -0400
Subject: Fixes for upload permission checking problems

---
 indra/newview/llfloatermodelpreview.cpp    | 10 +++++++---
 indra/newview/llfloatermodeluploadbase.cpp |  2 ++
 2 files changed, 9 insertions(+), 3 deletions(-)
 mode change 100644 => 100755 indra/newview/llfloatermodelpreview.cpp

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
old mode 100644
new mode 100755
index ea85dc0052..00cc81c5d6
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -5489,14 +5489,18 @@ void LLFloaterModelPreview::DecompRequest::completed()
 	}
 }
 
+void dump_llsd_to_file(const LLSD& content, std::string filename);
+
 void LLFloaterModelPreview::onPermReceived(const LLSD& result)
 {
+	dump_llsd_to_file(result,"perm_received.xml");
 	std::string upload_status = result["mesh_upload_status"].asString();
-	mHasUploadPerm = "valid" == upload_status;
+	// BAP HACK: handle "" for case that  MeshUploadFlag cap is broken.
+	mHasUploadPerm = (("" == upload_status) || ("valid" == upload_status));
 
 	mUploadBtn->setEnabled(mHasUploadPerm);
-	getChild<LLTextBox>("warning_title")->setVisible(mHasUploadPerm);
-	getChild<LLTextBox>("warning_message")->setVisible(mHasUploadPerm);
+	getChild<LLTextBox>("warning_title")->setVisible(!mHasUploadPerm);
+	getChild<LLTextBox>("warning_message")->setVisible(!mHasUploadPerm);
 }
 
 void LLFloaterModelPreview::setPermErrorStatus(U32 status, const std::string& reason)
diff --git a/indra/newview/llfloatermodeluploadbase.cpp b/indra/newview/llfloatermodeluploadbase.cpp
index 56c6447792..6d3800bfa4 100644
--- a/indra/newview/llfloatermodeluploadbase.cpp
+++ b/indra/newview/llfloatermodeluploadbase.cpp
@@ -52,5 +52,7 @@ void LLFloaterModelUploadBase::requestAgentUploadPermissions()
 		LLSD args;
 		args["CAPABILITY"] = capability;
 		LLNotificationsUtil::add("RegionCapabilityRequestError", args);
+		// BAP HACK avoid being blocked by broken server side stuff
+		mHasUploadPerm = true;
 	}
 }
-- 
cgit v1.2.3


From e4b12b83e8721e0856af0305f6cee46cd6092024 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Wed, 29 Jun 2011 22:03:29 +0300
Subject: SH-1725 WIP Added upload permissions and fee requests to Upload Model
 Wizard. - Enabled warning for users without upload permissions. - Enabled
 "Calculate weights & fee" button. - Temporarily enabled to upload meshes if
 upload permission capability request has failed.

---
 indra/newview/llfloatermodelpreview.cpp            |  6 +--
 indra/newview/llfloatermodelpreview.h              |  4 +-
 indra/newview/llfloatermodelwizard.cpp             | 59 ++++++++++++++++++----
 indra/newview/llfloatermodelwizard.h               |  9 +++-
 indra/newview/llmeshrepository.cpp                 |  8 ++-
 indra/newview/lluploadfloaterobservers.cpp         |  4 +-
 indra/newview/lluploadfloaterobservers.h           |  4 +-
 .../skins/default/xui/en/floater_model_wizard.xml  |  2 +-
 8 files changed, 74 insertions(+), 22 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 00cc81c5d6..9b61124208 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -5491,7 +5491,7 @@ void LLFloaterModelPreview::DecompRequest::completed()
 
 void dump_llsd_to_file(const LLSD& content, std::string filename);
 
-void LLFloaterModelPreview::onPermReceived(const LLSD& result)
+void LLFloaterModelPreview::onPermissionsReceived(const LLSD& result)
 {
 	dump_llsd_to_file(result,"perm_received.xml");
 	std::string upload_status = result["mesh_upload_status"].asString();
@@ -5503,9 +5503,9 @@ void LLFloaterModelPreview::onPermReceived(const LLSD& result)
 	getChild<LLTextBox>("warning_message")->setVisible(!mHasUploadPerm);
 }
 
-void LLFloaterModelPreview::setPermErrorStatus(U32 status, const std::string& reason)
+void LLFloaterModelPreview::setPermissonsErrorStatus(U32 status, const std::string& reason)
 {
-	llwarns << "LLFloaterModelPreview::setPermErrors(" << status << " : " << reason << ")" << llendl;
+	llwarns << "LLFloaterModelPreview::setPermissonsErrorStatus(" << status << " : " << reason << ")" << llendl;
 
 	LLNotificationsUtil::add("MeshUploadPermError");
 }
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index 62878812c3..6d5e46d9e4 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -197,10 +197,10 @@ public:
 	void disableViewOption(const std::string& option);
 
 	// shows warning message if agent has no permissions to upload model
-	/*virtual*/ void onPermReceived(const LLSD& result);
+	/*virtual*/ void onPermissionsReceived(const LLSD& result);
 
 	// called when error occurs during permissions request
-	/*virtual*/ void setPermErrorStatus(U32 status, const std::string& reason);
+	/*virtual*/ void setPermissonsErrorStatus(U32 status, const std::string& reason);
 
 	/*virtual*/ void onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url);
 
diff --git a/indra/newview/llfloatermodelwizard.cpp b/indra/newview/llfloatermodelwizard.cpp
index 3c0ce96864..4482d02ca3 100644
--- a/indra/newview/llfloatermodelwizard.cpp
+++ b/indra/newview/llfloatermodelwizard.cpp
@@ -162,6 +162,8 @@ void LLFloaterModelWizard::setState(int state)
 		getChildView("cancel")->setVisible(true);
 		mCalculateWeightsBtn->setVisible(false);
 		mCalculatingWeightsBtn->setVisible(false);
+
+		getChildView("upload")->setEnabled(mHasUploadPerm);
 	}
 
 	if (state == UPLOAD)
@@ -264,6 +266,21 @@ void LLFloaterModelWizard::onClickRecalculatePhysics()
 	executePhysicsStage("Decompose");
 }
 
+void LLFloaterModelWizard::onClickCalculateUploadFee()
+{
+	swap_controls(mCalculateWeightsBtn, mCalculatingWeightsBtn, false);
+
+	mModelPreview->rebuildUploadData();
+
+	mUploadModelUrl.clear();
+	LLMeshUploadThread* thread = new LLMeshUploadThread(mModelPreview->mUploadData, mModelPreview->mPreviewScale,
+			true, false, false, mUploadModelUrl, false);
+
+	thread->setObserverHandle(getWholeModelFeeObserverHandle());
+
+	gMeshRepo.mUploadWaitList.push_back(thread);
+}
+
 void LLFloaterModelWizard::loadModel()
 {
 	 mModelPreview->mLoading = TRUE;
@@ -460,13 +477,42 @@ void LLFloaterModelWizard::initDecompControls()
 	mDecompParams["Simplify Method"] = 0; // set it to retain %
 }
 
-void LLFloaterModelWizard::onPermReceived(const LLSD& result)
+/*virtual*/
+void LLFloaterModelWizard::onPermissionsReceived(const LLSD& result)
+{
+	std::string upload_status = result["mesh_upload_status"].asString();
+	mHasUploadPerm = "valid" == upload_status;
+
+	getChildView("upload")->setEnabled(mHasUploadPerm);
+	getChildView("warning_label")->setVisible(mHasUploadPerm);
+	getChildView("warning_text")->setVisible(mHasUploadPerm);
+}
+
+/*virtual*/
+void LLFloaterModelWizard::setPermissonsErrorStatus(U32 status, const std::string& reason)
 {
+	llwarns << "LLFloaterModelWizard::setPermissonsErrorStatus(" << status << " : " << reason << ")" << llendl;
 }
 
-void LLFloaterModelWizard::setPermErrorStatus(U32 status, const std::string& reason)
+/*virtual*/
+void LLFloaterModelWizard::onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url)
 {
-	llwarns << "LLFloaterModelWizard::setPermErrors(" << status << " : " << reason << ")" << llendl;
+	swap_controls(mCalculateWeightsBtn, mCalculatingWeightsBtn, true);
+
+	mUploadModelUrl = upload_url;
+
+	childSetTextArg("review_fee", "[FEE]", llformat("%d", fee));
+	childSetTextArg("charged_fee", "[FEE]", llformat("%d", fee));
+
+	setState(llmin((int) UPLOAD, mState+1));
+}
+
+/*virtual*/
+void LLFloaterModelWizard::setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason)
+{
+	swap_controls(mCalculateWeightsBtn, mCalculatingWeightsBtn, true);
+
+	llwarns << "LLFloaterModelWizard::setModelPhysicsFeeErrorStatus(" << status << " : " << reason << ")" << llendl;
 }
 
 //static
@@ -573,8 +619,7 @@ BOOL LLFloaterModelWizard::postBuild()
 	mRecalculatingPhysicsBtn = getChild<LLButton>("recalculating_physics_btn");
 
 	mCalculateWeightsBtn = getChild<LLButton>("calculate");
-	// *TODO: Change the callback to upload fee request.
-	mCalculateWeightsBtn->setCommitCallback(boost::bind(&LLFloaterModelWizard::onClickNext, this));
+	mCalculateWeightsBtn->setCommitCallback(boost::bind(&LLFloaterModelWizard::onClickCalculateUploadFee, this));
 
 	mCalculatingWeightsBtn = getChild<LLButton>("calculating");
 
@@ -622,10 +667,6 @@ void LLFloaterModelWizard::setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F
 	}
 
 	childSetTextArg("review_prim_equiv", "[EQUIV]", llformat("%d", mModelPreview->mResourceCost));
-
-	// *TODO: Get the actual upload fee.
-	childSetTextArg("review_fee", "[FEE]", llformat("%d", 0));
-	childSetTextArg("charged_fee", "[FEE]", llformat("%d", 0));
 }
 
 void LLFloaterModelWizard::modelLoadedCallback()
diff --git a/indra/newview/llfloatermodelwizard.h b/indra/newview/llfloatermodelwizard.h
index 9930e0c4e6..0b6ee451e1 100644
--- a/indra/newview/llfloatermodelwizard.h
+++ b/indra/newview/llfloatermodelwizard.h
@@ -72,10 +72,14 @@ public:
 	void initDecompControls();
 	
 	// shows warning message if agent has no permissions to upload model
-	void onPermReceived(const LLSD& result);
+	/*virtual*/ void onPermissionsReceived(const LLSD& result);
 
 	// called when error occurs during permissions request
-	void setPermErrorStatus(U32 status, const std::string& reason);
+	/*virtual*/ void setPermissonsErrorStatus(U32 status, const std::string& reason);
+
+	/*virtual*/ void onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url);
+
+	/*virtual*/ void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason);
 
 	const LLRect& getPreviewRect() const { return mPreviewRect; }
 
@@ -99,6 +103,7 @@ private:
 	void onClickSwitchToAdvanced();
 	void onClickRecalculateGeometry();
 	void onClickRecalculatePhysics();
+	void onClickCalculateUploadFee();
 	void onClickCancel();
 	void onClickBack();
 	void onClickNext();
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 743a8d53ed..31c2d34b8d 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -577,13 +577,14 @@ public:
 		mThread->mPendingUploads--;
 		dump_llsd_to_file(cc,make_dump_name("whole_model_fee_response_",dump_num));
 
+		LLWholeModelFeeObserver* observer = mObserverHandle.get();
+
 		if (isGoodStatus(status) &&
 			cc["state"].asString() == "upload")
 		{
 			llinfos << "fee request succeeded" << llendl;
 			mThread->mWholeModelUploadURL = cc["uploader"].asString();
 
-			LLWholeModelFeeObserver* observer = mObserverHandle.get();
 			if (observer)
 			{
 				S32 fee = cc["upload_price"].asInteger();
@@ -597,6 +598,11 @@ public:
 			llwarns << "fee request failed" << llendl;
 			log_upload_error(status,cc,"fee",mModelData["name"]);
 			mThread->mWholeModelUploadURL = "";
+
+			if (observer)
+			{
+				observer->setModelPhysicsFeeErrorStatus(status, reason);
+			}
 		}
 	}
 
diff --git a/indra/newview/lluploadfloaterobservers.cpp b/indra/newview/lluploadfloaterobservers.cpp
index 2d418ee00d..5a6a17fbca 100644
--- a/indra/newview/lluploadfloaterobservers.cpp
+++ b/indra/newview/lluploadfloaterobservers.cpp
@@ -41,7 +41,7 @@ void LLUploadModelPremissionsResponder::error(U32 status, const std::string& rea
 
 	if (observer)
 	{
-		observer->setPermErrorStatus(status, reason);
+		observer->setPermissonsErrorStatus(status, reason);
 	}
 }
 
@@ -51,6 +51,6 @@ void LLUploadModelPremissionsResponder::result(const LLSD& content)
 
 	if (observer)
 	{
-		observer->onPermReceived(content);
+		observer->onPermissionsReceived(content);
 	}
 }
diff --git a/indra/newview/lluploadfloaterobservers.h b/indra/newview/lluploadfloaterobservers.h
index f27687e12e..23206549e7 100644
--- a/indra/newview/lluploadfloaterobservers.h
+++ b/indra/newview/lluploadfloaterobservers.h
@@ -38,8 +38,8 @@ public:
 	LLUploadPermissionsObserver(){mUploadPermObserverHandle.bind(this);}
 	virtual ~LLUploadPermissionsObserver() {}
 
-	virtual void onPermReceived(const LLSD& result) = 0;
-	virtual void setPermErrorStatus(U32 status, const std::string& reason) = 0;
+	virtual void onPermissionsReceived(const LLSD& result) = 0;
+	virtual void setPermissonsErrorStatus(U32 status, const std::string& reason) = 0;
 
 	LLHandle<LLUploadPermissionsObserver> getPermObserverHandle() const {return mUploadPermObserverHandle;}
 
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 9f7c79ada4..89736363b9 100644
--- a/indra/newview/skins/default/xui/en/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_wizard.xml
@@ -126,7 +126,7 @@
 			</text>
 		</panel>
 		<panel
-		 top="14"
+		 top_pad="14"
 		 left="15"
 		 height="310"
 		 width="505"
-- 
cgit v1.2.3


From baaa3822c758b8dfc2672bd8cda64aa61ac54716 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Wed, 29 Jun 2011 18:39:37 -0400
Subject: SH-1726 WIP - prevent upload until sucessful fee request

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

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 9b61124208..cfb413491d 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -577,6 +577,7 @@ void LLFloaterModelPreview::onClickCalculateBtn()
 	gMeshRepo.mUploadWaitList.push_back(thread);
 
 	toggleCalculateButton(false);
+	mUploadBtn->setEnabled(false);
 }
 
 //static
@@ -750,7 +751,7 @@ void LLFloaterModelPreview::draw()
 		}
 	}
 
-	childSetEnabled("ok_btn", mHasUploadPerm);
+	childSetEnabled("ok_btn", mHasUploadPerm && !mUploadModelUrl.empty());
 
 	childSetTextArg("prim_cost", "[PRIM_COST]", llformat("%d", mModelPreview->mResourceCost));
 	childSetTextArg("description_label", "[TEXTURES]", llformat("%d", mModelPreview->mTextureSet.size()));
@@ -5425,7 +5426,8 @@ void LLFloaterModelPreview::toggleCalculateButton(bool visible)
 {
 	mCalculateBtn->setVisible(visible);
 	mUploadBtn->setVisible(!visible);
-	mUploadBtn->setEnabled(mHasUploadPerm);
+	//mUploadBtn->setEnabled(mHasUploadPerm);
+	mUploadBtn->setEnabled(mHasUploadPerm && !mUploadModelUrl.empty());
 
 	if (visible)
 	{
@@ -5442,6 +5444,7 @@ void LLFloaterModelPreview::onModelPhysicsFeeReceived(F64 physics, S32 fee, std:
 	childSetTextArg("weights", "[PH]", llformat("%.3f", physics));
 	childSetTextArg("weights", "[FEE]", llformat("%d", fee));
 	childSetVisible("weights", true);
+	mUploadBtn->setEnabled(mHasUploadPerm && !mUploadModelUrl.empty());
 }
 
 void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason)
@@ -5498,7 +5501,8 @@ void LLFloaterModelPreview::onPermissionsReceived(const LLSD& result)
 	// BAP HACK: handle "" for case that  MeshUploadFlag cap is broken.
 	mHasUploadPerm = (("" == upload_status) || ("valid" == upload_status));
 
-	mUploadBtn->setEnabled(mHasUploadPerm);
+	//mUploadBtn->setEnabled(mHasUploadPerm);
+	mUploadBtn->setEnabled(mHasUploadPerm && !mUploadModelUrl.empty());
 	getChild<LLTextBox>("warning_title")->setVisible(!mHasUploadPerm);
 	getChild<LLTextBox>("warning_message")->setVisible(!mHasUploadPerm);
 }
-- 
cgit v1.2.3


From 6baafbd549d7a0bddacb5a30b7d9336c5afbcbaf Mon Sep 17 00:00:00 2001
From: seth_productengine <none@none>
Date: Thu, 30 Jun 2011 15:01:47 +0300
Subject: SH-1725 WIP Fixed displaying upload permissions warning

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

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelwizard.cpp b/indra/newview/llfloatermodelwizard.cpp
index 4482d02ca3..a3db22dbc6 100644
--- a/indra/newview/llfloatermodelwizard.cpp
+++ b/indra/newview/llfloatermodelwizard.cpp
@@ -481,11 +481,12 @@ void LLFloaterModelWizard::initDecompControls()
 void LLFloaterModelWizard::onPermissionsReceived(const LLSD& result)
 {
 	std::string upload_status = result["mesh_upload_status"].asString();
-	mHasUploadPerm = "valid" == upload_status;
+	// BAP HACK: handle "" for case that  MeshUploadFlag cap is broken.
+	mHasUploadPerm = (("" == upload_status) || ("valid" == upload_status));
 
 	getChildView("upload")->setEnabled(mHasUploadPerm);
-	getChildView("warning_label")->setVisible(mHasUploadPerm);
-	getChildView("warning_text")->setVisible(mHasUploadPerm);
+	getChildView("warning_label")->setVisible(!mHasUploadPerm);
+	getChildView("warning_text")->setVisible(!mHasUploadPerm);
 }
 
 /*virtual*/
-- 
cgit v1.2.3


From c7bbe8e63149af214175bffcf4d3710654584c1d Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Thu, 30 Jun 2011 15:38:58 +0300
Subject: SH-1726 ADDITIONAL FIX (Viewer modifications to advanced model upload
 to accomodate upload fee & prim equivilancy)

- Added a signal on model change to initiate recalculating (calculate phys&fee button is shown again)

- Show 'calculate phys&fee' button on fee request error
---
 indra/newview/llfloatermodelpreview.cpp  | 13 +++++--------
 indra/newview/llfloatermodelpreview.h    |  3 +++
 indra/newview/llfloatermodeluploadbase.h | 14 +++++++-------
 indra/newview/lluploadfloaterobservers.h |  6 +++---
 4 files changed, 18 insertions(+), 18 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index cfb413491d..5a1cd9091a 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -445,6 +445,7 @@ BOOL LLFloaterModelPreview::postBuild()
 	mModelPreview = new LLModelPreview(512, 512, this );
 	mModelPreview->setPreviewTarget(16.f);
 	mModelPreview->setDetailsCallback(boost::bind(&LLFloaterModelPreview::setDetails, this, _1, _2, _3, _4, _5));
+	mModelPreview->setModelUpdatedCallback(boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this, _1));
 
 	//set callbacks for left click on line editor rows
 	for (U32 i = 0; i <= LLModel::LOD_HIGH; i++)
@@ -561,8 +562,6 @@ void LLFloaterModelPreview::loadModel(S32 lod, const std::string& file_name)
 
 void LLFloaterModelPreview::onClickCalculateBtn()
 {
-	childSetTextArg("weights", "[EQ]", llformat("%d", mModelPreview->mResourceCost));
-
 	mModelPreview->rebuildUploadData();
 
 	bool upload_skinweights = childGetValue("upload_skin").asBoolean();
@@ -654,9 +653,6 @@ void LLFloaterModelPreview::onUploadSkinCommit(LLUICtrl*,void* userdata)
 	{
 		return;
 	}
-	
-	fp->toggleCalculateButton(true);
-
 	fp->mModelPreview->refresh();
 	fp->mModelPreview->resetPreviewTarget();
 	fp->mModelPreview->clearBuffers();
@@ -686,7 +682,6 @@ void LLFloaterModelPreview::onGenerateNormalsCommit(LLUICtrl* ctrl, void* userda
 {
 	LLFloaterModelPreview* fp = (LLFloaterModelPreview*) userdata;
 
-	fp->toggleCalculateButton(true);
 	fp->mModelPreview->generateNormals();
 }
 
@@ -711,7 +706,6 @@ void LLFloaterModelPreview::onLODParamCommit(LLUICtrl* ctrl, void* userdata)
 {
 	LLFloaterModelPreview* fp = (LLFloaterModelPreview*) userdata;
 
-	fp->toggleCalculateButton(true);
 	fp->mModelPreview->onLODParamCommit(false);
 }
 
@@ -719,7 +713,6 @@ void LLFloaterModelPreview::onLODParamCommit(LLUICtrl* ctrl, void* userdata)
 void LLFloaterModelPreview::onLODParamCommitTriangleLimit(LLUICtrl* ctrl, void* userdata)
 {
 	LLFloaterModelPreview* fp = (LLFloaterModelPreview*) userdata;
-	fp->toggleCalculateButton(true);
 	fp->mModelPreview->onLODParamCommit(true);
 }
 
@@ -4473,6 +4466,8 @@ void LLModelPreview::updateStatusMessages()
 		crease->forceSetValue(mRequestedCreaseAngle[mPreviewLOD]);
 	}
 
+	mModelUpdatedSignal(true);
+
 }
 
 void LLModelPreview::setPreviewTarget(F32 distance)
@@ -5441,6 +5436,7 @@ void LLFloaterModelPreview::toggleCalculateButton(bool visible)
 void LLFloaterModelPreview::onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url)
 {
 	mUploadModelUrl = upload_url;
+	childSetTextArg("weights", "[EQ]", llformat("%d", mModelPreview->mResourceCost));
 	childSetTextArg("weights", "[PH]", llformat("%.3f", physics));
 	childSetTextArg("weights", "[FEE]", llformat("%d", fee));
 	childSetVisible("weights", true);
@@ -5449,6 +5445,7 @@ void LLFloaterModelPreview::onModelPhysicsFeeReceived(F64 physics, S32 fee, std:
 
 void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason)
 {
+	toggleCalculateButton(true);
 	llwarns << "LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(" << status << " : " << reason << ")" << llendl;
 }
 
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index 6d5e46d9e4..7f27da4699 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -297,6 +297,7 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex
 {	
 	typedef boost::signals2::signal<void (F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost)> details_signal_t;
 	typedef boost::signals2::signal<void (void)> model_loaded_signal_t;
+	typedef boost::signals2::signal<void (bool)> model_updated_signal_t;
 
 public:
 	LLModelPreview(S32 width, S32 height, LLFloater* fmp);
@@ -356,6 +357,7 @@ public:
 	
 	boost::signals2::connection setDetailsCallback( const details_signal_t::slot_type& cb ){  return mDetailsSignal.connect(cb);  }
 	boost::signals2::connection setModelLoadedCallback( const model_loaded_signal_t::slot_type& cb ){  return mModelLoadedSignal.connect(cb);  }
+	boost::signals2::connection setModelUpdatedCallback( const model_updated_signal_t::slot_type& cb ){  return mModelUpdatedSignal.connect(cb);  }
 	
 	void setLoadState( U32 state ) { mLoadState = state; }
 	U32 getLoadState() { return mLoadState; }
@@ -441,6 +443,7 @@ private:
 
 	details_signal_t mDetailsSignal;
 	model_loaded_signal_t mModelLoadedSignal;
+	model_updated_signal_t mModelUpdatedSignal;
 	
 	LLVector3	mModelPivot;
 	bool		mHasPivot;
diff --git a/indra/newview/llfloatermodeluploadbase.h b/indra/newview/llfloatermodeluploadbase.h
index a4e300563d..bb5e710273 100644
--- a/indra/newview/llfloatermodeluploadbase.h
+++ b/indra/newview/llfloatermodeluploadbase.h
@@ -24,8 +24,8 @@
  * $/LicenseInfo$
  */
 
-#ifndef LLFLOATERMODELUPLOADBASE_H_
-#define LLFLOATERMODELUPLOADBASE_H_
+#ifndef LL_LLFLOATERMODELUPLOADBASE_H
+#define LL_LLFLOATERMODELUPLOADBASE_H
 
 #include "lluploadfloaterobservers.h"
 
@@ -37,13 +37,13 @@ public:
 
 	virtual ~LLFloaterModelUploadBase(){};
 
-	virtual void setPermissonsErrorStatus(U32 status, const std::string& reason){};
+	virtual void setPermissonsErrorStatus(U32 status, const std::string& reason) = 0;
 
-	virtual void onPermissionsReceived(const LLSD& result){};
+	virtual void onPermissionsReceived(const LLSD& result) = 0;
 
-	virtual void onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url){};
+	virtual void onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url) = 0;
 
-	virtual void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason){};
+	virtual void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason) = 0;
 
 protected:
 
@@ -54,4 +54,4 @@ protected:
 	bool mHasUploadPerm;
 };
 
-#endif /* LLFLOATERMODELUPLOADBASE_H_ */
+#endif /* LL_LLFLOATERMODELUPLOADBASE_H */
diff --git a/indra/newview/lluploadfloaterobservers.h b/indra/newview/lluploadfloaterobservers.h
index 23206549e7..fb4be72378 100644
--- a/indra/newview/lluploadfloaterobservers.h
+++ b/indra/newview/lluploadfloaterobservers.h
@@ -24,8 +24,8 @@
  * $/LicenseInfo$
  */
 
-#ifndef LLUPLOADFLOATEROBSERVERS_H_
-#define LLUPLOADFLOATEROBSERVERS_H_
+#ifndef LL_LLUPLOADFLOATEROBSERVERS_H
+#define LL_LLUPLOADFLOATEROBSERVERS_H
 
 #include "llfloater.h"
 #include "llhttpclient.h"
@@ -76,4 +76,4 @@ private:
 	LLHandle<LLUploadPermissionsObserver> mObserverHandle;
 };
 
-#endif /* LLUPLOADFLOATEROBSERVERS_H_ */
+#endif /* LL_LLUPLOADFLOATEROBSERVERS_H */
-- 
cgit v1.2.3


From 93d6c921c9ca45241983096a4eb8b199c347d59c Mon Sep 17 00:00:00 2001
From: seth_productengine <none@none>
Date: Thu, 30 Jun 2011 16:37:43 +0300
Subject: SH-1725 WIP Fixed "Upload" button to be enabled only after
 recalculating the upload fee and weight.

---
 indra/newview/llfloatermodelwizard.cpp             | 25 +++++++++++++++++++---
 indra/newview/llfloatermodelwizard.h               |  1 +
 .../skins/default/xui/en/floater_model_wizard.xml  |  1 +
 3 files changed, 24 insertions(+), 3 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelwizard.cpp b/indra/newview/llfloatermodelwizard.cpp
index a3db22dbc6..f0e4e99d82 100644
--- a/indra/newview/llfloatermodelwizard.cpp
+++ b/indra/newview/llfloatermodelwizard.cpp
@@ -162,8 +162,6 @@ void LLFloaterModelWizard::setState(int state)
 		getChildView("cancel")->setVisible(true);
 		mCalculateWeightsBtn->setVisible(false);
 		mCalculatingWeightsBtn->setVisible(false);
-
-		getChildView("upload")->setEnabled(mHasUploadPerm);
 	}
 
 	if (state == UPLOAD)
@@ -484,7 +482,6 @@ void LLFloaterModelWizard::onPermissionsReceived(const LLSD& result)
 	// BAP HACK: handle "" for case that  MeshUploadFlag cap is broken.
 	mHasUploadPerm = (("" == upload_status) || ("valid" == upload_status));
 
-	getChildView("upload")->setEnabled(mHasUploadPerm);
 	getChildView("warning_label")->setVisible(!mHasUploadPerm);
 	getChildView("warning_text")->setVisible(!mHasUploadPerm);
 }
@@ -500,6 +497,10 @@ void LLFloaterModelWizard::onModelPhysicsFeeReceived(F64 physics, S32 fee, std::
 {
 	swap_controls(mCalculateWeightsBtn, mCalculatingWeightsBtn, true);
 
+	// Enable the "Upload" buton if we have calculated the upload fee
+	// and have the permission to upload.
+	getChildView("upload")->setEnabled(mHasUploadPerm);
+
 	mUploadModelUrl = upload_url;
 
 	childSetTextArg("review_fee", "[FEE]", llformat("%d", fee));
@@ -513,6 +514,9 @@ void LLFloaterModelWizard::setModelPhysicsFeeErrorStatus(U32 status, const std::
 {
 	swap_controls(mCalculateWeightsBtn, mCalculatingWeightsBtn, true);
 
+	// Disable the "Review" step if it has been previously enabled.
+	modelChangedCallback();
+
 	llwarns << "LLFloaterModelWizard::setModelPhysicsFeeErrorStatus(" << status << " : " << reason << ")" << llendl;
 }
 
@@ -637,6 +641,7 @@ BOOL LLFloaterModelWizard::postBuild()
 	mModelPreview->setPreviewTarget(16.f);
 	mModelPreview->setDetailsCallback(boost::bind(&LLFloaterModelWizard::setDetails, this, _1, _2, _3, _4, _5));
 	mModelPreview->setModelLoadedCallback(boost::bind(&LLFloaterModelWizard::modelLoadedCallback, this));
+	mModelPreview->setModelUpdatedCallback(boost::bind(&LLFloaterModelWizard::modelChangedCallback, this));
 	mModelPreview->mViewOption["show_textures"] = true;
 
 	center();
@@ -676,6 +681,20 @@ void LLFloaterModelWizard::modelLoadedCallback()
 	updateButtons();
 }
 
+void LLFloaterModelWizard::modelChangedCallback()
+{
+	// Don't allow to proceed to the "Review" step if the model has changed
+	// but the new upload fee hasn't been calculated yet.
+	if (mLastEnabledState > PHYSICS)
+	{
+		 mLastEnabledState = PHYSICS;
+	}
+
+	getChildView("upload")->setEnabled(false);
+
+	updateButtons();
+}
+
 void LLFloaterModelWizard::onUpload()
 {	
 	mModelPreview->rebuildUploadData();
diff --git a/indra/newview/llfloatermodelwizard.h b/indra/newview/llfloatermodelwizard.h
index 0b6ee451e1..6821e8b908 100644
--- a/indra/newview/llfloatermodelwizard.h
+++ b/indra/newview/llfloatermodelwizard.h
@@ -69,6 +69,7 @@ public:
 
 	void setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost);
 	void modelLoadedCallback();
+	void modelChangedCallback();
 	void initDecompControls();
 	
 	// shows warning message if agent has no permissions to upload model
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 89736363b9..9e1bd9c349 100644
--- a/indra/newview/skins/default/xui/en/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_wizard.xml
@@ -792,6 +792,7 @@ Buildings</text>
 	 name="calculating"
 	 label="Calculating... " />
 	<button
+	 enabled="false"
 	 top_delta="0"
 	 right="-150"
 	 width="90"
-- 
cgit v1.2.3


From 87458cd714cd5b12057b8f61dfc8000df176458f Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Thu, 30 Jun 2011 19:12:27 +0300
Subject: SH-1725 WIP Fixed model wizard making multiple calls to upload
 permissions check. Fixed truncated warning text.

---
 indra/newview/llfloatermodelwizard.cpp                      | 8 ++------
 indra/newview/llfloatermodelwizard.h                        | 2 --
 indra/newview/skins/default/xui/en/floater_model_wizard.xml | 4 ++--
 3 files changed, 4 insertions(+), 10 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelwizard.cpp b/indra/newview/llfloatermodelwizard.cpp
index f0e4e99d82..254c54ad2a 100644
--- a/indra/newview/llfloatermodelwizard.cpp
+++ b/indra/newview/llfloatermodelwizard.cpp
@@ -412,12 +412,6 @@ BOOL LLFloaterModelWizard::handleScrollWheel(S32 x, S32 y, S32 clicks)
 }
 
 
-/*virtual*/
-void LLFloaterModelWizard::onOpen(const LLSD& key)
-{
-	requestAgentUploadPermissions();
-}
-
 void LLFloaterModelWizard::initDecompControls()
 {
 	LLSD key;
@@ -654,6 +648,8 @@ BOOL LLFloaterModelWizard::postBuild()
 
 	initDecompControls();
 
+	requestAgentUploadPermissions();
+
 	return TRUE;
 }
 
diff --git a/indra/newview/llfloatermodelwizard.h b/indra/newview/llfloatermodelwizard.h
index 6821e8b908..7057189f86 100644
--- a/indra/newview/llfloatermodelwizard.h
+++ b/indra/newview/llfloatermodelwizard.h
@@ -65,8 +65,6 @@ public:
 	BOOL handleHover(S32 x, S32 y, MASK mask);
 	BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
 
-	/*virtual*/ void onOpen(const LLSD& key);
-
 	void setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost);
 	void modelLoadedCallback();
 	void modelChangedCallback();
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 9e1bd9c349..b5a5ff5342 100644
--- a/indra/newview/skins/default/xui/en/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_wizard.xml
@@ -264,14 +264,14 @@
                 WARNING:
             </text>
             <text
-             height="40"
+             height="50"
              left="10"
              name="warning_text"
              top_pad="0"
              visible="false"
              width="320"
              word_wrap="true">
-                You will not be able to complete the final step of uploading this model to the Second Life servers. [secondlife:///app/floater/learn_more Find out how] to set up y
+                You will not be able to complete the final step of uploading this model to the Second Life servers. [secondlife:///app/floater/learn_more Find out how] to set up your account for mesh model uploads. 
             </text>
 		</panel>
 	</panel>
-- 
cgit v1.2.3


From 06b1202747c07409c877cb89432f0df0bfacba47 Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Thu, 30 Jun 2011 19:58:27 +0300
Subject: - SH-1726 ADDITIONAL FIX (Viewer modifications to advanced model
 upload to accommodate upload fee & prim equivalency)  added the link for
 "Find out how" in warning text of advanced upload floater  advanced upload,
 button returns to "get fees" whenever any option that affects price changes

---
 indra/newview/llfloatermodelpreview.cpp                      | 9 +++++++++
 indra/newview/llfloatermodelpreview.h                        | 1 +
 indra/newview/skins/default/xui/en/floater_model_preview.xml | 2 +-
 3 files changed, 11 insertions(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 5a1cd9091a..7587cf0459 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -397,6 +397,10 @@ BOOL LLFloaterModelPreview::postBuild()
 	childSetCommitCallback("border_mode", onLODParamCommit, this);
 	childSetCommitCallback("share_tolerance", onLODParamCommit, this);
 
+	childSetCommitCallback("upload_skin", boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this), NULL);
+	childSetCommitCallback("upload_joints", boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this), NULL);
+	childSetCommitCallback("upload_textures", boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this), NULL);
+
 	childSetTextArg("status", "[STATUS]", getString("status_idle"));
 
 	//childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d",sUploadAmount));
@@ -5417,6 +5421,11 @@ void LLFloaterModelPreview::setStatusMessage(const std::string& msg)
 	mStatusMessage = msg;
 }
 
+void LLFloaterModelPreview::toggleCalculateButton()
+{
+	toggleCalculateButton(true);
+}
+
 void LLFloaterModelPreview::toggleCalculateButton(bool visible)
 {
 	mCalculateBtn->setVisible(visible);
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index 7f27da4699..eccc9ce1b6 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -273,6 +273,7 @@ protected:
 
 private:
 	void onClickCalculateBtn();
+	void toggleCalculateButton();
 
 	// Toggles between "Calculate weights & fee" and "Upload" buttons.
 	void toggleCalculateButton(bool visible);
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 e5f60ea482..7f15de7236 100644
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -93,7 +93,7 @@
      top_pad="5"
      wrap="true"
      visible="false">
-     You will not be able to complete the final upload of this model to the Second Life servers. Find out how to get certifed for mesh model uploads.
+     You will not be able to complete the final upload of this model to the Second Life servers. [secondlife:///app/floater/learn_more Find out how] to get certifed for mesh model uploads.
     </text>
 
   <tab_container
-- 
cgit v1.2.3


From 17060f4e92b12ab74a1b570cd9ee4d1543fb23d1 Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Thu, 30 Jun 2011 15:55:19 -0400
Subject: SH-1332 Remaining mesh wizard upload work

adding observer classes for the upload step so we don't move to success state until upload succeeds.
---
 indra/newview/llfloatermodelpreview.cpp  |  2 +-
 indra/newview/llfloatermodeluploadbase.h |  6 +++++-
 indra/newview/llfloatermodelwizard.cpp   | 26 +++++++++++++++++++++-----
 indra/newview/llfloatermodelwizard.h     |  4 ++++
 indra/newview/llmeshrepository.cpp       | 23 +++++++++++++++++++----
 indra/newview/llmeshrepository.h         |  7 +++++--
 indra/newview/lluploadfloaterobservers.h | 18 ++++++++++++++++++
 7 files changed, 73 insertions(+), 13 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 9b61124208..38ccd0d682 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -572,7 +572,7 @@ void LLFloaterModelPreview::onClickCalculateBtn()
 	LLMeshUploadThread* thread = new LLMeshUploadThread(mModelPreview->mUploadData, mModelPreview->mPreviewScale,
 			childGetValue("upload_textures").asBoolean(), upload_skinweights, upload_joint_positions, mUploadModelUrl, false);
 
-	thread->setObserverHandle(getWholeModelFeeObserverHandle());
+	thread->setFeeObserverHandle(getWholeModelFeeObserverHandle());
 
 	gMeshRepo.mUploadWaitList.push_back(thread);
 
diff --git a/indra/newview/llfloatermodeluploadbase.h b/indra/newview/llfloatermodeluploadbase.h
index a4e300563d..5671eb1fd0 100644
--- a/indra/newview/llfloatermodeluploadbase.h
+++ b/indra/newview/llfloatermodeluploadbase.h
@@ -29,7 +29,7 @@
 
 #include "lluploadfloaterobservers.h"
 
-class LLFloaterModelUploadBase : public LLFloater, public LLUploadPermissionsObserver, public LLWholeModelFeeObserver
+class LLFloaterModelUploadBase : public LLFloater, public LLUploadPermissionsObserver, public LLWholeModelFeeObserver, public LLWholeModelUploadObserver
 {
 public:
 
@@ -45,6 +45,10 @@ public:
 
 	virtual void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason){};
 
+	virtual void onModelUploadSuccess() {};
+
+	virtual void onModelUploadFailure() {};
+
 protected:
 
 	// requests agent's permissions to upload model
diff --git a/indra/newview/llfloatermodelwizard.cpp b/indra/newview/llfloatermodelwizard.cpp
index 4482d02ca3..8cfd04e461 100644
--- a/indra/newview/llfloatermodelwizard.cpp
+++ b/indra/newview/llfloatermodelwizard.cpp
@@ -276,7 +276,7 @@ void LLFloaterModelWizard::onClickCalculateUploadFee()
 	LLMeshUploadThread* thread = new LLMeshUploadThread(mModelPreview->mUploadData, mModelPreview->mPreviewScale,
 			true, false, false, mUploadModelUrl, false);
 
-	thread->setObserverHandle(getWholeModelFeeObserverHandle());
+	thread->setFeeObserverHandle(getWholeModelFeeObserverHandle());
 
 	gMeshRepo.mUploadWaitList.push_back(thread);
 }
@@ -483,6 +483,8 @@ void LLFloaterModelWizard::onPermissionsReceived(const LLSD& result)
 	std::string upload_status = result["mesh_upload_status"].asString();
 	mHasUploadPerm = "valid" == upload_status;
 
+	mHasUploadPerm = true;
+
 	getChildView("upload")->setEnabled(mHasUploadPerm);
 	getChildView("warning_label")->setVisible(mHasUploadPerm);
 	getChildView("warning_text")->setVisible(mHasUploadPerm);
@@ -515,6 +517,19 @@ void LLFloaterModelWizard::setModelPhysicsFeeErrorStatus(U32 status, const std::
 	llwarns << "LLFloaterModelWizard::setModelPhysicsFeeErrorStatus(" << status << " : " << reason << ")" << llendl;
 }
 
+/*virtual*/ 
+void LLFloaterModelWizard::onModelUploadSuccess() 
+{
+	// success!
+	setState(UPLOAD);
+}
+
+/*virtual*/
+void LLFloaterModelWizard::onModelUploadFailure()
+{
+	
+}
+
 //static
 void LLFloaterModelWizard::executePhysicsStage(std::string stage_name)
 {
@@ -679,11 +694,12 @@ void LLFloaterModelWizard::onUpload()
 {	
 	mModelPreview->rebuildUploadData();
 	
-	gMeshRepo.uploadModel(mModelPreview->mUploadData, mModelPreview->mPreviewScale, 
+	LLMeshUploadThread* thread = new LLMeshUploadThread(mModelPreview->mUploadData, mModelPreview->mPreviewScale, 
 						  true, false, false, mUploadModelUrl, true);
-	
-	setState(UPLOAD);
-	
+
+	thread->setUploadObserverHandle(getWholeModelUploadObserverHandle());
+
+	gMeshRepo.mUploadWaitList.push_back(thread);
 }
 
 void LLFloaterModelWizard::onPreviewLODCommit(LLUICtrl* ctrl)
diff --git a/indra/newview/llfloatermodelwizard.h b/indra/newview/llfloatermodelwizard.h
index 0b6ee451e1..202463c992 100644
--- a/indra/newview/llfloatermodelwizard.h
+++ b/indra/newview/llfloatermodelwizard.h
@@ -81,6 +81,10 @@ public:
 
 	/*virtual*/ void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason);
 
+	/*virtual*/ void onModelUploadSuccess();
+
+	/*virtual*/ void onModelUploadFailure();
+
 	const LLRect& getPreviewRect() const { return mPreviewRect; }
 
 	LLPhysicsDecomp::decomp_params mDecompParams;
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 31c2d34b8d..ff6c33ac27 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -612,11 +612,13 @@ class LLWholeModelUploadResponder: public LLCurl::Responder
 {
 	LLMeshUploadThread* mThread;
 	LLSD mModelData;
+	LLHandle<LLWholeModelUploadObserver> mObserverHandle;
 	
 public:
-	LLWholeModelUploadResponder(LLMeshUploadThread* thread, LLSD& model_data):
+	LLWholeModelUploadResponder(LLMeshUploadThread* thread, LLSD& model_data, LLHandle<LLWholeModelUploadObserver> observer_handle):
 		mThread(thread),
-		mModelData(model_data)
+		mModelData(model_data),
+		mObserverHandle(observer_handle)
 	{
 	}
 	virtual void completed(U32 status,
@@ -633,6 +635,9 @@ public:
 		mThread->mPendingUploads--;
 		dump_llsd_to_file(cc,make_dump_name("whole_model_upload_response_",dump_num));
 		llinfos << "LLWholeModelUploadResponder content: " << cc << llendl;
+
+		LLWholeModelUploadObserver* observer = mObserverHandle.get();
+
 		// requested "mesh" asset type isn't actually the type
 		// of the resultant object, fix it up here.
 		if (isGoodStatus(status) &&
@@ -641,12 +646,22 @@ public:
 			llinfos << "upload succeeded" << llendl;
 			mModelData["asset_type"] = "object";
 			gMeshRepo.updateInventory(LLMeshRepository::inventory_data(mModelData,cc));
+
+			if (observer)
+			{
+				observer->onModelUploadSuccess();
+			}
 		}
 		else
 		{
 			llwarns << "upload failed" << llendl;
 			std::string model_name = mModelData["name"].asString();
 			log_upload_error(status,cc,"upload",model_name);
+
+			if (observer)
+			{
+				observer->onModelUploadFailure();
+			}
 		}
 	}
 };
@@ -1741,7 +1756,7 @@ void LLMeshUploadThread::doWholeModelUpload()
 		dump_llsd_to_file(body,make_dump_name("whole_model_body_",dump_num));
 		LLCurlRequest::headers_t headers;
 		mCurlRequest->post(mWholeModelUploadURL, headers, body,
-						   new LLWholeModelUploadResponder(this, full_model_data), mMeshUploadTimeOut);
+						   new LLWholeModelUploadResponder(this, full_model_data, mUploadObserverHandle), mMeshUploadTimeOut);
 		do
 		{
 			mCurlRequest->process();
@@ -1770,7 +1785,7 @@ void LLMeshUploadThread::requestWholeModelFee()
 	mPendingUploads++;
 	LLCurlRequest::headers_t headers;
 	mCurlRequest->post(mWholeModelFeeCapability, headers, model_data,
-					   new LLWholeModelFeeResponder(this,model_data, mObserverHandle), mMeshUploadTimeOut);
+					   new LLWholeModelFeeResponder(this,model_data, mFeeObserverHandle), mMeshUploadTimeOut);
 
 	do
 	{
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index 03993c6f2c..df342facc0 100644
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -447,10 +447,13 @@ public:
 							 LLQuaternion& result_rot,
 							 LLVector3& result_scale);
 
-	void setObserverHandle(LLHandle<LLWholeModelFeeObserver> observer_handle) { mObserverHandle = observer_handle; }
+	void setFeeObserverHandle(LLHandle<LLWholeModelFeeObserver> observer_handle) { mFeeObserverHandle = observer_handle; }
+	void setUploadObserverHandle(LLHandle<LLWholeModelUploadObserver> observer_handle) { mUploadObserverHandle = observer_handle; }
 
 private:
-	LLHandle<LLWholeModelFeeObserver> mObserverHandle;
+	LLHandle<LLWholeModelFeeObserver> mFeeObserverHandle;
+	LLHandle<LLWholeModelUploadObserver> mUploadObserverHandle;
+
 	bool mDoUpload; // if FALSE only model data will be requested, otherwise the model will be uploaded
 };
 
diff --git a/indra/newview/lluploadfloaterobservers.h b/indra/newview/lluploadfloaterobservers.h
index 23206549e7..9a38db837c 100644
--- a/indra/newview/lluploadfloaterobservers.h
+++ b/indra/newview/lluploadfloaterobservers.h
@@ -62,6 +62,24 @@ protected:
 	LLRootHandle<LLWholeModelFeeObserver> mWholeModelFeeObserverHandle;
 };
 
+
+class LLWholeModelUploadObserver
+{
+public:
+	LLWholeModelUploadObserver() { mWholeModelUploadObserverHandle.bind(this); }
+	virtual ~LLWholeModelUploadObserver() {}
+
+	virtual void onModelUploadSuccess() = 0;
+
+	virtual void onModelUploadFailure() = 0;
+
+	LLHandle<LLWholeModelUploadObserver> getWholeModelUploadObserverHandle() const { return mWholeModelUploadObserverHandle; }
+
+protected:
+	LLRootHandle<LLWholeModelUploadObserver> mWholeModelUploadObserverHandle;
+};
+
+
 class LLUploadModelPremissionsResponder : public LLHTTPClient::Responder
 {
 public:
-- 
cgit v1.2.3


From 38778fcc6186abe2c6f037f07191780f87dd8cd7 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 30 Jun 2011 18:19:09 -0500
Subject: SH-680 Update streaming cost to be based on a triangle budget instead
 of a magic scaler.

Reviewed by Nyx.
---
 indra/newview/app_settings/settings.xml | 37 ++++++++++++---
 indra/newview/llmeshrepository.cpp      | 80 ++++++++++++++++++---------------
 indra/newview/llsceneview.cpp           | 15 +++++--
 indra/newview/llviewerwindow.cpp        |  4 +-
 4 files changed, 88 insertions(+), 48 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 3c309f93bc..2372c19fb9 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -9145,28 +9145,51 @@
       <key>Value</key>
       <real>1.0</real>
     </map>
-  <key>MeshStreamingCostScaler</key>
+  <key>MeshTriangleBudget</key>
   <map>
     <key>Comment</key>
-    <string>DEBUG</string>
+    <string>Target visible triangle budget to use when estimating streaming cost.</string>
     <key>Persist</key>
     <integer>1</integer>
     <key>Type</key>
-    <string>F32</string>
+    <string>U32</string>
     <key>Value</key>
-    <real>2.0</real>
+    <real>250000</real>
   </map>
-  <key>MeshThreadCount</key>
+  <key>MeshMetaDataDiscount</key>
   <map>
     <key>Comment</key>
-    <string>Number of threads to use for loading meshes.</string>
+    <string>Number of bytes to deduct for metadata when determining streaming cost.</string>
     <key>Persist</key>
     <integer>1</integer>
     <key>Type</key>
     <string>U32</string>
     <key>Value</key>
-    <integer>8</integer>
+    <real>384</real>
   </map>
+  <key>MeshMinimumByteSize</key>
+  <map>
+    <key>Comment</key>
+    <string>Minimum number of bytes per LoD block when determining streaming cost.</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>U32</string>
+    <key>Value</key>
+    <real>16</real>
+  </map>
+  <key>MeshBytesPerTriangle</key>
+  <map>
+    <key>Comment</key>
+    <string>Approximation of bytes per triangle to use for determining mesh streaming cost.</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>U32</string>
+    <key>Value</key>
+    <real>16</real>
+  </map>
+
   <key>MeshMaxConcurrentRequests</key>
   <map>
     <key>Comment</key>
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 4da5da9493..be11c53efa 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -3185,58 +3185,66 @@ void LLMeshRepository::uploadError(LLSD& args)
 //static
 F32 LLMeshRepository::getStreamingCost(LLSD& header, F32 radius, S32* bytes, S32* bytes_visible, S32 lod)
 {
-	F32 dlowest = llmin(radius/0.03f, 256.f);
-	F32 dlow = llmin(radius/0.06f, 256.f);
-	F32 dmid = llmin(radius/0.24f, 256.f);
+	F32 max_distance = 512.f;
+
+	F32 dlowest = llmin(radius/0.03f, max_distance);
+	F32 dlow = llmin(radius/0.06f, max_distance);
+	F32 dmid = llmin(radius/0.24f, max_distance);
 	
-	F32 METADATA_DISCOUNT = 128.f;  //discount 128 bytes to cover the cost of LLSD tags and compression domain overhead
-	F32 MINIMUM_SIZE = 32.f; //make sure nothing is "free"
+	F32 METADATA_DISCOUNT = (F32) gSavedSettings.getU32("MeshMetaDataDiscount");  //discount 128 bytes to cover the cost of LLSD tags and compression domain overhead
+	F32 MINIMUM_SIZE = (F32) gSavedSettings.getU32("MeshMinimumByteSize"); //make sure nothing is "free"
 
-	F32 bytes_lowest = llmax((F32) header["lowest_lod"]["size"].asReal()-METADATA_DISCOUNT, MINIMUM_SIZE)/1024.f;
-	F32 bytes_low = llmax((F32) header["low_lod"]["size"].asReal()/-METADATA_DISCOUNT, MINIMUM_SIZE)/1024.f;
-	F32 bytes_mid = llmax((F32) header["medium_lod"]["size"].asReal()-METADATA_DISCOUNT, MINIMUM_SIZE)/1024.f;
-	F32 bytes_high = llmax((F32) header["high_lod"]["size"].asReal()-METADATA_DISCOUNT, MINIMUM_SIZE)/1024.f;
+	F32 bytes_per_triangle = (F32) gSavedSettings.getU32("MeshBytesPerTriangle");
 
-	if (bytes)
+	S32 bytes_lowest = header["lowest_lod"]["size"].asInteger();
+	S32 bytes_low = header["low_lod"]["size"].asInteger();
+	S32 bytes_mid = header["medium_lod"]["size"].asInteger();
+	S32 bytes_high = header["high_lod"]["size"].asInteger();
+
+	if (bytes_high == 0)
 	{
-		*bytes = 0;
-		*bytes += header["lowest_lod"]["size"].asInteger();
-		*bytes += header["low_lod"]["size"].asInteger();
-		*bytes += header["medium_lod"]["size"].asInteger();
-		*bytes += header["high_lod"]["size"].asInteger();
+		return 0.f;
 	}
 
-
-	if (bytes_visible)
+	if (bytes_mid == 0)
 	{
-		lod = LLMeshRepository::getActualMeshLOD(header, lod);
-		if (lod >= 0 && lod <= 3)
-		{
-			*bytes_visible = header[header_lod[lod]]["size"].asInteger();
-		}
+		bytes_mid = bytes_high;
 	}
 
-	if (bytes_high == 0.f)
+	if (bytes_low == 0)
 	{
-		return 0.f;
+		bytes_low = bytes_mid;
 	}
 
-	if (bytes_mid == 0.f)
+	if (bytes_lowest == 0)
 	{
-		bytes_mid = bytes_high;
+		bytes_lowest = bytes_low;
 	}
 
-	if (bytes_low == 0.f)
+	F32 triangles_lowest = llmax((F32) bytes_lowest-METADATA_DISCOUNT, MINIMUM_SIZE)/bytes_per_triangle;
+	F32 triangles_low = llmax((F32) bytes_low-METADATA_DISCOUNT, MINIMUM_SIZE)/bytes_per_triangle;
+	F32 triangles_mid = llmax((F32) bytes_mid-METADATA_DISCOUNT, MINIMUM_SIZE)/bytes_per_triangle;
+	F32 triangles_high = llmax((F32) bytes_high-METADATA_DISCOUNT, MINIMUM_SIZE)/bytes_per_triangle;
+
+	if (bytes)
 	{
-		bytes_low = bytes_mid;
+		*bytes = 0;
+		*bytes += header["lowest_lod"]["size"].asInteger();
+		*bytes += header["low_lod"]["size"].asInteger();
+		*bytes += header["medium_lod"]["size"].asInteger();
+		*bytes += header["high_lod"]["size"].asInteger();
 	}
 
-	if (bytes_lowest == 0.f)
+	if (bytes_visible)
 	{
-		bytes_lowest = bytes_low;
+		lod = LLMeshRepository::getActualMeshLOD(header, lod);
+		if (lod >= 0 && lod <= 3)
+		{
+			*bytes_visible = header[header_lod[lod]]["size"].asInteger();
+		}
 	}
 
-	F32 max_area = 65536.f;
+	F32 max_area = 102932.f; //area of circle that encompasses region
 	F32 min_area = 1.f;
 
 	F32 high_area = llmin(F_PI*dmid*dmid, max_area);
@@ -3259,12 +3267,12 @@ F32 LLMeshRepository::getStreamingCost(LLSD& header, F32 radius, S32* bytes, S32
 	low_area /= total_area;
 	lowest_area /= total_area;
 
-	F32 weighted_avg = bytes_high*high_area +
-					   bytes_mid*mid_area +
-					   bytes_low*low_area +
-					  bytes_lowest*lowest_area;
+	F32 weighted_avg = triangles_high*high_area +
+					   triangles_mid*mid_area +
+					   triangles_low*low_area +
+					  triangles_lowest*lowest_area;
 
-	return weighted_avg * gSavedSettings.getF32("MeshStreamingCostScaler");
+	return weighted_avg/gSavedSettings.getU32("MeshTriangleBudget")*15000.f;
 }
 
 
diff --git a/indra/newview/llsceneview.cpp b/indra/newview/llsceneview.cpp
index 8e8fc9dd25..09e799e4f7 100644
--- a/indra/newview/llsceneview.cpp
+++ b/indra/newview/llsceneview.cpp
@@ -83,6 +83,9 @@ void LLSceneView::draw()
 	S32 total_visible_triangles[] = {0, 0};
 	S32 total_triangles[] = {0, 0};
 	
+	S32 total_visible_bytes[] = {0, 0};
+	S32 total_bytes[] = {0, 0};
+
 	//streaming cost
 	std::vector<F32> streaming_cost[2];
 	F32 total_streaming[] = { 0.f, 0.f };
@@ -122,13 +125,19 @@ void LLSceneView::draw()
 				visible_triangles[idx].push_back(visible);
 				triangles[idx].push_back(high_triangles);
 
-				F32 streaming = object->getStreamingCost();
+				S32 bytes = 0;
+				S32 visible_bytes = 0;
+
+				F32 streaming = object->getStreamingCost(&bytes, &visible_bytes);
 				total_streaming[idx] += streaming;
 				streaming_cost[idx].push_back(streaming);
 
 				F32 physics = object->getPhysicsCost();
 				total_physics[idx] += physics;
 				physics_cost[idx].push_back(physics);
+
+				total_bytes[idx] += bytes;
+				total_visible_bytes[idx] += visible_bytes;
 			}
 		}
 	}
@@ -279,8 +288,8 @@ void LLSceneView::draw()
 				total_visible += tri_count;	
 			}
 
-			std::string label = llformat("%s Object Triangle Counts (Ktris) -- [%.2f, %.2f] Mean: %.2f  Median: %.2f  Visible: %.2f/%.2f",
-											category[idx], tri_domain[0]/1024.f, tri_domain[1]/1024.f, (total/count)/1024.f, triangles[idx][count/2]/1024.f, total_visible_triangles[idx]/1024.f, total_triangles[idx]/1024.f);
+			std::string label = llformat("%s Object Triangle Counts (Ktris) -- Visible: %.2f/%.2f (%.2f KB Visible)",
+				category[idx], total_visible_triangles[idx]/1024.f, total_triangles[idx]/1024.f, total_visible_bytes[idx]/1024.f);
 
 			LLFontGL::getFontMonospace()->renderUTF8(label,
 											0 , tri_rect.mLeft, tri_rect.mTop+margin, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP);
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 1dffb9e5e3..b2fd802ae7 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -528,8 +528,8 @@ public:
 				addText(xpos,ypos, llformat("%s streaming cost: %.1f", label, cost));
 				ypos += y_inc;
 
-				addText(xpos, ypos, llformat("    %.1f KTris, %.1f/%.1f KB, %d objects",
-										count/1024.f, visible_bytes/1024.f, total_bytes/1024.f, object_count));
+				addText(xpos, ypos, llformat("    %.3f KTris, %.1f/%.1f KB, %d objects",
+										count/1000.f, visible_bytes/1024.f, total_bytes/1024.f, object_count));
 				ypos += y_inc;
 			
 			}
-- 
cgit v1.2.3


From 51dcb8476df521da73e935ea0d7ea5ad3b08d288 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Fri, 1 Jul 2011 16:36:25 +0300
Subject: SH-1964 FIXED switching to "Review" wizard step upon fee request
 success and to "Physics" step upon failure. Fixed disabling the final wizard
 step upon upload failure.

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

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelwizard.cpp b/indra/newview/llfloatermodelwizard.cpp
index 71baa0fa76..ad264399d8 100644
--- a/indra/newview/llfloatermodelwizard.cpp
+++ b/indra/newview/llfloatermodelwizard.cpp
@@ -500,7 +500,7 @@ void LLFloaterModelWizard::onModelPhysicsFeeReceived(F64 physics, S32 fee, std::
 	childSetTextArg("review_fee", "[FEE]", llformat("%d", fee));
 	childSetTextArg("charged_fee", "[FEE]", llformat("%d", fee));
 
-	setState(llmin((int) UPLOAD, mState+1));
+	setState(REVIEW);
 }
 
 /*virtual*/
@@ -512,6 +512,8 @@ void LLFloaterModelWizard::setModelPhysicsFeeErrorStatus(U32 status, const std::
 	modelChangedCallback();
 
 	llwarns << "LLFloaterModelWizard::setModelPhysicsFeeErrorStatus(" << status << " : " << reason << ")" << llendl;
+
+	setState(PHYSICS);
 }
 
 /*virtual*/ 
@@ -524,7 +526,13 @@ void LLFloaterModelWizard::onModelUploadSuccess()
 /*virtual*/
 void LLFloaterModelWizard::onModelUploadFailure()
 {
-	
+	// Disable the "Upload complete" step if it has been previously enabled.
+	if (mLastEnabledState > REVIEW)
+	{
+		 mLastEnabledState = REVIEW;
+	}
+
+	updateButtons();
 }
 
 //static
-- 
cgit v1.2.3


From 021ce5ccaf10e140fe114c586466ccea8ea7dbdf Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Fri, 1 Jul 2011 09:42:06 -0400
Subject: enabled mesh

---
 indra/newview/app_settings/settings.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index b520650978..2372c19fb9 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -5576,7 +5576,7 @@
     <key>Type</key>
     <string>Boolean</string>
     <key>Value</key>
-    <real>0</real>
+    <real>1</real>
   </map>
   <key>MeshImportUseSLM</key>
   <map>
-- 
cgit v1.2.3


From 03d22f5366ad84e2c3a904dfd843c1274b67e41b Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 1 Jul 2011 12:24:52 -0500
Subject: SH-1913 Fix for PE cost not updating appropriately when editing child
 prims of a linked set.

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

(limited to 'indra/newview')

diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index 45c6777ae8..c772ea32d0 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -1395,6 +1395,10 @@ void LLViewerObjectList::updateActive(LLViewerObject *objectp)
 
 void LLViewerObjectList::updateObjectCost(LLViewerObject* object)
 {
+	if (!object->isRoot())
+	{ //always fetch cost for the parent when fetching cost for children
+		mStaleObjectCost.insert(((LLViewerObject*)object->getParent())->getID());
+	}
 	mStaleObjectCost.insert(object->getID());
 }
 
-- 
cgit v1.2.3


From 8accd2cc045e016d6198f13b27001b7b31028da7 Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Fri, 1 Jul 2011 16:39:49 -0400
Subject: SH-1725 SH-1726 FIX mesh upload wizard & advanced don't handle upload
 errors gracefully

Restructured the code to be a bit cleaner, now have callbacks with appropriate functionality
in both the wizard and advanced uploaders. If the upload fails, it requires the user to
re-submit the recalculate request.
---
 indra/newview/llfloatermodelpreview.cpp | 25 +++++++++++++++++--------
 indra/newview/llfloatermodelpreview.h   |  4 ++++
 indra/newview/llfloatermodelwizard.cpp  | 19 +++++++------------
 indra/newview/llmeshrepository.cpp      | 13 +++++++++----
 indra/newview/llmeshrepository.h        |  6 ++++--
 5 files changed, 41 insertions(+), 26 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index a79f3404cb..7af288be24 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -572,12 +572,10 @@ void LLFloaterModelPreview::onClickCalculateBtn()
 	bool upload_joint_positions = childGetValue("upload_joints").asBoolean();
 
 	mUploadModelUrl.clear();
-	LLMeshUploadThread* thread = new LLMeshUploadThread(mModelPreview->mUploadData, mModelPreview->mPreviewScale,
-			childGetValue("upload_textures").asBoolean(), upload_skinweights, upload_joint_positions, mUploadModelUrl, false);
 
-	thread->setFeeObserverHandle(getWholeModelFeeObserverHandle());
-
-	gMeshRepo.mUploadWaitList.push_back(thread);
+	gMeshRepo.uploadModel(mModelPreview->mUploadData, mModelPreview->mPreviewScale,
+			childGetValue("upload_textures").asBoolean(), upload_skinweights, upload_joint_positions, mUploadModelUrl, false,
+						  getWholeModelFeeObserverHandle());
 
 	toggleCalculateButton(false);
 	mUploadBtn->setEnabled(false);
@@ -5352,9 +5350,8 @@ void LLFloaterModelPreview::onUpload(void* user_data)
 	mp->mModelPreview->saveUploadData(upload_skinweights, upload_joint_positions);
 
 	gMeshRepo.uploadModel(mp->mModelPreview->mUploadData, mp->mModelPreview->mPreviewScale,
-						  mp->childGetValue("upload_textures").asBoolean(), upload_skinweights, upload_joint_positions, mp->mUploadModelUrl);
-
-	mp->closeFloater(false);
+						  mp->childGetValue("upload_textures").asBoolean(), upload_skinweights, upload_joint_positions, mp->mUploadModelUrl,
+						  true, LLHandle<LLWholeModelFeeObserver>(), mp->getWholeModelUploadObserverHandle());
 }
 
 
@@ -5458,6 +5455,18 @@ void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(U32 status, const std:
 	llwarns << "LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(" << status << " : " << reason << ")" << llendl;
 }
 
+/*virtual*/ 
+void LLFloaterModelPreview::onModelUploadSuccess()
+{
+	closeFloater(false);
+}
+
+/*virtual*/ 
+void LLFloaterModelPreview::onModelUploadFailure()
+{
+	toggleCalculateButton(true);
+}
+
 S32 LLFloaterModelPreview::DecompRequest::statusCallback(const char* status, S32 p1, S32 p2)
 {
 	if (mContinue)
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index eccc9ce1b6..119c593221 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -206,6 +206,10 @@ public:
 
 	/*virtual*/ void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason);
 
+	/*virtual*/ void onModelUploadSuccess();
+
+	/*virtual*/ void onModelUploadFailure();
+
 protected:
 	friend class LLModelPreview;
 	friend class LLMeshFilePicker;
diff --git a/indra/newview/llfloatermodelwizard.cpp b/indra/newview/llfloatermodelwizard.cpp
index 71baa0fa76..230a0b9ef3 100644
--- a/indra/newview/llfloatermodelwizard.cpp
+++ b/indra/newview/llfloatermodelwizard.cpp
@@ -271,12 +271,9 @@ void LLFloaterModelWizard::onClickCalculateUploadFee()
 	mModelPreview->rebuildUploadData();
 
 	mUploadModelUrl.clear();
-	LLMeshUploadThread* thread = new LLMeshUploadThread(mModelPreview->mUploadData, mModelPreview->mPreviewScale,
-			true, false, false, mUploadModelUrl, false);
 
-	thread->setFeeObserverHandle(getWholeModelFeeObserverHandle());
-
-	gMeshRepo.mUploadWaitList.push_back(thread);
+	gMeshRepo.uploadModel(mModelPreview->mUploadData, mModelPreview->mPreviewScale,
+			true, false, false, mUploadModelUrl, false, getWholeModelFeeObserverHandle());
 }
 
 void LLFloaterModelWizard::loadModel()
@@ -524,7 +521,8 @@ void LLFloaterModelWizard::onModelUploadSuccess()
 /*virtual*/
 void LLFloaterModelWizard::onModelUploadFailure()
 {
-	
+	// Failure. Make the user recalculate fees
+	setState(PHYSICS);
 }
 
 //static
@@ -708,12 +706,9 @@ void LLFloaterModelWizard::onUpload()
 {	
 	mModelPreview->rebuildUploadData();
 	
-	LLMeshUploadThread* thread = new LLMeshUploadThread(mModelPreview->mUploadData, mModelPreview->mPreviewScale, 
-						  true, false, false, mUploadModelUrl, true);
-
-	thread->setUploadObserverHandle(getWholeModelUploadObserverHandle());
-
-	gMeshRepo.mUploadWaitList.push_back(thread);
+	gMeshRepo.uploadModel(mModelPreview->mUploadData, mModelPreview->mPreviewScale, 
+						  true, false, false, mUploadModelUrl, true,
+						  LLHandle<LLWholeModelFeeObserver>(), getWholeModelUploadObserverHandle());
 }
 
 void LLFloaterModelWizard::onPreviewLODCommit(LLUICtrl* ctrl)
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index ff6c33ac27..689ef407f8 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -1410,11 +1410,14 @@ bool LLMeshRepoThread::physicsShapeReceived(const LLUUID& mesh_id, U8* data, S32
 }
 
 LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data, LLVector3& scale, bool upload_textures,
-										bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload)
+										bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload,
+					   LLHandle<LLWholeModelFeeObserver> fee_observer, LLHandle<LLWholeModelUploadObserver> upload_observer)
 : LLThread("mesh upload"),
 	mDiscarded(FALSE),
 	mDoUpload(do_upload),
-	mWholeModelUploadURL(upload_url)
+	mWholeModelUploadURL(upload_url),
+	mFeeObserverHandle(fee_observer),
+	mUploadObserverHandle(upload_observer)
 {
 	mInstanceList = data;
 	mUploadTextures = upload_textures;
@@ -2896,9 +2899,11 @@ LLSD& LLMeshRepoThread::getMeshHeader(const LLUUID& mesh_id)
 
 
 void LLMeshRepository::uploadModel(std::vector<LLModelInstance>& data, LLVector3& scale, bool upload_textures,
-									bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload)
+									bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload,
+								   LLHandle<LLWholeModelFeeObserver> fee_observer, LLHandle<LLWholeModelUploadObserver> upload_observer)
 {
-	LLMeshUploadThread* thread = new LLMeshUploadThread(data, scale, upload_textures, upload_skin, upload_joints, upload_url, do_upload);
+	LLMeshUploadThread* thread = new LLMeshUploadThread(data, scale, upload_textures, upload_skin, upload_joints, upload_url, 
+														do_upload, fee_observer, upload_observer);
 	mUploadWaitList.push_back(thread);
 }
 
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index df342facc0..3597b96e13 100644
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -413,7 +413,8 @@ public:
 	std::map<LLViewerFetchedTexture*, LLTextureUploadData> mTextureMap;
 
 	LLMeshUploadThread(instance_list& data, LLVector3& scale, bool upload_textures,
-			bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload = true);
+			bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload = true,
+					   LLHandle<LLWholeModelFeeObserver> fee_observer= (LLHandle<LLWholeModelFeeObserver>()), LLHandle<LLWholeModelUploadObserver> upload_observer = (LLHandle<LLWholeModelUploadObserver>()));
 	~LLMeshUploadThread();
 
 	void uploadTexture(LLTextureUploadData& data);
@@ -505,7 +506,8 @@ public:
 	LLSD& getMeshHeader(const LLUUID& mesh_id);
 
 	void uploadModel(std::vector<LLModelInstance>& data, LLVector3& scale, bool upload_textures,
-			bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload = true);
+			bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload = true,
+					 LLHandle<LLWholeModelFeeObserver> fee_observer= (LLHandle<LLWholeModelFeeObserver>()), LLHandle<LLWholeModelUploadObserver> upload_observer = (LLHandle<LLWholeModelUploadObserver>()));
 
 	S32 getMeshSize(const LLUUID& mesh_id, S32 lod);
 
-- 
cgit v1.2.3


From 3cca342ffb50093f0e84ad96763bf3d7587630ae Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Fri, 1 Jul 2011 17:31:53 -0400
Subject: SH-1790 FIX - use the inventory flags returned by server when
 available

---
 indra/newview/llassetuploadresponders.cpp | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
 mode change 100644 => 100755 indra/newview/llassetuploadresponders.cpp

(limited to 'indra/newview')

diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp
old mode 100644
new mode 100755
index d7ba4ea470..a05cbc64fb
--- a/indra/newview/llassetuploadresponders.cpp
+++ b/indra/newview/llassetuploadresponders.cpp
@@ -127,6 +127,15 @@ void on_new_single_inventory_upload_complete(
 			group_perms,
 			next_owner_perms);
 
+		U32 inventory_item_flags = 0;
+		if (server_response.has("inventory_flags"))
+		{
+			inventory_item_flags = (U32) server_response["inventory_flags"].asInteger();
+			if (inventory_item_flags != 0)
+			{
+				llinfos << "inventory_item_flags " << inventory_item_flags << llendl;
+			}
+		}
 		S32 creation_date_now = time_corrected();
 		LLPointer<LLViewerInventoryItem> item = new LLViewerInventoryItem(
 			server_response["new_inventory_item"].asUUID(),
@@ -138,7 +147,7 @@ void on_new_single_inventory_upload_complete(
 			item_name,
 			item_description,
 			LLSaleInfo::DEFAULT,
-			LLInventoryItemFlags::II_FLAGS_NONE,
+			inventory_item_flags,
 			creation_date_now);
 
 		gInventory.updateItem(item);
-- 
cgit v1.2.3


From ec402fad16a937a39f4b5df4fd9da12acd61d322 Mon Sep 17 00:00:00 2001
From: Don Kjer <don@lindenlab.com>
Date: Sun, 3 Jul 2011 01:02:01 -0700
Subject: SH-1747 mesh-asset-dep -- uploaded objects have bad permissions, and
 SH-1975 Name of mesh is not loaded into mesh uploader floater.  Also removed
 a lot of dead mesh uploader code.

---
 indra/newview/llfloatermodelpreview.cpp |  10 +
 indra/newview/llmeshrepository.cpp      | 490 +-------------------------------
 indra/newview/llmeshrepository.h        |  23 --
 indra/newview/llviewerwindow.cpp        |   6 +-
 4 files changed, 21 insertions(+), 508 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 67841620ea..14f8ccb625 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -3472,7 +3472,17 @@ void LLModelPreview::loadModelCallback(S32 lod)
 
 	mLoading = false;
 	if (mFMP)
+	{
 		mFMP->getChild<LLCheckBoxCtrl>("confirm_checkbox")->set(FALSE);
+		if (!mBaseModel.empty())
+		{
+			if (mFMP->getChild<LLUICtrl>("description_form")->getValue().asString().empty())
+			{
+				const std::string& model_name = mBaseModel[0]->getName();
+				mFMP->getChild<LLUICtrl>("description_form")->setValue(model_name);
+			}
+		}
+	}
 	refresh();
 
 	mModelLoadedSignal();
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index be11c53efa..9ec804336c 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -198,196 +198,6 @@ S32 LLMeshRepoThread::sActiveHeaderRequests = 0;
 S32 LLMeshRepoThread::sActiveLODRequests = 0;
 U32	LLMeshRepoThread::sMaxConcurrentRequests = 1;
 
-
-class LLTextureCostResponder : public LLCurl::Responder
-{
-public:
-	LLTextureUploadData mData;
-	LLMeshUploadThread* mThread;
-
-	LLTextureCostResponder(LLTextureUploadData data, LLMeshUploadThread* thread) 
-		: mData(data), mThread(thread)
-	{
-
-	}
-
-	virtual void completed(U32 status, const std::string& reason, const LLSD& content)
-	{
-		mThread->mPendingConfirmations--;
-		if (isGoodStatus(status))
-		{
-			mThread->priceResult(mData, content);	
-		}
-		else
-		{
-			llwarns << status << ": " << reason << llendl;
-
-			if (mData.mRetries < MAX_TEXTURE_UPLOAD_RETRIES)
-			{
-				llwarns << "Retrying. (" << ++mData.mRetries << ")" << llendl;
-			
-				if (status == 499 || status == 500)
-				{
-					mThread->uploadTexture(mData);
-				}
-				else
-				{
-					llerrs << "Unhandled status " << status << llendl;
-				}
-			}
-			else
-			{ 
-				llwarns << "Giving up after " << mData.mRetries << " retries." << llendl;
-			}
-		}
-	}
-};
-
-class LLTextureUploadResponder : public LLCurl::Responder
-{
-public:
-	LLTextureUploadData mData;
-	LLMeshUploadThread* mThread;
-
-	LLTextureUploadResponder(LLTextureUploadData data, LLMeshUploadThread* thread)
-		: mData(data), mThread(thread)
-	{
-	}
-
-	virtual void completed(U32 status, const std::string& reason, const LLSD& content)
-	{
-		mThread->mPendingUploads--;
-		if (isGoodStatus(status))
-		{
-			mData.mUUID = content["new_asset"].asUUID();
-			gMeshRepo.updateInventory(LLMeshRepository::inventory_data(mData.mPostData, content));
-			mThread->onTextureUploaded(mData);
-		}
-		else
-		{
-			llwarns << status << ": " << reason << llendl;
-			llwarns << "Retrying. (" << ++mData.mRetries << ")" << llendl;
-
-			if (status == 404)
-			{
-				mThread->uploadTexture(mData);
-			}
-			else if (status == 499)
-			{
-				mThread->mConfirmedTextureQ.push(mData);
-			}
-			else
-			{
-				llerrs << "Unhandled status " << status << llendl;
-			}
-		}
-	}
-};
-
-class LLMeshCostResponder : public LLCurl::Responder
-{
-public:
-	LLMeshUploadData mData;
-	LLMeshUploadThread* mThread;
-
-	LLMeshCostResponder(LLMeshUploadData data, LLMeshUploadThread* thread) 
-		: mData(data), mThread(thread)
-	{
-
-	}
-
-	virtual void completed(U32 status, const std::string& reason, const LLSD& content)
-	{
-		mThread->mPendingConfirmations--;
-
-		if (isGoodStatus(status))
-		{
-			mThread->priceResult(mData, content);	
-		}
-		else
-		{
-			llwarns << status << ": " << reason << llendl;			
-			
-			if (status == HTTP_INTERNAL_ERROR)
-			{
-				llwarns << "Retrying. (" << ++mData.mRetries << ")" << llendl;
-				mThread->uploadModel(mData);
-			}
-			else if (status == HTTP_BAD_REQUEST)
-			{
-				llwarns << "Status 400 received from server, giving up." << llendl;
-			}
-			else if (status == HTTP_NOT_FOUND)
-			{
-				llwarns <<"Status 404 received, server is disconnected, giving up." << llendl ;
-			}
-			else
-			{
-				llerrs << "Unhandled status " << status << llendl;
-			}
-		}
-	}
-};
-
-class LLMeshUploadResponder : public LLCurl::Responder
-{
-public:
-	LLMeshUploadData mData;
-	LLMeshUploadThread* mThread;
-
-	LLMeshUploadResponder(LLMeshUploadData data, LLMeshUploadThread* thread)
-		: mData(data), mThread(thread)
-	{
-	}
-
-	virtual void completed(U32 status, const std::string& reason, const LLSD& content)
-	{
-		mThread->mPendingUploads--;
-		if (isGoodStatus(status))
-		{
-			mData.mUUID = content["new_asset"].asUUID();
-			if (mData.mUUID.isNull())
-			{
-				LLSD args;
-				std::string message = content["error"]["message"];
-				std::string identifier = content["error"]["identifier"];
-				std::string invalidity_identifier = content["error"]["invalidity_identifier"];
-
-				args["MESSAGE"] = message;
-				args["IDENTIFIER"] = identifier;
-				args["INVALIDITY_IDENTIFIER"] = invalidity_identifier;
-				args["LABEL"] = mData.mBaseModel->mLabel;
-
-				gMeshRepo.uploadError(args);
-			}
-			else
-			{
-				gMeshRepo.updateInventory(LLMeshRepository::inventory_data(mData.mPostData, content));
-				mThread->onModelUploaded(mData);
-			}
-		}
-		else
-		{
-			llwarns << status << ": " << reason << llendl;
-			llwarns << "Retrying. (" << ++mData.mRetries << ")" << llendl;
-
-			if (status == 404)
-			{
-				mThread->uploadModel(mData);
-			}
-			else if (status == 499)
-			{
-				mThread->mConfirmedQ.push(mData);
-			}
-			else if (status != 500)
-			{ //drop internal server errors on the floor, otherwise grab
-				llerrs << "Unhandled status " << status << llendl;
-			}
-		}
-	}
-};
-
-
 class LLMeshHeaderResponder : public LLCurl::Responder
 {
 public:
@@ -526,30 +336,6 @@ void log_upload_error(S32 status, const LLSD& content, std::string stage, std::s
 	}
 }
 
-class LLModelObjectUploadResponder: public LLCurl::Responder
-{
-	LLSD mObjectAsset;
-	LLMeshUploadThread* mThread;
-
-public:
-	LLModelObjectUploadResponder(LLMeshUploadThread* thread, const LLSD& object_asset):
-		mThread(thread),
-		mObjectAsset(object_asset)
-	{
-	}
-
-	virtual void completedRaw(U32 status, const std::string& reason,
-							  const LLChannelDescriptors& channels,
-							  const LLIOPipe::buffer_ptr_t& buffer)
-	{
-		assert_main_thread();
-		
-		llinfos << "completed" << llendl;
-		mThread->mPendingUploads--;
-		mThread->mFinished = true;
-	}
-};
-
 class LLWholeModelFeeResponder: public LLCurl::Responder
 {
 	LLMeshUploadThread* mThread;
@@ -1386,9 +1172,7 @@ LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data,
 	mUploadJoints = upload_joints;
 	mMutex = new LLMutex(NULL);
 	mCurlRequest = NULL;
-	mPendingConfirmations = 0;
 	mPendingUploads = 0;
-	mPendingCost = 0;
 	mFinished = false;
 	mOrigin = gAgent.getPositionAgent();
 	mHost = gAgent.getRegionHost();
@@ -1484,8 +1268,10 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
 	result["folder_id"] = gInventory.findCategoryUUIDForType(LLFolderType::FT_OBJECT);
 	result["asset_type"] = "mesh";
 	result["inventory_type"] = "object";
-	result["name"] = "mesh model";
-	result["description"] = "your description here";
+	result["description"] = "(No Description)";
+	result["next_owner_mask"] = LLSD::Integer(LLFloaterPerms::getNextOwnerPerms());
+	result["group_mask"] = LLSD::Integer(LLFloaterPerms::getGroupPerms());
+	result["everyone_mask"] = LLSD::Integer(LLFloaterPerms::getEveryonePerms());
 
 	res["mesh_list"] = LLSD::emptyArray();
 	res["texture_list"] = LLSD::emptyArray();
@@ -1497,6 +1283,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
 	std::map<LLViewerTexture*,S32> texture_index;
 
 	std::map<LLModel*,S32> mesh_index;
+	std::string model_name;
 
 	S32 instance_num = 0;
 	
@@ -1513,10 +1300,9 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
 		if (mesh_index.find(data.mBaseModel) == mesh_index.end())
 		{
 			// Have not seen this model before - create a new mesh_list entry for it.
-			std::string model_name = data.mBaseModel->getName();
-			if (!model_name.empty())
+			if (model_name.empty())
 			{
-				result["name"] = model_name;
+				model_name = data.mBaseModel->getName();
 			}
 
 			std::stringstream ostr;
@@ -1571,16 +1357,6 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
 			instance_entry["scale"] = ll_sd_from_vector3(scale);
 		
 			instance_entry["material"] = LL_MCODE_WOOD;
-			LLPermissions perm;
-			perm.setOwnerAndGroup(gAgent.getID(), gAgent.getID(), LLUUID::null, false);
-			perm.setCreator(gAgent.getID());
-		
-			perm.initMasks(PERM_ITEM_UNRESTRICTED | PERM_MOVE, //base
-						   PERM_ITEM_UNRESTRICTED | PERM_MOVE, //owner
-						   LLFloaterPerms::getEveryonePerms(),
-						   LLFloaterPerms::getGroupPerms(),
-						   LLFloaterPerms::getNextOwnerPerms());
-			instance_entry["permissions"] = ll_create_sd_from_permissions(perm);
 			instance_entry["physics_shape_type"] = (U8)(LLViewerObject::PHYSICS_SHAPE_CONVEX_HULL);
 			instance_entry["mesh"] = mesh_index[data.mBaseModel];
 
@@ -1644,6 +1420,8 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
 		}
 	}
 
+	if (model_name.empty()) model_name = "mesh model";
+	result["name"] = model_name;
 	result["asset_resources"] = res;
 	dump_llsd_to_file(result,make_dump_name("whole_model_",dump_num));
 
@@ -1739,20 +1517,6 @@ void LLMeshUploadThread::doWholeModelUpload()
 	mFinished = true;
 }
 
-void LLMeshUploadThread::uploadModel(LLMeshUploadData& data)
-{ //called from arbitrary thread
-	{
-		LLMutexLock lock(mMutex);
-		mUploadQ.push(data);
-	}
-}
-
-void LLMeshUploadThread::uploadTexture(LLTextureUploadData& data)
-{ //called from mesh upload thread
-	mTextureQ.push(data);	
-}
-
-
 static LLFastTimer::DeclareTimer FTM_NOTIFY_MESH_LOADED("Notify Loaded");
 static LLFastTimer::DeclareTimer FTM_NOTIFY_MESH_UNAVAILABLE("Notify Unavailable");
 
@@ -2866,101 +2630,6 @@ S32 LLMeshRepository::getMeshSize(const LLUUID& mesh_id, S32 lod)
 
 }
 
-
-void LLMeshUploadThread::doUploadModel(LLMeshUploadData& data)
-{
-	if(isDiscarded())
-	{
-		return ;
-	}
-
-	if (!data.mRSVP.empty())
-	{
-		std::stringstream ostr;
-
-		LLModel::Decomposition& decomp =
-			data.mModel[LLModel::LOD_PHYSICS].notNull() ? 
-			data.mModel[LLModel::LOD_PHYSICS]->mPhysics : 
-			data.mBaseModel->mPhysics;
-
-		decomp.mBaseHull = mHullMap[data.mBaseModel];
-
-		LLModel::writeModel(
-			ostr,  
-			data.mModel[LLModel::LOD_PHYSICS],
-			data.mModel[LLModel::LOD_HIGH],
-			data.mModel[LLModel::LOD_MEDIUM],
-			data.mModel[LLModel::LOD_LOW],
-			data.mModel[LLModel::LOD_IMPOSTOR], 
-			decomp,
-			mUploadSkin,
-			mUploadJoints);
-
-		data.mAssetData = ostr.str();
-
-		LLCurlRequest::headers_t headers;
-		mPendingUploads++;
-
-		mCurlRequest->post(data.mRSVP, headers, data.mAssetData, new LLMeshUploadResponder(data, this), mMeshUploadTimeOut);
-	}
-}
-
-void LLMeshUploadThread::doUploadTexture(LLTextureUploadData& data)
-{
-	if(isDiscarded())
-	{
-		return ;
-	}
-
-	if (!data.mRSVP.empty())
-	{
-		std::stringstream ostr;
-		
-		if (!data.mTexture->isRawImageValid())
-		{
-			data.mTexture->reloadRawImage(data.mTexture->getDiscardLevel());
-		}
-
-		if(data.mTexture->hasSavedRawImage())
-		{
-			LLPointer<LLImageJ2C> upload_file = LLViewerTextureList::convertToUploadFile(data.mTexture->getSavedRawImage());
-		
-			ostr.write((const char*) upload_file->getData(), upload_file->getDataSize());
-		}
-
-		data.mAssetData = ostr.str();
-
-		LLCurlRequest::headers_t headers;
-		mPendingUploads++;
-
-		mCurlRequest->post(data.mRSVP, headers, data.mAssetData, new LLTextureUploadResponder(data, this), mMeshUploadTimeOut);
-	}
-}
-
-
-void LLMeshUploadThread::onModelUploaded(LLMeshUploadData& data)
-{
-	createObjects(data);
-}
-
-void LLMeshUploadThread::onTextureUploaded(LLTextureUploadData& data)
-{
-	mTextureMap[data.mTexture] = data;
-}
-
-
-void LLMeshUploadThread::createObjects(LLMeshUploadData& data)
-{
-	instance_list& instances = mInstance[data.mBaseModel];
-
-	for (instance_list::iterator iter = instances.begin(); iter != instances.end(); ++iter)
-	{ //create prims that reference given mesh
-		LLModelInstance& instance = *iter;
-		instance.mMeshID = data.mUUID;
-		mInstanceQ.push(instance);
-	}
-}
-
 void LLMeshUploadThread::decomposeMeshMatrix(LLMatrix4& transformation,
 											 LLVector3& result_pos,
 											 LLQuaternion& result_rot,
@@ -3001,147 +2670,6 @@ void LLMeshUploadThread::decomposeMeshMatrix(LLMatrix4& transformation,
 	result_rot = quat_rotation; 
 }
 
-										 
-LLSD LLMeshUploadThread::createObject(LLModelInstance& instance)
-{
-	LLMatrix4 transformation = instance.mTransform;
-
-	llassert(instance.mMeshID.notNull());
-	
-	// check for reflection
-	BOOL reflected = (transformation.determinant() < 0);
-
-	// compute position
-	LLVector3 position = LLVector3(0, 0, 0) * transformation;
-
-	// compute scale
-	LLVector3 x_transformed = LLVector3(1, 0, 0) * transformation - position;
-	LLVector3 y_transformed = LLVector3(0, 1, 0) * transformation - position;
-	LLVector3 z_transformed = LLVector3(0, 0, 1) * transformation - position;
-	F32 x_length = x_transformed.normalize();
-	F32 y_length = y_transformed.normalize();
-	F32 z_length = z_transformed.normalize();
-	LLVector3 scale = LLVector3(x_length, y_length, z_length);
-
-    // adjust for "reflected" geometry
-	LLVector3 x_transformed_reflected = x_transformed;
-	if (reflected)
-	{
-		x_transformed_reflected *= -1.0;
-	}
-	
-	// compute rotation
-	LLMatrix3 rotation_matrix;
-	rotation_matrix.setRows(x_transformed_reflected, y_transformed, z_transformed);
-	LLQuaternion quat_rotation = rotation_matrix.quaternion();
-	quat_rotation.normalize(); // the rotation_matrix might not have been orthoginal.  make it so here.
-	LLVector3 euler_rotation;
-	quat_rotation.getEulerAngles(&euler_rotation.mV[VX], &euler_rotation.mV[VY], &euler_rotation.mV[VZ]);
-
-	//
-	// build parameter block to construct this prim
-	//
-	
-	LLSD object_params;
-
-	// create prim
-
-	// set volume params
-	U8 sculpt_type = LL_SCULPT_TYPE_MESH;
-	if (reflected)
-	{
-		sculpt_type |= LL_SCULPT_FLAG_MIRROR;
-	}
-	LLVolumeParams  volume_params;
-	volume_params.setType( LL_PCODE_PROFILE_SQUARE, LL_PCODE_PATH_LINE );
-	volume_params.setBeginAndEndS( 0.f, 1.f );
-	volume_params.setBeginAndEndT( 0.f, 1.f );
-	volume_params.setRatio  ( 1, 1 );
-	volume_params.setShear  ( 0, 0 );
-	volume_params.setSculptID(instance.mMeshID, sculpt_type);
-	object_params["shape"] = volume_params.asLLSD();
-
-	object_params["material"] = LL_MCODE_WOOD;
-
-	object_params["group-id"] = gAgent.getGroupID();
-	object_params["pos"] = ll_sd_from_vector3(position + mOrigin);
-	object_params["rotation"] = ll_sd_from_quaternion(quat_rotation);
-	object_params["scale"] = ll_sd_from_vector3(scale);
-	object_params["name"] = instance.mLabel;
-
-	// load material from dae file
-	object_params["facelist"] = LLSD::emptyArray();
-	for (S32 i = 0; i < instance.mMaterial.size(); i++)
-	{
-		LLTextureEntry te;
-		LLImportMaterial& mat = instance.mMaterial[i];
-
-		te.setColor(mat.mDiffuseColor);
-
-		LLUUID diffuse_id = mTextureMap[mat.mDiffuseMap].mUUID;
-
-		if (diffuse_id.notNull())
-		{
-			te.setID(diffuse_id);
-		}
-		else
-		{
-			te.setID(LLUUID("5748decc-f629-461c-9a36-a35a221fe21f")); // blank texture
-		}
-
-		te.setFullbright(mat.mFullbright);
-
-		object_params["facelist"][i] = te.asLLSD();
-	}
-
-	// set extra parameters
-	LLSculptParams sculpt_params;
-	sculpt_params.setSculptTexture(instance.mMeshID);
-	sculpt_params.setSculptType(sculpt_type);
-	U8 buffer[MAX_OBJECT_PARAMS_SIZE+1];
-	LLDataPackerBinaryBuffer dp(buffer, MAX_OBJECT_PARAMS_SIZE);
-	sculpt_params.pack(dp);
-	std::vector<U8> v(dp.getCurrentSize());
-	memcpy(&v[0], buffer, dp.getCurrentSize());
-	LLSD extra_parameter;
-	extra_parameter["extra_parameter"] = sculpt_params.mType;
-	extra_parameter["param_data"] = v;
-	object_params["extra_parameters"].append(extra_parameter);
-
-	LLPermissions perm;
-	perm.setOwnerAndGroup(gAgent.getID(), gAgent.getID(), LLUUID::null, false);
-	perm.setCreator(gAgent.getID());
-
-	perm.initMasks(PERM_ITEM_UNRESTRICTED | PERM_MOVE, //base
-				   PERM_ITEM_UNRESTRICTED | PERM_MOVE, //owner
-				   LLFloaterPerms::getEveryonePerms(),
-				   LLFloaterPerms::getGroupPerms(),
-				   LLFloaterPerms::getNextOwnerPerms());
-		
-	object_params["permissions"] = ll_create_sd_from_permissions(perm);
-
-	object_params["physics_shape_type"] = (U8)(LLViewerObject::PHYSICS_SHAPE_CONVEX_HULL);
-
-	return object_params;
-}
-
-void LLMeshUploadThread::priceResult(LLMeshUploadData& data, const LLSD& content)
-{
-	mPendingCost += content["upload_price"].asInteger();
-	data.mRSVP = content["rsvp"].asString();
-
-	mConfirmedQ.push(data);
-}
-
-void LLMeshUploadThread::priceResult(LLTextureUploadData& data, const LLSD& content)
-{
-	mPendingCost += content["upload_price"].asInteger();
-	data.mRSVP = content["rsvp"].asString();
-
-	mConfirmedTextureQ.push(data);
-}
-
-
 bool LLImportMaterial::operator<(const LLImportMaterial &rhs) const
 {
 	if (mDiffuseMap != rhs.mDiffuseMap)
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index f56734a7de..7752703d3f 100644
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -388,9 +388,7 @@ public:
 
 	LLMutex*					mMutex;
 	LLCurlRequest* mCurlRequest;
-	S32				mPendingConfirmations;
 	S32				mPendingUploads;
-	S32				mPendingCost;
 	LLVector3		mOrigin;
 	bool			mFinished;	
 	bool			mUploadTextures;
@@ -402,31 +400,10 @@ public:
 	std::string		mWholeModelFeeCapability;
 	std::string		mWholeModelUploadURL;
 
-	std::queue<LLMeshUploadData> mUploadQ;
-	std::queue<LLMeshUploadData> mConfirmedQ;
-	std::queue<LLModelInstance> mInstanceQ;
-
-	std::queue<LLTextureUploadData> mTextureQ;
-	std::queue<LLTextureUploadData> mConfirmedTextureQ;
-
-	std::map<LLViewerFetchedTexture*, LLTextureUploadData> mTextureMap;
-
 	LLMeshUploadThread(instance_list& data, LLVector3& scale, bool upload_textures,
 			bool upload_skin, bool upload_joints);
 	~LLMeshUploadThread();
 
-	void uploadTexture(LLTextureUploadData& data);
-	void doUploadTexture(LLTextureUploadData& data);
-	void priceResult(LLTextureUploadData& data, const LLSD& content);
-	void onTextureUploaded(LLTextureUploadData& data);
-
-	void uploadModel(LLMeshUploadData& data);
-	void doUploadModel(LLMeshUploadData& data);
-	void onModelUploaded(LLMeshUploadData& data);
-	void createObjects(LLMeshUploadData& data);
-	LLSD createObject(LLModelInstance& instance);
-	void priceResult(LLMeshUploadData& data, const LLSD& content);
-
 	bool finished() { return mFinished; }
 	virtual void run();
 	void preStart();
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index b2fd802ae7..4e5ebb690f 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -747,10 +747,8 @@ public:
 			{
 				LLMeshUploadThread* thread = *iter;
 
-				addText(xpos, ypos, llformat("Mesh Upload -- price quote: %d:%d | upload: %d:%d | create: %d", 
-								thread->mPendingConfirmations, thread->mUploadQ.size()+thread->mTextureQ.size(),
-								thread->mPendingUploads, thread->mConfirmedQ.size()+thread->mConfirmedTextureQ.size(),
-								thread->mInstanceQ.size()));
+				addText(xpos, ypos, llformat("Mesh Uploads: %d", 
+								thread->mPendingUploads));
 				ypos += y_inc;
 			}
 		}
-- 
cgit v1.2.3


From b466e95b4de2b93c5ed8e1947284371f3e89c99c Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Tue, 5 Jul 2011 14:11:16 -0400
Subject: merge cleanup

---
 indra/newview/llmeshrepository.cpp | 33 +++++++++++++++++++++++++++++++--
 indra/newview/llmeshrepository.h   |  3 +--
 2 files changed, 32 insertions(+), 4 deletions(-)
 mode change 100644 => 100755 indra/newview/llmeshrepository.h

(limited to 'indra/newview')

diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 5648f33965..a06422a177 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -1474,7 +1474,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
 	dest = result;
 }
 
-void LLMeshUploadThread::queueUpModels()
+void LLMeshUploadThread::generateHulls()
 {
 	for (instance_map::iterator iter = mInstance.begin(); iter != mInstance.end(); ++iter)
 		{
@@ -1529,7 +1529,7 @@ void LLMeshUploadThread::doWholeModelUpload()
 	}
 	else
 	{
-		queueUpModels();
+		generateHulls();
 
 		LLSD full_model_data;
 		wholeModelToLLSD(full_model_data, true);
@@ -1551,6 +1551,35 @@ void LLMeshUploadThread::doWholeModelUpload()
 	mFinished = true;
 }
 
+void LLMeshUploadThread::requestWholeModelFee()
+{
+	dump_num++;
+
+	mCurlRequest = new LLCurlRequest();
+
+	generateHulls();
+
+	LLSD model_data;
+	wholeModelToLLSD(model_data,false);
+	dump_llsd_to_file(model_data,make_dump_name("whole_model_fee_request_",dump_num));
+
+	mPendingUploads++;
+	LLCurlRequest::headers_t headers;
+	mCurlRequest->post(mWholeModelFeeCapability, headers, model_data,
+					   new LLWholeModelFeeResponder(this,model_data, mFeeObserverHandle), mMeshUploadTimeOut);
+
+	do
+	{
+		mCurlRequest->process();
+	} while (mCurlRequest->getQueued() > 0);
+
+	delete mCurlRequest;
+	mCurlRequest = NULL;
+
+	// Currently a no-op.
+	mFinished = true;
+}
+
 static LLFastTimer::DeclareTimer FTM_NOTIFY_MESH_LOADED("Notify Loaded");
 static LLFastTimer::DeclareTimer FTM_NOTIFY_MESH_UNAVAILABLE("Notify Unavailable");
 
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
old mode 100644
new mode 100755
index 0a2127ccb4..74a08a998f
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -412,8 +412,7 @@ public:
 	void discard() ;
 	BOOL isDiscarded();
 
-	// Queue up models for hull generation (viewer-side)
-	void queueUpModels();
+	void generateHulls();
 
 	void doWholeModelUpload();
 	void requestWholeModelFee();
-- 
cgit v1.2.3


From 5f17754a39c94c90be98313d52efab18e3cfc789 Mon Sep 17 00:00:00 2001
From: seth_productengine <none@none>
Date: Tue, 5 Jul 2011 21:21:26 +0300
Subject: SH-1965 FIXED recalculating physics in model upload wizard before
 requesting the upload fee.

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

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelwizard.cpp b/indra/newview/llfloatermodelwizard.cpp
index ae6b1dd85b..7efcdb6145 100644
--- a/indra/newview/llfloatermodelwizard.cpp
+++ b/indra/newview/llfloatermodelwizard.cpp
@@ -133,6 +133,10 @@ void LLFloaterModelWizard::setState(int state)
 		if (mLastEnabledState < state)
 		{
 			mModelPreview->setPhysicsFromLOD(1);
+
+			// Trigger the recalculate physics when first entering
+			// the Physics step.
+			onClickRecalculatePhysics();
 		}
 
 		mModelPreview->mViewOption["show_physics"] = true;
-- 
cgit v1.2.3


From 74c5c0a0d7761d0762bb0e7775259e0556fd392a Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Wed, 6 Jul 2011 20:05:38 +0300
Subject: SH-1945 FIXED Added a check for Estate Managership when checking
 whether an object encroaching on the region can be returned.

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

(limited to 'indra/newview')

diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index c3a7d345f5..fdf1e4a89b 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -575,7 +575,9 @@ bool LLViewerObject::isReturnable()
 			boxes.clear();
 			LLViewerRegion* pRegion = (*retCurrentIt).pRegion;
 			boxes.push_back( (*retCurrentIt).box );	
-			bool retResult = (pRegion && pRegion->childrenObjectReturnable( boxes )) ? 1 : 0;
+			bool retResult = 	pRegion
+							 && pRegion->childrenObjectReturnable( boxes )
+							 && pRegion->canManageEstate();
 			if ( retResult )
 			{ 
 				result = true;
-- 
cgit v1.2.3


From 1a5f978ca8eab965e89783b0476d52be4c2b185c Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 6 Jul 2011 12:32:44 -0500
Subject: SH-1988 Fix for using diameter instead of radius for streaming cost.

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

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 14f8ccb625..7d4059f50e 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -3013,7 +3013,7 @@ U32 LLModelPreview::calcResourceCost()
 			F32 z_length = z_transformed.normalize();
 			LLVector3 scale = LLVector3(x_length, y_length, z_length);
 
-			F32 radius = scale.length()*debug_scale;
+			F32 radius = scale.length()*0.5f*debug_scale;
 
 			streaming_cost += LLMeshRepository::getStreamingCost(ret, radius);
 		}
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index e6da8eb89d..4723ec9bd1 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -3096,7 +3096,7 @@ U32 LLVOVolume::getRenderCost(std::set<LLUUID> &textures) const
 
 F32 LLVOVolume::getStreamingCost(S32* bytes, S32* visible_bytes)
 {
-	F32 radius = getScale().length();
+	F32 radius = getScale().length()*0.5f;
 
 	if (isMesh())
 	{	
-- 
cgit v1.2.3


From 71eb68a85d5a5157622ae8f42bac1c21f00d54cd Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 6 Jul 2011 18:54:50 -0500
Subject: Fix for "set to default" button not resetting some data.

---
 indra/newview/llfloatermodelpreview.cpp | 37 ++++++++++++++++++++++++++-------
 indra/newview/llfloatermodelpreview.h   |  6 ++++--
 2 files changed, 33 insertions(+), 10 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 93607f7a30..a452bcebb2 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -363,6 +363,7 @@ mCalculateBtn(NULL)
 	mLastMouseY = 0;
 	mGLName = 0;
 	mStatusLock = new LLMutex(NULL);
+	mModelPreview = NULL;
 
 	mLODMode[LLModel::LOD_HIGH] = 0;
 	for (U32 i = 0; i < LLModel::LOD_HIGH; i++)
@@ -446,10 +447,7 @@ BOOL LLFloaterModelPreview::postBuild()
 
 	mPreviewRect = preview_panel->getRect();
 
-	mModelPreview = new LLModelPreview(512, 512, this );
-	mModelPreview->setPreviewTarget(16.f);
-	mModelPreview->setDetailsCallback(boost::bind(&LLFloaterModelPreview::setDetails, this, _1, _2, _3, _4, _5));
-	mModelPreview->setModelUpdatedCallback(boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this, _1));
+	initModelPreview();
 
 	//set callbacks for left click on line editor rows
 	for (U32 i = 0; i <= LLModel::LOD_HIGH; i++)
@@ -510,6 +508,19 @@ LLFloaterModelPreview::~LLFloaterModelPreview()
 	mStatusLock = NULL;
 }
 
+void LLFloaterModelPreview::initModelPreview()
+{
+	if (mModelPreview)
+	{
+		delete mModelPreview;
+	}
+
+	mModelPreview = new LLModelPreview(512, 512, this );
+	mModelPreview->setPreviewTarget(16.f);
+	mModelPreview->setDetailsCallback(boost::bind(&LLFloaterModelPreview::setDetails, this, _1, _2, _3, _4, _5));
+	mModelPreview->setModelUpdatedCallback(boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this, _1));
+}
+
 void LLFloaterModelPreview::onViewOptionChecked(const LLSD& userdata)
 {
 	if (mModelPreview)
@@ -557,11 +568,11 @@ void LLFloaterModelPreview::loadModel(S32 lod)
 	(new LLMeshFilePicker(mModelPreview, lod))->getFile();
 }
 
-void LLFloaterModelPreview::loadModel(S32 lod, const std::string& file_name)
+void LLFloaterModelPreview::loadModel(S32 lod, const std::string& file_name, bool force_disable_slm)
 {
 	mModelPreview->mLoading = true;
 
-	mModelPreview->loadModel(file_name, lod);
+	mModelPreview->loadModel(file_name, lod, force_disable_slm);
 }
 
 void LLFloaterModelPreview::onClickCalculateBtn()
@@ -3264,7 +3275,7 @@ void LLModelPreview::clearModel(S32 lod)
 	mScene[lod].clear();
 }
 
-void LLModelPreview::loadModel(std::string filename, S32 lod)
+void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable_slm)
 {
 	assert_main_thread();
 
@@ -3301,6 +3312,11 @@ void LLModelPreview::loadModel(std::string filename, S32 lod)
 
 	mModelLoader = new LLModelLoader(filename, lod, this, mJointTransformMap, mJointsFromNode );
 
+	if (force_disable_slm)
+	{
+		mModelLoader->mTrySLM = false;
+	}
+
 	mModelLoader->start();
 
 	mFMP->childSetTextArg("status", "[STATUS]", mFMP->getString("status_reading_file"));
@@ -5345,7 +5361,12 @@ void LLFloaterModelPreview::onReset(void* user_data)
 	LLFloaterModelPreview* fmp = (LLFloaterModelPreview*) user_data;
 	LLModelPreview* mp = fmp->mModelPreview;
 	std::string filename = mp->mLODFile[3]; 
-	mp->loadModel(filename,3);
+
+	//reset model preview
+	fmp->initModelPreview();
+
+	mp = fmp->mModelPreview;
+	mp->loadModel(filename,3,true);
 }
 
 //static
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index 119c593221..56098c6250 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -162,6 +162,8 @@ public:
 	
 	virtual BOOL postBuild();
 	
+	void initModelPreview();
+
 	BOOL handleMouseDown(S32 x, S32 y, MASK mask);
 	BOOL handleMouseUp(S32 x, S32 y, MASK mask);
 	BOOL handleHover(S32 x, S32 y, MASK mask);
@@ -187,7 +189,7 @@ public:
 	void updateResourceCost();
 	
 	void			loadModel(S32 lod);
-	void 			loadModel(S32 lod, const std::string& file_name);
+	void 			loadModel(S32 lod, const std::string& file_name, bool force_disable_slm = false);
 	
 	void onViewOptionChecked(const LLSD& userdata);
 	bool isViewOptionChecked(const LLSD& userdata);
@@ -324,7 +326,7 @@ public:
 	virtual BOOL needsRender() { return mNeedsUpdate; }
 	void setPreviewLOD(S32 lod);
 	void clearModel(S32 lod);
-	void loadModel(std::string filename, S32 lod);
+	void loadModel(std::string filename, S32 lod, bool force_disable_slm = false);
 	void loadModelCallback(S32 lod);
 	void genLODs(S32 which_lod = -1, U32 decimation = 3, bool enforce_tri_limit = false);
 	void generateNormals();
-- 
cgit v1.2.3


From 9b253ccf68718dea51dc94416b3ece28b42fc32a Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 6 Jul 2011 19:27:43 -0500
Subject: SH-1972 Fix for slm messing up physics shape on second upload.

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

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index a452bcebb2..ab370a221f 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -2034,12 +2034,6 @@ bool LLModelLoader::loadFromSLM(const std::string& filename)
 		return false;
 	}
 
-	if (model[LLModel::LOD_PHYSICS].empty())
-	{ //no explicit physics block, copy HIGH_LOD into physics array to recover convex decomp
-		model[LLModel::LOD_PHYSICS] = model[LLModel::LOD_HIGH];
-	}
-
-
 	//load instance list
 	model_instance_list instance_list;
 
@@ -3248,7 +3242,7 @@ void LLModelPreview::saveUploadData(const std::string& filename, bool save_skinw
 				instance.mLOD[LLModel::LOD_LOW], 
 				instance.mLOD[LLModel::LOD_IMPOSTOR], 
 				decomp, 
-				save_skinweights, save_joint_positions);
+				save_skinweights, save_joint_positions, FALSE, TRUE);
 
 			
 			data["mesh"][instance.mModel->mLocalID] = str.str();
-- 
cgit v1.2.3


From 681eb7ba0668835d6ddfc84fdddd830f3f5a9a87 Mon Sep 17 00:00:00 2001
From: prep <prep@lindenlab.com>
Date: Thu, 7 Jul 2011 11:35:49 -0400
Subject: Fixes for SH-1994 and SH-2009

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

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index ab370a221f..d5619f5259 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -602,6 +602,8 @@ void LLFloaterModelPreview::onImportScaleCommit(LLUICtrl*,void* userdata)
 		return;
 	}
 
+	fp->mModelPreview->mDirty = true;
+
 	fp->toggleCalculateButton(true);
 
 	fp->mModelPreview->refresh();
@@ -616,6 +618,8 @@ void LLFloaterModelPreview::onPelvisOffsetCommit( LLUICtrl*, void* userdata )
 		return;
 	}
 
+	fp->mModelPreview->mDirty = true;
+
 	fp->toggleCalculateButton(true);
 
 	fp->mModelPreview->refresh();
-- 
cgit v1.2.3


From 0400143b4dc37308b60fb29ee6e593f80b6a953f Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Thu, 7 Jul 2011 10:51:13 -0600
Subject: fix for SH-1808: uploading warthog model triggers
 LLPhysicsDecomp::doDecompositionSingleHull warnings SH-1333: [PUBLIC] Simple
 mesh causing the viewer to crash

---
 indra/newview/llmeshrepository.cpp | 82 ++++++++++++++++++++++++++++----------
 indra/newview/llmeshrepository.h   |  2 +-
 2 files changed, 61 insertions(+), 23 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 4da5da9493..f3ceac9dbe 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -3321,24 +3321,27 @@ S32 LLPhysicsDecomp::llcdCallback(const char* status, S32 p1, S32 p2)
 	return 1;
 }
 
-void LLPhysicsDecomp::setMeshData(LLCDMeshData& mesh)
+void LLPhysicsDecomp::setMeshData(LLCDMeshData& mesh, bool vertex_based)
 {
 	mesh.mVertexBase = mCurRequest->mPositions[0].mV;
 	mesh.mVertexStrideBytes = 12;
 	mesh.mNumVertices = mCurRequest->mPositions.size();
 
-	mesh.mIndexType = LLCDMeshData::INT_16;
-	mesh.mIndexBase = &(mCurRequest->mIndices[0]);
-	mesh.mIndexStrideBytes = 6;
+	if(!vertex_based)
+	{
+		mesh.mIndexType = LLCDMeshData::INT_16;
+		mesh.mIndexBase = &(mCurRequest->mIndices[0]);
+		mesh.mIndexStrideBytes = 6;
 	
-	mesh.mNumTriangles = mCurRequest->mIndices.size()/3;
+		mesh.mNumTriangles = mCurRequest->mIndices.size()/3;
+	}
 
-	if (mesh.mNumTriangles > 0 && mesh.mNumVertices > 2)
+	if ((vertex_based || mesh.mNumTriangles > 0) && mesh.mNumVertices > 2)
 	{
 		LLCDResult ret = LLCD_OK;
 		if (LLConvexDecomposition::getInstance() != NULL)
 		{
-			ret  = LLConvexDecomposition::getInstance()->setMeshData(&mesh);
+			ret  = LLConvexDecomposition::getInstance()->setMeshData(&mesh, vertex_based);
 		}
 
 		if (ret)
@@ -3362,7 +3365,7 @@ void LLPhysicsDecomp::doDecomposition()
 	//load data intoLLCD
 	if (stage == 0)
 	{
-		setMeshData(mesh);
+		setMeshData(mesh, false);
 	}
 		
 	//build parameter map
@@ -3536,11 +3539,54 @@ void make_box(LLPhysicsDecomp::Request * request)
 
 void LLPhysicsDecomp::doDecompositionSingleHull()
 {
-	LLCDMeshData mesh;
+	LLConvexDecomposition* decomp = LLConvexDecomposition::getInstance();
+
+	if (decomp == NULL)
+	{
+		//stub. do nothing.
+		return;
+	}
 	
-	setMeshData(mesh);
+	LLCDMeshData mesh;	
+
+#if 1
+	setMeshData(mesh, true);
+
+	LLCDResult ret = decomp->buildSingleHull() ;
+	if(ret)
+	{
+		llwarns << "Could not execute decomposition stage when attempting to create single hull." << llendl;
+		make_box(mCurRequest);
+	}
+
+	mMutex->lock();
+	mCurRequest->mHull.clear();
+	mCurRequest->mHull.resize(1);
+	mCurRequest->mHullMesh.clear();
+	mMutex->unlock();
+
+	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);
+
+	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);
+	}
+						
+	mMutex->lock();
+	mCurRequest->mHull[0] = p;
+	mMutex->unlock();	
 			
-	
+#else
+	setMeshData(mesh, false);
+
 	//set all parameters to default
 	std::map<std::string, const LLCDParam*> param_map;
 
@@ -3549,23 +3595,15 @@ void LLPhysicsDecomp::doDecompositionSingleHull()
 
 	if (!params)
 	{
-		param_count = LLConvexDecomposition::getInstance()->getParameters(&params);
+		param_count = decomp->getParameters(&params);
 	}
 	
-	LLConvexDecomposition* decomp = LLConvexDecomposition::getInstance();
-
-	if (decomp == NULL)
-	{
-		//stub. do nothing.
-		return;
-	}
-
 	for (S32 i = 0; i < param_count; ++i)
 	{
 		decomp->setParam(params[i].mName, params[i].mDefault.mIntOrEnumValue);
 	}
 
-	const S32 STAGE_DECOMPOSE = mStageID["Decompose"];
+	const S32 STAGE_DECOMPOSE = mStageID["Decompose"];	
 	const S32 STAGE_SIMPLIFY = mStageID["Simplify"];
 	const S32 DECOMP_PREVIEW = 0;
 	const S32 SIMPLIFY_RETAIN = 0;
@@ -3627,7 +3665,7 @@ void LLPhysicsDecomp::doDecompositionSingleHull()
 			}
 		}
 	}
-
+#endif
 
 	{
 		completeCurrent();
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index f56734a7de..26cef1650a 100644
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -189,7 +189,7 @@ public:
 	static S32 llcdCallback(const char*, S32, S32);
 	void cancel();
 
-	void setMeshData(LLCDMeshData& mesh);
+	void setMeshData(LLCDMeshData& mesh, bool vertex_based);
 	void doDecomposition();
 	void doDecompositionSingleHull();
 
-- 
cgit v1.2.3


From 30a80ac4869c94dd57690ff80e71b481880bf5ea Mon Sep 17 00:00:00 2001
From: prep <prep@lindenlab.com>
Date: Thu, 7 Jul 2011 15:32:38 -0400
Subject: Fix for SH-1992

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

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index d5619f5259..58cf8dfd7e 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -5458,8 +5458,24 @@ void LLFloaterModelPreview::toggleCalculateButton()
 void LLFloaterModelPreview::toggleCalculateButton(bool visible)
 {
 	mCalculateBtn->setVisible(visible);
+
+	bool uploadingSkin		     = childGetValue("upload_skin").asBoolean();
+	bool uploadingJointPositions = childGetValue("upload_joints").asBoolean();
+	if ( uploadingSkin )
+	{
+		//Disable the calculate button *if* the rig is invalid - which is determined during the critiquing process
+		if ( uploadingJointPositions && !mModelPreview->isRigValidForJointPositionUpload() )
+		{
+			mCalculateBtn->setVisible( false );
+		}
+		else
+		if ( !mModelPreview->isLegacyRigValid() )
+		{			
+			mCalculateBtn->setVisible( false );
+		}
+	}
+	
 	mUploadBtn->setVisible(!visible);
-	//mUploadBtn->setEnabled(mHasUploadPerm);
 	mUploadBtn->setEnabled(mHasUploadPerm && !mUploadModelUrl.empty());
 
 	if (visible)
-- 
cgit v1.2.3


From 2a6e18d147a3ef3f5a8780233c1cef2f7b69af4a Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 7 Jul 2011 18:32:42 -0500
Subject: SH-1774 Fix for preserving material assignments between multiple
 custom LoDs.

---
 indra/newview/llfloatermodelpreview.cpp | 132 ++++++++++++++++----------------
 indra/newview/llfloatermodelpreview.h   |   5 +-
 indra/newview/llmeshrepository.cpp      |  54 ++++---------
 indra/newview/llmeshrepository.h        |   5 +-
 4 files changed, 89 insertions(+), 107 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index ab370a221f..6c6b124b39 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -103,6 +103,9 @@
 #include "llanimationstates.h"
 #include "glod/glod.h"
 
+
+const S32 SLM_SUPPORTED_VERSION = 2;
+
 //static
 S32 LLFloaterModelPreview::sUploadAmount = 10;
 LLFloaterModelPreview* LLFloaterModelPreview::sInstance = NULL;
@@ -410,8 +413,6 @@ BOOL LLFloaterModelPreview::postBuild()
 
 	childSetAction("reset_btn", onReset, this);
 
-	childSetAction("clear_materials", onClearMaterials, this);
-
 	childSetCommitCallback("preview_lod_combo", onPreviewLODCommit, this);
 
 	childSetCommitCallback("upload_skin", onUploadSkinCommit, this);
@@ -1941,8 +1942,11 @@ bool LLModelLoader::doLoadModel()
 								mesh_scale *= transformation;
 								transformation = mesh_scale;
 								
-								std::vector<LLImportMaterial> materials;
-								materials.resize(model->getNumVolumeFaces());
+								std::map<std::string, LLImportMaterial> materials;
+								for (U32 i = 0; i < model->mMaterialList.size(); ++i)
+								{
+									materials[model->mMaterialList[i]] = LLImportMaterial();
+								}
 								mScene[transformation].push_back(LLModelInstance(model, model->mLabel, transformation, materials));
 								stretch_extents(model, transformation, mExtents[0], mExtents[1], mFirstTransform);
 							}
@@ -2004,6 +2008,11 @@ bool LLModelLoader::loadFromSLM(const std::string& filename)
 	//build model list for each LoD
 	model_list model[LLModel::NUM_LODS];
 
+	if (data["version"].asInteger() != SLM_SUPPORTED_VERSION)
+	{  //unsupported version
+		return false;
+	}
+
 	LLSD& mesh = data["mesh"];
 
 	LLVolumeParams volume_params;
@@ -2321,14 +2330,17 @@ void LLModelLoader::loadTextures()
 	{
 		for(U32 i = 0 ; i < iter->second.size(); i++)
 		{
-			for(U32 j = 0 ; j < iter->second[i].mMaterial.size() ; j++)
+			for(std::map<std::string, LLImportMaterial>::iterator j = iter->second[i].mMaterial.begin();
+				j != iter->second[i].mMaterial.end(); ++j)
 			{
-				if(!iter->second[i].mMaterial[j].mDiffuseMapFilename.empty())
+				LLImportMaterial& material = j->second;
+
+				if(!material.mDiffuseMapFilename.empty())
 				{
-					iter->second[i].mMaterial[j].mDiffuseMap = 
-						LLViewerTextureManager::getFetchedTextureFromUrl("file://" + iter->second[i].mMaterial[j].mDiffuseMapFilename, TRUE, LLViewerTexture::BOOST_PREVIEW);
-					iter->second[i].mMaterial[j].mDiffuseMap->setLoadedCallback(LLModelPreview::textureLoadedCallback, 0, TRUE, FALSE, mPreview, NULL, FALSE);
-					iter->second[i].mMaterial[j].mDiffuseMap->forceToSaveRawImage(0, F32_MAX);
+					material.mDiffuseMap = 
+						LLViewerTextureManager::getFetchedTextureFromUrl("file://" + material.mDiffuseMapFilename, TRUE, LLViewerTexture::BOOST_PREVIEW);
+					material.mDiffuseMap->setLoadedCallback(LLModelPreview::textureLoadedCallback, 0, TRUE, FALSE, mPreview, NULL, FALSE);
+					material.mDiffuseMap->forceToSaveRawImage(0, F32_MAX);
 					mNumOfFetchingTextures++ ;
 				}
 			}
@@ -2628,7 +2640,7 @@ void LLModelLoader::processElement( daeElement* element, bool& badElement )
 				{
 					LLMatrix4 transformation = mTransform;
 
-					std::vector<LLImportMaterial> materials = getMaterials(model, instance_geo);
+					std::map<std::string, LLImportMaterial> materials = getMaterials(model, instance_geo);
 
 					// adjust the transformation to compensate for mesh normalization
 					LLVector3 mesh_scale_vector;
@@ -2684,9 +2696,9 @@ void LLModelLoader::processElement( daeElement* element, bool& badElement )
 	}
 }
 
-std::vector<LLImportMaterial> LLModelLoader::getMaterials(LLModel* model, domInstance_geometry* instance_geo)
+std::map<std::string, LLImportMaterial> LLModelLoader::getMaterials(LLModel* model, domInstance_geometry* instance_geo)
 {
-	std::vector<LLImportMaterial> materials;
+	std::map<std::string, LLImportMaterial> materials;
 	for (int i = 0; i < model->mMaterialList.size(); i++)
 	{
 		LLImportMaterial import_material;
@@ -2733,7 +2745,8 @@ std::vector<LLImportMaterial> LLModelLoader::getMaterials(LLModel* model, domIns
 			}
 		}
 
-		materials.push_back(import_material);
+		import_material.mBinding = model->mMaterialList[i];
+		materials[model->mMaterialList[i]] = import_material;
 	}
 
 	return materials;
@@ -3118,6 +3131,19 @@ void LLModelPreview::rebuildUploadData()
 		mFMP->childEnable("ok_btn");
 	}
 
+	//reorder materials to match mBaseModel
+	for (U32 i = 0; i < LLModel::NUM_LODS; i++)
+	{
+		if (mBaseModel.size() == mModel[i].size())
+		{
+			for (U32 j = 0; j < mBaseModel.size(); ++j)
+			{
+				mModel[i][j]->matchMaterialOrder(mBaseModel[j]);
+				llassert(mModel[i][j]->mMaterialList == mBaseModel[j]->mMaterialList);
+			}
+		}
+	}
+
 	for (LLModelLoader::scene::iterator iter = mBaseScene.begin(); iter != mBaseScene.end(); ++iter)
 	{ //for each transform in scene
 		LLMatrix4 mat = iter->first;
@@ -3216,6 +3242,8 @@ void LLModelPreview::saveUploadData(const std::string& filename, bool save_skinw
 
 	LLSD data;
 
+	data["version"] = SLM_SUPPORTED_VERSION;
+
 	S32 mesh_id = 0;
 
 	//build list of unique models and initialize local id
@@ -3591,43 +3619,6 @@ void LLModelPreview::generateNormals()
 	updateStatusMessages();
 }
 
-void LLModelPreview::clearMaterials()
-{
-	for (LLModelLoader::scene::iterator iter = mScene[mPreviewLOD].begin(); iter != mScene[mPreviewLOD].end(); ++iter)
-	{ //for each transform in current scene
-		for (LLModelLoader::model_instance_list::iterator model_iter = iter->second.begin(); model_iter != iter->second.end(); ++model_iter)
-		{ //for each instance with that transform
-			LLModelInstance& source_instance = *model_iter;
-			LLModel* source = source_instance.mModel;
-
-			for (S32 i = 0; i < source->getNumVolumeFaces(); ++i)
-			{ //for each face in instance
-				LLImportMaterial& source_material = source_instance.mMaterial[i];
-
-				//clear material info
-				source_material.mDiffuseColor = LLColor4(1,1,1,1);
-				source_material.mDiffuseMap = NULL;
-				source_material.mDiffuseMapFilename.clear();
-				source_material.mDiffuseMapLabel.clear();
-				source_material.mFullbright = false;
-			}
-		}
-	}
-
-	mVertexBuffer[mPreviewLOD].clear();
-
-	if (mPreviewLOD == LLModel::LOD_HIGH)
-	{
-		mBaseScene = mScene[mPreviewLOD];
-		mBaseModel = mModel[mPreviewLOD];
-		clearGLODGroup();
-		mVertexBuffer[5].clear();
-	}
-
-	mResourceCost = calcResourceCost();
-	refresh();
-}
-
 void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_limit)
 {
 	if (mBaseModel.empty())
@@ -4897,6 +4888,19 @@ BOOL LLModelPreview::render()
 			}
 		}
 
+		//DEBUG -- make sure material lists all match
+		for (U32 i = 0; i < LLModel::NUM_LODS; i++)
+		{
+			if (mBaseModel.size() == mModel[i].size())
+			{
+				for (U32 j = 0; j < mBaseModel.size(); ++j)
+				{
+					mModel[i][j]->matchMaterialOrder(mBaseModel[j]);
+					llassert(mModel[i][j]->mMaterialList == mBaseModel[j]->mMaterialList);
+				}
+			}
+		}
+
 		if (regen)
 		{
 			genBuffers(mPreviewLOD, skin_weight);
@@ -4928,13 +4932,18 @@ BOOL LLModelPreview::render()
 
 					if (textures)
 					{
-						glColor4fv(instance.mMaterial[i].mDiffuseColor.mV);
-						if (i < instance.mMaterial.size() && instance.mMaterial[i].mDiffuseMap.notNull())
+						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())
 						{
-							if (instance.mMaterial[i].mDiffuseMap->getDiscardLevel() > -1)
+							if (material.mDiffuseMap->getDiscardLevel() > -1)
 							{
-								gGL.getTexUnit(0)->bind(instance.mMaterial[i].mDiffuseMap, true);
-								mTextureSet.insert(instance.mMaterial[i].mDiffuseMap.get());
+								gGL.getTexUnit(0)->bind(material.mDiffuseMap, true);
+								mTextureSet.insert(material.mDiffuseMap.get());
 							}
 						}
 					}
@@ -5234,8 +5243,10 @@ BOOL LLModelPreview::render()
 								position[j] = v;
 							}
 
+							const std::string& binding = instance.mModel->mMaterialList[i];
+							const LLImportMaterial& material = instance.mMaterial[binding];
 							buffer->setBuffer(type_mask & buffer->getTypeMask());
-							glColor4fv(instance.mMaterial[i].mDiffuseColor.mV);
+							glColor4fv(material.mDiffuseColor.mV);
 							gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 							buffer->draw(LLRender::TRIANGLES, buffer->getNumIndices(), 0);
 							glColor3f(0.4f, 0.4f, 0.4f);
@@ -5383,13 +5394,6 @@ void LLFloaterModelPreview::onUpload(void* user_data)
 }
 
 
-//static
-void LLFloaterModelPreview::onClearMaterials(void* user_data)
-{
-	LLFloaterModelPreview* mp = (LLFloaterModelPreview*) user_data;
-	mp->mModelPreview->clearMaterials();
-}
-
 //static
 void LLFloaterModelPreview::refresh(LLUICtrl* ctrl, void* user_data)
 {
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index 56098c6250..e252c9a677 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -109,7 +109,7 @@ public:
 
 	void loadTextures() ; //called in the main thread.
 	void processElement(daeElement* element, bool& badElement);
-	std::vector<LLImportMaterial> getMaterials(LLModel* model, domInstance_geometry* instance_geo);
+	std::map<std::string, LLImportMaterial> getMaterials(LLModel* model, domInstance_geometry* instance_geo);
 	LLImportMaterial profileToMaterial(domProfile_COMMON* material);
 	std::string getElementLabel(daeElement *element);
 	LLColor4 getDaeColor(daeElement* element);
@@ -182,8 +182,6 @@ public:
 
 	static void onUpload(void* data);
 	
-	static void onClearMaterials(void* data);
-	
 	static void refresh(LLUICtrl* ctrl, void* data);
 	
 	void updateResourceCost();
@@ -330,7 +328,6 @@ public:
 	void loadModelCallback(S32 lod);
 	void genLODs(S32 which_lod = -1, U32 decimation = 3, bool enforce_tri_limit = false);
 	void generateNormals();
-	void clearMaterials();
 	U32 calcResourceCost();
 	void rebuildUploadData();
 	void saveUploadData(bool save_skinweights, bool save_joint_poisitions);
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index a06422a177..9e4b749ea1 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -36,7 +36,6 @@
 #include "llbufferstream.h"
 #include "llcurl.h"
 #include "lldatapacker.h"
-#include "llfasttimer.h"
 #include "llfloatermodelpreview.h"
 #include "llfloaterperms.h"
 #include "lleconomy.h"
@@ -72,9 +71,6 @@
 
 #include <queue>
 
-LLFastTimer::DeclareTimer FTM_MESH_UPDATE("Mesh Update");
-LLFastTimer::DeclareTimer FTM_LOAD_MESH("Load Mesh");
-
 LLMeshRepository gMeshRepo;
 
 const U32 MAX_MESH_REQUESTS_PER_SECOND = 100;
@@ -1410,12 +1406,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
 
 			for (S32 face_num = 0; face_num < data.mBaseModel->getNumVolumeFaces(); face_num++)
 			{
-				if(face_num >= instance.mMaterial.size())
-				{
-					break ;
-				}
-
-				LLImportMaterial& material = instance.mMaterial[face_num];
+				LLImportMaterial& material = instance.mMaterial[data.mBaseModel->mMaterialList[face_num]];
 				LLSD face_entry = LLSD::emptyMap();
 				LLViewerFetchedTexture *texture = material.mDiffuseMap.get();
 				
@@ -1580,9 +1571,6 @@ void LLMeshUploadThread::requestWholeModelFee()
 	mFinished = true;
 }
 
-static LLFastTimer::DeclareTimer FTM_NOTIFY_MESH_LOADED("Notify Loaded");
-static LLFastTimer::DeclareTimer FTM_NOTIFY_MESH_UNAVAILABLE("Notify Unavailable");
-
 void LLMeshRepoThread::notifyLoadedMeshes()
 {
 	while (!mLoadedQ.empty())
@@ -2146,8 +2134,6 @@ S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_para
 		return detail;
 	}
 
-	LLFastTimer t(FTM_LOAD_MESH); 
-
 	{
 		LLMutexLock lock(mMeshMutex);
 		//add volume to list of loading meshes
@@ -2223,11 +2209,6 @@ S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_para
 	return detail;
 }
 
-static LLFastTimer::DeclareTimer FTM_START_MESH_THREAD("Start Thread");
-static LLFastTimer::DeclareTimer FTM_LOAD_MESH_LOD("Load LOD");
-static LLFastTimer::DeclareTimer FTM_MESH_LOCK1("Lock 1");
-static LLFastTimer::DeclareTimer FTM_MESH_LOCK2("Lock 2");
-
 void LLMeshRepository::notifyLoadedMeshes()
 { //called from main thread
 
@@ -2293,18 +2274,9 @@ void LLMeshRepository::notifyLoadedMeshes()
 		}
 	}
 
-	LLFastTimer t(FTM_MESH_UPDATE);
-
-	{
-		LLFastTimer t(FTM_MESH_LOCK1);
-		mMeshMutex->lock();	
-	}
-
-	{
-		LLFastTimer t(FTM_MESH_LOCK2);
-		mThread->mMutex->lock();
-	}
-	
+	mMeshMutex->lock();	
+	mThread->mMutex->lock();
+		
 	//popup queued error messages from background threads
 	while (!mUploadErrorQ.empty())
 	{
@@ -2356,7 +2328,6 @@ void LLMeshRepository::notifyLoadedMeshes()
 
 		while (!mPendingRequests.empty() && push_count > 0)
 		{
-			LLFastTimer t(FTM_LOAD_MESH_LOD);
 			LLMeshRepoThread::LODRequest& request = mPendingRequests.front();
 			mThread->loadMeshLOD(request.mMeshParams, request.mLOD);
 			mPendingRequests.erase(mPendingRequests.begin());
@@ -2757,6 +2728,11 @@ bool LLImportMaterial::operator<(const LLImportMaterial &rhs) const
 		return mDiffuseColor < rhs.mDiffuseColor;
 	}
 
+	if (mBinding != rhs.mBinding)
+	{
+		return mBinding < rhs.mBinding;
+	}
+
 	return mFullbright < rhs.mFullbright;
 }
 
@@ -3391,7 +3367,8 @@ LLModelInstance::LLModelInstance(LLSD& data)
 
 	for (U32 i = 0; i < data["material"].size(); ++i)
 	{
-		mMaterial.push_back(LLImportMaterial(data["material"][i]));
+		LLImportMaterial mat(data["material"][i]);
+		mMaterial[mat.mBinding] = mat;
 	}
 }
 
@@ -3404,9 +3381,10 @@ LLSD LLModelInstance::asLLSD()
 	ret["label"] = mLabel;
 	ret["transform"] = mTransform.getValue();
 	
-	for (U32 i = 0; i < mMaterial.size(); ++i)
+	U32 i = 0;
+	for (std::map<std::string, LLImportMaterial>::iterator iter = mMaterial.begin(); iter != mMaterial.end(); ++iter)
 	{
-		ret["material"][i] = mMaterial[i].asLLSD();
+		ret["material"][i++] = iter->second.asLLSD();
 	}
 
 	return ret;
@@ -3418,6 +3396,7 @@ LLImportMaterial::LLImportMaterial(LLSD& data)
 	mDiffuseMapLabel = data["diffuse"]["label"].asString();
 	mDiffuseColor.setValue(data["diffuse"]["color"]);
 	mFullbright = data["fullbright"].asBoolean();
+	mBinding = data["binding"].asString();
 }
 
 
@@ -3429,7 +3408,8 @@ LLSD LLImportMaterial::asLLSD()
 	ret["diffuse"]["label"] = mDiffuseMapLabel;
 	ret["diffuse"]["color"] = mDiffuseColor.getValue();
 	ret["fullbright"] = mFullbright;
-	
+	ret["binding"] = mBinding;
+
 	return ret;
 }
 
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index 74a08a998f..d775e8f74a 100755
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -92,6 +92,7 @@ public:
 	LLPointer<LLViewerFetchedTexture> mDiffuseMap;
 	std::string mDiffuseMapFilename;
 	std::string mDiffuseMapLabel;
+	std::string mBinding;
 	LLColor4 mDiffuseColor;
 	bool mFullbright;
 
@@ -120,9 +121,9 @@ public:
 	S32 mLocalMeshID;
 
 	LLMatrix4 mTransform;
-	std::vector<LLImportMaterial> mMaterial;
+	std::map<std::string, LLImportMaterial> mMaterial;
 
-	LLModelInstance(LLModel* model, const std::string& label, LLMatrix4& transform, std::vector<LLImportMaterial>& materials)
+	LLModelInstance(LLModel* model, const std::string& label, LLMatrix4& transform, std::map<std::string, LLImportMaterial>& materials)
 		: mModel(model), mLabel(label), mTransform(transform), mMaterial(materials)
 	{
 		mLocalMeshID = -1;
-- 
cgit v1.2.3


From c2e93ef931eb8e952502864cd857e37b23a4b834 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 7 Jul 2011 18:38:45 -0500
Subject: SH-1774 Remove misleading "Debug" comment -- this code performs a
 function.

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

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 6c6b124b39..489a1e4434 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -4888,7 +4888,7 @@ BOOL LLModelPreview::render()
 			}
 		}
 
-		//DEBUG -- make sure material lists all match
+		//make sure material lists all match
 		for (U32 i = 0; i < LLModel::NUM_LODS; i++)
 		{
 			if (mBaseModel.size() == mModel[i].size())
-- 
cgit v1.2.3


From 48c0d9c517a2473c87058587318fa893c5229bfb Mon Sep 17 00:00:00 2001
From: prep linden <prep@lindenlab.com>
Date: Fri, 8 Jul 2011 11:43:04 -0400
Subject: Fix for sh-2012 removed upload wizard option

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

(limited to 'indra/newview')

diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index a0d0c8625e..598f500e4f 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -993,19 +993,7 @@
             <menu_item_call.on_visible
             function="File.VisibleUploadModel"/>
             </menu_item_call>
-			<menu_item_call
-           label="Model Wizard..."
-           layout="topleft"
-           name="Upload Model Wizard">
-				<menu_item_call.on_click
-				 function="Floater.Show"
-				 parameter="upload_model_wizard" />
-				<menu_item_call.on_enable
-				 function="File.EnableUploadModel" />
-				<menu_item_call.on_visible
-				function="File.VisibleUploadModel"/>
-			</menu_item_call>
-            <menu_item_call
+	   <menu_item_call
              label="Bulk (L$[COST] per file)..."
              layout="topleft"
              name="Bulk Upload">
-- 
cgit v1.2.3


From 4bc77c55039e46ac8def09ebe167aa9c84191e7a Mon Sep 17 00:00:00 2001
From: prep linden <prep@lindenlab.com>
Date: Fri, 8 Jul 2011 16:15:26 -0400
Subject: Fix for sh-2016

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

(limited to 'indra/newview')

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 7f15de7236..701661ed3f 100644
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -15,7 +15,7 @@
   <string name="low">Low</string>
   <string name="lowest">Lowest</string>
   <string name="mesh_status_good">Ship it!</string>
-  <string name="mesh_status_na">N/A</string>
+  <string name="mesh_status_na">N/A<c/string>
   <string name="mesh_status_none">None</string>
   <string name="mesh_status_submesh_mismatch">Levels of detail have a different number of textureable faces.</string>
   <string name="mesh_status_mesh_mismatch">Levels of detail have a different number of mesh instances.</string>
@@ -93,7 +93,7 @@
      top_pad="5"
      wrap="true"
      visible="false">
-     You will not be able to complete the final upload of this model to the Second Life servers. [secondlife:///app/floater/learn_more Find out how] to get certifed for mesh model uploads.
+     You will not be able to complete the final upload of this model to the Second Life servers. [secondlife:///app/floater/learn_more Find out how] to get enabled for mesh model uploads.
     </text>
 
   <tab_container
-- 
cgit v1.2.3


From 615cc856a8abf44f62c58962f8b53178f9708ee3 Mon Sep 17 00:00:00 2001
From: prep linden <prep@lindenlab.com>
Date: Fri, 8 Jul 2011 16:17:34 -0400
Subject: Fix for sh-2016 Removed extra char

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

(limited to 'indra/newview')

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 701661ed3f..a5fa7fbf0b 100644
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -15,7 +15,7 @@
   <string name="low">Low</string>
   <string name="lowest">Lowest</string>
   <string name="mesh_status_good">Ship it!</string>
-  <string name="mesh_status_na">N/A<c/string>
+  <string name="mesh_status_na">N/A</string>
   <string name="mesh_status_none">None</string>
   <string name="mesh_status_submesh_mismatch">Levels of detail have a different number of textureable faces.</string>
   <string name="mesh_status_mesh_mismatch">Levels of detail have a different number of mesh instances.</string>
-- 
cgit v1.2.3


From 7b102270f5bee9dbfd36a2afb5c6fc32a773abea Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 8 Jul 2011 23:32:30 -0500
Subject: SH-2007 Don't eat an entire core when uploading meshes or requesting
 fee information.

---
 indra/newview/llmeshrepository.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 9e4b749ea1..2e5d65afaf 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -1532,6 +1532,8 @@ void LLMeshUploadThread::doWholeModelUpload()
 		do
 		{
 			mCurlRequest->process();
+			//sleep for 10ms to prevent eating a whole core
+			apr_sleep(10000);
 		} while (mCurlRequest->getQueued() > 0);
 	}
 
@@ -1562,6 +1564,8 @@ void LLMeshUploadThread::requestWholeModelFee()
 	do
 	{
 		mCurlRequest->process();
+		//sleep for 10ms to prevent eating a whole core
+		apr_sleep(10000);
 	} while (mCurlRequest->getQueued() > 0);
 
 	delete mCurlRequest;
@@ -2018,10 +2022,9 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason,
 
 				if (remaining < 0 || remaining > 4096)
 				{
-					llerrs << "Bad padding of mesh asset cache entry." << llendl;
+					llwarns << "Bad padding of mesh asset cache entry." << llendl;
 				}
-
-				if (remaining > 0)
+				else if (remaining > 0)
 				{
 					file.write(block, remaining);
 				}
-- 
cgit v1.2.3


From 7029c8ff534419a3bcfd0e5fc39a4739e4cdc19c Mon Sep 17 00:00:00 2001
From: Don Kjer <don@lindenlab.com>
Date: Sat, 9 Jul 2011 14:58:14 -0700
Subject: Fix for SH-2028.  Also fixed layout issues with new upload warning
 and upload price text when floater is resized.

---
 indra/newview/llfloatermodelpreview.cpp            | 15 +++++---
 indra/newview/llfloatermodelpreview.h              |  2 +-
 indra/newview/llfloatermodeluploadbase.h           |  2 +-
 indra/newview/llfloatermodelwizard.cpp             |  3 +-
 indra/newview/llfloatermodelwizard.h               |  2 +-
 indra/newview/llmeshrepository.cpp                 |  6 ++--
 indra/newview/lluploadfloaterobservers.h           |  2 +-
 .../skins/default/xui/en/floater_model_preview.xml | 40 +++++++++++++++++-----
 8 files changed, 50 insertions(+), 22 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index eb48955a64..1522f041c1 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -5486,18 +5486,23 @@ void LLFloaterModelPreview::toggleCalculateButton(bool visible)
 	{
 		std::string tbd = getString("tbd");
 		childSetTextArg("weights", "[EQ]", tbd);
+		childSetTextArg("weights", "[ST]", tbd);
+		childSetTextArg("weights", "[SIM]", tbd);
 		childSetTextArg("weights", "[PH]", tbd);
-		childSetTextArg("weights", "[FEE]", tbd);
+		childSetTextArg("upload_fee", "[FEE]", tbd);
 	}
 }
 
-void LLFloaterModelPreview::onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url)
+void LLFloaterModelPreview::onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url)
 {
 	mUploadModelUrl = upload_url;
-	childSetTextArg("weights", "[EQ]", llformat("%d", mModelPreview->mResourceCost));
-	childSetTextArg("weights", "[PH]", llformat("%.3f", physics));
-	childSetTextArg("weights", "[FEE]", llformat("%d", fee));
+	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("upload_fee", "[FEE]", llformat("%d", result["upload_price"].asInteger()));
 	childSetVisible("weights", true);
+	childSetVisible("upload_fee", true);
 	mUploadBtn->setEnabled(mHasUploadPerm && !mUploadModelUrl.empty());
 }
 
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index e252c9a677..fb4a39535d 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -202,7 +202,7 @@ public:
 	// called when error occurs during permissions request
 	/*virtual*/ void setPermissonsErrorStatus(U32 status, const std::string& reason);
 
-	/*virtual*/ void onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url);
+	/*virtual*/ void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url);
 
 	/*virtual*/ void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason);
 
diff --git a/indra/newview/llfloatermodeluploadbase.h b/indra/newview/llfloatermodeluploadbase.h
index 6d1282dbd6..a52bc28687 100644
--- a/indra/newview/llfloatermodeluploadbase.h
+++ b/indra/newview/llfloatermodeluploadbase.h
@@ -41,7 +41,7 @@ public:
 
 	virtual void onPermissionsReceived(const LLSD& result) = 0;
 
-	virtual void onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url) = 0;
+	virtual void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) = 0;
 
 	virtual void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason) = 0;
 
diff --git a/indra/newview/llfloatermodelwizard.cpp b/indra/newview/llfloatermodelwizard.cpp
index 7efcdb6145..b517b78e5a 100644
--- a/indra/newview/llfloatermodelwizard.cpp
+++ b/indra/newview/llfloatermodelwizard.cpp
@@ -488,7 +488,7 @@ void LLFloaterModelWizard::setPermissonsErrorStatus(U32 status, const std::strin
 }
 
 /*virtual*/
-void LLFloaterModelWizard::onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url)
+void LLFloaterModelWizard::onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url)
 {
 	swap_controls(mCalculateWeightsBtn, mCalculatingWeightsBtn, true);
 
@@ -498,6 +498,7 @@ void LLFloaterModelWizard::onModelPhysicsFeeReceived(F64 physics, S32 fee, std::
 
 	mUploadModelUrl = upload_url;
 
+	S32 fee = result["upload_price"].asInteger();
 	childSetTextArg("review_fee", "[FEE]", llformat("%d", fee));
 	childSetTextArg("charged_fee", "[FEE]", llformat("%d", fee));
 
diff --git a/indra/newview/llfloatermodelwizard.h b/indra/newview/llfloatermodelwizard.h
index ea60cf5db8..db9b605777 100644
--- a/indra/newview/llfloatermodelwizard.h
+++ b/indra/newview/llfloatermodelwizard.h
@@ -76,7 +76,7 @@ public:
 	// called when error occurs during permissions request
 	/*virtual*/ void setPermissonsErrorStatus(U32 status, const std::string& reason);
 
-	/*virtual*/ void onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url);
+	/*virtual*/ void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url);
 
 	/*virtual*/ void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason);
 
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 9e4b749ea1..6389f08f29 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -369,10 +369,8 @@ public:
 
 			if (observer)
 			{
-				S32 fee = cc["upload_price"].asInteger();
-				F64 phys = cc["data"]["physics_cost"].asReal();
-
-				observer->onModelPhysicsFeeReceived(phys, fee, mThread->mWholeModelUploadURL);
+				cc["data"]["upload_price"] = cc["upload_price"];
+				observer->onModelPhysicsFeeReceived(cc["data"], mThread->mWholeModelUploadURL);
 			}
 		}
 		else
diff --git a/indra/newview/lluploadfloaterobservers.h b/indra/newview/lluploadfloaterobservers.h
index c912c9755a..79aad282d7 100644
--- a/indra/newview/lluploadfloaterobservers.h
+++ b/indra/newview/lluploadfloaterobservers.h
@@ -53,7 +53,7 @@ public:
 	LLWholeModelFeeObserver() { mWholeModelFeeObserverHandle.bind(this); }
 	virtual ~LLWholeModelFeeObserver() {}
 
-	virtual void onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url) = 0;
+	virtual void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) = 0;
 	virtual void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason) = 0;
 
 	LLHandle<LLWholeModelFeeObserver> getWholeModelFeeObserverHandle() const { return mWholeModelFeeObserverHandle; }
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 a5fa7fbf0b..52377b60c5 100644
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -74,28 +74,50 @@
     follows="all"/>
     
     <text
-     follows="top|left"
      font="SansSerif"
+	 bottom_delta="15"
      left_delta="0"
      name="warning_title"
      text_color="Yellow"
-     top_pad="10"
      visible="false">
      WARNING:
     </text>
     <text
-     follows="top|left"
      text_color="White"
      height="50"
+	 width="290"
+	 top_delta="15"
      left_delta="0"
      name="warning_message"
      parse_urls="true"
-     top_pad="5"
      wrap="true"
      visible="false">
      You will not be able to complete the final upload of this model to the Second Life servers. [secondlife:///app/floater/learn_more Find out how] to get enabled for mesh model uploads.
     </text>
 
+  <text
+	height="50"
+	top_delta="55"
+	left_delta="0"
+	name="weights"
+	width="290"
+	word_wrap="true" 
+	>
+	<text
+		follows="top|left"
+	>Test0: [EQ]
+	</text>
+	<text
+	>Test: [ST]
+	</text>
+Streaming: [ST]
+Simulation: [SIM]
+Physics: [PH]
+Prim equivs: [EQ]
+  </text>
+  
+
+
   <tab_container
     follows="right|top|bottom"
     top="15"
@@ -407,12 +429,14 @@
 
   <text
 	height="16"
-	left="310"
-	name="weights"
+	left_delta="5"
+	bottom_delta="30"
+	name="upload_fee"
 	width="300"
+	follows="bottom|right"
 	word_wrap="true" 
-	top_pad="7">
-	    Prim equivs: [EQ] Physics: [PH] Upload fee: [FEE] L$
+	>
+	    Upload fee: L$ [FEE]
   </text>
   
   <button bottom="540" left="10"  follows="bottom|left" height="20" label="Set to defaults"
-- 
cgit v1.2.3


From 29d5413ea6c2d0782ab55916d9d9428ae00c1ace Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Sat, 9 Jul 2011 17:01:33 -0500
Subject: SH-2007 Code cleanup, expand minimum header size to 4KB, better
 comments around magic numbers, remove dead calcResourceCost

---
 indra/newview/app_settings/settings.xml            | 11 ----
 indra/newview/llfloatermodelpreview.cpp            | 22 +-------
 indra/newview/llfloatermodelpreview.h              |  2 -
 indra/newview/llmeshrepository.cpp                 | 58 ++++------------------
 indra/newview/llmeshrepository.h                   |  8 +--
 indra/newview/llviewerwindow.cpp                   | 13 -----
 indra/newview/pipeline.cpp                         | 57 ---------------------
 indra/newview/skins/default/xui/en/menu_viewer.xml |  5 +-
 8 files changed, 15 insertions(+), 161 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 2372c19fb9..e69fce6c6d 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -1935,17 +1935,6 @@
       <key>Value</key>
       <integer>0</integer>
     </map>
-  <key>DebugShowUploadCost</key>
-  <map>
-    <key>Comment</key>
-    <string>Show what it would cost to upload assets in current scene</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>Boolean</string>
-    <key>Value</key>
-    <integer>0</integer>
-  </map>
   <key>DebugShowRenderMatrices</key>
   <map>
     <key>Comment</key>
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index eb48955a64..b5a1bceebf 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -407,7 +407,6 @@ BOOL LLFloaterModelPreview::postBuild()
 
 	childSetTextArg("status", "[STATUS]", getString("status_idle"));
 
-	//childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d",sUploadAmount));
 	childSetAction("ok_btn", onUpload, this);
 	childDisable("ok_btn");
 
@@ -780,15 +779,6 @@ void LLFloaterModelPreview::draw()
 		childSetVisible("decompose_cancel", false);
 	}
 	
-	U32 resource_cost = mModelPreview->mResourceCost*10;
-
-	if (childGetValue("upload_textures").asBoolean())
-	{
-		resource_cost += mModelPreview->mTextureSet.size()*10;
-	}
-
-	childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d", resource_cost));
-
 	if (mModelPreview)
 	{
 		gGL.color3f(1.f, 1.f, 1.f);
@@ -3012,7 +3002,6 @@ U32 LLModelPreview::calcResourceCost()
 		//ok_btn should not have been changed unless something was wrong with joint list
 	}
 	
-	U32 cost = 0;
 	std::set<LLModel*> accounted;
 	U32 num_points = 0;
 	U32 num_hulls = 0;
@@ -3060,8 +3049,7 @@ U32 LLModelPreview::calcResourceCost()
 					   mFMP->childGetValue("upload_skin").asBoolean(),
 					   mFMP->childGetValue("upload_joints").asBoolean(),
 					   TRUE);
-			cost += gMeshRepo.calcResourceCost(ret);
-
+			
 			num_hulls += decomp.mHull.size();
 			for (U32 i = 0; i < decomp.mHull.size(); ++i)
 			{
@@ -3093,7 +3081,7 @@ U32 LLModelPreview::calcResourceCost()
 
 	updateStatusMessages();
 
-	return cost;
+	return streaming_cost;
 }
 
 void LLFloaterModelPreview::setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost)
@@ -5405,12 +5393,6 @@ void LLFloaterModelPreview::refresh(LLUICtrl* ctrl, void* user_data)
 	sInstance->mModelPreview->mDirty = true;
 }
 
-void LLFloaterModelPreview::updateResourceCost()
-{
-	U32 cost = mModelPreview->mResourceCost;
-	childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d",cost));
-}
-
 //static
 void LLModelPreview::textureLoadedCallback( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata )
 {
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index e252c9a677..f434987b9e 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -184,8 +184,6 @@ public:
 	
 	static void refresh(LLUICtrl* ctrl, void* data);
 	
-	void updateResourceCost();
-	
 	void			loadModel(S32 lod);
 	void 			loadModel(S32 lod, const std::string& file_name, bool force_disable_slm = false);
 	
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 2e5d65afaf..158ca56148 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -664,7 +664,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id)
 	}
 
 	U32 header_size = mMeshHeaderSize[mesh_id];
-
+	
 	if (header_size > 0)
 	{
 		S32 version = mMeshHeader[mesh_id]["version"].asInteger();
@@ -684,7 +684,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id)
 				U8* buffer = new U8[size];
 				file.read(buffer, size);
 
-				//make sure buffer isn't all 0's (reserved block but not written)
+				//make sure buffer isn't all 0's by checking the first 1KB (reserved block but not written)
 				bool zero = true;
 				for (S32 i = 0; i < llmin(size, 1024) && zero; ++i)
 				{
@@ -757,7 +757,7 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id)
 				U8* buffer = new U8[size];
 				file.read(buffer, size);
 
-				//make sure buffer isn't all 0's (reserved block but not written)
+				//make sure buffer isn't all 0's by checking the first 1KB (reserved block but not written)
 				bool zero = true;
 				for (S32 i = 0; i < llmin(size, 1024) && zero; ++i)
 				{
@@ -830,7 +830,7 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id)
 				U8* buffer = new U8[size];
 				file.read(buffer, size);
 
-				//make sure buffer isn't all 0's (reserved block but not written)
+				//make sure buffer isn't all 0's by checking the first 1KB (reserved block but not written)
 				bool zero = true;
 				for (S32 i = 0; i < llmin(size, 1024) && zero; ++i)
 				{
@@ -887,9 +887,9 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params)
 		S32 size = file.getSize();
 
 		if (size > 0)
-		{
-			U8 buffer[1024];
-			S32 bytes = llmin(size, 1024);
+		{ //NOTE -- if the header size is ever more than 4KB, this will break
+			U8 buffer[4096];
+			S32 bytes = llmin(size, 4096);
 			LLMeshRepository::sCacheBytesRead += bytes;	
 			file.read(buffer, bytes);
 			if (headerReceived(mesh_params, buffer, bytes))
@@ -911,6 +911,7 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params)
 		retval = true;
 		//grab first 4KB if we're going to bother with a fetch.  Cache will prevent future fetches if a full mesh fits
 		//within the first 4KB
+		//NOTE -- this will break of headers ever exceed 4KB
 		LLMeshRepository::sHTTPRequestCount++;
 		mCurlRequest->getByteRange(http_url, headers, 0, 4096, new LLMeshHeaderResponder(mesh_params));
 	}
@@ -947,7 +948,7 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod)
 				U8* buffer = new U8[size];
 				file.read(buffer, size);
 
-				//make sure buffer isn't all 0's (reserved block but not written)
+				//make sure buffer isn't all 0's by checking the first 1KB (reserved block but not written)
 				bool zero = true;
 				for (S32 i = 0; i < llmin(size, 1024) && zero; ++i)
 				{
@@ -1033,14 +1034,11 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat
 	}
 
 	{
-		U32 cost = gMeshRepo.calcResourceCost(header);
-
 		LLUUID mesh_id = mesh_params.getSculptID();
 		
 		mHeaderMutex->lock();
 		mMeshHeaderSize[mesh_id] = header_size;
 		mMeshHeader[mesh_id] = header;
-		mMeshResourceCost[mesh_id] = cost;
 		mHeaderMutex->unlock();
 
 		//check for pending requests
@@ -1673,19 +1671,6 @@ S32 LLMeshRepository::getActualMeshLOD(LLSD& header, S32 lod)
 	return -1;
 }
 
-U32 LLMeshRepoThread::getResourceCost(const LLUUID& mesh_id)
-{
-	LLMutexLock lock(mHeaderMutex);
-	
-	std::map<LLUUID, U32>::iterator iter = mMeshResourceCost.find(mesh_id);
-	if (iter != mMeshResourceCost.end())
-	{
-		return iter->second;
-	}
-
-	return 0;
-}
-
 void LLMeshRepository::cacheOutgoingMesh(LLMeshUploadData& data, LLSD& header)
 {
 	mThread->mMeshHeader[data.mUUID] = header;
@@ -2020,11 +2005,7 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason,
 
 				S32 remaining = bytes-file.tell();
 
-				if (remaining < 0 || remaining > 4096)
-				{
-					llwarns << "Bad padding of mesh asset cache entry." << llendl;
-				}
-				else if (remaining > 0)
+				if (remaining > 0)
 				{
 					file.write(block, remaining);
 				}
@@ -2480,25 +2461,6 @@ S32 LLMeshRepository::getActualMeshLOD(const LLVolumeParams& mesh_params, S32 lo
 	return mThread->getActualMeshLOD(mesh_params, lod);
 }
 
-U32 LLMeshRepository::calcResourceCost(LLSD& header)
-{
-	U32 bytes = 0;
-
-	for (U32 i = 0; i < 4; i++)
-	{
-		bytes += header[header_lod[i]]["size"].asInteger();
-	}
-
-	bytes += header["skin"]["size"].asInteger();
-
-	return bytes/4096 + 1;
-}
-
-U32 LLMeshRepository::getResourceCost(const LLUUID& mesh_id)
-{
-	return mThread->getResourceCost(mesh_id);
-}
-
 const LLMeshSkinInfo* LLMeshRepository::getSkinInfo(const LLUUID& mesh_id, LLVOVolume* requesting_obj)
 {
 	if (mesh_id.notNull())
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index d775e8f74a..a15650463e 100755
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -231,8 +231,7 @@ public:
 	mesh_header_map mMeshHeader;
 	
 	std::map<LLUUID, U32> mMeshHeaderSize;
-	std::map<LLUUID, U32> mMeshResourceCost;
-
+	
 	class HeaderRequest
 	{ 
 	public:
@@ -335,8 +334,7 @@ public:
 
 	void notifyLoadedMeshes();
 	S32 getActualMeshLOD(const LLVolumeParams& mesh_params, S32 lod);
-	U32 getResourceCost(const LLUUID& mesh_params);
-
+	
 	void loadMeshSkinInfo(const LLUUID& mesh_id);
 	void loadMeshDecomposition(const LLUUID& mesh_id);
 	void loadMeshPhysicsShape(const LLUUID& mesh_id);
@@ -466,8 +464,6 @@ public:
 
 	S32 getActualMeshLOD(const LLVolumeParams& mesh_params, S32 lod);
 	static S32 getActualMeshLOD(LLSD& header, S32 lod);
-	U32 calcResourceCost(LLSD& header);
-	U32 getResourceCost(const LLUUID& mesh_params);
 	const LLMeshSkinInfo* getSkinInfo(const LLUUID& mesh_id, LLVOVolume* requesting_obj);
 	LLModel::Decomposition* getDecomposition(const LLUUID& mesh_id);
 	void fetchPhysicsShape(const LLUUID& mesh_id);
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 4e5ebb690f..98cbbad89f 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -726,19 +726,6 @@ public:
 			}
 		}				
 
-		if (gSavedSettings.getBOOL("DebugShowUploadCost"))
-		{
-			addText(xpos, ypos, llformat("       Meshes: L$%d", gPipeline.mDebugMeshUploadCost));
-			ypos += y_inc/2;
-			addText(xpos, ypos, llformat("    Sculpties: L$%d", gPipeline.mDebugSculptUploadCost));
-			ypos += y_inc/2;
-			addText(xpos, ypos, llformat("     Textures: L$%d", gPipeline.mDebugTextureUploadCost));
-			ypos += y_inc/2;
-			addText(xpos, ypos, "Upload Cost: ");
-						
-			ypos += y_inc;
-		}
-
 		//temporary hack to give feedback on mesh upload progress
 		if (!gMeshRepo.mUploads.empty())
 		{
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index e74bf2a620..2d61a049f7 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -4134,63 +4134,6 @@ void LLPipeline::renderDebug()
 		}
 	}
 
-	if (gSavedSettings.getBOOL("DebugShowUploadCost"))
-	{
-		std::set<LLUUID> textures;
-		std::set<LLUUID> sculpts;
-		std::set<LLUUID> meshes;
-		
-		BOOL selected = TRUE;
-		if (LLSelectMgr::getInstance()->getSelection()->isEmpty())
-		{
-			selected = FALSE;
-		}
-			
-		for (LLCullResult::sg_list_t::iterator iter = sCull->beginVisibleGroups(); iter != sCull->endVisibleGroups(); ++iter)
-		{
-			LLSpatialGroup* group = *iter;
-			LLSpatialGroup::OctreeNode* node = group->mOctreeNode;
-			for (LLSpatialGroup::OctreeNode::element_iter elem = node->getData().begin(); elem != node->getData().end(); ++elem)
-			{
-				LLDrawable* drawable = *elem;
-				LLVOVolume* volume = drawable->getVOVolume();
-				if (volume && volume->isSelected() == selected)
-				{
-					for (U32 i = 0; i < volume->getNumTEs(); ++i)
-					{
-						LLTextureEntry* te = volume->getTE(i);
-						textures.insert(te->getID());
-					}
-
-					if (volume->isSculpted())
-					{
-						LLUUID sculpt_id = volume->getVolume()->getParams().getSculptID();
-						if (volume->isMesh())
-						{
-							meshes.insert(sculpt_id);
-						}
-						else
-						{
-							sculpts.insert(sculpt_id);
-						}
-					}
-				}
-			}
-		}
-
-		gPipeline.mDebugTextureUploadCost = textures.size() * 10;
-		gPipeline.mDebugSculptUploadCost = sculpts.size()*10;
-		
-		U32 mesh_cost = 0;
-
-		for (std::set<LLUUID>::iterator iter = meshes.begin(); iter != meshes.end(); ++iter)
-		{
-			mesh_cost += gMeshRepo.getResourceCost(*iter)*10;
-		}
-
-		gPipeline.mDebugMeshUploadCost = mesh_cost;
-	}
-
 	if (hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA))
 	{
 		LLVertexBuffer::unbind();
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 598f500e4f..4b068a1724 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -1997,10 +1997,7 @@
              label="Show Upload Cost"
              layout="topleft"
              name="Show Upload Cost">
-            <menu_item_check.on_check
-             function="CheckControl"
-             parameter="DebugShowUploadCost" />
-            <menu_item_check.on_click
+          <menu_item_check.on_click
              function="ToggleControl"
              parameter="DebugShowUploadCost" />
           </menu_item_check>
-- 
cgit v1.2.3


From 782c8a48f1dd56db7c2e5546291d15b78741d455 Mon Sep 17 00:00:00 2001
From: Don Kjer <don@lindenlab.com>
Date: Sat, 9 Jul 2011 19:50:36 -0700
Subject: Added L$ price breakdown for model uploads

---
 indra/newview/llfloatermodelpreview.cpp            | 11 ++++
 .../skins/default/xui/en/floater_model_preview.xml | 70 ++++++++++++++++------
 2 files changed, 64 insertions(+), 17 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 1522f041c1..fff6005726 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -5490,6 +5490,11 @@ void LLFloaterModelPreview::toggleCalculateButton(bool visible)
 		childSetTextArg("weights", "[SIM]", tbd);
 		childSetTextArg("weights", "[PH]", tbd);
 		childSetTextArg("upload_fee", "[FEE]", tbd);
+		childSetTextArg("price_breakdown", "[STREAMING]", tbd);
+		childSetTextArg("price_breakdown", "[PHYSICS]", tbd);
+		childSetTextArg("price_breakdown", "[INSTANCES]", tbd);
+		childSetTextArg("price_breakdown", "[TEXTURES]", tbd);
+		childSetTextArg("price_breakdown", "[MODEL]", tbd);
 	}
 }
 
@@ -5501,8 +5506,14 @@ void LLFloaterModelPreview::onModelPhysicsFeeReceived(const LLSD& result, std::s
 	childSetTextArg("weights", "[SIM]", llformat("%0.3f", result["simulation_cost"].asReal()));
 	childSetTextArg("weights", "[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());
 }
 
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 52377b60c5..060ddec1f4 100644
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -84,7 +84,7 @@
     </text>
     <text
      text_color="White"
-     height="50"
+     height="40"
 	 width="290"
 	 top_delta="15"
      left_delta="0"
@@ -92,31 +92,67 @@
      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. [secondlife:///app/floater/learn_more Find out how] to get enabled for mesh model uploads.
-    </text>
+     You will not be able to complete the final upload of this model to the Second Life servers. [secondlife:///app/floater/learn_more Find out how] to get enabled for mesh model uploads.</text>
 
   <text
-	height="50"
-	top_delta="55"
+	height="65"
+	top_delta="45"
 	left_delta="0"
+	name="weights_text"
+	width="80"
+	word_wrap="true" 
+	>
+Streaming:
+Physics:
+Simulation:
+
+Prim equivs:
+  </text>
+
+  <text
+	height="65"
+	top_delta="0"
+	left_delta="80"
 	name="weights"
-	width="290"
+	width="70"
 	word_wrap="true" 
 	>
-	<text
-		follows="top|left"
-	>Test0: [EQ]
-	</text>
-	<text
-	>Test: [ST]
-	</text>
-Streaming: [ST]
-Simulation: [SIM]
-Physics: [PH]
-Prim equivs: [EQ]
+[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"
-- 
cgit v1.2.3


From 80e60371f8be32719dd19467fd2def80e994aa2d Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Mon, 11 Jul 2011 11:33:05 -0400
Subject: Fix for linux build failure, hopefully

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

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 0939e7bbbf..80a9b8f781 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -3081,7 +3081,7 @@ U32 LLModelPreview::calcResourceCost()
 
 	updateStatusMessages();
 
-	return streaming_cost;
+	return (U32) streaming_cost;
 }
 
 void LLFloaterModelPreview::setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost)
-- 
cgit v1.2.3


From 572a1734a5230bb4ecbc3cc1e5ff842e582e9b49 Mon Sep 17 00:00:00 2001
From: prep <prep@lindenlab.com>
Date: Mon, 11 Jul 2011 13:51:20 -0400
Subject: SH-2012: removed upload wizard from inventory '+' menu

---
 indra/newview/skins/default/xui/en/menu_inventory_add.xml | 12 ------------
 1 file changed, 12 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/skins/default/xui/en/menu_inventory_add.xml b/indra/newview/skins/default/xui/en/menu_inventory_add.xml
index b36b82ebd8..3af056baa9 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory_add.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory_add.xml
@@ -54,18 +54,6 @@
                 <menu_item_call.on_visible
                 function="File.VisibleUploadModel"/>
                 </menu_item_call>
-              <menu_item_call
-                label="Model Wizard..."
-                layout="topleft"
-                name="Upload Model Wizard">
-                <menu_item_call.on_click
-                 function="Floater.Show"
-                 parameter="upload_model_wizard" />
-                <menu_item_call.on_enable
-                 function="File.EnableUploadModel" />
-                <menu_item_call.on_visible
-                function="File.VisibleUploadModel"/>
-	      </menu_item_call>
                 <menu_item_call
                  label="Bulk (L$[COST] per file)..."
                  layout="topleft"
-- 
cgit v1.2.3


From 4b3ed516fc621e8f5300a33c99c74160f05913ef Mon Sep 17 00:00:00 2001
From: prep <prep@lindenlab.com>
Date: Mon, 11 Jul 2011 14:55:07 -0400
Subject: Fix for sh-1982 and sh-2025

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

(limited to 'indra/newview')

diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml
index 2169b5ccc3..8901583799 100644
--- a/indra/newview/skins/default/xui/en/floater_tools.xml
+++ b/indra/newview/skins/default/xui/en/floater_tools.xml
@@ -267,7 +267,7 @@
      layout="topleft"
      left_pad="2"
      name="unlink_btn"
-     width="105">
+     width="90">
 	  <button.commit_callback
 	     function="BuildTool.UnlinkObjects"/>
     </button>
-- 
cgit v1.2.3


From b8351e83e8a0354de743c5a4adbc52930b563a76 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Mon, 11 Jul 2011 17:51:16 -0600
Subject: fix for SH-2051: viewer crashes when try to disbable "Show Upload
 Cost"

---
 indra/newview/app_settings/settings.xml            | 11 +++++++++++
 indra/newview/skins/default/xui/en/menu_viewer.xml | 12 +++++++-----
 2 files changed, 18 insertions(+), 5 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index b57657540c..6ddcec6232 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -1968,6 +1968,17 @@
       <key>Value</key>
       <integer>0</integer>
     </map>
+  <key>DebugShowUploadCost</key>
+  <map>
+    <key>Comment</key>
+    <string>Show mesh upload cost</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>Boolean</string>
+    <key>Value</key>
+    <integer>1</integer>
+  </map>
   <key>DebugShowXUINames</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 499cf47b6c..0fe6c09684 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -2076,12 +2076,14 @@
             </menu_item_check>
           <menu_item_check
              label="Show Upload Cost"
-             layout="topleft"
              name="Show Upload Cost">
-          <menu_item_check.on_click
-             function="ToggleControl"
+              <menu_item_check.on_check
+             function="CheckControl"
              parameter="DebugShowUploadCost" />
-          </menu_item_check>
+            <menu_item_check.on_click
+                 function="ToggleControl"
+                 parameter="DebugShowUploadCost" />
+            </menu_item_check>
             <menu_item_check
              label="Show Render Info"
              name="Show Render Info">
@@ -2092,7 +2094,7 @@
                  function="ToggleControl"
                  parameter="DebugShowRenderInfo" />
             </menu_item_check>
-			<menu_item_check
+			  <menu_item_check
              label="Show Texture Info"
              name="Show Texture Info">
                 <menu_item_check.on_check
-- 
cgit v1.2.3


From ec0ee4f7c80bf5d32f50d2788545d629068f1cb1 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 12 Jul 2011 12:04:58 -0500
Subject: SH-2052 Fix for reported PE being too low when selecting more than
 500 objects.

---
 indra/newview/llviewerobjectlist.cpp | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index f418a6137a..9d38954d8b 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -1071,10 +1071,12 @@ void LLViewerObjectList::fetchObjectCosts()
 				LLSD id_list;
 				U32 object_index = 0;
 
+				U32 count = 0;
+
 				for (
 					std::set<LLUUID>::iterator iter = mStaleObjectCost.begin();
 					iter != mStaleObjectCost.end();
-					++iter)
+					)
 				{
 					// Check to see if a request for this object
 					// has already been made.
@@ -1084,13 +1086,15 @@ void LLViewerObjectList::fetchObjectCosts()
 						mPendingObjectCost.insert(*iter);
 						id_list[object_index++] = *iter;
 					}
-				}
 
-				// id_list should now contain all
-				// requests in mStaleObjectCost before, so clear
-				// it now
-				mStaleObjectCost.clear();
+					mStaleObjectCost.erase(iter++);
 
+					if (count++ >= 450)
+					{
+						break;
+					}
+				}
+									
 				if ( id_list.size() > 0 )
 				{
 					LLSD post_data = LLSD::emptyMap();
-- 
cgit v1.2.3


From 922bc0aa6ac35175618c54d1e5649678f6b62417 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 12 Jul 2011 13:22:01 -0500
Subject: SH-2053 Don't poke the UI from a background thread -- it tends to get
 crashy.

---
 indra/newview/llfloatermodelpreview.cpp | 12 +++++++++++-
 indra/newview/llfloatermodelpreview.h   |  4 +++-
 indra/newview/llmeshrepository.cpp      | 11 ++++-------
 3 files changed, 18 insertions(+), 9 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 0939e7bbbf..abec392316 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -5482,7 +5482,17 @@ void LLFloaterModelPreview::toggleCalculateButton(bool visible)
 
 void LLFloaterModelPreview::onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url)
 {
-	mUploadModelUrl = upload_url;
+	mModelPhysicsFee = result;
+	mModelPhysicsFee["url"] = upload_url;
+
+	doOnIdleOneTime(boost::bind(&LLFloaterModelPreview::handleModelPhysicsFeeReceived,this));
+}
+
+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()));
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index 29a61d6ed3..3a5f7602fe 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -201,7 +201,7 @@ public:
 	/*virtual*/ void setPermissonsErrorStatus(U32 status, const std::string& reason);
 
 	/*virtual*/ void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url);
-
+				void handleModelPhysicsFeeReceived();
 	/*virtual*/ void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason);
 
 	/*virtual*/ void onModelUploadSuccess();
@@ -273,6 +273,8 @@ protected:
 	LLToggleableMenu* mViewOptionMenu;
 	LLMutex* mStatusLock;
 
+	LLSD mModelPhysicsFee;
+
 private:
 	void onClickCalculateBtn();
 	void toggleCalculateButton();
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index a1f8f64627..6e67e580b4 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -34,6 +34,7 @@
 #include "llagent.h"
 #include "llappviewer.h"
 #include "llbufferstream.h"
+#include "llcallbacklist.h"
 #include "llcurl.h"
 #include "lldatapacker.h"
 #include "llfloatermodelpreview.h"
@@ -355,7 +356,6 @@ public:
 			cc = llsd_from_file("fake_upload_error.xml");
 		}
 			
-		llinfos << "completed" << llendl;
 		mThread->mPendingUploads--;
 		dump_llsd_to_file(cc,make_dump_name("whole_model_fee_response_",dump_num));
 
@@ -364,7 +364,6 @@ public:
 		if (isGoodStatus(status) &&
 			cc["state"].asString() == "upload")
 		{
-			llinfos << "fee request succeeded" << llendl;
 			mThread->mWholeModelUploadURL = cc["uploader"].asString();
 
 			if (observer)
@@ -414,8 +413,7 @@ public:
 		//assert_main_thread();
 		mThread->mPendingUploads--;
 		dump_llsd_to_file(cc,make_dump_name("whole_model_upload_response_",dump_num));
-		llinfos << "LLWholeModelUploadResponder content: " << cc << llendl;
-
+		
 		LLWholeModelUploadObserver* observer = mObserverHandle.get();
 
 		// requested "mesh" asset type isn't actually the type
@@ -423,13 +421,12 @@ public:
 		if (isGoodStatus(status) &&
 			cc["state"].asString() == "complete")
 		{
-			llinfos << "upload succeeded" << llendl;
 			mModelData["asset_type"] = "object";
 			gMeshRepo.updateInventory(LLMeshRepository::inventory_data(mModelData,cc));
 
 			if (observer)
 			{
-				observer->onModelUploadSuccess();
+				doOnIdleOneTime(boost::bind(&LLWholeModelUploadObserver::onModelUploadSuccess, observer));
 			}
 		}
 		else
@@ -440,7 +437,7 @@ public:
 
 			if (observer)
 			{
-				observer->onModelUploadFailure();
+				doOnIdleOneTime(boost::bind(&LLWholeModelUploadObserver::onModelUploadFailure, observer));
 			}
 		}
 	}
-- 
cgit v1.2.3


From 77e2be798484e5a645e617e2bcf91e7b039dd96c Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Tue, 12 Jul 2011 14:35:32 -0400
Subject: SH-2043 FIX

---
 indra/newview/llfloatermodelpreview.cpp                    | 14 ++++++++++++++
 .../newview/skins/default/xui/en/floater_model_preview.xml |  2 +-
 2 files changed, 15 insertions(+), 1 deletion(-)
 mode change 100644 => 100755 indra/newview/skins/default/xui/en/floater_model_preview.xml

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 80a9b8f781..877f70efa9 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -101,7 +101,9 @@
 #include "llcallbacklist.h"
 #include "llviewerobjectlist.h"
 #include "llanimationstates.h"
+#include "llviewernetwork.h"
 #include "glod/glod.h"
+#include <boost/algorithm/string.hpp>
 
 
 const S32 SLM_SUPPORTED_VERSION = 2;
@@ -476,6 +478,18 @@ BOOL LLFloaterModelPreview::postBuild()
 			text->setMouseDownCallback(boost::bind(&LLModelPreview::setPreviewLOD, mModelPreview, i));
 		}
 	}
+	std::string current_grid = LLGridManager::getInstance()->getGridLabel();
+	std::transform(current_grid.begin(),current_grid.end(),current_grid.begin(),::tolower);
+	std::string validate_url;
+	if (current_grid == "agni")
+	{
+		validate_url = "http://secondlife.com/my/account/mesh.php";
+	}
+	else
+	{
+		validate_url = llformat("http://secondlife.%s.lindenlab.com/my/account/mesh.php",current_grid.c_str());
+	}
+	getChild<LLTextBox>("warning_message")->setTextArg("[VURL]", validate_url);
 
 	mUploadBtn = getChild<LLButton>("ok_btn");
 	mCalculateBtn = getChild<LLButton>("calculate_btn");
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 060ddec1f4..a0a95fafb8
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -92,7 +92,7 @@
      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. [secondlife:///app/floater/learn_more Find out how] to get enabled for mesh model uploads.</text>
+     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"
-- 
cgit v1.2.3


From 496c81401dddd9659560fb3dbd1c52caadf6c984 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Tue, 12 Jul 2011 14:39:15 -0400
Subject: SH-2049 FIX

---
 indra/newview/skins/default/xui/en/floater_model_preview.xml | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

(limited to 'indra/newview')

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 a0a95fafb8..e75511e2b3 100755
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -168,7 +168,8 @@ L$ [MODEL]
     <panel
       border="true"
       label="Level of Detail"
-      name="lod_panel">
+      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:
@@ -291,7 +292,8 @@ L$ [MODEL]
     <panel
       border="true"
       label="Physics"
-      name="physics_panel">
+      name="physics_panel"
+      help_topic="upload_model_physics">
 
       <!-- PHYSICS GEOMETRY-->
       <panel
@@ -432,7 +434,9 @@ L$ [MODEL]
     <panel
       border="true"
       label="Modifiers"
-      name="modifiers_panel">
+      name="modifiers_panel"
+      help_topic="upload_model_modifiers">
+
       <text left="10" width="90" bottom="30" follows="top|left" height="15">
         Scale:
       </text>
-- 
cgit v1.2.3


From bb44da4613595f7bf03d4c21d053917ce2df2b00 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 12 Jul 2011 14:07:09 -0500
Subject: SH-2050 Hide UI that breaks down upload fee and rename some fields.

---
 indra/newview/skins/default/xui/en/floater_model_preview.xml | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'indra/newview')

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 060ddec1f4..a8761e96b0 100644
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -102,9 +102,9 @@
 	width="80"
 	word_wrap="true" 
 	>
-Streaming:
+Download:
 Physics:
-Simulation:
+Server:
 
 Prim equivs:
   </text>
@@ -123,7 +123,8 @@ Prim equivs:
 
 [EQ]
   </text>
-  
+
+<!--
   <text
 	height="65"
 	top_delta="0"
@@ -153,6 +154,7 @@ L$ [INSTANCES]
 L$ [TEXTURES]
 L$ [MODEL]
   </text>
+    -->
 
   <tab_container
     follows="right|top|bottom"
-- 
cgit v1.2.3


From 5d25338ed0a8580be43f86ff07d777f21d1147e8 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Tue, 12 Jul 2011 14:42:56 -0600
Subject: fix for SH-2040: Missing '?: 0' and old style object/prim counts
 under Edit linked when Mesh disabled

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

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index dc71ade621..84fb8bd9e7 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -422,7 +422,7 @@ void LLFloaterTools::refresh()
 
 	// Refresh object and prim count labels
 	LLLocale locale(LLLocale::USER_LOCALE);
-
+#if 0
 	if (!gMeshRepo.meshRezEnabled())
 	{		
 		std::string obj_count_string;
@@ -447,6 +447,7 @@ void LLFloaterTools::refresh()
 		getChildView("RenderingCost")->setEnabled(have_selection && sShowObjectCost);
 	}
 	else
+#endif
 	{
 		F32 link_phys_cost  = LLSelectMgr::getInstance()->getSelection()->getSelectedLinksetPhysicsCost();
 		F32 link_cost  = LLSelectMgr::getInstance()->getSelection()->getSelectedLinksetCost();
-- 
cgit v1.2.3


From 104748b59af2ff15b44c910340daffe9180e74f7 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 12 Jul 2011 17:31:25 -0500
Subject: SH-1125 Retry when failing to get seed capability.

---
 indra/newview/llviewerregion.cpp | 34 +++++++++++++++++++++++++---------
 indra/newview/llviewerregion.h   |  2 +-
 2 files changed, 26 insertions(+), 10 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 8bb38e3e46..9c6c62053b 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -186,8 +186,8 @@ class BaseCapabilitiesComplete : public LLHTTPClient::Responder
 {
 	LOG_CLASS(BaseCapabilitiesComplete);
 public:
-    BaseCapabilitiesComplete(LLViewerRegion* region)
-		: mRegion(region)
+    BaseCapabilitiesComplete(LLViewerRegion* region, S32 retry = 0)
+		: mRegion(region), mRetry(retry)
     { }
 	virtual ~BaseCapabilitiesComplete()
 	{
@@ -206,9 +206,24 @@ public:
     {
 		LL_WARNS2("AppInit", "Capabilities") << statusNum << ": " << reason << LL_ENDL;
 		
-		if (STATE_SEED_GRANTED_WAIT == LLStartUp::getStartupState())
+		const S32 MAX_RETRIES = 5;
+
+		if (mRetry < MAX_RETRIES)
 		{
-			LLStartUp::setStartupState( STATE_SEED_CAP_GRANTED );
+			std::string url = mRegion->getCapability("Seed");
+
+			mRetry++;
+
+			llinfos << "retry " << mRetry << " posting to seed " << url << llendl;
+
+			mRegion->setSeedCapability(url, mRetry);
+		}
+		else
+		{
+			if (STATE_SEED_GRANTED_WAIT == LLStartUp::getStartupState())
+			{
+				LLStartUp::setStartupState( STATE_SEED_CAP_GRANTED );
+			}
 		}
     }
 
@@ -242,14 +257,15 @@ public:
 	}
 
     static boost::intrusive_ptr<BaseCapabilitiesComplete> build(
-								LLViewerRegion* region)
+								LLViewerRegion* region, S32 retry)
     {
 		return boost::intrusive_ptr<BaseCapabilitiesComplete>(
-							 new BaseCapabilitiesComplete(region));
+							 new BaseCapabilitiesComplete(region, retry));
     }
 
 private:
 	LLViewerRegion* mRegion;
+	S32 mRetry;
 };
 
 
@@ -1476,9 +1492,9 @@ void LLViewerRegion::unpackRegionHandshake()
 	msg->sendReliable(host);
 }
 
-void LLViewerRegion::setSeedCapability(const std::string& url)
+void LLViewerRegion::setSeedCapability(const std::string& url, S32 retry)
 {
-	if (getCapability("Seed") == url)
+	if (retry == 0 && getCapability("Seed") == url)
     {
 		// llwarns << "Ignoring duplicate seed capability" << llendl;
 		return;
@@ -1568,7 +1584,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
 
 	llinfos << "posting to seed " << url << llendl;
 
-	mImpl->mHttpResponderPtr = BaseCapabilitiesComplete::build(this) ;
+	mImpl->mHttpResponderPtr = BaseCapabilitiesComplete::build(this, retry) ;
 	LLHTTPClient::post(url, capabilityNames, mImpl->mHttpResponderPtr);
 }
 
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index 00252b8897..0176969cea 100644
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -230,7 +230,7 @@ public:
 	const LLHTTPClient::ResponderPtr getHttpResponderPtr() const;
 
 	// Get/set named capability URLs for this region.
-	void setSeedCapability(const std::string& url);
+	void setSeedCapability(const std::string& url, S32 retry = 0);
 	void setCapability(const std::string& name, const std::string& url);
 	// implements LLCapabilityProvider
     virtual std::string getCapability(const std::string& name) const;
-- 
cgit v1.2.3


From 4e16dc26ab3fd0506ba800f124649259aec46136 Mon Sep 17 00:00:00 2001
From: Don Kjer <don@lindenlab.com>
Date: Tue, 12 Jul 2011 18:10:17 -0700
Subject: Changes to support SH-1894: Textures uploaded with Mesh do not appear
 in inventory.  Reviewed by Andrew

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

(limited to 'indra/newview')

diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index a1f8f64627..4d9c324936 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -48,6 +48,7 @@
 #include "llthread.h"
 #include "llvfile.h"
 #include "llviewercontrol.h"
+#include "llviewerinventory.h"
 #include "llviewermenufile.h"
 #include "llviewerobjectlist.h"
 #include "llviewerregion.h"
@@ -1304,6 +1305,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
 
 	LLSD res;
 	result["folder_id"] = gInventory.findCategoryUUIDForType(LLFolderType::FT_OBJECT);
+	result["texture_folder_id"] = gInventory.findCategoryUUIDForType(LLFolderType::FT_TEXTURE);
 	result["asset_type"] = "mesh";
 	result["inventory_type"] = "object";
 	result["description"] = "(No Description)";
@@ -2223,6 +2225,38 @@ void LLMeshRepository::notifyLoadedMeshes()
 			LLAssetType::EType asset_type = LLAssetType::lookup(data.mPostData["asset_type"].asString());
 			LLInventoryType::EType inventory_type = LLInventoryType::lookup(data.mPostData["inventory_type"].asString());
 
+			// Handle addition of texture, if any.
+			if ( data.mResponse.has("new_texture_folder_id") )
+			{
+				const LLUUID& folder_id = data.mResponse["new_texture_folder_id"].asUUID();
+
+				if ( folder_id.notNull() )
+				{
+					LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TEXTURE);
+
+					std::string name;
+					// Check if the server built a different name for the texture folder
+					if ( data.mResponse.has("new_texture_folder_name") )
+					{
+						name = data.mResponse["new_texture_folder_name"].asString();
+					}
+					else
+					{
+						name = data.mPostData["name"].asString();
+					}
+
+					// Add the category to the internal representation
+					LLPointer<LLViewerInventoryCategory> cat = 
+						new LLViewerInventoryCategory(folder_id, parent_id, 
+							LLFolderType::FT_NONE, name, gAgent.getID());
+					cat->setVersion(LLViewerInventoryCategory::VERSION_UNKNOWN);
+
+					LLInventoryModel::LLCategoryUpdate update(cat->getParentUUID(), 1);
+					gInventory.accountForUpdate(update);
+					gInventory.updateCategory(cat);
+				}
+			}
+
 			on_new_single_inventory_upload_complete(
 				asset_type,
 				inventory_type,
@@ -2232,6 +2266,7 @@ void LLMeshRepository::notifyLoadedMeshes()
 				data.mPostData["description"],
 				data.mResponse,
 				data.mResponse["upload_price"]);
+			//}
 			
 			mInventoryQ.pop();
 		}
-- 
cgit v1.2.3


From 561d40d5c316b4879ea56965f6b320e8e1c70a88 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 14 Jul 2011 01:07:01 -0500
Subject: SH-715 Disable simplify/analyze button while counterpart is
 executing.

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

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 0748ed8039..ef846ec42e 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -780,19 +780,6 @@ void LLFloaterModelPreview::draw()
 	childSetTextArg("prim_cost", "[PRIM_COST]", llformat("%d", mModelPreview->mResourceCost));
 	childSetTextArg("description_label", "[TEXTURES]", llformat("%d", mModelPreview->mTextureSet.size()));
 
-	if (!mCurRequest.empty())
-	{
-		LLMutexLock lock(mStatusLock);
-		childSetTextArg("status", "[STATUS]", mStatusMessage);
-	}
-	else
-	{
-		childSetVisible("Simplify", true);
-		childSetVisible("simplify_cancel", false);
-		childSetVisible("Decompose", true);
-		childSetVisible("decompose_cancel", false);
-	}
-	
 	if (mModelPreview)
 	{
 		gGL.color3f(1.f, 1.f, 1.f);
@@ -992,12 +979,14 @@ void LLFloaterModelPreview::onPhysicsStageExecute(LLUICtrl* ctrl, void* data)
 			sInstance->setStatusMessage(sInstance->getString("decomposing"));
 			sInstance->childSetVisible("Decompose", false);
 			sInstance->childSetVisible("decompose_cancel", true);
+			sInstance->childDisable("Simplify");
 		}
 		else if (stage == "Simplify")
 		{
 			sInstance->setStatusMessage(sInstance->getString("simplifying"));
 			sInstance->childSetVisible("Simplify", false);
 			sInstance->childSetVisible("simplify_cancel", true);
+			sInstance->childDisable("Decompose");
 		}
 	}
 }
@@ -4345,6 +4334,24 @@ void LLModelPreview::updateStatusMessages()
 			child->setEnabled(enable);
 			child = panel->findNextSibling(child);
 		}
+
+		if (fmp->mCurRequest.empty())
+		{
+			fmp->childSetVisible("Simplify", true);
+			fmp->childSetVisible("simplify_cancel", false);
+			fmp->childSetVisible("Decompose", true);
+			fmp->childSetVisible("decompose_cancel", false);
+
+			if (phys_hulls > 0)
+			{
+				fmp->childEnable("Simplify");
+			}
+		
+			if (phys_tris || phys_hulls > 0)
+			{
+				fmp->childEnable("Decompose");
+			}
+		}
 	}
 
 	const char* lod_controls[] =
-- 
cgit v1.2.3


From fde88ae24d1093fd0f24fe9cfd66dc05a0d1c51f Mon Sep 17 00:00:00 2001
From: Don Kjer <don@lindenlab.com>
Date: Thu, 14 Jul 2011 18:43:49 -0700
Subject: Potential fix for SH-1854 and SH-1125 (caps issues)

---
 indra/newview/llstartup.cpp                    |  19 +++
 indra/newview/llviewerregion.cpp               | 223 +++++++++++++++----------
 indra/newview/llviewerregion.h                 |   7 +-
 indra/newview/llvoavatar.cpp                   |   5 +-
 indra/newview/skins/default/xui/en/strings.xml |   2 +
 5 files changed, 164 insertions(+), 92 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 4dfcb85295..46ff3d808a 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -1242,6 +1242,25 @@ bool idle_startup()
 	//---------------------------------------------------------------------
 	if(STATE_SEED_GRANTED_WAIT == LLStartUp::getStartupState())
 	{
+		LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(gFirstSimHandle);
+		if (regionp->capabilitiesReceived())
+		{
+			LLStartUp::setStartupState( STATE_SEED_CAP_GRANTED );
+		}
+		else
+		{
+			U32 num_retries = regionp->getNumSeedCapRetries();
+			if (num_retries > 0)
+			{
+				LLStringUtil::format_map_t args;
+				args["[NUMBER]"] = llformat("%d", num_retries + 1);
+				set_startup_status(0.4f, LLTrans::getString("LoginRetrySeedCapGrant", args), gAgent.mMOTD);
+			}
+			else
+			{
+				set_startup_status(0.4f, LLTrans::getString("LoginRequestSeedCapGrant"), gAgent.mMOTD);
+			}
+		}
 		return FALSE;
 	}
 
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 5b7492b66f..5be2234ec2 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -77,6 +77,13 @@
 
 const F32 WATER_TEXTURE_SCALE = 8.f;			//  Number of times to repeat the water texture across a region
 const S16 MAX_MAP_DIST = 10;
+// The server only keeps our pending agent info for 60 seconds.
+// We want to allow for seed cap retry, but its not useful after that 60 seconds.
+// Give it 3 chances, each at 18 seconds to give ourselves a few seconds to connect anyways if we give up.
+const S32 MAX_SEED_CAP_ATTEMPTS_BEFORE_LOGIN = 3;
+const F32 CAP_REQUEST_TIMEOUT = 18;
+// Even though we gave up on login, keep trying for caps after we are logged in:
+const S32 MAX_CAP_REQUEST_ATTEMPTS = 30;
 
 typedef std::map<std::string, std::string> CapabilityMap;
 
@@ -86,6 +93,10 @@ public:
 		:	mHost(host),
 			mCompositionp(NULL),
 			mEventPoll(NULL),
+			mSeedCapMaxAttempts(MAX_CAP_REQUEST_ATTEMPTS),
+			mSeedCapMaxAttemptsBeforeLogin(MAX_SEED_CAP_ATTEMPTS_BEFORE_LOGIN),
+			mSeedCapAttempts(0),
+			mHttpResponderID(0),
 		    // I'd prefer to set the LLCapabilityListener name to match the region
 		    // name -- it's disappointing that's not available at construction time.
 		    // We could instead store an LLCapabilityListener*, making
@@ -100,6 +111,8 @@ public:
 	{
 	}
 
+	void buildCapabilityNames(LLSD& capabilityNames);
+
 	// The surfaces and other layers
 	LLSurface*	mLandp;
 
@@ -132,6 +145,12 @@ public:
 	
 	LLEventPoll* mEventPoll;
 
+	S32 mSeedCapMaxAttempts;
+	S32 mSeedCapMaxAttemptsBeforeLogin;
+	S32 mSeedCapAttempts;
+
+	S32 mHttpResponderID;
+
 	/// Post an event to this LLCapabilityListener to invoke a capability message on
 	/// this LLViewerRegion's server
 	/// (https://wiki.lindenlab.com/wiki/Viewer:Messaging/Messaging_Notes#Capabilities)
@@ -139,8 +158,6 @@ public:
 
 	//spatial partitions for objects in this region
 	std::vector<LLSpatialPartition*> mObjectPartition;
-
-	LLHTTPClient::ResponderPtr  mHttpResponderPtr ;
 };
 
 // support for secondlife:///app/region/{REGION} SLapps
@@ -186,69 +203,51 @@ class BaseCapabilitiesComplete : public LLHTTPClient::Responder
 {
 	LOG_CLASS(BaseCapabilitiesComplete);
 public:
-    BaseCapabilitiesComplete(LLViewerRegion* region, S32 retry = 0)
-		: mRegion(region), mRetry(retry)
+    BaseCapabilitiesComplete(U64 region_handle, S32 id)
+		: mRegionHandle(region_handle), mID(id)
     { }
 	virtual ~BaseCapabilitiesComplete()
-	{
-		if(mRegion)
-		{
-			mRegion->setHttpResponderPtrNULL() ;
-		}
-	}
-
-	void setRegion(LLViewerRegion* region)
-	{
-		mRegion = region ;
-	}
+	{ }
 
     void error(U32 statusNum, const std::string& reason)
     {
 		LL_WARNS2("AppInit", "Capabilities") << statusNum << ": " << reason << LL_ENDL;
-		
-		const S32 MAX_RETRIES = 5;
-
-		if (mRetry < MAX_RETRIES)
-		{
-			std::string url = mRegion->getCapability("Seed");
-
-			mRetry++;
-
-			llinfos << "retry " << mRetry << " posting to seed " << url << llendl;
-
-			mRegion->setSeedCapability(url, mRetry);
-		}
-		else
+		LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
+		if (regionp)
 		{
-			if (STATE_SEED_GRANTED_WAIT == LLStartUp::getStartupState())
-			{
-				LLStartUp::setStartupState( STATE_SEED_CAP_GRANTED );
-			}
+			regionp->failedSeedCapability();
 		}
     }
 
     void result(const LLSD& content)
     {
-		if(!mRegion || LLHTTPClient::ResponderPtr(this) != mRegion->getHttpResponderPtr()) //region is removed or responder is not created.
+		LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
+		if(!regionp) //region was removed
+		{
+			LL_WARNS2("AppInit", "Capabilities") << "Received results for region that no longer exists!" << LL_ENDL;
+			return ;
+		}
+		if( mID != regionp->getHttpResponderID() ) // region is no longer referring to this responder
 		{
+			LL_WARNS2("AppInit", "Capabilities") << "Received results for a stale http responder!" << LL_ENDL;
 			return ;
 		}
 
 		LLSD::map_const_iterator iter;
 		for(iter = content.beginMap(); iter != content.endMap(); ++iter)
 		{
-			mRegion->setCapability(iter->first, iter->second);
+			regionp->setCapability(iter->first, iter->second);
 			LL_DEBUGS2("AppInit", "Capabilities") << "got capability for " 
 				<< iter->first << LL_ENDL;
 
 			/* HACK we're waiting for the ServerReleaseNotes */
-			if (iter->first == "ServerReleaseNotes" && mRegion->getReleaseNotesRequested())
+			if (iter->first == "ServerReleaseNotes" && regionp->getReleaseNotesRequested())
 			{
-				mRegion->showReleaseNotes();
+				regionp->showReleaseNotes();
 			}
 		}
 
-		mRegion->setCapabilitiesReceived(true);
+		regionp->setCapabilitiesReceived(true);
 
 		if (STATE_SEED_GRANTED_WAIT == LLStartUp::getStartupState())
 		{
@@ -256,16 +255,15 @@ public:
 		}
 	}
 
-    static boost::intrusive_ptr<BaseCapabilitiesComplete> build(
-								LLViewerRegion* region, S32 retry)
+    static boost::intrusive_ptr<BaseCapabilitiesComplete> build( U64 region_handle, S32 id )
     {
-		return boost::intrusive_ptr<BaseCapabilitiesComplete>(
-							 new BaseCapabilitiesComplete(region, retry));
+		return boost::intrusive_ptr<BaseCapabilitiesComplete>( 
+				new BaseCapabilitiesComplete(region_handle, id) );
     }
 
 private:
-	LLViewerRegion* mRegion;
-	S32 mRetry;
+	U64 mRegionHandle;
+	S32 mID;
 };
 
 
@@ -356,11 +354,6 @@ void LLViewerRegion::initStats()
 
 LLViewerRegion::~LLViewerRegion() 
 {
-	if(mImpl->mHttpResponderPtr)
-	{
-		(static_cast<BaseCapabilitiesComplete*>(mImpl->mHttpResponderPtr.get()))->setRegion(NULL) ;
-	}
-
 	gVLManager.cleanupData(this);
 	// Can't do this on destruction, because the neighbor pointers might be invalid.
 	// This should be reference counted...
@@ -907,14 +900,9 @@ U32 LLViewerRegion::getPacketsLost() const
 	}
 }
 
-void LLViewerRegion::setHttpResponderPtrNULL()
-{
-	mImpl->mHttpResponderPtr = NULL;
-}
-
-const LLHTTPClient::ResponderPtr LLViewerRegion::getHttpResponderPtr() const
+S32 LLViewerRegion::getHttpResponderID() const
 {
-	return mImpl->mHttpResponderPtr;
+	return mImpl->mHttpResponderID;
 }
 
 BOOL LLViewerRegion::pointInRegionGlobal(const LLVector3d &point_global) const
@@ -1493,22 +1481,9 @@ void LLViewerRegion::unpackRegionHandshake()
 	msg->sendReliable(host);
 }
 
-void LLViewerRegion::setSeedCapability(const std::string& url, S32 retry)
-{
-	if (retry == 0 && getCapability("Seed") == url)
-    {
-		// llwarns << "Ignoring duplicate seed capability" << llendl;
-		return;
-    }
-	
-	delete mImpl->mEventPoll;
-	mImpl->mEventPoll = NULL;
-	
-	mImpl->mCapabilities.clear();
-	setCapability("Seed", url);
-
-	LLSD capabilityNames = LLSD::emptyArray();
 	
+void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
+{
 	capabilityNames.append("AccountingParcel");
 	capabilityNames.append("AccountingSelection");
 	capabilityNames.append("AttachmentResources");
@@ -1582,46 +1557,118 @@ void LLViewerRegion::setSeedCapability(const std::string& url, S32 retry)
 	
 	// Please add new capabilities alphabetically to reduce
 	// merge conflicts.
+}
+
+void LLViewerRegion::setSeedCapability(const std::string& url)
+{
+	if (getCapability("Seed") == url)
+    {
+		// llwarns << "Ignoring duplicate seed capability" << llendl;
+		return;
+    }
+	
+	delete mImpl->mEventPoll;
+	mImpl->mEventPoll = NULL;
+	
+	mImpl->mCapabilities.clear();
+	setCapability("Seed", url);
+
+	LLSD capabilityNames = LLSD::emptyArray();
+	mImpl->buildCapabilityNames(capabilityNames);
 
 	llinfos << "posting to seed " << url << llendl;
 
-	mImpl->mHttpResponderPtr = BaseCapabilitiesComplete::build(this, retry) ;
-	LLHTTPClient::post(url, capabilityNames, mImpl->mHttpResponderPtr);
+	S32 id = ++mImpl->mHttpResponderID;
+	LLHTTPClient::post(url, capabilityNames, 
+						BaseCapabilitiesComplete::build(getHandle(), id),
+						LLSD(), CAP_REQUEST_TIMEOUT);
+}
+
+S32 LLViewerRegion::getNumSeedCapRetries()
+{
+	return mImpl->mSeedCapAttempts;
+}
+
+void LLViewerRegion::failedSeedCapability()
+{
+	// Should we retry asking for caps?
+	mImpl->mSeedCapAttempts++;
+	std::string url = getCapability("Seed");
+	if ( url.empty() )
+	{
+		LL_WARNS2("AppInit", "Capabilities") << "Failed to get seed capabilities, and can not determine url for retries!" << LL_ENDL;
+		return;
+	}
+	// After a few attempts, continue login.  We will keep trying once in-world:
+	if ( mImpl->mSeedCapAttempts >= mImpl->mSeedCapMaxAttemptsBeforeLogin &&
+		 STATE_SEED_GRANTED_WAIT == LLStartUp::getStartupState() )
+	{
+		LLStartUp::setStartupState( STATE_SEED_CAP_GRANTED );
+	}
+
+	if ( mImpl->mSeedCapAttempts < mImpl->mSeedCapMaxAttempts)
+	{
+		LLSD capabilityNames = LLSD::emptyArray();
+		mImpl->buildCapabilityNames(capabilityNames);
+
+		llinfos << "posting to seed " << url << " (retry " 
+				<< mImpl->mSeedCapAttempts << ")" << llendl;
+
+		S32 id = ++mImpl->mHttpResponderID;
+		LLHTTPClient::post(url, capabilityNames, 
+						BaseCapabilitiesComplete::build(getHandle(), id),
+						LLSD(), CAP_REQUEST_TIMEOUT);
+	}
+	else
+	{
+		// *TODO: Give a user pop-up about this error?
+		LL_WARNS2("AppInit", "Capabilities") << "Failed to get seed capabilities from '" << url << "' after " << mImpl->mSeedCapAttempts << " attempts.  Giving up!" << LL_ENDL;
+	}
 }
 
 class SimulatorFeaturesReceived : public LLHTTPClient::Responder
 {
 	LOG_CLASS(SimulatorFeaturesReceived);
 public:
-    SimulatorFeaturesReceived(LLViewerRegion* region)
-	: mRegion(region)
+    SimulatorFeaturesReceived(const std::string& retry_url, U64 region_handle, 
+			S32 attempt = 0, S32 max_attempts = MAX_CAP_REQUEST_ATTEMPTS)
+	: mRetryURL(retry_url), mRegionHandle(region_handle), mAttempt(attempt), mMaxAttempts(max_attempts)
     { }
 	
 	
     void error(U32 statusNum, const std::string& reason)
     {
 		LL_WARNS2("AppInit", "SimulatorFeatures") << statusNum << ": " << reason << LL_ENDL;
+		retry();
     }
-	
+
     void result(const LLSD& content)
     {
-		if(!mRegion) //region is removed or responder is not created.
+		LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
+		if(!regionp) //region is removed or responder is not created.
 		{
+			LL_WARNS2("AppInit", "SimulatorFeatures") << "Received results for region that no longer exists!" << LL_ENDL;
 			return ;
 		}
 		
-		mRegion->setSimulatorFeatures(content);
+		regionp->setSimulatorFeatures(content);
 	}
-	
-    static boost::intrusive_ptr<SimulatorFeaturesReceived> build(
-																 LLViewerRegion* region)
-    {
-		return boost::intrusive_ptr<SimulatorFeaturesReceived>(
-															   new SimulatorFeaturesReceived(region));
-    }
-	
+
 private:
-	LLViewerRegion* mRegion;
+	void retry()
+	{
+		if (mAttempt < mMaxAttempts)
+		{
+			mAttempt++;
+			LL_WARNS2("AppInit", "SimulatorFeatures") << "Re-trying '" << mRetryURL << "'.  Retry #" << mAttempt << LL_ENDL;
+			LLHTTPClient::get(mRetryURL, new SimulatorFeaturesReceived(*this), LLSD(), CAP_REQUEST_TIMEOUT);
+		}
+	}
+	
+	std::string mRetryURL;
+	U64 mRegionHandle;
+	S32 mAttempt;
+	S32 mMaxAttempts;
 };
 
 
@@ -1640,7 +1687,7 @@ void LLViewerRegion::setCapability(const std::string& name, const std::string& u
 	else if (name == "SimulatorFeatures")
 	{
 		// kick off a request for simulator features
-		LLHTTPClient::get(url, new SimulatorFeaturesReceived(this));
+		LLHTTPClient::get(url, new SimulatorFeaturesReceived(url, getHandle()), LLSD(), CAP_REQUEST_TIMEOUT);
 	}
 	else
 	{
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index 0176969cea..b3c19ea58d 100644
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -226,11 +226,12 @@ public:
 
 	U32	getPacketsLost() const;
 
-	void setHttpResponderPtrNULL();
-	const LLHTTPClient::ResponderPtr getHttpResponderPtr() const;
+	S32 getHttpResponderID() const;
 
 	// Get/set named capability URLs for this region.
-	void setSeedCapability(const std::string& url, S32 retry = 0);
+	void setSeedCapability(const std::string& url);
+	void failedSeedCapability();
+	S32 getNumSeedCapRetries();
 	void setCapability(const std::string& name, const std::string& url);
 	// implements LLCapabilityProvider
     virtual std::string getCapability(const std::string& name) const;
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 5c977492d8..b5be3cd552 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -1133,7 +1133,10 @@ void LLVOAvatar::initClass()
 		llerrs << "Error parsing skeleton XML file: " << skeleton_path << llendl;
 	}
 	// parse avatar_lad.xml
-	llassert(!sAvatarXmlInfo);
+	if (sAvatarXmlInfo)
+	{ //this can happen if a login attempt failed
+		deleteAndClear(sAvatarXmlInfo);
+	}
 	sAvatarXmlInfo = new LLVOAvatarXmlInfo;
 	if (!sAvatarXmlInfo->parseXmlSkeletonNode(root))
 	{
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 022c97f341..cb371edacf 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -43,6 +43,8 @@
 	<string name="LoginInitializingQuicktime">Initializing QuickTime...</string>
 	<string name="LoginQuicktimeNotFound">QuickTime not found - unable to initialize.</string>
 	<string name="LoginQuicktimeOK">QuickTime initialized successfully.</string>
+	<string name="LoginRequestSeedCapGrant">Requesting region capabilities...</string>
+	<string name="LoginRetrySeedCapGrant">Requesting region capabilities, attempt [NUMBER]...</string>
 	<string name="LoginWaitingForRegionHandshake">Waiting for region handshake...</string>
 	<string name="LoginConnectingToRegion">Connecting to region...</string>
 	<string name="LoginDownloadingClothing">Downloading clothing...</string>
-- 
cgit v1.2.3


From 3ce04f335e640ef9a00b00aae94ef2de841a1f7b Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Mon, 18 Jul 2011 18:25:47 -0400
Subject: SH-1904 FIX (cherry pick from original by bao)

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

(limited to 'indra/newview')

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 8b7e33ad36bc33c2356300f8eabc8ddae578070e Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Tue, 19 Jul 2011 15:19:07 -0400
Subject: Cherry pick of
 https://bitbucket.org/lindenlab/mesh-development/changeset/9cea44ebea3b by
 don, to fix old viewer crashes in mesh regions

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

(limited to 'indra/newview')

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 11ddfa8bcee802b0c5808ab4fef2eba48e8fc47f Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Tue, 19 Jul 2011 17:52:32 -0400
Subject: SH-2090 FIX - cherry pick from davep commit

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

(limited to 'indra/newview')

diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
old mode 100644
new mode 100755
index 4723ec9bd1..367a3f5732
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1017,6 +1017,9 @@ 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 298bb68484ec2f44369a1ad2e2b4c84d71d3d9f0 Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Fri, 22 Jul 2011 15:22:59 +0300
Subject: STORM-1474 FIXED Implement Show Last Search in viewer chrome

- Minimize the search floater on teleport
---
 indra/newview/llagent.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 492cfe7c1b..642a1907f0 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -3356,8 +3356,8 @@ bool LLAgent::teleportCore(bool is_local)
 	// hide the Region/Estate floater
 	LLFloaterReg::hideInstance("region_info");
 
-	// hide the search floater (EXT-8276)
-	LLFloaterReg::hideInstance("search");
+	// minimize the Search floater (STORM-1474)
+	LLFloaterReg::getInstance("search")->setMinimized(TRUE);
 
 	LLViewerParcelMgr::getInstance()->deselectLand();
 	LLViewerMediaFocus::getInstance()->clearFocus();
-- 
cgit v1.2.3


From e67bc887377c7a2eecaa2135c3e6c0f27724f3b5 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 22 Jul 2011 17:35:05 +0300
Subject: STORM-1311 FIXED Provide more space for parcel description in the
 Place Profile when coming from search.

This also affects the way teleport history items look.

In the first place I tried to make the description occupy all available space
and follow viewer window shape. However that triggered numerous bugs in the
text widgets, which spoiled the whole fix.
So I'm coming up with a temporary hacky solution that should fit
the ticket requirements.
---
 indra/newview/llexpandabletextbox.cpp |  9 +++++++++
 indra/newview/llexpandabletextbox.h   |  4 ++++
 indra/newview/llpanelplaceprofile.cpp | 29 +++++++++++++++++++++++++++++
 3 files changed, 42 insertions(+)

(limited to 'indra/newview')

diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp
index 5501b8c2ac..2abfbf37ca 100644
--- a/indra/newview/llexpandabletextbox.cpp
+++ b/indra/newview/llexpandabletextbox.cpp
@@ -415,6 +415,15 @@ void LLExpandableTextBox::onTopLost()
 	LLUICtrl::onTopLost();
 }
 
+void LLExpandableTextBox::updateTextShape()
+{
+	// I guess this should be done on every reshape(),
+	// but adding this code to reshape() currently triggers bug VWR-26455,
+	// which makes the text virtually unreadable.
+	llassert(!mExpanded);
+	updateTextBoxRect();
+}
+
 void LLExpandableTextBox::setValue(const LLSD& value)
 {
 	collapseTextBox();
diff --git a/indra/newview/llexpandabletextbox.h b/indra/newview/llexpandabletextbox.h
index f75ef954ff..399e48bea2 100644
--- a/indra/newview/llexpandabletextbox.h
+++ b/indra/newview/llexpandabletextbox.h
@@ -143,6 +143,10 @@ public:
 	 */
 	/*virtual*/ void onTopLost();
 
+	/**
+	 * *HACK: Update the inner textbox shape.
+	 */
+	void updateTextShape();
 
 	/**
 	 * Draws text box, collapses text box if its expanded and its parent's position changed
diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp
index 1e9ce58237..f82e86ef08 100644
--- a/indra/newview/llpanelplaceprofile.cpp
+++ b/indra/newview/llpanelplaceprofile.cpp
@@ -32,6 +32,7 @@
 #include "llparcel.h"
 #include "message.h"
 
+#include "llexpandabletextbox.h"
 #include "lliconctrl.h"
 #include "lllineeditor.h"
 #include "lltextbox.h"
@@ -227,6 +228,34 @@ void LLPanelPlaceProfile::setInfoType(EInfoType type)
 
 	getChild<LLAccordionCtrl>("advanced_info_accordion")->setVisible(is_info_type_agent);
 
+	// If we came from search we want larger description area, approx. 10 lines (see STORM-1311).
+	// Don't use the maximum available space because that leads to nasty artifacts
+	// in text editor and expandable text box.
+	{
+		const S32 SEARCH_DESC_HEIGHT = 150;
+
+		// Remember original geometry (once).
+		static const S32 sOrigDescVPad = getChildView("parcel_title")->getRect().mBottom - mDescEditor->getRect().mTop;
+		static const S32 sOrigDescHeight = mDescEditor->getRect().getHeight();
+		static const S32 sOrigMRIconVPad = mDescEditor->getRect().mBottom - mMaturityRatingIcon->getRect().mTop;
+		static const S32 sOrigMRTextVPad = mDescEditor->getRect().mBottom - mMaturityRatingText->getRect().mTop;
+
+		// Resize the description.
+		const S32 desc_height = is_info_type_agent ? sOrigDescHeight : SEARCH_DESC_HEIGHT;
+		const S32 desc_top = getChildView("parcel_title")->getRect().mBottom - sOrigDescVPad;
+		LLRect desc_rect = mDescEditor->getRect();
+		desc_rect.setOriginAndSize(desc_rect.mLeft, desc_top - desc_height, desc_rect.getWidth(), desc_height);
+		mDescEditor->reshape(desc_rect.getWidth(), desc_rect.getHeight());
+		mDescEditor->setRect(desc_rect);
+		mDescEditor->updateTextShape();
+
+		// Move the maturity rating icon/text accordingly.
+		const S32 mr_icon_bottom = mDescEditor->getRect().mBottom - sOrigMRIconVPad - mMaturityRatingIcon->getRect().getHeight();
+		const S32 mr_text_bottom = mDescEditor->getRect().mBottom - sOrigMRTextVPad - mMaturityRatingText->getRect().getHeight();
+		mMaturityRatingIcon->setOrigin(mMaturityRatingIcon->getRect().mLeft, mr_icon_bottom);
+		mMaturityRatingText->setOrigin(mMaturityRatingText->getRect().mLeft, mr_text_bottom);
+	}
+
 	switch(type)
 	{
 		case AGENT:
-- 
cgit v1.2.3


From 6fc9b496069bed9eb34773cdb3a782c85a595bbd Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 22 Jul 2011 18:38:49 +0300
Subject: STORM-1451 FIXED "Login failed" message is empty in Danish.

---
 indra/newview/skins/default/xui/da/notifications.xml | 1 +
 1 file changed, 1 insertion(+)

(limited to 'indra/newview')

diff --git a/indra/newview/skins/default/xui/da/notifications.xml b/indra/newview/skins/default/xui/da/notifications.xml
index 4c0fbd280b..c3999501eb 100644
--- a/indra/newview/skins/default/xui/da/notifications.xml
+++ b/indra/newview/skins/default/xui/da/notifications.xml
@@ -454,6 +454,7 @@ Købsprisen for dette land er ikke refunderet til ejeren. Hvis en dedikeret parv
 Dediker disse [AREA] m² land til gruppen &apos;[GROUP_NAME]&apos;?
 	</notification>
 	<notification name="ErrorMessage">
+		[ERROR_MESSAGE]
 		<usetemplate name="okbutton" yestext="OK"/>
 	</notification>
 	<notification name="AvatarMovedDesired">
-- 
cgit v1.2.3


From 1bc2d6035623d24588a69d501aa4ef76a93e113f Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 22 Jul 2011 18:59:29 +0300
Subject: STORM-1408 FIXED [DE] Text truncation in Edit outfit floater

Overriden the button width for German.
---
 indra/newview/skins/default/xui/de/panel_outfit_edit.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/skins/default/xui/de/panel_outfit_edit.xml b/indra/newview/skins/default/xui/de/panel_outfit_edit.xml
index 632f414747..1af0492aa1 100644
--- a/indra/newview/skins/default/xui/de/panel_outfit_edit.xml
+++ b/indra/newview/skins/default/xui/de/panel_outfit_edit.xml
@@ -46,8 +46,8 @@
 	</panel>
 	<panel name="save_revert_button_bar">
 		<layout_stack name="button_bar_ls">
-			<layout_panel name="save_btn_lp">
-				<button label="Speichern" name="save_btn"/>
+			<layout_panel name="save_btn_lp" width="61">
+				<button label="Speichern" name="save_btn" width="60" />
 			</layout_panel>
 			<layout_panel name="revert_btn_lp">
 				<button label="Änderungen rückgängig machen" name="revert_btn" tool_tip="Zur zuletzt gespeicherten Version zurückkehren"/>
-- 
cgit v1.2.3


From 632ae752114fe67ffb00b77d5200f4c9883c5124 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Fri, 22 Jul 2011 20:47:55 +0300
Subject: STORM-1404 FIXED Light viewer: untranslated buttons in the People
 panel.

Bug reason: incorrect reuse of an xml element name.
Fix: provided unique names for the buttons.
---
 indra/newview/skins/minimal/xui/da/panel_people.xml | 8 ++++----
 indra/newview/skins/minimal/xui/de/panel_people.xml | 6 +++---
 indra/newview/skins/minimal/xui/en/panel_people.xml | 6 +++---
 indra/newview/skins/minimal/xui/es/panel_people.xml | 6 +++---
 indra/newview/skins/minimal/xui/fr/panel_people.xml | 6 +++---
 indra/newview/skins/minimal/xui/it/panel_people.xml | 8 ++++----
 indra/newview/skins/minimal/xui/ja/panel_people.xml | 8 ++++----
 indra/newview/skins/minimal/xui/pl/panel_people.xml | 8 ++++----
 indra/newview/skins/minimal/xui/pt/panel_people.xml | 6 +++---
 9 files changed, 31 insertions(+), 31 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/skins/minimal/xui/da/panel_people.xml b/indra/newview/skins/minimal/xui/da/panel_people.xml
index 49cd2c71f2..8be4d695bd 100644
--- a/indra/newview/skins/minimal/xui/da/panel_people.xml
+++ b/indra/newview/skins/minimal/xui/da/panel_people.xml
@@ -66,16 +66,16 @@ Leder du efter personer at være sammen med? Prøv destinationsknappen nedenfor.
 			<layout_panel name="view_profile_btn_lp">
 				<button label="Profil" name="view_profile_btn" tool_tip="Vis billeder, grupper og anden beboer information"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="im_btn_lp">
 				<button label="IM" name="im_btn" tool_tip="Åben session med privat besked (IM)"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="call_btn_lp">
 				<button label="Opkald" name="call_btn" tool_tip="Kald til denne beboer"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="share_btn_lp">
 				<button label="Del" name="share_btn" tool_tip="Del en genstand fra beholdning"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="teleport_btn_lp">
 				<button label="Teleportér" name="teleport_btn" tool_tip="Tilbyd teleport"/>
 			</layout_panel>
 		</layout_stack>
diff --git a/indra/newview/skins/minimal/xui/de/panel_people.xml b/indra/newview/skins/minimal/xui/de/panel_people.xml
index 4f8f70ad17..a52557236f 100644
--- a/indra/newview/skins/minimal/xui/de/panel_people.xml
+++ b/indra/newview/skins/minimal/xui/de/panel_people.xml
@@ -48,13 +48,13 @@
 			<layout_panel name="view_profile_btn_lp">
 				<button label="Profil" name="view_profile_btn" tool_tip="Bilder, Gruppen und andere Einwohner-Informationen anzeigen"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="im_btn_lp">
 				<button label="IM" name="im_btn" tool_tip="Instant Messenger öffnen"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="call_btn_lp">
 				<button label="Anrufen" name="call_btn" tool_tip="Diesen Einwohner anrufen"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="teleport_btn_lp">
 				<button label="Teleportieren" name="teleport_btn" tool_tip="Teleport anbieten"/>
 			</layout_panel>
 		</layout_stack>
diff --git a/indra/newview/skins/minimal/xui/en/panel_people.xml b/indra/newview/skins/minimal/xui/en/panel_people.xml
index 76baacb091..4739f86e95 100644
--- a/indra/newview/skins/minimal/xui/en/panel_people.xml
+++ b/indra/newview/skins/minimal/xui/en/panel_people.xml
@@ -428,7 +428,7 @@ Looking for people to hang out with? Try the Destinations button below.
 			height="23"
 			layout="bottomleft"
 			left_pad="3"
-			name="chat_btn_lp"
+			name="im_btn_lp"
 		    user_resize="false" 
 		    auto_resize="true"
 			width="41">
@@ -449,7 +449,7 @@ Looking for people to hang out with? Try the Destinations button below.
 			height="23"
 			layout="bottomleft"
 			left_pad="3"
-			name="chat_btn_lp"
+			name="call_btn_lp"
 		    user_resize="false" 
 		    auto_resize="true"
 			width="52">
@@ -470,7 +470,7 @@ Looking for people to hang out with? Try the Destinations button below.
 			height="23"
 			layout="bottomleft"
 			left_pad="3"
-			name="chat_btn_lp"
+			name="teleport_btn_lp"
 		    user_resize="false" 
 		    auto_resize="true"
 			width="77">
diff --git a/indra/newview/skins/minimal/xui/es/panel_people.xml b/indra/newview/skins/minimal/xui/es/panel_people.xml
index 1e1c3411ae..8d3d14fa89 100644
--- a/indra/newview/skins/minimal/xui/es/panel_people.xml
+++ b/indra/newview/skins/minimal/xui/es/panel_people.xml
@@ -49,13 +49,13 @@
 			<layout_panel name="view_profile_btn_lp">
 				<button label="Perfil" name="view_profile_btn" tool_tip="Mostrar imágenes, grupos y otra información del Residente"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="im_btn_lp">
 				<button label="MI" name="im_btn" tool_tip="Abrir una sesión de mensajes instantáneos"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="call_btn_lp">
 				<button label="Llamar" name="call_btn" tool_tip="Llamar a este Residente"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="teleport_btn_lp">
 				<button label="Teleporte" name="teleport_btn" tool_tip="Ofrecer teleporte"/>
 			</layout_panel>
 		</layout_stack>
diff --git a/indra/newview/skins/minimal/xui/fr/panel_people.xml b/indra/newview/skins/minimal/xui/fr/panel_people.xml
index 72fb4d807f..4d6e31d9b5 100644
--- a/indra/newview/skins/minimal/xui/fr/panel_people.xml
+++ b/indra/newview/skins/minimal/xui/fr/panel_people.xml
@@ -49,13 +49,13 @@ Vous recherchez des résidents avec qui passer du temps ? Essayez avec le bouto
 			<layout_panel name="view_profile_btn_lp">
 				<button label="Profil" name="view_profile_btn" tool_tip="Afficher la photo, les groupes et autres infos des résidents"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="im_btn_lp">
 				<button label="IM" name="im_btn" tool_tip="Ouvrir une session IM"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="call_btn_lp">
 				<button label="Appeler" name="call_btn" tool_tip="Appeler ce résident."/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="teleport_btn_lp">
 				<button label="Téléporter" name="teleport_btn" tool_tip="Proposer une téléportation"/>
 			</layout_panel>
 		</layout_stack>
diff --git a/indra/newview/skins/minimal/xui/it/panel_people.xml b/indra/newview/skins/minimal/xui/it/panel_people.xml
index 068c8bb808..81e886acf0 100644
--- a/indra/newview/skins/minimal/xui/it/panel_people.xml
+++ b/indra/newview/skins/minimal/xui/it/panel_people.xml
@@ -66,16 +66,16 @@ Stai cercando persone da frequentare? Prova il pulsante Destinazioni in basso.
 			<layout_panel name="view_profile_btn_lp">
 				<button label="Profilo" name="view_profile_btn" tool_tip="Mostra immagine, gruppi e altre informazioni del residente"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="im_btn_lp">
 				<button label="IM" name="im_btn" tool_tip="Apri una sessione messaggio istantaneo"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="call_btn_lp">
 				<button label="Chiama" name="call_btn" tool_tip="Chiama questo residente"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="share_btn_lp">
 				<button label="Condividi" name="share_btn" tool_tip="Condividi un oggetto dell&apos;inventario"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="teleport_btn_lp">
 				<button label="Teleport" name="teleport_btn" tool_tip="Offri teleport"/>
 			</layout_panel>
 		</layout_stack>
diff --git a/indra/newview/skins/minimal/xui/ja/panel_people.xml b/indra/newview/skins/minimal/xui/ja/panel_people.xml
index 9eb45d9a80..5caeebc151 100644
--- a/indra/newview/skins/minimal/xui/ja/panel_people.xml
+++ b/indra/newview/skins/minimal/xui/ja/panel_people.xml
@@ -66,16 +66,16 @@
 			<layout_panel name="view_profile_btn_lp">
 				<button label="プロフィール" name="view_profile_btn" tool_tip="写真、グループ、その他住人情報を表示"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="im_btn_lp">
 				<button label="IM" name="im_btn" tool_tip="インスタントメッセージを開きます"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="call_btn_lp">
 				<button label="コール" name="call_btn" tool_tip="この住人にコールする"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="share_btn_lp">
 				<button label="共有" name="share_btn" tool_tip="「持ち物」のアイテムを共有する"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="teleport_btn_lp">
 				<button label="テレポート" name="teleport_btn" tool_tip="テレポートを送ります"/>
 			</layout_panel>
 		</layout_stack>
diff --git a/indra/newview/skins/minimal/xui/pl/panel_people.xml b/indra/newview/skins/minimal/xui/pl/panel_people.xml
index dbfee739f4..3b3aaa0987 100644
--- a/indra/newview/skins/minimal/xui/pl/panel_people.xml
+++ b/indra/newview/skins/minimal/xui/pl/panel_people.xml
@@ -66,16 +66,16 @@ Chcesz spotkać ludzi? Skorzystaj z przycisku &quot;Atrakcje turystyczne&quot; p
 			<layout_panel name="view_profile_btn_lp">
 				<button label="Profil" name="view_profile_btn" tool_tip="Pokaż zdjęcie, grupy i inne informacje o Rezydencie"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="im_btn_lp">
 				<button label="IM" name="im_btn" tool_tip="Otwórz wiadomości IM"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="call_btn_lp">
 				<button label="Dzwoń" name="call_btn" tool_tip="Zadzwoń do tego Rezydenta"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="share_btn_lp">
 				<button label="Udostępnij" name="share_btn" tool_tip="Udostępnij obiekt z Szafy"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="teleport_btn_lp">
 				<button label="Teleportuj" name="teleport_btn" tool_tip="Zaproponuj teleport"/>
 			</layout_panel>
 		</layout_stack>
diff --git a/indra/newview/skins/minimal/xui/pt/panel_people.xml b/indra/newview/skins/minimal/xui/pt/panel_people.xml
index d46c440eb9..0e98c586c6 100644
--- a/indra/newview/skins/minimal/xui/pt/panel_people.xml
+++ b/indra/newview/skins/minimal/xui/pt/panel_people.xml
@@ -49,13 +49,13 @@ Em busca de alguém para conversar? Confira o botão Destinos abaixo.
 			<layout_panel name="view_profile_btn_lp">
 				<button label="Perfil" name="view_profile_btn" tool_tip="Exibir fotografia, grupos e outras informações dos residentes"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="im_btn_lp">
 				<button label="MI" name="im_btn" tool_tip="Abrir sessão de mensagem instantânea"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="call_btn_lp">
 				<button label="Ligar" name="call_btn" tool_tip="Ligar para este residente"/>
 			</layout_panel>
-			<layout_panel name="chat_btn_lp">
+			<layout_panel name="teleport_btn_lp">
 				<button label="Teletransportar" name="teleport_btn" tool_tip="Oferecer teletransporte"/>
 			</layout_panel>
 		</layout_stack>
-- 
cgit v1.2.3


From c645e9e59e9e0a83a25f2c782ac79c21d519939e Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Mon, 25 Jul 2011 17:34:06 +0300
Subject: STORM-1220 FIXED Localized sim product name (e.g. "Estate / Full
 Region") everywhere.

---
 indra/newview/llfloaterbuyland.cpp    |  2 +-
 indra/newview/llfloaterland.cpp       | 13 ++-----------
 indra/newview/llfloaterregioninfo.cpp |  9 +++------
 indra/newview/llpanelplaceprofile.cpp |  2 +-
 indra/newview/llviewerregion.cpp      |  6 ++++++
 indra/newview/llviewerregion.h        |  1 +
 6 files changed, 14 insertions(+), 19 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp
index 610142b5a9..5cfdd69f7b 100644
--- a/indra/newview/llfloaterbuyland.cpp
+++ b/indra/newview/llfloaterbuyland.cpp
@@ -529,7 +529,7 @@ void LLFloaterBuyLandUI::updateCovenantInfo()
 	LLTextBox* region_type = getChild<LLTextBox>("region_type_text");
 	if (region_type)
 	{
-		region_type->setText(region->getSimProductName());
+		region_type->setText(region->getLocalizedSimProductName());
 	}
 	
 	LLTextBox* resellable_clause = getChild<LLTextBox>("resellable_clause");
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 9b7593ce61..4746f93009 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -566,10 +566,7 @@ void LLPanelLandGeneral::refresh()
 		if (regionp)
 		{
 			insert_maturity_into_textbox(mContentRating, gFloaterView->getParentFloater(this), MATURITY);
-
-			std::string land_type;
-			bool is_land_type_localized = LLTrans::findString(land_type, regionp->getSimProductName());
-			mLandType->setText(is_land_type_localized ? land_type : regionp->getSimProductName());
+			mLandType->setText(regionp->getLocalizedSimProductName());
 		}
 
 		// estate owner/manager cannot edit other parts of the parcel
@@ -2883,13 +2880,7 @@ void LLPanelLandCovenant::refresh()
 	}
 
 	LLTextBox* region_landtype = getChild<LLTextBox>("region_landtype_text");
-	if (region_landtype)
-	{
-		std::string land_type;
-		bool is_land_type_localized = LLTrans::findString(land_type, region->getSimProductName());
-
-		region_landtype->setText(is_land_type_localized ? land_type : region->getSimProductName());
-	}
+	region_landtype->setText(region->getLocalizedSimProductName());
 	
 	LLTextBox* region_maturity = getChild<LLTextBox>("region_maturity_text");
 	if (region_maturity)
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index 538c5e3b88..9a99417e93 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -336,7 +336,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
 	LLViewerRegion* region = gAgent.getRegion();
 	BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate());
 
-	// *TODO: Replace parcing msg with accessing the region info model.
+	// *TODO: Replace parsing msg with accessing the region info model.
 	LLRegionInfoModel& region_info = LLRegionInfoModel::instance();
 
 	// extract message
@@ -368,6 +368,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
 		msg->getSize("RegionInfo2", "ProductName") > 0)
 	{
 		msg->getString("RegionInfo2", "ProductName", sim_type);
+		LLTrans::findString(sim_type, sim_type); // try localizing sim product name
 	}
 
 	// GENERAL PANEL
@@ -2409,11 +2410,7 @@ bool LLPanelEstateCovenant::refreshFromRegion(LLViewerRegion* region)
 	}
 	
 	LLTextBox* region_landtype = getChild<LLTextBox>("region_landtype_text");
-	if (region_landtype)
-	{
-		region_landtype->setText(region->getSimProductName());
-	}
-	
+	region_landtype->setText(region->getLocalizedSimProductName());
 	
 	// let the parent class handle the general data collection. 
 	bool rv = LLPanelRegionInfo::refreshFromRegion(region);
diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp
index 1e9ce58237..b3c2fe2552 100644
--- a/indra/newview/llpanelplaceprofile.cpp
+++ b/indra/newview/llpanelplaceprofile.cpp
@@ -434,7 +434,7 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel,
 	}
 
 	mRegionNameText->setText(region->getName());
-	mRegionTypeText->setText(region->getSimProductName());
+	mRegionTypeText->setText(region->getLocalizedSimProductName());
 
 	// Determine parcel owner
 	if (parcel->isPublic())
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index bb7170e0f7..c33b39b449 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -558,6 +558,12 @@ const std::string LLViewerRegion::getSimAccessString() const
 	return accessToString(mSimAccess);
 }
 
+std::string LLViewerRegion::getLocalizedSimProductName() const
+{
+	const std::string& spn = getSimProductName();
+	std::string localized_spn;
+	return LLTrans::findString(localized_spn, spn) ? localized_spn : spn;
+}
 
 // static
 std::string LLViewerRegion::regionFlagsToString(U32 flags)
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index f68b51ea65..dbc12f548b 100644
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -193,6 +193,7 @@ public:
 	const std::string& getSimColoName()    const { return mColoName; }
 	const std::string& getSimProductSKU()  const { return mProductSKU; }
 	const std::string& getSimProductName() const { return mProductName; }
+	std::string getLocalizedSimProductName() const;
 
 	// Returns "Sandbox", "Expensive", etc.
 	static std::string regionFlagsToString(U32 flags);
-- 
cgit v1.2.3


From 149ca396817246c5a69e3913f66a892cf0a0e90f Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Mon, 25 Jul 2011 19:48:43 +0300
Subject: STORM-1233 FIXED Made the "Profile" button translatable in the Places
 panel by providing its layout stack with a unique name.

---
 indra/newview/skins/default/xui/da/panel_places.xml | 2 +-
 indra/newview/skins/default/xui/de/panel_places.xml | 2 +-
 indra/newview/skins/default/xui/en/panel_places.xml | 2 +-
 indra/newview/skins/default/xui/es/panel_places.xml | 2 +-
 indra/newview/skins/default/xui/fr/panel_places.xml | 2 +-
 indra/newview/skins/default/xui/it/panel_places.xml | 2 +-
 indra/newview/skins/default/xui/ja/panel_places.xml | 2 +-
 indra/newview/skins/default/xui/pl/panel_places.xml | 2 +-
 indra/newview/skins/default/xui/pt/panel_places.xml | 2 +-
 indra/newview/skins/default/xui/zh/panel_places.xml | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/skins/default/xui/da/panel_places.xml b/indra/newview/skins/default/xui/da/panel_places.xml
index fe8ca69f34..c555f2fb09 100644
--- a/indra/newview/skins/default/xui/da/panel_places.xml
+++ b/indra/newview/skins/default/xui/da/panel_places.xml
@@ -24,7 +24,7 @@
 						<menu_button label="▼" name="overflow_btn" tool_tip="Vis flere valg"/>
 					</layout_panel>
 				</layout_stack>
-				<layout_stack name="bottom_bar_ls3">
+				<layout_stack name="bottom_bar_profile_ls">
 					<layout_panel name="profile_btn_lp">
 						<button label="Profil" name="profile_btn" tool_tip="Vis profil for sted"/>
 					</layout_panel>
diff --git a/indra/newview/skins/default/xui/de/panel_places.xml b/indra/newview/skins/default/xui/de/panel_places.xml
index 36c77d4fe1..602ffff94d 100644
--- a/indra/newview/skins/default/xui/de/panel_places.xml
+++ b/indra/newview/skins/default/xui/de/panel_places.xml
@@ -24,7 +24,7 @@
 						<menu_button label="▼" name="overflow_btn" tool_tip="Zusätzliche Optionen anzeigen"/>
 					</layout_panel>
 				</layout_stack>
-				<layout_stack name="bottom_bar_ls3">
+				<layout_stack name="bottom_bar_profile_ls">
 					<layout_panel name="profile_btn_lp">
 						<button label="Profil" name="profile_btn" tool_tip="Ortsprofil anzeigen"/>
 					</layout_panel>
diff --git a/indra/newview/skins/default/xui/en/panel_places.xml b/indra/newview/skins/default/xui/en/panel_places.xml
index daf571297f..b6b8a337a1 100644
--- a/indra/newview/skins/default/xui/en/panel_places.xml
+++ b/indra/newview/skins/default/xui/en/panel_places.xml
@@ -234,7 +234,7 @@ background_visible="true"
 				height="23"
 				layout="topleft"
 				mouse_opaque="false"
-				name="bottom_bar_ls3"
+				name="bottom_bar_profile_ls"
 				left="0"
 				orientation="horizontal"
 				top="0"
diff --git a/indra/newview/skins/default/xui/es/panel_places.xml b/indra/newview/skins/default/xui/es/panel_places.xml
index 4c90a7e6b4..e9984b4512 100644
--- a/indra/newview/skins/default/xui/es/panel_places.xml
+++ b/indra/newview/skins/default/xui/es/panel_places.xml
@@ -24,7 +24,7 @@
 						<menu_button label="▼" name="overflow_btn" tool_tip="Ver más opciones"/>
 					</layout_panel>
 				</layout_stack>
-				<layout_stack name="bottom_bar_ls3">
+				<layout_stack name="bottom_bar_profile_ls">
 					<layout_panel name="profile_btn_lp">
 						<button label="Perfil" name="profile_btn" tool_tip="Mostrar el perfil del lugar"/>
 					</layout_panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_places.xml b/indra/newview/skins/default/xui/fr/panel_places.xml
index e252c224f8..509d167704 100644
--- a/indra/newview/skins/default/xui/fr/panel_places.xml
+++ b/indra/newview/skins/default/xui/fr/panel_places.xml
@@ -24,7 +24,7 @@
 						<menu_button label="▼" name="overflow_btn" tool_tip="Afficher d&apos;autres options"/>
 					</layout_panel>
 				</layout_stack>
-				<layout_stack name="bottom_bar_ls3">
+				<layout_stack name="bottom_bar_profile_ls">
 					<layout_panel name="profile_btn_lp">
 						<button label="Profil" name="profile_btn" tool_tip="Afficher le profil de l&apos;endroit"/>
 					</layout_panel>
diff --git a/indra/newview/skins/default/xui/it/panel_places.xml b/indra/newview/skins/default/xui/it/panel_places.xml
index 61830f186f..69995fb5de 100644
--- a/indra/newview/skins/default/xui/it/panel_places.xml
+++ b/indra/newview/skins/default/xui/it/panel_places.xml
@@ -24,7 +24,7 @@
 						<menu_button label="▼" name="overflow_btn" tool_tip="Mostra ulteriori opzioni"/>
 					</layout_panel>
 				</layout_stack>
-				<layout_stack name="bottom_bar_ls3">
+				<layout_stack name="bottom_bar_profile_ls">
 					<layout_panel name="profile_btn_lp">
 						<button label="Profilo" name="profile_btn" tool_tip="Mostra il profilo del luogo"/>
 					</layout_panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_places.xml b/indra/newview/skins/default/xui/ja/panel_places.xml
index e19b86e552..9d3925afdc 100644
--- a/indra/newview/skins/default/xui/ja/panel_places.xml
+++ b/indra/newview/skins/default/xui/ja/panel_places.xml
@@ -24,7 +24,7 @@
 						<menu_button label="▼" name="overflow_btn" tool_tip="オプションを表示します"/>
 					</layout_panel>
 				</layout_stack>
-				<layout_stack name="bottom_bar_ls3">
+				<layout_stack name="bottom_bar_profile_ls">
 					<layout_panel name="profile_btn_lp">
 						<button label="プロフィール" name="profile_btn" tool_tip="場所のプロフィールを表示"/>
 					</layout_panel>
diff --git a/indra/newview/skins/default/xui/pl/panel_places.xml b/indra/newview/skins/default/xui/pl/panel_places.xml
index 34c105225d..d69d137d23 100644
--- a/indra/newview/skins/default/xui/pl/panel_places.xml
+++ b/indra/newview/skins/default/xui/pl/panel_places.xml
@@ -24,7 +24,7 @@
 						<menu_button label="▼" name="overflow_btn" tool_tip="Pokaż opcje dodatkowe"/>
 					</layout_panel>
 				</layout_stack>
-				<layout_stack name="bottom_bar_ls3">
+				<layout_stack name="bottom_bar_profile_ls">
 					<layout_panel name="profile_btn_lp">
 						<button label="Profil" name="profile_btn" tool_tip="Pokaż profil miejsca"/>
 					</layout_panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_places.xml b/indra/newview/skins/default/xui/pt/panel_places.xml
index 828ef3e469..69f0baf65f 100644
--- a/indra/newview/skins/default/xui/pt/panel_places.xml
+++ b/indra/newview/skins/default/xui/pt/panel_places.xml
@@ -24,7 +24,7 @@
 						<menu_button label="▼" name="overflow_btn" tool_tip="Mostrar opções adicionais"/>
 					</layout_panel>
 				</layout_stack>
-				<layout_stack name="bottom_bar_ls3">
+				<layout_stack name="bottom_bar_profile_ls">
 					<layout_panel name="profile_btn_lp">
 						<button label="Perfil" name="profile_btn" tool_tip="Mostrar perfil do lugar"/>
 					</layout_panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_places.xml b/indra/newview/skins/default/xui/zh/panel_places.xml
index c141201ab2..6434a7279c 100644
--- a/indra/newview/skins/default/xui/zh/panel_places.xml
+++ b/indra/newview/skins/default/xui/zh/panel_places.xml
@@ -24,7 +24,7 @@
 						<menu_button name="overflow_btn" tool_tip="顯示額外選項"/>
 					</layout_panel>
 				</layout_stack>
-				<layout_stack name="bottom_bar_ls3">
+				<layout_stack name="bottom_bar_profile_ls">
 					<layout_panel name="profile_btn_lp">
 						<button label="檔案" name="profile_btn" tool_tip="顯示地點檔案"/>
 					</layout_panel>
-- 
cgit v1.2.3


From 7e405ef0e3efce400db53ddc16d367680da659c9 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Mon, 25 Jul 2011 23:46:28 +0300
Subject: STORM-1220 FOLLOWUP Prevent displaying unlocalized sim product name.

Removed LLViewerRegion::getSimProductName() so that it doesn't mistakenly
get used in UI code, thus causing localization bugs.
---
 indra/newview/llviewerregion.cpp | 3 +--
 indra/newview/llviewerregion.h   | 1 -
 2 files changed, 1 insertion(+), 3 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index c33b39b449..d4e0831c33 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -560,9 +560,8 @@ const std::string LLViewerRegion::getSimAccessString() const
 
 std::string LLViewerRegion::getLocalizedSimProductName() const
 {
-	const std::string& spn = getSimProductName();
 	std::string localized_spn;
-	return LLTrans::findString(localized_spn, spn) ? localized_spn : spn;
+	return LLTrans::findString(localized_spn, mProductName) ? localized_spn : mProductName;
 }
 
 // static
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index dbc12f548b..a105ff625d 100644
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -192,7 +192,6 @@ public:
 	S32 getSimCPURatio()                   const { return mCPURatio; }
 	const std::string& getSimColoName()    const { return mColoName; }
 	const std::string& getSimProductSKU()  const { return mProductSKU; }
-	const std::string& getSimProductName() const { return mProductName; }
 	std::string getLocalizedSimProductName() const;
 
 	// Returns "Sandbox", "Expensive", etc.
-- 
cgit v1.2.3


From 6a52c25d2b1be2e5cfb5c006a1b8b18c0ed4ba97 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Tue, 26 Jul 2011 10:40:05 -0400
Subject: storm-1510: remove loginpage url from settings file (per code review
 suggestion from Richard)

---
 indra/newview/app_settings/settings.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 5ad62d28c0..4f5aa05b38 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -4872,7 +4872,7 @@
       <key>Type</key>
       <string>String</string>
       <key>Value</key>
-      <string>http://viewer-login.agni.lindenlab.com/</string>
+      <string/>
     </map>
     <key>LosslessJ2CUpload</key>
     <map>
-- 
cgit v1.2.3


From a1b99c4821949c41a735e55eec01126d7e77fb17 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Tue, 26 Jul 2011 18:28:06 +0300
Subject: STORM-1291 FIXED Localize names of inventory items fetched via HTTP
 post requests.

These were not localized, unlike ones fetched via the message system.
---
 indra/newview/llviewerinventory.cpp | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'indra/newview')

diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index 22666cec0d..c532346e6b 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -418,6 +418,9 @@ void LLViewerInventoryItem::fetchFromServer(void) const
 BOOL LLViewerInventoryItem::unpackMessage(LLSD item)
 {
 	BOOL rv = LLInventoryItem::fromLLSD(item);
+
+	LLLocalizedInventoryItemsDictionary::getInstance()->localizeInventoryObjectName(mName);
+
 	mIsComplete = TRUE;
 	return rv;
 }
-- 
cgit v1.2.3


From c7158f3b4de6ef438630020d7fe49a148c6773d2 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Tue, 26 Jul 2011 20:14:13 +0300
Subject: STORM-1405 WIP Eliminated redundant getChild() calls.

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

(limited to 'indra/newview')

diff --git a/indra/newview/llpanelvoicedevicesettings.cpp b/indra/newview/llpanelvoicedevicesettings.cpp
index 4a80bbbe5e..94d65c5db2 100644
--- a/indra/newview/llpanelvoicedevicesettings.cpp
+++ b/indra/newview/llpanelvoicedevicesettings.cpp
@@ -68,9 +68,12 @@ BOOL LLPanelVoiceDeviceSettings::postBuild()
 	// set mic volume tuning slider based on last mic volume setting
 	volume_slider->setValue(mMicVolume);
 
-	getChild<LLComboBox>("voice_input_device")->setCommitCallback(
+	mCtrlInputDevices = getChild<LLComboBox>("voice_input_device");
+	mCtrlOutputDevices = getChild<LLComboBox>("voice_output_device");
+
+	mCtrlInputDevices->setCommitCallback(
 		boost::bind(&LLPanelVoiceDeviceSettings::onCommitInputDevice, this));
-	getChild<LLComboBox>("voice_output_device")->setCommitCallback(
+	mCtrlOutputDevices->setCommitCallback(
 		boost::bind(&LLPanelVoiceDeviceSettings::onCommitOutputDevice, this));
 	
 	return TRUE;
@@ -188,9 +191,6 @@ void LLPanelVoiceDeviceSettings::refresh()
 	LLVoiceClient::getInstance()->tuningSetMicVolume(current_volume);
 
 	// Fill in popup menus
-	mCtrlInputDevices = getChild<LLComboBox>("voice_input_device");
-	mCtrlOutputDevices = getChild<LLComboBox>("voice_output_device");
-
 	bool device_settings_available = LLVoiceClient::getInstance()->deviceSettingsAvailable();
 
 	if (mCtrlInputDevices)
@@ -297,7 +297,7 @@ void LLPanelVoiceDeviceSettings::onCommitInputDevice()
 	if(LLVoiceClient::getInstance())
 	{
 		LLVoiceClient::getInstance()->setCaptureDevice(
-			getChild<LLComboBox>("voice_input_device")->getValue().asString());
+			mCtrlInputDevices->getValue().asString());
 	}
 }
 
@@ -306,6 +306,6 @@ void LLPanelVoiceDeviceSettings::onCommitOutputDevice()
 	if(LLVoiceClient::getInstance())
 	{
 		LLVoiceClient::getInstance()->setRenderDevice(
-			getChild<LLComboBox>("voice_output_device")->getValue().asString());
+			mCtrlInputDevices->getValue().asString());
 	}
 }
-- 
cgit v1.2.3


From 4e23f4b74c05d23aeb52b822e1ffbcc871118a51 Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Tue, 26 Jul 2011 23:14:02 +0300
Subject: STORM-1405 WIP Localized the "No Device" and "Default System Device"
 strings in the sound devices panel.

By the way, fixed improper localization of the "Default" device name
which caused saving a localized string in settings.
---
 indra/newview/llpanelvoicedevicesettings.cpp       | 50 +++++++++++++++-------
 indra/newview/llpanelvoicedevicesettings.h         |  3 ++
 .../skins/default/xui/en/panel_sound_devices.xml   |  8 ++++
 3 files changed, 45 insertions(+), 16 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llpanelvoicedevicesettings.cpp b/indra/newview/llpanelvoicedevicesettings.cpp
index 94d65c5db2..6be2ea6481 100644
--- a/indra/newview/llpanelvoicedevicesettings.cpp
+++ b/indra/newview/llpanelvoicedevicesettings.cpp
@@ -41,6 +41,7 @@
 
 
 static LLRegisterPanelClassWrapper<LLPanelVoiceDeviceSettings> t_panel_group_general("panel_voice_device_settings");
+static const std::string DEFAULT_DEVICE("Default");
 
 
 LLPanelVoiceDeviceSettings::LLPanelVoiceDeviceSettings()
@@ -75,6 +76,10 @@ BOOL LLPanelVoiceDeviceSettings::postBuild()
 		boost::bind(&LLPanelVoiceDeviceSettings::onCommitInputDevice, this));
 	mCtrlOutputDevices->setCommitCallback(
 		boost::bind(&LLPanelVoiceDeviceSettings::onCommitOutputDevice, this));
+
+	mLocalizedDeviceNames[DEFAULT_DEVICE]				= getString("default_text");
+	mLocalizedDeviceNames["No Device"]					= getString("name_no_device");
+	mLocalizedDeviceNames["Default System Device"]		= getString("name_default_system_device");
 	
 	return TRUE;
 }
@@ -141,14 +146,14 @@ void LLPanelVoiceDeviceSettings::apply()
 	std::string s;
 	if(mCtrlInputDevices)
 	{
-		s = mCtrlInputDevices->getSimple();
+		s = mCtrlInputDevices->getValue().asString();
 		gSavedSettings.setString("VoiceInputAudioDevice", s);
 		mInputDevice = s;
 	}
 
 	if(mCtrlOutputDevices)
 	{
-		s = mCtrlOutputDevices->getSimple();
+		s = mCtrlOutputDevices->getValue().asString();
 		gSavedSettings.setString("VoiceOutputAudioDevice", s);
 		mOutputDevice = s;
 	}
@@ -169,10 +174,10 @@ void LLPanelVoiceDeviceSettings::cancel()
 	gSavedSettings.setString("VoiceOutputAudioDevice", mOutputDevice);
 
 	if(mCtrlInputDevices)
-		mCtrlInputDevices->setSimple(mInputDevice);
+		mCtrlInputDevices->setValue(mInputDevice);
 
 	if(mCtrlOutputDevices)
-		mCtrlOutputDevices->setSimple(mOutputDevice);
+		mCtrlOutputDevices->setValue(mOutputDevice);
 
 	gSavedSettings.setF32("AudioLevelMic", mMicVolume);
 	LLSlider* volume_slider = getChild<LLSlider>("mic_volume_slider");
@@ -212,14 +217,14 @@ void LLPanelVoiceDeviceSettings::refresh()
 		if(mCtrlInputDevices)
 		{
 			mCtrlInputDevices->removeall();
-			mCtrlInputDevices->add( mInputDevice, ADD_BOTTOM );
-			mCtrlInputDevices->setSimple(mInputDevice);
+			mCtrlInputDevices->add(getLocalizedDeviceName(mInputDevice), mInputDevice, ADD_BOTTOM);
+			mCtrlInputDevices->setValue(mInputDevice);
 		}
 		if(mCtrlOutputDevices)
 		{
 			mCtrlOutputDevices->removeall();
-			mCtrlOutputDevices->add( mOutputDevice, ADD_BOTTOM );
-			mCtrlOutputDevices->setSimple(mOutputDevice);
+			mCtrlOutputDevices->add(getLocalizedDeviceName(mOutputDevice), mOutputDevice, ADD_BOTTOM);
+			mCtrlOutputDevices->setValue(mOutputDevice);
 		}
 		mDevicesUpdated = FALSE;
 	}
@@ -230,35 +235,41 @@ void LLPanelVoiceDeviceSettings::refresh()
 		if(mCtrlInputDevices)
 		{
 			mCtrlInputDevices->removeall();
-			mCtrlInputDevices->add( getString("default_text"), ADD_BOTTOM );
+			mCtrlInputDevices->add(getLocalizedDeviceName(DEFAULT_DEVICE), DEFAULT_DEVICE, ADD_BOTTOM);
 
 			for(iter=LLVoiceClient::getInstance()->getCaptureDevices().begin(); 
 				iter != LLVoiceClient::getInstance()->getCaptureDevices().end();
 				iter++)
 			{
-				mCtrlInputDevices->add( *iter, ADD_BOTTOM );
+				mCtrlInputDevices->add(getLocalizedDeviceName(*iter), *iter, ADD_BOTTOM);
 			}
 
-			if(!mCtrlInputDevices->setSimple(mInputDevice))
+			// Fix invalid input audio device preference.
+			if (!mCtrlInputDevices->setSelectedByValue(mInputDevice, TRUE))
 			{
-				mCtrlInputDevices->setSimple(getString("default_text"));
+				mCtrlInputDevices->setValue(DEFAULT_DEVICE);
+				gSavedSettings.setString("VoiceInputAudioDevice", DEFAULT_DEVICE);
+				mInputDevice = DEFAULT_DEVICE;
 			}
 		}
 		
 		if(mCtrlOutputDevices)
 		{
 			mCtrlOutputDevices->removeall();
-			mCtrlOutputDevices->add( getString("default_text"), ADD_BOTTOM );
+			mCtrlOutputDevices->add(getLocalizedDeviceName(DEFAULT_DEVICE), DEFAULT_DEVICE, ADD_BOTTOM);
 
 			for(iter= LLVoiceClient::getInstance()->getRenderDevices().begin(); 
 				iter !=  LLVoiceClient::getInstance()->getRenderDevices().end(); iter++)
 			{
-				mCtrlOutputDevices->add( *iter, ADD_BOTTOM );
+				mCtrlOutputDevices->add(getLocalizedDeviceName(*iter), *iter, ADD_BOTTOM);
 			}
 
-			if(!mCtrlOutputDevices->setSimple(mOutputDevice))
+			// Fix invalid output audio device preference.
+			if (!mCtrlOutputDevices->setSelectedByValue(mOutputDevice, TRUE))
 			{
-				mCtrlOutputDevices->setSimple(getString("default_text"));
+				mCtrlOutputDevices->setValue(DEFAULT_DEVICE);
+				gSavedSettings.setString("VoiceOutputAudioDevice", DEFAULT_DEVICE);
+				mOutputDevice = DEFAULT_DEVICE;
 			}
 		}
 		mDevicesUpdated = TRUE;
@@ -292,6 +303,13 @@ void LLPanelVoiceDeviceSettings::cleanup()
 	}
 }
 
+// returns English name if no translation found
+std::string LLPanelVoiceDeviceSettings::getLocalizedDeviceName(const std::string& en_dev_name)
+{
+	std::map<std::string, std::string>::const_iterator it = mLocalizedDeviceNames.find(en_dev_name);
+	return it != mLocalizedDeviceNames.end() ? it->second : en_dev_name;
+}
+
 void LLPanelVoiceDeviceSettings::onCommitInputDevice()
 {
 	if(LLVoiceClient::getInstance())
diff --git a/indra/newview/llpanelvoicedevicesettings.h b/indra/newview/llpanelvoicedevicesettings.h
index d09476d469..ba3bcad0dc 100644
--- a/indra/newview/llpanelvoicedevicesettings.h
+++ b/indra/newview/llpanelvoicedevicesettings.h
@@ -49,6 +49,8 @@ public:
 	void setUseTuningMode(bool use) { mUseTuningMode = use; };
 	
 protected:
+	std::string getLocalizedDeviceName(const std::string& en_dev_name);
+
 	void onCommitInputDevice();
 	void onCommitOutputDevice();
 
@@ -59,6 +61,7 @@ protected:
 	class LLComboBox		*mCtrlOutputDevices;
 	BOOL mDevicesUpdated;
 	bool mUseTuningMode;
+	std::map<std::string, std::string> mLocalizedDeviceNames;
 };
 
 #endif // LL_LLPANELVOICEDEVICESETTINGS_H
diff --git a/indra/newview/skins/default/xui/en/panel_sound_devices.xml b/indra/newview/skins/default/xui/en/panel_sound_devices.xml
index 0a20a4a965..46cbc1e87f 100644
--- a/indra/newview/skins/default/xui/en/panel_sound_devices.xml
+++ b/indra/newview/skins/default/xui/en/panel_sound_devices.xml
@@ -11,6 +11,14 @@
       name="default_text">
         Default
     </panel.string>
+    <string
+     name="name_no_device">
+        No Device
+    </string>
+    <string
+     name="name_default_system_device">
+        Default System Device
+    </string>
     <icon
      follows="left|top"
      height="18"
-- 
cgit v1.2.3


From a9c6b5d808c3ca83446563f6d898b46b5b385165 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Tue, 26 Jul 2011 15:36:31 -0600
Subject: a trivial change: use lldebugs to replace llinfos for STORM-1417.

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

(limited to 'indra/newview')

diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index dbb39cd415..a219386b53 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -69,7 +69,7 @@ LLDrawPoolWLSky::LLDrawPoolWLSky(void) :
 		if(cloudNoiseFile->decode(sCloudNoiseRawImage, 0.0f))
 		{
 			//debug use			
-			llinfos << "cloud noise raw image width: " << sCloudNoiseRawImage->getWidth() << " : height: " << sCloudNoiseRawImage->getHeight() << " : components: " << 
+			lldebugs << "cloud noise raw image width: " << sCloudNoiseRawImage->getWidth() << " : height: " << sCloudNoiseRawImage->getHeight() << " : components: " << 
 				(S32)sCloudNoiseRawImage->getComponents() << " : data size: " << sCloudNoiseRawImage->getDataSize() << llendl ;
 			llassert_always(sCloudNoiseRawImage->getData()) ;
 
-- 
cgit v1.2.3


From 2617d562417b00fc3d2ecad20edd18ca1c900f2f Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Wed, 27 Jul 2011 00:37:00 +0300
Subject: STORM-1529 FIXED Made the Sound Devices floater wider.

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

(limited to 'indra/newview')

diff --git a/indra/newview/skins/default/xui/en/floater_sound_devices.xml b/indra/newview/skins/default/xui/en/floater_sound_devices.xml
index 304987c3d5..74e01f359c 100644
--- a/indra/newview/skins/default/xui/en/floater_sound_devices.xml
+++ b/indra/newview/skins/default/xui/en/floater_sound_devices.xml
@@ -15,14 +15,14 @@
  layout="topleft"
  name="floater_sound_devices"
  title="Sound Devices"
- width="315">
+ width="490">
   <panel
     layout="topleft"
     follows="all"
     filename="panel_sound_devices.xml"
     name="device_settings_panel"
     width="400"
-    left="2"
+    left="10"
     top="26"
     class="panel_voice_device_settings"/>
   <text
-- 
cgit v1.2.3


From b9b0255272067f127f5967e082fb30ac5408ccef Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 26 Jul 2011 18:38:49 -0500
Subject: SH-2179 Fix for active UI elements glowing when basic shaders
 enabled.

---
 indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
index ae943cc438..5b7cc57574 100644
--- a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
@@ -9,7 +9,7 @@ uniform sampler2D tex0;
 
 void main() 
 {
-	float alpha = texture2D(tex0, gl_TexCoord[0].xy).a;
+	float alpha = texture2D(tex0, gl_TexCoord[0].xy).a * gl_Color.a;
 
 	gl_FragColor = vec4(gl_Color.rgb, alpha);
 }
-- 
cgit v1.2.3


From 531c5c4e49283dcb8b5ef3d862185dc315e01b86 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 27 Jul 2011 00:19:54 -0500
Subject: SH-2120 Fix for water being very dark when basic shaders disabled.

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

(limited to 'indra/newview')

diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index 66ba6249d3..3a94b03a84 100644
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -754,7 +754,7 @@ void LLVOSky::calcSkyColorWLVert(LLVector3 & Pn, LLColor3 & vary_HazeColor, LLCo
 {
 	// project the direction ray onto the sky dome.
 	F32 phi = acos(Pn[1]);
-	F32 sinA = sin(F_PI - phi);
+	F32 sinA = llmax(sin(F_PI - phi), 0.01f);
 	F32 Plen = dome_radius * sin(F_PI + phi + asin(dome_offset_ratio * sinA)) / sinA;
 
 	Pn *= Plen;
-- 
cgit v1.2.3


From e7474eb48d3f5627a781cc25c96d721aa08b9629 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 27 Jul 2011 00:25:45 -0500
Subject: SH-2120 Better fix for water being very dark when basic shaders
 disabled (sinA might be negative)

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

(limited to 'indra/newview')

diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index 3a94b03a84..ef21e7373e 100644
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -754,7 +754,12 @@ void LLVOSky::calcSkyColorWLVert(LLVector3 & Pn, LLColor3 & vary_HazeColor, LLCo
 {
 	// project the direction ray onto the sky dome.
 	F32 phi = acos(Pn[1]);
-	F32 sinA = llmax(sin(F_PI - phi), 0.01f);
+	F32 sinA = sin(F_PI - phi);
+	if (fabsf(sinA) < 0.01f)
+	{ //avoid division by zero
+		sinA = 0.01f;
+	}
+
 	F32 Plen = dome_radius * sin(F_PI + phi + asin(dome_offset_ratio * sinA)) / sinA;
 
 	Pn *= Plen;
-- 
cgit v1.2.3


From e16eb4ae4a73125bc4e74fc667aa99110ac77c29 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 27 Jul 2011 01:04:53 -0500
Subject: SH-1990 Fix for redundantly applying some color scaling to sky and
 water (also add some snazzy specular bloom from the sun)

---
 .../shaders/class1/deferred/softenLightF.glsl      |  93 ++++++-----------
 .../shaders/class1/deferred/softenLightMSF.glsl    |  28 +++--
 .../shaders/class2/deferred/softenLightF.glsl      |  59 +++++++----
 .../shaders/class2/deferred/softenLightMSF.glsl    |  60 ++++++-----
 .../shaders/class3/deferred/softenLightF.glsl      | 113 +++++++--------------
 5 files changed, 157 insertions(+), 196 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index 60082f40d6..d327216a0c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -270,72 +270,41 @@ void main()
 	vec4 diffuse = texture2DRect(diffuseRect, tc);
 	vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy);
 	
-	calcAtmospherics(pos.xyz, 1.0);
+	vec3 col;
+	float bloom = 0.0;
+	if (diffuse.a < 0.9)
+	{
+		calcAtmospherics(pos.xyz, 1.0);
+	
+		col = atmosAmbient(vec3(0));
+		col += atmosAffectDirectionalLight(max(min(da, 1.0), diffuse.a));
 	
-	vec3 col = atmosAmbient(vec3(0));
-	col += atmosAffectDirectionalLight(max(min(da, 1.0), diffuse.a));
+		col *= diffuse.rgb;
 	
-	col *= diffuse.rgb;
+		if (spec.a > 0.0) // specular reflection
+		{
+			// the old infinite-sky shiny reflection
+			//
+			vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
+			float sa = dot(refnormpersp, vary_light.xyz);
+			vec3 dumbshiny = vary_SunlitColor*texture2D(lightFunc, vec2(sa, spec.a)).a;
+			
+			// add the two types of shiny together
+			vec3 spec_contrib = dumbshiny * spec.rgb;
+			bloom = dot(spec_contrib, spec_contrib);
+			col += spec_contrib;
+		}
 	
-	if (spec.a > 0.0) // specular reflection
+		col = atmosLighting(col);
+		col = scaleSoftClip(col);
+
+		col = mix(col.rgb, diffuse.rgb, diffuse.a);
+	}
+	else
 	{
-		// the old infinite-sky shiny reflection
-		//
-		vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
-		float sa = dot(refnormpersp, vary_light.xyz);
-		vec3 dumbshiny = vary_SunlitColor*texture2D(lightFunc, vec2(sa, spec.a)).a;
-
-		/*
-		// screen-space cheap fakey reflection map
-		//
-		vec3 refnorm = normalize(reflect(vec3(0,0,-1), norm.xyz));
-		depth -= 0.5; // unbias depth
-		// first figure out where we'll make our 2D guess from
-		vec2 ref2d = (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth;
-		// Offset the guess source a little according to a trivial
-		// checkerboard dither function and spec.a.
-		// This is meant to be similar to sampling a blurred version
-		// of the diffuse map.  LOD would be better in that regard.
-		// The goal of the blur is to soften reflections in surfaces
-		// with low shinyness, and also to disguise our lameness.
-		float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0
-		float checkoffset = (3.0 + (7.0*(1.0-spec.a)))*(checkerboard-0.5);
-		ref2d += vec2(checkoffset, checkoffset);
-		ref2d += tc.xy; // use as offset from destination
-		// Get attributes from the 2D guess point.
-		// We average two samples of diffuse (not of anything else) per
-		// pixel to try to reduce aliasing some more.
-		vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d + vec2(0.0, -checkoffset)).rgb +
-				     texture2DRect(diffuseRect, ref2d + vec2(-checkoffset, 0.0)).rgb);
-		float refdepth = texture2DRect(depthMap, ref2d).a;
-		vec3 refpos = getPosition_d(ref2d, refdepth).xyz;
-		vec3 refn = texture2DRect(normalMap, ref2d).rgb;
-		refn = normalize(vec3((refn.xy-0.5)*2.0,refn.z)); // unpack norm
-		// figure out how appropriate our guess actually was
-		float refapprop = max(0.0, dot(-refnorm, normalize(pos - refpos)));
-		// darken reflections from points which face away from the reflected ray - our guess was a back-face
-		//refapprop *= step(dot(refnorm, refn), 0.0);
-		refapprop = min(refapprop, max(0.0, -dot(refnorm, refn))); // more conservative variant
-		// get appropriate light strength for guess-point.
-		// reflect light direction to increase the illusion that
-		// these are reflections.
-		vec3 reflight = reflect(lightnorm.xyz, norm.xyz);
-		float reflit = max(dot(refn, reflight.xyz), 0.0);
-		// apply sun color to guess-point, dampen according to inappropriateness of guess
-		float refmod = min(refapprop, reflit);
-		vec3 refprod = vary_SunlitColor * refcol.rgb * refmod;
-		vec3 ssshiny = (refprod * spec.a);
-		ssshiny *= 0.3; // dampen it even more
-		*/
-		vec3 ssshiny = vec3(0,0,0);
-
-		// add the two types of shiny together
-		col += (ssshiny + dumbshiny) * spec.rgb;
+		col = diffuse.rgb;
 	}
-	
-	col = atmosLighting(col);
-	col = scaleSoftClip(col);
-		
+
 	gl_FragColor.rgb = col;
-	gl_FragColor.a = 0.0;
+	gl_FragColor.a = bloom;
 }
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightMSF.glsl
index 9dfacfb520..2cce43e2bf 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightMSF.glsl
@@ -266,7 +266,7 @@ void main()
 	vec2 tc = vary_fragcoord.xy;
 	ivec2 itc = ivec2(tc);
 
-	vec3 fcol = vec3(0,0,0);
+	vec4 fcol = vec4(0,0,0,0);
 
 	for (int i = 0; i < samples; ++i)
 	{
@@ -280,17 +280,16 @@ void main()
 		float da = max(dot(norm.xyz, vary_light.xyz), 0.0);
 	
 		vec4 diffuse = texelFetch(diffuseRect, itc, i);
-		if (diffuse.a >= 1.0)
-		{
-			fcol += diffuse.rgb;
-		}
-		else
+		vec3 col;
+		float bloom = 0.0;
+
+		if (diffuse.a < 0.9)
 		{
 			vec4 spec = texelFetch(specularRect, itc, i);
 	
 			calcAtmospherics(pos.xyz, 1.0);
 	
-			vec3 col = atmosAmbient(vec3(0));
+			col = atmosAmbient(vec3(0));
 			col += atmosAffectDirectionalLight(max(min(da, 1.0), diffuse.a));
 	
 			col *= diffuse.rgb;
@@ -304,15 +303,22 @@ void main()
 				vec3 dumbshiny = vary_SunlitColor*texture2D(lightFunc, vec2(sa, spec.a)).a;
 
 				// add the two types of shiny together
-				col += dumbshiny * spec.rgb;
+				vec3 spec_contrib = dumbshiny * spec.rgb;
+				bloom = dot(spec_contrib, spec_contrib);
+				col += spec_contrib;
 			}
 
 			col = atmosLighting(col);
 			col = scaleSoftClip(col);
-			fcol += col;
+			col = mix(col, diffuse.rgb, diffuse.a);
 		}
+		else
+		{
+			col = diffuse.rgb;
+		}
+
+		fcol += vec4(col, bloom);
 	}
 				
-	gl_FragColor.rgb = fcol.rgb/samples;
-	gl_FragColor.a = 0.0;
+	gl_FragColor = fcol/samples;
 }
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index 66a1a8515f..f0c9b01671 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -267,34 +267,49 @@ void main()
 	float da = max(dot(norm.xyz, vary_light.xyz), 0.0);
 	
 	vec4 diffuse = texture2DRect(diffuseRect, tc);
-	vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy);
-	
-	vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg;
-	float scol = max(scol_ambocc.r, diffuse.a); 
-	float ambocc = scol_ambocc.g;
+
+	vec3 col;
+	float bloom = 0.0;
+
+	if (diffuse.a < 0.9)
+	{
+		vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy);
+		
+		vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg;
+		float scol = max(scol_ambocc.r, diffuse.a); 
+		float ambocc = scol_ambocc.g;
 	
-	calcAtmospherics(pos.xyz, ambocc);
+		calcAtmospherics(pos.xyz, ambocc);
 	
-	vec3 col = atmosAmbient(vec3(0));
-	col += atmosAffectDirectionalLight(max(min(da, scol), diffuse.a));
+		col = atmosAmbient(vec3(0));
+		col += atmosAffectDirectionalLight(max(min(da, scol), diffuse.a));
 	
-	col *= diffuse.rgb;
+		col *= diffuse.rgb;
 	
-	if (spec.a > 0.0) // specular reflection
+		if (spec.a > 0.0) // specular reflection
+		{
+			// the old infinite-sky shiny reflection
+			//
+			vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
+			float sa = dot(refnormpersp, vary_light.xyz);
+			vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a;
+
+			// add the two types of shiny together
+			vec3 spec_contrib = dumbshiny * spec.rgb;
+			bloom = dot(spec_contrib, spec_contrib);
+			col += spec_contrib;
+		}
+			
+		col = atmosLighting(col);
+		col = scaleSoftClip(col);
+
+		col = mix(col, diffuse.rgb, diffuse.a);
+	}
+	else
 	{
-		// the old infinite-sky shiny reflection
-		//
-		vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
-		float sa = dot(refnormpersp, vary_light.xyz);
-		vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a;
-
-		// add the two types of shiny together
-		col += dumbshiny * spec.rgb;
+		col = diffuse.rgb;
 	}
-	
-	col = atmosLighting(col);
-	col = scaleSoftClip(col);
 		
 	gl_FragColor.rgb = col;
-	gl_FragColor.a = 0.0;
+	gl_FragColor.a = bloom;
 }
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
index 0bae10ca7d..3b572320c3 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
@@ -255,7 +255,7 @@ void main()
 	vec2 tc = vary_fragcoord.xy;
 	ivec2 itc = ivec2(tc);
 
-	vec3 fcol = vec3(0,0,0);
+	vec4 fcol = vec4(0,0,0,0);
 
 	vec2 scol_ambocc = texture2DRect(lightMap, tc).rg;
 	float ambocc = scol_ambocc.g;
@@ -270,38 +270,50 @@ void main()
 		float da = max(dot(norm.xyz, vary_light.xyz), 0.0);
 	
 		vec4 diffuse = texelFetch(diffuseRect, itc, i);
-		vec4 spec = texelFetch(specularRect, itc, i);
+		vec3 col;
+		float bloom = 0.0;
+		if (diffuse.a < 0.9)
+		{
+			vec4 spec = texelFetch(specularRect, itc, i);
 	
-		float amb = 0;
+			float amb = 0;
 
-		float scol = max(scol_ambocc.r, diffuse.a); 
-		amb += ambocc;
+			float scol = max(scol_ambocc.r, diffuse.a); 
+			amb += ambocc;
 
-		calcAtmospherics(pos.xyz, ambocc);
+			calcAtmospherics(pos.xyz, ambocc);
+	
+			col = atmosAmbient(vec3(0));
+			col += atmosAffectDirectionalLight(max(min(da, scol), diffuse.a));
 	
-		vec3 col = atmosAmbient(vec3(0));
-		col += atmosAffectDirectionalLight(max(min(da, scol), diffuse.a));
+			col *= diffuse.rgb;
 	
-		col *= diffuse.rgb;
+			if (spec.a > 0.0) // specular reflection
+			{
+				// the old infinite-sky shiny reflection
+				//
+				vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
+				float sa = dot(refnormpersp, vary_light.xyz);
+				vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a;
+
+				// add the two types of shiny together
+				vec3 spec_contrib = dumbshiny * spec.rgb;
+				bloom = dot(spec_contrib, spec_contrib);
+				col += spec_contrib;
+			}
 	
-		if (spec.a > 0.0) // specular reflection
+			col = atmosLighting(col);
+			col = scaleSoftClip(col);
+
+			col = mix(col, diffuse.rgb, diffuse.a);
+		}
+		else
 		{
-			// the old infinite-sky shiny reflection
-			//
-			vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
-			float sa = dot(refnormpersp, vary_light.xyz);
-			vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a;
-
-			// add the two types of shiny together
-			col += dumbshiny * spec.rgb;
+			col = diffuse.rgb;
 		}
-	
-		col = atmosLighting(col);
-		col = scaleSoftClip(col);
 
-		fcol += col;
+		fcol += vec4(col, bloom);
 	}
 		
-	gl_FragColor.rgb = fcol/samples; 
-	gl_FragColor.a = 0.0;
+	gl_FragColor = fcol/samples; 
 }
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
index d38d33cc21..1ae10a5faa 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
@@ -268,91 +268,50 @@ void main()
 	float da = max(dot(norm.xyz, vary_light.xyz), 0.0);
 	
 	vec4 diffuse = texture2DRect(diffuseRect, tc);
-	vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy);
+	vec3 col;
+	float bloom = 0.0;
+
+	if (diffuse.a < 0.9)
+	{
+		vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy);
 	
-	da = texture2D(lightFunc, vec2(da, 0.0)).a;
+		da = texture2D(lightFunc, vec2(da, 0.0)).a;
 		
-	vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg;
-	float scol = max(scol_ambocc.r, diffuse.a); 
-	float ambocc = scol_ambocc.g;
+		vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg;
+		float scol = max(scol_ambocc.r, diffuse.a); 
+		float ambocc = scol_ambocc.g;
 	
-	calcAtmospherics(pos.xyz, ambocc);
+		calcAtmospherics(pos.xyz, ambocc);
 	
-	vec3 col = atmosAmbient(vec3(0));
-	col += atmosAffectDirectionalLight(max(min(da, scol), diffuse.a));
+		col = atmosAmbient(vec3(0));
+		col += atmosAffectDirectionalLight(max(min(da, scol), diffuse.a));
 	
-	col *= diffuse.rgb;
+		col *= diffuse.rgb;
 	
-	if (spec.a > 0.0) // specular reflection
+		if (spec.a > 0.0) // specular reflection
+		{
+			// the old infinite-sky shiny reflection
+			//
+			vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
+			float sa = dot(refnormpersp, vary_light.xyz);
+			vec3 dumbshiny = vary_SunlitColor*scol*texture2D(lightFunc, vec2(sa, spec.a)).a;
+		
+			// add the two types of shiny together
+			vec3 spec_contrib = dumbshiny * spec.rgb;
+			bloom = dot(spec_contrib, spec_contrib);
+			col += spec_contrib;		
+		}
+	
+		col = atmosLighting(col);
+		col = scaleSoftClip(col);
+
+		col = mix(col, diffuse.rgb, diffuse.a);
+	}
+	else
 	{
-		// the old infinite-sky shiny reflection
-		//
-		vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
-		float sa = dot(refnormpersp, vary_light.xyz);
-		vec3 dumbshiny = vary_SunlitColor*scol*texture2D(lightFunc, vec2(sa, spec.a)).a;
-
-		/*
-		// screen-space cheap fakey reflection map
-		//
-		vec3 refnorm = normalize(reflect(vec3(0,0,-1), norm.xyz));
-		depth -= 0.5; // unbias depth
-		// first figure out where we'll make our 2D guess from
-		vec2 ref2d = (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth;
-		// Offset the guess source a little according to a trivial
-		// checkerboard dither function and spec.a.
-		// This is meant to be similar to sampling a blurred version
-		// of the diffuse map.  LOD would be better in that regard.
-		// The goal of the blur is to soften reflections in surfaces
-		// with low shinyness, and also to disguise our lameness.
-		float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0
-		float checkoffset = (3.0 + (7.0*(1.0-spec.a)))*(checkerboard-0.5);
-
-		ref2d += vec2(checkoffset, checkoffset);
-		ref2d += tc.xy; // use as offset from destination
-		// Get attributes from the 2D guess point.
-		// We average two samples of diffuse (not of anything else) per
-		// pixel to try to reduce aliasing some more.
-		vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d + vec2(0.0, -checkoffset)).rgb +
-				     texture2DRect(diffuseRect, ref2d + vec2(-checkoffset, 0.0)).rgb);
-		float refdepth = texture2DRect(depthMap, ref2d).a;
-		vec3 refpos = getPosition_d(ref2d, refdepth).xyz;
-		float refshad = texture2DRect(lightMap, ref2d).r;
-		vec3 refn = texture2DRect(normalMap, ref2d).rgb;
-		refn = vec3((refn.xy-0.5)*2.0,refn.z); // unpack norm
-		refn = normalize(refn);
-		// figure out how appropriate our guess actually was
-		float refapprop = max(0.0, dot(-refnorm, normalize(pos - refpos)));
-		// darken reflections from points which face away from the reflected ray - our guess was a back-face
-		//refapprop *= step(dot(refnorm, refn), 0.0);
-		refapprop = min(refapprop, max(0.0, -dot(refnorm, refn))); // more conservative variant
-		// get appropriate light strength for guess-point.
-		// reflect light direction to increase the illusion that
-		// these are reflections.
-		vec3 reflight = reflect(lightnorm.xyz, norm.xyz);
-		float reflit = min(max(dot(refn, reflight.xyz), 0.0), refshad);
-		// apply sun color to guess-point, dampen according to inappropriateness of guess
-		float refmod = min(refapprop, reflit);
-		vec3 refprod = vary_SunlitColor * refcol.rgb * refmod;
-		vec3 ssshiny = (refprod * spec.a);
-		ssshiny *= 0.3; // dampen it even more
-		*/
-		vec3 ssshiny = vec3(0,0,0);
-
-		// add the two types of shiny together
-		col += (ssshiny + dumbshiny) * spec.rgb;
+		col = diffuse.rgb;
 	}
-	
-	col = atmosLighting(col);
-	col = scaleSoftClip(col);
 		
 	gl_FragColor.rgb = col;
-	
-	//gl_FragColor.rgb = gi_col.rgb;
-	gl_FragColor.a = 0.0;
-	
-	//gl_FragColor.rg = scol_ambocc.rg;
-	//gl_FragColor.rgb = texture2DRect(lightMap, vary_fragcoord.xy).rgb;
-	//gl_FragColor.rgb = norm.rgb*0.5+0.5;
-	//gl_FragColor.rgb = vec3(ambocc);
-	//gl_FragColor.rgb = vec3(scol);
+	gl_FragColor.a = bloom;
 }
-- 
cgit v1.2.3


From 67bd8c314c87d27328addfaf19c8a9d97c171143 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Fri, 29 Jul 2011 15:07:52 -0400
Subject: late fix to disable VBO on Macs for performance

---
 indra/newview/featuretable_mac.txt | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt
index ee08e78af5..2690e8ec70 100644
--- a/indra/newview/featuretable_mac.txt
+++ b/indra/newview/featuretable_mac.txt
@@ -1,4 +1,4 @@
-version 26
+version 30
 
 // NOTE: This is mostly identical to featuretable_mac.txt with a few differences
 // Should be combined into one table
@@ -47,8 +47,8 @@ RenderTerrainLODFactor			1	2.0
 RenderTransparentWater			1	1
 RenderTreeLODFactor				1	1.0
 RenderUseImpostors				1	1
-RenderVBOEnable					1	1
-RenderVBOMappingDisable		1	1
+RenderVBOEnable					1	0
+RenderVBOMappingDisable		1	0
 RenderVolumeLODFactor			1	2.0
 UseStartScreen				1	1
 UseOcclusion					1	1
@@ -63,7 +63,7 @@ RenderDeferred				1	1
 RenderDeferredSSAO			1	1
 RenderShadowDetail			1	2
 WatchdogDisabled				1	1
-RenderUseStreamVBO			1	1
+RenderUseStreamVBO			1	0
 RenderFSAASamples			1	16
 
 //
@@ -243,13 +243,6 @@ RenderDeferred				0	0
 RenderDeferredSSAO			0	0
 RenderShadowDetail			0	0
 
-//
-// No GL_ARB_map_buffer_range
-//
-list NoMapBufferRange
-RenderVBOMappingDisable		1	0
-
-
 //
 // "Default" setups for safe, low, medium, high
 //
-- 
cgit v1.2.3


From 6850f13f50d90d19db2e119ed1596abd1bdd9b36 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Fri, 29 Jul 2011 15:08:27 -0400
Subject: late fix to set watchdog on at 60 seconds

---
 indra/newview/app_settings/settings.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 5ad62d28c0..598303718c 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -4894,7 +4894,7 @@
       <key>Type</key>
       <string>F32</string>
       <key>Value</key>
-      <real>20.0</real>
+      <real>60.0</real>
     </map>
     <key>MapOverlayIndex</key>
     <map>
@@ -12584,7 +12584,7 @@
       <key>Type</key>
       <string>S32</string>
       <key>Value</key>
-      <integer>-1</integer>
+      <integer>1</integer>
     </map>
     <key>WaterGLFogDensityScale</key>
     <map>
-- 
cgit v1.2.3


From a234d2433195cfd719910117d2db3185f54af8e7 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 29 Jul 2011 23:59:52 -0500
Subject: STORM-1512 Fix for crash when rendering impostors.

---
 indra/newview/pipeline.cpp | 63 ++++++++++++++++++++++++----------------------
 1 file changed, 33 insertions(+), 30 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index dfcc7396ba..0abeed988c 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -3741,52 +3741,55 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
 	LLVertexBuffer::unbind();
 	LLGLState::checkStates();
 
-	LLAppViewer::instance()->pingMainloopTimeout("Pipeline:RenderHighlights");
-
-	if (!sReflectionRender)
+	if (!LLPipeline::sImpostorRender)
 	{
-		renderHighlights();
-	}
+		LLAppViewer::instance()->pingMainloopTimeout("Pipeline:RenderHighlights");
 
-	// Contains a list of the faces of objects that are physical or
-	// have touch-handlers.
-	mHighlightFaces.clear();
+		if (!sReflectionRender)
+		{
+			renderHighlights();
+		}
 
-	LLAppViewer::instance()->pingMainloopTimeout("Pipeline:RenderDebug");
+		// Contains a list of the faces of objects that are physical or
+		// have touch-handlers.
+		mHighlightFaces.clear();
+
+		LLAppViewer::instance()->pingMainloopTimeout("Pipeline:RenderDebug");
 	
-	renderDebug();
+		renderDebug();
 
-	LLVertexBuffer::unbind();
+		LLVertexBuffer::unbind();
 	
-	if (!LLPipeline::sReflectionRender && !LLPipeline::sRenderDeferred)
-	{
-		if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
+		if (!LLPipeline::sReflectionRender && !LLPipeline::sRenderDeferred)
 		{
-			// Render debugging beacons.
-			gObjectList.renderObjectBeacons();
-			gObjectList.resetObjectBeacons();
+			if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
+			{
+				// Render debugging beacons.
+				gObjectList.renderObjectBeacons();
+				gObjectList.resetObjectBeacons();
+			}
+			else
+			{
+				// Make sure particle effects disappear
+				LLHUDObject::renderAllForTimer();
+			}
 		}
 		else
 		{
 			// Make sure particle effects disappear
 			LLHUDObject::renderAllForTimer();
 		}
-	}
-	else
-	{
-		// Make sure particle effects disappear
-		LLHUDObject::renderAllForTimer();
-	}
 
-	LLAppViewer::instance()->pingMainloopTimeout("Pipeline:RenderGeomEnd");
+		LLAppViewer::instance()->pingMainloopTimeout("Pipeline:RenderGeomEnd");
 
-	//HACK: preserve/restore matrices around HUD render
-	if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_HUD))
-	{
-		for (U32 i = 0; i < 16; i++)
+		//HACK: preserve/restore matrices around HUD render
+		if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_HUD))
 		{
-			gGLModelView[i] = saved_modelview[i];
-			gGLProjection[i] = saved_projection[i];
+			for (U32 i = 0; i < 16; i++)
+			{
+				gGLModelView[i] = saved_modelview[i];
+				gGLProjection[i] = saved_projection[i];
+			}
 		}
 	}
 
-- 
cgit v1.2.3


From 5711fda52f3939f482358ad5265618fb56da5998 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 29 Jul 2011 18:49:09 -0500
Subject: SH-2200 Fix for BSOD on 7800 Go on Vista when setting graphics detail
 to "High"

---
 .../app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl    | 2 --
 .../newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl | 2 --
 .../app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl        | 2 --
 indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl   | 2 --
 4 files changed, 8 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl
index f44a5ce32e..5283e80407 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl
@@ -10,8 +10,6 @@
 void calcAtmospherics(vec3 inPositionEye);
 mat4 getObjectSkinnedTransform();
 
-attribute vec4 object_weight;
-
 void main()
 {
 	mat4 mat = getObjectSkinnedTransform();
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl
index e5dafa8c78..1db79791de 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl
@@ -10,8 +10,6 @@
 void calcAtmospherics(vec3 inPositionEye);
 mat4 getObjectSkinnedTransform();
 
-attribute vec4 object_weight;
-
 void main()
 {
 	//transform vertex
diff --git a/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl
index cd655f3bb5..eea41bb4f0 100644
--- a/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl
@@ -11,8 +11,6 @@ vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
 mat4 getObjectSkinnedTransform();
 
-attribute vec4 object_weight;
-
 void main()
 {
 	mat4 mat = getObjectSkinnedTransform();
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl
index 900448035c..af92e5e002 100644
--- a/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl
@@ -11,8 +11,6 @@ vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
 void calcAtmospherics(vec3 inPositionEye);
 mat4 getObjectSkinnedTransform();
 
-attribute vec4 object_weight;
-
 void main()
 {
 	//transform vertex
-- 
cgit v1.2.3


From fbd5bd7adc205acecc49c7e9887efa3bca6552d0 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Mon, 1 Aug 2011 17:50:43 -0500
Subject: SH-2183 Add a debug setting to control whether or not to use multiple
 threads in LLCurl

---
 indra/newview/app_settings/settings.xml | 11 +++++++++++
 indra/newview/llappviewer.cpp           |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 7330c76b01..2b38a8028c 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -1803,6 +1803,17 @@
       <key>Value</key>
       <integer>0</integer>
     </map>
+  <key>CurlUseMultipleThreads</key>
+  <map>
+    <key>Comment</key>
+    <string>Use background threads for executing curl_multi_perform (requires restart)</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>Boolean</string>
+    <key>Value</key>
+    <integer>1</integer>
+  </map>
     <key>Cursor3D</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index b65933f8a1..d12b971bde 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -708,7 +708,7 @@ bool LLAppViewer::init()
 
     // *NOTE:Mani - LLCurl::initClass is not thread safe. 
     // Called before threads are created.
-    LLCurl::initClass();
+    LLCurl::initClass(gSavedSettings.getBOOL("CurlUseMultipleThreads"));
 	LL_INFOS("InitInfo") << "LLCurl initialized." << LL_ENDL ;
 
     LLMachineID::init();
-- 
cgit v1.2.3


From 5451af6cca43f296e1b5654ab3e611928929c1c9 Mon Sep 17 00:00:00 2001
From: "Nyx (Neal Orman)" <nyx@lindenlab.com>
Date: Tue, 2 Aug 2011 18:04:58 -0400
Subject: SH-2202 FIX physics costs have increased

Changed the default to use low LOD for single hull generation, will fall back to medium or high if not present.
---
 indra/newview/llmeshrepository.cpp | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'indra/newview')

diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 7ddc0db20d..afed306a28 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -1482,6 +1482,10 @@ void LLMeshUploadThread::generateHulls()
 			{
 				physics = data.mModel[LLModel::LOD_PHYSICS];
 			}
+			else if (data.mModel[LLModel::LOD_LOW].notNull())
+			{
+				physics = data.mModel[LLModel::LOD_LOW];
+			}
 			else if (data.mModel[LLModel::LOD_MEDIUM].notNull())
 			{
 				physics = data.mModel[LLModel::LOD_MEDIUM];
-- 
cgit v1.2.3


From 01ee25cca43b175567859becd1eacf77db24af55 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Tue, 2 Aug 2011 19:16:56 -0400
Subject: disable watchdog

---
 indra/newview/app_settings/settings.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 598303718c..27c3e42a37 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -12584,7 +12584,7 @@
       <key>Type</key>
       <string>S32</string>
       <key>Value</key>
-      <integer>1</integer>
+      <integer>0</integer>
     </map>
     <key>WaterGLFogDensityScale</key>
     <map>
-- 
cgit v1.2.3


From 3369ebc8dd839883e84b279977a2347391ec2ed6 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Thu, 4 Aug 2011 10:57:03 -0400
Subject: fix DOS line endings

---
 indra/newview/llpanelmarketplaceinbox.cpp  | 496 ++++++++++++++---------------
 indra/newview/llviewerprecompiledheaders.h |   4 +-
 2 files changed, 250 insertions(+), 250 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp
index af74f8f261..9f05a61812 100644
--- a/indra/newview/llpanelmarketplaceinbox.cpp
+++ b/indra/newview/llpanelmarketplaceinbox.cpp
@@ -1,248 +1,248 @@
-/** 
- * @file llpanelmarketplaceinbox.cpp
- * @brief Panel for marketplace inbox
- *
-* $LicenseInfo:firstyear=2011&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$
- */
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llpanelmarketplaceinbox.h"
-
-#include "llappviewer.h"
-#include "llbutton.h"
-#include "llinventorypanel.h"
-#include "llfolderview.h"
-#include "llsidepanelinventory.h"
-
-
-#define SUPPORTING_FRESH_ITEM_COUNT	0
-
-
-static LLRegisterPanelClassWrapper<LLPanelMarketplaceInbox> t_panel_marketplace_inbox("panel_marketplace_inbox");
-
-const LLPanelMarketplaceInbox::Params& LLPanelMarketplaceInbox::getDefaultParams() 
-{ 
-	return LLUICtrlFactory::getDefaultParams<LLPanelMarketplaceInbox>(); 
-}
-
-// protected
-LLPanelMarketplaceInbox::LLPanelMarketplaceInbox(const Params& p)
-	: LLPanel(p)
-	, mInventoryPanel(NULL)
-{
-}
-
-LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox()
-{
-}
-
-// virtual
-BOOL LLPanelMarketplaceInbox::postBuild()
-{
-	LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLPanelMarketplaceInbox::handleLoginComplete, this));
-
-	LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceInbox::onFocusReceived, this));
-	
-	return TRUE;
-}
-
-void LLPanelMarketplaceInbox::onSelectionChange()
-{
-	LLSidepanelInventory* sidepanel_inventory = dynamic_cast<LLSidepanelInventory*>(LLSideTray::getInstance()->getPanel("sidepanel_inventory"));
-		
-	sidepanel_inventory->updateVerbs();
-}
-
-
-void LLPanelMarketplaceInbox::handleLoginComplete()
-{
-	// Set us up as the class to drive the badge value for the sidebar_inventory button
-	LLSideTray::getInstance()->setTabButtonBadgeDriver("sidebar_inventory", this);
-}
-
-void LLPanelMarketplaceInbox::setupInventoryPanel()
-{
-	LLView * inbox_inventory_placeholder = getChild<LLView>("inbox_inventory_placeholder");
-	LLView * inbox_inventory_parent = inbox_inventory_placeholder->getParent();
-
-	mInventoryPanel = 
-		LLUICtrlFactory::createFromFile<LLInventoryPanel>("panel_inbox_inventory.xml",
-														  inbox_inventory_parent,
-														  LLInventoryPanel::child_registry_t::instance());
-	
-	// Reshape the inventory to the proper size
-	LLRect inventory_placeholder_rect = inbox_inventory_placeholder->getRect();
-	mInventoryPanel->setShape(inventory_placeholder_rect);
-	
-	// Set the sort order newest to oldest, and a selection change callback
-	mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE);	
-	mInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceInbox::onSelectionChange, this));
-
-	// Set up the note to display when the inbox is empty
-	mInventoryPanel->getFilter()->setEmptyLookupMessage("InventoryInboxNoItems");
-	
-	// Hide the placeholder text
-	inbox_inventory_placeholder->setVisible(FALSE);
-}
-
-void LLPanelMarketplaceInbox::onFocusReceived()
-{
-	LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory");
-
-	if (sidepanel_inventory)
-	{
-		LLInventoryPanel * inv_panel = sidepanel_inventory->getActivePanel();
-
-		if (inv_panel)
-		{
-			inv_panel->clearSelection();
-		}
-	
-		LLInventoryPanel * outbox_panel = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_outbox");
-
-		if (outbox_panel)
-		{
-			outbox_panel->clearSelection();
-		}
-		
-		sidepanel_inventory->updateVerbs();
-	}
-}
-
-BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg)
-{
-	*accept = ACCEPT_NO;
-	return TRUE;
-}
-
-U32 LLPanelMarketplaceInbox::getFreshItemCount() const
-{
-#if SUPPORTING_FRESH_ITEM_COUNT
-	
-	//
-	// NOTE: When turning this on, be sure to test the no inbox/outbox case because this code probably
-	//       will return "2" for the Inventory and LIBRARY top-levels when that happens.
-	//
-	
-	U32 fresh_item_count = 0;
-
-	if (mInventoryPanel)
-	{
-		const LLFolderViewFolder * inbox_folder = mInventoryPanel->getRootFolder();
-		
-		if (inbox_folder)
-		{
-			LLFolderViewFolder::folders_t::const_iterator folders_it = inbox_folder->getFoldersBegin();
-			LLFolderViewFolder::folders_t::const_iterator folders_end = inbox_folder->getFoldersEnd();
-
-			for (; folders_it != folders_end; ++folders_it)
-			{
-				const LLFolderViewFolder * folder = *folders_it;
-
-				// TODO: Replace this check with new "fresh" flag
-				if (folder->getCreationDate() > 1500)
-				{
-					fresh_item_count++;
-				}
-			}
-		}
-	}
-
-	return fresh_item_count;
-#else
-	return getTotalItemCount();
-#endif
-}
-
-U32 LLPanelMarketplaceInbox::getTotalItemCount() const
-{
-	U32 item_count = 0;
-	
-	if (mInventoryPanel)
-	{
-		const LLFolderViewFolder * inbox_folder = mInventoryPanel->getRootFolder();
-		
-		if (inbox_folder)
-		{
-			item_count += inbox_folder->getFoldersCount();
-		}
-	}
-	
-	return item_count;
-}
-
-std::string LLPanelMarketplaceInbox::getBadgeString() const
-{
-	std::string item_count_str("");
-
-	// If the inbox is visible, and the side panel is collapsed or expanded and not the inventory panel
-	if (getParent()->getVisible() &&
-		(LLSideTray::getInstance()->getCollapsed() || !LLSideTray::getInstance()->isPanelActive("sidepanel_inventory")))
-	{
-		U32 item_count = getFreshItemCount();
-
-		if (item_count)
-		{
-			item_count_str = llformat("%d", item_count);
-		}
-	}
-
-	return item_count_str;
-}
-
-void LLPanelMarketplaceInbox::draw()
-{
-	U32 item_count = getTotalItemCount();
-
-	LLView * fresh_new_count_view = getChildView("inbox_fresh_new_count");
-
-	if (item_count > 0)
-	{
-		std::string item_count_str = llformat("%d", item_count);
-
-		LLStringUtil::format_map_t args;
-		args["[NUM]"] = item_count_str;
-		getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelWithArg", args));
-
-#if SUPPORTING_FRESH_ITEM_COUNT
-		// set green text to fresh item count
-		U32 fresh_item_count = getFreshItemCount();
-		fresh_new_count_view->setVisible((fresh_item_count > 0));
-
-		if (fresh_item_count > 0)
-		{
-			getChild<LLUICtrl>("inbox_fresh_new_count")->setTextArg("[NUM]", llformat("%d", fresh_item_count));
-		}
-#else
-		fresh_new_count_view->setVisible(FALSE);
-#endif
-	}
-	else
-	{
-		getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelNoArg"));
-
-		fresh_new_count_view->setVisible(FALSE);
-	}
-		
-	LLPanel::draw();
-}
+/** 
+ * @file llpanelmarketplaceinbox.cpp
+ * @brief Panel for marketplace inbox
+ *
+* $LicenseInfo:firstyear=2011&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$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llpanelmarketplaceinbox.h"
+
+#include "llappviewer.h"
+#include "llbutton.h"
+#include "llinventorypanel.h"
+#include "llfolderview.h"
+#include "llsidepanelinventory.h"
+
+
+#define SUPPORTING_FRESH_ITEM_COUNT	0
+
+
+static LLRegisterPanelClassWrapper<LLPanelMarketplaceInbox> t_panel_marketplace_inbox("panel_marketplace_inbox");
+
+const LLPanelMarketplaceInbox::Params& LLPanelMarketplaceInbox::getDefaultParams() 
+{ 
+	return LLUICtrlFactory::getDefaultParams<LLPanelMarketplaceInbox>(); 
+}
+
+// protected
+LLPanelMarketplaceInbox::LLPanelMarketplaceInbox(const Params& p)
+	: LLPanel(p)
+	, mInventoryPanel(NULL)
+{
+}
+
+LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox()
+{
+}
+
+// virtual
+BOOL LLPanelMarketplaceInbox::postBuild()
+{
+	LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLPanelMarketplaceInbox::handleLoginComplete, this));
+
+	LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceInbox::onFocusReceived, this));
+	
+	return TRUE;
+}
+
+void LLPanelMarketplaceInbox::onSelectionChange()
+{
+	LLSidepanelInventory* sidepanel_inventory = dynamic_cast<LLSidepanelInventory*>(LLSideTray::getInstance()->getPanel("sidepanel_inventory"));
+		
+	sidepanel_inventory->updateVerbs();
+}
+
+
+void LLPanelMarketplaceInbox::handleLoginComplete()
+{
+	// Set us up as the class to drive the badge value for the sidebar_inventory button
+	LLSideTray::getInstance()->setTabButtonBadgeDriver("sidebar_inventory", this);
+}
+
+void LLPanelMarketplaceInbox::setupInventoryPanel()
+{
+	LLView * inbox_inventory_placeholder = getChild<LLView>("inbox_inventory_placeholder");
+	LLView * inbox_inventory_parent = inbox_inventory_placeholder->getParent();
+
+	mInventoryPanel = 
+		LLUICtrlFactory::createFromFile<LLInventoryPanel>("panel_inbox_inventory.xml",
+														  inbox_inventory_parent,
+														  LLInventoryPanel::child_registry_t::instance());
+	
+	// Reshape the inventory to the proper size
+	LLRect inventory_placeholder_rect = inbox_inventory_placeholder->getRect();
+	mInventoryPanel->setShape(inventory_placeholder_rect);
+	
+	// Set the sort order newest to oldest, and a selection change callback
+	mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE);	
+	mInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceInbox::onSelectionChange, this));
+
+	// Set up the note to display when the inbox is empty
+	mInventoryPanel->getFilter()->setEmptyLookupMessage("InventoryInboxNoItems");
+	
+	// Hide the placeholder text
+	inbox_inventory_placeholder->setVisible(FALSE);
+}
+
+void LLPanelMarketplaceInbox::onFocusReceived()
+{
+	LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory");
+
+	if (sidepanel_inventory)
+	{
+		LLInventoryPanel * inv_panel = sidepanel_inventory->getActivePanel();
+
+		if (inv_panel)
+		{
+			inv_panel->clearSelection();
+		}
+	
+		LLInventoryPanel * outbox_panel = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_outbox");
+
+		if (outbox_panel)
+		{
+			outbox_panel->clearSelection();
+		}
+		
+		sidepanel_inventory->updateVerbs();
+	}
+}
+
+BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg)
+{
+	*accept = ACCEPT_NO;
+	return TRUE;
+}
+
+U32 LLPanelMarketplaceInbox::getFreshItemCount() const
+{
+#if SUPPORTING_FRESH_ITEM_COUNT
+	
+	//
+	// NOTE: When turning this on, be sure to test the no inbox/outbox case because this code probably
+	//       will return "2" for the Inventory and LIBRARY top-levels when that happens.
+	//
+	
+	U32 fresh_item_count = 0;
+
+	if (mInventoryPanel)
+	{
+		const LLFolderViewFolder * inbox_folder = mInventoryPanel->getRootFolder();
+		
+		if (inbox_folder)
+		{
+			LLFolderViewFolder::folders_t::const_iterator folders_it = inbox_folder->getFoldersBegin();
+			LLFolderViewFolder::folders_t::const_iterator folders_end = inbox_folder->getFoldersEnd();
+
+			for (; folders_it != folders_end; ++folders_it)
+			{
+				const LLFolderViewFolder * folder = *folders_it;
+
+				// TODO: Replace this check with new "fresh" flag
+				if (folder->getCreationDate() > 1500)
+				{
+					fresh_item_count++;
+				}
+			}
+		}
+	}
+
+	return fresh_item_count;
+#else
+	return getTotalItemCount();
+#endif
+}
+
+U32 LLPanelMarketplaceInbox::getTotalItemCount() const
+{
+	U32 item_count = 0;
+	
+	if (mInventoryPanel)
+	{
+		const LLFolderViewFolder * inbox_folder = mInventoryPanel->getRootFolder();
+		
+		if (inbox_folder)
+		{
+			item_count += inbox_folder->getFoldersCount();
+		}
+	}
+	
+	return item_count;
+}
+
+std::string LLPanelMarketplaceInbox::getBadgeString() const
+{
+	std::string item_count_str("");
+
+	// If the inbox is visible, and the side panel is collapsed or expanded and not the inventory panel
+	if (getParent()->getVisible() &&
+		(LLSideTray::getInstance()->getCollapsed() || !LLSideTray::getInstance()->isPanelActive("sidepanel_inventory")))
+	{
+		U32 item_count = getFreshItemCount();
+
+		if (item_count)
+		{
+			item_count_str = llformat("%d", item_count);
+		}
+	}
+
+	return item_count_str;
+}
+
+void LLPanelMarketplaceInbox::draw()
+{
+	U32 item_count = getTotalItemCount();
+
+	LLView * fresh_new_count_view = getChildView("inbox_fresh_new_count");
+
+	if (item_count > 0)
+	{
+		std::string item_count_str = llformat("%d", item_count);
+
+		LLStringUtil::format_map_t args;
+		args["[NUM]"] = item_count_str;
+		getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelWithArg", args));
+
+#if SUPPORTING_FRESH_ITEM_COUNT
+		// set green text to fresh item count
+		U32 fresh_item_count = getFreshItemCount();
+		fresh_new_count_view->setVisible((fresh_item_count > 0));
+
+		if (fresh_item_count > 0)
+		{
+			getChild<LLUICtrl>("inbox_fresh_new_count")->setTextArg("[NUM]", llformat("%d", fresh_item_count));
+		}
+#else
+		fresh_new_count_view->setVisible(FALSE);
+#endif
+	}
+	else
+	{
+		getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelNoArg"));
+
+		fresh_new_count_view->setVisible(FALSE);
+	}
+		
+	LLPanel::draw();
+}
diff --git a/indra/newview/llviewerprecompiledheaders.h b/indra/newview/llviewerprecompiledheaders.h
index 252183b6d7..12f6a0dd1c 100644
--- a/indra/newview/llviewerprecompiledheaders.h
+++ b/indra/newview/llviewerprecompiledheaders.h
@@ -120,8 +120,8 @@
 
 // Library includes from llvfs
 #include "lldir.h"
-
-// Library includes from llmessage project
+
+// Library includes from llmessage project
 #include "llcachename.h"
 
 #endif
-- 
cgit v1.2.3


From 9963e9aaacb2372b248ddcd37a3c5195c61a458b Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Thu, 4 Aug 2011 11:00:53 -0400
Subject: fix license headers

---
 indra/newview/llenvmanager.cpp                 | 36 +++++++++++---------------
 indra/newview/llenvmanager.h                   | 36 +++++++++++---------------
 indra/newview/llwlhandlers.cpp                 | 36 +++++++++++---------------
 indra/newview/llwlhandlers.h                   | 36 +++++++++++---------------
 indra/newview/tests/lldir_stub.cpp             | 21 +++++++++++++--
 indra/newview/tests/llglslshader_stub.cpp      | 21 +++++++++++++--
 indra/newview/tests/llpipeline_stub.cpp        | 21 +++++++++++++--
 indra/newview/tests/llsky_stub.cpp             | 21 +++++++++++++--
 indra/newview/tests/llviewershadermgr_stub.cpp | 21 +++++++++++++--
 indra/newview/tests/llwlanimator_stub.cpp      | 21 +++++++++++++--
 indra/newview/tests/llwldaycycle_stub.cpp      | 21 +++++++++++++--
 indra/newview/tests/llwlparammanager_test.cpp  | 21 +++++++++++++--
 indra/newview/tests/llwlparamset_stub.cpp      | 21 +++++++++++++--
 13 files changed, 231 insertions(+), 102 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llenvmanager.cpp b/indra/newview/llenvmanager.cpp
index c2720eaf28..86fe6754dc 100644
--- a/indra/newview/llenvmanager.cpp
+++ b/indra/newview/llenvmanager.cpp
@@ -2,31 +2,25 @@
  * @file llenvmanager.cpp
  * @brief Implementation of classes managing WindLight and water settings.
  *
- * $LicenseInfo:firstyear=2009&license=viewergpl$
- * 
- * Copyright (c) 2009, Linden Research, Inc.
- * 
+ * $LicenseInfo:firstyear=2009&license=viewerlgpl$
  * Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab.  Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ * 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.
  * 
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at
- * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ * 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.
  * 
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
+ * 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
  * 
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
 
diff --git a/indra/newview/llenvmanager.h b/indra/newview/llenvmanager.h
index 96af102c1a..ad56761bc7 100644
--- a/indra/newview/llenvmanager.h
+++ b/indra/newview/llenvmanager.h
@@ -2,31 +2,25 @@
  * @file llenvmanager.h
  * @brief Declaration of classes managing WindLight and water settings.
  *
- * $LicenseInfo:firstyear=2009&license=viewergpl$
- * 
- * Copyright (c) 2009, Linden Research, Inc.
- * 
+ * $LicenseInfo:firstyear=2009&license=viewerlgpl$
  * Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab.  Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ * 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.
  * 
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at
- * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ * 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.
  * 
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
+ * 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
  * 
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
 
diff --git a/indra/newview/llwlhandlers.cpp b/indra/newview/llwlhandlers.cpp
index b5f53232cc..2425b96678 100644
--- a/indra/newview/llwlhandlers.cpp
+++ b/indra/newview/llwlhandlers.cpp
@@ -2,31 +2,25 @@
  * @file llwlhandlers.cpp
  * @brief Various classes which handle Windlight-related messaging
  *
- * $LicenseInfo:firstyear=2009&license=viewergpl$
- * 
- * Copyright (c) 2009, Linden Research, Inc.
- * 
+ * $LicenseInfo:firstyear=2009&license=viewerlgpl$
  * Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab.  Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ * 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.
  * 
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at
- * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ * 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.
  * 
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
+ * 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
  * 
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
 
diff --git a/indra/newview/llwlhandlers.h b/indra/newview/llwlhandlers.h
index 213bc7c7ce..23558876da 100644
--- a/indra/newview/llwlhandlers.h
+++ b/indra/newview/llwlhandlers.h
@@ -2,31 +2,25 @@
  * @file llwlhandlers.h
  * @brief Headers for classes in llwlhandlers.cpp
  *
- * $LicenseInfo:firstyear=2009&license=viewergpl$
- * 
- * Copyright (c) 2009, Linden Research, Inc.
- * 
+ * $LicenseInfo:firstyear=2009&license=viewerlgpl$
  * Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab.  Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ * 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.
  * 
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at
- * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ * 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.
  * 
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
+ * 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
  * 
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
 
diff --git a/indra/newview/tests/lldir_stub.cpp b/indra/newview/tests/lldir_stub.cpp
index 6646860b5e..18cf4e7419 100644
--- a/indra/newview/tests/lldir_stub.cpp
+++ b/indra/newview/tests/lldir_stub.cpp
@@ -2,8 +2,25 @@
  * @file lldir_stub.cpp
  * @brief  stub class to allow unit testing
  *
- * $LicenseInfo:firstyear=2009&license=viewergpl$
- * Copyright (c) 2009, Linden Research, Inc.
+ * $LicenseInfo:firstyear=2009&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$
  */
 
diff --git a/indra/newview/tests/llglslshader_stub.cpp b/indra/newview/tests/llglslshader_stub.cpp
index 5333c8a361..8947a632c8 100644
--- a/indra/newview/tests/llglslshader_stub.cpp
+++ b/indra/newview/tests/llglslshader_stub.cpp
@@ -2,8 +2,25 @@
  * @file llglslshader_stub.cpp
  * @brief  stub class to allow unit testing
  *
- * $LicenseInfo:firstyear=2009&license=viewergpl$
- * Copyright (c) 2009, Linden Research, Inc.
+ * $LicenseInfo:firstyear=2009&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$
  */
 
diff --git a/indra/newview/tests/llpipeline_stub.cpp b/indra/newview/tests/llpipeline_stub.cpp
index 85bf0ae3fb..ad112cbf6a 100644
--- a/indra/newview/tests/llpipeline_stub.cpp
+++ b/indra/newview/tests/llpipeline_stub.cpp
@@ -2,8 +2,25 @@
  * @file llpipeline_stub.cpp
  * @brief  stub class to allow unit testing
  *
- * $LicenseInfo:firstyear=2009&license=viewergpl$
- * Copyright (c) 2009, Linden Research, Inc.
+ * $LicenseInfo:firstyear=2009&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$
  */
 
diff --git a/indra/newview/tests/llsky_stub.cpp b/indra/newview/tests/llsky_stub.cpp
index 35f4944a95..241d740635 100644
--- a/indra/newview/tests/llsky_stub.cpp
+++ b/indra/newview/tests/llsky_stub.cpp
@@ -2,8 +2,25 @@
  * @file llsky_stub.cpp
  * @brief  stub class to allow unit testing
  *
- * $LicenseInfo:firstyear=2009&license=viewergpl$
- * Copyright (c) 2009, Linden Research, Inc.
+ * $LicenseInfo:firstyear=2009&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$
  */
 
diff --git a/indra/newview/tests/llviewershadermgr_stub.cpp b/indra/newview/tests/llviewershadermgr_stub.cpp
index 0dae527035..18eff72f3c 100644
--- a/indra/newview/tests/llviewershadermgr_stub.cpp
+++ b/indra/newview/tests/llviewershadermgr_stub.cpp
@@ -2,8 +2,25 @@
  * @file llglslshader_stub.cpp
  * @brief  stub class to allow unit testing
  *
- * $LicenseInfo:firstyear=2009&license=viewergpl$
- * Copyright (c) 2009, Linden Research, Inc.
+ * $LicenseInfo:firstyear=2009&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$
  */
 
diff --git a/indra/newview/tests/llwlanimator_stub.cpp b/indra/newview/tests/llwlanimator_stub.cpp
index 4d1bb85544..f5e15b2e7b 100644
--- a/indra/newview/tests/llwlanimator_stub.cpp
+++ b/indra/newview/tests/llwlanimator_stub.cpp
@@ -2,8 +2,25 @@
  * @file llwlanimator_stub.cpp
  * @brief  stub class to allow unit testing
  *
- * $LicenseInfo:firstyear=2009&license=viewergpl$
- * Copyright (c) 2009, Linden Research, Inc.
+ * $LicenseInfo:firstyear=2009&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$
  */
 
diff --git a/indra/newview/tests/llwldaycycle_stub.cpp b/indra/newview/tests/llwldaycycle_stub.cpp
index d98c9614b4..a7bc9a7b83 100644
--- a/indra/newview/tests/llwldaycycle_stub.cpp
+++ b/indra/newview/tests/llwldaycycle_stub.cpp
@@ -2,8 +2,25 @@
  * @file llwldaycycle_stub.cpp
  * @brief  stub class to allow unit testing
  *
- * $LicenseInfo:firstyear=2009&license=viewergpl$
- * Copyright (c) 2009, Linden Research, Inc.
+ * $LicenseInfo:firstyear=2009&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$
  */
 
diff --git a/indra/newview/tests/llwlparammanager_test.cpp b/indra/newview/tests/llwlparammanager_test.cpp
index a6c6a2abf4..be0dc9fd0c 100644
--- a/indra/newview/tests/llwlparammanager_test.cpp
+++ b/indra/newview/tests/llwlparammanager_test.cpp
@@ -2,8 +2,25 @@
  * @file llwlparammanager_test.cpp
  * @brief LLWLParamManager tests
  *
- * $LicenseInfo:firstyear=2009&license=viewergpl$
- * Copyright (c) 2009, Linden Research, Inc.
+ * $LicenseInfo:firstyear=2009&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$
  */
 
diff --git a/indra/newview/tests/llwlparamset_stub.cpp b/indra/newview/tests/llwlparamset_stub.cpp
index 6ce4b5827d..ccb99db475 100644
--- a/indra/newview/tests/llwlparamset_stub.cpp
+++ b/indra/newview/tests/llwlparamset_stub.cpp
@@ -2,8 +2,25 @@
  * @file llwlparamset_stub.cpp
  * @brief  stub class to allow unit testing
  *
- * $LicenseInfo:firstyear=2009&license=viewergpl$
- * Copyright (c) 2009, Linden Research, Inc.
+ * $LicenseInfo:firstyear=2009&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$
  */
 
-- 
cgit v1.2.3