diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt
index c44315e3f0e51834b20a07275de829f585f0c03f..a7ee22c2e2cac693084c7a6059e8683c9a8fc558 100644
--- a/indra/newview/VIEWER_VERSION.txt
+++ b/indra/newview/VIEWER_VERSION.txt
@@ -1 +1 @@
-6.3.7
+6.3.8
diff --git a/indra/newview/llaudiosourcevo.cpp b/indra/newview/llaudiosourcevo.cpp
index b37aba6c1520b10d6493967d7cf6a93ddd0be5d6..4b6c855bde3427eb74aabd2e4432fb23629bd385 100644
--- a/indra/newview/llaudiosourcevo.cpp
+++ b/indra/newview/llaudiosourcevo.cpp
@@ -29,8 +29,10 @@
 
 #include "llaudiosourcevo.h"
 
+#include "llagent.h"
 #include "llagentcamera.h"
 #include "llmutelist.h"
+#include "llviewercontrol.h"
 #include "llviewerparcelmgr.h"
 
 LLAudioSourceVO::LLAudioSourceVO(const LLUUID &sound_id, const LLUUID& owner_id, const F32 gain, LLViewerObject *objectp)
@@ -54,6 +56,79 @@ void LLAudioSourceVO::setGain(const F32 gain)
 	mGain = llclamp(gain, 0.f, 1.f);
 }
 
+void LLAudioSourceVO::checkCutOffRadius()
+{
+    if (mSourceMuted // already muted by something, will be recalculated on update()
+        || !mObjectp)
+    {
+        return;
+    }
+
+    F32 cutoff = mObjectp->getSoundCutOffRadius();
+    if (cutoff < 0.1f)
+    {
+        // consider cutoff below 0.1m as off (to avoid near zero comparison)
+        return;
+    }
+
+    LLVector3d pos_global = getPosGlobal();
+    if (!isInCutOffRadius(pos_global, cutoff))
+    {
+        mSourceMuted = true;
+    }
+}
+
+LLVector3d LLAudioSourceVO::getPosGlobal() const
+{
+    if (mObjectp->isAttachment())
+    {
+        LLViewerObject* parent = mObjectp;
+        while (parent && !parent->isAvatar())
+        {
+            parent = (LLViewerObject*)parent->getParent();
+        }
+        if (parent)
+        {
+            return parent->getPositionGlobal();
+        }
+    }
+    else
+    {
+        return mObjectp->getPositionGlobal();
+    }
+    return LLVector3d();
+}
+
+bool LLAudioSourceVO::isInCutOffRadius(const LLVector3d pos_global, const F32 cutoff) const
+{
+    static LLCachedControl<S32> ear_mode(gSavedSettings, "VoiceEarLocation", 0);
+
+    LLVector3d pos_ear;
+
+    switch (ear_mode())
+    {
+        case 0: // camera
+            pos_ear = gAgentCamera.getCameraPositionGlobal();
+            break;
+
+        case 1: // avatar
+        case 2:
+            // voice support 'mixed' in '2' case with agent's position and camera's rotations
+            // but it is not defined in settings and uses camera as default
+            pos_ear = gAgent.getPositionGlobal();
+            break;
+
+        default:
+            pos_ear = gAgentCamera.getCameraPositionGlobal();
+            break;
+    }
+    LLVector3d to_vec = pos_global - pos_ear;
+
+    F32 dist = (F32)to_vec.magVec();
+
+    return dist < cutoff;
+}
+
 void LLAudioSourceVO::updateMute()
 {
 	if (!mObjectp || mObjectp->isDead())
@@ -63,26 +138,11 @@ void LLAudioSourceVO::updateMute()
 	}
 
 	bool mute = false;
-	LLVector3d pos_global;
-
-	if (mObjectp->isAttachment())
-	{
-		LLViewerObject* parent = mObjectp;
-		while (parent && !parent->isAvatar())
-		{
-			parent = (LLViewerObject*)parent->getParent();
-		}
-		if (parent)
-		{
-			pos_global = parent->getPositionGlobal();
-		}
-	}
-	else
-	{
-		pos_global = mObjectp->getPositionGlobal();
-	}
+	LLVector3d pos_global = getPosGlobal();
 
-	if (!LLViewerParcelMgr::getInstance()->canHearSound(pos_global))
+	F32 cutoff = mObjectp->getSoundCutOffRadius();
+	if ((cutoff > 0.1f && !isInCutOffRadius(pos_global, cutoff)) // consider cutoff below 0.1m as off
+		|| !LLViewerParcelMgr::getInstance()->canHearSound(pos_global))
 	{
 		mute = true;
 	}
diff --git a/indra/newview/llaudiosourcevo.h b/indra/newview/llaudiosourcevo.h
index f1d8ef4528507b6be516b70cc54ac5edbc551b96..672a07f7d350f0b852236d08554b59119dd250e6 100644
--- a/indra/newview/llaudiosourcevo.h
+++ b/indra/newview/llaudiosourcevo.h
@@ -41,7 +41,11 @@ class LLAudioSourceVO : public LLAudioSource
 	/*virtual*/	void update();
 	/*virtual*/ void setGain(const F32 gain);
 
+	void checkCutOffRadius();
+
 private:
+	LLVector3d getPosGlobal() const;
+	bool isInCutOffRadius(LLVector3d pos_global, const F32 cutoff) const;
 	void updateMute();
 
 private:
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index 0075b621008ac03909d77dd3b30315b8090ecafd..60a5204547d158b630a7723042de398a92b1a773 100644
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -175,7 +175,7 @@ BOOL LLConversationViewSession::postBuild()
 				LLAvatarIconCtrl* icon = mItemPanel->getChild<LLAvatarIconCtrl>("avatar_icon");
 				icon->setVisible(true);
 				icon->setValue(session->mOtherParticipantID);
-				mSpeakingIndicator->setSpeakerId(gAgentID, session->mSessionID, true);
+				mSpeakingIndicator->setSpeakerId(session->mOtherParticipantID, session->mSessionID, true);
                 mHasArrow = false;
 			}
 			break;
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index c4186132fe5647e45dad616ff64c3c0208112c36..e12ad262f820e7e9e985e46bb8f76e637425d63d 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -433,7 +433,7 @@ void LLFloaterModelPreview::initModelPreview()
 	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));
+	mModelPreview->setModelUpdatedCallback(boost::bind(&LLFloaterModelPreview::modelUpdated, this, _1));
 }
 
 void LLFloaterModelPreview::onViewOptionChecked(LLUICtrl* ctrl)
@@ -510,7 +510,8 @@ void LLFloaterModelPreview::onClickCalculateBtn()
 		mModelPreview->getPreviewAvatar()->showAttachmentOverrides();
     }
 
-	mUploadModelUrl.clear();
+    mUploadModelUrl.clear();
+    mModelPhysicsFee.clear();
 
 	gMeshRepo.uploadModel(mModelPreview->mUploadData, mModelPreview->mPreviewScale,
                           childGetValue("upload_textures").asBoolean(), 
@@ -4439,6 +4440,12 @@ void LLFloaterModelPreview::toggleCalculateButton()
 	toggleCalculateButton(true);
 }
 
+void LLFloaterModelPreview::modelUpdated(bool calculate_visible)
+{
+    mModelPhysicsFee.clear();
+    toggleCalculateButton(calculate_visible);
+}
+
 void LLFloaterModelPreview::toggleCalculateButton(bool visible)
 {
 	mCalculateBtn->setVisible(visible);
@@ -4464,7 +4471,10 @@ void LLFloaterModelPreview::toggleCalculateButton(bool visible)
 		childSetTextArg("download_weight", "[ST]", tbd);
 		childSetTextArg("server_weight", "[SIM]", tbd);
 		childSetTextArg("physics_weight", "[PH]", tbd);
-		childSetTextArg("upload_fee", "[FEE]", tbd);
+		if (!mModelPhysicsFee.isMap() || mModelPhysicsFee.emptyMap())
+		{
+			childSetTextArg("upload_fee", "[FEE]", tbd);
+		}
 		childSetTextArg("price_breakdown", "[STREAMING]", tbd);
 		childSetTextArg("price_breakdown", "[PHYSICS]", tbd);
 		childSetTextArg("price_breakdown", "[INSTANCES]", tbd);
@@ -4524,10 +4534,21 @@ void LLFloaterModelPreview::handleModelPhysicsFeeReceived()
 	mUploadBtn->setEnabled(isModelUploadAllowed());
 }
 
-void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason)
+void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason, const LLSD& result)
 {
 	LL_WARNS() << "LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(" << status << " : " << reason << ")" << LL_ENDL;
 	doOnIdleOneTime(boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this, true));
+
+    if (result.has("upload_price"))
+    {
+        mModelPhysicsFee = result;
+        childSetTextArg("upload_fee", "[FEE]", llformat("%d", result["upload_price"].asInteger()));
+        childSetVisible("upload_fee", true);
+    }
+    else
+    {
+        mModelPhysicsFee.clear();
+    }
 }
 
 /*virtual*/ 
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index edc90d1695176aa3859ff656e84daef8b9d97c5b..1c66570650b64a977be0533f60dcf0f8f9d09d8f 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -125,7 +125,7 @@ class LLFloaterModelPreview : public LLFloaterModelUploadBase
 
 	/*virtual*/ void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url);
 				void handleModelPhysicsFeeReceived();
-	/*virtual*/ void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason);
+	/*virtual*/ void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason, const LLSD& result);
 
 	/*virtual*/ void onModelUploadSuccess();
 
@@ -208,6 +208,8 @@ class LLFloaterModelPreview : public LLFloaterModelUploadBase
 
 	void onLoDSourceCommit(S32 lod);
 
+	void modelUpdated(bool calculate_visible);
+
 	// Toggles between "Calculate weights & fee" and "Upload" buttons.
 	void toggleCalculateButton(bool visible);
 
diff --git a/indra/newview/llfloatermodeluploadbase.h b/indra/newview/llfloatermodeluploadbase.h
index 0d4c834122325d56ab1bc62457ca1fbfc0465ac5..721fce059e008288a06fa8c40c6c0af6298326f7 100644
--- a/indra/newview/llfloatermodeluploadbase.h
+++ b/indra/newview/llfloatermodeluploadbase.h
@@ -45,7 +45,7 @@ class LLFloaterModelUploadBase : public LLFloater, public LLUploadPermissionsObs
 
 	virtual void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) = 0;
 
-	virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason) = 0;
+	virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason, const LLSD& result) = 0;
 
 	virtual void onModelUploadSuccess() {};
 
diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp
index 61c8a3a89830f0a602216773c7bfeadba30e4cbd..c3375a377967215d434c1d48d801f5215a2a524b 100644
--- a/indra/newview/llimprocessing.cpp
+++ b/indra/newview/llimprocessing.cpp
@@ -62,6 +62,8 @@
 #pragma warning (disable:4702)
 #endif
 
+extern void on_new_message(const LLSD& msg);
+
 // Strip out "Resident" for display, but only if the message came from a user
 // (rather than a script)
 static std::string clean_name_from_im(const std::string& name, EInstantMessage type)
@@ -1028,6 +1030,14 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
                 }
 
                 LLNotificationsUI::LLNotificationManager::instance().onChat(chat, args);
+                if (message != "")
+                {
+                    LLSD msg_notify;
+                    msg_notify["session_id"] = LLUUID();
+                    msg_notify["from_id"] = chat.mFromID;
+                    msg_notify["source_type"] = chat.mSourceType;
+                    on_new_message(msg_notify);
+                }
             }
 
 
@@ -1559,6 +1569,12 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url)
         return;
     }
 
+    if (gAgent.getRegion() == NULL)
+    {
+        LL_WARNS("Messaging") << "Region null while attempting to load messages." << LL_ENDL;
+        return;
+    }
+
     LL_INFOS("Messaging") << "Processing offline messages." << LL_ENDL;
 
     std::vector<U8> data;
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 6d2d533c9dcefeca49612ec6d30abcc7602e1cb6..36784ce3f9ace5c2f2b37b7feddfbc69178abe81 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -2270,7 +2270,7 @@ class LLIsItemRemovable : public LLFolderViewFunctor
 // Can be destroyed (or moved to trash)
 BOOL LLFolderBridge::isItemRemovable() const
 {
-	if (!get_is_category_removable(getInventoryModel(), mUUID) || isMarketplaceListingsFolder())
+	if (!get_is_category_removable(getInventoryModel(), mUUID))
 	{
 		return FALSE;
 	}
@@ -2287,6 +2287,11 @@ BOOL LLFolderBridge::isItemRemovable() const
 		}
 	}
 
+	if (isMarketplaceListingsFolder() && (!LLMarketplaceData::instance().isSLMDataFetched() || LLMarketplaceData::instance().getActivationState(mUUID)))
+	{
+		return FALSE;
+	}
+
 	return TRUE;
 }
 
diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp
index 42b5ff38907cced1436c0c22f186c946d8aa1629..802e4941e634c6137f7faee131054389ac7b7ce1 100644
--- a/indra/newview/lllocationinputctrl.cpp
+++ b/indra/newview/lllocationinputctrl.cpp
@@ -1100,9 +1100,7 @@ void LLLocationInputCtrl::changeLocationPresentation()
 
 	//change location presentation only if user does not select/paste anything and 
 	//human-readable region name is being displayed
-	std::string text = mTextEntry->getText();
-	LLStringUtil::trim(text);
-	if(!mTextEntry->hasSelection() && text == mHumanReadableLocation)
+	if(!mTextEntry->hasSelection() && mTextEntry->getText() == mHumanReadableLocation)
 	{
 		//needs unescaped one
 		LLSLURL slurl;
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index 805c25508fe4f5d5e9da0d6550846154b7cdc73d..aa0c7fb73bcbe46d739a249d0fe020fedbf1c28a 100644
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -1294,6 +1294,11 @@ void LLMarketplaceData::setSLMDataFetched(U32 status)
     }
 }
 
+bool LLMarketplaceData::isSLMDataFetched()
+{
+    return mMarketPlaceDataFetched == MarketplaceFetchCodes::MARKET_FETCH_DONE;
+}
+
 // Creation / Deletion / Update
 // Methods publicly called
 bool LLMarketplaceData::createListing(const LLUUID& folder_id)
diff --git a/indra/newview/llmarketplacefunctions.h b/indra/newview/llmarketplacefunctions.h
index ec312baca395b65116c27286cfe73c53ec7f3229..fee9225f77c5905d04f5530e2694c14ece2e1c74 100644
--- a/indra/newview/llmarketplacefunctions.h
+++ b/indra/newview/llmarketplacefunctions.h
@@ -204,7 +204,9 @@ class LLMarketplaceData
     void setDataFetchedSignal(const status_updated_signal_t::slot_type& cb);
     void setSLMDataFetched(U32 status);
     U32 getSLMDataFetched() { return mMarketPlaceDataFetched; }
-    
+
+    bool isSLMDataFetched();
+
     // High level create/delete/set Marketplace data: each method returns true if the function succeeds, false if error
     bool createListing(const LLUUID& folder_id);
     bool activateListing(const LLUUID& folder_id, bool activate, S32 depth = -1);
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 31e3d408d7d95c5cd440ad38c3d9429e1fc6deaf..95322cce6dbf4682d413c8094fd0de420f3edce3 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -2772,7 +2772,7 @@ void LLMeshUploadThread::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResp
 
 			if (observer)
 			{
-				observer->setModelPhysicsFeeErrorStatus(status.toULong(), reason);
+				observer->setModelPhysicsFeeErrorStatus(status.toULong(), reason, body["error"]);
 			}
 		}
 		else
@@ -2805,7 +2805,7 @@ void LLMeshUploadThread::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResp
 
 				if (observer)
 				{
-					observer->setModelPhysicsFeeErrorStatus(status.toULong(), reason);
+					observer->setModelPhysicsFeeErrorStatus(status.toULong(), reason, body["error"]);
 				}
 			}
 		}
diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp
index fc1039b37257467074a5dfb53eaf9f5dd6cfe843..112da556825647b5d5d1ed65cd2119c8f576b1e2 100644
--- a/indra/newview/llnetmap.cpp
+++ b/indra/newview/llnetmap.cpp
@@ -354,7 +354,7 @@ void LLNetMap::draw()
 
 			LLColor4 color = show_as_friend ? map_avatar_friend_color : map_avatar_color;
 
-			unknown_relative_z = positions[i].mdV[VZ] == COARSEUPDATE_MAX_Z &&
+			unknown_relative_z = positions[i].mdV[VZ] >= COARSEUPDATE_MAX_Z &&
 					camera_position.mV[VZ] >= COARSEUPDATE_MAX_Z;
 
 			LLWorldMapView::drawAvatar(
diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp
index 7f6c065bb9f8b3ba62d16d8e9a21b2d9e4e7fd0c..e9fe493d7ec294b11df910feb00d62b0310fa8aa 100644
--- a/indra/newview/lloutputmonitorctrl.cpp
+++ b/indra/newview/lloutputmonitorctrl.cpp
@@ -245,11 +245,11 @@ void LLOutputMonitorCtrl::draw()
 // virtual
 BOOL LLOutputMonitorCtrl::handleMouseUp(S32 x, S32 y, MASK mask)
 {
-	if (mSpeakerId != gAgentID && !mShowParticipantsSpeaking)
+	if (mSpeakerId != gAgentID)
 	{
 		LLFloaterReg::showInstance("floater_voice_volume", LLSD().with("avatar_id", mSpeakerId));
 	}
-	else if(mShowParticipantsSpeaking)
+	else if (mShowParticipantsSpeaking)
 	{
 		LLFloaterReg::showInstance("chat_voice", LLSD());
 	}
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 7ef3685cdb2158aabbedcc7c5efdabd8973d5992..224cec9650ef444e04cbfde527919ef86cabc81b 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -1230,6 +1230,8 @@ void LLPanelLogin::updateLoginButtons()
 		if (user_combo->getCurrentIndex() != -1)
 		{
 			remember_name->setValue(true);
+			LLCheckBoxCtrl* remember_pass = getChild<LLCheckBoxCtrl>("remember_password");
+			remember_pass->setEnabled(TRUE);
 		} // Note: might be good idea to do "else remember_name->setValue(mRememberedState)" but it might behave 'weird' to user
 	}
 }
@@ -1239,6 +1241,8 @@ void LLPanelLogin::populateUserList(LLPointer<LLCredential> credential)
     LLComboBox* user_combo = getChild<LLComboBox>("username_combo");
     user_combo->removeall();
     user_combo->clear();
+    user_combo->setValue(std::string());
+    getChild<LLUICtrl>("password_edit")->setValue(std::string());
     mUsernameLength = 0;
     mPasswordLength = 0;
 
@@ -1261,9 +1265,7 @@ void LLPanelLogin::populateUserList(LLPointer<LLCredential> credential)
 
         if (credential.isNull() || !user_combo->setSelectedByValue(LLSD(credential->userID()), true))
         {
-            // selection failed, just deselect whatever might be selected
-            user_combo->setValue(std::string());
-            getChild<LLUICtrl>("password_edit")->setValue(std::string());
+            // selection failed, fields will be mepty
             updateLoginButtons();
         }
         else
@@ -1278,7 +1280,8 @@ void LLPanelLogin::populateUserList(LLPointer<LLCredential> credential)
             const LLSD &ident = credential->getIdentifier();
             if (ident.isMap() && ident.has("type"))
             {
-                user_combo->add(LLPanelLogin::getUserName(credential), credential->userID(), ADD_BOTTOM, TRUE);
+                // this llsd might hold invalid credencial (failed login), so
+                // do not add to the list, just set field.
                 setFields(credential);
             }
             else
diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp
index 735eaa423dc6a5f5ef2bf5fed0eec1d76b37ce8f..58bc0493388ed69123c308e0c34240c5109191d3 100644
--- a/indra/newview/llpanelvolume.cpp
+++ b/indra/newview/llpanelvolume.cpp
@@ -82,8 +82,11 @@
 
 #include <boost/bind.hpp>
 
-// "Features" Tab
 
+const F32 DEFAULT_GRAVITY_MULTIPLIER = 1.f;
+const F32 DEFAULT_DENSITY = 1000.f;
+
+// "Features" Tab
 BOOL	LLPanelVolume::postBuild()
 {
 	// Flexible Objects Parameters
@@ -830,7 +833,7 @@ void LLPanelVolume::onLightSelectTexture(const LLSD& data)
 // static
 void LLPanelVolume::onCommitMaterial( LLUICtrl* ctrl, void* userdata )
 {
-	//LLPanelObject* self = (LLPanelObject*) userdata;
+	LLPanelVolume* self = (LLPanelVolume*)userdata;
 	LLComboBox* box = (LLComboBox*) ctrl;
 
 	if (box)
@@ -841,6 +844,19 @@ void LLPanelVolume::onCommitMaterial( LLUICtrl* ctrl, void* userdata )
 		if (material_name != LEGACY_FULLBRIGHT_DESC)
 		{
 			U8 material_code = LLMaterialTable::basic.getMCode(material_name);
+			if (self)
+			{
+				LLViewerObject* objectp = self->mObject;
+				if (objectp)
+				{
+					objectp->setPhysicsGravity(DEFAULT_GRAVITY_MULTIPLIER);
+					objectp->setPhysicsFriction(LLMaterialTable::basic.getFriction(material_code));
+					//currently density is always set to 1000 serverside regardless of chosen material,
+					//actual material density should be used here, if this behavior change
+					objectp->setPhysicsDensity(DEFAULT_DENSITY);
+					objectp->setPhysicsRestitution(LLMaterialTable::basic.getRestitution(material_code));
+				}
+			}
 			LLSelectMgr::getInstance()->selectionSetMaterial(material_code);
 		}
 	}
diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp
index 1533a2746952765787b5130195ce7b5467f7f691..2f534ac2456eb9690c6892d9dde30ab652e9d895 100644
--- a/indra/newview/llpreviewnotecard.cpp
+++ b/indra/newview/llpreviewnotecard.cpp
@@ -367,6 +367,7 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs,
 			previewEditor->makePristine();
 			BOOL modifiable = preview->canModify(preview->mObjectID, preview->getItem());
 			preview->setEnabled(modifiable);
+			preview->syncExternal();
 			preview->mAssetStatus = PREVIEW_ASSET_LOADED;
 		}
 		else
@@ -503,10 +504,6 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem, bool sync)
 		}
 
 		editor->makePristine();
-		if (sync)
-		{
-			syncExternal();
-		}
 		const LLInventoryItem* item = getItem();
 		// save it out to database
         if (item)
@@ -755,6 +752,7 @@ void LLPreviewNotecard::openInExternalEditor()
 
     // Start watching file changes.
     mLiveFile = new LLLiveLSLFile(filename, boost::bind(&LLPreviewNotecard::onExternalChange, this, _1));
+    mLiveFile->ignoreNextUpdate();
     mLiveFile->addToEventTimer();
 
     // Open it in external editor.
diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp
index 8fef3ff1c03bf36822331d34aee221bb8ed64ec9..b448caeb0b898ab2e12f426d75629963399868d1 100644
--- a/indra/newview/llsnapshotlivepreview.cpp
+++ b/indra/newview/llsnapshotlivepreview.cpp
@@ -63,6 +63,7 @@ F32 SHINE_WIDTH = 0.6f;
 F32 SHINE_OPACITY = 0.3f;
 F32 FALL_TIME = 0.6f;
 S32 BORDER_WIDTH = 6;
+S32 TOP_PANEL_HEIGHT = 30;
 
 const S32 MAX_TEXTURE_SIZE = 512 ; //max upload texture size 512 * 512
 
@@ -293,8 +294,8 @@ void LLSnapshotLivePreview::draw()
 		F32 uv_width = isImageScaled() ? 1.f : llmin((F32)getWidth() / (F32)getCurrentImage()->getWidth(), 1.f);
 		F32 uv_height = isImageScaled() ? 1.f : llmin((F32)getHeight() / (F32)getCurrentImage()->getHeight(), 1.f);
 		gGL.pushMatrix();
-		{
-			gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom, 0.f);
+		{	
+			gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom + TOP_PANEL_HEIGHT, 0.f);
 			gGL.begin(LLRender::QUADS);
 			{
 				gGL.texCoord2f(uv_width, uv_height);
@@ -346,14 +347,15 @@ void LLSnapshotLivePreview::draw()
 			F32 shine_interp = llmin(1.f, mShineAnimTimer.getElapsedTimeF32() / SHINE_TIME);
 
 			// draw "shine" effect
-			LLLocalClipRect clip(getLocalRect());
+			LLRect local_rect(0, getRect().getHeight() + TOP_PANEL_HEIGHT, getRect().getWidth(), 0);
+			LLLocalClipRect clip(local_rect);
 			{
 				// draw diagonal stripe with gradient that passes over screen
 				S32 x1 = gViewerWindow->getWindowWidthScaled() * ll_round((clamp_rescale(shine_interp, 0.f, 1.f, -1.f - SHINE_WIDTH, 1.f)));
 				S32 x2 = x1 + ll_round(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH);
 				S32 x3 = x2 + ll_round(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH);
 				S32 y1 = 0;
-				S32 y2 = gViewerWindow->getWindowHeightScaled();
+				S32 y2 = gViewerWindow->getWindowHeightScaled() + TOP_PANEL_HEIGHT;
 
 				gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 				gGL.begin(LLRender::QUADS);
@@ -383,36 +385,6 @@ void LLSnapshotLivePreview::draw()
 		}
 	}
 
-	// draw framing rectangle
-	{
-		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
-		gGL.color4f(1.f, 1.f, 1.f, 1.f);
-		const LLRect& outline_rect = getImageRect();
-		gGL.begin(LLRender::QUADS);
-		{
-			gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH);
-			gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH);
-			gGL.vertex2i(outline_rect.mRight, outline_rect.mTop);
-			gGL.vertex2i(outline_rect.mLeft, outline_rect.mTop);
-
-			gGL.vertex2i(outline_rect.mLeft, outline_rect.mBottom);
-			gGL.vertex2i(outline_rect.mRight, outline_rect.mBottom);
-			gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH);
-			gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH);
-
-			gGL.vertex2i(outline_rect.mLeft, outline_rect.mTop);
-			gGL.vertex2i(outline_rect.mLeft, outline_rect.mBottom);
-			gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH);
-			gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH);
-
-			gGL.vertex2i(outline_rect.mRight, outline_rect.mBottom);
-			gGL.vertex2i(outline_rect.mRight, outline_rect.mTop);
-			gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH);
-			gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH);
-		}
-		gGL.end();
-	}
-
 	// draw old image dropping away
 	if (mFallAnimTimer.getStarted())
 	{
diff --git a/indra/newview/lluploadfloaterobservers.h b/indra/newview/lluploadfloaterobservers.h
index 15c3dad38e6ba2e843308f40f358a282f2001463..77e950a1c9ed83bcf69f73069b25b0945758651a 100644
--- a/indra/newview/lluploadfloaterobservers.h
+++ b/indra/newview/lluploadfloaterobservers.h
@@ -53,7 +53,7 @@ class LLWholeModelFeeObserver
 	virtual ~LLWholeModelFeeObserver() {}
 
 	virtual void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) = 0;
-	virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason) = 0;
+	virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason, const LLSD& result) = 0;
 
 	LLHandle<LLWholeModelFeeObserver> getWholeModelFeeObserverHandle() const { return mWholeModelFeeObserverHandle; }
 
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index fe67182bc46e1163ed4997d0650e6c71777556bd..3dd2f402fee9e8e632b22f4671ee3357a80f5d5a 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -374,6 +374,11 @@ void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_
 	LL_INFOS("Messaging") << "give_money(" << uuid << "," << amount << ")"<< LL_ENDL;
 	if(can_afford_transaction(amount))
 	{
+		if (uuid.isNull())
+		{
+			LL_WARNS() << "Failed to send L$ gift to to Null UUID." << LL_ENDL;
+			return;
+		}
 //		gStatusBar->debitBalance(amount);
 		LLMessageSystem* msg = gMessageSystem;
 		msg->newMessageFast(_PREHASH_MoneyTransferRequest);
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index efd8a23a5f706125dfa7ff4ccc8a1cf56463ad1a..fe3e4cdd617132e2dfdaa9be12f66c790d1954e8 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -268,6 +268,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
 	mData(NULL),
 	mAudioSourcep(NULL),
 	mAudioGain(1.f),
+	mSoundCutOffRadius(0.f),
 	mAppAngle(0.f),
 	mPixelArea(1024.f),
 	mInventory(NULL),
@@ -1245,6 +1246,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
 				LLUUID audio_uuid;
 				LLUUID owner_id;	// only valid if audio_uuid or particle system is not null
 				F32    gain;
+				F32    cutoff;
 				U8     sound_flags;
 
 				mesgsys->getU32Fast( _PREHASH_ObjectData, _PREHASH_CRC, crc, block_num);
@@ -1253,6 +1255,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
 				// HACK: Owner id only valid if non-null sound id or particle system
 				mesgsys->getUUIDFast(_PREHASH_ObjectData, _PREHASH_OwnerID, owner_id, block_num );
 				mesgsys->getF32Fast( _PREHASH_ObjectData, _PREHASH_Gain, gain, block_num );
+				mesgsys->getF32Fast(  _PREHASH_ObjectData, _PREHASH_Radius, cutoff, block_num );
 				mesgsys->getU8Fast(  _PREHASH_ObjectData, _PREHASH_Flags, sound_flags, block_num );
 				mesgsys->getU8Fast(  _PREHASH_ObjectData, _PREHASH_Material, material, block_num );
 				mesgsys->getU8Fast(  _PREHASH_ObjectData, _PREHASH_ClickAction, click_action, block_num); 
@@ -1261,6 +1264,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
 				mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_ObjectData, data, length, block_num, MAX_OBJECT_BINARY_DATA_SIZE);
 
 				mTotalCRC = crc;
+				mSoundCutOffRadius = cutoff;
 
 				// Owner ID used for sound muting or particle system muting
 				setAttachedSound(audio_uuid, owner_id, gain, sound_flags);
@@ -1957,6 +1961,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
 				}
 
 				mTotalCRC = crc;
+				mSoundCutOffRadius = cutoff;
 
 				setAttachedSound(sound_uuid, owner_id, gain, sound_flags);
 
@@ -5913,6 +5918,8 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow
 		if( gAgent.canAccessMaturityAtGlobal(this->getPositionGlobal()) )
 		{
 			//LL_INFOS() << "Playing attached sound " << audio_uuid << LL_ENDL;
+			// recheck cutoff radius in case this update was an object-update with new value
+			mAudioSourcep->checkCutOffRadius();
 			mAudioSourcep->play(audio_uuid);
 		}
 	}
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index e9ae26939a1a204c0cfae93dd02bdc605cba14c6..03c5403a1e596ae3cb016006d4edf0143f755897 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -403,6 +403,7 @@ class LLViewerObject
 	// Owner id is this object's owner
 	void setAttachedSound(const LLUUID &audio_uuid, const LLUUID& owner_id, const F32 gain, const U8 flags);
 	void adjustAudioGain(const F32 gain);
+	F32  getSoundCutOffRadius() const { return mSoundCutOffRadius; }
 	void clearAttachedSound()								{ mAudioSourcep = NULL; }
 
 	 // Create if necessary
@@ -790,6 +791,7 @@ class LLViewerObject
 	LLPointer<LLViewerPartSourceScript>		mPartSourcep;	// Particle source associated with this object.
 	LLAudioSourceVO* mAudioSourcep;
 	F32				mAudioGain;
+	F32				mSoundCutOffRadius;
 	
 	F32				mAppAngle;	// Apparent visual arc in degrees
 	F32				mPixelArea; // Apparent area in pixels
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index f4c2e93a454e945fb08a40a033012981e8db0f27..ff5dff1c9b156dad0e52bdcd8af8dd76cc45476f 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -4717,7 +4717,8 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
 		if ((image_width <= gGLManager.mGLMaxTextureSize && image_height <= gGLManager.mGLMaxTextureSize) && 
 			(image_width > window_width || image_height > window_height) && LLPipeline::sRenderDeferred && !show_ui)
 		{
-			if (scratch_space.allocate(image_width, image_height, GL_DEPTH_COMPONENT, true, true))
+			U32 color_fmt = type == LLSnapshotModel::SNAPSHOT_TYPE_DEPTH ? GL_DEPTH_COMPONENT : GL_RGBA;
+			if (scratch_space.allocate(image_width, image_height, color_fmt, true, true))
 			{
 				original_width = gPipeline.mDeferredScreen.getWidth();
 				original_height = gPipeline.mDeferredScreen.getHeight();
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 3b51d07f9626478d42f7ac373dd96cba36f64be9..71ff441600f8c22b803fedb78a846eb3713e1c91 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -2045,8 +2045,10 @@ void LLVOAvatar::resetSkeleton(bool reset_animations)
         LL_ERRS() << "Error resetting skeleton" << LL_ENDL;
 	}
 
-    // Reset attachment points (buildSkeleton only does bones and CVs)
-    bool ignore_hud_joints = true;
+    // Reset attachment points
+    // BuildSkeleton only does bones and CVs but we still need to reinit huds
+    // since huds can be animated.
+    bool ignore_hud_joints = !isSelf();
     initAttachmentPoints(ignore_hud_joints);
 
     // Fix up collision volumes
@@ -6576,7 +6578,7 @@ void LLVOAvatar::initAttachmentPoints(bool ignore_hud_joints)
         LLAvatarXmlInfo::LLAvatarAttachmentInfo *info = *iter;
         if (info->mIsHUDAttachment && (!isSelf() || ignore_hud_joints))
         {
-		    //don't process hud joint for other avatars, or when doing a skeleton reset.
+		    //don't process hud joint for other avatars.
             continue;
         }
 
@@ -10335,7 +10337,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity()
 	// Diagnostic list of all textures on our avatar
 	static std::set<LLUUID> all_textures;
 
-	if (mVisualComplexityStale)
+    if (mVisualComplexityStale)
 	{
 		U32 cost = VISUAL_COMPLEXITY_UNKNOWN;
 		LLVOVolume::texture_cost_t textures;
diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp
index 9bc3a2a33bc59b3e838e64d53daf3b320afa5f0f..a6df0792233581c1aabe4c1c268298b99a0003c4 100644
--- a/indra/newview/llworldmapview.cpp
+++ b/indra/newview/llworldmapview.cpp
@@ -1154,7 +1154,7 @@ void LLWorldMapView::drawAvatar(F32 x_pixels,
 {
 	const F32 HEIGHT_THRESHOLD = 7.f;
 	LLUIImagePtr dot_image = sAvatarLevelImage;
-	if (unknown_relative_z)
+	if (unknown_relative_z && llabs(relative_z) > HEIGHT_THRESHOLD)
 	{
 		dot_image = sAvatarUnknownImage;
 	}