diff --git a/.hgtags b/.hgtags
index 2b85f54c1408e825248eadc6032d5afd334260bf..9985ff4c254c017d03db58c6dd4e3478c1bb09ad 100755
--- a/.hgtags
+++ b/.hgtags
@@ -150,6 +150,7 @@ a9abb9633a266c8d2fe62411cfd1c86d32da72bf 2.7.1-release
 09984bfa6cae17e0f72d02b75c1b7393c65eecfc 2.7.5-beta1
 e1ed60913230dd64269a7f7fc52cbc6004f6d52c 2.8.0-start
 502f6a5deca9365ddae57db4f1e30172668e171e 2.8.1-start
+888768f162d2c0a8de1dcc5fb9a08bd8bd120a6b DRTVWR-175
 2a3965b3ad202df7ea25d2be689291bb14a1280e DRTVWR-155
 6866d9df6efbd441c66451debd376d21211de39c DRTVWR-68_2.7.5-release
 6866d9df6efbd441c66451debd376d21211de39c 2.7.5-release
@@ -329,6 +330,7 @@ af5f3e43e6e4424b1da19d9e16f6b853a7b822ed DRTVWR-169
 6428242e124b523813bfaf4c45b3d422f0298c81 3.3.3-release
 57d221de3df94f90b55204313c2cef044a3c0ae2 DRTVWR-176
 09ef7fd1b0781f33b8a3a9af6236b7bcb4831910 DRTVWR-170
+005dfe5c4c377207d065fb27858d2eb0b53b143a DRTVWR-167
 f87bfbe0b62d26f451d02a47c80ebef6b9168fc2 3.3.4-beta1
 f87bfbe0b62d26f451d02a47c80ebef6b9168fc2 DRTVWR-158
 f87bfbe0b62d26f451d02a47c80ebef6b9168fc2 3.3.4-beta1
@@ -337,6 +339,7 @@ bce218b2b45b730b22cc51e4807aa8b571cadef3 DRTVWR-173
 f91d003091a61937a044652c4c674447f7dcbb7a 3.3.4-beta1
 82b5330bc8b17d0d4b598832e9c5a92e90075682 3.3.4-beta2
 eb539c65e6ee26eea2bf373af2d0f4b52dc91289 DRTVWR-177
+4ad8a3afe40e0200309e3ada68932c4295ac2795 DRTVWR-179
 a8057e1b9a1246b434a27405be35e030f7d28b0c 3.3.4-beta3
 4281aa899fb2cedb7a9ca7ce91c5c29d4aa69594 DRTVWR-180
 9cd174d3a54d93d409a7c346a15b8bfb40fc58f4 DRTVWR-184
@@ -344,3 +347,5 @@ a8057e1b9a1246b434a27405be35e030f7d28b0c 3.3.4-beta3
 6c75f220b103db1420919c8b635fe53e2177f318 3.3.4-beta4
 ab2ffc547c8a8950ff187c4f6c95e5334fab597b 3.3.4-beta5
 28e100d0379a2b0710c57647a28fc5239d3d7b99 3.3.4-release
+a8b3eca451a9eaab59987efb0ab1c4217e3f2dcc DRTVWR-182
+1f27cdfdc54246484f8afbbe42ce48e954175cbd 3.4.0-beta1
diff --git a/BuildParams b/BuildParams
index 3dd35c5863324903337ddd6a518b111e3bf51e4d..ebfc640023eb5a85537730dfb3190ea9797ae7b2 100644
--- a/BuildParams
+++ b/BuildParams
@@ -18,7 +18,7 @@ build_CYGWIN_Debug = false
 email_status_this_is_os = true
 
 # Limit extent of codeticket updates to revisions after...
-codeticket_since = 2.2.0-release
+codeticket_since = 3.3.0-release
 
 # ========================================
 # Viewer Development
@@ -43,18 +43,20 @@ integration_viewer-development.viewer_channel = "Second Life Development"
 integration_viewer-development.login_channel = "Second Life Development"
 integration_viewer-development.build_viewer_update_version_manager = false
 integration_viewer-development.email = viewer-development-builds@lists.secondlife.com
-integration_viewer-development.build_enforce_coding_policy = true
-integration_viewer-development.codeticket_add_context = true
+integration_viewer-development.build_enforce_coding_policy = false
+integration_viewer-development.codeticket_add_context = false
 
 viewer-beta.viewer_channel = "Second Life Beta Viewer"
 viewer-beta.login_channel = "Second Life Beta Viewer"
 viewer-beta.build_debug_release_separately = true
 viewer-beta.build_viewer_update_version_manager = true
+viewer-beta.codeticket_add_context = false
 
 viewer-release.viewer_channel = "Second Life Release"
 viewer-release.login_channel = "Second Life Release"
 viewer-release.build_debug_release_separately = true
 viewer-release.build_viewer_update_version_manager = true
+viewer-release.codeticket_add_context = false
 
 # ========================================
 # mesh-development
@@ -123,35 +125,16 @@ viewer-adult-check.build_debug_release_separately = true
 viewer-adult-check.build_CYGWIN_Debug = false
 viewer-adult-check.build_viewer_update_version_manager = false
 
-# ================
-# oz
-# ================
-
-Snowstorm_viewer-project-review.build_debug_release_separately = true
-Snowstorm_viewer-project-review.codeticket_add_context = true
-Snowstorm_viewer-project-review.viewer_channel = "Project Viewer - Snowstorm Team"
-Snowstorm_viewer-project-review.login_channel = "Project Viewer - Snowstorm Team"
-Snowstorm_viewer-project-review.codeticket_add_context = true
-
-oz_viewer-devreview.build_debug_release_separately = true
-oz_viewer-devreview.codeticket_add_context = false
-oz_viewer-devreview.build_enforce_coding_policy = true
-oz_viewer-devreview.email = oz@lindenlab.com
-
-oz_viewer-trial.build_debug_release_separately = true
-oz_viewer-trial.codeticket_add_context = false
-oz_viewer-trial.build_enforce_coding_policy = true
-oz_viewer-trial.email = oz@lindenlab.com
-
-oz_viewer-beta-review.build_debug_release_separately = true
-oz_viewer-beta-review.codeticket_add_context = false
-oz_viewer-beta-review.viewer_channel = "Second Life Beta Viewer"
-oz_viewer-beta-review.login_channel = "Second Life Beta Viewer"
-oz_viewer-beta-review.email = oz@lindenlab.com
-
-oz_project-7.build_debug_release_separately = true
-oz_project-7.codeticket_add_context = false
-oz_project-7.email = "sldev@catznip.com oz@lindenlab.com"
+# ========================================
+# viewer-pathfinding
+# ========================================
+
+viewer-pathfinding.viewer_channel = "Project Viewer - Pathfinding"
+viewer-pathfinding.login_channel = "Project Viewer - Pathfinding"
+viewer-pathfinding.viewer_grid = agni
+viewer-pathfinding.build_debug_release_separately = true
+viewer-pathfinding.build_CYGWIN_Debug = false
+viewer-pathfinding.build_viewer_update_version_manager = false
 
 # =================================================================
 # asset delivery 2010 projects
diff --git a/autobuild.xml b/autobuild.xml
index 90d908c283cf130f6c07c76a08e552ded75874f4..5093e136b5ced6505442305da013d31ca573b1d7 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -903,6 +903,54 @@
           </map>
         </map>
       </map>
+      <key>havok-source</key>
+      <map>
+        <key>license</key>
+        <string>havok-ares</string>
+        <key>license_file</key>
+        <string>LICENSES/havok.txt</string>
+        <key>name</key>
+        <string>havok-source</string>
+        <key>platforms</key>
+        <map>
+          <key>darwin</key>
+          <map>
+            <key>archive</key>
+            <map>
+              <key>hash</key>
+              <string>efaf5cb3e861d44518eb03f4c406f03c</string>
+              <key>url</key>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/falcon_3p-havok-source/rev/261536/arch/Darwin/installer/havok_source-2012.1-darwin-20120710.tar.bz2</string>
+            </map>
+            <key>name</key>
+            <string>darwin</string>
+          </map>
+          <key>linux</key>
+          <map>
+            <key>archive</key>
+            <map>
+              <key>hash</key>
+              <string>50037fff3fd3356a073cdae88348c9ab</string>
+              <key>url</key>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/falcon_3p-havok-source/rev/261536/arch/Linux/installer/havok_source-2012.1-linux-20120711.tar.bz2</string>
+            </map>
+            <key>name</key>
+            <string>linux</string>
+          </map>
+          <key>windows</key>
+          <map>
+            <key>archive</key>
+            <map>
+              <key>hash</key>
+              <string>cd6638f5a03469654615730c16889a60</string>
+              <key>url</key>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/falcon_3p-havok-source/rev/261536/arch/CYGWIN/installer/havok_source-2012.1-windows-20120710.tar.bz2</string>
+            </map>
+            <key>name</key>
+            <string>windows</string>
+          </map>
+        </map>
+      </map>
       <key>jpeglib</key>
       <map>
         <key>license</key>
@@ -1191,12 +1239,14 @@
           </map>
         </map>
       </map>
-      <key>llconvexdecomposition</key>
+      <key>llphysicsextensions_source</key>
       <map>
         <key>license</key>
-        <string>havok</string>
+        <string>TEMPORARY</string>
+        <key>license_file</key>
+        <string>LICENSES/llphysicsextensions.txt</string>
         <key>name</key>
-        <string>llconvexdecomposition</string>
+        <string>llphysicsextensions_source</string>
         <key>platforms</key>
         <map>
           <key>darwin</key>
@@ -1204,9 +1254,11 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>362654a472ef7368d4c803ae3fb89d95</string>
+              <string>de22a97b276913a6dd05838b7fe297af</string>
+              <key>hash_algorithm</key>
+              <string>md5</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/238959/arch/Darwin/installer/llconvexdecomposition-0.1-darwin-20110819.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions-source/rev/262536/arch/Darwin/installer/llphysicsextensions_source-0.3-darwin-20120725.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
@@ -1216,9 +1268,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>c7801d899daec5338fbe95053255b7e7</string>
+              <string>d2dfbbc11aac34ebd551df86524c8c9c</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/238959/arch/Linux/installer/llconvexdecomposition-0.1-linux-20110819.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions-source/rev/262536/arch/Linux/installer/llphysicsextensions_source-0.3-linux-20120725.tar.bz2</string>
             </map>
             <key>name</key>
             <string>linux</string>
@@ -1228,23 +1280,25 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>6ecf2f85f03c5ae87fe45769566a5660</string>
+              <string>99abccc5d117ab82cadb8cff0d85b867</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/238959/arch/CYGWIN/installer/llconvexdecomposition-0.1-windows-20110819.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions-source/rev/262536/arch/CYGWIN/installer/llphysicsextensions_source-0.3-windows-20120725.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
           </map>
         </map>
+        <key>version</key>
+        <string>0.2</string>
       </map>
-      <key>llconvexdecompositionstub</key>
+      <key>llphysicsextensions_stub</key>
       <map>
         <key>license</key>
-        <string>lgpl</string>
+        <string>TEMPORARY</string>
         <key>license_file</key>
-        <string>LICENSES/LLConvexDecompositionStubLicense.txt</string>
+        <string>LICENSES/llphysicsextensions.txt</string>
         <key>name</key>
-        <string>llconvexdecompositionstub</string>
+        <string>llphysicsextensions_stub</string>
         <key>platforms</key>
         <map>
           <key>darwin</key>
@@ -1252,9 +1306,11 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>a5f53e09f67271fd50f1131ffdda9d27</string>
+              <string>3528620230fbd288fcc9dbbd8d8a6b59</string>
+              <key>hash_algorithm</key>
+              <string>md5</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llconvexdecompositionstub/rev/238958/arch/Darwin/installer/llconvexdecompositionstub-0.3-darwin-20110819.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions-stub/rev/262536/arch/Darwin/installer/llphysicsextensions_stub-0.3-darwin-20120725.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
@@ -1264,9 +1320,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>0006a964f1497f55a5f181b7042d2d22</string>
+              <string>69d188f72f9494b0e74c94ca0496f618</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llconvexdecompositionstub/rev/238958/arch/Linux/installer/llconvexdecompositionstub-0.3-linux-20110819.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions-stub/rev/262536/arch/Linux/installer/llphysicsextensions_stub-0.3-linux-20120725.tar.bz2</string>
             </map>
             <key>name</key>
             <string>linux</string>
@@ -1276,14 +1332,16 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>b859e7e3bb03ebb467f0309f46422995</string>
+              <string>61fc2b84ad53cf8d98d1784c31f9928e</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llconvexdecompositionstub/rev/238958/arch/CYGWIN/installer/llconvexdecompositionstub-0.3-windows-20110819.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions-stub/rev/262536/arch/CYGWIN/installer/llphysicsextensions_stub-0.3-windows-20120725.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
           </map>
         </map>
+        <key>version</key>
+        <string>0.2</string>
       </map>
       <key>llqtwebkit</key>
       <map>
diff --git a/build.sh b/build.sh
index a95ca91d82970997e753c61437ce948b277a31ee..b5876738e67aa83a0963f1a58c3a03d7aae3e54d 100755
--- a/build.sh
+++ b/build.sh
@@ -81,16 +81,43 @@ pre_build()
   end_section "Pre$variant"
 }
 
+package_llphysicsextensions_tpv()
+{
+  begin_section "PhysicsExtensions_TPV"
+  tpv_status=0
+  if [ "$variant" = "Release" ]
+  then 
+      llpetpvcfg=$build_dir/packages/llphysicsextensions/autobuild-tpv.xml
+      "$AUTOBUILD" build --verbose --config-file $llpetpvcfg -c Tpv
+      
+      # capture the package file name for use in upload later...
+      PKGTMP=`mktemp -t pgktpv.XXXXXX`
+      trap "rm $PKGTMP* 2>/dev/null" 0
+      "$AUTOBUILD" package --verbose --config-file $llpetpvcfg > $PKGTMP
+      tpv_status=$?
+      sed -n -e 's/^wrote *//p' $PKGTMP > $build_dir/llphysicsextensions_package
+  else
+      echo "Do not provide llphysicsextensions_tpv for $variant"
+      llphysicsextensions_package=""
+  fi
+  end_section "PhysicsExtensions_TPV"
+  return $tpv_status
+}
+
 build()
 {
   local variant="$1"
   if $build_viewer
   then
     begin_section "Viewer$variant"
-
     check_for "Before 'autobuild build'" ${build_dir}/packages/dictionaries
 
-    if "$AUTOBUILD" build --no-configure -c $variant
+    "$AUTOBUILD" build --no-configure -c $variant
+    viewer_build_ok=$?
+    end_section "Viewer$variant"
+    package_llphysicsextensions_tpv
+    tpvlib_build_ok=$?
+    if [ $viewer_build_ok -eq 0 -a $tpvlib_build_ok -eq 0 ]
     then
       echo true >"$build_dir"/build_ok
     else
@@ -98,7 +125,6 @@ build()
     fi
     check_for "After 'autobuild configure'" ${build_dir}/packages/dictionaries
 
-    end_section "Viewer$variant"
   fi
 }
 
@@ -215,11 +241,6 @@ do
   mkdir -p "$build_dir"
   mkdir -p "$build_dir/tmp"
 
-  # Install packages.
-  begin_section "AutobuildInstall" 
-  "$AUTOBUILD" install --verbose --skip-license-check
-  end_section "AutobuildInstall" 
-
   if pre_build "$variant" "$build_dir" >> "$build_log" 2>&1
   then
     if $build_link_parallel
@@ -289,13 +310,25 @@ then
       upload_item quicklink "$package" binary/octet-stream
       [ -f summary.json ] && upload_item installer summary.json text/plain
 
-      # Upload crash reporter files.
       case "$last_built_variant" in
       Release)
+        # Upload crash reporter files
         for symbolfile in $symbolfiles
         do
           upload_item symbolfile "$build_dir/$symbolfile" binary/octet-stream
         done
+        
+        # Upload the llphysicsextensions_tpv package, if one was produced
+        if [ -r "$build_dir/llphysicsextensions_package" ]
+        then
+            llphysicsextensions_package=$(cat $build_dir/llphysicsextensions_package)
+            upload_item private_artifact "$llphysicsextensions_package" binary/octet-stream
+        else
+            echo "No llphysicsextensions_package"
+        fi
+        ;;
+      *)
+        echo "Skipping mapfile for $last_built_variant"
         ;;
       esac
 
diff --git a/etc/message.xml b/etc/message.xml
index 3445975545dbd70c290c11f0d852ee14a0c58eab..7b133ab20570bf4ae3da5025c590fe034d23d29f 100644
--- a/etc/message.xml
+++ b/etc/message.xml
@@ -546,8 +546,24 @@
 					<key>trusted-sender</key>
 					<boolean>true</boolean>
 				</map>
-				
-				<!-- UDPDeprecated Messages -->
+
+        <key>NavMeshStatusUpdate</key>
+        <map>
+          <key>flavor</key>
+          <string>llsd</string>
+          <key>trusted-sender</key>
+          <boolean>true</boolean>
+        </map>
+
+        <key>AgentStateUpdate</key>
+        <map>
+          <key>flavor</key>
+          <string>llsd</string>
+          <key>trusted-sender</key>
+          <boolean>true</boolean>
+        </map>
+
+        <!-- UDPDeprecated Messages -->
 				<key>ScriptRunningReply</key>
 				<map>
 					<key>flavor</key>
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index 98eeed09b3a7448bbf504dadb27a80bbce469f16..00baf626d20a86f37ffcbf0ec902f675eda24156 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -69,6 +69,7 @@ if (WINDOWS)
       /Oy-
       /Zc:wchar_t-
       /arch:SSE2
+      /fp:fast
       )
      
   # Are we using the crummy Visual Studio KDU build workaround?
diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt
index 9b836aac5fb2772d93136b9d7d6ef13bb6518a4e..569034a6fb97d615d60af6ed7a17aae61312cebf 100644
--- a/indra/cmake/CMakeLists.txt
+++ b/indra/cmake/CMakeLists.txt
@@ -43,7 +43,6 @@ set(cmake_SOURCE_FILES
     LLAudio.cmake
     LLCharacter.cmake
     LLCommon.cmake
-    LLConvexDecomposition.cmake
     LLCrashLogger.cmake
     LLDatabase.cmake
     LLImage.cmake
@@ -54,6 +53,7 @@ set(cmake_SOURCE_FILES
     LLMessage.cmake
     LLPlugin.cmake
     LLPrimitive.cmake
+    LLPhysicsExtensions.cmake
     LLRender.cmake
     LLScene.cmake
     LLTestCommand.cmake
diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake
index 224e0a8b5163a32b4efbfd941113dcc0402ef12b..9f05c4cff21c4b6cdffa66232bc2982f8a59c675 100644
--- a/indra/cmake/Copy3rdPartyLibs.cmake
+++ b/indra/cmake/Copy3rdPartyLibs.cmake
@@ -57,10 +57,10 @@ if(WINDOWS)
         libhunspell.dll
         )
 
-    if(USE_GOOGLE_PERFTOOLS)
+    if(USE_TCMALLOC)
       set(debug_files ${debug_files} libtcmalloc_minimal-debug.dll)
       set(release_files ${release_files} libtcmalloc_minimal.dll)
-    endif(USE_GOOGLE_PERFTOOLS)
+    endif(USE_TCMALLOC)
 
     if (FMOD)
       set(debug_files ${debug_files} fmod.dll)
@@ -272,13 +272,16 @@ elseif(LINUX)
         libopenal.so
         libopenjpeg.so
         libssl.so
-        libtcmalloc_minimal.so
         libuuid.so.16
         libuuid.so.16.0.22
         libssl.so.1.0.0
         libfontconfig.so.1.4.4
        )
 
+    if (USE_TCMALLOC)
+      set(release_files ${release_files} "libtcmalloc_minimal.so")
+    endif (USE_TCMALLOC)
+
     if (FMOD)
       set(release_files ${release_files} "libfmod-3.75.so")
     endif (FMOD)
diff --git a/indra/cmake/GooglePerfTools.cmake b/indra/cmake/GooglePerfTools.cmake
index d9f91193be10762c23e7926b214890aecd66a99f..09501e0406e637ceea1e1c92d10291504e9fe2da 100644
--- a/indra/cmake/GooglePerfTools.cmake
+++ b/indra/cmake/GooglePerfTools.cmake
@@ -1,20 +1,34 @@
 # -*- cmake -*-
 include(Prebuilt)
 
+# If you want to enable or disable TCMALLOC in viewer builds, this is the place.
+# set ON or OFF as desired.
+set (USE_TCMALLOC ON)
+
 if (STANDALONE)
   include(FindGooglePerfTools)
 else (STANDALONE)
   if (WINDOWS)
-    use_prebuilt_binary(tcmalloc)
-    set(TCMALLOC_LIBRARIES 
-        debug libtcmalloc_minimal-debug
-        optimized libtcmalloc_minimal)
+    if (USE_TCMALLOC)
+       use_prebuilt_binary(tcmalloc)
+       set(TCMALLOC_LIBRARIES 
+         debug libtcmalloc_minimal-debug
+         optimized libtcmalloc_minimal)
+       set(TCMALLOC_LINK_FLAGS  "/INCLUDE:__tcmalloc")
+    else (USE_TCMALLOC)
+      set(TCMALLOC_LIBRARIES)
+      set(TCMALLOC_LINK_FLAGS)
+    endif (USE_TCMALLOC)
     set(GOOGLE_PERFTOOLS_FOUND "YES")
   endif (WINDOWS)
   if (LINUX)
-    use_prebuilt_binary(tcmalloc)
-    set(TCMALLOC_LIBRARIES 
-    tcmalloc)
+    if (USE_TCMALLOC)
+      use_prebuilt_binary(tcmalloc)
+      set(TCMALLOC_LIBRARIES 
+        tcmalloc)
+    else (USE_TCMALLOC)
+      set(TCMALLOC_LIBRARIES)
+    endif (USE_TCMALLOC)
     set(PROFILER_LIBRARIES profiler)
     set(GOOGLE_PERFTOOLS_INCLUDE_DIR
         ${LIBS_PREBUILT_DIR}/include)
@@ -29,13 +43,19 @@ if (GOOGLE_PERFTOOLS_FOUND)
 endif (GOOGLE_PERFTOOLS_FOUND)
 
 if (WINDOWS)
-    set(USE_GOOGLE_PERFTOOLS ON)
+   set(USE_GOOGLE_PERFTOOLS ON)
 endif (WINDOWS)
 
 if (USE_GOOGLE_PERFTOOLS)
-  set(TCMALLOC_FLAG -ULL_USE_TCMALLOC=1)
+  if (USE_TCMALLOC)
+    set(TCMALLOC_FLAG -DLL_USE_TCMALLOC=1)
+  else (USE_TCMALLOC)
+    set(TCMALLOC_FLAG -ULL_USE_TCMALLOC)
+  endif (USE_TCMALLOC)
+endif (USE_GOOGLE_PERFTOOLS)
+
+if (USE_GOOGLE_PERFTOOLS)
   include_directories(${GOOGLE_PERFTOOLS_INCLUDE_DIR})
   set(GOOGLE_PERFTOOLS_LIBRARIES ${TCMALLOC_LIBRARIES} ${STACKTRACE_LIBRARIES} ${PROFILER_LIBRARIES})
 else (USE_GOOGLE_PERFTOOLS)
-  set(TCMALLOC_FLAG -ULL_USE_TCMALLOC)
 endif (USE_GOOGLE_PERFTOOLS)
diff --git a/indra/cmake/Havok.cmake b/indra/cmake/Havok.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..5c0768abfa91c50ed25b72ce219fd890c5c651ac
--- /dev/null
+++ b/indra/cmake/Havok.cmake
@@ -0,0 +1,83 @@
+# -*- cmake -*-
+
+use_prebuilt_binary(havok-source)
+set(Havok_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/havok/Source)
+list(APPEND Havok_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/havok/Demo)
+
+set(HAVOK_DEBUG_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/debug/havok-fulldebug)
+set(HAVOK_RELEASE_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/release/havok)
+
+if (LL_DEBUG_HAVOK)
+   if (WIN32)
+      # Always link relwithdebinfo to havok-hybrid on windows.
+      set(HAVOK_RELWITHDEBINFO_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/debug/havok-hybrid)
+   else (WIN32)
+      set(HAVOK_RELWITHDEBINFO_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/debug/havok-fulldebug)
+   endif (WIN32)
+else (LL_DEBUG_HAVOK)
+   set(HAVOK_RELWITHDEBINFO_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/release/havok)
+endif (LL_DEBUG_HAVOK)
+
+set(HAVOK_LIBS
+    hkBase
+    hkCompat
+    hkGeometryUtilities
+    hkInternal
+    hkSerialize
+    hkSceneData
+    hkpCollide
+    hkpUtilities
+    hkpConstraintSolver
+    hkpDynamics
+    hkpInternal
+    hkaiInternal
+    hkaiPathfinding
+    hkaiAiPhysicsBridge
+    hkcdInternal
+    hkcdCollide
+    hkpVehicle
+    hkVisualize
+    hkaiVisualize
+    hkgpConvexDecomposition
+)
+
+unset(HK_DEBUG_LIBRARIES)
+unset(HK_RELEASE_LIBRARIES)
+unset(HK_RELWITHDEBINFO_LIBRARIES)
+
+foreach(HAVOK_LIB ${HAVOK_LIBS})
+        find_library(HAVOK_DEBUG_LIB_${HAVOK_LIB}   ${HAVOK_LIB} PATHS ${HAVOK_DEBUG_LIBRARY_PATH})
+        find_library(HAVOK_RELEASE_LIB_${HAVOK_LIB} ${HAVOK_LIB} PATHS ${HAVOK_RELEASE_LIBRARY_PATH})
+        find_library(HAVOK_RELWITHDEBINFO_LIB_${HAVOK_LIB} ${HAVOK_LIB} PATHS ${HAVOK_RELWITHDEBINFO_LIBRARY_PATH})
+        
+        if(LINUX)
+            set(cmd "mkdir")
+            set(debug_dir "${HAVOK_DEBUG_LIBRARY_PATH}/${HAVOK_LIB}")
+            set(release_dir "${HAVOK_RELEASE_LIBRARY_PATH}/${HAVOK_LIB}")
+            set(relwithdebinfo_dir "${HAVOK_RELWITHDEBINFO_LIBRARY_PATH}/${HAVOK_LIB}")
+
+            exec_program( ${cmd} ${HAVOK_DEBUG_LIBRARY_PATH} ARGS ${debug_dir} OUTPUT_VARIABLE rv)
+            exec_program( ${cmd} ${HAVOK_RELEASE_LIBRARY_PATH} ARGS ${release_dir} OUTPUT_VARIABLE rv)
+            exec_program( ${cmd} ${HAVOK_RELWITHDEBINFO_LIBRARY_PATH} ARGS ${relwithdebinfo_dir} OUTPUT_VARIABLE rv)
+
+            set(cmd "ar")
+            set(arg " -xv")
+            set(arg "${arg} ../lib${HAVOK_LIB}.a")
+            exec_program( ${cmd} ${debug_dir} ARGS ${arg} OUTPUT_VARIABLE rv)
+            exec_program( ${cmd} ${release_dir} ARGS ${arg} OUTPUT_VARIABLE rv)
+            exec_program( ${cmd} ${relwithdebinfo_dir} ARGS ${arg} OUTPUT_VARIABLE rv)
+
+            file(GLOB extracted_debug "${debug_dir}/*.o")
+            file(GLOB extracted_release "${release_dir}/*.o")
+            file(GLOB extracted_relwithdebinfo "${relwithdebinfo_dir}/*.o")
+            list(APPEND HK_DEBUG_LIBRARIES ${extracted_debug})
+            list(APPEND HK_RELEASE_LIBRARIES ${extracted_release})
+            list(APPEND HK_RELWITHDEBINFO_LIBRARIES ${extracted_relwithdebinfo})
+        else(LINUX)
+        # Win32
+            list(APPEND HK_DEBUG_LIBRARIES   ${HAVOK_DEBUG_LIB_${HAVOK_LIB}})
+            list(APPEND HK_RELEASE_LIBRARIES ${HAVOK_RELEASE_LIB_${HAVOK_LIB}})
+            list(APPEND HK_RELWITHDEBINFO_LIBRARIES ${HAVOK_RELWITHDEBINFO_LIB_${HAVOK_LIB}})
+        endif (LINUX)
+endforeach(HAVOK_LIB)
+
diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake
index 08feab6e36998c559cadb4ce01006787759c4537..a6f69a09e9300daeecca1065f5166dcf8a87d826 100644
--- a/indra/cmake/LLAddBuildTest.cmake
+++ b/indra/cmake/LLAddBuildTest.cmake
@@ -205,6 +205,15 @@ FUNCTION(LL_ADD_INTEGRATION_TEST
     SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES COMPILE_FLAGS -I"${TUT_INCLUDE_DIR}")
   endif(STANDALONE)
 
+  if (WINDOWS)
+    SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname}
+        PROPERTIES
+        LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS ${TCMALLOC_LINK_FLAGS}"
+        LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO"
+        LINK_FLAGS_RELEASE ""
+        )
+  endif (WINDOWS)
+
   # Add link deps to the executable
   if(TEST_DEBUG)
     message(STATUS "TARGET_LINK_LIBRARIES(INTEGRATION_TEST_${testname} ${libraries})")
diff --git a/indra/cmake/LLConvexDecomposition.cmake b/indra/cmake/LLConvexDecomposition.cmake
deleted file mode 100644
index 8e445047823871af1d00759b83352d26f09dfd76..0000000000000000000000000000000000000000
--- a/indra/cmake/LLConvexDecomposition.cmake
+++ /dev/null
@@ -1,12 +0,0 @@
-# -*- cmake -*-
-include(Prebuilt)
-
-set(LLCONVEXDECOMP_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
-  
-if (INSTALL_PROPRIETARY AND NOT STANDALONE)
-  use_prebuilt_binary(llconvexdecomposition)
-  set(LLCONVEXDECOMP_LIBRARY llconvexdecomposition)
-else (INSTALL_PROPRIETARY AND NOT STANDALONE)
-  use_prebuilt_binary(llconvexdecompositionstub)
-  set(LLCONVEXDECOMP_LIBRARY llconvexdecompositionstub)
-endif (INSTALL_PROPRIETARY AND NOT STANDALONE)
diff --git a/indra/cmake/LLPhysicsExtensions.cmake b/indra/cmake/LLPhysicsExtensions.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..e6afee762eca581b88130add82e6c7031d9e6edc
--- /dev/null
+++ b/indra/cmake/LLPhysicsExtensions.cmake
@@ -0,0 +1,35 @@
+# -*- cmake -*-
+include(Prebuilt)
+
+# There are three possible solutions to provide the llphysicsextensions:
+# - The full source package, selected by -DHAVOK:BOOL=ON
+# - The stub source package, selected by -DHAVOK:BOOL=OFF 
+# - The prebuilt package available to those with sublicenses, selected by -DHAVOK_TPV:BOOL=ON
+
+if (INSTALL_PROPRIETARY)
+   set(HAVOK ON CACHE BOOL "Use Havok physics library")
+endif (INSTALL_PROPRIETARY)
+
+
+# Note that the use_prebuilt_binary macros below do not in fact include binaries;
+# the llphysicsextensions_* packages are source only and are built here.
+# The source package and the stub package both build libraries of the same name.
+
+if (HAVOK)
+   include(Havok)
+   use_prebuilt_binary(llphysicsextensions_source)
+   set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/src)
+   set(LLPHYSICSEXTENSIONS_LIBRARIES    llphysicsextensions)
+
+elseif (HAVOK_TPV)
+   use_prebuilt_binary(llphysicsextensions_tpv)
+   set(LLPHYSICSEXTENSIONS_LIBRARIES    llphysicsextensions_tpv)
+
+else (HAVOK)
+   use_prebuilt_binary(llphysicsextensions_stub)
+   set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/stub)
+   set(LLPHYSICSEXTENSIONS_LIBRARIES    llphysicsextensionsstub)
+
+endif (HAVOK)
+
+set(LLPHYSICSEXTENSIONS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/llphysicsextensions)
diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake
index 47f944f9a5dd377ac5ba12b04ab107a07b7e2d1d..c3e3a80fd0d06cf20d8d1af12e3952ff7864d78b 100644
--- a/indra/cmake/Linking.cmake
+++ b/indra/cmake/Linking.cmake
@@ -38,9 +38,8 @@ if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
   # packages/lib/release directory to deal with autobuild packages that don't
   # provide (e.g.) lib/debug libraries.
   list(APPEND AUTOBUILD_LIBS_INSTALL_DIRS ${ARCH_PREBUILT_DIRS_RELEASE})
-  message(STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}, extending AUTOBUILD_LIBS_INSTALL_DIRS")
 endif (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
-message(STATUS "For ${CMAKE_BUILD_TYPE}, AUTOBUILD_LIBS_INSTALL_DIRS: ${AUTOBUILD_LIBS_INSTALL_DIRS}")
+
 link_directories(${AUTOBUILD_LIBS_INSTALL_DIRS})
 
 if (LINUX)
diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake
index 4cbf7aa0430ba27534e8f50c20cb3d61c608bc9e..56ced20abf68c32cd4a56fa1df22e3f4343fce87 100644
--- a/indra/cmake/Variables.cmake
+++ b/indra/cmake/Variables.cmake
@@ -101,8 +101,8 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
   
   # To support a different SDK update these Xcode settings:
   set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5)
-  set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk)
-  set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "4.0")
+  set(CMAKE_OSX_SYSROOT macosx10.6)
+  set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")
   set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym)
 
   # NOTE: To attempt an i386/PPC Universal build, add this on the configure line:
diff --git a/indra/cmake/ViewerMiscLibs.cmake b/indra/cmake/ViewerMiscLibs.cmake
index f907181929802ab0a27019b574a3ddab7d4e1794..5b00c989a4bd267dd1f1a2f23053339cafd68ab0 100644
--- a/indra/cmake/ViewerMiscLibs.cmake
+++ b/indra/cmake/ViewerMiscLibs.cmake
@@ -8,10 +8,3 @@ if (NOT STANDALONE)
   use_prebuilt_binary(fontconfig)
 endif(NOT STANDALONE)
 
-if(VIEWER AND NOT STANDALONE)
-  if(EXISTS ${CMAKE_SOURCE_DIR}/newview/res/have_artwork_bundle.marker)
-    message(STATUS "We seem to have an artwork bundle in the tree - brilliant.")
-  else(EXISTS ${CMAKE_SOURCE_DIR}/newview/res/have_artwork_bundle.marker)
-    message(FATAL_ERROR "Didn't find an artwork bundle - this needs to be downloaded separately and unpacked into this tree.  You can probably get it from the same place you got your viewer source.  Thanks!")
-  endif(EXISTS ${CMAKE_SOURCE_DIR}/newview/res/have_artwork_bundle.marker)
-endif(VIEWER AND NOT STANDALONE)
diff --git a/indra/llcharacter/llcharacter.cpp b/indra/llcharacter/llcharacter.cpp
index c9fb8534f189e93b3170e8fdc718a8f7b48ce76d..0a6a8f9fa6b4a095d404085ed4900264c0aa32d1 100644
--- a/indra/llcharacter/llcharacter.cpp
+++ b/indra/llcharacter/llcharacter.cpp
@@ -189,6 +189,7 @@ void LLCharacter::requestStopMotion( LLMotion* motion)
 //-----------------------------------------------------------------------------
 static LLFastTimer::DeclareTimer FTM_UPDATE_ANIMATION("Update Animation");
 static LLFastTimer::DeclareTimer FTM_UPDATE_HIDDEN_ANIMATION("Update Hidden Anim");
+static LLFastTimer::DeclareTimer FTM_UPDATE_MOTIONS("Update Motions");
 
 void LLCharacter::updateMotions(e_update_t update_type)
 {
@@ -206,7 +207,10 @@ void LLCharacter::updateMotions(e_update_t update_type)
 			mMotionController.unpauseAllMotions();
 		}
 		bool force_update = (update_type == FORCE_UPDATE);
-		mMotionController.updateMotions(force_update);
+		{
+			LLFastTimer t(FTM_UPDATE_MOTIONS);
+			mMotionController.updateMotions(force_update);
+		}
 	}
 }
 
diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp
index bb892f4a7f18555d81f6b9b54ccb5662f31ed9cf..4f6351709ede6eb70ddc24df82aaaa17fcaa8ba6 100644
--- a/indra/llcharacter/llmotioncontroller.cpp
+++ b/indra/llcharacter/llmotioncontroller.cpp
@@ -542,6 +542,8 @@ void LLMotionController::updateIdleActiveMotions()
 //-----------------------------------------------------------------------------
 // updateMotionsByType()
 //-----------------------------------------------------------------------------
+static LLFastTimer::DeclareTimer FTM_MOTION_ON_UPDATE("Motion onUpdate");
+
 void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_type)
 {
 	BOOL update_result = TRUE;
@@ -699,7 +701,10 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty
 			}
 
 			// perform motion update
-			update_result = motionp->onUpdate(mAnimTime - motionp->mActivationTimestamp, last_joint_signature);
+			{
+				LLFastTimer t(FTM_MOTION_ON_UPDATE);
+				update_result = motionp->onUpdate(mAnimTime - motionp->mActivationTimestamp, last_joint_signature);
+			}
 		}
 
 		//**********************
@@ -810,7 +815,7 @@ void LLMotionController::updateMotions(bool force_update)
 
 	// Always cap the number of loaded motions
 	purgeExcessMotions();
-	
+		
 	// Update timing info for this time step.
 	if (!mPaused)
 	{
@@ -832,6 +837,7 @@ void LLMotionController::updateMotions(bool force_update)
 				}
 
 				updateLoadingMotions();
+				
 				return;
 			}
 			
@@ -850,7 +856,7 @@ void LLMotionController::updateMotions(bool force_update)
 	}
 
 	updateLoadingMotions();
-
+	
 	resetJointSignatures();
 
 	if (mPaused && !force_update)
@@ -861,11 +867,12 @@ void LLMotionController::updateMotions(bool force_update)
 	{
 		// update additive motions
 		updateAdditiveMotions();
+				
 		resetJointSignatures();
-
+		
 		// update all regular motions
 		updateRegularMotions();
-
+		
 		if (use_quantum)
 		{
 			mPoseBlender.blendAndCache(TRUE);
diff --git a/indra/llcommon/llallocator.cpp b/indra/llcommon/llallocator.cpp
index 6f6abefc67cc1ff74c04d4e05a8ed920dc13a4cf..87654b5b97dc7b6bbab4c65aa25355f19cb41d40 100644
--- a/indra/llcommon/llallocator.cpp
+++ b/indra/llcommon/llallocator.cpp
@@ -27,7 +27,7 @@
 #include "linden_common.h"
 #include "llallocator.h"
 
-#if LL_USE_TCMALLOC
+#if (LL_USE_TCMALLOC && LL_USE_HEAP_PROFILER)
 
 #include "google/heap-profiler.h"
 #include "google/commandlineflags_public.h"
diff --git a/indra/llcommon/llcursortypes.cpp b/indra/llcommon/llcursortypes.cpp
index e987c397bdf4e1b850ed6f3fac822fc16e9790df..ec60097195b64b3e00b5fe37e215c3a7a934e170 100644
--- a/indra/llcommon/llcursortypes.cpp
+++ b/indra/llcommon/llcursortypes.cpp
@@ -69,6 +69,12 @@ ECursorType getCursorFromString(const std::string& cursor_string)
 		cursor_string_table["UI_CURSOR_TOOLSIT"] = UI_CURSOR_TOOLSIT;
 		cursor_string_table["UI_CURSOR_TOOLBUY"] = UI_CURSOR_TOOLBUY;
 		cursor_string_table["UI_CURSOR_TOOLOPEN"] = UI_CURSOR_TOOLOPEN;
+		cursor_string_table["UI_CURSOR_TOOLPATHFINDING"] = UI_CURSOR_TOOLPATHFINDING;
+		cursor_string_table["UI_CURSOR_TOOLPATHFINDINGPATHSTART"] = UI_CURSOR_TOOLPATHFINDING_PATH_START;
+		cursor_string_table["UI_CURSOR_TOOLPATHFINDINGPATHSTARTADD"] = UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD;
+		cursor_string_table["UI_CURSOR_TOOLPATHFINDINGPATHEND"] = UI_CURSOR_TOOLPATHFINDING_PATH_END;
+		cursor_string_table["UI_CURSOR_TOOLPATHFINDINGPATHENDADD"] = UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD;
+		cursor_string_table["UI_CURSOR_TOOLNO"] = UI_CURSOR_TOOLNO;
 	}
 
 	std::map<std::string,U32>::const_iterator iter = cursor_string_table.find(cursor_string);
diff --git a/indra/llcommon/llcursortypes.h b/indra/llcommon/llcursortypes.h
index bacb0a80ba41e1e86271a84313d66c52da563989..cb6d6636a0f9307d4e6764338fd9260c0053e76f 100644
--- a/indra/llcommon/llcursortypes.h
+++ b/indra/llcommon/llcursortypes.h
@@ -65,6 +65,12 @@ enum ECursorType {
 	UI_CURSOR_TOOLSIT,
 	UI_CURSOR_TOOLBUY,
 	UI_CURSOR_TOOLOPEN,
+	UI_CURSOR_TOOLPATHFINDING,
+	UI_CURSOR_TOOLPATHFINDING_PATH_START,
+	UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD,
+	UI_CURSOR_TOOLPATHFINDING_PATH_END,
+	UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD,
+	UI_CURSOR_TOOLNO,
 	UI_CURSOR_COUNT			// Number of elements in this enum (NOT a cursor)
 };
 
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp
index 7e6eee0f3ccc679cc87fcddc140c5bff02f2cda7..9b0141eb76717dc363d90010f46577db8146766b 100644
--- a/indra/llcommon/llerror.cpp
+++ b/indra/llcommon/llerror.cpp
@@ -534,7 +534,7 @@ namespace
 	}
 	
 	
-	void commonInit(const std::string& dir)
+	void commonInit(const std::string& dir, bool log_to_stderr = true)
 	{
 		LLError::Settings::reset();
 		
@@ -542,7 +542,8 @@ namespace
 		LLError::setFatalFunction(LLError::crashAndLoop);
 		LLError::setTimeFunction(LLError::utcTime);
 
-		if (shouldLogToStderr())
+		// log_to_stderr is only false in the unit and integration tests to keep builds quieter
+		if (log_to_stderr && shouldLogToStderr())
 		{
 			LLError::addRecorder(new RecordToStderr(stderrLogWantsTime()));
 		}
@@ -580,9 +581,9 @@ namespace LLError
 #endif
 	}
 
-	void initForApplication(const std::string& dir)
+	void initForApplication(const std::string& dir, bool log_to_stderr)
 	{
-		commonInit(dir);
+		commonInit(dir, log_to_stderr);
 	}
 
 	void setPrintLocation(bool print)
diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h
index b3e604f8e83f177c6a2285c524fea201b7e30bbb..b65b4101531fb6d42be69dfe6ec4315f0f48acc9 100644
--- a/indra/llcommon/llerror.h
+++ b/indra/llcommon/llerror.h
@@ -35,7 +35,7 @@
 #include "stdtypes.h"
 
 
-/* Error Logging Facility
+/** Error Logging Facility
 
 	Information for most users:
 	
@@ -100,7 +100,6 @@
 	even release.  Which means you can use them to help debug even when deployed
 	to a real grid.
 */
-
 namespace LLError
 {
 	enum ELevel
@@ -143,9 +142,13 @@ namespace LLError
 		CallSite(ELevel, const char* file, int line,
 				const std::type_info& class_info, const char* function, const char* broadTag, const char* narrowTag, bool printOnce);
 						
+#ifdef LL_LIBRARY_INCLUDE
+		bool shouldLog();
+#else // LL_LIBRARY_INCLUDE
 		bool shouldLog()
 			{ return mCached ? mShouldLog : Log::shouldLog(*this); }
 			// this member function needs to be in-line for efficiency
+#endif // LL_LIBRARY_INCLUDE
 		
 		void invalidate();
 		
diff --git a/indra/llcommon/llerrorcontrol.h b/indra/llcommon/llerrorcontrol.h
index d53a819d88359801fc35f29f389dc961b2b77743..480654b1a2b433d1ec07bce8c82a50d9155da901 100644
--- a/indra/llcommon/llerrorcontrol.h
+++ b/indra/llcommon/llerrorcontrol.h
@@ -62,7 +62,7 @@ namespace LLError
 		// logs to stderr, syslog, and windows debug log
 		// the identity string is used for in the syslog
 
-	LL_COMMON_API void initForApplication(const std::string& dir);
+	LL_COMMON_API void initForApplication(const std::string& dir, bool log_to_stderr = true);
 		// resets all logging settings to defaults needed by applicaitons
 		// logs to stderr and windows debug log
 		// sets up log configuration from the file logcontrol.xml in dir
diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp
index 3b9758f996a9f07e71b34f3e2f038782dc7d7554..afaf36666876aac84354637155364afd3f355e4d 100644
--- a/indra/llcommon/llmemory.cpp
+++ b/indra/llcommon/llmemory.cpp
@@ -61,6 +61,18 @@ BOOL LLMemory::sEnableMemoryFailurePrevention = FALSE;
 LLPrivateMemoryPoolManager::mem_allocation_info_t LLPrivateMemoryPoolManager::sMemAllocationTracker;
 #endif
 
+void ll_assert_aligned_func(uintptr_t ptr,U32 alignment)
+{
+#ifdef SHOW_ASSERT
+	// Redundant, place to set breakpoints.
+	if (ptr%alignment!=0)
+	{
+		llwarns << "alignment check failed" << llendl;
+	}
+	llassert(ptr%alignment==0);
+#endif
+}
+
 //static
 void LLMemory::initClass()
 {
diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h
index bbbdaa6497fc951d41cb3b2596f0258d5ad8a9df..9dd776ff57922271068e38ebd2ac82cafd537f23 100644
--- a/indra/llcommon/llmemory.h
+++ b/indra/llcommon/llmemory.h
@@ -27,7 +27,6 @@
 #define LLMEMORY_H
 
 #include "llmemtype.h"
-#if LL_DEBUG
 inline void* ll_aligned_malloc( size_t size, int align )
 {
 	void* mem = malloc( size + (align - 1) + sizeof(void*) );
@@ -43,10 +42,11 @@ inline void ll_aligned_free( void* ptr )
 	free( ((void**)ptr)[-1] );
 }
 
+#if !LL_USE_TCMALLOC
 inline void* ll_aligned_malloc_16(size_t size) // returned hunk MUST be freed with ll_aligned_free_16().
 {
 #if defined(LL_WINDOWS)
-	return _mm_malloc(size, 16);
+	return _aligned_malloc(size, 16);
 #elif defined(LL_DARWIN)
 	return malloc(size); // default osx malloc is 16 byte aligned.
 #else
@@ -58,21 +58,38 @@ inline void* ll_aligned_malloc_16(size_t size) // returned hunk MUST be freed wi
 #endif
 }
 
+inline void* ll_aligned_realloc_16(void* ptr, size_t size) // returned hunk MUST be freed with ll_aligned_free_16().
+{
+#if defined(LL_WINDOWS)
+	return _aligned_realloc(ptr, size, 16);
+#elif defined(LL_DARWIN)
+	return realloc(ptr,size); // default osx malloc is 16 byte aligned.
+#else
+	return realloc(ptr,size); // FIXME not guaranteed to be aligned.
+#endif
+}
+
 inline void ll_aligned_free_16(void *p)
 {
 #if defined(LL_WINDOWS)
-	_mm_free(p);
+	_aligned_free(p);
 #elif defined(LL_DARWIN)
 	return free(p);
 #else
 	free(p); // posix_memalign() is compatible with heap deallocator
 #endif
 }
+#else // USE_TCMALLOC
+// ll_aligned_foo_16 are not needed with tcmalloc
+#define ll_aligned_malloc_16 malloc
+#define ll_aligned_realloc_16 realloc
+#define ll_aligned_free_16 free
+#endif // USE_TCMALLOC
 
 inline void* ll_aligned_malloc_32(size_t size) // returned hunk MUST be freed with ll_aligned_free_32().
 {
 #if defined(LL_WINDOWS)
-	return _mm_malloc(size, 32);
+	return _aligned_malloc(size, 32);
 #elif defined(LL_DARWIN)
 	return ll_aligned_malloc( size, 32 );
 #else
@@ -87,22 +104,13 @@ inline void* ll_aligned_malloc_32(size_t size) // returned hunk MUST be freed wi
 inline void ll_aligned_free_32(void *p)
 {
 #if defined(LL_WINDOWS)
-	_mm_free(p);
+	_aligned_free(p);
 #elif defined(LL_DARWIN)
 	ll_aligned_free( p );
 #else
 	free(p); // posix_memalign() is compatible with heap deallocator
 #endif
 }
-#else // LL_DEBUG
-// ll_aligned_foo are noops now that we use tcmalloc everywhere (tcmalloc aligns automatically at appropriate intervals)
-#define ll_aligned_malloc( size, align ) malloc(size)
-#define ll_aligned_free( ptr ) free(ptr)
-#define ll_aligned_malloc_16 malloc
-#define ll_aligned_free_16 free
-#define ll_aligned_malloc_32 malloc
-#define ll_aligned_free_32 free
-#endif // LL_DEBUG
 
 #ifndef __DEBUG_PRIVATE_MEM__
 #define __DEBUG_PRIVATE_MEM__  0
@@ -512,4 +520,13 @@ void  LLPrivateMemoryPoolTester::operator delete[](void* addr)
 
 // LLSingleton moved to llsingleton.h
 
+LL_COMMON_API void ll_assert_aligned_func(uintptr_t ptr,U32 alignment);
+
+#ifdef SHOW_ASSERT
+#define ll_assert_aligned(ptr,alignment) ll_assert_aligned_func(reinterpret_cast<uintptr_t>(ptr),((U32)alignment))
+#else
+#define ll_assert_aligned(ptr,alignment)
+#endif
+
+
 #endif
diff --git a/indra/llcommon/llpointer.h b/indra/llcommon/llpointer.h
index affa0406025d50bc2147229a9b6ab62198361eb6..88c09c8dca83b606167be45e79728e6d78780ba4 100644
--- a/indra/llcommon/llpointer.h
+++ b/indra/llcommon/llpointer.h
@@ -140,6 +140,10 @@ template <class Type> class LLPointer
 	}
 
 protected:
+#ifdef LL_LIBRARY_INCLUDE
+	void ref();                             
+	void unref();
+#else
 	void ref()                             
 	{ 
 		if (mPointer)
@@ -162,7 +166,7 @@ template <class Type> class LLPointer
 			}
 		}
 	}
-
+#endif
 protected:
 	Type*	mPointer;
 };
diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp
index b419101b7e59b9c9adee29b12e12187381cb7867..7f4f670ed0fdd85173995095d42e217a32c6b3ef 100644
--- a/indra/llcommon/llsdserialize.cpp
+++ b/indra/llcommon/llsdserialize.cpp
@@ -55,6 +55,10 @@ static const char LEGACY_NON_HEADER[] = "<llsd>";
 const std::string LLSD_BINARY_HEADER("LLSD/Binary");
 const std::string LLSD_XML_HEADER("LLSD/XML");
 
+//used to deflate a gzipped asset (currently used for navmeshes)
+#define windowBits 15
+#define ENABLE_ZLIB_GZIP 32
+
 /**
  * LLSDSerialize
  */
@@ -2096,7 +2100,7 @@ bool unzip_llsd(LLSD& data, std::istream& is, S32 size)
 	strm.next_in = in;
 
 	S32 ret = inflateInit(&strm);
-
+	
 	do
 	{
 		strm.avail_out = CHUNK;
@@ -2159,12 +2163,87 @@ bool unzip_llsd(LLSD& data, std::istream& is, S32 size)
 			llwarns << "Failed to unzip LLSD block" << llendl;
 			free(result);
 			return false;
-		}
+		}		
 	}
 
 	free(result);
 	return true;
 }
+//This unzip function will only work with a gzip header and trailer - while the contents
+//of the actual compressed data is the same for either format (gzip vs zlib ), the headers
+//and trailers are different for the formats.
+U8* unzip_llsdNavMesh( bool& valid, unsigned int& outsize, std::istream& is, S32 size )
+{
+	U8* result = NULL;
+	U32 cur_size = 0;
+	z_stream strm;
+		
+	const U32 CHUNK = 0x4000;
 
+	U8 *in = new U8[size];
+	is.read((char*) in, size); 
+
+	U8 out[CHUNK];
+		
+	strm.zalloc = Z_NULL;
+	strm.zfree = Z_NULL;
+	strm.opaque = Z_NULL;
+	strm.avail_in = size;
+	strm.next_in = in;
+
+	
+	S32 ret = inflateInit2(&strm,  windowBits | ENABLE_ZLIB_GZIP );
+	do
+	{
+		strm.avail_out = CHUNK;
+		strm.next_out = out;
+		ret = inflate(&strm, Z_NO_FLUSH);
+		if (ret == Z_STREAM_ERROR)
+		{
+			inflateEnd(&strm);
+			free(result);
+			delete [] in;
+			valid = false;
+		}
+		
+		switch (ret)
+		{
+		case Z_NEED_DICT:
+			ret = Z_DATA_ERROR;
+		case Z_DATA_ERROR:
+		case Z_MEM_ERROR:
+			inflateEnd(&strm);
+			free(result);
+			delete [] in;
+			valid = false;
+			break;
+		}
+
+		U32 have = CHUNK-strm.avail_out;
+
+		result = (U8*) realloc(result, cur_size + have);
+		memcpy(result+cur_size, out, have);
+		cur_size += have;
+
+	} while (ret == Z_OK);
+
+	inflateEnd(&strm);
+	delete [] in;
+
+	if (ret != Z_STREAM_END)
+	{
+		free(result);
+		valid = false;
+		return NULL;
+	}
+
+	//result now points to the decompressed LLSD block
+	{
+		outsize= cur_size;
+		valid = true;		
+	}
+
+	return result;
+}
 
 
diff --git a/indra/llcommon/llsdserialize.h b/indra/llcommon/llsdserialize.h
index 99a3ea3cd48c77f9970f35198c06b7975187fa65..86e3fc864c065a694e8003dcc6a8d272b2f4b43b 100644
--- a/indra/llcommon/llsdserialize.h
+++ b/indra/llcommon/llsdserialize.h
@@ -793,5 +793,5 @@ class LL_COMMON_API LLSDSerialize
 //dirty little zip functions -- yell at davep
 LL_COMMON_API std::string zip_llsd(LLSD& data);
 LL_COMMON_API bool unzip_llsd(LLSD& data, std::istream& is, S32 size);
-
+LL_COMMON_API U8* unzip_llsdNavMesh( bool& valid, unsigned int& outsize,std::istream& is, S32 size);
 #endif // LL_LLSDSERIALIZE_H
diff --git a/indra/llcommon/llstatenums.h b/indra/llcommon/llstatenums.h
index 9033d8eb43c9af57a5bc72ab4ffb67c828673767..81c4085d16829a5f73f640e787e20cf46d58b319 100644
--- a/indra/llcommon/llstatenums.h
+++ b/indra/llcommon/llstatenums.h
@@ -28,41 +28,48 @@
 
 enum
 {
-	LL_SIM_STAT_TIME_DILATION,				// 0
-	LL_SIM_STAT_FPS,
-	LL_SIM_STAT_PHYSFPS,
-	LL_SIM_STAT_AGENTUPS,
-	LL_SIM_STAT_FRAMEMS,
-	LL_SIM_STAT_NETMS,						// 5
-	LL_SIM_STAT_SIMOTHERMS,
-	LL_SIM_STAT_SIMPHYSICSMS,
-	LL_SIM_STAT_AGENTMS,
-	LL_SIM_STAT_IMAGESMS,
-	LL_SIM_STAT_SCRIPTMS,					// 10
-	LL_SIM_STAT_NUMTASKS,
-	LL_SIM_STAT_NUMTASKSACTIVE,
-	LL_SIM_STAT_NUMAGENTMAIN,
-	LL_SIM_STAT_NUMAGENTCHILD,
-	LL_SIM_STAT_NUMSCRIPTSACTIVE,			// 15
-	LL_SIM_STAT_LSLIPS,
-	LL_SIM_STAT_INPPS,
-	LL_SIM_STAT_OUTPPS,
-	LL_SIM_STAT_PENDING_DOWNLOADS,
-	LL_SIM_STAT_PENDING_UPLOADS,			// 20
-	LL_SIM_STAT_VIRTUAL_SIZE_KB,
-	LL_SIM_STAT_RESIDENT_SIZE_KB,
-	LL_SIM_STAT_PENDING_LOCAL_UPLOADS,
-	LL_SIM_STAT_TOTAL_UNACKED_BYTES,
-	LL_SIM_STAT_PHYSICS_PINNED_TASKS,		// 25
-	LL_SIM_STAT_PHYSICS_LOD_TASKS,
-	LL_SIM_STAT_SIMPHYSICSSTEPMS,
-	LL_SIM_STAT_SIMPHYSICSSHAPEMS,
-	LL_SIM_STAT_SIMPHYSICSOTHERMS,
-	LL_SIM_STAT_SIMPHYSICSMEMORY,			// 30
-	LL_SIM_STAT_SCRIPT_EPS,
-	LL_SIM_STAT_SIMSPARETIME,
-	LL_SIM_STAT_SIMSLEEPTIME,
-	LL_SIM_STAT_IOPUMPTIME,
+	LL_SIM_STAT_TIME_DILATION         =  0,
+	LL_SIM_STAT_FPS                   =  1,
+	LL_SIM_STAT_PHYSFPS               =  2,
+	LL_SIM_STAT_AGENTUPS              =  3,
+	LL_SIM_STAT_FRAMEMS               =  4,
+	LL_SIM_STAT_NETMS                 =  5,
+	LL_SIM_STAT_SIMOTHERMS            =  6,
+	LL_SIM_STAT_SIMPHYSICSMS          =  7,
+	LL_SIM_STAT_AGENTMS               =  8,
+	LL_SIM_STAT_IMAGESMS              =  9,
+	LL_SIM_STAT_SCRIPTMS              = 10,
+	LL_SIM_STAT_NUMTASKS              = 11,
+	LL_SIM_STAT_NUMTASKSACTIVE        = 12,
+	LL_SIM_STAT_NUMAGENTMAIN          = 13,
+	LL_SIM_STAT_NUMAGENTCHILD         = 14,
+	LL_SIM_STAT_NUMSCRIPTSACTIVE      = 15,
+	LL_SIM_STAT_LSLIPS                = 16,
+	LL_SIM_STAT_INPPS                 = 17,
+	LL_SIM_STAT_OUTPPS                = 18,
+	LL_SIM_STAT_PENDING_DOWNLOADS     = 19,
+	LL_SIM_STAT_PENDING_UPLOADS       = 20,
+	LL_SIM_STAT_VIRTUAL_SIZE_KB       = 21,
+	LL_SIM_STAT_RESIDENT_SIZE_KB      = 22,
+	LL_SIM_STAT_PENDING_LOCAL_UPLOADS = 23,
+	LL_SIM_STAT_TOTAL_UNACKED_BYTES   = 24,
+	LL_SIM_STAT_PHYSICS_PINNED_TASKS  = 25,
+	LL_SIM_STAT_PHYSICS_LOD_TASKS     = 26,
+	LL_SIM_STAT_SIMPHYSICSSTEPMS      = 27,
+	LL_SIM_STAT_SIMPHYSICSSHAPEMS     = 28,
+	LL_SIM_STAT_SIMPHYSICSOTHERMS     = 29,
+	LL_SIM_STAT_SIMPHYSICSMEMORY      = 30,
+	LL_SIM_STAT_SCRIPT_EPS            = 31,
+	LL_SIM_STAT_SIMSPARETIME          = 32,
+	LL_SIM_STAT_SIMSLEEPTIME          = 33,
+	LL_SIM_STAT_IOPUMPTIME            = 34,
+	LL_SIM_STAT_PCTSCRIPTSRUN         = 35,
+	LL_SIM_STAT_REGION_IDLE           = 36, // dataserver only
+	LL_SIM_STAT_REGION_IDLE_POSSIBLE  = 37, // dataserver only
+	LL_SIM_STAT_SIMAISTEPTIMEMS       = 38,
+	LL_SIM_STAT_SKIPPEDAISILSTEPS_PS  = 39,
+	LL_SIM_STAT_PCTSTEPPEDCHARACTERS  = 40
+
 };
 
 #endif
diff --git a/indra/llcommon/lluuid.cpp b/indra/llcommon/lluuid.cpp
index 5d452ac4e44c03675e37ff2d681f1c741280dc79..db8c9c85ab52f742c5bb9131589ca42045c85e3b 100644
--- a/indra/llcommon/lluuid.cpp
+++ b/indra/llcommon/lluuid.cpp
@@ -922,3 +922,174 @@ LLAssetID LLTransactionID::makeAssetID(const LLUUID& session) const
 	}
 	return result;
 }
+
+// Construct
+LLUUID::LLUUID()
+{
+	setNull();
+}
+
+
+// Faster than copying from memory
+ void LLUUID::setNull()
+{
+	U32 *word = (U32 *)mData;
+	word[0] = 0;
+	word[1] = 0;
+	word[2] = 0;
+	word[3] = 0;
+}
+
+
+// Compare
+ bool LLUUID::operator==(const LLUUID& rhs) const
+{
+	U32 *tmp = (U32 *)mData;
+	U32 *rhstmp = (U32 *)rhs.mData;
+	// Note: binary & to avoid branching
+	return 
+		(tmp[0] == rhstmp[0]) &  
+		(tmp[1] == rhstmp[1]) &
+		(tmp[2] == rhstmp[2]) &
+		(tmp[3] == rhstmp[3]);
+}
+
+
+ bool LLUUID::operator!=(const LLUUID& rhs) const
+{
+	U32 *tmp = (U32 *)mData;
+	U32 *rhstmp = (U32 *)rhs.mData;
+	// Note: binary | to avoid branching
+	return 
+		(tmp[0] != rhstmp[0]) |
+		(tmp[1] != rhstmp[1]) |
+		(tmp[2] != rhstmp[2]) |
+		(tmp[3] != rhstmp[3]);
+}
+
+/*
+// JC: This is dangerous.  It allows UUIDs to be cast automatically
+// to integers, among other things.  Use isNull() or notNull().
+ LLUUID::operator bool() const
+{
+	U32 *word = (U32 *)mData;
+	return (word[0] | word[1] | word[2] | word[3]) > 0;
+}
+*/
+
+ BOOL LLUUID::notNull() const
+{
+	U32 *word = (U32 *)mData;
+	return (word[0] | word[1] | word[2] | word[3]) > 0;
+}
+
+// Faster than == LLUUID::null because doesn't require
+// as much memory access.
+ BOOL LLUUID::isNull() const
+{
+	U32 *word = (U32 *)mData;
+	// If all bits are zero, return !0 == TRUE
+	return !(word[0] | word[1] | word[2] | word[3]);
+}
+
+// Copy constructor
+ LLUUID::LLUUID(const LLUUID& rhs)
+{
+	U32 *tmp = (U32 *)mData;
+	U32 *rhstmp = (U32 *)rhs.mData;
+	tmp[0] = rhstmp[0];
+	tmp[1] = rhstmp[1];
+	tmp[2] = rhstmp[2];
+	tmp[3] = rhstmp[3];
+}
+
+ LLUUID::~LLUUID()
+{
+}
+
+// Assignment
+ LLUUID& LLUUID::operator=(const LLUUID& rhs)
+{
+	// No need to check the case where this==&rhs.  The branch is slower than the write.
+	U32 *tmp = (U32 *)mData;
+	U32 *rhstmp = (U32 *)rhs.mData;
+	tmp[0] = rhstmp[0];
+	tmp[1] = rhstmp[1];
+	tmp[2] = rhstmp[2];
+	tmp[3] = rhstmp[3];
+	
+	return *this;
+}
+
+
+ LLUUID::LLUUID(const char *in_string)
+{
+	if (!in_string || in_string[0] == 0)
+	{
+		setNull();
+		return;
+	}
+ 
+	set(in_string);
+}
+
+ LLUUID::LLUUID(const std::string& in_string)
+{
+	if (in_string.empty())
+	{
+		setNull();
+		return;
+	}
+
+	set(in_string);
+}
+
+// IW: DON'T "optimize" these w/ U32s or you'll scoogie the sort order
+// IW: this will make me very sad
+ bool LLUUID::operator<(const LLUUID &rhs) const
+{
+	U32 i;
+	for( i = 0; i < (UUID_BYTES - 1); i++ )
+	{
+		if( mData[i] != rhs.mData[i] )
+		{
+			return (mData[i] < rhs.mData[i]);
+		}
+	}
+	return (mData[UUID_BYTES - 1] < rhs.mData[UUID_BYTES - 1]);
+}
+
+ bool LLUUID::operator>(const LLUUID &rhs) const
+{
+	U32 i;
+	for( i = 0; i < (UUID_BYTES - 1); i++ )
+	{
+		if( mData[i] != rhs.mData[i] )
+		{
+			return (mData[i] > rhs.mData[i]);
+		}
+	}
+	return (mData[UUID_BYTES - 1] > rhs.mData[UUID_BYTES - 1]);
+}
+
+ U16 LLUUID::getCRC16() const
+{
+	// A UUID is 16 bytes, or 8 shorts.
+	U16 *short_data = (U16*)mData;
+	U16 out = 0;
+	out += short_data[0];
+	out += short_data[1];
+	out += short_data[2];
+	out += short_data[3];
+	out += short_data[4];
+	out += short_data[5];
+	out += short_data[6];
+	out += short_data[7];
+	return out;
+}
+
+ U32 LLUUID::getCRC32() const
+{
+	U32 *tmp = (U32*)mData;
+	return tmp[0] + tmp[1] + tmp[2] + tmp[3];
+}
diff --git a/indra/llcommon/lluuid.h b/indra/llcommon/lluuid.h
index 726be4a82da6697aa62186e8fd79f405a44dc379..0b9e7d0cd024a9eaffa14af49753c353cf55e29a 100644
--- a/indra/llcommon/lluuid.h
+++ b/indra/llcommon/lluuid.h
@@ -129,177 +129,6 @@ class LL_COMMON_API LLUUID
 
 typedef std::vector<LLUUID> uuid_vec_t;
 
-// Construct
-inline LLUUID::LLUUID()
-{
-	setNull();
-}
-
-
-// Faster than copying from memory
-inline void LLUUID::setNull()
-{
-	U32 *word = (U32 *)mData;
-	word[0] = 0;
-	word[1] = 0;
-	word[2] = 0;
-	word[3] = 0;
-}
-
-
-// Compare
-inline bool LLUUID::operator==(const LLUUID& rhs) const
-{
-	U32 *tmp = (U32 *)mData;
-	U32 *rhstmp = (U32 *)rhs.mData;
-	// Note: binary & to avoid branching
-	return 
-		(tmp[0] == rhstmp[0]) &  
-		(tmp[1] == rhstmp[1]) &
-		(tmp[2] == rhstmp[2]) &
-		(tmp[3] == rhstmp[3]);
-}
-
-
-inline bool LLUUID::operator!=(const LLUUID& rhs) const
-{
-	U32 *tmp = (U32 *)mData;
-	U32 *rhstmp = (U32 *)rhs.mData;
-	// Note: binary | to avoid branching
-	return 
-		(tmp[0] != rhstmp[0]) |
-		(tmp[1] != rhstmp[1]) |
-		(tmp[2] != rhstmp[2]) |
-		(tmp[3] != rhstmp[3]);
-}
-
-/*
-// JC: This is dangerous.  It allows UUIDs to be cast automatically
-// to integers, among other things.  Use isNull() or notNull().
-inline LLUUID::operator bool() const
-{
-	U32 *word = (U32 *)mData;
-	return (word[0] | word[1] | word[2] | word[3]) > 0;
-}
-*/
-
-inline BOOL LLUUID::notNull() const
-{
-	U32 *word = (U32 *)mData;
-	return (word[0] | word[1] | word[2] | word[3]) > 0;
-}
-
-// Faster than == LLUUID::null because doesn't require
-// as much memory access.
-inline BOOL LLUUID::isNull() const
-{
-	U32 *word = (U32 *)mData;
-	// If all bits are zero, return !0 == TRUE
-	return !(word[0] | word[1] | word[2] | word[3]);
-}
-
-// Copy constructor
-inline LLUUID::LLUUID(const LLUUID& rhs)
-{
-	U32 *tmp = (U32 *)mData;
-	U32 *rhstmp = (U32 *)rhs.mData;
-	tmp[0] = rhstmp[0];
-	tmp[1] = rhstmp[1];
-	tmp[2] = rhstmp[2];
-	tmp[3] = rhstmp[3];
-}
-
-inline LLUUID::~LLUUID()
-{
-}
-
-// Assignment
-inline LLUUID& LLUUID::operator=(const LLUUID& rhs)
-{
-	// No need to check the case where this==&rhs.  The branch is slower than the write.
-	U32 *tmp = (U32 *)mData;
-	U32 *rhstmp = (U32 *)rhs.mData;
-	tmp[0] = rhstmp[0];
-	tmp[1] = rhstmp[1];
-	tmp[2] = rhstmp[2];
-	tmp[3] = rhstmp[3];
-	
-	return *this;
-}
-
-
-inline LLUUID::LLUUID(const char *in_string)
-{
-	if (!in_string || in_string[0] == 0)
-	{
-		setNull();
-		return;
-	}
- 
-	set(in_string);
-}
-
-inline LLUUID::LLUUID(const std::string& in_string)
-{
-	if (in_string.empty())
-	{
-		setNull();
-		return;
-	}
-
-	set(in_string);
-}
-
-// IW: DON'T "optimize" these w/ U32s or you'll scoogie the sort order
-// IW: this will make me very sad
-inline bool LLUUID::operator<(const LLUUID &rhs) const
-{
-	U32 i;
-	for( i = 0; i < (UUID_BYTES - 1); i++ )
-	{
-		if( mData[i] != rhs.mData[i] )
-		{
-			return (mData[i] < rhs.mData[i]);
-		}
-	}
-	return (mData[UUID_BYTES - 1] < rhs.mData[UUID_BYTES - 1]);
-}
-
-inline bool LLUUID::operator>(const LLUUID &rhs) const
-{
-	U32 i;
-	for( i = 0; i < (UUID_BYTES - 1); i++ )
-	{
-		if( mData[i] != rhs.mData[i] )
-		{
-			return (mData[i] > rhs.mData[i]);
-		}
-	}
-	return (mData[UUID_BYTES - 1] > rhs.mData[UUID_BYTES - 1]);
-}
-
-inline U16 LLUUID::getCRC16() const
-{
-	// A UUID is 16 bytes, or 8 shorts.
-	U16 *short_data = (U16*)mData;
-	U16 out = 0;
-	out += short_data[0];
-	out += short_data[1];
-	out += short_data[2];
-	out += short_data[3];
-	out += short_data[4];
-	out += short_data[5];
-	out += short_data[6];
-	out += short_data[7];
-	return out;
-}
-
-inline U32 LLUUID::getCRC32() const
-{
-	U32 *tmp = (U32*)mData;
-	return tmp[0] + tmp[1] + tmp[2] + tmp[3];
-}
-
 
 // Helper structure for ordering lluuids in stl containers.
 // eg: 	std::map<LLUUID, LLWidget*, lluuid_less> widget_map;
@@ -329,3 +158,5 @@ class LL_COMMON_API LLTransactionID : public LLUUID
 };
 
 #endif
+
+
diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index 22d0aba51b7c15abe4e4b67a2a3020951be3dffe..bcc661a920465ebc73b42fd1dad40c3875162ecd 100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
@@ -28,8 +28,8 @@
 #define LL_LLVERSIONVIEWER_H
 
 const S32 LL_VERSION_MAJOR = 3;
-const S32 LL_VERSION_MINOR = 3;
-const S32 LL_VERSION_PATCH = 4;
+const S32 LL_VERSION_MINOR = 4;
+const S32 LL_VERSION_PATCH = 1;
 const S32 LL_VERSION_BUILD = 0;
 
 const char * const LL_CHANNEL = "Second Life Developer";
diff --git a/indra/llmath/CMakeLists.txt b/indra/llmath/CMakeLists.txt
index b5e59c1ca350285bf9394089c41a2767820c0d8c..5865ae030c2cac900207fc5e221036488e3ee351 100644
--- a/indra/llmath/CMakeLists.txt
+++ b/indra/llmath/CMakeLists.txt
@@ -117,6 +117,7 @@ if (LL_TESTS)
   # INTEGRATION TESTS
   set(test_libs llmath llcommon ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES})
   # TODO: Some of these need refactoring to be proper Unit tests rather than Integration tests.
+  LL_ADD_INTEGRATION_TEST(alignment "" "${test_libs}")
   LL_ADD_INTEGRATION_TEST(llbbox llbbox.cpp "${test_libs}")
   LL_ADD_INTEGRATION_TEST(llquaternion llquaternion.cpp "${test_libs}")
   LL_ADD_INTEGRATION_TEST(mathmisc "" "${test_libs}")
diff --git a/indra/llmath/llcamera.h b/indra/llmath/llcamera.h
index ec67b91d05f0c14f7f5ad7f3c062a29e542e0143..0b591be622e453915809b3e557caeb04310a937c 100644
--- a/indra/llmath/llcamera.h
+++ b/indra/llmath/llcamera.h
@@ -60,7 +60,7 @@ static const F32 MAX_FIELD_OF_VIEW = 175.f * DEG_TO_RAD;
 // roll(), pitch(), yaw()
 // etc...
 
-
+LL_ALIGN_PREFIX(16)
 class LLCamera
 : 	public LLCoordFrame
 {
@@ -108,7 +108,7 @@ class LLCamera
 	};
 
 private:
-	LLPlane mAgentPlanes[7];  //frustum planes in agent space a la gluUnproject (I'm a bastard, I know) - DaveP
+	LL_ALIGN_16(LLPlane mAgentPlanes[7]);  //frustum planes in agent space a la gluUnproject (I'm a bastard, I know) - DaveP
 	U8 mPlaneMask[8];         // 8 for alignment	
 	
 	F32 mView;					// angle between top and bottom frustum planes in radians.
@@ -116,13 +116,13 @@ class LLCamera
 	S32 mViewHeightInPixels;	// for ViewHeightInPixels() only
 	F32 mNearPlane;
 	F32 mFarPlane;
-	LLPlane mLocalPlanes[4];
+	LL_ALIGN_16(LLPlane mLocalPlanes[4]);
 	F32 mFixedDistance;			// Always return this distance, unless < 0
 	LLVector3 mFrustCenter;		// center of frustum and radius squared for ultra-quick exclusion test
 	F32 mFrustRadiusSquared;
 	
-	LLPlane mWorldPlanes[PLANE_NUM];
-	LLPlane mHorizPlanes[HORIZ_PLANE_NUM];
+	LL_ALIGN_16(LLPlane mWorldPlanes[PLANE_NUM]);
+	LL_ALIGN_16(LLPlane mHorizPlanes[HORIZ_PLANE_NUM]);
 
 	U32 mPlaneCount;  //defaults to 6, if setUserClipPlane is called, uses user supplied clip plane in
 
@@ -208,7 +208,7 @@ class LLCamera
 	void calculateFrustumPlanes(F32 left, F32 right, F32 top, F32 bottom);
 	void calculateFrustumPlanesFromWindow(F32 x1, F32 y1, F32 x2, F32 y2);
 	void calculateWorldFrustumPlanes();
-};
+} LL_ALIGN_POSTFIX(16);
 
 
 #endif
diff --git a/indra/llmath/llmatrix3a.h b/indra/llmath/llmatrix3a.h
index adb7e3389d5e54e1fa7695ae6700fadad83dcfe2..9916cfd2daba816a0bef6b0123e1df3f4276bd27 100644
--- a/indra/llmath/llmatrix3a.h
+++ b/indra/llmath/llmatrix3a.h
@@ -111,7 +111,7 @@ class LLMatrix3a
 
 protected:
 
-	LLVector4a mColumns[3];
+	LL_ALIGN_16(LLVector4a mColumns[3]);
 
 };
 
diff --git a/indra/llmath/llmatrix4a.h b/indra/llmath/llmatrix4a.h
index 27cf5b79f648939809fb0f2ab35b473748138698..c4cefdb4fa74ad58203b7b6cb903aafb50d9c1e4 100644
--- a/indra/llmath/llmatrix4a.h
+++ b/indra/llmath/llmatrix4a.h
@@ -34,7 +34,7 @@
 class LLMatrix4a
 {
 public:
-	LLVector4a mMatrix[4];
+	LL_ALIGN_16(LLVector4a mMatrix[4]);
 
 	inline void clear()
 	{
diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h
index 1b11e83b4af369cd4119d19e81d79f486f90014d..c3f6f7de2a147dd12474ced4798aea07aacb7590 100644
--- a/indra/llmath/lloctree.h
+++ b/indra/llmath/lloctree.h
@@ -31,7 +31,6 @@
 #include "v3math.h"
 #include "llvector4a.h"
 #include <vector>
-#include <set>
 
 #define OCT_ERRS LL_WARNS("OctreeErrors")
 
@@ -79,16 +78,18 @@ class LLOctreeNode : public LLTreeNode<T>
 
 	typedef LLOctreeTraveler<T>									oct_traveler;
 	typedef LLTreeTraveler<T>									tree_traveler;
-	typedef typename std::set<LLPointer<T> >					element_list;
-	typedef typename element_list::iterator						element_iter;
-	typedef typename element_list::const_iterator	const_element_iter;
+	typedef LLPointer<T>*										element_list;
+	typedef LLPointer<T>*										element_iter;
+	typedef const LLPointer<T>*									const_element_iter;
 	typedef typename std::vector<LLTreeListener<T>*>::iterator	tree_listener_iter;
-	typedef typename std::vector<LLOctreeNode<T>* >				child_list;
+	typedef LLOctreeNode<T>**									child_list;
+	typedef LLOctreeNode<T>**									child_iter;
+
 	typedef LLTreeNode<T>		BaseType;
 	typedef LLOctreeNode<T>		oct_node;
 	typedef LLOctreeListener<T>	oct_listener;
 
-	/*void* operator new(size_t size)
+	void* operator new(size_t size)
 	{
 		return ll_aligned_malloc_16(size);
 	}
@@ -96,7 +97,7 @@ class LLOctreeNode : public LLTreeNode<T>
 	void operator delete(void* ptr)
 	{
 		ll_aligned_free_16(ptr);
-	}*/
+	}
 
 	LLOctreeNode(	const LLVector4a& center, 
 					const LLVector4a& size, 
@@ -105,6 +106,9 @@ class LLOctreeNode : public LLTreeNode<T>
 	:	mParent((oct_node*)parent), 
 		mOctant(octant) 
 	{ 
+		mData = NULL;
+		mDataEnd = NULL;
+
 		mCenter = center;
 		mSize = size;
 
@@ -123,6 +127,16 @@ class LLOctreeNode : public LLTreeNode<T>
 	{ 
 		BaseType::destroyListeners(); 
 		
+		for (U32 i = 0; i < mElementCount; ++i)
+		{
+			mData[i]->setBinIndex(-1);
+			mData[i] = NULL;
+		}
+
+		free(mData);
+		mData = NULL;
+		mDataEnd = NULL;
+
 		for (U32 i = 0; i < getChildCount(); i++)
 		{
 			delete getChild(i);
@@ -219,12 +233,17 @@ class LLOctreeNode : public LLTreeNode<T>
 	}
 
 	void accept(oct_traveler* visitor)				{ visitor->visit(this); }
-	virtual bool isLeaf() const						{ return mChild.empty(); }
+	virtual bool isLeaf() const						{ return mChildCount == 0; }
 	
 	U32 getElementCount() const						{ return mElementCount; }
+	bool isEmpty() const							{ return mElementCount == 0; }
 	element_list& getData()							{ return mData; }
 	const element_list& getData() const				{ return mData; }
-	
+	element_iter getDataBegin()						{ return mData; }
+	element_iter getDataEnd()						{ return mDataEnd; }
+	const_element_iter getDataBegin() const			{ return mData; }
+	const_element_iter getDataEnd() const			{ return mDataEnd; }
+		
 	U32 getChildCount()	const						{ return mChildCount; }
 	oct_node* getChild(U32 index)					{ return mChild[index]; }
 	const oct_node* getChild(U32 index) const		{ return mChild[index]; }
@@ -289,7 +308,7 @@ class LLOctreeNode : public LLTreeNode<T>
 	
 	virtual bool insert(T* data)
 	{
-		if (data == NULL)
+		if (data == NULL || data->getBinIndex() != -1)
 		{
 			OCT_ERRS << "!!! INVALID ELEMENT ADDED TO OCTREE BRANCH !!!" << llendl;
 			return false;
@@ -302,13 +321,16 @@ class LLOctreeNode : public LLTreeNode<T>
 			if ((getElementCount() < gOctreeMaxCapacity && contains(data->getBinRadius()) ||
 				(data->getBinRadius() > getSize()[0] &&	parent && parent->getElementCount() >= gOctreeMaxCapacity))) 
 			{ //it belongs here
-				//if this is a redundant insertion, error out (should never happen)
-				llassert(mData.find(data) == mData.end());
+				mElementCount++;
+				mData = (element_list) realloc(mData, sizeof(LLPointer<T>)*mElementCount);
 
-				mData.insert(data);
-				BaseType::insert(data);
+				//avoid unref on uninitialized memory
+				memset(mData+mElementCount-1, 0, sizeof(LLPointer<T>));
 
-				mElementCount = mData.size();
+				mData[mElementCount-1] = data;
+				mDataEnd = mData + mElementCount;
+				data->setBinIndex(mElementCount-1);
+				BaseType::insert(data);
 				return true;
 			}
 			else
@@ -342,10 +364,16 @@ class LLOctreeNode : public LLTreeNode<T>
 
 				if( lt == 0x7 )
 				{
-					mData.insert(data);
-					BaseType::insert(data);
+					mElementCount++;
+					mData = (element_list) realloc(mData, sizeof(LLPointer<T>)*mElementCount);
+
+					//avoid unref on uninitialized memory
+					memset(mData+mElementCount-1, 0, sizeof(LLPointer<T>));
 
-					mElementCount = mData.size();
+					mData[mElementCount-1] = data;
+					mDataEnd = mData + mElementCount;
+					data->setBinIndex(mElementCount-1);
+					BaseType::insert(data);
 					return true;
 				}
 
@@ -394,23 +422,59 @@ class LLOctreeNode : public LLTreeNode<T>
 		return false;
 	}
 
+	void _remove(T* data, S32 i)
+	{ //precondition -- mElementCount > 0, idx is in range [0, mElementCount)
+
+		mElementCount--;
+		data->setBinIndex(-1); 
+		
+		if (mElementCount > 0)
+		{
+			if (mElementCount != i)
+			{
+				mData[i] = mData[mElementCount]; //might unref data, do not access data after this point
+				mData[i]->setBinIndex(i);
+			}
+
+			mData[mElementCount] = NULL; //needed for unref
+			mData = (element_list) realloc(mData, sizeof(LLPointer<T>)*mElementCount);
+			mDataEnd = mData+mElementCount;
+		}
+		else
+		{
+			mData[0] = NULL; //needed for unref
+			free(mData);
+			mData = NULL;
+			mDataEnd = NULL;
+		}
+
+		notifyRemoval(data);
+		checkAlive();
+	}
+
 	bool remove(T* data)
 	{
-		if (mData.find(data) != mData.end())
-		{	//we have data
-			mData.erase(data);
-			mElementCount = mData.size();
-			notifyRemoval(data);
-			checkAlive();
-			return true;
-		}
-		else if (isInside(data))
+		S32 i = data->getBinIndex();
+
+		if (i >= 0 && i < mElementCount)
+		{
+			if (mData[i] == data)
+			{ //found it
+				_remove(data, i);
+				llassert(data->getBinIndex() == -1);
+				return true;
+			}
+		}
+		
+		if (isInside(data))
 		{
 			oct_node* dest = getNodeAt(data);
 
 			if (dest != this)
 			{
-				return dest->remove(data);
+				bool ret = dest->remove(data);
+				llassert(data->getBinIndex() == -1);
+				return ret;
 			}
 		}
 
@@ -429,19 +493,20 @@ class LLOctreeNode : public LLTreeNode<T>
 		//node is now root
 		llwarns << "!!! OCTREE REMOVING FACE BY ADDRESS, SEVERE PERFORMANCE PENALTY |||" << llendl;
 		node->removeByAddress(data);
+		llassert(data->getBinIndex() == -1);
 		return true;
 	}
 
 	void removeByAddress(T* data)
 	{
-        if (mData.find(data) != mData.end())
+        for (U32 i = 0; i < mElementCount; ++i)
 		{
-			mData.erase(data);
-			mElementCount = mData.size();
-			notifyRemoval(data);
-			llwarns << "FOUND!" << llendl;
-			checkAlive();
-			return;
+			if (mData[i] == data)
+			{ //we have data
+				_remove(data, i);
+				llwarns << "FOUND!" << llendl;
+				return;
+			}
 		}
 		
 		for (U32 i = 0; i < getChildCount(); i++)
@@ -453,8 +518,8 @@ class LLOctreeNode : public LLTreeNode<T>
 
 	void clearChildren()
 	{
-		mChild.clear();
 		mChildCount = 0;
+
 		U32* foo = (U32*) mChildMap;
 		foo[0] = foo[1] = 0xFFFFFFFF;
 	}
@@ -516,7 +581,7 @@ class LLOctreeNode : public LLTreeNode<T>
 
 		mChildMap[child->getOctant()] = mChildCount;
 
-		mChild.push_back(child);
+		mChild[mChildCount] = child;
 		++mChildCount;
 		child->setParent(this);
 
@@ -543,9 +608,12 @@ class LLOctreeNode : public LLTreeNode<T>
 			mChild[index]->destroy();
 			delete mChild[index];
 		}
-		mChild.erase(mChild.begin() + index);
+
 		--mChildCount;
 
+		mChild[index] = mChild[mChildCount];
+		
+
 		//rebuild child map
 		U32* foo = (U32*) mChildMap;
 		foo[0] = foo[1] = 0xFFFFFFFF;
@@ -601,11 +669,12 @@ class LLOctreeNode : public LLTreeNode<T>
 	oct_node* mParent;
 	U8 mOctant;
 
-	child_list mChild;
+	LLOctreeNode<T>* mChild[8];
 	U8 mChildMap[8];
 	U32 mChildCount;
 
 	element_list mData;
+	element_iter mDataEnd;
 	U32 mElementCount;
 		
 }; 
diff --git a/indra/llmath/llplane.h b/indra/llmath/llplane.h
index a611894721c9207d829fdea615feb0a13c6616ec..3c32441b11875f9503c7de564ccb7f85e346a081 100644
--- a/indra/llmath/llplane.h
+++ b/indra/llmath/llplane.h
@@ -36,6 +36,8 @@
 // The plane normal = [A, B, C]
 // The closest approach = D / sqrt(A*A + B*B + C*C)
 
+
+LL_ALIGN_PREFIX(16)
 class LLPlane
 {
 public:
@@ -94,7 +96,7 @@ class LLPlane
 		
 private:
 	LLVector4a mV;
-};
+} LL_ALIGN_POSTFIX(16);
 
 
 
diff --git a/indra/llmath/llsimdmath.h b/indra/llmath/llsimdmath.h
index c7cdf7b32cb5d8d729fb42f7ef383424e9923268..01458521ec357cf6ef2cebbef0a13ab3a3d65774 100644
--- a/indra/llmath/llsimdmath.h
+++ b/indra/llmath/llsimdmath.h
@@ -67,11 +67,10 @@ template <typename T> T* LL_NEXT_ALIGNED_ADDRESS_64(T* address)
 
 #define LL_ALIGN_16(var) LL_ALIGN_PREFIX(16) var LL_ALIGN_POSTFIX(16)
 
-
-
 #include <xmmintrin.h>
 #include <emmintrin.h>
 
+#include "llmemory.h"
 #include "llsimdtypes.h"
 #include "llsimdtypes.inl"
 
diff --git a/indra/llmath/llsimdtypes.inl b/indra/llmath/llsimdtypes.inl
index 712239e4258b6bb4ed2ecb41ac45db5e2908a7ab..e905c84954b2be420c29d0c792b0dbcc814e1413 100644
--- a/indra/llmath/llsimdtypes.inl
+++ b/indra/llmath/llsimdtypes.inl
@@ -62,6 +62,7 @@ inline LLSimdScalar operator/(const LLSimdScalar& a, const LLSimdScalar& b)
 inline LLSimdScalar operator-(const LLSimdScalar& a)
 {
 	static LL_ALIGN_16(const U32 signMask[4]) = {0x80000000, 0x80000000, 0x80000000, 0x80000000 };
+	ll_assert_aligned(signMask,16);
 	return _mm_xor_ps(*reinterpret_cast<const LLQuad*>(signMask), a);
 }
 
@@ -146,6 +147,7 @@ inline LLSimdScalar& LLSimdScalar::operator/=(const LLSimdScalar& rhs)
 inline LLSimdScalar LLSimdScalar::getAbs() const
 {
 	static const LL_ALIGN_16(U32 F_ABS_MASK_4A[4]) = { 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF };
+	ll_assert_aligned(F_ABS_MASK_4A,16);
 	return _mm_and_ps( mQ, *reinterpret_cast<const LLQuad*>(F_ABS_MASK_4A));
 }
 
diff --git a/indra/llmath/llvector4a.cpp b/indra/llmath/llvector4a.cpp
index b66b7a70764f414480d4ab5c5c6cf7ce2ba848ca..6edeb0fefe5e37998514e1c83cc9eb00115256d2 100644
--- a/indra/llmath/llvector4a.cpp
+++ b/indra/llmath/llvector4a.cpp
@@ -24,6 +24,7 @@
  * $/LicenseInfo$
  */
 
+#include "llmemory.h"
 #include "llmath.h"
 #include "llquantize.h"
 
@@ -44,7 +45,10 @@ extern const LLVector4a LL_V4A_EPSILON = reinterpret_cast<const LLVector4a&> ( F
 	assert(dst != NULL);
 	assert(bytes > 0);
 	assert((bytes % sizeof(F32))== 0); 
-	
+	ll_assert_aligned(src,16);
+	ll_assert_aligned(dst,16);
+	assert(bytes%16==0);
+
 	F32* end = dst + (bytes / sizeof(F32) );
 
 	if (bytes > 64)
@@ -189,6 +193,8 @@ void LLVector4a::quantize16( const LLVector4a& low, const LLVector4a& high )
 		LLVector4a oneOverDelta;
 		{
 			static LL_ALIGN_16( const F32 F_TWO_4A[4] ) = { 2.f, 2.f, 2.f, 2.f };
+			ll_assert_aligned(F_TWO_4A,16);
+			
 			LLVector4a two; two.load4a( F_TWO_4A );
 
 			// Here we use _mm_rcp_ps plus one round of newton-raphson
diff --git a/indra/llmath/llvector4a.h b/indra/llmath/llvector4a.h
index 596082509df104fd09651ac3366975885f6f3d2e..0526793d3a6130cd23857815c58ec0435ea629b8 100644
--- a/indra/llmath/llvector4a.h
+++ b/indra/llmath/llvector4a.h
@@ -32,6 +32,7 @@ class LLRotation;
 
 #include <assert.h>
 #include "llpreprocessor.h"
+#include "llmemory.h"
 
 ///////////////////////////////////
 // FIRST TIME USERS PLEASE READ
@@ -46,6 +47,7 @@ class LLRotation;
 // LLVector3/LLVector4. 
 /////////////////////////////////
 
+LL_ALIGN_PREFIX(16)
 class LLVector4a
 {
 public:
@@ -82,6 +84,7 @@ class LLVector4a
 	}
 
 	// Copy words 16-byte blocks from src to dst. Source and destination must not overlap. 
+	// Source and dest must be 16-byte aligned and size must be multiple of 16.
 	static void memcpyNonAliased16(F32* __restrict dst, const F32* __restrict src, size_t bytes);
 
 	////////////////////////////////////
@@ -90,6 +93,7 @@ class LLVector4a
 	
 	LLVector4a()
 	{ //DO NOT INITIALIZE -- The overhead is completely unnecessary
+		ll_assert_aligned(this,16);
 	}
 	
 	LLVector4a(F32 x, F32 y, F32 z, F32 w = 0.f)
@@ -313,7 +317,7 @@ class LLVector4a
 
 private:
 	LLQuad mQ;
-};
+} LL_ALIGN_POSTFIX(16);
 
 inline void update_min_max(LLVector4a& min, LLVector4a& max, const LLVector4a& p)
 {
diff --git a/indra/llmath/llvector4a.inl b/indra/llmath/llvector4a.inl
index 7ad22a563156dcbd1845816d2d97aff9ead85471..7c52ffef2171c6caecd8c16af7793def0d99f74b 100644
--- a/indra/llmath/llvector4a.inl
+++ b/indra/llmath/llvector4a.inl
@@ -475,6 +475,7 @@ inline void LLVector4a::setLerp(const LLVector4a& lhs, const LLVector4a& rhs, F3
 inline LLBool32 LLVector4a::isFinite3() const
 {
 	static LL_ALIGN_16(const U32 nanOrInfMask[4]) = { 0x7f800000, 0x7f800000, 0x7f800000, 0x7f800000 };
+	ll_assert_aligned(nanOrInfMask,16);
 	const __m128i nanOrInfMaskV = *reinterpret_cast<const __m128i*> (nanOrInfMask);
 	const __m128i maskResult = _mm_and_si128( _mm_castps_si128(mQ), nanOrInfMaskV );
 	const LLVector4Logical equalityCheck = _mm_castsi128_ps(_mm_cmpeq_epi32( maskResult, nanOrInfMaskV ));
diff --git a/indra/llmath/llvector4logical.h b/indra/llmath/llvector4logical.h
index dd66b09d4391608eda6e4affa0674b4825cc288b..c5698f7cea62b1d56084906cf18a0801792070b7 100644
--- a/indra/llmath/llvector4logical.h
+++ b/indra/llmath/llvector4logical.h
@@ -27,6 +27,7 @@
 #ifndef	LL_VECTOR4LOGICAL_H
 #define	LL_VECTOR4LOGICAL_H
 
+#include "llmemory.h"
 
 ////////////////////////////
 // LLVector4Logical
@@ -77,6 +78,7 @@ class LLVector4Logical
 	inline LLVector4Logical& invert()
 	{
 		static const LL_ALIGN_16(U32 allOnes[4]) = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
+		ll_assert_aligned(allOnes,16);
 		mQ = _mm_andnot_ps( mQ, *(LLQuad*)(allOnes) );
 		return *this;
 	}
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index cc9744756fd4d4ba19ffb11c83229f9b3f4a0d1a..53d56e96dac6a9c4fedd218c3cea755b4f9fb173 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -95,17 +95,6 @@ const S32 SCULPT_MIN_AREA_DETAIL = 1;
 
 extern BOOL gDebugGL;
 
-void assert_aligned(void* ptr, uintptr_t alignment)
-{
-#if 0
-	uintptr_t t = (uintptr_t) ptr;
-	if (t%alignment != 0)
-	{
-		llerrs << "Alignment check failed." << llendl;
-	}
-#endif
-}
-
 BOOL check_same_clock_dir( const LLVector3& pt1, const LLVector3& pt2, const LLVector3& pt3, const LLVector3& norm)
 {    
 	LLVector3 test = (pt2-pt1)%(pt3-pt2);
@@ -328,16 +317,16 @@ class LLVolumeOctreeRebound : public LLOctreeTravelerDepthFirst<LLVolumeTriangle
 		LLVector4a& min = node->mExtents[0];
 		LLVector4a& max = node->mExtents[1];
 
-		if (!branch->getData().empty())
+		if (!branch->isEmpty())
 		{ //node has data, find AABB that binds data set
-			const LLVolumeTriangle* tri = *(branch->getData().begin());
+			const LLVolumeTriangle* tri = *(branch->getDataBegin());
 			
 			//initialize min/max to first available vertex
 			min = *(tri->mV[0]);
 			max = *(tri->mV[0]);
 			
 			for (LLOctreeNode<LLVolumeTriangle>::const_element_iter iter = 
-				branch->getData().begin(); iter != branch->getData().end(); ++iter)
+				branch->getDataBegin(); iter != branch->getDataEnd(); ++iter)
 			{ //for each triangle in node
 
 				//stretch by triangles in node
@@ -352,7 +341,7 @@ class LLVolumeOctreeRebound : public LLOctreeTravelerDepthFirst<LLVolumeTriangle
 				max.setMax(max, *tri->mV[2]);
 			}
 		}
-		else if (!branch->getChildren().empty())
+		else if (!branch->isLeaf())
 		{ //no data, but child nodes exist
 			LLVolumeOctreeListener* child = (LLVolumeOctreeListener*) branch->getChild(0)->getListener(0);
 
@@ -6962,14 +6951,14 @@ void LLVolumeFace::resizeVertices(S32 num_verts)
 	if (num_verts)
 	{
 		mPositions = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts);
-		assert_aligned(mPositions, 16);
+		ll_assert_aligned(mPositions, 16);
 		mNormals = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts);
-		assert_aligned(mNormals, 16);
+		ll_assert_aligned(mNormals, 16);
 
 		//pad texture coordinate block end to allow for QWORD reads
 		S32 size = ((num_verts*sizeof(LLVector2)) + 0xF) & ~0xF;
 		mTexCoords = (LLVector2*) ll_aligned_malloc_16(size);
-		assert_aligned(mTexCoords, 16);
+		ll_assert_aligned(mTexCoords, 16);
 	}
 	else
 	{
@@ -6993,14 +6982,17 @@ void LLVolumeFace::pushVertex(const LLVector4a& pos, const LLVector4a& norm, con
 //	S32 old_size = mNumVertices*16;
 
 	//positions
-	mPositions = (LLVector4a*) realloc(mPositions, new_size);
+	mPositions = (LLVector4a*) ll_aligned_realloc_16(mPositions, new_size);
+	ll_assert_aligned(mPositions,16);
 	
 	//normals
-	mNormals = (LLVector4a*) realloc(mNormals, new_size);
-	
+	mNormals = (LLVector4a*) ll_aligned_realloc_16(mNormals, new_size);
+	ll_assert_aligned(mNormals,16);
+
 	//tex coords
 	new_size = ((new_verts*8)+0xF) & ~0xF;
-	mTexCoords = (LLVector2*) realloc(mTexCoords, new_size);
+	mTexCoords = (LLVector2*) ll_aligned_realloc_16(mTexCoords, new_size);
+	ll_assert_aligned(mTexCoords,16);
 	
 
 	//just clear binormals
@@ -7053,7 +7045,8 @@ void LLVolumeFace::pushIndex(const U16& idx)
 	S32 old_size = ((mNumIndices*2)+0xF) & ~0xF;
 	if (new_size != old_size)
 	{
-		mIndices = (U16*) realloc(mIndices, new_size);
+		mIndices = (U16*) ll_aligned_realloc_16(mIndices, new_size);
+		ll_assert_aligned(mIndices,16);
 	}
 	
 	mIndices[mNumIndices++] = idx;
@@ -7094,12 +7087,12 @@ void LLVolumeFace::appendFace(const LLVolumeFace& face, LLMatrix4& mat_in, LLMat
 	}
 
 	//allocate new buffer space
-	mPositions = (LLVector4a*) realloc(mPositions, new_count*sizeof(LLVector4a));
-	assert_aligned(mPositions, 16);
-	mNormals = (LLVector4a*) realloc(mNormals, new_count*sizeof(LLVector4a));
-	assert_aligned(mNormals, 16);
-	mTexCoords = (LLVector2*) realloc(mTexCoords, (new_count*sizeof(LLVector2)+0xF) & ~0xF);
-	assert_aligned(mTexCoords, 16);
+	mPositions = (LLVector4a*) ll_aligned_realloc_16(mPositions, new_count*sizeof(LLVector4a));
+	ll_assert_aligned(mPositions, 16);
+	mNormals = (LLVector4a*) ll_aligned_realloc_16(mNormals, new_count*sizeof(LLVector4a));
+	ll_assert_aligned(mNormals, 16);
+	mTexCoords = (LLVector2*) ll_aligned_realloc_16(mTexCoords, (new_count*sizeof(LLVector2)+0xF) & ~0xF);
+	ll_assert_aligned(mTexCoords, 16);
 	
 	mNumVertices = new_count;
 
@@ -7145,7 +7138,7 @@ void LLVolumeFace::appendFace(const LLVolumeFace& face, LLMatrix4& mat_in, LLMat
 	new_count = mNumIndices + face.mNumIndices;
 
 	//allocate new index buffer
-	mIndices = (U16*) realloc(mIndices, (new_count*sizeof(U16)+0xF) & ~0xF);
+	mIndices = (U16*) ll_aligned_realloc_16(mIndices, (new_count*sizeof(U16)+0xF) & ~0xF);
 	
 	//get destination address into new index buffer
 	U16* dst_idx = mIndices+mNumIndices;
diff --git a/indra/llmath/llvolumeoctree.cpp b/indra/llmath/llvolumeoctree.cpp
index b5a935c2b54133710c8d39c1369cce3de9eca07a..cc83cb7235868bc4102f219806583c9b9e5e30a7 100644
--- a/indra/llmath/llvolumeoctree.cpp
+++ b/indra/llmath/llvolumeoctree.cpp
@@ -131,7 +131,7 @@ void LLOctreeTriangleRayIntersect::traverse(const LLOctreeNode<LLVolumeTriangle>
 void LLOctreeTriangleRayIntersect::visit(const LLOctreeNode<LLVolumeTriangle>* node)
 {
 	for (LLOctreeNode<LLVolumeTriangle>::const_element_iter iter = 
-			node->getData().begin(); iter != node->getData().end(); ++iter)
+			node->getDataBegin(); iter != node->getDataEnd(); ++iter)
 	{
 		const LLVolumeTriangle* tri = *iter;
 
@@ -236,8 +236,8 @@ void LLVolumeOctreeValidate::visit(const LLOctreeNode<LLVolumeTriangle>* branch)
 	}
 
 	//children fit, check data
-	for (LLOctreeNode<LLVolumeTriangle>::const_element_iter iter = branch->getData().begin(); 
-			iter != branch->getData().end(); ++iter)
+	for (LLOctreeNode<LLVolumeTriangle>::const_element_iter iter = branch->getDataBegin(); 
+			iter != branch->getDataEnd(); ++iter)
 	{
 		const LLVolumeTriangle* tri = *iter;
 
diff --git a/indra/llmath/llvolumeoctree.h b/indra/llmath/llvolumeoctree.h
index 688d91dc40b6c0f805187d808d45e1e9644aba42..9ae34a0c4e65cb551a67c9802233c16cf6af2818 100644
--- a/indra/llmath/llvolumeoctree.h
+++ b/indra/llmath/llvolumeoctree.h
@@ -37,9 +37,19 @@
 class LLVolumeTriangle : public LLRefCount
 {
 public:
+	void* operator new(size_t size)
+	{
+		return ll_aligned_malloc_16(size);
+	}
+
+	void operator delete(void* ptr)
+	{
+		ll_aligned_free_16(ptr);
+	}
+
 	LLVolumeTriangle()
 	{
-		
+		mBinIndex = -1;	
 	}
 
 	LLVolumeTriangle(const LLVolumeTriangle& rhs)
@@ -58,21 +68,38 @@ class LLVolumeTriangle : public LLRefCount
 	
 	}
 
-	LLVector4a mPositionGroup;
+	LL_ALIGN_16(LLVector4a mPositionGroup);
 
 	const LLVector4a* mV[3];
 	U16 mIndex[3];
 
 	F32 mRadius;
+	mutable S32 mBinIndex;
+
 
 	virtual const LLVector4a& getPositionGroup() const;
 	virtual const F32& getBinRadius() const;
+	
+	S32 getBinIndex() const { return mBinIndex; }
+	void setBinIndex(S32 idx) const { mBinIndex = idx; }
+
+
 };
 
 class LLVolumeOctreeListener : public LLOctreeListener<LLVolumeTriangle>
 {
 public:
 	
+	void* operator new(size_t size)
+	{
+		return ll_aligned_malloc_16(size);
+	}
+
+	void operator delete(void* ptr)
+	{
+		ll_aligned_free_16(ptr);
+	}
+
 	LLVolumeOctreeListener(LLOctreeNode<LLVolumeTriangle>* node);
 	~LLVolumeOctreeListener();
 	
@@ -99,8 +126,8 @@ class LLVolumeOctreeListener : public LLOctreeListener<LLVolumeTriangle>
 	
 
 public:
-	LLVector4a mBounds[2]; // bounding box (center, size) of this node and all its children (tight fit to objects)
-	LLVector4a mExtents[2]; // extents (min, max) of this node and all its children
+	LL_ALIGN_16(LLVector4a mBounds[2]); // bounding box (center, size) of this node and all its children (tight fit to objects)
+	LL_ALIGN_16(LLVector4a mExtents[2]); // extents (min, max) of this node and all its children
 };
 
 class LLOctreeTriangleRayIntersect : public LLOctreeTraveler<LLVolumeTriangle>
diff --git a/indra/llmath/tests/alignment_test.cpp b/indra/llmath/tests/alignment_test.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..ac0c45ae6f828d535dfdc791e9560274665bab6e
--- /dev/null
+++ b/indra/llmath/tests/alignment_test.cpp
@@ -0,0 +1,128 @@
+/**
+ * @file v3dmath_test.cpp
+ * @author Vir
+ * @date 2011-12
+ * @brief v3dmath test cases.
+ *
+ * $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$
+ */
+
+// Tests related to allocating objects with alignment constraints, particularly for SSE support.
+
+#include "linden_common.h"
+#include "../test/lltut.h"
+#include "../llmath.h"
+#include "../llsimdmath.h"
+#include "../llvector4a.h"
+
+void* operator new(size_t size)
+{
+	return ll_aligned_malloc_16(size);
+}
+
+void operator delete(void *p)
+{
+	ll_aligned_free_16(p);
+}
+
+namespace tut
+{
+
+#define is_aligned(ptr,alignment) ((reinterpret_cast<uintptr_t>(ptr))%(alignment)==0)
+#define is_aligned_relative(ptr,base_ptr,alignment) ((reinterpret_cast<uintptr_t>(ptr)-reinterpret_cast<uintptr_t>(base_ptr))%(alignment)==0)
+
+struct alignment_test {};
+
+typedef test_group<alignment_test> alignment_test_t;
+typedef alignment_test_t::object alignment_test_object_t;
+tut::alignment_test_t tut_alignment_test("LLAlignment");
+
+LL_ALIGN_PREFIX(16)
+class MyVector4a
+{
+	LLQuad mQ;
+} LL_ALIGN_POSTFIX(16);
+
+
+// Verify that aligned allocators perform as advertised.
+template<> template<>
+void alignment_test_object_t::test<1>()
+{
+#   ifdef LL_DEBUG
+	skip("This test fails on Windows when compiled in debug mode.");
+#   endif
+	
+	const int num_tests = 7;
+	void *align_ptr;
+	for (int i=0; i<num_tests; i++)
+	{
+		align_ptr = ll_aligned_malloc_16(sizeof(MyVector4a));
+		ensure("ll_aligned_malloc_16 failed", is_aligned(align_ptr,16));
+
+		align_ptr = ll_aligned_realloc_16(align_ptr,2*sizeof(MyVector4a));
+		ensure("ll_aligned_realloc_16 failed", is_aligned(align_ptr,16));
+
+		ll_aligned_free_16(align_ptr);
+
+		align_ptr = ll_aligned_malloc_32(sizeof(MyVector4a));
+		ensure("ll_aligned_malloc_32 failed", is_aligned(align_ptr,32));
+		ll_aligned_free_32(align_ptr);
+	}
+}
+
+// In-place allocation of objects and arrays.
+template<> template<>
+void alignment_test_object_t::test<2>()
+{
+	MyVector4a vec1;
+	ensure("LLAlignment vec1 unaligned", is_aligned(&vec1,16));
+	
+	MyVector4a veca[12];
+	ensure("LLAlignment veca unaligned", is_aligned(veca,16));
+}
+
+// Heap allocation of objects and arrays.
+template<> template<>
+void alignment_test_object_t::test<3>()
+{
+#   ifdef LL_DEBUG
+	skip("This test fails on Windows when compiled in debug mode.");
+#   endif
+	
+	const int ARR_SIZE = 7;
+	for(int i=0; i<ARR_SIZE; i++)
+	{
+		MyVector4a *vecp = new MyVector4a;
+		ensure("LLAlignment vecp unaligned", is_aligned(vecp,16));
+		delete vecp;
+	}
+
+	MyVector4a *veca = new MyVector4a[ARR_SIZE];
+	ensure("LLAligment veca base", is_aligned(veca,16));
+	for(int i=0; i<ARR_SIZE; i++)
+	{
+		std::cout << "veca[" << i << "]" << std::endl;
+		ensure("LLAlignment veca member unaligned", is_aligned(&veca[i],16));
+	}
+}
+
+}
diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp
index a16f5c7bf0ea27a314d959c4e3b75d02636e592f..f3f00072054df6f6d4d664f78fb3e6d41598e3f8 100644
--- a/indra/llmessage/llurlrequest.cpp
+++ b/indra/llmessage/llurlrequest.cpp
@@ -289,6 +289,8 @@ LLIOPipe::EStatus LLURLRequest::handleError(
 }
 
 static LLFastTimer::DeclareTimer FTM_PROCESS_URL_REQUEST("URL Request");
+static LLFastTimer::DeclareTimer FTM_PROCESS_URL_REQUEST_GET_RESULT("Get Result");
+static LLFastTimer::DeclareTimer FTM_URL_PERFORM("Perform");
 
 // virtual
 LLIOPipe::EStatus LLURLRequest::process_impl(
@@ -358,7 +360,6 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
 	{
 		PUMP_DEBUG;
 		LLIOPipe::EStatus status = STATUS_BREAK;
-		static LLFastTimer::DeclareTimer FTM_URL_PERFORM("Perform");
 		{
 			LLFastTimer t(FTM_URL_PERFORM);
 			if(!mDetail->mCurlRequest->wait())
@@ -371,8 +372,6 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
 		{
 			CURLcode result;
 
-			static LLFastTimer::DeclareTimer FTM_PROCESS_URL_REQUEST_GET_RESULT("Get Result");
-
 			bool newmsg = false;
 			{
 				LLFastTimer t(FTM_PROCESS_URL_REQUEST_GET_RESULT);
diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp
index e71fb96540724c096f066aa8560f9a97bbec5b39..d7658862da4f3eb2f83816d55587bfaff43ccd64 100644
--- a/indra/llmessage/message_prehash.cpp
+++ b/indra/llmessage/message_prehash.cpp
@@ -943,7 +943,6 @@ char const* const _PREHASH_SysGPU = LLMessageStringTable::getInstance()->getStri
 char const* const _PREHASH_AvatarInterestsReply = LLMessageStringTable::getInstance()->getString("AvatarInterestsReply");
 char const* const _PREHASH_StartLure = LLMessageStringTable::getInstance()->getString("StartLure");
 char const* const _PREHASH_SysRAM = LLMessageStringTable::getInstance()->getString("SysRAM");
-char const* const _PREHASH_ObjectPosition = LLMessageStringTable::getInstance()->getString("ObjectPosition");
 char const* const _PREHASH_SitPosition = LLMessageStringTable::getInstance()->getString("SitPosition");
 char const* const _PREHASH_StartTime = LLMessageStringTable::getInstance()->getString("StartTime");
 char const* const _PREHASH_BornOn = LLMessageStringTable::getInstance()->getString("BornOn");
@@ -999,7 +998,6 @@ char const* const _PREHASH_SnapshotID = LLMessageStringTable::getInstance()->get
 char const* const _PREHASH_Aspect = LLMessageStringTable::getInstance()->getString("Aspect");
 char const* const _PREHASH_ParamSize = LLMessageStringTable::getInstance()->getString("ParamSize");
 char const* const _PREHASH_VoteCast = LLMessageStringTable::getInstance()->getString("VoteCast");
-char const* const _PREHASH_CastsShadows = LLMessageStringTable::getInstance()->getString("CastsShadows");
 char const* const _PREHASH_EveryoneMask = LLMessageStringTable::getInstance()->getString("EveryoneMask");
 char const* const _PREHASH_ObjectSpinUpdate = LLMessageStringTable::getInstance()->getString("ObjectSpinUpdate");
 char const* const _PREHASH_MaturePublish = LLMessageStringTable::getInstance()->getString("MaturePublish");
@@ -1048,7 +1046,6 @@ char const* const _PREHASH_SimIP = LLMessageStringTable::getInstance()->getStrin
 char const* const _PREHASH_GodID = LLMessageStringTable::getInstance()->getString("GodID");
 char const* const _PREHASH_TeleportMinPrice = LLMessageStringTable::getInstance()->getString("TeleportMinPrice");
 char const* const _PREHASH_VoteItem = LLMessageStringTable::getInstance()->getString("VoteItem");
-char const* const _PREHASH_ObjectRotation = LLMessageStringTable::getInstance()->getString("ObjectRotation");
 char const* const _PREHASH_SitRotation = LLMessageStringTable::getInstance()->getString("SitRotation");
 char const* const _PREHASH_SnapSelection = LLMessageStringTable::getInstance()->getString("SnapSelection");
 char const* const _PREHASH_SoundTrigger = LLMessageStringTable::getInstance()->getString("SoundTrigger");
diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h
index dd2c2dbd64a6f7247a193577618d345b111c28af..da2b613f539022bc58bfaa2013d7b77272e365d1 100644
--- a/indra/llmessage/message_prehash.h
+++ b/indra/llmessage/message_prehash.h
@@ -943,7 +943,6 @@ extern char const* const _PREHASH_SysGPU;
 extern char const* const _PREHASH_AvatarInterestsReply;
 extern char const* const _PREHASH_StartLure;
 extern char const* const _PREHASH_SysRAM;
-extern char const* const _PREHASH_ObjectPosition;
 extern char const* const _PREHASH_SitPosition;
 extern char const* const _PREHASH_StartTime;
 extern char const* const _PREHASH_BornOn;
@@ -999,7 +998,6 @@ extern char const* const _PREHASH_SnapshotID;
 extern char const* const _PREHASH_Aspect;
 extern char const* const _PREHASH_ParamSize;
 extern char const* const _PREHASH_VoteCast;
-extern char const* const _PREHASH_CastsShadows;
 extern char const* const _PREHASH_EveryoneMask;
 extern char const* const _PREHASH_ObjectSpinUpdate;
 extern char const* const _PREHASH_MaturePublish;
@@ -1048,7 +1046,6 @@ extern char const* const _PREHASH_SimIP;
 extern char const* const _PREHASH_GodID;
 extern char const* const _PREHASH_TeleportMinPrice;
 extern char const* const _PREHASH_VoteItem;
-extern char const* const _PREHASH_ObjectRotation;
 extern char const* const _PREHASH_SitRotation;
 extern char const* const _PREHASH_SnapSelection;
 extern char const* const _PREHASH_SoundTrigger;
diff --git a/indra/llmessage/tests/llhttpclient_test.cpp b/indra/llmessage/tests/llhttpclient_test.cpp
index 843c3bcc4bd6c09b7cdb04bd579853c2bea7d5be..e338d4ec71ee566826a4f4a24bff428fe5ac77dd 100644
--- a/indra/llmessage/tests/llhttpclient_test.cpp
+++ b/indra/llmessage/tests/llhttpclient_test.cpp
@@ -258,6 +258,7 @@ namespace tut
 	void HTTPClientTestObject::test<1>()
 	{
 		LLHTTPClient::get(local_server, newResult());
+
 		runThePump();
 		ensureStatusOK();
 		ensure("result object wasn't destroyed", mResultDeleted);
diff --git a/indra/llprimitive/CMakeLists.txt b/indra/llprimitive/CMakeLists.txt
index 7d0e313ff317219f3550489d676541b35f86f40b..e4d9de7eb64cea94020c14ecaa08f66bebb9aa52 100644
--- a/indra/llprimitive/CMakeLists.txt
+++ b/indra/llprimitive/CMakeLists.txt
@@ -7,12 +7,14 @@ include(LLCommon)
 include(LLMath)
 include(LLMessage)
 include(LLXML)
+include(LLPhysicsExtensions)
 
 include_directories(
     ${LLCOMMON_INCLUDE_DIRS}
     ${LLMATH_INCLUDE_DIRS}
     ${LLMESSAGE_INCLUDE_DIRS}
     ${LLXML_INCLUDE_DIRS}
+    ${LLPHYSICSEXTENSIONS_INCLUDE_DIRS}
     ${LIBS_PREBUILT_DIR}/include/collada
     ${LIBS_PREBUILT_DIR}/include/collada/1.4
     )
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index cb32a510b80b62585cd3cb1863b83e178a4270e8..28ed051c5537a606873ecd8db38b48f0efd4f4ae 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -1026,7 +1026,8 @@ void LLModel::setVolumeFaceData(
 
 	if (tc.get())
 	{
-		LLVector4a::memcpyNonAliased16((F32*) face.mTexCoords, (F32*) tc.get(), num_verts*2*sizeof(F32));
+		U32 tex_size = (num_verts*2*sizeof(F32)+0xF)&~0xF;
+		LLVector4a::memcpyNonAliased16((F32*) face.mTexCoords, (F32*) tc.get(), tex_size);
 	}
 	else
 	{
diff --git a/indra/llprimitive/object_flags.h b/indra/llprimitive/object_flags.h
index 94c559d7577e2acb4fb5efc4da08d2ad0c3638ac..31dbd15ae0e7bdd8ee91cb24fd94d64b26d174dd 100644
--- a/indra/llprimitive/object_flags.h
+++ b/indra/llprimitive/object_flags.h
@@ -28,43 +28,47 @@
 #define LL_OBJECT_FLAGS_H
 
 // downstream flags from sim->viewer
-const U32	FLAGS_USE_PHYSICS			= 0x00000001;
-const U32	FLAGS_CREATE_SELECTED		= 0x00000002;
-const U32	FLAGS_OBJECT_MODIFY			= 0x00000004;
-const U32	FLAGS_OBJECT_COPY			= 0x00000008;
-const U32	FLAGS_OBJECT_ANY_OWNER		= 0x00000010;
-const U32	FLAGS_OBJECT_YOU_OWNER		= 0x00000020;
-const U32	FLAGS_SCRIPTED				= 0x00000040;
-const U32	FLAGS_HANDLE_TOUCH			= 0x00000080;
-const U32	FLAGS_OBJECT_MOVE			= 0x00000100;
-const U32	FLAGS_TAKES_MONEY			= 0x00000200;
-const U32	FLAGS_PHANTOM				= 0x00000400;
-const U32	FLAGS_INVENTORY_EMPTY		= 0x00000800;
+const U32   FLAGS_USE_PHYSICS          = (1U << 0);
+const U32   FLAGS_CREATE_SELECTED      = (1U << 1);
+const U32   FLAGS_OBJECT_MODIFY        = (1U << 2);
+const U32   FLAGS_OBJECT_COPY          = (1U << 3);
+const U32   FLAGS_OBJECT_ANY_OWNER     = (1U << 4);
+const U32   FLAGS_OBJECT_YOU_OWNER     = (1U << 5);
+const U32   FLAGS_SCRIPTED             = (1U << 6);
+const U32   FLAGS_HANDLE_TOUCH         = (1U << 7);
+const U32   FLAGS_OBJECT_MOVE          = (1U << 8);
+const U32   FLAGS_TAKES_MONEY          = (1U << 9);
+const U32   FLAGS_PHANTOM              = (1U << 10);
+const U32   FLAGS_INVENTORY_EMPTY      = (1U << 11);
 
-const U32	FLAGS_JOINT_HINGE			= 0x00001000;
-const U32	FLAGS_JOINT_P2P				= 0x00002000;
-const U32	FLAGS_JOINT_LP2P			= 0x00004000;
-// const U32	FLAGS_JOINT_WHEEL		= 0x00008000;
-const U32	FLAGS_INCLUDE_IN_SEARCH		= 0x00008000;
+const U32   FLAGS_AFFECTS_NAVMESH      = (1U << 12);
+const U32   FLAGS_CHARACTER            = (1U << 13);
+const U32   FLAGS_VOLUME_DETECT        = (1U << 14);
+const U32   FLAGS_INCLUDE_IN_SEARCH    = (1U << 15);
 
-const U32	FLAGS_ALLOW_INVENTORY_DROP	= 0x00010000;
-const U32	FLAGS_OBJECT_TRANSFER		= 0x00020000;
-const U32	FLAGS_OBJECT_GROUP_OWNED	= 0x00040000;
-//const U32	FLAGS_OBJECT_YOU_OFFICER	= 0x00080000;
+const U32   FLAGS_ALLOW_INVENTORY_DROP = (1U << 16);
+const U32   FLAGS_OBJECT_TRANSFER      = (1U << 17);
+const U32   FLAGS_OBJECT_GROUP_OWNED   = (1U << 18);
+//const U32 FLAGS_UNUSED_000           = (1U << 19); // was FLAGS_OBJECT_YOU_OFFICER
 
-const U32 	FLAGS_CAMERA_DECOUPLED 		= 0x00100000;
-const U32	FLAGS_ANIM_SOURCE			= 0x00200000;
-const U32	FLAGS_CAMERA_SOURCE			= 0x00400000;
+const U32   FLAGS_CAMERA_DECOUPLED     = (1U << 20);
+const U32   FLAGS_ANIM_SOURCE          = (1U << 21);
+const U32   FLAGS_CAMERA_SOURCE        = (1U << 22);
 
-const U32	FLAGS_CAST_SHADOWS			= 0x00800000;
+//const U32 FLAGS_UNUSED_001           = (1U << 23); // was FLAGS_CAST_SHADOWS
 
-const U32	FLAGS_OBJECT_OWNER_MODIFY	= 0x10000000;
+//const U32 FLAGS_UNUSED_002           = (1U << 24);
+//const U32 FLAGS_UNUSED_003           = (1U << 25);
+//const U32 FLAGS_UNUSED_004           = (1U << 26);
+//const U32 FLAGS_UNUSED_005           = (1U << 27);
 
-const U32	FLAGS_TEMPORARY_ON_REZ		= 0x20000000;
-const U32	FLAGS_TEMPORARY				= 0x40000000;
-const U32	FLAGS_ZLIB_COMPRESSED		= 0x80000000;
+const U32   FLAGS_OBJECT_OWNER_MODIFY  = (1U << 28);
 
-const U32	FLAGS_LOCAL					= FLAGS_ANIM_SOURCE | FLAGS_CAMERA_SOURCE;
+const U32   FLAGS_TEMPORARY_ON_REZ     = (1U << 29);
+//const U32 FLAGS_UNUSED_006           = (1U << 30); // was FLAGS_TEMPORARY
+//const U32 FLAGS_UNUSED_007           = (1U << 31); // was FLAGS_ZLIB_COMPRESSED
+
+const U32   FLAGS_LOCAL                = FLAGS_ANIM_SOURCE | FLAGS_CAMERA_SOURCE;
 
 typedef enum e_havok_joint_type
 {
@@ -77,4 +81,3 @@ typedef enum e_havok_joint_type
 } EHavokJointType;
 
 #endif
-
diff --git a/indra/llrender/CMakeLists.txt b/indra/llrender/CMakeLists.txt
index 5c13df9f81fd263e0cbcad5142d47b53c5030c9d..516af933165621055fac01849732f0ad7114167c 100644
--- a/indra/llrender/CMakeLists.txt
+++ b/indra/llrender/CMakeLists.txt
@@ -36,6 +36,7 @@ set(llrender_SOURCE_FILES
     llglslshader.cpp
     llimagegl.cpp
     llpostprocess.cpp
+    llrendernavprim.cpp
     llrendersphere.cpp
     llshadermgr.cpp
     lltexture.cpp
@@ -59,6 +60,7 @@ set(llrender_HEADER_FILES
     llimagegl.h
     llpostprocess.h
     llrender.h
+    llrendernavprim.h
     llrendersphere.h
     llshadermgr.h
     lltexture.h
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index f999940176431eb37bdf28adefa8d4328535d9ef..a4d7872ec25e0091152a4da7de8e60f2df09e5ed 100755
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -237,9 +237,11 @@ S32 LLImageGL::dataFormatComponents(S32 dataformat)
 
 //----------------------------------------------------------------------------
 
+static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_STATS("Image Stats");
 // static
 void LLImageGL::updateStats(F32 current_time)
 {
+	LLFastTimer t(FTM_IMAGE_UPDATE_STATS);
 	sLastFrameTime = current_time;
 	sBoundTextureMemoryInBytes = sCurBoundTextureMemory;
 	sCurBoundTextureMemory = 0;
diff --git a/indra/llrender/llrendernavprim.cpp b/indra/llrender/llrendernavprim.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..ca729648327df6523bec73b41c438a510f8e8131
--- /dev/null
+++ b/indra/llrender/llrendernavprim.cpp
@@ -0,0 +1,59 @@
+/** 
+* @file llrendernavprim.cpp
+* @brief Implementation of llrendernavprim
+* @author Prep@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, 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 "linden_common.h"
+
+#include "llrendernavprim.h"
+
+#include "llrender.h"
+#include "llvertexbuffer.h"
+#include "v4coloru.h"
+#include "v3math.h"
+
+//=============================================================================
+LLRenderNavPrim gRenderNav;
+//=============================================================================
+void LLRenderNavPrim::renderLLTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, const LLColor4U& color ) const
+{
+	LLColor4 cV(color);
+	gGL.color4fv( cV.mV );
+	gGL.begin(LLRender::TRIANGLES);
+	{
+		gGL.vertex3fv( a.mV );
+		gGL.vertex3fv( b.mV );
+		gGL.vertex3fv( c.mV );
+	}
+	gGL.end();		
+}
+//=============================================================================
+void LLRenderNavPrim::renderNavMeshVB( U32 mode, LLVertexBuffer* pVBO, int vertCnt )
+{	
+	pVBO->setBuffer( LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_NORMAL );
+	pVBO->drawArrays( mode, 0, vertCnt );	
+}
+//=============================================================================
diff --git a/indra/llrender/llrendernavprim.h b/indra/llrender/llrendernavprim.h
new file mode 100644
index 0000000000000000000000000000000000000000..a3a5dfec3af309e5038b55fa825bbb86a1cef9f3
--- /dev/null
+++ b/indra/llrender/llrendernavprim.h
@@ -0,0 +1,49 @@
+/** 
+* @file   llrendernavprim.h
+* @brief  Header file for llrendernavprim
+* @author Prep@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+* $/LicenseInfo$
+*/
+#ifndef LL_LLRENDERNAVPRIM_H
+#define LL_LLRENDERNAVPRIM_H
+
+#include "stdtypes.h"
+
+class LLColor4U;
+class LLVector3;
+class LLVertexBuffer;
+
+
+class LLRenderNavPrim
+{
+public:
+	//Draw simple tri
+	void renderLLTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, const LLColor4U& color ) const;
+	//Draw the contents of vertex buffer
+	void renderNavMeshVB( U32 mode, LLVertexBuffer* pVBO, int vertCnt );
+private:
+};
+
+extern LLRenderNavPrim gRenderNav;
+
+#endif // LL_LLRENDERNAVPRIM_H
diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp
index 99f0da330cf1d739983c186f13ef7a19550e6fae..cc5c2323809b40c43b79f843fe19fbd0997558e2 100644
--- a/indra/llrender/llrendertarget.cpp
+++ b/indra/llrender/llrendertarget.cpp
@@ -69,6 +69,42 @@ LLRenderTarget::~LLRenderTarget()
 	release();
 }
 
+void LLRenderTarget::resize(U32 resx, U32 resy, U32 color_fmt)
+{ 
+	//for accounting, get the number of pixels added/subtracted
+	S32 pix_diff = (resx*resy)-(mResX*mResY);
+		
+	mResX = resx;
+	mResY = resy;
+
+	for (U32 i = 0; i < mTex.size(); ++i)
+	{ //resize color attachments
+		gGL.getTexUnit(0)->bindManual(mUsage, mTex[i]);
+		LLImageGL::setManualImage(LLTexUnit::getInternalType(mUsage), 0, color_fmt, mResX, mResY, GL_RGBA, GL_UNSIGNED_BYTE, NULL, false);
+		sBytesAllocated += pix_diff*4;
+	}
+
+	if (mDepth)
+	{ //resize depth attachment
+		if (mStencil)
+		{
+			//use render buffers where stencil buffers are in play
+			glBindRenderbuffer(GL_RENDERBUFFER, mDepth);
+			glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, mResX, mResY);
+			glBindRenderbuffer(GL_RENDERBUFFER, 0);
+		}
+		else
+		{
+			gGL.getTexUnit(0)->bindManual(mUsage, mDepth);
+			U32 internal_type = LLTexUnit::getInternalType(mUsage);
+			LLImageGL::setManualImage(internal_type, 0, GL_DEPTH_COMPONENT24, mResX, mResY, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL, false);
+		}
+
+		sBytesAllocated += pix_diff*4;
+	}
+}
+	
+
 bool LLRenderTarget::allocate(U32 resx, U32 resy, U32 color_fmt, bool depth, bool stencil, LLTexUnit::eTextureType usage, bool use_fbo, S32 samples)
 {
 	stop_glerror();
diff --git a/indra/llrender/llrendertarget.h b/indra/llrender/llrendertarget.h
index 83604588401eafb354198ac2a9bfede5bfae122f..e1a51304f1747f0be9a10c00450f2f3355c370ee 100644
--- a/indra/llrender/llrendertarget.h
+++ b/indra/llrender/llrendertarget.h
@@ -57,8 +57,6 @@
 
 */
 
-class LLMultisampleBuffer;
-
 class LLRenderTarget
 {
 public:
@@ -74,6 +72,12 @@ class LLRenderTarget
 	//multiple calls will release previously allocated resources
 	bool allocate(U32 resx, U32 resy, U32 color_fmt, bool depth, bool stencil, LLTexUnit::eTextureType usage = LLTexUnit::TT_TEXTURE, bool use_fbo = false, S32 samples = 0);
 
+	//resize existing attachments to use new resolution and color format
+	// CAUTION: if the GL runs out of memory attempting to resize, this render target will be undefined
+	// DO NOT use for screen space buffers or for scratch space for an image that might be uploaded
+	// DO use for render targets that resize often and aren't likely to ruin someone's day if they break
+	void resize(U32 resx, U32 resy, U32 color_fmt);
+
 	//add color buffer attachment
 	//limit of 4 color attachments per render target
 	bool addColorAttachment(U32 color_fmt);
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 80752231d70f94bde9ec8f0e6b524e05e119230d..eadef93c890f871634b8ee1061d560f2d19c2f7e 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -38,10 +38,6 @@
 #include "llglslshader.h"
 #include "llmemory.h"
 
-#if LL_DARWIN
-#define LL_VBO_POOLING 1
-#else
-#endif
 //Next Highest Power Of Two
 //helper function, returns first number > v that is a power of 2, or v if v is already a power of 2
 U32 nhpo2(U32 v)
@@ -294,6 +290,7 @@ void LLVBOPool::seedPool()
 }
 
 
+
 void LLVBOPool::cleanup()
 {
 	U32 size = LL_VBO_BLOCK_SIZE;
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 09480968a67cd39d63a83e641ef712968e7fec73..629eef2c3bc024c8d0236551026395427825c74b 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -1488,6 +1488,10 @@ bool LLNotifications::loadTemplates()
 			{
 				replaceFormText(notification.form_ref.form, "$canceltext", notification.form_ref.form_template.cancel_text);
 			}
+			if(notification.form_ref.form_template.help_text.isProvided())
+			{
+				replaceFormText(notification.form_ref.form, "$helptext", notification.form_ref.form_template.help_text);
+			}
 			if(notification.form_ref.form_template.ignore_text.isProvided())
 			{
 				replaceFormText(notification.form_ref.form, "$ignoretext", notification.form_ref.form_template.ignore_text);
diff --git a/indra/llui/llnotificationtemplate.h b/indra/llui/llnotificationtemplate.h
index 72973789db246efdb3c5eab3194ee6c6c4a58978..b3b0bae86271527fa91b309533b51bfb2582f4dd 100644
--- a/indra/llui/llnotificationtemplate.h
+++ b/indra/llui/llnotificationtemplate.h
@@ -121,6 +121,7 @@ struct LLNotificationTemplate
 		Optional<std::string>	yes_text,
 								no_text,
 								cancel_text,
+								help_text,
 								ignore_text;
 
 		TemplateRef()
@@ -128,6 +129,7 @@ struct LLNotificationTemplate
 			yes_text("yestext"),
 			no_text("notext"),
 			cancel_text("canceltext"),
+			help_text("helptext"),
 			ignore_text("ignoretext")
 		{}
 	};
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index b3e1b63db58a4d788001458509c34c8aacc87b2e..802914e25be4c9f3b707bde5841279ae3d255b9b 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -389,6 +389,22 @@ std::vector<LLScrollListItem*> LLScrollListCtrl::getAllSelected() const
 	return ret;
 }
 
+S32 LLScrollListCtrl::getNumSelected() const
+{
+	S32 numSelected = 0;
+
+	for(item_list::const_iterator iter = mItemList.begin(); iter != mItemList.end(); ++iter)
+	{
+		LLScrollListItem* item  = *iter;
+		if (item->getSelected())
+		{
+			++numSelected;
+		}
+	}
+
+	return numSelected;
+}
+
 S32 LLScrollListCtrl::getFirstSelectedIndex() const
 {
 	S32 CurSelectedIndex = 0;
diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h
index ae8aea92457bb98fb8c531b3bf911f9937a2bab5..44d96358381b046a21af7d6d1800fb50dc15cc6f 100644
--- a/indra/llui/llscrolllistctrl.h
+++ b/indra/llui/llscrolllistctrl.h
@@ -257,6 +257,7 @@ class LLScrollListCtrl : public LLUICtrl, public LLEditMenuHandler,
 	LLScrollListItem*	getFirstSelected() const;
 	virtual S32			getFirstSelectedIndex() const;
 	std::vector<LLScrollListItem*> getAllSelected() const;
+	S32                 getNumSelected() const;
 	LLScrollListItem*	getLastSelectedItem() const { return mLastSelected; }
 
 	// iterate over all items
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 6f0d90be06765fa03801977592efdbddc86a8793..9a4dd41c4e789c87da8b6118ac99d8b16dca75d9 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -1702,6 +1702,12 @@ void LLWindowWin32::initCursors()
 	mCursor[ UI_CURSOR_TOOLSIT ]	= LoadCursor(module, TEXT("TOOLSIT"));
 	mCursor[ UI_CURSOR_TOOLBUY ]	= LoadCursor(module, TEXT("TOOLBUY"));
 	mCursor[ UI_CURSOR_TOOLOPEN ]	= LoadCursor(module, TEXT("TOOLOPEN"));
+	mCursor[ UI_CURSOR_TOOLPATHFINDING ]	= LoadCursor(module, TEXT("TOOLPATHFINDING"));
+	mCursor[ UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD ]	= LoadCursor(module, TEXT("TOOLPATHFINDINGPATHSTARTADD"));
+	mCursor[ UI_CURSOR_TOOLPATHFINDING_PATH_START ]	= LoadCursor(module, TEXT("TOOLPATHFINDINGPATHSTART"));
+	mCursor[ UI_CURSOR_TOOLPATHFINDING_PATH_END ]	= LoadCursor(module, TEXT("TOOLPATHFINDINGPATHEND"));
+	mCursor[ UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD ]	= LoadCursor(module, TEXT("TOOLPATHFINDINGPATHENDADD"));
+	mCursor[ UI_CURSOR_TOOLNO ]	= LoadCursor(module, TEXT("TOOLNO"));
 
 	// Color cursors
 	mCursor[ UI_CURSOR_TOOLPLAY ]		= loadColorCursor(TEXT("TOOLPLAY"));
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 65170a214099dc8511d1b4e2900649a463e533a0..753dbd7438643e283a6b0f05c0b9d6869cac8d87 100755
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -18,12 +18,12 @@ include(JsonCpp)
 include(LLAudio)
 include(LLCharacter)
 include(LLCommon)
-include(LLConvexDecomposition)
 include(LLImage)
 include(LLImageJ2COJ)
 include(LLInventory)
 include(LLMath)
 include(LLMessage)
+include(LLPhysicsExtensions)
 include(LLPlugin)
 include(LLPrimitive)
 include(LLRender)
@@ -45,6 +45,8 @@ include(VisualLeakDetector)
 include(GLOD)
 include(CMakeCopyIfDifferent)
 
+add_subdirectory(${LLPHYSICSEXTENSIONS_SRC_DIR} llphysicsextensions)
+
 include_directories(
     ${DBUSGLIB_INCLUDE_DIRS}
     ${JSONCPP_INCLUDE_DIR}
@@ -52,13 +54,14 @@ include_directories(
     ${LLAUDIO_INCLUDE_DIRS}
     ${LLCHARACTER_INCLUDE_DIRS}
     ${LLCOMMON_INCLUDE_DIRS}
-    ${LLCONVEXDECOMP_INCLUDE_DIRS}
+    ${LLPHYSICS_INCLUDE_DIRS}
     ${FMOD_INCLUDE_DIR}
     ${LLIMAGE_INCLUDE_DIRS}
     ${LLKDU_INCLUDE_DIRS}
     ${LLINVENTORY_INCLUDE_DIRS}
     ${LLMATH_INCLUDE_DIRS}
     ${LLMESSAGE_INCLUDE_DIRS}
+    ${LLPHYSICSEXTENSIONS_INCLUDE_DIRS}
     ${LLPLUGIN_INCLUDE_DIRS}
     ${LLPRIMITIVE_INCLUDE_DIRS}
     ${LLRENDER_INCLUDE_DIRS}
@@ -219,6 +222,10 @@ set(viewer_SOURCE_FILES
     llfloaterobjectweights.cpp
     llfloateropenobject.cpp
     llfloateroutbox.cpp
+    llfloaterpathfindingcharacters.cpp
+    llfloaterpathfindingconsole.cpp
+    llfloaterpathfindinglinksets.cpp
+    llfloaterpathfindingobjects.cpp
     llfloaterpay.cpp
     llfloaterperms.cpp
     llfloaterpostprocess.cpp
@@ -388,6 +395,7 @@ set(viewer_SOURCE_FILES
     llpanelonlinestatus.cpp
     llpaneloutfitedit.cpp
     llpaneloutfitsinventory.cpp
+    llpanelpathfindingrebakenavmesh.cpp
     llpanelpeople.cpp
     llpanelpeoplemenus.cpp
     llpanelpermissions.cpp
@@ -416,6 +424,17 @@ set(viewer_SOURCE_FILES
     llparcelselection.cpp
     llparticipantlist.cpp
     llpatchvertexarray.cpp
+    llpathfindingcharacter.cpp
+    llpathfindingcharacterlist.cpp
+    llpathfindinglinkset.cpp
+    llpathfindinglinksetlist.cpp
+    llpathfindingmanager.cpp
+    llpathfindingnavmesh.cpp
+    llpathfindingnavmeshstatus.cpp
+    llpathfindingnavmeshzone.cpp
+    llpathfindingobject.cpp
+    llpathfindingobjectlist.cpp
+    llpathfindingpathtool.cpp
     llphysicsmotion.cpp
     llphysicsshapebuilderutil.cpp
     llplacesinventorybridge.cpp
@@ -779,6 +798,10 @@ set(viewer_HEADER_FILES
     llfloaterobjectweights.h
     llfloateropenobject.h
     llfloateroutbox.h
+    llfloaterpathfindingcharacters.h
+    llfloaterpathfindingconsole.h
+    llfloaterpathfindinglinksets.h
+    llfloaterpathfindingobjects.h
     llfloaterpay.h
     llfloaterperms.h
     llfloaterpostprocess.h
@@ -942,6 +965,7 @@ set(viewer_HEADER_FILES
     llpanelonlinestatus.h
     llpaneloutfitedit.h
     llpaneloutfitsinventory.h
+    llpanelpathfindingrebakenavmesh.h
     llpanelpeople.h
     llpanelpeoplemenus.h
     llpanelpermissions.h
@@ -965,6 +989,17 @@ set(viewer_HEADER_FILES
     llparcelselection.h
     llparticipantlist.h
     llpatchvertexarray.h
+    llpathfindingcharacter.h
+    llpathfindingcharacterlist.h
+    llpathfindinglinkset.h
+    llpathfindinglinksetlist.h
+    llpathfindingmanager.h
+    llpathfindingnavmesh.h
+    llpathfindingnavmeshstatus.h
+    llpathfindingnavmeshzone.h
+    llpathfindingobject.h
+    llpathfindingobjectlist.h
+    llpathfindingpathtool.h
     llphysicsmotion.h
     llphysicsshapebuilderutil.h
     llplacesinventorybridge.h
@@ -1314,6 +1349,11 @@ if (WINDOWS)
         res/lltoolgrab.cur
         res/lltoolland.cur
         res/lltoolpan.cur
+        res/lltoolpathfinding.cur
+        res/lltoolpathfindingpathend.cur
+        res/lltoolpathfindingpathendadd.cur
+        res/lltoolpathfindingpathstart.cur
+        res/lltoolpathfindingpathstartadd.cur
         res/lltoolpipette.cur
         res/lltoolrotate.cur
         res/lltoolscale.cur
@@ -1521,11 +1561,9 @@ set(PACKAGE ON CACHE BOOL
 if (WINDOWS)
     set_target_properties(${VIEWER_BINARY_NAME}
         PROPERTIES
-        # *TODO -reenable this once we get server usage sorted out
-        #LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS /INCLUDE:\"__tcmalloc\""
-        LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS /INCLUDE:__tcmalloc"
+        LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS ${TCMALLOC_LINK_FLAGS}"
         LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO"
-        LINK_FLAGS_RELEASE ""
+        LINK_FLAGS_RELEASE "/FORCE:MULTIPLE /MAP\"secondlife-bin.MAP\" /OPT:REF"
         )
     if(USE_PRECOMPILED_HEADERS)
         set_target_properties(
@@ -1542,7 +1580,7 @@ if (WINDOWS)
     # In the meantime, if you have any ideas on how to easily maintain one list, either here or in viewer_manifest.py
     # and have the build deps get tracked *please* tell me about it.
 
-    if(USE_GOOGLE_PERFTOOLS)
+    if(USE_TCMALLOC)
       # Configure a var for tcmalloc location, if used.
       # Note the need to specify multiple names explicitly.
       set(GOOGLE_PERF_TOOLS_SOURCE
@@ -1550,7 +1588,7 @@ if (WINDOWS)
         ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/libtcmalloc_minimal.dll
         ${SHARED_LIB_STAGING_DIR}/Debug/libtcmalloc_minimal-debug.dll
         )
-     endif(USE_GOOGLE_PERFTOOLS)
+     endif(USE_TCMALLOC)
 
 
     set(COPY_INPUT_DEPENDENCIES
@@ -1733,6 +1771,17 @@ if (WINDOWS)
         #${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.bz2)
 
     endif (PACKAGE)
+elseif (DARWIN)
+    set_target_properties(${VIEWER_BINARY_NAME}
+        PROPERTIES
+        LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Xlinker -dead_strip -Xlinker -map -Xlinker ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME}.MAP"
+        )
+else (WINDOWS)
+        # Linux 
+    set_target_properties(${VIEWER_BINARY_NAME}
+        PROPERTIES
+        LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Wl,--Map=${VIEWER_BINARY_NAME}.MAP"
+        )
 endif (WINDOWS)
 
 # *NOTE - this list is very sensitive to ordering, test carefully on all
@@ -1780,7 +1829,8 @@ target_link_libraries(${VIEWER_BINARY_NAME}
     ${OPENSSL_LIBRARIES}
     ${CRYPTO_LIBRARIES}
     ${LLLOGIN_LIBRARIES}
-    ${LLCONVEXDECOMP_LIBRARY}
+    ${LLPHYSICS_LIBRARIES}
+    ${LLPHYSICSEXTENSIONS_LIBRARIES}
     ${TCMALLOC_LIBRARIES}
     )
 
diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml
index be79f919198612f0be1b54ad7b04d2b09a75a339..711191128b59257019f531a38ebae96ba9d0214e 100644
--- a/indra/newview/app_settings/cmd_line.xml
+++ b/indra/newview/app_settings/cmd_line.xml
@@ -101,7 +101,7 @@
     <key>grid</key>
     <map>
       <key>desc</key>
-      <string>Specify the name of the grid, local, or an IP address to connect to.</string>
+      <string>Specify the name of the grid to connect to.</string>
       <key>count</key>
       <integer>1</integer>
       <key>map-to</key>
@@ -117,16 +117,6 @@
       <string>h</string>
     </map>
 
-    <key>helperuri</key>
-    <map>
-      <key>desc</key>
-      <string>helper web CGI prefix to use</string>
-      <key>count</key>
-      <integer>1</integer>
-      <key>map-to</key>
-      <string>CmdLineHelperURI</string>
-    </map>
-
     <key>ignorepixeldepth</key>
     <map>
       <key>desc</key>
@@ -163,7 +153,7 @@
       <key>map-to</key>
       <string>UserLogFile</string>
     </map>
-    
+
     <key>login</key>
     <map>
       <key>desc</key>
@@ -174,28 +164,6 @@
       <string>UserLoginInfo</string>
     </map>
 
-    <key>loginpage</key>
-    <map>
-      <key>desc</key>
-      <string>Login authentication page to use.</string>
-      <key>count</key>
-      <integer>1</integer>
-      <key>map-to</key>
-      <string>LoginPage</string>
-    </map>
-
-    <key>loginuri</key>
-    <map>
-      <key>desc</key>
-      <string>login server and CGI script to use</string>
-      <key>count</key>
-      <integer>1</integer>
-      <key>compose</key>
-      <boolean>true</boolean>
-      <key>map-to</key>
-      <string>CmdLineLoginURI</string>
-    </map>
-
     <key>logmetrics</key>
     <map>
       <key>desc</key>
@@ -226,7 +194,7 @@
     <map>
       <key>map-to</key>
       <string>NoAudio</string>
-    </map>
+    </map>    
 
     <key>noinvlib</key>
     <map>
@@ -242,7 +210,7 @@
       <string>User will not get any notifications. NOTE: All notifications that occur will get added to ignore file for future runs.</string>
       <key>map-to</key>
       <string>IgnoreAllNotifications</string>      
-    </map>    
+    </map>
 
     <key>nopreload</key>
     <map>
@@ -321,7 +289,7 @@
       <key>map-to</key>
       <string>QuitAfterSeconds</string>
     </map>
-    
+
     <key>replaysession</key>
     <map>
       <key>desc</key>
@@ -335,7 +303,7 @@
       <key>map-to</key>
       <string>RotateRight</string>
     </map>
-
+    
     <key>safe</key>
     <map>
       <key>desc</key>
diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini
index 318b69438a761e4d4cff495aa80f535295517a85..6120f22ba4400f5a8c75e81c4ef992bced30c35a 100644
--- a/indra/newview/app_settings/keywords.ini
+++ b/indra/newview/app_settings/keywords.ini
@@ -559,6 +559,98 @@ STATUS_NOT_SUPPORTED                   Feature not supported
 STATUS_INTERNAL_ERROR                  An internal error occurred
 STATUS_WHITELIST_FAILED                URL failed to pass whitelist
 
+PROFILE_NONE               Disables profiling
+PROFILE_SCRIPT_MEMORY      Enables memory profiling
+
+RC_DATA_FLAGS          TODO: add documentation
+RC_DETECT_PHANTOM      TODO: add documentation
+RC_GET_LINK_NUM        TODO: add documentation
+RC_GET_NORMAL          TODO: add documentation
+RC_GET_ROOT_KEY        TODO: add documentation
+RC_MAX_HITS            TODO: add documentation
+RC_REJECT_TYPES			Optional parameter set in llCastRay() to reject hit against certain object types.
+RC_REJECT_AGENTS		Bit mask for RC_REJECT_TYPES, rejects hits against avatars.
+RC_REJECT_PHYSICAL		Bit mask for RC_REJECT_TYPES, rejects hits against moving objects.
+RC_REJECT_NONPHYSICAL	Bit mask for RC_REJECT_TYPES, rejects hits against non-moving objects.
+RC_REJECT_LAND			Bit mask for RC_REJECT_TYPES, rejects hits against the terrian.
+
+RCERR_CAST_TIME_EXCEEDED    TODO: add documentation
+RCERR_SIM_PERF_LOW          TODO: add documentation
+RCERR_UNKNOWN               TODO: add documentation
+
+ESTATE_ACCESS_ALLOWED_AGENT_ADD    TODO: add documentation
+ESTATE_ACCESS_ALLOWED_AGENT_REMOVE TODO: add documentation
+ESTATE_ACCESS_ALLOWED_GROUP_ADD    TODO: add documentation
+ESTATE_ACCESS_ALLOWED_GROUP_REMOVE TODO: add documentation
+ESTATE_ACCESS_BANNED_AGENT_ADD     TODO: add documentation
+ESTATE_ACCESS_BANNED_AGENT_REMOVE  TODO: add documentation
+
+DENSITY 			TODO: add documentation
+FRICTION 			TODO: add documentation
+RESTITUTION 		TODO: add documentation
+GRAVITY_MULTIPLIER 	TODO: add documentation
+
+KFM_COMMAND			TODO: add documentation
+KFM_CMD_PLAY		TODO: add documentation
+KFM_CMD_STOP		TODO: add documentation
+KFM_CMD_PAUSE		TODO: add documentation
+KFM_CMD_SET_MODE	TODO: add documentation
+KFM_MODE			TODO: add documentation
+KFM_FORWARD			TODO: add documentation
+KFM_LOOP			TODO: add documentation
+KFM_PING_PONG		TODO: add documentation
+KFM_REVERSE			TODO: add documentation
+KFM_DATA			TODO: add documentation
+KFM_ROTATION		TODO: add documentation
+KFM_TRANSLATION		TODO: add documentation
+
+CHARACTER_CMD_STOP	TODO: add documentation
+CHARACTER_CMD_JUMP	TODO: add documentation
+
+CHARACTER_DESIRED_SPEED		TODO: add documentation
+CHARACTER_RADIUS			TODO: add documentation
+CHARACTER_LENGTH			TODO: add documentation
+CHARACTER_ORIENTATION		TODO: add documentation
+CHARACTER_AVOIDANCE_MODE	TODO: add documentation
+PURSUIT_OFFSET				TODO: add documentation
+REQUIRE_LINE_OF_SIGHT		TODO: add documentation
+PURSUIT_FUZZ_FACTOR			TODO: add documentation
+PURSUIT_INTERCEPT			TODO: add documentation
+FORCE_DIRECT_PATH			TODO: add documentation
+VERTICAL					TODO: add documentation
+HORIZONTAL					TODO: add documentation
+AVOID_CHARACTERS			TODO: add documentation
+AVOID_DYNAMIC_OBSTACLES		TODO: add documentation
+
+PU_EVADE_HIDDEN                  Triggered when an llEvade character thinks it has hidden from its pursuer.
+PU_EVADE_SPOTTED                 Triggered when an llEvade character switches from hiding to running
+PU_FAILURE_INVALID_GOAL          Goal is not on the navigation-mesh and cannot be reached.
+PU_FAILURE_INVALID_START         Character cannot navigate from the current location - e.g., the character is off the navmesh or too high above it.
+PU_FAILURE_NO_VALID_DESTINATION  There's no good place for the character to go - e.g., it is patrolling and all the patrol points are now unreachable.
+PU_FAILURE_OTHER			     Unknown failure
+PU_FAILURE_TARGET_GONE           Target (for llPursue or llEvade) can no longer be tracked - e.g., it left the region or is an avatar that is now more than about 30m outside the region.
+PU_FAILURE_UNREACHABLE           Goal is no longer reachable for some reason - e.g., an obstacle blocks the path.
+PU_GOAL_REACHED                  Character has reached the goal and will stop or choose a new goal (if wandering).
+PU_SLOWDOWN_DISTANCE_REACHED     Character is near current goal.
+
+CHARACTER_TYPE			TODO: add documentation
+CHARACTER_TYPE_A		TODO: add documentation
+CHARACTER_TYPE_B		TODO: add documentation
+CHARACTER_TYPE_C		TODO: add documentation
+CHARACTER_TYPE_D		TODO: add documentation
+CHARACTER_TYPE_NONE		TODO: add documentation
+
+TRAVERSAL_TYPE			TODO: add documentation
+TRAVERSAL_TYPE_SLOW		TODO: add documentation
+TRAVERSAL_TYPE_FAST		TODO: add documentation
+TRAVERSAL_TYPE_NONE		TODO: add documentation
+
+CHARACTER_MAX_ACCEL				TODO: add documentation
+CHARACTER_MAX_DECEL				TODO: add documentation
+CHARACTER_MAX_ANGULAR_SPEED		TODO: add documentation
+CHARACTER_MAX_ANGULAR_ACCEL		TODO: add documentation
+CHARACTER_TURN_SPEED_MULTIPLIER	TODO: add documentation
+
 # string constants
 [word .1, .3, .5]
 NULL_KEY			Indicates an empty key
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 47b1222f3c8cb252d0d0f5ec0dc8b36cada4b410..ae95d7d9b759957036cf2c8a3c7000336c71d4bf 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -13752,5 +13752,312 @@
       <key>Value</key>
       <integer>0</integer>
     </map>
+	<key>PathfindingRetrieveNeighboringRegion</key>
+    <map>
+      <key>Comment</key>
+      <string>Download a neighboring region when visualizing a pathfinding navmesh (default val 99 means do not download neighbors).</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>U32</string>
+      <key>Value</key>
+	  <integer>99</integer>
+    </map>
+	<key>PathfindingNavMeshClear</key>
+    <map>
+      <key>Comment</key>
+      <string>Background color when displaying pathfinding navmesh.</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>Color4</string>
+      <key>Value</key>
+      <array>
+        <real>0</real>
+        <real>0</real>
+        <real>0</real>
+        <real>1.0</real>
+      </array>
+    </map>
+ <key>PathfindingWalkable</key>
+    <map>
+      <key>Comment</key>
+      <string>Color of walkable objects when displaying pathfinding navmesh object types.</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>Color4</string>
+      <key>Value</key>
+      <array>
+        <real>0.45490196078431372549019607843137</real>
+        <real>0.93333333333333333333333333333333</real>
+        <real>0.38823529411764705882352941176471</real>
+        <real>1.0</real>
+      </array>
+    </map>
+ <key>PathfindingObstacle</key>
+    <map>
+      <key>Comment</key>
+      <string>Color of static obstacle objects when displaying pathfinding navmesh object types.</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>Color4</string>
+      <key>Value</key>
+      <array>
+        <real>1.0</real>
+        <real>0.0</real>
+        <real>0.0</real>
+        <real>1.0</real>
+      </array>
+    </map>
+ <key>PathfindingMaterial</key>
+    <map>
+      <key>Comment</key>
+      <string>Color of material volumes when displaying pathfinding navmesh object types.</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>Color4</string>
+      <key>Value</key>
+      <array>
+        <real>0.5</real>
+        <real>0.0</real>
+        <real>1.0</real>
+        <real>0.3</real>
+      </array>
+    </map>
+ <key>PathfindingExclusion</key>
+    <map>
+      <key>Comment</key>
+      <string>Color of exclusion volumes when displaying pathfinding navmesh object types.</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>Color4</string>
+      <key>Value</key>
+      <array>
+        <real>1.0</real>
+        <real>1.0</real>
+        <real>0.0</real>
+        <real>0.3</real>
+      </array>
+    </map>
+ <key>PathfindingConnectedEdge</key>
+    <map>
+      <key>Comment</key>
+      <string>Color of a connected (crossable) edge when displaying pathfinding navmesh.</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>Color4</string>
+      <key>Value</key>
+      <array>
+        <real>0.86</real>
+        <real>0.86</real>
+        <real>0.86</real>
+        <real>1.0</real>
+      </array>
+    </map>
+ <key>PathfindingBoundaryEdge</key>
+    <map>
+      <key>Comment</key>
+      <string>Color of a boundary (non-crossable) edge when displaying pathfinding navmesh.</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>Color4</string>
+      <key>Value</key>
+      <array>
+        <real>1.0</real>
+        <real>0.0</real>
+        <real>0.0</real>
+        <real>1.0</real>
+      </array>
+    </map>
+ <key>PathfindingHeatColorBase</key>
+    <map>
+      <key>Comment</key>
+      <string>Color of the least walkable value when displaying the pathfinding navmesh as a heatmap.</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>Color4</string>
+      <key>Value</key>
+      <array>
+        <real>1.0</real>
+        <real>0.0</real>
+        <real>0.0</real>
+        <real>1.0</real>
+      </array>
+    </map>
+ <key>PathfindingHeatColorMax</key>
+    <map>
+      <key>Comment</key>
+      <string>Color of the most walkable value when displaying the pathfinding navmesh as a heatmap.</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>Color4</string>
+      <key>Value</key>
+      <array>
+        <real>1.0</real>
+        <real>1.0</real>
+        <real>1.0</real>
+        <real>1.0</real>
+      </array>
+    </map>
+  <key>PathfindingFaceColor</key>
+    <map>
+      <key>Comment</key>
+      <string>Color of the faces when displaying the default view of the pathfinding navmesh.</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>Color4</string>
+      <key>Value</key>
+      <array>
+        <real>1.0</real>
+        <real>1.0</real>
+        <real>1.0</real>
+        <real>1.0</real>
+      </array>
+    </map>
+ 	 <key>PathfindingTestPathValidEndColor</key>
+    <map>
+      <key>Comment</key>
+      <string>Color of the pathfinding test-pathing tool end-point when the path is valid.</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>Color4</string>
+      <key>Value</key>
+      <array>
+        <real>0.78</real>
+        <real>0.47</real>
+        <real>0.0</real>
+        <real>1.0</real>
+      </array>
+    </map>
+     <key>PathfindingTestPathInvalidEndColor</key>
+    <map>
+      <key>Comment</key>
+      <string>Color of the pathfinding test-pathing tool end-point when the path is invalid.</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>Color4</string>
+      <key>Value</key>
+      <array>
+        <real>1.0</real>
+        <real>0.0</real>
+        <real>1.0</real>
+        <real>1.0</real>
+      </array>
+    </map>
+	 <key>PathfindingTestPathColor</key>
+    <map>
+      <key>Comment</key>
+      <string>Color of the pathfinding test-path when the path is valid.</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>Color4</string>
+      <key>Value</key>
+      <array>
+        <real>1.0</real>
+        <real>0.59</real>
+        <real>0.0</real>
+        <real>0.9</real>
+      </array>
+    </map>
+  <key>PathfindingAmbiance</key>
+  <map>
+    <key>Comment</key>
+    <string>Ambiance of lit pathfinding navmesh displays.</string>
+    <key>Persist</key>
+    <integer>0</integer>
+    <key>Type</key>
+    <string>F32</string>
+    <key>Value</key>
+    <real>0.5</real>
+  </map>
+
+  <key>PathfindingXRayTint</key>
+  <map>
+    <key>Comment</key>
+    <string>Amount to darken/lighten x-ray lines in pathfinding display.</string>
+    <key>Persist</key>
+    <integer>0</integer>
+    <key>Type</key>
+    <string>F32</string>
+    <key>Value</key>
+    <real>0.8</real>
+  </map>
+
+  <key>PathfindingXRayOpacity</key>
+  <map>
+    <key>Comment</key>
+    <string>Opacity of xray lines in pathfinding display.</string>
+    <key>Persist</key>
+    <integer>0</integer>
+    <key>Type</key>
+    <string>F32</string>
+    <key>Value</key>
+    <real>0.25</real>
+  </map>
+
+  <key>PathfindingXRayWireframe</key>
+  <map>
+    <key>Comment</key>
+    <string>Render pathfinding navmesh xray as a wireframe.</string>
+    <key>Persist</key>
+    <integer>0</integer>
+    <key>Type</key>
+    <string>Boolean</string>
+    <key>Value</key>
+    <integer>0</integer>
+  </map>
+  
+  <key>PathfindingLineWidth</key>
+  <map>
+    <key>Comment</key>
+    <string>Width of volume outlines in pathfinding navmesh display.</string>
+    <key>Persist</key>
+    <integer>0</integer>
+    <key>Type</key>
+    <string>F32</string>
+    <key>Value</key>
+    <real>2.0</real>
+  </map>
+
+  <key>PathfindingLineOffset</key>
+  <map>
+    <key>Comment</key>
+    <string>Depth offset of volume outlines in pathfinding display.</string>
+    <key>Persist</key>
+    <integer>0</integer>
+    <key>Type</key>
+    <string>F32</string>
+    <key>Value</key>
+    <real>2.3</real>
+  </map>
+
+  <key>PathfindingWaterColor</key>
+    <map>
+      <key>Comment</key>
+      <string>Color of water plane when displaying pathfinding navmesh.</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>Color4</string>
+      <key>Value</key>
+      <array>
+        <real>0.0</real>
+        <real>0.0</real>
+        <real>1.0</real>
+        <real>1.0</real>
+      </array>
+    </map>
 </map>
 </llsd>
diff --git a/indra/newview/app_settings/shaders/class1/interface/pathfindingF.glsl b/indra/newview/app_settings/shaders/class1/interface/pathfindingF.glsl
new file mode 100644
index 0000000000000000000000000000000000000000..7379360e178c7fbda7e04bbbfe3eeee73009b140
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/interface/pathfindingF.glsl
@@ -0,0 +1,37 @@
+/** 
+ * @file pathfindingF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, 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$
+ */
+
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor
+#endif
+
+VARYING vec4 vertex_color;
+
+void main() 
+{
+	frag_color = vertex_color;
+}
diff --git a/indra/newview/app_settings/shaders/class1/interface/pathfindingNoNormalV.glsl b/indra/newview/app_settings/shaders/class1/interface/pathfindingNoNormalV.glsl
new file mode 100644
index 0000000000000000000000000000000000000000..19fa6073071e4e3053a6d8a4a4ed7114a06e30d5
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/interface/pathfindingNoNormalV.glsl
@@ -0,0 +1,42 @@
+/** 
+ * @file pathfindingV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, 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$
+ */
+
+uniform mat4 modelview_projection_matrix;
+
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+
+VARYING vec4 vertex_color;
+
+uniform float tint;
+uniform float alpha_scale;
+ 
+void main()
+{
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+
+	vertex_color = vec4(diffuse_color.rgb * tint, diffuse_color.a*alpha_scale);
+}
+
diff --git a/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl b/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl
new file mode 100644
index 0000000000000000000000000000000000000000..91f252cf1eb3575fa4087416cd2b19dd4692e815
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl
@@ -0,0 +1,54 @@
+/** 
+ * @file pathfindingV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, 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$
+ */
+
+uniform mat4 modelview_projection_matrix;
+
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec3 normal;
+
+VARYING vec4 vertex_color;
+
+uniform float tint;
+uniform float ambiance;
+uniform float alpha_scale;
+ 
+void main()
+{
+	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+
+	vec3 l1 = vec3(-0.75, 1, 1.0)*0.5;
+	vec3 l2 = vec3(0.5, -0.6, 0.4)*0.25;
+	vec3 l3 = vec3(0.5, -0.8, 0.3)*0.5;
+
+	float lit = max(dot(normal, l1), 0.0);
+	lit += max(dot(normal, l2), 0.0);
+	lit += max(dot(normal, l3), 0.0);
+
+	lit = clamp(lit, ambiance, 1.0);
+	
+	vertex_color = vec4(diffuse_color.rgb * tint * lit, diffuse_color.a*alpha_scale);
+}
+
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index a6776d4c8d8c556763302a828d3b0aa62fe61dd4..447836910d2044400e742d7b1cf75db882702f04 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -56,6 +56,7 @@
 #include "llnavigationbar.h" // to show/hide navigation bar when changing mouse look state
 #include "llnearbychatbar.h"
 #include "llnotificationsutil.h"
+#include "llpanelpathfindingrebakenavmesh.h"
 #include "llpaneltopinfobar.h"
 #include "llparcel.h"
 #include "llrendersphere.h"
@@ -343,6 +344,7 @@ LLAgent::LLAgent() :
 	mbTeleportKeepsLookAt(false),
 
 	mAgentAccess(new LLAgentAccess(gSavedSettings)),
+	mGodLevelChangeSignal(),
 	mCanEditParcel(false),
 	mTeleportSourceSLURL(new LLSLURL),
 	mTeleportRequest(),
@@ -2000,6 +2002,7 @@ void LLAgent::endAnimationUpdateUI()
 		LLChicletBar::getInstance()->setVisible(TRUE);
 
 		LLPanelStandStopFlying::getInstance()->setVisible(TRUE);
+		LLPanelPathfindingRebakeNavmesh::getInstance()->setVisible(TRUE);
 
 		LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset);
 
@@ -2109,6 +2112,7 @@ void LLAgent::endAnimationUpdateUI()
 		LLChicletBar::getInstance()->setVisible(FALSE);
 
 		LLPanelStandStopFlying::getInstance()->setVisible(FALSE);
+		LLPanelPathfindingRebakeNavmesh::getInstance()->setVisible(FALSE);
 
 		// clear out camera lag effect
 		gAgentCamera.clearCameraLag();
@@ -2794,6 +2798,12 @@ void LLAgent::setAdminOverride(BOOL b)
 void LLAgent::setGodLevel(U8 god_level)	
 { 
 	mAgentAccess->setGodLevel(god_level);
+	mGodLevelChangeSignal(god_level);
+}
+
+LLAgent::god_level_change_slot_t LLAgent::registerGodLevelChanageListener(god_level_change_callback_t pGodLevelChangeCallback)
+{
+	return mGodLevelChangeSignal.connect(pGodLevelChangeCallback);
 }
 
 const LLAgentAccess& LLAgent::getAgentAccess()
diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h
index a505d5bbaea6378e6e95fdc1519e899b131fd3ed..99904e118c15033dd01ebd22bc0a1ef1efe79ca2 100644
--- a/indra/newview/llagent.h
+++ b/indra/newview/llagent.h
@@ -670,6 +670,16 @@ class LLAgent : public LLOldEvents::LLObservable
 	void			requestEnterGodMode();
 	void			requestLeaveGodMode();
 
+	typedef boost::function<void (U8)>         god_level_change_callback_t;
+	typedef boost::signals2::signal<void (U8)> god_level_change_signal_t;
+	typedef boost::signals2::connection        god_level_change_slot_t;
+
+	god_level_change_slot_t registerGodLevelChanageListener(god_level_change_callback_t pGodLevelChangeCallback);
+
+private:
+	god_level_change_signal_t mGodLevelChangeSignal;
+	
+
 	//--------------------------------------------------------------------
 	// Maturity
 	//--------------------------------------------------------------------
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 6a4f6e4a027be89e488cf7e45fad09a47e7556fb..8594a13df05800201161894a5bab7f6399c398fe 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -89,6 +89,7 @@
 #include "lllogininstance.h"
 #include "llprogressview.h"
 #include "llvocache.h"
+#include "llvopartgroup.h"
 #include "llweb.h"
 #include "llsecondlifeurls.h"
 #include "llupdaterservice.h"
@@ -108,6 +109,7 @@
 #include "llvfsthread.h"
 #include "llvolumemgr.h"
 #include "llxfermanager.h"
+#include "llphysicsextensions.h"
 
 #include "llnotificationmanager.h"
 #include "llnotifications.h"
@@ -678,6 +680,9 @@ bool LLAppViewer::init()
 	// initialize SSE options
 	LLVector4a::initClass();
 
+	//initialize particle index pool
+	LLVOPartGroup::initClass();
+
 	// Need to do this initialization before we do anything else, since anything
 	// that touches files should really go through the lldir API
 	gDirUtilp->initAppDirs("SecondLife");
@@ -1608,6 +1613,9 @@ bool LLAppViewer::cleanup()
 	// shut down mesh streamer
 	gMeshRepo.shutdown();
 
+	// shut down Havok
+	LLPhysicsExtensions::quitSystem();
+
 	// Must clean up texture references before viewer window is destroyed.
 	if(LLHUDManager::instanceExists())
 	{
@@ -3101,8 +3109,8 @@ void LLAppViewer::writeSystemInfo()
 	gDebugInfo["OSInfo"] = getOSInfo().getOSStringSimple();
 
 	// The user is not logged on yet, but record the current grid choice login url
-	// which may have been the intended grid. This can b
-	gDebugInfo["GridName"] = LLGridManager::getInstance()->getGridLabel();
+	// which may have been the intended grid. 
+	gDebugInfo["GridName"] = LLGridManager::getInstance()->getGridId();
 
 	// *FIX:Mani - move this down in llappviewerwin32
 #ifdef LL_WINDOWS
@@ -5060,7 +5068,7 @@ void LLAppViewer::launchUpdater()
 #endif
 	// *TODO change userserver to be grid on both viewer and sim, since
 	// userserver no longer exists.
-	query_map["userserver"] = LLGridManager::getInstance()->getGridLabel();
+	query_map["userserver"] = LLGridManager::getInstance()->getGridId();
 	query_map["channel"] = LLVersionInfo::getChannel();
 	// *TODO constantize this guy
 	// *NOTE: This URL is also used in win_setup/lldownloader.cpp
diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp
index 48d02dfeaade77a3b13729edbb1ab2925af61897..e8d8efdc0a9c2dc03b82180fd9ea4d6ea33fbbb5 100644
--- a/indra/newview/llappviewerlinux.cpp
+++ b/indra/newview/llappviewerlinux.cpp
@@ -365,7 +365,7 @@ void LLAppViewerLinux::handleCrashReporting(bool reportFreeze)
 		const char * cmdargv[] =
 			{cmd.c_str(),
 			 "-user",
-			 (char*)LLGridManager::getInstance()->getGridLabel().c_str(),
+			 (char*)LLGridManager::getInstance()->getGridId().c_str(),
 			 "-name",
 			 LLAppViewer::instance()->getSecondLifeTitle().c_str(),
 			 NULL};
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index bad60a9757af3e116170e330d8d1891f136b4d80..53c77fa22e52e09d13448a06c980c3903a78f488 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -130,6 +130,8 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
 	// This results in a 2-3x improvement in opening a new Inventory window (which uses a large numebr of allocations)
 	// Note: This won't work when running from the debugger unless the _NO_DEBUG_HEAP environment variable is set to 1
 
+	// Enable to get mem debugging within visual studio.
+	//_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
 	_CrtSetDbgFlag(0); // default, just making explicit
 	
 	ULONG ulEnableLFH = 2;
diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp
old mode 100755
new mode 100644
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index 108ec92f6db6e155ced8338dcc1164f62a2ad70e..89a2e9f407b9293a17099b380448913d339466b7 100644
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -57,6 +57,8 @@ const F32 MIN_SHADOW_CASTER_RADIUS = 2.0f;
 
 static LLFastTimer::DeclareTimer FTM_CULL_REBOUND("Cull Rebound");
 
+extern bool gShiftFrame;
+
 
 ////////////////////////
 //
@@ -108,6 +110,8 @@ void LLDrawable::init()
 	
 	mGeneration = -1;
 	mBinRadius = 1.f;
+	mBinIndex = -1;
+
 	mSpatialBridge = NULL;
 }
 
@@ -714,6 +718,11 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update)
 		return;
 	}
 
+	if (gShiftFrame)
+	{
+		return;
+	}
+
 	//switch LOD with the spatial group to avoid artifacts
 	//LLSpatialGroup* sg = getSpatialGroup();
 
@@ -811,14 +820,19 @@ void LLDrawable::shiftPos(const LLVector4a &shift_vector)
 		mXform.setPosition(mVObjp->getPositionAgent());
 	}
 
-	mXform.setRotation(mVObjp->getRotation());
-	mXform.setScale(1,1,1);
 	mXform.updateMatrix();
 
 	if (isStatic())
 	{
 		LLVOVolume* volume = getVOVolume();
-		if (!volume)
+
+		bool rebuild = (!volume && 
+						getRenderType() != LLPipeline::RENDER_TYPE_TREE &&
+						getRenderType() != LLPipeline::RENDER_TYPE_TERRAIN &&
+						getRenderType() != LLPipeline::RENDER_TYPE_SKY &&
+						getRenderType() != LLPipeline::RENDER_TYPE_GROUND);
+
+		if (rebuild)
 		{
 			gPipeline.markRebuild(this, LLDrawable::REBUILD_ALL, TRUE);
 		}
@@ -832,7 +846,7 @@ void LLDrawable::shiftPos(const LLVector4a &shift_vector)
 				facep->mExtents[0].add(shift_vector);
 				facep->mExtents[1].add(shift_vector);
 			
-				if (!volume && facep->hasGeometry())
+				if (rebuild && facep->hasGeometry())
 				{
 					facep->clearVertexBuffer();
 				}
@@ -943,6 +957,12 @@ void LLDrawable::updateUVMinMax()
 {
 }
 
+LLSpatialGroup* LLDrawable::getSpatialGroup() const
+{ 
+	llassert((mSpatialGroupp == NULL) ? getBinIndex() == -1 : getBinIndex() != -1);
+	return mSpatialGroupp; 
+}
+
 void LLDrawable::setSpatialGroup(LLSpatialGroup *groupp)
 {
 /*if (mSpatialGroupp && (groupp != mSpatialGroupp))
@@ -965,6 +985,8 @@ void LLDrawable::setSpatialGroup(LLSpatialGroup *groupp)
 	}
 
 	mSpatialGroupp = groupp;
+
+	llassert((mSpatialGroupp == NULL) ? getBinIndex() == -1 : getBinIndex() != -1);
 }
 
 LLSpatialPartition* LLDrawable::getSpatialPartition()
@@ -1087,6 +1109,8 @@ LLSpatialBridge::LLSpatialBridge(LLDrawable* root, BOOL render_by_group, U32 dat
 	mDrawable = root;
 	root->setSpatialBridge(this);
 	
+	mBinIndex = -1;
+
 	mRenderType = mDrawable->mRenderType;
 	mDrawableType = mDrawable->mRenderType;
 	
@@ -1390,6 +1414,11 @@ void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update)
 		markDead();
 		return;
 	}
+	
+	if (gShiftFrame)
+	{
+		return;
+	}
 
 	if (mDrawable->getVObj())
 	{
@@ -1468,7 +1497,13 @@ void LLSpatialBridge::cleanupReferences()
 	LLDrawable::cleanupReferences();
 	if (mDrawable)
 	{
-		mDrawable->setSpatialGroup(NULL);
+		LLSpatialGroup* group = mDrawable->getSpatialGroup();
+		if (group)
+		{
+			group->mOctreeNode->remove(mDrawable);
+			mDrawable->setSpatialGroup(NULL);
+		}
+		
 		if (mDrawable->getVObj())
 		{
 			LLViewerObject::const_child_list_t& child_list = mDrawable->getVObj()->getChildren();
@@ -1479,7 +1514,12 @@ void LLSpatialBridge::cleanupReferences()
 				LLDrawable* drawable = child->mDrawable;					
 				if (drawable)
 				{
-					drawable->setSpatialGroup(NULL);
+					LLSpatialGroup* group = drawable->getSpatialGroup();
+					if (group)
+					{
+						group->mOctreeNode->remove(drawable);
+						drawable->setSpatialGroup(NULL);
+					}
 				}
 			}
 		}
diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h
index e2064b79f875037881b9b3ffdfa5611f7e74d3e8..960c64fa9e48c7787de1d14c90f180191e62f8b5 100644
--- a/indra/newview/lldrawable.h
+++ b/indra/newview/lldrawable.h
@@ -59,6 +59,7 @@ class LLViewerTexture;
 const U32 SILHOUETTE_HIGHLIGHT = 0;
 
 // All data for new renderer goes into this class.
+LL_ALIGN_PREFIX(16)
 class LLDrawable : public LLRefCount
 {
 public:
@@ -75,6 +76,16 @@ class LLDrawable : public LLRefCount
 
 	static void initClass();
 
+	void* operator new(size_t size)
+	{
+		return ll_aligned_malloc_16(size);
+	}
+
+	void operator delete(void* ptr)
+	{
+		ll_aligned_free_16(ptr);
+	}
+
 	LLDrawable()				{ init(); }
 	MEM_TYPE_NEW(LLMemType::MTYPE_DRAWABLE);
 	
@@ -109,6 +120,9 @@ class LLDrawable : public LLRefCount
 	F32			          getIntensity() const			{ return llmin(mXform.getScale().mV[0], 4.f); }
 	S32					  getLOD() const				{ return mVObjp ? mVObjp->getLOD() : 1; }
 	F32					  getBinRadius() const			{ return mBinRadius; }
+	S32					  getBinIndex() const			{ return mBinIndex; }
+	void				  setBinIndex(S32 index) const	{ mBinIndex = index; }
+
 	void  getMinMax(LLVector3& min,LLVector3& max) const { mXform.getMinMax(min,max); }
 	LLXformMatrix*		getXform() { return &mXform; }
 
@@ -194,7 +208,7 @@ class LLDrawable : public LLRefCount
 	S32 findReferences(LLDrawable *drawablep); // Not const because of @#$! iterators...
 
 	void setSpatialGroup(LLSpatialGroup *groupp);
-	LLSpatialGroup *getSpatialGroup() const			{ return mSpatialGroupp; }
+	LLSpatialGroup *getSpatialGroup() const;
 	LLSpatialPartition* getSpatialPartition();
 	
 	// Statics
@@ -281,8 +295,8 @@ class LLDrawable : public LLRefCount
 	} EDrawableFlags;
 
 private: //aligned members
-	LLVector4a		mExtents[2];
-	LLVector4a		mPositionGroup;
+	LL_ALIGN_16(LLVector4a		mExtents[2]);
+	LL_ALIGN_16(LLVector4a		mPositionGroup);
 	
 public:
 	LLXformMatrix       mXform;
@@ -315,6 +329,7 @@ class LLDrawable : public LLRefCount
 	mutable U32		mVisible;
 	F32				mRadius;
 	F32				mBinRadius;
+	mutable S32		mBinIndex;
 	S32				mGeneration;
 	
 	LLVector3		mCurrentScale;
@@ -323,7 +338,7 @@ class LLDrawable : public LLRefCount
 
 	static U32 sNumZombieDrawables;
 	static LLDynamicArrayPtr<LLPointer<LLDrawable> > sDeadList;
-};
+} LL_ALIGN_POSTFIX(16);
 
 
 inline LLFace* LLDrawable::getFace(const S32 i) const
diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp
index 35f8a8579671ef3ac9ccaed54c22323a7d6dc032..013c698445d872f953e8ea73a947bf780e81bb66 100644
--- a/indra/newview/lldrawpool.cpp
+++ b/indra/newview/lldrawpool.cpp
@@ -116,6 +116,7 @@ LLDrawPool::LLDrawPool(const U32 type)
 	sNumDrawPools++;
 	mId = sNumDrawPools;
 	mVertexShaderLevel = 0;
+	mSkipRender = false;
 }
 
 LLDrawPool::~LLDrawPool()
@@ -253,48 +254,6 @@ void LLFacePool::dirtyTextures(const std::set<LLViewerFetchedTexture*>& textures
 {
 }
 
-// static
-S32 LLFacePool::drawLoop(face_array_t& face_list)
-{
-	S32 res = 0;
-	if (!face_list.empty())
-	{
-		for (std::vector<LLFace*>::iterator iter = face_list.begin();
-			 iter != face_list.end(); iter++)
-		{
-			LLFace *facep = *iter;
-			res += facep->renderIndexed();
-		}
-	}
-	return res;
-}
-
-// static
-S32 LLFacePool::drawLoopSetTex(face_array_t& face_list, S32 stage)
-{
-	S32 res = 0;
-	if (!face_list.empty())
-	{
-		for (std::vector<LLFace*>::iterator iter = face_list.begin();
-			 iter != face_list.end(); iter++)
-		{
-			LLFace *facep = *iter;
-			gGL.getTexUnit(stage)->bind(facep->getTexture(), TRUE) ;
-			gGL.getTexUnit(0)->activate();
-			res += facep->renderIndexed();
-		}
-	}
-	return res;
-}
-
-void LLFacePool::drawLoop()
-{
-	if (!mDrawFace.empty())
-	{
-		drawLoop(mDrawFace);
-	}
-}
-
 void LLFacePool::enqueue(LLFace* facep)
 {
 	mDrawFace.push_back(facep);
@@ -442,7 +401,7 @@ void LLRenderPass::renderTexture(U32 type, U32 mask)
 
 void LLRenderPass::pushBatches(U32 type, U32 mask, BOOL texture, BOOL batch_textures)
 {
-	for (LLCullResult::drawinfo_list_t::iterator i = gPipeline.beginRenderMap(type); i != gPipeline.endRenderMap(type); ++i)	
+	for (LLCullResult::drawinfo_iterator i = gPipeline.beginRenderMap(type); i != gPipeline.endRenderMap(type); ++i)	
 	{
 		LLDrawInfo* pparams = *i;
 		if (pparams) 
diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h
index 64774d06df78ca0a2f86dcafa30d7c8a1ba5c295..ab9bb9e611ebbf0becf5091cb03fb0422f08c28d 100644
--- a/indra/newview/lldrawpool.h
+++ b/indra/newview/lldrawpool.h
@@ -77,6 +77,9 @@ class LLDrawPool
 	S32 getId() const { return mId; }
 	U32 getType() const { return mType; }
 
+	BOOL getSkipRenderFlag() const { return mSkipRender;}
+	void setSkipRenderFlag( BOOL flag ) { mSkipRender = flag; }
+
 	virtual LLViewerTexture *getDebugTexture();
 	virtual void beginRenderPass( S32 pass );
 	virtual void endRenderPass( S32 pass );
@@ -113,6 +116,7 @@ class LLDrawPool
 	S32 mVertexShaderLevel;
 	S32	mId;
 	U32 mType;				// Type of draw pool
+	BOOL mSkipRender;
 };
 
 class LLRenderPass : public LLDrawPool
@@ -186,10 +190,6 @@ class LLFacePool : public LLDrawPool
 
 	void buildEdges();
 
-	static S32 drawLoop(face_array_t& face_list);
-	static S32 drawLoopSetTex(face_array_t& face_list, S32 stage);
-	void drawLoop();
-
 	void addFaceReference(LLFace *facep);
 	void removeFaceReference(LLFace *facep);
 
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp
index 5f2a982ed313a2a8ce62a3f0ce6857d8cb965608..b4f6bf938366752b0c2e95d5c090d73934963ee4 100644
--- a/indra/newview/lldrawpoolalpha.cpp
+++ b/indra/newview/lldrawpoolalpha.cpp
@@ -348,7 +348,7 @@ void LLDrawPoolAlpha::render(S32 pass)
 
 void LLDrawPoolAlpha::renderAlphaHighlight(U32 mask)
 {
-	for (LLCullResult::sg_list_t::iterator i = gPipeline.beginAlphaGroups(); i != gPipeline.endAlphaGroups(); ++i)
+	for (LLCullResult::sg_iterator i = gPipeline.beginAlphaGroups(); i != gPipeline.endAlphaGroups(); ++i)
 	{
 		LLSpatialGroup* group = *i;
 		if (group->mSpatialPartition->mRenderByGroup &&
@@ -385,7 +385,7 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask)
 	
 	BOOL use_shaders = gPipeline.canUseVertexShaders();
 		
-	for (LLCullResult::sg_list_t::iterator i = gPipeline.beginAlphaGroups(); i != gPipeline.endAlphaGroups(); ++i)
+	for (LLCullResult::sg_iterator i = gPipeline.beginAlphaGroups(); i != gPipeline.endAlphaGroups(); ++i)
 	{
 		LLSpatialGroup* group = *i;
 		llassert(group);
@@ -411,6 +411,12 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask)
 					continue;
 				}
 
+				if ((params.mVertexBuffer->getTypeMask() & mask) != mask)
+				{ //FIXME!
+					llwarns << "Missing required components, skipping render batch." << llendl;
+					continue;
+				}
+
 				LLRenderPass::applyModelMatrix(params);
 
 				
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index ace3a20bbb1413545cbbf0ae68e9e5f01a6787ad..730ad1a364b105484254777ca5c485de35ed930d 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -1036,9 +1036,13 @@ void LLDrawPoolAvatar::endDeferredSkinned()
 	gGL.getTexUnit(0)->activate();
 }
 
+static LLFastTimer::DeclareTimer FTM_RENDER_AVATARS("renderAvatars");
+
 
 void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
 {
+	LLFastTimer t(FTM_RENDER_AVATARS);
+
 	if (pass == -1)
 	{
 		for (S32 i = 1; i < getNumPasses(); i++)
@@ -1195,15 +1199,6 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
 
 	if (pass >= 7 && pass < 9)
 	{
-		LLGLEnable blend(GL_BLEND);
-
-		gGL.setColorMask(true, true);
-		gGL.blendFunc(LLRender::BF_SOURCE_ALPHA,
-					  LLRender::BF_ONE_MINUS_SOURCE_ALPHA,
-					  LLRender::BF_ZERO,
-					  LLRender::BF_ONE_MINUS_SOURCE_ALPHA);
-
-		
 		if (pass == 7)
 		{
 			renderRiggedAlpha(avatarp);
@@ -1219,20 +1214,8 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
 
 	if (pass == 9)
 	{
-		LLGLEnable blend(GL_BLEND);
-		LLGLDisable test(GL_ALPHA_TEST);
-		gGL.flush();
-
-		LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL);
-		glPolygonOffset(-1.0f, -1.0f);
-		gGL.setSceneBlendType(LLRender::BT_ADD);
-
-		LLGLDepthTest depth(GL_TRUE, GL_FALSE);
-		gGL.setColorMask(false, true);
-
 		renderRiggedGlow(avatarp);
-		gGL.setColorMask(true, false);
-		gGL.setSceneBlendType(LLRender::BT_ALPHA);
+		
 		return;
 	}
 	
@@ -1430,7 +1413,7 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace*
 
 void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
 {
-	if (avatar->isSelf() && !gAgent.needsRenderAvatar() || !gMeshRepo.meshRezEnabled())
+	if (avatar->isSelf() && !gAgent.needsRenderAvatar())
 	{
 		return;
 	}
@@ -1559,8 +1542,12 @@ void LLDrawPoolAvatar::renderDeferredRiggedBump(LLVOAvatar* avatar)
 	renderRigged(avatar, RIGGED_DEFERRED_BUMP);
 }
 
+static LLFastTimer::DeclareTimer FTM_RIGGED_VBO("Rigged VBO");
+
 void LLDrawPoolAvatar::updateRiggedVertexBuffers(LLVOAvatar* avatar)
 {
+	LLFastTimer t(FTM_RIGGED_VBO);
+
 	//update rigged vertex buffers
 	for (U32 type = 0; type < NUM_RIGGED_PASSES; ++type)
 	{
@@ -1632,17 +1619,56 @@ void LLDrawPoolAvatar::renderRiggedFullbrightShiny(LLVOAvatar* avatar)
 
 void LLDrawPoolAvatar::renderRiggedAlpha(LLVOAvatar* avatar)
 {
-	renderRigged(avatar, RIGGED_ALPHA);
+	if (!mRiggedFace[RIGGED_ALPHA].empty())
+	{
+		LLGLEnable blend(GL_BLEND);
+
+		gGL.setColorMask(true, true);
+		gGL.blendFunc(LLRender::BF_SOURCE_ALPHA,
+						LLRender::BF_ONE_MINUS_SOURCE_ALPHA,
+						LLRender::BF_ZERO,
+						LLRender::BF_ONE_MINUS_SOURCE_ALPHA);
+
+		renderRigged(avatar, RIGGED_ALPHA);
+	}
 }
 
 void LLDrawPoolAvatar::renderRiggedFullbrightAlpha(LLVOAvatar* avatar)
 {
-	renderRigged(avatar, RIGGED_FULLBRIGHT_ALPHA);
+	if (!mRiggedFace[RIGGED_FULLBRIGHT_ALPHA].empty())
+	{
+		LLGLEnable blend(GL_BLEND);
+
+		gGL.setColorMask(true, true);
+		gGL.blendFunc(LLRender::BF_SOURCE_ALPHA,
+						LLRender::BF_ONE_MINUS_SOURCE_ALPHA,
+						LLRender::BF_ZERO,
+						LLRender::BF_ONE_MINUS_SOURCE_ALPHA);
+
+		renderRigged(avatar, RIGGED_FULLBRIGHT_ALPHA);
+	}
 }
 
 void LLDrawPoolAvatar::renderRiggedGlow(LLVOAvatar* avatar)
 {
-	renderRigged(avatar, RIGGED_GLOW, true);
+	if (!mRiggedFace[RIGGED_GLOW].empty())
+	{
+		LLGLEnable blend(GL_BLEND);
+		LLGLDisable test(GL_ALPHA_TEST);
+		gGL.flush();
+
+		LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL);
+		glPolygonOffset(-1.0f, -1.0f);
+		gGL.setSceneBlendType(LLRender::BT_ADD);
+
+		LLGLDepthTest depth(GL_TRUE, GL_FALSE);
+		gGL.setColorMask(false, true);
+
+		renderRigged(avatar, RIGGED_GLOW, true);
+
+		gGL.setColorMask(true, false);
+		gGL.setSceneBlendType(LLRender::BT_ALPHA);
+	}
 }
 
 
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index 6f71e6ebc8a22fc32bddfaa36b894758d95054b4..a264eae30263c14ffd60d04491e92ad7eb909d8e 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -847,12 +847,12 @@ void LLDrawPoolBump::renderDeferred(S32 pass)
 	LLFastTimer ftm(FTM_RENDER_BUMP);
 
 	U32 type = LLRenderPass::PASS_BUMP;
-	LLCullResult::drawinfo_list_t::iterator begin = gPipeline.beginRenderMap(type);
-	LLCullResult::drawinfo_list_t::iterator end = gPipeline.endRenderMap(type);
+	LLCullResult::drawinfo_iterator begin = gPipeline.beginRenderMap(type);
+	LLCullResult::drawinfo_iterator end = gPipeline.endRenderMap(type);
 
 	U32 mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_BINORMAL | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_COLOR;
 	
-	for (LLCullResult::drawinfo_list_t::iterator i = begin; i != end; ++i)	
+	for (LLCullResult::drawinfo_iterator i = begin; i != end; ++i)	
 	{
 		LLDrawInfo& params = **i;
 
@@ -1448,10 +1448,10 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
 
 void LLDrawPoolBump::renderBump(U32 type, U32 mask)
 {	
-	LLCullResult::drawinfo_list_t::iterator begin = gPipeline.beginRenderMap(type);
-	LLCullResult::drawinfo_list_t::iterator end = gPipeline.endRenderMap(type);
+	LLCullResult::drawinfo_iterator begin = gPipeline.beginRenderMap(type);
+	LLCullResult::drawinfo_iterator end = gPipeline.endRenderMap(type);
 
-	for (LLCullResult::drawinfo_list_t::iterator i = begin; i != end; ++i)	
+	for (LLCullResult::drawinfo_iterator i = begin; i != end; ++i)	
 	{
 		LLDrawInfo& params = **i;
 
diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index b95d8296fa0b3057fb3edc37e99074deb8ead479..7fc78fb382f08e66334ad8a792998de92a4f0a3d 100644
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -294,6 +294,34 @@ void LLDrawPoolTerrain::renderShadow(S32 pass)
 	//glCullFace(GL_BACK);
 }
 
+
+void LLDrawPoolTerrain::drawLoop()
+{
+	if (!mDrawFace.empty())
+	{
+		for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
+			 iter != mDrawFace.end(); iter++)
+		{
+			LLFace *facep = *iter;
+
+			LLMatrix4* model_matrix = &(facep->getDrawable()->getRegion()->mRenderMatrix);
+
+			if (model_matrix != gGLLastMatrix)
+			{
+				gGLLastMatrix = model_matrix;
+				gGL.loadMatrix(gGLModelView);
+				if (model_matrix)
+				{
+					gGL.multMatrix((GLfloat*) model_matrix->mMatrix);
+				}
+				gPipeline.mMatrixOpCount++;
+			}
+
+			facep->renderIndexed();
+		}
+	}
+}
+
 void LLDrawPoolTerrain::renderFullShader()
 {
 	// Hack! Get the region that this draw pool is rendering from!
diff --git a/indra/newview/lldrawpoolterrain.h b/indra/newview/lldrawpoolterrain.h
index 283ed87f1ad6b2785d1f424cae442c0546f19d8d..2163d087e16555dd1c0582817a3b10ccdd2a1b9f 100644
--- a/indra/newview/lldrawpoolterrain.h
+++ b/indra/newview/lldrawpoolterrain.h
@@ -83,6 +83,7 @@ class LLDrawPoolTerrain : public LLFacePool
 	void renderFull2TU();
 	void renderFull4TU();
 	void renderFullShader();
+	void drawLoop();
 };
 
 #endif // LL_LLDRAWPOOLSIMPLE_H
diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp
index 3165a3516c004669d7cc3b946266b33a604faeee..83f04e45a8f95b02d033d5808fb35945df8f3d99 100644
--- a/indra/newview/lldrawpooltree.cpp
+++ b/indra/newview/lldrawpooltree.cpp
@@ -37,6 +37,7 @@
 #include "llviewershadermgr.h"
 #include "llrender.h"
 #include "llviewercontrol.h"
+#include "llviewerregion.h"
 
 S32 LLDrawPoolTree::sDiffTex = 0;
 static LLGLSLShader* shader = NULL;
@@ -104,8 +105,22 @@ void LLDrawPoolTree::render(S32 pass)
 	{
 		LLFace *face = *iter;
 		LLVertexBuffer* buff = face->getVertexBuffer();
+
 		if(buff)
 		{
+			LLMatrix4* model_matrix = &(face->getDrawable()->getRegion()->mRenderMatrix);
+
+			if (model_matrix != gGLLastMatrix)
+			{
+				gGLLastMatrix = model_matrix;
+				gGL.loadMatrix(gGLModelView);
+				if (model_matrix)
+				{
+					gGL.multMatrix((GLfloat*) model_matrix->mMatrix);
+				}
+				gPipeline.mMatrixOpCount++;
+			}
+
 			buff->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK);
 			buff->drawRange(LLRender::TRIANGLES, 0, buff->getNumVerts()-1, buff->getNumIndices(), 0); 
 			gPipeline.addTrianglesDrawn(buff->getNumIndices());
diff --git a/indra/newview/lldriverparam.cpp b/indra/newview/lldriverparam.cpp
index 64eb11fc9b2e90becc78c29777f0c57fe771180c..885cae1737003f2f489139ca583b2c0251f405fc 100644
--- a/indra/newview/lldriverparam.cpp
+++ b/indra/newview/lldriverparam.cpp
@@ -155,6 +155,7 @@ LLDriverParam::LLDriverParam(LLVOAvatar *avatarp) :
 	mAvatarp(avatarp), 
 	mWearablep(NULL)
 {
+	mDefaultVec.clear();
 }
 
 LLDriverParam::LLDriverParam(LLWearable *wearablep) : 
@@ -162,6 +163,7 @@ LLDriverParam::LLDriverParam(LLWearable *wearablep) :
 	mAvatarp(NULL), 
 	mWearablep(wearablep)
 {
+	mDefaultVec.clear();
 }
 
 LLDriverParam::~LLDriverParam()
@@ -341,18 +343,19 @@ F32	LLDriverParam::getTotalDistortion()
 	return sum; 
 }
 
-const LLVector3	&LLDriverParam::getAvgDistortion()	
+const LLVector4a	&LLDriverParam::getAvgDistortion()	
 {
 	// It's not actually correct to take the average of averages, but it good enough here.
-	LLVector3 sum;
+	LLVector4a sum;
+	sum.clear();
 	S32 count = 0;
 	for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ )
 	{
 		LLDrivenEntry* driven = &(*iter);
-		sum += driven->mParam->getAvgDistortion();
+		sum.add(driven->mParam->getAvgDistortion());
 		count++;
 	}
-	sum /= (F32)count;
+	sum.mul( 1.f/(F32)count);
 
 	mDefaultVec = sum;
 	return mDefaultVec; 
@@ -375,21 +378,22 @@ F32	LLDriverParam::getMaxDistortion()
 }
 
 
-LLVector3	LLDriverParam::getVertexDistortion(S32 index, LLPolyMesh *poly_mesh)
+LLVector4a	LLDriverParam::getVertexDistortion(S32 index, LLPolyMesh *poly_mesh)
 {
-	LLVector3 sum;
+	LLVector4a sum;
+	sum.clear();
 	for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ )
 	{
 		LLDrivenEntry* driven = &(*iter);
-		sum += driven->mParam->getVertexDistortion( index, poly_mesh );
+		sum.add(driven->mParam->getVertexDistortion( index, poly_mesh ));
 	}
 	return sum;
 }
 
-const LLVector3*	LLDriverParam::getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh)
+const LLVector4a*	LLDriverParam::getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh)
 {
 	mCurrentDistortionParam = NULL;
-	const LLVector3* v = NULL;
+	const LLVector4a* v = NULL;
 	for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ )
 	{
 		LLDrivenEntry* driven = &(*iter);
@@ -404,7 +408,7 @@ const LLVector3*	LLDriverParam::getFirstDistortion(U32 *index, LLPolyMesh **poly
 	return v;
 };
 
-const LLVector3*	LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **poly_mesh)
+const LLVector4a*	LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **poly_mesh)
 {
 	llassert( mCurrentDistortionParam );
 	if( !mCurrentDistortionParam )
@@ -432,7 +436,7 @@ const LLVector3*	LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **poly_
 	}
 
 	// We're already in the middle of a param's distortions, so get the next one.
-	const LLVector3* v = driven->mParam->getNextDistortion( index, poly_mesh );
+	const LLVector4a* v = driven->mParam->getNextDistortion( index, poly_mesh );
 	if( (!v) && (iter != mDriven.end()) )
 	{
 		// This param is finished, so start the next param.  It might not have any
diff --git a/indra/newview/lldriverparam.h b/indra/newview/lldriverparam.h
index fb1b44458ce76a4eedf162517f278a646abccd17..7a4d711d4e808876b055b89f1b6d06bbf1584d06 100644
--- a/indra/newview/lldriverparam.h
+++ b/indra/newview/lldriverparam.h
@@ -105,18 +105,18 @@ class LLDriverParam : public LLViewerVisualParam
 	
 	// LLViewerVisualParam Virtual functions
 	/*virtual*/ F32					getTotalDistortion();
-	/*virtual*/ const LLVector3&	getAvgDistortion();
+	/*virtual*/ const LLVector4a&	getAvgDistortion();
 	/*virtual*/ F32					getMaxDistortion();
-	/*virtual*/ LLVector3			getVertexDistortion(S32 index, LLPolyMesh *poly_mesh);
-	/*virtual*/ const LLVector3*	getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh);
-	/*virtual*/ const LLVector3*	getNextDistortion(U32 *index, LLPolyMesh **poly_mesh);
+	/*virtual*/ LLVector4a			getVertexDistortion(S32 index, LLPolyMesh *poly_mesh);
+	/*virtual*/ const LLVector4a*	getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh);
+	/*virtual*/ const LLVector4a*	getNextDistortion(U32 *index, LLPolyMesh **poly_mesh);
 
 protected:
 	F32 getDrivenWeight(const LLDrivenEntry* driven, F32 input_weight);
 	void setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight, bool upload_bake);
 
 
-	LLVector3	mDefaultVec; // temp holder
+	LLVector4a	mDefaultVec; // temp holder
 	typedef std::vector<LLDrivenEntry> entry_list_t;
 	entry_list_t mDriven;
 	LLViewerVisualParam* mCurrentDistortionParam;
diff --git a/indra/newview/lldynamictexture.h b/indra/newview/lldynamictexture.h
index e18090545d5b95a91ffdc61544102ce51cacb264..c51e7d1e1a76ff64171cdd483ffc49c5d47c1bb1 100644
--- a/indra/newview/lldynamictexture.h
+++ b/indra/newview/lldynamictexture.h
@@ -36,6 +36,16 @@
 class LLViewerDynamicTexture : public LLViewerTexture
 {
 public:
+	void* operator new(size_t size)
+	{
+		return ll_aligned_malloc_16(size);
+	}
+
+	void operator delete(void* ptr)
+	{
+		ll_aligned_free_16(ptr);
+	}
+
 	enum
 	{
 		LL_VIEWER_DYNAMIC_TEXTURE = LLViewerTexture::DYNAMIC_TEXTURE,
@@ -85,7 +95,7 @@ class LLViewerDynamicTexture : public LLViewerTexture
 protected:
 	BOOL mClamp;
 	LLCoordGL mOrigin;
-	LLCamera mCamera;
+	LL_ALIGN_16(LLCamera mCamera);
 	
 	typedef std::set<LLViewerDynamicTexture*> instance_list_t;
 	static instance_list_t sInstances[ LLViewerDynamicTexture::ORDER_COUNT ];
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index 2060d13ca864bda18212ae7dd2755d06d7e8f657..4a0c94df33fa40d789f41c70656774e0901cd19e 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -163,16 +163,10 @@ void LLFace::init(LLDrawable* drawablep, LLViewerObject* objp)
 	mGeomCount		= 0;
 	mGeomIndex		= 0;
 	mIndicesCount	= 0;
-	if (drawablep->getRenderType() == LLPipeline::RENDER_TYPE_PARTICLES ||
-		drawablep->getRenderType() == LLPipeline::RENDER_TYPE_HUD_PARTICLES)
-	{ //indicate to LLParticlePartition that this particle is uninitialized
-		mIndicesIndex = 0xFFFFFFFF;
-	}
-	else
-	{
-		mIndicesIndex	= 0;
-	}
-	mIndexInTex = 0;
+
+	//special value to indicate uninitialized position
+	mIndicesIndex	= 0xFFFFFFFF;
+
 	mTexture		= NULL;
 	mTEOffset		= -1;
 	mTextureIndex = 255;
@@ -207,13 +201,10 @@ void LLFace::destroy()
 		mTexture->removeFace(this) ;
 	}
 	
-	if (mDrawablep.notNull() &&
-		(mDrawablep->getRenderType() == LLPipeline::RENDER_TYPE_PARTICLES ||
-		mDrawablep->getRenderType() == LLPipeline::RENDER_TYPE_HUD_PARTICLES) &&
-		mIndicesIndex != 0xFFFFFFFF)
+	if (isState(LLFace::PARTICLE))
 	{
 		LLVOPartGroup::freeVBSlot(getGeomIndex()/4);
-		mIndicesIndex = 0xFFFFFFFF;
+		clearState(LLFace::PARTICLE);
 	}
 
 	if (mDrawPoolp)
@@ -1207,19 +1198,25 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 	{
 		if (num_indices + (S32) mIndicesIndex > mVertexBuffer->getNumIndices())
 		{
-			llwarns	<< "Index buffer overflow!" << llendl;
-			llwarns << "Indices Count: " << mIndicesCount
-					<< " VF Num Indices: " << num_indices
-					<< " Indices Index: " << mIndicesIndex
-					<< " VB Num Indices: " << mVertexBuffer->getNumIndices() << llendl;
-			llwarns	<< " Face Index: " << f
-					<< " Pool Type: " << mPoolType << llendl;
+			if (gDebugGL)
+			{
+				llwarns	<< "Index buffer overflow!" << llendl;
+				llwarns << "Indices Count: " << mIndicesCount
+						<< " VF Num Indices: " << num_indices
+						<< " Indices Index: " << mIndicesIndex
+						<< " VB Num Indices: " << mVertexBuffer->getNumIndices() << llendl;
+				llwarns	<< " Face Index: " << f
+						<< " Pool Type: " << mPoolType << llendl;
+			}
 			return FALSE;
 		}
 
 		if (num_vertices + mGeomIndex > mVertexBuffer->getNumVerts())
 		{
-			llwarns << "Vertex buffer overflow!" << llendl;
+			if (gDebugGL)
+			{
+				llwarns << "Vertex buffer overflow!" << llendl;
+			}
 			return FALSE;
 		}
 	}
@@ -1651,7 +1648,8 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 						if (!do_xform)
 						{
 							LLFastTimer t(FTM_FACE_TEX_QUICK_NO_XFORM);
-							LLVector4a::memcpyNonAliased16((F32*) tex_coords.get(), (F32*) vf.mTexCoords, num_vertices*2*sizeof(F32));
+							S32 tc_size = (num_vertices*2*sizeof(F32)+0xF) & ~0xF;
+							LLVector4a::memcpyNonAliased16((F32*) tex_coords.get(), (F32*) vf.mTexCoords, tc_size);
 						}
 						else
 						{
diff --git a/indra/newview/llface.h b/indra/newview/llface.h
index 3d8d29ce2935ca68f4c3752b0cf46e2023512fc5..de4d03351ce39ad319f01bb4ba932065e778ff10 100644
--- a/indra/newview/llface.h
+++ b/indra/newview/llface.h
@@ -59,6 +59,17 @@ class LLFace
 {
 public:
 
+	void* operator new(size_t size)
+	{
+		return ll_aligned_malloc_16(size);
+	}
+
+	void operator delete(void* ptr)
+	{
+		ll_aligned_free_16(ptr);
+	}
+
+
 	LLFace(const LLFace& rhs)
 	{
 		*this = rhs;
@@ -79,6 +90,7 @@ class LLFace
 		USE_FACE_COLOR	= 0x0010,
 		TEXTURE_ANIM	= 0x0020, 
 		RIGGED			= 0x0040,
+		PARTICLE		= 0x0080,
 	};
 
 	static void initClass();
diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp
index 11edb60712ed6c8b3f587b36892e54f1ed234ee0..c4dca4cb79beffd77e263f238d0cf3378a75abaf 100644
--- a/indra/newview/llflexibleobject.cpp
+++ b/indra/newview/llflexibleobject.cpp
@@ -65,7 +65,7 @@ LLVolumeImplFlexible::LLVolumeImplFlexible(LLViewerObject* vo, LLFlexibleObjectD
 	mFrameNum = 0;
 	mCollisionSphereRadius = 0.f;
 	mRenderRes = 1;
-
+	
 	if(mVO->mDrawable.notNull())
 	{
 		mVO->mDrawable->makeActive() ;
@@ -255,50 +255,28 @@ void LLVolumeImplFlexible::onSetVolume(const LLVolumeParams &volume_params, cons
 {
 }
 
-//---------------------------------------------------------------------------------
-// This calculates the physics of the flexible object. Note that it has to be 0
-// updated every time step. In the future, perhaps there could be an 
-// optimization similar to what Havok does for objects that are stationary. 
-//---------------------------------------------------------------------------------
-static LLFastTimer::DeclareTimer FTM_FLEXIBLE_UPDATE("Update Flexies");
-BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
-{
-	if (mVO->mDrawable.isNull())
-	{
-		// Don't do anything until we have a drawable
-		return FALSE; // (we are not initialized or updated)
-	}
-
-	BOOL force_update = mSimulateRes == 0 ? TRUE : FALSE;
 
-	//flexible objects never go static
-	mVO->mDrawable->mQuietCount = 0;
-	if (!mVO->mDrawable->isRoot())
-	{
-		LLViewerObject* parent = (LLViewerObject*) mVO->getParent();
-		parent->mDrawable->mQuietCount = 0;
-	}
+void LLVolumeImplFlexible::updateRenderRes()
+{
+	LLDrawable* drawablep = mVO->mDrawable;
 
-	LLFastTimer ftm(FTM_FLEXIBLE_UPDATE);
-		
 	S32 new_res = mAttributes->getSimulateLOD();
 
-	//number of segments only cares about z axis
-	F32 app_angle = llround((F32) atan2( mVO->getScale().mV[2]*2.f, mVO->mDrawable->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f);
+#if 1 //optimal approximation of previous behavior that doesn't rely on atan2
+	F32 app_angle = mVO->getScale().mV[2]/drawablep->mDistanceWRTCamera;
 
 	// Rendering sections increases with visible angle on the screen
-	mRenderRes = (S32)(FLEXIBLE_OBJECT_MAX_SECTIONS*4*app_angle*DEG_TO_RAD/LLViewerCamera::getInstance()->getView());
-	if (mRenderRes > FLEXIBLE_OBJECT_MAX_SECTIONS)
-	{
-		mRenderRes = FLEXIBLE_OBJECT_MAX_SECTIONS;
-	}
-
+	mRenderRes = (S32) (12.f*app_angle);
+#else //legacy behavior
+	//number of segments only cares about z axis
+	F32 app_angle = llround((F32) atan2( mVO->getScale().mV[2]*2.f, drawablep->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f);
 
-	// Bottom cap at 1/4 the original number of sections
-	if (mRenderRes < mAttributes->getSimulateLOD()-1)
-	{
-		mRenderRes = mAttributes->getSimulateLOD()-1;
-	}
+ 	// Rendering sections increases with visible angle on the screen
+	mRenderRes = (S32)(FLEXIBLE_OBJECT_MAX_SECTIONS*4*app_angle*DEG_TO_RAD/LLViewerCamera::getInstance()->getView());
+#endif
+		
+	mRenderRes = llclamp(mRenderRes, new_res-1, (S32) FLEXIBLE_OBJECT_MAX_SECTIONS);
+		
 	// Throttle back simulation of segments we're not rendering
 	if (mRenderRes < new_res)
 	{
@@ -311,43 +289,65 @@ BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F6
 		setAttributesOfAllSections();
 		mInitialized = TRUE;
 	}
-	if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FLEXIBLE))
-	{
-		return FALSE; // (we are not initialized or updated)
-	}
-
-	bool visible = mVO->mDrawable->isVisible();
+}
+//---------------------------------------------------------------------------------
+// This calculates the physics of the flexible object. Note that it has to be 0
+// updated every time step. In the future, perhaps there could be an 
+// optimization similar to what Havok does for objects that are stationary. 
+//---------------------------------------------------------------------------------
+static LLFastTimer::DeclareTimer FTM_FLEXIBLE_UPDATE("Update Flexies");
+void LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
+{
+	LLDrawable* drawablep = mVO->mDrawable;
 
-	if (force_update && visible)
-	{
-		gPipeline.markRebuild(mVO->mDrawable, LLDrawable::REBUILD_POSITION, FALSE);
-	}
-	else if	(visible &&
-		!mVO->mDrawable->isState(LLDrawable::IN_REBUILD_Q1) &&
-		mVO->getPixelArea() > 256.f)
+	if (drawablep)
 	{
-		U32 id;
-		F32 pixel_area = mVO->getPixelArea();
+		//LLFastTimer ftm(FTM_FLEXIBLE_UPDATE);
 
-		if (mVO->isRootEdit())
+		//flexible objects never go static
+		drawablep->mQuietCount = 0;
+		if (!drawablep->isRoot())
 		{
-			id = mID;
+			LLViewerObject* parent = (LLViewerObject*) mVO->getParent();
+			parent->mDrawable->mQuietCount = 0;
 		}
-		else
+
+		if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FLEXIBLE))
 		{
-			LLVOVolume* parent = (LLVOVolume*) mVO->getParent();
-			id = parent->getVolumeInterfaceID();
-		}
+			bool visible = drawablep->isVisible();
 
-		U32 update_period = (U32) (LLViewerCamera::getInstance()->getScreenPixelArea()*0.01f/(pixel_area*(sUpdateFactor+1.f)))+1;
+			if ((mSimulateRes == 0) && visible)
+			{
+				updateRenderRes();
+				gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_POSITION, FALSE);
+			}
+			else if	(visible &&
+				!drawablep->isState(LLDrawable::IN_REBUILD_Q1) &&
+				mVO->getPixelArea() > 256.f)
+			{
+				U32 id;
+				F32 pixel_area = mVO->getPixelArea();
 
-		if ((LLDrawable::getCurrentFrame()+id)%update_period == 0)
-		{
-			gPipeline.markRebuild(mVO->mDrawable, LLDrawable::REBUILD_POSITION, FALSE);
+				if (mVO->isRootEdit())
+				{
+					id = mID;
+				}
+				else
+				{
+					LLVOVolume* parent = (LLVOVolume*) mVO->getParent();
+					id = parent->getVolumeInterfaceID();
+				}
+
+				U32 update_period = (U32) (LLViewerCamera::getInstance()->getScreenPixelArea()*0.01f/(pixel_area*(sUpdateFactor+1.f)))+1;
+
+				if ((LLDrawable::getCurrentFrame()+id)%update_period == 0)
+				{
+					updateRenderRes();
+					gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_POSITION, FALSE);
+				}
+			}
 		}
 	}
-	
-	return force_update;
 }
 
 inline S32 log2(S32 x)
@@ -369,7 +369,9 @@ void LLVolumeImplFlexible::doFlexibleUpdate()
 	if ((mSimulateRes == 0 || !mInitialized) && mVO->mDrawable->isVisible()) 
 	{
 		//mVO->markForUpdate(TRUE);
-		if (!doIdleUpdate(gAgent, *LLWorld::getInstance(), 0.0))
+		doIdleUpdate(gAgent, *LLWorld::getInstance(), 0.0);
+
+		if (mSimulateRes == 0)
 		{
 			return;	// we did not get updated or initialized, proceeding without can be dangerous
 		}
diff --git a/indra/newview/llflexibleobject.h b/indra/newview/llflexibleobject.h
index 371d6a077307ac56f96e0947ffa0897afbe7e214..56d579d86f940eb48b824499faddebdeba0174f6 100644
--- a/indra/newview/llflexibleobject.h
+++ b/indra/newview/llflexibleobject.h
@@ -78,7 +78,8 @@ class LLVolumeImplFlexible : public LLVolumeInterface
 		LLVector3 getFramePosition() const;
 		LLQuaternion getFrameRotation() const;
 		LLVolumeInterfaceType getInterfaceType() const		{ return INTERFACE_FLEXIBLE; }
-		BOOL doIdleUpdate(LLAgent &agent, LLWorld &world, const F64 &time);
+		void updateRenderRes();
+		void doIdleUpdate(LLAgent &agent, LLWorld &world, const F64 &time);
 		BOOL doUpdateGeometry(LLDrawable *drawable);
 		LLVector3 getPivotPosition() const;
 		void onSetVolume(const LLVolumeParams &volume_params, const S32 detail);
@@ -128,7 +129,7 @@ class LLVolumeImplFlexible : public LLVolumeInterface
 		LLVector3					mCollisionSpherePosition;
 		F32							mCollisionSphereRadius;
 		U32							mID;
-
+		
 		//--------------------------------------
 		// private methods
 		//--------------------------------------
diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp
index bca4b5e447188a64526b73266771923ac3e2b194..809d344d0162a1bbcc9aa56c68967ed5f315476d 100644
--- a/indra/newview/llfloaterbuycontents.cpp
+++ b/indra/newview/llfloaterbuycontents.cpp
@@ -211,8 +211,8 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj,
 
 		BOOL item_is_multi = FALSE;
 		if ((inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_LANDMARK_VISITED
-			|| inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS)
-			&& !(inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK))
+		     || inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS)
+		     && !(inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK))
 		{
 			item_is_multi = TRUE;
 		}
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 61da99fe3a5b1bf798b89c9c4655475f17273bd3..df8ecb6fd97dcef894f58220d160c692c8f4686d 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -2212,8 +2212,8 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata)
 	BOOL allow_damage		= !self->mCheckSafe->get();
 	BOOL allow_fly			= self->mCheckFly->get();
 	BOOL allow_landmark		= TRUE; // cannot restrict landmark creation
-	BOOL allow_group_scripts	= self->mCheckGroupScripts->get() || self->mCheckOtherScripts->get();
 	BOOL allow_other_scripts	= self->mCheckOtherScripts->get();
+	BOOL allow_group_scripts	= self->mCheckGroupScripts->get() || allow_other_scripts;
 	BOOL allow_publish		= FALSE;
 	BOOL mature_publish		= self->mMatureCtrl->get();
 	BOOL push_restriction	= self->mPushRestrictionCtrl->get();
@@ -2226,11 +2226,16 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata)
 	LLViewerRegion* region;
 	region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
 
-	if (!allow_other_scripts && region && region->getAllowDamage())
-	{
-
-		LLNotificationsUtil::add("UnableToDisableOutsideScripts");
-		return;
+	if (region && region->getAllowDamage())
+	{	// Damage is allowed on the region - server will always allow scripts
+		if ( (!allow_other_scripts && parcel->getParcelFlag(PF_ALLOW_OTHER_SCRIPTS)) ||
+			 (!allow_group_scripts && parcel->getParcelFlag(PF_ALLOW_GROUP_SCRIPTS)) )
+		{	// Don't allow turning off "Run Scripts" if damage is allowed in the region
+			self->mCheckOtherScripts->set(parcel->getParcelFlag(PF_ALLOW_OTHER_SCRIPTS));	// Restore UI to actual settings
+			self->mCheckGroupScripts->set(parcel->getParcelFlag(PF_ALLOW_GROUP_SCRIPTS));
+			LLNotificationsUtil::add("UnableToDisableOutsideScripts");
+			return;
+		}
 	}
 
 	// Push data into current parcel
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 0a5171245ae1a08dfacce8ec60f1943258382780..a071f338bac5333dc55165d6b5643e9654a9018d 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -497,7 +497,7 @@ BOOL LLFloaterModelPreview::postBuild()
 			text->setMouseDownCallback(boost::bind(&LLModelPreview::setPreviewLOD, mModelPreview, i));
 		}
 	}
-	std::string current_grid = LLGridManager::getInstance()->getGridLabel();
+	std::string current_grid = LLGridManager::getInstance()->getGridId();
 	std::transform(current_grid.begin(),current_grid.end(),current_grid.begin(),::tolower);
 	std::string validate_url;
 	if (current_grid == "agni")
@@ -4774,7 +4774,8 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights)
 			if (vf.mTexCoords)
 			{
 				vb->getTexCoord0Strider(tc_strider);
-				LLVector4a::memcpyNonAliased16((F32*) tc_strider.get(), (F32*) vf.mTexCoords, num_vertices*2*sizeof(F32));
+				S32 tex_size = (num_vertices*2*sizeof(F32)+0xF) & ~0xF;
+				LLVector4a::memcpyNonAliased16((F32*) tc_strider.get(), (F32*) vf.mTexCoords, tex_size);
 			}
 			
 			if (vf.mNormals)
@@ -5517,6 +5518,15 @@ BOOL LLModelPreview::render()
 							buffer->setBuffer(type_mask & buffer->getTypeMask());
 							gGL.diffuseColor4fv(material.mDiffuseColor.mV);
 							gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+							if (material.mDiffuseMap.notNull())
+							{
+								if (material.mDiffuseMap->getDiscardLevel() > -1)
+								{
+									gGL.getTexUnit(0)->bind(material.mDiffuseMap, true);
+									mTextureSet.insert(material.mDiffuseMap.get());
+								}
+							}
+						
 							buffer->draw(LLRender::TRIANGLES, buffer->getNumIndices(), 0);
 							gGL.diffuseColor3f(0.4f, 0.4f, 0.4f);
 
diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..99d262344cbde45031737a33720964f8fc776b5a
--- /dev/null
+++ b/indra/newview/llfloaterpathfindingcharacters.cpp
@@ -0,0 +1,326 @@
+/** 
+* @file llfloaterpathfindingcharacters.cpp
+* @brief "Pathfinding characters" floater, allowing for identification of pathfinding characters and their cpu usage.
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, 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 "llfloaterpathfindingcharacters.h"
+
+#include <string>
+
+#include "llcheckboxctrl.h"
+#include "llfloaterreg.h"
+#include "llfloaterpathfindingobjects.h"
+#include "llhandle.h"
+#include "llpathfindingcharacter.h"
+#include "llpathfindingcharacterlist.h"
+#include "llpathfindingmanager.h"
+#include "llpathfindingobject.h"
+#include "llpathfindingobjectlist.h"
+#include "llpathinglib.h"
+#include "llquaternion.h"
+#include "llsd.h"
+#include "lluicolortable.h"
+#include "lluuid.h"
+#include "llviewerobject.h"
+#include "llviewerobjectlist.h"
+#include "pipeline.h"
+#include "v3math.h"
+#include "v4color.h"
+
+LLHandle<LLFloaterPathfindingCharacters> LLFloaterPathfindingCharacters::sInstanceHandle;
+
+//---------------------------------------------------------------------------
+// LLFloaterPathfindingCharacters
+//---------------------------------------------------------------------------
+
+void LLFloaterPathfindingCharacters::onClose(bool pIsAppQuitting)
+{
+	// Hide any capsule that might be showing on floater close
+	hideCapsule();
+	LLFloaterPathfindingObjects::onClose( pIsAppQuitting );
+}
+
+BOOL LLFloaterPathfindingCharacters::isShowPhysicsCapsule() const
+{
+	return mShowPhysicsCapsuleCheckBox->get();
+}
+
+void LLFloaterPathfindingCharacters::setShowPhysicsCapsule(BOOL pIsShowPhysicsCapsule)
+{
+	mShowPhysicsCapsuleCheckBox->set(pIsShowPhysicsCapsule && (LLPathingLib::getInstance() != NULL));
+}
+
+BOOL LLFloaterPathfindingCharacters::isPhysicsCapsuleEnabled(LLUUID& id, LLVector3& pos, LLQuaternion& rot) const
+{
+	id = mSelectedCharacterId;
+	// Physics capsule is enable if the checkbox is enabled and if we can get the required render 
+	// parameters for any selected object
+	return (isShowPhysicsCapsule() &&  getCapsuleRenderData(pos, rot ));
+}
+
+void LLFloaterPathfindingCharacters::openCharactersWithSelectedObjects()
+{
+	LLFloaterPathfindingCharacters *charactersFloater = LLFloaterReg::getTypedInstance<LLFloaterPathfindingCharacters>("pathfinding_characters");
+	charactersFloater->showFloaterWithSelectionObjects();
+}
+
+LLHandle<LLFloaterPathfindingCharacters> LLFloaterPathfindingCharacters::getInstanceHandle()
+{
+	if ( sInstanceHandle.isDead() )
+	{
+		LLFloaterPathfindingCharacters *floaterInstance = LLFloaterReg::findTypedInstance<LLFloaterPathfindingCharacters>("pathfinding_characters");
+		if (floaterInstance != NULL)
+		{
+			sInstanceHandle = floaterInstance->mSelfHandle;
+		}
+	}
+
+	return sInstanceHandle;
+}
+
+LLFloaterPathfindingCharacters::LLFloaterPathfindingCharacters(const LLSD& pSeed)
+	: LLFloaterPathfindingObjects(pSeed),
+	mShowPhysicsCapsuleCheckBox(NULL),
+	mSelectedCharacterId(),
+	mBeaconColor(),
+	mSelfHandle()
+{
+	mSelfHandle.bind(this);
+}
+
+LLFloaterPathfindingCharacters::~LLFloaterPathfindingCharacters()
+{
+}
+
+BOOL LLFloaterPathfindingCharacters::postBuild()
+{
+	mBeaconColor = LLUIColorTable::getInstance()->getColor("PathfindingCharacterBeaconColor");
+
+	mShowPhysicsCapsuleCheckBox = findChild<LLCheckBoxCtrl>("show_physics_capsule");
+	llassert(mShowPhysicsCapsuleCheckBox != NULL);
+	mShowPhysicsCapsuleCheckBox->setCommitCallback(boost::bind(&LLFloaterPathfindingCharacters::onShowPhysicsCapsuleClicked, this));
+	mShowPhysicsCapsuleCheckBox->setEnabled(LLPathingLib::getInstance() != NULL);
+
+	return LLFloaterPathfindingObjects::postBuild();
+}
+
+void LLFloaterPathfindingCharacters::requestGetObjects()
+{
+	LLPathfindingManager::getInstance()->requestGetCharacters(getNewRequestId(), boost::bind(&LLFloaterPathfindingCharacters::handleNewObjectList, this, _1, _2, _3));
+}
+
+LLSD LLFloaterPathfindingCharacters::convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr)
+{
+	llassert(pObjectListPtr != NULL);
+	llassert(!pObjectListPtr->isEmpty());
+
+	LLSD scrollListData = LLSD::emptyArray();
+
+	for (LLPathfindingObjectList::const_iterator objectIter = pObjectListPtr->begin();	objectIter != pObjectListPtr->end(); ++objectIter)
+	{
+		const LLPathfindingCharacter *characterPtr = dynamic_cast<const LLPathfindingCharacter *>(objectIter->second.get());
+		LLSD element = buildCharacterScrollListData(characterPtr);
+		scrollListData.append(element);
+
+		if (characterPtr->hasOwner() && !characterPtr->hasOwnerName())
+		{
+			rebuildScrollListAfterAvatarNameLoads(characterPtr->getUUID());
+		}
+	}
+
+	return scrollListData;
+}
+
+void LLFloaterPathfindingCharacters::updateControlsOnScrollListChange()
+{
+	LLFloaterPathfindingObjects::updateControlsOnScrollListChange();
+	updateStateOnDisplayControls();
+	showSelectedCharacterCapsules();
+}
+
+S32 LLFloaterPathfindingCharacters::getNameColumnIndex() const
+{
+	return 0;
+}
+
+const LLColor4 &LLFloaterPathfindingCharacters::getBeaconColor() const
+{
+	return mBeaconColor;
+}
+
+LLPathfindingObjectListPtr LLFloaterPathfindingCharacters::getEmptyObjectList() const
+{
+	LLPathfindingObjectListPtr objectListPtr(new LLPathfindingCharacterList());
+	return objectListPtr;
+}
+
+void LLFloaterPathfindingCharacters::onShowPhysicsCapsuleClicked()
+{
+	if (LLPathingLib::getInstance() == NULL)
+	{
+		if (isShowPhysicsCapsule())
+		{
+			setShowPhysicsCapsule(FALSE);
+		}
+	}
+	else
+	{
+		if (mSelectedCharacterId.notNull() && isShowPhysicsCapsule())
+		{
+			showCapsule();
+		}
+		else
+		{
+			hideCapsule();
+		}
+	}
+}
+
+LLSD LLFloaterPathfindingCharacters::buildCharacterScrollListData(const LLPathfindingCharacter *pCharacterPtr) const
+{
+	LLSD columns;
+
+	columns[0]["column"] = "name";
+	columns[0]["value"] = pCharacterPtr->getName();
+
+	columns[1]["column"] = "description";
+	columns[1]["value"] = pCharacterPtr->getDescription();
+
+	columns[2]["column"] = "owner";
+	columns[2]["value"] = (pCharacterPtr->hasOwner()
+			? (pCharacterPtr->hasOwnerName()
+			? (pCharacterPtr->isGroupOwned()
+			? (pCharacterPtr->getOwnerName() + " " + getString("character_owner_group"))
+			: pCharacterPtr->getOwnerName())
+			: getString("character_owner_loading"))
+			: getString("character_owner_unknown"));
+
+	S32 cpuTime = llround(pCharacterPtr->getCPUTime());
+	std::string cpuTimeString = llformat("%d", cpuTime);
+	LLStringUtil::format_map_t string_args;
+	string_args["[CPU_TIME]"] = cpuTimeString;
+
+	columns[3]["column"] = "cpu_time";
+	columns[3]["value"] = getString("character_cpu_time", string_args);
+
+	columns[4]["column"] = "altitude";
+	columns[4]["value"] = llformat("%1.0f m", pCharacterPtr->getLocation()[2]);
+
+	LLSD element;
+	element["id"] = pCharacterPtr->getUUID().asString();
+	element["column"] = columns;
+
+	return element;
+}
+
+void LLFloaterPathfindingCharacters::updateStateOnDisplayControls()
+{
+	int numSelectedItems = getNumSelectedObjects();;
+	bool isEditEnabled = ((numSelectedItems == 1) && (LLPathingLib::getInstance() != NULL));
+
+	mShowPhysicsCapsuleCheckBox->setEnabled(isEditEnabled);
+	if (!isEditEnabled)
+	{
+		setShowPhysicsCapsule(FALSE);
+	}
+}
+
+void LLFloaterPathfindingCharacters::showSelectedCharacterCapsules()
+{
+	// Hide any previous capsule
+	hideCapsule();
+
+	// Get the only selected object, or set the selected object to null if we do not have exactly
+	// one object selected
+	if (getNumSelectedObjects() == 1)
+	{
+		LLPathfindingObjectPtr selectedObjectPtr = getFirstSelectedObject();
+		mSelectedCharacterId = selectedObjectPtr->getUUID();
+	}
+	else
+	{
+		mSelectedCharacterId.setNull();
+	}
+
+	// Show any capsule if enabled
+	showCapsule();
+}
+
+void LLFloaterPathfindingCharacters::showCapsule() const
+{
+	if (mSelectedCharacterId.notNull() && isShowPhysicsCapsule())
+	{
+		LLPathfindingObjectPtr objectPtr = getFirstSelectedObject();
+		llassert(objectPtr != NULL);
+		if (objectPtr != NULL)
+		{
+			const LLPathfindingCharacter *character = dynamic_cast<const LLPathfindingCharacter *>(objectPtr.get());
+			llassert(mSelectedCharacterId == character->getUUID());
+			if (LLPathingLib::getInstance() != NULL)
+			{
+				LLPathingLib::getInstance()->createPhysicsCapsuleRep(character->getLength(), character->getRadius(),
+					character->isHorizontal(), character->getUUID());
+			}
+		}
+
+		gPipeline.hideObject(mSelectedCharacterId);
+	}
+}
+
+void LLFloaterPathfindingCharacters::hideCapsule() const
+{
+	if (mSelectedCharacterId.notNull())
+	{
+		gPipeline.restoreHiddenObject(mSelectedCharacterId);
+	}
+	if (LLPathingLib::getInstance() != NULL)
+	{
+		LLPathingLib::getInstance()->cleanupPhysicsCapsuleRepResiduals();
+	}
+}
+
+bool LLFloaterPathfindingCharacters::getCapsuleRenderData(LLVector3& pPosition, LLQuaternion& rot) const
+{
+	bool result = false;
+
+	// If we have a selected object, find the object on the viewer object list and return its
+	// position.  Else, return false indicating that we either do not have a selected object
+	// or we cannot find the selected object on the viewer object list
+	if (mSelectedCharacterId.notNull())
+	{
+		LLViewerObject *viewerObject = gObjectList.findObject(mSelectedCharacterId);
+		if ( viewerObject != NULL )
+		{
+			rot			= viewerObject->getRotation() ;
+			pPosition	= viewerObject->getRenderPosition();		
+			result		= true;
+		}
+	}
+
+	return result;
+}
diff --git a/indra/newview/llfloaterpathfindingcharacters.h b/indra/newview/llfloaterpathfindingcharacters.h
new file mode 100644
index 0000000000000000000000000000000000000000..ef389ad4289df68d185fc49592a3271ec15104f0
--- /dev/null
+++ b/indra/newview/llfloaterpathfindingcharacters.h
@@ -0,0 +1,97 @@
+/** 
+* @file   llfloaterpathfindingcharacters.h
+* @brief  "Pathfinding characters" floater, allowing for identification of pathfinding characters and their cpu usage.
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+* $/LicenseInfo$
+*/
+#ifndef LL_LLFLOATERPATHFINDINGCHARACTERS_H
+#define LL_LLFLOATERPATHFINDINGCHARACTERS_H
+
+#include "llfloaterpathfindingobjects.h"
+#include "llhandle.h"
+#include "llpathfindingobjectlist.h"
+#include "lluuid.h"
+#include "v4color.h"
+
+class LLCheckBoxCtrl;
+class LLPathfindingCharacter;
+class LLQuaternion;
+class LLSD;
+class LLVector3;
+
+class LLFloaterPathfindingCharacters : public LLFloaterPathfindingObjects
+{
+public:
+	virtual void                                    onClose(bool pIsAppQuitting);
+
+	BOOL                                            isShowPhysicsCapsule() const;
+	void                                            setShowPhysicsCapsule(BOOL pIsShowPhysicsCapsule);
+
+	BOOL                                            isPhysicsCapsuleEnabled(LLUUID& id, LLVector3& pos, LLQuaternion& rot) const;
+
+	static void                                     openCharactersWithSelectedObjects();
+	static LLHandle<LLFloaterPathfindingCharacters> getInstanceHandle();
+
+protected:
+	friend class LLFloaterReg;
+
+	LLFloaterPathfindingCharacters(const LLSD& pSeed);
+	virtual ~LLFloaterPathfindingCharacters();
+
+	virtual BOOL                       postBuild();
+
+	virtual void                       requestGetObjects();
+
+	virtual LLSD                       convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr);
+
+	virtual void                       updateControlsOnScrollListChange();
+
+	virtual S32                        getNameColumnIndex() const;
+	virtual const LLColor4             &getBeaconColor() const;
+
+	virtual LLPathfindingObjectListPtr getEmptyObjectList() const;
+
+private:
+	void onShowPhysicsCapsuleClicked();
+
+	LLSD buildCharacterScrollListData(const LLPathfindingCharacter *pCharacterPtr) const;
+
+	void updateStateOnDisplayControls();
+	void showSelectedCharacterCapsules();
+
+	void showCapsule() const;
+	void hideCapsule() const;
+
+	bool getCapsuleRenderData(LLVector3& pPosition, LLQuaternion& rot) const;
+
+	LLCheckBoxCtrl                                   *mShowPhysicsCapsuleCheckBox;
+
+	LLUUID                                           mSelectedCharacterId;
+
+	LLColor4                                         mBeaconColor;
+
+	LLRootHandle<LLFloaterPathfindingCharacters>     mSelfHandle;
+	static LLHandle<LLFloaterPathfindingCharacters>  sInstanceHandle;
+};
+
+#endif // LL_LLFLOATERPATHFINDINGCHARACTERS_H
diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..298454724b8f9fcce39d3edb1d068a2255bd79e5
--- /dev/null
+++ b/indra/newview/llfloaterpathfindingconsole.cpp
@@ -0,0 +1,1273 @@
+/** 
+* @file llfloaterpathfindingconsole.cpp
+* @brief "Pathfinding console" floater, allowing for viewing and testing of the pathfinding navmesh through Havok AI utilities.
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, 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 "llfloaterpathfindingconsole.h"
+
+#include <vector>
+
+#include <boost/signals2.hpp>
+
+#include "llbutton.h"
+#include "llcheckboxctrl.h"
+#include "llcombobox.h"
+#include "llcontrol.h"
+#include "llenvmanager.h"
+#include "llfloaterpathfindingcharacters.h"
+#include "llfloaterpathfindinglinksets.h"
+#include "llfloaterreg.h"
+#include "llhandle.h"
+#include "llpanel.h"
+#include "llpathfindingnavmeshzone.h"
+#include "llpathfindingpathtool.h"
+#include "llpathinglib.h"
+#include "llsliderctrl.h"
+#include "llsd.h"
+#include "lltabcontainer.h"
+#include "lltextbase.h"
+#include "lltoolmgr.h"
+#include "lltoolfocus.h"
+#include "llviewercontrol.h"
+#include "llviewerparcelmgr.h"
+#include "pipeline.h"
+
+#define XUI_RENDER_HEATMAP_NONE 0
+#define XUI_RENDER_HEATMAP_A 1
+#define XUI_RENDER_HEATMAP_B 2
+#define XUI_RENDER_HEATMAP_C 3
+#define XUI_RENDER_HEATMAP_D 4
+
+#define XUI_CHARACTER_TYPE_NONE 0
+#define XUI_CHARACTER_TYPE_A 1
+#define XUI_CHARACTER_TYPE_B 2
+#define XUI_CHARACTER_TYPE_C 3
+#define XUI_CHARACTER_TYPE_D 4
+
+#define XUI_VIEW_TAB_INDEX 0
+#define XUI_TEST_TAB_INDEX 1
+
+#define SET_SHAPE_RENDER_FLAG(_flag,_type) _flag |= (1U << _type)
+
+#define CONTROL_NAME_RETRIEVE_NEIGHBOR       "PathfindingRetrieveNeighboringRegion"
+#define CONTROL_NAME_WALKABLE_OBJECTS        "PathfindingWalkable"
+#define CONTROL_NAME_STATIC_OBSTACLE_OBJECTS "PathfindingObstacle"
+#define CONTROL_NAME_MATERIAL_VOLUMES        "PathfindingMaterial"
+#define CONTROL_NAME_EXCLUSION_VOLUMES       "PathfindingExclusion"
+#define CONTROL_NAME_INTERIOR_EDGE           "PathfindingConnectedEdge"
+#define CONTROL_NAME_EXTERIOR_EDGE           "PathfindingBoundaryEdge"
+#define CONTROL_NAME_HEATMAP_MIN             "PathfindingHeatColorBase"
+#define CONTROL_NAME_HEATMAP_MAX             "PathfindingHeatColorMax"
+#define CONTROL_NAME_NAVMESH_FACE            "PathfindingFaceColor"
+#define CONTROL_NAME_TEST_PATH_VALID_END     "PathfindingTestPathValidEndColor"
+#define CONTROL_NAME_TEST_PATH_INVALID_END   "PathfindingTestPathInvalidEndColor"
+#define CONTROL_NAME_TEST_PATH               "PathfindingTestPathColor"
+#define CONTROL_NAME_WATER					 "PathfindingWaterColor"
+
+LLHandle<LLFloaterPathfindingConsole> LLFloaterPathfindingConsole::sInstanceHandle;
+
+//---------------------------------------------------------------------------
+// LLFloaterPathfindingConsole
+//---------------------------------------------------------------------------
+
+BOOL LLFloaterPathfindingConsole::postBuild()
+{
+	mViewTestTabContainer = findChild<LLTabContainer>("view_test_tab_container");
+	llassert(mViewTestTabContainer != NULL);
+	mViewTestTabContainer->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onTabSwitch, this));
+
+	mViewTab = findChild<LLPanel>("view_panel");
+	llassert(mViewTab != NULL);
+
+	mShowLabel = findChild<LLTextBase>("show_label");
+	llassert(mShowLabel != NULL);
+
+	mShowWorldCheckBox = findChild<LLCheckBoxCtrl>("show_world");
+	llassert(mShowWorldCheckBox != NULL);
+	mShowWorldCheckBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onShowWorldSet, this));
+	
+	mShowWorldMovablesOnlyCheckBox = findChild<LLCheckBoxCtrl>("show_world_movables_only");
+	llassert(mShowWorldMovablesOnlyCheckBox != NULL);
+	mShowWorldMovablesOnlyCheckBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onShowWorldMovablesOnlySet, this));
+
+	mShowNavMeshCheckBox = findChild<LLCheckBoxCtrl>("show_navmesh");
+	llassert(mShowNavMeshCheckBox != NULL);
+	mShowNavMeshCheckBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onShowNavMeshSet, this));
+
+	mShowNavMeshWalkabilityLabel = findChild<LLTextBase>("show_walkability_label");
+	llassert(mShowNavMeshWalkabilityLabel != NULL);
+
+	mShowNavMeshWalkabilityComboBox = findChild<LLComboBox>("show_heatmap_mode");
+	llassert(mShowNavMeshWalkabilityComboBox != NULL);
+	mShowNavMeshWalkabilityComboBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onShowWalkabilitySet, this));
+
+	mShowWalkablesCheckBox = findChild<LLCheckBoxCtrl>("show_walkables");
+	llassert(mShowWalkablesCheckBox != NULL);
+
+	mShowStaticObstaclesCheckBox = findChild<LLCheckBoxCtrl>("show_static_obstacles");
+	llassert(mShowStaticObstaclesCheckBox != NULL);
+
+	mShowMaterialVolumesCheckBox = findChild<LLCheckBoxCtrl>("show_material_volumes");
+	llassert(mShowMaterialVolumesCheckBox != NULL);
+
+	mShowExclusionVolumesCheckBox = findChild<LLCheckBoxCtrl>("show_exclusion_volumes");
+	llassert(mShowExclusionVolumesCheckBox != NULL);
+
+	mShowRenderWaterPlaneCheckBox = findChild<LLCheckBoxCtrl>("show_water_plane");
+	llassert(mShowRenderWaterPlaneCheckBox != NULL);
+
+	mShowXRayCheckBox = findChild<LLCheckBoxCtrl>("show_xray");
+	llassert(mShowXRayCheckBox != NULL);
+
+	mTestTab = findChild<LLPanel>("test_panel");
+	llassert(mTestTab != NULL);
+
+	mPathfindingViewerStatus = findChild<LLTextBase>("pathfinding_viewer_status");
+	llassert(mPathfindingViewerStatus != NULL);
+
+	mPathfindingSimulatorStatus = findChild<LLTextBase>("pathfinding_simulator_status");
+	llassert(mPathfindingSimulatorStatus != NULL);
+
+	mCtrlClickLabel = findChild<LLTextBase>("ctrl_click_label");
+	llassert(mCtrlClickLabel != NULL);
+
+	mShiftClickLabel = findChild<LLTextBase>("shift_click_label");
+	llassert(mShiftClickLabel != NULL);
+
+	mCharacterWidthLabel = findChild<LLTextBase>("character_width_label");
+	llassert(mCharacterWidthLabel != NULL);
+
+	mCharacterWidthSlider = findChild<LLSliderCtrl>("character_width");
+	llassert(mCharacterWidthSlider != NULL);
+	mCharacterWidthSlider->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onCharacterWidthSet, this));
+
+	mCharacterWidthUnitLabel = findChild<LLTextBase>("character_width_unit_label");
+	llassert(mCharacterWidthUnitLabel != NULL);
+
+	mCharacterTypeLabel = findChild<LLTextBase>("character_type_label");
+	llassert(mCharacterTypeLabel != NULL);
+
+	mCharacterTypeComboBox = findChild<LLComboBox>("path_character_type");
+	llassert(mCharacterTypeComboBox != NULL);
+	mCharacterTypeComboBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onCharacterTypeSwitch, this));
+
+	mPathTestingStatus = findChild<LLTextBase>("path_test_status");
+	llassert(mPathTestingStatus != NULL);
+
+	mClearPathButton = findChild<LLButton>("clear_path");
+	llassert(mClearPathButton != NULL);
+	mClearPathButton->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onClearPathClicked, this));
+
+	mErrorColor = LLUIColorTable::instance().getColor("PathfindingErrorColor");
+	mWarningColor = LLUIColorTable::instance().getColor("PathfindingWarningColor");
+
+	if (LLPathingLib::getInstance() != NULL)
+	{
+		mPathfindingToolset = new LLToolset();
+		mPathfindingToolset->addTool(LLPathfindingPathTool::getInstance());
+		mPathfindingToolset->addTool(LLToolCamera::getInstance());
+		mPathfindingToolset->setShowFloaterTools(false);
+	}
+
+	updateCharacterWidth();
+	updateCharacterType();
+
+	return LLFloater::postBuild();
+}
+
+void LLFloaterPathfindingConsole::onOpen(const LLSD& pKey)
+{
+	LLFloater::onOpen(pKey);
+	//make sure we have a pathing system
+	if ( LLPathingLib::getInstance() == NULL )
+	{ 
+		setConsoleState(kConsoleStateLibraryNotImplemented);
+		llwarns <<"Errror: cannot find pathing library implementation."<<llendl;
+	}
+	else
+	{	
+		if (!mNavMeshZoneSlot.connected())
+		{
+			mNavMeshZoneSlot = mNavMeshZone.registerNavMeshZoneListener(boost::bind(&LLFloaterPathfindingConsole::handleNavMeshZoneStatus, this, _1));
+		}
+
+		mIsNavMeshUpdating = false;
+		initializeNavMeshZoneForCurrentRegion();
+		registerSavedSettingsListeners();
+		fillInColorsForNavMeshVisualization();
+	}		
+
+	if (!mRegionBoundarySlot.connected())
+	{
+		mRegionBoundarySlot = LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LLFloaterPathfindingConsole::onRegionBoundaryCross, this));
+	}
+
+	if (!mTeleportFailedSlot.connected())
+	{
+		mTeleportFailedSlot = LLViewerParcelMgr::getInstance()->setTeleportFailedCallback(boost::bind(&LLFloaterPathfindingConsole::onRegionBoundaryCross, this));
+	}
+
+	if (!mPathEventSlot.connected())
+	{
+		mPathEventSlot = LLPathfindingPathTool::getInstance()->registerPathEventListener(boost::bind(&LLFloaterPathfindingConsole::onPathEvent, this));
+	}
+
+	setDefaultInputs();
+	updatePathTestStatus();
+
+	if (mViewTestTabContainer->getCurrentPanelIndex() == XUI_TEST_TAB_INDEX)
+	{
+		switchIntoTestPathMode();
+	}
+}
+
+void LLFloaterPathfindingConsole::onClose(bool pIsAppQuitting)
+{
+	switchOutOfTestPathMode();
+	
+	if (mPathEventSlot.connected())
+	{
+		mPathEventSlot.disconnect();
+	}
+
+	if (mTeleportFailedSlot.connected())
+	{
+		mTeleportFailedSlot.disconnect();
+	}
+
+	if (mRegionBoundarySlot.connected())
+	{
+		mRegionBoundarySlot.disconnect();
+	}
+
+	if (mNavMeshZoneSlot.connected())
+	{
+		mNavMeshZoneSlot.disconnect();
+	}
+
+	if (LLPathingLib::getInstance() != NULL)
+	{
+		mNavMeshZone.disable();
+	}
+	deregisterSavedSettingsListeners();
+
+	setDefaultInputs();
+	setConsoleState(kConsoleStateUnknown);
+	cleanupRenderableRestoreItems();
+
+	LLFloater::onClose(pIsAppQuitting);
+}
+
+LLHandle<LLFloaterPathfindingConsole> LLFloaterPathfindingConsole::getInstanceHandle()
+{
+	if (sInstanceHandle.isDead())
+	{
+		LLFloaterPathfindingConsole *floaterInstance = LLFloaterReg::findTypedInstance<LLFloaterPathfindingConsole>("pathfinding_console");
+		if (floaterInstance != NULL)
+		{
+			sInstanceHandle = floaterInstance->mSelfHandle;
+		}
+	}
+
+	return sInstanceHandle;
+}
+
+BOOL LLFloaterPathfindingConsole::isRenderNavMesh() const
+{
+	return mShowNavMeshCheckBox->get();
+}
+
+void LLFloaterPathfindingConsole::setRenderNavMesh(BOOL pIsRenderNavMesh)
+{
+	mShowNavMeshCheckBox->set(pIsRenderNavMesh);
+	setNavMeshRenderState();
+}
+
+BOOL LLFloaterPathfindingConsole::isRenderWalkables() const
+{
+	return mShowWalkablesCheckBox->get();
+}
+
+void LLFloaterPathfindingConsole::setRenderWalkables(BOOL pIsRenderWalkables)
+{
+	mShowWalkablesCheckBox->set(pIsRenderWalkables);
+}
+
+BOOL LLFloaterPathfindingConsole::isRenderStaticObstacles() const
+{
+	return mShowStaticObstaclesCheckBox->get();
+}
+
+void LLFloaterPathfindingConsole::setRenderStaticObstacles(BOOL pIsRenderStaticObstacles)
+{
+	mShowStaticObstaclesCheckBox->set(pIsRenderStaticObstacles);
+}
+
+BOOL LLFloaterPathfindingConsole::isRenderMaterialVolumes() const
+{
+	return mShowMaterialVolumesCheckBox->get();
+}
+
+void LLFloaterPathfindingConsole::setRenderMaterialVolumes(BOOL pIsRenderMaterialVolumes)
+{
+	mShowMaterialVolumesCheckBox->set(pIsRenderMaterialVolumes);
+}
+
+BOOL LLFloaterPathfindingConsole::isRenderExclusionVolumes() const
+{
+	return mShowExclusionVolumesCheckBox->get();
+}
+
+void LLFloaterPathfindingConsole::setRenderExclusionVolumes(BOOL pIsRenderExclusionVolumes)
+{
+	mShowExclusionVolumesCheckBox->set(pIsRenderExclusionVolumes);
+}
+
+BOOL LLFloaterPathfindingConsole::isRenderWorld() const
+{
+	return mShowWorldCheckBox->get();
+}
+
+void LLFloaterPathfindingConsole::setRenderWorld(BOOL pIsRenderWorld)
+{
+	mShowWorldCheckBox->set(pIsRenderWorld);
+	setWorldRenderState();
+}
+
+BOOL LLFloaterPathfindingConsole::isRenderWorldMovablesOnly() const
+{
+	return (mShowWorldCheckBox->get() && mShowWorldMovablesOnlyCheckBox->get());
+}
+
+void LLFloaterPathfindingConsole::setRenderWorldMovablesOnly(BOOL pIsRenderWorldMovablesOnly)
+{
+	mShowWorldMovablesOnlyCheckBox->set(pIsRenderWorldMovablesOnly);
+}
+
+BOOL LLFloaterPathfindingConsole::isRenderWaterPlane() const
+{
+	return mShowRenderWaterPlaneCheckBox->get();
+}
+
+void LLFloaterPathfindingConsole::setRenderWaterPlane(BOOL pIsRenderWaterPlane)
+{
+	mShowRenderWaterPlaneCheckBox->set(pIsRenderWaterPlane);
+}
+
+BOOL LLFloaterPathfindingConsole::isRenderXRay() const
+{
+	return mShowXRayCheckBox->get();
+}
+
+void LLFloaterPathfindingConsole::setRenderXRay(BOOL pIsRenderXRay)
+{
+	mShowXRayCheckBox->set(pIsRenderXRay);
+}
+
+LLPathingLib::LLPLCharacterType LLFloaterPathfindingConsole::getRenderHeatmapType() const
+{
+	LLPathingLib::LLPLCharacterType renderHeatmapType;
+
+	switch (mShowNavMeshWalkabilityComboBox->getValue().asInteger())
+	{
+	case XUI_RENDER_HEATMAP_NONE :
+		renderHeatmapType = LLPathingLib::LLPL_CHARACTER_TYPE_NONE;
+		break;
+	case XUI_RENDER_HEATMAP_A :
+		renderHeatmapType = LLPathingLib::LLPL_CHARACTER_TYPE_A;
+		break;
+	case XUI_RENDER_HEATMAP_B :
+		renderHeatmapType = LLPathingLib::LLPL_CHARACTER_TYPE_B;
+		break;
+	case XUI_RENDER_HEATMAP_C :
+		renderHeatmapType = LLPathingLib::LLPL_CHARACTER_TYPE_C;
+		break;
+	case XUI_RENDER_HEATMAP_D :
+		renderHeatmapType = LLPathingLib::LLPL_CHARACTER_TYPE_D;
+		break;
+	default :
+		renderHeatmapType = LLPathingLib::LLPL_CHARACTER_TYPE_NONE;
+		llassert(0);
+		break;
+	}
+
+	return renderHeatmapType;
+}
+
+void LLFloaterPathfindingConsole::setRenderHeatmapType(LLPathingLib::LLPLCharacterType pRenderHeatmapType)
+{
+	LLSD comboBoxValue;
+
+	switch (pRenderHeatmapType)
+	{
+	case LLPathingLib::LLPL_CHARACTER_TYPE_NONE :
+		comboBoxValue = XUI_RENDER_HEATMAP_NONE;
+		break;
+	case LLPathingLib::LLPL_CHARACTER_TYPE_A :
+		comboBoxValue = XUI_RENDER_HEATMAP_A;
+		break;
+	case LLPathingLib::LLPL_CHARACTER_TYPE_B :
+		comboBoxValue = XUI_RENDER_HEATMAP_B;
+		break;
+	case LLPathingLib::LLPL_CHARACTER_TYPE_C :
+		comboBoxValue = XUI_RENDER_HEATMAP_C;
+		break;
+	case LLPathingLib::LLPL_CHARACTER_TYPE_D :
+		comboBoxValue = XUI_RENDER_HEATMAP_D;
+		break;
+	default :
+		comboBoxValue = XUI_RENDER_HEATMAP_NONE;
+		llassert(0);
+		break;
+	}
+
+	mShowNavMeshWalkabilityComboBox->setValue(comboBoxValue);
+}
+
+LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed)
+	: LLFloater(pSeed),
+	mSelfHandle(),
+	mViewTestTabContainer(NULL),
+	mViewTab(NULL),
+	mShowLabel(NULL),
+	mShowWorldCheckBox(NULL),
+	mShowWorldMovablesOnlyCheckBox(NULL),
+	mShowNavMeshCheckBox(NULL),
+	mShowNavMeshWalkabilityLabel(NULL),
+	mShowNavMeshWalkabilityComboBox(NULL),
+	mShowWalkablesCheckBox(NULL),
+	mShowStaticObstaclesCheckBox(NULL),
+	mShowMaterialVolumesCheckBox(NULL),
+	mShowExclusionVolumesCheckBox(NULL),
+	mShowRenderWaterPlaneCheckBox(NULL),
+	mShowXRayCheckBox(NULL),
+	mPathfindingViewerStatus(NULL),
+	mPathfindingSimulatorStatus(NULL),
+	mTestTab(NULL),
+	mCtrlClickLabel(),
+	mShiftClickLabel(),
+	mCharacterWidthLabel(),
+	mCharacterWidthUnitLabel(),
+	mCharacterWidthSlider(NULL),
+	mCharacterTypeLabel(),
+	mCharacterTypeComboBox(NULL),
+	mPathTestingStatus(NULL),
+	mClearPathButton(NULL),
+	mErrorColor(),
+	mWarningColor(),
+	mNavMeshZoneSlot(),
+	mNavMeshZone(),
+	mIsNavMeshUpdating(false),
+	mRegionBoundarySlot(),
+	mTeleportFailedSlot(),
+	mPathEventSlot(),
+	mPathfindingToolset(NULL),
+	mSavedToolset(NULL),
+	mSavedSettingRetrieveNeighborSlot(),
+	mSavedSettingWalkableSlot(),
+	mSavedSettingStaticObstacleSlot(),
+	mSavedSettingMaterialVolumeSlot(),
+	mSavedSettingExclusionVolumeSlot(),
+	mSavedSettingInteriorEdgeSlot(),
+	mSavedSettingExteriorEdgeSlot(),
+	mSavedSettingHeatmapMinSlot(),
+	mSavedSettingHeatmapMaxSlot(),
+	mSavedSettingNavMeshFaceSlot(),
+	mSavedSettingTestPathValidEndSlot(),
+	mSavedSettingTestPathInvalidEndSlot(),
+	mSavedSettingTestPathSlot(),
+	mSavedSettingWaterSlot(),
+	mConsoleState(kConsoleStateUnknown),
+	mRenderableRestoreList()
+{
+	mSelfHandle.bind(this);
+}
+
+LLFloaterPathfindingConsole::~LLFloaterPathfindingConsole()
+{
+}
+
+void LLFloaterPathfindingConsole::onTabSwitch()
+{
+	if (mViewTestTabContainer->getCurrentPanelIndex() == XUI_TEST_TAB_INDEX)
+	{
+		switchIntoTestPathMode();
+	}
+	else
+	{
+		switchOutOfTestPathMode();
+	}
+}
+
+void LLFloaterPathfindingConsole::onShowWorldSet()
+{
+	setWorldRenderState();
+	updateRenderablesObjects();
+}
+
+void LLFloaterPathfindingConsole::onShowWorldMovablesOnlySet()
+{
+	updateRenderablesObjects();
+}
+
+void LLFloaterPathfindingConsole::onShowNavMeshSet()
+{
+	setNavMeshRenderState();
+}
+
+void LLFloaterPathfindingConsole::onShowWalkabilitySet()
+{
+	if (LLPathingLib::getInstance() != NULL)
+	{
+		LLPathingLib::getInstance()->setNavMeshMaterialType(getRenderHeatmapType());
+	}
+}
+
+void LLFloaterPathfindingConsole::onCharacterWidthSet()
+{
+	updateCharacterWidth();
+}
+
+void LLFloaterPathfindingConsole::onCharacterTypeSwitch()
+{
+	updateCharacterType();
+}
+
+void LLFloaterPathfindingConsole::onClearPathClicked()
+{
+	clearPath();
+}
+
+void LLFloaterPathfindingConsole::handleNavMeshZoneStatus(LLPathfindingNavMeshZone::ENavMeshZoneRequestStatus pNavMeshZoneRequestStatus)
+{
+	switch (pNavMeshZoneRequestStatus)
+	{
+	case LLPathfindingNavMeshZone::kNavMeshZoneRequestUnknown :
+		setConsoleState(kConsoleStateUnknown);
+		break;
+	case LLPathfindingNavMeshZone::kNavMeshZoneRequestWaiting :
+		setConsoleState(kConsoleStateRegionLoading);
+		break;
+	case LLPathfindingNavMeshZone::kNavMeshZoneRequestChecking :
+		setConsoleState(kConsoleStateCheckingVersion);
+		break;
+	case LLPathfindingNavMeshZone::kNavMeshZoneRequestNeedsUpdate :
+		mIsNavMeshUpdating = true;
+		mNavMeshZone.refresh();
+		break;
+	case LLPathfindingNavMeshZone::kNavMeshZoneRequestStarted :
+		setConsoleState(kConsoleStateDownloading);
+		break;
+	case LLPathfindingNavMeshZone::kNavMeshZoneRequestCompleted :
+		mIsNavMeshUpdating = false;
+		setConsoleState(kConsoleStateHasNavMesh);
+		break;
+	case LLPathfindingNavMeshZone::kNavMeshZoneRequestNotEnabled :
+		setConsoleState(kConsoleStateRegionNotEnabled);
+		break;
+	case LLPathfindingNavMeshZone::kNavMeshZoneRequestError :
+		setConsoleState(kConsoleStateError);
+		break;
+	default:
+		setConsoleState(kConsoleStateUnknown);
+		llassert(0);
+		break;
+	}
+}
+
+void LLFloaterPathfindingConsole::onRegionBoundaryCross()
+{	
+	initializeNavMeshZoneForCurrentRegion();	
+	setRenderWorld(TRUE);
+	setRenderWorldMovablesOnly(FALSE);
+}
+
+void LLFloaterPathfindingConsole::onPathEvent()
+{
+	const LLPathfindingPathTool *pathToolInstance = LLPathfindingPathTool::getInstance();
+
+	mCharacterWidthSlider->setValue(LLSD(pathToolInstance->getCharacterWidth()));
+
+	LLSD characterType;
+	switch (pathToolInstance->getCharacterType())
+	{
+	case LLPathfindingPathTool::kCharacterTypeNone :
+		characterType = XUI_CHARACTER_TYPE_NONE;
+		break;
+	case LLPathfindingPathTool::kCharacterTypeA :
+		characterType = XUI_CHARACTER_TYPE_A;
+		break;
+	case LLPathfindingPathTool::kCharacterTypeB :
+		characterType = XUI_CHARACTER_TYPE_B;
+		break;
+	case LLPathfindingPathTool::kCharacterTypeC :
+		characterType = XUI_CHARACTER_TYPE_C;
+		break;
+	case LLPathfindingPathTool::kCharacterTypeD :
+		characterType = XUI_CHARACTER_TYPE_D;
+		break;
+	default :
+		characterType = XUI_CHARACTER_TYPE_NONE;
+		llassert(0);
+		break;
+	}
+	mCharacterTypeComboBox->setValue(characterType);
+
+	updatePathTestStatus();
+}
+
+void LLFloaterPathfindingConsole::setDefaultInputs()
+{
+	mViewTestTabContainer->selectTab(XUI_VIEW_TAB_INDEX);
+	setRenderWorld(TRUE);
+	setRenderWorldMovablesOnly(FALSE);
+	setRenderNavMesh(FALSE);
+	setRenderWalkables(FALSE);
+	setRenderMaterialVolumes(FALSE);
+	setRenderStaticObstacles(FALSE);
+	setRenderExclusionVolumes(FALSE);
+	setRenderWaterPlane(FALSE);
+	setRenderXRay(FALSE);
+}
+
+void LLFloaterPathfindingConsole::setConsoleState(EConsoleState pConsoleState)
+{
+	mConsoleState = pConsoleState;
+	updateControlsOnConsoleState();
+	updateViewerStatusOnConsoleState();
+	updateSimulatorStatusOnConsoleState();
+}
+
+void LLFloaterPathfindingConsole::setWorldRenderState()
+{
+	BOOL renderWorld = isRenderWorld();
+
+	mShowWorldMovablesOnlyCheckBox->setEnabled(renderWorld && mShowWorldCheckBox->getEnabled());
+	if (!renderWorld)
+	{
+		mShowWorldMovablesOnlyCheckBox->set(FALSE);
+	}
+}
+
+void LLFloaterPathfindingConsole::setNavMeshRenderState()
+{
+	BOOL renderNavMesh = isRenderNavMesh();
+
+	mShowNavMeshWalkabilityLabel->setEnabled(renderNavMesh);
+	mShowNavMeshWalkabilityComboBox->setEnabled(renderNavMesh);
+}
+
+void LLFloaterPathfindingConsole::updateRenderablesObjects()
+{
+	if ( isRenderWorldMovablesOnly() )
+	{
+		gPipeline.hidePermanentObjects( mRenderableRestoreList );
+	}
+	else
+	{
+		cleanupRenderableRestoreItems();
+	}
+}
+
+void LLFloaterPathfindingConsole::updateControlsOnConsoleState()
+{
+	switch (mConsoleState)
+	{
+	case kConsoleStateUnknown :
+	case kConsoleStateRegionNotEnabled :
+	case kConsoleStateRegionLoading :
+		mViewTestTabContainer->selectTab(XUI_VIEW_TAB_INDEX);
+		mViewTab->setEnabled(FALSE);
+		mShowLabel->setEnabled(FALSE);
+		mShowWorldCheckBox->setEnabled(FALSE);
+		mShowWorldMovablesOnlyCheckBox->setEnabled(FALSE);
+		mShowNavMeshCheckBox->setEnabled(FALSE);
+		mShowNavMeshWalkabilityLabel->setEnabled(FALSE);
+		mShowNavMeshWalkabilityComboBox->setEnabled(FALSE);
+		mShowWalkablesCheckBox->setEnabled(FALSE);
+		mShowStaticObstaclesCheckBox->setEnabled(FALSE);
+		mShowMaterialVolumesCheckBox->setEnabled(FALSE);
+		mShowExclusionVolumesCheckBox->setEnabled(FALSE);
+		mShowRenderWaterPlaneCheckBox->setEnabled(FALSE);
+		mShowXRayCheckBox->setEnabled(FALSE);
+		mTestTab->setEnabled(FALSE);
+		mCtrlClickLabel->setEnabled(FALSE);
+		mShiftClickLabel->setEnabled(FALSE);
+		mCharacterWidthLabel->setEnabled(FALSE);
+		mCharacterWidthUnitLabel->setEnabled(FALSE);
+		mCharacterWidthSlider->setEnabled(FALSE);
+		mCharacterTypeLabel->setEnabled(FALSE);
+		mCharacterTypeComboBox->setEnabled(FALSE);
+		mClearPathButton->setEnabled(FALSE);
+		clearPath();
+		break;
+	case kConsoleStateLibraryNotImplemented :
+		mViewTestTabContainer->selectTab(XUI_VIEW_TAB_INDEX);
+		mViewTab->setEnabled(FALSE);
+		mShowLabel->setEnabled(FALSE);
+		mShowWorldCheckBox->setEnabled(FALSE);
+		mShowWorldMovablesOnlyCheckBox->setEnabled(FALSE);
+		mShowNavMeshCheckBox->setEnabled(FALSE);
+		mShowNavMeshWalkabilityLabel->setEnabled(FALSE);
+		mShowNavMeshWalkabilityComboBox->setEnabled(FALSE);
+		mShowWalkablesCheckBox->setEnabled(FALSE);
+		mShowStaticObstaclesCheckBox->setEnabled(FALSE);
+		mShowMaterialVolumesCheckBox->setEnabled(FALSE);
+		mShowExclusionVolumesCheckBox->setEnabled(FALSE);
+		mShowRenderWaterPlaneCheckBox->setEnabled(FALSE);
+		mShowXRayCheckBox->setEnabled(FALSE);
+		mTestTab->setEnabled(FALSE);
+		mCtrlClickLabel->setEnabled(FALSE);
+		mShiftClickLabel->setEnabled(FALSE);
+		mCharacterWidthLabel->setEnabled(FALSE);
+		mCharacterWidthUnitLabel->setEnabled(FALSE);
+		mCharacterWidthSlider->setEnabled(FALSE);
+		mCharacterTypeLabel->setEnabled(FALSE);
+		mCharacterTypeComboBox->setEnabled(FALSE);
+		mClearPathButton->setEnabled(FALSE);
+		clearPath();
+		break;
+	case kConsoleStateCheckingVersion :
+	case kConsoleStateDownloading :
+	case kConsoleStateError :
+		mViewTestTabContainer->selectTab(XUI_VIEW_TAB_INDEX);
+		mViewTab->setEnabled(FALSE);
+		mShowLabel->setEnabled(FALSE);
+		mShowWorldCheckBox->setEnabled(FALSE);
+		mShowWorldMovablesOnlyCheckBox->setEnabled(FALSE);
+		mShowNavMeshCheckBox->setEnabled(FALSE);
+		mShowNavMeshWalkabilityLabel->setEnabled(FALSE);
+		mShowNavMeshWalkabilityComboBox->setEnabled(FALSE);
+		mShowWalkablesCheckBox->setEnabled(FALSE);
+		mShowStaticObstaclesCheckBox->setEnabled(FALSE);
+		mShowMaterialVolumesCheckBox->setEnabled(FALSE);
+		mShowExclusionVolumesCheckBox->setEnabled(FALSE);
+		mShowRenderWaterPlaneCheckBox->setEnabled(FALSE);
+		mShowXRayCheckBox->setEnabled(FALSE);
+		mTestTab->setEnabled(FALSE);
+		mCtrlClickLabel->setEnabled(FALSE);
+		mShiftClickLabel->setEnabled(FALSE);
+		mCharacterWidthLabel->setEnabled(FALSE);
+		mCharacterWidthUnitLabel->setEnabled(FALSE);
+		mCharacterWidthSlider->setEnabled(FALSE);
+		mCharacterTypeLabel->setEnabled(FALSE);
+		mCharacterTypeComboBox->setEnabled(FALSE);
+		mClearPathButton->setEnabled(FALSE);
+		clearPath();
+		break;
+	case kConsoleStateHasNavMesh :
+		mViewTab->setEnabled(TRUE);
+		mShowLabel->setEnabled(TRUE);
+		mShowWorldCheckBox->setEnabled(TRUE);
+		setWorldRenderState();
+		mShowNavMeshCheckBox->setEnabled(TRUE);
+		setNavMeshRenderState();
+		mShowWalkablesCheckBox->setEnabled(TRUE);
+		mShowStaticObstaclesCheckBox->setEnabled(TRUE);
+		mShowMaterialVolumesCheckBox->setEnabled(TRUE);
+		mShowExclusionVolumesCheckBox->setEnabled(TRUE);
+		mShowRenderWaterPlaneCheckBox->setEnabled(TRUE);
+		mShowXRayCheckBox->setEnabled(TRUE);
+		mTestTab->setEnabled(TRUE);
+		mCtrlClickLabel->setEnabled(TRUE);
+		mShiftClickLabel->setEnabled(TRUE);
+		mCharacterWidthLabel->setEnabled(TRUE);
+		mCharacterWidthUnitLabel->setEnabled(TRUE);
+		mCharacterWidthSlider->setEnabled(TRUE);
+		mCharacterTypeLabel->setEnabled(TRUE);
+		mCharacterTypeComboBox->setEnabled(TRUE);
+		mClearPathButton->setEnabled(TRUE);
+		break;
+	default :
+		llassert(0);
+		break;
+	}
+}
+
+void LLFloaterPathfindingConsole::updateViewerStatusOnConsoleState()
+{
+	std::string viewerStatusText("");
+	LLStyle::Params viewerStyleParams;
+
+	switch (mConsoleState)
+	{
+	case kConsoleStateUnknown :
+		viewerStatusText = getString("navmesh_viewer_status_unknown");
+		viewerStyleParams.color = mErrorColor;
+		break;
+	case kConsoleStateLibraryNotImplemented :
+		viewerStatusText = getString("navmesh_viewer_status_library_not_implemented");
+		viewerStyleParams.color = mErrorColor;
+		break;
+	case kConsoleStateRegionNotEnabled :
+		viewerStatusText = getString("navmesh_viewer_status_region_not_enabled");
+		viewerStyleParams.color = mErrorColor;
+		break;
+	case kConsoleStateRegionLoading :
+		viewerStatusText = getString("navmesh_viewer_status_region_loading");
+		viewerStyleParams.color = mWarningColor;
+		break;
+	case kConsoleStateCheckingVersion :
+		viewerStatusText = getString("navmesh_viewer_status_checking_version");
+		viewerStyleParams.color = mWarningColor;
+		break;
+	case kConsoleStateDownloading :
+		if (mIsNavMeshUpdating)
+		{
+			viewerStatusText = getString("navmesh_viewer_status_updating");
+		}
+		else
+		{
+			viewerStatusText = getString("navmesh_viewer_status_downloading");
+		}
+		viewerStyleParams.color = mWarningColor;
+		break;
+	case kConsoleStateHasNavMesh :
+		viewerStatusText = getString("navmesh_viewer_status_has_navmesh");
+		break;
+	case kConsoleStateError :
+		viewerStatusText = getString("navmesh_viewer_status_error");
+		viewerStyleParams.color = mErrorColor;
+		break;
+	default :
+		viewerStatusText = getString("navmesh_viewer_status_unknown");
+		viewerStyleParams.color = mErrorColor;
+		llassert(0);
+		break;
+	}
+
+	mPathfindingViewerStatus->setText((LLStringExplicit)viewerStatusText, viewerStyleParams);
+}
+
+void LLFloaterPathfindingConsole::updateSimulatorStatusOnConsoleState()
+{
+	std::string simulatorStatusText("");
+	LLStyle::Params simulatorStyleParams;
+
+	switch (mConsoleState)
+	{
+	case kConsoleStateUnknown :
+	case kConsoleStateLibraryNotImplemented :
+	case kConsoleStateRegionNotEnabled :
+	case kConsoleStateRegionLoading :
+	case kConsoleStateCheckingVersion :
+	case kConsoleStateError :
+		simulatorStatusText = getString("navmesh_simulator_status_unknown");
+		simulatorStyleParams.color = mErrorColor;
+		break;
+	case kConsoleStateDownloading :
+	case kConsoleStateHasNavMesh :
+		switch (mNavMeshZone.getNavMeshZoneStatus())
+		{
+		case LLPathfindingNavMeshZone::kNavMeshZonePending : 
+			simulatorStatusText = getString("navmesh_simulator_status_pending");
+			simulatorStyleParams.color = mWarningColor;
+			break;
+		case LLPathfindingNavMeshZone::kNavMeshZoneBuilding : 
+			simulatorStatusText = getString("navmesh_simulator_status_building");
+			simulatorStyleParams.color = mWarningColor;
+			break;
+		case LLPathfindingNavMeshZone::kNavMeshZoneSomePending : 
+			simulatorStatusText = getString("navmesh_simulator_status_some_pending");
+			simulatorStyleParams.color = mWarningColor;
+			break;
+		case LLPathfindingNavMeshZone::kNavMeshZoneSomeBuilding : 
+			simulatorStatusText = getString("navmesh_simulator_status_some_building");
+			simulatorStyleParams.color = mWarningColor;
+			break;
+		case LLPathfindingNavMeshZone::kNavMeshZonePendingAndBuilding : 
+			simulatorStatusText = getString("navmesh_simulator_status_pending_and_building");
+			simulatorStyleParams.color = mWarningColor;
+			break;
+		case LLPathfindingNavMeshZone::kNavMeshZoneComplete : 
+			simulatorStatusText = getString("navmesh_simulator_status_complete");
+			break;
+		default : 
+			simulatorStatusText = getString("navmesh_simulator_status_unknown");
+			simulatorStyleParams.color = mErrorColor;
+			break;
+		}
+		break;
+	default :
+		simulatorStatusText = getString("navmesh_simulator_status_unknown");
+		simulatorStyleParams.color = mErrorColor;
+		llassert(0);
+		break;
+	}
+
+	mPathfindingSimulatorStatus->setText((LLStringExplicit)simulatorStatusText, simulatorStyleParams);
+}
+
+void LLFloaterPathfindingConsole::initializeNavMeshZoneForCurrentRegion()
+{
+	mNavMeshZone.disable();
+	mNavMeshZone.initialize();
+	mNavMeshZone.enable();
+	mNavMeshZone.refresh();
+	cleanupRenderableRestoreItems();
+}
+
+void LLFloaterPathfindingConsole::cleanupRenderableRestoreItems()
+{
+	if ( !mRenderableRestoreList.empty() ) 
+	{ 
+		gPipeline.restorePermanentObjects( mRenderableRestoreList ); 
+		mRenderableRestoreList.clear();
+	}
+	else
+	{
+		gPipeline.skipRenderingOfTerrain( false );
+	}
+}
+
+void LLFloaterPathfindingConsole::switchIntoTestPathMode()
+{
+	if (LLPathingLib::getInstance() != NULL)
+	{
+		llassert(mPathfindingToolset != NULL);
+		LLToolMgr *toolMgrInstance = LLToolMgr::getInstance();
+		if (toolMgrInstance->getCurrentToolset() != mPathfindingToolset)
+		{
+			mSavedToolset = toolMgrInstance->getCurrentToolset();
+			toolMgrInstance->setCurrentToolset(mPathfindingToolset);
+		}
+	}
+}
+
+void LLFloaterPathfindingConsole::switchOutOfTestPathMode()
+{
+	if (LLPathingLib::getInstance() != NULL)
+	{
+		llassert(mPathfindingToolset != NULL);
+		LLToolMgr *toolMgrInstance = LLToolMgr::getInstance();
+		if (toolMgrInstance->getCurrentToolset() == mPathfindingToolset)
+		{
+			toolMgrInstance->setCurrentToolset(mSavedToolset);
+			mSavedToolset = NULL;
+		}
+	}
+}
+
+void LLFloaterPathfindingConsole::updateCharacterWidth()
+{
+	LLPathfindingPathTool::getInstance()->setCharacterWidth(mCharacterWidthSlider->getValueF32());
+}
+
+void LLFloaterPathfindingConsole::updateCharacterType()
+{
+	LLPathfindingPathTool::ECharacterType characterType;
+
+	switch (mCharacterTypeComboBox->getValue().asInteger())
+	{
+	case XUI_CHARACTER_TYPE_NONE :
+		characterType = LLPathfindingPathTool::kCharacterTypeNone;
+		break;
+	case XUI_CHARACTER_TYPE_A :
+		characterType = LLPathfindingPathTool::kCharacterTypeA;
+		break;
+	case XUI_CHARACTER_TYPE_B :
+		characterType = LLPathfindingPathTool::kCharacterTypeB;
+		break;
+	case XUI_CHARACTER_TYPE_C :
+		characterType = LLPathfindingPathTool::kCharacterTypeC;
+		break;
+	case XUI_CHARACTER_TYPE_D :
+		characterType = LLPathfindingPathTool::kCharacterTypeD;
+		break;
+	default :
+		characterType = LLPathfindingPathTool::kCharacterTypeNone;
+		llassert(0);
+		break;
+	}
+
+	LLPathfindingPathTool::getInstance()->setCharacterType(characterType);
+}
+
+void LLFloaterPathfindingConsole::clearPath()
+{
+	LLPathfindingPathTool::getInstance()->clearPath();
+}
+
+void LLFloaterPathfindingConsole::updatePathTestStatus()
+{
+	std::string statusText("");
+	LLStyle::Params styleParams;
+
+	switch (LLPathfindingPathTool::getInstance()->getPathStatus())
+	{
+	case LLPathfindingPathTool::kPathStatusUnknown :
+		statusText = getString("pathing_unknown");
+		styleParams.color = mErrorColor;
+		break;
+	case LLPathfindingPathTool::kPathStatusChooseStartAndEndPoints :
+		statusText = getString("pathing_choose_start_and_end_points");
+		styleParams.color = mWarningColor;
+		break;
+	case LLPathfindingPathTool::kPathStatusChooseStartPoint :
+		statusText = getString("pathing_choose_start_point");
+		styleParams.color = mWarningColor;
+		break;
+	case LLPathfindingPathTool::kPathStatusChooseEndPoint :
+		statusText = getString("pathing_choose_end_point");
+		styleParams.color = mWarningColor;
+		break;
+	case LLPathfindingPathTool::kPathStatusHasValidPath :
+		statusText = getString("pathing_path_valid");
+		break;
+	case LLPathfindingPathTool::kPathStatusHasInvalidPath :
+		statusText = getString("pathing_path_invalid");
+		styleParams.color = mErrorColor;
+		break;
+	case LLPathfindingPathTool::kPathStatusNotEnabled :
+		statusText = getString("pathing_region_not_enabled");
+		styleParams.color = mErrorColor;
+		break;
+	case LLPathfindingPathTool::kPathStatusNotImplemented :
+		statusText = getString("pathing_library_not_implemented");
+		styleParams.color = mErrorColor;
+		break;
+	case LLPathfindingPathTool::kPathStatusError :
+		statusText = getString("pathing_error");
+		styleParams.color = mErrorColor;
+		break;
+	default :
+		statusText = getString("pathing_unknown");
+		styleParams.color = mErrorColor;
+		break;
+	}
+
+	mPathTestingStatus->setText((LLStringExplicit)statusText, styleParams);
+}
+
+
+BOOL LLFloaterPathfindingConsole::isRenderAnyShapes() const
+{
+	return (isRenderWalkables() || isRenderStaticObstacles() ||
+		isRenderMaterialVolumes() ||  isRenderExclusionVolumes());
+}
+
+U32 LLFloaterPathfindingConsole::getRenderShapeFlags()
+{
+	U32 shapeRenderFlag = 0U;
+
+	if (isRenderWalkables())
+	{ 
+		SET_SHAPE_RENDER_FLAG(shapeRenderFlag, LLPathingLib::LLST_WalkableObjects); 
+	}
+	if (isRenderStaticObstacles())
+	{ 
+		SET_SHAPE_RENDER_FLAG(shapeRenderFlag, LLPathingLib::LLST_ObstacleObjects); 
+	}
+	if (isRenderMaterialVolumes())
+	{ 
+		SET_SHAPE_RENDER_FLAG(shapeRenderFlag, LLPathingLib::LLST_MaterialPhantoms); 
+	}
+	if (isRenderExclusionVolumes())
+	{ 
+		SET_SHAPE_RENDER_FLAG(shapeRenderFlag, LLPathingLib::LLST_ExclusionPhantoms); 
+	}
+
+	return shapeRenderFlag;
+}
+
+void LLFloaterPathfindingConsole::registerSavedSettingsListeners()
+{
+	if (!mSavedSettingRetrieveNeighborSlot.connected())
+	{
+		mSavedSettingRetrieveNeighborSlot = gSavedSettings.getControl(CONTROL_NAME_RETRIEVE_NEIGHBOR)->getSignal()->connect(boost::bind(&LLFloaterPathfindingConsole::handleRetrieveNeighborChange, this, _1, _2));
+	}
+	if (!mSavedSettingWalkableSlot.connected())
+	{
+		mSavedSettingWalkableSlot = gSavedSettings.getControl(CONTROL_NAME_WALKABLE_OBJECTS)->getSignal()->connect(boost::bind(&LLFloaterPathfindingConsole::handleNavMeshColorChange, this, _1, _2));
+	}
+	if (!mSavedSettingStaticObstacleSlot.connected())
+	{
+		mSavedSettingStaticObstacleSlot = gSavedSettings.getControl(CONTROL_NAME_STATIC_OBSTACLE_OBJECTS)->getSignal()->connect(boost::bind(&LLFloaterPathfindingConsole::handleNavMeshColorChange, this, _1, _2));
+	}
+	if (!mSavedSettingMaterialVolumeSlot.connected())
+	{
+		mSavedSettingMaterialVolumeSlot = gSavedSettings.getControl(CONTROL_NAME_MATERIAL_VOLUMES)->getSignal()->connect(boost::bind(&LLFloaterPathfindingConsole::handleNavMeshColorChange, this, _1, _2));
+	}
+	if (!mSavedSettingExclusionVolumeSlot.connected())
+	{
+		mSavedSettingExclusionVolumeSlot = gSavedSettings.getControl(CONTROL_NAME_EXCLUSION_VOLUMES)->getSignal()->connect(boost::bind(&LLFloaterPathfindingConsole::handleNavMeshColorChange, this, _1, _2));
+	}
+	if (!mSavedSettingInteriorEdgeSlot.connected())
+	{
+		mSavedSettingInteriorEdgeSlot = gSavedSettings.getControl(CONTROL_NAME_INTERIOR_EDGE)->getSignal()->connect(boost::bind(&LLFloaterPathfindingConsole::handleNavMeshColorChange, this, _1, _2));
+	}
+	if (!mSavedSettingExteriorEdgeSlot.connected())
+	{
+		mSavedSettingExteriorEdgeSlot = gSavedSettings.getControl(CONTROL_NAME_EXTERIOR_EDGE)->getSignal()->connect(boost::bind(&LLFloaterPathfindingConsole::handleNavMeshColorChange, this, _1, _2));
+	}
+	if (!mSavedSettingHeatmapMinSlot.connected())
+	{
+		mSavedSettingHeatmapMinSlot = gSavedSettings.getControl(CONTROL_NAME_HEATMAP_MIN)->getSignal()->connect(boost::bind(&LLFloaterPathfindingConsole::handleNavMeshColorChange, this, _1, _2));
+	}
+	if (!mSavedSettingHeatmapMaxSlot.connected())
+	{
+		mSavedSettingHeatmapMaxSlot = gSavedSettings.getControl(CONTROL_NAME_HEATMAP_MAX)->getSignal()->connect(boost::bind(&LLFloaterPathfindingConsole::handleNavMeshColorChange, this, _1, _2));
+	}
+	if (!mSavedSettingNavMeshFaceSlot.connected())
+	{
+		mSavedSettingNavMeshFaceSlot = gSavedSettings.getControl(CONTROL_NAME_NAVMESH_FACE)->getSignal()->connect(boost::bind(&LLFloaterPathfindingConsole::handleNavMeshColorChange, this, _1, _2));
+	}
+	if (!mSavedSettingTestPathValidEndSlot.connected())
+	{
+		mSavedSettingTestPathValidEndSlot = gSavedSettings.getControl(CONTROL_NAME_TEST_PATH_VALID_END)->getSignal()->connect(boost::bind(&LLFloaterPathfindingConsole::handleNavMeshColorChange, this, _1, _2));
+	}
+	if (!mSavedSettingTestPathInvalidEndSlot.connected())
+	{
+		mSavedSettingTestPathInvalidEndSlot = gSavedSettings.getControl(CONTROL_NAME_TEST_PATH_INVALID_END)->getSignal()->connect(boost::bind(&LLFloaterPathfindingConsole::handleNavMeshColorChange, this, _1, _2));
+	}
+	if (!mSavedSettingTestPathSlot.connected())
+	{
+		mSavedSettingTestPathSlot = gSavedSettings.getControl(CONTROL_NAME_TEST_PATH)->getSignal()->connect(boost::bind(&LLFloaterPathfindingConsole::handleNavMeshColorChange, this, _1, _2));
+	}
+	if (!mSavedSettingWaterSlot.connected())
+	{
+		mSavedSettingWaterSlot = gSavedSettings.getControl(CONTROL_NAME_WATER)->getSignal()->connect(boost::bind(&LLFloaterPathfindingConsole::handleNavMeshColorChange, this, _1, _2));
+	}
+}
+
+void LLFloaterPathfindingConsole::deregisterSavedSettingsListeners()
+{
+	if (mSavedSettingRetrieveNeighborSlot.connected())
+	{
+		mSavedSettingRetrieveNeighborSlot.disconnect();
+	}
+	if (mSavedSettingWalkableSlot.connected())
+	{
+		mSavedSettingWalkableSlot.disconnect();
+	}
+	if (mSavedSettingStaticObstacleSlot.connected())
+	{
+		mSavedSettingStaticObstacleSlot.disconnect();
+	}
+	if (mSavedSettingMaterialVolumeSlot.connected())
+	{
+		mSavedSettingMaterialVolumeSlot.disconnect();
+	}
+	if (mSavedSettingExclusionVolumeSlot.connected())
+	{
+		mSavedSettingExclusionVolumeSlot.disconnect();
+	}
+	if (mSavedSettingInteriorEdgeSlot.connected())
+	{
+		mSavedSettingInteriorEdgeSlot.disconnect();
+	}
+	if (mSavedSettingExteriorEdgeSlot.connected())
+	{
+		mSavedSettingExteriorEdgeSlot.disconnect();
+	}
+	if (mSavedSettingHeatmapMinSlot.connected())
+	{
+		mSavedSettingHeatmapMinSlot.disconnect();
+	}
+	if (mSavedSettingHeatmapMaxSlot.connected())
+	{
+		mSavedSettingHeatmapMaxSlot.disconnect();
+	}
+	if (mSavedSettingNavMeshFaceSlot.connected())
+	{
+		mSavedSettingNavMeshFaceSlot.disconnect();
+	}
+	if (mSavedSettingTestPathValidEndSlot.connected())
+	{
+		mSavedSettingTestPathValidEndSlot.disconnect();
+	}
+	if (mSavedSettingTestPathInvalidEndSlot.connected())
+	{
+		mSavedSettingTestPathInvalidEndSlot.disconnect();
+	}
+	if (mSavedSettingTestPathSlot.connected())
+	{
+		mSavedSettingTestPathSlot.disconnect();
+	}
+	if (mSavedSettingWaterSlot.connected())
+	{
+		mSavedSettingWaterSlot.disconnect();
+	}
+}
+
+void LLFloaterPathfindingConsole::handleRetrieveNeighborChange(LLControlVariable *pControl, const LLSD &pNewValue)
+{
+	initializeNavMeshZoneForCurrentRegion();
+}
+
+void LLFloaterPathfindingConsole::handleNavMeshColorChange(LLControlVariable *pControl, const LLSD &pNewValue)
+{
+	fillInColorsForNavMeshVisualization();
+}
+
+void LLFloaterPathfindingConsole::fillInColorsForNavMeshVisualization()
+{
+	if (LLPathingLib::getInstance() != NULL)
+	{
+		LLPathingLib::NavMeshColors navMeshColors;
+
+		LLColor4 in = gSavedSettings.getColor4(CONTROL_NAME_WALKABLE_OBJECTS);
+		navMeshColors.mWalkable= LLColor4U(in); 
+
+		in = gSavedSettings.getColor4(CONTROL_NAME_STATIC_OBSTACLE_OBJECTS);
+		navMeshColors.mObstacle= LLColor4U(in); 
+
+		in = gSavedSettings.getColor4(CONTROL_NAME_MATERIAL_VOLUMES);
+		navMeshColors.mMaterial= LLColor4U(in); 
+
+		in = gSavedSettings.getColor4(CONTROL_NAME_EXCLUSION_VOLUMES);
+		navMeshColors.mExclusion= LLColor4U(in); 
+
+		in = gSavedSettings.getColor4(CONTROL_NAME_INTERIOR_EDGE);
+		navMeshColors.mConnectedEdge= LLColor4U(in); 
+
+		in = gSavedSettings.getColor4(CONTROL_NAME_EXTERIOR_EDGE);
+		navMeshColors.mBoundaryEdge= LLColor4U(in); 
+
+		navMeshColors.mHeatColorBase = gSavedSettings.getColor4(CONTROL_NAME_HEATMAP_MIN);
+
+		navMeshColors.mHeatColorMax = gSavedSettings.getColor4(CONTROL_NAME_HEATMAP_MAX);
+
+		in = gSavedSettings.getColor4(CONTROL_NAME_NAVMESH_FACE);
+		navMeshColors.mFaceColor= LLColor4U(in); 	
+
+		in = gSavedSettings.getColor4(CONTROL_NAME_TEST_PATH_VALID_END);
+		navMeshColors.mStarValid= LLColor4U(in); 	
+
+		in = gSavedSettings.getColor4(CONTROL_NAME_TEST_PATH_INVALID_END);
+		navMeshColors.mStarInvalid= LLColor4U(in);
+
+		in = gSavedSettings.getColor4(CONTROL_NAME_TEST_PATH);
+		navMeshColors.mTestPath= LLColor4U(in); 	
+
+		in = gSavedSettings.getColor4(CONTROL_NAME_WATER);
+		navMeshColors.mWaterColor= LLColor4U(in); 	
+
+		LLPathingLib::getInstance()->setNavMeshColors(navMeshColors);
+	}
+}
diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h
new file mode 100644
index 0000000000000000000000000000000000000000..4b2f7672e411e0bb00f0e789c767ac1bcfb745de
--- /dev/null
+++ b/indra/newview/llfloaterpathfindingconsole.h
@@ -0,0 +1,220 @@
+/** 
+* @file   llfloaterpathfindingconsole.h
+* @brief  "Pathfinding console" floater, allowing for viewing and testing of the pathfinding navmesh through Havok AI utilities.
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+* $/LicenseInfo$
+*/
+#ifndef LL_LLFLOATERPATHFINDINGCONSOLE_H
+#define LL_LLFLOATERPATHFINDINGCONSOLE_H
+
+#include <vector>
+
+#include <boost/signals2.hpp>
+
+#include "llfloater.h"
+#include "llhandle.h"
+#include "llpathfindingnavmeshzone.h"
+#include "llpathfindingpathtool.h"
+#include "llpathinglib.h"
+#include "v4color.h"
+
+class LLButton;
+class LLCheckBoxCtrl;
+class LLComboBox;
+class LLControlVariable;
+class LLPanel;
+class LLSD;
+class LLSliderCtrl;
+class LLTabContainer;
+class LLTextBase;
+class LLToolset;
+
+class LLFloaterPathfindingConsole
+:	public LLFloater
+{
+	friend class LLFloaterReg;
+
+public:
+	virtual BOOL postBuild();
+	virtual void onOpen(const LLSD& pKey);
+	virtual void onClose(bool pIsAppQuitting);
+
+	static LLHandle<LLFloaterPathfindingConsole> getInstanceHandle();
+
+	BOOL isRenderNavMesh() const;
+	void setRenderNavMesh(BOOL pIsRenderNavMesh);
+
+	BOOL isRenderWalkables() const;
+	void setRenderWalkables(BOOL pIsRenderWalkables);
+
+	BOOL isRenderStaticObstacles() const;
+	void setRenderStaticObstacles(BOOL pIsRenderStaticObstacles);
+
+	BOOL isRenderMaterialVolumes() const;
+	void setRenderMaterialVolumes(BOOL pIsRenderMaterialVolumes);
+
+	BOOL isRenderExclusionVolumes() const;
+	void setRenderExclusionVolumes(BOOL pIsRenderExclusionVolumes);
+
+	BOOL isRenderWorld() const;
+	void setRenderWorld(BOOL pIsRenderWorld);
+	
+	BOOL isRenderWorldMovablesOnly() const;
+	void setRenderWorldMovablesOnly(BOOL pIsRenderWorldMovablesOnly);
+
+	BOOL isRenderWaterPlane() const;
+	void setRenderWaterPlane(BOOL pIsRenderWaterPlane);
+	
+	BOOL isRenderXRay() const;
+	void setRenderXRay(BOOL pIsRenderXRay);
+	
+	BOOL isRenderAnyShapes() const;
+	U32  getRenderShapeFlags();
+
+	LLPathingLib::LLPLCharacterType getRenderHeatmapType() const;
+	void                            setRenderHeatmapType(LLPathingLib::LLPLCharacterType pRenderHeatmapType);
+
+protected:
+
+private:
+	typedef enum
+	{
+		kConsoleStateUnknown,
+		kConsoleStateLibraryNotImplemented,
+		kConsoleStateRegionNotEnabled,
+		kConsoleStateRegionLoading,
+		kConsoleStateCheckingVersion,
+		kConsoleStateDownloading,
+		kConsoleStateHasNavMesh,
+		kConsoleStateError
+	} EConsoleState;
+
+	// Does its own instance management, so clients not allowed
+	// to allocate or destroy.
+	LLFloaterPathfindingConsole(const LLSD& pSeed);
+	virtual ~LLFloaterPathfindingConsole();
+
+	void onTabSwitch();
+	void onShowWorldSet();
+	void onShowWorldMovablesOnlySet();
+	void onShowNavMeshSet();
+	void onShowWalkabilitySet();
+	void onCharacterWidthSet();
+	void onCharacterTypeSwitch();
+	void onClearPathClicked();
+
+	void handleNavMeshZoneStatus(LLPathfindingNavMeshZone::ENavMeshZoneRequestStatus pNavMeshZoneRequestStatus);
+	void onRegionBoundaryCross();
+	void onPathEvent();
+
+	void setDefaultInputs();
+	void setConsoleState(EConsoleState pConsoleState);
+	void setWorldRenderState();
+	void setNavMeshRenderState();
+	void updateRenderablesObjects();
+
+	void updateControlsOnConsoleState();
+	void updateViewerStatusOnConsoleState();
+	void updateSimulatorStatusOnConsoleState();
+
+	void initializeNavMeshZoneForCurrentRegion();
+
+	void switchIntoTestPathMode();
+	void switchOutOfTestPathMode();
+	void updateCharacterWidth();
+	void updateCharacterType();
+	void clearPath();
+	void updatePathTestStatus();
+
+	void registerSavedSettingsListeners();
+	void deregisterSavedSettingsListeners();
+	void handleRetrieveNeighborChange(LLControlVariable *pControl, const LLSD &pNewValue);
+	void handleNavMeshColorChange(LLControlVariable *pControl, const LLSD &pNewValue);
+	void fillInColorsForNavMeshVisualization();
+	void cleanupRenderableRestoreItems();
+
+	LLRootHandle<LLFloaterPathfindingConsole>     mSelfHandle;
+	LLTabContainer                                *mViewTestTabContainer;
+	LLPanel                                       *mViewTab;
+	LLTextBase                                    *mShowLabel;
+	LLCheckBoxCtrl                                *mShowWorldCheckBox;
+	LLCheckBoxCtrl                                *mShowWorldMovablesOnlyCheckBox;
+	LLCheckBoxCtrl                                *mShowNavMeshCheckBox;
+	LLTextBase                                    *mShowNavMeshWalkabilityLabel;
+	LLComboBox                                    *mShowNavMeshWalkabilityComboBox;
+	LLCheckBoxCtrl                                *mShowWalkablesCheckBox;
+	LLCheckBoxCtrl                                *mShowStaticObstaclesCheckBox;
+	LLCheckBoxCtrl                                *mShowMaterialVolumesCheckBox;
+	LLCheckBoxCtrl                                *mShowExclusionVolumesCheckBox;
+	LLCheckBoxCtrl								  *mShowRenderWaterPlaneCheckBox;
+	LLCheckBoxCtrl								  *mShowXRayCheckBox;
+	LLTextBase                                    *mPathfindingViewerStatus;
+	LLTextBase                                    *mPathfindingSimulatorStatus;
+	LLPanel                                       *mTestTab;
+	LLTextBase                                    *mCtrlClickLabel;
+	LLTextBase                                    *mShiftClickLabel;
+	LLTextBase                                    *mCharacterWidthLabel;
+	LLTextBase                                    *mCharacterWidthUnitLabel;
+	LLSliderCtrl                                  *mCharacterWidthSlider;
+	LLTextBase                                    *mCharacterTypeLabel;
+	LLComboBox                                    *mCharacterTypeComboBox;
+	LLTextBase                                    *mPathTestingStatus;
+	LLButton                                      *mClearPathButton;
+
+	LLColor4                                      mErrorColor;
+	LLColor4                                      mWarningColor;
+
+	LLPathfindingNavMeshZone::navmesh_zone_slot_t mNavMeshZoneSlot;
+	LLPathfindingNavMeshZone                      mNavMeshZone;
+	bool                                          mIsNavMeshUpdating;
+
+	boost::signals2::connection                   mRegionBoundarySlot;
+	boost::signals2::connection                   mTeleportFailedSlot;
+	LLPathfindingPathTool::path_event_slot_t      mPathEventSlot;
+
+	LLToolset                                     *mPathfindingToolset;
+	LLToolset                                     *mSavedToolset;
+
+	boost::signals2::connection                   mSavedSettingRetrieveNeighborSlot;
+	boost::signals2::connection                   mSavedSettingWalkableSlot;
+	boost::signals2::connection                   mSavedSettingStaticObstacleSlot;
+	boost::signals2::connection                   mSavedSettingMaterialVolumeSlot;
+	boost::signals2::connection                   mSavedSettingExclusionVolumeSlot;
+	boost::signals2::connection                   mSavedSettingInteriorEdgeSlot;
+	boost::signals2::connection                   mSavedSettingExteriorEdgeSlot;
+	boost::signals2::connection                   mSavedSettingHeatmapMinSlot;
+	boost::signals2::connection                   mSavedSettingHeatmapMaxSlot;
+	boost::signals2::connection                   mSavedSettingNavMeshFaceSlot;
+	boost::signals2::connection                   mSavedSettingTestPathValidEndSlot;
+	boost::signals2::connection                   mSavedSettingTestPathInvalidEndSlot;
+	boost::signals2::connection                   mSavedSettingTestPathSlot;
+	boost::signals2::connection                   mSavedSettingWaterSlot;
+
+	EConsoleState                                 mConsoleState;
+ 
+	std::vector<U32>							  mRenderableRestoreList;
+
+	static LLHandle<LLFloaterPathfindingConsole>  sInstanceHandle;
+};
+
+#endif // LL_LLFLOATERPATHFINDINGCONSOLE_H
diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..877bd0822d7b8233d140d204b74a37a20518beeb
--- /dev/null
+++ b/indra/newview/llfloaterpathfindinglinksets.cpp
@@ -0,0 +1,745 @@
+/** 
+* @file llfloaterpathfindinglinksets.cpp
+* @brief "Pathfinding linksets" floater, allowing manipulation of the linksets on the current region.
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, 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 "llfloaterpathfindinglinksets.h"
+
+#include <string>
+
+#include <boost/bind.hpp>
+
+#include "llagent.h"
+#include "llbutton.h"
+#include "llcombobox.h"
+#include "llfloaterpathfindingobjects.h"
+#include "llfloaterreg.h"
+#include "lllineeditor.h"
+#include "llnotificationsutil.h"
+#include "llpathfindinglinkset.h"
+#include "llpathfindinglinksetlist.h"
+#include "llpathfindingmanager.h"
+#include "llscrolllistitem.h"
+#include "llsd.h"
+#include "lltextbase.h"
+#include "lltextvalidate.h"
+#include "lluicolortable.h"
+#include "lluictrl.h"
+#include "v3math.h"
+#include "v4color.h"
+
+#define XUI_LINKSET_USE_NONE             0
+#define XUI_LINKSET_USE_WALKABLE         1
+#define XUI_LINKSET_USE_STATIC_OBSTACLE  2
+#define XUI_LINKSET_USE_DYNAMIC_OBSTACLE 3
+#define XUI_LINKSET_USE_MATERIAL_VOLUME  4
+#define XUI_LINKSET_USE_EXCLUSION_VOLUME 5
+#define XUI_LINKSET_USE_DYNAMIC_PHANTOM  6
+
+//---------------------------------------------------------------------------
+// LLFloaterPathfindingLinksets
+//---------------------------------------------------------------------------
+
+void LLFloaterPathfindingLinksets::openLinksetsWithSelectedObjects()
+{
+	LLFloaterPathfindingLinksets *linksetsFloater = LLFloaterReg::getTypedInstance<LLFloaterPathfindingLinksets>("pathfinding_linksets");
+	linksetsFloater->clearFilters();
+	linksetsFloater->showFloaterWithSelectionObjects();
+}
+
+LLFloaterPathfindingLinksets::LLFloaterPathfindingLinksets(const LLSD& pSeed)
+	: LLFloaterPathfindingObjects(pSeed),
+	mFilterByName(NULL),
+	mFilterByDescription(NULL),
+	mFilterByLinksetUse(NULL),
+	mEditLinksetUse(NULL),
+	mEditLinksetUseWalkable(NULL),
+	mEditLinksetUseStaticObstacle(NULL),
+	mEditLinksetUseDynamicObstacle(NULL),
+	mEditLinksetUseMaterialVolume(NULL),
+	mEditLinksetUseExclusionVolume(NULL),
+	mEditLinksetUseDynamicPhantom(NULL),
+	mLabelWalkabilityCoefficients(NULL),
+	mLabelEditA(NULL),
+	mLabelSuggestedUseA(NULL),
+	mEditA(NULL),
+	mLabelEditB(NULL),
+	mLabelSuggestedUseB(NULL),
+	mEditB(NULL),
+	mLabelEditC(NULL),
+	mLabelSuggestedUseC(NULL),
+	mEditC(NULL),
+	mLabelEditD(NULL),
+	mLabelSuggestedUseD(NULL),
+	mEditD(NULL),
+	mApplyEditsButton(NULL),
+	mBeaconColor()
+{
+}
+
+LLFloaterPathfindingLinksets::~LLFloaterPathfindingLinksets()
+{
+}
+
+BOOL LLFloaterPathfindingLinksets::postBuild()
+{
+	mBeaconColor = LLUIColorTable::getInstance()->getColor("PathfindingLinksetBeaconColor");
+
+	mFilterByName = findChild<LLLineEditor>("filter_by_name");
+	llassert(mFilterByName != NULL);
+	mFilterByName->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onApplyAllFilters, this));
+	mFilterByName->setSelectAllonFocusReceived(true);
+	mFilterByName->setCommitOnFocusLost(true);
+
+	mFilterByDescription = findChild<LLLineEditor>("filter_by_description");
+	llassert(mFilterByDescription != NULL);
+	mFilterByDescription->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onApplyAllFilters, this));
+	mFilterByDescription->setSelectAllonFocusReceived(true);
+	mFilterByDescription->setCommitOnFocusLost(true);
+
+	mFilterByLinksetUse = findChild<LLComboBox>("filter_by_linkset_use");
+	llassert(mFilterByLinksetUse != NULL);
+	mFilterByLinksetUse->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onApplyAllFilters, this));
+
+	childSetAction("apply_filters", boost::bind(&LLFloaterPathfindingLinksets::onApplyAllFilters, this));
+	childSetAction("clear_filters", boost::bind(&LLFloaterPathfindingLinksets::onClearFiltersClicked, this));
+
+	mEditLinksetUse = findChild<LLComboBox>("edit_linkset_use");
+	llassert(mEditLinksetUse != NULL);
+	mEditLinksetUse->clearRows();
+
+	mEditLinksetUseUnset = mEditLinksetUse->addElement(buildLinksetUseScrollListData(getString("linkset_choose_use"), XUI_LINKSET_USE_NONE));
+	llassert(mEditLinksetUseUnset != NULL);
+
+	mEditLinksetUseWalkable = mEditLinksetUse->addElement(buildLinksetUseScrollListData(getLinksetUseString(LLPathfindingLinkset::kWalkable), XUI_LINKSET_USE_WALKABLE));
+	llassert(mEditLinksetUseWalkable != NULL);
+
+	mEditLinksetUseStaticObstacle = mEditLinksetUse->addElement(buildLinksetUseScrollListData(getLinksetUseString(LLPathfindingLinkset::kStaticObstacle), XUI_LINKSET_USE_STATIC_OBSTACLE));
+	llassert(mEditLinksetUseStaticObstacle != NULL);
+
+	mEditLinksetUseDynamicObstacle = mEditLinksetUse->addElement(buildLinksetUseScrollListData(getLinksetUseString(LLPathfindingLinkset::kDynamicObstacle), XUI_LINKSET_USE_DYNAMIC_OBSTACLE));
+	llassert(mEditLinksetUseDynamicObstacle != NULL);
+
+	mEditLinksetUseMaterialVolume = mEditLinksetUse->addElement(buildLinksetUseScrollListData(getLinksetUseString(LLPathfindingLinkset::kMaterialVolume), XUI_LINKSET_USE_MATERIAL_VOLUME));
+	llassert(mEditLinksetUseMaterialVolume != NULL);
+
+	mEditLinksetUseExclusionVolume = mEditLinksetUse->addElement(buildLinksetUseScrollListData(getLinksetUseString(LLPathfindingLinkset::kExclusionVolume), XUI_LINKSET_USE_EXCLUSION_VOLUME));
+	llassert(mEditLinksetUseExclusionVolume != NULL);
+
+	mEditLinksetUseDynamicPhantom = mEditLinksetUse->addElement(buildLinksetUseScrollListData(getLinksetUseString(LLPathfindingLinkset::kDynamicPhantom), XUI_LINKSET_USE_DYNAMIC_PHANTOM));
+	llassert(mEditLinksetUseDynamicPhantom != NULL);
+
+	mEditLinksetUse->selectFirstItem();
+
+	mLabelWalkabilityCoefficients = findChild<LLTextBase>("walkability_coefficients_label");
+	llassert(mLabelWalkabilityCoefficients != NULL);
+
+	mLabelEditA = findChild<LLTextBase>("edit_a_label");
+	llassert(mLabelEditA != NULL);
+
+	mLabelSuggestedUseA = findChild<LLTextBase>("suggested_use_a_label");
+	llassert(mLabelSuggestedUseA != NULL);
+
+	mEditA = findChild<LLLineEditor>("edit_a_value");
+	llassert(mEditA != NULL);
+	mEditA->setPrevalidate(LLTextValidate::validateNonNegativeS32);
+	mEditA->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1));
+
+	mLabelEditB = findChild<LLTextBase>("edit_b_label");
+	llassert(mLabelEditB != NULL);
+
+	mLabelSuggestedUseB = findChild<LLTextBase>("suggested_use_b_label");
+	llassert(mLabelSuggestedUseB != NULL);
+
+	mEditB = findChild<LLLineEditor>("edit_b_value");
+	llassert(mEditB != NULL);
+	mEditB->setPrevalidate(LLTextValidate::validateNonNegativeS32);
+	mEditB->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1));
+
+	mLabelEditC = findChild<LLTextBase>("edit_c_label");
+	llassert(mLabelEditC != NULL);
+
+	mLabelSuggestedUseC = findChild<LLTextBase>("suggested_use_c_label");
+	llassert(mLabelSuggestedUseC != NULL);
+
+	mEditC = findChild<LLLineEditor>("edit_c_value");
+	llassert(mEditC != NULL);
+	mEditC->setPrevalidate(LLTextValidate::validateNonNegativeS32);
+	mEditC->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1));
+
+	mLabelEditD = findChild<LLTextBase>("edit_d_label");
+	llassert(mLabelEditD != NULL);
+
+	mLabelSuggestedUseD = findChild<LLTextBase>("suggested_use_d_label");
+	llassert(mLabelSuggestedUseD != NULL);
+
+	mEditD = findChild<LLLineEditor>("edit_d_value");
+	llassert(mEditD != NULL);
+	mEditD->setPrevalidate(LLTextValidate::validateNonNegativeS32);
+	mEditD->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered, this, _1));
+
+	mApplyEditsButton = findChild<LLButton>("apply_edit_values");
+	llassert(mApplyEditsButton != NULL);
+	mApplyEditsButton->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onApplyChangesClicked, this));
+
+	return LLFloaterPathfindingObjects::postBuild();
+}
+
+void LLFloaterPathfindingLinksets::requestGetObjects()
+{
+	LLPathfindingManager::getInstance()->requestGetLinksets(getNewRequestId(), boost::bind(&LLFloaterPathfindingLinksets::handleNewObjectList, this, _1, _2, _3));
+}
+
+LLSD LLFloaterPathfindingLinksets::convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr)
+{
+	llassert(pObjectListPtr != NULL);
+	llassert(!pObjectListPtr->isEmpty());
+
+	std::string nameFilter = mFilterByName->getText();
+	std::string descriptionFilter = mFilterByDescription->getText();
+	LLPathfindingLinkset::ELinksetUse linksetUseFilter = getFilterLinksetUse();
+	bool isFilteringName = !nameFilter.empty();
+	bool isFilteringDescription = !descriptionFilter.empty();
+	bool isFilteringLinksetUse = (linksetUseFilter != LLPathfindingLinkset::kUnknown);
+
+	LLSD scrollListData = LLSD::emptyArray();
+	const LLVector3& avatarPosition = gAgent.getPositionAgent();
+
+	if (isFilteringName || isFilteringDescription || isFilteringLinksetUse)
+	{
+		LLStringUtil::toUpper(nameFilter);
+		LLStringUtil::toUpper(descriptionFilter);
+		for (LLPathfindingObjectList::const_iterator objectIter = pObjectListPtr->begin();	objectIter != pObjectListPtr->end(); ++objectIter)
+		{
+			const LLPathfindingLinkset *linksetPtr = dynamic_cast<const LLPathfindingLinkset *>(objectIter->second.get());
+			std::string linksetName = (linksetPtr->isTerrain() ? getString("linkset_terrain_name") : linksetPtr->getName());
+			std::string linksetDescription = linksetPtr->getDescription();
+			LLStringUtil::toUpper(linksetName);
+			LLStringUtil::toUpper(linksetDescription);
+			if ((!isFilteringName || (linksetName.find(nameFilter) != std::string::npos)) &&
+				(!isFilteringDescription || (linksetDescription.find(descriptionFilter) != std::string::npos)) &&
+				(!isFilteringLinksetUse || (linksetPtr->getLinksetUse() == linksetUseFilter)))
+			{
+				LLSD element = buildLinksetScrollListData(linksetPtr, avatarPosition);
+				scrollListData.append(element);
+
+				if (linksetPtr->hasOwner() && !linksetPtr->hasOwnerName())
+				{
+					rebuildScrollListAfterAvatarNameLoads(linksetPtr->getUUID());
+				}
+			}
+		}
+	}
+	else
+	{
+		for (LLPathfindingObjectList::const_iterator objectIter = pObjectListPtr->begin();	objectIter != pObjectListPtr->end(); ++objectIter)
+		{
+			const LLPathfindingLinkset *linksetPtr = dynamic_cast<const LLPathfindingLinkset *>(objectIter->second.get());
+			LLSD element = buildLinksetScrollListData(linksetPtr, avatarPosition);
+			scrollListData.append(element);
+
+			if (linksetPtr->hasOwner() && !linksetPtr->hasOwnerName())
+			{
+				rebuildScrollListAfterAvatarNameLoads(linksetPtr->getUUID());
+			}
+		}
+	}
+
+	return scrollListData;
+}
+
+void LLFloaterPathfindingLinksets::updateControlsOnScrollListChange()
+{
+	LLFloaterPathfindingObjects::updateControlsOnScrollListChange();
+	updateEditFieldValues();
+	updateStateOnEditFields();
+	updateStateOnEditLinksetUse();
+}
+
+S32 LLFloaterPathfindingLinksets::getNameColumnIndex() const
+{
+	return 0;
+}
+
+const LLColor4 &LLFloaterPathfindingLinksets::getBeaconColor() const
+{
+	return mBeaconColor;
+}
+
+LLPathfindingObjectListPtr LLFloaterPathfindingLinksets::getEmptyObjectList() const
+{
+	LLPathfindingObjectListPtr objectListPtr(new LLPathfindingLinksetList());
+	return objectListPtr;
+}
+
+void LLFloaterPathfindingLinksets::requestSetLinksets(LLPathfindingObjectListPtr pLinksetList, LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD)
+{
+	LLPathfindingManager::getInstance()->requestSetLinksets(getNewRequestId(), pLinksetList, pLinksetUse, pA, pB, pC, pD, boost::bind(&LLFloaterPathfindingLinksets::handleUpdateObjectList, this, _1, _2, _3));
+}
+
+void LLFloaterPathfindingLinksets::onApplyAllFilters()
+{
+	rebuildObjectsScrollList();
+}
+
+void LLFloaterPathfindingLinksets::onClearFiltersClicked()
+{
+	clearFilters();
+	rebuildObjectsScrollList();
+}
+
+void LLFloaterPathfindingLinksets::onWalkabilityCoefficientEntered(LLUICtrl *pUICtrl)
+{
+	LLLineEditor *pLineEditor = static_cast<LLLineEditor *>(pUICtrl);
+	llassert(pLineEditor != NULL);
+
+	const std::string &valueString = pLineEditor->getText();
+	S32 value;
+
+	if (LLStringUtil::convertToS32(valueString, value))
+	{
+		if ((value < LLPathfindingLinkset::MIN_WALKABILITY_VALUE) || (value > LLPathfindingLinkset::MAX_WALKABILITY_VALUE))
+		{
+			value = llclamp(value, LLPathfindingLinkset::MIN_WALKABILITY_VALUE, LLPathfindingLinkset::MAX_WALKABILITY_VALUE);
+			pLineEditor->setValue(LLSD(value));
+		}
+	}
+	else
+	{
+		pLineEditor->setValue(LLSD(LLPathfindingLinkset::MAX_WALKABILITY_VALUE));
+	}
+}
+
+void LLFloaterPathfindingLinksets::onApplyChangesClicked()
+{
+	applyEdit();
+}
+
+void LLFloaterPathfindingLinksets::clearFilters()
+{
+	mFilterByName->clear();
+	mFilterByDescription->clear();
+	setFilterLinksetUse(LLPathfindingLinkset::kUnknown);
+}
+
+void LLFloaterPathfindingLinksets::updateEditFieldValues()
+{
+	int numSelectedObjects = getNumSelectedObjects();
+	if (numSelectedObjects <= 0)
+	{
+		mEditLinksetUse->selectFirstItem();
+		mEditA->clear();
+		mEditB->clear();
+		mEditC->clear();
+		mEditD->clear();
+	}
+	else
+	{
+		LLPathfindingObjectPtr firstSelectedObjectPtr = getFirstSelectedObject();
+		llassert(firstSelectedObjectPtr != NULL);
+
+		const LLPathfindingLinkset *linkset = dynamic_cast<const LLPathfindingLinkset *>(firstSelectedObjectPtr.get());
+
+		setEditLinksetUse(linkset->getLinksetUse());
+		mEditA->setValue(LLSD(linkset->getWalkabilityCoefficientA()));
+		mEditB->setValue(LLSD(linkset->getWalkabilityCoefficientB()));
+		mEditC->setValue(LLSD(linkset->getWalkabilityCoefficientC()));
+		mEditD->setValue(LLSD(linkset->getWalkabilityCoefficientD()));
+	}
+}
+
+LLSD LLFloaterPathfindingLinksets::buildLinksetScrollListData(const LLPathfindingLinkset *pLinksetPtr, const LLVector3 &pAvatarPosition) const
+{
+	llassert(pLinksetPtr != NULL);
+	LLSD columns;
+
+	if (pLinksetPtr->isTerrain())
+	{
+		columns[0]["column"] = "name";
+		columns[0]["value"] = getString("linkset_terrain_name");
+
+		columns[1]["column"] = "description";
+		columns[1]["value"] = getString("linkset_terrain_description");
+
+		columns[2]["column"] = "owner";
+		columns[2]["value"] = getString("linkset_terrain_owner");
+
+		columns[3]["column"] = "land_impact";
+		columns[3]["value"] = getString("linkset_terrain_land_impact");
+
+		columns[4]["column"] = "dist_from_you";
+		columns[4]["value"] = getString("linkset_terrain_dist_from_you");
+	}
+	else
+	{
+		columns[0]["column"] = "name";
+		columns[0]["value"] = pLinksetPtr->getName();
+
+		columns[1]["column"] = "description";
+		columns[1]["value"] = pLinksetPtr->getDescription();
+
+		columns[2]["column"] = "owner";
+		columns[2]["value"] = (pLinksetPtr->hasOwner()
+			? (pLinksetPtr->hasOwnerName()
+			? (pLinksetPtr->isGroupOwned()
+			? (pLinksetPtr->getOwnerName() + " " + getString("linkset_owner_group"))
+			: pLinksetPtr->getOwnerName())
+			: getString("linkset_owner_loading"))
+			: getString("linkset_owner_unknown"));
+
+		columns[3]["column"] = "land_impact";
+		columns[3]["value"] = llformat("%1d", pLinksetPtr->getLandImpact());
+
+		columns[4]["column"] = "dist_from_you";
+		columns[4]["value"] = llformat("%1.0f m", dist_vec(pAvatarPosition, pLinksetPtr->getLocation()));
+	}
+
+	columns[5]["column"] = "linkset_use";
+	std::string linksetUse = getLinksetUseString(pLinksetPtr->getLinksetUse());
+	if (pLinksetPtr->isTerrain())
+	{
+		linksetUse += (" " + getString("linkset_is_terrain"));
+	}
+	else if (!pLinksetPtr->isModifiable() && pLinksetPtr->canBeVolume())
+	{
+		linksetUse += (" " + getString("linkset_is_restricted_state"));
+	}
+	else if (pLinksetPtr->isModifiable() && !pLinksetPtr->canBeVolume())
+	{
+		linksetUse += (" " + getString("linkset_is_non_volume_state"));
+	}
+	else if (!pLinksetPtr->isModifiable() && !pLinksetPtr->canBeVolume())
+	{
+		linksetUse += (" " + getString("linkset_is_restricted_non_volume_state"));
+	}
+	columns[5]["value"] = linksetUse;
+
+	columns[6]["column"] = "a_percent";
+	columns[6]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientA());
+
+	columns[7]["column"] = "b_percent";
+	columns[7]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientB());
+
+	columns[8]["column"] = "c_percent";
+	columns[8]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientC());
+
+	columns[9]["column"] = "d_percent";
+	columns[9]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientD());
+
+	LLSD element;
+	element["id"] = pLinksetPtr->getUUID().asString();
+	element["column"] = columns;
+
+	return element;
+}
+
+LLSD LLFloaterPathfindingLinksets::buildLinksetUseScrollListData(const std::string &pLabel, S32 pValue) const
+{
+	LLSD columns;
+
+	columns[0]["column"] = "name";
+	columns[0]["value"] = pLabel;
+	columns[0]["font"] = "SANSSERIF";
+
+	LLSD element;
+	element["value"] = pValue;
+	element["column"] = columns;
+
+	return element;
+}
+
+bool LLFloaterPathfindingLinksets::isShowUnmodifiablePhantomWarning(LLPathfindingLinkset::ELinksetUse pLinksetUse) const
+{
+	bool isShowWarning = false;
+
+	if (pLinksetUse != LLPathfindingLinkset::kUnknown)
+	{
+		LLPathfindingObjectListPtr selectedObjects = getSelectedObjects();
+		if ((selectedObjects != NULL) && !selectedObjects->isEmpty())
+		{
+			const LLPathfindingLinksetList *linksetList = dynamic_cast<const LLPathfindingLinksetList *>(selectedObjects.get());
+			isShowWarning = linksetList->isShowUnmodifiablePhantomWarning(pLinksetUse);
+		}
+	}
+
+	return isShowWarning;
+}
+
+bool LLFloaterPathfindingLinksets::isShowCannotBeVolumeWarning(LLPathfindingLinkset::ELinksetUse pLinksetUse) const
+{
+	bool isShowWarning = false;
+
+	if (pLinksetUse != LLPathfindingLinkset::kUnknown)
+	{
+		LLPathfindingObjectListPtr selectedObjects = getSelectedObjects();
+		if ((selectedObjects != NULL) && !selectedObjects->isEmpty())
+		{
+			const LLPathfindingLinksetList *linksetList = dynamic_cast<const LLPathfindingLinksetList *>(selectedObjects.get());
+			isShowWarning = linksetList->isShowCannotBeVolumeWarning(pLinksetUse);
+		}
+	}
+
+	return isShowWarning;
+}
+
+void LLFloaterPathfindingLinksets::updateStateOnEditFields()
+{
+	int numSelectedItems = getNumSelectedObjects();
+	bool isEditEnabled = (numSelectedItems > 0);
+
+	mEditLinksetUse->setEnabled(isEditEnabled);
+
+	mLabelWalkabilityCoefficients->setEnabled(isEditEnabled);
+	mLabelEditA->setEnabled(isEditEnabled);
+	mLabelEditB->setEnabled(isEditEnabled);
+	mLabelEditC->setEnabled(isEditEnabled);
+	mLabelEditD->setEnabled(isEditEnabled);
+	mLabelSuggestedUseA->setEnabled(isEditEnabled);
+	mLabelSuggestedUseB->setEnabled(isEditEnabled);
+	mLabelSuggestedUseC->setEnabled(isEditEnabled);
+	mLabelSuggestedUseD->setEnabled(isEditEnabled);
+	mEditA->setEnabled(isEditEnabled);
+	mEditB->setEnabled(isEditEnabled);
+	mEditC->setEnabled(isEditEnabled);
+	mEditD->setEnabled(isEditEnabled);
+
+	mApplyEditsButton->setEnabled(isEditEnabled && (getMessagingState() == kMessagingComplete));
+}
+
+void LLFloaterPathfindingLinksets::updateStateOnEditLinksetUse()
+{
+	BOOL useWalkable = FALSE;
+	BOOL useStaticObstacle = FALSE;
+	BOOL useDynamicObstacle = FALSE;
+	BOOL useMaterialVolume = FALSE;
+	BOOL useExclusionVolume = FALSE;
+	BOOL useDynamicPhantom = FALSE;
+
+	LLPathfindingObjectListPtr selectedObjects = getSelectedObjects();
+	if ((selectedObjects != NULL) && !selectedObjects->isEmpty())
+	{
+		const LLPathfindingLinksetList *linksetList = dynamic_cast<const LLPathfindingLinksetList *>(selectedObjects.get());
+		linksetList->determinePossibleStates(useWalkable, useStaticObstacle, useDynamicObstacle, useMaterialVolume, useExclusionVolume, useDynamicPhantom);
+	}
+
+	mEditLinksetUseWalkable->setEnabled(useWalkable);
+	mEditLinksetUseStaticObstacle->setEnabled(useStaticObstacle);
+	mEditLinksetUseDynamicObstacle->setEnabled(useDynamicObstacle);
+	mEditLinksetUseMaterialVolume->setEnabled(useMaterialVolume);
+	mEditLinksetUseExclusionVolume->setEnabled(useExclusionVolume);
+	mEditLinksetUseDynamicPhantom->setEnabled(useDynamicPhantom);
+}
+
+void LLFloaterPathfindingLinksets::applyEdit()
+{
+	LLPathfindingLinkset::ELinksetUse linksetUse = getEditLinksetUse();
+
+	bool showUnmodifiablePhantomWarning = isShowUnmodifiablePhantomWarning(linksetUse);
+	bool showCannotBeVolumeWarning = isShowCannotBeVolumeWarning(linksetUse);
+
+	if (showUnmodifiablePhantomWarning || showCannotBeVolumeWarning)
+	{
+		LLPathfindingLinkset::ELinksetUse restrictedLinksetUse = LLPathfindingLinkset::getLinksetUseWithToggledPhantom(linksetUse);
+		LLSD substitutions;
+		substitutions["REQUESTED_TYPE"] = getLinksetUseString(linksetUse);
+		substitutions["RESTRICTED_TYPE"] = getLinksetUseString(restrictedLinksetUse);
+
+		std::string notificationName;
+		if (showUnmodifiablePhantomWarning && showCannotBeVolumeWarning)
+		{
+			notificationName = "PathfindingLinksets_SetLinksetUseMismatchOnRestrictedAndVolume";
+		}
+		else if (showUnmodifiablePhantomWarning)
+		{
+			notificationName = "PathfindingLinksets_SetLinksetUseMismatchOnRestricted";
+		}
+		else
+		{
+			notificationName = "PathfindingLinksets_SetLinksetUseMismatchOnVolume";
+		}
+		LLNotificationsUtil::add(notificationName, substitutions, LLSD(), boost::bind(&LLFloaterPathfindingLinksets::handleApplyEdit, this, _1, _2));
+	}
+	else
+	{
+		doApplyEdit();
+	}
+}
+
+void LLFloaterPathfindingLinksets::handleApplyEdit(const LLSD &pNotification, const LLSD &pResponse)
+{
+	if (LLNotificationsUtil::getSelectedOption(pNotification, pResponse) == 0)
+	{
+		doApplyEdit();
+	}
+}
+
+void LLFloaterPathfindingLinksets::doApplyEdit()
+{
+	LLPathfindingObjectListPtr selectedObjects = getSelectedObjects();
+	if ((selectedObjects != NULL) && !selectedObjects->isEmpty())
+	{
+		LLPathfindingLinkset::ELinksetUse linksetUse = getEditLinksetUse();
+		const std::string &aString = mEditA->getText();
+		const std::string &bString = mEditB->getText();
+		const std::string &cString = mEditC->getText();
+		const std::string &dString = mEditD->getText();
+		S32 aValue = static_cast<S32>(atoi(aString.c_str()));
+		S32 bValue = static_cast<S32>(atoi(bString.c_str()));
+		S32 cValue = static_cast<S32>(atoi(cString.c_str()));
+		S32 dValue = static_cast<S32>(atoi(dString.c_str()));
+
+
+		requestSetLinksets(selectedObjects, linksetUse, aValue, bValue, cValue, dValue);
+	}
+}
+
+std::string LLFloaterPathfindingLinksets::getLinksetUseString(LLPathfindingLinkset::ELinksetUse pLinksetUse) const
+{
+	std::string linksetUse;
+
+	switch (pLinksetUse)
+	{
+	case LLPathfindingLinkset::kWalkable :
+		linksetUse = getString("linkset_use_walkable");
+		break;
+	case LLPathfindingLinkset::kStaticObstacle :
+		linksetUse = getString("linkset_use_static_obstacle");
+		break;
+	case LLPathfindingLinkset::kDynamicObstacle :
+		linksetUse = getString("linkset_use_dynamic_obstacle");
+		break;
+	case LLPathfindingLinkset::kMaterialVolume :
+		linksetUse = getString("linkset_use_material_volume");
+		break;
+	case LLPathfindingLinkset::kExclusionVolume :
+		linksetUse = getString("linkset_use_exclusion_volume");
+		break;
+	case LLPathfindingLinkset::kDynamicPhantom :
+		linksetUse = getString("linkset_use_dynamic_phantom");
+		break;
+	case LLPathfindingLinkset::kUnknown :
+	default :
+		linksetUse = getString("linkset_use_dynamic_obstacle");
+		llassert(0);
+		break;
+	}
+
+	return linksetUse;
+}
+
+LLPathfindingLinkset::ELinksetUse LLFloaterPathfindingLinksets::getFilterLinksetUse() const
+{
+	return convertToLinksetUse(mFilterByLinksetUse->getValue());
+}
+
+void LLFloaterPathfindingLinksets::setFilterLinksetUse(LLPathfindingLinkset::ELinksetUse pLinksetUse)
+{
+	mFilterByLinksetUse->setValue(convertToXuiValue(pLinksetUse));
+}
+
+LLPathfindingLinkset::ELinksetUse LLFloaterPathfindingLinksets::getEditLinksetUse() const
+{
+	return convertToLinksetUse(mEditLinksetUse->getValue());
+}
+
+void LLFloaterPathfindingLinksets::setEditLinksetUse(LLPathfindingLinkset::ELinksetUse pLinksetUse)
+{
+	mEditLinksetUse->setValue(convertToXuiValue(pLinksetUse));
+}
+
+LLPathfindingLinkset::ELinksetUse LLFloaterPathfindingLinksets::convertToLinksetUse(LLSD pXuiValue) const
+{
+	LLPathfindingLinkset::ELinksetUse linkUse;
+
+	switch (pXuiValue.asInteger())
+	{
+	case XUI_LINKSET_USE_NONE :
+		linkUse = LLPathfindingLinkset::kUnknown;
+		break;
+	case XUI_LINKSET_USE_WALKABLE :
+		linkUse = LLPathfindingLinkset::kWalkable;
+		break;
+	case XUI_LINKSET_USE_STATIC_OBSTACLE :
+		linkUse = LLPathfindingLinkset::kStaticObstacle;
+		break;
+	case XUI_LINKSET_USE_DYNAMIC_OBSTACLE :
+		linkUse = LLPathfindingLinkset::kDynamicObstacle;
+		break;
+	case XUI_LINKSET_USE_MATERIAL_VOLUME :
+		linkUse = LLPathfindingLinkset::kMaterialVolume;
+		break;
+	case XUI_LINKSET_USE_EXCLUSION_VOLUME :
+		linkUse = LLPathfindingLinkset::kExclusionVolume;
+		break;
+	case XUI_LINKSET_USE_DYNAMIC_PHANTOM :
+		linkUse = LLPathfindingLinkset::kDynamicPhantom;
+		break;
+	default :
+		linkUse = LLPathfindingLinkset::kUnknown;
+		llassert(0);
+		break;
+	}
+
+	return linkUse;
+}
+
+LLSD LLFloaterPathfindingLinksets::convertToXuiValue(LLPathfindingLinkset::ELinksetUse pLinksetUse) const
+{
+	LLSD xuiValue;
+
+	switch (pLinksetUse)
+	{
+	case LLPathfindingLinkset::kUnknown :
+		xuiValue = XUI_LINKSET_USE_NONE;
+		break;
+	case LLPathfindingLinkset::kWalkable :
+		xuiValue = XUI_LINKSET_USE_WALKABLE;
+		break;
+	case LLPathfindingLinkset::kStaticObstacle :
+		xuiValue = XUI_LINKSET_USE_STATIC_OBSTACLE;
+		break;
+	case LLPathfindingLinkset::kDynamicObstacle :
+		xuiValue = XUI_LINKSET_USE_DYNAMIC_OBSTACLE;
+		break;
+	case LLPathfindingLinkset::kMaterialVolume :
+		xuiValue = XUI_LINKSET_USE_MATERIAL_VOLUME;
+		break;
+	case LLPathfindingLinkset::kExclusionVolume :
+		xuiValue = XUI_LINKSET_USE_EXCLUSION_VOLUME;
+		break;
+	case LLPathfindingLinkset::kDynamicPhantom :
+		xuiValue = XUI_LINKSET_USE_DYNAMIC_PHANTOM;
+		break;
+	default :
+		xuiValue = XUI_LINKSET_USE_NONE;
+		llassert(0);
+		break;
+	}
+
+	return xuiValue;
+}
diff --git a/indra/newview/llfloaterpathfindinglinksets.h b/indra/newview/llfloaterpathfindinglinksets.h
new file mode 100644
index 0000000000000000000000000000000000000000..342a64fc7753ed74eaa656b52a5b42f27878b40c
--- /dev/null
+++ b/indra/newview/llfloaterpathfindinglinksets.h
@@ -0,0 +1,134 @@
+/** 
+* @file   llfloaterpathfindinglinksets.h
+* @brief  "Pathfinding linksets" floater, allowing manipulation of the linksets on the current region.
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+* $/LicenseInfo$
+*/
+#ifndef LL_LLFLOATERPATHFINDINGLINKSETS_H
+#define LL_LLFLOATERPATHFINDINGLINKSETS_H
+
+#include <string>
+
+#include "llfloaterpathfindingobjects.h"
+#include "llpathfindinglinkset.h"
+#include "llpathfindingobjectlist.h"
+#include "v4color.h"
+
+class LLButton;
+class LLComboBox;
+class LLLineEditor;
+class LLScrollListItem;
+class LLSD;
+class LLTextBase;
+class LLUICtrl;
+class LLVector3;
+
+class LLFloaterPathfindingLinksets : public LLFloaterPathfindingObjects
+{
+public:
+	static void  openLinksetsWithSelectedObjects();
+
+protected:
+	friend class LLFloaterReg;
+
+	LLFloaterPathfindingLinksets(const LLSD& pSeed);
+	virtual ~LLFloaterPathfindingLinksets();
+
+	virtual BOOL                       postBuild();
+
+	virtual void                       requestGetObjects();
+
+	virtual LLSD                       convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr);
+
+	virtual void                       updateControlsOnScrollListChange();
+
+	virtual S32                        getNameColumnIndex() const;
+	virtual const LLColor4             &getBeaconColor() const;
+
+	virtual LLPathfindingObjectListPtr getEmptyObjectList() const;
+
+private:
+	void requestSetLinksets(LLPathfindingObjectListPtr pLinksetList, LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD);
+
+	void onApplyAllFilters();
+	void onClearFiltersClicked();
+	void onWalkabilityCoefficientEntered(LLUICtrl *pUICtrl);
+	void onApplyChangesClicked();
+
+	void clearFilters();
+
+	void updateEditFieldValues();
+	LLSD buildLinksetScrollListData(const LLPathfindingLinkset *pLinksetPtr, const LLVector3 &pAvatarPosition) const;
+	LLSD buildLinksetUseScrollListData(const std::string &pLabel, S32 pValue) const;
+
+	bool isShowUnmodifiablePhantomWarning(LLPathfindingLinkset::ELinksetUse pLinksetUse) const;
+	bool isShowCannotBeVolumeWarning(LLPathfindingLinkset::ELinksetUse pLinksetUse) const;
+
+	void updateStateOnEditFields();
+	void updateStateOnEditLinksetUse();
+
+	void applyEdit();
+	void handleApplyEdit(const LLSD &pNotification, const LLSD &pResponse);
+	void doApplyEdit();
+
+	std::string getLinksetUseString(LLPathfindingLinkset::ELinksetUse pLinksetUse) const;
+
+	LLPathfindingLinkset::ELinksetUse getFilterLinksetUse() const;
+	void                              setFilterLinksetUse(LLPathfindingLinkset::ELinksetUse pLinksetUse);
+
+	LLPathfindingLinkset::ELinksetUse getEditLinksetUse() const;
+	void                              setEditLinksetUse(LLPathfindingLinkset::ELinksetUse pLinksetUse);
+
+	LLPathfindingLinkset::ELinksetUse convertToLinksetUse(LLSD pXuiValue) const;
+	LLSD                              convertToXuiValue(LLPathfindingLinkset::ELinksetUse pLinksetUse) const;
+
+	LLLineEditor     *mFilterByName;
+	LLLineEditor     *mFilterByDescription;
+	LLComboBox       *mFilterByLinksetUse;
+	LLComboBox       *mEditLinksetUse;
+	LLScrollListItem *mEditLinksetUseUnset;
+	LLScrollListItem *mEditLinksetUseWalkable;
+	LLScrollListItem *mEditLinksetUseStaticObstacle;
+	LLScrollListItem *mEditLinksetUseDynamicObstacle;
+	LLScrollListItem *mEditLinksetUseMaterialVolume;
+	LLScrollListItem *mEditLinksetUseExclusionVolume;
+	LLScrollListItem *mEditLinksetUseDynamicPhantom;
+	LLTextBase       *mLabelWalkabilityCoefficients;
+	LLTextBase       *mLabelEditA;
+	LLTextBase       *mLabelSuggestedUseA;
+	LLLineEditor     *mEditA;
+	LLTextBase       *mLabelEditB;
+	LLTextBase       *mLabelSuggestedUseB;
+	LLLineEditor     *mEditB;
+	LLTextBase       *mLabelEditC;
+	LLTextBase       *mLabelSuggestedUseC;
+	LLLineEditor     *mEditC;
+	LLTextBase       *mLabelEditD;
+	LLTextBase       *mLabelSuggestedUseD;
+	LLLineEditor     *mEditD;
+	LLButton         *mApplyEditsButton;
+
+	LLColor4         mBeaconColor;
+};
+
+#endif // LL_LLFLOATERPATHFINDINGLINKSETS_H
diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e246265be93299e11c1a4de0b54fe8edcd30a09e
--- /dev/null
+++ b/indra/newview/llfloaterpathfindingobjects.cpp
@@ -0,0 +1,866 @@
+/** 
+* @file llfloaterpathfindingobjects.cpp
+* @brief Base class for both the pathfinding linksets and characters floater.
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, 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 "llfloaterpathfindingobjects.h"
+
+#include <vector>
+
+#include <boost/bind.hpp>
+#include <boost/signals2.hpp>
+
+#include "llagent.h"
+#include "llavatarname.h"
+#include "llavatarnamecache.h"
+#include "llbutton.h"
+#include "llcheckboxctrl.h"
+#include "llenvmanager.h"
+#include "llfloater.h"
+#include "llfontgl.h"
+#include "llnotifications.h"
+#include "llnotificationsutil.h"
+#include "llpathfindingmanager.h"
+#include "llresmgr.h"
+#include "llscrolllistcell.h"
+#include "llscrolllistctrl.h"
+#include "llscrolllistitem.h"
+#include "llselectmgr.h"
+#include "llsd.h"
+#include "llstring.h"
+#include "llstyle.h"
+#include "lltextbase.h"
+#include "lluicolortable.h"
+#include "llviewermenu.h"
+#include "llviewerobject.h"
+#include "llviewerobjectlist.h"
+#include "llviewerregion.h"
+#include "v3dmath.h"
+#include "v3math.h"
+#include "v4color.h"
+
+#define DEFAULT_BEACON_WIDTH 6
+
+//---------------------------------------------------------------------------
+// LLFloaterPathfindingObjects
+//---------------------------------------------------------------------------
+
+void LLFloaterPathfindingObjects::onOpen(const LLSD &pKey)
+{
+	LLFloater::onOpen(pKey);
+
+	selectNoneObjects();
+	mObjectsScrollList->setCommitOnSelectionChange(TRUE);
+
+	if (!mSelectionUpdateSlot.connected())
+	{
+		mSelectionUpdateSlot = LLSelectMgr::getInstance()->mUpdateSignal.connect(boost::bind(&LLFloaterPathfindingObjects::onInWorldSelectionListChanged, this));
+	}
+
+	if (!mRegionBoundaryCrossingSlot.connected())
+	{
+		mRegionBoundaryCrossingSlot = LLEnvManagerNew::getInstance()->setRegionChangeCallback(boost::bind(&LLFloaterPathfindingObjects::onRegionBoundaryCrossed, this));
+	}
+
+	if (!mGodLevelChangeSlot.connected())
+	{
+		mGodLevelChangeSlot = gAgent.registerGodLevelChanageListener(boost::bind(&LLFloaterPathfindingObjects::onGodLevelChange, this, _1));
+	}
+
+	requestGetObjects();
+}
+
+void LLFloaterPathfindingObjects::onClose(bool pIsAppQuitting)
+{
+	
+	if (mGodLevelChangeSlot.connected())
+	{
+		mGodLevelChangeSlot.disconnect();
+	}
+
+	if (mRegionBoundaryCrossingSlot.connected())
+	{
+		mRegionBoundaryCrossingSlot.disconnect();
+	}
+
+	if (mSelectionUpdateSlot.connected())
+	{
+		mSelectionUpdateSlot.disconnect();
+	}
+
+	mObjectsScrollList->setCommitOnSelectionChange(FALSE);
+	selectNoneObjects();
+
+	if (mObjectsSelection.notNull())
+	{
+		mObjectsSelection.clear();
+	}
+}
+
+void LLFloaterPathfindingObjects::draw()
+{
+	LLFloater::draw();
+
+	if (isShowBeacons())
+	{
+		std::vector<LLScrollListItem *> selectedItems = mObjectsScrollList->getAllSelected();
+		if (!selectedItems.empty())
+		{
+			int numSelectedItems = selectedItems.size();
+			S32 nameColumnIndex = getNameColumnIndex();
+			const LLColor4 &beaconColor = getBeaconColor();
+			const LLColor4 &beaconTextColor = getBeaconTextColor();
+			S32 beaconWidth = getBeaconWidth();
+
+			std::vector<LLViewerObject *> viewerObjects;
+			viewerObjects.reserve(numSelectedItems);
+
+			for (std::vector<LLScrollListItem *>::const_iterator selectedItemIter = selectedItems.begin();
+				selectedItemIter != selectedItems.end(); ++selectedItemIter)
+			{
+				const LLScrollListItem *selectedItem = *selectedItemIter;
+
+				LLViewerObject *viewerObject = gObjectList.findObject(selectedItem->getUUID());
+				if (viewerObject != NULL)
+				{
+					const std::string &objectName = selectedItem->getColumn(nameColumnIndex)->getValue().asString();
+					gObjectList.addDebugBeacon(viewerObject->getPositionAgent(), objectName, beaconColor, beaconTextColor, beaconWidth);
+				}
+			}
+		}
+	}
+}
+
+LLFloaterPathfindingObjects::LLFloaterPathfindingObjects(const LLSD &pSeed)
+	: LLFloater(pSeed),
+	mObjectsScrollList(NULL),
+	mMessagingStatus(NULL),
+	mRefreshListButton(NULL),
+	mSelectAllButton(NULL),
+	mSelectNoneButton(NULL),
+	mShowBeaconCheckBox(NULL),
+	mTakeButton(NULL),
+	mTakeCopyButton(NULL),
+	mReturnButton(NULL),
+	mDeleteButton(NULL),
+	mTeleportButton(NULL),
+	mLoadingAvatarNames(),
+	mDefaultBeaconColor(),
+	mDefaultBeaconTextColor(),
+	mErrorTextColor(),
+	mWarningTextColor(),
+	mMessagingState(kMessagingUnknown),
+	mMessagingRequestId(0U),
+	mObjectList(),
+	mObjectsSelection(),
+	mHasObjectsToBeSelected(false),
+	mObjectsToBeSelected(),
+	mSelectionUpdateSlot(),
+	mRegionBoundaryCrossingSlot()
+{
+}
+
+LLFloaterPathfindingObjects::~LLFloaterPathfindingObjects()
+{
+}
+
+BOOL LLFloaterPathfindingObjects::postBuild()
+{
+	mDefaultBeaconColor = LLUIColorTable::getInstance()->getColor("PathfindingDefaultBeaconColor");
+	mDefaultBeaconTextColor = LLUIColorTable::getInstance()->getColor("PathfindingDefaultBeaconTextColor");
+	mErrorTextColor = LLUIColorTable::getInstance()->getColor("PathfindingErrorColor");
+	mWarningTextColor = LLUIColorTable::getInstance()->getColor("PathfindingWarningColor");
+
+	mObjectsScrollList = findChild<LLScrollListCtrl>("objects_scroll_list");
+	llassert(mObjectsScrollList != NULL);
+	mObjectsScrollList->setCommitCallback(boost::bind(&LLFloaterPathfindingObjects::onScrollListSelectionChanged, this));
+	mObjectsScrollList->sortByColumnIndex(static_cast<U32>(getNameColumnIndex()), TRUE);
+
+	mMessagingStatus = findChild<LLTextBase>("messaging_status");
+	llassert(mMessagingStatus != NULL);
+
+	mRefreshListButton = findChild<LLButton>("refresh_objects_list");
+	llassert(mRefreshListButton != NULL);
+	mRefreshListButton->setCommitCallback(boost::bind(&LLFloaterPathfindingObjects::onRefreshObjectsClicked, this));
+
+	mSelectAllButton = findChild<LLButton>("select_all_objects");
+	llassert(mSelectAllButton != NULL);
+	mSelectAllButton->setCommitCallback(boost::bind(&LLFloaterPathfindingObjects::onSelectAllObjectsClicked, this));
+
+	mSelectNoneButton = findChild<LLButton>("select_none_objects");
+	llassert(mSelectNoneButton != NULL);
+	mSelectNoneButton->setCommitCallback(boost::bind(&LLFloaterPathfindingObjects::onSelectNoneObjectsClicked, this));
+
+	mShowBeaconCheckBox = findChild<LLCheckBoxCtrl>("show_beacon");
+	llassert(mShowBeaconCheckBox != NULL);
+
+	mTakeButton = findChild<LLButton>("take_objects");
+	llassert(mTakeButton != NULL);
+	mTakeButton->setCommitCallback(boost::bind(&LLFloaterPathfindingObjects::onTakeClicked, this));
+
+	mTakeCopyButton = findChild<LLButton>("take_copy_objects");
+	llassert(mTakeCopyButton != NULL);
+	mTakeCopyButton->setCommitCallback(boost::bind(&LLFloaterPathfindingObjects::onTakeCopyClicked, this));
+
+	mReturnButton = findChild<LLButton>("return_objects");
+	llassert(mReturnButton != NULL);
+	mReturnButton->setCommitCallback(boost::bind(&LLFloaterPathfindingObjects::onReturnClicked, this));
+
+	mDeleteButton = findChild<LLButton>("delete_objects");
+	llassert(mDeleteButton != NULL);
+	mDeleteButton->setCommitCallback(boost::bind(&LLFloaterPathfindingObjects::onDeleteClicked, this));
+
+	mTeleportButton = findChild<LLButton>("teleport_me_to_object");
+	llassert(mTeleportButton != NULL);
+	mTeleportButton->setCommitCallback(boost::bind(&LLFloaterPathfindingObjects::onTeleportClicked, this));
+
+	return LLFloater::postBuild();
+}
+
+void LLFloaterPathfindingObjects::requestGetObjects()
+{
+	llassert(0);
+}
+
+LLPathfindingManager::request_id_t LLFloaterPathfindingObjects::getNewRequestId()
+{
+	return ++mMessagingRequestId;
+}
+
+void LLFloaterPathfindingObjects::handleNewObjectList(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::ERequestStatus pRequestStatus, LLPathfindingObjectListPtr pObjectList)
+{
+	llassert(pRequestId <= mMessagingRequestId);
+	if (pRequestId == mMessagingRequestId)
+	{
+		switch (pRequestStatus)
+		{
+		case LLPathfindingManager::kRequestStarted :
+			setMessagingState(kMessagingGetRequestSent);
+			break;
+		case LLPathfindingManager::kRequestCompleted :
+			mObjectList = pObjectList;
+			rebuildObjectsScrollList();
+			setMessagingState(kMessagingComplete);
+			break;
+		case LLPathfindingManager::kRequestNotEnabled :
+			clearAllObjects();
+			setMessagingState(kMessagingNotEnabled);
+			break;
+		case LLPathfindingManager::kRequestError :
+			clearAllObjects();
+			setMessagingState(kMessagingGetError);
+			break;
+		default :
+			clearAllObjects();
+			setMessagingState(kMessagingGetError);
+			llassert(0);
+			break;
+		}
+	}
+}
+
+void LLFloaterPathfindingObjects::handleUpdateObjectList(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::ERequestStatus pRequestStatus, LLPathfindingObjectListPtr pObjectList)
+{
+	// We current assume that handleUpdateObjectList is called only when objects are being SET
+	llassert(pRequestId <= mMessagingRequestId);
+	if (pRequestId == mMessagingRequestId)
+	{
+		switch (pRequestStatus)
+		{
+		case LLPathfindingManager::kRequestStarted :
+			setMessagingState(kMessagingSetRequestSent);
+			break;
+		case LLPathfindingManager::kRequestCompleted :
+			if (mObjectList == NULL)
+			{
+				mObjectList = pObjectList;
+			}
+			else
+			{
+				mObjectList->update(pObjectList);
+			}
+			rebuildObjectsScrollList();
+			setMessagingState(kMessagingComplete);
+			break;
+		case LLPathfindingManager::kRequestNotEnabled :
+			clearAllObjects();
+			setMessagingState(kMessagingNotEnabled);
+			break;
+		case LLPathfindingManager::kRequestError :
+			clearAllObjects();
+			setMessagingState(kMessagingSetError);
+			break;
+		default :
+			clearAllObjects();
+			setMessagingState(kMessagingSetError);
+			llassert(0);
+			break;
+		}
+	}
+}
+
+void LLFloaterPathfindingObjects::rebuildObjectsScrollList()
+{
+	if (!mHasObjectsToBeSelected)
+	{
+		std::vector<LLScrollListItem*> selectedItems = mObjectsScrollList->getAllSelected();
+		int numSelectedItems = selectedItems.size();
+		if (numSelectedItems > 0)
+		{
+			mObjectsToBeSelected.reserve(selectedItems.size());
+			for (std::vector<LLScrollListItem*>::const_iterator itemIter = selectedItems.begin();
+				itemIter != selectedItems.end(); ++itemIter)
+			{
+				const LLScrollListItem *listItem = *itemIter;
+				mObjectsToBeSelected.push_back(listItem->getUUID());
+			}
+		}
+	}
+
+	S32 origScrollPosition = mObjectsScrollList->getScrollPos();
+	mObjectsScrollList->deleteAllItems();
+
+	if ((mObjectList != NULL) && !mObjectList->isEmpty())
+	{
+		LLSD scrollListData = convertObjectsIntoScrollListData(mObjectList);
+		llassert(scrollListData.isArray());
+
+		LLScrollListCell::Params cellParams;
+		cellParams.font = LLFontGL::getFontSansSerif();
+
+		for (LLSD::array_const_iterator rowElementIter = scrollListData.beginArray(); rowElementIter != scrollListData.endArray(); ++rowElementIter)
+		{
+			const LLSD &rowElement = *rowElementIter;
+
+			LLScrollListItem::Params rowParams;
+			llassert(rowElement.has("id"));
+			llassert(rowElement.get("id").isString());
+			rowParams.value = rowElement.get("id");
+
+			llassert(rowElement.has("column"));
+			llassert(rowElement.get("column").isArray());
+			const LLSD &columnElement = rowElement.get("column");
+			for (LLSD::array_const_iterator cellIter = columnElement.beginArray(); cellIter != columnElement.endArray(); ++cellIter)
+			{
+				const LLSD &cellElement = *cellIter;
+
+				llassert(cellElement.has("column"));
+				llassert(cellElement.get("column").isString());
+				cellParams.column = cellElement.get("column").asString();
+
+				llassert(cellElement.has("value"));
+				llassert(cellElement.get("value").isString());
+				cellParams.value = cellElement.get("value").asString();
+
+				rowParams.columns.add(cellParams);
+			}
+
+			mObjectsScrollList->addRow(rowParams);
+		}
+	}
+
+	mObjectsScrollList->selectMultiple(mObjectsToBeSelected);
+	if (mHasObjectsToBeSelected)
+	{
+		mObjectsScrollList->scrollToShowSelected();
+	}
+	else
+	{
+		mObjectsScrollList->setScrollPos(origScrollPosition);
+	}
+
+	mObjectsToBeSelected.clear();
+	mHasObjectsToBeSelected = false;
+
+	updateControlsOnScrollListChange();
+}
+
+LLSD LLFloaterPathfindingObjects::convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr)
+{
+	llassert(0);
+	LLSD nullObjs = LLSD::emptyArray();
+	return nullObjs;
+}
+
+void LLFloaterPathfindingObjects::rebuildScrollListAfterAvatarNameLoads(const LLUUID &pAvatarId)
+{
+	std::set<LLUUID>::const_iterator iter = mLoadingAvatarNames.find(pAvatarId);
+	if (iter == mLoadingAvatarNames.end())
+	{
+		mLoadingAvatarNames.insert(pAvatarId);
+		LLAvatarNameCache::get(pAvatarId, boost::bind(&LLFloaterPathfindingObjects::handleAvatarNameLoads, this, _1, _2));
+	}
+}
+
+void LLFloaterPathfindingObjects::updateControlsOnScrollListChange()
+{
+	updateMessagingStatus();
+	updateStateOnListControls();
+	selectScrollListItemsInWorld();
+	updateStateOnActionControls();
+}
+
+void LLFloaterPathfindingObjects::updateControlsOnInWorldSelectionChange()
+{
+	updateStateOnActionControls();
+}
+
+S32 LLFloaterPathfindingObjects::getNameColumnIndex() const
+{
+	return 0;
+}
+
+const LLColor4 &LLFloaterPathfindingObjects::getBeaconColor() const
+{
+	return mDefaultBeaconColor;
+}
+
+const LLColor4 &LLFloaterPathfindingObjects::getBeaconTextColor() const
+{
+	return mDefaultBeaconTextColor;
+}
+
+S32 LLFloaterPathfindingObjects::getBeaconWidth() const
+{
+	return DEFAULT_BEACON_WIDTH;
+}
+
+void LLFloaterPathfindingObjects::showFloaterWithSelectionObjects()
+{
+	mObjectsToBeSelected.clear();
+
+	LLObjectSelectionHandle selectedObjectsHandle = LLSelectMgr::getInstance()->getSelection();
+	if (selectedObjectsHandle.notNull())
+	{
+		LLObjectSelection *selectedObjects = selectedObjectsHandle.get();
+		if (!selectedObjects->isEmpty())
+		{
+			for (LLObjectSelection::valid_iterator objectIter = selectedObjects->valid_begin();
+				objectIter != selectedObjects->valid_end(); ++objectIter)
+			{
+				LLSelectNode *object = *objectIter;
+				LLViewerObject *viewerObject = object->getObject();
+				mObjectsToBeSelected.push_back(viewerObject->getID());
+			}
+		}
+	}
+	mHasObjectsToBeSelected = true;
+
+	if (!isShown())
+	{
+		openFloater();
+		setVisibleAndFrontmost();
+	}
+	else
+	{
+		rebuildObjectsScrollList();
+		if (isMinimized())
+		{
+			setMinimized(FALSE);
+		}
+		setVisibleAndFrontmost();
+	}
+	setFocus(TRUE);
+}
+
+BOOL LLFloaterPathfindingObjects::isShowBeacons() const
+{
+	return mShowBeaconCheckBox->get();
+}
+
+void LLFloaterPathfindingObjects::clearAllObjects()
+{
+	selectNoneObjects();
+	mObjectsScrollList->deleteAllItems();
+	mObjectList.reset();
+}
+
+void LLFloaterPathfindingObjects::selectAllObjects()
+{
+	mObjectsScrollList->selectAll();
+}
+
+void LLFloaterPathfindingObjects::selectNoneObjects()
+{
+	mObjectsScrollList->deselectAllItems();
+}
+
+void LLFloaterPathfindingObjects::teleportToSelectedObject()
+{
+	std::vector<LLScrollListItem*> selectedItems = mObjectsScrollList->getAllSelected();
+	llassert(selectedItems.size() == 1);
+	if (selectedItems.size() == 1)
+	{
+		std::vector<LLScrollListItem*>::const_reference selectedItemRef = selectedItems.front();
+		const LLScrollListItem *selectedItem = selectedItemRef;
+		llassert(mObjectList != NULL);
+		LLVector3d teleportLocation;
+		LLViewerObject *viewerObject = gObjectList.findObject(selectedItem->getUUID());
+		if (viewerObject == NULL)
+		{
+			// If we cannot find the object in the viewer list, teleport to the last reported position
+			const LLPathfindingObjectPtr objectPtr = mObjectList->find(selectedItem->getUUID().asString());
+			teleportLocation = gAgent.getPosGlobalFromAgent(objectPtr->getLocation());
+		}
+		else
+		{
+			// If we can find the object in the viewer list, teleport to the known current position
+			teleportLocation = viewerObject->getPositionGlobal();
+		}
+		gAgent.teleportViaLocationLookAt(teleportLocation);
+	}
+}
+
+LLPathfindingObjectListPtr LLFloaterPathfindingObjects::getEmptyObjectList() const
+{
+	llassert(0);
+	LLPathfindingObjectListPtr objectListPtr(new LLPathfindingObjectList());
+	return objectListPtr;
+}
+
+int LLFloaterPathfindingObjects::getNumSelectedObjects() const
+{
+	return mObjectsScrollList->getNumSelected();
+}
+
+LLPathfindingObjectListPtr LLFloaterPathfindingObjects::getSelectedObjects() const
+{
+	LLPathfindingObjectListPtr selectedObjects = getEmptyObjectList();
+
+	std::vector<LLScrollListItem*> selectedItems = mObjectsScrollList->getAllSelected();
+	if (!selectedItems.empty())
+	{
+		for (std::vector<LLScrollListItem*>::const_iterator itemIter = selectedItems.begin();
+			itemIter != selectedItems.end(); ++itemIter)
+		{
+			LLPathfindingObjectPtr objectPtr = findObject(*itemIter);
+			if (objectPtr != NULL)
+			{
+				selectedObjects->update(objectPtr);
+			}
+		}
+	}
+
+	return selectedObjects;
+}
+
+LLPathfindingObjectPtr LLFloaterPathfindingObjects::getFirstSelectedObject() const
+{
+	LLPathfindingObjectPtr objectPtr;
+
+	std::vector<LLScrollListItem*> selectedItems = mObjectsScrollList->getAllSelected();
+	if (!selectedItems.empty())
+	{
+		objectPtr = findObject(selectedItems.front());
+	}
+
+	return objectPtr;
+}
+
+LLFloaterPathfindingObjects::EMessagingState LLFloaterPathfindingObjects::getMessagingState() const
+{
+	return mMessagingState;
+}
+
+void LLFloaterPathfindingObjects::setMessagingState(EMessagingState pMessagingState)
+{
+	mMessagingState = pMessagingState;
+	updateControlsOnScrollListChange();
+}
+
+void LLFloaterPathfindingObjects::onRefreshObjectsClicked()
+{
+	requestGetObjects();
+}
+
+void LLFloaterPathfindingObjects::onSelectAllObjectsClicked()
+{
+	selectAllObjects();
+}
+
+void LLFloaterPathfindingObjects::onSelectNoneObjectsClicked()
+{
+	selectNoneObjects();
+}
+
+void LLFloaterPathfindingObjects::onTakeClicked()
+{
+	handle_take();
+	requestGetObjects();
+}
+
+void LLFloaterPathfindingObjects::onTakeCopyClicked()
+{
+	handle_take_copy();
+}
+
+void LLFloaterPathfindingObjects::onReturnClicked()
+{
+	LLNotification::Params params("PathfindingReturnMultipleItems");
+	params.functor.function(boost::bind(&LLFloaterPathfindingObjects::handleReturnItemsResponse, this, _1, _2));
+
+	LLSD substitutions;
+	int numItems = getNumSelectedObjects();
+	substitutions["NUM_ITEMS"] = static_cast<LLSD::Integer>(numItems);
+	params.substitutions = substitutions;
+
+	if (numItems == 1)
+	{
+		LLNotifications::getInstance()->forceResponse(params, 0);
+	}
+	else if (numItems > 1)
+	{
+		LLNotifications::getInstance()->add(params);
+	}
+}
+
+void LLFloaterPathfindingObjects::onDeleteClicked()
+{
+	LLNotification::Params params("PathfindingDeleteMultipleItems");
+	params.functor.function(boost::bind(&LLFloaterPathfindingObjects::handleDeleteItemsResponse, this, _1, _2));
+
+	LLSD substitutions;
+	int numItems = getNumSelectedObjects();
+	substitutions["NUM_ITEMS"] = static_cast<LLSD::Integer>(numItems);
+	params.substitutions = substitutions;
+
+	if (numItems == 1)
+	{
+		LLNotifications::getInstance()->forceResponse(params, 0);
+	}
+	else if (numItems > 1)
+	{
+		LLNotifications::getInstance()->add(params);
+	}
+}
+
+void LLFloaterPathfindingObjects::onTeleportClicked()
+{
+	teleportToSelectedObject();
+}
+
+void LLFloaterPathfindingObjects::onScrollListSelectionChanged()
+{
+	updateControlsOnScrollListChange();
+}
+
+void LLFloaterPathfindingObjects::onInWorldSelectionListChanged()
+{
+	updateControlsOnInWorldSelectionChange();
+}
+
+void LLFloaterPathfindingObjects::onRegionBoundaryCrossed()
+{
+	requestGetObjects();
+}
+
+void LLFloaterPathfindingObjects::onGodLevelChange(U8 pGodLevel)
+{
+	requestGetObjects();
+}
+
+void LLFloaterPathfindingObjects::handleAvatarNameLoads(const LLUUID &pAvatarId, const LLAvatarName &pAvatarName)
+{
+	llassert(mLoadingAvatarNames.find(pAvatarId) != mLoadingAvatarNames.end());
+	mLoadingAvatarNames.erase(pAvatarId);
+	if (mLoadingAvatarNames.empty())
+	{
+		rebuildObjectsScrollList();
+	}
+}
+
+void LLFloaterPathfindingObjects::updateMessagingStatus()
+{
+	std::string statusText("");
+	LLStyle::Params styleParams;
+
+	switch (getMessagingState())
+	{
+	case kMessagingUnknown:
+		statusText = getString("messaging_initial");
+		styleParams.color = mErrorTextColor;
+		break;
+	case kMessagingGetRequestSent :
+		statusText = getString("messaging_get_inprogress");
+		styleParams.color = mWarningTextColor;
+		break;
+	case kMessagingGetError :
+		statusText = getString("messaging_get_error");
+		styleParams.color = mErrorTextColor;
+		break;
+	case kMessagingSetRequestSent :
+		statusText = getString("messaging_set_inprogress");
+		styleParams.color = mWarningTextColor;
+		break;
+	case kMessagingSetError :
+		statusText = getString("messaging_set_error");
+		styleParams.color = mErrorTextColor;
+		break;
+	case kMessagingComplete :
+		if (mObjectsScrollList->isEmpty())
+		{
+			statusText = getString("messaging_complete_none_found");
+		}
+		else
+		{
+			S32 numItems = mObjectsScrollList->getItemCount();
+			S32 numSelectedItems = mObjectsScrollList->getNumSelected();
+
+			LLLocale locale(LLStringUtil::getLocale());
+			std::string numItemsString;
+			LLResMgr::getInstance()->getIntegerString(numItemsString, numItems);
+
+			std::string numSelectedItemsString;
+			LLResMgr::getInstance()->getIntegerString(numSelectedItemsString, numSelectedItems);
+
+			LLStringUtil::format_map_t string_args;
+			string_args["[NUM_SELECTED]"] = numSelectedItemsString;
+			string_args["[NUM_TOTAL]"] = numItemsString;
+			statusText = getString("messaging_complete_available", string_args);
+		}
+		break;
+	case kMessagingNotEnabled :
+		statusText = getString("messaging_not_enabled");
+		styleParams.color = mErrorTextColor;
+		break;
+	default:
+		statusText = getString("messaging_initial");
+		styleParams.color = mErrorTextColor;
+		llassert(0);
+		break;
+	}
+
+	mMessagingStatus->setText((LLStringExplicit)statusText, styleParams);
+}
+
+void LLFloaterPathfindingObjects::updateStateOnListControls()
+{
+	switch (getMessagingState())
+	{
+	case kMessagingUnknown:
+	case kMessagingGetRequestSent :
+	case kMessagingSetRequestSent :
+		mRefreshListButton->setEnabled(FALSE);
+		mSelectAllButton->setEnabled(FALSE);
+		mSelectNoneButton->setEnabled(FALSE);
+		break;
+	case kMessagingGetError :
+	case kMessagingSetError :
+	case kMessagingNotEnabled :
+		mRefreshListButton->setEnabled(TRUE);
+		mSelectAllButton->setEnabled(FALSE);
+		mSelectNoneButton->setEnabled(FALSE);
+		break;
+	case kMessagingComplete :
+		{
+			int numItems = mObjectsScrollList->getItemCount();
+			int numSelectedItems = mObjectsScrollList->getNumSelected();
+			mRefreshListButton->setEnabled(TRUE);
+			mSelectAllButton->setEnabled(numSelectedItems < numItems);
+			mSelectNoneButton->setEnabled(numSelectedItems > 0);
+		}
+		break;
+	default:
+		llassert(0);
+		break;
+	}
+}
+
+void LLFloaterPathfindingObjects::updateStateOnActionControls()
+{
+	int numSelectedItems = mObjectsScrollList->getNumSelected();
+	bool isEditEnabled = (numSelectedItems > 0);
+
+	mShowBeaconCheckBox->setEnabled(isEditEnabled);
+	mTakeButton->setEnabled(isEditEnabled && visible_take_object());
+	mTakeCopyButton->setEnabled(isEditEnabled && enable_object_take_copy());
+	mReturnButton->setEnabled(isEditEnabled && enable_object_return());
+	mDeleteButton->setEnabled(isEditEnabled && enable_object_delete());
+	mTeleportButton->setEnabled(numSelectedItems == 1);
+}
+
+void LLFloaterPathfindingObjects::selectScrollListItemsInWorld()
+{
+	mObjectsSelection.clear();
+	LLSelectMgr::getInstance()->deselectAll();
+
+	std::vector<LLScrollListItem *> selectedItems = mObjectsScrollList->getAllSelected();
+	if (!selectedItems.empty())
+	{
+		int numSelectedItems = selectedItems.size();
+
+		std::vector<LLViewerObject *>viewerObjects;
+		viewerObjects.reserve(numSelectedItems);
+
+		for (std::vector<LLScrollListItem *>::const_iterator selectedItemIter = selectedItems.begin();
+			selectedItemIter != selectedItems.end(); ++selectedItemIter)
+		{
+			const LLScrollListItem *selectedItem = *selectedItemIter;
+
+			LLViewerObject *viewerObject = gObjectList.findObject(selectedItem->getUUID());
+			if (viewerObject != NULL)
+			{
+				viewerObjects.push_back(viewerObject);
+			}
+		}
+
+		if (!viewerObjects.empty())
+		{
+			mObjectsSelection = LLSelectMgr::getInstance()->selectObjectAndFamily(viewerObjects);
+		}
+	}
+}
+
+void LLFloaterPathfindingObjects::handleReturnItemsResponse(const LLSD &pNotification, const LLSD &pResponse)
+{
+	if (LLNotificationsUtil::getSelectedOption(pNotification, pResponse) == 0)
+	{
+		handle_object_return();
+		requestGetObjects();
+	}
+}
+
+void LLFloaterPathfindingObjects::handleDeleteItemsResponse(const LLSD &pNotification, const LLSD &pResponse)
+{
+	if (LLNotificationsUtil::getSelectedOption(pNotification, pResponse) == 0)
+	{
+		handle_object_delete();
+		requestGetObjects();
+	}
+}
+
+LLPathfindingObjectPtr LLFloaterPathfindingObjects::findObject(const LLScrollListItem *pListItem) const
+{
+	LLPathfindingObjectPtr objectPtr;
+
+	LLUUID uuid = pListItem->getUUID();
+	const std::string &uuidString = uuid.asString();
+	llassert(mObjectList != NULL);
+	objectPtr = mObjectList->find(uuidString);
+
+	return objectPtr;
+}
diff --git a/indra/newview/llfloaterpathfindingobjects.h b/indra/newview/llfloaterpathfindingobjects.h
new file mode 100644
index 0000000000000000000000000000000000000000..e8d446b598963374700d607fbc9d49c24d339498
--- /dev/null
+++ b/indra/newview/llfloaterpathfindingobjects.h
@@ -0,0 +1,176 @@
+/** 
+* @file   llfloaterpathfindingobjects.h
+* @brief  Base class for both the pathfinding linksets and characters floater.
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+* $/LicenseInfo$
+*/
+#ifndef LL_LLFLOATERPATHFINDINGOBJECTS_H
+#define LL_LLFLOATERPATHFINDINGOBJECTS_H
+
+#include <set>
+
+#include <boost/signals2.hpp>
+
+#include "llagent.h"
+#include "llfloater.h"
+#include "llpathfindingmanager.h"
+#include "llpathfindingobject.h"
+#include "llpathfindingobjectlist.h"
+#include "llselectmgr.h"
+#include "lluuid.h"
+#include "v4color.h"
+
+class LLAvatarName;
+class LLButton;
+class LLCheckBoxCtrl;
+class LLScrollListCtrl;
+class LLScrollListItem;
+class LLSD;
+class LLTextBase;
+
+class LLFloaterPathfindingObjects : public LLFloater
+{
+public:
+	virtual void onOpen(const LLSD &pKey);
+	virtual void onClose(bool pIsAppQuitting);
+	virtual void draw();
+
+protected:
+	friend class LLFloaterReg;
+
+	typedef enum
+	{
+		kMessagingUnknown,
+		kMessagingGetRequestSent,
+		kMessagingGetError,
+		kMessagingSetRequestSent,
+		kMessagingSetError,
+		kMessagingComplete,
+		kMessagingNotEnabled
+	} EMessagingState;
+
+	LLFloaterPathfindingObjects(const LLSD &pSeed);
+	virtual ~LLFloaterPathfindingObjects();
+
+	virtual BOOL                       postBuild();
+
+	virtual void                       requestGetObjects();
+	LLPathfindingManager::request_id_t getNewRequestId();
+	void                               handleNewObjectList(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::ERequestStatus pRequestStatus, LLPathfindingObjectListPtr pObjectList);
+	void                               handleUpdateObjectList(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::ERequestStatus pRequestStatus, LLPathfindingObjectListPtr pObjectList);
+
+	void                               rebuildObjectsScrollList();
+	virtual LLSD                       convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr);
+
+	void                               rebuildScrollListAfterAvatarNameLoads(const LLUUID &pAvatarId);
+
+	virtual void                       updateControlsOnScrollListChange();
+	virtual void                       updateControlsOnInWorldSelectionChange();
+
+	virtual S32                        getNameColumnIndex() const;
+	virtual const LLColor4             &getBeaconColor() const;
+	virtual const LLColor4             &getBeaconTextColor() const;
+	virtual S32                        getBeaconWidth() const;
+
+	void                               showFloaterWithSelectionObjects();
+
+	BOOL                               isShowBeacons() const;
+	void                               clearAllObjects();
+	void                               selectAllObjects();
+	void                               selectNoneObjects();
+	void                               teleportToSelectedObject();
+
+	virtual LLPathfindingObjectListPtr getEmptyObjectList() const;
+	int                                getNumSelectedObjects() const;
+	LLPathfindingObjectListPtr         getSelectedObjects() const;
+	LLPathfindingObjectPtr             getFirstSelectedObject() const;
+
+	EMessagingState                    getMessagingState() const;
+
+private:
+	LLFloaterPathfindingObjects(const LLFloaterPathfindingObjects &pOther);
+
+	void                   setMessagingState(EMessagingState pMessagingState);
+
+	void                   onRefreshObjectsClicked();
+	void                   onSelectAllObjectsClicked();
+	void                   onSelectNoneObjectsClicked();
+	void                   onTakeClicked();
+	void                   onTakeCopyClicked();
+	void                   onReturnClicked();
+	void                   onDeleteClicked();
+	void                   onTeleportClicked();
+
+	void                   onScrollListSelectionChanged();
+	void                   onInWorldSelectionListChanged();
+	void                   onRegionBoundaryCrossed();
+	void                   onGodLevelChange(U8 pGodLevel);
+
+	void                   handleAvatarNameLoads(const LLUUID &pAvatarId, const LLAvatarName &pAvatarName);
+
+	void                   updateMessagingStatus();
+	void                   updateStateOnListControls();
+	void                   updateStateOnActionControls();
+	void                   selectScrollListItemsInWorld();
+
+	void                   handleReturnItemsResponse(const LLSD &pNotification, const LLSD &pResponse);
+	void                   handleDeleteItemsResponse(const LLSD &pNotification, const LLSD &pResponse);
+
+	LLPathfindingObjectPtr findObject(const LLScrollListItem *pListItem) const;
+
+	LLScrollListCtrl                   *mObjectsScrollList;
+	LLTextBase                         *mMessagingStatus;
+	LLButton                           *mRefreshListButton;
+	LLButton                           *mSelectAllButton;
+	LLButton                           *mSelectNoneButton;
+	LLCheckBoxCtrl                     *mShowBeaconCheckBox;
+
+	LLButton                           *mTakeButton;
+	LLButton                           *mTakeCopyButton;
+	LLButton                           *mReturnButton;
+	LLButton                           *mDeleteButton;
+	LLButton                           *mTeleportButton;
+
+	std::set<LLUUID>                   mLoadingAvatarNames;
+
+	LLColor4                           mDefaultBeaconColor;
+	LLColor4                           mDefaultBeaconTextColor;
+	LLColor4                           mErrorTextColor;
+	LLColor4                           mWarningTextColor;
+
+	EMessagingState                    mMessagingState;
+	LLPathfindingManager::request_id_t mMessagingRequestId;
+
+	LLPathfindingObjectListPtr         mObjectList;
+
+	LLObjectSelectionHandle            mObjectsSelection;
+
+	bool                               mHasObjectsToBeSelected;
+	uuid_vec_t                         mObjectsToBeSelected;
+
+	boost::signals2::connection        mSelectionUpdateSlot;
+	boost::signals2::connection        mRegionBoundaryCrossingSlot;
+	LLAgent::god_level_change_slot_t   mGodLevelChangeSlot;
+};
+
+#endif // LL_LLFLOATERPATHFINDINGOBJECTS_H
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 5edd920c708b2bf9afe82bb7bdd2e0c97e377828..60556147a91523ad4fe38edcd63dee5a2732e718 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -779,7 +779,7 @@ void LLFloaterPreference::onBtnOK()
 		llinfos << "Can't close preferences!" << llendl;
 	}
 
-	LLPanelLogin::updateLocationCombo( false );
+	LLPanelLogin::updateLocationSelectorsVisibility();
 }
 
 // static 
@@ -796,7 +796,7 @@ void LLFloaterPreference::onBtnApply( )
 	apply();
 	saveSettings();
 
-	LLPanelLogin::updateLocationCombo( false );
+	LLPanelLogin::updateLocationSelectorsVisibility();
 }
 
 // static 
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index 6978e6a430c4e4b1a74dd197365d0a0d1b6564eb..99ebb0eb3462fe01f7fbacf78017222571ad452c 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -110,9 +110,6 @@ void click_show_more(void*);
 void click_popup_info(void*);
 void click_popup_done(void*);
 void click_popup_minimize(void*);
-void click_popup_rotate_left(void*);
-void click_popup_rotate_reset(void*);
-void click_popup_rotate_right(void*);
 void commit_slider_dozer_force(LLUICtrl *);
 void click_apply_to_selection(void*);
 void commit_radio_group_focus(LLUICtrl* ctrl);
@@ -136,6 +133,7 @@ class LLLandImpactsObserver : public LLParcelObserver
 		if(tools_floater)
 		{
 			tools_floater->updateLandImpacts();
+			tools_floater->dirty();
 		}
 	}
 };
@@ -954,24 +952,6 @@ void commit_slider_zoom(LLUICtrl *ctrl)
 	gAgentCamera.setCameraZoomFraction(zoom_level);
 }
 
-void click_popup_rotate_left(void*)
-{
-	LLSelectMgr::getInstance()->selectionRotateAroundZ( 45.f );
-	dialog_refresh_all();
-}
-
-void click_popup_rotate_reset(void*)
-{
-	LLSelectMgr::getInstance()->selectionResetRotation();
-	dialog_refresh_all();
-}
-
-void click_popup_rotate_right(void*)
-{
-	LLSelectMgr::getInstance()->selectionRotateAroundZ( -45.f );
-	dialog_refresh_all();
-}
-
 void commit_slider_dozer_force(LLUICtrl *ctrl)
 {
 	// the slider is logarithmic, so we exponentiate to get the actual force multiplier
@@ -1218,7 +1198,10 @@ void LLFloaterTools::getMediaState()
 		return;
 	}
 	
-	bool editable = (first_object->permModify() || selectedMediaEditable());
+	BOOL is_nonpermanent_enforced = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() 
+		&& LLSelectMgr::getInstance()->selectGetRootsNonPermanentEnforced())
+		|| LLSelectMgr::getInstance()->selectGetNonPermanentEnforced();
+	bool editable = is_nonpermanent_enforced && (first_object->permModify() || selectedMediaEditable());
 
 	// Check modify permissions and whether any selected objects are in
 	// the process of being fetched.  If they are, then we're not editable
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 9ce64a630fe883511ccd9eaac7fb3103feb91f9f..7d047ec67ec25fe045c283d46cb92561ba35a08b 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -2235,12 +2235,16 @@ void LLFolderView::doIdle()
 		arrangeAll();
 	}
 
+	mNeedsAutoSelect = mFilter->hasFilterString() &&
+							!(gFocusMgr.childHasKeyboardFocus(this) || gFocusMgr.getMouseCapture());
+
+		
 	if (mFilter->isModified() && mFilter->isNotDefault())
 	{
 		mNeedsAutoSelect = TRUE;
 	}
 	mFilter->clearModified();
-
+			
 	// filter to determine visibility before arranging
 	filterFromRoot();
 
diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp
index 025181ead55cca5761c8983c89a38598e2f377a7..8d9d70b50eea2892118cd4c13d676ac6ead1b4e5 100644
--- a/indra/newview/lllocationinputctrl.cpp
+++ b/indra/newview/lllocationinputctrl.cpp
@@ -44,10 +44,14 @@
 
 // newview includes
 #include "llagent.h"
+#include "llenvmanager.h"
 #include "llfloatersidepanelcontainer.h"
 #include "llinventoryobserver.h"
 #include "lllandmarkactions.h"
 #include "lllandmarklist.h"
+#include "llpathfindingmanager.h"
+#include "llpathfindingnavmesh.h"
+#include "llpathfindingnavmeshstatus.h"
 #include "llteleporthistory.h"
 #include "llslurl.h"
 #include "llstatusbar.h"			// getHealth()
@@ -191,7 +195,9 @@ LLLocationInputCtrl::Params::Params()
 	damage_icon("damage_icon"),
 	damage_text("damage_text"),
 	see_avatars_icon("see_avatars_icon"),
-	maturity_help_topic("maturity_help_topic")
+	maturity_help_topic("maturity_help_topic"),
+	pathfinding_dirty_icon("pathfinding_dirty_icon"),
+	pathfinding_disabled_icon("pathfinding_disabled_icon")
 {
 }
 
@@ -203,6 +209,9 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p)
 	mAddLandmarkBtn(NULL),
 	mForSaleBtn(NULL),
 	mInfoBtn(NULL),
+	mRegionCrossingSlot(),
+	mNavMeshSlot(),
+	mIsNavMeshDirty(false),
 	mLandmarkImageOn(NULL),
 	mLandmarkImageOff(NULL),
 	mIconMaturityGeneral(NULL),
@@ -270,7 +279,7 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p)
 	if (p.icon_maturity_general())
 	{
 		mIconMaturityGeneral = p.icon_maturity_general;
-	}
+	}		
 	if (p.icon_maturity_adult())
 	{
 		mIconMaturityAdult = p.icon_maturity_adult;
@@ -279,7 +288,7 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p)
 	{
 		mIconMaturityModerate = p.icon_maturity_moderate;
 	}
-
+	
 	LLButton::Params maturity_button = p.maturity_button;
 	mMaturityButton = LLUICtrlFactory::create<LLButton>(maturity_button);
 	addChild(mMaturityButton);
@@ -336,7 +345,21 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p)
 	mParcelIcon[DAMAGE_ICON] = LLUICtrlFactory::create<LLIconCtrl>(damage_icon);
 	mParcelIcon[DAMAGE_ICON]->setMouseDownCallback(boost::bind(&LLLocationInputCtrl::onParcelIconClick, this, DAMAGE_ICON));
 	addChild(mParcelIcon[DAMAGE_ICON]);
-	
+
+	LLIconCtrl::Params pathfinding_dirty_icon = p.pathfinding_dirty_icon;
+	pathfinding_dirty_icon.tool_tip = LLTrans::getString("LocationCtrlPathfindingDirtyTooltip");
+	pathfinding_dirty_icon.mouse_opaque = true;
+	mParcelIcon[PATHFINDING_DIRTY_ICON] = LLUICtrlFactory::create<LLIconCtrl>(pathfinding_dirty_icon);
+	mParcelIcon[PATHFINDING_DIRTY_ICON]->setMouseDownCallback(boost::bind(&LLLocationInputCtrl::onParcelIconClick, this, PATHFINDING_DIRTY_ICON));
+	addChild(mParcelIcon[PATHFINDING_DIRTY_ICON]);
+
+	LLIconCtrl::Params pathfinding_disabled_icon = p.pathfinding_disabled_icon;
+	pathfinding_disabled_icon.tool_tip = LLTrans::getString("LocationCtrlPathfindingDisabledTooltip");
+	pathfinding_disabled_icon.mouse_opaque = true;
+	mParcelIcon[PATHFINDING_DISABLED_ICON] = LLUICtrlFactory::create<LLIconCtrl>(pathfinding_disabled_icon);
+	mParcelIcon[PATHFINDING_DISABLED_ICON]->setMouseDownCallback(boost::bind(&LLLocationInputCtrl::onParcelIconClick, this, PATHFINDING_DISABLED_ICON));
+	addChild(mParcelIcon[PATHFINDING_DISABLED_ICON]);
+
 	LLTextBox::Params damage_text = p.damage_text;
 	damage_text.tool_tip = LLTrans::getString("LocationCtrlDamageTooltip");
 	damage_text.mouse_opaque = true;
@@ -391,6 +414,9 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p)
 	mLocationHistoryConnection = LLLocationHistory::getInstance()->setChangedCallback(
 			boost::bind(&LLLocationInputCtrl::onLocationHistoryChanged, this,_1));
 
+	mRegionCrossingSlot = LLEnvManagerNew::getInstance()->setRegionChangeCallback(boost::bind(&LLLocationInputCtrl::onRegionBoundaryCrossed, this));
+	createNavMeshStatusListenerForCurrentRegion();
+
 	mRemoveLandmarkObserver	= new LLRemoveLandmarkObserver(this);
 	mAddLandmarkObserver	= new LLAddLandmarkObserver(this);
 	gInventory.addObserver(mRemoveLandmarkObserver);
@@ -415,6 +441,8 @@ LLLocationInputCtrl::~LLLocationInputCtrl()
 	LLViewerParcelMgr::getInstance()->removeObserver(mParcelChangeObserver);
 	delete mParcelChangeObserver;
 
+	mRegionCrossingSlot.disconnect();
+	mNavMeshSlot.disconnect();
 	mCoordinatesControlConnection.disconnect();
 	mParcelPropertiesControlConnection.disconnect();
 	mParcelMgrConnection.disconnect();
@@ -636,6 +664,17 @@ void LLLocationInputCtrl::onMaturityButtonClicked()
 	LLUI::sHelpImpl->showTopic(mMaturityHelpTopic);
 }
 
+void LLLocationInputCtrl::onRegionBoundaryCrossed()
+{
+	createNavMeshStatusListenerForCurrentRegion();
+}
+
+void LLLocationInputCtrl::onNavMeshStatusChange(const LLPathfindingNavMeshStatus &pNavMeshStatus)
+{
+	mIsNavMeshDirty = pNavMeshStatus.isValid() && (pNavMeshStatus.getStatus() != LLPathfindingNavMeshStatus::kComplete);
+	refreshParcelIcons();
+}
+
 void LLLocationInputCtrl::onLandmarkLoaded(LLLandmark* lm)
 {
 	(void) lm;
@@ -819,6 +858,7 @@ void LLLocationInputCtrl::refreshParcelIcons()
 		bool allow_scripts	= vpm->allowAgentScripts(agent_region, current_parcel);
 		bool allow_damage	= vpm->allowAgentDamage(agent_region, current_parcel);
 		bool see_avs        = current_parcel->getSeeAVs();
+		bool pathfinding_dynamic_enabled = agent_region->dynamicPathfindingEnabled();
 
 		// Most icons are "block this ability"
 		mParcelIcon[VOICE_ICON]->setVisible(   !allow_voice );
@@ -827,6 +867,9 @@ void LLLocationInputCtrl::refreshParcelIcons()
 		mParcelIcon[BUILD_ICON]->setVisible(   !allow_build );
 		mParcelIcon[SCRIPTS_ICON]->setVisible( !allow_scripts );
 		mParcelIcon[DAMAGE_ICON]->setVisible(  allow_damage );
+		mParcelIcon[PATHFINDING_DIRTY_ICON]->setVisible(mIsNavMeshDirty);
+		mParcelIcon[PATHFINDING_DISABLED_ICON]->setVisible(!mIsNavMeshDirty && !pathfinding_dynamic_enabled);
+
 		mDamageText->setVisible(allow_damage);
 		mParcelIcon[SEE_AVATARS_ICON]->setVisible( !see_avs );
 
@@ -1165,6 +1208,12 @@ void LLLocationInputCtrl::onParcelIconClick(EParcelIcon icon)
 	case BUILD_ICON:
 		LLNotificationsUtil::add("NoBuild");
 		break;
+	case PATHFINDING_DIRTY_ICON:
+		LLNotificationsUtil::add("PathfindingDirty");
+		break;
+	case PATHFINDING_DISABLED_ICON:
+		LLNotificationsUtil::add("DynamicPathfindingDisabled");
+		break;
 	case SCRIPTS_ICON:
 	{
 		LLViewerRegion* region = gAgent.getRegion();
@@ -1193,3 +1242,18 @@ void LLLocationInputCtrl::onParcelIconClick(EParcelIcon icon)
 	// no default to get compiler warning when a new icon gets added
 	}
 }
+
+void LLLocationInputCtrl::createNavMeshStatusListenerForCurrentRegion()
+{
+	if (mNavMeshSlot.connected())
+	{
+		mNavMeshSlot.disconnect();
+	}
+
+	LLViewerRegion *currentRegion = gAgent.getRegion();
+	if (currentRegion != NULL)
+	{
+		mNavMeshSlot = LLPathfindingManager::getInstance()->registerNavMeshListenerForRegion(currentRegion, boost::bind(&LLLocationInputCtrl::onNavMeshStatusChange, this, _2));
+		LLPathfindingManager::getInstance()->requestGetNavMeshForRegion(currentRegion, true);
+	}
+}
diff --git a/indra/newview/lllocationinputctrl.h b/indra/newview/lllocationinputctrl.h
index ed47ba73e3f8f90172e9b679dd2745423138ad15..cd6fd24077862e26a956e8656dfe8a12e647ad4d 100644
--- a/indra/newview/lllocationinputctrl.h
+++ b/indra/newview/lllocationinputctrl.h
@@ -31,6 +31,7 @@
 #include "lliconctrl.h"		// Params
 #include "lltextbox.h"		// Params
 #include "lllocationhistory.h"
+#include "llpathfindingnavmesh.h"
 
 class LLLandmark;
 
@@ -40,6 +41,7 @@ class LLRemoveLandmarkObserver;
 class LLParcelChangeObserver;
 class LLMenuGL;
 class LLTeleportHistoryItem;
+class LLPathfindingNavMeshStatus;
 
 /**
  * Location input control.
@@ -78,7 +80,9 @@ class LLLocationInputCtrl
 											build_icon,
 											scripts_icon,
 											damage_icon,
-											see_avatars_icon;
+											see_avatars_icon,
+											pathfinding_dirty_icon,
+											pathfinding_disabled_icon;
 		Optional<LLTextBox::Params>			damage_text;
 		Params();
 	};
@@ -110,13 +114,15 @@ class LLLocationInputCtrl
 	enum EParcelIcon
 	{
 		VOICE_ICON = 0,
-		FLY_ICON,			// 1
-		PUSH_ICON,			// 2
-		BUILD_ICON,			// 3
-		SCRIPTS_ICON,		// 4
-		DAMAGE_ICON,		// 5
-		SEE_AVATARS_ICON,   // 6
-		ICON_COUNT			// 7 total
+		FLY_ICON,			      // 1
+		PUSH_ICON,			      // 2
+		BUILD_ICON,			      // 3
+		SCRIPTS_ICON,		      // 4
+		DAMAGE_ICON,		      // 5
+		SEE_AVATARS_ICON,         // 6
+		PATHFINDING_DIRTY_ICON,   // 7
+		PATHFINDING_DISABLED_ICON,// 8
+		ICON_COUNT			      // 9 total
 	};
 
 	friend class LLUICtrlFactory;
@@ -155,11 +161,15 @@ class LLLocationInputCtrl
 	void					onAddLandmarkButtonClicked();
 	void					onAgentParcelChange();
 	void					onMaturityButtonClicked();
+	void                    onRegionBoundaryCrossed();
+	void                    onNavMeshStatusChange(const LLPathfindingNavMeshStatus &pNavMeshStatus);
 	// callbacks
 	bool					onLocationContextMenuItemEnabled(const LLSD& userdata);
 	void 					onLocationContextMenuItemClicked(const LLSD& userdata);
 	void					onParcelIconClick(EParcelIcon icon);
 
+	void                    createNavMeshStatusListenerForCurrentRegion();
+
 	LLMenuGL*				mLocationContextMenu;
 	LLButton*				mAddLandmarkBtn;
 	LLButton*				mForSaleBtn;
@@ -179,11 +189,15 @@ class LLLocationInputCtrl
 	boost::signals2::connection	mParcelPropertiesControlConnection;
 	boost::signals2::connection	mParcelMgrConnection;
 	boost::signals2::connection	mLocationHistoryConnection;
+	boost::signals2::connection	mRegionCrossingSlot;
+	LLPathfindingNavMesh::navmesh_slot_t mNavMeshSlot;
+	bool mIsNavMeshDirty;
 	LLUIImage* mLandmarkImageOn;
 	LLUIImage* mLandmarkImageOff;
 	LLPointer<LLUIImage> mIconMaturityGeneral;
 	LLPointer<LLUIImage> mIconMaturityAdult;
 	LLPointer<LLUIImage> mIconMaturityModerate;
+	LLPointer<LLUIImage> mIconPathfindingDynamic;
 
 	std::string mAddLandmarkTooltip;
 	std::string mEditLandmarkTooltip;
diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp
index a8da94f75e2f1809e1d553bab8c57d3ceb3d6e2e..826e8d560a5ffc01746fb2e9a69c0169f6f8f23d 100644
--- a/indra/newview/llmaniprotate.cpp
+++ b/indra/newview/llmaniprotate.cpp
@@ -479,9 +479,12 @@ BOOL LLManipRotate::handleMouseUp(S32 x, S32 y, MASK mask)
 		{
 			LLSelectNode* selectNode = *iter;
 			LLViewerObject* object = selectNode->getObject();
+			LLViewerObject* root_object = (object == NULL) ? NULL : object->getRootEdit();
 
 			// have permission to move and object is root of selection or individually selected
-			if (object->permMove() && (object->isRootEdit() || selectNode->mIndividualSelection))
+			if (object->permMove() && !object->isPermanentEnforced() &&
+				((root_object == NULL) || !root_object->isPermanentEnforced()) &&
+				(object->isRootEdit() || selectNode->mIndividualSelection))
 			{
 				object->mUnselectedChildrenPositions.clear() ;
 			}
@@ -567,9 +570,12 @@ void LLManipRotate::drag( S32 x, S32 y )
 	{
 		LLSelectNode* selectNode = *iter;
 		LLViewerObject* object = selectNode->getObject();
+		LLViewerObject* root_object = (object == NULL) ? NULL : object->getRootEdit();
 
 		// have permission to move and object is root of selection or individually selected
-		if (object->permMove() && (object->isRootEdit() || selectNode->mIndividualSelection))
+		if (object->permMove() && !object->isPermanentEnforced() &&
+			((root_object == NULL) || !root_object->isPermanentEnforced()) &&
+			(object->isRootEdit() || selectNode->mIndividualSelection))
 		{
 			if (!object->isRootEdit())
 			{
@@ -621,9 +627,11 @@ void LLManipRotate::drag( S32 x, S32 y )
 	{
 		LLSelectNode* selectNode = *iter;
 		LLViewerObject* object = selectNode->getObject();
+		LLViewerObject* root_object = (object == NULL) ? NULL : object->getRootEdit();
 
 		// to avoid cumulative position changes we calculate the objects new position using its saved position
-		if (object && object->permMove())
+		if (object && object->permMove() && !object->isPermanentEnforced() &&
+			((root_object == NULL) || !root_object->isPermanentEnforced()))
 		{
 			LLVector3 center   = gAgent.getPosAgentFromGlobal( mRotationCenter );
 
@@ -704,7 +712,10 @@ void LLManipRotate::drag( S32 x, S32 y )
 	{
 		LLSelectNode* selectNode = *iter;
 		LLViewerObject*cur = selectNode->getObject();
-		if( cur->permModify() && cur->permMove() && !cur->isAvatar())
+		LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit();
+		if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() &&
+			((root_object == NULL) || !root_object->isPermanentEnforced()) &&
+			!cur->isAvatar())
 		{
 			selectNode->mLastRotation = cur->getRotation();
 			selectNode->mLastPositionLocal = cur->getPosition();
@@ -1871,7 +1882,10 @@ BOOL LLManipRotate::canAffectSelection()
 		{
 			virtual bool apply(LLViewerObject* objectp)
 			{
-				return objectp->permMove() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
+				LLViewerObject *root_object = (objectp == NULL) ? NULL : objectp->getRootEdit();
+				return objectp->permMove() && !objectp->isPermanentEnforced() &&
+					((root_object == NULL) || !root_object->isPermanentEnforced()) &&
+					(objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
 			}
 		} func;
 		can_rotate = mObjectSelection->applyToObjects(&func);
diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp
index f6df4cdfbfe0c8530d5c3efa9eb56858e4d315d1..00a0bf889431465a0f36383a00a3e97be8ea53b4 100644
--- a/indra/newview/llmanipscale.cpp
+++ b/indra/newview/llmanipscale.cpp
@@ -826,7 +826,10 @@ void LLManipScale::drag( S32 x, S32 y )
 	{
 		LLSelectNode* selectNode = *iter;
 		LLViewerObject*cur = selectNode->getObject();
-		if( cur->permModify() && cur->permMove() && !cur->isAvatar())
+		LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit();
+		if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() &&
+			((root_object == NULL) || !root_object->isPermanentEnforced()) &&
+			!cur->isAvatar())
 		{
 			selectNode->mLastScale = cur->getScale();
 			selectNode->mLastPositionLocal = cur->getPosition();
@@ -973,7 +976,10 @@ void LLManipScale::dragCorner( S32 x, S32 y )
 	{
 		LLSelectNode* selectNode = *iter;
 		LLViewerObject* cur = selectNode->getObject();
-		if(  cur->permModify() && cur->permMove() && !cur->isAvatar() )
+		LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit();
+		if(  cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() &&
+			((root_object == NULL) || !root_object->isPermanentEnforced()) &&
+			!cur->isAvatar() )
 		{
 			const LLVector3& scale = selectNode->mSavedScale;
 
@@ -995,7 +1001,10 @@ void LLManipScale::dragCorner( S32 x, S32 y )
 	{
 		LLSelectNode* selectNode = *iter;
 		LLViewerObject* cur = selectNode->getObject();
-		if( cur->permModify() && cur->permMove() && !cur->isAvatar() && cur->isRootEdit() )
+		LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit();
+		if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() &&
+			((root_object == NULL) || !root_object->isPermanentEnforced()) &&
+			!cur->isAvatar() && cur->isRootEdit() )
 		{
 			const LLVector3& scale = selectNode->mSavedScale;
 			cur->setScale( scale_factor * scale );
@@ -1043,7 +1052,10 @@ void LLManipScale::dragCorner( S32 x, S32 y )
 	{
 		LLSelectNode* selectNode = *iter;
 		LLViewerObject*cur = selectNode->getObject();
-		if( cur->permModify() && cur->permMove() && !cur->isAvatar() && !cur->isRootEdit() )
+		LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit();
+		if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() &&
+			((root_object == NULL) || !root_object->isPermanentEnforced()) &&
+			!cur->isAvatar() && !cur->isRootEdit() )
 		{
 			const LLVector3& scale = selectNode->mSavedScale;
 			cur->setScale( scale_factor * scale, FALSE );
@@ -1251,7 +1263,10 @@ void LLManipScale::stretchFace( const LLVector3& drag_start_agent, const LLVecto
 	{
 		LLSelectNode* selectNode = *iter;
 		LLViewerObject*cur = selectNode->getObject();
-		if( cur->permModify() && cur->permMove() && !cur->isAvatar() )
+		LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit();
+		if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() &&
+			((root_object == NULL) || !root_object->isPermanentEnforced()) &&
+			!cur->isAvatar() )
 		{
 			LLBBox cur_bbox			= cur->getBoundingBoxAgent();
 			LLVector3 start_local	= cur_bbox.agentToLocal( drag_start_agent );
@@ -2057,7 +2072,10 @@ BOOL LLManipScale::canAffectSelection()
 		{
 			virtual bool apply(LLViewerObject* objectp)
 			{
-				return objectp->permModify() && objectp->permMove() && !objectp->isSeat();
+				LLViewerObject *root_object = (objectp == NULL) ? NULL : objectp->getRootEdit();
+				return objectp->permModify() && objectp->permMove() && !objectp->isPermanentEnforced() &&
+					((root_object == NULL) || !root_object->isPermanentEnforced()) &&
+					!objectp->isSeat();
 			}
 		} func;
 		can_scale = mObjectSelection->applyToObjects(&func);
diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp
index f8088d04b406c67deefc248fe960c79848801fa4..10608463b46aee47ee61220ad57339bdfe9d43d6 100644
--- a/indra/newview/llmaniptranslate.cpp
+++ b/indra/newview/llmaniptranslate.cpp
@@ -688,7 +688,9 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
 			}
 		}
 
-		if (object->permMove())
+		LLViewerObject* root_object = (object == NULL) ? NULL : object->getRootEdit();
+		if (object->permMove() && !object->isPermanentEnforced() &&
+			((root_object == NULL) || !root_object->isPermanentEnforced()))
 		{
 			// handle attachments in local space
 			if (object->isAttachment() && object->mDrawable.notNull())
@@ -2305,7 +2307,10 @@ BOOL LLManipTranslate::canAffectSelection()
 		{
 			virtual bool apply(LLViewerObject* objectp)
 			{
-				return objectp->permMove() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
+				LLViewerObject *root_object = (objectp == NULL) ? NULL : objectp->getRootEdit();
+				return objectp->permMove() && !objectp->isPermanentEnforced() &&
+					((root_object == NULL) || !root_object->isPermanentEnforced()) &&
+					(objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
 			}
 		} func;
 		can_move = mObjectSelection->applyToObjects(&func);
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index 51df868faa65852656edafb10c7dce9b7a4e7709..0b009b68f74ae87e4854a767b8cf2ef9aecbd60f 100644
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -47,16 +47,16 @@ static std::string getMarketplaceDomain()
 	
 	if (!LLGridManager::getInstance()->isInProductionGrid())
 	{
-		const std::string& grid_label = LLGridManager::getInstance()->getGridLabel();
-		const std::string& grid_label_lower = utf8str_tolower(grid_label);
+		const std::string& grid_id = LLGridManager::getInstance()->getGridId();
+		const std::string& grid_id_lower = utf8str_tolower(grid_id);
 		
-		if (grid_label_lower == "damballah")
+		if (grid_id_lower == "damballah")
 		{
 			domain = "secondlife-staging.com";
 		}
 		else
 		{
-			domain = llformat("%s.lindenlab.com", grid_label_lower.c_str());
+			domain = llformat("%s.lindenlab.com", grid_id_lower.c_str());
 		}
 	}
 	
diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp
index c3d8b91d67ae372bfdf4868470fe41b45cde16bf..93f7146fc8060d46d9e8c8a4724b0bbd6191ca66 100644
--- a/indra/newview/llmoveview.cpp
+++ b/indra/newview/llmoveview.cpp
@@ -686,7 +686,7 @@ void LLPanelStandStopFlying::onStopFlyingButtonClick()
 	gAgent.setFlying(FALSE);
 
 	setFocus(FALSE); // EXT-482
-	setVisible(FALSE);
+	mStopFlyingButton->setVisible(FALSE);
 }
 
 /**
@@ -710,7 +710,7 @@ void LLPanelStandStopFlying::updatePosition()
 		left_tb_width = toolbar_left->getRect().getWidth();
 	}
 
-	if(LLPanel* panel_ssf_container = getRootView()->getChild<LLPanel>("stand_stop_flying_container"))
+	if(LLPanel* panel_ssf_container = getRootView()->getChild<LLPanel>("state_management_buttons_container"))
 	{
 		panel_ssf_container->setOrigin(0, y_pos);
 	}
diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp
index a64b4ec94d599dce7b7d9588425b75430e9a7734..77e1487f3835764938b749fae338a67cfb70c95b 100644
--- a/indra/newview/llpanelcontents.cpp
+++ b/indra/newview/llpanelcontents.cpp
@@ -116,7 +116,7 @@ void LLPanelContents::getState(LLViewerObject *objectp )
 
 	// BUG? Check for all objects being editable?
 	bool editable = gAgent.isGodlike()
-					|| (objectp->permModify()
+					|| (objectp->permModify() && !objectp->isPermanentEnforced()
 					       && ( objectp->permYouOwner() || ( !group_id.isNull() && gAgent.isInGroup(group_id) )));  // solves SL-23488
 	BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME );
 
@@ -127,6 +127,8 @@ void LLPanelContents::getState(LLViewerObject *objectp )
 		((LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() == 1)
 			|| (LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1)));
 
+	getChildView("button permissions")->setEnabled(!objectp->isPermanentEnforced());
+	mPanelInventoryObject->setEnabled(!objectp->isPermanentEnforced());
 }
 
 void LLPanelContents::refresh()
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index 3e298054466bbc367ce90cd60252ad9882270193..202be9671b4d4bdb092b69391c7f518de57fecba 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -490,7 +490,7 @@ void LLPanelFace::getState()
 		&& objectp->getPCode() == LL_PCODE_VOLUME
 		&& objectp->permModify())
 	{
-		BOOL editable = objectp->permModify();
+		BOOL editable = objectp->permModify() && !objectp->isPermanentEnforced();
 
 		// only turn on auto-adjust button if there is a media renderer and the media is loaded
 		getChildView("textbox autofix")->setEnabled(editable);
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 76aadcd9138d1458bcb886b94e6031ff74a93049..a8049b1b03591511537a39f50848ddfed1bdedbd 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -104,7 +104,6 @@ class LLLoginRefreshHandler : public LLCommandHandler
 // Public methods
 //---------------------------------------------------------------------------
 LLPanelLogin::LLPanelLogin(const LLRect &rect,
-						 BOOL show_server,
 						 void (*callback)(S32 option, void* user_data),
 						 void *cb_data)
 :	LLPanel(),
@@ -119,7 +118,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
 	// instance management
 	if (LLPanelLogin::sInstance)
 	{
-		llwarns << "Duplicate instance of login view deleted" << llendl;
+		LL_WARNS("AppInit") << "Duplicate instance of login view deleted" << LL_ENDL;
 		// Don't leave bad pointer in gFocusMgr
 		gFocusMgr.setDefaultKeyboardFocus(NULL);
 
@@ -152,12 +151,36 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
 		LLSLURL slurl(gSavedSettings.getString("LoginLocation"));
 		LLStartUp::setStartSLURL(slurl);
 	}
-	updateLocationCombo(false);
+	
+	LLComboBox* location_combo = getChild<LLComboBox>("start_location_combo");
+	updateLocationSelectorsVisibility(); // separate so that it can be called from preferences
+	location_combo->setFocusLostCallback(boost::bind(&LLPanelLogin::onLocationSLURL, this));
+	
+	LLComboBox* server_choice_combo = getChild<LLComboBox>("server_combo");
+	server_choice_combo->setCommitCallback(boost::bind(&LLPanelLogin::onSelectServer, this));
 
-	LLComboBox* server_choice_combo = sInstance->getChild<LLComboBox>("server_combo");
-	server_choice_combo->setCommitCallback(onSelectServer, NULL);
-	server_choice_combo->setFocusLostCallback(boost::bind(onServerComboLostFocus, _1));
-	updateServerCombo();
+	// Load all of the grids, sorted, and then add a bar and the current grid at the top
+	server_choice_combo->removeall();
+
+	std::string current_grid = LLGridManager::getInstance()->getGrid();
+	std::map<std::string, std::string> known_grids = LLGridManager::getInstance()->getKnownGrids();
+	for (std::map<std::string, std::string>::iterator grid_choice = known_grids.begin();
+		 grid_choice != known_grids.end();
+		 grid_choice++)
+	{
+		if (!grid_choice->first.empty() && current_grid != grid_choice->first)
+		{
+			LL_DEBUGS("AppInit")<<"adding "<<grid_choice->first<<LL_ENDL;
+			server_choice_combo->add(grid_choice->second, grid_choice->first);
+		}
+	}
+	server_choice_combo->sortByName();
+	server_choice_combo->addSeparator(ADD_TOP);
+	LL_DEBUGS("AppInit")<<"adding current "<<current_grid<<LL_ENDL;
+	server_choice_combo->add(LLGridManager::getInstance()->getGridLabel(), 
+							 current_grid,
+							 ADD_TOP);	
+	server_choice_combo->selectFirstItem();		
 
 	childSetAction("connect_btn", onClickConnect, this);
 
@@ -167,10 +190,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
 	std::string version = llformat("%s (%d)",
 								   LLVersionInfo::getShortVersion().c_str(),
 								   LLVersionInfo::getBuild());
-	//LLTextBox* channel_text = getChild<LLTextBox>("channel_text");
-	//channel_text->setTextArg("[CHANNEL]", channel); // though not displayed
-	//channel_text->setTextArg("[VERSION]", version);
-	//channel_text->setClickedCallback(onClickVersion, this);
 	
 	LLTextBox* forgot_password_text = getChild<LLTextBox>("forgot_password_text");
 	forgot_password_text->setClickedCallback(onClickForgotPassword, NULL);
@@ -192,9 +211,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
 	// Show last logged in user favorites in "Start at" combo.
 	addUsersWithFavoritesToUsername();
 	getChild<LLComboBox>("username_combo")->setTextChangedCallback(boost::bind(&LLPanelLogin::addFavoritesToStartLocation, this));
-
-	updateLocationCombo(false);
-
 }
 
 void LLPanelLogin::addUsersWithFavoritesToUsername()
@@ -389,25 +405,27 @@ void LLPanelLogin::giveFocus()
 // static
 void LLPanelLogin::showLoginWidgets()
 {
-	// *NOTE: Mani - This may or may not be obselete code.
-	// It seems to be part of the defunct? reg-in-client project.
-	sInstance->getChildView("login_widgets")->setVisible( true);
-	LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
-	sInstance->reshapeBrowser();
-	// *TODO: Append all the usual login parameters, like first_login=Y etc.
-	std::string splash_screen_url = LLGridManager::getInstance()->getLoginPage();
-	web_browser->navigateTo( splash_screen_url, "text/html" );
-	LLUICtrl* username_combo = sInstance->getChild<LLUICtrl>("username_combo");
-	username_combo->setFocus(TRUE);
+	if (sInstance)
+	{
+		// *NOTE: Mani - This may or may not be obselete code.
+		// It seems to be part of the defunct? reg-in-client project.
+		sInstance->getChildView("login_widgets")->setVisible( true);
+		LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
+		sInstance->reshapeBrowser();
+		// *TODO: Append all the usual login parameters, like first_login=Y etc.
+		std::string splash_screen_url = LLGridManager::getInstance()->getLoginPage();
+		web_browser->navigateTo( splash_screen_url, "text/html" );
+		LLUICtrl* username_combo = sInstance->getChild<LLUICtrl>("username_combo");
+		username_combo->setFocus(TRUE);
+	}
 }
 
 // static
 void LLPanelLogin::show(const LLRect &rect,
-						BOOL show_server,
 						void (*callback)(S32 option, void* user_data),
 						void* callback_data)
 {
-	new LLPanelLogin(rect, show_server, callback, callback_data);
+	new LLPanelLogin(rect, callback, callback_data);
 
 	if( !gFocusMgr.getKeyboardFocus() )
 	{
@@ -567,21 +585,6 @@ void LLPanelLogin::getFields(LLPointer<LLCredential>& credential,
 	remember = sInstance->getChild<LLUICtrl>("remember_check")->getValue();
 }
 
-// static
-BOOL LLPanelLogin::isGridComboDirty()
-{
-	BOOL user_picked = FALSE;
-	if (!sInstance)
-	{
-		llwarns << "Attempted getServer with no login view shown" << llendl;
-	}
-	else
-	{
-		LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
-		user_picked = combo->isDirty();
-	}
-	return user_picked;
-}
 
 // static
 BOOL LLPanelLogin::areCredentialFieldsDirty()
@@ -611,83 +614,69 @@ BOOL LLPanelLogin::areCredentialFieldsDirty()
 
 
 // static
-void LLPanelLogin::updateLocationCombo( bool force_visible )
+void LLPanelLogin::updateLocationSelectorsVisibility()
 {
-	if (!sInstance) 
+	if (sInstance) 
 	{
-		return;
+		BOOL show_start = gSavedSettings.getBOOL("ShowStartLocation");
+		sInstance->getChildView("start_location_combo")->setVisible(show_start);
+		sInstance->getChildView("start_location_text")->setVisible(show_start);
+
+		BOOL show_server = gSavedSettings.getBOOL("ForceShowGrid");
+		LLComboBox* server_choice_combo = sInstance->getChild<LLComboBox>("server_combo");
+		server_choice_combo->setVisible( show_server );
 	}	
-	
-	LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo");
-	
-	switch(LLStartUp::getStartSLURL().getType())
-	{
-		case LLSLURL::LOCATION:
-		{
-			
-			combo->setCurrentByIndex( 2 );	
-			combo->setTextEntry(LLStartUp::getStartSLURL().getLocationString());	
-			break;
-		}
-		case LLSLURL::HOME_LOCATION:
-			combo->setCurrentByIndex(1);
-			break;
-		default:
-			combo->setCurrentByIndex(0);
-			break;
-	}
-	
-	BOOL show_start = TRUE;
-	
-	if ( ! force_visible )
-		show_start = gSavedSettings.getBOOL("ShowStartLocation");
-	
-	sInstance->getChildView("start_location_combo")->setVisible( show_start);
-	sInstance->getChildView("start_location_text")->setVisible( show_start);
-	
-	BOOL show_server = gSavedSettings.getBOOL("ForceShowGrid");
-	sInstance->getChildView("server_combo_text")->setVisible( show_server);	
-	sInstance->getChildView("server_combo")->setVisible( show_server);
 }
 
-// static
-void LLPanelLogin::updateStartSLURL()
+// static - called from LLStartUp::setStartSLURL
+void LLPanelLogin::onUpdateStartSLURL(const LLSLURL& new_start_slurl)
 {
 	if (!sInstance) return;
-	
-	LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo");
-	S32 index = combo->getCurrentIndex();
-	
-	switch (index)
-	{
-		case 0:
-		{
-			LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_LAST));
-			break;
-		}			
-		case 1:
-		{
-			LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_HOME));
-			break;
-		}
-		default:
+
+	LL_DEBUGS("AppInit")<<new_start_slurl.asString()<<LL_ENDL;
+
+	LLComboBox* location_combo = sInstance->getChild<LLComboBox>("start_location_combo");
+	/*
+	 * Determine whether or not the new_start_slurl modifies the grid.
+	 *
+	 * Note that some forms that could be in the slurl are grid-agnostic.,
+	 * such as "home".  Other forms, such as
+	 * https://grid.example.com/region/Party%20Town/20/30/5 
+	 * specify a particular grid; in those cases we want to change the grid
+	 * and the grid selector to match the new value.
+	 */
+	if ( LLSLURL::LOCATION == new_start_slurl.getType() )
+	{
+		std::string slurl_grid = LLGridManager::getInstance()->getGrid(new_start_slurl.getGrid());
+		if ( ! slurl_grid.empty() ) // is that a valid grid?
 		{
-			LLSLURL slurl = LLSLURL(combo->getValue().asString());
-			if(slurl.getType() == LLSLURL::LOCATION)
+			if ( slurl_grid != LLGridManager::getInstance()->getGrid() ) // new grid?
 			{
-				// we've changed the grid, so update the grid selection
-				LLStartUp::setStartSLURL(slurl);
+				// the slurl changes the grid, so update everything to match
+				LLGridManager::getInstance()->setGridChoice(slurl_grid);
+
+				// update the grid selector to match the slurl
+				LLComboBox* server_combo = sInstance->getChild<LLComboBox>("server_combo");
+				std::string server_label(LLGridManager::getInstance()->getGridLabel(slurl_grid));
+				server_combo->setSimple(server_label);
+
+				updateServer(); // to change the links and splash screen
 			}
-			break;
-		}			
+			location_combo->setTextEntry(new_start_slurl.getLocationString());
+		}
+		else
+		{
+			// the grid specified by the slurl is not known
+			LLNotificationsUtil::add("InvalidLocationSLURL");
+			location_combo->setTextEntry(LLStringUtil::null);
+		}
 	}
 }
 
-
 void LLPanelLogin::setLocation(const LLSLURL& slurl)
 {
-	LLStartUp::setStartSLURL(slurl);
-	updateServer();
+	LL_DEBUGS("AppInit")<<"setting Location "<<slurl.asString()<<LL_ENDL;
+	LLStartUp::setStartSLURL(slurl); // calls onUpdateStartSLURL, above
 }
 
 // static
@@ -705,13 +694,14 @@ void LLPanelLogin::closePanel()
 // static
 void LLPanelLogin::setAlwaysRefresh(bool refresh)
 {
-	if (LLStartUp::getStartupState() >= STATE_LOGIN_CLEANUP) return;
-
-	LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
-
-	if (web_browser)
+	if (sInstance && LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP)
 	{
-		web_browser->setAlwaysRefresh(refresh);
+		LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
+
+		if (web_browser)
+		{
+			web_browser->setAlwaysRefresh(refresh);
+		}
 	}
 }
 
@@ -761,7 +751,7 @@ void LLPanelLogin::loadLoginPage()
 	curl_free(curl_version);
 
 	// Grid
-	char* curl_grid = curl_escape(LLGridManager::getInstance()->getGridLabel().c_str(), 0);
+	char* curl_grid = curl_escape(LLGridManager::getInstance()->getGridId().c_str(), 0);
 	oStr << "&grid=" << curl_grid;
 	curl_free(curl_grid);
 	
@@ -775,27 +765,13 @@ void LLPanelLogin::loadLoginPage()
 	LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
 	if (web_browser->getCurrentNavUrl() != oStr.str())
 	{
+		LL_DEBUGS("AppInit")<<oStr.str()<<LL_ENDL;
 		web_browser->navigateTo( oStr.str(), "text/html" );
 	}
 }
 
 void LLPanelLogin::handleMediaEvent(LLPluginClassMedia* /*self*/, EMediaEvent event)
 {
-	if(event == MEDIA_EVENT_NAVIGATE_COMPLETE)
-	{
-		LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
-		if (web_browser)
-		{
-			// *HACK HACK HACK HACK!
-			/* Stuff a Tab key into the browser now so that the first field will
-			** get the focus!  The embedded javascript on the page that properly
-			** sets the initial focus in a real web browser is not working inside
-			** the viewer, so this is an UGLY HACK WORKAROUND for now.
-			*/
-			// Commented out as it's not reliable
-			//web_browser->handleKey(KEY_TAB, MASK_NONE, false);
-		}
-	}
 }
 
 //---------------------------------------------------------------------------
@@ -812,15 +788,9 @@ void LLPanelLogin::onClickConnect(void *)
 
 		LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
 		LLSD combo_val = combo->getSelectedValue();
-		if (combo_val.isUndefined())
-		{
-			combo_val = combo->getValue();
-		}
-		if(combo_val.isUndefined())
-		{
-			LLNotificationsUtil::add("StartRegionEmpty");
-			return;
-		}		
+
+		// the grid definitions may come from a user-supplied grids.xml, so they may not be good
+		LL_DEBUGS("AppInit")<<"grid "<<combo_val.asString()<<LL_ENDL;
 		try
 		{
 			LLGridManager::getInstance()->setGridChoice(combo_val.asString());
@@ -828,13 +798,14 @@ void LLPanelLogin::onClickConnect(void *)
 		catch (LLInvalidGridName ex)
 		{
 			LLSD args;
-			args["GRID"] = combo_val.asString();
+			args["GRID"] = ex.name();
 			LLNotificationsUtil::add("InvalidGrid", args);
 			return;
 		}
-		updateStartSLURL();
-		std::string username = sInstance->getChild<LLUICtrl>("username_combo")->getValue().asString();
 
+		// The start location SLURL has already been sent to LLStartUp::setStartSLURL
+
+		std::string username = sInstance->getChild<LLUICtrl>("username_combo")->getValue().asString();
 		
 		if(username.empty())
 		{
@@ -877,7 +848,10 @@ void LLPanelLogin::onClickConnect(void *)
 // static
 void LLPanelLogin::onClickNewAccount(void*)
 {
-	LLWeb::loadURLExternal(sInstance->getString("create_account_url"));
+	if (sInstance)
+	{
+		LLWeb::loadURLExternal(sInstance->getString("create_account_url"));
+	}
 }
 
 
@@ -913,7 +887,7 @@ void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data)
 	This->mPasswordModified = TRUE;
 	if (gKeyboard->getKeyDown(KEY_CAPSLOCK) && sCapslockDidNotification == FALSE)
 	{
-// *TODO: use another way to notify user about enabled caps lock, see EXT-6858
+		// *TODO: use another way to notify user about enabled caps lock, see EXT-6858
 		sCapslockDidNotification = TRUE;
 	}
 }
@@ -921,113 +895,97 @@ void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data)
 
 void LLPanelLogin::updateServer()
 {
-	try 
+	if (sInstance)
 	{
-
-		updateServerCombo();	
-		// if they've selected another grid, we should load the credentials
-		// for that grid and set them to the UI.
-		if(sInstance && !sInstance->areCredentialFieldsDirty())
+		try 
 		{
-			LLPointer<LLCredential> credential = gSecAPIHandler->loadCredential(LLGridManager::getInstance()->getGrid());	
-			bool remember = sInstance->getChild<LLUICtrl>("remember_check")->getValue();
-			sInstance->setFields(credential, remember);
-		}
-		// grid changed so show new splash screen (possibly)
-		loadLoginPage();
-		updateLocationCombo(LLStartUp::getStartSLURL().getType() == LLSLURL::LOCATION);
-	}
-	catch (LLInvalidGridName ex)
-	{
-		// do nothing
-	}
-}
-
-void LLPanelLogin::updateServerCombo()
-{
-	if (!sInstance) 
-	{
-		return;	
-	}
-	// We add all of the possible values, sorted, and then add a bar and the current value at the top
-	LLComboBox* server_choice_combo = sInstance->getChild<LLComboBox>("server_combo");	
-	server_choice_combo->removeall();
+			// if they've selected another grid, we should load the credentials
+			// for that grid and set them to the UI.
+			if(!sInstance->areCredentialFieldsDirty())
+			{
+				LLPointer<LLCredential> credential = gSecAPIHandler->loadCredential(LLGridManager::getInstance()->getGrid());	
+				bool remember = sInstance->getChild<LLUICtrl>("remember_check")->getValue();
+				sInstance->setFields(credential, remember);
+			}
 
-	std::map<std::string, std::string> known_grids = LLGridManager::getInstance()->getKnownGrids(!gSavedSettings.getBOOL("ShowBetaGrids"));
+			// update the login panel links 
+			bool system_grid = LLGridManager::getInstance()->isSystemGrid();
+	
+			sInstance->getChildView("create_new_account_text")->setVisible( system_grid);
+			sInstance->getChildView("forgot_password_text")->setVisible( system_grid);
 
-	for (std::map<std::string, std::string>::iterator grid_choice = known_grids.begin();
-		 grid_choice != known_grids.end();
-		 grid_choice++)
-	{
-		if (!grid_choice->first.empty())
+			// grid changed so show new splash screen (possibly)
+			loadLoginPage();
+		}
+		catch (LLInvalidGridName ex)
 		{
-			server_choice_combo->add(grid_choice->second, grid_choice->first);
+			LL_WARNS("AppInit")<<"server '"<<ex.name()<<"' selection failed"<<LL_ENDL;
+			LLSD args;
+			args["GRID"] = ex.name();
+			LLNotificationsUtil::add("InvalidGrid", args);	
+			return;
 		}
 	}
-	server_choice_combo->sortByName();
-	
-	server_choice_combo->addSeparator(ADD_TOP);
-	
-	server_choice_combo->add(LLGridManager::getInstance()->getGridLabel(), 
-		LLGridManager::getInstance()->getGrid(), ADD_TOP);	
-	
-	server_choice_combo->selectFirstItem();	
 }
 
-// static
-void LLPanelLogin::onSelectServer(LLUICtrl*, void*)
+void LLPanelLogin::onSelectServer()
 {
-	// *NOTE: The paramters for this method are ignored. 
-	// LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*)
-	// calls this method.
-	LL_INFOS("AppInit") << "onSelectServer" << LL_ENDL;
 	// The user twiddled with the grid choice ui.
 	// apply the selection to the grid setting.
 	LLPointer<LLCredential> credential;
 	
-	LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
-	LLSD combo_val = combo->getSelectedValue();
-	if (combo_val.isUndefined())
+	LLComboBox* server_combo = getChild<LLComboBox>("server_combo");
+	LLSD server_combo_val = server_combo->getSelectedValue();
+	LL_INFOS("AppInit") << "grid "<<server_combo_val.asString()<< LL_ENDL;
+	LLGridManager::getInstance()->setGridChoice(server_combo_val.asString());
+	
+	/*
+	 * Determine whether or not the value in the start_location_combo makes sense
+	 * with the new grid value.
+	 *
+	 * Note that some forms that could be in the location combo are grid-agnostic,
+	 * such as "MyRegion/128/128/0".  There could be regions with that name on any
+	 * number of grids, so leave them alone.  Other forms, such as
+	 * https://grid.example.com/region/Party%20Town/20/30/5 specify a particular
+	 * grid; in those cases we want to clear the location.
+	 */
+	LLComboBox* location_combo = getChild<LLComboBox>("start_location_combo");
+	S32 index = location_combo->getCurrentIndex();
+	switch (index)
 	{
-		combo_val = combo->getValue();
+	case 0: // last location
+	case 1: // home location
+		// do nothing - these are grid-agnostic locations
+		break;
+		
+	default:
+		{
+			std::string location = location_combo->getValue().asString();
+			LLSLURL slurl(location); // generata a slurl from the location combo contents
+			if (   slurl.getType() == LLSLURL::LOCATION
+				&& slurl.getGrid() != LLGridManager::getInstance()->getGrid()
+				)
+			{
+				// the grid specified by the location is not this one, so clear the combo
+				location_combo->setCurrentByIndex(0); // last location on the new grid
+				location_combo->setTextEntry(LLStringUtil::null);
+			}
+		}			
+		break;
 	}
-	
-	combo = sInstance->getChild<LLComboBox>("start_location_combo");	
-	combo->setCurrentByIndex(1);
-	LLStartUp::setStartSLURL(LLSLURL(gSavedSettings.getString("LoginLocation")));
-	LLGridManager::getInstance()->setGridChoice(combo_val.asString());
-	// This new selection will override preset uris
-	// from the command line.
+
 	updateServer();
-	updateLocationCombo(false);
-	updateLoginPanelLinks();
 }
 
-void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe)
+void LLPanelLogin::onLocationSLURL()
 {
-	if (!sInstance)
-	{
-		return;
-	}
+	LLComboBox* location_combo = getChild<LLComboBox>("start_location_combo");
+	std::string location = location_combo->getValue().asString();
+	LL_DEBUGS("AppInit")<<location<<LL_ENDL;
 
-	LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
-	if(fe == combo)
-	{
-		onSelectServer(combo, NULL);	
-	}
+	LLStartUp::setStartSLURL(location); // calls onUpdateStartSLURL, above 
 }
 
-void LLPanelLogin::updateLoginPanelLinks()
-{
-	LLSD grid_data;
-	LLGridManager::getInstance()->getGridInfo(grid_data);
-	bool system_grid = grid_data.has(GRID_IS_SYSTEM_GRID_VALUE);
-	
-	// need to call through sInstance, as it's called from onSelectServer, which
-	// is static.
-	sInstance->getChildView("create_new_account_text")->setVisible( system_grid);
-	sInstance->getChildView("forgot_password_text")->setVisible( system_grid);
-}
 
 std::string canonicalize_username(const std::string& name)
 {
diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h
index a439c4ff6b8a3e95d9821d7644133151e1412dd2..c71cfc378309ccfe584d27d88a3f353acaf25f34 100644
--- a/indra/newview/llpanellogin.h
+++ b/indra/newview/llpanellogin.h
@@ -44,7 +44,7 @@ class LLPanelLogin:
 {
 	LOG_CLASS(LLPanelLogin);
 public:
-	LLPanelLogin(const LLRect &rect, BOOL show_server, 
+	LLPanelLogin(const LLRect &rect,
 				void (*callback)(S32 option, void* user_data),
 				void *callback_data);
 	~LLPanelLogin();
@@ -57,7 +57,7 @@ class LLPanelLogin:
 	// hidden on startup for reg-in-client
 	static void showLoginWidgets();
 
-	static void show(const LLRect &rect, BOOL show_server, 
+	static void show(const LLRect &rect,
 		void (*callback)(S32 option, void* user_data), 
 		void* callback_data);
 
@@ -65,11 +65,12 @@ class LLPanelLogin:
 
 	static void getFields(LLPointer<LLCredential>& credential, BOOL& remember);
 
-	static BOOL isGridComboDirty();
 	static BOOL areCredentialFieldsDirty();
 	static void setLocation(const LLSLURL& slurl);
 	
-	static void updateLocationCombo(bool force_visible);  // simply update the combo box
+	/// Call when preferences that control visibility may have changed
+	static void updateLocationSelectorsVisibility();
+
 	static void closePanel();
 
 	void setSiteIsAlive( bool alive );
@@ -82,22 +83,24 @@ class LLPanelLogin:
 	/*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
 	static void updateServer();  // update the combo box, change the login page to the new server, clear the combo
 
+	/// to be called from LLStartUp::setStartSLURL
+	static void onUpdateStartSLURL(const LLSLURL& new_start_slurl);
+
 private:
 	friend class LLPanelLoginListener;
 	void reshapeBrowser();
 	void addFavoritesToStartLocation();
 	void addUsersWithFavoritesToUsername();
+	void onSelectServer();
+	void onLocationSLURL();
+
 	static void onClickConnect(void*);
 	static void onClickNewAccount(void*);
 	static void onClickVersion(void*);
 	static void onClickForgotPassword(void*);
 	static void onClickHelp(void*);
 	static void onPassKey(LLLineEditor* caller, void* user_data);
-	static void onSelectServer(LLUICtrl*, void*);
-	static void onServerComboLostFocus(LLFocusableElement*);
 	static void updateServerCombo();
-	static void updateStartSLURL();
-	static void updateLoginPanelLinks();
 
 private:
 	LLPointer<LLUIImage> mLogoImage;
diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp
index 7dfe529b73f373569d4adda1fe269ce83cd70816..d87b565b328d1b6fe6a0b98f177b11babf98a3ae 100644
--- a/indra/newview/llpanelobject.cpp
+++ b/indra/newview/llpanelobject.cpp
@@ -119,7 +119,6 @@ BOOL	LLPanelObject::postBuild()
 	mCheckPhantom = getChild<LLCheckBoxCtrl>("Phantom Checkbox Ctrl");
 	childSetCommitCallback("Phantom Checkbox Ctrl",onCommitPhantom,this);
        
-
 	// Position
 	mLabelPosition = getChild<LLTextBox>("label position");
 	mCtrlPosX = getChild<LLSpinCtrl>("Pos X");
@@ -272,7 +271,7 @@ BOOL	LLPanelObject::postBuild()
 	childSetCommitCallback("sculpt mirror control", onCommitSculptType, this);
 	mCtrlSculptInvert = getChild<LLCheckBoxCtrl>("sculpt invert control");
 	childSetCommitCallback("sculpt invert control", onCommitSculptType, this);
-	
+
 	// Start with everyone disabled
 	clearCtrls();
 
@@ -284,7 +283,6 @@ LLPanelObject::LLPanelObject()
 	mIsPhysical(FALSE),
 	mIsTemporary(FALSE),
 	mIsPhantom(FALSE),
-	mCastShadows(TRUE),
 	mSelectedType(MI_BOX),
 	mSculptTextureRevert(LLUUID::null),
 	mSculptTypeRevert(0)
@@ -343,9 +341,9 @@ void LLPanelObject::getState( )
 	}
 
 	// can move or rotate only linked group with move permissions, or sub-object with move and modify perms
-	BOOL enable_move	= objectp->permMove() && !objectp->isAttachment() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
-	BOOL enable_scale	= objectp->permMove() && objectp->permModify();
-	BOOL enable_rotate	= objectp->permMove() && ( (objectp->permModify() && !objectp->isAttachment()) || !gSavedSettings.getBOOL("EditLinkedParts"));
+	BOOL enable_move	= objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && !objectp->isAttachment() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
+	BOOL enable_scale	= objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && objectp->permModify();
+	BOOL enable_rotate	= objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && ( (objectp->permModify() && !objectp->isAttachment()) || !gSavedSettings.getBOOL("EditLinkedParts"));
 
 	S32 selected_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
 	BOOL single_volume = (LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ))
@@ -463,9 +461,16 @@ void LLPanelObject::getState( )
 		getChildView("select_single")->setVisible( TRUE);
 		getChildView("select_single")->setEnabled(TRUE);
 	}
+
+	BOOL is_flexible = volobjp && volobjp->isFlexible();
+	BOOL is_permanent = root_objectp->flagObjectPermanent();
+	BOOL is_permanent_enforced = root_objectp->isPermanentEnforced();
+	BOOL is_character = root_objectp->flagCharacter();
+	llassert(!is_permanent || !is_character); // should never have a permanent object that is also a character
+
 	// Lock checkbox - only modifiable if you own the object.
 	BOOL self_owned = (gAgent.getID() == owner_id);
-	mCheckLock->setEnabled( roots_selected > 0 && self_owned );
+	mCheckLock->setEnabled( roots_selected > 0 && self_owned && !is_permanent_enforced);
 
 	// More lock and debit checkbox - get the values
 	BOOL valid;
@@ -495,30 +500,27 @@ void LLPanelObject::getState( )
 		}
 	}
 
-	BOOL is_flexible = volobjp && volobjp->isFlexible();
-
 	// Physics checkbox
-	mIsPhysical = root_objectp->usePhysics();
+	mIsPhysical = root_objectp->flagUsePhysics();
+	llassert(!is_permanent || !mIsPhysical); // should never have a permanent object that is also physical
+
 	mCheckPhysics->set( mIsPhysical );
 	mCheckPhysics->setEnabled( roots_selected>0 
 								&& (editable || gAgent.isGodlike()) 
-								&& !is_flexible);
+								&& !is_flexible && !is_permanent);
 
 	mIsTemporary = root_objectp->flagTemporaryOnRez();
+	llassert(!is_permanent || !mIsTemporary); // should never has a permanent object that is also temporary
+
 	mCheckTemporary->set( mIsTemporary );
-	mCheckTemporary->setEnabled( roots_selected>0 && editable );
+	mCheckTemporary->setEnabled( roots_selected>0 && editable && !is_permanent);
 
 	mIsPhantom = root_objectp->flagPhantom();
+	BOOL is_volume_detect = root_objectp->flagVolumeDetect();
+	llassert(!is_character || !mIsPhantom); // should never have a character that is also a phantom
 	mCheckPhantom->set( mIsPhantom );
-	mCheckPhantom->setEnabled( roots_selected>0 && editable && !is_flexible );
+	mCheckPhantom->setEnabled( roots_selected>0 && editable && !is_flexible && !is_permanent_enforced && !is_character && !is_volume_detect);
 
-       
-#if 0 // 1.9.2
-	mCastShadows = root_objectp->flagCastShadows();
-	mCheckCastShadows->set( mCastShadows );
-	mCheckCastShadows->setEnabled( roots_selected==1 && editable );
-#endif
-	
 	//----------------------------------------------------------------------------
 
 	S32 selected_item	= MI_BOX;
@@ -556,7 +558,7 @@ void LLPanelObject::getState( )
 	{
 		// Only allowed to change these parameters for objects
 		// that you have permissions on AND are not attachments.
-		enabled = root_objectp->permModify();
+		enabled = root_objectp->permModify() && !root_objectp->isPermanentEnforced();
 		
 		// Volume type
 		const LLVolumeParams &volume_params = objectp->getVolume()->getParams();
@@ -1215,22 +1217,6 @@ void LLPanelObject::sendIsPhantom()
 	}
 }
 
-void LLPanelObject::sendCastShadows()
-{
-	BOOL value = mCheckCastShadows->get();
-	if( mCastShadows != value )
-	{
-		LLSelectMgr::getInstance()->selectionUpdateCastShadows(value);
-		mCastShadows = value;
-
-		llinfos << "update cast shadows sent" << llendl;
-	}
-	else
-	{
-		llinfos << "update cast shadows not changed" << llendl;
-	}
-}
-
 // static
 void LLPanelObject::onCommitParametric( LLUICtrl* ctrl, void* userdata )
 {
@@ -1887,10 +1873,6 @@ void LLPanelObject::clearCtrls()
 	mCheckPhantom	->set(FALSE);
 	mCheckPhantom	->setEnabled( FALSE );
 	
-#if 0 // 1.9.2
-	mCheckCastShadows->set(FALSE);
-	mCheckCastShadows->setEnabled( FALSE );
-#endif
 	// Disable text labels
 	mLabelPosition	->setEnabled( FALSE );
 	mLabelSize		->setEnabled( FALSE );
@@ -1978,14 +1960,6 @@ void LLPanelObject::onCommitPhantom( LLUICtrl* ctrl, void* userdata )
 	self->sendIsPhantom();
 }
 
-// static
-void LLPanelObject::onCommitCastShadows( LLUICtrl* ctrl, void* userdata )
-{
-	LLPanelObject* self = (LLPanelObject*) userdata;
-	self->sendCastShadows();
-}
-
-
 void LLPanelObject::onSelectSculpt(const LLSD& data)
 {
     LLTextureCtrl* mTextureCtrl = getChild<LLTextureCtrl>("sculpt texture control");
diff --git a/indra/newview/llpanelobject.h b/indra/newview/llpanelobject.h
index 475dfdaedbbffec08ea2e653f0cd58a5450054b5..c4cf27ab1aa9dceca65b1ae47c7772c560d82674 100644
--- a/indra/newview/llpanelobject.h
+++ b/indra/newview/llpanelobject.h
@@ -64,7 +64,6 @@ class LLPanelObject : public LLPanel
 	static void 	onCommitRotation(		LLUICtrl* ctrl, void* userdata);
 	static void 	onCommitTemporary(		LLUICtrl* ctrl, void* userdata);
 	static void 	onCommitPhantom(		LLUICtrl* ctrl, void* userdata);
-	static void 	onCommitCastShadows(	LLUICtrl* ctrl, void* userdata);
 	static void 	onCommitPhysics(		LLUICtrl* ctrl, void* userdata);
 
 	static void 	onCommitParametric(LLUICtrl* ctrl, void* userdata);
@@ -75,8 +74,7 @@ class LLPanelObject : public LLPanel
 	void     		onSelectSculpt(const LLSD& data);
 	BOOL     		onDropSculpt(LLInventoryItem* item);
 	static void     onCommitSculptType(    LLUICtrl *ctrl, void* userdata);
-		
-	
+
 protected:
 	void			getState();
 
@@ -87,7 +85,6 @@ class LLPanelObject : public LLPanel
 	void			sendIsTemporary();
 	void			sendIsPhantom();
 
-	void			sendCastShadows();
 	void            sendSculpt();
 	
 	void 			getVolumeParams(LLVolumeParams& volume_params);
@@ -153,7 +150,6 @@ class LLPanelObject : public LLPanel
 	LLCheckBoxCtrl	*mCheckPhysics;
 	LLCheckBoxCtrl	*mCheckTemporary;
 	LLCheckBoxCtrl	*mCheckPhantom;
-	LLCheckBoxCtrl	*mCheckCastShadows;
 
 	LLTextureCtrl   *mCtrlSculptTexture;
 	LLTextBox       *mLabelSculptType;
@@ -165,7 +161,6 @@ class LLPanelObject : public LLPanel
 	BOOL			mIsPhysical;			// to avoid sending "physical" when not changed
 	BOOL			mIsTemporary;			// to avoid sending "temporary" when not changed
 	BOOL			mIsPhantom;				// to avoid sending "phantom" when not changed
-	BOOL			mCastShadows;			// to avoid sending "cast shadows" when not changed
 	S32				mSelectedType;			// So we know what selected type we last were
 
 	LLUUID          mSculptTextureRevert;   // so we can revert the sculpt texture on cancel
diff --git a/indra/newview/llpanelpathfindingrebakenavmesh.cpp b/indra/newview/llpanelpathfindingrebakenavmesh.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..7efb1a922731b76656ab063737120078103d239c
--- /dev/null
+++ b/indra/newview/llpanelpathfindingrebakenavmesh.cpp
@@ -0,0 +1,269 @@
+/** 
+* @file llpanelpathfindingrebakenavmesh.cpp
+* @brief Implementation of llpanelpathfindingrebakenavmesh
+* @author Prep@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, 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 "llpanelpathfindingrebakenavmesh.h"
+
+#include <boost/bind.hpp>
+#include <boost/signals2.hpp>
+
+#include "llagent.h"
+#include "llbutton.h"
+#include "llenvmanager.h"
+#include "llhints.h"
+#include "llnotificationsutil.h"
+#include "llpanel.h"
+#include "llpathfindingmanager.h"
+#include "llpathfindingnavmesh.h"
+#include "llpathfindingnavmeshstatus.h"
+#include "lltoolbar.h"
+#include "lltoolbarview.h"
+#include "lltooltip.h"
+#include "llviewerregion.h"
+
+LLPanelPathfindingRebakeNavmesh* LLPanelPathfindingRebakeNavmesh::getInstance()
+{
+	static LLPanelPathfindingRebakeNavmesh* panel = getPanel();
+	return panel;
+}
+
+BOOL LLPanelPathfindingRebakeNavmesh::postBuild()
+{
+	//Rebake button
+	mNavMeshRebakeButton = findChild<LLButton>("navmesh_btn");
+	llassert(mNavMeshRebakeButton != NULL);
+	mNavMeshRebakeButton->setCommitCallback(boost::bind(&LLPanelPathfindingRebakeNavmesh::onNavMeshRebakeClick, this));
+	LLHints::registerHintTarget("navmesh_btn", mNavMeshRebakeButton->getHandle());
+	
+	//Sending rebake request
+	mNavMeshSendingButton = findChild<LLButton>("navmesh_btn_sending");
+	llassert(mNavMeshSendingButton != NULL);
+	LLHints::registerHintTarget("navmesh_btn_sending", mNavMeshSendingButton->getHandle());
+
+	//rebaking...
+	mNavMeshBakingButton = findChild<LLButton>("navmesh_btn_baking");
+	llassert(mNavMeshBakingButton != NULL);
+	LLHints::registerHintTarget("navmesh_btn_baking", mNavMeshBakingButton->getHandle());
+
+	setMode(kRebakeNavMesh_Default);
+
+	createNavMeshStatusListenerForCurrentRegion();
+
+	if ( !mRegionCrossingSlot.connected() )
+	{
+		mRegionCrossingSlot = LLEnvManagerNew::getInstance()->setRegionChangeCallback(boost::bind(&LLPanelPathfindingRebakeNavmesh::handleRegionBoundaryCrossed, this));
+	}
+
+	if (!mAgentStateSlot.connected())
+	{
+		mAgentStateSlot = LLPathfindingManager::getInstance()->registerAgentStateListener(boost::bind(&LLPanelPathfindingRebakeNavmesh::handleAgentState, this, _1));
+	}
+	LLPathfindingManager::getInstance()->requestGetAgentState();
+
+	return LLPanel::postBuild();
+}
+
+void LLPanelPathfindingRebakeNavmesh::draw()
+{
+	if (doDraw())
+	{
+		updatePosition();
+		LLPanel::draw();
+	}
+}
+
+BOOL LLPanelPathfindingRebakeNavmesh::handleToolTip( S32 x, S32 y, MASK mask )
+{
+	LLToolTipMgr::instance().unblockToolTips();
+
+	if (mNavMeshRebakeButton->getVisible())
+	{
+		LLToolTipMgr::instance().show(mNavMeshRebakeButton->getToolTip());
+	}
+	else if (mNavMeshSendingButton->getVisible())
+	{
+		LLToolTipMgr::instance().show(mNavMeshSendingButton->getToolTip());
+	}
+	else if (mNavMeshBakingButton->getVisible())
+	{
+		LLToolTipMgr::instance().show(mNavMeshBakingButton->getToolTip());
+	}
+
+	return LLPanel::handleToolTip(x, y, mask);
+}
+
+LLPanelPathfindingRebakeNavmesh::LLPanelPathfindingRebakeNavmesh() 
+	: LLPanel(),
+	mCanRebakeRegion(FALSE),
+	mRebakeNavMeshMode(kRebakeNavMesh_Default),
+	mNavMeshRebakeButton(NULL),
+	mNavMeshSendingButton(NULL),
+	mNavMeshBakingButton(NULL),
+	mNavMeshSlot(),
+	mRegionCrossingSlot(),
+	mAgentStateSlot()
+{
+	// make sure we have the only instance of this class
+	static bool b = true;
+	llassert_always(b);
+	b=false;
+}
+
+LLPanelPathfindingRebakeNavmesh::~LLPanelPathfindingRebakeNavmesh() 
+{
+}
+
+LLPanelPathfindingRebakeNavmesh* LLPanelPathfindingRebakeNavmesh::getPanel()
+{
+	LLPanelPathfindingRebakeNavmesh* panel = new LLPanelPathfindingRebakeNavmesh();
+	panel->buildFromFile("panel_navmesh_rebake.xml");
+	return panel;
+}
+
+void LLPanelPathfindingRebakeNavmesh::setMode(ERebakeNavMeshMode pRebakeNavMeshMode)
+{
+	if (pRebakeNavMeshMode == kRebakeNavMesh_Available)
+	{
+		LLNotificationsUtil::add("PathfindingRebakeNavmesh");
+	}
+	mNavMeshRebakeButton->setVisible(pRebakeNavMeshMode == kRebakeNavMesh_Available);
+	mNavMeshSendingButton->setVisible(pRebakeNavMeshMode == kRebakeNavMesh_RequestSent);
+	mNavMeshBakingButton->setVisible(pRebakeNavMeshMode == kRebakeNavMesh_InProgress);
+	mRebakeNavMeshMode = pRebakeNavMeshMode;
+}
+
+LLPanelPathfindingRebakeNavmesh::ERebakeNavMeshMode LLPanelPathfindingRebakeNavmesh::getMode() const
+{
+	return mRebakeNavMeshMode;
+}
+
+void LLPanelPathfindingRebakeNavmesh::onNavMeshRebakeClick()
+{
+	setMode(kRebakeNavMesh_RequestSent);
+	LLPathfindingManager::getInstance()->requestRebakeNavMesh(boost::bind(&LLPanelPathfindingRebakeNavmesh::handleRebakeNavMeshResponse, this, _1));
+}
+
+void LLPanelPathfindingRebakeNavmesh::handleAgentState(BOOL pCanRebakeRegion)
+{
+	mCanRebakeRegion = pCanRebakeRegion;
+}
+
+void LLPanelPathfindingRebakeNavmesh::handleRebakeNavMeshResponse(bool pResponseStatus)
+{
+	if (getMode() == kRebakeNavMesh_RequestSent)
+	{
+		setMode(pResponseStatus ? kRebakeNavMesh_InProgress : kRebakeNavMesh_Default);
+	}
+
+	if (!pResponseStatus)
+	{
+		LLNotificationsUtil::add("PathfindingCannotRebakeNavmesh");
+	}
+}
+
+void LLPanelPathfindingRebakeNavmesh::handleNavMeshStatus(const LLPathfindingNavMeshStatus &pNavMeshStatus)
+{
+	ERebakeNavMeshMode rebakeNavMeshMode = kRebakeNavMesh_Default;
+	if (pNavMeshStatus.isValid())
+	{
+		switch (pNavMeshStatus.getStatus())
+		{
+		case LLPathfindingNavMeshStatus::kPending :
+		case LLPathfindingNavMeshStatus::kRepending :
+			rebakeNavMeshMode = kRebakeNavMesh_Available;
+			break;
+		case LLPathfindingNavMeshStatus::kBuilding :
+			rebakeNavMeshMode = kRebakeNavMesh_InProgress;
+			break;
+		case LLPathfindingNavMeshStatus::kComplete :
+			rebakeNavMeshMode = kRebakeNavMesh_NotAvailable;
+			break;
+		default : 
+			rebakeNavMeshMode = kRebakeNavMesh_Default;
+			llassert(0);
+			break;
+		}
+	}
+
+	setMode(rebakeNavMeshMode);
+}
+
+void LLPanelPathfindingRebakeNavmesh::handleRegionBoundaryCrossed()
+{
+	createNavMeshStatusListenerForCurrentRegion();
+	mCanRebakeRegion = FALSE;
+	LLPathfindingManager::getInstance()->requestGetAgentState();
+}
+
+void LLPanelPathfindingRebakeNavmesh::createNavMeshStatusListenerForCurrentRegion()
+{
+	if (mNavMeshSlot.connected())
+	{
+		mNavMeshSlot.disconnect();
+	}
+
+	LLViewerRegion *currentRegion = gAgent.getRegion();
+	if (currentRegion != NULL)
+	{
+		mNavMeshSlot = LLPathfindingManager::getInstance()->registerNavMeshListenerForRegion(currentRegion, boost::bind(&LLPanelPathfindingRebakeNavmesh::handleNavMeshStatus, this, _2));
+		LLPathfindingManager::getInstance()->requestGetNavMeshForRegion(currentRegion, true);
+	}
+}
+
+bool LLPanelPathfindingRebakeNavmesh::doDraw() const
+{
+	return (mCanRebakeRegion && (mRebakeNavMeshMode != kRebakeNavMesh_NotAvailable));
+}
+
+void LLPanelPathfindingRebakeNavmesh::updatePosition()
+{
+	S32 y_pos = 0;
+	S32 bottom_tb_center = 0;
+
+	if (LLToolBar* toolbar_bottom = gToolBarView->getChild<LLToolBar>("toolbar_bottom"))
+	{
+		y_pos = toolbar_bottom->getRect().getHeight();
+		bottom_tb_center = toolbar_bottom->getRect().getCenterX();
+	}
+
+	S32 left_tb_width = 0;
+	if (LLToolBar* toolbar_left = gToolBarView->getChild<LLToolBar>("toolbar_left"))
+	{
+		left_tb_width = toolbar_left->getRect().getWidth();
+	}
+
+	if(LLPanel* panel_ssf_container = getRootView()->getChild<LLPanel>("state_management_buttons_container"))
+	{
+		panel_ssf_container->setOrigin(0, y_pos);
+	}
+
+	S32 x_pos = bottom_tb_center-getRect().getWidth()/2 - left_tb_width + 113 /* width of stand/fly button */ + 10 /* margin */;
+
+	setOrigin( x_pos, 0);
+}
diff --git a/indra/newview/llpanelpathfindingrebakenavmesh.h b/indra/newview/llpanelpathfindingrebakenavmesh.h
new file mode 100644
index 0000000000000000000000000000000000000000..48764f2aa7764453e6f3bc35167262eda4fb4ba5
--- /dev/null
+++ b/indra/newview/llpanelpathfindingrebakenavmesh.h
@@ -0,0 +1,96 @@
+/** 
+* @file   llpanelpathfindingrebakenavmesh.h
+* @brief  Header file for llpanelpathfindingrebakenavmesh
+* @author Prep@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+* $/LicenseInfo$
+*/
+#ifndef LL_LLPANELPATHFINDINGREBAKENAVMESH_H
+#define LL_LLPANELPATHFINDINGREBAKENAVMESH_H
+
+#include <boost/signals2.hpp>
+
+#include "llpanel.h"
+#include "llpathfindingmanager.h"
+#include "llpathfindingnavmesh.h"
+
+class LLButton;
+class LLPathfindingNavMeshStatus;
+
+class LLPanelPathfindingRebakeNavmesh : public LLPanel
+{
+
+	LOG_CLASS(LLPanelPathfindingRebakeNavmesh);
+
+public:
+	static LLPanelPathfindingRebakeNavmesh* getInstance();
+
+	virtual BOOL postBuild();
+
+	virtual void draw();
+	virtual BOOL handleToolTip( S32 x, S32 y, MASK mask );
+
+protected:
+
+private:
+	typedef enum
+	{
+		kRebakeNavMesh_Available,
+		kRebakeNavMesh_RequestSent,
+		kRebakeNavMesh_InProgress,
+		kRebakeNavMesh_NotAvailable,
+		kRebakeNavMesh_Default = kRebakeNavMesh_NotAvailable
+	} ERebakeNavMeshMode;
+
+	LLPanelPathfindingRebakeNavmesh();
+	virtual ~LLPanelPathfindingRebakeNavmesh();
+
+	static LLPanelPathfindingRebakeNavmesh* getPanel();
+
+	void               setMode(ERebakeNavMeshMode pRebakeNavMeshMode);
+	ERebakeNavMeshMode getMode() const;
+	
+	void onNavMeshRebakeClick();
+
+	void handleAgentState(BOOL pCanRebakeRegion);
+	void handleRebakeNavMeshResponse(bool pResponseStatus);
+	void handleNavMeshStatus(const LLPathfindingNavMeshStatus &pNavMeshStatus);
+	void handleRegionBoundaryCrossed();
+
+	void createNavMeshStatusListenerForCurrentRegion();
+
+	bool doDraw() const;
+	void updatePosition();
+
+	BOOL                                     mCanRebakeRegion;
+	ERebakeNavMeshMode                       mRebakeNavMeshMode;
+	
+	LLButton*                                mNavMeshRebakeButton;
+	LLButton*                                mNavMeshSendingButton;
+	LLButton*                                mNavMeshBakingButton;
+
+	LLPathfindingNavMesh::navmesh_slot_t     mNavMeshSlot;
+	boost::signals2::connection              mRegionCrossingSlot;
+	LLPathfindingManager::agent_state_slot_t mAgentStateSlot;
+};
+
+#endif // LL_LLPANELPATHFINDINGREBAKENAVMESH_H
diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp
index 59130236f262162a1a485b0afd9349176bab66d3..51ab7649a48f07e0f5a70b583fc5ec27f9dddcc9 100644
--- a/indra/newview/llpanelpermissions.cpp
+++ b/indra/newview/llpanelpermissions.cpp
@@ -62,6 +62,7 @@
 #include "llspinctrl.h"
 #include "roles_constants.h"
 #include "llgroupactions.h"
+#include "lltrans.h"
 
 
 U8 string_value_to_click_action(std::string p_value);
@@ -180,6 +181,9 @@ void LLPanelPermissions::disableAll()
 	getChildView("perm_modify")->setEnabled(FALSE);
 	getChild<LLUICtrl>("perm_modify")->setValue(LLStringUtil::null);
 
+	getChildView("pathfinding_attributes_value")->setEnabled(FALSE);
+	getChild<LLUICtrl>("pathfinding_attributes_value")->setValue(LLStringUtil::null);
+
 	getChildView("Creator:")->setEnabled(FALSE);
 	getChild<LLUICtrl>("Creator Name")->setValue(LLStringUtil::null);
 	getChildView("Creator Name")->setEnabled(FALSE);
@@ -299,6 +303,9 @@ void LLPanelPermissions::refresh()
 	BOOL is_perm_modify = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() 
 						   && LLSelectMgr::getInstance()->selectGetRootsModify())
 		|| LLSelectMgr::getInstance()->selectGetModify();
+	BOOL is_nonpermanent_enforced = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() 
+						   && LLSelectMgr::getInstance()->selectGetRootsNonPermanentEnforced())
+		|| LLSelectMgr::getInstance()->selectGetNonPermanentEnforced();
 	const LLFocusableElement* keyboard_focus_view = gFocusMgr.getKeyboardFocus();
 
 	S32 string_index = 0;
@@ -307,12 +314,18 @@ void LLPanelPermissions::refresh()
 			getString("text modify info 1"),
 			getString("text modify info 2"),
 			getString("text modify info 3"),
-			getString("text modify info 4")
+			getString("text modify info 4"),
+			getString("text modify info 5"),
+			getString("text modify info 6")
 		};
 	if (!is_perm_modify)
 	{
 		string_index += 2;
 	}
+	else if (!is_nonpermanent_enforced)
+	{
+		string_index += 4;
+	}
 	if (!is_one_object)
 	{
 		++string_index;
@@ -320,6 +333,34 @@ void LLPanelPermissions::refresh()
 	getChildView("perm_modify")->setEnabled(TRUE);
 	getChild<LLUICtrl>("perm_modify")->setValue(MODIFY_INFO_STRINGS[string_index]);
 
+	std::string pfAttrName;
+
+	if ((LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() 
+		&& LLSelectMgr::getInstance()->selectGetRootsNonPathfinding())
+		|| LLSelectMgr::getInstance()->selectGetNonPathfinding())
+	{
+		pfAttrName = "Pathfinding_Object_Attr_None";
+	}
+	else if ((LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() 
+		&& LLSelectMgr::getInstance()->selectGetRootsPermanent())
+		|| LLSelectMgr::getInstance()->selectGetPermanent())
+	{
+		pfAttrName = "Pathfinding_Object_Attr_Permanent";
+	}
+	else if ((LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() 
+		&& LLSelectMgr::getInstance()->selectGetRootsCharacter())
+		|| LLSelectMgr::getInstance()->selectGetCharacter())
+	{
+		pfAttrName = "Pathfinding_Object_Attr_Character";
+	}
+	else
+	{
+		pfAttrName = "Pathfinding_Object_Attr_MultiSelect";
+	}
+
+	getChildView("pathfinding_attributes_value")->setEnabled(TRUE);
+	getChild<LLUICtrl>("pathfinding_attributes_value")->setValue(LLTrans::getString(pfAttrName));
+
 	getChildView("Permissions:")->setEnabled(TRUE);
 	
 	// Update creator text field
@@ -384,7 +425,7 @@ void LLPanelPermissions::refresh()
 		}
 	}
 	
-	getChildView("button set group")->setEnabled(owners_identical && (mOwnerID == gAgent.getID()));
+	getChildView("button set group")->setEnabled(owners_identical && (mOwnerID == gAgent.getID()) && is_nonpermanent_enforced);
 
 	getChildView("Name:")->setEnabled(TRUE);
 	LLLineEditor* LineEditorObjectName = getChild<LLLineEditor>("Object Name");
@@ -414,7 +455,7 @@ void LLPanelPermissions::refresh()
 
 	// figure out the contents of the name, description, & category
 	BOOL edit_name_desc = FALSE;
-	if (is_one_object && objectp->permModify())
+	if (is_one_object && objectp->permModify() && !objectp->isPermanentEnforced())
 	{
 		edit_name_desc = TRUE;
 	}
@@ -594,12 +635,12 @@ void LLPanelPermissions::refresh()
 	BOOL has_change_perm_ability = FALSE;
 	BOOL has_change_sale_ability = FALSE;
 
-	if (valid_base_perms &&
+	if (valid_base_perms && is_nonpermanent_enforced &&
 		(self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_MANIPULATE))))
 	{
 		has_change_perm_ability = TRUE;
 	}
-	if (valid_base_perms &&
+	if (valid_base_perms && is_nonpermanent_enforced &&
 	   (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_SET_SALE))))
 	{
 		has_change_sale_ability = TRUE;
@@ -812,8 +853,8 @@ void LLPanelPermissions::refresh()
 			combo_click_action->setValue(LLSD(combo_value));
 		}
 	}
-	getChildView("label click action")->setEnabled(is_perm_modify && all_volume);
-	getChildView("clickaction")->setEnabled(is_perm_modify && all_volume);
+	getChildView("label click action")->setEnabled(is_perm_modify && is_nonpermanent_enforced  && all_volume);
+	getChildView("clickaction")->setEnabled(is_perm_modify && is_nonpermanent_enforced && all_volume);
 }
 
 
diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp
index 12eea7844d6949f4ef1a8392e9e81af2b5469312..13b746dbabb3ccc24f6006e97f1971819e4eafeb 100644
--- a/indra/newview/llpanelvolume.cpp
+++ b/indra/newview/llpanelvolume.cpp
@@ -68,6 +68,7 @@
 #include "llworld.h"
 #include "pipeline.h"
 #include "llviewershadermgr.h"
+#include "llnotificationsutil.h"
 
 #include "lldrawpool.h"
 #include "lluictrlfactory.h"
@@ -77,13 +78,15 @@
 #include "llviewercontrol.h"
 #include "llmeshrepository.h"
 
+#include <boost/bind.hpp>
+
 // "Features" Tab
 
 BOOL	LLPanelVolume::postBuild()
 {
 	// Flexible Objects Parameters
 	{
-		childSetCommitCallback("Flexible1D Checkbox Ctrl",onCommitIsFlexible,this);
+		childSetCommitCallback("Flexible1D Checkbox Ctrl", boost::bind(&LLPanelVolume::onCommitIsFlexible, this, _1, _2), NULL);
 		childSetCommitCallback("FlexNumSections",onCommitFlexible,this);
 		getChild<LLUICtrl>("FlexNumSections")->setValidateBeforeCommit(precommitValidate);
 		childSetCommitCallback("FlexGravity",onCommitFlexible,this);
@@ -255,7 +258,7 @@ void LLPanelVolume::getState( )
 	owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name);
 
 	// BUG? Check for all objects being editable?
-	BOOL editable = root_objectp->permModify();
+	BOOL editable = root_objectp->permModify() && !root_objectp->isPermanentEnforced();
 	BOOL single_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME )
 		&& LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1;
 
@@ -351,7 +354,7 @@ void LLPanelVolume::getState( )
 	getChild<LLUICtrl>("Flexible1D Checkbox Ctrl")->setValue(is_flexible);
 	if (is_flexible || (volobjp && volobjp->canBeFlexible()))
 	{
-		getChildView("Flexible1D Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp && !volobjp->isMesh());
+		getChildView("Flexible1D Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp && !volobjp->isMesh() && !objectp->isPermanentEnforced());
 	}
 	else
 	{
@@ -495,7 +498,7 @@ void LLPanelVolume::getState( )
 
 	mComboPhysicsShapeType->add(getString("Convex Hull"), LLSD(2));	
 	mComboPhysicsShapeType->setValue(LLSD(objectp->getPhysicsShapeType()));
-	mComboPhysicsShapeType->setEnabled(editable);
+	mComboPhysicsShapeType->setEnabled(editable && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()));
 
 	mObject = objectp;
 	mRootObject = root_objectp;
@@ -873,10 +876,26 @@ void LLPanelVolume::onCommitFlexible( LLUICtrl* ctrl, void* userdata )
 	self->refresh();
 }
 
-// static
-void LLPanelVolume::onCommitIsFlexible( LLUICtrl* ctrl, void* userdata )
+void LLPanelVolume::onCommitIsFlexible(LLUICtrl *, void*)
 {
-	LLPanelVolume* self = (LLPanelVolume*) userdata;
-	self->sendIsFlexible();
+	if (mObject->flagObjectPermanent())
+	{
+		LLNotificationsUtil::add("PathfindingLinksets_ChangeToFlexiblePath", LLSD(), LLSD(), boost::bind(&LLPanelVolume::handleResponseChangeToFlexible, this, _1, _2));
+	}
+	else
+	{
+		sendIsFlexible();
+	}
 }
 
+void LLPanelVolume::handleResponseChangeToFlexible(const LLSD &pNotification, const LLSD &pResponse)
+{
+	if (LLNotificationsUtil::getSelectedOption(pNotification, pResponse) == 0)
+	{
+		sendIsFlexible();
+	}
+	else
+	{
+		getChild<LLUICtrl>("Flexible1D Checkbox Ctrl")->setValue(FALSE);
+	}
+}
diff --git a/indra/newview/llpanelvolume.h b/indra/newview/llpanelvolume.h
index 0ef47db0d9effe6e958f11dd47acf0d977c48780..deb6b6f2a6c76906bba703bc4d27078973c8bd8c 100644
--- a/indra/newview/llpanelvolume.h
+++ b/indra/newview/llpanelvolume.h
@@ -61,7 +61,7 @@ class LLPanelVolume : public LLPanel
 	
 	static void 	onCommitIsLight(		LLUICtrl* ctrl, void* userdata);
 	static void 	onCommitLight(			LLUICtrl* ctrl, void* userdata);
-	static void 	onCommitIsFlexible(		LLUICtrl* ctrl, void* userdata);
+	void 			onCommitIsFlexible(		LLUICtrl* ctrl, void* userdata);
 	static void 	onCommitFlexible(		LLUICtrl* ctrl, void* userdata);
 	static void     onCommitPhysicsParam(       LLUICtrl* ctrl, void* userdata);
 	static void 	onCommitMaterial(		LLUICtrl* ctrl, void* userdata);
@@ -84,6 +84,8 @@ class LLPanelVolume : public LLPanel
 	void            sendPhysicsRestitution(LLUICtrl* ctrl, void* userdata);
 	void            sendPhysicsDensity(LLUICtrl* ctrl, void* userdata);
 
+	void            handleResponseChangeToFlexible(const LLSD &pNotification, const LLSD &pResponse);
+
 /*
 	LLTextBox*		mLabelSelectSingleMessage;
 	// Light
diff --git a/indra/newview/llpathfindingcharacter.cpp b/indra/newview/llpathfindingcharacter.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..00f2ebc4bbe2bea72e9b2a7ba57a0ce9a61f7545
--- /dev/null
+++ b/indra/newview/llpathfindingcharacter.cpp
@@ -0,0 +1,99 @@
+/** 
+* @file llpathfindingcharacter.cpp
+* @brief Definition of a pathfinding character that contains various properties required for havok pathfinding.
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, 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 "llpathfindingcharacter.h"
+
+#include <string>
+
+#include "llpathfindingobject.h"
+#include "llsd.h"
+
+#define CHARACTER_CPU_TIME_FIELD   "cpu_time"
+#define CHARACTER_HORIZONTAL_FIELD "horizontal"
+#define CHARACTER_LENGTH_FIELD     "length"
+#define CHARACTER_RADIUS_FIELD     "radius"
+
+//---------------------------------------------------------------------------
+// LLPathfindingCharacter
+//---------------------------------------------------------------------------
+
+LLPathfindingCharacter::LLPathfindingCharacter(const std::string &pUUID, const LLSD& pCharacterData)
+	: LLPathfindingObject(pUUID, pCharacterData),
+	mCPUTime(0U),
+	mIsHorizontal(FALSE),
+	mLength(0.0f),
+	mRadius(0.0f)
+{
+	parseCharacterData(pCharacterData);
+}
+
+LLPathfindingCharacter::LLPathfindingCharacter(const LLPathfindingCharacter& pOther)
+	: LLPathfindingObject(pOther),
+	mCPUTime(pOther.mCPUTime),
+	mIsHorizontal(pOther.mIsHorizontal),
+	mLength(pOther.mLength),
+	mRadius(pOther.mRadius)
+{
+}
+
+LLPathfindingCharacter::~LLPathfindingCharacter()
+{
+}
+
+LLPathfindingCharacter& LLPathfindingCharacter::operator =(const LLPathfindingCharacter& pOther)
+{
+	dynamic_cast<LLPathfindingObject &>(*this) = pOther;
+
+	mCPUTime = pOther.mCPUTime;
+	mIsHorizontal = pOther.mIsHorizontal;
+	mLength = pOther.mLength;
+	mRadius = pOther.mRadius;
+
+	return *this;
+}
+
+void LLPathfindingCharacter::parseCharacterData(const LLSD &pCharacterData)
+{
+	llassert(pCharacterData.has(CHARACTER_CPU_TIME_FIELD));
+	llassert(pCharacterData.get(CHARACTER_CPU_TIME_FIELD).isReal());
+	mCPUTime = pCharacterData.get(CHARACTER_CPU_TIME_FIELD).asReal();
+
+	llassert(pCharacterData.has(CHARACTER_HORIZONTAL_FIELD));
+	llassert(pCharacterData.get(CHARACTER_HORIZONTAL_FIELD).isBoolean());
+	mIsHorizontal = pCharacterData.get(CHARACTER_HORIZONTAL_FIELD).asBoolean();
+
+	llassert(pCharacterData.has(CHARACTER_LENGTH_FIELD));
+	llassert(pCharacterData.get(CHARACTER_LENGTH_FIELD).isReal());
+	mLength = pCharacterData.get(CHARACTER_LENGTH_FIELD).asReal();
+
+	llassert(pCharacterData.has(CHARACTER_RADIUS_FIELD));
+	llassert(pCharacterData.get(CHARACTER_RADIUS_FIELD).isReal());
+	mRadius = pCharacterData.get(CHARACTER_RADIUS_FIELD).asReal();
+}
diff --git a/indra/newview/llpathfindingcharacter.h b/indra/newview/llpathfindingcharacter.h
new file mode 100644
index 0000000000000000000000000000000000000000..7cf9f401b023bc2d8dbbbbd8d70dc1763a19d2e0
--- /dev/null
+++ b/indra/newview/llpathfindingcharacter.h
@@ -0,0 +1,63 @@
+/** 
+* @file   llpathfindingcharacter.h
+* @brief  Definition of a pathfinding character that contains various properties required for havok pathfinding.
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+* $/LicenseInfo$
+*/
+#ifndef LL_LLPATHFINDINGCHARACTER_H
+#define LL_LLPATHFINDINGCHARACTER_H
+
+#include <string>
+
+#include "llpathfindingobject.h"
+
+class LLSD;
+
+class LLPathfindingCharacter : public LLPathfindingObject
+{
+public:
+	LLPathfindingCharacter(const std::string &pUUID, const LLSD &pCharacterData);
+	LLPathfindingCharacter(const LLPathfindingCharacter& pOther);
+	virtual ~LLPathfindingCharacter();
+
+	LLPathfindingCharacter& operator =(const LLPathfindingCharacter& pOther);
+
+	inline F32  getCPUTime() const   {return mCPUTime;};
+
+	inline BOOL isHorizontal() const {return mIsHorizontal;};
+	inline F32  getLength() const    {return mLength;};
+	inline F32  getRadius() const    {return mRadius;};
+
+protected:
+
+private:
+	void parseCharacterData(const LLSD &pCharacterData);
+
+	F32  mCPUTime;
+
+	BOOL mIsHorizontal;
+	F32  mLength;
+	F32  mRadius;
+};
+
+#endif // LL_LLPATHFINDINGCHARACTER_H
diff --git a/indra/newview/llpathfindingcharacterlist.cpp b/indra/newview/llpathfindingcharacterlist.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..12340cebfa18170bc638954cd787ddb017866753
--- /dev/null
+++ b/indra/newview/llpathfindingcharacterlist.cpp
@@ -0,0 +1,69 @@
+/** 
+* @file llpathfindingcharacterlist.cpp
+* @brief Implementation of llpathfindingcharacterlist
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, 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 "llpathfindingcharacterlist.h"
+
+#include "llpathfindingcharacter.h"
+#include "llpathfindingobject.h"
+#include "llpathfindingobjectlist.h"
+#include "llsd.h"
+
+//---------------------------------------------------------------------------
+// LLPathfindingCharacterList
+//---------------------------------------------------------------------------
+
+LLPathfindingCharacterList::LLPathfindingCharacterList()
+	: LLPathfindingObjectList()
+{
+}
+
+LLPathfindingCharacterList::LLPathfindingCharacterList(const LLSD& pCharacterListData)
+	: LLPathfindingObjectList()
+{
+	parseCharacterListData(pCharacterListData);
+}
+
+LLPathfindingCharacterList::~LLPathfindingCharacterList()
+{
+}
+
+void LLPathfindingCharacterList::parseCharacterListData(const LLSD& pCharacterListData)
+{
+	LLPathfindingObjectMap &objectMap = getObjectMap();
+
+	for (LLSD::map_const_iterator characterDataIter = pCharacterListData.beginMap();
+		characterDataIter != pCharacterListData.endMap(); ++characterDataIter)
+	{
+		const std::string& uuid(characterDataIter->first);
+		const LLSD& characterData = characterDataIter->second;
+		LLPathfindingObjectPtr character(new LLPathfindingCharacter(uuid, characterData));
+		objectMap.insert(std::pair<std::string, LLPathfindingObjectPtr>(uuid, character));
+	}
+}
diff --git a/indra/newview/llpathfindingcharacterlist.h b/indra/newview/llpathfindingcharacterlist.h
new file mode 100644
index 0000000000000000000000000000000000000000..4ecf70001d3bdd4d04c4f7e1ad13be2f972637b6
--- /dev/null
+++ b/indra/newview/llpathfindingcharacterlist.h
@@ -0,0 +1,47 @@
+/** 
+* @file   llpathfindingcharacterlist.h
+* @brief  Header file for llpathfindingcharacterlist
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+* $/LicenseInfo$
+*/
+#ifndef LL_LLPATHFINDINGCHARACTERLIST_H
+#define LL_LLPATHFINDINGCHARACTERLIST_H
+
+#include "llpathfindingobjectlist.h"
+
+class LLSD;
+
+class LLPathfindingCharacterList : public LLPathfindingObjectList
+{
+public:
+	LLPathfindingCharacterList();
+	LLPathfindingCharacterList(const LLSD& pCharacterListData);
+	virtual ~LLPathfindingCharacterList();
+
+protected:
+
+private:
+	void parseCharacterListData(const LLSD& pCharacterListData);
+};
+
+#endif // LL_LLPATHFINDINGCHARACTERLIST_H
diff --git a/indra/newview/llpathfindinglinkset.cpp b/indra/newview/llpathfindinglinkset.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..fe4daabd89dbb9e85d84c84abfc5ae966d5904a7
--- /dev/null
+++ b/indra/newview/llpathfindinglinkset.cpp
@@ -0,0 +1,387 @@
+/** 
+* @file llpathfindinglinkset.cpp
+* @brief Definition of a pathfinding linkset that contains various properties required for havok pathfinding.
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, 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 "llpathfindinglinkset.h"
+
+#include <string>
+
+#include "llpathfindingobject.h"
+#include "llsd.h"
+
+#define LINKSET_LAND_IMPACT_FIELD   "landimpact"
+#define LINKSET_MODIFIABLE_FIELD    "modifiable"
+#define LINKSET_CATEGORY_FIELD      "navmesh_category"
+#define LINKSET_CAN_BE_VOLUME       "can_be_volume"
+#define LINKSET_PHANTOM_FIELD       "phantom"
+#define LINKSET_WALKABILITY_A_FIELD "A"
+#define LINKSET_WALKABILITY_B_FIELD "B"
+#define LINKSET_WALKABILITY_C_FIELD "C"
+#define LINKSET_WALKABILITY_D_FIELD "D"
+
+#define LINKSET_CATEGORY_VALUE_INCLUDE 0
+#define LINKSET_CATEGORY_VALUE_EXCLUDE 1
+#define LINKSET_CATEGORY_VALUE_IGNORE  2
+
+//---------------------------------------------------------------------------
+// LLPathfindingLinkset
+//---------------------------------------------------------------------------
+
+const S32 LLPathfindingLinkset::MIN_WALKABILITY_VALUE(0);
+const S32 LLPathfindingLinkset::MAX_WALKABILITY_VALUE(100);
+
+LLPathfindingLinkset::LLPathfindingLinkset(const LLSD& pTerrainData)
+	: LLPathfindingObject(),
+	mIsTerrain(true),
+	mLandImpact(0U),
+	mIsModifiable(FALSE),
+	mCanBeVolume(FALSE),
+	mLinksetUse(kUnknown),
+	mWalkabilityCoefficientA(MIN_WALKABILITY_VALUE),
+	mWalkabilityCoefficientB(MIN_WALKABILITY_VALUE),
+	mWalkabilityCoefficientC(MIN_WALKABILITY_VALUE),
+	mWalkabilityCoefficientD(MIN_WALKABILITY_VALUE)
+{
+	parsePathfindingData(pTerrainData);
+}
+
+LLPathfindingLinkset::LLPathfindingLinkset(const std::string &pUUID, const LLSD& pLinksetData)
+	: LLPathfindingObject(pUUID, pLinksetData),
+	mIsTerrain(false),
+	mLandImpact(0U),
+	mIsModifiable(TRUE),
+	mCanBeVolume(TRUE),
+	mLinksetUse(kUnknown),
+	mWalkabilityCoefficientA(MIN_WALKABILITY_VALUE),
+	mWalkabilityCoefficientB(MIN_WALKABILITY_VALUE),
+	mWalkabilityCoefficientC(MIN_WALKABILITY_VALUE),
+	mWalkabilityCoefficientD(MIN_WALKABILITY_VALUE)
+{
+	parseLinksetData(pLinksetData);
+	parsePathfindingData(pLinksetData);
+}
+
+LLPathfindingLinkset::LLPathfindingLinkset(const LLPathfindingLinkset& pOther)
+	: LLPathfindingObject(pOther),
+	mIsTerrain(pOther.mIsTerrain),
+	mLandImpact(pOther.mLandImpact),
+	mIsModifiable(pOther.mIsModifiable),
+	mCanBeVolume(pOther.mCanBeVolume),
+	mLinksetUse(pOther.mLinksetUse),
+	mWalkabilityCoefficientA(pOther.mWalkabilityCoefficientA),
+	mWalkabilityCoefficientB(pOther.mWalkabilityCoefficientB),
+	mWalkabilityCoefficientC(pOther.mWalkabilityCoefficientC),
+	mWalkabilityCoefficientD(pOther.mWalkabilityCoefficientD)
+{
+}
+
+LLPathfindingLinkset::~LLPathfindingLinkset()
+{
+}
+
+LLPathfindingLinkset& LLPathfindingLinkset::operator =(const LLPathfindingLinkset& pOther)
+{
+	dynamic_cast<LLPathfindingObject &>(*this) = pOther;
+
+	mIsTerrain = pOther.mIsTerrain;
+	mLandImpact = pOther.mLandImpact;
+	mIsModifiable = pOther.mIsModifiable;
+	mCanBeVolume = pOther.mCanBeVolume;
+	mLinksetUse = pOther.mLinksetUse;
+	mWalkabilityCoefficientA = pOther.mWalkabilityCoefficientA;
+	mWalkabilityCoefficientB = pOther.mWalkabilityCoefficientB;
+	mWalkabilityCoefficientC = pOther.mWalkabilityCoefficientC;
+	mWalkabilityCoefficientD = pOther.mWalkabilityCoefficientD;
+
+	return *this;
+}
+
+BOOL LLPathfindingLinkset::isPhantom() const
+{
+	return isPhantom(getLinksetUse());
+}
+
+LLPathfindingLinkset::ELinksetUse LLPathfindingLinkset::getLinksetUseWithToggledPhantom(ELinksetUse pLinksetUse)
+{
+	BOOL isPhantom = LLPathfindingLinkset::isPhantom(pLinksetUse);
+	ENavMeshGenerationCategory navMeshGenerationCategory = getNavMeshGenerationCategory(pLinksetUse);
+
+	return getLinksetUse(!isPhantom, navMeshGenerationCategory);
+}
+
+bool LLPathfindingLinkset::isShowUnmodifiablePhantomWarning(ELinksetUse pLinksetUse) const
+{
+	return (!isModifiable() && (isPhantom() != isPhantom(pLinksetUse)));
+}
+
+bool LLPathfindingLinkset::isShowCannotBeVolumeWarning(ELinksetUse pLinksetUse) const
+{
+	return (!canBeVolume() && ((pLinksetUse == kMaterialVolume) || (pLinksetUse == kExclusionVolume)));
+}
+
+LLSD LLPathfindingLinkset::encodeAlteredFields(ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD) const
+{
+	LLSD itemData;
+
+	if (!isTerrain() && (pLinksetUse != kUnknown) && (getLinksetUse() != pLinksetUse) &&
+		(canBeVolume() || ((pLinksetUse != kMaterialVolume) && (pLinksetUse != kExclusionVolume))))
+	{
+		if (isModifiable())
+		{
+			itemData[LINKSET_PHANTOM_FIELD] = static_cast<bool>(isPhantom(pLinksetUse));
+		}
+
+		itemData[LINKSET_CATEGORY_FIELD] = convertCategoryToLLSD(getNavMeshGenerationCategory(pLinksetUse));
+	}
+
+	if (mWalkabilityCoefficientA != pA)
+	{
+		itemData[LINKSET_WALKABILITY_A_FIELD] = llclamp(pA, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE);
+	}
+
+	if (mWalkabilityCoefficientB != pB)
+	{
+		itemData[LINKSET_WALKABILITY_B_FIELD] = llclamp(pB, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE);
+	}
+
+	if (mWalkabilityCoefficientC != pC)
+	{
+		itemData[LINKSET_WALKABILITY_C_FIELD] = llclamp(pC, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE);
+	}
+
+	if (mWalkabilityCoefficientD != pD)
+	{
+		itemData[LINKSET_WALKABILITY_D_FIELD] = llclamp(pD, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE);
+	}
+
+	return itemData;
+}
+
+void LLPathfindingLinkset::parseLinksetData(const LLSD &pLinksetData)
+{
+	llassert(pLinksetData.has(LINKSET_LAND_IMPACT_FIELD));
+	llassert(pLinksetData.get(LINKSET_LAND_IMPACT_FIELD).isInteger());
+	llassert(pLinksetData.get(LINKSET_LAND_IMPACT_FIELD).asInteger() >= 0);
+	mLandImpact = pLinksetData.get(LINKSET_LAND_IMPACT_FIELD).asInteger();
+	
+	llassert(pLinksetData.has(LINKSET_MODIFIABLE_FIELD));
+	llassert(pLinksetData.get(LINKSET_MODIFIABLE_FIELD).isBoolean());
+	mIsModifiable = pLinksetData.get(LINKSET_MODIFIABLE_FIELD).asBoolean();
+}
+
+void LLPathfindingLinkset::parsePathfindingData(const LLSD &pLinksetData)
+{
+	bool isPhantom = false;
+	if (pLinksetData.has(LINKSET_PHANTOM_FIELD))
+	{
+		llassert(pLinksetData.get(LINKSET_PHANTOM_FIELD).isBoolean());
+		isPhantom = pLinksetData.get(LINKSET_PHANTOM_FIELD).asBoolean();
+	}
+	
+	llassert(pLinksetData.has(LINKSET_CATEGORY_FIELD));
+	mLinksetUse = getLinksetUse(isPhantom, convertCategoryFromLLSD(pLinksetData.get(LINKSET_CATEGORY_FIELD)));
+
+	if (pLinksetData.has(LINKSET_CAN_BE_VOLUME))
+	{
+		llassert(pLinksetData.get(LINKSET_CAN_BE_VOLUME).isBoolean());
+		mCanBeVolume = pLinksetData.get(LINKSET_CAN_BE_VOLUME).asBoolean();
+	}
+
+	llassert(pLinksetData.has(LINKSET_WALKABILITY_A_FIELD));
+	llassert(pLinksetData.get(LINKSET_WALKABILITY_A_FIELD).isInteger());
+	mWalkabilityCoefficientA = pLinksetData.get(LINKSET_WALKABILITY_A_FIELD).asInteger();
+	llassert(mWalkabilityCoefficientA >= MIN_WALKABILITY_VALUE);
+	llassert(mWalkabilityCoefficientA <= MAX_WALKABILITY_VALUE);
+	
+	llassert(pLinksetData.has(LINKSET_WALKABILITY_B_FIELD));
+	llassert(pLinksetData.get(LINKSET_WALKABILITY_B_FIELD).isInteger());
+	mWalkabilityCoefficientB = pLinksetData.get(LINKSET_WALKABILITY_B_FIELD).asInteger();
+	llassert(mWalkabilityCoefficientB >= MIN_WALKABILITY_VALUE);
+	llassert(mWalkabilityCoefficientB <= MAX_WALKABILITY_VALUE);
+	
+	llassert(pLinksetData.has(LINKSET_WALKABILITY_C_FIELD));
+	llassert(pLinksetData.get(LINKSET_WALKABILITY_C_FIELD).isInteger());
+	mWalkabilityCoefficientC = pLinksetData.get(LINKSET_WALKABILITY_C_FIELD).asInteger();
+	llassert(mWalkabilityCoefficientC >= MIN_WALKABILITY_VALUE);
+	llassert(mWalkabilityCoefficientC <= MAX_WALKABILITY_VALUE);
+	
+	llassert(pLinksetData.has(LINKSET_WALKABILITY_D_FIELD));
+	llassert(pLinksetData.get(LINKSET_WALKABILITY_D_FIELD).isInteger());
+	mWalkabilityCoefficientD = pLinksetData.get(LINKSET_WALKABILITY_D_FIELD).asInteger();
+	llassert(mWalkabilityCoefficientD >= MIN_WALKABILITY_VALUE);
+	llassert(mWalkabilityCoefficientD <= MAX_WALKABILITY_VALUE);
+}
+
+BOOL LLPathfindingLinkset::isPhantom(ELinksetUse pLinksetUse)
+{
+	BOOL retVal;
+
+	switch (pLinksetUse)
+	{
+	case kWalkable :
+	case kStaticObstacle :
+	case kDynamicObstacle :
+		retVal = false;
+		break;
+	case kMaterialVolume :
+	case kExclusionVolume :
+	case kDynamicPhantom :
+		retVal = true;
+		break;
+	case kUnknown :
+	default :
+		retVal = false;
+		llassert(0);
+		break;
+	}
+
+	return retVal;
+}
+
+LLPathfindingLinkset::ELinksetUse LLPathfindingLinkset::getLinksetUse(bool pIsPhantom, ENavMeshGenerationCategory pNavMeshGenerationCategory)
+{
+	ELinksetUse linksetUse = kUnknown;
+
+	if (pIsPhantom)
+	{
+		switch (pNavMeshGenerationCategory)
+		{
+		case kNavMeshGenerationIgnore :
+			linksetUse = kDynamicPhantom;
+			break;
+		case kNavMeshGenerationInclude :
+			linksetUse = kMaterialVolume;
+			break;
+		case kNavMeshGenerationExclude :
+			linksetUse = kExclusionVolume;
+			break;
+		default :
+			linksetUse = kUnknown;
+			llassert(0);
+			break;
+		}
+	}
+	else
+	{
+		switch (pNavMeshGenerationCategory)
+		{
+		case kNavMeshGenerationIgnore :
+			linksetUse = kDynamicObstacle;
+			break;
+		case kNavMeshGenerationInclude :
+			linksetUse = kWalkable;
+			break;
+		case kNavMeshGenerationExclude :
+			linksetUse = kStaticObstacle;
+			break;
+		default :
+			linksetUse = kUnknown;
+			llassert(0);
+			break;
+		}
+	}
+
+	return linksetUse;
+}
+
+LLPathfindingLinkset::ENavMeshGenerationCategory LLPathfindingLinkset::getNavMeshGenerationCategory(ELinksetUse pLinksetUse)
+{
+	ENavMeshGenerationCategory navMeshGenerationCategory;
+	switch (pLinksetUse)
+	{
+	case kWalkable :
+	case kMaterialVolume :
+		navMeshGenerationCategory = kNavMeshGenerationInclude;
+		break;
+	case kStaticObstacle :
+	case kExclusionVolume :
+		navMeshGenerationCategory = kNavMeshGenerationExclude;
+		break;
+	case kDynamicObstacle :
+	case kDynamicPhantom :
+		navMeshGenerationCategory = kNavMeshGenerationIgnore;
+		break;
+	case kUnknown :
+	default :
+		navMeshGenerationCategory = kNavMeshGenerationIgnore;
+		llassert(0);
+		break;
+	}
+
+	return navMeshGenerationCategory;
+}
+
+LLSD LLPathfindingLinkset::convertCategoryToLLSD(ENavMeshGenerationCategory pNavMeshGenerationCategory)
+{
+	LLSD llsd;
+
+	switch (pNavMeshGenerationCategory)
+	{
+		case kNavMeshGenerationIgnore :
+			llsd = static_cast<S32>(LINKSET_CATEGORY_VALUE_IGNORE);
+			break;
+		case kNavMeshGenerationInclude :
+			llsd = static_cast<S32>(LINKSET_CATEGORY_VALUE_INCLUDE);
+			break;
+		case kNavMeshGenerationExclude :
+			llsd = static_cast<S32>(LINKSET_CATEGORY_VALUE_EXCLUDE);
+			break;
+		default :
+			llsd = static_cast<S32>(LINKSET_CATEGORY_VALUE_IGNORE);
+			llassert(0);
+			break;
+	}
+
+	return llsd;
+}
+
+LLPathfindingLinkset::ENavMeshGenerationCategory LLPathfindingLinkset::convertCategoryFromLLSD(const LLSD &llsd)
+{
+	ENavMeshGenerationCategory navMeshGenerationCategory;
+
+	llassert(llsd.isInteger());
+	switch (llsd.asInteger())
+	{
+		case LINKSET_CATEGORY_VALUE_IGNORE :
+			navMeshGenerationCategory = kNavMeshGenerationIgnore;
+			break;
+		case LINKSET_CATEGORY_VALUE_INCLUDE :
+			navMeshGenerationCategory = kNavMeshGenerationInclude;
+			break;
+		case LINKSET_CATEGORY_VALUE_EXCLUDE :
+			navMeshGenerationCategory = kNavMeshGenerationExclude;
+			break;
+		default :
+			navMeshGenerationCategory = kNavMeshGenerationIgnore;
+			llassert(0);
+			break;
+	}
+
+	return navMeshGenerationCategory;
+}
diff --git a/indra/newview/llpathfindinglinkset.h b/indra/newview/llpathfindinglinkset.h
new file mode 100644
index 0000000000000000000000000000000000000000..73b4d6bad41f87c7d017e5926b5515cbc3a8e317
--- /dev/null
+++ b/indra/newview/llpathfindinglinkset.h
@@ -0,0 +1,108 @@
+/** 
+* @file   llpathfindinglinkset.h
+* @brief  Definition of a pathfinding linkset that contains various properties required for havok pathfinding.
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+* $/LicenseInfo$
+*/
+#ifndef LL_LLPATHFINDINGLINKSET_H
+#define LL_LLPATHFINDINGLINKSET_H
+
+#include <string>
+
+#include "llpathfindingobject.h"
+
+class LLSD;
+
+class LLPathfindingLinkset : public LLPathfindingObject
+{
+public:
+	typedef enum
+	{
+		kUnknown,
+		kWalkable,
+		kStaticObstacle,
+		kDynamicObstacle,
+		kMaterialVolume,
+		kExclusionVolume,
+		kDynamicPhantom
+	} ELinksetUse;
+
+	LLPathfindingLinkset(const LLSD &pTerrainData);
+	LLPathfindingLinkset(const std::string &pUUID, const LLSD &pLinksetData);
+	LLPathfindingLinkset(const LLPathfindingLinkset& pOther);
+	virtual ~LLPathfindingLinkset();
+
+	LLPathfindingLinkset& operator = (const LLPathfindingLinkset& pOther);
+
+	inline bool        isTerrain() const                   {return mIsTerrain;};
+	inline U32         getLandImpact() const               {return mLandImpact;};
+	BOOL               isModifiable() const                {return mIsModifiable;};
+	BOOL               isPhantom() const;
+	BOOL               canBeVolume() const                 {return mCanBeVolume;};
+	static ELinksetUse getLinksetUseWithToggledPhantom(ELinksetUse pLinksetUse);
+
+	inline ELinksetUse getLinksetUse() const               {return mLinksetUse;};
+
+	inline S32         getWalkabilityCoefficientA() const  {return mWalkabilityCoefficientA;};
+	inline S32         getWalkabilityCoefficientB() const  {return mWalkabilityCoefficientB;};
+	inline S32         getWalkabilityCoefficientC() const  {return mWalkabilityCoefficientC;};
+	inline S32         getWalkabilityCoefficientD() const  {return mWalkabilityCoefficientD;};
+
+	bool               isShowUnmodifiablePhantomWarning(ELinksetUse pLinksetUse) const;
+	bool               isShowCannotBeVolumeWarning(ELinksetUse pLinksetUse) const;
+	LLSD               encodeAlteredFields(ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD) const;
+
+	static const S32 MIN_WALKABILITY_VALUE;
+	static const S32 MAX_WALKABILITY_VALUE;
+	
+protected:
+
+private:
+	typedef enum
+	{
+		kNavMeshGenerationIgnore,
+		kNavMeshGenerationInclude,
+		kNavMeshGenerationExclude
+	} ENavMeshGenerationCategory;
+
+	void                              parseLinksetData(const LLSD &pLinksetData);
+	void                              parsePathfindingData(const LLSD &pLinksetData);
+
+	static BOOL                       isPhantom(ELinksetUse pLinksetUse);
+	static ELinksetUse                getLinksetUse(bool pIsPhantom, ENavMeshGenerationCategory pNavMeshGenerationCategory);
+	static ENavMeshGenerationCategory getNavMeshGenerationCategory(ELinksetUse pLinksetUse);
+	static LLSD                       convertCategoryToLLSD(ENavMeshGenerationCategory pNavMeshGenerationCategory);
+	static ENavMeshGenerationCategory convertCategoryFromLLSD(const LLSD &llsd);
+
+	bool         mIsTerrain;
+	U32          mLandImpact;
+	BOOL         mIsModifiable;
+	BOOL         mCanBeVolume;
+	ELinksetUse  mLinksetUse;
+	S32          mWalkabilityCoefficientA;
+	S32          mWalkabilityCoefficientB;
+	S32          mWalkabilityCoefficientC;
+	S32          mWalkabilityCoefficientD;
+};
+
+#endif // LL_LLPATHFINDINGLINKSET_H
diff --git a/indra/newview/llpathfindinglinksetlist.cpp b/indra/newview/llpathfindinglinksetlist.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..746fa342a110e0f447515ae5a25651fb1f20fd6e
--- /dev/null
+++ b/indra/newview/llpathfindinglinksetlist.cpp
@@ -0,0 +1,196 @@
+/** 
+* @file llpathfindinglinksetlist.cpp
+* @brief Implementation of llpathfindinglinksetlist
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, 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 "llpathfindinglinksetlist.h"
+
+#include <string>
+#include <map>
+
+#include "llpathfindinglinkset.h"
+#include "llpathfindingobject.h"
+#include "llpathfindingobjectlist.h"
+#include "llsd.h"
+
+//---------------------------------------------------------------------------
+// LLPathfindingLinksetList
+//---------------------------------------------------------------------------
+
+LLPathfindingLinksetList::LLPathfindingLinksetList()
+	: LLPathfindingObjectList()
+{
+}
+
+LLPathfindingLinksetList::LLPathfindingLinksetList(const LLSD& pLinksetListData)
+	: LLPathfindingObjectList()
+{
+	parseLinksetListData(pLinksetListData);
+}
+
+LLPathfindingLinksetList::~LLPathfindingLinksetList()
+{
+}
+
+LLSD LLPathfindingLinksetList::encodeObjectFields(LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD) const
+{
+	LLSD listData;
+
+	for (const_iterator linksetIter = begin(); linksetIter != end(); ++linksetIter)
+	{
+		const LLPathfindingObjectPtr objectPtr = linksetIter->second;
+		const LLPathfindingLinkset *linkset = dynamic_cast<const LLPathfindingLinkset *>(objectPtr.get());
+
+		if (!linkset->isTerrain())
+		{
+			LLSD linksetData = linkset->encodeAlteredFields(pLinksetUse, pA, pB, pC, pD);
+			if (!linksetData.isUndefined())
+			{
+				const std::string& uuid(linksetIter->first);
+				listData[uuid] = linksetData;
+			}
+		}
+	}
+
+	return listData;
+}
+
+LLSD LLPathfindingLinksetList::encodeTerrainFields(LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD) const
+{
+	LLSD terrainData;
+
+	for (const_iterator linksetIter = begin(); linksetIter != end(); ++linksetIter)
+	{
+		const LLPathfindingObjectPtr objectPtr = linksetIter->second;
+		const LLPathfindingLinkset *linkset = dynamic_cast<const LLPathfindingLinkset *>(objectPtr.get());
+
+		if (linkset->isTerrain())
+		{
+			terrainData = linkset->encodeAlteredFields(pLinksetUse, pA, pB, pC, pD);
+			break;
+		}
+	}
+	
+	return terrainData;
+}
+
+bool LLPathfindingLinksetList::isShowUnmodifiablePhantomWarning(LLPathfindingLinkset::ELinksetUse pLinksetUse) const
+{
+	bool isShowWarning = false;
+
+	for (const_iterator objectIter = begin(); !isShowWarning && (objectIter != end()); ++objectIter)
+	{
+		const LLPathfindingObjectPtr objectPtr = objectIter->second;
+		const LLPathfindingLinkset *linkset = dynamic_cast<const LLPathfindingLinkset *>(objectPtr.get());
+		isShowWarning = linkset->isShowUnmodifiablePhantomWarning(pLinksetUse);
+	}
+
+	return isShowWarning;
+}
+
+bool LLPathfindingLinksetList::isShowCannotBeVolumeWarning(LLPathfindingLinkset::ELinksetUse pLinksetUse) const
+{
+	bool isShowWarning = false;
+
+	for (const_iterator objectIter = begin(); !isShowWarning && (objectIter != end()); ++objectIter)
+	{
+		const LLPathfindingObjectPtr objectPtr = objectIter->second;
+		const LLPathfindingLinkset *linkset = dynamic_cast<const LLPathfindingLinkset *>(objectPtr.get());
+		isShowWarning = linkset->isShowCannotBeVolumeWarning(pLinksetUse);
+	}
+
+	return isShowWarning;
+}
+
+void LLPathfindingLinksetList::determinePossibleStates(BOOL &pCanBeWalkable, BOOL &pCanBeStaticObstacle, BOOL &pCanBeDynamicObstacle,
+	BOOL &pCanBeMaterialVolume, BOOL &pCanBeExclusionVolume, BOOL &pCanBeDynamicPhantom) const
+{
+	pCanBeWalkable = FALSE;
+	pCanBeStaticObstacle = FALSE;
+	pCanBeDynamicObstacle = FALSE;
+	pCanBeMaterialVolume = FALSE;
+	pCanBeExclusionVolume = FALSE;
+	pCanBeDynamicPhantom = FALSE;
+
+	for (const_iterator objectIter = begin();
+		!(pCanBeWalkable && pCanBeStaticObstacle && pCanBeDynamicObstacle && pCanBeMaterialVolume && pCanBeExclusionVolume && pCanBeDynamicPhantom) && (objectIter != end());
+		++objectIter)
+	{
+		const LLPathfindingObjectPtr objectPtr = objectIter->second;
+		const LLPathfindingLinkset *linkset = dynamic_cast<const LLPathfindingLinkset *>(objectPtr.get());
+
+		if (linkset->isTerrain())
+		{
+			pCanBeWalkable = TRUE;
+		}
+		else
+		{
+			if (linkset->isModifiable())
+			{
+				pCanBeWalkable = TRUE;
+				pCanBeStaticObstacle = TRUE;
+				pCanBeDynamicObstacle = TRUE;
+				pCanBeDynamicPhantom = TRUE;
+				if (linkset->canBeVolume())
+				{
+					pCanBeMaterialVolume = TRUE;
+					pCanBeExclusionVolume = TRUE;
+				}
+			}
+			else if (linkset->isPhantom())
+			{
+				pCanBeDynamicPhantom = TRUE;
+				if (linkset->canBeVolume())
+				{
+					pCanBeMaterialVolume = TRUE;
+					pCanBeExclusionVolume = TRUE;
+				}
+			}
+			else
+			{
+				pCanBeWalkable = TRUE;
+				pCanBeStaticObstacle = TRUE;
+				pCanBeDynamicObstacle = TRUE;
+			}
+		}
+	}
+}
+
+void LLPathfindingLinksetList::parseLinksetListData(const LLSD& pLinksetListData)
+{
+	LLPathfindingObjectMap &objectMap = getObjectMap();
+
+	for (LLSD::map_const_iterator linksetDataIter = pLinksetListData.beginMap();
+		linksetDataIter != pLinksetListData.endMap(); ++linksetDataIter)
+	{
+		const std::string& uuid(linksetDataIter->first);
+		const LLSD& linksetData = linksetDataIter->second;
+		LLPathfindingObjectPtr linksetPtr(new LLPathfindingLinkset(uuid, linksetData));
+		objectMap.insert(std::pair<std::string, LLPathfindingObjectPtr>(uuid, linksetPtr));
+	}
+}
diff --git a/indra/newview/llpathfindinglinksetlist.h b/indra/newview/llpathfindinglinksetlist.h
new file mode 100644
index 0000000000000000000000000000000000000000..77c63586401728baf80ed666d55ccdc7d6a0d786
--- /dev/null
+++ b/indra/newview/llpathfindinglinksetlist.h
@@ -0,0 +1,57 @@
+/** 
+* @file   llpathfindinglinksetlist.h
+* @brief  Header file for llpathfindinglinksetlist
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+* $/LicenseInfo$
+*/
+#ifndef LL_LLPATHFINDINGLINKSETLIST_H
+#define LL_LLPATHFINDINGLINKSETLIST_H
+
+#include "llpathfindinglinkset.h"
+#include "llpathfindingobjectlist.h"
+
+class LLSD;
+
+class LLPathfindingLinksetList : public LLPathfindingObjectList
+{
+public:
+	LLPathfindingLinksetList();
+	LLPathfindingLinksetList(const LLSD& pLinksetListData);
+	virtual ~LLPathfindingLinksetList();
+
+	LLSD encodeObjectFields(LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD) const;
+	LLSD encodeTerrainFields(LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD) const;
+
+	bool isShowUnmodifiablePhantomWarning(LLPathfindingLinkset::ELinksetUse pLinksetUse) const;
+	bool isShowCannotBeVolumeWarning(LLPathfindingLinkset::ELinksetUse pLinksetUse) const;
+
+	void determinePossibleStates(BOOL &pCanBeWalkable, BOOL &pCanBeStaticObstacle, BOOL &pCanBeDynamicObstacle,
+		BOOL &pCanBeMaterialVolume, BOOL &pCanBeExclusionVolume, BOOL &pCanBeDynamicPhantom) const;
+
+protected:
+
+private:
+	void parseLinksetListData(const LLSD& pLinksetListData);
+};
+
+#endif // LL_LLPATHFINDINGLINKSETLIST_H
diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..2dd01e931e097b9c510adfab4af61b63b772401a
--- /dev/null
+++ b/indra/newview/llpathfindingmanager.cpp
@@ -0,0 +1,1049 @@
+/** 
+* @file llpathfindingmanager.cpp
+* @brief Implementation of llpathfindingmanager
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, 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 "llpathfindingmanager.h"
+
+#include <string>
+#include <map>
+
+#include <boost/bind.hpp>
+#include <boost/function.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/signals2.hpp>
+
+#include "llagent.h"
+#include "llhttpclient.h"
+#include "llhttpnode.h"
+#include "llnotificationsutil.h"
+#include "llpathfindingcharacterlist.h"
+#include "llpathfindinglinkset.h"
+#include "llpathfindinglinksetlist.h"
+#include "llpathfindingnavmesh.h"
+#include "llpathfindingnavmeshstatus.h"
+#include "llpathfindingobject.h"
+#include "llpathinglib.h"
+#include "llsingleton.h"
+#include "llsd.h"
+#include "lltrans.h"
+#include "lluuid.h"
+#include "llviewerregion.h"
+#include "llweb.h"
+
+#define CAP_SERVICE_RETRIEVE_NAVMESH        "RetrieveNavMeshSrc"
+
+#define CAP_SERVICE_NAVMESH_STATUS          "NavMeshGenerationStatus"
+
+#define CAP_SERVICE_OBJECT_LINKSETS         "ObjectNavMeshProperties"
+#define CAP_SERVICE_TERRAIN_LINKSETS        "TerrainNavMeshProperties"
+
+#define CAP_SERVICE_CHARACTERS              "CharacterProperties"
+
+#define SIM_MESSAGE_NAVMESH_STATUS_UPDATE   "/message/NavMeshStatusUpdate"
+#define SIM_MESSAGE_AGENT_STATE_UPDATE      "/message/AgentStateUpdate"
+#define SIM_MESSAGE_BODY_FIELD              "body"
+
+#define CAP_SERVICE_AGENT_STATE             "AgentState"
+
+#define AGENT_STATE_CAN_REBAKE_REGION_FIELD "can_modify_navmesh"
+
+//---------------------------------------------------------------------------
+// LLNavMeshSimStateChangeNode
+//---------------------------------------------------------------------------
+
+class LLNavMeshSimStateChangeNode : public LLHTTPNode
+{
+public:
+	virtual void post(ResponsePtr pResponse, const LLSD &pContext, const LLSD &pInput) const;
+};
+
+LLHTTPRegistration<LLNavMeshSimStateChangeNode> gHTTPRegistrationNavMeshSimStateChangeNode(SIM_MESSAGE_NAVMESH_STATUS_UPDATE);
+
+
+//---------------------------------------------------------------------------
+// LLAgentStateChangeNode
+//---------------------------------------------------------------------------
+class LLAgentStateChangeNode : public LLHTTPNode
+{
+public:
+	virtual void post(ResponsePtr pResponse, const LLSD &pContext, const LLSD &pInput) const;
+};
+
+LLHTTPRegistration<LLAgentStateChangeNode> gHTTPRegistrationAgentStateChangeNode(SIM_MESSAGE_AGENT_STATE_UPDATE);
+
+//---------------------------------------------------------------------------
+// NavMeshStatusResponder
+//---------------------------------------------------------------------------
+
+class NavMeshStatusResponder : public LLHTTPClient::Responder
+{
+public:
+	NavMeshStatusResponder(const std::string &pCapabilityURL, LLViewerRegion *pRegion, bool pIsGetStatusOnly);
+	virtual ~NavMeshStatusResponder();
+
+	virtual void result(const LLSD &pContent);
+	virtual void error(U32 pStatus, const std::string& pReason);
+
+protected:
+
+private:
+	std::string    mCapabilityURL;
+	LLViewerRegion *mRegion;
+	LLUUID         mRegionUUID;
+	bool           mIsGetStatusOnly;
+};
+
+//---------------------------------------------------------------------------
+// NavMeshResponder
+//---------------------------------------------------------------------------
+
+class NavMeshResponder : public LLHTTPClient::Responder
+{
+public:
+	NavMeshResponder(const std::string &pCapabilityURL, U32 pNavMeshVersion, LLPathfindingNavMeshPtr pNavMeshPtr);
+	virtual ~NavMeshResponder();
+
+	virtual void result(const LLSD &pContent);
+	virtual void error(U32 pStatus, const std::string& pReason);
+
+protected:
+
+private:
+	std::string             mCapabilityURL;
+	U32                     mNavMeshVersion;
+	LLPathfindingNavMeshPtr mNavMeshPtr;
+};
+
+//---------------------------------------------------------------------------
+// AgentStateResponder
+//---------------------------------------------------------------------------
+
+class AgentStateResponder : public LLHTTPClient::Responder
+{
+public:
+	AgentStateResponder(const std::string &pCapabilityURL);
+	virtual ~AgentStateResponder();
+
+	virtual void result(const LLSD &pContent);
+	virtual void error(U32 pStatus, const std::string& pReason);
+
+protected:
+
+private:
+	std::string mCapabilityURL;
+};
+
+
+//---------------------------------------------------------------------------
+// NavMeshRebakeResponder
+//---------------------------------------------------------------------------
+class NavMeshRebakeResponder : public LLHTTPClient::Responder
+{
+public:
+	NavMeshRebakeResponder(const std::string &pCapabilityURL, LLPathfindingManager::rebake_navmesh_callback_t pRebakeNavMeshCallback);
+	virtual ~NavMeshRebakeResponder();
+
+	virtual void result(const LLSD &pContent);
+	virtual void error(U32 pStatus, const std::string& pReason);
+
+protected:
+
+private:
+	std::string                                     mCapabilityURL;
+	LLPathfindingManager::rebake_navmesh_callback_t mRebakeNavMeshCallback;
+};
+
+//---------------------------------------------------------------------------
+// LinksetsResponder
+//---------------------------------------------------------------------------
+
+class LinksetsResponder
+{
+public:
+	LinksetsResponder(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::object_request_callback_t pLinksetsCallback, bool pIsObjectRequested, bool pIsTerrainRequested);
+	virtual ~LinksetsResponder();
+
+	void handleObjectLinksetsResult(const LLSD &pContent);
+	void handleObjectLinksetsError(U32 pStatus, const std::string &pReason, const std::string &pURL);
+	void handleTerrainLinksetsResult(const LLSD &pContent);
+	void handleTerrainLinksetsError(U32 pStatus, const std::string &pReason, const std::string &pURL);
+
+protected:
+
+private:
+	void sendCallback();
+
+	typedef enum
+	{
+		kNotRequested,
+		kWaiting,
+		kReceivedGood,
+		kReceivedError
+	} EMessagingState;
+
+	LLPathfindingManager::request_id_t              mRequestId;
+	LLPathfindingManager::object_request_callback_t mLinksetsCallback;
+
+	EMessagingState                                 mObjectMessagingState;
+	EMessagingState                                 mTerrainMessagingState;
+
+	LLPathfindingObjectListPtr                      mObjectLinksetListPtr;
+	LLPathfindingObjectPtr                          mTerrainLinksetPtr;
+};
+
+typedef boost::shared_ptr<LinksetsResponder> LinksetsResponderPtr;
+
+//---------------------------------------------------------------------------
+// ObjectLinksetsResponder
+//---------------------------------------------------------------------------
+
+class ObjectLinksetsResponder : public LLHTTPClient::Responder
+{
+public:
+	ObjectLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr);
+	virtual ~ObjectLinksetsResponder();
+
+	virtual void result(const LLSD &pContent);
+	virtual void error(U32 pStatus, const std::string &pReason);
+
+protected:
+
+private:
+	std::string          mCapabilityURL;
+	LinksetsResponderPtr mLinksetsResponsderPtr;
+};
+
+//---------------------------------------------------------------------------
+// TerrainLinksetsResponder
+//---------------------------------------------------------------------------
+
+class TerrainLinksetsResponder : public LLHTTPClient::Responder
+{
+public:
+	TerrainLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr);
+	virtual ~TerrainLinksetsResponder();
+
+	virtual void result(const LLSD &pContent);
+	virtual void error(U32 pStatus, const std::string &pReason);
+
+protected:
+
+private:
+	std::string          mCapabilityURL;
+	LinksetsResponderPtr mLinksetsResponsderPtr;
+};
+
+//---------------------------------------------------------------------------
+// CharactersResponder
+//---------------------------------------------------------------------------
+
+class CharactersResponder : public LLHTTPClient::Responder
+{
+public:
+	CharactersResponder(const std::string &pCapabilityURL, LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::object_request_callback_t pCharactersCallback);
+	virtual ~CharactersResponder();
+
+	virtual void result(const LLSD &pContent);
+	virtual void error(U32 pStatus, const std::string &pReason);
+
+protected:
+
+private:
+	std::string                                     mCapabilityURL;
+	LLPathfindingManager::request_id_t              mRequestId;
+	LLPathfindingManager::object_request_callback_t mCharactersCallback;
+};
+
+//---------------------------------------------------------------------------
+// LLPathfindingManager
+//---------------------------------------------------------------------------
+
+LLPathfindingManager::LLPathfindingManager()
+	: LLSingleton<LLPathfindingManager>(),
+	mNavMeshMap(),
+	mAgentStateSignal()
+{
+}
+
+LLPathfindingManager::~LLPathfindingManager()
+{	
+	quitSystem();
+}
+
+void LLPathfindingManager::initSystem()
+{
+	if (LLPathingLib::getInstance() == NULL)
+	{
+		LLPathingLib::initSystem();
+	}
+}
+
+void LLPathfindingManager::quitSystem()
+{
+	if (LLPathingLib::getInstance() != NULL)
+	{
+		LLPathingLib::quitSystem();
+	}
+}
+
+bool LLPathfindingManager::isPathfindingViewEnabled() const
+{
+	return (LLPathingLib::getInstance() != NULL);
+}
+
+bool LLPathfindingManager::isPathfindingEnabledForCurrentRegion() const
+{
+	return isPathfindingEnabledForRegion(getCurrentRegion());
+}
+
+bool LLPathfindingManager::isPathfindingEnabledForRegion(LLViewerRegion *pRegion) const
+{
+	std::string retrieveNavMeshURL = getRetrieveNavMeshURLForRegion(pRegion);
+	return !retrieveNavMeshURL.empty();
+}
+
+bool LLPathfindingManager::isAllowViewTerrainProperties() const
+{
+	LLViewerRegion* region = getCurrentRegion();
+	return (gAgent.isGodlike() || ((region != NULL) && region->canManageEstate()));
+}
+
+LLPathfindingNavMesh::navmesh_slot_t LLPathfindingManager::registerNavMeshListenerForRegion(LLViewerRegion *pRegion, LLPathfindingNavMesh::navmesh_callback_t pNavMeshCallback)
+{
+	LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pRegion);
+	return navMeshPtr->registerNavMeshListener(pNavMeshCallback);
+}
+
+void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion, bool pIsGetStatusOnly)
+{
+	LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pRegion);
+
+	if (pRegion == NULL)
+	{
+		navMeshPtr->handleNavMeshNotEnabled();
+	}
+	else if (!pRegion->capabilitiesReceived())
+	{
+		navMeshPtr->handleNavMeshWaitForRegionLoad();
+		pRegion->setCapabilitiesReceivedCallback(boost::bind(&LLPathfindingManager::handleDeferredGetNavMeshForRegion, this, _1, pIsGetStatusOnly));
+	}
+	else if (!isPathfindingEnabledForRegion(pRegion))
+	{
+		navMeshPtr->handleNavMeshNotEnabled();
+	}
+	else
+	{
+		std::string navMeshStatusURL = getNavMeshStatusURLForRegion(pRegion);
+		llassert(!navMeshStatusURL.empty());
+		navMeshPtr->handleNavMeshCheckVersion();
+		LLHTTPClient::ResponderPtr navMeshStatusResponder = new NavMeshStatusResponder(navMeshStatusURL, pRegion, pIsGetStatusOnly);
+		LLHTTPClient::get(navMeshStatusURL, navMeshStatusResponder);
+	}
+}
+
+void LLPathfindingManager::requestGetLinksets(request_id_t pRequestId, object_request_callback_t pLinksetsCallback) const
+{
+	LLPathfindingObjectListPtr emptyLinksetListPtr;
+	LLViewerRegion *currentRegion = getCurrentRegion();
+
+	if (currentRegion == NULL)
+	{
+		pLinksetsCallback(pRequestId, kRequestNotEnabled, emptyLinksetListPtr);
+	}
+	else if (!currentRegion->capabilitiesReceived())
+	{
+		pLinksetsCallback(pRequestId, kRequestStarted, emptyLinksetListPtr);
+		currentRegion->setCapabilitiesReceivedCallback(boost::bind(&LLPathfindingManager::handleDeferredGetLinksetsForRegion, this, _1, pRequestId, pLinksetsCallback));
+	}
+	else
+	{
+		std::string objectLinksetsURL = getObjectLinksetsURLForCurrentRegion();
+		std::string terrainLinksetsURL = getTerrainLinksetsURLForCurrentRegion();
+		if (objectLinksetsURL.empty() || terrainLinksetsURL.empty())
+		{
+			pLinksetsCallback(pRequestId, kRequestNotEnabled, emptyLinksetListPtr);
+		}
+		else
+		{
+			pLinksetsCallback(pRequestId, kRequestStarted, emptyLinksetListPtr);
+
+			bool doRequestTerrain = isAllowViewTerrainProperties();
+			LinksetsResponderPtr linksetsResponderPtr(new LinksetsResponder(pRequestId, pLinksetsCallback, true, doRequestTerrain));
+
+			LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(objectLinksetsURL, linksetsResponderPtr);
+			LLHTTPClient::get(objectLinksetsURL, objectLinksetsResponder);
+
+			if (doRequestTerrain)
+			{
+				LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(terrainLinksetsURL, linksetsResponderPtr);
+				LLHTTPClient::get(terrainLinksetsURL, terrainLinksetsResponder);
+			}
+		}
+	}
+}
+
+void LLPathfindingManager::requestSetLinksets(request_id_t pRequestId, const LLPathfindingObjectListPtr &pLinksetListPtr, LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD, object_request_callback_t pLinksetsCallback) const
+{
+	LLPathfindingObjectListPtr emptyLinksetListPtr;
+
+	std::string objectLinksetsURL = getObjectLinksetsURLForCurrentRegion();
+	std::string terrainLinksetsURL = getTerrainLinksetsURLForCurrentRegion();
+	if (objectLinksetsURL.empty() || terrainLinksetsURL.empty())
+	{
+		pLinksetsCallback(pRequestId, kRequestNotEnabled, emptyLinksetListPtr);
+	}
+	else if ((pLinksetListPtr == NULL) || pLinksetListPtr->isEmpty())
+	{
+		pLinksetsCallback(pRequestId, kRequestCompleted, emptyLinksetListPtr);
+	}
+	else 
+	{
+		const LLPathfindingLinksetList *linksetList = dynamic_cast<const LLPathfindingLinksetList *>(pLinksetListPtr.get());
+
+		LLSD objectPostData = linksetList->encodeObjectFields(pLinksetUse, pA, pB, pC, pD);
+		LLSD terrainPostData;
+		if (isAllowViewTerrainProperties())
+		{
+			terrainPostData = linksetList->encodeTerrainFields(pLinksetUse, pA, pB, pC, pD);
+		}
+
+		if (objectPostData.isUndefined() && terrainPostData.isUndefined())
+		{
+			pLinksetsCallback(pRequestId, kRequestCompleted, emptyLinksetListPtr);
+		}
+		else
+		{
+			pLinksetsCallback(pRequestId, kRequestStarted, emptyLinksetListPtr);
+
+			LinksetsResponderPtr linksetsResponderPtr(new LinksetsResponder(pRequestId, pLinksetsCallback, !objectPostData.isUndefined(), !terrainPostData.isUndefined()));
+
+			if (!objectPostData.isUndefined())
+			{
+				LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(objectLinksetsURL, linksetsResponderPtr);
+				LLHTTPClient::put(objectLinksetsURL, objectPostData, objectLinksetsResponder);
+			}
+
+			if (!terrainPostData.isUndefined())
+			{
+				LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(terrainLinksetsURL, linksetsResponderPtr);
+				LLHTTPClient::put(terrainLinksetsURL, terrainPostData, terrainLinksetsResponder);
+			}
+		}
+	}
+}
+
+void LLPathfindingManager::requestGetCharacters(request_id_t pRequestId, object_request_callback_t pCharactersCallback) const
+{
+	LLPathfindingObjectListPtr emptyCharacterListPtr;
+
+	LLViewerRegion *currentRegion = getCurrentRegion();
+
+	if (currentRegion == NULL)
+	{
+		pCharactersCallback(pRequestId, kRequestNotEnabled, emptyCharacterListPtr);
+	}
+	else if (!currentRegion->capabilitiesReceived())
+	{
+		pCharactersCallback(pRequestId, kRequestStarted, emptyCharacterListPtr);
+		currentRegion->setCapabilitiesReceivedCallback(boost::bind(&LLPathfindingManager::handleDeferredGetCharactersForRegion, this, _1, pRequestId, pCharactersCallback));
+	}
+	else
+	{
+		std::string charactersURL = getCharactersURLForCurrentRegion();
+		if (charactersURL.empty())
+		{
+			pCharactersCallback(pRequestId, kRequestNotEnabled, emptyCharacterListPtr);
+		}
+		else
+		{
+			pCharactersCallback(pRequestId, kRequestStarted, emptyCharacterListPtr);
+
+			LLHTTPClient::ResponderPtr charactersResponder = new CharactersResponder(charactersURL, pRequestId, pCharactersCallback);
+			LLHTTPClient::get(charactersURL, charactersResponder);
+		}
+	}
+}
+
+LLPathfindingManager::agent_state_slot_t LLPathfindingManager::registerAgentStateListener(agent_state_callback_t pAgentStateCallback)
+{
+	return mAgentStateSignal.connect(pAgentStateCallback);
+}
+
+void LLPathfindingManager::requestGetAgentState()
+{
+	LLViewerRegion *currentRegion = getCurrentRegion();
+
+	if (currentRegion == NULL)
+	{
+		mAgentStateSignal(FALSE);
+	}
+	else
+	{
+		if (!currentRegion->capabilitiesReceived())
+		{
+			currentRegion->setCapabilitiesReceivedCallback(boost::bind(&LLPathfindingManager::handleDeferredGetAgentStateForRegion, this, _1));
+		}
+		else if (!isPathfindingEnabledForRegion(currentRegion))
+		{
+			mAgentStateSignal(FALSE);
+		}
+		else
+		{
+			std::string agentStateURL = getAgentStateURLForRegion(currentRegion);
+			llassert(!agentStateURL.empty());
+			LLHTTPClient::ResponderPtr responder = new AgentStateResponder(agentStateURL);
+			LLHTTPClient::get(agentStateURL, responder);
+		}
+	}
+}
+
+void LLPathfindingManager::requestRebakeNavMesh(rebake_navmesh_callback_t pRebakeNavMeshCallback)
+{
+	LLViewerRegion *currentRegion = getCurrentRegion();
+
+	if (currentRegion == NULL)
+	{
+		pRebakeNavMeshCallback(false);
+	}
+	else if (!isPathfindingEnabledForRegion(currentRegion))
+	{
+		pRebakeNavMeshCallback(false);
+	}
+	else
+	{
+		std::string navMeshStatusURL = getNavMeshStatusURLForCurrentRegion();
+		llassert(!navMeshStatusURL.empty());
+		LLSD postData;			
+		postData["command"] = "rebuild";
+		LLHTTPClient::ResponderPtr responder = new NavMeshRebakeResponder(navMeshStatusURL, pRebakeNavMeshCallback);
+		LLHTTPClient::post(navMeshStatusURL, postData, responder);
+	}
+}
+
+void LLPathfindingManager::sendRequestGetNavMeshForRegion(LLPathfindingNavMeshPtr navMeshPtr, LLViewerRegion *pRegion, const LLPathfindingNavMeshStatus &pNavMeshStatus)
+{
+	if ((pRegion == NULL) || !pRegion->isAlive())
+	{
+		navMeshPtr->handleNavMeshNotEnabled();
+	}
+	else
+	{
+		std::string navMeshURL = getRetrieveNavMeshURLForRegion(pRegion);
+
+		if (navMeshURL.empty())
+		{
+			navMeshPtr->handleNavMeshNotEnabled();
+		}
+		else
+		{
+			navMeshPtr->handleNavMeshStart(pNavMeshStatus);
+			LLHTTPClient::ResponderPtr responder = new NavMeshResponder(navMeshURL, pNavMeshStatus.getVersion(), navMeshPtr);
+
+			LLSD postData;
+			LLHTTPClient::post(navMeshURL, postData, responder);
+		}
+	}
+}
+
+void LLPathfindingManager::handleDeferredGetAgentStateForRegion(const LLUUID &pRegionUUID)
+{
+	LLViewerRegion *currentRegion = getCurrentRegion();
+
+	if ((currentRegion != NULL) && (currentRegion->getRegionID() == pRegionUUID))
+	{
+		requestGetAgentState();
+	}
+}
+
+void LLPathfindingManager::handleDeferredGetNavMeshForRegion(const LLUUID &pRegionUUID, bool pIsGetStatusOnly)
+{
+	LLViewerRegion *currentRegion = getCurrentRegion();
+
+	if ((currentRegion != NULL) && (currentRegion->getRegionID() == pRegionUUID))
+	{
+		requestGetNavMeshForRegion(currentRegion, pIsGetStatusOnly);
+	}
+}
+
+void LLPathfindingManager::handleDeferredGetLinksetsForRegion(const LLUUID &pRegionUUID, request_id_t pRequestId, object_request_callback_t pLinksetsCallback) const
+{
+	LLViewerRegion *currentRegion = getCurrentRegion();
+
+	if ((currentRegion != NULL) && (currentRegion->getRegionID() == pRegionUUID))
+	{
+		requestGetLinksets(pRequestId, pLinksetsCallback);
+	}
+}
+
+void LLPathfindingManager::handleDeferredGetCharactersForRegion(const LLUUID &pRegionUUID, request_id_t pRequestId, object_request_callback_t pCharactersCallback) const
+{
+	LLViewerRegion *currentRegion = getCurrentRegion();
+
+	if ((currentRegion != NULL) && (currentRegion->getRegionID() == pRegionUUID))
+	{
+		requestGetCharacters(pRequestId, pCharactersCallback);
+	}
+}
+
+void LLPathfindingManager::handleNavMeshStatusRequest(const LLPathfindingNavMeshStatus &pNavMeshStatus, LLViewerRegion *pRegion, bool pIsGetStatusOnly)
+{
+	LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pNavMeshStatus.getRegionUUID());
+
+	if (!pNavMeshStatus.isValid())
+	{
+		navMeshPtr->handleNavMeshError();
+	}
+	else
+	{
+		if (navMeshPtr->hasNavMeshVersion(pNavMeshStatus))
+		{
+			navMeshPtr->handleRefresh(pNavMeshStatus);
+		}
+		else if (pIsGetStatusOnly)
+		{
+			navMeshPtr->handleNavMeshNewVersion(pNavMeshStatus);
+		}
+		else
+		{
+			sendRequestGetNavMeshForRegion(navMeshPtr, pRegion, pNavMeshStatus);
+		}
+	}
+}
+
+void LLPathfindingManager::handleNavMeshStatusUpdate(const LLPathfindingNavMeshStatus &pNavMeshStatus)
+{
+	LLPathfindingNavMeshPtr navMeshPtr = getNavMeshForRegion(pNavMeshStatus.getRegionUUID());
+
+	if (!pNavMeshStatus.isValid())
+	{
+		navMeshPtr->handleNavMeshError();
+	}
+	else
+	{
+		navMeshPtr->handleNavMeshNewVersion(pNavMeshStatus);
+	}
+}
+
+void LLPathfindingManager::handleAgentState(BOOL pCanRebakeRegion) 
+{
+	mAgentStateSignal(pCanRebakeRegion);
+}
+
+LLPathfindingNavMeshPtr LLPathfindingManager::getNavMeshForRegion(const LLUUID &pRegionUUID)
+{
+	LLPathfindingNavMeshPtr navMeshPtr;
+	NavMeshMap::iterator navMeshIter = mNavMeshMap.find(pRegionUUID);
+	if (navMeshIter == mNavMeshMap.end())
+	{
+		navMeshPtr = LLPathfindingNavMeshPtr(new LLPathfindingNavMesh(pRegionUUID));
+		mNavMeshMap.insert(std::pair<LLUUID, LLPathfindingNavMeshPtr>(pRegionUUID, navMeshPtr));
+	}
+	else
+	{
+		navMeshPtr = navMeshIter->second;
+	}
+
+	return navMeshPtr;
+}
+
+LLPathfindingNavMeshPtr LLPathfindingManager::getNavMeshForRegion(LLViewerRegion *pRegion)
+{
+	LLUUID regionUUID;
+	if (pRegion != NULL)
+	{
+		regionUUID = pRegion->getRegionID();
+	}
+
+	return getNavMeshForRegion(regionUUID);
+}
+
+std::string LLPathfindingManager::getNavMeshStatusURLForCurrentRegion() const
+{
+	return getNavMeshStatusURLForRegion(getCurrentRegion());
+}
+
+std::string LLPathfindingManager::getNavMeshStatusURLForRegion(LLViewerRegion *pRegion) const
+{
+	return getCapabilityURLForRegion(pRegion, CAP_SERVICE_NAVMESH_STATUS);
+}
+
+std::string LLPathfindingManager::getRetrieveNavMeshURLForRegion(LLViewerRegion *pRegion) const
+{
+	return getCapabilityURLForRegion(pRegion, CAP_SERVICE_RETRIEVE_NAVMESH);
+}
+
+std::string LLPathfindingManager::getObjectLinksetsURLForCurrentRegion() const
+{
+	return getCapabilityURLForCurrentRegion(CAP_SERVICE_OBJECT_LINKSETS);
+}
+
+std::string LLPathfindingManager::getTerrainLinksetsURLForCurrentRegion() const
+{
+	return getCapabilityURLForCurrentRegion(CAP_SERVICE_TERRAIN_LINKSETS);
+}
+
+std::string LLPathfindingManager::getCharactersURLForCurrentRegion() const
+{
+	return getCapabilityURLForCurrentRegion(CAP_SERVICE_CHARACTERS);
+}
+
+std::string LLPathfindingManager::getAgentStateURLForRegion(LLViewerRegion *pRegion) const
+{
+	return getCapabilityURLForRegion(pRegion, CAP_SERVICE_AGENT_STATE);
+}
+
+std::string LLPathfindingManager::getCapabilityURLForCurrentRegion(const std::string &pCapabilityName) const
+{
+	return getCapabilityURLForRegion(getCurrentRegion(), pCapabilityName);
+}
+
+std::string LLPathfindingManager::getCapabilityURLForRegion(LLViewerRegion *pRegion, const std::string &pCapabilityName) const
+{
+	std::string capabilityURL("");
+
+	if (pRegion != NULL)
+	{
+		capabilityURL = pRegion->getCapability(pCapabilityName);
+	}
+
+	if (capabilityURL.empty())
+	{
+		llwarns << "cannot find capability '" << pCapabilityName << "' for current region '"
+			<< ((pRegion != NULL) ? pRegion->getName() : "<null>") << "'" << llendl;
+	}
+
+	return capabilityURL;
+}
+
+LLViewerRegion *LLPathfindingManager::getCurrentRegion() const
+{
+	return gAgent.getRegion();
+}
+
+//---------------------------------------------------------------------------
+// LLNavMeshSimStateChangeNode
+//---------------------------------------------------------------------------
+
+void LLNavMeshSimStateChangeNode::post(ResponsePtr pResponse, const LLSD &pContext, const LLSD &pInput) const
+{
+	llassert(pInput.has(SIM_MESSAGE_BODY_FIELD));
+	llassert(pInput.get(SIM_MESSAGE_BODY_FIELD).isMap());
+	LLPathfindingNavMeshStatus navMeshStatus(pInput.get(SIM_MESSAGE_BODY_FIELD));
+	LLPathfindingManager::getInstance()->handleNavMeshStatusUpdate(navMeshStatus);
+}
+
+//---------------------------------------------------------------------------
+// LLAgentStateChangeNode
+//---------------------------------------------------------------------------
+
+void LLAgentStateChangeNode::post(ResponsePtr pResponse, const LLSD &pContext, const LLSD &pInput) const
+{
+	llassert(pInput.has(SIM_MESSAGE_BODY_FIELD));
+	llassert(pInput.get(SIM_MESSAGE_BODY_FIELD).isMap());
+	llassert(pInput.get(SIM_MESSAGE_BODY_FIELD).has(AGENT_STATE_CAN_REBAKE_REGION_FIELD));
+	llassert(pInput.get(SIM_MESSAGE_BODY_FIELD).get(AGENT_STATE_CAN_REBAKE_REGION_FIELD).isBoolean());
+	BOOL canRebakeRegion = pInput.get(SIM_MESSAGE_BODY_FIELD).get(AGENT_STATE_CAN_REBAKE_REGION_FIELD).asBoolean();
+	
+	LLPathfindingManager::getInstance()->handleAgentState(canRebakeRegion);
+}
+
+//---------------------------------------------------------------------------
+// NavMeshStatusResponder
+//---------------------------------------------------------------------------
+
+NavMeshStatusResponder::NavMeshStatusResponder(const std::string &pCapabilityURL, LLViewerRegion *pRegion, bool pIsGetStatusOnly)
+	: LLHTTPClient::Responder(),
+	mCapabilityURL(pCapabilityURL),
+	mRegion(pRegion),
+	mRegionUUID(),
+	mIsGetStatusOnly(pIsGetStatusOnly)
+{
+	if (mRegion != NULL)
+	{
+		mRegionUUID = mRegion->getRegionID();
+	}
+}
+
+NavMeshStatusResponder::~NavMeshStatusResponder()
+{
+}
+
+void NavMeshStatusResponder::result(const LLSD &pContent)
+{
+	LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID, pContent);
+	LLPathfindingManager::getInstance()->handleNavMeshStatusRequest(navMeshStatus, mRegion, mIsGetStatusOnly);
+}
+
+void NavMeshStatusResponder::error(U32 pStatus, const std::string& pReason)
+{
+	llwarns << "error with request to URL '" << mCapabilityURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl;
+	LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID);
+	LLPathfindingManager::getInstance()->handleNavMeshStatusRequest(navMeshStatus, mRegion, mIsGetStatusOnly);
+}
+
+//---------------------------------------------------------------------------
+// NavMeshResponder
+//---------------------------------------------------------------------------
+
+NavMeshResponder::NavMeshResponder(const std::string &pCapabilityURL, U32 pNavMeshVersion, LLPathfindingNavMeshPtr pNavMeshPtr)
+	: LLHTTPClient::Responder(),
+	mCapabilityURL(pCapabilityURL),
+	mNavMeshVersion(pNavMeshVersion),
+	mNavMeshPtr(pNavMeshPtr)
+{
+}
+
+NavMeshResponder::~NavMeshResponder()
+{
+}
+
+void NavMeshResponder::result(const LLSD &pContent)
+{
+	mNavMeshPtr->handleNavMeshResult(pContent, mNavMeshVersion);
+}
+
+void NavMeshResponder::error(U32 pStatus, const std::string& pReason)
+{
+	mNavMeshPtr->handleNavMeshError(pStatus, pReason, mCapabilityURL, mNavMeshVersion);
+}
+
+//---------------------------------------------------------------------------
+// AgentStateResponder
+//---------------------------------------------------------------------------
+
+AgentStateResponder::AgentStateResponder(const std::string &pCapabilityURL)
+: LLHTTPClient::Responder()
+, mCapabilityURL(pCapabilityURL)
+{
+}
+
+AgentStateResponder::~AgentStateResponder()
+{
+}
+
+void AgentStateResponder::result(const LLSD &pContent)
+{
+	llassert(pContent.has(AGENT_STATE_CAN_REBAKE_REGION_FIELD));
+	llassert(pContent.get(AGENT_STATE_CAN_REBAKE_REGION_FIELD).isBoolean());
+	BOOL canRebakeRegion = pContent.get(AGENT_STATE_CAN_REBAKE_REGION_FIELD).asBoolean();
+	LLPathfindingManager::getInstance()->handleAgentState(canRebakeRegion);
+}
+
+void AgentStateResponder::error(U32 pStatus, const std::string &pReason)
+{
+	llwarns << "error with request to URL '" << mCapabilityURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl;
+	LLPathfindingManager::getInstance()->handleAgentState(FALSE);
+}
+
+
+//---------------------------------------------------------------------------
+// navmesh rebake responder
+//---------------------------------------------------------------------------
+NavMeshRebakeResponder::NavMeshRebakeResponder(const std::string &pCapabilityURL, LLPathfindingManager::rebake_navmesh_callback_t pRebakeNavMeshCallback)
+	: LLHTTPClient::Responder(),
+	mCapabilityURL(pCapabilityURL),
+	mRebakeNavMeshCallback(pRebakeNavMeshCallback)
+{
+}
+
+NavMeshRebakeResponder::~NavMeshRebakeResponder()
+{
+}
+
+void NavMeshRebakeResponder::result(const LLSD &pContent)
+{
+	mRebakeNavMeshCallback(true);
+}
+
+void NavMeshRebakeResponder::error(U32 pStatus, const std::string &pReason)
+{
+	llwarns << "error with request to URL '" << mCapabilityURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl;
+	mRebakeNavMeshCallback(false);
+}
+
+//---------------------------------------------------------------------------
+// LinksetsResponder
+//---------------------------------------------------------------------------
+
+LinksetsResponder::LinksetsResponder(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::object_request_callback_t pLinksetsCallback, bool pIsObjectRequested, bool pIsTerrainRequested)
+	: mRequestId(pRequestId),
+	mLinksetsCallback(pLinksetsCallback),
+	mObjectMessagingState(pIsObjectRequested ? kWaiting : kNotRequested),
+	mTerrainMessagingState(pIsTerrainRequested ? kWaiting : kNotRequested),
+	mObjectLinksetListPtr(),
+	mTerrainLinksetPtr()
+{
+}
+
+LinksetsResponder::~LinksetsResponder()
+{
+}
+
+void LinksetsResponder::handleObjectLinksetsResult(const LLSD &pContent)
+{
+	mObjectLinksetListPtr = LLPathfindingObjectListPtr(new LLPathfindingLinksetList(pContent));
+
+	mObjectMessagingState = kReceivedGood;
+	if (mTerrainMessagingState != kWaiting)
+	{
+		sendCallback();
+	}
+}
+
+void LinksetsResponder::handleObjectLinksetsError(U32 pStatus, const std::string &pReason, const std::string &pURL)
+{
+	llwarns << "error with request to URL '" << pURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl;
+	mObjectMessagingState = kReceivedError;
+	if (mTerrainMessagingState != kWaiting)
+	{
+		sendCallback();
+	}
+}
+
+void LinksetsResponder::handleTerrainLinksetsResult(const LLSD &pContent)
+{
+	mTerrainLinksetPtr = LLPathfindingObjectPtr(new LLPathfindingLinkset(pContent));
+
+	mTerrainMessagingState = kReceivedGood;
+	if (mObjectMessagingState != kWaiting)
+	{
+		sendCallback();
+	}
+}
+
+void LinksetsResponder::handleTerrainLinksetsError(U32 pStatus, const std::string &pReason, const std::string &pURL)
+{
+	mTerrainMessagingState = kReceivedError;
+	if (mObjectMessagingState != kWaiting)
+	{
+		sendCallback();
+	}
+}
+
+void LinksetsResponder::sendCallback()
+{
+	llassert(mObjectMessagingState != kWaiting);
+	llassert(mTerrainMessagingState != kWaiting);
+	LLPathfindingManager::ERequestStatus requestStatus =
+		((((mObjectMessagingState == kReceivedGood) || (mObjectMessagingState == kNotRequested)) &&
+		  ((mTerrainMessagingState == kReceivedGood) || (mTerrainMessagingState == kNotRequested))) ?
+		 LLPathfindingManager::kRequestCompleted : LLPathfindingManager::kRequestError);
+
+	if (mObjectMessagingState != kReceivedGood)
+	{
+		mObjectLinksetListPtr = LLPathfindingObjectListPtr(new LLPathfindingLinksetList());
+	}
+
+	if (mTerrainMessagingState == kReceivedGood)
+	{
+		mObjectLinksetListPtr->update(mTerrainLinksetPtr);
+	}
+
+	mLinksetsCallback(mRequestId, requestStatus, mObjectLinksetListPtr);
+}
+
+//---------------------------------------------------------------------------
+// ObjectLinksetsResponder
+//---------------------------------------------------------------------------
+
+ObjectLinksetsResponder::ObjectLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr)
+	: LLHTTPClient::Responder(),
+	mCapabilityURL(pCapabilityURL),
+	mLinksetsResponsderPtr(pLinksetsResponsderPtr)
+{
+}
+
+ObjectLinksetsResponder::~ObjectLinksetsResponder()
+{
+}
+
+void ObjectLinksetsResponder::result(const LLSD &pContent)
+{
+	mLinksetsResponsderPtr->handleObjectLinksetsResult(pContent);
+}
+
+void ObjectLinksetsResponder::error(U32 pStatus, const std::string &pReason)
+{
+	mLinksetsResponsderPtr->handleObjectLinksetsError(pStatus, pReason, mCapabilityURL);
+}
+
+//---------------------------------------------------------------------------
+// TerrainLinksetsResponder
+//---------------------------------------------------------------------------
+
+TerrainLinksetsResponder::TerrainLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr)
+	: LLHTTPClient::Responder(),
+	mCapabilityURL(pCapabilityURL),
+	mLinksetsResponsderPtr(pLinksetsResponsderPtr)
+{
+}
+
+TerrainLinksetsResponder::~TerrainLinksetsResponder()
+{
+}
+
+void TerrainLinksetsResponder::result(const LLSD &pContent)
+{
+	mLinksetsResponsderPtr->handleTerrainLinksetsResult(pContent);
+}
+
+void TerrainLinksetsResponder::error(U32 pStatus, const std::string &pReason)
+{
+	mLinksetsResponsderPtr->handleTerrainLinksetsError(pStatus, pReason, mCapabilityURL);
+}
+
+//---------------------------------------------------------------------------
+// CharactersResponder
+//---------------------------------------------------------------------------
+
+CharactersResponder::CharactersResponder(const std::string &pCapabilityURL, LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::object_request_callback_t pCharactersCallback)
+	: LLHTTPClient::Responder(),
+	mCapabilityURL(pCapabilityURL),
+	mRequestId(pRequestId),
+	mCharactersCallback(pCharactersCallback)
+{
+}
+
+CharactersResponder::~CharactersResponder()
+{
+}
+
+void CharactersResponder::result(const LLSD &pContent)
+{
+	LLPathfindingObjectListPtr characterListPtr = LLPathfindingObjectListPtr(new LLPathfindingCharacterList(pContent));
+	mCharactersCallback(mRequestId, LLPathfindingManager::kRequestCompleted, characterListPtr);
+}
+
+void CharactersResponder::error(U32 pStatus, const std::string &pReason)
+{
+	llwarns << "error with request to URL '" << mCapabilityURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl;
+
+	LLPathfindingObjectListPtr characterListPtr =  LLPathfindingObjectListPtr(new LLPathfindingCharacterList());
+	mCharactersCallback(mRequestId, LLPathfindingManager::kRequestError, characterListPtr);
+}
diff --git a/indra/newview/llpathfindingmanager.h b/indra/newview/llpathfindingmanager.h
new file mode 100644
index 0000000000000000000000000000000000000000..c61ff244fc1a4549db5c78535cad9633823d28a1
--- /dev/null
+++ b/indra/newview/llpathfindingmanager.h
@@ -0,0 +1,127 @@
+/** 
+* @file   llpathfindingmanager.h
+* @brief  Header file for llpathfindingmanager
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+* $/LicenseInfo$
+*/
+#ifndef LL_LLPATHFINDINGMANAGER_H
+#define LL_LLPATHFINDINGMANAGER_H
+
+#include <string>
+#include <map>
+
+#include <boost/function.hpp>
+#include <boost/signals2.hpp>
+
+#include "llpathfindinglinkset.h"
+#include "llpathfindingobjectlist.h"
+#include "llpathfindingnavmesh.h"
+#include "llsingleton.h"
+
+class LLPathfindingNavMeshStatus;
+class LLUUID;
+class LLViewerRegion;
+
+class LLPathfindingManager : public LLSingleton<LLPathfindingManager>
+{
+	friend class LLNavMeshSimStateChangeNode;
+	friend class NavMeshStatusResponder;
+	friend class LLAgentStateChangeNode;
+	friend class AgentStateResponder;
+public:
+	typedef enum {
+		kRequestStarted,
+		kRequestCompleted,
+		kRequestNotEnabled,
+		kRequestError
+	} ERequestStatus;
+
+	LLPathfindingManager();
+	virtual ~LLPathfindingManager();
+
+	void initSystem();
+	void quitSystem();
+
+	bool isPathfindingViewEnabled() const;
+	bool isPathfindingEnabledForCurrentRegion() const;
+	bool isPathfindingEnabledForRegion(LLViewerRegion *pRegion) const;
+
+	bool isAllowViewTerrainProperties() const;
+
+	LLPathfindingNavMesh::navmesh_slot_t registerNavMeshListenerForRegion(LLViewerRegion *pRegion, LLPathfindingNavMesh::navmesh_callback_t pNavMeshCallback);
+	void requestGetNavMeshForRegion(LLViewerRegion *pRegion, bool pIsGetStatusOnly);
+
+	typedef U32 request_id_t;
+	typedef boost::function<void (request_id_t, ERequestStatus, LLPathfindingObjectListPtr)> object_request_callback_t;
+
+	void requestGetLinksets(request_id_t pRequestId, object_request_callback_t pLinksetsCallback) const;
+	void requestSetLinksets(request_id_t pRequestId, const LLPathfindingObjectListPtr &pLinksetListPtr, LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD, object_request_callback_t pLinksetsCallback) const;
+
+	void requestGetCharacters(request_id_t pRequestId, object_request_callback_t pCharactersCallback) const;
+
+	typedef boost::function<void (BOOL)>         agent_state_callback_t;
+	typedef boost::signals2::signal<void (BOOL)> agent_state_signal_t;
+	typedef boost::signals2::connection          agent_state_slot_t;	
+
+	agent_state_slot_t registerAgentStateListener(agent_state_callback_t pAgentStateCallback);
+	void requestGetAgentState();	
+
+	typedef boost::function<void (bool)> rebake_navmesh_callback_t;
+	void requestRebakeNavMesh(rebake_navmesh_callback_t pRebakeNavMeshCallback);
+
+protected:
+
+private:
+	typedef std::map<LLUUID, LLPathfindingNavMeshPtr> NavMeshMap;
+
+	void sendRequestGetNavMeshForRegion(LLPathfindingNavMeshPtr navMeshPtr, LLViewerRegion *pRegion, const LLPathfindingNavMeshStatus &pNavMeshStatus);
+
+	void handleDeferredGetAgentStateForRegion(const LLUUID &pRegionUUID);
+	void handleDeferredGetNavMeshForRegion(const LLUUID &pRegionUUID, bool pIsGetStatusOnly);
+	void handleDeferredGetLinksetsForRegion(const LLUUID &pRegionUUID, request_id_t pRequestId, object_request_callback_t pLinksetsCallback) const;
+	void handleDeferredGetCharactersForRegion(const LLUUID &pRegionUUID, request_id_t pRequestId, object_request_callback_t pCharactersCallback) const;
+
+	void handleNavMeshStatusRequest(const LLPathfindingNavMeshStatus &pNavMeshStatus, LLViewerRegion *pRegion, bool pIsGetStatusOnly);
+	void handleNavMeshStatusUpdate(const LLPathfindingNavMeshStatus &pNavMeshStatus);
+
+	void handleAgentState(BOOL pCanRebakeRegion);
+
+	LLPathfindingNavMeshPtr getNavMeshForRegion(const LLUUID &pRegionUUID);
+	LLPathfindingNavMeshPtr getNavMeshForRegion(LLViewerRegion *pRegion);
+
+	std::string getNavMeshStatusURLForCurrentRegion() const;
+	std::string getNavMeshStatusURLForRegion(LLViewerRegion *pRegion) const;
+	std::string getRetrieveNavMeshURLForRegion(LLViewerRegion *pRegion) const;
+	std::string getObjectLinksetsURLForCurrentRegion() const;
+	std::string getTerrainLinksetsURLForCurrentRegion() const;
+	std::string getCharactersURLForCurrentRegion() const;
+	std::string	getAgentStateURLForRegion(LLViewerRegion *pRegion) const;
+	std::string getCapabilityURLForCurrentRegion(const std::string &pCapabilityName) const;
+	std::string getCapabilityURLForRegion(LLViewerRegion *pRegion, const std::string &pCapabilityName) const;
+	LLViewerRegion *getCurrentRegion() const;
+
+	NavMeshMap           mNavMeshMap;
+	agent_state_signal_t mAgentStateSignal;
+};
+
+#endif // LL_LLPATHFINDINGMANAGER_H
diff --git a/indra/newview/llpathfindingnavmesh.cpp b/indra/newview/llpathfindingnavmesh.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e01dd3a152f78baf17db8aa69aea42fe29e7ea2d
--- /dev/null
+++ b/indra/newview/llpathfindingnavmesh.cpp
@@ -0,0 +1,205 @@
+/** 
+* @file llpathfindingnavmesh.cpp
+* @brief Implementation of llpathfindingnavmesh
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, 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 "llpathfindingnavmesh.h"
+
+#include <string>
+
+#include "llpathfindingnavmeshstatus.h"
+#include "llsd.h"
+#include "llsdserialize.h"
+#include "lluuid.h"
+
+#define NAVMESH_VERSION_FIELD "navmesh_version"
+#define NAVMESH_DATA_FIELD    "navmesh_data"
+
+//---------------------------------------------------------------------------
+// LLPathfindingNavMesh
+//---------------------------------------------------------------------------
+
+LLPathfindingNavMesh::LLPathfindingNavMesh(const LLUUID &pRegionUUID)
+	: mNavMeshStatus(pRegionUUID),
+	mNavMeshRequestStatus(kNavMeshRequestUnknown),
+	mNavMeshSignal(),
+	mNavMeshData()
+
+{
+}
+
+LLPathfindingNavMesh::~LLPathfindingNavMesh()
+{
+}
+
+LLPathfindingNavMesh::navmesh_slot_t LLPathfindingNavMesh::registerNavMeshListener(navmesh_callback_t pNavMeshCallback)
+{
+	return mNavMeshSignal.connect(pNavMeshCallback);
+}
+
+bool LLPathfindingNavMesh::hasNavMeshVersion(const LLPathfindingNavMeshStatus &pNavMeshStatus) const
+{
+	return ((mNavMeshStatus.getVersion() == pNavMeshStatus.getVersion()) &&
+		((mNavMeshRequestStatus == kNavMeshRequestStarted) || (mNavMeshRequestStatus == kNavMeshRequestCompleted) ||
+		((mNavMeshRequestStatus == kNavMeshRequestChecking) && !mNavMeshData.empty())));
+}
+
+void LLPathfindingNavMesh::handleNavMeshWaitForRegionLoad()
+{
+	setRequestStatus(kNavMeshRequestWaiting);
+}
+
+void LLPathfindingNavMesh::handleNavMeshCheckVersion()
+{
+	setRequestStatus(kNavMeshRequestChecking);
+}
+
+void LLPathfindingNavMesh::handleRefresh(const LLPathfindingNavMeshStatus &pNavMeshStatus)
+{
+	llassert(mNavMeshStatus.getRegionUUID() == pNavMeshStatus.getRegionUUID());
+	llassert(mNavMeshStatus.getVersion() == pNavMeshStatus.getVersion());
+	mNavMeshStatus = pNavMeshStatus;
+	if (mNavMeshRequestStatus == kNavMeshRequestChecking)
+	{
+		llassert(!mNavMeshData.empty());
+		setRequestStatus(kNavMeshRequestCompleted);
+	}
+	else
+	{
+		sendStatus();
+	}
+}
+
+void LLPathfindingNavMesh::handleNavMeshNewVersion(const LLPathfindingNavMeshStatus &pNavMeshStatus)
+{
+	llassert(mNavMeshStatus.getRegionUUID() == pNavMeshStatus.getRegionUUID());
+	if (mNavMeshStatus.getVersion() == pNavMeshStatus.getVersion())
+	{
+		mNavMeshStatus = pNavMeshStatus;
+		sendStatus();
+	}
+	else
+	{
+		mNavMeshData.clear();
+		mNavMeshStatus = pNavMeshStatus;
+		setRequestStatus(kNavMeshRequestNeedsUpdate);
+	}
+}
+
+void LLPathfindingNavMesh::handleNavMeshStart(const LLPathfindingNavMeshStatus &pNavMeshStatus)
+{
+	llassert(mNavMeshStatus.getRegionUUID() == pNavMeshStatus.getRegionUUID());
+	mNavMeshStatus = pNavMeshStatus;
+	setRequestStatus(kNavMeshRequestStarted);
+}
+
+void LLPathfindingNavMesh::handleNavMeshResult(const LLSD &pContent, U32 pNavMeshVersion)
+{
+	llassert(pContent.has(NAVMESH_VERSION_FIELD));
+	if (pContent.has(NAVMESH_VERSION_FIELD))
+	{
+		llassert(pContent.get(NAVMESH_VERSION_FIELD).isInteger());
+		llassert(pContent.get(NAVMESH_VERSION_FIELD).asInteger() >= 0);
+		U32 embeddedNavMeshVersion = static_cast<U32>(pContent.get(NAVMESH_VERSION_FIELD).asInteger());
+		llassert(embeddedNavMeshVersion == pNavMeshVersion); // stinson 03/13/2012 : does this ever occur?
+		if (embeddedNavMeshVersion != pNavMeshVersion)
+		{
+			llwarns << "Mismatch between expected and embedded navmesh versions occurred" << llendl;
+			pNavMeshVersion = embeddedNavMeshVersion;
+		}
+	}
+
+	if (mNavMeshStatus.getVersion() == pNavMeshVersion)
+	{
+		ENavMeshRequestStatus status;
+		if ( pContent.has(NAVMESH_DATA_FIELD) )
+		{
+			const LLSD::Binary &value = pContent.get(NAVMESH_DATA_FIELD).asBinary();
+			unsigned int binSize = value.size();
+			std::string newStr(reinterpret_cast<const char *>(&value[0]), binSize);
+			std::istringstream streamdecomp( newStr );
+			unsigned int decompBinSize = 0;
+			bool valid = false;
+			U8* pUncompressedNavMeshContainer = unzip_llsdNavMesh( valid, decompBinSize, streamdecomp, binSize ) ;
+			if ( !valid )
+			{
+				llwarns << "Unable to decompress the navmesh llsd." << llendl;
+				status = kNavMeshRequestError;
+			}
+			else
+			{
+				llassert(pUncompressedNavMeshContainer);
+				mNavMeshData.resize( decompBinSize );
+				memcpy( &mNavMeshData[0], &pUncompressedNavMeshContainer[0], decompBinSize );
+				status = kNavMeshRequestCompleted;
+			}
+			if ( pUncompressedNavMeshContainer )
+			{
+				free( pUncompressedNavMeshContainer );
+			}
+		}
+		else
+		{
+			llwarns << "No mesh data received" << llendl;
+			status = kNavMeshRequestError;
+		}
+		setRequestStatus(status);
+	}
+}
+
+void LLPathfindingNavMesh::handleNavMeshNotEnabled()
+{
+	mNavMeshData.clear();
+	setRequestStatus(kNavMeshRequestNotEnabled);
+}
+
+void LLPathfindingNavMesh::handleNavMeshError()
+{
+	mNavMeshData.clear();
+	setRequestStatus(kNavMeshRequestError);
+}
+
+void LLPathfindingNavMesh::handleNavMeshError(U32 pStatus, const std::string &pReason, const std::string &pURL, U32 pNavMeshVersion)
+{
+	llwarns << "error with request to URL '" << pURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl;
+	if (mNavMeshStatus.getVersion() == pNavMeshVersion)
+	{
+		handleNavMeshError();
+	}
+}
+
+void LLPathfindingNavMesh::setRequestStatus(ENavMeshRequestStatus pNavMeshRequestStatus)
+{
+	mNavMeshRequestStatus = pNavMeshRequestStatus;
+	sendStatus();
+}
+
+void LLPathfindingNavMesh::sendStatus()
+{
+	mNavMeshSignal(mNavMeshRequestStatus, mNavMeshStatus, mNavMeshData);
+}
diff --git a/indra/newview/llpathfindingnavmesh.h b/indra/newview/llpathfindingnavmesh.h
new file mode 100644
index 0000000000000000000000000000000000000000..7a844f54cebf407f6350b8596a7f38e993d02467
--- /dev/null
+++ b/indra/newview/llpathfindingnavmesh.h
@@ -0,0 +1,91 @@
+/** 
+* @file   llpathfindingnavmesh.h
+* @brief  Header file for llpathfindingnavmesh
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+* $/LicenseInfo$
+*/
+#ifndef LL_LLPATHFINDINGNAVMESH_H
+#define LL_LLPATHFINDINGNAVMESH_H
+
+#include <string>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/function.hpp>
+#include <boost/signals2.hpp>
+
+#include "llpathfindingnavmeshstatus.h"
+#include "llsd.h"
+
+class LLPathfindingNavMesh;
+class LLUUID;
+
+typedef boost::shared_ptr<LLPathfindingNavMesh> LLPathfindingNavMeshPtr;
+
+class LLPathfindingNavMesh
+{
+public:
+	typedef enum {
+		kNavMeshRequestUnknown,
+		kNavMeshRequestWaiting,
+		kNavMeshRequestChecking,
+		kNavMeshRequestNeedsUpdate,
+		kNavMeshRequestStarted,
+		kNavMeshRequestCompleted,
+		kNavMeshRequestNotEnabled,
+		kNavMeshRequestError
+	} ENavMeshRequestStatus;
+
+	typedef boost::function<void (ENavMeshRequestStatus, const LLPathfindingNavMeshStatus &, const LLSD::Binary &)>         navmesh_callback_t;
+	typedef boost::signals2::signal<void (ENavMeshRequestStatus, const LLPathfindingNavMeshStatus &, const LLSD::Binary &)> navmesh_signal_t;
+	typedef boost::signals2::connection                                                                                     navmesh_slot_t;
+
+	LLPathfindingNavMesh(const LLUUID &pRegionUUID);
+	virtual ~LLPathfindingNavMesh();
+
+	navmesh_slot_t registerNavMeshListener(navmesh_callback_t pNavMeshCallback);
+
+	bool hasNavMeshVersion(const LLPathfindingNavMeshStatus &pNavMeshStatus) const;
+
+	void handleNavMeshWaitForRegionLoad();
+	void handleNavMeshCheckVersion();
+	void handleRefresh(const LLPathfindingNavMeshStatus &pNavMeshStatus);
+	void handleNavMeshNewVersion(const LLPathfindingNavMeshStatus &pNavMeshStatus);
+	void handleNavMeshStart(const LLPathfindingNavMeshStatus &pNavMeshStatus);
+	void handleNavMeshResult(const LLSD &pContent, U32 pNavMeshVersion);
+	void handleNavMeshNotEnabled();
+	void handleNavMeshError();
+	void handleNavMeshError(U32 pStatus, const std::string &pReason, const std::string &pURL, U32 pNavMeshVersion);
+
+protected:
+
+private:
+	void setRequestStatus(ENavMeshRequestStatus pNavMeshRequestStatus);
+	void sendStatus();
+
+	LLPathfindingNavMeshStatus mNavMeshStatus;
+	ENavMeshRequestStatus      mNavMeshRequestStatus;
+	navmesh_signal_t           mNavMeshSignal;
+	LLSD::Binary               mNavMeshData;
+};
+
+#endif // LL_LLPATHFINDINGNAVMESH_H
diff --git a/indra/newview/llpathfindingnavmeshstatus.cpp b/indra/newview/llpathfindingnavmeshstatus.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..2eaa6075ca30577a53d4aeea34a92c78760c7d91
--- /dev/null
+++ b/indra/newview/llpathfindingnavmeshstatus.cpp
@@ -0,0 +1,145 @@
+/** 
+* @file llpathfindingnavmeshstatus.cpp
+* @brief Implementation of llpathfindingnavmeshstatus
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, 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 "llpathfindingnavmeshstatus.h"
+
+#include <string>
+
+#include "llsd.h"
+#include "llstring.h"
+#include "lluuid.h"
+
+#define REGION_FIELD  "region_id"
+#define STATUS_FIELD  "status"
+#define VERSION_FIELD "version"
+
+const std::string LLPathfindingNavMeshStatus::sStatusPending("pending");
+const std::string LLPathfindingNavMeshStatus::sStatusBuilding("building");
+const std::string LLPathfindingNavMeshStatus::sStatusComplete("complete");
+const std::string LLPathfindingNavMeshStatus::sStatusRepending("repending");
+
+
+//---------------------------------------------------------------------------
+// LLPathfindingNavMeshStatus
+//---------------------------------------------------------------------------
+
+LLPathfindingNavMeshStatus::LLPathfindingNavMeshStatus()
+	: mIsValid(false),
+	mRegionUUID(),
+	mVersion(0U),
+	mStatus(kComplete)
+{
+}
+
+LLPathfindingNavMeshStatus::LLPathfindingNavMeshStatus(const LLUUID &pRegionUUID)
+	: mIsValid(false),
+	mRegionUUID(pRegionUUID),
+	mVersion(0U),
+	mStatus(kComplete)
+{
+}
+
+LLPathfindingNavMeshStatus::LLPathfindingNavMeshStatus(const LLUUID &pRegionUUID, const LLSD &pContent)
+	: mIsValid(true),
+	mRegionUUID(pRegionUUID),
+	mVersion(0U),
+	mStatus(kComplete)
+{
+	parseStatus(pContent);
+}
+
+LLPathfindingNavMeshStatus::LLPathfindingNavMeshStatus(const LLSD &pContent)
+	: mIsValid(true),
+	mRegionUUID(),
+	mVersion(0U),
+	mStatus(kComplete)
+{
+	llassert(pContent.has(REGION_FIELD));
+	llassert(pContent.get(REGION_FIELD).isUUID());
+	mRegionUUID = pContent.get(REGION_FIELD).asUUID();
+
+	parseStatus(pContent);
+}
+
+LLPathfindingNavMeshStatus::LLPathfindingNavMeshStatus(const LLPathfindingNavMeshStatus &pOther)
+	: mIsValid(pOther.mIsValid),
+	mRegionUUID(pOther.mRegionUUID),
+	mVersion(pOther.mVersion),
+	mStatus(pOther.mStatus)
+{
+}
+
+LLPathfindingNavMeshStatus::~LLPathfindingNavMeshStatus()
+{
+}
+
+LLPathfindingNavMeshStatus &LLPathfindingNavMeshStatus::operator =(const LLPathfindingNavMeshStatus &pOther)
+{
+	mIsValid = pOther.mIsValid;
+	mRegionUUID = pOther.mRegionUUID;
+	mVersion = pOther.mVersion;
+	mStatus = pOther.mStatus;
+
+	return *this;
+}
+
+void LLPathfindingNavMeshStatus::parseStatus(const LLSD &pContent)
+{
+	llassert(pContent.has(VERSION_FIELD));
+	llassert(pContent.get(VERSION_FIELD).isInteger());
+	llassert(pContent.get(VERSION_FIELD).asInteger() >= 0);
+	mVersion = static_cast<U32>(pContent.get(VERSION_FIELD).asInteger());
+
+	llassert(pContent.has(STATUS_FIELD));
+	llassert(pContent.get(STATUS_FIELD).isString());
+	std::string status = pContent.get(STATUS_FIELD).asString();
+
+	if (LLStringUtil::compareStrings(status, sStatusPending) == 0)
+	{
+		mStatus = kPending;
+	}
+	else if (LLStringUtil::compareStrings(status, sStatusBuilding) == 0)
+	{
+		mStatus = kBuilding;
+	}
+	else if (LLStringUtil::compareStrings(status, sStatusComplete) == 0)
+	{
+		mStatus = kComplete;
+	}
+	else if (LLStringUtil::compareStrings(status, sStatusRepending) == 0)
+	{
+		mStatus = kRepending;
+	}
+	else
+	{
+		mStatus = kComplete;
+		llassert(0);
+	}
+}
diff --git a/indra/newview/llpathfindingnavmeshstatus.h b/indra/newview/llpathfindingnavmeshstatus.h
new file mode 100644
index 0000000000000000000000000000000000000000..74533fa484f2564a669d8d6b0f1d5232e13544a3
--- /dev/null
+++ b/indra/newview/llpathfindingnavmeshstatus.h
@@ -0,0 +1,77 @@
+/** 
+* @file   llpathfindingnavmeshstatus.h
+* @brief  Header file for llpathfindingnavmeshstatus
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+* $/LicenseInfo$
+*/
+#ifndef LL_LLPATHFINDINGNAVMESHSTATUS_H
+#define LL_LLPATHFINDINGNAVMESHSTATUS_H
+
+#include <string>
+
+#include "lluuid.h"
+
+class LLSD;
+
+class LLPathfindingNavMeshStatus
+{
+public:
+	typedef enum
+	{
+		kPending,
+		kBuilding,
+		kComplete,
+		kRepending
+	} ENavMeshStatus;
+
+	LLPathfindingNavMeshStatus();
+	LLPathfindingNavMeshStatus(const LLUUID &pRegionUUID);
+	LLPathfindingNavMeshStatus(const LLUUID &pRegionUUID, const LLSD &pContent);
+	LLPathfindingNavMeshStatus(const LLSD &pContent);
+	LLPathfindingNavMeshStatus(const LLPathfindingNavMeshStatus &pOther);
+	virtual ~LLPathfindingNavMeshStatus();
+
+	LLPathfindingNavMeshStatus &operator =(const LLPathfindingNavMeshStatus &pOther);
+
+	bool           isValid() const        {return mIsValid;};
+	const LLUUID   &getRegionUUID() const {return mRegionUUID;};
+	U32            getVersion() const     {return mVersion;};
+	ENavMeshStatus getStatus() const      {return mStatus;};
+
+protected:
+
+private:
+	void           parseStatus(const LLSD &pContent);
+
+	bool           mIsValid;
+	LLUUID         mRegionUUID;
+	U32            mVersion;
+	ENavMeshStatus mStatus;
+
+	static const std::string sStatusPending;
+	static const std::string sStatusBuilding;
+	static const std::string sStatusComplete;
+	static const std::string sStatusRepending;
+};
+
+#endif // LL_LLPATHFINDINGNAVMESHSTATUS_H
diff --git a/indra/newview/llpathfindingnavmeshzone.cpp b/indra/newview/llpathfindingnavmeshzone.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e190dbba659e3ae71bd9e4efa6b39d42b7a0b5a5
--- /dev/null
+++ b/indra/newview/llpathfindingnavmeshzone.cpp
@@ -0,0 +1,423 @@
+/** 
+* @file llpathfindingnavmeshzone.cpp
+* @brief Implementation of llpathfindingnavmeshzone
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, 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 "llpathfindingnavmeshzone.h"
+
+#include <vector>
+
+#include <boost/bind.hpp>
+#include <boost/function.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/signals2.hpp>
+
+#include "llagent.h"
+#include "llpathfindingmanager.h"
+#include "llpathfindingnavmesh.h"
+#include "llpathfindingnavmeshstatus.h"
+#include "llpathinglib.h"
+#include "llsd.h"
+#include "lluuid.h"
+#include "llviewercontrol.h"
+#include "llviewerregion.h"
+
+#define CENTER_REGION 99
+
+//---------------------------------------------------------------------------
+// LLPathfindingNavMeshZone
+//---------------------------------------------------------------------------
+
+LLPathfindingNavMeshZone::LLPathfindingNavMeshZone()
+	: mNavMeshLocationPtrs(),
+	mNavMeshZoneRequestStatus(kNavMeshZoneRequestUnknown),
+	mNavMeshZoneSignal()
+{
+}
+
+LLPathfindingNavMeshZone::~LLPathfindingNavMeshZone()
+{
+}
+
+LLPathfindingNavMeshZone::navmesh_zone_slot_t LLPathfindingNavMeshZone::registerNavMeshZoneListener(navmesh_zone_callback_t pNavMeshZoneCallback)
+{
+	return mNavMeshZoneSignal.connect(pNavMeshZoneCallback);
+}
+
+void LLPathfindingNavMeshZone::initialize()
+{
+	mNavMeshLocationPtrs.clear();
+
+	NavMeshLocationPtr centerNavMeshPtr(new NavMeshLocation(CENTER_REGION, boost::bind(&LLPathfindingNavMeshZone::handleNavMeshLocation, this)));
+	mNavMeshLocationPtrs.push_back(centerNavMeshPtr);
+
+	U32 neighborRegionDir = gSavedSettings.getU32("PathfindingRetrieveNeighboringRegion");
+	if (neighborRegionDir != CENTER_REGION)
+	{
+		NavMeshLocationPtr neighborNavMeshPtr(new NavMeshLocation(neighborRegionDir, boost::bind(&LLPathfindingNavMeshZone::handleNavMeshLocation, this)));
+		mNavMeshLocationPtrs.push_back(neighborNavMeshPtr);
+	}
+}
+
+void LLPathfindingNavMeshZone::enable()
+{
+	for (NavMeshLocationPtrs::iterator navMeshLocationPtrIter = mNavMeshLocationPtrs.begin();
+		navMeshLocationPtrIter != mNavMeshLocationPtrs.end(); ++navMeshLocationPtrIter)
+	{
+		NavMeshLocationPtr navMeshLocationPtr = *navMeshLocationPtrIter;
+		navMeshLocationPtr->enable();
+	}
+}
+
+void LLPathfindingNavMeshZone::disable()
+{
+	for (NavMeshLocationPtrs::iterator navMeshLocationPtrIter = mNavMeshLocationPtrs.begin();
+		navMeshLocationPtrIter != mNavMeshLocationPtrs.end(); ++navMeshLocationPtrIter)
+	{
+		NavMeshLocationPtr navMeshLocationPtr = *navMeshLocationPtrIter;
+		navMeshLocationPtr->disable();
+	}
+}
+
+void LLPathfindingNavMeshZone::refresh()
+{
+	if (LLPathingLib::getInstance() != NULL)
+	{
+		LLPathingLib::getInstance()->cleanupResidual();
+	}
+
+	for (NavMeshLocationPtrs::iterator navMeshLocationPtrIter = mNavMeshLocationPtrs.begin();
+		navMeshLocationPtrIter != mNavMeshLocationPtrs.end(); ++navMeshLocationPtrIter)
+	{
+		NavMeshLocationPtr navMeshLocationPtr = *navMeshLocationPtrIter;
+		navMeshLocationPtr->refresh();
+	}
+}
+
+LLPathfindingNavMeshZone::ENavMeshZoneStatus LLPathfindingNavMeshZone::getNavMeshZoneStatus() const
+{
+	bool hasPending = false;
+	bool hasBuilding = false;
+	bool hasComplete = false;
+	bool hasRepending = false;
+
+	for (NavMeshLocationPtrs::const_iterator navMeshLocationPtrIter = mNavMeshLocationPtrs.begin();
+		navMeshLocationPtrIter != mNavMeshLocationPtrs.end(); ++navMeshLocationPtrIter)
+	{
+		const NavMeshLocationPtr navMeshLocationPtr = *navMeshLocationPtrIter;
+
+		switch (navMeshLocationPtr->getNavMeshStatus())
+		{
+		case LLPathfindingNavMeshStatus::kPending :
+			hasPending = true;
+			break;
+		case LLPathfindingNavMeshStatus::kBuilding :
+			hasBuilding = true;
+			break;
+		case LLPathfindingNavMeshStatus::kComplete :
+			hasComplete = true;
+			break;
+		case LLPathfindingNavMeshStatus::kRepending :
+			hasRepending = true;
+			break;
+		default :
+			hasPending = true;
+			llassert(0);
+			break;
+		}
+	}
+
+	ENavMeshZoneStatus zoneStatus = kNavMeshZoneComplete;
+	if (hasRepending || (hasPending && hasBuilding))
+	{
+		zoneStatus = kNavMeshZonePendingAndBuilding;
+	}
+	else if (hasComplete)
+	{
+		if (hasPending)
+		{
+			zoneStatus = kNavMeshZoneSomePending;
+		}
+		else if (hasBuilding)
+		{
+			zoneStatus = kNavMeshZoneSomeBuilding;
+		}
+		else
+		{
+			zoneStatus = kNavMeshZoneComplete;
+		}
+	}
+	else if (hasPending)
+	{
+		zoneStatus = kNavMeshZonePending;
+	}
+	else if (hasBuilding)
+	{
+		zoneStatus = kNavMeshZoneBuilding;
+	}
+
+	return zoneStatus;
+}
+
+void LLPathfindingNavMeshZone::handleNavMeshLocation()
+{
+	updateStatus();
+}
+
+void LLPathfindingNavMeshZone::updateStatus()
+{
+	bool hasRequestUnknown = false;
+	bool hasRequestWaiting = false;
+	bool hasRequestChecking = false;
+	bool hasRequestNeedsUpdate = false;
+	bool hasRequestStarted = false;
+	bool hasRequestCompleted = false;
+	bool hasRequestNotEnabled = false;
+	bool hasRequestError = false;
+
+	for (NavMeshLocationPtrs::const_iterator navMeshLocationPtrIter = mNavMeshLocationPtrs.begin();
+		navMeshLocationPtrIter != mNavMeshLocationPtrs.end(); ++navMeshLocationPtrIter)
+	{
+		const NavMeshLocationPtr navMeshLocationPtr = *navMeshLocationPtrIter;
+		switch (navMeshLocationPtr->getRequestStatus())
+		{
+		case LLPathfindingNavMesh::kNavMeshRequestUnknown :
+			hasRequestUnknown = true;
+			break;
+		case LLPathfindingNavMesh::kNavMeshRequestWaiting :
+			hasRequestWaiting = true;
+			break;
+		case LLPathfindingNavMesh::kNavMeshRequestChecking :
+			hasRequestChecking = true;
+			break;
+		case LLPathfindingNavMesh::kNavMeshRequestNeedsUpdate :
+			hasRequestNeedsUpdate = true;
+			break;
+		case LLPathfindingNavMesh::kNavMeshRequestStarted :
+			hasRequestStarted = true;
+			break;
+		case LLPathfindingNavMesh::kNavMeshRequestCompleted :
+			hasRequestCompleted = true;
+			break;
+		case LLPathfindingNavMesh::kNavMeshRequestNotEnabled :
+			hasRequestNotEnabled = true;
+			break;
+		case LLPathfindingNavMesh::kNavMeshRequestError :
+			hasRequestError = true;
+			break;
+		default :
+			hasRequestError = true;
+			llassert(0);
+			break;
+		}
+	}
+
+	ENavMeshZoneRequestStatus zoneRequestStatus = kNavMeshZoneRequestUnknown;
+	if (hasRequestWaiting)
+	{
+		zoneRequestStatus = kNavMeshZoneRequestWaiting;
+	}
+	else if (hasRequestNeedsUpdate)
+	{
+		zoneRequestStatus = kNavMeshZoneRequestNeedsUpdate;
+	}
+	else if (hasRequestChecking)
+	{
+		zoneRequestStatus = kNavMeshZoneRequestChecking;
+	}
+	else if (hasRequestStarted)
+	{
+		zoneRequestStatus = kNavMeshZoneRequestStarted;
+	}
+	else if (hasRequestError)
+	{
+		zoneRequestStatus = kNavMeshZoneRequestError;
+	}
+	else if (hasRequestUnknown)
+	{
+		zoneRequestStatus = kNavMeshZoneRequestUnknown;
+	}
+	else if (hasRequestCompleted)
+	{
+		zoneRequestStatus = kNavMeshZoneRequestCompleted;
+	}
+	else if (hasRequestNotEnabled)
+	{
+		zoneRequestStatus = kNavMeshZoneRequestNotEnabled;
+	}
+	else
+	{
+		zoneRequestStatus = kNavMeshZoneRequestError;
+		llassert(0);
+	}
+
+	if ((mNavMeshZoneRequestStatus != kNavMeshZoneRequestCompleted) &&
+		(zoneRequestStatus == kNavMeshZoneRequestCompleted))
+	{
+		llassert(LLPathingLib::getInstance() != NULL);
+		if (LLPathingLib::getInstance() != NULL)
+		{
+			LLPathingLib::getInstance()->processNavMeshData();
+		}
+	}
+
+	mNavMeshZoneRequestStatus = zoneRequestStatus;
+	mNavMeshZoneSignal(mNavMeshZoneRequestStatus);
+}
+
+//---------------------------------------------------------------------------
+// LLPathfindingNavMeshZone::NavMeshLocation
+//---------------------------------------------------------------------------
+
+LLPathfindingNavMeshZone::NavMeshLocation::NavMeshLocation(S32 pDirection, navmesh_location_callback_t pLocationCallback)
+	: mDirection(pDirection),
+	mRegionUUID(),
+	mHasNavMesh(false),
+	mNavMeshVersion(0U),
+	mNavMeshStatus(LLPathfindingNavMeshStatus::kComplete),
+	mLocationCallback(pLocationCallback),
+	mRequestStatus(LLPathfindingNavMesh::kNavMeshRequestUnknown),
+	mNavMeshSlot()
+{
+}
+
+LLPathfindingNavMeshZone::NavMeshLocation::~NavMeshLocation()
+{
+}
+
+void LLPathfindingNavMeshZone::NavMeshLocation::enable()
+{
+	clear();
+
+	LLViewerRegion *region = getRegion();
+	if (region == NULL)
+	{
+		mRegionUUID.setNull();
+	}
+	else
+	{
+		mRegionUUID = region->getRegionID();
+		mNavMeshSlot = LLPathfindingManager::getInstance()->registerNavMeshListenerForRegion(region, boost::bind(&LLPathfindingNavMeshZone::NavMeshLocation::handleNavMesh, this, _1, _2, _3));
+	}
+}
+
+void LLPathfindingNavMeshZone::NavMeshLocation::refresh()
+{
+	LLViewerRegion *region = getRegion();
+
+	if (region == NULL)
+	{
+		llassert(mRegionUUID.isNull());
+		LLPathfindingNavMeshStatus newNavMeshStatus(mRegionUUID);
+		LLSD::Binary nullData;
+		handleNavMesh(LLPathfindingNavMesh::kNavMeshRequestNotEnabled, newNavMeshStatus, nullData);
+	}
+	else
+	{
+		llassert(mRegionUUID == region->getRegionID());
+		LLPathfindingManager::getInstance()->requestGetNavMeshForRegion(region, false);
+	}
+}
+
+void LLPathfindingNavMeshZone::NavMeshLocation::disable()
+{
+	clear();
+}
+
+LLPathfindingNavMesh::ENavMeshRequestStatus LLPathfindingNavMeshZone::NavMeshLocation::getRequestStatus() const
+{
+	return mRequestStatus;
+}
+
+LLPathfindingNavMeshStatus::ENavMeshStatus LLPathfindingNavMeshZone::NavMeshLocation::getNavMeshStatus() const
+{
+	return mNavMeshStatus;
+}
+
+void LLPathfindingNavMeshZone::NavMeshLocation::handleNavMesh(LLPathfindingNavMesh::ENavMeshRequestStatus pNavMeshRequestStatus, const LLPathfindingNavMeshStatus &pNavMeshStatus, const LLSD::Binary &pNavMeshData)
+{
+	llassert(mRegionUUID == pNavMeshStatus.getRegionUUID());
+
+	if ((pNavMeshRequestStatus == LLPathfindingNavMesh::kNavMeshRequestCompleted) &&
+		(!mHasNavMesh || (mNavMeshVersion != pNavMeshStatus.getVersion())))
+	{
+		llassert(!pNavMeshData.empty());
+		mHasNavMesh = true;
+		mNavMeshVersion = pNavMeshStatus.getVersion();
+		llassert(LLPathingLib::getInstance() != NULL);
+		if (LLPathingLib::getInstance() != NULL)
+		{
+			LLPathingLib::getInstance()->extractNavMeshSrcFromLLSD(pNavMeshData, mDirection);
+		}
+	}
+
+	mRequestStatus = pNavMeshRequestStatus;
+	mNavMeshStatus = pNavMeshStatus.getStatus();
+	mLocationCallback();
+}
+
+void LLPathfindingNavMeshZone::NavMeshLocation::clear()
+{
+	mHasNavMesh = false;
+	mRequestStatus = LLPathfindingNavMesh::kNavMeshRequestUnknown;
+	mNavMeshStatus = LLPathfindingNavMeshStatus::kComplete;
+	if (mNavMeshSlot.connected())
+	{
+		mNavMeshSlot.disconnect();
+	}
+}
+
+LLViewerRegion *LLPathfindingNavMeshZone::NavMeshLocation::getRegion() const
+{
+	LLViewerRegion *region = NULL;
+
+	LLViewerRegion *currentRegion = gAgent.getRegion();
+	if (currentRegion != NULL)
+	{
+		if (mDirection == CENTER_REGION)
+		{
+			region = currentRegion;
+		}
+		else
+		{
+			//User wants to pull in a neighboring region
+			std::vector<S32> availableRegions;
+			currentRegion->getNeighboringRegionsStatus( availableRegions );
+			//Is the desired region in the available list
+			std::vector<S32>::iterator foundElem = std::find(availableRegions.begin(),availableRegions.end(),mDirection); 
+			if ( foundElem != availableRegions.end() )
+			{
+				std::vector<LLViewerRegion*> neighborRegionsPtrs;
+				currentRegion->getNeighboringRegions( neighborRegionsPtrs );
+				region = neighborRegionsPtrs[foundElem - availableRegions.begin()];
+			}
+		}
+	}
+
+	return region;
+}
diff --git a/indra/newview/llpathfindingnavmeshzone.h b/indra/newview/llpathfindingnavmeshzone.h
new file mode 100644
index 0000000000000000000000000000000000000000..baa1cc59799d4e51e1aac97dd513b55e6a2dc34c
--- /dev/null
+++ b/indra/newview/llpathfindingnavmeshzone.h
@@ -0,0 +1,128 @@
+/** 
+* @file   llpathfindingnavmeshzone.h
+* @brief  Header file for llpathfindingnavmeshzone
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+* $/LicenseInfo$
+*/
+#ifndef LL_LLPATHFINDINGNAVMESHZONE_H
+#define LL_LLPATHFINDINGNAVMESHZONE_H
+
+#include <vector>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/function.hpp>
+#include <boost/signals2.hpp>
+
+#include "llpathfindingnavmesh.h"
+#include "llpathfindingnavmeshstatus.h"
+#include "llsd.h"
+#include "lluuid.h"
+
+class LLViewerRegion;
+
+class LLPathfindingNavMeshZone
+{
+public:
+	typedef enum {
+		kNavMeshZoneRequestUnknown,
+		kNavMeshZoneRequestWaiting,
+		kNavMeshZoneRequestChecking,
+		kNavMeshZoneRequestNeedsUpdate,
+		kNavMeshZoneRequestStarted,
+		kNavMeshZoneRequestCompleted,
+		kNavMeshZoneRequestNotEnabled,
+		kNavMeshZoneRequestError
+	} ENavMeshZoneRequestStatus;
+
+	typedef enum {
+		kNavMeshZonePending,
+		kNavMeshZoneBuilding,
+		kNavMeshZoneSomePending,
+		kNavMeshZoneSomeBuilding,
+		kNavMeshZonePendingAndBuilding,
+		kNavMeshZoneComplete
+	} ENavMeshZoneStatus;
+
+	typedef boost::function<void (ENavMeshZoneRequestStatus)>         navmesh_zone_callback_t;
+	typedef boost::signals2::signal<void (ENavMeshZoneRequestStatus)> navmesh_zone_signal_t;
+	typedef boost::signals2::connection                               navmesh_zone_slot_t;
+
+	LLPathfindingNavMeshZone();
+	virtual ~LLPathfindingNavMeshZone();
+
+	navmesh_zone_slot_t registerNavMeshZoneListener(navmesh_zone_callback_t pNavMeshZoneCallback);
+	void initialize();
+
+	void enable();
+	void disable();
+	void refresh();
+
+	ENavMeshZoneStatus getNavMeshZoneStatus() const;
+
+protected:
+
+private:
+	typedef boost::function<void (void)> navmesh_location_callback_t;
+	class NavMeshLocation
+	{
+	public:
+		NavMeshLocation(S32 pDirection, navmesh_location_callback_t pLocationCallback);
+		virtual ~NavMeshLocation();
+
+		void enable();
+		void refresh();
+		void disable();
+
+		LLPathfindingNavMesh::ENavMeshRequestStatus getRequestStatus() const;
+		LLPathfindingNavMeshStatus::ENavMeshStatus  getNavMeshStatus() const;
+
+	protected:
+
+	private:
+		void           handleNavMesh(LLPathfindingNavMesh::ENavMeshRequestStatus pNavMeshRequestStatus, const LLPathfindingNavMeshStatus &pNavMeshStatus, const LLSD::Binary &pNavMeshData);
+
+		void           clear();
+		LLViewerRegion *getRegion() const;
+
+		S32                                         mDirection;
+		LLUUID                                      mRegionUUID;
+		bool                                        mHasNavMesh;
+		U32                                         mNavMeshVersion;
+		LLPathfindingNavMeshStatus::ENavMeshStatus  mNavMeshStatus;
+		navmesh_location_callback_t                 mLocationCallback;
+		LLPathfindingNavMesh::ENavMeshRequestStatus mRequestStatus;
+		LLPathfindingNavMesh::navmesh_slot_t        mNavMeshSlot;
+	};
+
+	typedef boost::shared_ptr<NavMeshLocation> NavMeshLocationPtr;
+	typedef std::vector<NavMeshLocationPtr> NavMeshLocationPtrs;
+
+	void handleNavMeshLocation();
+	void updateStatus();
+
+	NavMeshLocationPtrs       mNavMeshLocationPtrs;
+	ENavMeshZoneRequestStatus mNavMeshZoneRequestStatus;
+	navmesh_zone_signal_t     mNavMeshZoneSignal;
+};
+
+#endif // LL_LLPATHFINDINGNAVMESHZONE_H
diff --git a/indra/newview/llpathfindingobject.cpp b/indra/newview/llpathfindingobject.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..916eceb4c899bfca34f1e59cd2b0d108ce7be24d
--- /dev/null
+++ b/indra/newview/llpathfindingobject.cpp
@@ -0,0 +1,162 @@
+/** 
+* @file llpathfindingobject.cpp
+* @brief Implementation of llpathfindingobject
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, 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 "llpathfindingobject.h"
+
+#include <string>
+
+#include "llavatarname.h"
+#include "llavatarnamecache.h"
+#include "llsd.h"
+#include "lluuid.h"
+#include "v3math.h"
+
+#define PATHFINDING_OBJECT_NAME_FIELD           "name"
+#define PATHFINDING_OBJECT_DESCRIPTION_FIELD    "description"
+#define PATHFINDING_OBJECT_OWNER_FIELD          "owner"
+#define PATHFINDING_OBJECT_POSITION_FIELD       "position"
+#define PATHFINDING_OBJECT_IS_GROUP_OWNED_FIELD "owner_is_group"
+
+//---------------------------------------------------------------------------
+// LLPathfindingObject
+//---------------------------------------------------------------------------
+
+LLPathfindingObject::LLPathfindingObject()
+	: mUUID(),
+	mName(),
+	mDescription(),
+	mOwnerUUID(),
+	mHasOwnerName(false),
+	mOwnerName(),
+	mIsGroupOwned(false),
+	mLocation()
+{
+}
+
+LLPathfindingObject::LLPathfindingObject(const std::string &pUUID, const LLSD &pObjectData)
+	: mUUID(pUUID),
+	mName(),
+	mDescription(),
+	mOwnerUUID(),
+	mHasOwnerName(false),
+	mOwnerName(),
+	mIsGroupOwned(false),
+	mLocation()
+{
+	parseObjectData(pObjectData);
+}
+
+LLPathfindingObject::LLPathfindingObject(const LLPathfindingObject& pOther)
+	: mUUID(pOther.mUUID),
+	mName(pOther.mName),
+	mDescription(pOther.mDescription),
+	mOwnerUUID(pOther.mOwnerUUID),
+	mHasOwnerName(false),
+	mOwnerName(),
+	mIsGroupOwned(pOther.mIsGroupOwned),
+	mLocation(pOther.mLocation)
+{
+	fetchOwnerName();
+}
+
+LLPathfindingObject::~LLPathfindingObject()
+{
+}
+
+LLPathfindingObject &LLPathfindingObject::operator =(const LLPathfindingObject& pOther)
+{
+	mUUID = pOther.mUUID;
+	mName = pOther.mName;
+	mDescription = pOther.mDescription;
+	mOwnerUUID = pOther.mOwnerUUID;
+	fetchOwnerName();
+	mIsGroupOwned = pOther.mIsGroupOwned;
+	mLocation = pOther.mLocation;
+
+	return *this;
+}
+
+std::string LLPathfindingObject::getOwnerName() const
+{
+	std::string ownerName;
+
+	if (hasOwner())
+	{
+		ownerName = mOwnerName.getCompleteName();
+	}
+
+	return ownerName;
+}
+
+void LLPathfindingObject::parseObjectData(const LLSD &pObjectData)
+{
+	llassert(pObjectData.has(PATHFINDING_OBJECT_NAME_FIELD));
+	llassert(pObjectData.get(PATHFINDING_OBJECT_NAME_FIELD).isString());
+	mName = pObjectData.get(PATHFINDING_OBJECT_NAME_FIELD).asString();
+	
+	llassert(pObjectData.has(PATHFINDING_OBJECT_DESCRIPTION_FIELD));
+	llassert(pObjectData.get(PATHFINDING_OBJECT_DESCRIPTION_FIELD).isString());
+	mDescription = pObjectData.get(PATHFINDING_OBJECT_DESCRIPTION_FIELD).asString();
+
+	llassert(pObjectData.has(PATHFINDING_OBJECT_OWNER_FIELD));
+	llassert(pObjectData.get(PATHFINDING_OBJECT_OWNER_FIELD).isUUID());
+	mOwnerUUID = pObjectData.get(PATHFINDING_OBJECT_OWNER_FIELD).asUUID();
+	fetchOwnerName();
+
+	if (pObjectData.has(PATHFINDING_OBJECT_IS_GROUP_OWNED_FIELD))
+	{
+		llassert(pObjectData.get(PATHFINDING_OBJECT_IS_GROUP_OWNED_FIELD).isBoolean());
+		mIsGroupOwned = pObjectData.get(PATHFINDING_OBJECT_IS_GROUP_OWNED_FIELD).asBoolean();
+	}
+
+	llassert(pObjectData.has(PATHFINDING_OBJECT_POSITION_FIELD));
+	llassert(pObjectData.get(PATHFINDING_OBJECT_POSITION_FIELD).isArray());
+	mLocation.setValue(pObjectData.get(PATHFINDING_OBJECT_POSITION_FIELD));
+}
+
+void LLPathfindingObject::fetchOwnerName()
+{
+	mHasOwnerName = false;
+	if (hasOwner())
+	{
+		mHasOwnerName = LLAvatarNameCache::get(mOwnerUUID, &mOwnerName);
+		if (!mHasOwnerName)
+		{
+			LLAvatarNameCache::get(mOwnerUUID, boost::bind(&LLPathfindingObject::handleAvatarNameFetch, this, _1, _2));
+		}
+	}
+}
+
+void LLPathfindingObject::handleAvatarNameFetch(const LLUUID &pOwnerUUID, const LLAvatarName &pAvatarName)
+{
+	llassert(mOwnerUUID == pOwnerUUID);
+	mOwnerName = pAvatarName;
+	mHasOwnerName = true;
+}
diff --git a/indra/newview/llpathfindingobject.h b/indra/newview/llpathfindingobject.h
new file mode 100644
index 0000000000000000000000000000000000000000..d45cc554fd793d15919ef9e52733603594ab43e8
--- /dev/null
+++ b/indra/newview/llpathfindingobject.h
@@ -0,0 +1,80 @@
+/** 
+* @file   llpathfindingobject.h
+* @brief  Header file for llpathfindingobject
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+* $/LicenseInfo$
+*/
+#ifndef LL_LLPATHFINDINGOBJECT_H
+#define LL_LLPATHFINDINGOBJECT_H
+
+#include <string>
+
+#include <boost/shared_ptr.hpp>
+
+#include "llavatarname.h"
+#include "lluuid.h"
+#include "v3math.h"
+
+class LLPathfindingObject;
+class LLSD;
+
+typedef boost::shared_ptr<LLPathfindingObject> LLPathfindingObjectPtr;
+
+class LLPathfindingObject
+{
+public:
+	LLPathfindingObject();
+	LLPathfindingObject(const std::string &pUUID, const LLSD &pObjectData);
+	LLPathfindingObject(const LLPathfindingObject& pOther);
+	virtual ~LLPathfindingObject();
+
+	LLPathfindingObject& operator =(const LLPathfindingObject& pOther);
+
+	inline const LLUUID&      getUUID() const        {return mUUID;};
+	inline const std::string& getName() const        {return mName;};
+	inline const std::string& getDescription() const {return mDescription;};
+	inline BOOL               hasOwner() const       {return mOwnerUUID.notNull();};
+	inline bool               hasOwnerName() const   {return mHasOwnerName;};
+	std::string               getOwnerName() const;
+	inline BOOL               isGroupOwned() const   {return mIsGroupOwned;};
+	inline const LLVector3&   getLocation() const    {return mLocation;};
+
+protected:
+
+private:
+	void parseObjectData(const LLSD &pObjectData);
+
+	void fetchOwnerName();
+	void handleAvatarNameFetch(const LLUUID &pOwnerUUID, const LLAvatarName &pAvatarName);
+
+	LLUUID       mUUID;
+	std::string  mName;
+	std::string  mDescription;
+	LLUUID       mOwnerUUID;
+	bool         mHasOwnerName;
+	LLAvatarName mOwnerName;
+	BOOL         mIsGroupOwned;
+	LLVector3    mLocation;
+};
+
+#endif // LL_LLPATHFINDINGOBJECT_H
diff --git a/indra/newview/llpathfindingobjectlist.cpp b/indra/newview/llpathfindingobjectlist.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..68a7e736e61327d5b995fcf804e6ed2ce039c36d
--- /dev/null
+++ b/indra/newview/llpathfindingobjectlist.cpp
@@ -0,0 +1,112 @@
+/** 
+* @file llpathfindingobjectlist.cpp
+* @brief Implementation of llpathfindingobjectlist
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, 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 "llpathfindingobjectlist.h"
+
+#include <string>
+#include <map>
+
+#include "llpathfindingobject.h"
+
+//---------------------------------------------------------------------------
+// LLPathfindingObjectList
+//---------------------------------------------------------------------------
+
+LLPathfindingObjectList::LLPathfindingObjectList()
+	: mObjectMap()
+{
+}
+
+LLPathfindingObjectList::~LLPathfindingObjectList()
+{
+}
+
+bool LLPathfindingObjectList::isEmpty() const
+{
+	return mObjectMap.empty();
+}
+
+void LLPathfindingObjectList::update(LLPathfindingObjectPtr pUpdateObjectPtr)
+{
+	if (pUpdateObjectPtr != NULL)
+	{
+		std::string updateObjectId = pUpdateObjectPtr->getUUID().asString();
+
+		LLPathfindingObjectMap::iterator foundObjectIter = mObjectMap.find(updateObjectId);
+		if (foundObjectIter == mObjectMap.end())
+		{
+			mObjectMap.insert(std::pair<std::string, LLPathfindingObjectPtr>(updateObjectId, pUpdateObjectPtr));
+		}
+		else
+		{
+			foundObjectIter->second = pUpdateObjectPtr;
+		}
+	}
+}
+
+void LLPathfindingObjectList::update(LLPathfindingObjectListPtr pUpdateObjectListPtr)
+{
+	if ((pUpdateObjectListPtr != NULL) && !pUpdateObjectListPtr->isEmpty())
+	{
+		for (LLPathfindingObjectMap::const_iterator updateObjectIter = pUpdateObjectListPtr->begin();
+			updateObjectIter != pUpdateObjectListPtr->end(); ++updateObjectIter)
+		{
+			const LLPathfindingObjectPtr updateObjectPtr = updateObjectIter->second;
+			update(updateObjectPtr);
+		}
+	}
+}
+
+LLPathfindingObjectPtr LLPathfindingObjectList::find(const std::string &pObjectId) const
+{
+	LLPathfindingObjectPtr objectPtr;
+
+	LLPathfindingObjectMap::const_iterator objectIter = mObjectMap.find(pObjectId);
+	if (objectIter != mObjectMap.end())
+	{
+		objectPtr = objectIter->second;
+	}
+
+	return objectPtr;
+}
+
+LLPathfindingObjectList::const_iterator LLPathfindingObjectList::begin() const
+{
+	return mObjectMap.begin();
+}
+
+LLPathfindingObjectList::const_iterator LLPathfindingObjectList::end() const
+{
+	return mObjectMap.end();
+}
+
+LLPathfindingObjectMap &LLPathfindingObjectList::getObjectMap()
+{
+	return mObjectMap;
+}
diff --git a/indra/newview/llpathfindingobjectlist.h b/indra/newview/llpathfindingobjectlist.h
new file mode 100644
index 0000000000000000000000000000000000000000..3ad8e8b096357c574db5fd1d275fb366fed77bda
--- /dev/null
+++ b/indra/newview/llpathfindingobjectlist.h
@@ -0,0 +1,67 @@
+/** 
+* @file   llpathfindingobjectlist.h
+* @brief  Header file for llpathfindingobjectlist
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+* $/LicenseInfo$
+*/
+#ifndef LL_LLPATHFINDINGOBJECTLIST_H
+#define LL_LLPATHFINDINGOBJECTLIST_H
+
+#include <string>
+#include <map>
+
+#include <boost/shared_ptr.hpp>
+
+#include "llpathfindingobject.h"
+
+class LLPathfindingObjectList;
+
+typedef boost::shared_ptr<LLPathfindingObjectList> LLPathfindingObjectListPtr;
+typedef std::map<std::string, LLPathfindingObjectPtr> LLPathfindingObjectMap;
+
+class LLPathfindingObjectList
+{
+public:
+	LLPathfindingObjectList();
+	virtual ~LLPathfindingObjectList();
+
+	bool isEmpty() const;
+
+	void update(LLPathfindingObjectPtr pUpdateObjectPtr);
+	void update(LLPathfindingObjectListPtr pUpdateObjectListPtr);
+
+	LLPathfindingObjectPtr find(const std::string &pObjectId) const;
+
+	typedef LLPathfindingObjectMap::const_iterator const_iterator;
+	const_iterator begin() const;
+	const_iterator end() const;
+
+
+protected:
+	LLPathfindingObjectMap &getObjectMap();
+
+private:
+	LLPathfindingObjectMap mObjectMap;
+};
+
+#endif // LL_LLPATHFINDINGOBJECTLIST_H
diff --git a/indra/newview/llpathfindingpathtool.cpp b/indra/newview/llpathfindingpathtool.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..006755e20b1c48952c202a5f83e7f8270ba5efb3
--- /dev/null
+++ b/indra/newview/llpathfindingpathtool.cpp
@@ -0,0 +1,467 @@
+/** 
+* @file llpathfindingpathtool.cpp
+* @brief Implementation of llpathfindingpathtool
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, 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 "llpathfindingpathtool.h"
+
+#include <boost/function.hpp>
+#include <boost/signals2.hpp>
+
+#include "llagent.h"
+#include "llpathfindingmanager.h"
+#include "llpathinglib.h"
+#include "llsingleton.h"
+#include "lltool.h"
+#include "llviewercamera.h"
+#include "llviewerregion.h"
+#include "llviewerwindow.h"
+
+#define PATH_TOOL_NAME "PathfindingPathTool"
+
+LLPathfindingPathTool::LLPathfindingPathTool()
+	: LLTool(PATH_TOOL_NAME),
+	LLSingleton<LLPathfindingPathTool>(),
+	mFinalPathData(),
+	mTempPathData(),
+	mPathResult(LLPathingLib::LLPL_NO_PATH),
+	mCharacterType(kCharacterTypeNone),
+	mPathEventSignal(),
+	mIsLeftMouseButtonHeld(false),
+	mIsMiddleMouseButtonHeld(false),
+	mIsRightMouseButtonHeld(false)
+{
+	setCharacterWidth(1.0f);
+	setCharacterType(mCharacterType);
+}
+
+LLPathfindingPathTool::~LLPathfindingPathTool()
+{
+}
+
+BOOL LLPathfindingPathTool::handleMouseDown(S32 pX, S32 pY, MASK pMask)
+{
+	BOOL returnVal = FALSE;
+
+	if (!mIsLeftMouseButtonHeld && !mIsMiddleMouseButtonHeld && !mIsRightMouseButtonHeld)
+	{
+		if (isAnyPathToolModKeys(pMask))
+		{
+			gViewerWindow->setCursor(isPointAModKeys(pMask)
+				? UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD
+				: UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD);
+			computeFinalPoints(pX, pY, pMask);
+			mIsLeftMouseButtonHeld = true;
+			setMouseCapture(TRUE);
+			returnVal = TRUE;
+		}
+		else if (!isCameraModKeys(pMask))
+		{
+			gViewerWindow->setCursor(UI_CURSOR_TOOLNO);
+			mIsLeftMouseButtonHeld = true;
+			setMouseCapture(TRUE);
+			returnVal = TRUE;
+		}
+	}
+	mIsLeftMouseButtonHeld = true;
+
+	return returnVal;
+}
+
+BOOL LLPathfindingPathTool::handleMouseUp(S32 pX, S32 pY, MASK pMask)
+{
+	BOOL returnVal = FALSE;
+
+	if (mIsLeftMouseButtonHeld && !mIsMiddleMouseButtonHeld && !mIsRightMouseButtonHeld)
+	{
+		computeFinalPoints(pX, pY, pMask);
+		setMouseCapture(FALSE);
+		returnVal = TRUE;
+	}
+	mIsLeftMouseButtonHeld = false;
+
+	return returnVal;
+}
+
+BOOL LLPathfindingPathTool::handleMiddleMouseDown(S32 pX, S32 pY, MASK pMask)
+{
+	setMouseCapture(TRUE);
+	mIsMiddleMouseButtonHeld = true;
+	gViewerWindow->setCursor(UI_CURSOR_TOOLNO);
+
+	return TRUE;
+}
+
+BOOL LLPathfindingPathTool::handleMiddleMouseUp(S32 pX, S32 pY, MASK pMask)
+{
+	if (!mIsLeftMouseButtonHeld && mIsMiddleMouseButtonHeld && !mIsRightMouseButtonHeld)
+	{
+		setMouseCapture(FALSE);
+	}
+	mIsMiddleMouseButtonHeld = false;
+
+	return TRUE;
+}
+
+BOOL LLPathfindingPathTool::handleRightMouseDown(S32 pX, S32 pY, MASK pMask)
+{
+	setMouseCapture(TRUE);
+	mIsRightMouseButtonHeld = true;
+	gViewerWindow->setCursor(UI_CURSOR_TOOLNO);
+
+	return TRUE;
+}
+
+BOOL LLPathfindingPathTool::handleRightMouseUp(S32 pX, S32 pY, MASK pMask)
+{
+	if (!mIsLeftMouseButtonHeld && !mIsMiddleMouseButtonHeld && mIsRightMouseButtonHeld)
+	{
+		setMouseCapture(FALSE);
+	}
+	mIsRightMouseButtonHeld = false;
+
+	return TRUE;
+}
+
+BOOL LLPathfindingPathTool::handleDoubleClick(S32 pX, S32 pY, MASK pMask)
+{
+	return TRUE;
+}
+
+BOOL LLPathfindingPathTool::handleHover(S32 pX, S32 pY, MASK pMask)
+{
+	BOOL returnVal = FALSE;
+
+	if (!mIsLeftMouseButtonHeld && !mIsMiddleMouseButtonHeld && !mIsRightMouseButtonHeld && !isAnyPathToolModKeys(pMask))
+	{
+		gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING);
+	}
+
+	if (!mIsMiddleMouseButtonHeld && !mIsRightMouseButtonHeld && isAnyPathToolModKeys(pMask))
+	{
+		gViewerWindow->setCursor(isPointAModKeys(pMask)
+			? (mIsLeftMouseButtonHeld ? UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD : UI_CURSOR_TOOLPATHFINDING_PATH_START)
+			: (mIsLeftMouseButtonHeld ? UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD : UI_CURSOR_TOOLPATHFINDING_PATH_END));
+		computeTempPoints(pX, pY, pMask);
+		returnVal = TRUE;
+	}
+	else
+	{
+		clearTemp();
+		computeFinalPath();
+	}
+
+	return returnVal;
+}
+
+BOOL LLPathfindingPathTool::handleKey(KEY pKey, MASK pMask)
+{
+	// Eat the escape key or else the camera tool will pick up and reset to default view.  This,
+	// in turn, will cause some other methods to get called.  And one of those methods will reset
+	// the current toolset back to the basic toolset.  This means that the pathfinding path toolset
+	// will no longer be active, but typically with pathfinding path elements on screen.
+	return (pKey == KEY_ESCAPE);
+}
+
+LLPathfindingPathTool::EPathStatus LLPathfindingPathTool::getPathStatus() const
+{
+	EPathStatus status = kPathStatusUnknown;
+
+	if (LLPathingLib::getInstance() == NULL)
+	{
+		status = kPathStatusNotImplemented;
+	}
+	else if ((gAgent.getRegion() != NULL) && !gAgent.getRegion()->capabilitiesReceived())
+	{
+		status = kPathStatusUnknown;
+	}
+	else if (!LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion())
+	{
+		status = kPathStatusNotEnabled;
+	}
+	else if (!hasFinalA() && !hasFinalB())
+	{
+		status = kPathStatusChooseStartAndEndPoints;
+	}
+	else if (!hasFinalA())
+	{
+		status = kPathStatusChooseStartPoint;
+	}
+	else if (!hasFinalB())
+	{
+		status = kPathStatusChooseEndPoint;
+	}
+	else if (mPathResult == LLPathingLib::LLPL_PATH_GENERATED_OK)
+	{
+		status = kPathStatusHasValidPath;
+	}
+	else if (mPathResult == LLPathingLib::LLPL_NO_PATH)
+	{
+		status = kPathStatusHasInvalidPath;
+	}
+	else
+	{
+		status = kPathStatusError;
+	}
+
+	return status;
+}
+
+F32 LLPathfindingPathTool::getCharacterWidth() const
+{
+	return mFinalPathData.mCharacterWidth;
+}
+
+void LLPathfindingPathTool::setCharacterWidth(F32 pCharacterWidth)
+{
+	mFinalPathData.mCharacterWidth = pCharacterWidth;
+	mTempPathData.mCharacterWidth = pCharacterWidth;
+	computeFinalPath();
+}
+
+LLPathfindingPathTool::ECharacterType LLPathfindingPathTool::getCharacterType() const
+{
+	return mCharacterType;
+}
+
+void LLPathfindingPathTool::setCharacterType(ECharacterType pCharacterType)
+{
+	mCharacterType = pCharacterType;
+
+	LLPathingLib::LLPLCharacterType characterType;
+	switch (pCharacterType)
+	{
+	case kCharacterTypeNone :
+		characterType = LLPathingLib::LLPL_CHARACTER_TYPE_NONE;
+		break;
+	case kCharacterTypeA :
+		characterType = LLPathingLib::LLPL_CHARACTER_TYPE_A;
+		break;
+	case kCharacterTypeB :
+		characterType = LLPathingLib::LLPL_CHARACTER_TYPE_B;
+		break;
+	case kCharacterTypeC :
+		characterType = LLPathingLib::LLPL_CHARACTER_TYPE_C;
+		break;
+	case kCharacterTypeD :
+		characterType = LLPathingLib::LLPL_CHARACTER_TYPE_D;
+		break;
+	default :
+		characterType = LLPathingLib::LLPL_CHARACTER_TYPE_NONE;
+		llassert(0);
+		break;
+	}
+	mFinalPathData.mCharacterType = characterType;
+	mTempPathData.mCharacterType = characterType;
+	computeFinalPath();
+}
+
+bool LLPathfindingPathTool::isRenderPath() const
+{
+	return (hasFinalA() || hasFinalB() || hasTempA() || hasTempB());
+}
+
+void LLPathfindingPathTool::clearPath()
+{
+	clearFinal();
+	clearTemp();
+	computeFinalPath();
+}
+
+LLPathfindingPathTool::path_event_slot_t LLPathfindingPathTool::registerPathEventListener(path_event_callback_t pPathEventCallback)
+{
+	return mPathEventSignal.connect(pPathEventCallback);
+}
+
+bool LLPathfindingPathTool::isAnyPathToolModKeys(MASK pMask) const
+{
+	return ((pMask & (MASK_CONTROL|MASK_SHIFT)) != 0);
+}
+
+bool LLPathfindingPathTool::isPointAModKeys(MASK pMask) const
+{
+	return ((pMask & MASK_CONTROL) != 0);
+}
+
+bool LLPathfindingPathTool::isPointBModKeys(MASK pMask) const
+{
+	return ((pMask & MASK_SHIFT) != 0);
+}
+
+bool LLPathfindingPathTool::isCameraModKeys(MASK pMask) const
+{
+	return ((pMask & MASK_ALT) != 0);
+}
+
+void LLPathfindingPathTool::getRayPoints(S32 pX, S32 pY, LLVector3 &pRayStart, LLVector3 &pRayEnd) const
+{
+	LLVector3 dv = gViewerWindow->mouseDirectionGlobal(pX, pY);
+	LLVector3 mousePos = LLViewerCamera::getInstance()->getOrigin();
+	pRayStart = mousePos;
+	pRayEnd = mousePos + dv * 150;
+}
+
+void LLPathfindingPathTool::computeFinalPoints(S32 pX, S32 pY, MASK pMask)
+{
+	LLVector3 rayStart, rayEnd;
+	getRayPoints(pX, pY, rayStart, rayEnd);
+
+	if (isPointAModKeys(pMask))
+	{
+		setFinalA(rayStart, rayEnd);
+	}
+	else if (isPointBModKeys(pMask))
+	{
+		setFinalB(rayStart, rayEnd);
+	}
+	computeFinalPath();
+}
+
+void LLPathfindingPathTool::computeTempPoints(S32 pX, S32 pY, MASK pMask)
+{
+	LLVector3 rayStart, rayEnd;
+	getRayPoints(pX, pY, rayStart, rayEnd);
+
+	if (isPointAModKeys(pMask))
+	{
+		setTempA(rayStart, rayEnd);
+		if (hasFinalB())
+		{
+			setTempB(getFinalBStart(), getFinalBEnd());
+		}
+	}
+	else if (isPointBModKeys(pMask))
+	{
+		if (hasFinalA())
+		{
+			setTempA(getFinalAStart(), getFinalAEnd());
+		}
+		setTempB(rayStart, rayEnd);
+	}
+	computeTempPath();
+}
+
+void LLPathfindingPathTool::setFinalA(const LLVector3 &pStartPoint, const LLVector3 &pEndPoint)
+{
+	mFinalPathData.mStartPointA = pStartPoint;
+	mFinalPathData.mEndPointA = pEndPoint;
+	mFinalPathData.mHasPointA = true;
+}
+
+bool LLPathfindingPathTool::hasFinalA() const
+{
+	return mFinalPathData.mHasPointA;
+}
+
+const LLVector3 &LLPathfindingPathTool::getFinalAStart() const
+{
+	return mFinalPathData.mStartPointA;
+}
+
+const LLVector3 &LLPathfindingPathTool::getFinalAEnd() const
+{
+	return mFinalPathData.mEndPointA;
+}
+
+void LLPathfindingPathTool::setTempA(const LLVector3 &pStartPoint, const LLVector3 &pEndPoint)
+{
+	mTempPathData.mStartPointA = pStartPoint;
+	mTempPathData.mEndPointA = pEndPoint;
+	mTempPathData.mHasPointA = true;
+}
+
+bool LLPathfindingPathTool::hasTempA() const
+{
+	return mTempPathData.mHasPointA;
+}
+
+void LLPathfindingPathTool::setFinalB(const LLVector3 &pStartPoint, const LLVector3 &pEndPoint)
+{
+	mFinalPathData.mStartPointB = pStartPoint;
+	mFinalPathData.mEndPointB = pEndPoint;
+	mFinalPathData.mHasPointB = true;
+}
+
+bool LLPathfindingPathTool::hasFinalB() const
+{
+	return mFinalPathData.mHasPointB;
+}
+
+const LLVector3 &LLPathfindingPathTool::getFinalBStart() const
+{
+	return mFinalPathData.mStartPointB;
+}
+
+const LLVector3 &LLPathfindingPathTool::getFinalBEnd() const
+{
+	return mFinalPathData.mEndPointB;
+}
+
+void LLPathfindingPathTool::setTempB(const LLVector3 &pStartPoint, const LLVector3 &pEndPoint)
+{
+	mTempPathData.mStartPointB = pStartPoint;
+	mTempPathData.mEndPointB = pEndPoint;
+	mTempPathData.mHasPointB = true;
+}
+
+bool LLPathfindingPathTool::hasTempB() const
+{
+	return mTempPathData.mHasPointB;
+}
+
+void LLPathfindingPathTool::clearFinal()
+{
+	mFinalPathData.mHasPointA = false;
+	mFinalPathData.mHasPointB = false;
+}
+
+void LLPathfindingPathTool::clearTemp()
+{
+	mTempPathData.mHasPointA = false;
+	mTempPathData.mHasPointB = false;
+}
+
+void LLPathfindingPathTool::computeFinalPath()
+{
+	mPathResult = LLPathingLib::LLPL_NO_PATH;
+	if (LLPathingLib::getInstance() != NULL)
+	{
+		mPathResult = LLPathingLib::getInstance()->generatePath(mFinalPathData);
+	}
+	mPathEventSignal();
+}
+
+void LLPathfindingPathTool::computeTempPath()
+{
+	mPathResult = LLPathingLib::LLPL_NO_PATH;
+	if (LLPathingLib::getInstance() != NULL)
+	{
+		mPathResult = LLPathingLib::getInstance()->generatePath(mTempPathData);
+	}
+	mPathEventSignal();
+}
diff --git a/indra/newview/llpathfindingpathtool.h b/indra/newview/llpathfindingpathtool.h
new file mode 100644
index 0000000000000000000000000000000000000000..97284265f19b0d4327de284b82b0dee170fbe41c
--- /dev/null
+++ b/indra/newview/llpathfindingpathtool.h
@@ -0,0 +1,138 @@
+/** 
+* @file   llpathfindingpathtool.h
+* @brief  Header file for llpathfindingpathtool
+* @author Stinson@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+* $/LicenseInfo$
+*/
+#ifndef LL_LLPATHFINDINGPATHTOOL_H
+#define LL_LLPATHFINDINGPATHTOOL_H
+
+#include <boost/function.hpp>
+#include <boost/signals2.hpp>
+
+#include "llpathinglib.h"
+#include "llsingleton.h"
+#include "lltool.h"
+
+class LLPathfindingPathTool : public LLTool, public LLSingleton<LLPathfindingPathTool>
+{
+public:
+	typedef enum
+	{
+		kPathStatusUnknown,
+		kPathStatusChooseStartAndEndPoints,
+		kPathStatusChooseStartPoint,
+		kPathStatusChooseEndPoint,
+		kPathStatusHasValidPath,
+		kPathStatusHasInvalidPath,
+		kPathStatusNotEnabled,
+		kPathStatusNotImplemented,
+		kPathStatusError
+	} EPathStatus;
+
+	typedef enum
+	{
+		kCharacterTypeNone,
+		kCharacterTypeA,
+		kCharacterTypeB,
+		kCharacterTypeC,
+		kCharacterTypeD
+	} ECharacterType;
+
+	LLPathfindingPathTool();
+	virtual ~LLPathfindingPathTool();
+
+	typedef boost::function<void (void)>         path_event_callback_t;
+	typedef boost::signals2::signal<void (void)> path_event_signal_t;
+	typedef boost::signals2::connection          path_event_slot_t;
+
+	virtual BOOL      handleMouseDown(S32 pX, S32 pY, MASK pMask);
+	virtual BOOL      handleMouseUp(S32 pX, S32 pY, MASK pMask);
+	virtual BOOL      handleMiddleMouseDown(S32 pX, S32 pY, MASK pMask);
+	virtual BOOL      handleMiddleMouseUp(S32 pX, S32 pY, MASK pMask);
+	virtual BOOL      handleRightMouseDown(S32 pX, S32 pY, MASK pMask);
+	virtual BOOL      handleRightMouseUp(S32 pX, S32 pY, MASK pMask);
+	virtual BOOL      handleDoubleClick(S32 x, S32 y, MASK mask);
+
+	virtual BOOL      handleHover(S32 pX, S32 pY, MASK pMask);
+
+	virtual BOOL      handleKey(KEY pKey, MASK pMask);
+
+	EPathStatus       getPathStatus() const;
+
+	F32               getCharacterWidth() const;
+	void              setCharacterWidth(F32 pCharacterWidth);
+
+	ECharacterType    getCharacterType() const;
+	void              setCharacterType(ECharacterType pCharacterType);
+
+	bool              isRenderPath() const;
+	void              clearPath();
+
+	path_event_slot_t registerPathEventListener(path_event_callback_t pPathEventCallback);
+
+protected:
+
+private:
+	bool              isAnyPathToolModKeys(MASK pMask) const;
+	bool              isPointAModKeys(MASK pMask) const;
+	bool              isPointBModKeys(MASK pMask) const;
+	bool              isCameraModKeys(MASK pMask) const;
+
+	void              getRayPoints(S32 pX, S32 pY, LLVector3 &pRayStart, LLVector3 &pRayEnd) const;
+	void              computeFinalPoints(S32 pX, S32 pY, MASK pMask);
+	void              computeTempPoints(S32 pX, S32 pY, MASK pMask);
+
+	void              setFinalA(const LLVector3 &pStartPoint, const LLVector3 &pEndPoint);
+	bool              hasFinalA() const;
+	const LLVector3   &getFinalAStart() const;
+	const LLVector3   &getFinalAEnd() const;
+
+	void              setTempA(const LLVector3 &pStartPoint, const LLVector3 &pEndPoint);
+	bool              hasTempA() const;
+
+	void              setFinalB(const LLVector3 &pStartPoint, const LLVector3 &pEndPoint);
+	bool              hasFinalB() const;
+	const LLVector3   &getFinalBStart() const;
+	const LLVector3   &getFinalBEnd() const;
+
+	void              setTempB(const LLVector3 &pStartPoint, const LLVector3 &pEndPoint);
+	bool              hasTempB() const;
+
+	void              clearFinal();
+	void              clearTemp();
+
+	void              computeFinalPath();
+	void              computeTempPath();
+
+	LLPathingLib::PathingPacket mFinalPathData;
+	LLPathingLib::PathingPacket mTempPathData;
+	LLPathingLib::LLPLResult    mPathResult;
+	ECharacterType              mCharacterType;
+	path_event_signal_t         mPathEventSignal;
+	bool                        mIsLeftMouseButtonHeld;
+	bool                        mIsMiddleMouseButtonHeld;
+	bool                        mIsRightMouseButtonHeld;
+};
+
+#endif // LL_LLPATHFINDINGPATHTOOL_H
diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp
index e124916c48095131afcec1dc09e9bb0e78a02139..cb6989c9dde1c42c7bb8c1d1a084ab36c573b515 100644
--- a/indra/newview/llphysicsmotion.cpp
+++ b/indra/newview/llphysicsmotion.cpp
@@ -67,6 +67,19 @@ inline F64 llsgn(const F64 a)
 class LLPhysicsMotion
 {
 public:
+	typedef enum
+	{
+		SMOOTHING = 0,
+		MASS,
+		GRAVITY,
+		SPRING,
+		GAIN,
+		DAMPING,
+		DRAG,
+		MAX_EFFECT,
+		NUM_PARAMS
+	} eParamName;
+
         /*
           param_driver_name: The param that controls the params that are being affected by the physics.
           joint_name: The joint that the body part is attached to.  The joint is
@@ -98,6 +111,11 @@ class LLPhysicsMotion
                 mPositionLastUpdate_local(0)
         {
                 mJointState = new LLJointState;
+
+				for (U32 i = 0; i < NUM_PARAMS; ++i)
+				{
+					mParamCache[i] = NULL;
+				}
         }
 
         BOOL initialize();
@@ -111,16 +129,43 @@ class LLPhysicsMotion
                 return mJointState;
         }
 protected:
-        F32 getParamValue(const std::string& controller_key)
-        {
-                const controller_map_t::const_iterator& entry = mParamControllers.find(controller_key);
+
+		F32 getParamValue(eParamName param)
+		{
+			static std::string controller_key[] = 
+			{
+				"Smoothing",
+				"Mass",
+				"Gravity",
+				"Spring",
+				"Gain",
+				"Damping",
+				"Drag",
+				"MaxEffect"
+			};
+
+			if (!mParamCache[param])
+			{
+				const controller_map_t::const_iterator& entry = mParamControllers.find(controller_key[param]);
                 if (entry == mParamControllers.end())
                 {
-                        return sDefaultController[controller_key];
+                        return sDefaultController[controller_key[param]];
                 }
                 const std::string& param_name = (*entry).second.c_str();
-                return mCharacter->getVisualParamWeight(param_name.c_str());
-        }
+                mParamCache[param] = mCharacter->getVisualParam(param_name.c_str());
+			}
+				
+			if (mParamCache[param])
+			{
+				return mParamCache[param]->getWeight();
+			}
+			else
+			{
+				return sDefaultController[controller_key[param]];
+			}
+		}
+
+        
         void setParamValue(LLViewerVisualParam *param,
                            const F32 new_value_local,
                                                    F32 behavior_maxeffect);
@@ -150,6 +195,8 @@ class LLPhysicsMotion
 
         F32 mLastTime;
         
+		LLVisualParam* mParamCache[NUM_PARAMS];
+
         static default_controller_map_t sDefaultController;
 };
 
@@ -427,7 +474,6 @@ BOOL LLPhysicsMotionController::onUpdate(F32 time, U8* joint_mask)
         return TRUE;
 }
 
-
 // Return TRUE if character has to update visual params.
 BOOL LLPhysicsMotion::onUpdate(F32 time)
 {
@@ -471,15 +517,16 @@ BOOL LLPhysicsMotion::onUpdate(F32 time)
 
         LLJoint *joint = mJointState->getJoint();
 
-        const F32 behavior_mass = getParamValue("Mass");
-        const F32 behavior_gravity = getParamValue("Gravity");
-        const F32 behavior_spring = getParamValue("Spring");
-        const F32 behavior_gain = getParamValue("Gain");
-        const F32 behavior_damping = getParamValue("Damping");
-        const F32 behavior_drag = getParamValue("Drag");
-        const BOOL physics_test = FALSE; // Enable this to simulate bouncing on all parts.
+		const F32 behavior_mass = getParamValue(MASS);
+		const F32 behavior_gravity = getParamValue(GRAVITY);
+		const F32 behavior_spring = getParamValue(SPRING);
+		const F32 behavior_gain = getParamValue(GAIN);
+		const F32 behavior_damping = getParamValue(DAMPING);
+		const F32 behavior_drag = getParamValue(DRAG);
+		F32 behavior_maxeffect = getParamValue(MAX_EFFECT);
+		
+		const BOOL physics_test = FALSE; // Enable this to simulate bouncing on all parts.
         
-        F32 behavior_maxeffect = getParamValue("MaxEffect");
         if (physics_test)
                 behavior_maxeffect = 1.0f;
 
diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp
index 450f9b2be7238a61f594dee75d7a1a3416f3a46e..70f3b5335e2ea332d2bdfc7ca6fe3b1793c13de6 100644
--- a/indra/newview/llpolymesh.cpp
+++ b/indra/newview/llpolymesh.cpp
@@ -129,22 +129,22 @@ void LLPolyMeshSharedData::freeMeshData()
         {
                 mNumVertices = 0;
 
-                delete [] mBaseCoords;
+                ll_aligned_free_16(mBaseCoords);
                 mBaseCoords = NULL;
 
-                delete [] mBaseNormals;
+                ll_aligned_free_16(mBaseNormals);
                 mBaseNormals = NULL;
 
-                delete [] mBaseBinormals;
+                ll_aligned_free_16(mBaseBinormals);
                 mBaseBinormals = NULL;
 
-                delete [] mTexCoords;
+                ll_aligned_free_16(mTexCoords);
                 mTexCoords = NULL;
 
-                delete [] mDetailTexCoords;
+                ll_aligned_free_16(mDetailTexCoords);
                 mDetailTexCoords = NULL;
 
-                delete [] mWeights;
+                ll_aligned_free_16(mWeights);
                 mWeights = NULL;
         }
 
@@ -229,15 +229,19 @@ U32 LLPolyMeshSharedData::getNumKB()
 BOOL LLPolyMeshSharedData::allocateVertexData( U32 numVertices )
 {
         U32 i;
-        mBaseCoords = new LLVector3[ numVertices ];
-        mBaseNormals = new LLVector3[ numVertices ];
-        mBaseBinormals = new LLVector3[ numVertices ];
-        mTexCoords = new LLVector2[ numVertices ];
-        mDetailTexCoords = new LLVector2[ numVertices ];
-        mWeights = new F32[ numVertices ];
+        mBaseCoords = (LLVector4a*) ll_aligned_malloc_16(numVertices*sizeof(LLVector4a));
+        mBaseNormals = (LLVector4a*) ll_aligned_malloc_16(numVertices*sizeof(LLVector4a));
+        mBaseBinormals = (LLVector4a*) ll_aligned_malloc_16(numVertices*sizeof(LLVector4a));
+        mTexCoords = (LLVector2*) ll_aligned_malloc_16(numVertices*sizeof(LLVector2));
+        mDetailTexCoords = (LLVector2*) ll_aligned_malloc_16(numVertices*sizeof(LLVector2));
+        mWeights = (F32*) ll_aligned_malloc_16(numVertices*sizeof(F32));
         for (i = 0; i < numVertices; i++)
         {
-                mWeights[i] = 0.f;
+			mBaseCoords[i].clear();
+			mBaseNormals[i].clear();
+			mBaseBinormals[i].clear();
+			mTexCoords[i].clear();
+            mWeights[i] = 0.f;
         }
         mNumVertices = numVertices;
         return TRUE;
@@ -408,39 +412,47 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
 
                         allocateVertexData( numVertices );      
 
-                        //----------------------------------------------------------------
-                        // Coords
-                        //----------------------------------------------------------------
-                        numRead = fread(mBaseCoords, 3*sizeof(float), numVertices, fp);
-                        llendianswizzle(mBaseCoords, sizeof(float), 3*numVertices);
-                        if (numRead != numVertices)
-                        {
-                                llerrs << "can't read Coordinates from " << fileName << llendl;
-                                return FALSE;
-                        }
-
-                        //----------------------------------------------------------------
-                        // Normals
-                        //----------------------------------------------------------------
-                        numRead = fread(mBaseNormals, 3*sizeof(float), numVertices, fp);
-                        llendianswizzle(mBaseNormals, sizeof(float), 3*numVertices);
-                        if (numRead != numVertices)
-                        {
-                                llerrs << " can't read Normals from " << fileName << llendl;
-                                return FALSE;
-                        }
-
-                        //----------------------------------------------------------------
-                        // Binormals
-                        //----------------------------------------------------------------
-                        numRead = fread(mBaseBinormals, 3*sizeof(float), numVertices, fp);
-                        llendianswizzle(mBaseBinormals, sizeof(float), 3*numVertices);
-                        if (numRead != numVertices)
-                        {
-                                llerrs << " can't read Binormals from " << fileName << llendl;
-                                return FALSE;
-                        }
-
+						for (U16 i = 0; i < numVertices; ++i)
+						{
+							//----------------------------------------------------------------
+							// Coords
+							//----------------------------------------------------------------
+							numRead = fread(&mBaseCoords[i], sizeof(float), 3, fp);
+							llendianswizzle(&mBaseCoords[i], sizeof(float), 3);
+							if (numRead != 3)
+							{
+									llerrs << "can't read Coordinates from " << fileName << llendl;
+									return FALSE;
+							}
+						}
+
+						for (U16 i = 0; i < numVertices; ++i)
+						{
+							//----------------------------------------------------------------
+							// Normals
+							//----------------------------------------------------------------
+							numRead = fread(&mBaseNormals[i], sizeof(float), 3, fp);
+							llendianswizzle(&mBaseNormals[i], sizeof(float), 3);
+							if (numRead != 3)
+							{
+									llerrs << " can't read Normals from " << fileName << llendl;
+									return FALSE;
+							}
+						}
+
+						for (U16 i = 0; i < numVertices; ++i)
+						{
+							//----------------------------------------------------------------
+							// Binormals
+							//----------------------------------------------------------------
+							numRead = fread(&mBaseBinormals[i], sizeof(float), 3, fp);
+							llendianswizzle(&mBaseBinormals[i], sizeof(float), 3);
+							if (numRead != 3)
+							{
+									llerrs << " can't read Binormals from " << fileName << llendl;
+									return FALSE;
+							}
+						}
 
                         //----------------------------------------------------------------
                         // TexCoords
@@ -767,21 +779,28 @@ LLPolyMesh::LLPolyMesh(LLPolyMeshSharedData *shared_data, LLPolyMesh *reference_
 	{
 		// Allocate memory without initializing every vector
 		// NOTE: This makes asusmptions about the size of LLVector[234]
-		int nverts = mSharedData->mNumVertices;
-		int nfloats = nverts * (2*4 + 3*3 + 2 + 4);
+		S32 nverts = mSharedData->mNumVertices;
+		//make sure it's an even number of verts for alignment
+		nverts += nverts%2;
+		S32 nfloats = nverts * (
+					4 + //coords
+					4 + //normals
+					4 + //weights
+					2 + //coords
+					4 + //scaled normals
+					4 + //binormals
+					4); //scaled binormals
+
 		//use 16 byte aligned vertex data to make LLPolyMesh SSE friendly
 		mVertexData = (F32*) ll_aligned_malloc_16(nfloats*4);
-		int offset = 0;
-		mCoords				= 	(LLVector4*)(mVertexData + offset); offset += 4*nverts;
-		mNormals			=	(LLVector4*)(mVertexData + offset); offset += 4*nverts;
-		mClothingWeights	= 	(LLVector4*)(mVertexData + offset); offset += 4*nverts;
-		mTexCoords			= 	(LLVector2*)(mVertexData + offset); offset += 2*nverts;
-
-		// these members don't need to be 16-byte aligned, but the first one might be
-		// read during an aligned memcpy of mTexCoords
-		mScaledNormals =                (LLVector3*)(mVertexData + offset); offset += 3*nverts;
-		mBinormals =                    (LLVector3*)(mVertexData + offset); offset += 3*nverts;
-		mScaledBinormals =              (LLVector3*)(mVertexData + offset); offset += 3*nverts; 
+		S32 offset = 0;
+		mCoords				= 	(LLVector4a*)(mVertexData + offset); offset += 4*nverts;
+		mNormals			=	(LLVector4a*)(mVertexData + offset); offset += 4*nverts;
+		mClothingWeights	= 	(LLVector4a*)(mVertexData + offset); offset += 4*nverts;
+		mTexCoords			= 	(LLVector2*)(mVertexData + offset);  offset += 2*nverts;
+		mScaledNormals		=   (LLVector4a*)(mVertexData + offset); offset += 4*nverts;
+		mBinormals			=   (LLVector4a*)(mVertexData + offset); offset += 4*nverts;
+		mScaledBinormals	=   (LLVector4a*)(mVertexData + offset); offset += 4*nverts; 
 		initializeForMorph();
 	}
 }
@@ -906,7 +925,7 @@ void LLPolyMesh::dumpDiagInfo()
 //-----------------------------------------------------------------------------
 // getWritableCoords()
 //-----------------------------------------------------------------------------
-LLVector4 *LLPolyMesh::getWritableCoords()
+LLVector4a *LLPolyMesh::getWritableCoords()
 {
         return mCoords;
 }
@@ -914,7 +933,7 @@ LLVector4 *LLPolyMesh::getWritableCoords()
 //-----------------------------------------------------------------------------
 // getWritableNormals()
 //-----------------------------------------------------------------------------
-LLVector4 *LLPolyMesh::getWritableNormals()
+LLVector4a *LLPolyMesh::getWritableNormals()
 {
         return mNormals;
 }
@@ -922,7 +941,7 @@ LLVector4 *LLPolyMesh::getWritableNormals()
 //-----------------------------------------------------------------------------
 // getWritableBinormals()
 //-----------------------------------------------------------------------------
-LLVector3 *LLPolyMesh::getWritableBinormals()
+LLVector4a *LLPolyMesh::getWritableBinormals()
 {
         return mBinormals;
 }
@@ -931,7 +950,7 @@ LLVector3 *LLPolyMesh::getWritableBinormals()
 //-----------------------------------------------------------------------------
 // getWritableClothingWeights()
 //-----------------------------------------------------------------------------
-LLVector4       *LLPolyMesh::getWritableClothingWeights()
+LLVector4a       *LLPolyMesh::getWritableClothingWeights()
 {
         return mClothingWeights;
 }
@@ -947,7 +966,7 @@ LLVector2       *LLPolyMesh::getWritableTexCoords()
 //-----------------------------------------------------------------------------
 // getScaledNormals()
 //-----------------------------------------------------------------------------
-LLVector3 *LLPolyMesh::getScaledNormals()
+LLVector4a *LLPolyMesh::getScaledNormals()
 {
         return mScaledNormals;
 }
@@ -955,7 +974,7 @@ LLVector3 *LLPolyMesh::getScaledNormals()
 //-----------------------------------------------------------------------------
 // getScaledBinormals()
 //-----------------------------------------------------------------------------
-LLVector3 *LLPolyMesh::getScaledBinormals()
+LLVector4a *LLPolyMesh::getScaledBinormals()
 {
         return mScaledBinormals;
 }
@@ -966,17 +985,17 @@ LLVector3 *LLPolyMesh::getScaledBinormals()
 //-----------------------------------------------------------------------------
 void LLPolyMesh::initializeForMorph()
 {
-    for (U32 i = 0; i < mSharedData->mNumVertices; ++i)
+    LLVector4a::memcpyNonAliased16((F32*) mCoords, (F32*) mSharedData->mBaseCoords, sizeof(LLVector4a) * mSharedData->mNumVertices);
+	LLVector4a::memcpyNonAliased16((F32*) mNormals, (F32*) mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices);
+	LLVector4a::memcpyNonAliased16((F32*) mScaledNormals, (F32*) mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices);
+	LLVector4a::memcpyNonAliased16((F32*) mBinormals, (F32*) mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices);
+	LLVector4a::memcpyNonAliased16((F32*) mScaledBinormals, (F32*) mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices);
+	LLVector4a::memcpyNonAliased16((F32*) mTexCoords, (F32*) mSharedData->mTexCoords, sizeof(LLVector2) * (mSharedData->mNumVertices + mSharedData->mNumVertices%2));
+
+	for (U32 i = 0; i < mSharedData->mNumVertices; ++i)
 	{
-		mCoords[i] = LLVector4(mSharedData->mBaseCoords[i]);
-		mNormals[i] = LLVector4(mSharedData->mBaseNormals[i]);
+		mClothingWeights[i].clear();
 	}
-
-	memcpy(mScaledNormals, mSharedData->mBaseNormals, sizeof(LLVector3) * mSharedData->mNumVertices);	/*Flawfinder: ignore*/
-	memcpy(mBinormals, mSharedData->mBaseBinormals, sizeof(LLVector3) * mSharedData->mNumVertices);	/*Flawfinder: ignore*/
-	memcpy(mScaledBinormals, mSharedData->mBaseBinormals, sizeof(LLVector3) * mSharedData->mNumVertices);		/*Flawfinder: ignore*/
-	memcpy(mTexCoords, mSharedData->mTexCoords, sizeof(LLVector2) * mSharedData->mNumVertices);		/*Flawfinder: ignore*/
-	memset(mClothingWeights, 0, sizeof(LLVector4) * mSharedData->mNumVertices);
 }
 
 //-----------------------------------------------------------------------------
@@ -1098,7 +1117,7 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
 LLPolySkeletalDistortion::LLPolySkeletalDistortion(LLVOAvatar *avatarp)
 {
         mAvatar = avatarp;
-        mDefaultVec.setVec(0.001f, 0.001f, 0.001f);
+        mDefaultVec.splat(0.001f);
 }
 
 //-----------------------------------------------------------------------------
@@ -1171,8 +1190,12 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
 //-----------------------------------------------------------------------------
 // apply()
 //-----------------------------------------------------------------------------
+static LLFastTimer::DeclareTimer FTM_POLYSKELETAL_DISTORTION_APPLY("Skeletal Distortion");
+
 void LLPolySkeletalDistortion::apply( ESex avatar_sex )
 {
+	LLFastTimer t(FTM_POLYSKELETAL_DISTORTION_APPLY);
+
         F32 effective_weight = ( getSex() & avatar_sex ) ? mCurWeight : getDefaultWeight();
 
         LLJoint* joint;
@@ -1228,11 +1251,14 @@ LLPolyMorphData *clone_morph_param_direction(const LLPolyMorphData *src_data,
 {
         LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*src_data);
         cloned_morph_data->mName = name;
+		LLVector4a dir;
+		dir.load3(direction.mV);
+
         for (U32 v=0; v < cloned_morph_data->mNumIndices; v++)
         {
-                cloned_morph_data->mCoords[v] = direction;
-                cloned_morph_data->mNormals[v] = LLVector3(0,0,0);
-                cloned_morph_data->mBinormals[v] = LLVector3(0,0,0);
+                cloned_morph_data->mCoords[v] = dir;
+                cloned_morph_data->mNormals[v].clear();
+                cloned_morph_data->mBinormals[v].clear();
         }
         return cloned_morph_data;
 }
@@ -1243,17 +1269,27 @@ LLPolyMorphData *clone_morph_param_cleavage(const LLPolyMorphData *src_data,
 {
         LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*src_data);
         cloned_morph_data->mName = name;
+
+		LLVector4a sc;
+		sc.splat(scale);
+
+		LLVector4a nsc;
+		nsc.set(scale, -scale, scale, scale);
+
         for (U32 v=0; v < cloned_morph_data->mNumIndices; v++)
         {
-                cloned_morph_data->mCoords[v] = src_data->mCoords[v]*scale;
-                cloned_morph_data->mNormals[v] = src_data->mNormals[v]*scale;
-                cloned_morph_data->mBinormals[v] = src_data->mBinormals[v]*scale;
-                if (cloned_morph_data->mCoords[v][1] < 0)
-                {
-                        cloned_morph_data->mCoords[v][1] *= -1;
-                        cloned_morph_data->mNormals[v][1] *= -1;
-                        cloned_morph_data->mBinormals[v][1] *= -1;
-                }
+            if (cloned_morph_data->mCoords[v][1] < 0)
+            {
+                cloned_morph_data->mCoords[v].setMul(src_data->mCoords[v],nsc);
+				cloned_morph_data->mNormals[v].setMul(src_data->mNormals[v],nsc);
+				cloned_morph_data->mBinormals[v].setMul(src_data->mBinormals[v],nsc);
+			}
+			else
+			{
+				cloned_morph_data->mCoords[v].setMul(src_data->mCoords[v],sc);
+				cloned_morph_data->mNormals[v].setMul(src_data->mNormals[v], sc);
+				cloned_morph_data->mBinormals[v].setMul(src_data->mBinormals[v],sc);
+			}
         }
         return cloned_morph_data;
 }
diff --git a/indra/newview/llpolymesh.h b/indra/newview/llpolymesh.h
index ba2bf85570379834083d498a7adef65c4cf6dee9..ffb11a3f7ea7261590b8e74e3f681ca40a7c7f7f 100644
--- a/indra/newview/llpolymesh.h
+++ b/indra/newview/llpolymesh.h
@@ -73,9 +73,9 @@ class LLPolyMeshSharedData
 							
 	// vertex data			
 	S32						mNumVertices;
-	LLVector3				*mBaseCoords;
-	LLVector3				*mBaseNormals;
-	LLVector3				*mBaseBinormals;
+	LLVector4a				*mBaseCoords;
+	LLVector4a				*mBaseNormals;
+	LLVector4a				*mBaseBinormals;
 	LLVector2				*mTexCoords;
 	LLVector2				*mDetailTexCoords;
 	F32						*mWeights;
@@ -217,41 +217,41 @@ class LLPolyMesh
 	}
 
 	// Get coords
-	const LLVector4	*getCoords() const{
+	const LLVector4a	*getCoords() const{
 		return mCoords;
 	}
 
 	// non const version
-	LLVector4 *getWritableCoords();
+	LLVector4a *getWritableCoords();
 
 	// Get normals
-	const LLVector4	*getNormals() const{ 
+	const LLVector4a	*getNormals() const{ 
 		return mNormals; 
 	}
 
 	// Get normals
-	const LLVector3	*getBinormals() const{ 
+	const LLVector4a	*getBinormals() const{ 
 		return mBinormals; 
 	}
 
 	// Get base mesh normals
-	const LLVector3 *getBaseNormals() const{
+	const LLVector4a *getBaseNormals() const{
 		llassert(mSharedData);
 		return mSharedData->mBaseNormals;
 	}
 
 	// Get base mesh normals
-	const LLVector3 *getBaseBinormals() const{
+	const LLVector4a *getBaseBinormals() const{
 		llassert(mSharedData);
 		return mSharedData->mBaseBinormals;
 	}
 
 	// intermediate morphed normals and output normals
-	LLVector4 *getWritableNormals();
-	LLVector3 *getScaledNormals();
+	LLVector4a *getWritableNormals();
+	LLVector4a *getScaledNormals();
 
-	LLVector3 *getWritableBinormals();
-	LLVector3 *getScaledBinormals();
+	LLVector4a *getWritableBinormals();
+	LLVector4a *getScaledBinormals();
 
 	// Get texCoords
 	const LLVector2	*getTexCoords() const { 
@@ -275,9 +275,9 @@ class LLPolyMesh
 
 	F32			*getWritableWeights() const;
 
-	LLVector4	*getWritableClothingWeights();
+	LLVector4a	*getWritableClothingWeights();
 
-	const LLVector4		*getClothingWeights()
+	const LLVector4a		*getClothingWeights()
 	{
 		return mClothingWeights;	
 	}
@@ -341,17 +341,17 @@ class LLPolyMesh
 	// Single array of floats for allocation / deletion
 	F32						*mVertexData;
 	// deformed vertices (resulting from application of morph targets)
-	LLVector4				*mCoords;
+	LLVector4a				*mCoords;
 	// deformed normals (resulting from application of morph targets)
-	LLVector3				*mScaledNormals;
+	LLVector4a				*mScaledNormals;
 	// output normals (after normalization)
-	LLVector4				*mNormals;
+	LLVector4a				*mNormals;
 	// deformed binormals (resulting from application of morph targets)
-	LLVector3				*mScaledBinormals;
+	LLVector4a				*mScaledBinormals;
 	// output binormals (after normalization)
-	LLVector3				*mBinormals;
+	LLVector4a				*mBinormals;
 	// weight values that mark verts as clothing/skin
-	LLVector4				*mClothingWeights;
+	LLVector4a				*mClothingWeights;
 	// output texture coordinates
 	LLVector2				*mTexCoords;
 	
@@ -419,17 +419,17 @@ class LLPolySkeletalDistortion : public LLViewerVisualParam
 	
 	// LLViewerVisualParam Virtual functions
 	/*virtual*/ F32					getTotalDistortion() { return 0.1f; }
-	/*virtual*/ const LLVector3&	getAvgDistortion()	{ return mDefaultVec; }
+	/*virtual*/ const LLVector4a&	getAvgDistortion()	{ return mDefaultVec; }
 	/*virtual*/ F32					getMaxDistortion() { return 0.1f; }
-	/*virtual*/ LLVector3			getVertexDistortion(S32 index, LLPolyMesh *poly_mesh){return LLVector3(0.001f, 0.001f, 0.001f);}
-	/*virtual*/ const LLVector3*	getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh){index = 0; poly_mesh = NULL; return &mDefaultVec;};
-	/*virtual*/ const LLVector3*	getNextDistortion(U32 *index, LLPolyMesh **poly_mesh){index = 0; poly_mesh = NULL; return NULL;};
+	/*virtual*/ LLVector4a			getVertexDistortion(S32 index, LLPolyMesh *poly_mesh){return LLVector4a(0.001f, 0.001f, 0.001f);}
+	/*virtual*/ const LLVector4a*	getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh){index = 0; poly_mesh = NULL; return &mDefaultVec;};
+	/*virtual*/ const LLVector4a*	getNextDistortion(U32 *index, LLPolyMesh **poly_mesh){index = 0; poly_mesh = NULL; return NULL;};
 
 protected:
 	typedef std::map<LLJoint*, LLVector3> joint_vec_map_t;
 	joint_vec_map_t mJointScales;
 	joint_vec_map_t mJointOffsets;
-	LLVector3	mDefaultVec;
+	LLVector4a	mDefaultVec;
 	// Backlink only; don't make this an LLPointer.
 	LLVOAvatar *mAvatar;
 };
diff --git a/indra/newview/llpolymorph.cpp b/indra/newview/llpolymorph.cpp
index cefd7df3febf7d1496de7fa630aa53078e0adbe8..d25d1420ee07ad8e54c3451b03bee0ca19864265 100644
--- a/indra/newview/llpolymorph.cpp
+++ b/indra/newview/llpolymorph.cpp
@@ -48,7 +48,7 @@ LLPolyMorphData::LLPolyMorphData(const std::string& morph_name)
 	mNumIndices = 0;
 	mCurrentIndex = 0;
 	mTotalDistortion = 0.f;
-	mAvgDistortion.zeroVec();
+	mAvgDistortion.clear();
 	mMaxDistortion = 0.f;
 	mVertexIndices = NULL;
 	mCoords = NULL;
@@ -73,9 +73,9 @@ LLPolyMorphData::LLPolyMorphData(const LLPolyMorphData &rhs) :
 {
 	const S32 numVertices = mNumIndices;
 
-	mCoords = new LLVector3[numVertices];
-	mNormals = new LLVector3[numVertices];
-	mBinormals = new LLVector3[numVertices];
+	mCoords = new LLVector4a[numVertices];
+	mNormals = new LLVector4a[numVertices];
+	mBinormals = new LLVector4a[numVertices];
 	mTexCoords = new LLVector2[numVertices];
 	mVertexIndices = new U32[numVertices];
 	
@@ -121,16 +121,16 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
 	//-------------------------------------------------------------------------
 	// allocate vertices
 	//-------------------------------------------------------------------------
-	mCoords = new LLVector3[numVertices];
-	mNormals = new LLVector3[numVertices];
-	mBinormals = new LLVector3[numVertices];
+	mCoords = new LLVector4a[numVertices];
+	mNormals = new LLVector4a[numVertices];
+	mBinormals = new LLVector4a[numVertices];
 	mTexCoords = new LLVector2[numVertices];
 	// Actually, we are allocating more space than we need for the skiplist
 	mVertexIndices = new U32[numVertices];
 	mNumIndices = 0;
 	mTotalDistortion = 0.f;
 	mMaxDistortion = 0.f;
-	mAvgDistortion.zeroVec();
+	mAvgDistortion.clear();
 	mMesh = mesh;
 
 	//-------------------------------------------------------------------------
@@ -152,36 +152,36 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
 		}
 
 
-		numRead = fread(&mCoords[v].mV, sizeof(F32), 3, fp);
-		llendianswizzle(&mCoords[v].mV, sizeof(F32), 3);
+		numRead = fread(&mCoords[v], sizeof(F32), 3, fp);
+		llendianswizzle(&mCoords[v], sizeof(F32), 3);
 		if (numRead != 3)
 		{
 			llwarns << "Can't read morph target vertex coordinates" << llendl;
 			return FALSE;
 		}
 
-		F32 magnitude = mCoords[v].magVec();
+		F32 magnitude = mCoords[v].getLength3().getF32();
 		
 		mTotalDistortion += magnitude;
-		mAvgDistortion.mV[VX] += fabs(mCoords[v].mV[VX]);
-		mAvgDistortion.mV[VY] += fabs(mCoords[v].mV[VY]);
-		mAvgDistortion.mV[VZ] += fabs(mCoords[v].mV[VZ]);
+		LLVector4a t;
+		t.setAbs(mCoords[v]);
+		mAvgDistortion.add(t);
 		
 		if (magnitude > mMaxDistortion)
 		{
 			mMaxDistortion = magnitude;
 		}
 
-		numRead = fread(&mNormals[v].mV, sizeof(F32), 3, fp);
-		llendianswizzle(&mNormals[v].mV, sizeof(F32), 3);
+		numRead = fread(&mNormals[v], sizeof(F32), 3, fp);
+		llendianswizzle(&mNormals[v], sizeof(F32), 3);
 		if (numRead != 3)
 		{
 			llwarns << "Can't read morph target normal" << llendl;
 			return FALSE;
 		}
 
-		numRead = fread(&mBinormals[v].mV, sizeof(F32), 3, fp);
-		llendianswizzle(&mBinormals[v].mV, sizeof(F32), 3);
+		numRead = fread(&mBinormals[v], sizeof(F32), 3, fp);
+		llendianswizzle(&mBinormals[v], sizeof(F32), 3);
 		if (numRead != 3)
 		{
 			llwarns << "Can't read morph target binormal" << llendl;
@@ -200,8 +200,8 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
 		mNumIndices++;
 	}
 
-	mAvgDistortion = mAvgDistortion * (1.f/(F32)mNumIndices);
-	mAvgDistortion.normVec();
+	mAvgDistortion.mul(1.f/(F32)mNumIndices);
+	mAvgDistortion.normalize3fast();
 
 	return TRUE;
 }
@@ -367,9 +367,9 @@ BOOL LLPolyMorphTarget::parseData(LLXmlTreeNode* node)
 //-----------------------------------------------------------------------------
 // getVertexDistortion()
 //-----------------------------------------------------------------------------
-LLVector3 LLPolyMorphTarget::getVertexDistortion(S32 requested_index, LLPolyMesh *mesh)
+LLVector4a LLPolyMorphTarget::getVertexDistortion(S32 requested_index, LLPolyMesh *mesh)
 {
-	if (!mMorphData || mMesh != mesh) return LLVector3::zero;
+	if (!mMorphData || mMesh != mesh) return LLVector4a::getZero();
 
 	for(U32 index = 0; index < mMorphData->mNumIndices; index++)
 	{
@@ -379,17 +379,17 @@ LLVector3 LLPolyMorphTarget::getVertexDistortion(S32 requested_index, LLPolyMesh
 		}
 	}
 
-	return LLVector3::zero;
+	return LLVector4a::getZero();
 }
 
 //-----------------------------------------------------------------------------
 // getFirstDistortion()
 //-----------------------------------------------------------------------------
-const LLVector3 *LLPolyMorphTarget::getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh)
+const LLVector4a *LLPolyMorphTarget::getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh)
 {
-	if (!mMorphData) return &LLVector3::zero;
+	if (!mMorphData) return &LLVector4a::getZero();
 
-	LLVector3* resultVec;
+	LLVector4a* resultVec;
 	mMorphData->mCurrentIndex = 0;
 	if (mMorphData->mNumIndices)
 	{
@@ -411,11 +411,11 @@ const LLVector3 *LLPolyMorphTarget::getFirstDistortion(U32 *index, LLPolyMesh **
 //-----------------------------------------------------------------------------
 // getNextDistortion()
 //-----------------------------------------------------------------------------
-const LLVector3 *LLPolyMorphTarget::getNextDistortion(U32 *index, LLPolyMesh **poly_mesh)
+const LLVector4a *LLPolyMorphTarget::getNextDistortion(U32 *index, LLPolyMesh **poly_mesh)
 {
-	if (!mMorphData) return &LLVector3::zero;
+	if (!mMorphData) return &LLVector4a::getZero();
 
-	LLVector3* resultVec;
+	LLVector4a* resultVec;
 	mMorphData->mCurrentIndex++;
 	if (mMorphData->mCurrentIndex < mMorphData->mNumIndices)
 	{
@@ -451,7 +451,7 @@ F32	LLPolyMorphTarget::getTotalDistortion()
 //-----------------------------------------------------------------------------
 // getAvgDistortion()
 //-----------------------------------------------------------------------------
-const LLVector3& LLPolyMorphTarget::getAvgDistortion()	
+const LLVector4a& LLPolyMorphTarget::getAvgDistortion()	
 {
 	if (mMorphData) 
 	{
@@ -459,7 +459,7 @@ const LLVector3& LLPolyMorphTarget::getAvgDistortion()
 	}
 	else 
 	{
-		return LLVector3::zero;
+		return LLVector4a::getZero();
 	}
 }
 
@@ -481,6 +481,8 @@ F32	LLPolyMorphTarget::getMaxDistortion()
 //-----------------------------------------------------------------------------
 // apply()
 //-----------------------------------------------------------------------------
+static LLFastTimer::DeclareTimer FTM_APPLY_MORPH_TARGET("Apply Morph");
+
 void LLPolyMorphTarget::apply( ESex avatar_sex )
 {
 	if (!mMorphData || mNumMorphMasksPending > 0)
@@ -488,6 +490,8 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
 		return;
 	}
 
+	LLFastTimer t(FTM_APPLY_MORPH_TARGET);
+
 	mLastSex = avatar_sex;
 
 	// Check for NaN condition (NaN is detected if a variable doesn't equal itself.
@@ -508,15 +512,15 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
 	if (delta_weight != 0.f)
 	{
 		llassert(!mMesh->isLOD());
-		LLVector4 *coords = mMesh->getWritableCoords();
+		LLVector4a *coords = mMesh->getWritableCoords();
 
-		LLVector3 *scaled_normals = mMesh->getScaledNormals();
-		LLVector4 *normals = mMesh->getWritableNormals();
+		LLVector4a *scaled_normals = mMesh->getScaledNormals();
+		LLVector4a *normals = mMesh->getWritableNormals();
 
-		LLVector3 *scaled_binormals = mMesh->getScaledBinormals();
-		LLVector3 *binormals = mMesh->getWritableBinormals();
+		LLVector4a *scaled_binormals = mMesh->getScaledBinormals();
+		LLVector4a *binormals = mMesh->getWritableBinormals();
 
-		LLVector4 *clothing_weights = mMesh->getWritableClothingWeights();
+		LLVector4a *clothing_weights = mMesh->getWritableClothingWeights();
 		LLVector2 *tex_coords = mMesh->getWritableTexCoords();
 
 		F32 *maskWeightArray = (mVertMask) ? mVertMask->getMorphMaskWeights() : NULL;
@@ -531,31 +535,38 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
 				maskWeight = maskWeightArray[vert_index_morph];
 			}
 
-			coords[vert_index_mesh] += LLVector4(mMorphData->mCoords[vert_index_morph] * delta_weight * maskWeight);
+
+			LLVector4a pos = mMorphData->mCoords[vert_index_morph];
+			pos.mul(delta_weight*maskWeight);
+			coords[vert_index_mesh].add(pos);
 
 			if (getInfo()->mIsClothingMorph && clothing_weights)
 			{
-				LLVector3 clothing_offset = mMorphData->mCoords[vert_index_morph] * delta_weight * maskWeight;
-				LLVector4* clothing_weight = &clothing_weights[vert_index_mesh];
-				clothing_weight->mV[VX] += clothing_offset.mV[VX];
-				clothing_weight->mV[VY] += clothing_offset.mV[VY];
-				clothing_weight->mV[VZ] += clothing_offset.mV[VZ];
-				clothing_weight->mV[VW] = maskWeight;
+				LLVector4a clothing_offset = mMorphData->mCoords[vert_index_morph];
+				clothing_offset.mul(delta_weight * maskWeight);
+				LLVector4a* clothing_weight = &clothing_weights[vert_index_mesh];
+				clothing_weight->add(clothing_offset);
+				clothing_weight->getF32ptr()[VW] = maskWeight;
 			}
 
 			// calculate new normals based on half angles
-			scaled_normals[vert_index_mesh] += mMorphData->mNormals[vert_index_morph] * delta_weight * maskWeight * NORMAL_SOFTEN_FACTOR;
-			LLVector3 normalized_normal = scaled_normals[vert_index_mesh];
-			normalized_normal.normVec();
-			normals[vert_index_mesh] = LLVector4(normalized_normal);
+			LLVector4a norm = mMorphData->mNormals[vert_index_morph];
+			norm.mul(delta_weight*maskWeight*NORMAL_SOFTEN_FACTOR);
+			scaled_normals[vert_index_mesh].add(norm);
+			norm = scaled_normals[vert_index_mesh];
+			norm.normalize3fast();
+			normals[vert_index_mesh] = norm;
 
 			// calculate new binormals
-			scaled_binormals[vert_index_mesh] += mMorphData->mBinormals[vert_index_morph] * delta_weight * maskWeight * NORMAL_SOFTEN_FACTOR;
-			LLVector3 tangent = scaled_binormals[vert_index_mesh] % normalized_normal;
-			LLVector3 normalized_binormal = normalized_normal % tangent; 
-			normalized_binormal.normVec();
-			binormals[vert_index_mesh] = normalized_binormal;
-
+			LLVector4a binorm = mMorphData->mBinormals[vert_index_morph];
+			binorm.mul(delta_weight*maskWeight*NORMAL_SOFTEN_FACTOR);
+			scaled_binormals[vert_index_mesh].add(binorm);
+			LLVector4a tangent;
+			tangent.setCross3(scaled_binormals[vert_index_mesh], norm);
+			LLVector4a& normalized_binormal = binormals[vert_index_mesh];
+			normalized_binormal.setCross3(norm, tangent); 
+			normalized_binormal.normalize3fast();
+			
 			tex_coords[vert_index_mesh] += mMorphData->mTexCoords[vert_index_morph] * delta_weight * maskWeight;
 		}
 
@@ -582,7 +593,7 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
 //-----------------------------------------------------------------------------
 void	LLPolyMorphTarget::applyMask(U8 *maskTextureData, S32 width, S32 height, S32 num_components, BOOL invert)
 {
-	LLVector4 *clothing_weights = getInfo()->mIsClothingMorph ? mMesh->getWritableClothingWeights() : NULL;
+	LLVector4a *clothing_weights = getInfo()->mIsClothingMorph ? mMesh->getWritableClothingWeights() : NULL;
 
 	if (!mVertMask)
 	{
@@ -596,29 +607,47 @@ void	LLPolyMorphTarget::applyMask(U8 *maskTextureData, S32 width, S32 height, S3
 
 		if (maskWeights)
 		{
-			LLVector4 *coords = mMesh->getWritableCoords();
-			LLVector3 *scaled_normals = mMesh->getScaledNormals();
-			LLVector3 *scaled_binormals = mMesh->getScaledBinormals();
+			LLVector4a *coords = mMesh->getWritableCoords();
+			LLVector4a *scaled_normals = mMesh->getScaledNormals();
+			LLVector4a *scaled_binormals = mMesh->getScaledBinormals();
 			LLVector2 *tex_coords = mMesh->getWritableTexCoords();
 
+			LLVector4Logical clothing_mask;
+			clothing_mask.clear();
+			clothing_mask.setElement<0>();
+			clothing_mask.setElement<1>();
+			clothing_mask.setElement<2>();
+
+
 			for(U32 vert = 0; vert < mMorphData->mNumIndices; vert++)
 			{
 				F32 lastMaskWeight = mLastWeight * maskWeights[vert];
 				S32 out_vert = mMorphData->mVertexIndices[vert];
 
 				// remove effect of existing masked morph
-				coords[out_vert] -= LLVector4(mMorphData->mCoords[vert]) * lastMaskWeight;
-				scaled_normals[out_vert] -= mMorphData->mNormals[vert] * lastMaskWeight * NORMAL_SOFTEN_FACTOR;
-				scaled_binormals[out_vert] -= mMorphData->mBinormals[vert] * lastMaskWeight * NORMAL_SOFTEN_FACTOR;
+				LLVector4a t;
+				t = mMorphData->mCoords[vert];
+				t.mul(lastMaskWeight);
+				coords[out_vert].sub(t);
+
+				t = mMorphData->mNormals[vert];
+				t.mul(lastMaskWeight*NORMAL_SOFTEN_FACTOR);
+				scaled_normals[out_vert].sub(t);
+
+				t = mMorphData->mBinormals[vert];
+				t.mul(lastMaskWeight*NORMAL_SOFTEN_FACTOR);
+				scaled_binormals[out_vert].sub(t);
+
 				tex_coords[out_vert] -= mMorphData->mTexCoords[vert] * lastMaskWeight;
 
 				if (clothing_weights)
 				{
-					LLVector3 clothing_offset = mMorphData->mCoords[vert] * lastMaskWeight;
-					LLVector4* clothing_weight = &clothing_weights[out_vert];
-					clothing_weight->mV[VX] -= clothing_offset.mV[VX];
-					clothing_weight->mV[VY] -= clothing_offset.mV[VY];
-					clothing_weight->mV[VZ] -= clothing_offset.mV[VZ];
+					LLVector4a clothing_offset = mMorphData->mCoords[vert];
+					clothing_offset.mul(lastMaskWeight);
+					LLVector4a* clothing_weight = &clothing_weights[out_vert];
+					LLVector4a t;
+					t.setSub(*clothing_weight, clothing_offset);
+					clothing_weight->setSelectWithMask(clothing_mask, t, *clothing_weight);
 				}
 			}
 		}
@@ -654,7 +683,7 @@ LLPolyVertexMask::~LLPolyVertexMask()
 //-----------------------------------------------------------------------------
 // generateMask()
 //-----------------------------------------------------------------------------
-void LLPolyVertexMask::generateMask(U8 *maskTextureData, S32 width, S32 height, S32 num_components, BOOL invert, LLVector4 *clothing_weights)
+void LLPolyVertexMask::generateMask(U8 *maskTextureData, S32 width, S32 height, S32 num_components, BOOL invert, LLVector4a *clothing_weights)
 {
 // RN debug output that uses Image Debugger (http://www.cs.unc.edu/~baxter/projects/imdebug/)
 //	BOOL debugImg = FALSE; 
@@ -698,7 +727,7 @@ void LLPolyVertexMask::generateMask(U8 *maskTextureData, S32 width, S32 height,
 
 		if (clothing_weights)
 		{
-			clothing_weights[vertIndex].mV[VW] = mWeights[index];
+			clothing_weights[vertIndex].getF32ptr()[VW] = mWeights[index];
 		}
 	}
 	mWeightsGenerated = TRUE;
diff --git a/indra/newview/llpolymorph.h b/indra/newview/llpolymorph.h
index 8a024f2e9e05c55b83bb987f0f36a2d98ff3d86a..46e23b7792a499a435e6ee9d2f7ab6c22b8814fc 100644
--- a/indra/newview/llpolymorph.h
+++ b/indra/newview/llpolymorph.h
@@ -58,14 +58,14 @@ class LLPolyMorphData
 	U32					mNumIndices;
 	U32*				mVertexIndices;
 	U32					mCurrentIndex;
-	LLVector3*			mCoords;
-	LLVector3*			mNormals;
-	LLVector3*			mBinormals;
+	LLVector4a*			mCoords;
+	LLVector4a*			mNormals;
+	LLVector4a*			mBinormals;
 	LLVector2*			mTexCoords;
 
 	F32					mTotalDistortion;	// vertex distortion summed over entire morph
 	F32					mMaxDistortion;		// maximum single vertex distortion in a given morph
-	LLVector3			mAvgDistortion;		// average vertex distortion, to infer directionality of the morph
+	LLVector4a			mAvgDistortion;		// average vertex distortion, to infer directionality of the morph
 	LLPolyMeshSharedData*	mMesh;
 };
 
@@ -78,7 +78,7 @@ class LLPolyVertexMask
 	LLPolyVertexMask(LLPolyMorphData* morph_data);
 	~LLPolyVertexMask();
 
-	void generateMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert, LLVector4 *clothing_weights);
+	void generateMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert, LLVector4a *clothing_weights);
 	F32* getMorphMaskWeights();
 
 
@@ -157,11 +157,11 @@ class LLPolyMorphTarget : public LLViewerVisualParam
 	
 	// LLViewerVisualParam Virtual functions
 	/*virtual*/ F32					getTotalDistortion();
-	/*virtual*/ const LLVector3&	getAvgDistortion();
+	/*virtual*/ const LLVector4a&	getAvgDistortion();
 	/*virtual*/ F32					getMaxDistortion();
-	/*virtual*/ LLVector3			getVertexDistortion(S32 index, LLPolyMesh *poly_mesh);
-	/*virtual*/ const LLVector3*	getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh);
-	/*virtual*/ const LLVector3*	getNextDistortion(U32 *index, LLPolyMesh **poly_mesh);
+	/*virtual*/ LLVector4a			getVertexDistortion(S32 index, LLPolyMesh *poly_mesh);
+	/*virtual*/ const LLVector4a*	getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh);
+	/*virtual*/ const LLVector4a*	getNextDistortion(U32 *index, LLPolyMesh **poly_mesh);
 
 	void	applyMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert);
 	void	addPendingMorphMask() { mNumMorphMasksPending++; }
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index a55565909f3649a69c7b805395a67eebe269e0fc..3b52dd552f56efea0bc47e9016c368bba2e3b32e 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -276,7 +276,7 @@ void LLSelectMgr::overrideObjectUpdates()
 		virtual bool apply(LLSelectNode* selectNode)
 		{
 			LLViewerObject* object = selectNode->getObject();
-			if (object && object->permMove())
+			if (object && object->permMove() && !object->isPermanentEnforced())
 			{
 				if (!selectNode->mLastPositionLocal.isExactlyZero())
 				{
@@ -593,6 +593,12 @@ bool LLSelectMgr::linkObjects()
 		return true;
 	}
 
+	if (!LLSelectMgr::getInstance()->selectGetRootsNonPermanentEnforced())
+	{
+		LLNotificationsUtil::add("CannotLinkPermanent");
+		return true;
+	}
+
 	LLUUID owner_id;
 	std::string owner_name;
 	if (!LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name))
@@ -638,7 +644,9 @@ bool LLSelectMgr::enableLinkObjects()
 			{
 				virtual bool apply(LLViewerObject* object)
 				{
-					return object->permModify();
+					LLViewerObject *root_object = (object == NULL) ? NULL : object->getRootEdit();
+					return object->permModify() && !object->isPermanentEnforced() &&
+						((root_object == NULL) || !root_object->isPermanentEnforced());
 				}
 			} func;
 			const bool firstonly = true;
@@ -651,10 +659,12 @@ bool LLSelectMgr::enableLinkObjects()
 bool LLSelectMgr::enableUnlinkObjects()
 {
 	LLViewerObject* first_editable_object = LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject();
+	LLViewerObject *root_object = (first_editable_object == NULL) ? NULL : first_editable_object->getRootEdit();
 
 	bool new_value = LLSelectMgr::getInstance()->selectGetAllRootsValid() &&
 		first_editable_object &&
-		!first_editable_object->isAttachment();
+		!first_editable_object->isAttachment() && !first_editable_object->isPermanentEnforced() &&
+		((root_object == NULL) || !root_object->isPermanentEnforced());
 
 	return new_value;
 }
@@ -955,7 +965,7 @@ void LLSelectMgr::highlightObjectOnly(LLViewerObject* objectp)
 	}
 	
 	if ((gSavedSettings.getBOOL("SelectOwnedOnly") && !objectp->permYouOwner()) 
-		|| (gSavedSettings.getBOOL("SelectMovableOnly") && !objectp->permMove()))
+		|| (gSavedSettings.getBOOL("SelectMovableOnly") && (!objectp->permMove() ||  objectp->isPermanentEnforced())))
 	{
 		// only select my own objects
 		return;
@@ -2338,50 +2348,6 @@ void LLSelectMgr::packObjectIDAsParam(LLSelectNode* node, void *)
 	gMessageSystem->addString("Parameter", buf);
 }
 
-//-----------------------------------------------------------------------------
-// Rotation options
-//-----------------------------------------------------------------------------
-void LLSelectMgr::selectionResetRotation()
-{
-	struct f : public LLSelectedObjectFunctor
-	{
-		virtual bool apply(LLViewerObject* object)
-		{
-			LLQuaternion identity(0.f, 0.f, 0.f, 1.f);
-			object->setRotation(identity);
-			if (object->mDrawable.notNull())
-			{
-				gPipeline.markMoved(object->mDrawable, TRUE);
-			}
-			object->sendRotationUpdate();
-			return true;
-		}
-	} func;
-	getSelection()->applyToRootObjects(&func);
-}
-
-void LLSelectMgr::selectionRotateAroundZ(F32 degrees)
-{
-	LLQuaternion rot( degrees * DEG_TO_RAD, LLVector3(0,0,1) );
-	struct f : public LLSelectedObjectFunctor
-	{
-		LLQuaternion mRot;
-		f(const LLQuaternion& rot) : mRot(rot) {}
-		virtual bool apply(LLViewerObject* object)
-		{
-			object->setRotation( object->getRotationEdit() * mRot );
-			if (object->mDrawable.notNull())
-			{
-				gPipeline.markMoved(object->mDrawable, TRUE);
-			}
-			object->sendRotationUpdate();
-			return true;
-		}
-	} func(rot);
-	getSelection()->applyToRootObjects(&func);	
-}
-
-
 //-----------------------------------------------------------------------------
 // selectionTexScaleAutofit()
 //-----------------------------------------------------------------------------
@@ -2595,6 +2561,340 @@ BOOL LLSelectMgr::selectGetRootsModify()
 }
 
 
+//-----------------------------------------------------------------------------
+// selectGetNonPermanentEnforced() - return TRUE if all objects are not
+// permanent enforced
+//-----------------------------------------------------------------------------
+BOOL LLSelectMgr::selectGetNonPermanentEnforced()
+{
+	for (LLObjectSelection::iterator iter = getSelection()->begin();
+		 iter != getSelection()->end(); iter++ )
+	{
+		LLSelectNode* node = *iter;
+		LLViewerObject* object = node->getObject();
+		if( !object || !node->mValid )
+		{
+			return FALSE;
+		}
+		if( object->isPermanentEnforced())
+		{
+			return FALSE;
+		}
+	}
+	return TRUE;
+}
+
+//-----------------------------------------------------------------------------
+// selectGetRootsNonPermanentEnforced() - return TRUE if all root objects are
+// not permanent enforced
+//-----------------------------------------------------------------------------
+BOOL LLSelectMgr::selectGetRootsNonPermanentEnforced()
+{
+	for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
+		 iter != getSelection()->root_end(); iter++ )
+	{
+		LLSelectNode* node = *iter;
+		LLViewerObject* object = node->getObject();
+		if( !node->mValid )
+		{
+			return FALSE;
+		}
+		if( object->isPermanentEnforced())
+		{
+			return FALSE;
+		}
+	}
+
+	return TRUE;
+}
+
+//-----------------------------------------------------------------------------
+// selectGetPermanent() - return TRUE if all objects are permanent
+//-----------------------------------------------------------------------------
+BOOL LLSelectMgr::selectGetPermanent()
+{
+	for (LLObjectSelection::iterator iter = getSelection()->begin();
+		 iter != getSelection()->end(); iter++ )
+	{
+		LLSelectNode* node = *iter;
+		LLViewerObject* object = node->getObject();
+		if( !object || !node->mValid )
+		{
+			return FALSE;
+		}
+		if( !object->flagObjectPermanent())
+		{
+			return FALSE;
+		}
+	}
+	return TRUE;
+}
+
+//-----------------------------------------------------------------------------
+// selectGetRootsPermanent() - return TRUE if all root objects are
+// permanent
+//-----------------------------------------------------------------------------
+BOOL LLSelectMgr::selectGetRootsPermanent()
+{
+	for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
+		 iter != getSelection()->root_end(); iter++ )
+	{
+		LLSelectNode* node = *iter;
+		LLViewerObject* object = node->getObject();
+		if( !node->mValid )
+		{
+			return FALSE;
+		}
+		if( !object->flagObjectPermanent())
+		{
+			return FALSE;
+		}
+	}
+
+	return TRUE;
+}
+
+//-----------------------------------------------------------------------------
+// selectGetCharacter() - return TRUE if all objects are character
+//-----------------------------------------------------------------------------
+BOOL LLSelectMgr::selectGetCharacter()
+{
+	for (LLObjectSelection::iterator iter = getSelection()->begin();
+		 iter != getSelection()->end(); iter++ )
+	{
+		LLSelectNode* node = *iter;
+		LLViewerObject* object = node->getObject();
+		if( !object || !node->mValid )
+		{
+			return FALSE;
+		}
+		if( !object->flagCharacter())
+		{
+			return FALSE;
+		}
+	}
+	return TRUE;
+}
+
+//-----------------------------------------------------------------------------
+// selectGetRootsCharacter() - return TRUE if all root objects are
+// character
+//-----------------------------------------------------------------------------
+BOOL LLSelectMgr::selectGetRootsCharacter()
+{
+	for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
+		 iter != getSelection()->root_end(); iter++ )
+	{
+		LLSelectNode* node = *iter;
+		LLViewerObject* object = node->getObject();
+		if( !node->mValid )
+		{
+			return FALSE;
+		}
+		if( !object->flagCharacter())
+		{
+			return FALSE;
+		}
+	}
+
+	return TRUE;
+}
+
+//-----------------------------------------------------------------------------
+// selectGetNonPathfinding() - return TRUE if all objects are not pathfinding
+//-----------------------------------------------------------------------------
+BOOL LLSelectMgr::selectGetNonPathfinding()
+{
+	for (LLObjectSelection::iterator iter = getSelection()->begin();
+		 iter != getSelection()->end(); iter++ )
+	{
+		LLSelectNode* node = *iter;
+		LLViewerObject* object = node->getObject();
+		if( !object || !node->mValid )
+		{
+			return FALSE;
+		}
+		if( object->flagObjectPermanent() || object->flagCharacter())
+		{
+			return FALSE;
+		}
+	}
+	return TRUE;
+}
+
+//-----------------------------------------------------------------------------
+// selectGetRootsNonPathfinding() - return TRUE if all root objects are not
+// pathfinding
+//-----------------------------------------------------------------------------
+BOOL LLSelectMgr::selectGetRootsNonPathfinding()
+{
+	for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
+		 iter != getSelection()->root_end(); iter++ )
+	{
+		LLSelectNode* node = *iter;
+		LLViewerObject* object = node->getObject();
+		if( !node->mValid )
+		{
+			return FALSE;
+		}
+		if( object->flagObjectPermanent() || object->flagCharacter())
+		{
+			return FALSE;
+		}
+	}
+
+	return TRUE;
+}
+
+//-----------------------------------------------------------------------------
+// selectGetNonPermanent() - return TRUE if all objects are not permanent
+//-----------------------------------------------------------------------------
+BOOL LLSelectMgr::selectGetNonPermanent()
+{
+	for (LLObjectSelection::iterator iter = getSelection()->begin();
+		 iter != getSelection()->end(); iter++ )
+	{
+		LLSelectNode* node = *iter;
+		LLViewerObject* object = node->getObject();
+		if( !object || !node->mValid )
+		{
+			return FALSE;
+		}
+		if( object->flagObjectPermanent())
+		{
+			return FALSE;
+		}
+	}
+	return TRUE;
+}
+
+//-----------------------------------------------------------------------------
+// selectGetRootsNonPermanent() - return TRUE if all root objects are not
+// permanent
+//-----------------------------------------------------------------------------
+BOOL LLSelectMgr::selectGetRootsNonPermanent()
+{
+	for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
+		 iter != getSelection()->root_end(); iter++ )
+	{
+		LLSelectNode* node = *iter;
+		LLViewerObject* object = node->getObject();
+		if( !node->mValid )
+		{
+			return FALSE;
+		}
+		if( object->flagObjectPermanent())
+		{
+			return FALSE;
+		}
+	}
+
+	return TRUE;
+}
+
+//-----------------------------------------------------------------------------
+// selectGetNonCharacter() - return TRUE if all objects are not character
+//-----------------------------------------------------------------------------
+BOOL LLSelectMgr::selectGetNonCharacter()
+{
+	for (LLObjectSelection::iterator iter = getSelection()->begin();
+		 iter != getSelection()->end(); iter++ )
+	{
+		LLSelectNode* node = *iter;
+		LLViewerObject* object = node->getObject();
+		if( !object || !node->mValid )
+		{
+			return FALSE;
+		}
+		if( object->flagCharacter())
+		{
+			return FALSE;
+		}
+	}
+	return TRUE;
+}
+
+//-----------------------------------------------------------------------------
+// selectGetRootsNonCharacter() - return TRUE if all root objects are not 
+// character
+//-----------------------------------------------------------------------------
+BOOL LLSelectMgr::selectGetRootsNonCharacter()
+{
+	for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
+		 iter != getSelection()->root_end(); iter++ )
+	{
+		LLSelectNode* node = *iter;
+		LLViewerObject* object = node->getObject();
+		if( !node->mValid )
+		{
+			return FALSE;
+		}
+		if( object->flagCharacter())
+		{
+			return FALSE;
+		}
+	}
+
+	return TRUE;
+}
+
+
+//-----------------------------------------------------------------------------
+// selectGetEditableLinksets() - return TRUE if all objects are editable
+//                               pathfinding linksets
+//-----------------------------------------------------------------------------
+BOOL LLSelectMgr::selectGetEditableLinksets()
+{
+	for (LLObjectSelection::iterator iter = getSelection()->begin();
+		 iter != getSelection()->end(); iter++ )
+	{
+		LLSelectNode* node = *iter;
+		LLViewerObject* object = node->getObject();
+		if( !object || !node->mValid )
+		{
+			return FALSE;
+		}
+		if (object->flagUsePhysics() ||
+			object->flagTemporaryOnRez() ||
+			object->flagCharacter() ||
+			object->flagVolumeDetect() ||
+			object->flagAnimSource() ||
+			(object->getRegion() != gAgent.getRegion()) ||
+			(!gAgent.isGodlike() && 
+			!gAgent.canManageEstate() &&
+			!object->permYouOwner() &&
+			!object->permMove()))
+		{
+			return FALSE;
+		}
+	}
+	return TRUE;
+}
+
+//-----------------------------------------------------------------------------
+// selectGetViewableCharacters() - return TRUE if all objects are characters
+//                        viewable within the pathfinding characters floater
+//-----------------------------------------------------------------------------
+BOOL LLSelectMgr::selectGetViewableCharacters()
+{
+	for (LLObjectSelection::iterator iter = getSelection()->begin();
+		 iter != getSelection()->end(); iter++ )
+	{
+		LLSelectNode* node = *iter;
+		LLViewerObject* object = node->getObject();
+		if( !object || !node->mValid )
+		{
+			return FALSE;
+		}
+		if( !object->flagCharacter() ||
+			(object->getRegion() != gAgent.getRegion()))
+		{
+			return FALSE;
+		}
+	}
+	return TRUE;
+}
+
 //-----------------------------------------------------------------------------
 // selectGetRootsTransfer() - return TRUE if current agent can transfer all
 // selected root objects.
@@ -4201,12 +4501,6 @@ void LLSelectMgr::selectionUpdatePhantom(BOOL is_phantom)
 	getSelection()->applyToObjects(&func);	
 }
 
-void LLSelectMgr::selectionUpdateCastShadows(BOOL cast_shadows)
-{
-	LLSelectMgrApplyFlags func(	FLAGS_CAST_SHADOWS, cast_shadows);
-	getSelection()->applyToObjects(&func);	
-}
-
 //----------------------------------------------------------------------
 // Helpful packing functions for sendObjectMessage()
 //----------------------------------------------------------------------
@@ -6298,7 +6592,7 @@ BOOL LLSelectMgr::canSelectObject(LLViewerObject* object)
 	}
 
 	if ((gSavedSettings.getBOOL("SelectOwnedOnly") && !object->permYouOwner()) ||
-		(gSavedSettings.getBOOL("SelectMovableOnly") && !object->permMove()))
+		(gSavedSettings.getBOOL("SelectMovableOnly") && (!object->permMove() ||  object->isPermanentEnforced())))
 	{
 		// only select my own objects
 		return FALSE;
@@ -6990,7 +7284,7 @@ LLSelectNode* LLObjectSelection::getFirstMoveableNode(BOOL get_root_first)
 		bool apply(LLSelectNode* node)
 		{
 			LLViewerObject* obj = node->getObject();
-			return obj && obj->permMove();
+			return obj && obj->permMove() && !obj->isPermanentEnforced();
 		}
 	} func;
 	LLSelectNode* res = get_root_first ? getFirstRootNode(&func, TRUE) : getFirstNode(&func);
@@ -7028,9 +7322,10 @@ LLViewerObject* LLObjectSelection::getFirstDeleteableObject()
 			LLViewerObject* obj = node->getObject();
 			// you can delete an object if you are the owner
 			// or you have permission to modify it.
-			if( obj && ( (obj->permModify()) ||
-						 (obj->permYouOwner()) ||
-						 (!obj->permAnyOwner())	))		// public
+			if( obj && !obj->isPermanentEnforced() &&
+				( (obj->permModify()) ||
+				(obj->permYouOwner()) ||
+				(!obj->permAnyOwner())	))		// public
 			{
 				if( !obj->isAttachment() )
 				{
@@ -7070,7 +7365,7 @@ LLViewerObject* LLObjectSelection::getFirstMoveableObject(BOOL get_parent)
 		bool apply(LLSelectNode* node)
 		{
 			LLViewerObject* obj = node->getObject();
-			return obj && obj->permMove();
+			return obj && obj->permMove() && !obj->isPermanentEnforced();
 		}
 	} func;
 	return getFirstSelectedObject(&func, get_parent);
@@ -7139,7 +7434,7 @@ bool LLSelectMgr::selectionMove(const LLVector3& displ,
 	{
 		obj = (*it)->getObject();
 		bool enable_pos = false, enable_rot = false;
-		bool perm_move = obj->permMove();
+		bool perm_move = obj->permMove() && !obj->isPermanentEnforced();
 		bool perm_mod = obj->permModify();
 		
 		LLVector3d sel_center(getSelectionCenterGlobal());
diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h
index 94606b9fba6739fc962fff86192fb9594459c505..ecbb20df1bb1292f7e580765588cc28ba5e796f8 100644
--- a/indra/newview/llselectmgr.h
+++ b/indra/newview/llselectmgr.h
@@ -510,7 +510,6 @@ class LLSelectMgr : public LLEditMenuHandler, public LLSingleton<LLSelectMgr>
 	void selectionUpdatePhysics(BOOL use_physics);
 	void selectionUpdateTemporary(BOOL is_temporary);
 	void selectionUpdatePhantom(BOOL is_ghost);
-	void selectionUpdateCastShadows(BOOL cast_shadows);
 	void selectionDump();
 
 	BOOL selectionAllPCode(LLPCode code);		// all objects have this PCode
@@ -548,8 +547,6 @@ class LLSelectMgr : public LLEditMenuHandler, public LLSingleton<LLSelectMgr>
 	void selectionTexScaleAutofit(F32 repeats_per_meter);
 	void adjustTexturesByScale(BOOL send_to_sim, BOOL stretch);
 
-	void selectionResetRotation();				// sets rotation quat to identity
-	void selectionRotateAroundZ(F32 degrees);
 	bool selectionMove(const LLVector3& displ, F32 rx, F32 ry, F32 rz,
 					   U32 update_type);
 	void sendSelectionMove();
@@ -572,6 +569,33 @@ class LLSelectMgr : public LLEditMenuHandler, public LLSingleton<LLSelectMgr>
 	BOOL selectGetRootsModify();
 	BOOL selectGetModify();
 
+	// returns TRUE if is all objects are non-permanent-enforced
+	BOOL selectGetRootsNonPermanentEnforced();
+	BOOL selectGetNonPermanentEnforced();
+
+	// returns TRUE if is all objects are permanent
+	BOOL selectGetRootsPermanent();
+	BOOL selectGetPermanent();
+
+	// returns TRUE if is all objects are character
+	BOOL selectGetRootsCharacter();
+	BOOL selectGetCharacter();
+
+	// returns TRUE if is all objects are not permanent
+	BOOL selectGetRootsNonPathfinding();
+	BOOL selectGetNonPathfinding();
+
+	// returns TRUE if is all objects are not permanent
+	BOOL selectGetRootsNonPermanent();
+	BOOL selectGetNonPermanent();
+
+	// returns TRUE if is all objects are not character
+	BOOL selectGetRootsNonCharacter();
+	BOOL selectGetNonCharacter();
+
+	BOOL selectGetEditableLinksets();
+	BOOL selectGetViewableCharacters();
+
 	// returns TRUE if selected objects can be transferred.
 	BOOL selectGetRootsTransfer();
 
diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp
index 1ce05da8497f171b630d1c76585c26bd26fc3ae6..92c2863ffdf49124f54c38ee7b28f74412e7e8ac 100644
--- a/indra/newview/llsidepaneliteminfo.cpp
+++ b/indra/newview/llsidepaneliteminfo.cpp
@@ -352,7 +352,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item)
 		getChildView("BtnCreator")->setEnabled(FALSE);
 		getChildView("LabelCreatorTitle")->setEnabled(FALSE);
 		getChildView("LabelCreatorName")->setEnabled(FALSE);
-		getChild<LLUICtrl>("LabelCreatorName")->setValue(getString("unknown"));
+		getChild<LLUICtrl>("LabelCreatorName")->setValue(getString("unknown_multiple"));
 	}
 
 	////////////////
diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp
index 64b82aa0bb8004147a84b4fea92e0928af01d601..c351b1a1283d10c5aa82f88653f091675eedb386 100644
--- a/indra/newview/llsidepaneltaskinfo.cpp
+++ b/indra/newview/llsidepaneltaskinfo.cpp
@@ -61,6 +61,9 @@
 #include "llspinctrl.h"
 #include "roles_constants.h"
 #include "llgroupactions.h"
+#include "lltextbase.h"
+#include "llstring.h"
+#include "lltrans.h"
 
 ///----------------------------------------------------------------------------
 /// Class llsidepaneltaskinfo
@@ -146,6 +149,7 @@ BOOL LLSidepanelTaskInfo::postBuild()
 	mDAEditCost = getChild<LLUICtrl>("Edit Cost");
 	mDALabelClickAction = getChildView("label click action");
 	mDAComboClickAction = getChild<LLComboBox>("clickaction");
+	mDAPathfindingAttributes = getChild<LLTextBase>("pathfinding_attributes_value");
 	mDAB = getChildView("B:");
 	mDAO = getChildView("O:");
 	mDAG = getChildView("G:");
@@ -242,6 +246,9 @@ void LLSidepanelTaskInfo::disableAll()
 		mDAComboClickAction->clear();
 	}
 
+	mDAPathfindingAttributes->setEnabled(FALSE);
+	mDAPathfindingAttributes->setValue(LLStringUtil::null);
+
 	mDAB->setVisible(FALSE);
 	mDAO->setVisible(FALSE);
 	mDAG->setVisible(FALSE);
@@ -301,6 +308,8 @@ void LLSidepanelTaskInfo::refresh()
 	// BUG: fails if a root and non-root are both single-selected.
 	const BOOL is_perm_modify = (mObjectSelection->getFirstRootNode() && LLSelectMgr::getInstance()->selectGetRootsModify()) ||
 		LLSelectMgr::getInstance()->selectGetModify();
+	const BOOL is_nonpermanent_enforced = (mObjectSelection->getFirstRootNode() && LLSelectMgr::getInstance()->selectGetRootsNonPermanentEnforced()) ||
+		LLSelectMgr::getInstance()->selectGetNonPermanentEnforced();
 
 	S32 string_index = 0;
 	std::string MODIFY_INFO_STRINGS[] =
@@ -308,12 +317,18 @@ void LLSidepanelTaskInfo::refresh()
 			getString("text modify info 1"),
 			getString("text modify info 2"),
 			getString("text modify info 3"),
-			getString("text modify info 4")
+			getString("text modify info 4"),
+			getString("text modify info 5"),
+			getString("text modify info 6")
 		};
 	if (!is_perm_modify)
 	{
 		string_index += 2;
 	}
+	else if (!is_nonpermanent_enforced)
+	{
+		string_index += 4;
+	}
 	if (!is_one_object)
 	{
 		++string_index;
@@ -321,6 +336,34 @@ void LLSidepanelTaskInfo::refresh()
 	getChildView("perm_modify")->setEnabled(TRUE);
 	getChild<LLUICtrl>("perm_modify")->setValue(MODIFY_INFO_STRINGS[string_index]);
 
+	std::string pfAttrName;
+
+	if ((mObjectSelection->getFirstRootNode() 
+		&& LLSelectMgr::getInstance()->selectGetRootsNonPathfinding())
+		|| LLSelectMgr::getInstance()->selectGetNonPathfinding())
+	{
+		pfAttrName = "Pathfinding_Object_Attr_None";
+	}
+	else if ((mObjectSelection->getFirstRootNode() 
+		&& LLSelectMgr::getInstance()->selectGetRootsPermanent())
+		|| LLSelectMgr::getInstance()->selectGetPermanent())
+	{
+		pfAttrName = "Pathfinding_Object_Attr_Permanent";
+	}
+	else if ((mObjectSelection->getFirstRootNode() 
+		&& LLSelectMgr::getInstance()->selectGetRootsCharacter())
+		|| LLSelectMgr::getInstance()->selectGetCharacter())
+	{
+		pfAttrName = "Pathfinding_Object_Attr_Character";
+	}
+	else
+	{
+		pfAttrName = "Pathfinding_Object_Attr_MultiSelect";
+	}
+
+	mDAPathfindingAttributes->setEnabled(TRUE);
+	mDAPathfindingAttributes->setValue(LLTrans::getString(pfAttrName));
+
 	getChildView("Permissions:")->setEnabled(TRUE);
 	
 	// Update creator text field
@@ -385,7 +428,7 @@ void LLSidepanelTaskInfo::refresh()
 		}
 	}
 	
-	getChildView("button set group")->setEnabled(owners_identical && (mOwnerID == gAgent.getID()));
+	getChildView("button set group")->setEnabled(owners_identical && (mOwnerID == gAgent.getID()) && is_nonpermanent_enforced);
 
 	getChildView("Name:")->setEnabled(TRUE);
 	LLLineEditor* LineEditorObjectName = getChild<LLLineEditor>("Object Name");
@@ -415,7 +458,7 @@ void LLSidepanelTaskInfo::refresh()
 
 	// figure out the contents of the name, description, & category
 	BOOL edit_name_desc = FALSE;
-	if (is_one_object && objectp->permModify())
+	if (is_one_object && objectp->permModify() && !objectp->isPermanentEnforced())
 	{
 		edit_name_desc = TRUE;
 	}
@@ -595,12 +638,12 @@ void LLSidepanelTaskInfo::refresh()
 	BOOL has_change_perm_ability = FALSE;
 	BOOL has_change_sale_ability = FALSE;
 
-	if (valid_base_perms &&
+	if (valid_base_perms && is_nonpermanent_enforced &&
 		(self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_MANIPULATE))))
 	{
 		has_change_perm_ability = TRUE;
 	}
-	if (valid_base_perms &&
+	if (valid_base_perms && is_nonpermanent_enforced &&
 	   (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_SET_SALE))))
 	{
 		has_change_sale_ability = TRUE;
@@ -812,8 +855,8 @@ void LLSidepanelTaskInfo::refresh()
 			ComboClickAction->setCurrentByIndex((S32)click_action);
 		}
 	}
-	getChildView("label click action")->setEnabled(is_perm_modify && all_volume);
-	getChildView("clickaction")->setEnabled(is_perm_modify && all_volume);
+	getChildView("label click action")->setEnabled(is_perm_modify && is_nonpermanent_enforced && all_volume);
+	getChildView("clickaction")->setEnabled(is_perm_modify && is_nonpermanent_enforced && all_volume);
 
 	if (!getIsEditing())
 	{
diff --git a/indra/newview/llsidepaneltaskinfo.h b/indra/newview/llsidepaneltaskinfo.h
index be0fee212727bc2bcd4b6969760b7bffbc30f038..124229af064908f3e08b26d373dc8acb10efc174 100644
--- a/indra/newview/llsidepaneltaskinfo.h
+++ b/indra/newview/llsidepaneltaskinfo.h
@@ -41,6 +41,7 @@ class LLCheckBoxCtrl;
 class LLComboBox;
 class LLNameBox;
 class LLViewerObject;
+class LLTextBase;
 
 class LLSidepanelTaskInfo : public LLSidepanelInventorySubpanel
 {
@@ -150,6 +151,7 @@ class LLSidepanelTaskInfo : public LLSidepanelInventorySubpanel
 	LLUICtrl*	mDAEditCost;
 	LLView*		mDALabelClickAction;
 	LLComboBox*	mDAComboClickAction;
+	LLTextBase* mDAPathfindingAttributes;
 	LLView*		mDAB;
 	LLView*		mDAO;
 	LLView*		mDAG;
diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp
index a853726deaae2a9c8453c23f0ea98dc7f0fcf43b..3a822333200d19f04c31a0706c52d4ab1ea777c0 100644
--- a/indra/newview/llslurl.cpp
+++ b/indra/newview/llslurl.cpp
@@ -56,14 +56,13 @@ LLSLURL::LLSLURL(const std::string& slurl)
 {
 	// by default we go to agni.
 	mType = INVALID;
-	LL_INFOS("AppInit") << "SLURL: " << slurl << LL_ENDL;
+
 	if(slurl == SIM_LOCATION_HOME)
 	{
 		mType = HOME_LOCATION;
 	}
 	else if(slurl.empty() || (slurl == SIM_LOCATION_LAST))
 	{
-
 		mType = LAST_LOCATION;
 	}
 	else
@@ -80,6 +79,7 @@ LLSLURL::LLSLURL(const std::string& slurl)
 			// these slurls are typically passed in from the 'starting location' box on the login panel,
 			// where the user can type in <regionname>/<x>/<y>/<z>
 			std::string fixed_slurl = LLGridManager::getInstance()->getSLURLBase();
+
 			// the slurl that was passed in might have a prepended /, or not.  So,
 			// we strip off the prepended '/' so we don't end up with http://slurl.com/secondlife/<region>/<x>/<y>/<z>
 			// or some such.
@@ -138,7 +138,7 @@ LLSLURL::LLSLURL(const std::string& slurl)
 				// so parse the grid name to derive the grid ID
 				if (!slurl_uri.hostName().empty())
 				{
-					mGrid = LLGridManager::getInstance()->getGridByLabel(slurl_uri.hostName());
+					mGrid = LLGridManager::getInstance()->getGridId(slurl_uri.hostName());
 				}
 				else if(path_array[0].asString() == LLSLURL::SLURL_SECONDLIFE_PATH)
 				{
@@ -150,12 +150,13 @@ LLSLURL::LLSLURL(const std::string& slurl)
 				{
 					// for app style slurls, where no grid name is specified, assume the currently
 					// selected or logged in grid.
-					mGrid =  LLGridManager::getInstance()->getGrid();
+					mGrid =  LLGridManager::getInstance()->getGridId();
 				}
 
 				if(mGrid.empty())
 				{
 					// we couldn't find the grid in the grid manager, so bail
+					LL_WARNS("AppInit")<<"unable to find grid"<<LL_ENDL;
 					return;
 				}
 				// set the type as appropriate.
@@ -334,7 +335,7 @@ LLSLURL::LLSLURL(const std::string& grid,
 LLSLURL::LLSLURL(const std::string& region, 
 		 const LLVector3& position)
 {
-  *this = LLSLURL(LLGridManager::getInstance()->getGrid(),
+  *this = LLSLURL(LLGridManager::getInstance()->getGridId(),
 		  region, position);
 }
 
@@ -343,7 +344,7 @@ LLSLURL::LLSLURL(const std::string& grid,
 		 const std::string& region, 
 		 const LLVector3d& global_position)
 {
-  *this = LLSLURL(grid,
+	*this = LLSLURL(LLGridManager::getInstance()->getGridId(grid),
 		  region, LLVector3(global_position.mdV[VX],
 				    global_position.mdV[VY],
 				    global_position.mdV[VZ]));
@@ -353,7 +354,7 @@ LLSLURL::LLSLURL(const std::string& grid,
 LLSLURL::LLSLURL(const std::string& region, 
 		 const LLVector3d& global_position)
 {
-  *this = LLSLURL(LLGridManager::getInstance()->getGrid(),
+  *this = LLSLURL(LLGridManager::getInstance()->getGridId(),
 		  region, global_position);
 }
 
@@ -426,7 +427,7 @@ std::string LLSLURL::getLoginString() const
 			unescaped_start << "last";
 			break;
 		default:
-			LL_WARNS("AppInit") << "Unexpected SLURL type for login string" << (int)mType << LL_ENDL;
+			LL_WARNS("AppInit") << "Unexpected SLURL type ("<<(int)mType <<")for login string"<< LL_ENDL;
 			break;
 	}
 	return  xml_escape_string(unescaped_start.str());
@@ -465,18 +466,47 @@ std::string LLSLURL::getLocationString() const
 					(int)llround(mPosition[1]),
 					(int)llround(mPosition[2]));						 
 }
+
+// static
+const std::string LLSLURL::typeName[NUM_SLURL_TYPES] = 
+{
+	"INVALID", 
+	"LOCATION",
+	"HOME_LOCATION",
+	"LAST_LOCATION",
+	"APP",
+	"HELP"
+};
+		
+std::string LLSLURL::getTypeString(SLURL_TYPE type)
+{
+	std::string name;
+	if ( type >= INVALID && type < NUM_SLURL_TYPES )
+	{
+		name = LLSLURL::typeName[type];
+	}
+	else
+	{
+		name = llformat("Out of Range (%d)",type);
+	}
+	return name;
+}
+
+
 std::string LLSLURL::asString() const
 {
     std::ostringstream result;
-    result << "   mAppCmd:"  << getAppCmd() <<
-              "   mAppPath:" + getAppPath().asString() <<
-              "   mAppQueryMap:" + getAppQueryMap().asString() <<
-              "   mAppQuery: " + getAppQuery() <<
-              "   mGrid: " + getGrid() <<
-              "   mRegion: " + getRegion() <<
-              "   mPosition: "  <<
-              "   mType: " << mType <<
-              "   mPosition: " << mPosition;
+    result
+		<< "   mType: " << LLSLURL::getTypeString(mType)
+		<< "   mGrid: " + getGrid()
+		<< "   mRegion: " + getRegion()
+		<< "   mPosition: " << mPosition
+		<< "   mAppCmd:"  << getAppCmd()
+		<< "   mAppPath:" + getAppPath().asString()
+		<< "   mAppQueryMap:" + getAppQueryMap().asString()
+		<< "   mAppQuery: " + getAppQuery()
+		;
+	
     return result.str();
 }
 
diff --git a/indra/newview/llslurl.h b/indra/newview/llslurl.h
index 1a3f0543dd09163e133e8fe7c80ad1af65486938..b86cf7949ba021e9a921063215f091933ab2a160 100644
--- a/indra/newview/llslurl.h
+++ b/indra/newview/llslurl.h
@@ -51,13 +51,15 @@ class LLSLURL
 	static const char* SLURL_APP_PATH;
 	static const char* SLURL_REGION_PATH;	
 	
+	// if you modify this enumeration, update typeName as well
 	enum SLURL_TYPE { 
 		INVALID, 
 		LOCATION,
 		HOME_LOCATION,
 		LAST_LOCATION,
 		APP,
-		HELP 
+		HELP,
+		NUM_SLURL_TYPES // must be last
 	};
 		
 	
@@ -92,6 +94,10 @@ class LLSLURL
     std::string asString() const ;
 
 protected:
+	static const std::string typeName[NUM_SLURL_TYPES];
+	/// Get a human-readable version of the type for logging
+	static std::string getTypeString(SLURL_TYPE type);	
+	
 	SLURL_TYPE mType;
 	
 	// used for Apps and Help
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 325a2d300453a0dce2dd4e22e2c5470576aa20ae..78c905f6ffba81bf941ea3cbab77d3d0648e9d28 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -68,6 +68,7 @@ const F32 SG_OCCLUSION_FUDGE = 0.25f;
 #define assert_states_valid(x)
 #endif
 
+extern bool gShiftFrame;
 
 static U32 sZombieGroups = 0;
 U32 LLSpatialGroup::sNodeCount = 0;
@@ -529,6 +530,7 @@ void LLSpatialGroup::setVisible()
 
 void LLSpatialGroup::validate()
 {
+	ll_assert_aligned(this,64);
 #if LL_OCTREE_PARANOIA_CHECK
 
 	sg_assert(!isState(DIRTY));
@@ -541,7 +543,7 @@ void LLSpatialGroup::validate()
 
 	validateDrawMap();
 
-	for (element_iter i = getData().begin(); i != getData().end(); ++i)
+	for (element_iter i = getDataBegin(); i != getDataEnd(); ++i)
 	{
 		LLDrawable* drawable = *i;
 		sg_assert(drawable->getSpatialGroup() == this);
@@ -758,7 +760,7 @@ BOOL LLSpatialGroup::boundObjects(BOOL empty, LLVector4a& minOut, LLVector4a& ma
 {	
 	const OctreeNode* node = mOctreeNode;
 
-	if (node->getData().empty())
+	if (node->isEmpty())
 	{	//don't do anything if there are no objects
 		if (empty && mOctreeNode->getParent())
 		{	//only root is allowed to be empty
@@ -775,14 +777,14 @@ BOOL LLSpatialGroup::boundObjects(BOOL empty, LLVector4a& minOut, LLVector4a& ma
 		clearState(OBJECT_DIRTY);
 
 		//initialize bounding box to first element
-		OctreeNode::const_element_iter i = node->getData().begin();
+		OctreeNode::const_element_iter i = node->getDataBegin();
 		LLDrawable* drawablep = *i;
 		const LLVector4a* minMax = drawablep->getSpatialExtents();
 
 		newMin = minMax[0];
 		newMax = minMax[1];
 
-		for (++i; i != node->getData().end(); ++i)
+		for (++i; i != node->getDataEnd(); ++i)
 		{
 			drawablep = *i;
 			minMax = drawablep->getSpatialExtents();
@@ -923,7 +925,10 @@ void LLSpatialGroup::shift(const LLVector4a &offset)
 	mObjectExtents[0].add(offset);
 	mObjectExtents[1].add(offset);
 
-	//if (!mSpatialPartition->mRenderByGroup)
+	if (!mSpatialPartition->mRenderByGroup && 
+		mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_TREE &&
+		mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_TERRAIN &&
+		mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_BRIDGE)
 	{
 		setState(GEOM_DIRTY);
 		gPipeline.markRebuild(this, TRUE);
@@ -1195,6 +1200,8 @@ LLSpatialGroup::LLSpatialGroup(OctreeNode* node, LLSpatialPartition* part) :
 	mCurUpdatingSlotp(NULL),
 	mCurUpdatingTexture (NULL)
 {
+	ll_assert_aligned(this,16);
+	
 	sNodeCount++;
 	LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
 
@@ -1238,13 +1245,18 @@ void LLSpatialGroup::updateDistance(LLCamera &camera)
 		return;
 	}
 
+	if (gShiftFrame)
+	{
+		return;
+	}
+
 #if !LL_RELEASE_FOR_DOWNLOAD
 	if (isState(LLSpatialGroup::OBJECT_DIRTY))
 	{
 		llerrs << "Spatial group dirty on distance update." << llendl;
 	}
 #endif
-	if (!getData().empty())
+	if (!isEmpty())
 	{
 		mRadius = mSpatialPartition->mRenderByGroup ? mObjectBounds[1].getLength3().getF32() :
 						(F32) mOctreeNode->getSize().getLength3().getF32();
@@ -1395,7 +1407,7 @@ void LLSpatialGroup::handleDestruction(const TreeNode* node)
 	LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
 	setState(DEAD);
 	
-	for (element_iter i = getData().begin(); i != getData().end(); ++i)
+	for (element_iter i = getDataBegin(); i != getDataEnd(); ++i)
 	{
 		LLDrawable* drawable = *i;
 		if (drawable->getSpatialGroup() == this)
@@ -1482,7 +1494,7 @@ void LLSpatialGroup::destroyGL(bool keep_occlusion)
 	}
 
 
-	for (LLSpatialGroup::element_iter i = getData().begin(); i != getData().end(); ++i)
+	for (LLSpatialGroup::element_iter i = getDataBegin(); i != getDataEnd(); ++i)
 	{
 		LLDrawable* drawable = *i;
 		for (S32 j = 0; j < drawable->getNumFaces(); j++)
@@ -1838,12 +1850,14 @@ BOOL LLSpatialPartition::remove(LLDrawable *drawablep, LLSpatialGroup *curp)
 {
 	LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
 	
-	drawablep->setSpatialGroup(NULL);
-
 	if (!curp->removeObject(drawablep))
 	{
 		OCT_ERRS << "Failed to remove drawable from octree!" << llendl;
 	}
+	else
+	{
+		drawablep->setSpatialGroup(NULL);
+	}
 
 	assert_octree_valid(mOctree);
 	
@@ -2114,7 +2128,7 @@ class LLOctreeCullVisExtents: public LLOctreeCullShadow
 
 	virtual void processGroup(LLSpatialGroup* group)
 	{
-		llassert(!group->isState(LLSpatialGroup::DIRTY) && !group->getData().empty())
+		llassert(!group->isState(LLSpatialGroup::DIRTY) && !group->isEmpty())
 		
 		if (mRes < 2)
 		{
@@ -2181,7 +2195,7 @@ class LLOctreeSelect : public LLOctreeCull
 	{
 		LLSpatialGroup::OctreeNode* branch = group->mOctreeNode;
 
-		for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i)
+		for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getDataBegin(); i != branch->getDataEnd(); ++i)
 		{
 			LLDrawable* drawable = *i;
 			
@@ -2305,7 +2319,7 @@ class LLOctreeDirty : public LLOctreeTraveler<LLDrawable>
 		LLSpatialGroup* group = (LLSpatialGroup*) state->getListener(0);
 		group->destroyGL();
 
-		for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
+		for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
 		{
 			LLDrawable* drawable = *i;
 			if (drawable->getVObj().notNull() && !group->mSpatialPartition->mRenderByGroup)
@@ -2615,7 +2629,7 @@ void renderOctree(LLSpatialGroup* group)
 			gGL.flush();
 			glLineWidth(1.f);
 			gGL.flush();
-			for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
+			for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
 			{
 				LLDrawable* drawable = *i;
 				if (!group->mSpatialPartition->isBridge())
@@ -2661,7 +2675,7 @@ void renderOctree(LLSpatialGroup* group)
 	}
 	else
 	{
-		if (group->mBufferUsage == GL_STATIC_DRAW_ARB && !group->getData().empty() 
+		if (group->mBufferUsage == GL_STATIC_DRAW_ARB && !group->isEmpty() 
 			&& group->mSpatialPartition->mRenderByGroup)
 		{
 			col.setVec(0.8f, 0.4f, 0.1f, 0.1f);
@@ -2729,7 +2743,7 @@ void renderVisibility(LLSpatialGroup* group, LLCamera* camera)
 	glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
 
 	BOOL render_objects = (!LLPipeline::sUseOcclusion || !group->isOcclusionState(LLSpatialGroup::OCCLUDED)) && group->isVisible() &&
-							!group->getData().empty();
+							!group->isEmpty();
 
 	if (render_objects)
 	{
@@ -3460,7 +3474,7 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
 
 void renderPhysicsShapes(LLSpatialGroup* group)
 {
-	for (LLSpatialGroup::OctreeNode::const_element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
+	for (LLSpatialGroup::OctreeNode::const_element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
 	{
 		LLDrawable* drawable = *i;
 		LLVOVolume* volume = drawable->getVOVolume();
@@ -3809,7 +3823,7 @@ class LLRenderOctreeRaycast : public LLOctreeTriangleRayIntersect
 
 		LLVector3 center, size;
 		
-		if (branch->getData().empty())
+		if (branch->isEmpty())
 		{
 			gGL.diffuseColor3f(1.f,0.2f,0.f);
 			center.set(branch->getCenter().getF32ptr());
@@ -3845,8 +3859,8 @@ class LLRenderOctreeRaycast : public LLOctreeTriangleRayIntersect
 			}
 
 			gGL.begin(LLRender::TRIANGLES);
-			for (LLOctreeNode<LLVolumeTriangle>::const_element_iter iter = branch->getData().begin();
-					iter != branch->getData().end();
+			for (LLOctreeNode<LLVolumeTriangle>::const_element_iter iter = branch->getDataBegin();
+					iter != branch->getDataEnd();
 					++iter)
 			{
 				const LLVolumeTriangle* tri = *iter;
@@ -4083,7 +4097,7 @@ class LLOctreeRenderNonOccluded : public LLOctreeTraveler<LLDrawable>
 
 		if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_BBOXES))
 		{
-			if (!group->getData().empty())
+			if (!group->isEmpty())
 			{
 				gGL.diffuseColor3f(0,0,1);
 				drawBoxOutline(group->mObjectBounds[0],
@@ -4091,7 +4105,7 @@ class LLOctreeRenderNonOccluded : public LLOctreeTraveler<LLDrawable>
 			}
 		}
 
-		for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i)
+		for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getDataBegin(); i != branch->getDataEnd(); ++i)
 		{
 			LLDrawable* drawable = *i;
 					
@@ -4177,7 +4191,7 @@ class LLOctreeRenderNonOccluded : public LLOctreeTraveler<LLDrawable>
 						{
 							if (index < 255)
 							{
-								if (facep->mDrawInfo->mTextureList.size() <= index)
+								if (facep->mDrawInfo->mTextureList.size()<= index)
 								{
 									llerrs << "Face texture index out of bounds." << llendl;
 								}
@@ -4280,7 +4294,7 @@ class LLOctreePushBBoxVerts : public LLOctreeTraveler<LLDrawable>
 			return;
 		}
 
-		for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i)
+		for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getDataBegin(); i != branch->getDataEnd(); ++i)
 		{
 			LLDrawable* drawable = *i;
 						
@@ -4504,7 +4518,7 @@ class LLOctreeIntersect : public LLSpatialGroup::OctreeTraveler
 	
 	virtual void visit(const LLSpatialGroup::OctreeNode* branch) 
 	{	
-		for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i)
+		for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getDataBegin(); i != branch->getDataEnd(); ++i)
 		{
 			check(*i);
 		}
@@ -4690,28 +4704,62 @@ LLVertexBuffer* LLGeometryManager::createVertexBuffer(U32 type_mask, U32 usage)
 
 LLCullResult::LLCullResult() 
 {
+	mVisibleGroupsAllocated = 0;
+	mAlphaGroupsAllocated = 0;
+	mOcclusionGroupsAllocated = 0;
+	mDrawableGroupsAllocated = 0;
+	mVisibleListAllocated = 0;
+	mVisibleBridgeAllocated = 0;
+
+	mVisibleGroups = NULL;
+	mVisibleGroupsEnd = NULL;
+	mAlphaGroups = NULL;
+	mAlphaGroupsEnd = NULL;
+	mOcclusionGroups = NULL;
+	mOcclusionGroupsEnd = NULL;
+	mDrawableGroups = NULL;
+	mDrawableGroupsEnd = NULL;
+	mVisibleList = NULL;
+	mVisibleListEnd = NULL;
+	mVisibleBridge = NULL;
+	mVisibleBridgeEnd = NULL;
+
+	for (U32 i = 0; i < LLRenderPass::NUM_RENDER_TYPES; i++)
+	{
+		mRenderMap[i] = NULL;
+		mRenderMapEnd[i] = NULL;
+		mRenderMapAllocated[i] = 0;
+	}
+
 	clear();
 }
 
+void LLCullResult::pushBack(void**& head, U32& count, void* val)
+{
+	count++;
+	head = (void**) realloc((void*) head, sizeof(void*) * count);
+	head[count-1] = val;
+}
+
 void LLCullResult::clear()
 {
 	mVisibleGroupsSize = 0;
-	mVisibleGroupsEnd = mVisibleGroups.begin();
+	mVisibleGroupsEnd = mVisibleGroups;
 
 	mAlphaGroupsSize = 0;
-	mAlphaGroupsEnd = mAlphaGroups.begin();
+	mAlphaGroupsEnd = mAlphaGroups;
 
 	mOcclusionGroupsSize = 0;
-	mOcclusionGroupsEnd = mOcclusionGroups.begin();
+	mOcclusionGroupsEnd = mOcclusionGroups;
 
 	mDrawableGroupsSize = 0;
-	mDrawableGroupsEnd = mDrawableGroups.begin();
+	mDrawableGroupsEnd = mDrawableGroups;
 
 	mVisibleListSize = 0;
-	mVisibleListEnd = mVisibleList.begin();
+	mVisibleListEnd = mVisibleList;
 
 	mVisibleBridgeSize = 0;
-	mVisibleBridgeEnd = mVisibleBridge.begin();
+	mVisibleBridgeEnd = mVisibleBridge;
 
 
 	for (U32 i = 0; i < LLRenderPass::NUM_RENDER_TYPES; i++)
@@ -4721,176 +4769,176 @@ void LLCullResult::clear()
 			mRenderMap[i][j] = 0;
 		}
 		mRenderMapSize[i] = 0;
-		mRenderMapEnd[i] = mRenderMap[i].begin();
+		mRenderMapEnd[i] = mRenderMap[i];
 	}
 }
 
-LLCullResult::sg_list_t::iterator LLCullResult::beginVisibleGroups()
+LLCullResult::sg_iterator LLCullResult::beginVisibleGroups()
 {
-	return mVisibleGroups.begin();
+	return mVisibleGroups;
 }
 
-LLCullResult::sg_list_t::iterator LLCullResult::endVisibleGroups()
+LLCullResult::sg_iterator LLCullResult::endVisibleGroups()
 {
 	return mVisibleGroupsEnd;
 }
 
-LLCullResult::sg_list_t::iterator LLCullResult::beginAlphaGroups()
+LLCullResult::sg_iterator LLCullResult::beginAlphaGroups()
 {
-	return mAlphaGroups.begin();
+	return mAlphaGroups;
 }
 
-LLCullResult::sg_list_t::iterator LLCullResult::endAlphaGroups()
+LLCullResult::sg_iterator LLCullResult::endAlphaGroups()
 {
 	return mAlphaGroupsEnd;
 }
 
-LLCullResult::sg_list_t::iterator LLCullResult::beginOcclusionGroups()
+LLCullResult::sg_iterator LLCullResult::beginOcclusionGroups()
 {
-	return mOcclusionGroups.begin();
+	return mOcclusionGroups;
 }
 
-LLCullResult::sg_list_t::iterator LLCullResult::endOcclusionGroups()
+LLCullResult::sg_iterator LLCullResult::endOcclusionGroups()
 {
 	return mOcclusionGroupsEnd;
 }
 
-LLCullResult::sg_list_t::iterator LLCullResult::beginDrawableGroups()
+LLCullResult::sg_iterator LLCullResult::beginDrawableGroups()
 {
-	return mDrawableGroups.begin();
+	return mDrawableGroups;
 }
 
-LLCullResult::sg_list_t::iterator LLCullResult::endDrawableGroups()
+LLCullResult::sg_iterator LLCullResult::endDrawableGroups()
 {
 	return mDrawableGroupsEnd;
 }
 
-LLCullResult::drawable_list_t::iterator LLCullResult::beginVisibleList()
+LLCullResult::drawable_iterator LLCullResult::beginVisibleList()
 {
-	return mVisibleList.begin();
+	return mVisibleList;
 }
 
-LLCullResult::drawable_list_t::iterator LLCullResult::endVisibleList()
+LLCullResult::drawable_iterator LLCullResult::endVisibleList()
 {
 	return mVisibleListEnd;
 }
 
-LLCullResult::bridge_list_t::iterator LLCullResult::beginVisibleBridge()
+LLCullResult::bridge_iterator LLCullResult::beginVisibleBridge()
 {
-	return mVisibleBridge.begin();
+	return mVisibleBridge;
 }
 
-LLCullResult::bridge_list_t::iterator LLCullResult::endVisibleBridge()
+LLCullResult::bridge_iterator LLCullResult::endVisibleBridge()
 {
 	return mVisibleBridgeEnd;
 }
 
-LLCullResult::drawinfo_list_t::iterator LLCullResult::beginRenderMap(U32 type)
+LLCullResult::drawinfo_iterator LLCullResult::beginRenderMap(U32 type)
 {
-	return mRenderMap[type].begin();
+	return mRenderMap[type];
 }
 
-LLCullResult::drawinfo_list_t::iterator LLCullResult::endRenderMap(U32 type)
+LLCullResult::drawinfo_iterator LLCullResult::endRenderMap(U32 type)
 {
 	return mRenderMapEnd[type];
 }
 
 void LLCullResult::pushVisibleGroup(LLSpatialGroup* group)
 {
-	if (mVisibleGroupsSize < mVisibleGroups.size())
+	if (mVisibleGroupsSize < mVisibleGroupsAllocated)
 	{
 		mVisibleGroups[mVisibleGroupsSize] = group;
 	}
 	else
 	{
-		mVisibleGroups.push_back(group);
+		pushBack((void**&) mVisibleGroups, mVisibleGroupsAllocated, (void*) group);
 	}
 	++mVisibleGroupsSize;
-	mVisibleGroupsEnd = mVisibleGroups.begin()+mVisibleGroupsSize;
+	mVisibleGroupsEnd = mVisibleGroups+mVisibleGroupsSize;
 }
 
 void LLCullResult::pushAlphaGroup(LLSpatialGroup* group)
 {
-	if (mAlphaGroupsSize < mAlphaGroups.size())
+	if (mAlphaGroupsSize < mAlphaGroupsAllocated)
 	{
 		mAlphaGroups[mAlphaGroupsSize] = group;
 	}
 	else
 	{
-		mAlphaGroups.push_back(group);
+		pushBack((void**&) mAlphaGroups, mAlphaGroupsAllocated, (void*) group);
 	}
 	++mAlphaGroupsSize;
-	mAlphaGroupsEnd = mAlphaGroups.begin()+mAlphaGroupsSize;
+	mAlphaGroupsEnd = mAlphaGroups+mAlphaGroupsSize;
 }
 
 void LLCullResult::pushOcclusionGroup(LLSpatialGroup* group)
 {
-	if (mOcclusionGroupsSize < mOcclusionGroups.size())
+	if (mOcclusionGroupsSize < mOcclusionGroupsAllocated)
 	{
 		mOcclusionGroups[mOcclusionGroupsSize] = group;
 	}
 	else
 	{
-		mOcclusionGroups.push_back(group);
+		pushBack((void**&) mOcclusionGroups, mOcclusionGroupsAllocated, (void*) group);
 	}
 	++mOcclusionGroupsSize;
-	mOcclusionGroupsEnd = mOcclusionGroups.begin()+mOcclusionGroupsSize;
+	mOcclusionGroupsEnd = mOcclusionGroups+mOcclusionGroupsSize;
 }
 
 void LLCullResult::pushDrawableGroup(LLSpatialGroup* group)
 {
-	if (mDrawableGroupsSize < mDrawableGroups.size())
+	if (mDrawableGroupsSize < mDrawableGroupsAllocated)
 	{
 		mDrawableGroups[mDrawableGroupsSize] = group;
 	}
 	else
 	{
-		mDrawableGroups.push_back(group);
+		pushBack((void**&) mDrawableGroups, mDrawableGroupsAllocated, (void*) group);
 	}
 	++mDrawableGroupsSize;
-	mDrawableGroupsEnd = mDrawableGroups.begin()+mDrawableGroupsSize;
+	mDrawableGroupsEnd = mDrawableGroups+mDrawableGroupsSize;
 }
 
 void LLCullResult::pushDrawable(LLDrawable* drawable)
 {
-	if (mVisibleListSize < mVisibleList.size())
+	if (mVisibleListSize < mVisibleListAllocated)
 	{
 		mVisibleList[mVisibleListSize] = drawable;
 	}
 	else
 	{
-		mVisibleList.push_back(drawable);
+		pushBack((void**&) mVisibleList, mVisibleListAllocated, (void*) drawable);
 	}
 	++mVisibleListSize;
-	mVisibleListEnd = mVisibleList.begin()+mVisibleListSize;
+	mVisibleListEnd = mVisibleList+mVisibleListSize;
 }
 
 void LLCullResult::pushBridge(LLSpatialBridge* bridge)
 {
-	if (mVisibleBridgeSize < mVisibleBridge.size())
+	if (mVisibleBridgeSize < mVisibleBridgeAllocated)
 	{
 		mVisibleBridge[mVisibleBridgeSize] = bridge;
 	}
 	else
 	{
-		mVisibleBridge.push_back(bridge);
+		pushBack((void**&) mVisibleBridge, mVisibleBridgeAllocated, (void*) bridge);
 	}
 	++mVisibleBridgeSize;
-	mVisibleBridgeEnd = mVisibleBridge.begin()+mVisibleBridgeSize;
+	mVisibleBridgeEnd = mVisibleBridge+mVisibleBridgeSize;
 }
 
 void LLCullResult::pushDrawInfo(U32 type, LLDrawInfo* draw_info)
 {
-	if (mRenderMapSize[type] < mRenderMap[type].size())
+	if (mRenderMapSize[type] < mRenderMapAllocated[type])
 	{
 		mRenderMap[type][mRenderMapSize[type]] = draw_info;
 	}
 	else
 	{
-		mRenderMap[type].push_back(draw_info);
+		pushBack((void**&) mRenderMap[type], mRenderMapAllocated[type], (void*) draw_info);
 	}
 	++mRenderMapSize[type];
-	mRenderMapEnd[type] = mRenderMap[type].begin() + mRenderMapSize[type];
+	mRenderMapEnd[type] = mRenderMap[type] + mRenderMapSize[type];
 }
 
 
diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h
index f0e4f15a83b579c855acc68c0c706905653965cf..f050df2b3945709ce0c400038ce3c47a32b79713 100644
--- a/indra/newview/llspatialpartition.h
+++ b/indra/newview/llspatialpartition.h
@@ -68,6 +68,16 @@ class LLDrawInfo : public LLRefCount
 	~LLDrawInfo();	
 	
 public:
+	void* operator new(size_t size)
+	{
+		return ll_aligned_malloc_16(size);
+	}
+
+	void operator delete(void* ptr)
+	{
+		ll_aligned_free_16(ptr);
+	}
+
 
 	LLDrawInfo(const LLDrawInfo& rhs)
 	{
@@ -106,7 +116,7 @@ class LLDrawInfo : public LLRefCount
 	F32 mPartSize;
 	F32 mVSize;
 	LLSpatialGroup* mGroup;
-	LLFace* mFace; //associated face
+	LL_ALIGN_16(LLFace* mFace); //associated face
 	F32 mDistance;
 	U32 mDrawMode;
 
@@ -181,7 +191,7 @@ class LLDrawInfo : public LLRefCount
 	};
 };
 
-LL_ALIGN_PREFIX(64)
+LL_ALIGN_PREFIX(16)
 class LLSpatialGroup : public LLOctreeListener<LLDrawable>
 {
 	friend class LLSpatialPartition;
@@ -193,6 +203,16 @@ class LLSpatialGroup : public LLOctreeListener<LLDrawable>
 		*this = rhs;
 	}
 
+	void* operator new(size_t size)
+	{
+		return ll_aligned_malloc_16(size);
+	}
+
+	void operator delete(void* ptr)
+	{
+		ll_aligned_free_16(ptr);
+	}
+
 	const LLSpatialGroup& operator=(const LLSpatialGroup& rhs)
 	{
 		llerrs << "Illegal operation!" << llendl;
@@ -325,8 +345,13 @@ class LLSpatialGroup : public LLOctreeListener<LLDrawable>
 
 	void dirtyGeom() { setState(GEOM_DIRTY); }
 	void dirtyMesh() { setState(MESH_DIRTY); }
+
+	//octree wrappers to make code more readable
 	element_list& getData() { return mOctreeNode->getData(); }
+	element_iter getDataBegin() { return mOctreeNode->getDataBegin(); }
+	element_iter getDataEnd() { return mOctreeNode->getDataEnd(); }
 	U32 getElementCount() const { return mOctreeNode->getElementCount(); }
+	bool isEmpty() const { return mOctreeNode->isEmpty(); }
 
 	void drawObjectBox(LLColor4 col);
 
@@ -370,12 +395,12 @@ class LLSpatialGroup : public LLOctreeListener<LLDrawable>
 		V4_COUNT = 10
 	} eV4Index;
 
-	LLVector4a mBounds[2]; // bounding box (center, size) of this node and all its children (tight fit to objects)
-	LLVector4a mExtents[2]; // extents (min, max) of this node and all its children
-	LLVector4a mObjectExtents[2]; // extents (min, max) of objects in this node
-	LLVector4a mObjectBounds[2]; // bounding box (center, size) of objects in this node
-	LLVector4a mViewAngle;
-	LLVector4a mLastUpdateViewAngle;
+	LL_ALIGN_16(LLVector4a mBounds[2]); // bounding box (center, size) of this node and all its children (tight fit to objects)
+	LL_ALIGN_16(LLVector4a mExtents[2]); // extents (min, max) of this node and all its children
+	LL_ALIGN_16(LLVector4a mObjectExtents[2]); // extents (min, max) of objects in this node
+	LL_ALIGN_16(LLVector4a mObjectBounds[2]); // bounding box (center, size) of objects in this node
+	LL_ALIGN_16(LLVector4a mViewAngle);
+	LL_ALIGN_16(LLVector4a mLastUpdateViewAngle);
 
 	F32 mObjectBoxSize; //cached mObjectBounds[1].getLength3()
 		
@@ -542,34 +567,39 @@ class LLCullResult
 public:
 	LLCullResult();
 
-	typedef std::vector<LLSpatialGroup*> sg_list_t;
-	typedef std::vector<LLDrawable*> drawable_list_t;
-	typedef std::vector<LLSpatialBridge*> bridge_list_t;
-	typedef std::vector<LLDrawInfo*> drawinfo_list_t;
+	typedef LLSpatialGroup** sg_list_t;
+	typedef LLDrawable** drawable_list_t;
+	typedef LLSpatialBridge** bridge_list_t;
+	typedef LLDrawInfo** drawinfo_list_t;
+
+	typedef LLSpatialGroup** sg_iterator;
+	typedef LLSpatialBridge** bridge_iterator;
+	typedef LLDrawInfo** drawinfo_iterator;
+	typedef LLDrawable** drawable_iterator;
 
 	void clear();
 	
-	sg_list_t::iterator beginVisibleGroups();
-	sg_list_t::iterator endVisibleGroups();
+	sg_iterator beginVisibleGroups();
+	sg_iterator endVisibleGroups();
 
-	sg_list_t::iterator beginAlphaGroups();
-	sg_list_t::iterator endAlphaGroups();
+	sg_iterator beginAlphaGroups();
+	sg_iterator endAlphaGroups();
 
 	bool hasOcclusionGroups() { return mOcclusionGroupsSize > 0; }
-	sg_list_t::iterator beginOcclusionGroups();
-	sg_list_t::iterator endOcclusionGroups();
+	sg_iterator beginOcclusionGroups();
+	sg_iterator endOcclusionGroups();
 
-	sg_list_t::iterator beginDrawableGroups();
-	sg_list_t::iterator endDrawableGroups();
+	sg_iterator beginDrawableGroups();
+	sg_iterator endDrawableGroups();
 
-	drawable_list_t::iterator beginVisibleList();
-	drawable_list_t::iterator endVisibleList();
+	drawable_iterator beginVisibleList();
+	drawable_iterator endVisibleList();
 
-	bridge_list_t::iterator beginVisibleBridge();
-	bridge_list_t::iterator endVisibleBridge();
+	bridge_iterator beginVisibleBridge();
+	bridge_iterator endVisibleBridge();
 
-	drawinfo_list_t::iterator beginRenderMap(U32 type);
-	drawinfo_list_t::iterator endRenderMap(U32 type);
+	drawinfo_iterator beginRenderMap(U32 type);
+	drawinfo_iterator endRenderMap(U32 type);
 
 	void pushVisibleGroup(LLSpatialGroup* group);
 	void pushAlphaGroup(LLSpatialGroup* group);
@@ -589,28 +619,41 @@ class LLCullResult
 	void assertDrawMapsEmpty();
 
 private:
+
+	void pushBack(void** &head, U32& count, void* val);
+
 	U32					mVisibleGroupsSize;
 	U32					mAlphaGroupsSize;
 	U32					mOcclusionGroupsSize;
 	U32					mDrawableGroupsSize;
 	U32					mVisibleListSize;
 	U32					mVisibleBridgeSize;
+
+	U32					mVisibleGroupsAllocated;
+	U32					mAlphaGroupsAllocated;
+	U32					mOcclusionGroupsAllocated;
+	U32					mDrawableGroupsAllocated;
+	U32					mVisibleListAllocated;
+	U32					mVisibleBridgeAllocated;
+
 	U32					mRenderMapSize[LLRenderPass::NUM_RENDER_TYPES];
 
 	sg_list_t			mVisibleGroups;
-	sg_list_t::iterator mVisibleGroupsEnd;
+	sg_iterator			mVisibleGroupsEnd;
 	sg_list_t			mAlphaGroups;
-	sg_list_t::iterator mAlphaGroupsEnd;
+	sg_iterator			mAlphaGroupsEnd;
 	sg_list_t			mOcclusionGroups;
-	sg_list_t::iterator	mOcclusionGroupsEnd;
+	sg_iterator			mOcclusionGroupsEnd;
 	sg_list_t			mDrawableGroups;
-	sg_list_t::iterator mDrawableGroupsEnd;
+	sg_iterator			mDrawableGroupsEnd;
 	drawable_list_t		mVisibleList;
-	drawable_list_t::iterator mVisibleListEnd;
+	drawable_iterator	mVisibleListEnd;
 	bridge_list_t		mVisibleBridge;
-	bridge_list_t::iterator mVisibleBridgeEnd;
+	bridge_iterator		mVisibleBridgeEnd;
 	drawinfo_list_t		mRenderMap[LLRenderPass::NUM_RENDER_TYPES];
-	drawinfo_list_t::iterator mRenderMapEnd[LLRenderPass::NUM_RENDER_TYPES];
+	U32					mRenderMapAllocated[LLRenderPass::NUM_RENDER_TYPES];
+	drawinfo_iterator mRenderMapEnd[LLRenderPass::NUM_RENDER_TYPES];
+
 };
 
 
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 56f27c158dc8f69a62e5a2dd24f5dd61c0f56dd4..cef6ca3edceb6e2db7d94cc7e72aed2e0cb40668 100755
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -186,6 +186,7 @@
 #include "llappearancemgr.h"
 #include "llavatariconctrl.h"
 #include "llvoicechannel.h"
+#include "llpathfindingmanager.h"
 
 #include "lllogin.h"
 #include "llevents.h"
@@ -1005,7 +1006,7 @@ bool idle_startup()
 
 	if(STATE_LOGIN_AUTH_INIT == LLStartUp::getStartupState())
 	{
-		gDebugInfo["GridName"] = LLGridManager::getInstance()->getGridLabel();
+		gDebugInfo["GridName"] = LLGridManager::getInstance()->getGridId();
 
 		// Update progress status and the display loop.
 		auth_desc = LLTrans::getString("LoginInProgress");
@@ -1169,7 +1170,6 @@ bool idle_startup()
 				LLVoiceClient::getInstance()->userAuthorized(gUserCredential->userID(), gAgentID);
 				// create the default proximal channel
 				LLVoiceChannel::initClass();
-				LLGridManager::getInstance()->setFavorite(); 
 				LLStartUp::setStartupState( STATE_WORLD_INIT);
 			}
 			else
@@ -1932,7 +1932,8 @@ bool idle_startup()
 		{
 			llinfos << "gAgentStartLocation : " << gAgentStartLocation << llendl;
 			LLSLURL start_slurl = LLStartUp::getStartSLURL();
-			
+			LL_DEBUGS("AppInit") << "start slurl "<<start_slurl.asString()<<LL_ENDL;
+
 			if (((start_slurl.getType() == LLSLURL::LOCATION) && (gAgentStartLocation == "url")) ||
 				((start_slurl.getType() == LLSLURL::LAST_LOCATION) && (gAgentStartLocation == "last")) ||
 				((start_slurl.getType() == LLSLURL::HOME_LOCATION) && (gAgentStartLocation == "home")))
@@ -2176,6 +2177,9 @@ bool idle_startup()
 		LLIMFloater::initIMFloater();
 		display_startup();
 
+		llassert(LLPathfindingManager::getInstance() != NULL);
+		LLPathfindingManager::getInstance()->initSystem();
+
 		return TRUE;
 	}
 
@@ -2191,21 +2195,13 @@ void login_show()
 {
 	LL_INFOS("AppInit") << "Initializing Login Screen" << LL_ENDL;
 
-#ifdef LL_RELEASE_FOR_DOWNLOAD
-	BOOL bUseDebugLogin = gSavedSettings.getBOOL("UseDebugLogin");
-#else
-	BOOL bUseDebugLogin = TRUE;
-#endif
 	// Hide the toolbars: may happen to come back here if login fails after login agent but before login in region
 	if (gToolBarView)
 	{
 		gToolBarView->setVisible(FALSE);
 	}
 	
-	LLPanelLogin::show(	gViewerWindow->getWindowRectScaled(),
-						bUseDebugLogin || gSavedSettings.getBOOL("SecondLifeEnterprise"),
-						login_callback, NULL );
-
+	LLPanelLogin::show(	gViewerWindow->getWindowRectScaled(), login_callback, NULL );
 }
 
 // Callback for when login screen is closed.  Option 0 = connect, option 1 = quit.
@@ -2284,7 +2280,7 @@ bool login_alert_status(const LLSD& notification, const LLSD& response)
       //      break;
         case 2:     // Teleport
             // Restart the login process, starting at our home locaton
-	  LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_HOME));
+			LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_HOME));
             LLStartUp::setStartupState( STATE_LOGIN_CLEANUP );
             break;
         default:
@@ -2838,21 +2834,18 @@ bool LLStartUp::dispatchURL()
 void LLStartUp::setStartSLURL(const LLSLURL& slurl) 
 {
   sStartSLURL = slurl;
+  LL_DEBUGS("AppInit")<<slurl.asString()<<LL_ENDL;
+
   switch(slurl.getType())
     {
     case LLSLURL::HOME_LOCATION:
-      {
-		  gSavedSettings.setString("LoginLocation", LLSLURL::SIM_LOCATION_HOME);
-	break;
-      }
     case LLSLURL::LAST_LOCATION:
-      {
-	gSavedSettings.setString("LoginLocation", LLSLURL::SIM_LOCATION_LAST);
-	break;
-      }
+    case LLSLURL::LOCATION:
+		gSavedSettings.setString("LoginLocation", LLSLURL::SIM_LOCATION_HOME);
+		LLPanelLogin::onUpdateStartSLURL(slurl); // updates grid if needed
+		break;
     default:
-			LLGridManager::getInstance()->setGridChoice(slurl.getGrid());
-			break;
+		break;
     }
 }
 
diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp
index 66df7dae3ed5332c9ea2f4fcc35542496d5f425c..f64a72a616c8a0673d9c6756fdcf8735befb1d15 100644
--- a/indra/newview/llsurface.cpp
+++ b/indra/newview/llsurface.cpp
@@ -56,6 +56,7 @@
 #include "lldrawable.h"
 
 extern LLPipeline gPipeline;
+extern bool gShiftFrame;
 
 LLColor4U MAX_WATER_COLOR(0, 48, 96, 240);
 
@@ -294,7 +295,7 @@ void LLSurface::initTextures()
 		mWaterObjp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, mRegionp);
 		gPipeline.createObject(mWaterObjp);
 		LLVector3d water_pos_global = from_region_handle(mRegionp->getHandle());
-		water_pos_global += LLVector3d(128.0, 128.0, DEFAULT_WATER_HEIGHT);
+		water_pos_global += LLVector3d(128.0, 128.0, DEFAULT_WATER_HEIGHT);		// region doesn't have a valid water height yet
 		mWaterObjp->setPositionGlobal(water_pos_global);
 	}
 }
@@ -346,6 +347,19 @@ void LLSurface::getNeighboringRegions( std::vector<LLViewerRegion*>& uniqueRegio
 	}	
 }
 
+
+void LLSurface::getNeighboringRegionsStatus( std::vector<S32>& regions )
+{
+	S32 i;
+	for (i = 0; i < 8; i++)
+	{
+		if ( mNeighbors[i] != NULL )
+		{
+			regions.push_back( i );
+		}
+	}	
+}
+
 void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction)
 {
 	S32 i;
@@ -608,6 +622,11 @@ void LLSurface::moveZ(const S32 x, const S32 y, const F32 delta)
 
 void LLSurface::updatePatchVisibilities(LLAgent &agent) 
 {
+	if (gShiftFrame)
+	{
+		return;
+	}
+
 	LLVector3 pos_region = mRegionp->getPosRegionFromGlobal(gAgentCamera.getCameraPositionGlobal());
 
 	LLSurfacePatch *patchp;
diff --git a/indra/newview/llsurface.h b/indra/newview/llsurface.h
index a4ef4fe2de61a00e7dfa9d9d2a2a8f288cd2b510..8052fb0d18d7b7b579a02ae47b23392987a5398f 100644
--- a/indra/newview/llsurface.h
+++ b/indra/newview/llsurface.h
@@ -142,6 +142,7 @@ class LLSurface
 	friend std::ostream& operator<<(std::ostream &s, const LLSurface &S);
 	
 	void getNeighboringRegions( std::vector<LLViewerRegion*>& uniqueRegions );
+	void getNeighboringRegionsStatus( std::vector<S32>& regions );
 	
 public:
 	// Number of grid points on one side of a region, including +1 buffer for
diff --git a/indra/newview/llsurfacepatch.cpp b/indra/newview/llsurfacepatch.cpp
index 5077c2c7e1f4bbdbd72ea6f642fecb0681bb8f08..a9ba2bce9c4ef2c8429796f0508b719c8545c5f3 100644
--- a/indra/newview/llsurfacepatch.cpp
+++ b/indra/newview/llsurfacepatch.cpp
@@ -43,6 +43,7 @@
 #include "lldrawpool.h"
 #include "noise.h"
 
+extern bool gShiftFrame;
 extern U64 gFrameTime;
 extern LLPipeline gPipeline;
 
@@ -218,7 +219,7 @@ void LLSurfacePatch::eval(const U32 x, const U32 y, const U32 stride, LLVector3
 	pos_agent.mV[VX] += x * mSurfacep->getMetersPerGrid();
 	pos_agent.mV[VY] += y * mSurfacep->getMetersPerGrid();
 	pos_agent.mV[VZ]  = *(mDataZ + point_offset);
-	*vertex     = pos_agent;
+	*vertex     = pos_agent-mVObjp->getRegion()->getOriginAgent();
 
 	LLVector3 rel_pos = pos_agent - mSurfacep->getOriginAgent();
 	LLVector3 tex_pos = rel_pos * (1.f/surface_stride);
@@ -366,10 +367,13 @@ void LLSurfacePatch::updateCameraDistanceRegion(const LLVector3 &pos_region)
 {
 	if (LLPipeline::sDynamicLOD)
 	{
-		LLVector3 dv = pos_region;
-		dv -= mCenterRegion;
-		mVisInfo.mDistance = llmax(0.f, (F32)(dv.magVec() - mRadius))/
-			llmax(LLVOSurfacePatch::sLODFactor, 0.1f);
+		if (!gShiftFrame)
+		{
+			LLVector3 dv = pos_region;
+			dv -= mCenterRegion;
+			mVisInfo.mDistance = llmax(0.f, (F32)(dv.magVec() - mRadius))/
+				llmax(LLVOSurfacePatch::sLODFactor, 0.1f);
+		}
 	}
 	else
 	{
diff --git a/indra/newview/lltexlayerparams.h b/indra/newview/lltexlayerparams.h
index 74c22b0cdf83ee4ebb0492da500856cc8df6d773..2c0da60b4863424cabcd364f7b566c0c6056704c 100644
--- a/indra/newview/lltexlayerparams.h
+++ b/indra/newview/lltexlayerparams.h
@@ -76,11 +76,11 @@ class LLTexLayerParamAlpha : public LLTexLayerParam
 
 	// LLViewerVisualParam Virtual functions
 	/*virtual*/ F32					getTotalDistortion()									{ return 1.f; }
-	/*virtual*/ const LLVector3&	getAvgDistortion()										{ return mAvgDistortionVec; }
+	/*virtual*/ const LLVector4a&	getAvgDistortion()										{ return mAvgDistortionVec; }
 	/*virtual*/ F32					getMaxDistortion()										{ return 3.f; }
-	/*virtual*/ LLVector3			getVertexDistortion(S32 index, LLPolyMesh *poly_mesh)	{ return LLVector3(1.f, 1.f, 1.f);}
-	/*virtual*/ const LLVector3*	getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh)	{ index = 0; poly_mesh = NULL; return &mAvgDistortionVec;};
-	/*virtual*/ const LLVector3*	getNextDistortion(U32 *index, LLPolyMesh **poly_mesh)	{ index = 0; poly_mesh = NULL; return NULL;};
+	/*virtual*/ LLVector4a			getVertexDistortion(S32 index, LLPolyMesh *poly_mesh)	{ return LLVector4a(1.f, 1.f, 1.f);}
+	/*virtual*/ const LLVector4a*	getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh)	{ index = 0; poly_mesh = NULL; return &mAvgDistortionVec;};
+	/*virtual*/ const LLVector4a*	getNextDistortion(U32 *index, LLPolyMesh **poly_mesh)	{ index = 0; poly_mesh = NULL; return NULL;};
 
 	// New functions
 	BOOL					render( S32 x, S32 y, S32 width, S32 height );
@@ -94,7 +94,7 @@ class LLTexLayerParamAlpha : public LLTexLayerParam
 	LLPointer<LLImageRaw>	mStaticImageRaw;
 	BOOL					mNeedsCreateTexture;
 	BOOL					mStaticImageInvalid;
-	LLVector3				mAvgDistortionVec;
+	LLVector4a				mAvgDistortionVec;
 	F32						mCachedEffectiveWeight;
 
 public:
@@ -155,18 +155,18 @@ class LLTexLayerParamColor : public LLTexLayerParam
 
 	// LLViewerVisualParam Virtual functions
 	/*virtual*/ F32					getTotalDistortion()									{ return 1.f; }
-	/*virtual*/ const LLVector3&	getAvgDistortion()										{ return mAvgDistortionVec; }
+	/*virtual*/ const LLVector4a&	getAvgDistortion()										{ return mAvgDistortionVec; }
 	/*virtual*/ F32					getMaxDistortion()										{ return 3.f; }
-	/*virtual*/ LLVector3			getVertexDistortion(S32 index, LLPolyMesh *poly_mesh)	{ return LLVector3(1.f, 1.f, 1.f); }
-	/*virtual*/ const LLVector3*	getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh)	{ index = 0; poly_mesh = NULL; return &mAvgDistortionVec;};
-	/*virtual*/ const LLVector3*	getNextDistortion(U32 *index, LLPolyMesh **poly_mesh)	{ index = 0; poly_mesh = NULL; return NULL;};
+	/*virtual*/ LLVector4a			getVertexDistortion(S32 index, LLPolyMesh *poly_mesh)	{ return LLVector4a(1.f, 1.f, 1.f); }
+	/*virtual*/ const LLVector4a*	getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh)	{ index = 0; poly_mesh = NULL; return &mAvgDistortionVec;};
+	/*virtual*/ const LLVector4a*	getNextDistortion(U32 *index, LLPolyMesh **poly_mesh)	{ index = 0; poly_mesh = NULL; return NULL;};
 
 	// New functions
 	LLColor4				getNetColor() const;
 protected:
 	virtual void onGlobalColorChanged(bool upload_bake) {}
 private:
-	LLVector3				mAvgDistortionVec;
+	LLVector4a				mAvgDistortionVec;
 };
 
 class LLTexLayerParamColorInfo : public LLViewerVisualParamInfo
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
old mode 100755
new mode 100644
diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp
index 319e2508e0578dff1339e447a9762771cee62881..9907da0f0e7396604beb71b2d3d7eb08608bf0d2 100644
--- a/indra/newview/lltoolgrab.cpp
+++ b/indra/newview/lltoolgrab.cpp
@@ -205,9 +205,9 @@ BOOL LLToolGrab::handleObjectHit(const LLPickInfo& info)
 
 	// Clicks on scripted or physical objects are temporary grabs, so
 	// not "Build mode"
-	mHideBuildHighlight = script_touch || objectp->usePhysics();
+	mHideBuildHighlight = script_touch || objectp->flagUsePhysics();
 
-	if (!objectp->usePhysics())
+	if (!objectp->flagUsePhysics())
 	{
 		if (script_touch)
 		{
@@ -222,18 +222,24 @@ BOOL LLToolGrab::handleObjectHit(const LLPickInfo& info)
 			if (gAgentCamera.cameraMouselook())
 			{
 				mMode = GRAB_LOCKED;
+				gViewerWindow->hideCursor();
+				gViewerWindow->moveCursorToCenter();
 			}
-			else
+			else if (objectp->permMove() && !objectp->isPermanentEnforced())
 			{
 				mMode = GRAB_ACTIVE_CENTER;
+				gViewerWindow->hideCursor();
+				gViewerWindow->moveCursorToCenter();
+			}
+			else
+			{
+				mMode = GRAB_LOCKED;
 			}
 
-			gViewerWindow->hideCursor();
-			gViewerWindow->moveCursorToCenter();
 			
 		}
 	}
-	else if( !objectp->permMove() )
+	else if( objectp->flagCharacter() || !objectp->permMove() || objectp->isPermanentEnforced())
 	{
 		// if mouse is over a physical object without move permission, show feedback if user tries to move it.
 		mMode = GRAB_LOCKED;
diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp
index ac01316462caa8b43c8e646f116cc3fcd9cb26d9..a135ba70f510a8af2e13822e23d4107239be3669 100644
--- a/indra/newview/lltoolmgr.cpp
+++ b/indra/newview/lltoolmgr.cpp
@@ -91,6 +91,8 @@ LLToolMgr::LLToolMgr()
 //	gLandToolset		= new LLToolset();
 	gMouselookToolset	= new LLToolset();
 	gFaceEditToolset	= new LLToolset();
+	gMouselookToolset->setShowFloaterTools(false);
+	gFaceEditToolset->setShowFloaterTools(false);
 }
 
 void LLToolMgr::initTools()
diff --git a/indra/newview/lltoolmgr.h b/indra/newview/lltoolmgr.h
index 12649cfba2d92e33482a98c54b6cb0620fc44b78..e7d1c56c8315d52ab90fbb682cac7112c869e0ec 100644
--- a/indra/newview/lltoolmgr.h
+++ b/indra/newview/lltoolmgr.h
@@ -89,7 +89,7 @@ class LLToolMgr : public LLSingleton<LLToolMgr>
 class LLToolset
 {
 public:
-	LLToolset() : mSelectedTool(NULL) {}
+	LLToolset() : mSelectedTool(NULL), mIsShowFloaterTools(true) {}
 
 	LLTool*			getSelectedTool()				{ return mSelectedTool; }
 
@@ -105,10 +105,14 @@ class LLToolset
 
 	BOOL			isToolSelected( S32 index );
 
+	void            setShowFloaterTools(bool pShowFloaterTools) {mIsShowFloaterTools = pShowFloaterTools;};
+	bool            isShowFloaterTools() const                  {return mIsShowFloaterTools;};
+
 protected:
 	LLTool*			mSelectedTool;
 	typedef std::vector<LLTool*> tool_list_t;
 	tool_list_t 	mToolList;
+	bool            mIsShowFloaterTools;
 };
 
 // Globals
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index b0d9bd5d707138e55b7d6f323447e6e049350408..3cd761b73b52cbf0b932e8480d8cf79784645f9c 100644
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -312,7 +312,7 @@ BOOL LLToolPie::handleLeftClickPick()
 	// Switch to grab tool if physical or triggerable
 	if (object && 
 		!object->isAvatar() && 
-		((object->usePhysics() || (parent && !parent->isAvatar() && parent->usePhysics())) || touchable) 
+		((object->flagUsePhysics() || (parent && !parent->isAvatar() && parent->flagUsePhysics())) || touchable) 
 		)
 	{
 		gGrabTransientTool = this;
@@ -596,8 +596,8 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
 			lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl;
 		}
 		
-		else if ((object && !object->isAvatar() && object->usePhysics()) 
-				 || (parent && !parent->isAvatar() && parent->usePhysics()))
+		else if ((object && !object->isAvatar() && object->flagUsePhysics()) 
+				 || (parent && !parent->isAvatar() && parent->flagUsePhysics()))
 		{
 			show_highlight = true;
 			gViewerWindow->setCursor(UI_CURSOR_TOOLGRAB);
diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp
index 4240a38326369a61f1cbd17ab6c8583f837f92fe..00b15a5f26e0f4c7f2e0a8cf5857b5b30602a21f 100644
--- a/indra/newview/llurldispatcher.cpp
+++ b/indra/newview/llurldispatcher.cpp
@@ -205,18 +205,18 @@ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const LLSLURL&
 {
 
   // we can't teleport cross grid at this point
-	if((!LLGridManager::getInstance()->isSystemGrid(slurl.getGrid()) || !LLGridManager::getInstance()->isSystemGrid()) &&
-	   (slurl.getGrid() != LLGridManager::getInstance()->getGrid()))
+	if(   LLGridManager::getInstance()->getGrid(slurl.getGrid())
+	   != LLGridManager::getInstance()->getGrid())
 	{
 		LLSD args;
 		args["SLURL"] = slurl.getLocationString();
 		args["CURRENT_GRID"] = LLGridManager::getInstance()->getGridLabel();
-		LLSD grid_info;
-		LLGridManager::getInstance()->getGridInfo(slurl.getGrid(), grid_info);
+		std::string grid_label = 
+			LLGridManager::getInstance()->getGridLabel(slurl.getGrid());
 		
-		if(grid_info.has(GRID_LABEL_VALUE))
+		if(!grid_label.empty())
 		{
-			args["GRID"] = grid_info[GRID_LABEL_VALUE].asString();
+			args["GRID"] = grid_label;
 		}
 		else 
 		{
diff --git a/indra/newview/llviewercamera.h b/indra/newview/llviewercamera.h
index 184033de424bc6b1ea9d21536ba816971dc4985d..b857c7fe89fb108c0c2abf7730b8739531022602 100644
--- a/indra/newview/llviewercamera.h
+++ b/indra/newview/llviewercamera.h
@@ -51,9 +51,19 @@ const BOOL NOT_FOR_SELECTION = FALSE;
 extern template class LLViewerCamera* LLSingleton<class LLViewerCamera>::getInstance();
 #endif
 
+LL_ALIGN_PREFIX(16)
 class LLViewerCamera : public LLCamera, public LLSingleton<LLViewerCamera>
 {
 public:
+	void* operator new(size_t size)
+	{
+		return ll_aligned_malloc_16(size);
+	}
+
+	void operator delete(void* ptr)
+	{
+		ll_aligned_free_16(ptr);
+	}
 
 	typedef enum
 	{
@@ -137,6 +147,7 @@ class LLViewerCamera : public LLCamera, public LLSingleton<LLViewerCamera>
 	S16					mZoomSubregion;
 
 public:
-};
+} LL_ALIGN_POSTFIX(16);
+
 
 #endif // LL_LLVIEWERCAMERA_H
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 4571d08050f0e2a5ba582a2510c16987c0abe09a..d58ee05fb6bb25d1bb9d938df9a33d40c79c1d17 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -79,6 +79,7 @@
 #include "llpostprocess.h"
 
 extern LLPointer<LLViewerTexture> gStartTexture;
+extern bool gShiftFrame;
 
 LLPointer<LLViewerTexture> gDisconnectedImagep = NULL;
 
@@ -162,8 +163,11 @@ void display_startup()
 	glClear(GL_DEPTH_BUFFER_BIT);
 }
 
+static LLFastTimer::DeclareTimer FTM_UPDATE_CAMERA("Update Camera");
+
 void display_update_camera()
 {
+	LLFastTimer t(FTM_UPDATE_CAMERA);
 	LLMemType mt_uc(LLMemType::MTYPE_DISPLAY_UPDATE_CAMERA);
 	// TODO: cut draw distance down if customizing avatar?
 	// TODO: cut draw distance on per-parcel basis?
@@ -217,6 +221,11 @@ static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_CLASS("Class");
 static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_BUMP("Bump");
 static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_LIST("List");
 static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_DELETE("Delete");
+static LLFastTimer::DeclareTimer FTM_RESIZE_WINDOW("Resize Window");
+static LLFastTimer::DeclareTimer FTM_HUD_UPDATE("HUD Update");
+static LLFastTimer::DeclareTimer FTM_DISPLAY_UPDATE_GEOM("Update Geom");
+static LLFastTimer::DeclareTimer FTM_TEXTURE_UNBIND("Texture Unbind");
+static LLFastTimer::DeclareTimer FTM_TELEPORT_DISPLAY("Teleport Display");
 
 // Paint the display!
 void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
@@ -226,6 +235,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 
 	if (gWindowResized)
 	{ //skip render on frames where window has been resized
+		LLFastTimer t(FTM_RESIZE_WINDOW);
 		gGL.flush();
 		glClear(GL_COLOR_BUFFER_BIT);
 		gViewerWindow->getWindow()->swapBuffers();
@@ -362,6 +372,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 
 	if (gTeleportDisplay)
 	{
+		LLFastTimer t(FTM_TELEPORT_DISPLAY);
 		LLAppViewer::instance()->pingMainloopTimeout("Display:Teleport");
 		const F32 TELEPORT_ARRIVAL_DELAY = 2.f; // Time to preload the world before raising the curtain after we've actually already arrived.
 
@@ -425,6 +436,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 				LLAgent::sTeleportProgressMessages["arriving"]);
 			gTextureList.mForceResetTextureStats = TRUE;
 			gAgentCamera.resetView(TRUE, TRUE);
+			
 			break;
 
 		case LLAgent::TELEPORT_ARRIVING:
@@ -590,6 +602,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 				
 		// *TODO: merge these two methods
 		{
+			LLFastTimer t(FTM_HUD_UPDATE);
 			LLMemType mt_uh(LLMemType::MTYPE_DISPLAY_UPDATE_HUD);
 			LLHUDManager::getInstance()->updateEffects();
 			LLHUDObject::updateAll();
@@ -597,6 +610,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 		}
 
 		{
+			LLFastTimer t(FTM_DISPLAY_UPDATE_GEOM);
 			LLMemType mt_ug(LLMemType::MTYPE_DISPLAY_UPDATE_GEOM);
 			const F32 max_geom_update_time = 0.005f*10.f*gFrameIntervalSeconds; // 50 ms/second update time
 			gPipeline.createObjects(max_geom_update_time);
@@ -606,6 +620,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 		}
 
 		gPipeline.updateGL();
+		
 		stop_glerror();
 
 		S32 water_clip = 0;
@@ -765,7 +780,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 				LLImageGL::deleteDeadTextures();
 				stop_glerror();
 			}*/
-		}
+			}
 
 		LLGLState::checkStates();
 		LLGLState::checkClientArrays();
@@ -937,14 +952,18 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 			stop_glerror();
 		}
 
-		for (U32 i = 0; i < gGLManager.mNumTextureImageUnits; i++)
-		{ //dummy cleanup of any currently bound textures
-			if (gGL.getTexUnit(i)->getCurrType() != LLTexUnit::TT_NONE)
-			{
-				gGL.getTexUnit(i)->unbind(gGL.getTexUnit(i)->getCurrType());
-				gGL.getTexUnit(i)->disable();
+		{
+			LLFastTimer t(FTM_TEXTURE_UNBIND);
+			for (U32 i = 0; i < gGLManager.mNumTextureImageUnits; i++)
+			{ //dummy cleanup of any currently bound textures
+				if (gGL.getTexUnit(i)->getCurrType() != LLTexUnit::TT_NONE)
+				{
+					gGL.getTexUnit(i)->unbind(gGL.getTexUnit(i)->getCurrType());
+					gGL.getTexUnit(i)->disable();
+				}
 			}
 		}
+
 		LLAppViewer::instance()->pingMainloopTimeout("Display:RenderFlush");		
 		
 		if (to_texture)
@@ -1010,6 +1029,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 	display_stats();
 				
 	LLAppViewer::instance()->pingMainloopTimeout("Display:Done");
+
+	gShiftFrame = false;
 }
 
 void render_hud_attachments()
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index 96303151f4eb9aca72aab75550ac82fbd2b1817f..1f7cf0cdd449b9e6d76362e472d93866039dd7c8 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -83,6 +83,9 @@
 #include "llfloaterobjectweights.h"
 #include "llfloateropenobject.h"
 #include "llfloateroutbox.h"
+#include "llfloaterpathfindingcharacters.h"
+#include "llfloaterpathfindinglinksets.h"
+#include "llfloaterpathfindingconsole.h"
 #include "llfloaterpay.h"
 #include "llfloaterperms.h"
 #include "llfloaterpostprocess.h"
@@ -249,6 +252,9 @@ void LLViewerFloaterReg::registerFloaters()
 	LLFloaterReg::add("outgoing_call", "floater_outgoing_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLOutgoingCallDialog>);
 	LLFloaterPayUtil::registerFloater();
 
+	LLFloaterReg::add("pathfinding_characters", "floater_pathfinding_characters.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPathfindingCharacters>);
+	LLFloaterReg::add("pathfinding_linksets", "floater_pathfinding_linksets.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPathfindingLinksets>);
+	LLFloaterReg::add("pathfinding_console", "floater_pathfinding_console.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPathfindingConsole>);
 	LLFloaterReg::add("people", "floater_people.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSidePanelContainer>);
 	LLFloaterReg::add("places", "floater_places.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSidePanelContainer>);
 	LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreference>);
diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp
index f029ae5302f040785f4390eb5a8c723b6e4f90f9..5d1aa870a3165ee455c8d2dc4e90825cec78658a 100755
--- a/indra/newview/llviewerjointmesh.cpp
+++ b/indra/newview/llviewerjointmesh.cpp
@@ -729,8 +729,10 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_w
 				F32* vw = (F32*) vertex_weightsp.get();
 				F32* cw = (F32*) clothing_weightsp.get();	
 
-				LLVector4a::memcpyNonAliased16(tc, (F32*) mMesh->getTexCoords(), num_verts*2*sizeof(F32));
-				LLVector4a::memcpyNonAliased16(vw, (F32*) mMesh->getWeights(), num_verts*sizeof(F32));	
+				S32 tc_size = (num_verts*2*sizeof(F32)+0xF) & ~0xF;
+				LLVector4a::memcpyNonAliased16(tc, (F32*) mMesh->getTexCoords(), tc_size);
+				S32 vw_size = (num_verts*sizeof(F32)+0xF) & ~0xF;	
+				LLVector4a::memcpyNonAliased16(vw, (F32*) mMesh->getWeights(), vw_size);	
 				LLVector4a::memcpyNonAliased16(cw, (F32*) mMesh->getClothingWeights(), num_verts*4*sizeof(F32));	
 			}
 
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 97ddfb48d2df34d46480d3dbcc6ced74fbe82bf3..01a54509ef06cf32265091fd08df6a4cfa8a4401 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -60,6 +60,8 @@
 #include "llfloatergodtools.h"
 #include "llfloaterinventory.h"
 #include "llfloaterland.h"
+#include "llfloaterpathfindingcharacters.h"
+#include "llfloaterpathfindinglinksets.h"
 #include "llfloaterpay.h"
 #include "llfloaterreporter.h"
 #include "llfloatersearch.h"
@@ -117,6 +119,7 @@
 #include "lleconomy.h"
 #include "lltoolgrab.h"
 #include "llwindow.h"
+#include "llpathfindingmanager.h"
 #include "boost/unordered_map.hpp"
 
 using namespace LLVOAvatarDefines;
@@ -204,7 +207,6 @@ void near_sit_object();
 BOOL is_selection_buy_not_take();
 S32 selection_price();
 BOOL enable_take();
-void handle_take();
 void handle_object_show_inspector();
 void handle_avatar_show_inspector();
 bool confirm_take(const LLSD& notification, const LLSD& response, LLObjectSelectionHandle selection_handle);
@@ -2782,6 +2784,16 @@ bool enable_object_build()
 	return !enable_object_edit();
 }
 
+bool enable_object_select_in_pathfinding_linksets()
+{
+	return LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion() && LLSelectMgr::getInstance()->selectGetEditableLinksets();
+}
+
+bool enable_object_select_in_pathfinding_characters()
+{
+	return LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion() &&  LLSelectMgr::getInstance()->selectGetViewableCharacters();
+}
+
 class LLSelfRemoveAllAttachments : public view_listener_t
 {
 	bool handleEvent(const LLSD& userdata)
@@ -3303,7 +3315,7 @@ void append_aggregate(std::string& string, const LLAggregatePermissions& ag_perm
 bool enable_buy_object()
 {
     // In order to buy, there must only be 1 purchaseable object in
-    // the selection manger.
+    // the selection manager.
 	if(LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() != 1) return false;
     LLViewerObject* obj = NULL;
     LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode();
@@ -4181,8 +4193,9 @@ static bool get_derezzable_objects(
 		{
 		case DRD_TAKE_INTO_AGENT_INVENTORY:
 		case DRD_TRASH:
-			if( (node->mPermissions->allowTransferTo(gAgent.getID()) && object->permModify())
-				|| (node->allowOperationOnNode(PERM_OWNER, GP_OBJECT_MANIPULATE)) )
+			if (!object->isPermanentEnforced() &&
+				((node->mPermissions->allowTransferTo(gAgent.getID()) && object->permModify())
+				|| (node->allowOperationOnNode(PERM_OWNER, GP_OBJECT_MANIPULATE))))
 			{
 				can_derez_current = TRUE;
 			}
@@ -4592,9 +4605,10 @@ BOOL enable_take()
 			return TRUE;
 		}
 # endif
-		if((node->mPermissions->allowTransferTo(gAgent.getID())
+		if(!object->isPermanentEnforced() &&
+			((node->mPermissions->allowTransferTo(gAgent.getID())
 			&& object->permModify())
-		   || (node->mPermissions->getOwner() == gAgent.getID()))
+			|| (node->mPermissions->getOwner() == gAgent.getID())))
 		{
 			return TRUE;
 		}
@@ -4846,6 +4860,22 @@ class LLToolsSaveToObjectInventory : public view_listener_t
 	}
 };
 
+class LLToolsEnablePathfinding : public view_listener_t
+{
+	bool handleEvent(const LLSD& userdata)
+	{
+		return (LLPathfindingManager::getInstance() != NULL) && LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion();
+	}
+};
+
+class LLToolsEnablePathfindingView : public view_listener_t
+{
+	bool handleEvent(const LLSD& userdata)
+	{
+		return (LLPathfindingManager::getInstance() != NULL) && LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion() && LLPathfindingManager::getInstance()->isPathfindingViewEnabled();
+	}
+};
+
 // Round the position of all root objects to the grid
 class LLToolsSnapObjectXY : public view_listener_t
 {
@@ -5104,6 +5134,12 @@ class LLEditDelete : public view_listener_t
 	}
 };
 
+bool enable_object_return()
+{
+	return (!LLSelectMgr::getInstance()->getSelection()->isEmpty() &&
+		(gAgent.isGodlike() || can_derez(DRD_RETURN_TO_OWNER)));
+}
+
 void handle_spellcheck_replace_with_suggestion(const LLUICtrl* ctrl, const LLSD& param)
 {
 	const LLContextMenu* menu = dynamic_cast<const LLContextMenu*>(ctrl->getParent());
@@ -5191,6 +5227,49 @@ bool enable_object_delete()
 	return new_value;
 }
 
+class LLObjectsReturnPackage
+{
+public:
+	LLObjectsReturnPackage() : mObjectSelection(), mReturnableObjects(), mError(),	mFirstRegion(NULL) {};
+	~LLObjectsReturnPackage()
+	{
+		mObjectSelection.clear();
+		mReturnableObjects.clear();
+		mError.clear();
+		mFirstRegion = NULL;
+	};
+
+	LLObjectSelectionHandle mObjectSelection;
+	LLDynamicArray<LLViewerObjectPtr> mReturnableObjects;
+	std::string mError;
+	LLViewerRegion *mFirstRegion;
+};
+
+static void return_objects(LLObjectsReturnPackage *objectsReturnPackage, const LLSD& notification, const LLSD& response)
+{
+	if (LLNotificationsUtil::getSelectedOption(notification, response) == 0)
+	{
+		// Ignore category ID for this derez destination.
+		derez_objects(DRD_RETURN_TO_OWNER, LLUUID::null, objectsReturnPackage->mFirstRegion, objectsReturnPackage->mError, &objectsReturnPackage->mReturnableObjects);
+	}
+
+	delete objectsReturnPackage;
+}
+
+void handle_object_return()
+{
+	if (!LLSelectMgr::getInstance()->getSelection()->isEmpty())
+	{
+		LLObjectsReturnPackage *objectsReturnPackage = new LLObjectsReturnPackage();
+		objectsReturnPackage->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();
+
+		// Save selected objects, so that we still know what to return after the confirmation dialog resets selection.
+		get_derezzable_objects(DRD_RETURN_TO_OWNER, objectsReturnPackage->mError, objectsReturnPackage->mFirstRegion, &objectsReturnPackage->mReturnableObjects);
+
+		LLNotificationsUtil::add("ReturnToOwner", LLSD(), LLSD(), boost::bind(&return_objects, objectsReturnPackage, _1, _2));
+	}
+}
+
 void handle_object_delete()
 {
 
@@ -6552,6 +6631,7 @@ BOOL object_selected_and_point_valid()
 		(selection->getFirstRootObject()->getPCode() == LL_PCODE_VOLUME) && 
 		selection->getFirstRootObject()->permYouOwner() &&
 		selection->getFirstRootObject()->flagObjectMove() &&
+		!selection->getFirstRootObject()->flagObjectPermanent() &&
 		!((LLViewerObject*)selection->getFirstRootObject()->getRoot())->isAvatar() && 
 		(selection->getFirstRootObject()->getNVPair("AssetContainer") == NULL);
 }
@@ -7059,8 +7139,8 @@ BOOL enable_save_into_inventory(void*)
 			return TRUE;
 		}
 	}
-#endif
 	return FALSE;
+#endif
 }
 
 class LLToolsEnableSaveToInventory : public view_listener_t
@@ -8218,7 +8298,7 @@ void initialize_menus()
 
 	// Me > Movement
 	view_listener_t::addMenu(new LLAdvancedAgentFlyingInfo(), "Agent.getFlying");
-
+	
 	// Communicate
 	view_listener_t::addMenu(new LLCommunicateBlockList(), "Communicate.BlockList");
 	
@@ -8277,6 +8357,9 @@ void initialize_menus()
 	view_listener_t::addMenu(new LLToolsEnableSaveToInventory(), "Tools.EnableSaveToInventory");
 	view_listener_t::addMenu(new LLToolsEnableSaveToObjectInventory(), "Tools.EnableSaveToObjectInventory");
 
+	view_listener_t::addMenu(new LLToolsEnablePathfinding(), "Tools.EnablePathfinding");
+	view_listener_t::addMenu(new LLToolsEnablePathfindingView(), "Tools.EnablePathfindingView");
+
 	// Help menu
 	// most items use the ShowFloater method
 	view_listener_t::addMenu(new LLToggleHowTo(), "Help.ToggleHowTo");
@@ -8566,6 +8649,10 @@ void initialize_menus()
 	enable.add("EnablePayAvatar", boost::bind(&enable_pay_avatar));
 	enable.add("EnableEdit", boost::bind(&enable_object_edit));
 	enable.add("VisibleBuild", boost::bind(&enable_object_build));
+	commit.add("Pathfinding.Linksets.Select", boost::bind(&LLFloaterPathfindingLinksets::openLinksetsWithSelectedObjects));
+	enable.add("EnableSelectInPathfindingLinksets", boost::bind(&enable_object_select_in_pathfinding_linksets));
+	commit.add("Pathfinding.Characters.Select", boost::bind(&LLFloaterPathfindingCharacters::openCharactersWithSelectedObjects));
+	enable.add("EnableSelectInPathfindingCharacters", boost::bind(&enable_object_select_in_pathfinding_characters));
 
 	view_listener_t::addMenu(new LLFloaterVisible(), "FloaterVisible");
 	view_listener_t::addMenu(new LLShowSidetrayPanel(), "ShowSidetrayPanel");
diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h
index 8c40762865ea1b781198f41652112b0609a060a4..3515aa4302cfe614340fae22d1134ba8781f6935 100644
--- a/indra/newview/llviewermenu.h
+++ b/indra/newview/llviewermenu.h
@@ -94,11 +94,20 @@ void handle_object_touch();
 bool enable_object_open();
 void handle_object_open();
 
+bool visible_take_object();
+bool tools_visible_take_object();
+bool enable_object_take_copy();
+bool enable_object_return();
+bool enable_object_delete();
+
 // Buy either contents or object itself
 void handle_buy();
+void handle_take();
 void handle_take_copy();
 void handle_look_at_selection(const LLSD& param);
 void handle_zoom_to_object(LLUUID object_id);
+void handle_object_return();
+void handle_object_delete();
 
 void handle_buy_land();
 
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 0baf119d7021e52a0600328e775742110fc88991..903f4437a7ea11bcf1d53529fcf8ef39f78beb34 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -134,6 +134,7 @@ static const U32 LLREQUEST_PERMISSION_THROTTLE_LIMIT	= 5;     // requests
 static const F32 LLREQUEST_PERMISSION_THROTTLE_INTERVAL	= 10.0f; // seconds
 
 extern BOOL gDebugClicks;
+extern bool gShiftFrame;
 
 // function prototypes
 bool check_offer_throttle(const std::string& from_name, bool check_only);
@@ -3930,6 +3931,7 @@ void process_avatar_init_complete(LLMessageSystem* msg, void**)
 
 void process_agent_movement_complete(LLMessageSystem* msg, void**)
 {
+	gShiftFrame = true;
 	gAgentMovementCompleted = true;
 
 	LLUUID agent_id;
@@ -4853,6 +4855,18 @@ void process_sim_stats(LLMessageSystem *msg, void **user_data)
 		case LL_SIM_STAT_IOPUMPTIME:
 			LLViewerStats::getInstance()->mSimPumpIOMsec.addValue(stat_value);
 			break;
+		case LL_SIM_STAT_PCTSCRIPTSRUN:
+			LLViewerStats::getInstance()->mSimPctScriptsRun.addValue(stat_value);
+			break;
+		case LL_SIM_STAT_SIMAISTEPTIMEMS:
+			LLViewerStats::getInstance()->mSimSimAIStepMsec.addValue(stat_value);
+			break;
+		case LL_SIM_STAT_SKIPPEDAISILSTEPS_PS:
+			LLViewerStats::getInstance()->mSimSimSkippedSilhouetteSteps.addValue(stat_value);
+			break;
+		case LL_SIM_STAT_PCTSTEPPEDCHARACTERS:
+			LLViewerStats::getInstance()->mSimSimPctSteppedCharacters.addValue(stat_value);
+			break;
 		default:
 			// Used to be a commented out warning.
  			LL_DEBUGS("Messaging") << "Unknown stat id" << stat_id << LL_ENDL;
@@ -4962,7 +4976,7 @@ void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data)
 				LLViewerObject* object = gObjectList.findObject(object_id);
 				if (object)
 				{
-					object->mFlags |= FLAGS_ANIM_SOURCE;
+					object->setFlagsWithoutUpdate(FLAGS_ANIM_SOURCE, TRUE);
 
 					BOOL anim_found = FALSE;
 					LLVOAvatar::AnimSourceIterator anim_it = avatarp->mAnimationSources.find(object_id);
@@ -5109,7 +5123,7 @@ void process_set_follow_cam_properties(LLMessageSystem *mesgsys, void **user_dat
 	LLViewerObject* objectp = gObjectList.findObject(source_id);
 	if (objectp)
 	{
-		objectp->mFlags |= FLAGS_CAMERA_SOURCE;
+		objectp->setFlagsWithoutUpdate(FLAGS_CAMERA_SOURCE, TRUE);
 	}
 
 	S32 num_objects = mesgsys->getNumberOfBlocks("CameraProperty");
diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp
index ef5c65eb87ea2df5ab63748317b605e8b78231ef..97f4c3e5feb1e627f69494ed0852d15f8e81a8cf 100644
--- a/indra/newview/llviewernetwork.cpp
+++ b/indra/newview/llviewernetwork.cpp
@@ -1,4 +1,4 @@
-/** 
+/**
  * @file llviewernetwork.cpp
  * @author James Cook, Richard Nelson
  * @brief Networking constants and globals for viewer.
@@ -6,21 +6,21 @@
  * $LicenseInfo:firstyear=2006&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$
  */
@@ -34,13 +34,39 @@
 #include "lltrans.h"
 #include "llweb.h"
 
-                                                            
-const char* DEFAULT_LOGIN_PAGE = "http://viewer-login.agni.lindenlab.com/";
 
-const char* SYSTEM_GRID_SLURL_BASE = "secondlife://%s/secondlife/";
-const char* MAIN_GRID_SLURL_BASE = "http://maps.secondlife.com/secondlife/";
-const char* SYSTEM_GRID_APP_SLURL_BASE = "secondlife:///app";
+/// key used to store the grid, and the name attribute in the grid data
+const std::string  GRID_VALUE = "keyname";
+/// the value displayed in the grid selector menu, and other human-oriented text
+const std::string  GRID_LABEL_VALUE = "label";
+/// the value used on the --grid command line argument
+const std::string  GRID_ID_VALUE = "grid_login_id";
+/// the url for the login cgi script
+const std::string  GRID_LOGIN_URI_VALUE = "login_uri";
+///
+const std::string  GRID_HELPER_URI_VALUE = "helper_uri";
+/// the splash page url
+const std::string  GRID_LOGIN_PAGE_VALUE = "login_page";
+/// internal data on system grids
+const std::string  GRID_IS_SYSTEM_GRID_VALUE = "system_grid";
+/// whether this is single or double names
+const std::string  GRID_LOGIN_IDENTIFIER_TYPES = "login_identifier_types";
+
+// defines slurl formats associated with various grids.
+// we need to continue to support existing forms, as slurls
+// are shared between viewers that may not understand newer
+// forms.
+const std::string GRID_SLURL_BASE = "slurl_base";
+const std::string GRID_APP_SLURL_BASE = "app_slurl_base";
+
+const std::string DEFAULT_LOGIN_PAGE = "http://viewer-login.agni.lindenlab.com/";
+
+const std::string MAIN_GRID_LOGIN_URI = "https://login.agni.lindenlab.com/cgi-bin/login.cgi";
+
+const std::string MAIN_GRID_SLURL_BASE = "http://maps.secondlife.com/secondlife/";
+const std::string SYSTEM_GRID_APP_SLURL_BASE = "secondlife:///app";
 
+const char* SYSTEM_GRID_SLURL_BASE = "secondlife://%s/secondlife/";
 const char* DEFAULT_SLURL_BASE = "https://%s/region/";
 const char* DEFAULT_APP_SLURL_BASE = "x-grid-location-info://%s/app";
 
@@ -54,14 +80,17 @@ LLGridManager::LLGridManager()
 	// an attacker.  Don't want someone snagging a password.
 	std::string grid_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,
 														   "grids.xml");
+	LL_DEBUGS("GridManager")<<LL_ENDL;
+
 	initialize(grid_file);
-	
+
 }
 
 
 LLGridManager::LLGridManager(const std::string& grid_file)
 {
 	// initialize with an explicity grid file for testing.
+	LL_DEBUGS("GridManager")<<LL_ENDL;
 	initialize(grid_file);
 }
 
@@ -74,183 +103,83 @@ LLGridManager::LLGridManager(const std::string& grid_file)
 //
 // LLGridManager::initialze - initialize the list of known grids based
 // on the fixed list of linden grids (fixed for security reasons)
-// the grids.xml file
-// and the command line.
+// and the grids.xml file
 void LLGridManager::initialize(const std::string& grid_file)
 {
 	// default grid list.
 	// Don't move to a modifiable file for security reasons,
 	mGrid.clear() ;
+
 	// set to undefined
 	mGridList = LLSD();
 	mGridFile = grid_file;
 	// as we don't want an attacker to override our grid list
 	// to point the default grid to an invalid grid
-	addSystemGrid("None", "", "", "", DEFAULT_LOGIN_PAGE);
-	
-
-
-  	addSystemGrid("Agni",                                                                                             
-				  MAINGRID,                                               
-				  "https://login.agni.lindenlab.com/cgi-bin/login.cgi",                    
-				  "https://secondlife.com/helpers/",     
-				  DEFAULT_LOGIN_PAGE);
-	addSystemGrid("Aditi",                                                                                             
-				  "util.aditi.lindenlab.com",                                              
-				  "https://login.aditi.lindenlab.com/cgi-bin/login.cgi",                   
+  	addSystemGrid("Second Life Main Grid (Agni)",
+				  MAINGRID,
+				  MAIN_GRID_LOGIN_URI,
+				  "https://secondlife.com/helpers/",
+				  DEFAULT_LOGIN_PAGE,
+				  "Agni");
+	addSystemGrid("Second Life Beta Test Grid (Aditi)",
+				  "util.aditi.lindenlab.com",
+				  "https://login.aditi.lindenlab.com/cgi-bin/login.cgi",
 				  "http://aditi-secondlife.webdev.lindenlab.com/helpers/",
-				  DEFAULT_LOGIN_PAGE);
-	addSystemGrid("Aruna",                                                                                            
-				  "util.aruna.lindenlab.com",                                              
-				  "https://login.aruna.lindenlab.com/cgi-bin/login.cgi",                   
-				  "http://aruna-secondlife.webdev.lindenlab.com/helpers/",
-				  DEFAULT_LOGIN_PAGE);
-	addSystemGrid("Bharati",                                                                                            
-				  "util.bharati.lindenlab.com",                                              
-				  "https://login.bharati.lindenlab.com/cgi-bin/login.cgi",                   
-				  "http://bharati-secondlife.webdev.lindenlab.com/helpers/",
-				  DEFAULT_LOGIN_PAGE);
-	addSystemGrid("Chandra",                                                                                            
-				  "util.chandra.lindenlab.com",                                              
-				  "https://login.chandra.lindenlab.com/cgi-bin/login.cgi",                   
-				  "http://chandra-secondlife.webdev.lindenlab.com/helpers/",
-				  DEFAULT_LOGIN_PAGE);
-	addSystemGrid("Damballah",                                                                                            
-				  "util.damballah.lindenlab.com",                                              
-				  "https://login.damballah.lindenlab.com/cgi-bin/login.cgi",                   
-				  "http://damballah-secondlife.webdev.lindenlab.com/helpers/",
-				  DEFAULT_LOGIN_PAGE);
-	addSystemGrid("Danu",                                                                                            
-				  "util.danu.lindenlab.com",                                              
-				  "https://login.danu.lindenlab.com/cgi-bin/login.cgi",                   
-				  "http://danu-secondlife.webdev.lindenlab.com/helpers/",
-				  DEFAULT_LOGIN_PAGE);
-	addSystemGrid("Durga",                                                                                            
-				  "util.durga.lindenlab.com",                                              
-				  "https://login.durga.lindenlab.com/cgi-bin/login.cgi",                   
-				  "http://durga-secondlife.webdev.lindenlab.com/helpers/",
-				  DEFAULT_LOGIN_PAGE);
-	addSystemGrid("Ganga",                                                                                            
-				  "util.ganga.lindenlab.com",                                              
-				  "https://login.ganga.lindenlab.com/cgi-bin/login.cgi",                   
-				  "http://ganga-secondlife.webdev.lindenlab.com/helpers/",
-				  DEFAULT_LOGIN_PAGE);
-	addSystemGrid("Mitra",                                                                                            
-				  "util.mitra.lindenlab.com",                                              
-				  "https://login.mitra.lindenlab.com/cgi-bin/login.cgi",                   
-				  "http://mitra-secondlife.webdev.lindenlab.com/helpers/",
-				  DEFAULT_LOGIN_PAGE);
-	addSystemGrid("Mohini",                                                                                           
-				  "util.mohini.lindenlab.com",                                             
-				  "https://login.mohini.lindenlab.com/cgi-bin/login.cgi",                  
-				  "http://mohini-secondlife.webdev.lindenlab.com/helpers/",
-				  DEFAULT_LOGIN_PAGE);
-	addSystemGrid("Nandi",                                                                                            
-				  "util.nandi.lindenlab.com",                                              
-				  "https://login.nandi.lindenlab.com/cgi-bin/login.cgi",                   
-				  "http://nandi-secondlife.webdev.lindenlab.com/helpers/",
-				  DEFAULT_LOGIN_PAGE);
-	addSystemGrid("Parvati",                                                                                            
-				  "util.parvati.lindenlab.com",                                              
-				  "https://login.parvati.lindenlab.com/cgi-bin/login.cgi",                   
-				  "http://parvati-secondlife.webdev.lindenlab.com/helpers/",
-				  DEFAULT_LOGIN_PAGE);
-	addSystemGrid("Radha",                                                                                            
-				  "util.radha.lindenlab.com",                                              
-				  "https://login.radha.lindenlab.com/cgi-bin/login.cgi",                   
-				  "http://radha-secondlife.webdev.lindenlab.com/helpers/",
-				  DEFAULT_LOGIN_PAGE);
-	addSystemGrid("Ravi",                                                                                             
-				  "util.ravi.lindenlab.com",                                               
-				  "https://login.ravi.lindenlab.com/cgi-bin/login.cgi",                    
-				  "http://ravi-secondlife.webdev.lindenlab.com/helpers/",
-				  DEFAULT_LOGIN_PAGE);
-	addSystemGrid("Siva",                                                                                             
-				  "util.siva.lindenlab.com",                                               
-				  "https://login.siva.lindenlab.com/cgi-bin/login.cgi",                    
-				  "http://siva-secondlife.webdev.lindenlab.com/helpers/",
-				  DEFAULT_LOGIN_PAGE);
-	addSystemGrid("Shakti",                                                                                           
-				  "util.shakti.lindenlab.com",                                             
-				  "https://login.shakti.lindenlab.com/cgi-bin/login.cgi",                  
-				  "http://shakti-secondlife.webdev.lindenlab.com/helpers/",
-				  DEFAULT_LOGIN_PAGE);
-	addSystemGrid("Soma",                                                                                             
-				  "util.soma.lindenlab.com",                                               
-				  "https://login.soma.lindenlab.com/cgi-bin/login.cgi",                    
-				  "http://soma-secondlife.webdev.lindenlab.com/helpers/",
-				  DEFAULT_LOGIN_PAGE);
-	addSystemGrid("Uma",                                                                                              
-				  "util.uma.lindenlab.com",                                                
-				  "https://login.uma.lindenlab.com/cgi-bin/login.cgi",                     
-				  "http://uma-secondlife.webdev.lindenlab.com/helpers/",
-				  DEFAULT_LOGIN_PAGE);
-	addSystemGrid("Vaak",                                                                                             
-				  "util.vaak.lindenlab.com",                                               
-				  "https://login.vaak.lindenlab.com/cgi-bin/login.cgi",                    
-				  "http://vaak-secondlife.webdev.lindenlab.com/helpers/",
-				  DEFAULT_LOGIN_PAGE);
-	addSystemGrid("Yami",                                                                                             
-				  "util.yami.lindenlab.com",                                               
-				  "https://login.yami.lindenlab.com/cgi-bin/login.cgi",                    
-				  "http://yami-secondlife.webdev.lindenlab.com/helpers/",
-				  DEFAULT_LOGIN_PAGE);
-	addSystemGrid("Local (Linden)",                                                                                    
-				  "localhost",                                                             
-				  "https://login.dmz.lindenlab.com/cgi-bin/login.cgi",                     
-				  "",
-				  DEFAULT_LOGIN_PAGE); 
-
-	
+				  DEFAULT_LOGIN_PAGE,
+				  "Aditi");
+
 	LLSD other_grids;
 	llifstream llsd_xml;
 	if (!grid_file.empty())
 	{
+		LL_INFOS("GridManager")<<"Grid configuration file '"<<grid_file<<"'"<<LL_ENDL;
 		llsd_xml.open( grid_file.c_str(), std::ios::in | std::ios::binary );
 
 		// parse through the gridfile, inserting grids into the list unless
-		// they overwrite a linden grid.
-		if( llsd_xml.is_open()) 
+		// they overwrite an existing grid.
+		if( llsd_xml.is_open())
 		{
 			LLSDSerialize::fromXMLDocument( other_grids, llsd_xml );
 			if(other_grids.isMap())
 			{
-				for(LLSD::map_iterator grid_itr = other_grids.beginMap(); 
+				for(LLSD::map_iterator grid_itr = other_grids.beginMap();
 					grid_itr != other_grids.endMap();
 					++grid_itr)
 				{
 					LLSD::String key_name = grid_itr->first;
 					LLSD grid = grid_itr->second;
-					// TODO:  Make sure gridfile specified label is not 
-					// a system grid label
-					LL_DEBUGS("GridManager") << "reading: " << key_name << LL_ENDL;
-					if (mGridList.has(key_name) &&
-						mGridList[key_name].has(GRID_IS_SYSTEM_GRID_VALUE))
+
+					std::string existingGrid = getGrid(grid);
+					if (mGridList.has(key_name) || !existingGrid.empty())
 					{
-						LL_DEBUGS("GridManager") << "Cannot override grid " << key_name << " as it's a system grid" << LL_ENDL;
-						// If the system grid does exist in the grids file, and it's marked as a favorite, set it as a favorite.
-						if(grid_itr->second.has(GRID_IS_FAVORITE_VALUE) && grid_itr->second[GRID_IS_FAVORITE_VALUE].asBoolean() )
-						{
-							mGridList[key_name][GRID_IS_FAVORITE_VALUE] = TRUE;
-						}
+						LL_WARNS("GridManager") << "Cannot override existing grid '" << key_name << "'; ignoring definition from '"<<grid_file<<"'" << LL_ENDL;
+					}
+					else if ( addGrid(grid) )
+					{
+						LL_INFOS("GridManager") << "added grid '"<<key_name<<"'"<<LL_ENDL;
 					}
 					else
 					{
-						try
-						{
-							addGrid(grid);
-							LL_DEBUGS("GridManager") << "Added grid: " << key_name << LL_ENDL;
-						}
-						catch (...)
-						{
-						}
+						LL_WARNS("GridManager") << "failed to add invalid grid '"<<key_name<<"'"<<LL_ENDL;
 					}
 				}
 				llsd_xml.close();
-			}	
-		}     
+			}
+			else
+			{
+				LL_WARNS("GridManager")<<"Failed to parse grid configuration '"<<grid_file<<"'"<<LL_ENDL;
+			}
+		}
+		else
+		{
+			LL_WARNS("GridManager")<<"Failed to open grid configuration '"<<grid_file<<"'"<<LL_ENDL;
+		}
+	}
+	else
+	{
+		LL_DEBUGS("GridManager")<<"no grid file specified"<<LL_ENDL;
 	}
-	
+
 	// load a grid from the command line.
 	// if the actual grid name is specified from the command line,
 	// set it as the 'selected' grid.
@@ -259,50 +188,38 @@ void LLGridManager::initialize(const std::string& grid_file)
 	{
 		// try to find the grid assuming the command line parameter is
 		// the case-insensitive 'label' of the grid.  ie 'Agni'
-		mGrid = getGridByLabel(cmd_line_grid);
+		mGrid = getGrid(cmd_line_grid);
 		if(mGrid.empty())
 		{
-			// if we couldn't find it, assume the
-			// requested grid is the actual grid 'name' or index,
-			// which would be the dns name of the grid (for non
-			// linden hosted grids)
-			// If the grid isn't there, that's ok, as it will be
-			// automatically added later.
-			mGrid = cmd_line_grid;
+			LL_WARNS("GridManager")<<"Unknown grid '"<<cmd_line_grid<<"'"<<LL_ENDL;
+		}
+		else
+		{
+			LL_INFOS("GridManager")<<"Command line specified '"<<cmd_line_grid<<"': "<<mGrid<<LL_ENDL;
 		}
-		
 	}
 	else
 	{
 		// if a grid was not passed in via the command line, grab it from the CurrentGrid setting.
 		// if there's no current grid, that's ok as it'll be either set by the value passed
 		// in via the login uri if that's specified, or will default to maingrid
-		mGrid = gSavedSettings.getString("CurrentGrid");
+		std::string last_grid = gSavedSettings.getString("CurrentGrid");
+		if ( ! getGrid(last_grid).empty() )
+		{
+			LL_INFOS("GridManager")<<"Using last grid: "<<last_grid<<LL_ENDL;
+			mGrid = last_grid;
+		}
+		else
+		{
+			LL_INFOS("GridManager")<<"Last grid '"<<last_grid<<"' not configured"<<LL_ENDL;
+		}
 	}
-	
+
 	if(mGrid.empty())
 	{
 		// no grid was specified so default to maingrid
-		LL_DEBUGS("GridManager") << "Setting grid to MAINGRID as no grid has been specified " << LL_ENDL;
+		LL_INFOS("GridManager") << "Default grid to "<<MAINGRID<< LL_ENDL;
 		mGrid = MAINGRID;
-		
-	}
-	
-	// generate a 'grid list' entry for any command line parameter overrides
-	// or setting overides that we'll add to the grid list or override
-	// any grid list entries with.
-	LLSD grid = LLSD::emptyMap();	
-	
-	if(mGridList.has(mGrid))
-	{
-		grid = mGridList[mGrid];
-	}
-	else
-	{
-		grid[GRID_VALUE] = mGrid;
-		// add the grid with the additional values, or update the
-		// existing grid if it exists with the given values
-		addGrid(grid);		
 	}
 
 	LLControlVariablePtr grid_control = gSavedSettings.getControl("CurrentGrid");
@@ -314,115 +231,105 @@ void LLGridManager::initialize(const std::string& grid_file)
 	// since above only triggers on changes, trigger the callback manually to initialize state
 	updateIsInProductionGrid();
 
-	LL_DEBUGS("GridManager") << "Selected grid is " << mGrid << LL_ENDL;		
 	setGridChoice(mGrid);
-	if(mGridList[mGrid][GRID_LOGIN_URI_VALUE].isArray())
-	{
-		llinfos << "is array" << llendl;
-	}
 }
 
 LLGridManager::~LLGridManager()
 {
-	saveFavorites();
 }
 
-void LLGridManager::getGridInfo(const std::string &grid, LLSD& grid_info)
-{
-	
-	grid_info = mGridList[grid]; 
-	
-	// override any grid data with the command line info.
-	
-	LLSD cmd_line_login_uri = gSavedSettings.getLLSD("CmdLineLoginURI");
-	if (cmd_line_login_uri.isString())
-	{	
-		grid_info[GRID_LOGIN_URI_VALUE] = LLSD::emptyArray();
-		grid_info[GRID_LOGIN_URI_VALUE].append(cmd_line_login_uri);
-	}
-	
-	// override the helper uri if it was passed in
-	std::string cmd_line_helper_uri = gSavedSettings.getString("CmdLineHelperURI");
-	if(!cmd_line_helper_uri.empty())
-	{
-		grid_info[GRID_HELPER_URI_VALUE] = cmd_line_helper_uri;	
-	}
-	
-	// override the login page if it was passed in
-	std::string cmd_line_login_page = gSavedSettings.getString("LoginPage");
-	if(!cmd_line_login_page.empty())
-	{
-		grid_info[GRID_LOGIN_PAGE_VALUE] = cmd_line_login_page;
-	}	
-}
-
-
 //
 // LLGridManager::addGrid - add a grid to the grid list, populating the needed values
 // if they're not populated yet.
 //
 
-void LLGridManager::addGrid(LLSD& grid_data)
+bool LLGridManager::addGrid(LLSD& grid_data)
 {
+	bool added = false;
 	if (grid_data.isMap() && grid_data.has(GRID_VALUE))
 	{
-		std::string grid = utf8str_tolower(grid_data[GRID_VALUE]);
+		std::string grid = utf8str_tolower(grid_data[GRID_VALUE].asString());
 
-		// grid should be in the form of a dns address
-		if (!grid.empty() &&
-			grid.find_first_not_of("abcdefghijklmnopqrstuvwxyz1234567890-_. ") != std::string::npos)
-		{
-			printf("grid name: %s", grid.c_str());
-			throw LLInvalidGridName(grid);
-		}
-		
-		// populate the other values if they don't exist
-		if (!grid_data.has(GRID_LABEL_VALUE)) 
-		{
-			grid_data[GRID_LABEL_VALUE] = grid;
-		}
-		if (!grid_data.has(GRID_ID_VALUE))
-		{
-			grid_data[GRID_ID_VALUE] = grid;
-		}
-		
-		// if the grid data doesn't include any of the URIs, then 
-		// generate them from the grid, which should be a dns address
-		if (!grid_data.has(GRID_LOGIN_URI_VALUE)) 
+		if ( getGrid(grid_data[GRID_VALUE]).empty() && getGrid(grid).empty() )
 		{
-			grid_data[GRID_LOGIN_URI_VALUE] = LLSD::emptyArray();
-			grid_data[GRID_LOGIN_URI_VALUE].append(std::string("https://") + 
-													grid + "/cgi-bin/login.cgi");
-		}
-		// Populate to the default values
-		if (!grid_data.has(GRID_LOGIN_PAGE_VALUE)) 
-		{
-			grid_data[GRID_LOGIN_PAGE_VALUE] = std::string("http://") + grid + "/app/login/";
-		}		
-		if (!grid_data.has(GRID_HELPER_URI_VALUE)) 
-		{
-			grid_data[GRID_HELPER_URI_VALUE] = std::string("https://") + grid + "/helpers/";
+			std::string grid_id = grid_data.has(GRID_ID_VALUE) ? grid_data[GRID_ID_VALUE].asString() : "";
+			if ( getGrid(grid_id).empty() )
+			{
+				// populate the other values if they don't exist
+				if (!grid_data.has(GRID_LABEL_VALUE))
+				{
+					grid_data[GRID_LABEL_VALUE] = grid;
+				}
+				if (!grid_data.has(GRID_ID_VALUE))
+				{
+					grid_data[GRID_ID_VALUE] = grid;
+				}
+
+				// if the grid data doesn't include any of the URIs, then
+				// generate them from the grid, which should be a dns address
+				if (!grid_data.has(GRID_LOGIN_URI_VALUE))
+				{
+					grid_data[GRID_LOGIN_URI_VALUE] = LLSD::emptyArray();
+					grid_data[GRID_LOGIN_URI_VALUE].append(std::string("https://") +
+														   grid + "/cgi-bin/login.cgi");
+				}
+				// Populate to the default values
+				if (!grid_data.has(GRID_LOGIN_PAGE_VALUE))
+				{
+					grid_data[GRID_LOGIN_PAGE_VALUE] = std::string("http://") + grid + "/app/login/";
+				}
+				if (!grid_data.has(GRID_HELPER_URI_VALUE))
+				{
+					grid_data[GRID_HELPER_URI_VALUE] = std::string("https://") + grid + "/helpers/";
+				}
+
+				if (!grid_data.has(GRID_LOGIN_IDENTIFIER_TYPES))
+				{
+					// non system grids and grids that haven't already been configured with values
+					// get both types of credentials.
+					grid_data[GRID_LOGIN_IDENTIFIER_TYPES] = LLSD::emptyArray();
+					grid_data[GRID_LOGIN_IDENTIFIER_TYPES].append(CRED_IDENTIFIER_TYPE_AGENT);
+					grid_data[GRID_LOGIN_IDENTIFIER_TYPES].append(CRED_IDENTIFIER_TYPE_ACCOUNT);
+				}
+
+				LL_DEBUGS("GridManager") <<grid<<"\n"
+										 <<"  id:          "<<grid_data[GRID_ID_VALUE].asString()<<"\n"
+										 <<"  label:       "<<grid_data[GRID_LABEL_VALUE].asString()<<"\n"
+										 <<"  login page:  "<<grid_data[GRID_LOGIN_PAGE_VALUE].asString()<<"\n"
+										 <<"  helper page: "<<grid_data[GRID_HELPER_URI_VALUE].asString()<<"\n";
+				/* still in LL_DEBUGS */ 
+				for (LLSD::array_const_iterator login_uris = grid_data[GRID_LOGIN_URI_VALUE].beginArray();
+					 login_uris != grid_data[GRID_LOGIN_URI_VALUE].endArray();
+					 login_uris++)
+				{
+					LL_CONT << "  login uri:   "<<login_uris->asString()<<"\n";
+				}
+				LL_CONT << LL_ENDL;
+				mGridList[grid] = grid_data;
+				added = true;
+			}
+			else
+			{
+				LL_WARNS("GridManager")<<"duplicate grid id'"<<grid_id<<"' ignored"<<LL_ENDL;
+			}
 		}
-		
-		if (!grid_data.has(GRID_LOGIN_IDENTIFIER_TYPES))
+		else
 		{
-			// non system grids and grids that haven't already been configured with values
-			// get both types of credentials.
-			grid_data[GRID_LOGIN_IDENTIFIER_TYPES] = LLSD::emptyArray();
-			grid_data[GRID_LOGIN_IDENTIFIER_TYPES].append(CRED_IDENTIFIER_TYPE_AGENT);
-			grid_data[GRID_LOGIN_IDENTIFIER_TYPES].append(CRED_IDENTIFIER_TYPE_ACCOUNT);
+			LL_WARNS("GridManager")<<"duplicate grid name '"<<grid<<"' ignored"<<LL_ENDL;
 		}
-		
-		LL_DEBUGS("GridManager") << "ADDING: " << grid << LL_ENDL;
-		mGridList[grid] = grid_data;		
 	}
+	else
+	{
+		LL_WARNS("GridManager")<<"invalid grid definition ignored"<<LL_ENDL;
+	}
+	return added;
 }
 
 //
 // LLGridManager::addSystemGrid - helper for adding a system grid.
-void LLGridManager::addSystemGrid(const std::string& label, 
-								  const std::string& name, 
-								  const std::string& login, 
+void LLGridManager::addSystemGrid(const std::string& label,
+								  const std::string& name,
+								  const std::string& login_uri,
 								  const std::string& helper,
 								  const std::string& login_page,
 								  const std::string& login_id)
@@ -432,12 +339,12 @@ void LLGridManager::addSystemGrid(const std::string& label,
 	grid[GRID_LABEL_VALUE] = label;
 	grid[GRID_HELPER_URI_VALUE] = helper;
 	grid[GRID_LOGIN_URI_VALUE] = LLSD::emptyArray();
-	grid[GRID_LOGIN_URI_VALUE].append(login);
+	grid[GRID_LOGIN_URI_VALUE].append(login_uri);
 	grid[GRID_LOGIN_PAGE_VALUE] = login_page;
-	grid[GRID_IS_SYSTEM_GRID_VALUE] = TRUE;
+	grid[GRID_IS_SYSTEM_GRID_VALUE] = true;
 	grid[GRID_LOGIN_IDENTIFIER_TYPES] = LLSD::emptyArray();
 	grid[GRID_LOGIN_IDENTIFIER_TYPES].append(CRED_IDENTIFIER_TYPE_AGENT);
-	
+
 	grid[GRID_APP_SLURL_BASE] = SYSTEM_GRID_APP_SLURL_BASE;
 	if (login_id.empty())
 	{
@@ -447,124 +354,187 @@ void LLGridManager::addSystemGrid(const std::string& label,
 	{
 		grid[GRID_ID_VALUE] = login_id;
 	}
-	
-	// only add the system grids beyond agni to the visible list
-	// if we're building a debug version.
+
 	if (name == std::string(MAINGRID))
 	{
-		grid[GRID_SLURL_BASE] = MAIN_GRID_SLURL_BASE;		
-		grid[GRID_IS_FAVORITE_VALUE] = TRUE;		
+		grid[GRID_SLURL_BASE] = MAIN_GRID_SLURL_BASE;
 	}
 	else
 	{
-		grid[GRID_SLURL_BASE] = llformat(SYSTEM_GRID_SLURL_BASE, label.c_str());
+		grid[GRID_SLURL_BASE] = llformat(SYSTEM_GRID_SLURL_BASE, grid[GRID_ID_VALUE].asString().c_str());
 	}
+
 	addGrid(grid);
 }
 
 // return a list of grid name -> grid label mappings for UI purposes
-std::map<std::string, std::string> LLGridManager::getKnownGrids(bool favorite_only)
+std::map<std::string, std::string> LLGridManager::getKnownGrids()
 {
 	std::map<std::string, std::string> result;
 	for(LLSD::map_iterator grid_iter = mGridList.beginMap();
 		grid_iter != mGridList.endMap();
-		grid_iter++) 
+		grid_iter++)
 	{
-		if(!favorite_only || grid_iter->second.has(GRID_IS_FAVORITE_VALUE))
-		{
-			result[grid_iter->first] = grid_iter->second[GRID_LABEL_VALUE].asString();
-		}
+		result[grid_iter->first] = grid_iter->second[GRID_LABEL_VALUE].asString();
 	}
 
 	return result;
 }
 
-
 void LLGridManager::setGridChoice(const std::string& grid)
 {
 	// Set the grid choice based on a string.
-	// The string can be:
-	// - a grid label from the gGridInfo table 
-	// - a hostname
-	// - an ip address
-
-	// loop through.  We could do just a hash lookup but we also want to match
-	// on label
-	std::string grid_name = grid;
-	if(!mGridList.has(grid_name))
+	LL_DEBUGS("GridManager")<<"requested "<<grid<<LL_ENDL;
+ 	std::string grid_name = getGrid(grid); // resolved either the name or the id to the name
+
+	if(!grid_name.empty())
 	{
-		// case insensitive
-		grid_name = getGridByLabel(grid);
+		LL_INFOS("GridManager")<<"setting "<<grid_name<<LL_ENDL;
+		mGrid = grid_name;
+		gSavedSettings.setString("CurrentGrid", grid_name);
+		
+		updateIsInProductionGrid();
 	}
-	
-	if(grid_name.empty())
+	else
 	{
 		// the grid was not in the list of grids.
-		LLSD grid_data = LLSD::emptyMap();
-		grid_data[GRID_VALUE] = grid;
-		addGrid(grid_data);		
+		LL_WARNS("GridManager")<<"unknown grid "<<grid<<LL_ENDL;
 	}
-	mGrid = grid;
-	gSavedSettings.setString("CurrentGrid", grid);
-
-	updateIsInProductionGrid();
 }
 
-std::string LLGridManager::getGridByLabel( const std::string &grid_label, bool case_sensitive)
+std::string LLGridManager::getGrid( const std::string &grid )
 {
-	for(LLSD::map_iterator grid_iter = mGridList.beginMap();
-		grid_iter != mGridList.endMap();
-		grid_iter++) 
+	std::string grid_name;
+
+	if (mGridList.has(grid))
+	{
+		// the grid was the long name, so we're good, return it
+		grid_name = grid;
+	}
+	else
 	{
-		if (grid_iter->second.has(GRID_LABEL_VALUE))
+		// search the grid list for a grid with a matching id
+		for(LLSD::map_iterator grid_iter = mGridList.beginMap();
+			grid_name.empty() && grid_iter != mGridList.endMap();
+			grid_iter++)
 		{
-			if (0 == (case_sensitive?LLStringUtil::compareStrings(grid_label, grid_iter->second[GRID_LABEL_VALUE].asString()):
-				LLStringUtil::compareInsensitive(grid_label, grid_iter->second[GRID_LABEL_VALUE].asString())))
+			if (grid_iter->second.has(GRID_ID_VALUE))
 			{
-				return grid_iter->first;
+				if (0 == (LLStringUtil::compareInsensitive(grid,
+														   grid_iter->second[GRID_ID_VALUE].asString())))
+				{
+					// found a matching label, return this name
+					grid_name = grid_iter->first;
+				}
 			}
 		}
 	}
-	return std::string();
+	return grid_name;
 }
 
-void LLGridManager::getLoginURIs(std::vector<std::string>& uris)
+std::string LLGridManager::getGridLabel(const std::string& grid)
+{
+	std::string grid_label;
+	std::string grid_name = getGrid(grid);
+	if (!grid.empty())
+	{
+		grid_label = mGridList[grid_name][GRID_LABEL_VALUE].asString();
+	}
+	else
+	{
+		LL_WARNS("GridManager")<<"invalid grid '"<<grid<<"'"<<LL_ENDL;
+	}
+	LL_DEBUGS("GridManager")<<"returning "<<grid_label<<LL_ENDL;
+	return grid_label;
+}
+
+std::string LLGridManager::getGridId(const std::string& grid)
+{
+	std::string grid_id;
+	std::string grid_name = getGrid(grid);
+	if (!grid.empty())
+	{
+		grid_id = mGridList[grid_name][GRID_ID_VALUE].asString();
+	}
+	else
+	{
+		LL_WARNS("GridManager")<<"invalid grid '"<<grid<<"'"<<LL_ENDL;
+	}
+	LL_DEBUGS("GridManager")<<"returning "<<grid_id<<LL_ENDL;
+	return grid_id;
+}
+
+void LLGridManager::getLoginURIs(const std::string& grid, std::vector<std::string>& uris)
 {
 	uris.clear();
-	LLSD cmd_line_login_uri = gSavedSettings.getLLSD("CmdLineLoginURI");
-	if (cmd_line_login_uri.isString())
-	{	
-		uris.push_back(cmd_line_login_uri);
-		return;
+	std::string grid_name = getGrid(grid);
+	if (!grid_name.empty())
+	{
+		for (LLSD::array_iterator llsd_uri = mGridList[grid_name][GRID_LOGIN_URI_VALUE].beginArray();
+			 llsd_uri != mGridList[grid_name][GRID_LOGIN_URI_VALUE].endArray();
+			 llsd_uri++)
+		{
+			uris.push_back(llsd_uri->asString());
+		}
 	}
-	for (LLSD::array_iterator llsd_uri = mGridList[mGrid][GRID_LOGIN_URI_VALUE].beginArray();
-		 llsd_uri != mGridList[mGrid][GRID_LOGIN_URI_VALUE].endArray();
-		 llsd_uri++)
+	else
 	{
-		uris.push_back(llsd_uri->asString());
+		LL_WARNS("GridManager")<<"invalid grid '"<<grid<<"'"<<LL_ENDL;
 	}
 }
 
-std::string LLGridManager::getHelperURI() 
+void LLGridManager::getLoginURIs(std::vector<std::string>& uris)
 {
-	std::string cmd_line_helper_uri = gSavedSettings.getString("CmdLineHelperURI");
-	if(!cmd_line_helper_uri.empty())
+	getLoginURIs(mGrid, uris);
+}
+
+std::string LLGridManager::getHelperURI(const std::string& grid)
+{
+	std::string helper_uri;
+	std::string grid_name = getGrid(grid);
+	if (!grid_name.empty())
 	{
-		return cmd_line_helper_uri;	
+		helper_uri = mGridList[grid_name][GRID_HELPER_URI_VALUE].asString();
 	}
-	return mGridList[mGrid][GRID_HELPER_URI_VALUE];
+	else
+	{
+		LL_WARNS("GridManager")<<"invalid grid '"<<grid<<"'"<<LL_ENDL;
+	}
+
+	LL_DEBUGS("GridManager")<<"returning "<<helper_uri<<LL_ENDL;
+	return helper_uri;
 }
 
-std::string LLGridManager::getLoginPage() 
+std::string LLGridManager::getLoginPage(const std::string& grid)
 {
-	// override the login page if it was passed in
-	std::string cmd_line_login_page = gSavedSettings.getString("LoginPage");
-	if(!cmd_line_login_page.empty())
+	std::string grid_login_page;
+	std::string grid_name = getGrid(grid);
+	if (!grid_name.empty())
+	{
+		grid_login_page = mGridList[grid_name][GRID_LOGIN_PAGE_VALUE].asString();
+	}
+	else
 	{
-		return cmd_line_login_page;
-	}	
-	
-	return mGridList[mGrid][GRID_LOGIN_PAGE_VALUE];
+		LL_WARNS("GridManager")<<"invalid grid '"<<grid<<"'"<<LL_ENDL;
+	}
+	return grid_login_page;
+}
+
+std::string LLGridManager::getLoginPage()
+{
+	std::string login_page = mGridList[mGrid][GRID_LOGIN_PAGE_VALUE].asString();
+	LL_DEBUGS("GridManager")<<"returning "<<login_page<<LL_ENDL;
+	return login_page;
+}
+
+void LLGridManager::getLoginIdentifierTypes(LLSD& idTypes)
+{
+	idTypes = mGridList[mGrid][GRID_LOGIN_IDENTIFIER_TYPES];
+}
+
+std::string LLGridManager::getGridLoginID()
+{
+	return mGridList[mGrid][GRID_ID_VALUE];
 }
 
 void LLGridManager::updateIsInProductionGrid()
@@ -578,13 +548,19 @@ void LLGridManager::updateIsInProductionGrid()
 	if (uris.empty())
 	{
 		mIsInProductionGrid = true;
-		return;
 	}
-	LLStringUtil::toLower(uris[0]);
-	if((uris[0].find("agni") != std::string::npos))
+	else
 	{
-		mIsInProductionGrid = true;
-		return;
+		for ( std::vector<std::string>::iterator uri_it = uris.begin();
+			  ! mIsInProductionGrid && uri_it != uris.end();
+			  uri_it++
+			 )
+		{
+			if( MAIN_GRID_LOGIN_URI == *uri_it )
+			{
+				mIsInProductionGrid = true;
+			}
+		}
 	}
 }
 
@@ -593,50 +569,53 @@ bool LLGridManager::isInProductionGrid()
 	return mIsInProductionGrid;
 }
 
-void LLGridManager::saveFavorites()
+bool LLGridManager::isSystemGrid(const std::string& grid)
 {
-	// filter out just those marked as favorites
-	LLSD output_grid_list = LLSD::emptyMap();
-	for(LLSD::map_iterator grid_iter = mGridList.beginMap();
-		grid_iter != mGridList.endMap();
-		grid_iter++)
-	{
-		if(grid_iter->second.has(GRID_IS_FAVORITE_VALUE))
-		{
-			output_grid_list[grid_iter->first] = grid_iter->second;
-		}
-	}       
-	llofstream llsd_xml;
-	llsd_xml.open( mGridFile.c_str(), std::ios::out | std::ios::binary);	
-	LLSDSerialize::toPrettyXML(output_grid_list, llsd_xml);
-	llsd_xml.close();
-}
+	std::string grid_name = getGrid(grid);
 
+	return (   !grid_name.empty()
+			&& mGridList.has(grid)
+			&& mGridList[grid].has(GRID_IS_SYSTEM_GRID_VALUE)
+			&& mGridList[grid][GRID_IS_SYSTEM_GRID_VALUE].asBoolean()
+			);
+}
 
 // build a slurl for the given region within the selected grid
 std::string LLGridManager::getSLURLBase(const std::string& grid)
 {
-	std::string grid_base;
-	if(mGridList.has(grid) && mGridList[grid].has(GRID_SLURL_BASE))
+	std::string grid_base = "";
+	std::string grid_name = getGrid(grid);
+	if( ! grid_name.empty() && mGridList.has(grid_name) )
 	{
-		return mGridList[grid][GRID_SLURL_BASE].asString();
-	}
-	else
-	{
-		return  llformat(DEFAULT_SLURL_BASE, grid.c_str());
+		if (mGridList[grid_name].has(GRID_SLURL_BASE))
+		{
+			grid_base = mGridList[grid_name][GRID_SLURL_BASE].asString();
+		}
+		else
+		{
+			grid_base = llformat(DEFAULT_SLURL_BASE, grid_name.c_str());
+		}
 	}
+	LL_DEBUGS("GridManager")<<"returning '"<<grid_base<<"'"<<LL_ENDL;
+	return grid_base;
 }
 
 // build a slurl for the given region within the selected grid
 std::string LLGridManager::getAppSLURLBase(const std::string& grid)
 {
-	std::string grid_base;
-	if(mGridList.has(grid) && mGridList[grid].has(GRID_APP_SLURL_BASE))
-	{
-	  return mGridList[grid][GRID_APP_SLURL_BASE].asString();
-	}
-	else
+	std::string grid_base = "";
+	std::string grid_name = getGrid(grid);
+	if(!grid_name.empty() && mGridList.has(grid))
 	{
-	  return  llformat(DEFAULT_APP_SLURL_BASE, grid.c_str());
+		if (mGridList[grid].has(GRID_APP_SLURL_BASE))
+		{
+			grid_base = mGridList[grid][GRID_APP_SLURL_BASE].asString();
+		}
+		else
+		{
+			grid_base = llformat(DEFAULT_APP_SLURL_BASE, grid_name.c_str());
+		}
 	}
+	LL_DEBUGS("GridManager")<<"returning '"<<grid_base<<"'"<<LL_ENDL;
+	return grid_base;
 }
diff --git a/indra/newview/llviewernetwork.h b/indra/newview/llviewernetwork.h
index 15e25b49524512fa9b07881f440fa54f5bba4a8b..3f56103b2e72df1b1edfeaa7d903ba95987e8811 100644
--- a/indra/newview/llviewernetwork.h
+++ b/indra/newview/llviewernetwork.h
@@ -27,113 +27,181 @@
 
 #ifndef LL_LLVIEWERNETWORK_H
 #define LL_LLVIEWERNETWORK_H
-                                                                                                       
-extern const char* DEFAULT_LOGIN_PAGE;
-      
-#define GRID_VALUE "name"
-#define GRID_LABEL_VALUE "label"
-#define GRID_ID_VALUE "grid_login_id"
-#define GRID_LOGIN_URI_VALUE "login_uri"
-#define GRID_HELPER_URI_VALUE "helper_uri"
-#define GRID_LOGIN_PAGE_VALUE "login_page"
-#define GRID_IS_SYSTEM_GRID_VALUE "system_grid"
-#define GRID_IS_FAVORITE_VALUE "favorite"
+
+// @TODO this really should be private, but is used in llslurl
 #define MAINGRID "util.agni.lindenlab.com"
-#define GRID_LOGIN_IDENTIFIER_TYPES "login_identifier_types"
-// defines slurl formats associated with various grids.
-// we need to continue to support existing forms, as slurls
-// are shared between viewers that may not understand newer
-// forms.
-#define GRID_SLURL_BASE "slurl_base"
-#define GRID_APP_SLURL_BASE "app_slurl_base"
 
+/// Exception thrown when a grid is not valid
 class LLInvalidGridName
 {
 public:
 	LLInvalidGridName(std::string grid) : mGrid(grid)
 	{
 	}
+	std::string name() { return mGrid; }
 protected:
 	std::string mGrid;
 };
 
-
 /**
- * @brief A class to manage the grids available to the viewer
- * including persistance.  This class also maintains the currently
- * selected grid.
- * 
+ * @brief A singleton class to manage the grids available to the viewer.
+ *
+ * This class maintains several properties for each known grid, and provides
+ * interfaces for obtaining each of these properties given a specified
+ * grid.  Grids are specified by either of two identifiers, each of which
+ * must be unique among all known grids:
+ * - grid name : DNS name for the grid
+ * - grid id   : a short form (conventionally a single word) 
+ *
+ * This class maintains the currently selected grid, and provides short
+ * form accessors for each of the properties of the selected grid.
  **/
 class LLGridManager : public LLSingleton<LLGridManager>
 {
-public:
-	
-	// when the grid manager is instantiated, the default grids are automatically
-	// loaded, and the grids favorites list is loaded from the xml file.
+  public:
+	/* ================================================================
+	 * @name Initialization and Configuration
+	 * @{
+	 */
+	/// Instantiate the grid manager, load default grids, selects the default grid
 	LLGridManager(const std::string& grid_file);
 	LLGridManager();
 	~LLGridManager();
 	
+	/// add grids from an external grids file
 	void initialize(const std::string& grid_file);
-	// grid list management
-	
-	// add a grid to the list of grids
-	void addGrid(LLSD& grid_info);	
-
-	// retrieve a map of grid-name <-> label
-	// by default only return the user visible grids
-	std::map<std::string, std::string> getKnownGrids(bool favorites_only=FALSE);
 	
-	void getGridInfo(const std::string& grid, LLSD &grid_info);
+	//@}
 	
-	// current grid management
+	/* ================================================================
+	 * @name Grid Identifiers 
+	 * @{
+	 * The id is a short form (typically one word) grid name,
+	 * It should be used in URL path elements or parameters
+	 *
+	 * Each grid also has a "label", intented to be a user friendly
+	 * descriptive form (it is used in the login panel grid menu, for example).
+	 */
+	/// Return the name of a grid, given either its name or its id
+	std::string getGrid( const std::string &grid );
 
-	// select a given grid as the current grid.  If the grid
-	// is not a known grid, then it's assumed to be a dns name for the
-	// grid, and the various URIs will be automatically generated.
-	void setGridChoice(const std::string& grid);
+	/// Get the id (short form selector) for a given grid
+	std::string getGridId(const std::string& grid);
+
+	/// Get the id (short form selector) for the selected grid
+	std::string getGridId() { return getGridId(mGrid); }
+
+	/// Get the user-friendly long form descriptor for a given grid
+	std::string getGridLabel(const std::string& grid);
 	
+	/// Get the user-friendly long form descriptor for the selected grid
+	std::string getGridLabel() { return getGridLabel(mGrid); }
+
+	/// Retrieve a map of grid-name -> label
+	std::map<std::string, std::string> getKnownGrids();
+
+	//@}
+
+	/* ================================================================
+	 * @name Login related properties
+	 * @{
+	 */
+
+	/**
+	 * Get the login uris for the specified grid.
+	 * The login uri for a grid is the target of the authentication request.
+	 * A grid may have multple login uris, so they are returned as a vector.
+	 */
+	void getLoginURIs(const std::string& grid, std::vector<std::string>& uris);
 	
-	std::string getGridLabel() { return mGridList[mGrid][GRID_LABEL_VALUE]; } 	
-	std::string getGrid() const { return mGrid; }
+	/// Get the login uris for the selected grid
 	void getLoginURIs(std::vector<std::string>& uris);
-	std::string getHelperURI();
-	std::string getLoginPage();
-	std::string getGridLoginID() { return mGridList[mGrid][GRID_ID_VALUE]; }	
-	std::string getLoginPage(const std::string& grid) { return mGridList[grid][GRID_LOGIN_PAGE_VALUE]; }
-	void        getLoginIdentifierTypes(LLSD& idTypes) { idTypes = mGridList[mGrid][GRID_LOGIN_IDENTIFIER_TYPES]; }
 	
-	// build a slurl for the given region within the selected grid
+	/// Get the URI for webdev help functions for the specified grid
+	std::string getHelperURI(const std::string& grid);
+
+	/// Get the URI for webdev help functions for the selected grid
+	std::string getHelperURI() { return getHelperURI(mGrid); }
+
+	/// Get the url of the splash page to be displayed prior to login
+	std::string getLoginPage(const std::string& grid_name);
+
+	/// Get the URI for the login splash page for the selected grid
+	std::string getLoginPage();
+
+	/// Get the id to be used as a short name in url path components or parameters
+	std::string getGridLoginID();
+
+	/// Get an array of the login types supported by the grid
+	void getLoginIdentifierTypes(LLSD& idTypes);
+	/**< the types are "agent" and "avatar";
+	 * one means single-name (someone Resident) accounts and other first/last name accounts
+	 * I am not sure which is which
+	 */
+
+	//@}
+
+	/* ================================================================
+	 * @name URL Construction Properties
+	 * @{
+	 */
+
+	/// Return the slurl prefix (everything up to but not including the region) for a given grid
 	std::string getSLURLBase(const std::string& grid);
+
+	/// Return the slurl prefix (everything up to but not including the region) for the selected grid
 	std::string getSLURLBase() { return getSLURLBase(mGrid); }
 	
+	/// Return the application URL prefix for the given grid
 	std::string getAppSLURLBase(const std::string& grid);
+
+	/// Return the application URL prefix for the selected grid
 	std::string getAppSLURLBase() { return getAppSLURLBase(mGrid); }	
-	
-	void getGridInfo(LLSD &grid_info) { getGridInfo(mGrid, grid_info); }
-	
-	std::string getGridByLabel( const std::string &grid_label, bool case_sensitive = false);
-	
-	bool isSystemGrid(const std::string& grid) 
-	{ 
-		return mGridList.has(grid) &&
-		      mGridList[grid].has(GRID_IS_SYSTEM_GRID_VALUE) && 
-	           mGridList[grid][GRID_IS_SYSTEM_GRID_VALUE].asBoolean(); 
-	}
+
+	//@}
+
+	/* ================================================================
+	 * @name Selecting the current grid
+	 * @{
+	 * At initialization, the current grid is set by the first of:
+	 * -# The value supplied by the --grid command line option (setting CmdLineGridChoice);
+	 *    Note that a default for this may be set at build time.
+	 * -# The grid used most recently (setting CurrentGrid)
+	 * -# The main grid (Agni)
+	 */
+
+	/// Select a given grid as the current grid.  
+	void setGridChoice(const std::string& grid);
+
+	/// Returns the name of the currently selected grid 
+	std::string getGrid() const { return mGrid; }
+
+	//@}
+
+	/// Is the given grid one of the hard-coded default grids (Agni or Aditi)
+	bool isSystemGrid(const std::string& grid);
+
+	/// Is the selected grid one of the hard-coded default grids (Agni or Aditi)
 	bool isSystemGrid() { return isSystemGrid(mGrid); }
-	// Mark this grid as a favorite that should be persisited on 'save'
-	// this is currently used to persist a grid after a successful login
-	void setFavorite() { mGridList[mGrid][GRID_IS_FAVORITE_VALUE] = TRUE; }
-	
+
+	/// Is the selected grid a production grid?
 	bool isInProductionGrid();
-	void saveFavorites();
-	void clearFavorites();
+	/**
+	 * yes, that's not a very helpful description.
+	 * I don't really know why that is different from isSystemGrid()
+	 * In practice, the implementation is that it
+	 * @returns true if the login uri for the grid is the uri for MAINGRID
+	 */
 
-protected:
+  private:
+	
+	/// Add a grid to the list of grids 
+	bool addGrid(LLSD& grid_info);
+	///< @returns true if successfully added
 
 	void updateIsInProductionGrid();
 
-	// helper function for adding the predefined grids
+	// helper function for adding the hard coded grids
 	void addSystemGrid(const std::string& label, 
 					   const std::string& name, 
 					   const std::string& login, 
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 67c87a6c63b20d78df7fbf53eb08d2bb25679c80..31e4fd1ed550ae34c17a80a694efee748465d731 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -199,6 +199,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
 	mID(id),
 	mLocalID(0),
 	mTotalCRC(0),
+	mListIndex(-1),
 	mTEImages(NULL),
 	mGLName(0),
 	mbCanSelect(TRUE),
@@ -448,7 +449,7 @@ void LLViewerObject::dump() const
 	/*
 	llinfos << "Velocity: " << getVelocity() << llendl;
 	llinfos << "AnyOwner: " << permAnyOwner() << " YouOwner: " << permYouOwner() << " Edit: " << mPermEdit << llendl;
-	llinfos << "UsePhysics: " << usePhysics() << " CanSelect " << mbCanSelect << " UserSelected " << mUserSelected << llendl;
+	llinfos << "UsePhysics: " << flagUsePhysics() << " CanSelect " << mbCanSelect << " UserSelected " << mUserSelected << llendl;
 	llinfos << "AppAngle: " << mAppAngle << llendl;
 	llinfos << "PixelArea: " << mPixelArea << llendl;
 
@@ -2067,12 +2068,11 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
 		}
 	}
 
-	if (new_rot != mLastRot
+	if (new_rot != getRotation()
 		|| new_angv != old_angv)
 	{
-		if (new_rot != mLastRot)
+		if (new_rot != getRotation())
 		{
-			mLastRot = new_rot;
 			setRotation(new_rot);
 		}
 		
@@ -2171,8 +2171,8 @@ BOOL LLViewerObject::isActive() const
 
 BOOL LLViewerObject::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
 {
-	static LLFastTimer::DeclareTimer ftm("Viewer Object");
-	LLFastTimer t(ftm);
+	//static LLFastTimer::DeclareTimer ftm("Viewer Object");
+	//LLFastTimer t(ftm);
 
 	if (mDead)
 	{
@@ -4085,38 +4085,6 @@ void LLViewerObject::sendMaterialUpdate() const
 
 }
 
-// formerly send_object_rotation
-void LLViewerObject::sendRotationUpdate() const
-{
-	LLViewerRegion* regionp = getRegion();
-	if(!regionp) return;
-	gMessageSystem->newMessageFast(_PREHASH_ObjectRotation);
-	gMessageSystem->nextBlockFast(_PREHASH_AgentData);
-	gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
-	gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
-	gMessageSystem->nextBlockFast(_PREHASH_ObjectData);
-	gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID, mLocalID);
-	gMessageSystem->addQuatFast(_PREHASH_Rotation, getRotationEdit());
-	//llinfos << "Sent rotation " << getRotationEdit() << llendl;
-	gMessageSystem->sendReliable( regionp->getHost() );
-}
-
-/* Obsolete, we use MultipleObjectUpdate instead
-//// formerly send_object_position_global
-//void LLViewerObject::sendPositionUpdate() const
-//{
-//	gMessageSystem->newMessageFast(_PREHASH_ObjectPosition);
-//	gMessageSystem->nextBlockFast(_PREHASH_AgentData);
-//	gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
-//	gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
-//	gMessageSystem->nextBlockFast(_PREHASH_ObjectData);
-//	gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID,	mLocalID );
-//	gMessageSystem->addVector3Fast(_PREHASH_Position, getPositionRegion());
-//	LLViewerRegion* regionp = getRegion();
-//	gMessageSystem->sendReliable(regionp->getHost());
-//}
-*/
-
 //formerly send_object_shape(LLViewerObject *object)
 void LLViewerObject::sendShapeUpdate()
 {
@@ -4824,9 +4792,11 @@ void LLViewerObject::deleteParticleSource()
 // virtual
 void LLViewerObject::updateDrawable(BOOL force_damped)
 {
-	if (mDrawable.notNull() && 
-		!mDrawable->isState(LLDrawable::ON_MOVE_LIST) &&
-		isChanged(MOVED))
+	if (!isChanged(MOVED))
+	{ //most common case, having an empty if case here makes for better branch prediction
+	}
+	else if (mDrawable.notNull() && 
+		!mDrawable->isState(LLDrawable::ON_MOVE_LIST))
 	{
 		BOOL damped_motion = 
 			!isChanged(SHIFTED) &&										// not shifted between regions this frame and...
@@ -5191,7 +5161,7 @@ BOOL LLViewerObject::permAnyOwner() const
 { 
 	if (isRootEdit())
 	{
-		return ((mFlags & FLAGS_OBJECT_ANY_OWNER) != 0); 
+		return flagObjectAnyOwner(); 
 	}
 	else
 	{
@@ -5213,7 +5183,7 @@ BOOL LLViewerObject::permYouOwner() const
 			return TRUE;
 		}
 # endif
-		return ((mFlags & FLAGS_OBJECT_YOU_OWNER) != 0); 
+		return flagObjectYouOwner(); 
 #endif
 	}
 	else
@@ -5227,7 +5197,7 @@ BOOL LLViewerObject::permGroupOwner() const
 { 
 	if (isRootEdit())
 	{
-		return ((mFlags & FLAGS_OBJECT_GROUP_OWNED) != 0); 
+		return flagObjectGroupOwned(); 
 	}
 	else
 	{
@@ -5250,7 +5220,7 @@ BOOL LLViewerObject::permOwnerModify() const
 			return TRUE;
 	}
 # endif
-		return ((mFlags & FLAGS_OBJECT_OWNER_MODIFY) != 0); 
+		return flagObjectOwnerModify(); 
 #endif
 	}
 	else
@@ -5274,7 +5244,7 @@ BOOL LLViewerObject::permModify() const
 			return TRUE;
 	}
 # endif
-		return ((mFlags & FLAGS_OBJECT_MODIFY) != 0); 
+		return flagObjectModify(); 
 #endif
 	}
 	else
@@ -5298,7 +5268,7 @@ BOOL LLViewerObject::permCopy() const
 			return TRUE;
 		}
 # endif
-		return ((mFlags & FLAGS_OBJECT_COPY) != 0); 
+		return flagObjectCopy();
 #endif
 	}
 	else
@@ -5322,7 +5292,7 @@ BOOL LLViewerObject::permMove() const
 			return TRUE;
 		}
 # endif
-		return ((mFlags & FLAGS_OBJECT_MOVE) != 0); 
+		return flagObjectMove(); 
 #endif
 	}
 	else
@@ -5346,7 +5316,7 @@ BOOL LLViewerObject::permTransfer() const
 			return TRUE;
 		}
 # endif
-		return ((mFlags & FLAGS_OBJECT_TRANSFER) != 0); 
+		return flagObjectTransfer(); 
 #endif
 	}
 	else
@@ -5389,21 +5359,19 @@ void LLViewerObject::markForUpdate(BOOL priority)
 	}
 }
 
+bool LLViewerObject::isPermanentEnforced() const
+{
+	return flagObjectPermanent() && (mRegionp != gAgent.getRegion()) && !gAgent.isGodlike();
+}
+
 bool LLViewerObject::getIncludeInSearch() const
 {
-	return ((mFlags & FLAGS_INCLUDE_IN_SEARCH) != 0);
+	return flagIncludeInSearch();
 }
 
 void LLViewerObject::setIncludeInSearch(bool include_in_search)
 {
-	if (include_in_search)
-	{
-		mFlags |= FLAGS_INCLUDE_IN_SEARCH;
-	}
-	else
-	{
-		mFlags &= ~FLAGS_INCLUDE_IN_SEARCH;
-	}
+	setFlags(FLAGS_INCLUDE_IN_SEARCH, include_in_search);
 }
 
 void LLViewerObject::setRegion(LLViewerRegion *regionp)
@@ -5442,8 +5410,8 @@ void	LLViewerObject::updateRegion(LLViewerRegion *regionp)
 
 bool LLViewerObject::specialHoverCursor() const
 {
-	return (mFlags & FLAGS_USE_PHYSICS)
-			|| (mFlags & FLAGS_HANDLE_TOUCH)
+	return flagUsePhysics()
+			|| flagHandleTouch()
 			|| (mClickAction != 0);
 }
 
@@ -5456,10 +5424,15 @@ void LLViewerObject::updateFlags(BOOL physics_changed)
 	gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
 	gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
 	gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID, getLocalID() );
-	gMessageSystem->addBOOLFast(_PREHASH_UsePhysics, usePhysics() );
+	gMessageSystem->addBOOLFast(_PREHASH_UsePhysics, flagUsePhysics() );
 	gMessageSystem->addBOOL("IsTemporary", flagTemporaryOnRez() );
 	gMessageSystem->addBOOL("IsPhantom", flagPhantom() );
-	gMessageSystem->addBOOL("CastsShadows", flagCastShadows() );
+
+	// stinson 02/28/2012 : This CastsShadows BOOL is no longer used in either the viewer or the simulator
+	// The simulator code does not even unpack this value when the message is received.
+	// This could be potentially hijacked in the future for another use should the urgent need arise.
+	gMessageSystem->addBOOL("CastsShadows", FALSE );
+
 	if (physics_changed)
 	{
 		gMessageSystem->nextBlock("ExtraPhysics");
@@ -5473,6 +5446,19 @@ void LLViewerObject::updateFlags(BOOL physics_changed)
 }
 
 BOOL LLViewerObject::setFlags(U32 flags, BOOL state)
+{
+	BOOL setit = setFlagsWithoutUpdate(flags, state);
+
+	// BUG: Sometimes viewer physics and simulator physics get
+	// out of sync.  To fix this, always send update to simulator.
+// 	if (setit)
+	{
+		updateFlags();
+	}
+	return setit;
+}
+
+BOOL LLViewerObject::setFlagsWithoutUpdate(U32 flags, BOOL state)
 {
 	BOOL setit = FALSE;
 	if (state)
@@ -5491,13 +5477,6 @@ BOOL LLViewerObject::setFlags(U32 flags, BOOL state)
 			setit = TRUE;
 		}
 	}
-
-	// BUG: Sometimes viewer physics and simulator physics get
-	// out of sync.  To fix this, always send update to simulator.
-// 	if (setit)
-	{
-		updateFlags();
-	}
 	return setit;
 }
 
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index 409108266eb841228609e3e8792e7d9c30397e2a..f8f63277504d7b4a236347528da18aede768c5b7 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -229,6 +229,8 @@ class LLViewerObject : public LLPrimitive, public LLRefCount, public LLGLUpdate
 	const LLUUID &getID() const						{ return mID; }
 	U32 getLocalID() const							{ return mLocalID; }
 	U32 getCRC() const								{ return mTotalCRC; }
+	S32 getListIndex() const						{ return mListIndex; }
+	void setListIndex(S32 idx)						{ mListIndex = idx; }
 
 	virtual BOOL isFlexible() const					{ return FALSE; }
 	virtual BOOL isSculpted() const 				{ return FALSE; }
@@ -308,7 +310,6 @@ class LLViewerObject : public LLPrimitive, public LLRefCount, public LLGLUpdate
 
 	inline void setRotation(const F32 x, const F32 y, const F32 z, BOOL damped = FALSE);
 	inline void setRotation(const LLQuaternion& quat, BOOL damped = FALSE);
-	void sendRotationUpdate() const;
 
 	/*virtual*/	void	setNumTEs(const U8 num_tes);
 	/*virtual*/	void	setTE(const U8 te, const LLTextureEntry &texture_entry);
@@ -471,26 +472,37 @@ class LLViewerObject : public LLPrimitive, public LLRefCount, public LLGLUpdate
 	BOOL			permCopy() const;	
 	BOOL			permMove() const;		
 	BOOL			permTransfer() const;
-	inline BOOL		usePhysics() const				{ return ((mFlags & FLAGS_USE_PHYSICS) != 0); }
+	inline BOOL		flagUsePhysics() const			{ return ((mFlags & FLAGS_USE_PHYSICS) != 0); }
+	inline BOOL		flagObjectAnyOwner() const		{ return ((mFlags & FLAGS_OBJECT_ANY_OWNER) != 0); }
+	inline BOOL		flagObjectYouOwner() const		{ return ((mFlags & FLAGS_OBJECT_YOU_OWNER) != 0); }
+	inline BOOL		flagObjectGroupOwned() const	{ return ((mFlags & FLAGS_OBJECT_GROUP_OWNED) != 0); }
+	inline BOOL		flagObjectOwnerModify() const	{ return ((mFlags & FLAGS_OBJECT_OWNER_MODIFY) != 0); }
+	inline BOOL		flagObjectModify() const		{ return ((mFlags & FLAGS_OBJECT_MODIFY) != 0); }
+	inline BOOL		flagObjectCopy() const			{ return ((mFlags & FLAGS_OBJECT_COPY) != 0); }
+	inline BOOL		flagObjectMove() const			{ return ((mFlags & FLAGS_OBJECT_MOVE) != 0); }
+	inline BOOL		flagObjectTransfer() const		{ return ((mFlags & FLAGS_OBJECT_TRANSFER) != 0); }
+	inline BOOL		flagObjectPermanent() const		{ return ((mFlags & FLAGS_AFFECTS_NAVMESH) != 0); }
+	inline BOOL		flagCharacter() const			{ return ((mFlags & FLAGS_CHARACTER) != 0); }
+	inline BOOL		flagVolumeDetect() const		{ return ((mFlags & FLAGS_VOLUME_DETECT) != 0); }
+	inline BOOL		flagIncludeInSearch() const     { return ((mFlags & FLAGS_INCLUDE_IN_SEARCH) != 0); }
 	inline BOOL		flagScripted() const			{ return ((mFlags & FLAGS_SCRIPTED) != 0); }
 	inline BOOL		flagHandleTouch() const			{ return ((mFlags & FLAGS_HANDLE_TOUCH) != 0); }
 	inline BOOL		flagTakesMoney() const			{ return ((mFlags & FLAGS_TAKES_MONEY) != 0); }
 	inline BOOL		flagPhantom() const				{ return ((mFlags & FLAGS_PHANTOM) != 0); }
 	inline BOOL		flagInventoryEmpty() const		{ return ((mFlags & FLAGS_INVENTORY_EMPTY) != 0); }
-	inline BOOL		flagCastShadows() const			{ return ((mFlags & FLAGS_CAST_SHADOWS) != 0); }
 	inline BOOL		flagAllowInventoryAdd() const	{ return ((mFlags & FLAGS_ALLOW_INVENTORY_DROP) != 0); }
-	inline BOOL		flagTemporary() const			{ return ((mFlags & FLAGS_TEMPORARY) != 0); }
 	inline BOOL		flagTemporaryOnRez() const		{ return ((mFlags & FLAGS_TEMPORARY_ON_REZ) != 0); }
 	inline BOOL		flagAnimSource() const			{ return ((mFlags & FLAGS_ANIM_SOURCE) != 0); }
 	inline BOOL		flagCameraSource() const		{ return ((mFlags & FLAGS_CAMERA_SOURCE) != 0); }
 	inline BOOL		flagCameraDecoupled() const		{ return ((mFlags & FLAGS_CAMERA_DECOUPLED) != 0); }
-	inline BOOL		flagObjectMove() const			{ return ((mFlags & FLAGS_OBJECT_MOVE) != 0); }
 
 	U8       getPhysicsShapeType() const;
 	inline F32      getPhysicsGravity() const       { return mPhysicsGravity; }
 	inline F32      getPhysicsFriction() const      { return mPhysicsFriction; }
 	inline F32      getPhysicsDensity() const       { return mPhysicsDensity; }
 	inline F32      getPhysicsRestitution() const   { return mPhysicsRestitution; }
+
+	bool            isPermanentEnforced() const;
 	
 	bool getIncludeInSearch() const;
 	void setIncludeInSearch(bool include_in_search);
@@ -507,6 +519,7 @@ class LLViewerObject : public LLPrimitive, public LLRefCount, public LLGLUpdate
 
 	void updateFlags(BOOL physics_changed = FALSE);
 	BOOL setFlags(U32 flag, BOOL state);
+	BOOL setFlagsWithoutUpdate(U32 flag, BOOL state);
 	void setPhysicsShapeType(U8 type);
 	void setPhysicsGravity(F32 gravity);
 	void setPhysicsFriction(F32 friction);
@@ -592,15 +605,20 @@ class LLViewerObject : public LLPrimitive, public LLRefCount, public LLGLUpdate
 	// Last total CRC received from sim, used for caching
 	U32				mTotalCRC;
 
+	// index into LLViewerObjectList::mActiveObjects or -1 if not in list
+	S32				mListIndex;
+
 	LLPointer<LLViewerTexture> *mTEImages;
 
 	// Selection, picking and rendering variables
 	U32				mGLName;			// GL "name" used by selection code
 	BOOL			mbCanSelect;		// true if user can select this object by clicking
 
+private:
 	// Grabbed from UPDATE_FLAGS
 	U32				mFlags;
 
+public:
 	// Sent to sim in UPDATE_FLAGS, received in ObjectPhysicsProperties
 	U8              mPhysicsShapeType;
 	F32             mPhysicsGravity;
@@ -717,7 +735,6 @@ class LLViewerObject : public LLPrimitive, public LLRefCount, public LLGLUpdate
 
 	F32				mTimeDilation;				// Time dilation sent with the object.
 	F32				mRotTime;					// Amount (in seconds) that object has rotated according to angular velocity (llSetTargetOmega)
-	LLQuaternion	mLastRot;					// last rotation received from the simulator
 
 	LLVOJointInfo*  mJointInfo;
 	U8				mState;	// legacy
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index beb68c1cbbc0eba763d7e6c9014d30df4004f17a..ea20950b36f1801505e535e4034ea10e1bbb0868 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -386,9 +386,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
 		}
 		else if (compressed)
 		{
-			U8							compbuffer[2048];
 			S32							uncompressed_length = 2048;
-			S32							compressed_length;
 			compressed_dp.reset();
 
 			U32 flags = 0;
@@ -397,24 +395,9 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
 				mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_UpdateFlags, flags, i);
 			}
 			
-			// I don't think we ever use this flag from the server.  DK 2010/12/09
-			if (flags & FLAGS_ZLIB_COMPRESSED)
-			{
-				//llinfos << "TEST: flags & FLAGS_ZLIB_COMPRESSED" << llendl;
-				compressed_length = mesgsys->getSizeFast(_PREHASH_ObjectData, i, _PREHASH_Data);
-				mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_Data, compbuffer, 0, i);
-				uncompressed_length = 2048;
-				uncompress(compressed_dpbuffer, (unsigned long *)&uncompressed_length,
-						   compbuffer, compressed_length);
-				compressed_dp.assignBuffer(compressed_dpbuffer, uncompressed_length);
-			}
-			else
-			{
-				uncompressed_length = mesgsys->getSizeFast(_PREHASH_ObjectData, i, _PREHASH_Data);
-				mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_Data, compressed_dpbuffer, 0, i);
-				compressed_dp.assignBuffer(compressed_dpbuffer, uncompressed_length);
-			}
-
+			uncompressed_length = mesgsys->getSizeFast(_PREHASH_ObjectData, i, _PREHASH_Data);
+			mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_Data, compressed_dpbuffer, 0, i);
+			compressed_dp.assignBuffer(compressed_dpbuffer, uncompressed_length);
 
 			if (update_type != OUT_TERSE_IMPROVED) // OUT_FULL_COMPRESSED only?
 			{
@@ -931,21 +914,30 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
 	LLViewerObject *objectp = NULL;	
 	
 	// Make a copy of the list in case something in idleUpdate() messes with it
-	std::vector<LLViewerObject*> idle_list;
-	
+	static std::vector<LLViewerObject*> idle_list;
+
+	U32 idle_count = 0;
+		
 	static LLFastTimer::DeclareTimer idle_copy("Idle Copy");
 
 	{
 		LLFastTimer t(idle_copy);
-		idle_list.reserve( mActiveObjects.size() );
-
- 		for (std::set<LLPointer<LLViewerObject> >::iterator active_iter = mActiveObjects.begin();
+		
+ 		for (std::vector<LLPointer<LLViewerObject> >::iterator active_iter = mActiveObjects.begin();
 			active_iter != mActiveObjects.end(); active_iter++)
 		{
 			objectp = *active_iter;
 			if (objectp)
 			{
-				idle_list.push_back( objectp );
+				if (idle_count >= idle_list.size())
+				{
+					idle_list.push_back( objectp );
+				}
+				else
+				{
+					idle_list[idle_count] = objectp;
+				}
+				++idle_count;
 			}
 			else
 			{	// There shouldn't be any NULL pointers in the list, but they have caused
@@ -955,10 +947,13 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
 		}
 	}
 
+	std::vector<LLViewerObject*>::iterator idle_end = idle_list.begin()+idle_count;
+
 	if (gSavedSettings.getBOOL("FreezeTime"))
 	{
+		
 		for (std::vector<LLViewerObject*>::iterator iter = idle_list.begin();
-			iter != idle_list.end(); iter++)
+			iter != idle_end; iter++)
 		{
 			objectp = *iter;
 			if (objectp->isAvatar())
@@ -970,17 +965,17 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
 	else
 	{
 		for (std::vector<LLViewerObject*>::iterator idle_iter = idle_list.begin();
-			idle_iter != idle_list.end(); idle_iter++)
+			idle_iter != idle_end; idle_iter++)
 		{
 			objectp = *idle_iter;
-			if (!objectp->idleUpdate(agent, world, frame_time))
+			if (objectp->idleUpdate(agent, world, frame_time))
 			{
-				//  If Idle Update returns false, kill object!
-				kill_list.push_back(objectp);
+				num_active_objects++;				
 			}
 			else
 			{
-				num_active_objects++;
+				//  If Idle Update returns false, kill object!
+				kill_list.push_back(objectp);
 			}
 		}
 		for (std::vector<LLViewerObject*>::iterator kill_iter = kill_list.begin();
@@ -1218,7 +1213,7 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp)
 	{
 		//llinfos << "Removing " << objectp->mID << " " << objectp->getPCodeString() << " from active list in cleanupReferences." << llendl;
 		objectp->setOnActiveList(FALSE);
-		mActiveObjects.erase(objectp);
+		removeFromActiveList(objectp);
 	}
 
 	if (objectp->isOnMap())
@@ -1395,6 +1390,26 @@ void LLViewerObjectList::cleanDeadObjects(BOOL use_timer)
 	mNumDeadObjects = 0;
 }
 
+void LLViewerObjectList::removeFromActiveList(LLViewerObject* objectp)
+{
+	S32 idx = objectp->getListIndex();
+	if (idx != -1)
+	{ //remove by moving last element to this object's position
+		llassert(mActiveObjects[idx] == objectp);
+		
+		objectp->setListIndex(-1);
+
+		S32 last_index = mActiveObjects.size()-1;
+
+		if (idx != last_index)
+		{
+			mActiveObjects[idx] = mActiveObjects[last_index];
+			mActiveObjects[idx]->setListIndex(idx);
+			mActiveObjects.pop_back();
+		}
+	}
+}
+
 void LLViewerObjectList::updateActive(LLViewerObject *objectp)
 {
 	LLMemType mt(LLMemType::MTYPE_OBJECT);
@@ -1409,13 +1424,29 @@ void LLViewerObjectList::updateActive(LLViewerObject *objectp)
 		if (active)
 		{
 			//llinfos << "Adding " << objectp->mID << " " << objectp->getPCodeString() << " to active list." << llendl;
-			mActiveObjects.insert(objectp);
-			objectp->setOnActiveList(TRUE);
+			S32 idx = objectp->getListIndex();
+			if (idx <= -1)
+			{
+				mActiveObjects.push_back(objectp);
+				objectp->setListIndex(mActiveObjects.size()-1);
+				objectp->setOnActiveList(TRUE);
+			}
+			else
+			{
+				llassert(idx < mActiveObjects.size());
+				llassert(mActiveObjects[idx] == objectp);
+
+				if (idx >= mActiveObjects.size() ||
+					mActiveObjects[idx] != objectp)
+				{
+					llwarns << "Invalid object list index detected!" << llendl;
+				}
+			}
 		}
 		else
 		{
 			//llinfos << "Removing " << objectp->mID << " " << objectp->getPCodeString() << " from active list." << llendl;
-			mActiveObjects.erase(objectp);
+			removeFromActiveList(objectp);
 			objectp->setOnActiveList(FALSE);
 		}
 	}
@@ -1489,6 +1520,10 @@ void LLViewerObjectList::onPhysicsFlagsFetchFailure(const LLUUID& object_id)
 	mPendingPhysicsFlags.erase(object_id);
 }
 
+static LLFastTimer::DeclareTimer FTM_SHIFT_OBJECTS("Shift Objects");
+static LLFastTimer::DeclareTimer FTM_PIPELINE_SHIFT("Pipeline Shift");
+static LLFastTimer::DeclareTimer FTM_REGION_SHIFT("Region Shift");
+
 void LLViewerObjectList::shiftObjects(const LLVector3 &offset)
 {
 	// This is called when we shift our origin when we cross region boundaries...
@@ -1500,6 +1535,8 @@ void LLViewerObjectList::shiftObjects(const LLVector3 &offset)
 		return;
 	}
 
+	LLFastTimer t(FTM_SHIFT_OBJECTS);
+
 	LLViewerObject *objectp;
 	for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter)
 	{
@@ -1516,8 +1553,15 @@ void LLViewerObjectList::shiftObjects(const LLVector3 &offset)
 		}
 	}
 
-	gPipeline.shiftObjects(offset);
-	LLWorld::getInstance()->shiftRegions(offset);
+	{
+		LLFastTimer t(FTM_PIPELINE_SHIFT);
+		gPipeline.shiftObjects(offset);
+	}
+
+	{
+		LLFastTimer t(FTM_REGION_SHIFT);
+		LLWorld::getInstance()->shiftRegions(offset);
+	}
 }
 
 void LLViewerObjectList::repartitionObjects()
diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h
index 64925f46aeacea27376e964bd3587eb326d5f1c6..9936432a71e288c7e3e73942725fbe24ea6e5486 100644
--- a/indra/newview/llviewerobjectlist.h
+++ b/indra/newview/llviewerobjectlist.h
@@ -118,7 +118,9 @@ class LLViewerObjectList
 
 	void dirtyAllObjectInventory();
 
+	void removeFromActiveList(LLViewerObject* objectp);
 	void updateActive(LLViewerObject *objectp);
+	
 	void updateAvatarVisibility();
 
 	// Selection related stuff
@@ -197,7 +199,7 @@ class LLViewerObjectList
 	typedef std::vector<LLPointer<LLViewerObject> > vobj_list_t;
 
 	vobj_list_t mObjects;
-	std::set<LLPointer<LLViewerObject> > mActiveObjects;
+	std::vector<LLPointer<LLViewerObject> > mActiveObjects;
 
 	vobj_list_t mMapObjects;
 
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index f3771e93d974ba4efd4fbded988e49497f9da092..05c7ef538103090efb6e059ec99f20613e2ca3b8 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1176,6 +1176,7 @@ void LLViewerRegion::getInfo(LLSD& info)
 void LLViewerRegion::getSimulatorFeatures(LLSD& sim_features)
 {
 	sim_features = mSimulatorFeatures;
+
 }
 
 void LLViewerRegion::setSimulatorFeatures(const LLSD& sim_features)
@@ -1486,7 +1487,8 @@ void LLViewerRegion::unpackRegionHandshake()
 		// all of our terrain stuff, by
 		if (compp->getParamsReady())
 		{
-			getLand().dirtyAllPatches();
+			//this line creates frame stalls on region crossing and removing it appears to have no effect
+			//getLand().dirtyAllPatches();
 		}
 		else
 		{
@@ -1514,8 +1516,10 @@ void LLViewerRegion::unpackRegionHandshake()
 
 void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
 {
+	capabilityNames.append("AgentState");
 	capabilityNames.append("AttachmentResources");
 	capabilityNames.append("AvatarPickerSearch");
+	capabilityNames.append("CharacterProperties");
 	capabilityNames.append("ChatSessionRequest");
 	capabilityNames.append("CopyInventoryFromNotecard");
 	capabilityNames.append("CreateInventoryCategory");
@@ -1544,8 +1548,10 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
 	capabilityNames.append("LandResources");
 	capabilityNames.append("MapLayer");
 	capabilityNames.append("MapLayerGod");
-	capabilityNames.append("MeshUploadFlag");
+	capabilityNames.append("MeshUploadFlag");	
+	capabilityNames.append("NavMeshGenerationStatus");
 	capabilityNames.append("NewFileAgentInventory");
+	capabilityNames.append("ObjectNavMeshProperties");
 	capabilityNames.append("ParcelPropertiesUpdate");
 	capabilityNames.append("ParcelMediaURLFilterList");
 	capabilityNames.append("ParcelNavigateMedia");
@@ -1555,6 +1561,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
 	capabilityNames.append("RemoteParcelRequest");
 	capabilityNames.append("RequestTextureDownload");
 	capabilityNames.append("ResourceCostSelected");
+	capabilityNames.append("RetrieveNavMeshSrc");
 	capabilityNames.append("SearchStatRequest");
 	capabilityNames.append("SearchStatTracking");
 	capabilityNames.append("SendPostcard");
@@ -1566,6 +1573,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
 	capabilityNames.append("SetDisplayName");
 	capabilityNames.append("SimConsoleAsync");
 	capabilityNames.append("StartGroupProposal");
+	capabilityNames.append("TerrainNavMeshProperties");
 	capabilityNames.append("TextureStats");
 	capabilityNames.append("UntrustedSimulatorMessage");
 	capabilityNames.append("UpdateAgentInformation");
@@ -1580,7 +1588,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
 	capabilityNames.append("ViewerMetrics");
 	capabilityNames.append("ViewerStartAuction");
 	capabilityNames.append("ViewerStats");
-	
+
 	// Please add new capabilities alphabetically to reduce
 	// merge conflicts.
 }
@@ -1819,7 +1827,10 @@ void LLViewerRegion::getNeighboringRegions( std::vector<LLViewerRegion*>& unique
 {
 	mImpl->mLandp->getNeighboringRegions( uniqueRegions );
 }
-
+void LLViewerRegion::getNeighboringRegionsStatus( std::vector<S32>& regions )
+{
+	mImpl->mLandp->getNeighboringRegionsStatus( regions );
+}
 void LLViewerRegion::showReleaseNotes()
 {
 	std::string url = this->getCapability("ServerReleaseNotes");
@@ -1852,4 +1863,9 @@ bool LLViewerRegion::meshRezEnabled() const
 				mSimulatorFeatures["MeshRezEnabled"].asBoolean());
 }
 
+bool LLViewerRegion::dynamicPathfindingEnabled() const
+{
+	return ( mSimulatorFeatures.has("DynamicPathfindingEnabled") &&
+			 mSimulatorFeatures["DynamicPathfindingEnabled"].asBoolean());
+}
 
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index 7280c7f2e6b9b44102cfb47350f1e999e0039a95..c9fffaf30e4abff15de3dbc7f31bddf8bef0cbbe 100644
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -286,6 +286,9 @@ class LLViewerRegion: public LLCapabilityProvider // implements this interface
 	void getSimulatorFeatures(LLSD& info);	
 	void setSimulatorFeatures(const LLSD& info);
 
+	
+	bool dynamicPathfindingEnabled() const;
+
 	typedef enum
 	{
 		CACHE_MISS_TYPE_FULL = 0,
@@ -326,6 +329,7 @@ class LLViewerRegion: public LLCapabilityProvider // implements this interface
 	bool objectsCrossParcel(const std::vector<LLBBox>& boxes) const;
 
 	void getNeighboringRegions( std::vector<LLViewerRegion*>& uniqueRegions );
+	void getNeighboringRegionsStatus( std::vector<S32>& regions );
 	
 public:
 	struct CompareDistance
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index a6c564a6a10e7d97c6f406058d57cbd6da522656..d9918e633b889c7644d6244f6a91db5a620037a6 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -143,6 +143,8 @@ LLGLSLShader		gUnderWaterProgram;
 
 //interface shaders
 LLGLSLShader		gHighlightProgram;
+LLGLSLShader		gPathfindingProgram;
+LLGLSLShader		gPathfindingNoNormalsProgram;
 
 //avatar shader handles
 LLGLSLShader		gAvatarProgram;
@@ -662,6 +664,8 @@ void LLViewerShaderMgr::unloadShaders()
 	gClipProgram.unload();
 	gAlphaMaskProgram.unload();
 	gUIProgram.unload();
+	gPathfindingProgram.unload();
+	gPathfindingNoNormalsProgram.unload();
 	gCustomAlphaProgram.unload();
 	gGlowCombineProgram.unload();
 	gSplatTextureRectProgram.unload();
@@ -2604,6 +2608,26 @@ BOOL LLViewerShaderMgr::loadShadersInterface()
 		success = gUIProgram.createShader(NULL, NULL);
 	}
 
+	if (success)
+	{
+		gPathfindingProgram.mName = "Pathfinding Shader";
+		gPathfindingProgram.mShaderFiles.clear();
+		gPathfindingProgram.mShaderFiles.push_back(make_pair("interface/pathfindingV.glsl", GL_VERTEX_SHADER_ARB));
+		gPathfindingProgram.mShaderFiles.push_back(make_pair("interface/pathfindingF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gPathfindingProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE];
+		success = gPathfindingProgram.createShader(NULL, NULL);
+	}
+
+	if (success)
+	{
+		gPathfindingNoNormalsProgram.mName = "PathfindingNoNormals Shader";
+		gPathfindingNoNormalsProgram.mShaderFiles.clear();
+		gPathfindingNoNormalsProgram.mShaderFiles.push_back(make_pair("interface/pathfindingNoNormalV.glsl", GL_VERTEX_SHADER_ARB));
+		gPathfindingNoNormalsProgram.mShaderFiles.push_back(make_pair("interface/pathfindingF.glsl", GL_FRAGMENT_SHADER_ARB));
+		gPathfindingNoNormalsProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE];
+		success = gPathfindingNoNormalsProgram.createShader(NULL, NULL);
+	}
+
 	if (success)
 	{
 		gCustomAlphaProgram.mName = "Custom Alpha Shader";
diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h
index 8f7ff8dd2f7cdac011344848f4100c0ff9e25bc4..d6dd645e8cc483473a986febaf52dc00be10a24a 100644
--- a/indra/newview/llviewershadermgr.h
+++ b/indra/newview/llviewershadermgr.h
@@ -301,6 +301,8 @@ extern LLGLSLShader			gGlowExtractProgram;
 
 //interface shaders
 extern LLGLSLShader			gHighlightProgram;
+extern LLGLSLShader			gPathfindingProgram;
+extern LLGLSLShader			gPathfindingNoNormalsProgram;
 
 // avatar shader handles
 extern LLGLSLShader			gAvatarProgram;
diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp
index 0be016e5bb090ee31a9e44718f6c30272fcfe03f..d1c6b7ea7913419608a6e1696e1c796b78dd1d17 100755
--- a/indra/newview/llviewerstats.cpp
+++ b/indra/newview/llviewerstats.cpp
@@ -233,6 +233,9 @@ LLViewerStats::LLViewerStats() :
 	mSimSimPhysicsStepMsec("simsimphysicsstepmsec"),
 	mSimSimPhysicsShapeUpdateMsec("simsimphysicsshapeupdatemsec"),
 	mSimSimPhysicsOtherMsec("simsimphysicsothermsec"),
+	mSimSimAIStepMsec("simsimaistepmsec"),
+	mSimSimSkippedSilhouetteSteps("simsimskippedsilhouettesteps"),
+	mSimSimPctSteppedCharacters("simsimpctsteppedcharacters"),
 	mSimAgentMsec("simagentmsec"),
 	mSimImagesMsec("simimagesmsec"),
 	mSimScriptMsec("simscriptmsec"),
@@ -244,6 +247,7 @@ LLViewerStats::LLViewerStats() :
 	mSimObjects("simobjects"),
 	mSimActiveObjects("simactiveobjects"),
 	mSimActiveScripts("simactivescripts"),
+	mSimPctScriptsRun("simpctscriptsrun"),
 	mSimInPPS("siminpps"),
 	mSimOutPPS("simoutpps"),
 	mSimPendingDownloads("simpendingdownloads"),
diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h
index 750d963f69e6792310034b5c5fe85e5f4084a616..554e4d647ee17dc546792471bd6709de9f453252 100755
--- a/indra/newview/llviewerstats.h
+++ b/indra/newview/llviewerstats.h
@@ -71,6 +71,10 @@ class LLViewerStats : public LLSingleton<LLViewerStats>
 	LLStat mSimSimPhysicsShapeUpdateMsec;
 	LLStat mSimSimPhysicsOtherMsec;
 
+	LLStat mSimSimAIStepMsec;
+	LLStat mSimSimSkippedSilhouetteSteps;
+	LLStat mSimSimPctSteppedCharacters;
+
 	LLStat mSimAgentMsec;
 	LLStat mSimImagesMsec;
 	LLStat mSimScriptMsec;
@@ -83,6 +87,7 @@ class LLViewerStats : public LLSingleton<LLViewerStats>
 	LLStat mSimObjects;
 	LLStat mSimActiveObjects;
 	LLStat mSimActiveScripts;
+	LLStat mSimPctScriptsRun;
 
 	LLStat mSimInPPS;
 	LLStat mSimOutPPS;
diff --git a/indra/newview/llviewervisualparam.h b/indra/newview/llviewervisualparam.h
index dd7751acd7bba704b4eca5111fa29a421ad8b293..3bc95cbfbfbf42d5963232cd744cfbc08807270f 100644
--- a/indra/newview/llviewervisualparam.h
+++ b/indra/newview/llviewervisualparam.h
@@ -83,11 +83,11 @@ class LLViewerVisualParam : public LLVisualParam
 
 	// New Virtual functions
 	virtual F32					getTotalDistortion() = 0;
-	virtual const LLVector3&	getAvgDistortion() = 0;
+	virtual const LLVector4a&	getAvgDistortion() = 0;
 	virtual F32					getMaxDistortion() = 0;
-	virtual LLVector3			getVertexDistortion(S32 index, LLPolyMesh *mesh) = 0;
-	virtual const LLVector3*	getFirstDistortion(U32 *index, LLPolyMesh **mesh) = 0;
-	virtual const LLVector3*	getNextDistortion(U32 *index, LLPolyMesh **mesh) = 0;
+	virtual LLVector4a			getVertexDistortion(S32 index, LLPolyMesh *mesh) = 0;
+	virtual const LLVector4a*	getFirstDistortion(U32 *index, LLPolyMesh **mesh) = 0;
+	virtual const LLVector4a*	getNextDistortion(U32 *index, LLPolyMesh **mesh) = 0;
 	
 	// interface methods
 	F32					getDisplayOrder() const		{ return getInfo()->mEditGroupDisplayOrder; }
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
old mode 100755
new mode 100644
index 7afb13547085fc9292929db3ee60d17128f7b75e..af2eec9ba8961b43c122cf261081d85d04a67e60
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -126,6 +126,7 @@
 #include "llmorphview.h"
 #include "llmoveview.h"
 #include "llnavigationbar.h"
+#include "llpanelpathfindingrebakenavmesh.h"
 #include "llpaneltopinfobar.h"
 #include "llpopupview.h"
 #include "llpreviewtexture.h"
@@ -1921,11 +1922,16 @@ void LLViewerWindow::initWorldUI()
 		getRootView()->addChild(gHUDView);
 	}
 
-	LLPanel* panel_ssf_container = getRootView()->getChild<LLPanel>("stand_stop_flying_container");
+	LLPanel* panel_ssf_container = getRootView()->getChild<LLPanel>("state_management_buttons_container");
+
 	LLPanelStandStopFlying* panel_stand_stop_flying	= LLPanelStandStopFlying::getInstance();
 	panel_ssf_container->addChild(panel_stand_stop_flying);
-	panel_ssf_container->setVisible(TRUE);
 
+	LLPanelPathfindingRebakeNavmesh *panel_rebake_navmesh = LLPanelPathfindingRebakeNavmesh::getInstance();
+	panel_ssf_container->addChild(panel_rebake_navmesh);
+
+	panel_ssf_container->setVisible(TRUE);
+	
 	// Load and make the toolbars visible
 	// Note: we need to load the toolbars only *after* the user is logged in and IW
 	if (gToolBarView)
@@ -3166,8 +3172,7 @@ void LLViewerWindow::updateLayout()
 			||	(tool != LLToolPie::getInstance()						// not default tool
 				&& tool != LLToolCompGun::getInstance()					// not coming out of mouselook
 				&& !suppress_toolbox									// not override in third person
-				&& LLToolMgr::getInstance()->getCurrentToolset() != gFaceEditToolset	// not special mode
-				&& LLToolMgr::getInstance()->getCurrentToolset() != gMouselookToolset
+				&& LLToolMgr::getInstance()->getCurrentToolset()->isShowFloaterTools()
 				&& (!captor || dynamic_cast<LLView*>(captor) != NULL)))						// not dragging
 		{
 			// Force floater tools to be visible (unless minimized)
@@ -3521,8 +3526,11 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
 					{
 						LLSelectNode* nodep = *iter;
 						LLViewerObject* object = nodep->getObject();
+						LLViewerObject *root_object = (object == NULL) ? NULL : object->getRootEdit();
 						BOOL this_object_movable = FALSE;
-						if (object->permMove() && (object->permModify() || selecting_linked_set))
+						if (object->permMove() && !object->isPermanentEnforced() &&
+							((root_object == NULL) || !root_object->isPermanentEnforced()) &&
+							(object->permModify() || selecting_linked_set))
 						{
 							moveable_object_selected = TRUE;
 							this_object_movable = TRUE;
@@ -4760,8 +4768,11 @@ void LLViewerWindow::requestResolutionUpdate()
 	mResDirty = true;
 }
 
+static LLFastTimer::DeclareTimer FTM_WINDOW_CHECK_SETTINGS("Window Settings");
+
 void LLViewerWindow::checkSettings()
 {
+	LLFastTimer t(FTM_WINDOW_CHECK_SETTINGS);
 	if (mStatesDirty)
 	{
 		gGL.refreshState();
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index f8502b17cb1904afb1c9cdbb58cc68e0b754985b..34484ffa6cce4877bc7a3b3bd9edb1d8c566e809 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -817,6 +817,7 @@ LLVOAvatar::~LLVOAvatar()
 	lldebugs << "LLVOAvatar Destructor (0x" << this << ") id:" << mID << llendl;
 
 	mRoot.removeAllChildren();
+	mJointMap.clear();
 
 	deleteAndClearArray(mSkeleton);
 	deleteAndClearArray(mCollisionVolumes);
@@ -1459,8 +1460,6 @@ void LLVOAvatar::onShift(const LLVector4a& shift_vector)
 	const LLVector3& shift = reinterpret_cast<const LLVector3&>(shift_vector);
 	mLastAnimExtents[0] += shift;
 	mLastAnimExtents[1] += shift;
-	mNeedsImpostorUpdate = TRUE;
-	mNeedsAnimUpdate = TRUE;
 }
 
 void LLVOAvatar::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax)
@@ -1934,6 +1933,7 @@ void LLVOAvatar::buildCharacter()
 	// remove all of mRoot's children
 	//-------------------------------------------------------------------------
 	mRoot.removeAllChildren();
+	mJointMap.clear();
 	mIsBuilt = FALSE;
 
 	//-------------------------------------------------------------------------
@@ -2390,7 +2390,7 @@ S32 LLVOAvatar::setTETexture(const U8 te, const LLUUID& uuid)
 	}
 }
 
-static LLFastTimer::DeclareTimer FTM_AVATAR_UPDATE("Update Avatar");
+static LLFastTimer::DeclareTimer FTM_AVATAR_UPDATE("Avatar Update");
 static LLFastTimer::DeclareTimer FTM_JOINT_UPDATE("Update Joints");
 
 //------------------------------------------------------------------------
@@ -2692,7 +2692,7 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update)
 
 	if (isImpostor() && !mNeedsImpostorUpdate)
 	{
-		LLVector4a ext[2];
+		LL_ALIGN_16(LLVector4a ext[2]);
 		F32 distance;
 		LLVector3 angle;
 
@@ -5137,7 +5137,20 @@ const LLUUID& LLVOAvatar::getID() const
 // RN: avatar joints are multi-rooted to include screen-based attachments
 LLJoint *LLVOAvatar::getJoint( const std::string &name )
 {
-	LLJoint* jointp = mRoot.findJoint(name);
+	joint_map_t::iterator iter = mJointMap.find(name);
+
+	LLJoint* jointp = NULL;
+
+	if (iter == mJointMap.end() || iter->second == NULL)
+	{ //search for joint and cache found joint in lookup table
+		jointp = mRoot.findJoint(name);
+		mJointMap[name] = jointp;
+	}
+	else
+	{ //return cached pointer
+		jointp = iter->second;
+	}
+
 	return jointp;
 }
 
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 6fb56a4c0bb2bf70a0134746170612c59e665079..f5692bb52f73d3885f1b911e7c4b69a1768984ed 100755
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -93,6 +93,16 @@ class LLVOAvatar :
  **/
 
 public:
+	void* operator new(size_t size)
+	{
+		return ll_aligned_malloc_16(size);
+	}
+
+	void operator delete(void* ptr)
+	{
+		ll_aligned_free_16(ptr);
+	}
+
 	LLVOAvatar(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
 	virtual void		markDead();
 	static void			initClass(); // Initialize data that's only init'd once per class.
@@ -215,7 +225,7 @@ class LLVOAvatar :
 	bool isBuilt() const { return mIsBuilt; }
 
 private: //aligned members
-	LLVector4a	mImpostorExtents[2];
+	LL_ALIGN_16(LLVector4a	mImpostorExtents[2]);
 
 private:
 	BOOL			mSupportsAlphaLayers; // For backwards compatibility, TRUE for 1.23+ clients
@@ -356,6 +366,10 @@ class LLVOAvatar :
 
 	LLVector3			mHeadOffset; // current head position
 	LLViewerJoint		mRoot;
+
+	typedef std::map<std::string, LLJoint*> joint_map_t;
+	joint_map_t			mJointMap;
+
 protected:
 	static BOOL			parseSkeletonFile(const std::string& filename);
 	void				buildCharacter();
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index d28ff3e28d8c97874a85d6366b6975d547a716a8..76131727c4e56f14623c518dbd0fb9ca0bb7741e 100755
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -795,7 +795,7 @@ void LLVOAvatarSelf::stopMotionFromSource(const LLUUID& source_id)
 	LLViewerObject* object = gObjectList.findObject(source_id);
 	if (object)
 	{
-		object->mFlags &= ~FLAGS_ANIM_SOURCE;
+		object->setFlagsWithoutUpdate(FLAGS_ANIM_SOURCE, FALSE);
 	}
 }
 
diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h
index 543891ca632366a759fdcaa83b12e60449c330b7..2b273e616c963a4fc926c7a353726613f83e10fa 100755
--- a/indra/newview/llvoavatarself.h
+++ b/indra/newview/llvoavatarself.h
@@ -49,6 +49,16 @@ class LLVOAvatarSelf :
  **/
 
 public:
+	void* operator new(size_t size)
+	{
+		return ll_aligned_malloc_16(size);
+	}
+
+	void operator delete(void* ptr)
+	{
+		ll_aligned_free_16(ptr);
+	}
+
 	LLVOAvatarSelf(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
 	virtual 				~LLVOAvatarSelf();
 	virtual void			markDead();
diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp
index 44968342bf0fc430ecee93fbe229d3859e57b353..5ad9ccc9af3937c2c8256656acdd1401822c729e 100644
--- a/indra/newview/llvograss.cpp
+++ b/indra/newview/llvograss.cpp
@@ -622,7 +622,7 @@ void LLGrassPartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_count
 	mFaceList.clear();
 
 	LLViewerCamera* camera = LLViewerCamera::getInstance();
-	for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
+	for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
 	{
 		LLDrawable* drawablep = *i;
 		
diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp
index e21358b65a29638e18af95af7a5f5877969ba883..9cce68fff69796cfedec00e8539e66ff1970d3c2 100644
--- a/indra/newview/llvopartgroup.cpp
+++ b/indra/newview/llvopartgroup.cpp
@@ -52,8 +52,7 @@ LLPointer<LLVertexBuffer> LLVOPartGroup::sVB = NULL;
 S32 LLVOPartGroup::sVBSlotFree[];
 S32* LLVOPartGroup::sVBSlotCursor = NULL;
 
-//static
-void LLVOPartGroup::restoreGL()
+void LLVOPartGroup::initClass()
 {
 	for (S32 i = 0; i < LL_MAX_PARTICLE_COUNT; ++i)
 	{
@@ -61,7 +60,11 @@ void LLVOPartGroup::restoreGL()
 	}
 
 	sVBSlotCursor = sVBSlotFree;
+}
 
+//static
+void LLVOPartGroup::restoreGL()
+{
 	sVB = new LLVertexBuffer(VERTEX_DATA_MASK, GL_STREAM_DRAW_ARB);
 	U32 count = LL_MAX_PARTICLE_COUNT;
 	sVB->allocateBuffer(count*4, count*6, true);
@@ -554,7 +557,7 @@ void LLParticlePartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_co
 	mFaceList.clear();
 
 	LLViewerCamera* camera = LLViewerCamera::getInstance();
-	for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
+	for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
 	{
 		LLDrawable* drawablep = *i;
 		
@@ -626,7 +629,7 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group)
 		LLFace* facep = *i;
 		LLAlphaObject* object = (LLAlphaObject*) facep->getViewerObject();
 
-		if (facep->getIndicesStart() == 0xFFFFFFFF)
+		if (!facep->isState(LLFace::PARTICLE))
 		{ //set the indices of this face
 			S32 idx = LLVOPartGroup::findAvailableVBSlot();
 			if (idx >= 0)
@@ -635,6 +638,7 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group)
 				facep->setIndicesIndex(idx*6);
 				facep->setVertexBuffer(LLVOPartGroup::sVB);
 				facep->setPoolType(LLDrawPool::POOL_ALPHA);
+				facep->setState(LLFace::PARTICLE);
 			}
 			else
 			{
diff --git a/indra/newview/llvopartgroup.h b/indra/newview/llvopartgroup.h
index 6160bceb24a867e869b865086e02391bf6e66c33..43b2844f07b5e3409fec28e51afdae19366e3882 100644
--- a/indra/newview/llvopartgroup.h
+++ b/indra/newview/llvopartgroup.h
@@ -45,6 +45,7 @@ class LLVOPartGroup : public LLAlphaObject
 	static S32 sVBSlotFree[LL_MAX_PARTICLE_COUNT];
 	static S32* sVBSlotCursor;
 
+	static void initClass();
 	static void restoreGL();
 	static void destroyGL();
 	static S32 findAvailableVBSlot();
diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp
index 3556bde9a87843f13b6c69220f5a2e7b7045d082..337ddfb24d11ceecb24603c1f65f0c876b351319 100644
--- a/indra/newview/llvotree.cpp
+++ b/indra/newview/llvotree.cpp
@@ -374,7 +374,7 @@ BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
 		// *TODO: I don't know what's so special about trees
 		// that they don't get REBUILD_POSITION automatically
 		// at a higher level.
-		const LLVector3 &this_position = getPositionAgent();
+		const LLVector3 &this_position = getPositionRegion();
 		if (this_position != mLastPosition)
 		{
 			gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_POSITION);
@@ -843,10 +843,10 @@ void LLVOTree::updateMesh()
 	LLMatrix4 matrix;
 	
 	// Translate to tree base  HACK - adjustment in Z plants tree underground
-	const LLVector3 &pos_agent = getPositionAgent();
+	const LLVector3 &pos_region = getPositionRegion();
 	//gGL.translatef(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ] - 0.1f);
 	LLMatrix4 trans_mat;
-	trans_mat.setTranslation(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ] - 0.1f);
+	trans_mat.setTranslation(pos_region.mV[VX], pos_region.mV[VY], pos_region.mV[VZ] - 0.1f);
 	trans_mat *= matrix;
 	
 	// Rotate to tree position and bend for current trunk/wind
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 7a2f6bc35ba047ad557110974ae7b2ab9a83b59a..0e02b972fb40b3932b16c4aa889137e7f1e32ef9 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -639,8 +639,8 @@ BOOL LLVOVolume::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
 {
 	LLViewerObject::idleUpdate(agent, world, time);
 
-	static LLFastTimer::DeclareTimer ftm("Volume Idle");
-	LLFastTimer t(ftm);
+	//static LLFastTimer::DeclareTimer ftm("Volume Idle");
+	//LLFastTimer t(ftm);
 
 	if (mDead || mDrawable.isNull())
 	{
@@ -3846,82 +3846,85 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons
 		
 		LLVector4a* weight = vol_face.mWeights;
 
-		LLMatrix4a bind_shape_matrix;
-		bind_shape_matrix.loadu(skin->mBindShapeMatrix);
-
-		LLVector4a* pos = dst_face.mPositions;
-
+		if ( weight )
 		{
-			LLFastTimer t(FTM_SKIN_RIGGED);
+			LLMatrix4a bind_shape_matrix;
+			bind_shape_matrix.loadu(skin->mBindShapeMatrix);
+
+			LLVector4a* pos = dst_face.mPositions;
 
-			for (U32 j = 0; j < dst_face.mNumVertices; ++j)
 			{
-				LLMatrix4a final_mat;
-				final_mat.clear();
+				LLFastTimer t(FTM_SKIN_RIGGED);
 
-				S32 idx[4];
+				for (U32 j = 0; j < dst_face.mNumVertices; ++j)
+				{
+					LLMatrix4a final_mat;
+					final_mat.clear();
 
-				LLVector4 wght;
+					S32 idx[4];
 
-				F32 scale = 0.f;
-				for (U32 k = 0; k < 4; k++)
-				{
-					F32 w = weight[j][k];
+					LLVector4 wght;
 
-					idx[k] = (S32) floorf(w);
-					wght[k] = w - floorf(w);
-					scale += wght[k];
-				}
+					F32 scale = 0.f;
+					for (U32 k = 0; k < 4; k++)
+					{
+						F32 w = weight[j][k];
 
-				wght *= 1.f/scale;
+						idx[k] = (S32) floorf(w);
+						wght[k] = w - floorf(w);
+						scale += wght[k];
+					}
 
-				for (U32 k = 0; k < 4; k++)
-				{
-					F32 w = wght[k];
+					wght *= 1.f/scale;
 
-					LLMatrix4a src;
-					src.setMul(mp[idx[k]], w);
+					for (U32 k = 0; k < 4; k++)
+					{
+						F32 w = wght[k];
 
-					final_mat.add(src);
-				}
+						LLMatrix4a src;
+						src.setMul(mp[idx[k]], w);
+
+						final_mat.add(src);
+					}
 
 				
-				LLVector4a& v = vol_face.mPositions[j];
-				LLVector4a t;
-				LLVector4a dst;
-				bind_shape_matrix.affineTransform(v, t);
-				final_mat.affineTransform(t, dst);
-				pos[j] = dst;
-			}
+					LLVector4a& v = vol_face.mPositions[j];
+					LLVector4a t;
+					LLVector4a dst;
+					bind_shape_matrix.affineTransform(v, t);
+					final_mat.affineTransform(t, dst);
+					pos[j] = dst;
+				}
 
-			//update bounding box
-			LLVector4a& min = dst_face.mExtents[0];
-			LLVector4a& max = dst_face.mExtents[1];
+				//update bounding box
+				LLVector4a& min = dst_face.mExtents[0];
+				LLVector4a& max = dst_face.mExtents[1];
 
-			min = pos[0];
-			max = pos[1];
+				min = pos[0];
+				max = pos[1];
 
-			for (U32 j = 1; j < dst_face.mNumVertices; ++j)
-			{
-				min.setMin(min, pos[j]);
-				max.setMax(max, pos[j]);
-			}
+				for (U32 j = 1; j < dst_face.mNumVertices; ++j)
+				{
+					min.setMin(min, pos[j]);
+					max.setMax(max, pos[j]);
+				}
 
-			dst_face.mCenter->setAdd(dst_face.mExtents[0], dst_face.mExtents[1]);
-			dst_face.mCenter->mul(0.5f);
+				dst_face.mCenter->setAdd(dst_face.mExtents[0], dst_face.mExtents[1]);
+				dst_face.mCenter->mul(0.5f);
 
-		}
+			}
 
-		{
-			LLFastTimer t(FTM_RIGGED_OCTREE);
-			delete dst_face.mOctree;
-			dst_face.mOctree = NULL;
+			{
+				LLFastTimer t(FTM_RIGGED_OCTREE);
+				delete dst_face.mOctree;
+				dst_face.mOctree = NULL;
 
-			LLVector4a size;
-			size.setSub(dst_face.mExtents[1], dst_face.mExtents[0]);
-			size.splat(size.getLength3().getF32()*0.5f);
+				LLVector4a size;
+				size.setSub(dst_face.mExtents[1], dst_face.mExtents[0]);
+				size.splat(size.getLength3().getF32()*0.5f);
 			
-			dst_face.createOctree(1.f);
+				dst_face.createOctree(1.f);
+			}
 		}
 	}
 }
@@ -4236,7 +4239,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
 		LLFastTimer t(FTM_REBUILD_VOLUME_FACE_LIST);
 
 		//get all the faces into a list
-		for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
+		for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); drawable_iter != group->getDataEnd(); ++drawable_iter)
 		{
 			LLDrawable* drawablep = *drawable_iter;
 		
@@ -4642,7 +4645,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
 	if (!LLPipeline::sDelayVBUpdate)
 	{
 		//drawables have been rebuilt, clear rebuild status
-		for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
+		for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); drawable_iter != group->getDataEnd(); ++drawable_iter)
 		{
 			LLDrawable* drawablep = *drawable_iter;
 			drawablep->clearState(LLDrawable::REBUILD_ALL);
@@ -4682,7 +4685,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
 		
 		std::set<LLVertexBuffer*> mapped_buffers;
 
-		for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
+		for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); drawable_iter != group->getDataEnd(); ++drawable_iter)
 		{
 			LLDrawable* drawablep = *drawable_iter;
 
@@ -4706,8 +4709,14 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
 						if (buff)
 						{
 							llassert(!face->isState(LLFace::RIGGED));
-							face->getGeometryVolume(*volume, face->getTEOffset(), 
-								vobj->getRelativeXform(), vobj->getRelativeXformInvTrans(), face->getGeomIndex());
+
+							if (!face->getGeometryVolume(*volume, face->getTEOffset(), 
+								vobj->getRelativeXform(), vobj->getRelativeXformInvTrans(), face->getGeomIndex()))
+							{ //something's gone wrong with the vertex buffer accounting, rebuild this group 
+								group->dirtyGeom();
+								gPipeline.markRebuild(group, TRUE);
+							}
+
 
 							if (buff->isLocked())
 							{
@@ -4744,7 +4753,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
 		if(num_mapped_veretx_buffer != LLVertexBuffer::sMappedCount) 
 		{
 			llwarns << "Not all mapped vertex buffers are unmapped!" << llendl ; 
-			for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
+			for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); drawable_iter != group->getDataEnd(); ++drawable_iter)
 			{
 				LLDrawable* drawablep = *drawable_iter;
 				for (S32 i = 0; i < drawablep->getNumFaces(); ++i)
@@ -5041,8 +5050,11 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
 
 					llassert(!facep->isState(LLFace::RIGGED));
 
-					facep->getGeometryVolume(*volume, te_idx, 
-						vobj->getRelativeXform(), vobj->getRelativeXformInvTrans(), index_offset,true);
+					if (!facep->getGeometryVolume(*volume, te_idx, 
+						vobj->getRelativeXform(), vobj->getRelativeXformInvTrans(), index_offset,true))
+					{
+						llwarns << "Failed to get geometry for face!" << llendl;
+					}
 
 					if (drawablep->isState(LLDrawable::ANIMATED_CHILD))
 					{
@@ -5212,7 +5224,7 @@ void LLGeometryManager::addGeometryCount(LLSpatialGroup* group, U32 &vertex_coun
 
 	//for each drawable
 
-	for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
+	for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); drawable_iter != group->getDataEnd(); ++drawable_iter)
 	{
 		LLDrawable* drawablep = *drawable_iter;
 		
diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h
index 29e782e9dd885fee0c5c72ce45686c8eded16401..8cb69930beae150407c7a59b86331e6dd31b69c8 100644
--- a/indra/newview/llvovolume.h
+++ b/indra/newview/llvovolume.h
@@ -68,7 +68,7 @@ class LLVolumeInterface
 public:
 	virtual ~LLVolumeInterface() { }
 	virtual LLVolumeInterfaceType getInterfaceType() const = 0;
-	virtual BOOL doIdleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) = 0;
+	virtual void doIdleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) = 0;
 	virtual BOOL doUpdateGeometry(LLDrawable *drawable) = 0;
 	virtual LLVector3 getPivotPosition() const = 0;
 	virtual void onSetVolume(const LLVolumeParams &volume_params, const S32 detail) = 0;
diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp
index d2d48dc68fac33321199b62d91bfc3111dffe9a5..83337b386dec52fae4b8463f94d637d950e43260 100644
--- a/indra/newview/llweb.cpp
+++ b/indra/newview/llweb.cpp
@@ -185,8 +185,8 @@ std::string LLWeb::expandURLSubstitutions(const std::string &url,
 	substitution["VERSION_PATCH"] = LLVersionInfo::getPatch();
 	substitution["VERSION_BUILD"] = LLVersionInfo::getBuild();
 	substitution["CHANNEL"] = LLVersionInfo::getChannel();
-	substitution["GRID"] = LLGridManager::getInstance()->getGridLabel();
-	substitution["GRID_LOWERCASE"] = utf8str_tolower(LLGridManager::getInstance()->getGridLabel());
+	substitution["GRID"] = LLGridManager::getInstance()->getGridId();
+	substitution["GRID_LOWERCASE"] = utf8str_tolower(LLGridManager::getInstance()->getGridId());
 	substitution["OS"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple();
 	substitution["SESSION_ID"] = gAgent.getSessionID();
 	substitution["FIRST_LOGIN"] = gAgent.isFirstLogin();
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index b061c90d98c6d8b126e63dd04f3676956ed48c6b..78ee3e4fd98d8da4c7834c5cf1a8ac46d4556eb5 100644
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -657,7 +657,10 @@ void LLWorld::updateRegions(F32 max_update_time)
 		if (did_one && max_time <= 0.f)
 			break;
 		max_time = llmin(max_time, max_update_time*.1f);
-		did_one |= regionp->idleUpdate(max_update_time);
+		if (regionp->idleUpdate(max_update_time))
+		{
+			did_one = TRUE;
+		}
 	}
 }
 
@@ -837,6 +840,9 @@ void LLWorld::updateWaterObjects()
 	}
 	mHoleWaterObjects.clear();
 
+	// Use the water height of the region we're on for areas where there is no region
+	F32 water_height = gAgent.getRegion()->getWaterHeight();
+
 	// Now, get a list of the holes
 	S32 x, y;
 	for (x = min_x; x <= max_x; x += rwidth)
@@ -845,12 +851,12 @@ void LLWorld::updateWaterObjects()
 		{
 			U64 region_handle = to_region_handle(x, y);
 			if (!getRegionFromHandle(region_handle))
-			{
+			{	// No region at that area, so make water
 				LLVOWater* waterp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, gAgent.getRegion());
 				waterp->setUseTexture(FALSE);
 				waterp->setPositionGlobal(LLVector3d(x + rwidth/2,
 													 y + rwidth/2,
-													 256.f+DEFAULT_WATER_HEIGHT));
+													 256.f + water_height));
 				waterp->setScale(LLVector3((F32)rwidth, (F32)rwidth, 512.f));
 				gPipeline.createObject(waterp);
 				mHoleWaterObjects.push_back(waterp);
@@ -907,7 +913,7 @@ void LLWorld::updateWaterObjects()
 		}
 
 		waterp->setRegion(gAgent.getRegion());
-		LLVector3d water_pos(water_center_x, water_center_y, 256.f+DEFAULT_WATER_HEIGHT) ;
+		LLVector3d water_pos(water_center_x, water_center_y, 256.f + water_height) ;
 		LLVector3 water_scale((F32) dim[0], (F32) dim[1], 512.f);
 
 		//stretch out to horizon
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index ed61ac5ca85bcbde8d65ba8bac29be553e7df717..c20292a76e0c5133e05409e2681b36aa11b62259 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -108,7 +108,10 @@
 #include "lltoolpie.h"
 #include "llcurl.h"
 #include "llnotifications.h"
-
+#include "llpathinglib.h"
+#include "llfloaterpathfindingconsole.h"
+#include "llfloaterpathfindingcharacters.h"
+#include "llpathfindingpathtool.h"
 
 #ifdef _DEBUG
 // Debug indices is disabled for now for debug performance - djs 4/24/02
@@ -117,6 +120,8 @@
 //#define DEBUG_INDICES
 #endif
 
+bool gShiftFrame = false;
+
 //cached settings
 BOOL LLPipeline::RenderAvatarVP;
 BOOL LLPipeline::VertexShaderEnable;
@@ -214,7 +219,7 @@ BOOL	gDebugPipeline = FALSE;
 LLPipeline gPipeline;
 const LLMatrix4* gGLLastMatrix = NULL;
 
-LLFastTimer::DeclareTimer FTM_RENDER_GEOMETRY("Geometry");
+LLFastTimer::DeclareTimer FTM_RENDER_GEOMETRY("Render Geometry");
 LLFastTimer::DeclareTimer FTM_RENDER_GRASS("Grass");
 LLFastTimer::DeclareTimer FTM_RENDER_INVISIBLE("Invisible");
 LLFastTimer::DeclareTimer FTM_RENDER_OCCLUSION("Occlusion");
@@ -231,8 +236,13 @@ LLFastTimer::DeclareTimer FTM_RENDER_BUMP("Bump");
 LLFastTimer::DeclareTimer FTM_RENDER_FULLBRIGHT("Fullbright");
 LLFastTimer::DeclareTimer FTM_RENDER_GLOW("Glow");
 LLFastTimer::DeclareTimer FTM_GEO_UPDATE("Geo Update");
+LLFastTimer::DeclareTimer FTM_PIPELINE_CREATE("Pipeline Create");
 LLFastTimer::DeclareTimer FTM_POOLRENDER("RenderPool");
 LLFastTimer::DeclareTimer FTM_POOLS("Pools");
+LLFastTimer::DeclareTimer FTM_DEFERRED_POOLRENDER("RenderPool (Deferred)");
+LLFastTimer::DeclareTimer FTM_DEFERRED_POOLS("Pools (Deferred)");
+LLFastTimer::DeclareTimer FTM_POST_DEFERRED_POOLRENDER("RenderPool (Post)");
+LLFastTimer::DeclareTimer FTM_POST_DEFERRED_POOLS("Pools (Post)");
 LLFastTimer::DeclareTimer FTM_RENDER_BLOOM_FBO("First FBO");
 LLFastTimer::DeclareTimer FTM_STATESORT("Sort Draw State");
 LLFastTimer::DeclareTimer FTM_PIPELINE("Pipeline");
@@ -710,7 +720,7 @@ void LLPipeline::destroyGL()
 	{
 		glDeleteQueriesARB(1, &mMeshDirtyQueryObject);
 		mMeshDirtyQueryObject = 0;
-	}
+}
 }
 
 static LLFastTimer::DeclareTimer FTM_RESIZE_SCREEN_TEXTURE("Resize Screen Texture");
@@ -1368,7 +1378,7 @@ class LLOctreeDirtyTexture : public LLOctreeTraveler<LLDrawable>
 	{
 		LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0);
 
-		if (!group->isState(LLSpatialGroup::GEOM_DIRTY) && !group->getData().empty())
+		if (!group->isState(LLSpatialGroup::GEOM_DIRTY) && !group->isEmpty())
 		{
 			for (LLSpatialGroup::draw_map_t::iterator i = group->mDrawMap.begin(); i != group->mDrawMap.end(); ++i)
 			{
@@ -1677,7 +1687,7 @@ U32 LLPipeline::addObject(LLViewerObject *vobj)
 
 void LLPipeline::createObjects(F32 max_dtime)
 {
-	LLFastTimer ftm(FTM_GEO_UPDATE);
+	LLFastTimer ftm(FTM_PIPELINE_CREATE);
 	LLMemType mt(LLMemType::MTYPE_PIPELINE_CREATE_OBJECTS);
 
 	LLTimer update_timer;
@@ -1973,7 +1983,7 @@ void LLPipeline::clearReferences()
 
 void check_references(LLSpatialGroup* group, LLDrawable* drawable)
 {
-	for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
+	for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
 	{
 		if (drawable == *i)
 		{
@@ -1995,7 +2005,7 @@ void check_references(LLDrawable* drawable, LLFace* face)
 
 void check_references(LLSpatialGroup* group, LLFace* face)
 {
-	for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
+	for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
 	{
 		LLDrawable* drawable = *i;
 		check_references(drawable, face);
@@ -2007,25 +2017,25 @@ void LLPipeline::checkReferences(LLFace* face)
 #if 0
 	if (sCull)
 	{
-		for (LLCullResult::sg_list_t::iterator iter = sCull->beginVisibleGroups(); iter != sCull->endVisibleGroups(); ++iter)
+		for (LLCullResult::sg_iterator iter = sCull->beginVisibleGroups(); iter != sCull->endVisibleGroups(); ++iter)
 		{
 			LLSpatialGroup* group = *iter;
 			check_references(group, face);
 		}
 
-		for (LLCullResult::sg_list_t::iterator iter = sCull->beginAlphaGroups(); iter != sCull->endAlphaGroups(); ++iter)
+		for (LLCullResult::sg_iterator iter = sCull->beginAlphaGroups(); iter != sCull->endAlphaGroups(); ++iter)
 		{
 			LLSpatialGroup* group = *iter;
 			check_references(group, face);
 		}
 
-		for (LLCullResult::sg_list_t::iterator iter = sCull->beginDrawableGroups(); iter != sCull->endDrawableGroups(); ++iter)
+		for (LLCullResult::sg_iterator iter = sCull->beginDrawableGroups(); iter != sCull->endDrawableGroups(); ++iter)
 		{
 			LLSpatialGroup* group = *iter;
 			check_references(group, face);
 		}
 
-		for (LLCullResult::drawable_list_t::iterator iter = sCull->beginVisibleList(); iter != sCull->endVisibleList(); ++iter)
+		for (LLCullResult::drawable_iterator iter = sCull->beginVisibleList(); iter != sCull->endVisibleList(); ++iter)
 		{
 			LLDrawable* drawable = *iter;
 			check_references(drawable, face);	
@@ -2039,25 +2049,25 @@ void LLPipeline::checkReferences(LLDrawable* drawable)
 #if 0
 	if (sCull)
 	{
-		for (LLCullResult::sg_list_t::iterator iter = sCull->beginVisibleGroups(); iter != sCull->endVisibleGroups(); ++iter)
+		for (LLCullResult::sg_iterator iter = sCull->beginVisibleGroups(); iter != sCull->endVisibleGroups(); ++iter)
 		{
 			LLSpatialGroup* group = *iter;
 			check_references(group, drawable);
 		}
 
-		for (LLCullResult::sg_list_t::iterator iter = sCull->beginAlphaGroups(); iter != sCull->endAlphaGroups(); ++iter)
+		for (LLCullResult::sg_iterator iter = sCull->beginAlphaGroups(); iter != sCull->endAlphaGroups(); ++iter)
 		{
 			LLSpatialGroup* group = *iter;
 			check_references(group, drawable);
 		}
 
-		for (LLCullResult::sg_list_t::iterator iter = sCull->beginDrawableGroups(); iter != sCull->endDrawableGroups(); ++iter)
+		for (LLCullResult::sg_iterator iter = sCull->beginDrawableGroups(); iter != sCull->endDrawableGroups(); ++iter)
 		{
 			LLSpatialGroup* group = *iter;
 			check_references(group, drawable);
 		}
 
-		for (LLCullResult::drawable_list_t::iterator iter = sCull->beginVisibleList(); iter != sCull->endVisibleList(); ++iter)
+		for (LLCullResult::drawable_iterator iter = sCull->beginVisibleList(); iter != sCull->endVisibleList(); ++iter)
 		{
 			if (drawable == *iter)
 			{
@@ -2090,19 +2100,19 @@ void LLPipeline::checkReferences(LLDrawInfo* draw_info)
 #if 0
 	if (sCull)
 	{
-		for (LLCullResult::sg_list_t::iterator iter = sCull->beginVisibleGroups(); iter != sCull->endVisibleGroups(); ++iter)
+		for (LLCullResult::sg_iterator iter = sCull->beginVisibleGroups(); iter != sCull->endVisibleGroups(); ++iter)
 		{
 			LLSpatialGroup* group = *iter;
 			check_references(group, draw_info);
 		}
 
-		for (LLCullResult::sg_list_t::iterator iter = sCull->beginAlphaGroups(); iter != sCull->endAlphaGroups(); ++iter)
+		for (LLCullResult::sg_iterator iter = sCull->beginAlphaGroups(); iter != sCull->endAlphaGroups(); ++iter)
 		{
 			LLSpatialGroup* group = *iter;
 			check_references(group, draw_info);
 		}
 
-		for (LLCullResult::sg_list_t::iterator iter = sCull->beginDrawableGroups(); iter != sCull->endDrawableGroups(); ++iter)
+		for (LLCullResult::sg_iterator iter = sCull->beginDrawableGroups(); iter != sCull->endDrawableGroups(); ++iter)
 		{
 			LLSpatialGroup* group = *iter;
 			check_references(group, draw_info);
@@ -2116,7 +2126,7 @@ void LLPipeline::checkReferences(LLSpatialGroup* group)
 #if 0
 	if (sCull)
 	{
-		for (LLCullResult::sg_list_t::iterator iter = sCull->beginVisibleGroups(); iter != sCull->endVisibleGroups(); ++iter)
+		for (LLCullResult::sg_iterator iter = sCull->beginVisibleGroups(); iter != sCull->endVisibleGroups(); ++iter)
 		{
 			if (group == *iter)
 			{
@@ -2124,7 +2134,7 @@ void LLPipeline::checkReferences(LLSpatialGroup* group)
 			}
 		}
 
-		for (LLCullResult::sg_list_t::iterator iter = sCull->beginAlphaGroups(); iter != sCull->endAlphaGroups(); ++iter)
+		for (LLCullResult::sg_iterator iter = sCull->beginAlphaGroups(); iter != sCull->endAlphaGroups(); ++iter)
 		{
 			if (group == *iter)
 			{
@@ -2132,7 +2142,7 @@ void LLPipeline::checkReferences(LLSpatialGroup* group)
 			}
 		}
 
-		for (LLCullResult::sg_list_t::iterator iter = sCull->beginDrawableGroups(); iter != sCull->endDrawableGroups(); ++iter)
+		for (LLCullResult::sg_iterator iter = sCull->beginDrawableGroups(); iter != sCull->endDrawableGroups(); ++iter)
 		{
 			if (group == *iter)
 			{
@@ -2371,7 +2381,7 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl
 
 void LLPipeline::markNotCulled(LLSpatialGroup* group, LLCamera& camera)
 {
-	if (group->getData().empty())
+	if (group->isEmpty())
 	{ 
 		return;
 	}
@@ -2466,7 +2476,7 @@ void LLPipeline::doOcclusion(LLCamera& camera)
 			{
 				gOcclusionCubeProgram.bind();
 			}
-		}
+			}
 
 		if (mCubeVB.isNull())
 		{ //cube VB will be used for issuing occlusion queries
@@ -2474,7 +2484,7 @@ void LLPipeline::doOcclusion(LLCamera& camera)
 		}
 		mCubeVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
 
-		for (LLCullResult::sg_list_t::iterator iter = sCull->beginOcclusionGroups(); iter != sCull->endOcclusionGroups(); ++iter)
+		for (LLCullResult::sg_iterator iter = sCull->beginOcclusionGroups(); iter != sCull->endOcclusionGroups(); ++iter)
 		{
 			LLSpatialGroup* group = *iter;
 			group->doOcclusion(&camera);
@@ -2510,14 +2520,24 @@ BOOL LLPipeline::updateDrawableGeom(LLDrawable* drawablep, BOOL priority)
 
 static LLFastTimer::DeclareTimer FTM_SEED_VBO_POOLS("Seed VBO Pool");
 
+static LLFastTimer::DeclareTimer FTM_UPDATE_GL("Update GL");
+
 void LLPipeline::updateGL()
 {
-	while (!LLGLUpdate::sGLQ.empty())
 	{
-		LLGLUpdate* glu = LLGLUpdate::sGLQ.front();
-		glu->updateGL();
-		glu->mInQ = FALSE;
-		LLGLUpdate::sGLQ.pop_front();
+		LLFastTimer t(FTM_UPDATE_GL);
+		while (!LLGLUpdate::sGLQ.empty())
+		{
+			LLGLUpdate* glu = LLGLUpdate::sGLQ.front();
+			glu->updateGL();
+			glu->mInQ = FALSE;
+			LLGLUpdate::sGLQ.pop_front();
+		}
+
+	{ //seed VBO Pools
+		LLFastTimer t(FTM_SEED_VBO_POOLS);
+		LLVertexBuffer::seedPools();
+	}
 	}
 
 	{ //seed VBO Pools
@@ -2526,6 +2546,8 @@ void LLPipeline::updateGL()
 	}
 }
 
+static LLFastTimer::DeclareTimer FTM_REBUILD_PRIORITY_GROUPS("Rebuild Priority Groups");
+
 void LLPipeline::clearRebuildGroups()
 {
 	mGroupQ1Locked = true;
@@ -2553,9 +2575,9 @@ void LLPipeline::clearRebuildGroups()
 
 void LLPipeline::rebuildPriorityGroups()
 {
+	LLFastTimer t(FTM_REBUILD_PRIORITY_GROUPS);
 	LLTimer update_timer;
 	LLMemType mt(LLMemType::MTYPE_PIPELINE);
-	
 	assertInitialized();
 
 	gMeshRepo.notifyLoadedMeshes();
@@ -2574,7 +2596,9 @@ void LLPipeline::rebuildPriorityGroups()
 	mGroupQ1Locked = false;
 
 }
-		
+
+static LLFastTimer::DeclareTimer FTM_REBUILD_GROUPS("Rebuild Groups");
+
 void LLPipeline::rebuildGroups()
 {
 	if (mGroupQ2.empty())
@@ -2582,6 +2606,7 @@ void LLPipeline::rebuildGroups()
 		return;
 	}
 
+	LLFastTimer t(FTM_REBUILD_GROUPS);
 	mGroupQ2Locked = true;
 	// Iterate through some drawables on the non-priority build queue
 	S32 size = (S32) mGroupQ2.size();
@@ -2725,6 +2750,7 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera)
 		{
 			const LLDrawable* root = ((LLSpatialBridge*) drawablep)->mDrawable;
 			llassert(root); // trying to catch a bad assumption
+					
 			if (root && //  // this test may not be needed, see above
 					root->getVObj()->isAttachment())
 			{
@@ -2747,6 +2773,7 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera)
 		}
 		else
 		{
+		
 			sCull->pushDrawable(drawablep);
 		}
 
@@ -2823,6 +2850,10 @@ void LLPipeline::markShift(LLDrawable *drawablep)
 	}
 }
 
+static LLFastTimer::DeclareTimer FTM_SHIFT_DRAWABLE("Shift Drawable");
+static LLFastTimer::DeclareTimer FTM_SHIFT_OCTREE("Shift Octree");
+static LLFastTimer::DeclareTimer FTM_SHIFT_HUD("Shift HUD");
+
 void LLPipeline::shiftObjects(const LLVector3 &offset)
 {
 	LLMemType mt(LLMemType::MTYPE_PIPELINE_SHIFT_OBJECTS);
@@ -2835,35 +2866,46 @@ void LLPipeline::shiftObjects(const LLVector3 &offset)
 	LLVector4a offseta;
 	offseta.load3(offset.mV);
 
-	for (LLDrawable::drawable_vector_t::iterator iter = mShiftList.begin();
-		 iter != mShiftList.end(); iter++)
 	{
-		LLDrawable *drawablep = *iter;
-		if (drawablep->isDead())
+		LLFastTimer t(FTM_SHIFT_DRAWABLE);
+
+		for (LLDrawable::drawable_vector_t::iterator iter = mShiftList.begin();
+			 iter != mShiftList.end(); iter++)
 		{
-			continue;
-		}	
-		drawablep->shiftPos(offseta);	
-		drawablep->clearState(LLDrawable::ON_SHIFT_LIST);
+			LLDrawable *drawablep = *iter;
+			if (drawablep->isDead())
+			{
+				continue;
+			}	
+			drawablep->shiftPos(offseta);	
+			drawablep->clearState(LLDrawable::ON_SHIFT_LIST);
+		}
+		mShiftList.resize(0);
 	}
-	mShiftList.resize(0);
 
-	for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); 
-			iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
+	
 	{
-		LLViewerRegion* region = *iter;
-		for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++)
+		LLFastTimer t(FTM_SHIFT_OCTREE);
+		for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); 
+				iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
 		{
-			LLSpatialPartition* part = region->getSpatialPartition(i);
-			if (part)
+			LLViewerRegion* region = *iter;
+			for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++)
 			{
-				part->shift(offseta);
+				LLSpatialPartition* part = region->getSpatialPartition(i);
+				if (part)
+				{
+					part->shift(offseta);
+				}
 			}
 		}
 	}
 
-	LLHUDText::shiftAll(offset);
-	LLHUDNameTag::shiftAll(offset);
+	{
+		LLFastTimer t(FTM_SHIFT_HUD);
+		LLHUDText::shiftAll(offset);
+		LLHUDNameTag::shiftAll(offset);
+	}
 	display_update_camera();
 }
 
@@ -2896,8 +2938,10 @@ void LLPipeline::markPartitionMove(LLDrawable* drawable)
 	}
 }
 
+static LLFastTimer::DeclareTimer FTM_PROCESS_PARTITIONQ("PartitionQ");
 void LLPipeline::processPartitionQ()
 {
+	LLFastTimer t(FTM_PROCESS_PARTITIONQ);
 	for (LLDrawable::drawable_list_t::iterator iter = mPartitionQ.begin(); iter != mPartitionQ.end(); ++iter)
 	{
 		LLDrawable* drawable = *iter;
@@ -3013,7 +3057,7 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result)
 	//LLVertexBuffer::unbind();
 
 	grabReferences(result);
-	for (LLCullResult::sg_list_t::iterator iter = sCull->beginDrawableGroups(); iter != sCull->endDrawableGroups(); ++iter)
+	for (LLCullResult::sg_iterator iter = sCull->beginDrawableGroups(); iter != sCull->endDrawableGroups(); ++iter)
 	{
 		LLSpatialGroup* group = *iter;
 		group->checkOcclusion();
@@ -3024,7 +3068,7 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result)
 		else
 		{
 			group->setVisible();
-			for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
+			for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
 			{
 				markVisible(*i, camera);
 			}
@@ -3039,9 +3083,9 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result)
 	if (LLViewerCamera::sCurCameraID == LLViewerCamera::CAMERA_WORLD)
 	{
 		LLSpatialGroup* last_group = NULL;
-		for (LLCullResult::bridge_list_t::iterator i = sCull->beginVisibleBridge(); i != sCull->endVisibleBridge(); ++i)
+		for (LLCullResult::bridge_iterator i = sCull->beginVisibleBridge(); i != sCull->endVisibleBridge(); ++i)
 		{
-			LLCullResult::bridge_list_t::iterator cur_iter = i;
+			LLCullResult::bridge_iterator cur_iter = i;
 			LLSpatialBridge* bridge = *cur_iter;
 			LLSpatialGroup* group = bridge->getSpatialGroup();
 
@@ -3071,7 +3115,7 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result)
 		}
 	}
 
-	for (LLCullResult::sg_list_t::iterator iter = sCull->beginVisibleGroups(); iter != sCull->endVisibleGroups(); ++iter)
+	for (LLCullResult::sg_iterator iter = sCull->beginVisibleGroups(); iter != sCull->endVisibleGroups(); ++iter)
 	{
 		LLSpatialGroup* group = *iter;
 		group->checkOcclusion();
@@ -3093,7 +3137,7 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result)
 	
 	{
 		LLFastTimer ftm(FTM_STATESORT_DRAWABLE);
-		for (LLCullResult::drawable_list_t::iterator iter = sCull->beginVisibleList();
+		for (LLCullResult::drawable_iterator iter = sCull->beginVisibleList();
 			 iter != sCull->endVisibleList(); ++iter)
 		{
 			LLDrawable *drawablep = *iter;
@@ -3112,7 +3156,7 @@ void LLPipeline::stateSort(LLSpatialGroup* group, LLCamera& camera)
 	LLMemType mt(LLMemType::MTYPE_PIPELINE_STATE_SORT);
 	if (group->changeLOD())
 	{
-		for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
+		for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
 		{
 			LLDrawable* drawablep = *i;
 			stateSort(drawablep, camera);
@@ -3229,13 +3273,13 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera)
 }
 
 
-void forAllDrawables(LLCullResult::sg_list_t::iterator begin, 
-					 LLCullResult::sg_list_t::iterator end,
+void forAllDrawables(LLCullResult::sg_iterator begin, 
+					 LLCullResult::sg_iterator end,
 					 void (*func)(LLDrawable*))
 {
-	for (LLCullResult::sg_list_t::iterator i = begin; i != end; ++i)
+	for (LLCullResult::sg_iterator i = begin; i != end; ++i)
 	{
-		for (LLSpatialGroup::element_iter j = (*i)->getData().begin(); j != (*i)->getData().end(); ++j)
+		for (LLSpatialGroup::element_iter j = (*i)->getDataBegin(); j != (*i)->getDataEnd(); ++j)
 		{
 			func(*j);	
 		}
@@ -3314,7 +3358,7 @@ void renderPhysicalBeacons(LLDrawable* drawablep)
 	if (vobj 
 		&& !vobj->isAvatar() 
 		//&& !vobj->getParent()
-		&& vobj->usePhysics())
+		&& vobj->flagUsePhysics())
 	{
 		if (gPipeline.sRenderBeacons)
 		{
@@ -3437,7 +3481,7 @@ void LLPipeline::postSort(LLCamera& camera)
 
 	llpushcallstacks ;
 	//rebuild drawable geometry
-	for (LLCullResult::sg_list_t::iterator i = sCull->beginDrawableGroups(); i != sCull->endDrawableGroups(); ++i)
+	for (LLCullResult::sg_iterator i = sCull->beginDrawableGroups(); i != sCull->endDrawableGroups(); ++i)
 	{
 		LLSpatialGroup* group = *i;
 		if (!sUseOcclusion || 
@@ -3453,9 +3497,9 @@ void LLPipeline::postSort(LLCamera& camera)
 	rebuildPriorityGroups();
 	llpushcallstacks ;
 
-	
+
 	//build render map
-	for (LLCullResult::sg_list_t::iterator i = sCull->beginVisibleGroups(); i != sCull->endVisibleGroups(); ++i)
+	for (LLCullResult::sg_iterator i = sCull->beginVisibleGroups(); i != sCull->endVisibleGroups(); ++i)
 	{
 		LLSpatialGroup* group = *i;
 		if (sUseOcclusion && 
@@ -3525,7 +3569,7 @@ void LLPipeline::postSort(LLCamera& camera)
 			}
 		}
 	}
-	
+		
 	//flush particle VB
 	LLVOPartGroup::sVB->flush();
 
@@ -3970,6 +4014,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
 	gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sDefaultImagep);
 	LLViewerFetchedTexture::sDefaultImagep->setAddressMode(LLTexUnit::TAM_WRAP);
 	
+
 	//////////////////////////////////////////////
 	//
 	// Actually render all of the geometry
@@ -4042,7 +4087,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
 							break;
 						}
 						
-						p->render(i);
+						if ( !p->getSkipRenderFlag() ) { p->render(i); }
 					}
 					poolp->endRenderPass(i);
 					LLVertexBuffer::unbind();
@@ -4157,7 +4202,7 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera)
 	LLMemType mt_rgd(LLMemType::MTYPE_PIPELINE_RENDER_GEOM_DEFFERRED);
 	LLFastTimer t(FTM_RENDER_GEOMETRY);
 
-	LLFastTimer t2(FTM_POOLS);
+	LLFastTimer t2(FTM_DEFERRED_POOLS);
 
 	LLGLEnable cull(GL_CULL_FACE);
 
@@ -4199,7 +4244,7 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera)
 		pool_set_t::iterator iter2 = iter1;
 		if (hasRenderType(poolp->getType()) && poolp->getNumDeferredPasses() > 0)
 		{
-			LLFastTimer t(FTM_POOLRENDER);
+			LLFastTimer t(FTM_DEFERRED_POOLRENDER);
 
 			gGLLastMatrix = NULL;
 			gGL.loadMatrix(gGLModelView);
@@ -4216,7 +4261,7 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera)
 						break;
 					}
 										
-					p->renderDeferred(i);
+					if ( !p->getSkipRenderFlag() ) { p->renderDeferred(i); }
 				}
 				poolp->endDeferredPass(i);
 				LLVertexBuffer::unbind();
@@ -4252,7 +4297,7 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera)
 void LLPipeline::renderGeomPostDeferred(LLCamera& camera)
 {
 	LLMemType mt_rgpd(LLMemType::MTYPE_PIPELINE_RENDER_GEOM_POST_DEF);
-	LLFastTimer t(FTM_POOLS);
+	LLFastTimer t(FTM_POST_DEFERRED_POOLS);
 	U32 cur_type = 0;
 
 	LLGLEnable cull(GL_CULL_FACE);
@@ -4286,7 +4331,7 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera)
 		pool_set_t::iterator iter2 = iter1;
 		if (hasRenderType(poolp->getType()) && poolp->getNumPostDeferredPasses() > 0)
 		{
-			LLFastTimer t(FTM_POOLRENDER);
+			LLFastTimer t(FTM_POST_DEFERRED_POOLRENDER);
 
 			gGLLastMatrix = NULL;
 			gGL.loadMatrix(gGLModelView);
@@ -4476,7 +4521,7 @@ void LLPipeline::renderPhysicsDisplay()
 		}
 	}
 
-	for (LLCullResult::bridge_list_t::const_iterator i = sCull->beginVisibleBridge(); i != sCull->endVisibleBridge(); ++i)
+	for (LLCullResult::bridge_iterator i = sCull->beginVisibleBridge(); i != sCull->endVisibleBridge(); ++i)
 	{
 		LLSpatialBridge* bridge = *i;
 		if (!bridge->isDead() && hasRenderType(bridge->mDrawableType))
@@ -4505,14 +4550,341 @@ void LLPipeline::renderDebug()
 
 	assertInitialized();
 
+	bool hud_only = hasRenderType(LLPipeline::RENDER_TYPE_HUD);
+
+	if (!hud_only )
+	{
+		//Render any navmesh geometry	
+		LLPathingLib *llPathingLibInstance = LLPathingLib::getInstance();
+		if ( llPathingLibInstance != NULL ) 
+		{
+			//character floater renderables
+			
+			LLHandle<LLFloaterPathfindingCharacters> pathfindingCharacterHandle = LLFloaterPathfindingCharacters::getInstanceHandle();
+			if ( !pathfindingCharacterHandle.isDead() )
+			{
+				LLFloaterPathfindingCharacters *pathfindingCharacter = pathfindingCharacterHandle.get();
+
+				if ( pathfindingCharacter->getVisible() || gAgentCamera.cameraMouselook() )			
+				{	
+					if (LLGLSLShader::sNoFixedFunction)
+					{					
+						gPathfindingProgram.bind();			
+						gPathfindingProgram.uniform1f("tint", 1.f);
+						gPathfindingProgram.uniform1f("ambiance", 1.f);
+						gPathfindingProgram.uniform1f("alpha_scale", 1.f);
+					}
+
+					//Requried character physics capsule render parameters
+					LLUUID id;					
+					LLVector3 pos;
+					LLQuaternion rot;
+				
+					if ( pathfindingCharacter->isPhysicsCapsuleEnabled( id, pos, rot ) )
+					{
+						if (LLGLSLShader::sNoFixedFunction)
+						{					
+							//remove blending artifacts
+							gGL.setColorMask(false, false);
+							llPathingLibInstance->renderSimpleShapeCapsuleID( gGL, id, pos, rot );				
+							gGL.setColorMask(true, false);
+							LLGLEnable blend(GL_BLEND);
+							gPathfindingProgram.uniform1f("alpha_scale", 0.90f);
+							llPathingLibInstance->renderSimpleShapeCapsuleID( gGL, id, pos, rot );
+							gPathfindingProgram.bind();
+						}
+						else
+						{
+							llPathingLibInstance->renderSimpleShapeCapsuleID( gGL, id, pos, rot );
+						}
+					}
+				}
+			}
+			
+
+			//pathing console renderables
+			LLHandle<LLFloaterPathfindingConsole> pathfindingConsoleHandle = LLFloaterPathfindingConsole::getInstanceHandle();
+			if (!pathfindingConsoleHandle.isDead())
+			{
+				LLFloaterPathfindingConsole *pathfindingConsole = pathfindingConsoleHandle.get();
+
+				if ( pathfindingConsole->getVisible() || gAgentCamera.cameraMouselook() )
+				{				
+					F32 ambiance = gSavedSettings.getF32("PathfindingAmbiance");
+
+					if (LLGLSLShader::sNoFixedFunction)
+					{					
+						gPathfindingProgram.bind();
+			
+						gPathfindingProgram.uniform1f("tint", 1.f);
+						gPathfindingProgram.uniform1f("ambiance", ambiance);
+						gPathfindingProgram.uniform1f("alpha_scale", 1.f);
+					}
+
+					if ( !pathfindingConsole->isRenderWorld() )
+					{
+						const LLColor4 clearColor = gSavedSettings.getColor4("PathfindingNavMeshClear");
+						gGL.setColorMask(true, true);
+						glClearColor(clearColor.mV[0],clearColor.mV[1],clearColor.mV[2],0);
+						glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);					
+						gGL.setColorMask(true, false);
+						glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );	
+					}
+
+					//NavMesh
+					if ( pathfindingConsole->isRenderNavMesh() )
+					{	
+						gGL.flush();
+						glLineWidth(2.0f);	
+						LLGLEnable cull(GL_CULL_FACE);
+						LLGLDisable blend(GL_BLEND);
+						
+						if ( pathfindingConsole->isRenderWorld() )
+						{					
+							LLGLEnable blend(GL_BLEND);
+							gPathfindingProgram.uniform1f("alpha_scale", 0.66f);
+							llPathingLibInstance->renderNavMesh();
+						}
+						else
+						{
+							llPathingLibInstance->renderNavMesh();
+						}
+						
+						//render edges
+						if (LLGLSLShader::sNoFixedFunction)
+						{
+							gPathfindingNoNormalsProgram.bind();
+							gPathfindingNoNormalsProgram.uniform1f("tint", 1.f);
+							gPathfindingNoNormalsProgram.uniform1f("alpha_scale", 1.f);
+							llPathingLibInstance->renderNavMeshEdges();
+							gPathfindingProgram.bind();
+						}
+						else
+						{
+							llPathingLibInstance->renderNavMeshEdges();
+						}
+
+						gGL.flush();
+						glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );	
+						glLineWidth(1.0f);	
+						gGL.flush();
+					}
+					//User designated path
+					if ( LLPathfindingPathTool::getInstance()->isRenderPath() )
+					{
+						//The path
+						if (LLGLSLShader::sNoFixedFunction)
+						{
+							gUIProgram.bind();
+							gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep);
+							llPathingLibInstance->renderPath();
+							gPathfindingProgram.bind();
+						}
+						else
+						{
+							llPathingLibInstance->renderPath();
+						}
+						//The bookends
+						if (LLGLSLShader::sNoFixedFunction)
+						{
+							//remove blending artifacts
+							gGL.setColorMask(false, false);
+							llPathingLibInstance->renderPathBookend( gGL, LLPathingLib::LLPL_START );
+							llPathingLibInstance->renderPathBookend( gGL, LLPathingLib::LLPL_END );
+						
+							gGL.setColorMask(true, false);
+							//render the bookends
+							LLGLEnable blend(GL_BLEND);
+							gPathfindingProgram.uniform1f("alpha_scale", 0.90f);
+							llPathingLibInstance->renderPathBookend( gGL, LLPathingLib::LLPL_START );
+							llPathingLibInstance->renderPathBookend( gGL, LLPathingLib::LLPL_END );
+							gPathfindingProgram.bind();
+						}
+						else
+						{
+							llPathingLibInstance->renderPathBookend( gGL, LLPathingLib::LLPL_START );
+							llPathingLibInstance->renderPathBookend( gGL, LLPathingLib::LLPL_END );
+						}
+					
+					}
+				
+					if ( pathfindingConsole->isRenderWaterPlane() )
+					{	
+						if (LLGLSLShader::sNoFixedFunction)
+						{
+							LLGLEnable blend(GL_BLEND);
+							gPathfindingProgram.uniform1f("alpha_scale", 0.90f);
+							llPathingLibInstance->renderSimpleShapes( gGL, gAgent.getRegion()->getWaterHeight() );
+						}
+						else
+						{
+							llPathingLibInstance->renderSimpleShapes( gGL, gAgent.getRegion()->getWaterHeight() );					
+						}
+					}
+				//physics/exclusion shapes
+				if ( pathfindingConsole->isRenderAnyShapes() )
+				{					
+						U32 render_order[] = {
+							1 << LLPathingLib::LLST_ObstacleObjects,
+							1 << LLPathingLib::LLST_WalkableObjects,
+							1 << LLPathingLib::LLST_ExclusionPhantoms,	
+							1 << LLPathingLib::LLST_MaterialPhantoms,
+						};
+
+						U32 flags = pathfindingConsole->getRenderShapeFlags();
+
+						for (U32 i = 0; i < 4; i++)
+						{
+							if (!(flags & render_order[i]))
+							{
+								continue;
+							}
+
+							//turn off backface culling for volumes so they are visible when camera is inside volume
+							LLGLDisable cull(i >= 2 ? GL_CULL_FACE : 0);
+						
+							gGL.flush();
+							glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );	
+				
+							//get rid of some z-fighting
+							LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL);
+							glPolygonOffset(1.0f, 1.0f);
+
+							//render to depth first to avoid blending artifacts
+							gGL.setColorMask(false, false);
+							llPathingLibInstance->renderNavMeshShapesVBO( render_order[i] );		
+							gGL.setColorMask(true, false);
+
+							//get rid of some z-fighting
+							glPolygonOffset(0.f, 0.f);
+
+							LLGLEnable blend(GL_BLEND);
+				
+							{
+								gPathfindingProgram.uniform1f("ambiance", ambiance);
+
+								{ //draw solid overlay
+									LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_LEQUAL);
+									llPathingLibInstance->renderNavMeshShapesVBO( render_order[i] );				
+									gGL.flush();				
+								}
+				
+								LLGLEnable lineOffset(GL_POLYGON_OFFSET_LINE);
+								glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );	
+						
+								F32 offset = gSavedSettings.getF32("PathfindingLineOffset");
+
+								if (pathfindingConsole->isRenderXRay())
+								{
+									gPathfindingProgram.uniform1f("tint", gSavedSettings.getF32("PathfindingXRayTint"));
+									gPathfindingProgram.uniform1f("alpha_scale", gSavedSettings.getF32("PathfindingXRayOpacity"));
+									LLGLEnable blend(GL_BLEND);
+									LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_GREATER);
+								
+									glPolygonOffset(offset, -offset);
+								
+									if (gSavedSettings.getBOOL("PathfindingXRayWireframe"))
+									{ //draw hidden wireframe as darker and less opaque
+										gPathfindingProgram.uniform1f("ambiance", 1.f);
+										llPathingLibInstance->renderNavMeshShapesVBO( render_order[i] );				
+									}
+									else
+									{
+										glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );	
+										gPathfindingProgram.uniform1f("ambiance", ambiance);
+										llPathingLibInstance->renderNavMeshShapesVBO( render_order[i] );				
+										glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+									}
+								}
+
+								{ //draw visible wireframe as brighter, thicker and more opaque
+									glPolygonOffset(offset, offset);
+									gPathfindingProgram.uniform1f("ambiance", 1.f);
+									gPathfindingProgram.uniform1f("tint", 1.f);
+									gPathfindingProgram.uniform1f("alpha_scale", 1.f);
+
+									glLineWidth(gSavedSettings.getF32("PathfindingLineWidth"));
+									LLGLDisable blendOut(GL_BLEND);
+									llPathingLibInstance->renderNavMeshShapesVBO( render_order[i] );				
+									gGL.flush();
+									glLineWidth(1.f);
+								}
+				
+								glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+							}
+						}
+					}
+
+					glPolygonOffset(0.f, 0.f);
+
+					if ( pathfindingConsole->isRenderNavMesh() && pathfindingConsole->isRenderXRay() )
+					{	//render navmesh xray
+						F32 ambiance = gSavedSettings.getF32("PathfindingAmbiance");
+
+						LLGLEnable lineOffset(GL_POLYGON_OFFSET_LINE);
+						LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL);
+											
+						F32 offset = gSavedSettings.getF32("PathfindingLineOffset");
+						glPolygonOffset(offset, -offset);
+
+						LLGLEnable blend(GL_BLEND);
+						LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_GREATER);
+						gGL.flush();				
+						glLineWidth(2.0f);	
+						LLGLEnable cull(GL_CULL_FACE);
+																		
+						gPathfindingProgram.uniform1f("tint", gSavedSettings.getF32("PathfindingXRayTint"));
+						gPathfindingProgram.uniform1f("alpha_scale", gSavedSettings.getF32("PathfindingXRayOpacity"));
+								
+						if (gSavedSettings.getBOOL("PathfindingXRayWireframe"))
+						{ //draw hidden wireframe as darker and less opaque
+							glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );	
+							gPathfindingProgram.uniform1f("ambiance", 1.f);
+							llPathingLibInstance->renderNavMesh();
+							glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );	
+						}	
+						else
+						{
+							gPathfindingProgram.uniform1f("ambiance", ambiance);
+							llPathingLibInstance->renderNavMesh();
+						}
+
+						//render edges
+						if (LLGLSLShader::sNoFixedFunction)
+						{
+							gPathfindingNoNormalsProgram.bind();
+							gPathfindingNoNormalsProgram.uniform1f("tint", gSavedSettings.getF32("PathfindingXRayTint"));
+							gPathfindingNoNormalsProgram.uniform1f("alpha_scale", gSavedSettings.getF32("PathfindingXRayOpacity"));
+							llPathingLibInstance->renderNavMeshEdges();
+							gPathfindingProgram.bind();
+						}
+						else
+						{
+							llPathingLibInstance->renderNavMeshEdges();
+						}
+					
+						gGL.flush();
+						glLineWidth(1.0f);	
+					}
+			
+					glPolygonOffset(0.f, 0.f);
+
+					gGL.flush();
+					if (LLGLSLShader::sNoFixedFunction)
+					{
+						gPathfindingProgram.unbind();
+					}
+				}
+			}
+		}
+	}
+
 	gGL.color4f(1,1,1,1);
 
 	gGLLastMatrix = NULL;
 	gGL.loadMatrix(gGLModelView);
 	gGL.setColorMask(true, false);
 
-	bool hud_only = hasRenderType(LLPipeline::RENDER_TYPE_HUD);
-
 	
 	if (!hud_only && !mDebugBlips.empty())
 	{ //render debug blips
@@ -4571,7 +4943,7 @@ void LLPipeline::renderDebug()
 		}
 	}
 
-	for (LLCullResult::bridge_list_t::const_iterator i = sCull->beginVisibleBridge(); i != sCull->endVisibleBridge(); ++i)
+	for (LLCullResult::bridge_iterator i = sCull->beginVisibleBridge(); i != sCull->endVisibleBridge(); ++i)
 	{
 		LLSpatialBridge* bridge = *i;
 		if (!bridge->isDead() && hasRenderType(bridge->mDrawableType))
@@ -4823,8 +5195,11 @@ void LLPipeline::renderDebug()
 	}
 }
 
+static LLFastTimer::DeclareTimer FTM_REBUILD_POOLS("Rebuild Pools");
+
 void LLPipeline::rebuildPools()
 {
+	LLFastTimer t(FTM_REBUILD_POOLS);
 	LLMemType mt(LLMemType::MTYPE_PIPELINE_REBUILD_POOLS);
 
 	assertInitialized();
@@ -6373,23 +6748,26 @@ void LLPipeline::resetVertexBuffers(LLDrawable* drawable)
 		LLFace* facep = drawable->getFace(i);
 		if (facep)
 		{
-			facep->clearVertexBuffer();
-		}
+		facep->clearVertexBuffer();
 	}
 }
+}
 
 void LLPipeline::resetVertexBuffers()
 {
 	mResetVertexBuffers = true;
 }
 
+static LLFastTimer::DeclareTimer FTM_RESET_VB("Reset VB");
+
 void LLPipeline::doResetVertexBuffers()
 {
 	if (!mResetVertexBuffers)
 	{
 		return;
 	}
-	
+
+	LLFastTimer t(FTM_RESET_VB);
 	mResetVertexBuffers = false;
 
 	mCubeVB = NULL;
@@ -6412,6 +6790,10 @@ void LLPipeline::doResetVertexBuffers()
 
 	gSky.resetVertexBuffers();
 
+	if ( LLPathingLib::getInstance() )
+	{
+		LLPathingLib::getInstance()->cleanupVBOManager();
+	}
 	LLVOPartGroup::destroyGL();
 
 	LLVertexBuffer::cleanupClass();
@@ -7639,7 +8021,7 @@ void LLPipeline::renderDeferredLighting()
 				}
 
 				mCubeVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
-				
+
 				LLGLDepthTest depth(GL_TRUE, GL_FALSE);
 				for (LLDrawable::drawable_set_t::iterator iter = mLights.begin(); iter != mLights.end(); ++iter)
 				{
@@ -7685,7 +8067,7 @@ void LLPipeline::renderDeferredLighting()
 					}
 
 					sVisibleLightCount++;
-										
+
 					if (camera->getOrigin().mV[0] > c[0] + s + 0.2f ||
 						camera->getOrigin().mV[0] < c[0] - s - 0.2f ||
 						camera->getOrigin().mV[1] > c[1] + s + 0.2f ||
@@ -8325,6 +8707,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
 				gGL.setColorMask(true, false);
 
 				renderGeom(camera);
+
 			}
 
 			LLPipeline::sUnderWaterRender = FALSE;
@@ -8809,6 +9192,8 @@ void LLPipeline::generateHighlight(LLCamera& camera)
 }
 
 
+static LLFastTimer::DeclareTimer FTM_GEN_SUN_SHADOW("Gen Sun Shadow");
+
 void LLPipeline::generateSunShadow(LLCamera& camera)
 {
 	if (!sRenderDeferred || RenderShadowDetail <= 0)
@@ -8816,6 +9201,8 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
 		return;
 	}
 
+	LLFastTimer t(FTM_GEN_SUN_SHADOW);
+
 	BOOL skip_avatar_update = FALSE;
 	if (!isAgentAvatarValid() || gAgentCamera.getCameraAnimating() || gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK || !LLVOAvatar::sVisibleInFirstPerson)
 	{
@@ -9565,7 +9952,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
 
 void LLPipeline::renderGroups(LLRenderPass* pass, U32 type, U32 mask, BOOL texture)
 {
-	for (LLCullResult::sg_list_t::iterator i = sCull->beginVisibleGroups(); i != sCull->endVisibleGroups(); ++i)
+	for (LLCullResult::sg_iterator i = sCull->beginVisibleGroups(); i != sCull->endVisibleGroups(); ++i)
 	{
 		LLSpatialGroup* group = *i;
 		if (!group->isDead() &&
@@ -9578,6 +9965,12 @@ void LLPipeline::renderGroups(LLRenderPass* pass, U32 type, U32 mask, BOOL textu
 	}
 }
 
+static LLFastTimer::DeclareTimer FTM_IMPOSTOR_MARK_VISIBLE("Impostor Mark Visible");
+static LLFastTimer::DeclareTimer FTM_IMPOSTOR_SETUP("Impostor Setup");
+static LLFastTimer::DeclareTimer FTM_IMPOSTOR_BACKGROUND("Impostor Background");
+static LLFastTimer::DeclareTimer FTM_IMPOSTOR_ALLOCATE("Impostor Allocate");
+static LLFastTimer::DeclareTimer FTM_IMPOSTOR_RESIZE("Impostor Resize");
+
 void LLPipeline::generateImpostor(LLVOAvatar* avatar)
 {
 	LLMemType mt_gi(LLMemType::MTYPE_PIPELINE_GENERATE_IMPOSTOR);
@@ -9633,101 +10026,114 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
 	sImpostorRender = TRUE;
 
 	LLViewerCamera* viewer_camera = LLViewerCamera::getInstance();
-	markVisible(avatar->mDrawable, *viewer_camera);
-	LLVOAvatar::sUseImpostors = FALSE;
 
-	LLVOAvatar::attachment_map_t::iterator iter;
-	for (iter = avatar->mAttachmentPoints.begin();
-		iter != avatar->mAttachmentPoints.end();
-		++iter)
 	{
-		LLViewerJointAttachment *attachment = iter->second;
-		for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
-			 attachment_iter != attachment->mAttachedObjects.end();
-			 ++attachment_iter)
+		LLFastTimer t(FTM_IMPOSTOR_MARK_VISIBLE);
+		markVisible(avatar->mDrawable, *viewer_camera);
+		LLVOAvatar::sUseImpostors = FALSE;
+
+		LLVOAvatar::attachment_map_t::iterator iter;
+		for (iter = avatar->mAttachmentPoints.begin();
+			iter != avatar->mAttachmentPoints.end();
+			++iter)
 		{
-			if (LLViewerObject* attached_object = (*attachment_iter))
+			LLViewerJointAttachment *attachment = iter->second;
+			for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
+				 attachment_iter != attachment->mAttachedObjects.end();
+				 ++attachment_iter)
 			{
-				markVisible(attached_object->mDrawable->getSpatialBridge(), *viewer_camera);
+				if (LLViewerObject* attached_object = (*attachment_iter))
+				{
+					markVisible(attached_object->mDrawable->getSpatialBridge(), *viewer_camera);
+				}
 			}
 		}
 	}
 
 	stateSort(*LLViewerCamera::getInstance(), result);
 	
-	const LLVector4a* ext = avatar->mDrawable->getSpatialExtents();
-	LLVector3 pos(avatar->getRenderPosition()+avatar->getImpostorOffset());
-
 	LLCamera camera = *viewer_camera;
-
-	camera.lookAt(viewer_camera->getOrigin(), pos, viewer_camera->getUpAxis());
-	
 	LLVector2 tdim;
+	U32 resY = 0;
+	U32 resX = 0;
 
+	{
+		LLFastTimer t(FTM_IMPOSTOR_SETUP);
+		const LLVector4a* ext = avatar->mDrawable->getSpatialExtents();
+		LLVector3 pos(avatar->getRenderPosition()+avatar->getImpostorOffset());
 
-	LLVector4a half_height;
-	half_height.setSub(ext[1], ext[0]);
-	half_height.mul(0.5f);
+		camera.lookAt(viewer_camera->getOrigin(), pos, viewer_camera->getUpAxis());
+	
+		LLVector4a half_height;
+		half_height.setSub(ext[1], ext[0]);
+		half_height.mul(0.5f);
 
-	LLVector4a left;
-	left.load3(camera.getLeftAxis().mV);
-	left.mul(left);
-	left.normalize3fast();
+		LLVector4a left;
+		left.load3(camera.getLeftAxis().mV);
+		left.mul(left);
+		left.normalize3fast();
 
-	LLVector4a up;
-	up.load3(camera.getUpAxis().mV);
-	up.mul(up);
-	up.normalize3fast();
+		LLVector4a up;
+		up.load3(camera.getUpAxis().mV);
+		up.mul(up);
+		up.normalize3fast();
 
-	tdim.mV[0] = fabsf(half_height.dot3(left).getF32());
-	tdim.mV[1] = fabsf(half_height.dot3(up).getF32());
+		tdim.mV[0] = fabsf(half_height.dot3(left).getF32());
+		tdim.mV[1] = fabsf(half_height.dot3(up).getF32());
 
-	gGL.matrixMode(LLRender::MM_PROJECTION);
-	gGL.pushMatrix();
+		gGL.matrixMode(LLRender::MM_PROJECTION);
+		gGL.pushMatrix();
 	
-	F32 distance = (pos-camera.getOrigin()).length();
-	F32 fov = atanf(tdim.mV[1]/distance)*2.f*RAD_TO_DEG;
-	F32 aspect = tdim.mV[0]/tdim.mV[1];
-	glh::matrix4f persp = gl_perspective(fov, aspect, 1.f, 256.f);
-	glh_set_current_projection(persp);
-	gGL.loadMatrix(persp.m);
+		F32 distance = (pos-camera.getOrigin()).length();
+		F32 fov = atanf(tdim.mV[1]/distance)*2.f*RAD_TO_DEG;
+		F32 aspect = tdim.mV[0]/tdim.mV[1];
+		glh::matrix4f persp = gl_perspective(fov, aspect, 1.f, 256.f);
+		glh_set_current_projection(persp);
+		gGL.loadMatrix(persp.m);
 
-	gGL.matrixMode(LLRender::MM_MODELVIEW);
-	gGL.pushMatrix();
-	glh::matrix4f mat;
-	camera.getOpenGLTransform(mat.m);
+		gGL.matrixMode(LLRender::MM_MODELVIEW);
+		gGL.pushMatrix();
+		glh::matrix4f mat;
+		camera.getOpenGLTransform(mat.m);
 
-	mat = glh::matrix4f((GLfloat*) OGL_TO_CFR_ROTATION) * mat;
+		mat = glh::matrix4f((GLfloat*) OGL_TO_CFR_ROTATION) * mat;
 
-	gGL.loadMatrix(mat.m);
-	glh_set_current_modelview(mat);
+		gGL.loadMatrix(mat.m);
+		glh_set_current_modelview(mat);
 
-	glClearColor(0.0f,0.0f,0.0f,0.0f);
-	gGL.setColorMask(true, true);
+		glClearColor(0.0f,0.0f,0.0f,0.0f);
+		gGL.setColorMask(true, true);
 	
-	// get the number of pixels per angle
-	F32 pa = gViewerWindow->getWindowHeightRaw() / (RAD_TO_DEG * viewer_camera->getView());
+		// get the number of pixels per angle
+		F32 pa = gViewerWindow->getWindowHeightRaw() / (RAD_TO_DEG * viewer_camera->getView());
 
-	//get resolution based on angle width and height of impostor (double desired resolution to prevent aliasing)
-	U32 resY = llmin(nhpo2((U32) (fov*pa)), (U32) 512);
-	U32 resX = llmin(nhpo2((U32) (atanf(tdim.mV[0]/distance)*2.f*RAD_TO_DEG*pa)), (U32) 512);
+		//get resolution based on angle width and height of impostor (double desired resolution to prevent aliasing)
+		resY = llmin(nhpo2((U32) (fov*pa)), (U32) 512);
+		resX = llmin(nhpo2((U32) (atanf(tdim.mV[0]/distance)*2.f*RAD_TO_DEG*pa)), (U32) 512);
 
-	if (!avatar->mImpostor.isComplete() || resX != avatar->mImpostor.getWidth() ||
-		resY != avatar->mImpostor.getHeight())
-	{
-		avatar->mImpostor.allocate(resX,resY,GL_RGBA,TRUE,FALSE);
+		if (!avatar->mImpostor.isComplete())
+		{
+			LLFastTimer t(FTM_IMPOSTOR_ALLOCATE);
+			avatar->mImpostor.allocate(resX,resY,GL_RGBA,TRUE,FALSE);
+
+			if (LLPipeline::sRenderDeferred)
+			{
+				addDeferredAttachments(avatar->mImpostor);
+			}
 		
-		if (LLPipeline::sRenderDeferred)
+			gGL.getTexUnit(0)->bind(&avatar->mImpostor);
+			gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
+			gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+		}
+		else if(resX != avatar->mImpostor.getWidth() ||
+			resY != avatar->mImpostor.getHeight())
 		{
-			addDeferredAttachments(avatar->mImpostor);
+			LLFastTimer t(FTM_IMPOSTOR_RESIZE);
+			avatar->mImpostor.resize(resX,resY,GL_RGBA);
 		}
-		
-		gGL.getTexUnit(0)->bind(&avatar->mImpostor);
-		gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
-		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
-	}
 
-	avatar->mImpostor.bindTarget();
+		avatar->mImpostor.bindTarget();
+	}
 
 	if (LLPipeline::sRenderDeferred)
 	{
@@ -9744,6 +10150,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
 	}
 	
 	{ //create alpha mask based on depth buffer (grey out if muted)
+		LLFastTimer t(FTM_IMPOSTOR_BACKGROUND);
 		if (LLPipeline::sRenderDeferred)
 		{
 			GLuint buff = GL_COLOR_ATTACHMENT0;
@@ -9829,22 +10236,22 @@ BOOL LLPipeline::hasRenderBatches(const U32 type) const
 	return sCull->getRenderMapSize(type) > 0;
 }
 
-LLCullResult::drawinfo_list_t::iterator LLPipeline::beginRenderMap(U32 type)
+LLCullResult::drawinfo_iterator LLPipeline::beginRenderMap(U32 type)
 {
 	return sCull->beginRenderMap(type);
 }
 
-LLCullResult::drawinfo_list_t::iterator LLPipeline::endRenderMap(U32 type)
+LLCullResult::drawinfo_iterator LLPipeline::endRenderMap(U32 type)
 {
 	return sCull->endRenderMap(type);
 }
 
-LLCullResult::sg_list_t::iterator LLPipeline::beginAlphaGroups()
+LLCullResult::sg_iterator LLPipeline::beginAlphaGroups()
 {
 	return sCull->beginAlphaGroups();
 }
 
-LLCullResult::sg_list_t::iterator LLPipeline::endAlphaGroups()
+LLCullResult::sg_iterator LLPipeline::endAlphaGroups()
 {
 	return sCull->endAlphaGroups();
 }
@@ -9975,3 +10382,143 @@ void LLPipeline::addDebugBlip(const LLVector3& position, const LLColor4& color)
 	mDebugBlips.push_back(blip);
 }
 
+void LLPipeline::hidePermanentObjects( std::vector<U32>& restoreList )
+{
+	//This method is used to hide any vo's from the object list that may have
+	//the permanent flag set.
+	
+	U32 objCnt = gObjectList.getNumObjects();
+	for (U32 i = 0; i < objCnt; ++i)
+	{
+		LLViewerObject* pObject = gObjectList.getObject(i);
+		if ( pObject && pObject->flagObjectPermanent() )
+		{
+			LLDrawable *pDrawable = pObject->mDrawable;
+		
+			if ( pDrawable )
+			{
+				restoreList.push_back( i );
+				hideDrawable( pDrawable );			
+			}
+		}
+	}
+
+	skipRenderingOfTerrain( true );
+}
+
+void LLPipeline::restorePermanentObjects( const std::vector<U32>& restoreList )
+{
+	//This method is used to restore(unhide) any vo's from the object list that may have
+	//been hidden because their permanency flag was set.
+
+	std::vector<U32>::const_iterator itCurrent	= restoreList.begin();
+	std::vector<U32>::const_iterator itEnd		= restoreList.end();
+	
+	U32 objCnt = gObjectList.getNumObjects();
+
+	while ( itCurrent != itEnd )
+	{
+		U32 index = *itCurrent;
+		LLViewerObject* pObject = NULL;
+		if ( index < objCnt ) 
+		{
+			pObject = gObjectList.getObject( index );
+		}
+		if ( pObject )
+		{
+			LLDrawable *pDrawable = pObject->mDrawable;
+			if ( pDrawable )
+			{
+				pDrawable->clearState( LLDrawable::FORCE_INVISIBLE );
+				unhideDrawable( pDrawable );				
+			}
+		}
+		++itCurrent;
+	}
+	
+	skipRenderingOfTerrain( false );
+}
+
+void LLPipeline::skipRenderingOfTerrain( BOOL flag )
+{
+	pool_set_t::iterator iter = mPools.begin();
+	while ( iter != mPools.end() )
+	{
+		LLDrawPool* pPool = *iter;		
+		U32 poolType = pPool->getType();					
+		if ( hasRenderType( pPool->getType() ) && poolType == LLDrawPool::POOL_TERRAIN )
+		{
+			pPool->setSkipRenderFlag( flag );			
+		}
+		++iter;
+	}
+}
+
+void LLPipeline::hideObject( const LLUUID& id )
+{
+	LLViewerObject *pVO = gObjectList.findObject( id );
+	
+	if ( pVO )
+	{
+		LLDrawable *pDrawable = pVO->mDrawable;
+		
+		if ( pDrawable )
+		{
+			hideDrawable( pDrawable );		
+		}		
+	}
+}
+
+void LLPipeline::hideDrawable( LLDrawable *pDrawable )
+{
+	pDrawable->setState( LLDrawable::FORCE_INVISIBLE );
+	markRebuild( pDrawable, LLDrawable::REBUILD_ALL, TRUE );
+	//hide the children
+	LLViewerObject::const_child_list_t& child_list = pDrawable->getVObj()->getChildren();
+	for ( LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
+		  iter != child_list.end(); iter++ )
+	{
+		LLViewerObject* child = *iter;
+		LLDrawable* drawable = child->mDrawable;					
+		if ( drawable )
+		{
+			drawable->setState( LLDrawable::FORCE_INVISIBLE );
+			markRebuild( drawable, LLDrawable::REBUILD_ALL, TRUE );
+		}
+	}
+}
+void LLPipeline::unhideDrawable( LLDrawable *pDrawable )
+{
+	pDrawable->clearState( LLDrawable::FORCE_INVISIBLE );
+	markRebuild( pDrawable, LLDrawable::REBUILD_ALL, TRUE );
+	//restore children
+	LLViewerObject::const_child_list_t& child_list = pDrawable->getVObj()->getChildren();
+	for ( LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
+		  iter != child_list.end(); iter++)
+	{
+		LLViewerObject* child = *iter;
+		LLDrawable* drawable = child->mDrawable;					
+		if ( drawable )
+		{
+			drawable->clearState( LLDrawable::FORCE_INVISIBLE );
+			markRebuild( drawable, LLDrawable::REBUILD_ALL, TRUE );
+		}
+	}
+}
+void LLPipeline::restoreHiddenObject( const LLUUID& id )
+{
+	LLViewerObject *pVO = gObjectList.findObject( id );
+	
+	if ( pVO )
+	{
+		LLDrawable *pDrawable = pVO->mDrawable;
+		if ( pDrawable )
+		{
+			unhideDrawable( pDrawable );			
+		}
+	}
+}
+
+
+
+
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index ae84c5886f216ff5e0a120f286fa45cd76042c18..d1baf17d0dd504870ae9c477fb5fa9bb3a311978 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -295,10 +295,10 @@ class LLPipeline
 	void setLight(LLDrawable *drawablep, BOOL is_light);
 	
 	BOOL hasRenderBatches(const U32 type) const;
-	LLCullResult::drawinfo_list_t::iterator beginRenderMap(U32 type);
-	LLCullResult::drawinfo_list_t::iterator endRenderMap(U32 type);
-	LLCullResult::sg_list_t::iterator beginAlphaGroups();
-	LLCullResult::sg_list_t::iterator endAlphaGroups();
+	LLCullResult::drawinfo_iterator beginRenderMap(U32 type);
+	LLCullResult::drawinfo_iterator endRenderMap(U32 type);
+	LLCullResult::sg_iterator beginAlphaGroups();
+	LLCullResult::sg_iterator endAlphaGroups();
 	
 
 	void addTrianglesDrawn(S32 index_count, U32 render_type = LLRender::TRIANGLES);
@@ -370,6 +370,12 @@ class LLPipeline
 
 	void addDebugBlip(const LLVector3& position, const LLColor4& color);
 
+	void hidePermanentObjects( std::vector<U32>& restoreList );
+	void restorePermanentObjects( const std::vector<U32>& restoreList );
+	void skipRenderingOfTerrain( BOOL flag );
+	void hideObject( const LLUUID& id );
+	void restoreHiddenObject( const LLUUID& id );
+
 private:
 	void unloadShaders();
 	void addToQuickLookup( LLDrawPool* new_poolp );
@@ -377,7 +383,8 @@ class LLPipeline
 	BOOL updateDrawableGeom(LLDrawable* drawable, BOOL priority);
 	void assertInitializedDoError();
 	bool assertInitialized() { const bool is_init = isInit(); if (!is_init) assertInitializedDoError(); return is_init; };
-	
+	void hideDrawable( LLDrawable *pDrawable );
+	void unhideDrawable( LLDrawable *pDrawable );
 public:
 	enum {GPU_CLASS_MAX = 3 };
 
diff --git a/indra/newview/res/lltoolpathfinding.cur b/indra/newview/res/lltoolpathfinding.cur
new file mode 100644
index 0000000000000000000000000000000000000000..2aba2daa45a671f069ed52348822f53219d73755
Binary files /dev/null and b/indra/newview/res/lltoolpathfinding.cur differ
diff --git a/indra/newview/res/lltoolpathfindingpathend.cur b/indra/newview/res/lltoolpathfindingpathend.cur
new file mode 100644
index 0000000000000000000000000000000000000000..e951a6956ba90a7fd4739479e48d3a54b570ebc3
Binary files /dev/null and b/indra/newview/res/lltoolpathfindingpathend.cur differ
diff --git a/indra/newview/res/lltoolpathfindingpathendadd.cur b/indra/newview/res/lltoolpathfindingpathendadd.cur
new file mode 100644
index 0000000000000000000000000000000000000000..0bf3201b2360c9d91bfd88b669b5c92262c6a358
Binary files /dev/null and b/indra/newview/res/lltoolpathfindingpathendadd.cur differ
diff --git a/indra/newview/res/lltoolpathfindingpathstart.cur b/indra/newview/res/lltoolpathfindingpathstart.cur
new file mode 100644
index 0000000000000000000000000000000000000000..fecc716990c052122bde6af4bf193a0cc57c58bf
Binary files /dev/null and b/indra/newview/res/lltoolpathfindingpathstart.cur differ
diff --git a/indra/newview/res/lltoolpathfindingpathstartadd.cur b/indra/newview/res/lltoolpathfindingpathstartadd.cur
new file mode 100644
index 0000000000000000000000000000000000000000..45e23e5161f7d0370af0b3d4f917535c24a3c751
Binary files /dev/null and b/indra/newview/res/lltoolpathfindingpathstartadd.cur differ
diff --git a/indra/newview/res/viewerRes.rc b/indra/newview/res/viewerRes.rc
index a53dece4221c6b5602accc6074bb42439dbd914b..df75f3f697f7fd2adc591037ca33c56d38d4d920 100644
--- a/indra/newview/res/viewerRes.rc
+++ b/indra/newview/res/viewerRes.rc
@@ -122,6 +122,12 @@ TOOLMEDIAOPEN           CURSOR                  "toolmediaopen.cur"
 TOOLBUY                 CURSOR                  "toolbuy.cur"
 TOOLOPEN                CURSOR                  "toolopen.cur"
 TOOLSIT                 CURSOR                  "toolsit.cur"
+TOOLPATHFINDING         CURSOR                  "lltoolpathfinding.cur"
+TOOLPATHFINDINGPATHSTART CURSOR                 "lltoolpathfindingpathstart.cur"
+TOOLPATHFINDINGPATHSTARTADD CURSOR              "lltoolpathfindingpathstartadd.cur"
+TOOLPATHFINDINGPATHEND  CURSOR                  "lltoolpathfindingpathend.cur"
+TOOLPATHFINDINGPATHENDADD CURSOR                "lltoolpathfindingpathendadd.cur"
+TOOLNO                  CURSOR                  "llno.cur"
 
 /////////////////////////////////////////////////////////////////////////////
 //
diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml
index b616e2327bbe99e484d0e3059b13c7a999393b91..9bf2922033fcdd5c5a127dcc32da1510a8f5c3ae 100644
--- a/indra/newview/skins/default/colors.xml
+++ b/indra/newview/skins/default/colors.xml
@@ -1,825 +1,861 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <colors>
 
-	<!-- Named Colors -->
-	<color
-	 name="EmphasisColor"
-	 value="0.38 0.694 0.573 1" />
-	<color
-	 name="EmphasisColor_13"
-	 value="0.38 0.694 0.573 0.13" />
-	<color
-	 name="EmphasisColor_35"
-	 value="0.38 0.694 0.573 0.35" />
-	<color
-	 name="White"
-	 value="1 1 1 1" />
-	<color
-	 name="White_05"
-	 value="1 1 1 0.05" />
-	<color
-	 name="White_10"
-	 value="1 1 1 0.1" />
-	<color
-	 name="White_25"
-	 value="1 1 1 0.25" />
-	<color
-	 name="White_50"
-	 value="1 1 1 0.5" />
-	<color
-	 name="LtGray"
-	 value="0.75 0.75 0.75 1" />
-	<color
-	 name="LtGray_35"
-	 value="0.75 0.75 0.75 0.35" />
-	<color
-	 name="LtGray_50"
-	 value="0.75 0.75 0.75 0.50" />
-	<color
-	 name="Gray"
-	 value="0.5 0.5 0.5 1" />
-	<color
-	 name="DkGray"
-	 value="0.125 0.125 0.125 1" />
-	<color
-	 name="DkGray_66"
-	 value="0.125 0.125 0.125 .66" />
-	<color
-	 name="DkGray2"
-	 value="0.169 0.169 0.169 1" />
-	<color
-	 name="MouseGray"
-	 value="0.191 0.191 0.191 1" />
-	<color
-	 name="Black"
-	 value="0 0 0 1" />
-	<colork
-	 name="Black_10"
-	 value="0 0 0 0.1" />
-	<color
-	 name="Black_25"
-	 value="0 0 0 0.25" />
-	<color
-	 name="Black_50"
-	 value="0 0 0 0.5" />
-	<color
-	name="FrogGreen"
-	value="0.26 0.345 0.263 1" />
-	<color
-	 name="Red"
-	 value="1 0 0 1" />
-	<color
-	 name="Blue"
-	 value="0 0 1 1" />
-	<color
-	 name="Yellow"
-	 value="1 1 0 1" />
-	<color
-	 name="Green"
-	 value="0 1 0 1" />
-	<color
-	 name="Transparent"
-	 value="0 0 0 0" />
-	<color
-	name="Purple"
-	value="1 0 1 1" />
-	<color
-	name="Lime"
-	value=".8 1 .73 1" />
-	<color
-	name="LtYellow"
-	value="1 1 .79 1" />
-	<color
-	name="DrYellow"
-	value="1 0.86 0 1" />
-	<color
-	name="LtOrange"
-	value="1 .85 .73 1" />
-	<color
-	name="MdBlue"
-	value=".07 .38 .51 1" />
+  <!-- Named Colors -->
+  <color
+      name="EmphasisColor"
+      value="0.38 0.694 0.573 1" />
+  <color
+      name="EmphasisColor_13"
+      value="0.38 0.694 0.573 0.13" />
+  <color
+      name="EmphasisColor_35"
+      value="0.38 0.694 0.573 0.35" />
+  <color
+      name="White"
+      value="1 1 1 1" />
+  <color
+      name="White_05"
+      value="1 1 1 0.05" />
+  <color
+      name="White_10"
+      value="1 1 1 0.1" />
+  <color
+      name="White_25"
+      value="1 1 1 0.25" />
+  <color
+      name="White_50"
+      value="1 1 1 0.5" />
+  <color
+      name="LtGray"
+      value="0.75 0.75 0.75 1" />
+  <color
+      name="LtGray_35"
+      value="0.75 0.75 0.75 0.35" />
+  <color
+      name="LtGray_50"
+      value="0.75 0.75 0.75 0.50" />
+  <color
+      name="Gray"
+      value="0.5 0.5 0.5 1" />
+  <color
+      name="DkGray"
+      value="0.125 0.125 0.125 1" />
+  <color
+      name="DkGray_66"
+      value="0.125 0.125 0.125 .66" />
+  <color
+      name="DkGray2"
+      value="0.169 0.169 0.169 1" />
+  <color
+      name="MouseGray"
+      value="0.191 0.191 0.191 1" />
+  <color
+      name="Black"
+      value="0 0 0 1" />
+  <colork
+      name="Black_10"
+      value="0 0 0 0.1" />
+  <color
+      name="Black_25"
+      value="0 0 0 0.25" />
+  <color
+      name="Black_50"
+      value="0 0 0 0.5" />
+  <color
+      name="FrogGreen"
+      value="0.26 0.345 0.263 1" />
+  <color
+      name="Red"
+      value="1 0 0 1" />
+  <color
+      name="Blue"
+      value="0 0 1 1" />
+  <color
+      name="Yellow"
+      value="1 1 0 1" />
+  <color
+      name="Green"
+      value="0 1 0 1" />
+  <color
+      name="Transparent"
+      value="0 0 0 0" />
+  <color
+      name="Purple"
+      value="1 0 1 1" />
+  <color
+      name="Lime"
+      value=".8 1 .73 1" />
+  <color
+      name="LtYellow"
+      value="1 1 .79 1" />
+  <color
+      name="DrYellow"
+      value="1 0.86 0 1" />
+  <color
+      name="LtOrange"
+      value="1 .85 .73 1" />
+  <color
+      name="MdBlue"
+      value=".07 .38 .51 1" />
+  <color
+      name="LtRed"
+      value="1 0.2 0.2 1" />
+  <color
+      name="LtGreen"
+      value="0.2 1 0.2 1" />
+  <color
+      name="Red_80"
+      value="1 0 0 0.8" />
+  <color
+      name="Green_80"
+      value="0 1 0 0.8" />
+  <color
+      name="Blue_80"
+      value="0 0 1 0.8" />
 
   <!-- This color name makes potentially unused colors show up bright purple.
-  Leave this here until all Unused? are removed below, otherwise
-  the viewer generates many warnings on startup. -->
+       Leave this here until all Unused? are removed below, otherwise
+       the viewer generates many warnings on startup. -->
   <color
-	 name="Unused?"
-	 value=".831 1 0 1" />
+      name="Unused?"
+      value=".831 1 0 1" />
 
   <!-- UI Definitions -->
 
-    <color
-     name="AccordionHeaderTextColor"
-     reference="LtGray" />
-    <color
-     name="AgentChatColor"
-     reference="White" />
-    <color
-     name="AlertBoxColor"
-     value="0.24 0.24 0.24 1" />
-    <color
-     name="AlertCautionBoxColor"
-     value="1 0.82 0.46 1" />
-    <color
-     name="AlertCautionTextColor"
-     reference="LtYellow" />
-    <color
-     name="AvatarListItemIconDefaultColor"
-     reference="White" />
-    <color
-     name="AvatarListItemIconOnlineColor"
-     reference="White" />
-    <color
-     name="AvatarListItemIconOfflineColor"
-     value="0.5 0.5 0.5 0.5" />
-    <color
-     name="AvatarListItemIconVoiceInvitedColor"
-     reference="AvatarListItemIconOfflineColor" />
-    <color
-     name="AvatarListItemIconVoiceJoinedColor"
-     reference="AvatarListItemIconOnlineColor" />
-    <color
-     name="AvatarListItemIconVoiceLeftColor"
-     reference="AvatarListItemIconOfflineColor" />
-    <color
-     name="BadgeImageColor"
-     value="1.0 0.40 0.0 1.0" />
-    <color
-     name="BadgeBorderColor"
-     value="0.9 0.9 0.9 1.0" />
-    <color
-     name="BadgeLabelColor"
-     reference="White" />
-    <color
-     name="ButtonBorderColor"
-     reference="Unused?" />
-    <color
-     name="ButtonCautionImageColor"
-     reference="Unused?" />
-    <color
-     name="ButtonColor"
-     reference="Unused?" />
-    <color
-     name="ButtonFlashBgColor"
-     reference="Unused?" />
-    <color
-     name="ButtonImageColor"
-     reference="White" />
-    <color
-     name="ButtonLabelColor"
-     reference="LtGray" />
-    <color
-     name="ButtonLabelDisabledColor"
-     reference="White_25" />
-    <color
-     name="ButtonLabelSelectedColor"
-     reference="White" />
-    <color
-     name="ButtonLabelSelectedDisabledColor"
-     reference="White_25" />
-    <color
-     name="ButtonSelectedBgColor"
-     reference="Unused?" />
-    <color
-     name="ButtonSelectedColor"
-     reference="Unused?" />
-    <color
-     name="ButtonUnselectedBgColor"
-     reference="Unused?" />
-    <color
-     name="ButtonUnselectedFgColor"
-     reference="Unused?" />
-    <color
-     name="ChatHistoryBgColor"
-     reference="Transparent" />
-    <color
-     name="ChatHistoryTextColor"
-     reference="LtGray" />
-    <color
-     name="ChicletFlashColor"
-     value="0.114 0.65 0.1" />
-    <color
-     name="ColorDropShadow"
-     reference="Black_50" />
-    <color
-     name="ColorPaletteEntry01"
-     reference="Black" />
-    <color
-     name="ColorPaletteEntry02"
-     reference="Gray" />
-    <color
-     name="ColorPaletteEntry03"
-     value="0.5 0 0 1" />
-    <color
-     name="ColorPaletteEntry04"
-     value="0.5 0.5 0 1" />
-    <color
-     name="ColorPaletteEntry05"
-     value="0 0.5 0 1" />
-    <color
-     name="ColorPaletteEntry06"
-     value="0 0.5 0.5 1" />
-    <color
-     name="ColorPaletteEntry07"
-     value="0 0 0.5 1" />
-    <color
-     name="ColorPaletteEntry08"
-     value="0.5 0 0.5 1" />
-    <color
-     name="ColorPaletteEntry09"
-     value="0.5 0.5 0 1" />
-    <color
-     name="ColorPaletteEntry10"
-     value="0 0.25 0.25 1" />
-    <color
-     name="ColorPaletteEntry11"
-     value="0 0.5 1 1" />
-    <color
-     name="ColorPaletteEntry12"
-     value="0 0.25 0.5 1" />
-    <color
-     name="ColorPaletteEntry13"
-     value="0.5 0 1 1" />
-    <color
-     name="ColorPaletteEntry14"
-     value="0.5 0.25 0 1" />
-    <color
-     name="ColorPaletteEntry15"
-     reference="White" />
-    <color
-     name="ColorPaletteEntry16"
-     reference="LtYellow" />
-    <color
-     name="ColorPaletteEntry17"
-     reference="White" />
-    <color
-     name="ColorPaletteEntry18"
-     reference="LtGray" />
-    <color
-     name="ColorPaletteEntry19"
-     reference="Red" />
-    <color
-     name="ColorPaletteEntry20"
-     reference="Yellow" />
-    <color
-     name="ColorPaletteEntry21"
-     reference="Green" />
-    <color
-     name="ColorPaletteEntry22"
-     value="0 1 1 1" />
-    <color
-     name="ColorPaletteEntry23"
-     reference="Blue" />
-    <color
-     name="ColorPaletteEntry24"
-     reference="Purple" />
-    <color
-     name="ColorPaletteEntry25"
-     value="1 1 0.5 1" />
-    <color
-     name="ColorPaletteEntry26"
-     value="0 1 0.5 1" />
-    <color
-     name="ColorPaletteEntry27"
-     value="0.5 1 1 1" />
-    <color
-     name="ColorPaletteEntry28"
-     value="0.5 0.5 1 1" />
-    <color
-     name="ColorPaletteEntry29"
-     value="1 0 0.5 1" />
-    <color
-     name="ColorPaletteEntry30"
-     value="1 0.5 0 1" />
-    <color
-     name="ColorPaletteEntry31"
-     reference="White" />
-    <color
-     name="ColorPaletteEntry32"
-     reference="White" />
-    <color
-     name="ComboListBgColor"
-     reference="DkGray" />
-    <color
-     name="ConsoleBackground"
-     reference="Black" />
-    <color
-     name="ContextSilhouetteColor"
-     reference="EmphasisColor" />
-    <color
-     name="DefaultHighlightDark"
-     reference="White_10" />
-    <color
-     name="DefaultHighlightLight"
-     reference="White_25" />
-    <color
-     name="DefaultShadowDark"
-     reference="Black_50" />
-    <color
-     name="DefaultShadowLight"
-     reference="Black_50" />
-    <color
-     name="EffectColor"
-     reference="White" />
-     <color
-     name="FilterBackgroundColor"
-     reference="Black" />
-    <color
-     name="FilterTextColor"
-     value="0.38 0.69 0.57 1" />
-     <color
-     name="FloaterButtonImageColor"
-     reference="LtGray" />
-    <color
-     name="FloaterDefaultBackgroundColor"
-     reference="DkGray_66" />
-    <color
-     name="FloaterFocusBackgroundColor"
-     reference="DkGray2" />
-    <color
-     name="FloaterFocusBorderColor"
-     reference="Black_50" />
-    <color
-     name="FloaterUnfocusBorderColor"
-     reference="Black_50" />
-    <color
-     name="FocusColor"
-     reference="EmphasisColor" />
-    <color
-     name="FolderViewLoadingMessageTextColor"
-     value="0.3344 0.5456 0.5159 1" />
-    <color
-     name="GridFocusPointColor"
-     reference="White_50" />
-    <color
-     name="GridlineBGColor"
-     value="0.92 0.92 1 0.78" />
-    <color
-     name="GridlineColor"
-     reference="White" />
-    <color
-     name="GridlineShadowColor"
-     value="0 0 0 0.31" />
-    <color
-     name="GroupNotifyBoxColor"
-     value="0.3344 0.5456 0.5159 1" />
-    <color
-     name="GroupNotifyTextColor"
-     reference="White"/>
-    <color
-     name="GroupNotifyDimmedTextColor"
-     reference="LtGray" />
-    <color
-     name="GroupOverTierColor"
-     value="0.43 0.06 0.06 1" />
-    <color
-     name="HTMLLinkColor"
-     reference="EmphasisColor" />
-    <color
-     name="HealthTextColor"
-     reference="White" />
-    <color
-     name="HelpBgColor"
-     reference="Unused?" />
-    <color
-     name="HelpFgColor"
-     reference="Unused?" />
-    <color
-     name="HelpScrollHighlightColor"
-     reference="Unused?" />
-    <color
-     name="HelpScrollShadowColor"
-     reference="Unused?" />
-    <color
-     name="HelpScrollThumbColor"
-     reference="Unused?" />
-    <color
-     name="HelpScrollTrackColor"
-     reference="Unused?" />
-    <color
-     name="HighlightChildColor"
-     reference="Yellow" />
-    <color
-     name="HighlightInspectColor"
-     value="1 0 1 1" />
-    <color
-     name="HighlightParentColor"
-     value="0.67 0.83 0.96 1" />
-    <color
-     name="IMHistoryBgColor"
-     reference="Unused?" />
-    <color
-     name="IMHistoryTextColor"
-     reference="Unused?" />
-    <color
-     name="IconDisabledColor"
-	 reference="White_25" />
-    <color
-     name="IconEnabledColor"
-     reference="White" />
-    <color
-     name="InventoryBackgroundColor"
-     reference="DkGray2" />
-    <color
-     name="InventoryFocusOutlineColor"
-     reference="White_25" />
-    <color
-     name="InventoryItemSuffixColor"
-     reference="White_25" />
-    <color
-     name="InventoryItemLibraryColor"
-     reference="EmphasisColor" />
-    <color
-     name="InventoryItemLinkColor"
-     reference="LtGray_50" />
-    <color
-     name="InventoryMouseOverColor"
-     reference="LtGray_35" />
-    <color
-     name="InventorySearchStatusColor"
-     reference="EmphasisColor" />
-    <color
-     name="LabelDisabledColor"
-     reference="White_25" />
-    <color
-     name="LabelSelectedColor"
-     reference="White" />
-    <color
-     name="LabelSelectedDisabledColor"
-     reference="White_25" />
-    <color
-     name="LabelTextColor"
-     reference="LtGray" />
-    <color
-     name="LoginProgressBarBgColor"
-     reference="Unused?" />
-    <color
-     name="LoginProgressBarFgColor"
-     reference="Unused?" />
-    <color
-     name="LoginProgressBoxBorderColor"
-     value="0 0.12 0.24 0" />
-    <color
-     name="LoginProgressBoxCenterColor"
-     value="0 0 0 0.78" />
-    <color
-     name="LoginProgressBoxShadowColor"
-     value="0 0 0 0.78" />
-    <color
-     name="LoginProgressBoxTextColor"
-     reference="White" />
-    <color
-     name="MapAvatarColor"
-     reference="Green" />
-    <color
-     name="MapAvatarFriendColor"
-     reference="Yellow" />
-    <color
-     name="MapAvatarSelfColor"
-     value="0.53125 0 0.498047 1" />
-    <color
-     name="MapFrustumColor"
-     reference="White_10" />
-    <color
-     name="MapFrustumRotatingColor"
-     value="1 1 1 0.2" />
-    <color
-     name="MapTrackColor"
-     reference="Red" />
-    <color
-     name="MapTrackDisabledColor"
-     value="0.5 0 0 1" />
-    <color
-     name="MenuBarBgColor"
-     reference="DkGray" />
-    <color
-     name="MenuBarGodBgColor"
-     reference="FrogGreen" />
-    <color
-     name="MenuDefaultBgColor"
-     reference="DkGray2" />
-    <color
-     name="MenuItemDisabledColor"
-	 reference="LtGray_50" />
-    <color
-     name="MenuItemEnabledColor"
-     reference="LtGray" />
-    <color
-     name="MenuItemHighlightBgColor"
-     reference="EmphasisColor_35" />
-    <color
-     name="MenuItemHighlightFgColor"
-     reference="White" />
-    <color
-     name="MenuNonProductionBgColor"
-     reference="Black" />
-    <color
-     name="MenuNonProductionGodBgColor"
-     value="0.263 0.325 0.345 1" />
-    <color
-     name="MenuPopupBgColor"
-	  reference="DkGray2" />
-    <color
-     name="ModelUploaderLabels"
-     value="1 0.6 0 1" />	  
-    <color
-     name="MultiSliderDisabledThumbColor"
-     reference="Black" />
-    <color
-     name="MultiSliderThumbCenterColor"
-     reference="White" />
-    <color
-     name="MultiSliderThumbCenterSelectedColor"
-     reference="Green" />
-    <color
-     name="MultiSliderThumbOutlineColor"
-     reference="Unused?" />
-    <color
-     name="MultiSliderTrackColor"
-     reference="LtGray" />
-    <color
-     name="MultiSliderTriangleColor"
-     reference="Yellow" />
+  <color
+      name="AccordionHeaderTextColor"
+      reference="LtGray" />
+  <color
+      name="AgentChatColor"
+      reference="White" />
+  <color
+      name="AlertBoxColor"
+      value="0.24 0.24 0.24 1" />
+  <color
+      name="AlertCautionBoxColor"
+      value="1 0.82 0.46 1" />
+  <color
+      name="AlertCautionTextColor"
+      reference="LtYellow" />
+  <color
+      name="AvatarListItemIconDefaultColor"
+      reference="White" />
+  <color
+      name="AvatarListItemIconOnlineColor"
+      reference="White" />
+  <color
+      name="AvatarListItemIconOfflineColor"
+      value="0.5 0.5 0.5 0.5" />
+  <color
+      name="AvatarListItemIconVoiceInvitedColor"
+      reference="AvatarListItemIconOfflineColor" />
+  <color
+      name="AvatarListItemIconVoiceJoinedColor"
+      reference="AvatarListItemIconOnlineColor" />
+  <color
+      name="AvatarListItemIconVoiceLeftColor"
+      reference="AvatarListItemIconOfflineColor" />
+  <color
+      name="BadgeImageColor"
+      value="1.0 0.40 0.0 1.0" />
+  <color
+      name="BadgeBorderColor"
+      value="0.9 0.9 0.9 1.0" />
+  <color
+      name="BadgeLabelColor"
+      reference="White" />
+  <color
+      name="ButtonBorderColor"
+      reference="Unused?" />
+  <color
+      name="ButtonCautionImageColor"
+      reference="Unused?" />
+  <color
+      name="ButtonColor"
+      reference="Unused?" />
+  <color
+      name="ButtonFlashBgColor"
+      reference="Unused?" />
+  <color
+      name="ButtonImageColor"
+      reference="White" />
+  <color
+      name="ButtonLabelColor"
+      reference="LtGray" />
+  <color
+      name="ButtonLabelDisabledColor"
+      reference="White_25" />
+  <color
+      name="ButtonLabelSelectedColor"
+      reference="White" />
+  <color
+      name="ButtonLabelSelectedDisabledColor"
+      reference="White_25" />
+  <color
+      name="ButtonSelectedBgColor"
+      reference="Unused?" />
+  <color
+      name="ButtonSelectedColor"
+      reference="Unused?" />
+  <color
+      name="ButtonUnselectedBgColor"
+      reference="Unused?" />
+  <color
+      name="ButtonUnselectedFgColor"
+      reference="Unused?" />
+  <color
+      name="ChatHistoryBgColor"
+      reference="Transparent" />
+  <color
+      name="ChatHistoryTextColor"
+      reference="LtGray" />
+  <color
+      name="ChicletFlashColor"
+      value="0.114 0.65 0.1" />
+  <color
+      name="ColorDropShadow"
+      reference="Black_50" />
+  <color
+      name="ColorPaletteEntry01"
+      reference="Black" />
+  <color
+      name="ColorPaletteEntry02"
+      reference="Gray" />
+  <color
+      name="ColorPaletteEntry03"
+      value="0.5 0 0 1" />
+  <color
+      name="ColorPaletteEntry04"
+      value="0.5 0.5 0 1" />
+  <color
+      name="ColorPaletteEntry05"
+      value="0 0.5 0 1" />
+  <color
+      name="ColorPaletteEntry06"
+      value="0 0.5 0.5 1" />
+  <color
+      name="ColorPaletteEntry07"
+      value="0 0 0.5 1" />
+  <color
+      name="ColorPaletteEntry08"
+      value="0.5 0 0.5 1" />
+  <color
+      name="ColorPaletteEntry09"
+      value="0.5 0.5 0 1" />
+  <color
+      name="ColorPaletteEntry10"
+      value="0 0.25 0.25 1" />
+  <color
+      name="ColorPaletteEntry11"
+      value="0 0.5 1 1" />
+  <color
+      name="ColorPaletteEntry12"
+      value="0 0.25 0.5 1" />
+  <color
+      name="ColorPaletteEntry13"
+      value="0.5 0 1 1" />
+  <color
+      name="ColorPaletteEntry14"
+      value="0.5 0.25 0 1" />
+  <color
+      name="ColorPaletteEntry15"
+      reference="White" />
+  <color
+      name="ColorPaletteEntry16"
+      reference="LtYellow" />
+  <color
+      name="ColorPaletteEntry17"
+      reference="White" />
+  <color
+      name="ColorPaletteEntry18"
+      reference="LtGray" />
+  <color
+      name="ColorPaletteEntry19"
+      reference="Red" />
+  <color
+      name="ColorPaletteEntry20"
+      reference="Yellow" />
+  <color
+      name="ColorPaletteEntry21"
+      reference="Green" />
+  <color
+      name="ColorPaletteEntry22"
+      value="0 1 1 1" />
+  <color
+      name="ColorPaletteEntry23"
+      reference="Blue" />
+  <color
+      name="ColorPaletteEntry24"
+      reference="Purple" />
+  <color
+      name="ColorPaletteEntry25"
+      value="1 1 0.5 1" />
+  <color
+      name="ColorPaletteEntry26"
+      value="0 1 0.5 1" />
+  <color
+      name="ColorPaletteEntry27"
+      value="0.5 1 1 1" />
+  <color
+      name="ColorPaletteEntry28"
+      value="0.5 0.5 1 1" />
+  <color
+      name="ColorPaletteEntry29"
+      value="1 0 0.5 1" />
+  <color
+      name="ColorPaletteEntry30"
+      value="1 0.5 0 1" />
+  <color
+      name="ColorPaletteEntry31"
+      reference="White" />
+  <color
+      name="ColorPaletteEntry32"
+      reference="White" />
+  <color
+      name="ComboListBgColor"
+      reference="DkGray" />
+  <color
+      name="ConsoleBackground"
+      reference="Black" />
+  <color
+      name="ContextSilhouetteColor"
+      reference="EmphasisColor" />
+  <color
+      name="DefaultHighlightDark"
+      reference="White_10" />
+  <color
+      name="DefaultHighlightLight"
+      reference="White_25" />
+  <color
+      name="DefaultShadowDark"
+      reference="Black_50" />
+  <color
+      name="DefaultShadowLight"
+      reference="Black_50" />
+  <color
+      name="EffectColor"
+      reference="White" />
+  <color
+      name="FilterBackgroundColor"
+      reference="Black" />
+  <color
+      name="FilterTextColor"
+      value="0.38 0.69 0.57 1" />
+  <color
+      name="FloaterButtonImageColor"
+      reference="LtGray" />
+  <color
+      name="FloaterDefaultBackgroundColor"
+      reference="DkGray_66" />
+  <color
+      name="FloaterFocusBackgroundColor"
+      reference="DkGray2" />
+  <color
+      name="FloaterFocusBorderColor"
+      reference="Black_50" />
+  <color
+      name="FloaterUnfocusBorderColor"
+      reference="Black_50" />
+  <color
+      name="FocusColor"
+      reference="EmphasisColor" />
+  <color
+      name="FolderViewLoadingMessageTextColor"
+      value="0.3344 0.5456 0.5159 1" />
+  <color
+      name="GridFocusPointColor"
+      reference="White_50" />
+  <color
+      name="GridlineBGColor"
+      value="0.92 0.92 1 0.78" />
+  <color
+      name="GridlineColor"
+      reference="White" />
+  <color
+      name="GridlineShadowColor"
+      value="0 0 0 0.31" />
+  <color
+      name="GroupNotifyBoxColor"
+      value="0.3344 0.5456 0.5159 1" />
+  <color
+      name="GroupNotifyTextColor"
+      reference="White"/>
+  <color
+      name="GroupNotifyDimmedTextColor"
+      reference="LtGray" />
+  <color
+      name="GroupOverTierColor"
+      value="0.43 0.06 0.06 1" />
+  <color
+      name="HTMLLinkColor"
+      reference="EmphasisColor" />
+  <color
+      name="HealthTextColor"
+      reference="White" />
+  <color
+      name="HelpBgColor"
+      reference="Unused?" />
+  <color
+      name="HelpFgColor"
+      reference="Unused?" />
+  <color
+      name="HelpScrollHighlightColor"
+      reference="Unused?" />
+  <color
+      name="HelpScrollShadowColor"
+      reference="Unused?" />
+  <color
+      name="HelpScrollThumbColor"
+      reference="Unused?" />
+  <color
+      name="HelpScrollTrackColor"
+      reference="Unused?" />
+  <color
+      name="HighlightChildColor"
+      reference="Yellow" />
+  <color
+      name="HighlightInspectColor"
+      value="1 0 1 1" />
+  <color
+      name="HighlightParentColor"
+      value="0.67 0.83 0.96 1" />
+  <color
+      name="IMHistoryBgColor"
+      reference="Unused?" />
+  <color
+      name="IMHistoryTextColor"
+      reference="Unused?" />
+  <color
+      name="IconDisabledColor"
+      reference="White_25" />
+  <color
+      name="IconEnabledColor"
+      reference="White" />
+  <color
+      name="InventoryBackgroundColor"
+      reference="DkGray2" />
+  <color
+      name="InventoryFocusOutlineColor"
+      reference="White_25" />
+  <color
+      name="InventoryItemSuffixColor"
+      reference="White_25" />
+  <color
+      name="InventoryItemLibraryColor"
+      reference="EmphasisColor" />
+  <color
+      name="InventoryItemLinkColor"
+      reference="LtGray_50" />
+  <color
+      name="InventoryMouseOverColor"
+      reference="LtGray_35" />
+  <color
+      name="InventorySearchStatusColor"
+      reference="EmphasisColor" />
+  <color
+      name="LabelDisabledColor"
+      reference="White_25" />
+  <color
+      name="LabelSelectedColor"
+      reference="White" />
+  <color
+      name="LabelSelectedDisabledColor"
+      reference="White_25" />
+  <color
+      name="LabelTextColor"
+      reference="LtGray" />
+  <color
+      name="LoginProgressBarBgColor"
+      reference="Unused?" />
+  <color
+      name="LoginProgressBarFgColor"
+      reference="Unused?" />
+  <color
+      name="LoginProgressBoxBorderColor"
+      value="0 0.12 0.24 0" />
+  <color
+      name="LoginProgressBoxCenterColor"
+      value="0 0 0 0.78" />
+  <color
+      name="LoginProgressBoxShadowColor"
+      value="0 0 0 0.78" />
+  <color
+      name="LoginProgressBoxTextColor"
+      reference="White" />
+  <color
+      name="MapAvatarColor"
+      reference="Green" />
+  <color
+      name="MapAvatarFriendColor"
+      reference="Yellow" />
+  <color
+      name="MapAvatarSelfColor"
+      value="0.53125 0 0.498047 1" />
+  <color
+      name="MapFrustumColor"
+      reference="White_10" />
+  <color
+      name="MapFrustumRotatingColor"
+      value="1 1 1 0.2" />
+  <color
+      name="MapTrackColor"
+      reference="Red" />
+  <color
+      name="MapTrackDisabledColor"
+      value="0.5 0 0 1" />
+  <color
+      name="MenuBarBgColor"
+      reference="DkGray" />
+  <color
+      name="MenuBarGodBgColor"
+      reference="FrogGreen" />
+  <color
+      name="MenuDefaultBgColor"
+      reference="DkGray2" />
+  <color
+      name="MenuItemDisabledColor"
+      reference="LtGray_50" />
+  <color
+      name="MenuItemEnabledColor"
+      reference="LtGray" />
+  <color
+      name="MenuItemHighlightBgColor"
+      reference="EmphasisColor_35" />
+  <color
+      name="MenuItemHighlightFgColor"
+      reference="White" />
+  <color
+      name="MenuNonProductionBgColor"
+      reference="Black" />
+  <color
+      name="MenuNonProductionGodBgColor"
+      value="0.263 0.325 0.345 1" />
+  <color
+      name="MenuPopupBgColor"
+      reference="DkGray2" />
+  <color
+      name="ModelUploaderLabels"
+      value="1 0.6 0 1" />	  
+  <color
+      name="MultiSliderDisabledThumbColor"
+      reference="Black" />
+  <color
+      name="MultiSliderThumbCenterColor"
+      reference="White" />
+  <color
+      name="MultiSliderThumbCenterSelectedColor"
+      reference="Green" />
+  <color
+      name="MultiSliderThumbOutlineColor"
+      reference="Unused?" />
+  <color
+      name="MultiSliderTrackColor"
+      reference="LtGray" />
+  <color
+      name="MultiSliderTriangleColor"
+      reference="Yellow" />
   <!--
-    <color
+      <color
       name="NameTagBackground"
       value="0.85 0.85 0.85 0.80" />
-      -->
-    <color
+  -->
+  <color
       name="NameTagBackground"
       value="0 0 0 1" />
-    <color
-     name="NameTagChat"
-     reference="White" />
-    <color
-     name="NameTagFriend"
-     value="0.447 0.784 0.663 1" />
-    <color
-     name="NameTagLegacy"
-     reference="White" />
-    <color
-     name="NameTagMatch"
-     reference="White" />
-    <color
-     name="NameTagMismatch"
-     reference="White" />
-    <color
-     name="NetMapBackgroundColor"
-     value="0 0 0 1" />
-    <color
-     name="NetMapGroupOwnAboveWater"
-     reference="Purple" />
-    <color
-     name="NetMapGroupOwnBelowWater"
-     value="0.78 0 0.78 1" />
-    <color
-     name="NetMapOtherOwnAboveWater"
-     value="0.24 0.24 0.24 1" />
-    <color
-     name="NetMapOtherOwnBelowWater"
-     value="0.12 0.12 0.12 1" />
-    <color
-     name="NetMapYouOwnAboveWater"
-     value="0 1 1 1" />
-    <color
-     name="NetMapYouOwnBelowWater"
-     value="0 0.78 0.78 1" />
-    <color
-     name="NotifyBoxColor"
-     value="LtGray" />
-    <color
-     name="NotifyCautionBoxColor"
-     value="1 0.82 0.46 1" />
-    <color
-     name="NotifyCautionWarnColor"
-     reference="White" />
-    <color
-     name="NotifyTextColor"
-     reference="White" />
-    <color
-     name="ObjectBubbleColor"
-     reference="DkGray_66" />
-    <color
-     name="ObjectChatColor"
-     reference="EmphasisColor" />
-    <color
-     name="OverdrivenColor"
-     reference="Red" />
-    <color
-     name="PanelDefaultBackgroundColor"
-     reference="DkGray" />
-    <color
-     name="PanelDefaultHighlightLight"
-     reference="White_50" />
-    <color
-     name="PanelFocusBackgroundColor"
-     reference="DkGray2" />
-    <color
-     name="PanelNotificationBackground"
-     value="1 0.3 0.3 0" />
-    <color
-     name="ParcelHoverColor"
-     reference="White" />
-    <color
-     name="PieMenuBgColor"
-     value="0.24 0.24 0.24 0.59" />
-    <color
-     name="PieMenuLineColor"
-     value="0 0 0 0.5" />
-    <color
-     name="PieMenuSelectedColor"
-     value="0.72 0.72 0.74 0.3" />
-    <color
-     name="PropertyColorAuction"
-     value="0.5 0 1 0.4" />
-    <color
-     name="PropertyColorAvail"
-     reference="Transparent" />
-    <color
-     name="PropertyColorForSale"
-     value="1 0.5 0 0.4" />
-    <color
-     name="PropertyColorGroup"
-     value="0 0.72 0.72 0.4" />
-    <color
-     name="PropertyColorOther"
-     value="1 0 0 0.4" />
-    <color
-     name="PropertyColorSelf"
-     value="0 1 0 0.4" />
-    <color
-     name="ScriptBgReadOnlyColor"
-     value="0.39 0.39 0.39 1" />
-    <color
-     name="ScriptErrorColor"
-     reference="Red" />
-    <color
-     name="ScrollBGStripeColor"
-     reference="Transparent" />
-    <color
-     name="ScrollBgReadOnlyColor"
+  <color
+      name="NameTagChat"
+      reference="White" />
+  <color
+      name="NameTagFriend"
+      value="0.447 0.784 0.663 1" />
+  <color
+      name="NameTagLegacy"
+      reference="White" />
+  <color
+      name="NameTagMatch"
+      reference="White" />
+  <color
+      name="NameTagMismatch"
+      reference="White" />
+  <color
+      name="NetMapBackgroundColor"
+      value="0 0 0 1" />
+  <color
+      name="NetMapGroupOwnAboveWater"
+      reference="Purple" />
+  <color
+      name="NetMapGroupOwnBelowWater"
+      value="0.78 0 0.78 1" />
+  <color
+      name="NetMapOtherOwnAboveWater"
+      value="0.24 0.24 0.24 1" />
+  <color
+      name="NetMapOtherOwnBelowWater"
+      value="0.12 0.12 0.12 1" />
+  <color
+      name="NetMapYouOwnAboveWater"
+      value="0 1 1 1" />
+  <color
+      name="NetMapYouOwnBelowWater"
+      value="0 0.78 0.78 1" />
+  <color
+      name="NotifyBoxColor"
+      value="LtGray" />
+  <color
+      name="NotifyCautionBoxColor"
+      value="1 0.82 0.46 1" />
+  <color
+      name="NotifyCautionWarnColor"
+      reference="White" />
+  <color
+      name="NotifyTextColor"
+      reference="White" />
+  <color
+      name="ObjectBubbleColor"
+      reference="DkGray_66" />
+  <color
+      name="ObjectChatColor"
+      reference="EmphasisColor" />
+  <color
+      name="OverdrivenColor"
+      reference="Red" />
+  <color
+      name="PanelDefaultBackgroundColor"
+      reference="DkGray" />
+  <color
+      name="PanelDefaultHighlightLight"
+      reference="White_50" />
+  <color
+      name="PanelFocusBackgroundColor"
+      reference="DkGray2" />
+  <color
+      name="PanelNotificationBackground"
+      value="1 0.3 0.3 0" />
+  <color
+      name="ParcelHoverColor"
+      reference="White" />
+  <color
+      name="PathfindingErrorColor"
+      reference="LtRed" />
+  <color
+      name="PathfindingWarningColor"
+      reference="DrYellow" />
+  <color
+      name="PathfindingGoodColor"
+      reference="LtGreen" />
+  <color
+      name="PathfindingDefaultBeaconColor"
+      reference="Red_80" />
+  <color
+      name="PathfindingDefaultBeaconTextColor"
+      reference="White" />
+  <color
+      name="PathfindingLinksetBeaconColor"
+      reference="Blue_80" />
+  <color
+      name="PathfindingCharacterBeaconColor"
+      reference="Red_80" />
+  <color
+      name="PieMenuBgColor"
+      value="0.24 0.24 0.24 0.59" />
+  <color
+      name="PieMenuLineColor"
+      value="0 0 0 0.5" />
+  <color
+      name="PieMenuSelectedColor"
+      value="0.72 0.72 0.74 0.3" />
+  <color
+      name="PropertyColorAuction"
+      value="0.5 0 1 0.4" />
+  <color
+      name="PropertyColorAvail"
       reference="Transparent" />
-    <color
-     name="ScrollBgWriteableColor"
-     reference="White_05" />
-    <color
-     name="ScrollDisabledColor"
-     reference="White_25" />
-    <color
-     name="ScrollHighlightedColor"
-     reference="Unused?" />
-    <color
-     name="ScrollHoveredColor"
-     reference="EmphasisColor_13" />
-    <color
-     name="ScrollSelectedBGColor"
-     reference="EmphasisColor_35" />
-    <color
-     name="ScrollSelectedFGColor"
-     reference="White" />
-    <color
-     name="ScrollUnselectedColor"
-     reference="LtGray" />
-    <color
-     name="ScrollbarThumbColor"
-     reference="White" />
-    <color
-     name="ScrollbarTrackColor"
-     reference="Black" />
-    <color
-     name="SelectedOutfitTextColor"
-     reference="EmphasisColor" />
-    <color
-     name="SilhouetteChildColor"
-     value="0.13 0.42 0.77 1" />
-    <color
-     name="SilhouetteParentColor"
-     reference="Yellow" />
-    <color
-     name="SliderDisabledThumbColor"
-     reference="White_25" />
-    <color
-     name="SliderThumbCenterColor"
-     reference="White" />
-    <color
-     name="SliderThumbOutlineColor"
-     reference="White" />
-    <color
-     name="SliderTrackColor"
-     reference="Unused?" />
-    <color
-     name="SpeakingColor"
-     reference="FrogGreen" />
-    <color
-     name="SystemChatColor"
-     reference="LtGray" />
-    <color
-     name="TextBgFocusColor"
-     reference="White" />
-    <color
-     name="TextBgReadOnlyColor"
-	 reference="White_05" />
-    <color
-     name="TextBgWriteableColor"
-     reference="LtGray" />
-    <color
-     name="TextCursorColor"
-     reference="Black" />
-    <color
-     name="TextDefaultColor"
-     reference="Black" />
-    <color
-     name="TextEmbeddedItemColor"
-     value="0 0 0.5 1" />
-    <color
-     name="TextEmbeddedItemReadOnlyColor"
-     reference="Unused?" />
-    <color
-     name="TextFgColor"
-     value="0.102 0.102 0.102 1" />
-    <color
-     name="TextFgReadOnlyColor"
-     reference="LtGray" />
-    <color
-     name="TextFgTentativeColor"
-     value="0.4 0.4 0.4 1" />
-    <color
-     name="TimeTextColor"
-     reference="LtGray" />
-    <color
-     name="TitleBarFocusColor"
-     reference="White_10" />
-    <color
-     name="ToastBackground"
-     value="0.3 0.3 0.3 0" />
-    <color
-     name="ToolTipBgColor"
-     value="0.937 0.89 0.655 1" />
-    <color
-     name="ToolTipBorderColor"
-     value="0.812 0.753 0.451 1" />
-    <color
-     name="ToolTipTextColor"
-     reference="DkGray2" />
-    <color
-     name="InspectorTipTextColor"
-     reference="LtGray" />
-    <color
-     name="UserChatColor"
-     reference="White" />
-    <color
-     name="llOwnerSayChatColor"
-     reference="LtYellow" />
+  <color
+      name="PropertyColorForSale"
+      value="1 0.5 0 0.4" />
+  <color
+      name="PropertyColorGroup"
+      value="0 0.72 0.72 0.4" />
+  <color
+      name="PropertyColorOther"
+      value="1 0 0 0.4" />
+  <color
+      name="PropertyColorSelf"
+      value="0 1 0 0.4" />
+  <color
+      name="ScriptBgReadOnlyColor"
+      value="0.39 0.39 0.39 1" />
+  <color
+      name="ScriptErrorColor"
+      reference="Red" />
+  <color
+      name="ScrollBGStripeColor"
+      reference="Transparent" />
+  <color
+      name="ScrollBgReadOnlyColor"
+      reference="Transparent" />
+  <color
+      name="ScrollBgWriteableColor"
+      reference="White_05" />
+  <color
+      name="ScrollDisabledColor"
+      reference="White_25" />
+  <color
+      name="ScrollHighlightedColor"
+      reference="Unused?" />
+  <color
+      name="ScrollHoveredColor"
+      reference="EmphasisColor_13" />
+  <color
+      name="ScrollSelectedBGColor"
+      reference="EmphasisColor_35" />
+  <color
+      name="ScrollSelectedFGColor"
+      reference="White" />
+  <color
+      name="ScrollUnselectedColor"
+      reference="LtGray" />
+  <color
+      name="ScrollbarThumbColor"
+      reference="White" />
+  <color
+      name="ScrollbarTrackColor"
+      reference="Black" />
+  <color
+      name="SelectedOutfitTextColor"
+      reference="EmphasisColor" />
+  <color
+      name="SilhouetteChildColor"
+      value="0.13 0.42 0.77 1" />
+  <color
+      name="SilhouetteParentColor"
+      reference="Yellow" />
+  <color
+      name="SliderDisabledThumbColor"
+      reference="White_25" />
+  <color
+      name="SliderThumbCenterColor"
+      reference="White" />
+  <color
+      name="SliderThumbOutlineColor"
+      reference="White" />
+  <color
+      name="SliderTrackColor"
+      reference="Unused?" />
+  <color
+      name="SpeakingColor"
+      reference="FrogGreen" />
+  <color
+      name="SystemChatColor"
+      reference="LtGray" />
+  <color
+      name="TextBgFocusColor"
+      reference="White" />
+  <color
+      name="TextBgReadOnlyColor"
+      reference="White_05" />
+  <color
+      name="TextBgWriteableColor"
+      reference="LtGray" />
+  <color
+      name="TextCursorColor"
+      reference="Black" />
+  <color
+      name="TextDefaultColor"
+      reference="Black" />
+  <color
+      name="TextEmbeddedItemColor"
+      value="0 0 0.5 1" />
+  <color
+      name="TextEmbeddedItemReadOnlyColor"
+      reference="Unused?" />
+  <color
+      name="TextFgColor"
+      value="0.102 0.102 0.102 1" />
+  <color
+      name="TextFgReadOnlyColor"
+      reference="LtGray" />
+  <color
+      name="TextFgTentativeColor"
+      value="0.4 0.4 0.4 1" />
+  <color
+      name="TimeTextColor"
+      reference="LtGray" />
+  <color
+      name="TitleBarFocusColor"
+      reference="White_10" />
+  <color
+      name="ToastBackground"
+      value="0.3 0.3 0.3 0" />
+  <color
+      name="ToolTipBgColor"
+      value="0.937 0.89 0.655 1" />
+  <color
+      name="ToolTipBorderColor"
+      value="0.812 0.753 0.451 1" />
+  <color
+      name="ToolTipTextColor"
+      reference="DkGray2" />
+  <color
+      name="InspectorTipTextColor"
+      reference="LtGray" />
+  <color
+      name="UserChatColor"
+      reference="White" />
+  <color
+      name="llOwnerSayChatColor"
+      reference="LtYellow" />
 
-    <!-- New Colors -->
-    <color
-     name="OutputMonitorMutedColor"
-     reference="DkGray2" />
-    <color
-     name="SysWellItemUnselected"
-     value="0 0 0 0" />
-    <color
-     name="SysWellItemSelected"
-     value="0.3 0.3 0.3 1.0" />
-    <color
-    name="ColorSwatchBorderColor"
-    value="0.45098 0.517647 0.607843 1"/>
-    <color
-     name="ChatTimestampColor"
-     reference="White" />
-    <color
-     name="MenuBarProjectBgColor"
-     reference="MdBlue" />
+  <!-- New Colors -->
+  <color
+      name="OutputMonitorMutedColor"
+      reference="DkGray2" />
+  <color
+      name="SysWellItemUnselected"
+      value="0 0 0 0" />
+  <color
+      name="SysWellItemSelected"
+      value="0.3 0.3 0.3 1.0" />
+  <color
+      name="ColorSwatchBorderColor"
+      value="0.45098 0.517647 0.607843 1"/>
+  <color
+      name="ChatTimestampColor"
+      reference="White" />
+  <color
+      name="MenuBarProjectBgColor"
+      reference="MdBlue" />
   
-    <color
+  <color
       name="MeshImportTableNormalColor"
       value="1 1 1 1"/>
-    <color
+  <color
       name="MeshImportTableHighlightColor"
       value="0.2 0.8 1 1"/>
 
-    <color
-     name="DirectChatColor"
-     reference="LtOrange" />
+  <color
+      name="DirectChatColor"
+      reference="LtOrange" />
 
-    <color
+  <color
       name="ToolbarDropZoneColor"
       value=".48 .69 1 .5" />
   
-    <!-- Generic color names (legacy) -->
+  <!-- Generic color names (legacy) -->
   <color
-    name="white"
-    value="1 1 1 1"/>
+      name="white"
+      value="1 1 1 1"/>
   <color
-    name="black"
-    value="0 0 0 1"/>
+      name="black"
+      value="0 0 0 1"/>
   <color
-    name="red"
-    value="1 0 0 1"/>
+      name="red"
+      value="1 0 0 1"/>
   <color
-    name="green"
-    value="0 1 0 1"/>
+      name="green"
+      value="0 1 0 1"/>
   <color
-    name="blue"
-    value="0 0 1 1"/>
+      name="blue"
+      value="0 0 1 1"/>
 </colors>
diff --git a/indra/newview/skins/default/textures/icons/Pathfinding_Dirty.png b/indra/newview/skins/default/textures/icons/Pathfinding_Dirty.png
new file mode 100644
index 0000000000000000000000000000000000000000..cfa12cb7cc247d75d4b103fb34d98de70ba89a32
Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Pathfinding_Dirty.png differ
diff --git a/indra/newview/skins/default/textures/icons/Pathfinding_Disabled.png b/indra/newview/skins/default/textures/icons/Pathfinding_Disabled.png
new file mode 100644
index 0000000000000000000000000000000000000000..0622141848d674ff013842bc0554b25679f91c41
Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Pathfinding_Disabled.png differ
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index 7ca6820318ba3c96857760a0a14b320455163da3..06f8f8c67051061f5bcc264b1f4c6ae456f203cc 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -431,6 +431,9 @@ with the same filename but different name
  <texture name="Parcel_Voice_Light" file_name="icons/Parcel_Voice_Light.png" preload="false" />
  <texture name="Parcel_VoiceNo_Light" file_name="icons/Parcel_VoiceNo_Light.png" preload="false" />
 
+  <texture name="Pathfinding_Dirty" file_name="icons/Pathfinding_Dirty.png" preload="false" />
+  <texture name="Pathfinding_Disabled" file_name="icons/Pathfinding_Disabled.png" preload="false" />
+
   <texture name="Pause_Off" file_name="icons/Pause_Off.png" preload="false" />
   <texture name="Pause_Over" file_name="icons/Pause_Over.png" preload="false" />
   <texture name="Pause_Press" file_name="icons/Pause_Press.png" preload="false" />
diff --git a/indra/newview/skins/default/xui/de/floater_hardware_settings.xml b/indra/newview/skins/default/xui/de/floater_hardware_settings.xml
index ca081aafae842d59710dbbff2ece273cdd9c4b12..fd6c9a0875aa5d1663a0a0466bb82b7014d3cfd0 100644
--- a/indra/newview/skins/default/xui/de/floater_hardware_settings.xml
+++ b/indra/newview/skins/default/xui/de/floater_hardware_settings.xml
@@ -25,6 +25,10 @@
 		VBO aktivieren:
 	</text>
 	<check_box initial_value="true" label="OpenGL Vertex-Buffer-Objekte aktivieren" name="vbo" tool_tip="Wenn Sie über moderne Grafikhardware verfügen, können Sie durch Aktivieren dieser Option die Geschwindigkeit verbessern.  Bei alter Hardware sind die VBO oft schlecht implementiert, was zu Abstürzen führen kann, wenn diese Option aktiviert ist."/>
+	<text name="tc label">
+		S3TC aktivieren:
+	</text>
+	<check_box initial_value="true" label="Texturkomprimierung aktivieren (Neustart erforderlich)" name="texture compression" tool_tip="Komprimiert Texturen im Videospeicher, damit höher auflösende Texturen geladen werden können (leichte Beeinträchtigung der Farbqualität)."/>
 	<slider label="Texturen-Cache (MB):" name="GraphicsCardTextureMemory" tool_tip="Speicherplatz, der für Texturen zur Verfügung steht. In der Regel handelt es sich um Grafikkartenspeicher. Ein kleinerer Wert kann die Geschwindigkeit erhöhen, aber auch zu Texturunschärfen führen."/>
 	<spinner label="Nebeldistanzverhältnis:" name="fog"/>
 	<button label="OK" label_selected="OK" name="OK"/>
diff --git a/indra/newview/skins/default/xui/de/floater_stats.xml b/indra/newview/skins/default/xui/de/floater_stats.xml
index f6dc9fe15d3ea01d14ebc6afd7b1e3b428820552..92d057a4fef558529a8e3e05fed2980978f45100 100644
--- a/indra/newview/skins/default/xui/de/floater_stats.xml
+++ b/indra/newview/skins/default/xui/de/floater_stats.xml
@@ -14,8 +14,11 @@
 					<stat_bar label="Pro Sek. gezeichnete KTris" name="ktrissec"/>
 					<stat_bar label="Objektanzahl" name="objs"/>
 					<stat_bar label="Neue Objekte" name="newobjs"/>
+					<stat_bar label="Objektcache-Trefferrate" name="object_cache_hits"/>
 				</stat_view>
 				<stat_view label="Textur" name="texture">
+					<stat_bar label="Cache-Trefferrate" name="texture_cache_hits"/>
+					<stat_bar label="Cache-Leselatenz" name="texture_cache_read_latency"/>
 					<stat_bar label="Zählen" name="numimagesstat"/>
 					<stat_bar label="Rohanzahl" name="numrawimagesstat"/>
 					<stat_bar label="GL Sp" name="gltexmemstat"/>
diff --git a/indra/newview/skins/default/xui/de/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/de/floater_texture_ctrl.xml
index 8944c79c7d725aa01e93e0f0fb3359eaf8c297de..5bb96bebc42a1eee06b3007879506c18ce0d619b 100644
--- a/indra/newview/skins/default/xui/de/floater_texture_ctrl.xml
+++ b/indra/newview/skins/default/xui/de/floater_texture_ctrl.xml
@@ -1,24 +1,35 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="texture picker" title="TEXTUR AUSWÄHLEN">
-	<string name="choose_picture">
+	<floater.string name="choose_picture">
 		Zum Auswählen eines Bildes hier klicken
-	</string>
+	</floater.string>
+	<floater.string name="pick title">
+		Auswählen:
+	</floater.string>
 	<text name="Multiple">
 		Mehrere Texturen
 	</text>
+	<radio_group name="mode_selection">
+		<radio_item label="Inventar" name="inventory" value="0"/>
+		<radio_item label="Lokal" name="local" value="1"/>
+	</radio_group>
 	<text name="unknown">
 		Größe: [DIMENSIONS]
 	</text>
 	<button label="Standard" label_selected="Standard" name="Default"/>
-	<button label="Keine" label_selected="Keine" name="None"/>
 	<button label="Leer" label_selected="Leer" name="Blank"/>
-	<check_box label="Ordner anzeigen" name="show_folders_check"/>
-	<search_editor label="Texturen filtern" name="inventory search editor"/>
-	<check_box label="Jetzt übernehmen" name="apply_immediate_check"/>
+	<button label="Keine" label_selected="Keine" name="None"/>
 	<button label="" label_selected="" name="Pipette"/>
-	<button label="Abbrechen" label_selected="Abbrechen" name="Cancel"/>
+	<filter_editor label="Texturen filtern" name="inventory search editor"/>
+	<check_box initial_value="false" label="Ordner anzeigen" name="show_folders_check"/>
+	<button label="Hinzufügen" label_selected="Hinzufügen" name="l_add_btn"/>
+	<button label="Entfernen" label_selected="Entfernen" name="l_rem_btn"/>
+	<button label="Hochladen" label_selected="Hochladen" name="l_upl_btn"/>
+	<scroll_list name="l_name_list">
+		<column label="Name" name="unit_name"/>
+		<column label="ID" name="unit_id_HIDDEN"/>
+	</scroll_list>
 	<button label="OK" label_selected="OK" name="Select"/>
-	<text name="pick title">
-		Auswählen:
-	</text>
+	<button label="Abbrechen" label_selected="Abbrechen" name="Cancel"/>
+	<check_box initial_value="true" label="Jetzt übernehmen" name="apply_immediate_check"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/de/floater_texture_fetch_debugger.xml b/indra/newview/skins/default/xui/de/floater_texture_fetch_debugger.xml
new file mode 100644
index 0000000000000000000000000000000000000000..0f407cb15c0505ab8cfd539f113c2f664c8cc176
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/floater_texture_fetch_debugger.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="TexFetchDebugger" title="Debugger für Texturabruffehler">
+	<text name="total_num_fetched_label">
+		1, Gesamtzahl abgerufener Texturen: [NUM]
+	</text>
+	<text name="total_num_fetching_requests_label">
+		2, Gesamtzahl von Abrufanforderungen: [NUM]
+	</text>
+	<text name="total_num_cache_hits_label">
+		3, Gesamtzahl von Cachetreffern: [NUM]
+	</text>
+	<text name="total_num_visible_tex_label">
+		4, Gesamtzahl sichtbarer Texturen: [NUM]
+	</text>
+	<text name="total_num_visible_tex_fetch_req_label">
+		5, Gesamtzahl von Abrufanforderungen für sichtbare Texturen: [NUM]
+	</text>
+	<text name="total_fetched_data_label">
+		6, Gesamtmenge abgerufener Daten: [SIZE1] KB, decodierte Daten: [SIZE2] KB, [PIXEL] MPixel
+	</text>
+	<text name="total_fetched_vis_data_label">
+		7, Gesamtmenge sichtbarer Daten: [SIZE1] KB, decodierte Daten: [SIZE2] KB
+	</text>
+	<text name="total_fetched_rendered_data_label">
+		8, Gesamtmenge dargestellter Daten: [SIZE1] KB, decodierte Daten: [SIZE2] KB, [PIXEL] MPixel
+	</text>
+	<text name="total_time_cache_read_label">
+		9, Gesamtzeit Cache-Lesezugriffe: [TIME] s
+	</text>
+	<text name="total_time_cache_write_label">
+		10, Gesamtzeit Cache-Schreibzugriffe: [TIME] s
+	</text>
+	<text name="total_time_decode_label">
+		11, Gesamtzeit Decodierung: [TIME] s
+	</text>
+	<text name="total_time_gl_label">
+		12, Gesamtzeit GL-Texturerstellung: [TIME] s
+	</text>
+	<text name="total_time_http_label">
+		13, Gesamtzeit HTTP-Abrufe: [TIME] s
+	</text>
+	<text name="total_time_fetch_label">
+		14, Gesamtzeit für alle Abrufe: [TIME] s
+	</text>
+	<text name="total_time_refetch_vis_cache_label">
+		15, Neuabruf sichtbarer Texturen aus Cache, Zeit: [TIME] s, Abrufmenge: [SIZE2] KB, [PIXEL] MPixel
+	</text>
+	<text name="total_time_refetch_vis_http_label">
+		16, Neuabruf sichtbarer Texturen von HTTP, Zeit: [TIME] s, Abrufmenge: [SIZE2] KB, [PIXEL] MPixel
+	</text>
+	<spinner label="17, Verhältnis Texel/Pixel:" name="texel_pixel_ratio"/>
+	<button label="Starten" name="start_btn"/>
+	<button label="Zurücksetzen" name="clear_btn"/>
+	<button label="Schließen" name="close_btn"/>
+	<button label="Cache-Lesezugriff" name="cacheread_btn"/>
+	<button label="Cache-Schreibzugriff" name="cachewrite_btn"/>
+	<button label="HTTP" name="http_btn"/>
+	<button label="Decodieren" name="decode_btn"/>
+	<button label="GL-Textur" name="gl_btn"/>
+	<button label="Neuabruf sichtbarer Texturen (Cache)" name="refetchviscache_btn"/>
+	<button label="Neuabruf sichtbarer Texturen (HTTP)" name="refetchvishttp_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/de/floater_window_size.xml b/indra/newview/skins/default/xui/de/floater_window_size.xml
index a2a53e0567a658dc5dcee65603360dd73e6d8eb0..6502f002a16cf1f7976bb2cd923fcac443be3a0f 100644
--- a/indra/newview/skins/default/xui/de/floater_window_size.xml
+++ b/indra/newview/skins/default/xui/de/floater_window_size.xml
@@ -7,10 +7,17 @@
 		Fenstergröße einstellen:
 	</text>
 	<combo_box name="window_size_combo" tool_tip="Breite x Höhe">
-		<combo_box.item label="1000 x 700 (Standard)" name="item0"/>
-		<combo_box.item label="1024 x 768" name="item1"/>
-		<combo_box.item label="1280 x 720 (720p)" name="item2"/>
-		<combo_box.item label="1920 x 1080 (1080p)" name="item3"/>
+		<combo_box.item label="1000 x 700 (Standard)" name="item1"/>
+		<combo_box.item label="1024 x 768 (4:3 XGA)" name="item2"/>
+		<combo_box.item label="1280 x 720 (16:9 HDTV)" name="item3"/>
+		<combo_box.item label="1280 x 800 (5:8 WXGA)" name="item4"/>
+		<combo_box.item label="1280 x 1024 (5:4 SXGA)" name="item5"/>
+		<combo_box.item label="1440 x 900 (8:5 WSXGA)" name="item7"/>
+		<combo_box.item label="1600 x 900 (16:9 HD+)" name="item8"/>
+		<combo_box.item label="1600 x 1200 (4:3 UXGA)" name="item9"/>
+		<combo_box.item label="1680 x 1050 (8:5 WSXGA+)" name="item10"/>
+		<combo_box.item label="1920 x 1080 (16:9 HDTV)" name="item11"/>
+		<combo_box.item label="1920 x 1200 (8:5 WUXGA)" name="item12"/>
 	</combo_box>
 	<button label="Festlegen" name="set_btn"/>
 	<button label="Abbrechen" name="cancel_btn"/>
diff --git a/indra/newview/skins/default/xui/de/menu_viewer.xml b/indra/newview/skins/default/xui/de/menu_viewer.xml
index d011c7295cb7169d8b42bc6985b9e1f4238e2d69..c4c4defab9fb5f26a4d8ce08f8e8371c2d401ea3 100644
--- a/indra/newview/skins/default/xui/de/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/de/menu_viewer.xml
@@ -21,7 +21,6 @@
 			<menu_item_call label="Beschäftigt" name="Set Busy"/>
 		</menu>
 		<menu_item_call label="L$ kaufen..." name="Buy and Sell L$"/>
-		<menu_item_call label="Händler-Outbox..." name="MerchantOutbox"/>
 		<menu_item_call label="Kontoübersicht..." name="Manage My Account">
 			<menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=de"/>
 		</menu_item_call>
@@ -227,11 +226,10 @@
 			<menu_item_check label="Textur" name="Texture Console"/>
 			<menu_item_check label="Fehler beseitigen" name="Debug Console"/>
 			<menu_item_call label="Meldungen" name="Notifications"/>
-			<menu_item_check label="Texturgröße" name="Texture Size"/>
-			<menu_item_check label="Texture-Kategorie" name="Texture Category"/>
 			<menu_item_check label="Schnelle Timer" name="Fast Timers"/>
 			<menu_item_check label="Speicher" name="Memory"/>
 			<menu_item_check label="Szenestatistiken" name="Scene Statistics"/>
+			<menu_item_call label="Debug-Konsole für Texturabruffehler" name="Texture Fetch Debug Console"/>
 			<menu_item_call label="Info zu Region in Fenster Fehler beseitigen" name="Region Info to Debug Console"/>
 			<menu_item_call label="Gruppeninfo in Fenster Fehler beseitigen" name="Group Info to Debug Console"/>
 			<menu_item_call label="Info zu Fähigkeiten in Fenster Fehler beseitigen" name="Capabilities Info to Debug Console"/>
@@ -289,6 +287,12 @@
 			<menu_item_check label="Komplexität beim Rendern" name="rendercomplexity"/>
 			<menu_item_check label="Byte in Anhängen" name="attachment bytes"/>
 			<menu_item_check label="Formen" name="Sculpt"/>
+			<menu label="Texturdichte" name="Texture Density">
+				<menu_item_check label="Keine" name="None"/>
+				<menu_item_check label="Aktuelle" name="Current"/>
+				<menu_item_check label="Gewünschte" name="Desired"/>
+				<menu_item_check label="Volle" name="Full"/>
+			</menu>
 		</menu>
 		<menu label="Rendering" name="Rendering">
 			<menu_item_check label="Achsen" name="Axes"/>
@@ -306,7 +310,6 @@
 			<menu_item_check label="Animationstexturen" name="Animation Textures"/>
 			<menu_item_check label="Texturen deaktivieren" name="Disable Textures"/>
 			<menu_item_check label="Voll-Res-Texturen" name="Rull Res Textures"/>
-			<menu_item_check label="Texturen prüfen" name="Audit Textures"/>
 			<menu_item_check label="Textur-Atlas (experimentell)" name="Texture Atlas"/>
 			<menu_item_check label="Angehängte Lichter rendern" name="Render Attached Lights"/>
 			<menu_item_check label="Angehängte Partikel rendern" name="Render Attached Particles"/>
diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml
index ac068fcd4ea1be1ed135094464bac53d5e69ffa5..f7274d31e1367b04459a4ca72a0796996eb93c0a 100644
--- a/indra/newview/skins/default/xui/de/notifications.xml
+++ b/indra/newview/skins/default/xui/de/notifications.xml
@@ -502,6 +502,15 @@ Weitere Informationen finden Sie auf [_URL].
 		</url>
 		<usetemplate ignoretext="Meine Hardware wird nicht unterstützt" name="okcancelignore" notext="Nein" yestext="Ja"/>
 	</notification>
+	<notification name="IntelOldDriver">
+		Wahrscheinlich gibt es einen neueren Treiber für Ihren Grafikchip. Durch Aktualisieren der Grafiktreiber lässt sich die Leistung u. U. beträchtlich verbessern.
+
+    Unter [_URL] nach aktualisierten Treibern suchen?
+		<url name="url">
+			http://www.intel.com/p/de_DE/support/detect/graphics
+		</url>
+		<usetemplate ignoretext="Mein Grafiktreiber ist veraltet" name="okcancelignore" notext="Nein" yestext="Ja"/>
+	</notification>
 	<notification name="UnknownGPU">
 		Ihr System verwendet eine Grafikkarte, die [APP_NAME] nicht erkennt.
 Dies passiert dann, wenn die neue Hardware noch nicht mit [APP_NAME] getestet wurde.  Wahrscheinlich wird das Programm richtig ausgeführt, aber Sie müssen eventuell ein paar Grafikeinstellungen vornehmen.
@@ -2628,16 +2637,12 @@ Ist das OK?
 		</form>
 	</notification>
 	<notification name="ScriptQuestionCaution">
-		Das Objekt „&lt;nolink&gt;[OBJECTNAME]&lt;/nolink&gt;“, das „[NAME]“ gehört, stellt folgende Anfrage:
-
-[QUESTIONS]
-Wenn Sie diesem Objekt und seinem Ersteller nicht vertrauen, sollten Sie diese Anfrage ablehnen.
-
-Anfrage gestatten?
+		Achtung: Das Objekt „&lt;nolink&gt;[OBJECTNAME]&lt;/nolink&gt;“ fordert uneingeschränkten Zugriff auf Ihr Linden-Dollar-Konto an. Wenn Sie Zugriff gewähren, kann dieses Objekt jederzeit und ohne weitere Warnung Ihr Konto belasten bzw. ganz leeren.
+  
+Eine solche Anforderung ist nur in seltenen Fällen legitim. Gewähren Sie dem Objekt nur dann Zugriff, wenn Sie genau verstehen, wieso ein solcher Zugriff auf Ihr Konto erforderlich ist.
 		<form name="form">
-			<button name="Grant" text="Gewähren"/>
+			<button name="Grant" text="Uneingeschränkten Zugriff gewähren"/>
 			<button name="Deny" text="Verweigern"/>
-			<button name="Details" text="Info..."/>
 		</form>
 	</notification>
 	<notification name="ScriptDialog">
@@ -3135,4 +3140,16 @@ Ansonsten können Sie auf der Karte nachsehen und dort Ort suchen, die als „In
 	<global name="You died and have been teleported to your home location">
 		Sie sind gestorben und wurden zu Ihrem Zuhause teleportiert.
 	</global>
+	<notification name="LocalBitmapsUpdateFileNotFound">
+		[FNAME] wurde nicht gefunden und konnte deshalb nicht aktualisiert werden.
+Zukünftige Aktualisierungen dieser Datei werden deaktiviert.
+	</notification>
+	<notification name="LocalBitmapsUpdateFailedFinal">
+		[FNAME] konnte auch nach [NRETRIES] Versuchen nicht geöffnet oder decodiert werden und gilt als beschädigt.
+Zukünftige Aktualisierungen dieser Datei werden deaktiviert.
+	</notification>
+	<notification name="LocalBitmapsVerifyFail">
+		Versuch, eine ungültige oder nicht lesbare Bilddatei ([FNAME]) hinzuzufügen, die nicht geöffnet oder decodiert werden konnte.
+Versuch abgebrochen.
+	</notification>
 </notifications>
diff --git a/indra/newview/skins/default/xui/de/panel_script_question_toast.xml b/indra/newview/skins/default/xui/de/panel_script_question_toast.xml
new file mode 100644
index 0000000000000000000000000000000000000000..a2d0237da010e5c72549a283f6a34c7561e17eab
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/panel_script_question_toast.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel label="script_question_panel" name="panel_script_question_toast">
+	<panel label="buttons_panel" name="buttons_panel"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml
index d917d33d12ee9426f2dc627fd62a0345137dba60..668a7b35bfaf2e64b122f8feb7a010c229bb3ce2 100644
--- a/indra/newview/skins/default/xui/de/strings.xml
+++ b/indra/newview/skins/default/xui/de/strings.xml
@@ -886,6 +886,9 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden.
 	<string name="ScriptQuestionCautionChatDenied">
 		Dem Objekt „[OBJECTNAME]“, ein Objekt von „[OWNERNAME]“, in [REGIONNAME] [REGIONPOS], wurde folgende Berechtigung verweigert: [PERMISSIONS].
 	</string>
+	<string name="AdditionalPermissionsRequestHeader">
+		Wenn Sie dem Objekt Zugriff auf Ihr Konto gewähren, kann dieses außerdem:
+	</string>
 	<string name="ScriptTakeMoney">
 		Linden-Dollar (L$) von Ihnen nehmen
 	</string>
@@ -919,6 +922,9 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden.
 	<string name="ControlYourCamera">
 		Kamerasteuerung
 	</string>
+	<string name="TeleportYourAgent">
+		Sie teleportieren
+	</string>
 	<string name="NotConnected">
 		Nicht verbunden
 	</string>
diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml
new file mode 100644
index 0000000000000000000000000000000000000000..46ee113b69361378b867bee7df04da8545de7f4c
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml
@@ -0,0 +1,209 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+    positioning="cascading"
+    can_resize="true"
+    can_tear_off="false"
+    height="273"
+    width="635"
+    min_height="273"
+    min_width="635"
+    layout="topleft"
+    name="floater_pathfinding_characters"
+    help_topic="floater_pathfinding_characters"
+    reuse_instance="true"
+    save_rect="false"
+    single_instance="true"
+    title="Pathfinding characters">
+  <floater.string name="messaging_initial"></floater.string>
+  <floater.string name="messaging_get_inprogress">Querying for pathfinding characters ...</floater.string>
+  <floater.string name="messaging_get_error">Error detected while querying for pathfinding characters.</floater.string>
+  <floater.string name="messaging_set_inprogress"></floater.string>
+  <floater.string name="messaging_set_error"></floater.string>
+  <floater.string name="messaging_complete_none_found">No pathfinding characters.</floater.string>
+  <floater.string name="messaging_complete_available">[NUM_SELECTED] characters selected out of [NUM_TOTAL].</floater.string>
+  <floater.string name="messaging_not_enabled">This region is not enabled for pathfinding.</floater.string>
+  <floater.string name="character_cpu_time">[CPU_TIME] µs</floater.string>
+  <floater.string name="character_owner_loading">[Loading]</floater.string>
+  <floater.string name="character_owner_unknown">[Unknown]</floater.string>
+  <floater.string name="character_owner_group">[group]</floater.string>
+  <panel
+      border="false"
+      bevel_style="none"
+      follows="left|top|right|bottom"
+      layout="topleft"
+      height="191"
+      width="635">
+    <scroll_list
+        column_padding="0"
+        draw_heading="true"
+        follows="all"
+        height="135"
+        layout="topleft"
+        left="18"
+        top_pad="10"
+        tab_stop="false"
+        multi_select="true"
+        name="objects_scroll_list"
+        width="600">
+      <scroll_list.columns
+          label="Name"
+          name="name"
+          dynamic_width="true" />
+      <scroll_list.columns
+          label="Description"
+          name="description"
+          width="172" />
+      <scroll_list.columns
+          label="Owner"
+          name="owner"
+          width="141" />
+      <scroll_list.columns
+          label="CPU"
+          name="cpu_time"
+          width="60" />
+      <scroll_list.columns
+          label="Altitude"
+          name="altitude"
+          width="64" />
+    </scroll_list>
+    <text
+        height="26"
+        word_wrap="true"
+        use_ellipses="false"
+        type="string"
+        text_color="LabelTextColor"
+        length="1"
+        follows="left|bottom|right"
+        layout="topleft"
+        name="messaging_status"
+        top_pad="17"
+        width="238">
+      Characters:
+    </text>
+    <button
+        follows="right|bottom"
+        height="21"
+        label="Refresh list"
+        layout="topleft"
+        name="refresh_objects_list"
+        top_pad="-29"
+        left_pad="0"
+        width="115"/>
+    <button
+        follows="right|bottom"
+        height="21"
+        label="Select all"
+        layout="topleft"
+        name="select_all_objects"
+        top_pad="-21"
+        left_pad="8"
+        width="115"/>
+    <button
+        follows="right|bottom"
+        height="21"
+        label="Select none"
+        layout="topleft"
+        name="select_none_objects"
+        top_pad="-21"
+        left_pad="8"
+        width="115"/>
+  </panel>
+  <view_border
+      bevel_style="none"
+      follows="left|right|bottom"
+      height="0"
+      layout="topleft"
+      name="horiz_separator"
+      top_pad="0"
+      left="18"
+      width="600"/>
+  <panel
+      border="false"
+      bevel_style="none"
+      follows="left|right|bottom"
+      layout="topleft"
+      left="0"
+      height="67"
+      width="635">
+    <text
+        height="13"
+        word_wrap="false"
+        use_ellipses="false"
+        type="string"
+        text_color="LabelTextColor"
+        text_readonly_color="LabelDisabledColor"
+        length="1"
+        follows="left|bottom|right"
+        layout="topleft"
+        name="actions_label"
+        left="18"
+        top_pad="8"
+        width="242">
+      Actions on selected characters:
+    </text>
+    <check_box
+        height="19"
+        follows="left|bottom"
+        label="Show beacon"
+        layout="topleft"
+        name="show_beacon"
+        top_pad="-16"
+        left_pad="0"
+        width="150" />
+    <check_box
+        height="19"
+        follows="left|bottom"
+        label="Show physics capsule"
+        layout="topleft"
+        name="show_physics_capsule"
+        top_pad="-19"
+        left_pad="0"
+        width="150" />
+    <button
+        follows="left|bottom"
+        height="22"
+        label="Take"
+        layout="topleft"
+        name="take_objects"
+        top_pad="9"
+        left="18"
+        width="94"/>
+    <button
+        follows="left|bottom"
+        height="22"
+        label="Take copy"
+        layout="topleft"
+        name="take_copy_objects"
+        top_pad="-22"
+        left_pad="6"
+        width="94"/>
+    <button
+        follows="left|bottom"
+        height="22"
+        label="Teleport me to it"
+        layout="topleft"
+        name="teleport_me_to_object"
+        tool_tip="Enabled only when one character is selected."
+        top_pad="-22"
+        left_pad="26"
+        width="159"/>
+    <button
+        follows="right|bottom"
+        height="22"
+        label="Return"
+        layout="topleft"
+        name="return_objects"
+        top_pad="-22"
+        left_pad="26"
+        width="94"/>
+    <button
+        follows="right|bottom"
+        height="22"
+        label="Delete"
+        layout="topleft"
+        name="delete_objects"
+        top_pad="-22"
+        left_pad="6"
+        width="94"/>
+  </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml
new file mode 100644
index 0000000000000000000000000000000000000000..26293130699004f3c76a0a46e4148139331ba87e
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml
@@ -0,0 +1,419 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+    positioning="cascading"
+    can_tear_off="false"
+    height="498"
+    layout="topleft"
+    name="floater_pathfinding_console"
+    help_topic="floater_pathfinding_console"
+    reuse_instance="true"
+    save_rect="true"
+    single_instance="true"
+    title="Pathfinding view / test"
+    width="240">
+  <floater.string name="navmesh_viewer_status_unknown"></floater.string>
+  <floater.string name="navmesh_viewer_status_library_not_implemented">Cannot find pathing library implementation.</floater.string>
+  <floater.string name="navmesh_viewer_status_region_not_enabled">This region is not enabled for pathfinding.</floater.string>
+  <floater.string name="navmesh_viewer_status_region_loading">Waiting for the region to finish loading.</floater.string>
+  <floater.string name="navmesh_viewer_status_checking_version">Checking the status of the navmesh.</floater.string>
+  <floater.string name="navmesh_viewer_status_downloading">Downloading the navmesh.</floater.string>
+  <floater.string name="navmesh_viewer_status_updating">The navmesh has changed on the server. Downloading the latest navmesh.</floater.string>
+  <floater.string name="navmesh_viewer_status_has_navmesh">Latest navmesh has been downloaded.</floater.string>
+  <floater.string name="navmesh_viewer_status_error">Unable to download navmesh successfully.</floater.string>
+  <floater.string name="navmesh_simulator_status_unknown"></floater.string>
+  <floater.string name="navmesh_simulator_status_pending">Navmesh has pending changes.</floater.string>
+  <floater.string name="navmesh_simulator_status_building">Navmesh is building.</floater.string>
+  <floater.string name="navmesh_simulator_status_some_pending">Some navmesh regions have pending changes.</floater.string>
+  <floater.string name="navmesh_simulator_status_some_building">Some navmesh regions are building.</floater.string>
+  <floater.string name="navmesh_simulator_status_pending_and_building">Some navmesh regions have pending changes and others are building.</floater.string>
+  <floater.string name="navmesh_simulator_status_complete">Navmesh is up-to-date.</floater.string>
+  <floater.string name="pathing_unknown"></floater.string>
+  <floater.string name="pathing_library_not_implemented">Cannot find pathing library implementation.</floater.string>
+  <floater.string name="pathing_region_not_enabled">This region is not enabled for pathfinding.</floater.string>
+  <floater.string name="pathing_choose_start_and_end_points">Please choose start and end points.</floater.string>
+  <floater.string name="pathing_choose_start_point">Please choose start point.</floater.string>
+  <floater.string name="pathing_choose_end_point">Please choose end point.</floater.string>
+  <floater.string name="pathing_path_valid">Path is shown in orange.</floater.string>
+  <floater.string name="pathing_path_invalid">A path between the chosen points cannot be found.</floater.string>
+  <floater.string name="pathing_error">An error occurred during path generation.</floater.string>
+  <panel
+      border="false"
+      bevel_style="none"
+      follows="left|top"
+      layout="topleft"
+      left="12"
+      top_pad="10"
+      height="61"
+      width="214">
+    <text
+        height="13"
+        word_wrap="true"
+        use_ellipses="false"
+        type="string"
+        text_color="LabelTextColor"
+        length="1"
+        layout="topleft"
+        left="0"
+        top_pad="0"
+        width="214">
+      Viewer status
+    </text>
+    <text
+        height="40"
+        word_wrap="true"
+        use_ellipses="false"
+        type="string"
+        text_color="PathfindingGoodColor"
+        length="1"
+        follows="left|top"
+        layout="topleft"
+        left="0"
+        name="pathfinding_viewer_status"
+        top_pad="8"
+        width="214">
+    </text>
+  </panel>
+  <panel
+      border="false"
+      bevel_style="none"
+      follows="left|top"
+      layout="topleft"
+      left="12"
+      height="66"
+      width="214">
+    <text
+        height="13"
+        word_wrap="true"
+        use_ellipses="false"
+        type="string"
+        text_color="LabelTextColor"
+        length="1"
+        layout="topleft"
+        left="0"
+        top_pad="5"
+        width="214">
+      Simulator status
+    </text>
+    <text
+        height="40"
+        word_wrap="true"
+        use_ellipses="false"
+        type="string"
+        text_color="PathfindingGoodColor"
+        length="1"
+        follows="left|top"
+        layout="topleft"
+        left="0"
+        name="pathfinding_simulator_status"
+        top_pad="8"
+        width="214">
+    </text>
+  </panel>
+  <view_border
+      bevel_style="none"
+      follows="top|left"
+      layout="topleft"
+      left="12"
+      top="179"
+      height="305"
+      width="213"
+      visible="true" />
+  <tab_container
+      follows="left|top"
+      layout="topleft"
+      tab_position="top"
+      name="view_test_tab_container"
+      left="12"
+      top="157"
+      height="328"
+      width="214">
+    <panel
+        border="false"
+        bevel_style="none"
+        follows="left|top"
+        layout="topleft"
+        name="view_panel"
+        label="View">
+      <text
+          height="13"
+          word_wrap="true"
+          use_ellipses="false"
+          type="string"
+          text_color="LabelTextColor"
+          text_readonly_color="LabelDisabledColor"
+          name="show_label"
+          length="1"
+          follows="left|top"
+          layout="topleft"
+          top_pad="20"
+          left="12"
+          width="200">
+        Show:
+      </text>
+      <check_box
+          height="19"
+          label="World"
+          layout="topleft"
+          name="show_world"
+          top_pad="4"
+          width="90" />
+      <check_box
+          height="19"
+          label="Movables only"
+          layout="topleft"
+          left="32"
+          name="show_world_movables_only"
+          top_pad="4"
+          width="90" />
+      <check_box
+          height="19"
+          label="Navmesh"
+          left="12"
+          layout="topleft"
+          name="show_navmesh"
+          top_pad="7"
+          width="90" />
+      <text
+          height="13"
+          word_wrap="true"
+          use_ellipses="false"
+          type="string"
+          text_color="LabelTextColor"
+          text_readonly_color="LabelDisabledColor"
+          name="show_walkability_label"
+          length="1"
+          follows="left|top"
+          layout="topleft"
+          left="32"
+          width="180">
+        Show walkability map:
+      </text>
+      <combo_box
+          height="19"
+          layout="topleft"
+          left="32"
+          name="show_heatmap_mode"
+          top_pad="8"
+          width="156">
+        <combo_box.item
+            label="Do not show"
+            name="show_heatmap_mode_none"
+            value="0" />
+        <combo_box.item
+            label="Character type A"
+            name="show_heatmap_mode_a"
+            value="1" />
+        <combo_box.item
+            label="Character type B"
+            name="show_heatmap_mode_b"
+            value="2" />
+        <combo_box.item
+            label="Character type C"
+            name="show_heatmap_mode_c"
+            value="3" />
+        <combo_box.item
+            label="Character type D"
+            name="show_heatmap_mode_d"
+            value="4" />
+      </combo_box>
+      <check_box
+          height="19"
+          label="Walkables"
+          layout="topleft"
+          left="12"
+          name="show_walkables"
+          top_pad="10"
+          width="90" />
+      <check_box
+          height="19"
+          label="Material volumes"
+          layout="topleft"
+          name="show_material_volumes"
+          top_pad="4"
+          width="90" />
+      <check_box
+          height="19"
+          label="Static obstacles"
+          layout="topleft"
+          name="show_static_obstacles"
+          top_pad="4"
+          width="90" />
+      <check_box
+          height="19"
+          label="Exclusion volumes"
+          layout="topleft"
+          name="show_exclusion_volumes"
+          top_pad="4"
+          width="90" />
+      <check_box
+          height="19"
+          label="Water plane"
+          layout="topleft"
+          name="show_water_plane"
+          top_pad="4"
+          width="90" />
+      <check_box
+          height="19"
+          label="With X-ray vision"
+          layout="topleft"
+          name="show_xray"
+          top_pad="4"
+          width="90" />
+    </panel>
+    <panel
+        border="false"
+        bevel_style="none"
+        follows="left|top"
+        layout="topleft"
+        name="test_panel"
+        label="Test path">
+      <text
+          height="14"
+          word_wrap="true"
+          use_ellipses="false"
+          type="string"
+          text_color="LabelTextColor"
+          text_readonly_color="LabelDisabledColor"
+          name="ctrl_click_label"
+          length="1"
+          left="12"
+          follows="left|top"
+          layout="topleft"
+          top_pad="20"
+          width="202">
+        Ctrl-click to select start point.
+      </text>
+      <text
+          height="14"
+          word_wrap="true"
+          use_ellipses="false"
+          type="string"
+          text_color="LabelTextColor"
+          text_readonly_color="LabelDisabledColor"
+          name="shift_click_label"
+          length="1"
+          follows="left|top"
+          layout="topleft"
+          top_pad="5"
+          width="202">
+        Shift-click to select end point.
+      </text>
+      <view_border
+          bevel_style="none"
+          follows="top|left"
+          layout="topleft"
+          height="0"
+          width="185"
+          top_pad="13"
+          visible="true" />
+      <text
+          height="14"
+          word_wrap="true"
+          use_ellipses="false"
+          type="string"
+          text_color="LabelTextColor"
+          text_readonly_color="LabelDisabledColor"
+          name="character_width_label"
+          length="1"
+          follows="left|top"
+          layout="topleft"
+          top_pad="14"
+          width="202">
+        Character width
+      </text>
+      <slider
+          decimal_digits="1"
+          height="14"
+          increment="0.1"
+          layout="topleft"
+          follows="left|top"
+          max_val="2"
+          min_val="0.2"
+          name="character_width"
+          top_pad="5"
+          value="1"
+          width="145" />
+      <text
+          height="14"
+          word_wrap="false"
+          use_ellipses="false"
+          type="string"
+          text_color="LabelTextColor"
+          text_readonly_color="LabelDisabledColor"
+          name="character_width_unit_label"
+          length="1"
+          follows="left|top"
+          layout="topleft"
+          top_pad="-14"
+          left_pad="0"
+          width="20">
+        m
+      </text>
+      <text
+          height="14"
+          word_wrap="true"
+          use_ellipses="false"
+          type="string"
+          text_color="LabelTextColor"
+          text_readonly_color="LabelDisabledColor"
+          name="character_type_label"
+          length="1"
+          follows="left|top"
+          layout="topleft"
+          left_pad="-165"
+          top_pad="13"
+          width="202">
+        Character type
+      </text>
+      <combo_box
+          follows="top|left"
+          layout="topleft"
+          height="19"
+          width="156"
+          top_pad="5"
+          name="path_character_type">
+        <combo_box.item
+            label="None"
+            name="path_character_type_none"
+            value="0" />
+        <combo_box.item
+            label="A"
+            name="path_character_type_a"
+            value="1" />
+        <combo_box.item
+            label="B"
+            name="path_character_type_b"
+            value="2" />
+        <combo_box.item
+            label="C"
+            name="path_character_type_c"
+            value="3" />
+        <combo_box.item
+            label="D"
+            name="path_character_type_d"
+            value="4" />
+      </combo_box>
+      <text
+          height="14"
+          word_wrap="true"
+          use_ellipses="false"
+          type="string"
+          text_color="PathfindingGoodColor"
+          length="1"
+          follows="left|top"
+          layout="topleft"
+          name="path_test_status"
+          top_pad="11"
+          width="202">
+      </text>
+      <button
+          follows="left|top"
+          height="22"
+          label="Clear path"
+          layout="topleft"
+          name="clear_path"
+          top_pad="27"
+          width="96"/>
+    </panel>
+  </tab_container>
+</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml
new file mode 100644
index 0000000000000000000000000000000000000000..eaed92ac55f7e42c42dde11de8170fc17395d09b
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml
@@ -0,0 +1,589 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+    positioning="cascading"
+    can_resize="true"
+    can_tear_off="false"
+    height="395"
+    width="1015"
+    min_height="395"
+    min_width="1015"
+    layout="topleft"
+    name="floater_pathfinding_linksets"
+    help_topic="floater_pathfinding_linksets"
+    reuse_instance="true"
+    save_rect="false"
+    single_instance="true"
+    title="Pathfinding linksets">
+  <floater.string name="messaging_initial"></floater.string>
+  <floater.string name="messaging_get_inprogress">Querying for pathfinding linksets ...</floater.string>
+  <floater.string name="messaging_get_error">Error detected while querying for pathfinding linksets.</floater.string>
+  <floater.string name="messaging_set_inprogress">Modifying selected pathfinding linksets ...</floater.string>
+  <floater.string name="messaging_set_error">Error detected while modifying selected pathfinding linksets.</floater.string>
+  <floater.string name="messaging_complete_none_found">No pathfinding linksets.</floater.string>
+  <floater.string name="messaging_complete_available">[NUM_SELECTED] linksets selected out of [NUM_TOTAL].</floater.string>
+  <floater.string name="messaging_not_enabled">This region is not enabled for pathfinding.</floater.string>
+  <floater.string name="linkset_terrain_name">[Terrain]</floater.string>
+  <floater.string name="linkset_terrain_description">--</floater.string>
+  <floater.string name="linkset_terrain_owner">--</floater.string>
+  <floater.string name="linkset_terrain_land_impact">--</floater.string>
+  <floater.string name="linkset_terrain_dist_from_you">--</floater.string>
+  <floater.string name="linkset_owner_loading">[Loading]</floater.string>
+  <floater.string name="linkset_owner_unknown">[Unknown]</floater.string>
+  <floater.string name="linkset_owner_group">[group]</floater.string>
+  <floater.string name="linkset_use_walkable">Walkable</floater.string>
+  <floater.string name="linkset_use_static_obstacle">Static obstacle</floater.string>
+  <floater.string name="linkset_use_dynamic_obstacle">Movable obstacle</floater.string>
+  <floater.string name="linkset_use_material_volume">Material volume</floater.string>
+  <floater.string name="linkset_use_exclusion_volume">Exclusion volume</floater.string>
+  <floater.string name="linkset_use_dynamic_phantom">Movable phantom</floater.string>
+  <floater.string name="linkset_is_terrain">[unmodifiable]</floater.string>
+  <floater.string name="linkset_is_restricted_state">[restricted]</floater.string>
+  <floater.string name="linkset_is_non_volume_state">[concave]</floater.string>
+  <floater.string name="linkset_is_restricted_non_volume_state">[restricted,concave]</floater.string>
+  <floater.string name="linkset_choose_use">Choose linkset use...</floater.string>
+  <panel
+      border="false"
+      bevel_style="none"
+      follows="left|top|right|bottom"
+      layout="topleft"
+      height="226"
+      width="999">
+    <text
+        height="13"
+        word_wrap="false"
+        use_ellipses="false"
+        type="string"
+        text_color="LabelTextColor"
+        length="1"
+        follows="left|top"
+        layout="topleft"
+        left="20"
+        top_pad="14"
+        width="67">
+      Filter by:
+    </text>
+    <text
+        height="13"
+        word_wrap="false"
+        use_ellipses="false"
+        type="string"
+        text_color="LabelTextColor"
+        length="1"
+        follows="left|top"
+        layout="topleft"
+        left_pad="0"
+        width="62">
+      Name
+    </text>
+    <line_editor
+        border_style="line"
+        border_thickness="1"
+        follows="left|top"
+        height="20"
+        layout="topleft"
+        left_pad="0"
+        top_pad="-18"
+        max_length_chars="255"
+        name="filter_by_name"
+        width="161" />
+    <text
+        height="13"
+        word_wrap="false"
+        use_ellipses="false"
+        type="string"
+        text_color="LabelTextColor"
+        length="1"
+        follows="left|top"
+        layout="topleft"
+        left_pad="22"
+        top_pad="-15"
+        width="88">
+      Description
+    </text>
+    <line_editor
+        border_style="line"
+        border_thickness="1"
+        follows="left|top"
+        height="20"
+        layout="topleft"
+        left_pad="0"
+        top_pad="-17"
+        max_length_chars="255"
+        name="filter_by_description"
+        width="162" />
+    <combo_box
+        height="20"
+        layout="topleft"
+        follows="left|top"
+        name="filter_by_linkset_use"
+        left_pad="32"
+        top_pad="-20"
+        width="199">
+      <combo_box.item
+          label="Filter by linkset use..."
+          name="filter_by_linkset_use_none"
+          value="0" />
+      <combo_box.item
+          label="Walkable"
+          name="filter_by_linkset_use_walkable"
+          value="1" />
+      <combo_box.item
+          label="Static obstacle"
+          name="filter_by_linkset_use_static_obstacle"
+          value="2" />
+      <combo_box.item
+          label="Movable obstacle"
+          name="filter_by_linkset_use_dynamic_obstacle"
+          value="3" />
+      <combo_box.item
+          label="Material volume"
+          name="filter_by_linkset_use_material_volume"
+          value="4" />
+      <combo_box.item
+          label="Exclusion volume"
+          name="filter_by_linkset_use_exclusion_volume"
+          value="5" />
+      <combo_box.item
+          label="Movable phantom"
+          name="filter_by_linkset_use_dynamic_phantom"
+          value="6" />
+    </combo_box>
+    <button
+        follows="right|top"
+        height="21"
+        label="Apply"
+        layout="topleft"
+        name="apply_filters"
+        top_pad="-21"
+        left_pad="31"
+        width="73"/>
+    <button
+        follows="right|top"
+        height="21"
+        label="Clear"
+        layout="topleft"
+        name="clear_filters"
+        top_pad="-21"
+        left_pad="8"
+        width="73"/>
+    <scroll_list
+        column_padding="0"
+        draw_heading="true"
+        follows="all"
+        height="135"
+        layout="topleft"
+        left="18"
+        top_pad="15"
+        tab_stop="false"
+        multi_select="true"
+        name="objects_scroll_list"
+        width="980">
+      <scroll_list.columns
+          label="Name (root prim)"
+          name="name"
+          dynamic_width="true" />
+      <scroll_list.columns
+          label="Description (root prim)"
+          name="description"
+          width="158" />
+      <scroll_list.columns
+          label="Owner"
+          name="owner"
+          width="141" />
+      <scroll_list.columns
+          label="Impact"
+          name="land_impact"
+          width="55" />
+      <scroll_list.columns
+          label="Distance"
+          name="dist_from_you"
+          width="65" />
+      <scroll_list.columns
+          label="Linkset use"
+          name="linkset_use"
+          width="236" />
+      <scroll_list.columns
+          label="A %"
+          name="a_percent"
+          width="41" />
+      <scroll_list.columns
+          label="B %"
+          name="b_percent"
+          width="41" />
+      <scroll_list.columns
+          label="C %"
+          name="c_percent"
+          width="41" />
+      <scroll_list.columns
+          label="D %"
+          name="d_percent"
+          width="41" />
+    </scroll_list>
+    <text
+        height="13"
+        word_wrap="false"
+        use_ellipses="false"
+        type="string"
+        text_color="LabelTextColor"
+        length="1"
+        follows="left|bottom|right"
+        layout="topleft"
+        name="messaging_status"
+        top_pad="17"
+        width="619">
+      Linksets:
+    </text>
+    <button
+        follows="right|bottom"
+        height="21"
+        label="Refresh list"
+        layout="topleft"
+        name="refresh_objects_list"
+        top_pad="-16"
+        left_pad="0"
+        width="115"/>
+    <button
+        follows="right|bottom"
+        height="21"
+        label="Select all"
+        layout="topleft"
+        name="select_all_objects"
+        top_pad="-21"
+        left_pad="8"
+        width="115"/>
+    <button
+        follows="right|bottom"
+        height="21"
+        label="Select none"
+        layout="topleft"
+        name="select_none_objects"
+        top_pad="-21"
+        left_pad="8"
+        width="115"/>
+  </panel>
+  <view_border
+      bevel_style="none"
+      follows="left|bottom|right"
+      height="0"
+      layout="topleft"
+      name="horiz_separator"
+      top_pad="0"
+      left="18"
+      width="979"/>
+  <panel
+      border="false"
+      bevel_style="none"
+      follows="left|right|bottom"
+      layout="topleft"
+      left="0"
+      height="67"
+      width="950">
+    <text
+        height="13"
+        word_wrap="false"
+        use_ellipses="false"
+        type="string"
+        text_color="LabelTextColor"
+        text_readonly_color="LabelDisabledColor"
+        length="1"
+        left="18"
+        follows="left|bottom|right"
+        layout="topleft"
+        top_pad="8"
+        width="580">
+      Actions on selected linksets (If a linkset is removed from the world, its attributes may be lost):
+    </text>
+    <check_box
+        height="19"
+        follows="left|bottom"
+        label="Show beacon"
+        layout="topleft"
+        name="show_beacon"
+        left_pad="0"
+        top_pad="-16"
+        width="90" />
+    <button
+        follows="left|bottom"
+        height="21"
+        label="Take"
+        layout="topleft"
+        name="take_objects"
+        top_pad="9"
+        left="18"
+        width="95"/>
+    <button
+        follows="left|bottom"
+        height="21"
+        label="Take copy"
+        layout="topleft"
+        name="take_copy_objects"
+        top_pad="-21"
+        left_pad="6"
+        width="95"/>
+    <button
+        follows="left|bottom"
+        height="21"
+        label="Teleport me to it"
+        layout="topleft"
+        name="teleport_me_to_object"
+        top_pad="-21"
+        left_pad="206"
+        width="160"/>
+    <button
+        follows="right|bottom"
+        height="21"
+        label="Return"
+        layout="topleft"
+        name="return_objects"
+        top_pad="-21"
+        left_pad="220"
+        width="95"/>
+    <button
+        follows="right|bottom"
+        height="21"
+        label="Delete"
+        layout="topleft"
+        name="delete_objects"
+        top_pad="-21"
+        left_pad="6"
+        width="95"/>
+  </panel>
+  <view_border
+      bevel_style="none"
+      follows="left|bottom|right"
+      height="0"
+      layout="topleft"
+      name="horiz_separator"
+      top_pad="0"
+      left="18"
+      width="979"/>
+  <panel
+      border="false"
+      bevel_style="none"
+      follows="left|right|bottom"
+      layout="topleft"
+      left="0"
+      height="75"
+      width="950">
+    <text
+        height="13"
+        word_wrap="false"
+        use_ellipses="false"
+        type="string"
+        text_color="LabelTextColor"
+        length="1"
+        follows="left|bottom"
+        layout="topleft"
+        left="18"
+        top_pad="8"
+        width="912">
+      Edit attributes of selected linksets and press the button to apply changes
+    </text>
+    <combo_box
+        height="20"
+        layout="topleft"
+        follows="left|top"
+        name="edit_linkset_use"
+        left="18"
+        top_pad="17"
+        width="199">
+    </combo_box>
+    <text
+        height="13"
+        word_wrap="false"
+        use_ellipses="false"
+        type="string"
+        text_color="LabelTextColor"
+        text_readonly_color="LabelDisabledColor"
+        name="walkability_coefficients_label"
+        length="1"
+        follows="left|bottom"
+        layout="topleft"
+        left_pad="36"
+        top_pad="-17"
+        width="110">
+      Walkability:
+    </text>
+    <text
+        height="13"
+        word_wrap="false"
+        use_ellipses="false"
+        type="string"
+        text_color="LabelTextColor"
+        text_readonly_color="LabelDisabledColor"
+        name="edit_a_label"
+        length="1"
+        follows="left|bottom"
+        layout="topleft"
+        left_pad="0"
+        width="18">
+      A
+    </text>
+    <line_editor
+        border_style="line"
+        border_thickness="1"
+        follows="left|bottom"
+        height="21"
+        layout="topleft"
+        left_pad="0"
+        top_pad="-19"
+        max_length_chars="3"
+        name="edit_a_value"
+        tool_tip="Walkability for characters of type A.  Example character type is humanoid."
+        width="45" />
+    <text
+        height="13"
+        word_wrap="false"
+        use_ellipses="false"
+        type="string"
+        text_color="LabelTextColor"
+        text_readonly_color="LabelDisabledColor"
+        name="edit_b_label"
+        length="1"
+        follows="left|bottom"
+        layout="topleft"
+        left_pad="44"
+        top_pad="-15"
+        width="18">
+      B
+    </text>
+    <line_editor
+        border_style="line"
+        border_thickness="1"
+        follows="left|bottom"
+        height="21"
+        layout="topleft"
+        left_pad="0"
+        top_pad="-19"
+        max_length_chars="3"
+        name="edit_b_value"
+        tool_tip="Walkability for characters of type B.  Example character type is creature."
+        width="45" />
+    <text
+        height="13"
+        word_wrap="false"
+        use_ellipses="false"
+        type="string"
+        text_color="LabelTextColor"
+        text_readonly_color="LabelDisabledColor"
+        name="edit_c_label"
+        length="1"
+        follows="left|bottom"
+        layout="topleft"
+        left_pad="44"
+        top_pad="-15"
+        width="18">
+      C
+    </text>
+    <line_editor
+        border_style="line"
+        border_thickness="1"
+        follows="left|bottom"
+        height="21"
+        layout="topleft"
+        left_pad="0"
+        top_pad="-19"
+        max_length_chars="3"
+        name="edit_c_value"
+        tool_tip="Walkability for characters of type C.  Example character type is mechanical."
+        width="45" />
+    <text
+        height="13"
+        word_wrap="false"
+        use_ellipses="false"
+        type="string"
+        text_color="LabelTextColor"
+        text_readonly_color="LabelDisabledColor"
+        name="edit_d_label"
+        length="1"
+        follows="left|bottom"
+        layout="topleft"
+        left_pad="44"
+        top_pad="-15"
+        width="18">
+      D
+    </text>
+    <line_editor
+        border_style="line"
+        border_thickness="1"
+        follows="left|bottom"
+        height="21"
+        layout="topleft"
+        left_pad="0"
+        top_pad="-19"
+        max_length_chars="3"
+        name="edit_d_value"
+        tool_tip="Walkability for characters of type D.  Example character type is other."
+        width="45" />
+    <button
+        follows="right|bottom"
+        height="21"
+        label="Apply changes"
+        layout="topleft"
+        name="apply_edit_values"
+        top_pad="-21"
+        left_pad="40"
+        width="140"/>
+    <text
+        height="13"
+        word_wrap="false"
+        use_ellipses="false"
+        type="string"
+        text_color="LabelTextColor"
+        text_readonly_color="LabelDisabledColor"
+        name="suggested_use_a_label"
+        length="1"
+        follows="left|bottom"
+        layout="topleft"
+        left="363"
+        top_pad="5"
+        width="107">
+      (Humanoid)
+    </text>
+    <text
+        height="13"
+        word_wrap="false"
+        use_ellipses="false"
+        type="string"
+        text_color="LabelTextColor"
+        text_readonly_color="LabelDisabledColor"
+        name="suggested_use_b_label"
+        length="1"
+        follows="left|bottom"
+        layout="topleft"
+        left_pad="0"
+        width="107">
+      (Creature)
+    </text>
+    <text
+        height="13"
+        word_wrap="false"
+        use_ellipses="false"
+        type="string"
+        text_color="LabelTextColor"
+        text_readonly_color="LabelDisabledColor"
+        name="suggested_use_c_label"
+        length="1"
+        follows="left|bottom"
+        layout="topleft"
+        left_pad="0"
+        width="107">
+      (Mechanical)
+    </text>
+    <text
+        height="13"
+        word_wrap="false"
+        use_ellipses="false"
+        type="string"
+        text_color="LabelTextColor"
+        text_readonly_color="LabelDisabledColor"
+        name="suggested_use_d_label"
+        length="1"
+        follows="left|bottom"
+        layout="topleft"
+        left_pad="0"
+        width="107">
+      (Other)
+    </text>
+  </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_stats.xml b/indra/newview/skins/default/xui/en/floater_stats.xml
index 9400f7b94ffa3774c29f6a609f47f6a2b5687097..f9eb16d2241290aab668e9686151bf9a85954ce9 100644
--- a/indra/newview/skins/default/xui/en/floater_stats.xml
+++ b/indra/newview/skins/default/xui/en/floater_stats.xml
@@ -168,7 +168,7 @@
 			   name="texture"
 			   label="Texture"
 			   show_label="true">
-        <stat_bar
+			  <stat_bar
 				 name="texture_cache_hits"
 				 label="Cache Hit Rate"
 				 stat="texture_cache_hits"
@@ -571,6 +571,20 @@
 			   show_bar="false"
 			   show_mean="false" >
 			</stat_bar>
+        <stat_bar
+            name="simpctscriptsrun"
+            label="Scripts Run"
+            unit_label=" %"
+            stat="simpctscriptsrun"
+            bar_min="0"
+            bar_max="100"
+            tick_spacing="10"
+            label_spacing="20"
+            precision="3"
+            show_per_sec="false"
+            show_bar="false"
+            show_mean="true">
+        </stat_bar>
 
 			<stat_bar
 			   name="simscripteps"
@@ -587,6 +601,53 @@
 			   show_mean="false" >
 			</stat_bar>
 
+        <stat_view
+            name="simpathfinding"
+            label="Pathfinding"
+            show_label="true">
+          <stat_bar
+              name="simsimaistepmsec"
+              label="  AI Step Time"
+              stat="simsimaistepmsec"
+              unit_label="ms"
+              precision="3"
+              bar_min="0.f"
+              bar_max="40.f"
+              tick_spacing="10.f"
+              label_spacing="20.f"
+              show_per_sec="false"
+              show_bar="false"
+              show_mean="false" >
+          </stat_bar>
+          <stat_bar
+              name="simsimskippedsilhouettesteps"
+              label="  Skipped Silhouette Steps"
+              stat="simsimskippedsilhouettesteps"
+              unit_label="/sec"
+              precision="0"
+              bar_min="0"
+              bar_max="45"
+              tick_spacing="4"
+              label_spacing="8"
+              show_per_sec="false"
+              show_bar="false">
+          </stat_bar>
+          <stat_bar
+              name="simsimpctsteppedcharacters"
+              label="  Characters Updated"
+              unit_label=" %"
+              stat="simsimpctsteppedcharacters"
+              bar_min="0"
+              bar_max="100"
+              tick_spacing="10"
+              label_spacing="20"
+              precision="1"
+              show_per_sec="false"
+              show_bar="false"
+              show_mean="true">
+          </stat_bar>
+        </stat_view>
+
 			<stat_bar
 			   name="siminpps"
 			   label="Packets In"
diff --git a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml
index 6021ba0a5ab8b8ebea4da81876c637009ba4fbd0..2e29c61cb28456fc75cc401082ba6de07dad57b2 100644
--- a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml
+++ b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml
@@ -134,6 +134,16 @@
      top_delta="-25"
      name="Pipette"
      width="28" />
+   <check_box
+     follows="left|bottom"
+     height="20"
+     initial_value="true"
+     label="Live Preview"
+     layout="topleft"
+     left="4"
+     name="apply_immediate_check"
+     top="262"
+     width="120" />
    <text
      follows="left|bottom"
      height="20"
diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml
index e37740d20cd71aa64c8ca4746165bb36d7253829..5204efbf6564229f20917b912bc42a41ce989c03 100644
--- a/indra/newview/skins/default/xui/en/floater_tools.xml
+++ b/indra/newview/skins/default/xui/en/floater_tools.xml
@@ -2,7 +2,7 @@
 <floater
  positioning="cascading"
  legacy_header_height="18"
- height="580"
+ height="590"
  layout="topleft"
  bg_opaque_image="Window_NoTitle_Foreground"
  bg_alpha_image="Window_NoTitle_Background"
@@ -876,6 +876,14 @@
              name="text modify info 4">
                 You can't modify these objects
             </panel.string>
+            <panel.string
+             name="text modify info 5">
+                You can't modify this object across a region boundary
+            </panel.string>
+            <panel.string
+             name="text modify info 6">
+                You can't modify these objects across a region boundary
+            </panel.string>
             <panel.string
              name="text modify warning">
                 You must select entire object to set permissions
@@ -941,7 +949,7 @@
              left="10"
              length="1"
              follows="left|top"
-             height="19"
+             height="29"
              layout="topleft"
              name="Creator:"
              top_pad="7"
@@ -954,7 +962,7 @@
              length="1"
              follows="left|top"
              left_pad="0"
-             height="20"
+             height="29"
              layout="topleft"
              name="Creator Name"
              top_delta="0"
@@ -969,10 +977,10 @@
              length="1"
              left="10"
              follows="left|top"
-             height="19"
+             height="29"
              layout="topleft"
              name="Owner:"
-             top_pad="13"
+             top_pad="3"
              width="90">
                 Owner:
             </text>
@@ -981,7 +989,7 @@
              type="string"
              length="1"
              follows="left|top"
-             height="20"
+             height="29"
              layout="topleft"
              name="Owner Name"
              left_pad="0"
@@ -1000,7 +1008,7 @@
              left="10"
              height="18"
              name="Group:"
-             top_pad="17"
+             top_pad="3"
              width="75">
                 Group:
             </text>
@@ -1029,7 +1037,7 @@
              layout="topleft"
              name="checkbox share with group"
              tool_tip="Allow all members of the set group to share your modify permissions for this object. You must Deed to enable role restrictions."
-             top_pad="10"
+             top_pad="5"
              left="100"
              width="87" />
             <button
@@ -1051,7 +1059,7 @@
              top_pad="10"
              left="10"
              name="label click action"
-             width="118">
+             width="82">
                 Click to:
             </text>
             <combo_box
@@ -1059,7 +1067,7 @@
              height="23"
              layout="topleft"
              name="clickaction"
-             width="148"
+             width="130"
              left_pad="10">
                 <combo_box.item
                  label="Touch  (default)"
@@ -1092,19 +1100,39 @@
              layout="topleft"
              name="checkbox for sale"
              left="7"
-             width="100" />
-<!-- NEW SALE TYPE COMBO BOX -->
+             width="97" />
+  <!-- NEW PRICE SPINNER
+Objects are allowed to be for sale for L$0 to invoke buy UI behavior
+even though the user gets a free copy.
+-->
+  <spinner
+      follows="left|top"
+      decimal_digits="0"
+      increment="1"
+      left_pad="0"
+      control_name="Edit Cost"
+      name="Edit Cost"
+      label="L$"
+      label_width="15"
+      label_text.valign="center"
+      valign="center"
+      width="85"
+      min_val="0"
+      height="20"
+      max_val="999999999" />
+  <!-- NEW SALE TYPE COMBO BOX -->
       <combo_box
-            left_pad="10"
+            left_pad="8"
             layout="topleft"
             follows="left|top"
             allow_text_entry="false"
             height="23"
+            top_pad="-23"
             initial_value="2"
             max_chars="20"
             mouse_opaque="true"
             name="sale type"
-            width="168">
+            width="89">
         <combo_box.item
            name="Copy"
            label="Copy"
@@ -1118,31 +1146,13 @@
            label="Original"
            value="1" />
       </combo_box>
-<!-- NEW PRICE SPINNER
-Objects are allowed to be for sale for L$0 to invoke buy UI behavior
-even though the user gets a free copy.
--->
-    <spinner
-        follows="left|top"
-        decimal_digits="0"
-        increment="1"
-        top_pad="8"
-        left="118"
-        control_name="Edit Cost"
-        name="Edit Cost"
-        label="Price: L$"
-        label_width="65"
-        width="165"
-        min_val="0"
-        height="20"
-        max_val="999999999" />
       <check_box
 	   height="15"
 	   width="110"
 	   top_pad="5"
 	   label="Show in search"
        layout="topleft"
-	   left="100"
+	   left="7"
        name="search_check"
        tool_tip="Let people see this object in search results" />
 		<panel
@@ -1155,15 +1165,16 @@ even though the user gets a free copy.
          name="perms_build"
          left="0"
          top_pad="4"
-         height="105"
+         height="121"
          width="290">
             <text
              type="string"
              length="1"
              left="10"
+             word_wrap="true"
              top_pad="9"
              text_color="EmphasisColor"
-             height="16"
+             height="32"
              follows="left|top|right"
              layout="topleft"
              name="perm_modify"
@@ -1233,7 +1244,7 @@ even though the user gets a free copy.
              type="string"
              text_color="EmphasisColor"
              length="1"
-             top="9"
+             top="23"
              follows="left|top"
              layout="topleft"
              left="230"
@@ -1308,7 +1319,36 @@ even though the user gets a free copy.
                 F:
             </text>
         </panel>
-      </panel>
+		<panel
+         border="false"
+         follows="left|top"
+         layout="topleft"
+         mouse_opaque="false"
+         name="pathfinding_attrs_panel"
+         left="0"
+         top_pad="0"
+         height="25"
+         width="290">
+      <text
+         type="string"
+         follows="left|top"
+         name="pathfinding_attributes_label"
+         top_pad="4"
+         width="150"
+         left="10">
+        Pathfinding attributes:
+      </text>
+      <text
+         type="string"
+         follows="left|top"
+         text_color="EmphasisColor"
+         name="pathfinding_attributes_value"
+         width="130"
+         word_wrap="false"
+         left_pad="0">
+      </text>
+    </panel>
+  </panel>
       <!-- Object tab -->
       <panel
          border="false"
@@ -1355,8 +1395,7 @@ even though the user gets a free copy.
              tool_tip="Causes object to not collide with other objects or avatars"
              top_pad="0"
              width="123" />
-
-            <text
+        <text
              type="string"
              length="1"
              follows="left|top"
diff --git a/indra/newview/skins/default/xui/en/menu_object.xml b/indra/newview/skins/default/xui/en/menu_object.xml
index 719509301b0a9486393c0c5490df6ab4244b1620..52b9524b113e629e18b9a7edbd5209af0d9e893d 100644
--- a/indra/newview/skins/default/xui/en/menu_object.xml
+++ b/indra/newview/skins/default/xui/en/menu_object.xml
@@ -1,179 +1,199 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <context_menu
- layout="topleft"
- name="Object Pie">
-   <menu_item_call
-     enabled="false"
-     label="Touch"
-     name="Object Touch">
-        <menu_item_call.on_click
-         function="Object.Touch" />
-        <menu_item_call.on_enable
-         function="Object.EnableTouch"
-         name="EnableTouch"
-         parameter="Touch" />
-   </menu_item_call>
-   <menu_item_call
-     label="Edit"
-     name="Edit...">
-        <menu_item_call.on_click
-         function="Object.Edit" />
+    layout="topleft"
+    name="Object Pie">
+  <menu_item_call
+      enabled="false"
+      label="Touch"
+      name="Object Touch">
+    <menu_item_call.on_click
+        function="Object.Touch" />
     <menu_item_call.on_enable
-         function="EnableEdit"/>
-    </menu_item_call>
-    <menu_item_call
+        function="Object.EnableTouch"
+        name="EnableTouch"
+        parameter="Touch" />
+  </menu_item_call>
+  <menu_item_call
+      label="Edit"
+      name="Edit...">
+    <menu_item_call.on_click
+        function="Object.Edit" />
+    <menu_item_call.on_enable
+        function="EnableEdit"/>
+  </menu_item_call>
+  <menu_item_call
       label="Build"
       name="Build">
-      <menu_item_call.on_click
+    <menu_item_call.on_click
         function="Object.Build" />
-        <menu_item_call.on_enable
-         function="EnableEdit"/>
-    </menu_item_call>
-   <menu_item_call
-     enabled="false"
-     label="Open"
-     name="Open">
-        <menu_item_call.on_click
-         function="Object.Open" />
-        <menu_item_call.on_enable
-         function="Object.EnableOpen" />
-   </menu_item_call>
-   <menu_item_call
-     enabled="false"
-     label="Sit Here"
-     name="Object Sit">
-        <menu_item_call.on_click
-         function="Object.SitOrStand" />
-        <menu_item_call.on_enable
-         function="Object.EnableSit" />
-   </menu_item_call>
-   <menu_item_call
-     enabled="false"
-     label="Stand Up"
-     name="Object Stand Up">
-        <menu_item_call.on_click
-         function="Object.SitOrStand" />
-        <menu_item_call.on_enable
-         function="Object.EnableStandUp" />
-   </menu_item_call>
-   <menu_item_call
-       label="Object Profile"
-       name="Object Inspect">
-         <menu_item_call.on_click
-          function="Object.Inspect" />
-         <menu_item_call.on_enable
-          function="Object.EnableInspect" />
-   </menu_item_call>
+    <menu_item_call.on_enable
+        function="EnableEdit"/>
+  </menu_item_call>
   <menu_item_call
-       label="Zoom In"
-       name="Zoom In">
+      label="Show in linksets"
+      name="show_in_linksets">
     <menu_item_call.on_click
-     function="Object.ZoomIn" />
+        function="Pathfinding.Linksets.Select" />
+    <menu_item_call.on_enable
+        function="EnableSelectInPathfindingLinksets"/>
+    <menu_item_call.on_visible
+        function="EnableSelectInPathfindingLinksets"/>
+  </menu_item_call>
+  <menu_item_call
+      label="Show in characters"
+      name="show_in_characters">
+    <menu_item_call.on_click
+        function="Pathfinding.Characters.Select" />
+    <menu_item_call.on_enable
+        function="EnableSelectInPathfindingCharacters"/>
+    <menu_item_call.on_visible
+        function="EnableSelectInPathfindingCharacters"/>
   </menu_item_call>
-<menu_item_separator layout="topleft" />
-   <context_menu
-         label="Put On"
-         name="Put On" >
-   <menu_item_call
+  <menu_item_call
       enabled="false"
-      label="Wear"
-      name="Wear">
-            <menu_item_call.on_click
-             function="Object.AttachToAvatar" />
-            <menu_item_call.on_enable
-             function="Object.EnableWear" />
-   </menu_item_call>
-   <menu_item_call
+      label="Open"
+      name="Open">
+    <menu_item_call.on_click
+        function="Object.Open" />
+    <menu_item_call.on_enable
+        function="Object.EnableOpen" />
+  </menu_item_call>
+  <menu_item_call
       enabled="false"
-      label="Add"
-      name="Add">
-            <menu_item_call.on_click
-             function="Object.AttachAddToAvatar" />
-            <menu_item_call.on_enable
-             function="Object.EnableWear" />
-   </menu_item_call>
-   <context_menu
-         label="Attach"
-         name="Object Attach" />
-   <context_menu
-         label="Attach HUD"
-         name="Object Attach HUD" />
-   </context_menu>
-   <context_menu
-         label="Manage"
-         name="Remove">
-   <menu_item_call
-         enabled="false"
-         label="Report Abuse"
-         name="Report Abuse...">
-            <menu_item_call.on_click
-             function="Object.ReportAbuse" />
-            <menu_item_call.on_enable
-             function="Object.EnableReportAbuse" />
-   </menu_item_call>
-   <menu_item_call
-          enabled="false"
-          label="Block"
-          name="Object Mute">
-             <menu_item_call.on_click
-              function="Object.Mute" />
-             <menu_item_call.on_enable
-              function="Object.EnableMute" />
-   </menu_item_call>
-   <menu_item_call
+      label="Sit Here"
+      name="Object Sit">
+    <menu_item_call.on_click
+        function="Object.SitOrStand" />
+    <menu_item_call.on_enable
+        function="Object.EnableSit" />
+  </menu_item_call>
+  <menu_item_call
       enabled="false"
-      label="Return"
-      name="Return...">
-         <menu_item_call.on_click
-          function="Object.Return" />
-         <menu_item_call.on_enable
-          function="Object.EnableReturn" />
-     </menu_item_call>
-    </context_menu>
-   <menu_item_separator layout="topleft" />
-   <menu_item_call
-     label="Take"
-     layout="topleft"
-     name="Pie Object Take">
+      label="Stand Up"
+      name="Object Stand Up">
+    <menu_item_call.on_click
+        function="Object.SitOrStand" />
+    <menu_item_call.on_enable
+        function="Object.EnableStandUp" />
+  </menu_item_call>
+  <menu_item_call
+      label="Object Profile"
+      name="Object Inspect">
+    <menu_item_call.on_click
+        function="Object.Inspect" />
+    <menu_item_call.on_enable
+        function="Object.EnableInspect" />
+  </menu_item_call>
+  <menu_item_call
+      label="Zoom In"
+      name="Zoom In">
+    <menu_item_call.on_click
+        function="Object.ZoomIn" />
+  </menu_item_call>
+  <menu_item_separator layout="topleft" />
+  <context_menu
+      label="Put On"
+      name="Put On" >
+    <menu_item_call
+        enabled="false"
+        label="Wear"
+        name="Wear">
       <menu_item_call.on_click
-       function="Object.Take"/>
+          function="Object.AttachToAvatar" />
       <menu_item_call.on_enable
-       function="Object.VisibleTake"/>
-   </menu_item_call>
-   <menu_item_call
-   enabled="false"
-   label="Take Copy"
-   name="Take Copy">
+          function="Object.EnableWear" />
+    </menu_item_call>
+    <menu_item_call
+        enabled="false"
+        label="Add"
+        name="Add">
       <menu_item_call.on_click
-       function="Tools.TakeCopy" />
+          function="Object.AttachAddToAvatar" />
       <menu_item_call.on_enable
-       function="Tools.EnableTakeCopy" />
-  </menu_item_call>
-   <menu_item_call
-   enabled="false"
-   label="Pay"
-   name="Pay...">
-  <menu_item_call.on_click
-   function="PayObject" />
-  <menu_item_call.on_enable
-   function="EnablePayObject" />
-</menu_item_call>
-  <menu_item_call
-   enabled="false"
-   label="Buy"
-   name="Buy...">
+          function="Object.EnableWear" />
+    </menu_item_call>
+    <context_menu
+        label="Attach"
+        name="Object Attach" />
+    <context_menu
+        label="Attach HUD"
+        name="Object Attach HUD" />
+  </context_menu>
+  <context_menu
+      label="Manage"
+      name="Remove">
+    <menu_item_call
+        enabled="false"
+        label="Report Abuse"
+        name="Report Abuse...">
+      <menu_item_call.on_click
+          function="Object.ReportAbuse" />
+      <menu_item_call.on_enable
+          function="Object.EnableReportAbuse" />
+    </menu_item_call>
+    <menu_item_call
+        enabled="false"
+        label="Block"
+        name="Object Mute">
       <menu_item_call.on_click
-       function="Object.Buy" />
+          function="Object.Mute" />
       <menu_item_call.on_enable
-       function="Object.EnableBuy" />
-   </menu_item_call>
-   <menu_item_call
-     enabled="false"
-     label="Delete"
-     name="Delete">
+          function="Object.EnableMute" />
+    </menu_item_call>
+    <menu_item_call
+        enabled="false"
+        label="Return"
+        name="Return...">
       <menu_item_call.on_click
-       function="Object.Delete" />
+          function="Object.Return" />
       <menu_item_call.on_enable
-       function="Object.EnableDelete" />
+          function="Object.EnableReturn" />
+    </menu_item_call>
+  </context_menu>
+  <menu_item_separator layout="topleft" />
+  <menu_item_call
+      label="Take"
+      layout="topleft"
+      name="Pie Object Take">
+    <menu_item_call.on_click
+        function="Object.Take"/>
+    <menu_item_call.on_enable
+        function="Object.VisibleTake"/>
+  </menu_item_call>
+  <menu_item_call
+      enabled="false"
+      label="Take Copy"
+      name="Take Copy">
+    <menu_item_call.on_click
+        function="Tools.TakeCopy" />
+    <menu_item_call.on_enable
+        function="Tools.EnableTakeCopy" />
+  </menu_item_call>
+  <menu_item_call
+      enabled="false"
+      label="Pay"
+      name="Pay...">
+    <menu_item_call.on_click
+        function="PayObject" />
+    <menu_item_call.on_enable
+        function="EnablePayObject" />
+  </menu_item_call>
+  <menu_item_call
+      enabled="false"
+      label="Buy"
+      name="Buy...">
+    <menu_item_call.on_click
+        function="Object.Buy" />
+    <menu_item_call.on_enable
+        function="Object.EnableBuy" />
+  </menu_item_call>
+  <menu_item_call
+      enabled="false"
+      label="Delete"
+      name="Delete">
+    <menu_item_call.on_click
+        function="Object.Delete" />
+    <menu_item_call.on_enable
+        function="Object.EnableDelete" />
   </menu_item_call>
 </context_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 6bcdc615c3b420dc3c7558e9c2b595f6048e27cd..1aa55acf2d8a573bf75b23d3113b09c88fa468d2 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -952,7 +952,42 @@
           </menu_item_call>
         </menu>
 
-        <menu_item_separator/>
+      <menu
+         create_jump_keys="true"
+         label="Pathfinding"
+         name="Pathfinding"
+         tear_off="false">
+        <menu_item_call
+            label="Linksets..."
+            name="pathfinding_linksets_menu_item">
+          <menu_item_call.on_click
+              function="Floater.ToggleOrBringToFront"
+              parameter="pathfinding_linksets" />
+          <menu_item_call.on_enable
+              function="Tools.EnablePathfinding" />
+        </menu_item_call>
+        <menu_item_call
+            label="Characters..."
+            name="pathfinding_characters_menu_item">
+          <menu_item_call.on_click
+              function="Floater.ToggleOrBringToFront"
+              parameter="pathfinding_characters" />
+          <menu_item_call.on_enable
+              function="Tools.EnablePathfinding" />
+        </menu_item_call>
+        <menu_item_call
+            label="View / test..."
+            name="pathfinding_console_menu_item">
+          <menu_item_call.on_click
+              function="Floater.ToggleOrBringToFront"
+              parameter="pathfinding_console" />
+          <menu_item_call.on_enable
+              function="Tools.EnablePathfindingView" />
+        </menu_item_call>
+      </menu>
+
+
+      <menu_item_separator/>
 
         <menu
          create_jump_keys="true"
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 91b4d38e9718a3a0a1ad6781ac6e93c8a21d14a5..13f073a1c2fe2264f01f854744004f2d6307ac67 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -77,6 +77,21 @@
     </form>
   </template>
 
+  <template name="okhelpignore">
+    <form>
+      <button
+       default="true"
+       index="0"
+       name="OK_okhelpignore"
+       text="$yestext"/>
+      <button
+       index="1"
+       name="Help_okhelpignore"
+       text="$helptext"/>
+      <ignore text="$ignoretext"/>
+    </form>
+  </template>
+
   <template name="yesnocancelbuttons">
     <form>
       <button
@@ -898,7 +913,22 @@ You need an account to enter [SECOND_LIFE]. Would you like to create one now?
 You need to enter either the Username or both the First and Last name of your avatar into the Username field, then login again.
   </notification>
   
-
+  <notification
+   icon="alertmodal.tga"
+   name="InvalidGrid"
+   type="alertmodal">
+   <tag>fail</tag>
+'[GRID]' is not a valid grid identifier.
+  </notification>
+  
+  <notification
+   icon="alertmodal.tga"
+   name="InvalidLocationSLURL"
+   type="alertmodal">
+   <tag>fail</tag>
+Your start location did not specify a valid grid.
+  </notification>
+  
   <notification
    icon="alertmodal.tga"
    name="DeleteClassified"
@@ -1190,7 +1220,7 @@ There was a problem saving a compiled script due to the following reason: [REASO
    icon="alertmodal.tga"
    name="StartRegionEmpty"
    type="alertmodal">
-Oops, Your Start Region is not defined.
+Your Start Region is not defined.
 Please type the Region name in Start Location box or choose My Last Location or My Home as your Start Location.
 <tag>fail</tag>
     <usetemplate
@@ -1499,6 +1529,14 @@ Please make sure none are locked, and that you own all of them.
   <tag>fail</tag>
   </notification>
 
+  <notification
+   icon="alertmodal.tga"
+   name="CannotLinkPermanent"
+   type="alertmodal">
+    Objects cannot be linked across region boundaries.
+    <tag>fail</tag>
+  </notification>
+
   <notification
    icon="alertmodal.tga"
    name="CannotLinkDifferentOwners"
@@ -6020,6 +6058,56 @@ This area has voice chat disabled. You won&apos;t be able to hear anyone talking
 This area has building disabled. You can&apos;t build or rez objects here.
   </notification>
 
+  <notification
+     icon="notify.tga"
+     name="PathfindingDirty"
+     persist="true"
+     type="notify">
+    <unique/>
+    The region has pending pathfinding changes.  If you have build rights, you may rebake the region by clicking on the “Rebake region” button.
+  </notification>
+
+  <notification
+     icon="notify.tga"
+     name="DynamicPathfindingDisabled"
+     persist="true"
+     type="notify">
+    <unique/>
+    Dynamic pathfinding is not enabled on this region.  Scripted objects using pathfinding LSL calls may not operate as expected on this region.
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="PathfindingRebakeNavmesh"
+   type="alertmodal">
+    <unique/>
+    Changing certain objects in this region could cause other moving objects to behave incorrectly.  To make moving objects behave correctly, click the “Rebake region” button.  Choose “Help” for more information.
+    <url
+      option="1"
+      name="url"
+      target = "_external">
+      http://wiki.secondlife.com/wiki/Pathfinding_Tools_in_the_Second_Life_Viewer
+    </url>
+    <usetemplate
+     name="okhelpignore"
+     ignoretext="Changing certain objects in this region could cause other moving objects to behave incorrectly."
+     yestext="OK"
+     helptext="Help"
+     />
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="PathfindingCannotRebakeNavmesh"
+   type="alertmodal">
+    <unique/>
+    An error occurred.  There may be a network or server problem, or you may not have build rights.  Sometimes logging out and back in will solve this problem.
+    <usetemplate
+     name="okbutton"
+     yestext="OK"
+     />
+  </notification>
+
   <notification
    icon="notify.tga"
    name="SeeAvatars"
@@ -7481,6 +7569,18 @@ You locally updated a [RESOLUTION] baked texture for '[BODYREGION]' after [TIME]
    name="LivePreviewUnavailable"
    type="alert">
    
+We cannot display a preview of this texture because it is no-copy and/or no-transfer.
+  <usetemplate
+    ignoretext="Warn me that Live Preview mode is not available for no-copy and/or no-transfer textures"
+    name="okignore"
+    yestext="OK"/>
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="LivePreviewUnavailable"
+   type="alert">
+   
 We cannot display a preview of this texture because it is no-copy and/or no-transfer.
   <usetemplate
     ignoretext="Warn me that Live Preview mode is not available for no-copy and/or no-transfer textures"
@@ -7972,7 +8072,60 @@ The site at &apos;&lt;nolink&gt;[HOST_NAME]&lt;/nolink&gt;&apos; in realm &apos;
       notext="Cancel"
       ignoretext="Confirm before hiding UI"/>
   </notification>
-  
+
+  <notification
+   icon="alertmodal.tga"
+   name="PathfindingLinksets_SetLinksetUseMismatchOnRestricted"
+   type="alertmodal">
+    Some selected linksets cannot be set to be '[REQUESTED_TYPE]' because of permission restrictions on the linkset.  These linksets will be set to be '[RESTRICTED_TYPE]' instead.
+    <tag>confirm</tag>
+    <usetemplate
+     ignoretext="Some selected linksets cannot be set because of permission restrictions on the linkset."
+     name="okcancelignore"
+     notext="Cancel"
+     yestext="OK"/>
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="PathfindingLinksets_SetLinksetUseMismatchOnVolume"
+   type="alertmodal">
+    Some selected linksets cannot be set to be '[REQUESTED_TYPE]' because the shape is non-convex.
+    <tag>confirm</tag>
+    <usetemplate
+     ignoretext="Some selected linksets cannot be set because the shape is non-convex"
+     name="okcancelignore"
+     notext="Cancel"
+     yestext="OK"/>
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="PathfindingLinksets_SetLinksetUseMismatchOnRestrictedAndVolume"
+   type="alertmodal">
+    Some selected linksets cannot be set to be '[REQUESTED_TYPE]' because of permission restrictions on the linkset.  These linksets will be set to be '[RESTRICTED_TYPE]' instead.
+ Some selected linksets cannot be set to be '[REQUESTED_TYPE]' because the shape is non-convex. These linksets&apos; use types will not change.
+    <tag>confirm</tag>
+    <usetemplate
+     ignoretext="Some selected linksets cannot be set because of permission restrictions on the linkset and because the shape is non-convex."
+     name="okcancelignore"
+     notext="Cancel"
+     yestext="OK"/>
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="PathfindingLinksets_ChangeToFlexiblePath"
+   type="alertmodal">
+    The selected object affects the navmesh.  Changing it to a Flexible Path will remove it from the navmesh.
+    <tag>confirm</tag>
+    <usetemplate
+     ignoretext="The selected object affects the navmesh.  Changing it to a Flexible Path will remove it from the navmesh."
+     name="okcancelignore"
+     notext="Cancel"
+     yestext="OK"/>
+  </notification>
+
   <global name="UnsupportedGLRequirements">
 You do not appear to have the proper hardware requirements for [APP_NAME]. [APP_NAME] requires an OpenGL graphics card that has multitexture support. If this is the case, you may want to make sure that you have the latest drivers for your graphics card, and service packs and patches for your operating system.
 
@@ -8031,5 +8184,31 @@ Disabling future updates for this file.
 Attempted to add an invalid or unreadable image file [FNAME] which could not be opened or decoded.
 Attempt cancelled.
   </notification>
-  
+
+  <notification
+   icon="alertmodal.tga"
+   name="PathfindingReturnMultipleItems"
+   type="alertmodal">
+    You are returning [NUM_ITEMS] items.  Are you sure you want to continue?
+    <tag>confirm</tag>
+    <usetemplate
+     ignoretext="Are you sure you want to return multiple items?"
+     name="okcancelignore"
+     notext="No"
+     yestext="Yes"/>
+  </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="PathfindingDeleteMultipleItems"
+   type="alertmodal">
+    You are deleting [NUM_ITEMS] items.  Are you sure you want to continue?
+    <tag>confirm</tag>
+    <usetemplate
+     ignoretext="Are you sure you want to delete multiple items?"
+     name="okcancelignore"
+     notext="No"
+     yestext="Yes"/>
+  </notification>
+
 </notifications>
diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml
index 223326dd06e2119d4a54a915b5747bfb4f273ad3..44702c828f01430f5b0f3cf11e6ac33073e77361 100644
--- a/indra/newview/skins/default/xui/en/panel_login.xml
+++ b/indra/newview/skins/default/xui/en/panel_login.xml
@@ -1,216 +1,205 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <panel
-follows="all"
-height="600"
-layout="topleft"
-left="0"
-name="panel_login"
-focus_root="true" 
-top="600"
- width="996">
-<panel.string
-     name="create_account_url">
-       http://join.secondlife.com/
-</panel.string>
-<string name="reg_in_client_url" translate="false">
-     http://secondlife.eniac15.lindenlab.com/reg-in-client/
-</string>
-<panel.string
-     name="forgot_password_url">
-       http://secondlife.com/account/request.php
-</panel.string>
-<!-- *NOTE: Custom resize logic for login_html in llpanellogin.cpp -->
-<web_browser
-  tab_stop="false" 
-  trusted_content="true" 
-  bg_opaque_color="Black"
-  border_visible="false"
-  bottom="600"
-  follows="all"
-  left="0"
-  name="login_html"
-  start_url=""
-  top="0"
-  height="600"
-  width="980"/>
-<layout_stack
-follows="left|bottom|right"
-name="login_widgets"
-layout="topleft"
-orientation="horizontal"
-top="519"
-width="996"
-height="80">
-<layout_panel
-auto_resize="false"
-follows="left|bottom"
-name="login"
-layout="topleft"
-width="705"
-min_width="705"
-height="80">
-<text
-follows="left|bottom"
-font="SansSerifSmall"
-height="16"
-name="username_text"
-top="20"
-left="20"
-width="150">
-Username:
-</text>
-<combo_box
-allow_text_entry="true"
-follows="left|bottom"
-height="22"
-left_delta="0"
-max_chars="128"
-combo_editor.prevalidate_callback="ascii"
-tool_tip="The username you chose when you registered, like bobsmith12 or Steller Sunshine"
-top_pad="0"
-name="username_combo"
-width="178">
-  <combo_box.combo_button
-   visible ="false"/>
-  <combo_box.drop_down_button
-   visible ="false"/>
-</combo_box>
-<text
-follows="left|bottom"
-font="SansSerifSmall"
-height="15"
-left_pad="-19"
-name="password_text"
-top="20"
-    width="150">
-       Password:
-</text>
-<line_editor
-follows="left|bottom"
-  height="22"
-  max_length_bytes="16"
-name="password_edit"
-is_password="true" 
-select_on_focus="true"
-  top_pad="0"
-  width="135" />
- <check_box
-control_name="RememberPassword"
-follows="left|bottom"
-font="SansSerifSmall"
-height="16"
-label="Remember password"
-  top_pad="3"
-  name="remember_check"
- width="135" />
-<button
-  follows="left|bottom"
-  height="23"
-  image_unselected="PushButton_On"
-  image_selected="PushButton_On_Selected"
-  label="Log In"
-  label_color="White"
-  layout="topleft"
-  left_pad="10"
-  name="connect_btn"
-  top="35"
-  width="90" />
-  <text
-  follows="left|bottom"
-  font="SansSerifSmall"
-  height="15"
-  left_pad="8"
-  name="start_location_text"
-  top="20"
-  width="130">
-       Start at:
- </text>
-<combo_box
-allow_text_entry="true"
-control_name="NextLoginLocation"
-  follows="left|bottom"
-  height="23"
-max_chars="128"
-top_pad="0"
-name="start_location_combo"
-     width="165">
-<combo_box.item
-label="My last location"
-name="MyLastLocation"
-         value="last" />
-<combo_box.item
-label="My home"
-name="MyHome"
-         value="home" />
-<combo_box.item
-label="&lt;Type region name&gt;"
-name="Typeregionname"   value="" />
-</combo_box>
-<combo_box
-allow_text_entry="true"
-font="SansSerifSmall"
-   follows="left|right|bottom"
-   height="23"
-   max_chars="256"
-layout="topleft"
-top_pad="2"
-name="server_combo"
-width="135"
-  visible="false" />
-</layout_panel>
-<layout_panel
-tab_stop="false"
-follows="right|bottom"
-name="links"
-width="205"
-min_width="205"
-height="80">
-   <text
-follows="right|bottom"
-font="SansSerifSmall"
-text_color="EmphasisColor"
-halign="right"
-height="16"
-top="12"
-right="-10"
-name="create_new_account_text"
-  width="200">
-       Sign up
- </text>
-<text
-follows="right|bottom"
-font="SansSerifSmall"
-text_color="EmphasisColor"
-halign="right"
-height="16"
-name="forgot_password_text"
-top_pad="12"
-right="-10"
-  width="200">
-       Forgot your username or password?
-</text>
-<text
-follows="right|bottom"
-font="SansSerifSmall"
-text_color="EmphasisColor"
-halign="right"
-height="16"
-name="login_help"
-top_pad="2"
-right="-10"
-    width="200">
-       Need help logging in?   </text>
-<!--  <text
-    follows="right|bottom"
-    font="SansSerifSmall"
-    halign="right"
-    height="28"
-    top_pad="2"
-    name="channel_text"
-    width="180"
-    word_wrap="true">
-       [VERSION]
-   </text>-->
-   </layout_panel>
-</layout_stack>
+    follows="all"
+    height="600"
+    layout="topleft"
+    left="0"
+    name="panel_login"
+    focus_root="true" 
+    top="600"
+    width="996">
+  <panel.string
+      name="create_account_url">
+    http://join.secondlife.com/
+  </panel.string>
+  <string name="reg_in_client_url" translate="false">
+    http://secondlife.eniac15.lindenlab.com/reg-in-client/
+  </string>
+  <panel.string
+      name="forgot_password_url">
+    http://secondlife.com/account/request.php
+  </panel.string>
+  <!-- *NOTE: Custom resize logic for login_html in llpanellogin.cpp -->
+  <web_browser
+      tab_stop="false" 
+      trusted_content="true" 
+      bg_opaque_color="Black"
+      border_visible="false"
+      bottom="600"
+      follows="all"
+      left="0"
+      name="login_html"
+      start_url=""
+      top="0"
+      height="600"
+      width="980"/>
+  <layout_stack
+      follows="left|bottom|right"
+      name="login_widgets"
+      layout="topleft"
+      orientation="horizontal"
+      top="519"
+      width="996"
+      height="80">
+    <layout_panel
+        auto_resize="false"
+        follows="left|bottom"
+        name="login"
+        layout="topleft"
+        width="705"
+        min_width="705"
+        height="80">
+      <text
+          follows="left|bottom"
+          font="SansSerifSmall"
+          height="16"
+          name="username_text"
+          top="20"
+          left="20"
+          width="150">
+        Username:
+      </text>
+      <combo_box
+          allow_text_entry="true"
+          follows="left|bottom"
+          height="22"
+          left_delta="0"
+          max_chars="128"
+          combo_editor.prevalidate_callback="ascii"
+          tool_tip="The username you chose when you registered, like bobsmith12 or Steller Sunshine"
+          top_pad="0"
+          name="username_combo"
+          width="178">
+        <combo_box.combo_button
+            visible ="false"/>
+        <combo_box.drop_down_button
+            visible ="false"/>
+      </combo_box>
+      <text
+          follows="left|bottom"
+          font="SansSerifSmall"
+          height="15"
+          left_pad="-19"
+          name="password_text"
+          top="20"
+          width="150">
+        Password:
+      </text>
+      <line_editor
+          follows="left|bottom"
+          height="22"
+          max_length_bytes="16"
+          name="password_edit"
+          is_password="true" 
+          select_on_focus="true"
+          top_pad="0"
+          width="135" />
+      <check_box
+          control_name="RememberPassword"
+          follows="left|bottom"
+          font="SansSerifSmall"
+          height="16"
+          label="Remember password"
+          top_pad="3"
+          name="remember_check"
+          width="135" />
+      <button
+          follows="left|bottom"
+          height="23"
+          image_unselected="PushButton_On"
+          image_selected="PushButton_On_Selected"
+          label="Log In"
+          label_color="White"
+          layout="topleft"
+          left_pad="10"
+          name="connect_btn"
+          top="35"
+          width="90" />
+      <text
+          follows="left|bottom"
+          font="SansSerifSmall"
+          height="15"
+          left_pad="8"
+          name="start_location_text"
+          top="20"
+          width="130">
+        Start at:
+      </text>
+      <combo_box
+          allow_text_entry="true"
+          control_name="NextLoginLocation"
+          follows="left|bottom"
+          height="23"
+          max_chars="128"
+          top_pad="0"
+          name="start_location_combo"
+          width="165">
+        <combo_box.item
+            label="My last location"
+            name="MyLastLocation"
+            value="last" />
+        <combo_box.item
+            label="My home"
+            name="MyHome"
+            value="home" />
+        <combo_box.item
+            label="&lt;Type region name&gt;"
+            name="Typeregionname"   value="" />
+      </combo_box>
+      <combo_box
+          allow_text_entry="false"
+          font="SansSerifSmall"
+          follows="left|right|bottom"
+          height="23"
+          max_chars="256"
+          layout="topleft"
+          top_pad="2"
+          name="server_combo"
+          width="250"
+          visible="false" />
+    </layout_panel>
+    <layout_panel
+        tab_stop="false"
+        follows="right|bottom"
+        name="links"
+        width="205"
+        min_width="205"
+        height="80">
+      <text
+          follows="right|bottom"
+          font="SansSerifSmall"
+          text_color="EmphasisColor"
+          halign="right"
+          height="16"
+          top="12"
+          right="-10"
+          name="create_new_account_text"
+          width="200">
+        Sign up
+      </text>
+      <text
+          follows="right|bottom"
+          font="SansSerifSmall"
+          text_color="EmphasisColor"
+          halign="right"
+          height="16"
+          name="forgot_password_text"
+          top_pad="12"
+          right="-10"
+          width="200">
+        Forgot your username or password?
+      </text>
+      <text
+          follows="right|bottom"
+          font="SansSerifSmall"
+          text_color="EmphasisColor"
+          halign="right"
+          height="16"
+          name="login_help"
+          top_pad="2"
+          right="-10"
+          width="200">
+      Need help logging in?   </text>
+    </layout_panel>
+  </layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_navmesh_rebake.xml b/indra/newview/skins/default/xui/en/panel_navmesh_rebake.xml
new file mode 100644
index 0000000000000000000000000000000000000000..90308a2ca9534c119cea41dca5258087ca6ac612
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_navmesh_rebake.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<panel
+    height="25"
+    layout="topleft"
+    name="panel_navmesh_rebake"
+    mouse_opaque="false"
+    visible="true"
+    width="133">
+  <button
+      follows="left|bottom"
+      height="19"
+      label="Rebake region"
+      layout="topleft"
+      left="10"
+      name="navmesh_btn"
+      tool_tip="Click to rebake the region&apos;s navmesh."
+      top="2"
+      visible="false"
+      enabled="true"
+      width="120" />
+  <button
+      follows="left|bottom"
+      height="19"
+      label="Requesting rebake"
+      layout="topleft"
+      left="10"
+      name="navmesh_btn_sending"
+      tool_tip="Sending rebake request to the server."
+      top="2"
+      visible="false"
+      enabled="false"
+      width="120" />
+  <button
+      follows="left|bottom"
+      height="19"
+      label="Region is rebaking"
+      layout="topleft"
+      left="10"
+      name="navmesh_btn_baking"
+      tool_tip="Region is being rebaked.  When completed, this button will disappear."
+      top="2"
+      visible="false"
+      enabled="false"
+      width="120" />
+</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_toolbar_view.xml b/indra/newview/skins/default/xui/en/panel_toolbar_view.xml
index 58911bed56224ef99e96d1375b1f48fc6b78fd29..f5c559fe1dda158c06c33f4439980e9067918200 100644
--- a/indra/newview/skins/default/xui/en/panel_toolbar_view.xml
+++ b/indra/newview/skins/default/xui/en/panel_toolbar_view.xml
@@ -93,11 +93,11 @@
                left="0"
                mouse_opaque="false"
                tab_stop="false"
-               name="stand_stop_flying_container"
+               name="state_management_buttons_container"
                visible="false"
                width="200"/>
       </layout_panel>
-      <layout_panel name="right_toolbar_panel"
+       <layout_panel name="right_toolbar_panel"
                     auto_resize="false"
                     height="500"
                     width="30"
diff --git a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml
index 54a312bd59247e66d0ba34dc0170f4f2b7dae06f..c5dfb703e50ccbabcc2ab455bc3c995581da0ac0 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml
@@ -11,6 +11,10 @@
 		 name="unknown">
         (unknown)
 	</panel.string>
+    <panel.string
+         name="unknown_multiple">
+        (unknown / multiple)
+    </panel.string>
 	<panel.string
 		 name="public">
         (public)
diff --git a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml
index bf2e6bc2d98a149f472b40251ed88983ec3ee15f..e9a787cef092bca5530c4a947ef14eedb853e306 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml
@@ -1,429 +1,437 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <panel
-	 height="570"
-	 layout="topleft"
-	 name="object properties"
-	 help_topic="object_properties"
-	 title="Object Profile"
-	 width="333">
-	 <panel.string
-	  name="text deed continued">
-		Deed
-	 </panel.string>
-	<panel.string
-	 name="text deed">
-		Deed
-	</panel.string>
-            <panel.string
-             name="text modify info 1">
-                You can modify this object
-            </panel.string>
-            <panel.string
-             name="text modify info 2">
-                You can modify these objects
-            </panel.string>
-            <panel.string
-             name="text modify info 3">
-                You can't modify this object
-            </panel.string>
-            <panel.string
-             name="text modify info 4">
-                You can't modify these objects
-            </panel.string>
-            <panel.string
-             name="text modify warning">
-                This object has linked parts
-            </panel.string>
-            <panel.string
-             name="Cost Default">
-                Price: L$
-            </panel.string>
-            <panel.string
-             name="Cost Total">
-                Total Price: L$
-            </panel.string>
-            <panel.string
-             name="Cost Per Unit">
-                Price Per: L$
-            </panel.string>
-            <panel.string
-             name="Cost Mixed">
-                Mixed Price
-            </panel.string>
-            <panel.string
-             name="Sale Mixed">
-                Mixed Sale
-            </panel.string>
+    height="570"
+    layout="topleft"
+    name="object properties"
+    help_topic="object_properties"
+    title="Object Profile"
+    width="333">
+  <panel.string
+      name="text deed continued">
+    Deed
+  </panel.string>
+  <panel.string
+      name="text deed">
+    Deed
+  </panel.string>
+  <panel.string
+      name="text modify info 1">
+    You can modify this object
+  </panel.string>
+  <panel.string
+      name="text modify info 2">
+    You can modify these objects
+  </panel.string>
+  <panel.string
+      name="text modify info 3">
+    You can't modify this object
+  </panel.string>
+  <panel.string
+      name="text modify info 4">
+    You can't modify these objects
+  </panel.string>
+  <panel.string
+      name="text modify info 5">
+    You can't modify this object across a region boundary
+  </panel.string>
+  <panel.string
+      name="text modify info 6">
+    You can't modify these objects across a region boundary
+  </panel.string>
+  <panel.string
+      name="text modify warning">
+    This object has linked parts
+  </panel.string>
+  <panel.string
+      name="Cost Default">
+    Price: L$
+  </panel.string>
+  <panel.string
+      name="Cost Total">
+    Total Price: L$
+  </panel.string>
+  <panel.string
+      name="Cost Per Unit">
+    Price Per: L$
+  </panel.string>
+  <panel.string
+      name="Cost Mixed">
+    Mixed Price
+  </panel.string>
+  <panel.string
+      name="Sale Mixed">
+    Mixed Sale
+  </panel.string>
+  <button
+      follows="top|left"
+      height="24"
+      image_hover_unselected="BackButton_Over"
+      image_pressed="BackButton_Press"
+      image_unselected="BackButton_Off"
+      layout="topleft"
+      left="8"
+      name="back_btn"
+      tab_stop="false"
+      top="0"
+      width="30"
+      use_draw_context_alpha="false" />
+  <text
+      follows="top|left|right"
+      font="SansSerifHuge"
+      height="26"
+      layout="topleft"
+      left_pad="10"
+      name="title"
+      text_color="LtGray"
+      top="0"
+      use_ellipses="true"
+      value="Object Profile"
+      width="290" />
+  <text
+      follows="top|left"
+      height="13"
+      layout="topleft"
+      left="45"
+      name="where"
+      text_color="LtGray_50"
+      value="(Inworld)"
+      width="150" />
+  <panel
+      follows="all"
+      height="490"
+      label=""
+      layout="topleft"
+      left="10"
+      help_topic=""
+      name="properties_panel"
+      top="45"
+      width="313"
+      background_visible="true"
+      bg_alpha_color="DkGray2">
+    <text
+        type="string"
+        length="1"
+        follows="left|top"
+        height="10"
+        layout="topleft"
+        left="5"
+        name="Name:"
+        top="10"
+        width="78">
+      Name:
+    </text>
+    <line_editor
+        border_style="line"
+        border_thickness="1"
+        follows="left|top|right"
+        height="20"
+        layout="topleft"
+        left_delta="78"
+        max_length_bytes="63"
+        name="Object Name"
+        top_delta="0"
+        width="225" />
+    <text
+        type="string"
+        length="1"
+        follows="left|top"
+        height="10"
+        layout="topleft"
+        left="5"
+        name="Description:"
+        top_pad="10"
+        width="78">
+      Description:
+    </text>
+    <line_editor
+        border_style="line"
+        border_thickness="1"
+        follows="left|top|right"
+        height="23"
+        layout="topleft"
+        name="Object Description"
+        select_on_focus="true"
+        left_delta="78"
+        max_length_bytes="127"
+        top_delta="-5"
+        width="225"/>
+    <text
+        type="string"
+        length="1"
+        follows="left|top"
+        height="23"
+        layout="topleft"
+        left="5"
+        name="CreatorNameLabel"
+        top_pad="12"
+        width="78">
+      Creator:
+    </text>
+    <text
+        type="string"
+        follows="left|right|top"
+        font="SansSerifSmall"
+        height="15"
+        layout="topleft"
+        left_pad="0"
+        name="Creator Name"
+        top_delta="0"
+        translate="false"
+        use_ellipses="true" 
+        width="225">
+      TestString PleaseIgnore
+    </text>
+    <text
+        type="string"
+        length="1"
+        follows="left|top"
+        height="23"
+        layout="topleft"
+        left="5"
+        name="Owner:"
+        top_pad="15"
+        width="78">
+      Owner:
+    </text>
+    <text
+        type="string"
+        follows="left|right|top"
+        font="SansSerifSmall"
+        height="15"
+        layout="topleft"
+        left_pad="0"
+        name="Owner Name"
+        top_delta="0"
+        translate="false"
+        use_ellipses="true" 
+        width="225">
+      TestString PleaseIgnore
+    </text>
+    <text
+        type="string"
+        length="1"
+        follows="left|top"
+        height="23"
+        layout="topleft"
+        left="5"
+        name="Group_label"
+        top_pad="15"
+        width="78">
+      Group:
+    </text>
     <button
-     follows="top|left"
-     height="24"
-     image_hover_unselected="BackButton_Over"
-     image_pressed="BackButton_Press"
-     image_unselected="BackButton_Off"
-     layout="topleft"
-     left="8"
-     name="back_btn"
-     tab_stop="false"
-     top="0"
-     width="30"
-     use_draw_context_alpha="false" />
-        <text
-     follows="top|left|right"
-     font="SansSerifHuge"
-     height="26"
-     layout="topleft"
-     left_pad="10"
-     name="title"
-     text_color="LtGray"
-     top="0"
-     use_ellipses="true"
-     value="Object Profile"
-     width="290" />
-	    <text
-     follows="top|left"
-     height="13"
-     layout="topleft"
-     left="45"
-     name="where"
-     text_color="LtGray_50"
-     value="(Inworld)"
-     width="150" />
-	<panel
-         follows="all"
-         height="490"
-         label=""
-         layout="topleft"
-         left="10"
-         help_topic=""
-         name="properties_panel"
-         top="45"
-         width="313"
-   background_visible="true"
-   bg_alpha_color="DkGray2">
-	    	    <text
-		     type="string"
-		     length="1"
-		     follows="left|top"
-		     height="10"
-		     layout="topleft"
-		     left="5"
-             name="Name:"
-		     top="10"
-		     width="78">
-	        Name:
-	    </text>
-	    <line_editor
-		     border_style="line"
-		     border_thickness="1"
-	    	 follows="left|top|right"
-		     height="20"
-		     layout="topleft"
-	    	 left_delta="78"
-		     max_length_bytes="63"
-             name="Object Name"
-	    	 top_delta="0"
-		     width="225" />
-	    <text
-	    type="string"
-	    length="1"
-	    follows="left|top"
-	    height="10"
-	    layout="topleft"
-	    left="5"
-             name="Description:"
-	    top_pad="10"
-	    width="78">
-	        Description:
-	    </text>
-            <line_editor
-	     border_style="line"
-    	     border_thickness="1"
-             follows="left|top|right"
-             height="23"
-             layout="topleft"
-             name="Object Description"
-             select_on_focus="true"
-    		 left_delta="78"
-		     max_length_bytes="127"
-	    	 top_delta="-5"
-	    	 width="225"/>
-	    <text
-		     type="string"
-		     length="1"
-		     follows="left|top"
-		     height="23"
-		     layout="topleft"
-    		 left="5"
-		 name="CreatorNameLabel"
-		  top_pad="12"
-		     width="78">
-	        Creator:
-    	</text>
-	    <text
-		     type="string"
-     follows="left|right|top"
-     font="SansSerifSmall"
-     height="15"
-     layout="topleft"
-     left_pad="0"
-             name="Creator Name"
-		     top_delta="0"
-		     translate="false"
-         use_ellipses="true" 
-		     width="225">
-	        TestString PleaseIgnore
-	     </text>
-	    <text
-			 type="string"
-			 length="1"
-			 follows="left|top"
-			 height="23"
-			layout="topleft"
-			left="5"
-			name="Owner:"
-			top_pad="15"
-			 width="78">
-			    Owner:
-	     </text>
-	     <text
-			    type="string"
-			    follows="left|right|top"
-			    font="SansSerifSmall"
-			    height="15"
-			    layout="topleft"
-			    left_pad="0"
-			    name="Owner Name"
-			    top_delta="0"
-			    translate="false"
-          use_ellipses="true" 
-			    width="225">
-			    TestString PleaseIgnore
-	     </text>
-	    	    <text
-			 type="string"
-			 length="1"
-			 follows="left|top"
-			 height="23"
-			 layout="topleft"
-			 left="5"
-			name="Group_label"
-			top_pad="15"
-			width="78">
-			    Group:
-	     </text>
-      		<button
-			 follows="top|left"
-			 height="10"
-			 image_disabled="Activate_Checkmark"
-			 image_selected="Activate_Checkmark"
-			 image_unselected="Activate_Checkmark"
-			 image_color="White_50"
-			 layout="topleft"
-			 left_pad="0"
-			 top_delta="0"
-			 name="button set group"
-			 tab_stop="false"
-			 tool_tip="Choose a group to share this object's permissions"
-			 width="10" />
-            <name_box
-             follows="left|top"
-             height="18"
-             initial_value="Loading..."
-             layout="topleft"
-             left_pad="5"
-             top_delta="-1"
-             name="Group Name Proxy"
-             width="150" />
-            <button
-             follows="top|left"
-             height="23"
-             label="Deed"
-             label_selected="Deed"
-             layout="topleft"
-             name="button deed"
-             top_pad="0"
-             left="81"
-             tool_tip="Deeding gives this item away with next owner permissions. Group shared objects can be deeded by a group officer."
-             width="100" />
-            <text
-             type="string"
-             length="1"
-             follows="left|top"
-             height="9"
-             layout="topleft"
-             top_pad="5"
-             left="5"
-             name="label click action"
-             width="280">
-                Click to:
-            </text>
-            <combo_box
-             follows="left|top"
-             height="23"
-             layout="topleft"
-             name="clickaction"
-             width="168"
-             left="81">
-                <combo_box.item
-                 label="Touch  (default)"
-                 name="Touch/grab(default)"
-                 value="Touch" />
-                <combo_box.item
-                 label="Sit on object"
-                 name="Sitonobject"
-                 value="Sit" />
-                <combo_box.item
-                 label="Buy object"
-                 name="Buyobject"
-                 value="Buy" />
-                <combo_box.item
-                 label="Pay object"
-                 name="Payobject"
-                 value="Pay" />
-                <combo_box.item
-                 label="Open"
-                 name="Open"
-                 value="Open" />
-            </combo_box>
-	 <panel
-         border="false"
-         follows="left|top"
-         layout="topleft"
-         mouse_opaque="false"
-         background_visible="true"
-         bg_alpha_color="DkGray"
-         name="perms_inv"
-         left="0"
-         top_pad="15"
-         height="135"
-         width="313">
-	  <text
-             type="string"
-             length="1"
-             left="10"
-             top_pad="15"
-             text_color="EmphasisColor"
-	     height="15"
-             follows="left|top|right"
-             layout="topleft"
-             name="perm_modify"
-             width="310">
-                You can modify this object
-            </text>
-	  	    <text
-			 type="string"
-			 length="1"
-			 follows="left|top"
-			 height="16"
-			 layout="topleft"
-			 left="10"
-               name="Anyone can:"
-			 top_pad="8"
-			 width="100">
-			Anyone:
-	    </text>
-	    <check_box
-			 height="18"
-			 label="Copy"
-			 layout="topleft"
-			 left_pad="0"
-             name="checkbox allow everyone copy"
-			 top_delta="-2"
-			 width="90" />
-	    <check_box
-             height="18"
-             label="Move"
-             layout="topleft"
-             name="checkbox allow everyone move"
-			 left_pad="0"
-             width="150" />
-	       	<text
-			 type="string"
-			 length="1"
-			 follows="left|top"
-			 height="16"
-			 layout="topleft"
-			 left="10"
-			 name="GroupLabel"
-			 top_pad="8"
-			 width="100">
-			Group:
-    	</text>
-			    <check_box
-			 height="18"
-			 label="Share"
-			 layout="topleft"
-			 left_pad="90"
-			 top_delta="-2"
-             name="checkbox share with group"
-			 tool_tip="Allow all members of the set group to share your modify permissions for this object. You must Deed to enable role restrictions."
-			 width="150" />
-	    	    <text
-			 type="string"
-			 length="1"
-			 follows="left|top"
-			 height="16"
-			 layout="topleft"
-			 left="10"
-			 name="NextOwnerLabel"
-			 top_pad="8"
-			 width="200"
-			 word_wrap="true">
-			Next owner:
-	    </text>
-	    <check_box
-			 height="18"
-			 label="Modify"
-			 layout="topleft"
-			 left="20"
-			 top_pad="0"
-             name="checkbox next owner can modify"
-			 width="90" />
-	    <check_box
-			 height="18"
-			 label="Copy"
-			 layout="topleft"
-			 left_pad="0"
-             name="checkbox next owner can copy"
-			 width="90" />
-	    <check_box
-			 height="18"
-			 label="Transfer"
-			 layout="topleft"
-			 left_pad="0"
-             name="checkbox next owner can transfer"
-			 tool_tip="Next owner can give away or resell this object"
-			 width="106" />
-	    </panel>
-	    <check_box
-			 height="23"
-			 label="For Sale"
-			 layout="topleft"
-			 left="20"
-             name="checkbox for sale"
-			 top_pad="10"
-			 width="100" />
-		<combo_box
-			 height="23"
-			 left_pad="0"
-			 layout="topleft"
-			 follows="left|top"
-            name="sale type"
-			 width="170">
-        <combo_box.item
-           name="Copy"
-           label="Copy"
-           value="2" />
-        <combo_box.item
-           name="Contents"
-           label="Contents"
-           value="3" />
-        <combo_box.item
-           name="Original"
-           label="Original"
-           value="1" />
-	    </combo_box>
-		<spinner
+        follows="top|left"
+        height="10"
+        image_disabled="Activate_Checkmark"
+        image_selected="Activate_Checkmark"
+        image_unselected="Activate_Checkmark"
+        image_color="White_50"
+        layout="topleft"
+        left_pad="0"
+        top_delta="0"
+        name="button set group"
+        tab_stop="false"
+        tool_tip="Choose a group to share this object's permissions"
+        width="10" />
+    <name_box
+        follows="left|top"
+        height="18"
+        initial_value="Loading..."
+        layout="topleft"
+        left_pad="5"
+        top_delta="-1"
+        name="Group Name Proxy"
+        width="150" />
+    <button
+        follows="top|left"
+        height="23"
+        label="Deed"
+        label_selected="Deed"
+        layout="topleft"
+        name="button deed"
+        top_pad="0"
+        left="81"
+        tool_tip="Deeding gives this item away with next owner permissions. Group shared objects can be deeded by a group officer."
+        width="100" />
+    <text
+        type="string"
+        length="1"
+        follows="left|top"
+        height="9"
+        layout="topleft"
+        top_pad="5"
+        left="5"
+        name="label click action"
+        width="280">
+      Click to:
+    </text>
+    <combo_box
+        follows="left|top"
+        height="23"
+        layout="topleft"
+        name="clickaction"
+        width="168"
+        left="81">
+      <combo_box.item
+          label="Touch  (default)"
+          name="Touch/grab(default)"
+          value="Touch" />
+      <combo_box.item
+          label="Sit on object"
+          name="Sitonobject"
+          value="Sit" />
+      <combo_box.item
+          label="Buy object"
+          name="Buyobject"
+          value="Buy" />
+      <combo_box.item
+          label="Pay object"
+          name="Payobject"
+          value="Pay" />
+      <combo_box.item
+          label="Open"
+          name="Open"
+          value="Open" />
+    </combo_box>
+    <panel
+        border="false"
+        follows="left|top"
+        layout="topleft"
+        mouse_opaque="false"
+        background_visible="true"
+        bg_alpha_color="DkGray"
+        name="perms_inv"
+        left="0"
+        top_pad="15"
+        height="135"
+        width="313">
+      <text
+          type="string"
+          length="1"
+          left="5"
+          top_pad="15"
+          text_color="EmphasisColor"
+          height="15"
+          follows="left|top|right"
+          layout="topleft"
+          name="perm_modify"
+          width="310">
+        You can modify this object
+      </text>
+      <text
+          type="string"
+          length="1"
+          follows="left|top"
+          height="16"
+          layout="topleft"
+          left="10"
+          name="Anyone can:"
+          top_pad="8"
+          width="100">
+        Anyone:
+      </text>
+      <check_box
+          height="18"
+          label="Copy"
+          layout="topleft"
+          left_pad="0"
+          name="checkbox allow everyone copy"
+          top_delta="-2"
+          width="90" />
+      <check_box
+          height="18"
+          label="Move"
+          layout="topleft"
+          name="checkbox allow everyone move"
+          left_pad="0"
+          width="150" />
+      <text
+          type="string"
+          length="1"
+          follows="left|top"
+          height="16"
+          layout="topleft"
+          left="10"
+          name="GroupLabel"
+          top_pad="8"
+          width="100">
+        Group:
+      </text>
+      <check_box
+          height="18"
+          label="Share"
+          layout="topleft"
+          left_pad="90"
+          top_delta="-2"
+          name="checkbox share with group"
+          tool_tip="Allow all members of the set group to share your modify permissions for this object. You must Deed to enable role restrictions."
+          width="150" />
+      <text
+          type="string"
+          length="1"
+          follows="left|top"
+          height="16"
+          layout="topleft"
+          left="10"
+          name="NextOwnerLabel"
+          top_pad="8"
+          width="200"
+          word_wrap="true">
+        Next owner:
+      </text>
+      <check_box
+          height="18"
+          label="Modify"
+          layout="topleft"
+          left="20"
+          top_pad="0"
+          name="checkbox next owner can modify"
+          width="90" />
+      <check_box
+          height="18"
+          label="Copy"
+          layout="topleft"
+          left_pad="0"
+          name="checkbox next owner can copy"
+          width="90" />
+      <check_box
+          height="18"
+          label="Transfer"
+          layout="topleft"
+          left_pad="0"
+          name="checkbox next owner can transfer"
+          tool_tip="Next owner can give away or resell this object"
+          width="106" />
+    </panel>
+    <check_box
+        height="23"
+        label="For Sale"
+        layout="topleft"
+        left="20"
+        name="checkbox for sale"
+        top_pad="10"
+        width="100" />
+    <combo_box
+        height="23"
+        left_pad="0"
+        layout="topleft"
+        follows="left|top"
+        name="sale type"
+        width="170">
+      <combo_box.item
+          name="Copy"
+          label="Copy"
+          value="2" />
+      <combo_box.item
+          name="Contents"
+          label="Contents"
+          value="3" />
+      <combo_box.item
+          name="Original"
+          label="Original"
+          value="1" />
+    </combo_box>
+    <spinner
         follows="left|top"
         decimal_digits="0"
         increment="1"
@@ -437,132 +445,150 @@
         min_val="1"
         height="20"
         max_val="999999999" />
-      <check_box
-	   height="20"
-	   width="110"
-	   top_pad="6"
-	   label="Show in search"
-       layout="topleft"
-	   left="120"
-       name="search_check"
-       tool_tip="Let people see this object in search results" />
-            <text
-             type="string"
-             text_color="EmphasisColor"
-             length="1"
-             top_pad="15"
-             follows="left|top"
-             layout="topleft"
-             left="10"
-             name="B:"
-             height="10"
-             width="50">
-                B:
-            </text>
-            <text
-             type="string"
-             text_color="White"
-             length="1"
-             follows="left|top"
-             layout="topleft"
-             left_pad="0"
-             name="O:"
-             height="10"
-             width="50">
-                O:
-            </text>
-            <text
-             type="string"
-             text_color="EmphasisColor"
-             length="1"
-             follows="left|top"
-             layout="topleft"
-             left_pad="0"
-             name="G:"
-             height="10"
-             width="50">
-                G:
-            </text>
-            <text
-             type="string"
-             text_color="White"
-             length="1"
-             follows="left|top"
-             left_pad="0"
-             layout="topleft"
-             name="E:"
-             height="10"
-             width="50">
-                E:
-            </text>
-            <text
-             type="string"
-             text_color="EmphasisColor"
-             length="1"
-             follows="left|top"
-             layout="topleft"
-             left_pad="0"
-             name="N:"
-             height="10"
-             width="50">
-                N:
-            </text>
-            <text
-             type="string"
-             text_color="White"
-             length="1"
-             follows="left|top"
-             layout="topleft"
-             left_pad="0"
-             name="F:"
-             height="10"
-             width="50">
-                F:
-            </text>
-		</panel>
-    <panel
-		 height="25"
-		 layout="bottomright"
-		 name="button_panel"
-		 left="5"
-		 bottom="5"
-		 width="313">
-        <button
-		     follows="bottom|left"
-		     height="23"
-		     label="Open"
-		     layout="topleft"
-		     left="5"
-		     name="open_btn"
-		     top="0"
-		     width="73" />
-	    <button
-		     follows="bottom|left"
-		     height="23"
-		     label="Pay"
-		     layout="topleft"
-		     left_pad="5"
-		     name="pay_btn"
-		     top="0"
-		     width="73" />
-	    <button
-		     follows="bottom|left"
-		     height="23"
-		     label="Buy"
-		     layout="topleft"
-		     left_pad="5"
-		     name="buy_btn"
-		     top="0"
-		     width="73" />
-        <button
-		     follows="bottom|left"
-		     height="23"
-		     label="Details"
-		     layout="topleft"
-		     left_pad="5"
-		     name="details_btn"
-		     top="0"
-		     width="74" />
+    <check_box
+        height="20"
+        width="110"
+        top_pad="6"
+        label="Show in search"
+        layout="topleft"
+        left="120"
+        name="search_check"
+        tool_tip="Let people see this object in search results" />
+    <text
+        type="string"
+        follows="left|top"
+        name="pathfinding_attributes_label"
+        top_pad="6"
+        width="150"
+        left="5">
+      Pathfinding attributes:
+    </text>
+    <text
+        type="string"
+        follows="left|top"
+        text_color="EmphasisColor"
+        name="pathfinding_attributes_value"
+        width="130"
+        word_wrap="false"
+        left_pad="0">
+    </text>
+    <text
+        type="string"
+        text_color="EmphasisColor"
+        length="1"
+        top_pad="10"
+        follows="left|top"
+        layout="topleft"
+        left="10"
+        name="B:"
+        height="10"
+        width="50">
+      B:
+    </text>
+    <text
+        type="string"
+        text_color="White"
+        length="1"
+        follows="left|top"
+        layout="topleft"
+        left_pad="0"
+        name="O:"
+        height="10"
+        width="50">
+      O:
+    </text>
+    <text
+        type="string"
+        text_color="EmphasisColor"
+        length="1"
+        follows="left|top"
+        layout="topleft"
+        left_pad="0"
+        name="G:"
+        height="10"
+        width="50">
+      G:
+    </text>
+    <text
+        type="string"
+        text_color="White"
+        length="1"
+        follows="left|top"
+        left_pad="0"
+        layout="topleft"
+        name="E:"
+        height="10"
+        width="50">
+      E:
+    </text>
+    <text
+        type="string"
+        text_color="EmphasisColor"
+        length="1"
+        follows="left|top"
+        layout="topleft"
+        left_pad="0"
+        name="N:"
+        height="10"
+        width="50">
+      N:
+    </text>
+    <text
+        type="string"
+        text_color="White"
+        length="1"
+        follows="left|top"
+        layout="topleft"
+        left_pad="0"
+        name="F:"
+        height="10"
+        width="50">
+      F:
+    </text>
+  </panel>
+  <panel
+      height="25"
+      layout="bottomright"
+      name="button_panel"
+      left="5"
+      bottom="5"
+      width="313">
+    <button
+        follows="bottom|left"
+        height="23"
+        label="Open"
+        layout="topleft"
+        left="5"
+        name="open_btn"
+        top="0"
+        width="73" />
+    <button
+        follows="bottom|left"
+        height="23"
+        label="Pay"
+        layout="topleft"
+        left_pad="5"
+        name="pay_btn"
+        top="0"
+        width="73" />
+    <button
+        follows="bottom|left"
+        height="23"
+        label="Buy"
+        layout="topleft"
+        left_pad="5"
+        name="buy_btn"
+        top="0"
+        width="73" />
+    <button
+        follows="bottom|left"
+        height="23"
+        label="Details"
+        layout="topleft"
+        left_pad="5"
+        name="details_btn"
+        top="0"
+        width="74" />
 
-	</panel>
+  </panel>
 </panel>
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 6dd80dc11ae6126e6a57fdff3486c754ad3f6562..d5186e4c1bcd575f76f03c8dc710d3fe52cdef95 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -672,7 +672,7 @@ Sets the texture u &amp; v scales for the chosen face or ALL_SIDES
 	</string>
 	<string name="LSLTipText_llOffsetTexture" translate="false">
 llOffsetTexture(float u, float v, integer face)
-Sets the texture u &amp; v offsets for the chosen face or ALL_SIDES
+Sets the texture u  &amp; v offsets for the chosen face or ALL_SIDES
 	</string>
 	<string name="LSLTipText_llRotateTexture" translate="false">
 llRotateTexture(float rotation, integer face)
@@ -790,9 +790,9 @@ Sets the script timer to zero
 float llGetAndResetTime()
 Returns the script time in seconds and then resets the script timer to zero
 	</string>
-	<string name="LSLTipText_llSoplayund" translate="false">
+	<string name="LSLTipText_llSound" translate="false">
 llSound(string sound, float volume, integer queue, integer loop)
-Plays sound at volume and whether it should loop or not
+Plays sound at volume and whether it should loop or not.
 	</string>
 	<string name="LSLTipText_llPlaySound" translate="false">
 llPlaySound(string sound, float volume)
@@ -1668,7 +1668,7 @@ Returns a list containing results of the sent query
 	</string>
 	<string name="LSLTipText_llModPow" translate="false">
 integer llModPow(integer a, integer b, integer c)
-Returns a raised to the b power, mod c. ( (a**b)%c )
+Returns a raised to the b power, mod c. ( (a**b)%c )
 b is capped at 0xFFFF (16 bits).
 	</string>
 	<string name="LSLTipText_llGetInventoryType" translate="false">
@@ -1781,10 +1781,10 @@ integer llGetParcelMaxPrims(vector pos, integer sim_wide)
 Returns the maximum number of prims allowed on the parcel at pos
 	</string>
 	<string name="LSLTipText_llGetParcelDetails" translate="false">
-    list llGetParcelDetails(vector pos, list params)
-    Returns the parcel details specified in params for the parcel at pos.
-    Params is one or more of: PARCEL_DETAILS_NAME, _DESC, _OWNER, _GROUP, _AREA, _ID, _SEE_AVATARS
-  </string>
+list llGetParcelDetails(vector pos, list params)
+Returns the parcel details specified in params for the parcel at pos.
+Params is one or more of: PARCEL_DETAILS_NAME, _DESC, _OWNER, _GROUP, _AREA, _ID, _SEE_AVATARS
+	</string>
 	<string name="LSLTipText_llSetLinkPrimitiveParams" translate="false">
 llSetLinkPrimitiveParams(integer linknumber, list rules)
 Sets primitive parameters for linknumber based on rules
@@ -1873,71 +1873,202 @@ Releases the specified URL, it will no longer be usable
 	<string name="LSLTipText_llHTTPResponse" translate="false">
 llHTTPResponse(key request_id, integer status, string body)
 Responds to request_id with status and body
-  </string>
+	</string>
 	<string name="LSLTipText_llGetHTTPHeader" translate="false">
 string llGetHTTPHeader(key request_id, string header)
 Returns the value for header for request_id
 	</string>
-  <string name="LSLTipText_llSetPrimMediaParams" translate="false">
+	<string name="LSLTipText_llSetPrimMediaParams" translate="false">
 llSetPrimMediaParams(integer face, list params)
 Sets the media params for a particular face on an object. If media is not already on this object, add it.
 List is a set of name/value pairs in no particular order.  Params not specified are unchanged, or if new media is added then set to the default specified.
 The possible names are below, along with the types of values and what they mean.
-  </string>
-  <string name="LSLTipText_llGetPrimMediaParams" translate="false">
+	</string>
+	<string name="LSLTipText_llGetPrimMediaParams" translate="false">
 list llGetPrimMediaParams(integer face, list params)
 Returns the media params for a particular face on an object, given the desired list of names, in the order requested.
 (Returns an empty list if no media exists on the face.)
-  </string>
-  <string name="LSLTipText_llClearPrimMedia" translate="false">
+	</string>
+	<string name="LSLTipText_llClearPrimMedia" translate="false">
 llClearPrimMedia(integer face)
 Clears (deletes) the media and all params from the given face.
-  </string>
-<string name="LSLTipText_llSetLinkPrimitiveParamsFast" translate="false">
+	</string>
+	<string name="LSLTipText_llSetLinkPrimitiveParamsFast" translate="false">
 llSetLinkPrimitiveParamsFast(integer linknumber,list rules)
 Set primitive parameters for linknumber based on rules.
-</string>
-<string name="LSLTipText_llGetLinkPrimitiveParams" translate="false">
+	</string>
+	<string name="LSLTipText_llGetLinkPrimitiveParams" translate="false">
 llGetLinkPrimitiveParams(integer linknumber,list rules)
 Get primitive parameters for linknumber based on rules.
-</string>
-<string name="LSLTipText_llLinkParticleSystem" translate="false">
+	</string>
+	<string name="LSLTipText_llLinkParticleSystem" translate="false">
 llLinkParticleSystem(integer linknumber,list rules)
 Creates a particle system based on rules.  Empty list removes particle system from object.
 List format is [ rule1, data1, rule2, data2 . . . rulen, datan ].
-</string>
-<string name="LSLTipText_llSetLinkTextureAnim" translate="false">
+	</string>
+	<string name="LSLTipText_llSetLinkTextureAnim" translate="false">
 llSetLinkTextureAnim(integer link, integer mode, integer face, integer sizex, integer sizey, float start, float length, float rate)
-Animate the texture on the specified prim's face/faces.
-</string>
-<string name="LSLTipText_llGetLinkNumberOfSides" translate="false">
+Animate the texture on the specified prim&apos;s face/faces.
+	</string>
+	<string name="LSLTipText_llGetLinkNumberOfSides" translate="false">
 integer llGetLinkNumberOfSides(integer link)
 Returns the number of sides of the specified linked prim.
-</string>
-<string name="LSLTipText_llGetUsername" translate="false">
+	</string>
+	<string name="LSLTipText_llGetUsername" translate="false">
 string llGetUsername(key id)
 Returns the single-word username of an avatar, iff the avatar is in the current region, otherwise the empty string.
-</string>
-<string name="LSLTipText_llRequestUsername" translate="false">
+	</string>
+	<string name="LSLTipText_llRequestUsername" translate="false">
 key llRequestUsername(key id)
 Requests single-word username of an avatar.  When data is available the dataserver event will be raised.
-</string>
-<string name="LSLTipText_llGetDisplayName" translate="false">
-  string llGetDisplayName(key id)
-  Returns the name of an avatar, iff the avatar is in the current simulator, and the name has been cached, otherwise the same as llGetUsername.  Use llRequestDisplayName if you absolutely must have the display name.
-</string>
-<string name="LSLTipText_llRequestDisplayName" translate="false">
+	</string>
+	<string name="LSLTipText_llGetDisplayName" translate="false">
+string llGetDisplayName(key id)
+Returns the name of an avatar, iff the avatar is in the current simulator, and the name has been cached, otherwise the same as llGetUsername.  Use llRequestDisplayName if you absolutely must have the display name.
+	</string>
+	<string name="LSLTipText_llRequestDisplayName" translate="false">
 key llRequestDisplayName(key id)
 Requests name of an avatar.  When data is available the dataserver event will be raised.
-</string>
-<string name="LSLTipText_llRegionSayTo" translate="false">
-llRegionSayTo(key target, integer channel, string msg)
-Sends msg on channel (not DEBUG_CHANNEL) directly to prim or avatar target anywhere within the region
-</string>
-<string name="LSLTipText_llGetEnv" translate="false">
+	</string>
+	<string name="LSLTipText_llGetEnv" translate="false">
 llGetEnv(string name)
 Returns a string with the requested data about the region
-</string>
+	</string>
+	<string name="LSLTipText_llCastRay" translate="false">
+llCastRay(vector start, vector end, list params)
+Casts a ray into the physics world from &apos;start&apos; to &apos;end&apos; and returns data according to details in params.
+	</string>
+	<string name="LSLTipText_llRegionSayTo" translate="false">
+llRegionSayTo(key target, integer channel, string msg)
+Sends msg on channel (not DEBUG_CHANNEL) directly to prim or avatar target anywhere within the region.
+	</string>
+	<string name="LSLTipText_llGetSPMaxMemory" translate="false">
+integer llGetSPMaxMemory()
+Returns the maximum used memory for the current script. Only valid after using PROFILE_SCRIPT_MEMORY. Non-mono scripts always use 16k.
+	</string>
+	<string name="LSLTipText_llGetUsedMemory" translate="false">
+integer llGetUsedMemory()
+Returns the current used memory for the current script. Non-mono scripts always use 16k.
+	</string>
+	<string name="LSLTipText_llScriptProfiler" translate="false">
+llScriptProfiler(integer flags)
+Enabled or disables script profiling options. Currently only supports PROFILE_SCRIPT_MEMORY (mono only) and PROFILE_NONE.
+MAY SIGNIFICANTLY REDUCE SCRIPT PERFORMANCE!
+	</string>
+	<string name="LSLTipText_llSetMemoryLimit" translate="false">
+integer llSetMemoryLimit(integer mem)
+	</string>
+	<string name="LSLTipText_llGetMemoryLimit" translate="false">
+integer llGetMemoryLimit()
+	</string>
+	<string name="LSLTipText_llSetLinkMedia" translate="false">
+llSetLinkMedia(integer link, integer face, list params)
+Set the media params for a particular face on linked prim.  List is a set of name/value pairs (in no particular order). The possible names are below, along with the types of values and what they mean.  If media is not already on this object, add it. Params not specified are unchanged, or if new media is added set to the default specified.
+	</string>
+	<string name="LSLTipText_llGetLinkMedia" translate="false">
+list llGetLinkMedia(integer link, integer face, list params)
+Get the media params for a particular face on linked prim, given the desired list of names. Returns a list of values in the order requested.  Returns an empty list if no media exists on the face.
+	</string>
+	<string name="LSLTipText_llClearLinkMedia" translate="false">
+llClearLinkMedia(integer link, integer face)
+Clears (deletes) the media and all params from the given face on linked prim.
+	</string>
+	<string name="LSLTipText_llSetContentType" translate="false">
+llSetContentType(key id, integer content_type)
+	</string>
+	<string name="LSLTipText_llLinkSitTarget" translate="false">
+llLinkSitTarget(integer link, vector offset, rotation rot)
+Set the sit location for this object (if offset == &lt;0,0,0&gt; clear it)
+	</string>
+	<string name="LSLTipText_llAvatarOnLinkSitTarget" translate="false">
+key llAvatarOnLinkSitTarget(integer link)
+If an avatar is sitting on the sit target, return the avatar&apos;s key, NULL_KEY otherwise
+	</string>
+	<string name="LSLTipText_llSetLinkCamera" translate="false">
+llSetLinkCamera(integer link, vector eye, vector at)
+	</string>
+	<string name="LSLTipText_llSetVelocity" translate="false">
+llSetVelocity(vector velocity, integer local)
+Sets an objects velocity, in local coords if local == TRUE (if the script is physical)
+	</string>
+	<string name="LSLTipText_llSetAngularVelocity" translate="false">
+llSetAngularVelocity(vector angular_velocity, integer local)
+Sets an objects angular velocity, in local coords if local == TRUE (if the script is physical)
+	</string>
+	<string name="LSLTipText_llSetPhysicsMaterial" translate="false">
+llSetPhysicsMaterial(integer flags, float gravity_multiplier, float restitution, float friction, float density )
+Sets the requested attributes of the root object&apos;s physics material.
+	</string>
+	<string name="LSLTipText_llGetPhysicsMaterial" translate="false">
+llGetPhysicsMaterial() returns the gravity multiplier, restitution, friction, and density of the linkset as a list in that order.
+	</string>
+	<string name="LSLTipText_llGetMassMKS" translate="false">
+llGetMassMKS() returns the mass of the linkset in kilograms.
+	</string>
+	<string name="LSLTipText_llGenerateKey" translate="false">
+llGenerateKey()
+Retun a unique generated key
+	</string>
+	<string name="LSLTipText_llSetKeyframedMotion" translate="false">
+llSetKeyframedMotion(list keyframes, list options)
+Requests that a nonphysical object be keyframed according to keyframe list.
+	</string>
+	<string name="LSLTipText_llTransferLindenDollars" translate="false">
+key llTransferLindenDollars(key destination, integer amount)
+Transfer amount of linden dollars (L$) from script owner to destination. Returns a key to a corresponding transaction_result event for the success of the transfer.
+	</string>
+	<string name="LSLTipText_llGetParcelMusicURL" translate="false">
+string llGetParcelMusicURL()
+Gets the streaming audio URL for the parcel of land on which the object is located.
+	</string>
+	<string name="LSLTipText_llSetRegionPos" translate="false">
+integer llSetRegionPos(vector pos)
+Sets the position anywhere within the region (if the object isn&apos;t physical)
+	</string>
+	<string name="LSLTipText_llNavigateTo" translate="false">
+llNavigateTo(vector point, list options)
+For AI Character: Navigate to destination.
+	</string>
+	<string name="LSLTipText_llCreateCharacter" translate="false">
+llCreateCharacter(list options)
+Convert linkset to AI Character which can navigate the world.
+	</string>
+	<string name="LSLTipText_llPursue" translate="false">
+llPursue(key target, list options)
+For AI Character: Chase after a target.
+	</string>
+	<string name="LSLTipText_llWanderWithin" translate="false">
+llWanderWithin(vector center, float radius, list options)
+For AI Character: Wander within a specified volume.
+	</string>
+	<string name="LSLTipText_llFleeFrom" translate="false">
+llFleeFrom(vector source, float radius, list options)
+For AI Character: Flee from a point.
+	</string>
+	<string name="LSLTipText_llPatrolPoints" translate="false">
+llPatrolPoints(list points, list options)
+For AI Character: Patrol a list of points.
+	</string>
+	<string name="LSLTipText_llExecCharacterCmd" translate="false">
+llExecCharacterCmd(integer cmd, list options)
+For AI Character: Execute a character command.
+	</string>
+	<string name="LSLTipText_llDeleteCharacter" translate="false">
+llDeleteCharacter()
+Convert linkset from AI Character to Physics object.
+	</string>
+	<string name="LSLTipText_llUpdateCharacter" translate="false">
+llUpdateCharacter(list options)
+Change the AI Character&apos;s settings.
+	</string>
+	<string name="LSLTipText_llEvade" translate="false">
+llEvade(key target, list options)
+For AI Character: Evade a specified target.
+	</string>
+	<string name="LSLTipText_llGetClosestNavPoint" translate="false">
+list llGetClosestNavPoint(vector point, list options)
+For AI Character: Get the closest navigable point to the point provided.
+	</string>
 
 
   <!-- Avatar busy/away mode -->
@@ -3196,7 +3327,8 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
   <string name="LocationCtrlModerateIconTooltip">Moderate Region</string>
   <string name="LocationCtrlGeneralIconTooltip">General Region</string>
   <string name="LocationCtrlSeeAVsTooltip">Avatars visible and chat allowed outside of this parcel</string>
-
+  <string name="LocationCtrlPathfindingDirtyTooltip">Objects that move may not behave correctly in this region until the region is rebaked.</string>
+  <string name="LocationCtrlPathfindingDisabledTooltip">Dynamic pathfinding is not enabled on this region.</string>
   <!-- Strings used by the (currently Linux) auto-updater app -->
 	<string name="UpdaterWindowTitle">
 	  [APP_NAME] Update
@@ -3752,6 +3884,13 @@ Try enclosing path to the editor with double quotes.
   <string name="Preview">Preview</string>
   <string name="Normal">Normal</string>
 
+  <!-- Pathfinding -->
+  <string name="Pathfinding_Wiki_URL">http://wiki.secondlife.com/wiki/Pathfinding_Tools_in_the_Second_Life_Viewer</string>
+  <string name="Pathfinding_Object_Attr_None">None</string>
+  <string name="Pathfinding_Object_Attr_Permanent">Affects navmesh</string>
+  <string name="Pathfinding_Object_Attr_Character">Character</string>
+  <string name="Pathfinding_Object_Attr_MultiSelect">(Multiple)</string>
+
   <!-- Snapshot image quality levels -->
   <string name="snapshot_quality_very_low">Very Low</string>
   <string name="snapshot_quality_low">Low</string>
diff --git a/indra/newview/skins/default/xui/en/widgets/location_input.xml b/indra/newview/skins/default/xui/en/widgets/location_input.xml
index 44436fb6f276657cc8e160825d2129ec96654d30..61ec046649d85ddced12ac0f6810beb9a2af34a4 100644
--- a/indra/newview/skins/default/xui/en/widgets/location_input.xml
+++ b/indra/newview/skins/default/xui/en/widgets/location_input.xml
@@ -112,6 +112,22 @@
     follows="right|top"
     image_name="Parcel_Health_Dark"
     />
+  <pathfinding_dirty_icon
+    name="pathfinding_dirty_icon"
+    width="22"
+    height="18"
+    top="21"
+    follows="right|top"
+    image_name="Pathfinding_Dirty"
+    />
+  <pathfinding_disabled_icon
+    name="pathfinding_disabled_icon"
+    width="22"
+    height="18"
+    top="21"
+    follows="right|top"
+    image_name="Pathfinding_Disabled"
+    />
   <!-- Default text color is invisible on top of nav bar background -->
   <damage_text
     name="damage_text"
diff --git a/indra/newview/skins/default/xui/es/floater_hardware_settings.xml b/indra/newview/skins/default/xui/es/floater_hardware_settings.xml
index b96076836b4448f49b51b5ad8921ed3dfa602749..c351db5eaecebc72ec35c37f1dab14da7bc3b1bb 100644
--- a/indra/newview/skins/default/xui/es/floater_hardware_settings.xml
+++ b/indra/newview/skins/default/xui/es/floater_hardware_settings.xml
@@ -25,6 +25,10 @@
 		Activar VBO:
 	</text>
 	<check_box initial_value="true" label="Activar OpenGL Vertex Buffer Objects" name="vbo" tool_tip="En hardware moderno, habilitar esta opción mejora el rendimiento. Pero en hardware antiguo, el habilitarlo hace que, frecuentemente, se obtenga una implementación pobre de VBO, lo que puede provocarle caídas."/>
+	<text name="tc label">
+		Activar S3TC:
+	</text>
+	<check_box initial_value="verdadero" label="Activar la compresión de texturas (requiere reiniciar)" name="texture compression" tool_tip="Comprime las texturas de la memoria de vídeo, lo cual permite cargar texturas de una resolución más alta, pero con una cierta pérdida de calidad del color."/>
 	<slider label="Memoria para texturas (MB):" name="GraphicsCardTextureMemory" tool_tip="Cantidad de memoria asignada a las texturas. Por defecto es la memoria de la tarjeta de vídeo. Reducir esta cantidad puede mejorar el rendimiento, pero también hacer que las texturas se vean borrosas."/>
 	<spinner label="Intensidad de la niebla:" name="fog"/>
 	<button label="OK" label_selected="OK" name="OK"/>
diff --git a/indra/newview/skins/default/xui/es/floater_stats.xml b/indra/newview/skins/default/xui/es/floater_stats.xml
index ba4af2e8669b8426a95988549f094730b982f8e5..d53ae88126c98399d2cccc93b18082687b36dfbe 100644
--- a/indra/newview/skins/default/xui/es/floater_stats.xml
+++ b/indra/newview/skins/default/xui/es/floater_stats.xml
@@ -14,8 +14,11 @@
 					<stat_bar label="KTris generados por segundo" name="ktrissec"/>
 					<stat_bar label="Objetos en total" name="objs"/>
 					<stat_bar label="Objetos nuevos" name="newobjs"/>
+					<stat_bar label="Índice de aciertos de caché de objetos" name="object_cache_hits"/>
 				</stat_view>
 				<stat_view label="Textura" name="texture">
+					<stat_bar label="Índice de aciertos de caché" name="texture_cache_hits"/>
+					<stat_bar label="Latencia de lectura de caché" name="texture_cache_read_latency"/>
 					<stat_bar label="Número" name="numimagesstat"/>
 					<stat_bar label="Raw: número" name="numrawimagesstat"/>
 					<stat_bar label="GL Mem" name="gltexmemstat"/>
diff --git a/indra/newview/skins/default/xui/es/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/es/floater_texture_ctrl.xml
index ed2787ea608aad734badcb7b0b5eca9d994fb77c..1e566e3e31b26e12d5fe1195606eaa2241c1d429 100644
--- a/indra/newview/skins/default/xui/es/floater_texture_ctrl.xml
+++ b/indra/newview/skins/default/xui/es/floater_texture_ctrl.xml
@@ -1,24 +1,35 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="texture picker" title="DESTACADO: TEXTURA">
-	<string name="choose_picture">
+	<floater.string name="choose_picture">
 		Pulse para elegir una imagen
-	</string>
+	</floater.string>
+	<floater.string name="pick title">
+		Elegir:
+	</floater.string>
 	<text name="Multiple">
 		Texturas múltiples
 	</text>
+	<radio_group name="mode_selection">
+		<radio_item label="Inventario" name="inventory" value="0"/>
+		<radio_item label="Local" name="local" value="1"/>
+	</radio_group>
 	<text name="unknown">
 		Tamaño: [DIMENSIONS]
 	</text>
 	<button label="Por defecto" label_selected="Por defecto" name="Default" width="84"/>
-	<button label="Ninguna" label_selected="Ninguna" left="90" name="None"/>
 	<button label="Blanca" label_selected="Blanca" name="Blank"/>
-	<check_box label="Ver las carpetas" name="show_folders_check"/>
-	<search_editor label="Filtrar las texturas" name="inventory search editor"/>
-	<check_box label="Aplicarlo ahora" name="apply_immediate_check"/>
+	<button label="Ninguna" label_selected="Ninguna" left="90" name="None"/>
 	<button label="" label_selected="" name="Pipette"/>
-	<button label="Cancelar" label_selected="Cancelar" name="Cancel"/>
+	<filter_editor label="Filtrar las texturas" name="inventory search editor"/>
+	<check_box initial_value="false" label="Ver las carpetas" name="show_folders_check"/>
+	<button label="Añadir" label_selected="Añadir" name="l_add_btn"/>
+	<button label="Eliminar" label_selected="Eliminar" name="l_rem_btn"/>
+	<button label="Subir" label_selected="Subir" name="l_upl_btn"/>
+	<scroll_list name="l_name_list">
+		<column label="Nombre" name="unit_name"/>
+		<column label="ID" name="unit_id_HIDDEN"/>
+	</scroll_list>
 	<button label="OK" label_selected="OK" name="Select"/>
-	<string name="pick title">
-		Elegir:
-	</string>
+	<button label="Cancelar" label_selected="Cancelar" name="Cancel"/>
+	<check_box initial_value="true" label="Aplicarlo ahora" name="apply_immediate_check"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/es/floater_texture_fetch_debugger.xml b/indra/newview/skins/default/xui/es/floater_texture_fetch_debugger.xml
new file mode 100644
index 0000000000000000000000000000000000000000..29fd2ab2a32a9fa498ea398d5a3e4e1844c173a1
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/floater_texture_fetch_debugger.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="TexFetchDebugger" title="Depurador de obtención de texturas">
+	<text name="total_num_fetched_label">
+		1, Número total de texturas obtenidas: [NUM]
+	</text>
+	<text name="total_num_fetching_requests_label">
+		2, Número total de solicitudes de obtención: [NUM]
+	</text>
+	<text name="total_num_cache_hits_label">
+		3, Número total de aciertos de caché: [NUM]
+	</text>
+	<text name="total_num_visible_tex_label">
+		4, Número total de texturas visibles: [NUM]
+	</text>
+	<text name="total_num_visible_tex_fetch_req_label">
+		5, Número total de solicitudes de obtención de texturas visibles: [NUM]
+	</text>
+	<text name="total_fetched_data_label">
+		6, Número total de datos obtenidos: [SIZE1] KB, Datos descodificados: [SIZE2] KB, [PIXEL] MPíxeles
+	</text>
+	<text name="total_fetched_vis_data_label">
+		7, Número total de datos visibles: [SIZE1] KB, Datos descodificados: [SIZE2] KB
+	</text>
+	<text name="total_fetched_rendered_data_label">
+		8, Número total de datos representados: [SIZE1] KB, Datos descodificados: [SIZE2] KB, [PIXEL] MPíxeles
+	</text>
+	<text name="total_time_cache_read_label">
+		9, Tiempo total en lecturas de caché: [TIME] segundos
+	</text>
+	<text name="total_time_cache_write_label">
+		10, Tiempo total en escrituras de caché: [TIME] segundos
+	</text>
+	<text name="total_time_decode_label">
+		11, Tiempo total en descodificaciones: [TIME] segundos
+	</text>
+	<text name="total_time_gl_label">
+		12, Tiempo total en la creación de texturas gl: [TIME] segundos
+	</text>
+	<text name="total_time_http_label">
+		13, Tiempo total en obtención de HTTP: [TIME] segundos
+	</text>
+	<text name="total_time_fetch_label">
+		14, Tiempo total en obtención completa: [TIME] segundos
+	</text>
+	<text name="total_time_refetch_vis_cache_label">
+		15, Volviendo a obtener visibles de la caché, Tiempo: [TIME] segundos, Obtenidos: [SIZE] KB, [PIXEL] MPíxeles
+	</text>
+	<text name="total_time_refetch_vis_http_label">
+		16, Volviendo a obtener visibles de HTTP, Tiempo: [TIME] segundos, Obtenidos: [SIZE] KB, [PIXEL] MPíxeles
+	</text>
+	<spinner label="17, Proporción de texeles/píxeles:" name="texel_pixel_ratio"/>
+	<button label="Iniciar" name="start_btn"/>
+	<button label="Restablecer" name="clear_btn"/>
+	<button label="Cerrar" name="close_btn"/>
+	<button label="Lectura de caché" name="cacheread_btn"/>
+	<button label="Escritura de caché" name="cachewrite_btn"/>
+	<button label="HTTP" name="http_btn"/>
+	<button label="Descodificar" name="decode_btn"/>
+	<button label="Textura GL" name="gl_btn"/>
+	<button label="Volver a obtener caché de vis." name="refetchviscache_btn"/>
+	<button label="Volver a obtener HTTP de vis." name="refetchvishttp_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_window_size.xml b/indra/newview/skins/default/xui/es/floater_window_size.xml
index f57ce08eac5bc2ff7fd22c20b73a177f28ecee91..6c1ad02319e98d56f47930f133d931c456ff67a0 100644
--- a/indra/newview/skins/default/xui/es/floater_window_size.xml
+++ b/indra/newview/skins/default/xui/es/floater_window_size.xml
@@ -7,10 +7,17 @@
 		Definir el tamaño de la ventana:
 	</text>
 	<combo_box name="window_size_combo" tool_tip="ancho x alto">
-		<combo_box.item label="1000 x 700 (por defecto)" name="item0"/>
-		<combo_box.item label="1024 x 768" name="item1"/>
-		<combo_box.item label="1280 x 720 (720 p)" name="item2"/>
-		<combo_box.item label="1920 x 1080 (1080 p)" name="item3"/>
+		<combo_box.item label="1000 x 700 (por defecto)" name="item1"/>
+		<combo_box.item label="1024 x 768 (4:3 XGA)" name="item2"/>
+		<combo_box.item label="1280 x 720 (16:9 HDTV)" name="item3"/>
+		<combo_box.item label="1280 x 800 (5:8 WXGA)" name="item4"/>
+		<combo_box.item label="1280 x 1024 (5:4 SXGA)" name="item5"/>
+		<combo_box.item label="1440 x 900 (8:5 WSXGA)" name="item7"/>
+		<combo_box.item label="1600 x 900 (16:9 HD+)" name="item8"/>
+		<combo_box.item label="1600 x 1200 (4:3 UXGA)" name="item9"/>
+		<combo_box.item label="1680 x 1050 (8:5 WSXGA+)" name="item10"/>
+		<combo_box.item label="1920 x 1080 (16:9 HDTV)" name="item11"/>
+		<combo_box.item label="1920 x 1200 (8:5 WUXGA)" name="item12"/>
 	</combo_box>
 	<button label="Configurar" name="set_btn"/>
 	<button label="Cancelar" name="cancel_btn"/>
diff --git a/indra/newview/skins/default/xui/es/menu_viewer.xml b/indra/newview/skins/default/xui/es/menu_viewer.xml
index 9522d4eac669ccf3e8a089019f189ae35939768d..740bd35cbbd26db44ae1f51b8247565dc9d94653 100644
--- a/indra/newview/skins/default/xui/es/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/es/menu_viewer.xml
@@ -225,11 +225,10 @@
 			<menu_item_check label="Texture Console" name="Texture Console"/>
 			<menu_item_check label="Debug Console" name="Debug Console"/>
 			<menu_item_call label="Notifications Console" name="Notifications"/>
-			<menu_item_check label="Texture Size Console" name="Texture Size"/>
-			<menu_item_check label="Texture Category Console" name="Texture Category"/>
 			<menu_item_check label="Fast Timers" name="Fast Timers"/>
 			<menu_item_check label="Memory" name="Memory"/>
 			<menu_item_check label="Datos de la escena" name="Scene Statistics"/>
+			<menu_item_call label="Consola de depuración de obtención de texturas" name="Texture Fetch Debug Console"/>
 			<menu_item_call label="Region Info to Debug Console" name="Region Info to Debug Console"/>
 			<menu_item_check label="Camera" name="Camera"/>
 			<menu_item_check label="Wind" name="Wind"/>
@@ -270,6 +269,12 @@
 			<menu_item_check label="Complejidad del renderizado" name="rendercomplexity"/>
 			<menu_item_check label="Bytes de adjunto" name="attachment bytes"/>
 			<menu_item_check label="Esculpir" name="Sculpt"/>
+			<menu label="Densidad de textura" name="Texture Density">
+				<menu_item_check label="Ninguna" name="None"/>
+				<menu_item_check label="Actual" name="Current"/>
+				<menu_item_check label="Deseada" name="Desired"/>
+				<menu_item_check label="Completa" name="Full"/>
+			</menu>
 		</menu>
 		<menu label="Rendering" name="Rendering">
 			<menu_item_check label="Axes" name="Axes"/>
diff --git a/indra/newview/skins/default/xui/es/notifications.xml b/indra/newview/skins/default/xui/es/notifications.xml
index d47c3d7ad886da40e1a5d7345de4e8c80c09d69b..af7a7b088a128a425b0ac40223d8e87255086bf3 100644
--- a/indra/newview/skins/default/xui/es/notifications.xml
+++ b/indra/newview/skins/default/xui/es/notifications.xml
@@ -490,6 +490,15 @@ El objeto debe de haber sido borrado o estar fuera de rango (&apos;out of range&
 		</url>
 		<usetemplate ignoretext="El hardware de mi ordenador no está admitido" name="okcancelignore" notext="No" yestext="Sí"/>
 	</notification>
+	<notification name="IntelOldDriver">
+		Probablemente ya existe un controlador más reciente para tu procesador de gráficos. La actualización del controlador de gráficos puede mejorar sustancialmente el rendimiento.
+
+    ¿Deseas visitar [_URL] para comprobar si hay controladores actualizados?
+		<url name="url">
+			http://www.intel.com/p/es_XL/support/detect/graphics
+		</url>
+		<usetemplate ignoretext="Mi controlador de gráficos no está actualizado" name="okcancelignore" notext="No" yestext="Sí"/>
+	</notification>
 	<notification name="UnknownGPU">
 		Tu sistema usa una tarjeta gráfica que [APP_NAME] no reconoce.
 Suele suceder con hardware nuevo que todavía no ha sido probado con [APP_NAME].  Probablemente todo irá bien, pero deberás ajustar tus configuraciones gráficas.
@@ -2622,33 +2631,23 @@ Del objeto: &lt;nolink&gt;[OBJECTNAME]&lt;/nolink&gt;, propietario: [NAME]?
 		</form>
 	</notification>
 	<notification name="ScriptQuestionCaution">
-		Un objeto de nombre &apos;&lt;nolink&gt;[OBJECTNAME]&lt;/nolink&gt;&apos;, propiedad de &apos;[NAME]&apos;, quiere:
-
-[QUESTIONS]
-Si no confias en este objeto y en su creador, deberías rehusar esta petición.
-
-¿Autorizar esta petición?
+		Atención: El objeto &apos;&lt;nolink&gt;[OBJECTNAME]&lt;/nolink&gt;&apos; solicita un acceso total a tu cuenta de dólares Linden. Si le autorizas el acceso, podrá retirar fondos de tu cuenta en cualquier momento o vaciarla por completo, de manera permanente y sin más advertencias.
+  
+Estas solicitudes pocas veces son legítimas. No autorices el acceso si no conoces la razón exacta por la que desea el acceso a tu cuenta.
 		<form name="form">
-			<button name="Grant" text="Autorizar"/>
+			<button name="Grant" text="Permitir acceso total"/>
 			<button name="Deny" text="Denegar"/>
-			<button name="Details" text="Detalles..."/>
 		</form>
 	</notification>
 	<notification name="ScriptDialog">
 		&apos;&lt;nolink&gt;[TITLE]&lt;/nolink&gt;&apos; de [NAME]
 [MESSAGE]
-		<form name="form">
-			<button name="Mute" text="Ignorar"/>
-			<button name="Ignore" text="Ignorar"/>
-		</form>
+		<form name="form"/>
 	</notification>
 	<notification name="ScriptDialogGroup">
 		&apos;&lt;nolink&gt;[TITLE]&lt;/nolink&gt;&apos; de [GROUPNAME]
 [MESSAGE]
-		<form name="form">
-			<button name="Mute" text="Ignorar"/>
-			<button name="Ignore" text="Ignorar"/>
-		</form>
+		<form name="form"/>
 	</notification>
 	<notification name="BuyLindenDollarSuccess">
 		¡Gracias por tu pago!
@@ -3126,4 +3125,16 @@ También puedes buscar en el Mapa lugares marcados como &quot;Puntos de Informac
 	<global name="You died and have been teleported to your home location">
 		Has muerto y te has teleportado a tu Base.
 	</global>
+	<notification name="LocalBitmapsUpdateFileNotFound">
+		[FNAME] no se ha podido actualizar porque el archivo ya no se encuentra.
+Desactivando futuras actualizaciones de este archivo.
+	</notification>
+	<notification name="LocalBitmapsUpdateFailedFinal">
+		[FNAME] se ha intentado abrir o descodificar durante [NRETRIES] intentos sin éxito, y ahora se considera roto.
+Desactivando futuras actualizaciones de este archivo.
+	</notification>
+	<notification name="LocalBitmapsVerifyFail">
+		Se ha intentado añadir un archivo de imagen [FNAME] no válido o ilegible, que no se puede abrir ni descodificar.
+Intento cancelado.
+	</notification>
 </notifications>
diff --git a/indra/newview/skins/default/xui/es/panel_script_question_toast.xml b/indra/newview/skins/default/xui/es/panel_script_question_toast.xml
new file mode 100644
index 0000000000000000000000000000000000000000..a2d0237da010e5c72549a283f6a34c7561e17eab
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/panel_script_question_toast.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel label="script_question_panel" name="panel_script_question_toast">
+	<panel label="buttons_panel" name="buttons_panel"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/es/strings.xml b/indra/newview/skins/default/xui/es/strings.xml
index 67c65c6ce9a48b700356d9721951c5ed66fd1136..adc32ba168a9b43d3b4f1a169249cdaf7151a375 100644
--- a/indra/newview/skins/default/xui/es/strings.xml
+++ b/indra/newview/skins/default/xui/es/strings.xml
@@ -871,6 +871,9 @@ Intenta iniciar sesión de nuevo en unos instantes.
 	<string name="ScriptQuestionCautionChatDenied">
 		A &apos;[OBJECTNAME]&apos;, un objeto propiedad de &apos;[OWNERNAME]&apos;, localizado en [REGIONNAME] con la posición [REGIONPOS], se le ha denegado el permiso para: [PERMISSIONS].
 	</string>
+	<string name="AdditionalPermissionsRequestHeader">
+		Si autorizas el acceso a tu cuenta, también permitirás al objeto:
+	</string>
 	<string name="ScriptTakeMoney">
 		Cogerle a usted dólares Linden (L$)
 	</string>
@@ -904,6 +907,9 @@ Intenta iniciar sesión de nuevo en unos instantes.
 	<string name="ControlYourCamera">
 		Controlar su cámara
 	</string>
+	<string name="TeleportYourAgent">
+		Teleportarte
+	</string>
 	<string name="SIM_ACCESS_PG">
 		General
 	</string>
diff --git a/indra/newview/skins/default/xui/fr/floater_hardware_settings.xml b/indra/newview/skins/default/xui/fr/floater_hardware_settings.xml
index 2bc76e0c632501de04281d2017b485b3a5009f07..098f8fc7131522940ce660937ff5c56df87c2c55 100644
--- a/indra/newview/skins/default/xui/fr/floater_hardware_settings.xml
+++ b/indra/newview/skins/default/xui/fr/floater_hardware_settings.xml
@@ -25,6 +25,10 @@
 		Activer le VBO :
 	</text>
 	<check_box initial_value="true" label="Activer OpenGL Vertex Buffer Objects" name="vbo" tool_tip="Sur un matériel moderne, cette option permet une meilleure performance. Par contre, sur un matériel plus ancien, les VBO sont souvent mal implémentés et peuvent causer des crashs lorsqu&apos;ils sont activés."/>
+	<text name="tc label">
+		Activer S3TC :
+	</text>
+	<check_box initial_value="vraie" label="Activer la compression des textures (redémarrage requis)" name="texture compression" tool_tip="Comprime les textures en mémoire vidéo afin de permettre de charger des textures de résolution plus élevée au prix d&apos;une certaine qualité de couleur."/>
 	<slider label="Mémoire textures (Mo) :" name="GraphicsCardTextureMemory" tool_tip="Quantité de mémoire à affecter aux textures. Utilise la mémoire de la carte vidéo par défaut. Si vous réduisez ce paramètre, cela peut améliorer les performances, mais les textures risquent d&apos;être floues."/>
 	<spinner label="Indice du brouillard :" name="fog"/>
 	<button label="OK" label_selected="OK" name="OK"/>
diff --git a/indra/newview/skins/default/xui/fr/floater_stats.xml b/indra/newview/skins/default/xui/fr/floater_stats.xml
index 2ce2e6dcd55d89aa17d959581e16856427b8b6d3..56fa062d46b6e2659e36c073fae71c1e3c0df09f 100644
--- a/indra/newview/skins/default/xui/fr/floater_stats.xml
+++ b/indra/newview/skins/default/xui/fr/floater_stats.xml
@@ -14,8 +14,11 @@
 					<stat_bar label="KTris par s" name="ktrissec"/>
 					<stat_bar label="Objets totaux" name="objs"/>
 					<stat_bar label="Nouveaux objets" name="newobjs"/>
+					<stat_bar label="Taux de réussite du cache des objets" name="object_cache_hits"/>
 				</stat_view>
 				<stat_view label="Texture" name="texture">
+					<stat_bar label="Taux de réussite du cache" name="texture_cache_hits"/>
+					<stat_bar label="Latence de lecture du cache" name="texture_cache_read_latency"/>
 					<stat_bar label="Nombre" name="numimagesstat"/>
 					<stat_bar label="Nombre brut" name="numrawimagesstat"/>
 					<stat_bar label="Mém GL" name="gltexmemstat"/>
@@ -57,7 +60,7 @@
 				<stat_bar label="Chargements en attente" name="simpendinguploads"/>
 				<stat_bar label="Total Unacked Bytes" name="simtotalunackedbytes"/>
 				<stat_view label="Temps (ms)" name="simperf">
-					<stat_bar label="Durée totale de l'image" name="simframemsec"/>
+					<stat_bar label="Durée totale de l&apos;image" name="simframemsec"/>
 					<stat_bar label="Durée nette" name="simnetmsec"/>
 					<stat_bar label="Durée sim (physique)" name="simsimphysicsmsec"/>
 					<stat_bar label="Durée sim (autre)" name="simsimothermsec"/>
diff --git a/indra/newview/skins/default/xui/fr/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/fr/floater_texture_ctrl.xml
index 381bcceb005afbb1dac9c7fbf3369698f4c60e0c..ca0fbd3589c9115c849aefec68c07137c4c3444b 100644
--- a/indra/newview/skins/default/xui/fr/floater_texture_ctrl.xml
+++ b/indra/newview/skins/default/xui/fr/floater_texture_ctrl.xml
@@ -1,24 +1,35 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="texture picker" title="CHOISIR : TEXTURE">
-	<string name="choose_picture">
+	<floater.string name="choose_picture">
 		Cliquez pour sélectionner une image
-	</string>
+	</floater.string>
+	<floater.string name="pick title">
+		Choisir :
+	</floater.string>
 	<text name="Multiple">
 		Textures multiples
 	</text>
+	<radio_group name="mode_selection">
+		<radio_item label="Inventaire" name="inventory" value="0"/>
+		<radio_item label="Local" name="local" value="1"/>
+	</radio_group>
 	<text name="unknown">
 		Taille : [DIMENSIONS]
 	</text>
 	<button label="Défaut" label_selected="Défaut" name="Default" width="60"/>
-	<button label="Aucune" label_selected="Aucune" left="68" name="None" width="60"/>
 	<button label="Vierge" label_selected="Vierge" name="Blank" width="60"/>
-	<check_box label="Afficher les dossiers" name="show_folders_check"/>
-	<search_editor label="Filtrer les textures" name="inventory search editor"/>
-	<check_box label="Appliquer maintenant" name="apply_immediate_check"/>
+	<button label="Aucune" label_selected="Aucune" left="68" name="None" width="60"/>
 	<button bottom="-240" label="" label_selected="" name="Pipette"/>
-	<button label="Annuler" label_selected="Annuler" name="Cancel"/>
+	<filter_editor label="Filtrer les textures" name="inventory search editor"/>
+	<check_box initial_value="false" label="Afficher les dossiers" name="show_folders_check"/>
+	<button label="Ajouter" label_selected="Ajouter" name="l_add_btn"/>
+	<button label="Supprimer" label_selected="Supprimer" name="l_rem_btn"/>
+	<button label="Charger" label_selected="Charger" name="l_upl_btn"/>
+	<scroll_list name="l_name_list">
+		<column label="Nom" name="unit_name"/>
+		<column label="ID" name="unit_id_HIDDEN"/>
+	</scroll_list>
 	<button label="OK" label_selected="OK" name="Select"/>
-	<string name="pick title">
-		Choisir :
-	</string>
+	<button label="Annuler" label_selected="Annuler" name="Cancel"/>
+	<check_box initial_value="true" label="Appliquer maintenant" name="apply_immediate_check"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/fr/floater_texture_fetch_debugger.xml b/indra/newview/skins/default/xui/fr/floater_texture_fetch_debugger.xml
new file mode 100644
index 0000000000000000000000000000000000000000..f0cc95319d0d46e1628008407eb261082e601a07
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/floater_texture_fetch_debugger.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="TexFetchDebugger" title="Outil de débogage de la récupération des textures">
+	<text name="total_num_fetched_label">
+		1, nombre total de textures récupérées : [NUM]
+	</text>
+	<text name="total_num_fetching_requests_label">
+		2, nombre total de demandes de récupération : [NUM]
+	</text>
+	<text name="total_num_cache_hits_label">
+		3, nombre total de présences dans le cache : [NUM]
+	</text>
+	<text name="total_num_visible_tex_label">
+		4, nombre total de textures visibles : [NUM]
+	</text>
+	<text name="total_num_visible_tex_fetch_req_label">
+		5, nombre total de demandes de récupération de textures visibles : [NUM]
+	</text>
+	<text name="total_fetched_data_label">
+		6, nombre total de données récupérées : [SIZE1] Ko, données décodées : [SIZE2] Ko, [PIXEL] Mpixels
+	</text>
+	<text name="total_fetched_vis_data_label">
+		7, nombre total de données visibles : [SIZE1] Ko, données décodées : [SIZE2] Ko
+	</text>
+	<text name="total_fetched_rendered_data_label">
+		8, nombre total de données rendues : [SIZE1] Ko, données décodées : [SIZE2] Ko, [PIXEL] Mpixels
+	</text>
+	<text name="total_time_cache_read_label">
+		9, durée totale des lectures du cache : [TIME] secondes
+	</text>
+	<text name="total_time_cache_write_label">
+		10, durée totale des écritures du cache : [TIME] secondes
+	</text>
+	<text name="total_time_decode_label">
+		11, durée totale des décodages : [TIME] secondes
+	</text>
+	<text name="total_time_gl_label">
+		12, durée totale de la création de textures GL : [TIME] secondes
+	</text>
+	<text name="total_time_http_label">
+		13, durée totale de la récupération HTTP : [TIME] secondes
+	</text>
+	<text name="total_time_fetch_label">
+		14, durée totale de la récupération intégrale : [TIME] secondes
+	</text>
+	<text name="total_time_refetch_vis_cache_label">
+		15, nouvelle récupération des données visibles du cache, Durée : [TIME] secondes, Récupéré : [SIZE] Ko, [PIXEL] Mpixels
+	</text>
+	<text name="total_time_refetch_vis_http_label">
+		16, nouvelle récupération des données visibles de la requête HTTP, Durée : [TIME] secondes, Récupéré : [SIZE] Ko, [PIXEL] Mpixels
+	</text>
+	<spinner label="17, taux de texels/pixels :" name="texel_pixel_ratio"/>
+	<button label="Démarrer" name="start_btn"/>
+	<button label="Réinitialiser" name="clear_btn"/>
+	<button label="Fermer" name="close_btn"/>
+	<button label="Lecture du cache" name="cacheread_btn"/>
+	<button label="Écriture du cache" name="cachewrite_btn"/>
+	<button label="HTTP" name="http_btn"/>
+	<button label="Décoder" name="decode_btn"/>
+	<button label="Texture GL" name="gl_btn"/>
+	<button label="Récupérer à nouveau les données visibles du cache" name="refetchviscache_btn"/>
+	<button label="Récupérer à nouveau les données visibles de la requête HTTP" name="refetchvishttp_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/fr/floater_window_size.xml b/indra/newview/skins/default/xui/fr/floater_window_size.xml
index cbda4390d8fef20f27b429ea578b0fbcb7b92705..11c2e439bdf59122819e7af8ab11fd4d8f2462fb 100644
--- a/indra/newview/skins/default/xui/fr/floater_window_size.xml
+++ b/indra/newview/skins/default/xui/fr/floater_window_size.xml
@@ -7,10 +7,17 @@
 		Définir la taille de la fenêtre :
 	</text>
 	<combo_box name="window_size_combo" tool_tip="largeur x hauteur">
-		<combo_box.item label="1 000 x 700 (défaut)" name="item0"/>
-		<combo_box.item label="1 024 x 768" name="item1"/>
-		<combo_box.item label="1 280 x 720 (720 p)" name="item2"/>
-		<combo_box.item label="1 920 x 1 080 (1 080p)" name="item3"/>
+		<combo_box.item label="1000 x 700 (par défaut)" name="item1"/>
+		<combo_box.item label="1024 x 768 (4:3 XGA)" name="item2"/>
+		<combo_box.item label="1280 x 720 (16:9 HDTV)" name="item3"/>
+		<combo_box.item label="1280 x 800 (5:8 WXGA)" name="item4"/>
+		<combo_box.item label="1280 x 1024 (5:4 SXGA)" name="item5"/>
+		<combo_box.item label="1440 x 900 (8:5 WSXGA)" name="item7"/>
+		<combo_box.item label="1600 x 900 (16:9 HD+)" name="item8"/>
+		<combo_box.item label="1600 x 1200 (4:3 UXGA)" name="item9"/>
+		<combo_box.item label="1680 x 1050 (8:5 WSXGA+)" name="item10"/>
+		<combo_box.item label="1920 x 1080 (16:9 HDTV)" name="item11"/>
+		<combo_box.item label="1920 x 1200 (8:5 WUXGA)" name="item12"/>
 	</combo_box>
 	<button label="Choisir" name="set_btn"/>
 	<button label="Annuler" name="cancel_btn"/>
diff --git a/indra/newview/skins/default/xui/fr/menu_viewer.xml b/indra/newview/skins/default/xui/fr/menu_viewer.xml
index 3c3d4f5f6940104d92dcf95b59213dd02c5ebaa8..2a26ed7a70d7d8b5a46999e52e2d835595497e7a 100644
--- a/indra/newview/skins/default/xui/fr/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/fr/menu_viewer.xml
@@ -227,11 +227,10 @@
 			<menu_item_check label="Console de textures" name="Texture Console"/>
 			<menu_item_check label="Console de débogage" name="Debug Console"/>
 			<menu_item_call label="Console de notifications" name="Notifications"/>
-			<menu_item_check label="Console de tailles de textures" name="Texture Size"/>
-			<menu_item_check label="Console des catégories de textures" name="Texture Category"/>
 			<menu_item_check label="Chronos" name="Fast Timers"/>
 			<menu_item_check label="Mémoire" name="Memory"/>
 			<menu_item_check label="Statistiques de la scène" name="Scene Statistics"/>
+			<menu_item_call label="Console de débogage de la récupération des textures" name="Texture Fetch Debug Console"/>
 			<menu_item_call label="Infos de région vers la console de débogage" name="Region Info to Debug Console"/>
 			<menu_item_call label="Infos de groupe vers la console de débogage" name="Group Info to Debug Console"/>
 			<menu_item_call label="Infos de capacités vers la console de débogage" name="Capabilities Info to Debug Console"/>
@@ -289,6 +288,12 @@
 			<menu_item_check label="Complexité du rendu" name="rendercomplexity"/>
 			<menu_item_check label="Octets d&apos;éléments attachés" name="attachment bytes"/>
 			<menu_item_check label="Sculpture" name="Sculpt"/>
+			<menu label="Densité des textures" name="Texture Density">
+				<menu_item_check label="Aucune" name="None"/>
+				<menu_item_check label="Actuelle" name="Current"/>
+				<menu_item_check label="Souhaitée" name="Desired"/>
+				<menu_item_check label="Complète" name="Full"/>
+			</menu>
 		</menu>
 		<menu label="Rendu" name="Rendering">
 			<menu_item_check label="Axes" name="Axes"/>
@@ -306,7 +311,6 @@
 			<menu_item_check label="Textures d&apos;animation" name="Animation Textures"/>
 			<menu_item_check label="Désactiver les textures" name="Disable Textures"/>
 			<menu_item_check label="Textures pleine résolution" name="Rull Res Textures"/>
-			<menu_item_check label="Audit Textures" name="Audit Textures"/>
 			<menu_item_check label="Atlas des textures (expérimental)" name="Texture Atlas"/>
 			<menu_item_check label="Rendu des lumières jointes" name="Render Attached Lights"/>
 			<menu_item_check label="Rendu des particules jointes" name="Render Attached Particles"/>
diff --git a/indra/newview/skins/default/xui/fr/notifications.xml b/indra/newview/skins/default/xui/fr/notifications.xml
index 746a4b1d5552800f2ebb6a18a6956a070f0b2494..0cdfc61e8eff738b3b44be2e6d1807586120f971 100644
--- a/indra/newview/skins/default/xui/fr/notifications.xml
+++ b/indra/newview/skins/default/xui/fr/notifications.xml
@@ -494,6 +494,15 @@ Consulter [_URL] pour en savoir plus ?
 		</url>
 		<usetemplate ignoretext="Mon matériel n&apos;est pas pris en charge" name="okcancelignore" notext="Non" yestext="Oui"/>
 	</notification>
+	<notification name="IntelOldDriver">
+		Il existe probablement un pilote plus récent pour votre puce graphique. La mise à jour des pilotes graphiques est susceptible d&apos;améliorer considérablement les performances.
+
+    Visiter la page [_URL] pour rechercher d&apos;éventuelles mises à jour de pilotes ?
+		<url name="url">
+			http://www.intel.com/p/fr_FR/support/detect/graphics
+		</url>
+		<usetemplate ignoretext="Mon pilote graphique est obsolète." name="okcancelignore" notext="Non" yestext="Oui"/>
+	</notification>
 	<notification name="UnknownGPU">
 		Votre système contient une carte graphique que [APP_NAME] ne reconnaît pas.
 Cela est souvent le cas avec le nouveau matériel qui n&apos;a pas encore été testé avec [APP_NAME].  Cela ne posera probablement pas de problème, mais vous devrez peut-être ajuster vos paramètres graphiques.
@@ -2614,16 +2623,12 @@ Acceptez-vous ?
 		</form>
 	</notification>
 	<notification name="ScriptQuestionCaution">
-		Un objet nommé &lt;nolink&gt;[OBJECTNAME]&lt;/nolink&gt;, appartenant à [NAME], aimerait :
-
-[QUESTIONS]
-Si vous n&apos;avez pas confiance en cet objet ni en son créateur, refusez cette requête.
-
-Accepter cette requête ?
+		Avertissement : l&apos;objet &lt;nolink&gt;[OBJECTNAME]&lt;/nolink&gt; souhaite un accès total à votre compte en Linden dollars. Si vous autorisez cet accès, il pourra supprimer des fonds de votre compte à tout moment ou le vider entièrement de façon continue sans avis préalable.
+  
+Il est rare qu&apos;une telle demande soit légitime. N&apos;autorisez pas cet accès si vous ne comprenez pas entièrement pourquoi l&apos;objet souhaite accéder à votre compte.
 		<form name="form">
-			<button name="Grant" text="Accepter"/>
+			<button name="Grant" text="Permettre un accès total"/>
 			<button name="Deny" text="Refuser"/>
-			<button name="Details" text="Détails..."/>
 		</form>
 	</notification>
 	<notification name="ScriptDialog">
@@ -3122,4 +3127,15 @@ Sinon, consultez la carte et trouvez les &quot; infohubs &quot;.
 	<global name="You died and have been teleported to your home location">
 		Vous êtes mort et avez été téléporté à votre domicile.
 	</global>
+	<notification name="LocalBitmapsUpdateFileNotFound">
+		Impossible de mettre à jour [FNAME] car le fichier est introuvable.
+Désactivation des mises à jour futures de ce fichier...
+	</notification>
+	<notification name="LocalBitmapsUpdateFailedFinal">
+		[NRETRIES] tentatives d&apos;ouverture ou de décodage de [FNAME] ont échoué. Le fichier est désormais considéré comme endommagé.
+Désactivation des mises à jour futures de ce fichier...
+	</notification>
+	<notification name="LocalBitmapsVerifyFail">
+		Tentative d&apos;ajout d&apos;un fichier image [FNAME] non valide ou illisible n&apos;ayant pas pu être ouvert ou décodé. Tentative annulée.
+	</notification>
 </notifications>
diff --git a/indra/newview/skins/default/xui/fr/panel_script_question_toast.xml b/indra/newview/skins/default/xui/fr/panel_script_question_toast.xml
new file mode 100644
index 0000000000000000000000000000000000000000..a2d0237da010e5c72549a283f6a34c7561e17eab
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/panel_script_question_toast.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel label="script_question_panel" name="panel_script_question_toast">
+	<panel label="buttons_panel" name="buttons_panel"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml
index 8b410128da412fd67a0cf607eb82933c347de6b7..0987952c28e2e50f10de8fa46b7e9f1a3818ce77 100644
--- a/indra/newview/skins/default/xui/fr/strings.xml
+++ b/indra/newview/skins/default/xui/fr/strings.xml
@@ -886,6 +886,9 @@ Veuillez réessayer de vous connecter dans une minute.
 	<string name="ScriptQuestionCautionChatDenied">
 		&apos;[OBJECTNAME]&apos;, un objet appartenant à [OWNERNAME], situé dans [REGIONNAME] à [REGIONPOS], n&apos;a pas reçu le droit de : [PERMISSIONS].
 	</string>
+	<string name="AdditionalPermissionsRequestHeader">
+		Si vous autorisez un accès à votre compte, vous autorisez également l&apos;objet à :
+	</string>
 	<string name="ScriptTakeMoney">
 		Débiter vos Linden dollars (L$)
 	</string>
@@ -919,6 +922,9 @@ Veuillez réessayer de vous connecter dans une minute.
 	<string name="ControlYourCamera">
 		Contrôler votre caméra
 	</string>
+	<string name="TeleportYourAgent">
+		Vous téléporter
+	</string>
 	<string name="NotConnected">
 		Pas connecté(e)
 	</string>
diff --git a/indra/newview/skins/default/xui/it/floater_hardware_settings.xml b/indra/newview/skins/default/xui/it/floater_hardware_settings.xml
index 5d3ae04a4d847649efe5792f3d2f015145d13e3a..edbbc354cfade7f501368eb1e6094cf33fbf3527 100644
--- a/indra/newview/skins/default/xui/it/floater_hardware_settings.xml
+++ b/indra/newview/skins/default/xui/it/floater_hardware_settings.xml
@@ -25,6 +25,10 @@
 		Attiva VBO:
 	</text>
 	<check_box initial_value="true" label="Attiva oggetti OpenGL Vertex Buffer" name="vbo" tool_tip="Attivandolo su un hardware moderno aumenta la performance.  Ma, su un vecchio hardware, spesso l&apos;implementazione dei VBO è scarsa e potresti avere dei crash quando è attivato."/>
+	<text name="tc label">
+		Attiva S3TC:
+	</text>
+	<check_box initial_value="true" label="Attiva compressione texture (richiede riavvio)" name="texture compression" tool_tip="Comprime le texture nella memoria video, consentendo il caricamento di texture a risoluzione maggiore al prezzo di ua perdita di qualit&apos; del colore."/>
 	<slider label="Memoria texture (MB):" name="GraphicsCardTextureMemory" tool_tip="Spazio di memoria da ssegnare alle textures. Utilizza la memoria della scheda video come impostazione predefinita. La riduzione di questa impostazione potrebbe migliorare il rendimento ma potrebbe anche rendere le texture poco definite."/>
 	<spinner label="Indice della distanza  della nebbia:" name="fog"/>
 	<button label="OK" label_selected="OK" name="OK"/>
diff --git a/indra/newview/skins/default/xui/it/floater_stats.xml b/indra/newview/skins/default/xui/it/floater_stats.xml
index ad6ef6b54b8f914f4d90d5b7a63bdc8380a8a5d1..2241cad7117a0292a218f3888340fa887c12d89b 100644
--- a/indra/newview/skins/default/xui/it/floater_stats.xml
+++ b/indra/newview/skins/default/xui/it/floater_stats.xml
@@ -14,8 +14,11 @@
 					<stat_bar label="KTris disegnato per secondo" name="ktrissec"/>
 					<stat_bar label="Totale oggetti" name="objs"/>
 					<stat_bar label="Nuovi oggetti" name="newobjs"/>
+					<stat_bar label="Hit rate della cache per l&apos;oggetto" name="object_cache_hits"/>
 				</stat_view>
 				<stat_view label="Texture" name="texture">
+					<stat_bar label="Hit rate della cache" name="texture_cache_hits"/>
+					<stat_bar label="Latenza di lettura della cache" name="texture_cache_read_latency"/>
 					<stat_bar label="Conteggio" name="numimagesstat"/>
 					<stat_bar label="Conteggio grezzo" name="numrawimagesstat"/>
 					<stat_bar label="Memoria GL" name="gltexmemstat"/>
diff --git a/indra/newview/skins/default/xui/it/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/it/floater_texture_ctrl.xml
index 7b77584ba05a0d43227e989288e71dccc7cf3f6d..e85030087c1f075bc57c8bf057fdfd4f3c0f1e20 100644
--- a/indra/newview/skins/default/xui/it/floater_texture_ctrl.xml
+++ b/indra/newview/skins/default/xui/it/floater_texture_ctrl.xml
@@ -1,23 +1,34 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="texture picker" title="PREFERITO: TEXTURE">
-	<string name="choose_picture">
+	<floater.string name="choose_picture">
 		Clicca per scegliere l&apos;immagine
-	</string>
+	</floater.string>
+	<floater.string name="pick title">
+		Scegli:
+	</floater.string>
 	<text name="Multiple">
 		Texture multiple
 	</text>
+	<radio_group name="mode_selection">
+		<radio_item label="Inventario" name="inventory" value="0"/>
+		<radio_item label="Locale" name="local" value="1"/>
+	</radio_group>
 	<text name="unknown">
 		Dimensioni: [DIMENSIONS]
 	</text>
 	<button label="Default" label_selected="Default" name="Default"/>
-	<button label="Niente" label_selected="Niente" name="None"/>
 	<button label="Vuoto" label_selected="Vuoto" name="Blank"/>
-	<check_box label="Mostra cartelle" name="show_folders_check"/>
-	<search_editor label="Filtro texture" name="inventory search editor"/>
-	<check_box label="Applica adesso" name="apply_immediate_check"/>
-	<button label="Annulla" label_selected="Annulla" name="Cancel"/>
+	<button label="Niente" label_selected="Niente" name="None"/>
+	<filter_editor label="Filtro texture" name="inventory search editor"/>
+	<check_box initial_value="false" label="Mostra cartelle" name="show_folders_check"/>
+	<button label="Aggiungi" label_selected="Aggiungi" name="l_add_btn"/>
+	<button label="Rimuovi" label_selected="Rimuovi" name="l_rem_btn"/>
+	<button label="Carica" label_selected="Carica" name="l_upl_btn"/>
+	<scroll_list name="l_name_list">
+		<column label="Nome" name="unit_name"/>
+		<column label="ID" name="unit_id_HIDDEN"/>
+	</scroll_list>
 	<button label="OK" label_selected="OK" name="Select"/>
-	<string name="pick title">
-		Scegli:
-	</string>
+	<button label="Annulla" label_selected="Annulla" name="Cancel"/>
+	<check_box initial_value="true" label="Applica adesso" name="apply_immediate_check"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/it/floater_texture_fetch_debugger.xml b/indra/newview/skins/default/xui/it/floater_texture_fetch_debugger.xml
new file mode 100644
index 0000000000000000000000000000000000000000..57e65c3456d83efdd64c11b22be5ecb3a6557c5e
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/floater_texture_fetch_debugger.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="TexFetchDebugger" title="Debugger recupero texture">
+	<text name="total_num_fetched_label">
+		1, Numero totale di texture recuperate: [NUM]
+	</text>
+	<text name="total_num_fetching_requests_label">
+		2, Numero totale di richieste di recupero: [NUM]
+	</text>
+	<text name="total_num_cache_hits_label">
+		3, Numero totale di recuperi dalla cache: [NUM]
+	</text>
+	<text name="total_num_visible_tex_label">
+		4, Numero totale di texture visibili: [NUM]
+	</text>
+	<text name="total_num_visible_tex_fetch_req_label">
+		5, Numero totale di richieste di fetching texture visibili: [NUM]
+	</text>
+	<text name="total_fetched_data_label">
+		6, Numero totale di fetching dati: [SIZE1] KB, Dati decodificati: [SIZE2] KB, [PIXEL] MPixel
+	</text>
+	<text name="total_fetched_vis_data_label">
+		7, Numero totale di dati visibili: [SIZE1] KB, Dati decodificati: [SIZE2] KB
+	</text>
+	<text name="total_fetched_rendered_data_label">
+		8, Numero totale di rendering dei dati: [SIZE1] KB, Dati decodificati: [SIZE2] KB, [PIXEL] MPixel
+	</text>
+	<text name="total_time_cache_read_label">
+		9, Tempo totale letture cache: [TIME] secondi
+	</text>
+	<text name="total_time_cache_write_label">
+		10, Tempo totale scrittura cache: [TIME] secondi
+	</text>
+	<text name="total_time_decode_label">
+		11, Tempo totale decodifica: [TIME] secondi
+	</text>
+	<text name="total_time_gl_label">
+		12, Tempo totale creazione texture gl: [TIME] secondi
+	</text>
+	<text name="total_time_http_label">
+		13, Tempo totale fetching HTTP: [TIME] secondi
+	</text>
+	<text name="total_time_fetch_label">
+		14, Tempo totale complessivo fetching: [TIME] secondi
+	</text>
+	<text name="total_time_refetch_vis_cache_label">
+		15, Nuovo fetching elementi visibili dalla cache, Tempo: [TIME] secondi, fetching: [SIZE] KB, [PIXEL] MPixels
+	</text>
+	<text name="total_time_refetch_vis_http_label">
+		16, Nuovo fetching elementi visibili da HTTP, Tempo: [TIME] secondi, fetching: [SIZE] KB, [PIXEL] MPixels
+	</text>
+	<spinner label="17, Rapporto Texel/Pixel:" name="texel_pixel_ratio"/>
+	<button label="Attiva" name="start_btn"/>
+	<button label="Reimposta" name="clear_btn"/>
+	<button label="Chiudi" name="close_btn"/>
+	<button label="Lettura cache" name="cacheread_btn"/>
+	<button label="Scrittura cache" name="cachewrite_btn"/>
+	<button label="HTTP" name="http_btn"/>
+	<button label="Decodifica" name="decode_btn"/>
+	<button label="Texture GL" name="gl_btn"/>
+	<button label="Nuovo fetch visibili cache" name="refetchviscache_btn"/>
+	<button label="Nuovo fetch visibili HTTP" name="refetchvishttp_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_window_size.xml b/indra/newview/skins/default/xui/it/floater_window_size.xml
index 036b74b7d99e3a61e2753fb1b519601b16a61b59..fef423aefecb49a380e097114a1f48babd3b5ac4 100644
--- a/indra/newview/skins/default/xui/it/floater_window_size.xml
+++ b/indra/newview/skins/default/xui/it/floater_window_size.xml
@@ -7,10 +7,17 @@
 		Imposta dimensione finestra:
 	</text>
 	<combo_box name="window_size_combo" tool_tip="larghezza x altezza">
-		<combo_box.item label="1000 x 700 (default)" name="item0"/>
-		<combo_box.item label="1024 x 768" name="item1"/>
-		<combo_box.item label="1280 x 720 (720p)" name="item2"/>
-		<combo_box.item label="1920 x 1080 (1080p)" name="item3"/>
+		<combo_box.item label="1000 x 700 (predefinito)" name="item1"/>
+		<combo_box.item label="1024 x 768 (4:3 XGA)" name="item2"/>
+		<combo_box.item label="1280 x 720 (16:9 HDTV)" name="item3"/>
+		<combo_box.item label="1280 x 800 (5:8 WXGA)" name="item4"/>
+		<combo_box.item label="1280 x 1024 (5:4 SXGA)" name="item5"/>
+		<combo_box.item label="1440 x 900 (8:5 WSXGA)" name="item7"/>
+		<combo_box.item label="1600 x 900 (16:9 HD+)" name="item8"/>
+		<combo_box.item label="1600 x 1200 (4:3 UXGA)" name="item9"/>
+		<combo_box.item label="1680 x 1050 (8:5 WSXGA+)" name="item10"/>
+		<combo_box.item label="1920 x 1080 (16:9 HDTV)" name="item11"/>
+		<combo_box.item label="1920 x 1200 (8:5 WUXGA)" name="item12"/>
 	</combo_box>
 	<button label="Imposta" name="set_btn"/>
 	<button label="Annulla" name="cancel_btn"/>
diff --git a/indra/newview/skins/default/xui/it/menu_viewer.xml b/indra/newview/skins/default/xui/it/menu_viewer.xml
index 99b7e3c4e6b5f5e75167e7f19840b5ae0f8fb9e3..f94b2f9a9e323da62b19496014e0c2190af05b6b 100644
--- a/indra/newview/skins/default/xui/it/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/it/menu_viewer.xml
@@ -226,11 +226,10 @@
 			<menu_item_check label="Console texture" name="Texture Console"/>
 			<menu_item_check label="Console di Debug" name="Debug Console"/>
 			<menu_item_call label="Console notifiche" name="Notifications"/>
-			<menu_item_check label="Console dimensioni texture" name="Texture Size"/>
-			<menu_item_check label="Console categoria texture" name="Texture Category"/>
 			<menu_item_check label="Timer veloci" name="Fast Timers"/>
 			<menu_item_check label="Memoria" name="Memory"/>
 			<menu_item_check label="Statistiche scena" name="Scene Statistics"/>
+			<menu_item_call label="Console di debug recupero texture" name="Texture Fetch Debug Console"/>
 			<menu_item_call label="Informazioni regione sulla console di debug" name="Region Info to Debug Console"/>
 			<menu_item_check label="Fotocamera" name="Camera"/>
 			<menu_item_check label="Vento" name="Wind"/>
@@ -271,6 +270,12 @@
 			<menu_item_check label="Complessità rendering" name="rendercomplexity"/>
 			<menu_item_check label="Byte collegamento" name="attachment bytes"/>
 			<menu_item_check label="Scolpisci" name="Sculpt"/>
+			<menu label="Densità texture" name="Texture Density">
+				<menu_item_check label="Nessuna" name="None"/>
+				<menu_item_check label="Attuale" name="Current"/>
+				<menu_item_check label="Desiderata" name="Desired"/>
+				<menu_item_check label="Completa" name="Full"/>
+			</menu>
 		</menu>
 		<menu label="Rendering" name="Rendering">
 			<menu_item_check label="Assi" name="Axes"/>
diff --git a/indra/newview/skins/default/xui/it/notifications.xml b/indra/newview/skins/default/xui/it/notifications.xml
index 0e6fee60d16a99587936c5aedb44874e42124ddb..9660c8f851e50a34707be2baf5797dcb1c2d465a 100644
--- a/indra/newview/skins/default/xui/it/notifications.xml
+++ b/indra/newview/skins/default/xui/it/notifications.xml
@@ -492,6 +492,15 @@ Visitare [_URL] per ulteriori informazioni?
 		</url>
 		<usetemplate ignoretext="L&apos;hardware di questo computer non è compatibile" name="okcancelignore" notext="No" yestext="Si"/>
 	</notification>
+	<notification name="IntelOldDriver">
+		È probabile che ci sia un driver aggiornato per il processore grafico.  L&apos;aggiornamento dei driver della grafica può migliorare le prestazioni in maniera significativa.
+
+    Visitare [_URL] per cercare un aggiornamento del driver?
+		<url name="url">
+			http://www.intel.com/p/it_IT/support/detect/graphics
+		</url>
+		<usetemplate ignoretext="Driver grafica obsoleto" name="okcancelignore" notext="No" yestext="Sì"/>
+	</notification>
 	<notification name="UnknownGPU">
 		Il tuo sistema utilizza una scheda grafica che [APP_NAME] non riconosce.
 Questo succede spesso con un nuovo hardware che non è stato ancora testato con [APP_NAME].  Probabilmente tutto andrà bene, ma devi riconfigurare le tue impostazioni grafiche.
@@ -2616,16 +2625,12 @@ OK?
 		</form>
 	</notification>
 	<notification name="ScriptQuestionCaution">
-		Un oggetto di nome &apos;&lt;nolink&gt;[OBJECTNAME]&lt;/nolink&gt;&apos;, posseduto da  &apos;[NAME]&apos; vorrebbe:
-
-[QUESTIONS]
-Se non ti fidi di questo oggetto e del suo ideatore, dovresti rifiutare la richiesta.
-
-Concedi questa richiesta?
+		Attenzione: L&apos;oggetto &apos;&lt;nolink&gt;[OBJECTNAME]&lt;/nolink&gt;&apos; ha richiesto accesso completo al tuo account in Dollari Linden. Se consenti l&apos;accesso, potrà rimuovere fondi dal tuo account in qalunque momento e anche svuotare completamente l&apos;account, per un periodo illimitato e senza ulteriori avvisi.
+  
+Raramente questo tipo di richiesta è legittima. Non consentire l&apos;accesso se non comprendi perfettamente il motivo per cui desidera accedere al tuo account.
 		<form name="form">
-			<button name="Grant" text="Accetta"/>
+			<button name="Grant" text="Consenti accesso totale"/>
 			<button name="Deny" text="Nega"/>
-			<button name="Details" text="Dettagli..."/>
 		</form>
 	</notification>
 	<notification name="ScriptDialog">
@@ -3124,4 +3129,16 @@ In alternativa, puoi guardare sulla mappa e trovare luoghi segnalati come &quot;
 	<global name="You died and have been teleported to your home location">
 		Sei deceduto e sei stato teleportato a casa tua.
 	</global>
+	<notification name="LocalBitmapsUpdateFileNotFound">
+		[FNAME] non è stato aggiornato perché il file non è stato più trovato.
+Gli aggiornamenti futuri per questo file sono disattivati.
+	</notification>
+	<notification name="LocalBitmapsUpdateFailedFinal">
+		[FNAME] non è stato aperto o decodificato dopo [NRETRIES] tentativi, viene considerato danneggiato.
+Gli aggiornamenti futuri per questo file sono disattivati.
+	</notification>
+	<notification name="LocalBitmapsVerifyFail">
+		Tentativo di aggiungere un file immagine [FNAME] non valido o non leggibile che non è stato possibile aprire o decodificare.
+Tentativo annullato.
+	</notification>
 </notifications>
diff --git a/indra/newview/skins/default/xui/it/panel_script_question_toast.xml b/indra/newview/skins/default/xui/it/panel_script_question_toast.xml
new file mode 100644
index 0000000000000000000000000000000000000000..a2d0237da010e5c72549a283f6a34c7561e17eab
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/panel_script_question_toast.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel label="script_question_panel" name="panel_script_question_toast">
+	<panel label="buttons_panel" name="buttons_panel"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/it/strings.xml b/indra/newview/skins/default/xui/it/strings.xml
index 8529fadd7def85ed002bfef479bb0a54b158a81c..11accb5f08d01cc14d4bf3e2b643edfa701c33f3 100644
--- a/indra/newview/skins/default/xui/it/strings.xml
+++ b/indra/newview/skins/default/xui/it/strings.xml
@@ -880,6 +880,9 @@ Prova ad accedere nuovamente tra un minuto.
 	<string name="ScriptQuestionCautionChatDenied">
 		A &apos;[OBJECTNAME]&apos;, un oggetto di proprietà di &apos;[OWNERNAME]&apos;, situato in [REGIONNAME] [REGIONPOS], è stato negato il permesso di: [PERMISSIONS].
 	</string>
+	<string name="AdditionalPermissionsRequestHeader">
+		Se consenti l&apos;accesso al tuo account, consentirai anche all&apos;oggetto di:
+	</string>
 	<string name="ScriptTakeMoney">
 		Prendere dollari Linden (L$) da te
 	</string>
@@ -913,6 +916,9 @@ Prova ad accedere nuovamente tra un minuto.
 	<string name="ControlYourCamera">
 		Controllare la tua fotocamera
 	</string>
+	<string name="TeleportYourAgent">
+		Teleportarti
+	</string>
 	<string name="SIM_ACCESS_PG">
 		Generale
 	</string>
diff --git a/indra/newview/skins/default/xui/ja/floater_hardware_settings.xml b/indra/newview/skins/default/xui/ja/floater_hardware_settings.xml
index 1b6558a9eb329c591c60bebbcf159856631d2ae4..c8b8e918e0f32be8cc0e48b6aab2f51b5e8b5bcc 100644
--- a/indra/newview/skins/default/xui/ja/floater_hardware_settings.xml
+++ b/indra/newview/skins/default/xui/ja/floater_hardware_settings.xml
@@ -25,6 +25,10 @@
 		VBO を有効化:
 	</text>
 	<check_box initial_value="true" label="OpenGL Vertex Buffer Objectsを有効化" name="vbo" tool_tip="最新のハードウェアでこの設定を有効にすると、パフォーマンスが向上します。  しかし、旧型のハードウェアでは VBO の実装が貧弱な場合が多く、この設定を有効にすることでクラッシュにつながるおそれがあります。"/>
+	<text name="tc label">
+		S3TC を有効にする:
+	</text>
+	<check_box initial_value="true" label="テクスチャ圧縮を有効にする(再起動が必要)" name="texture compression" tool_tip="ビデオメモリ内でテクスチャを圧縮することにより、色の質を多少犠牲にしながら、より高解像度のテクスチャを読み込めるようにします。"/>
 	<slider label="テクスチャメモリ(MB):" name="GraphicsCardTextureMemory" tool_tip="テクスチャに割り当てられたメモリの量。 ビデオカードのメモリに既定。 数値を下げるとパフォーマンスが向上しますが、テクスチャの精度が落ちることがあります。"/>
 	<spinner label="フォグの距離比率:" name="fog"/>
 	<button label="OK" label_selected="OK" name="OK"/>
diff --git a/indra/newview/skins/default/xui/ja/floater_stats.xml b/indra/newview/skins/default/xui/ja/floater_stats.xml
index 6a1f34cfd85a6c69250911ca6f79c3db50937042..da5358f06a0c7ddf2421207db1dd06113bf941b2 100644
--- a/indra/newview/skins/default/xui/ja/floater_stats.xml
+++ b/indra/newview/skins/default/xui/ja/floater_stats.xml
@@ -14,8 +14,11 @@
 					<stat_bar label="秒ごとの KTris 描画" name="ktrissec"/>
 					<stat_bar label="オブジェクト合計" name="objs"/>
 					<stat_bar label="新規オブジェクト" name="newobjs"/>
+					<stat_bar label="オブジェクトキャッシュヒット率" name="object_cache_hits"/>
 				</stat_view>
 				<stat_view label="テクスチャ" name="texture">
+					<stat_bar label="キャッシュヒット率" name="texture_cache_hits"/>
+					<stat_bar label="キャッシュ読み取り遅延" name="texture_cache_read_latency"/>
 					<stat_bar label="カウント" name="numimagesstat"/>
 					<stat_bar label="Raw カウント" name="numrawimagesstat"/>
 					<stat_bar label="GL メモリ" name="gltexmemstat"/>
diff --git a/indra/newview/skins/default/xui/ja/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/ja/floater_texture_ctrl.xml
index 399cffcce5cc0e9012cc5e17223a81c828742994..55fe8406587dce0633bf6484d456ce2db64d0140 100644
--- a/indra/newview/skins/default/xui/ja/floater_texture_ctrl.xml
+++ b/indra/newview/skins/default/xui/ja/floater_texture_ctrl.xml
@@ -1,24 +1,35 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="texture picker" title="テクスチャの選択">
-	<string name="choose_picture">
+	<floater.string name="choose_picture">
 		クリックして写真を選択
-	</string>
+	</floater.string>
+	<floater.string name="pick title">
+		ピック:
+	</floater.string>
 	<text name="Multiple">
 		複数のテクスチャ
 	</text>
+	<radio_group name="mode_selection">
+		<radio_item label="インベントリ" name="inventory" value="0"/>
+		<radio_item label="ローカル" name="local" value="1"/>
+	</radio_group>
 	<text name="unknown">
 		サイズ: [DIMENSIONS]
 	</text>
 	<button label="デフォルト" label_selected="デフォルト" name="Default"/>
-	<button label="なし" label_selected="なし" name="None"/>
 	<button label="ブランク" label_selected="ブランク" name="Blank"/>
-	<check_box label="フォルダを表示" name="show_folders_check"/>
-	<search_editor label="テクスチャをフィルター" name="inventory search editor"/>
-	<check_box label="すぐ適用" name="apply_immediate_check"/>
+	<button label="なし" label_selected="なし" name="None"/>
 	<button label="" label_selected="" name="Pipette"/>
-	<button label="取り消し" label_selected="取り消し" name="Cancel"/>
+	<filter_editor label="テクスチャをフィルター" name="inventory search editor"/>
+	<check_box initial_value="false" label="フォルダを表示" name="show_folders_check"/>
+	<button label="追加" label_selected="追加" name="l_add_btn"/>
+	<button label="削除" label_selected="削除" name="l_rem_btn"/>
+	<button label="アップロード" label_selected="アップロード" name="l_upl_btn"/>
+	<scroll_list name="l_name_list">
+		<column label="名前" name="unit_name"/>
+		<column label="ID" name="unit_id_HIDDEN"/>
+	</scroll_list>
 	<button label="OK" label_selected="OK" name="Select"/>
-	<text name="pick title">
-		ピック:
-	</text>
+	<button label="取り消し" label_selected="取り消し" name="Cancel"/>
+	<check_box initial_value="true" label="すぐ適用" name="apply_immediate_check"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/ja/floater_texture_fetch_debugger.xml b/indra/newview/skins/default/xui/ja/floater_texture_fetch_debugger.xml
new file mode 100644
index 0000000000000000000000000000000000000000..4efdf7d40d647b30a5108b3d2eeaebb33456976e
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/floater_texture_fetch_debugger.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="TexFetchDebugger" title="テクスチャ取得デバッガ">
+	<text name="total_num_fetched_label">
+		1, 取得したテクスチャの合計数:[NUM]
+	</text>
+	<text name="total_num_fetching_requests_label">
+		2, 取得リクエストの合計数:[NUM]
+	</text>
+	<text name="total_num_cache_hits_label">
+		3, キャッシュヒットの合計数:[NUM]
+	</text>
+	<text name="total_num_visible_tex_label">
+		4, 表示テクスチャの合計数:[NUM]
+	</text>
+	<text name="total_num_visible_tex_fetch_req_label">
+		5, 表示テクスチャ取得リクエストの合計数:[NUM]
+	</text>
+	<text name="total_fetched_data_label">
+		6, 取得したデータの合計数:[SIZE1]KB、デコードされたデータ:[SIZE2]KB、[PIXEL]メガピクセル
+	</text>
+	<text name="total_fetched_vis_data_label">
+		7, 表示データの合計数:[SIZE1]KB、デコードされたデータ:[SIZE2]KB
+	</text>
+	<text name="total_fetched_rendered_data_label">
+		8, レンダリングされたデータの合計数:[SIZE1]KB、デコードされたデータ:[SIZE2]KB、[PIXEL]メガピクセル
+	</text>
+	<text name="total_time_cache_read_label">
+		9, キャッシュ読み取りの合計時間:[TIME] 秒
+	</text>
+	<text name="total_time_cache_write_label">
+		10, キャッシュ書き込みの合計時間:[TIME] 秒
+	</text>
+	<text name="total_time_decode_label">
+		11, デコードの合計時間:[TIME] 秒
+	</text>
+	<text name="total_time_gl_label">
+		12, glテクスチャ作成の合計時間:[TIME] 秒
+	</text>
+	<text name="total_time_http_label">
+		13, HTTP 取得の合計時間:[TIME] 秒
+	</text>
+	<text name="total_time_fetch_label">
+		14, 取得全体の合計時間:[TIME] 秒
+	</text>
+	<text name="total_time_refetch_vis_cache_label">
+		15, キャッシュから表示テクスチャを再取得、時間:[TIME] 秒、取得:[SIZE]KB、[PIXEL]メガピクセル
+	</text>
+	<text name="total_time_refetch_vis_http_label">
+		16, HTTP から表示テクスチャを再取得、時間:[TIME] 秒、取得:[SIZE]KB、[PIXEL]メガピクセル
+	</text>
+	<spinner label="17, テクセル/ピクセルの比率:" name="texel_pixel_ratio"/>
+	<button label="開始" name="start_btn"/>
+	<button label="リセット" name="clear_btn"/>
+	<button label="閉じる" name="close_btn"/>
+	<button label="キャッシュ読み取り" name="cacheread_btn"/>
+	<button label="キャッシュ書き込み" name="cachewrite_btn"/>
+	<button label="HTTP" name="http_btn"/>
+	<button label="デコード" name="decode_btn"/>
+	<button label="GL テクスチャ" name="gl_btn"/>
+	<button label="キャッシュ表示テクスチャ再取得" name="refetchviscache_btn"/>
+	<button label="HTTP表示テクスチャ再取得" name="refetchvishttp_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/ja/floater_window_size.xml b/indra/newview/skins/default/xui/ja/floater_window_size.xml
index 152a5f48068285580979d48c108ddee68d8f22bc..416813d6cc142e6c48ef754648b17a30951aabca 100644
--- a/indra/newview/skins/default/xui/ja/floater_window_size.xml
+++ b/indra/newview/skins/default/xui/ja/floater_window_size.xml
@@ -7,10 +7,17 @@
 		ウィンドウのサイズを設定:
 	</text>
 	<combo_box name="window_size_combo" tool_tip="横幅 x 高さ">
-		<combo_box.item label="1000 x 700 (標準)" name="item0"/>
-		<combo_box.item label="1024 x 768" name="item1"/>
-		<combo_box.item label="1280 x 720 (720p)" name="item2"/>
-		<combo_box.item label="1920 x 1080 (1080p)" name="item3"/>
+		<combo_box.item label="1000 x 700 (デフォルト)" name="item1"/>
+		<combo_box.item label="1024 x 768 (4:3 XGA)" name="item2"/>
+		<combo_box.item label="1280 x 720 (16:9 HDTV)" name="item3"/>
+		<combo_box.item label="1280 x 800 (5:8 WXGA)" name="item4"/>
+		<combo_box.item label="1280 x 1024 (5:4 SXGA)" name="item5"/>
+		<combo_box.item label="1440 x 900 (8:5 WSXGA)" name="item7"/>
+		<combo_box.item label="1600 x 900 (16:9 HD+)" name="item8"/>
+		<combo_box.item label="1600 x 1200 (4:3 UXGA)" name="item9"/>
+		<combo_box.item label="1680 x 1050 (8:5 WSXGA+)" name="item10"/>
+		<combo_box.item label="1920 x 1080 (16:9 HDTV)" name="item11"/>
+		<combo_box.item label="1920 x 1200 (8:5 WUXGA)" name="item12"/>
 	</combo_box>
 	<button label="設定" name="set_btn"/>
 	<button label="キャンセル" name="cancel_btn"/>
diff --git a/indra/newview/skins/default/xui/ja/menu_viewer.xml b/indra/newview/skins/default/xui/ja/menu_viewer.xml
index 8496dfb1dbff3e9a9ad50a24370555ad8c4c0248..3a398bd985129b0f6f4455cfd3191daf947741ab 100644
--- a/indra/newview/skins/default/xui/ja/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/ja/menu_viewer.xml
@@ -227,11 +227,10 @@
 			<menu_item_check label="テクスチャのコンソール" name="Texture Console"/>
 			<menu_item_check label="デバッグコンソール" name="Debug Console"/>
 			<menu_item_call label="通知コンソール" name="Notifications"/>
-			<menu_item_check label="テクスチャサイズのコンソール" name="Texture Size"/>
-			<menu_item_check label="テクスチャカテゴリのコンソール" name="Texture Category"/>
 			<menu_item_check label="ファーストタイマー" name="Fast Timers"/>
 			<menu_item_check label="メモリ" name="Memory"/>
 			<menu_item_check label="風景の統計" name="Scene Statistics"/>
+			<menu_item_call label="テクスチャ取得デバッグコンソール" name="Texture Fetch Debug Console"/>
 			<menu_item_call label="リージョン情報をデバッグコンソールへ" name="Region Info to Debug Console"/>
 			<menu_item_call label="グループ情報をデバッグコンソールへ" name="Group Info to Debug Console"/>
 			<menu_item_call label="性能情報をデバッグコンソールへ" name="Capabilities Info to Debug Console"/>
@@ -289,6 +288,12 @@
 			<menu_item_check label="描画の詳細度" name="rendercomplexity"/>
 			<menu_item_check label="添付アイテムのバイト数" name="attachment bytes"/>
 			<menu_item_check label="スカルプト" name="Sculpt"/>
+			<menu label="テクスチャの密度" name="Texture Density">
+				<menu_item_check label="なし" name="None"/>
+				<menu_item_check label="現在" name="Current"/>
+				<menu_item_check label="望ましい" name="Desired"/>
+				<menu_item_check label="フル" name="Full"/>
+			</menu>
 		</menu>
 		<menu label="レンダリング" name="Rendering">
 			<menu_item_check label="軸" name="Axes"/>
@@ -306,7 +311,6 @@
 			<menu_item_check label="アニメーションテクスチャ" name="Animation Textures"/>
 			<menu_item_check label="テクスチャを無効にする" name="Disable Textures"/>
 			<menu_item_check label="フル解像度テクスチャ" name="Rull Res Textures"/>
-			<menu_item_check label="テクスチャの検査" name="Audit Textures"/>
 			<menu_item_check label="テクスチャアトラス(試験段階)" name="Texture Atlas"/>
 			<menu_item_check label="装着された光源を描画する" name="Render Attached Lights"/>
 			<menu_item_check label="取り付けられたパーティクルを描画する" name="Render Attached Particles"/>
diff --git a/indra/newview/skins/default/xui/ja/notifications.xml b/indra/newview/skins/default/xui/ja/notifications.xml
index 7bf8a7b8beea04d10beda4392f7d0f367adb2646..f35c0f0d14a4f75084f3195e244b64c50bb267bc 100644
--- a/indra/newview/skins/default/xui/ja/notifications.xml
+++ b/indra/newview/skins/default/xui/ja/notifications.xml
@@ -517,6 +517,15 @@ L$ が不足しているのでこのグループに参加することができ
 		</url>
 		<usetemplate ignoretext="使用中のコンピューターのハードウェアがサポートされていないとき" name="okcancelignore" notext="いいえ" yestext="はい"/>
 	</notification>
+	<notification name="IntelOldDriver">
+		おそらくお使いのグラフィックチップ用の新しいドライバが入手可能です。グラフィックドライバを更新することにより、パフォーマンスが大幅に向上する場合があります。
+
+[_URL] にアクセスして更新版のドライバがあるかどうかを確認しますか?
+		<url name="url">
+			http://www.intel.com/p/ja_JP/support/detect/graphics
+		</url>
+		<usetemplate ignoretext="使用しているグラフィックドライバが古い場合" name="okcancelignore" notext="いいえ" yestext="はい"/>
+	</notification>
 	<notification name="UnknownGPU">
 		お使いのシステムには、[APP_NAME] が認識できないグラフィックカードが搭載されています。
 [APP_NAME] でまだテストされていない最新ハードウェアのためだと考えられます。  問題ないとは思いますが、グラフィックの設定を調整する必要があるかもしれません。
@@ -2663,16 +2672,12 @@ Web ページにリンクすると、他人がこの場所に簡単にアクセ
 		</form>
 	</notification>
 	<notification name="ScriptQuestionCaution">
-		[NAME] が所有する「&lt;nolink&gt;[OBJECTNAME]&lt;/nolink&gt;」 というオブジェクトが、次のことをしようとしています:
-
-[QUESTIONS]
-このオブジェクトや制作者を信用できない場合は、このリクエストを拒否してください。
-
-リクエストを受けますか?
+		警告:オブジェクト &apos;&lt;nolink&gt;[OBJECTNAME]&lt;/nolink&gt;&apos; はあなたのリンデンドルアカウントへのトータルアクセスを希望しています。アクセスを許可すると、このオブジェクトはいつでもあなたのアカウントから資金を削除したり、今後警告を表示することなく継続的にアカウントを完全に空にできるようになります。
+  
+このようなリクエストが正当であることは稀です。このオブジェクトがあなたのアカウントにアクセスしたい理由を完全に理解している場合を除き、アクセスの許可は避けてください。
 		<form name="form">
-			<button name="Grant" text="許可"/>
+			<button name="Grant" text="トータルアクセスを許可"/>
 			<button name="Deny" text="拒否"/>
-			<button name="Details" text="詳細..."/>
 		</form>
 	</notification>
 	<notification name="ScriptDialog">
@@ -3180,4 +3185,16 @@ M キーを押して変更します。
 	<global name="You died and have been teleported to your home location">
 		死んでしまったので、ホームにテレポートされました。
 	</global>
+	<notification name="LocalBitmapsUpdateFileNotFound">
+		[FNAME] は、見つからなかったため、更新できませんでした。
+このファイルに対する今後の更新を無効にします。
+	</notification>
+	<notification name="LocalBitmapsUpdateFailedFinal">
+		[FNAME] を開くまたはデコードする試行に失敗しました(試行回数 [NRETRIES] 回)。そのため、このファイルは壊れているものとして処理されました。
+このファイルに対する今後の更新を無効にします。
+	</notification>
+	<notification name="LocalBitmapsVerifyFail">
+		開くことができない、またはデコードできない無効または読み取り不能な画像ファイル [FNAME] を追加しようとしました。
+この試行はキャンセルされました。
+	</notification>
 </notifications>
diff --git a/indra/newview/skins/default/xui/ja/panel_script_question_toast.xml b/indra/newview/skins/default/xui/ja/panel_script_question_toast.xml
new file mode 100644
index 0000000000000000000000000000000000000000..a2d0237da010e5c72549a283f6a34c7561e17eab
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/panel_script_question_toast.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel label="script_question_panel" name="panel_script_question_toast">
+	<panel label="buttons_panel" name="buttons_panel"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml
index 680ef608909e84b8687a3396d92aad455f44c72f..f6b3edc57ffbf804d0d12b7988f512b418b0379a 100644
--- a/indra/newview/skins/default/xui/ja/strings.xml
+++ b/indra/newview/skins/default/xui/ja/strings.xml
@@ -886,6 +886,9 @@ support@secondlife.com にお問い合わせください。
 	<string name="ScriptQuestionCautionChatDenied">
 		[REGIONNAME] の [REGIONPOS] という場所にある、「 [OWNERNAME] 」が所有する「 [OBJECTNAME] 」というオブジェクトは、次の権限を拒否しました: [PERMISSIONS]
 	</string>
+	<string name="AdditionalPermissionsRequestHeader">
+		あなたのアカウントへのアクセスを許可すると、このオブジェクトには次の操作も許可されます:
+	</string>
 	<string name="ScriptTakeMoney">
 		リンデンドル(L$)を支払う
 	</string>
@@ -919,6 +922,9 @@ support@secondlife.com にお問い合わせください。
 	<string name="ControlYourCamera">
 		カメラのコントロール
 	</string>
+	<string name="TeleportYourAgent">
+		あなたをテレポート
+	</string>
 	<string name="NotConnected">
 		接続されていません
 	</string>
diff --git a/indra/newview/skins/default/xui/pt/floater_hardware_settings.xml b/indra/newview/skins/default/xui/pt/floater_hardware_settings.xml
index 1bc2bce76856766925cae3862232ff10eda78943..1204fb93e2794075ffafb9b3908a1b93e809e487 100644
--- a/indra/newview/skins/default/xui/pt/floater_hardware_settings.xml
+++ b/indra/newview/skins/default/xui/pt/floater_hardware_settings.xml
@@ -25,6 +25,10 @@
 		Habilitar VBO:
 	</text>
 	<check_box initial_value="true" label="Habilitar Objetos com Armazenamento de Vértices" name="vbo" tool_tip="Habilitando-o em máquinas novas, ele oferece um ganho de performance. Contudo, as máquinas antigas tem freqüentemente implementações pobres de VBOs e você pode ter travamentos quando esta opção é habilitada."/>
+	<text name="tc label">
+		Habilitar S3TC:
+	</text>
+	<check_box initial_value="true" label="Habilitar compressão de texturas (requer reinício)" name="texture compression" tool_tip="Comprime as texturas na memória de vídeo, permitindo o carregamento de texturas de maior resolução em detrimento da qualidade da cor."/>
 	<slider label="Memória de texturas (MB):" name="GraphicsCardTextureMemory" tool_tip="Quanto da memória deve ser alocado para texturas.  O padrão é definido pela memória da placa de vídeo.  Reduzir este valor pode melhorar o desempenho, mas as texturas podem fica fora de foco."/>
 	<spinner label="Relação de Distância de  Nevoeiro:" name="fog"/>
 	<button label="OK" label_selected="OK" name="OK"/>
diff --git a/indra/newview/skins/default/xui/pt/floater_stats.xml b/indra/newview/skins/default/xui/pt/floater_stats.xml
index f0a053ebe3ed0c61514b989257f670f2cc9b9e24..e770c6ac38e9b8cf2132b3dd5b5ffa414eb1bf3b 100644
--- a/indra/newview/skins/default/xui/pt/floater_stats.xml
+++ b/indra/newview/skins/default/xui/pt/floater_stats.xml
@@ -14,8 +14,11 @@
 					<stat_bar label="KTris desenhados por segundo" name="ktrissec"/>
 					<stat_bar label="Total Objects" name="objs"/>
 					<stat_bar label="New Objects" name="newobjs"/>
+					<stat_bar label="Taxa de acertos do cache do objeto" name="object_cache_hits"/>
 				</stat_view>
 				<stat_view label="Texture" name="texture">
+					<stat_bar label="Taxa de acertos do cache" name="texture_cache_hits"/>
+					<stat_bar label="Latência de leitura do cache" name="texture_cache_read_latency"/>
 					<stat_bar label="Count" name="numimagesstat"/>
 					<stat_bar label="Raw Count" name="numrawimagesstat"/>
 					<stat_bar label="GL Mem" name="gltexmemstat"/>
diff --git a/indra/newview/skins/default/xui/pt/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/pt/floater_texture_ctrl.xml
index 144bc0340e9ba1eb589cdc7a8767e5b137390dbd..57223beaebcaa7825e4461f11513506bbcec9733 100644
--- a/indra/newview/skins/default/xui/pt/floater_texture_ctrl.xml
+++ b/indra/newview/skins/default/xui/pt/floater_texture_ctrl.xml
@@ -1,23 +1,34 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="texture picker" title="DESTAQUE: TEXTURA">
-	<string name="choose_picture">
+	<floater.string name="choose_picture">
 		Clique para escolher uma imagem
-	</string>
+	</floater.string>
+	<floater.string name="pick title">
+		Pegar:
+	</floater.string>
 	<text name="Multiple">
 		Multiplas texturas
 	</text>
+	<radio_group name="mode_selection">
+		<radio_item label="Inventário" name="inventory" value="0"/>
+		<radio_item label="Local" name="local" value="1"/>
+	</radio_group>
 	<text name="unknown">
 		Tamanho: [DIMENSÕES]
 	</text>
 	<button label="Padrão" label_selected="Padrão" name="Default"/>
-	<button label="Nenhum" label_selected="Nenhum" name="None"/>
 	<button label="Branco" label_selected="Branco" name="Blank"/>
-	<check_box label="Exibir pastas" name="show_folders_check"/>
-	<search_editor label="Filtrar texturas" name="inventory search editor"/>
-	<check_box label="Applicar agora" name="apply_immediate_check"/>
-	<button label="Cancelar" label_selected="Cancelar" name="Cancel"/>
+	<button label="Nenhum" label_selected="Nenhum" name="None"/>
+	<filter_editor label="Filtrar texturas" name="inventory search editor"/>
+	<check_box initial_value="false" label="Exibir pastas" name="show_folders_check"/>
+	<button label="Adicionar" label_selected="Adicionar" name="l_add_btn"/>
+	<button label="Remover" label_selected="Remover" name="l_rem_btn"/>
+	<button label="Enviar" label_selected="Enviar" name="l_upl_btn"/>
+	<scroll_list name="l_name_list">
+		<column label="Nome" name="unit_name"/>
+		<column label="ID" name="unit_id_HIDDEN"/>
+	</scroll_list>
 	<button label="OK" label_selected="OK" name="Select"/>
-	<string name="pick title">
-		Pegar:
-	</string>
+	<button label="Cancelar" label_selected="Cancelar" name="Cancel"/>
+	<check_box initial_value="true" label="Applicar agora" name="apply_immediate_check"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_texture_fetch_debugger.xml b/indra/newview/skins/default/xui/pt/floater_texture_fetch_debugger.xml
new file mode 100644
index 0000000000000000000000000000000000000000..f20d50362edec89b0f8b84406db052cc657cffe6
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/floater_texture_fetch_debugger.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="TexFetchDebugger" title="Depurador de obtenção de textura">
+	<text name="total_num_fetched_label">
+		1, Número total de texturas obtidas: [NUM]
+	</text>
+	<text name="total_num_fetching_requests_label">
+		2, Número total de solicitações de obtenção: [NUM]
+	</text>
+	<text name="total_num_cache_hits_label">
+		3, Número total de acertos de cache: [NUM]
+	</text>
+	<text name="total_num_visible_tex_label">
+		4, Número total de texturas visíveis: [NUM]
+	</text>
+	<text name="total_num_visible_tex_fetch_req_label">
+		5, Número total de solicitações de obtenção de texturas visíveis: [NUM]
+	</text>
+	<text name="total_fetched_data_label">
+		6, Número total de dados obtidos: [SIZE1]KB, Dados decodificados: [SIZE2]KB, [PIXEL]MPixels
+	</text>
+	<text name="total_fetched_vis_data_label">
+		7, Número total de dados visíveis: [SIZE1]KB, Dados decodificados: [SIZE2]KB
+	</text>
+	<text name="total_fetched_rendered_data_label">
+		8, Número total de dados renderizados: [SIZE1]KB, Dados decodificados: [SIZE2]KB, [PIXEL]MPixels
+	</text>
+	<text name="total_time_cache_read_label">
+		9, Tempo total de leituras de cache: [TIME] segundos
+	</text>
+	<text name="total_time_cache_write_label">
+		10, Tempo total de gravações em cache: [TIME] segundos
+	</text>
+	<text name="total_time_decode_label">
+		11, Tempo total das decodificações: [TIME] segundos
+	</text>
+	<text name="total_time_gl_label">
+		12, Tempo total de criação de texturas gl: [TIME] segundos
+	</text>
+	<text name="total_time_http_label">
+		13, Tempo total de obtenção de HTTP: [TIME] segundos
+	</text>
+	<text name="total_time_fetch_label">
+		14, Tempo total de obtenção completa: [TIME] segundos
+	</text>
+	<text name="total_time_refetch_vis_cache_label">
+		15, Obtendo novamente visíveis do cache, Tempo: [TIME] segundos, Obtidos: [SIZE]KB, [PIXEL]MPixels
+	</text>
+	<text name="total_time_refetch_vis_http_label">
+		16, Obtendo novamente visíveis do HTTP, Tempo: [TIME] segundos, Obtidos: [SIZE]KB, [PIXEL]MPixels
+	</text>
+	<spinner label="17, Proporção de texel/pixel:" name="texel_pixel_ratio"/>
+	<button label="Iniciar" name="start_btn"/>
+	<button label="Redefinir" name="clear_btn"/>
+	<button label="Fechar" name="close_btn"/>
+	<button label="Leitura do cache" name="cacheread_btn"/>
+	<button label="Gravação em cache" name="cachewrite_btn"/>
+	<button label="HTTP" name="http_btn"/>
+	<button label="Decodificar" name="decode_btn"/>
+	<button label="Textura GL" name="gl_btn"/>
+	<button label="Obter novamente cache visível" name="refetchviscache_btn"/>
+	<button label="Obter novamente HTTP visível" name="refetchvishttp_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_window_size.xml b/indra/newview/skins/default/xui/pt/floater_window_size.xml
index 6a8ccbd00249e1c9358acaa9e18b299249a8a8d8..7deb799bd7d8241fcf6819b9149879b55d80f881 100644
--- a/indra/newview/skins/default/xui/pt/floater_window_size.xml
+++ b/indra/newview/skins/default/xui/pt/floater_window_size.xml
@@ -7,10 +7,17 @@
 		Definir tamanho da janela:
 	</text>
 	<combo_box name="window_size_combo" tool_tip="largura x altura">
-		<combo_box.item label="1000 x 700 (padrão)" name="item0"/>
-		<combo_box.item label="1024 x 768" name="item1"/>
-		<combo_box.item label="1280 x 720 (720p)" name="item2"/>
-		<combo_box.item label="1920 x 1080 (1080p)" name="item3"/>
+		<combo_box.item label="1000 x 700 (padrão)" name="item1"/>
+		<combo_box.item label="1024 x 768 (4:3 XGA)" name="item2"/>
+		<combo_box.item label="1280 x 720 (16:9 HDTV)" name="item3"/>
+		<combo_box.item label="1280 x 800 (5:8 WXGA)" name="item4"/>
+		<combo_box.item label="1280 x 1024 (5:4 SXGA)" name="item5"/>
+		<combo_box.item label="1440 x 900 (8:5 WSXGA)" name="item7"/>
+		<combo_box.item label="1600 x 900 (16:9 HD+)" name="item8"/>
+		<combo_box.item label="1600 x 1200 (4:3 UXGA)" name="item9"/>
+		<combo_box.item label="1680 x 1050 (8:5 WSXGA+)" name="item10"/>
+		<combo_box.item label="1920 x 1080 (16:9 HDTV)" name="item11"/>
+		<combo_box.item label="1920 x 1200 (8:5 WUXGA)" name="item12"/>
 	</combo_box>
 	<button label="Definir" name="set_btn"/>
 	<button label="Cancelar" name="cancel_btn"/>
diff --git a/indra/newview/skins/default/xui/pt/menu_viewer.xml b/indra/newview/skins/default/xui/pt/menu_viewer.xml
index fd973bf3c24ced2d115913755727ef677c6a09c7..d93330e6dfe9fd163465d255c7c3e65ba4684e0f 100644
--- a/indra/newview/skins/default/xui/pt/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/pt/menu_viewer.xml
@@ -226,11 +226,10 @@
 			<menu_item_check label="Painel de textura" name="Texture Console"/>
 			<menu_item_check label="Console de depuração" name="Debug Console"/>
 			<menu_item_call label="Painel de avisos" name="Notifications"/>
-			<menu_item_check label="Painel de tamanho de textura" name="Texture Size"/>
-			<menu_item_check label="Painel de texturas" name="Texture Category"/>
 			<menu_item_check label="Tempos" name="Fast Timers"/>
 			<menu_item_check label="Memória" name="Memory"/>
 			<menu_item_check label="Estatísticas da cena" name="Scene Statistics"/>
+			<menu_item_call label="Painel de depuração de obtenção de textura" name="Texture Fetch Debug Console"/>
 			<menu_item_call label="Region Info to Debug Console" name="Region Info to Debug Console"/>
 			<menu_item_check label="Câmera:" name="Camera"/>
 			<menu_item_check label="Vento" name="Wind"/>
@@ -271,6 +270,12 @@
 			<menu_item_check label="Renderizar complexidade" name="rendercomplexity"/>
 			<menu_item_check label="Bytes do anexo" name="attachment bytes"/>
 			<menu_item_check label="Esculpir" name="Sculpt"/>
+			<menu label="Densidade da textura" name="Texture Density">
+				<menu_item_check label="Nenhuma" name="None"/>
+				<menu_item_check label="Atual" name="Current"/>
+				<menu_item_check label="Desejada" name="Desired"/>
+				<menu_item_check label="Completa" name="Full"/>
+			</menu>
 		</menu>
 		<menu label="Rendering" name="Rendering">
 			<menu_item_check label="Axes" name="Axes"/>
diff --git a/indra/newview/skins/default/xui/pt/notifications.xml b/indra/newview/skins/default/xui/pt/notifications.xml
index 3b39c0f92cb1948b836a7a29e48e1ff686958d66..500a7f0c0173578906d9854365bc7082360f3ec9 100644
--- a/indra/newview/skins/default/xui/pt/notifications.xml
+++ b/indra/newview/skins/default/xui/pt/notifications.xml
@@ -489,6 +489,15 @@ Consultar [_URL] para mais informações?
 		</url>
 		<usetemplate ignoretext="O hardware do meu computador não é suportado" name="okcancelignore" notext="Não" yestext="Sim"/>
 	</notification>
+	<notification name="IntelOldDriver">
+		Provavelmente, há um driver mais recente para o seu chip gráfico.  A atualização dos drivers gráficos pode melhorar significativamente o desempenho.
+
+    Visitar [_URL] para verificar se há atualizações do driver?
+		<url name="url">
+			http://www.intel.com/p/pt_BR/support/detect/graphics
+		</url>
+		<usetemplate ignoretext="Meu driver gráfico está desatualizado" name="okcancelignore" notext="Não" yestext="Sim"/>
+	</notification>
 	<notification name="UnknownGPU">
 		A placa de vídeo do seu sistema não é reconhecida pelo [APP_NAME].
 Isto acontece quando novos hardwares que ainda não foram testados no [APP_NAME].  Talvez isso não cause problemas, mas pode ser preciso checar as configurações de vídeo. 
@@ -2596,16 +2605,12 @@ OK?
 		</form>
 	</notification>
 	<notification name="ScriptQuestionCaution">
-		Um objeto chamado &apos;&lt;nolink&gt;[OBJECTNAME]&lt;/nolink&gt;&apos;&apos;, de &apos;[NAME]&apos;, gostaria de:
-
-[QUESTIONS]
-Se você não confia nos objetos deste autor, recuse-o.
-
-Deseja aceitar?
+		Aviso: O objeto &apos;&lt;nolink&gt;[OBJECTNAME]&lt;/nolink&gt;&apos; deseja obter acesso total à sua conta de dólares Linden. Se você conceder acesso, ele poderá remover fundos de sua conta a qualquer momento ou esvaziar sua conta completamente, continuamente e sem avisos adicionais.
+  
+Esse tipo de pedido raramente é legítimo. Não conceda acesso se você não entender completamente por que ele deseja acessar sua conta.
 		<form name="form">
-			<button name="Grant" text="Autorizar"/>
+			<button name="Grant" text="Permitir acesso total"/>
 			<button name="Deny" text="Negar"/>
-			<button name="Details" text="Detalhes..."/>
 		</form>
 	</notification>
 	<notification name="ScriptDialog">
@@ -3096,4 +3101,16 @@ Outra opção é procurar por lugares com a tag &apos;Infohub&apos; no mapa.
 	<global name="You died and have been teleported to your home location">
 		Você morreu e foi reenviado ao seu início.
 	</global>
+	<notification name="LocalBitmapsUpdateFileNotFound">
+		Não foi possível atualizar [FNAME], pois o arquivo não pôde ser encontrado.
+Desabilitando atualizações futuras deste arquivo.
+	</notification>
+	<notification name="LocalBitmapsUpdateFailedFinal">
+		[FNAME] não pode ser aberto ou decodificado em [NRETRIES] tentativas, e agora é considerado corrompido.
+Desabilitando atualizações futuras deste arquivo.
+	</notification>
+	<notification name="LocalBitmapsVerifyFail">
+		Tentativa de adição de um formato de imagem inválido ou ilegível [FNAME] que não pode ser aberto ou decodificado.
+Tentativa cancelada.
+	</notification>
 </notifications>
diff --git a/indra/newview/skins/default/xui/pt/panel_script_question_toast.xml b/indra/newview/skins/default/xui/pt/panel_script_question_toast.xml
new file mode 100644
index 0000000000000000000000000000000000000000..a2d0237da010e5c72549a283f6a34c7561e17eab
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/panel_script_question_toast.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel label="script_question_panel" name="panel_script_question_toast">
+	<panel label="buttons_panel" name="buttons_panel"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/pt/strings.xml b/indra/newview/skins/default/xui/pt/strings.xml
index 342a52356b95e8360578272e0f1a039da7a481e5..fd8f22f331816fdf10b0f13ca0895d3e8800a303 100644
--- a/indra/newview/skins/default/xui/pt/strings.xml
+++ b/indra/newview/skins/default/xui/pt/strings.xml
@@ -835,6 +835,9 @@ Pessoas com contas gratuitas não poderão acessar o Second Life no momento para
 	<string name="ScriptQuestionCautionChatDenied">
 		&apos;[OBJECTNAME]&apos;, um objeto de  &apos;[OWNERNAME]&apos;, localizado em [REGIONNAME] a [REGIONPOS], teve permissão negada para: [PERMISSIONS].
 	</string>
+	<string name="AdditionalPermissionsRequestHeader">
+		Se você permitir acesso à sua conta, o objeto também poderá:
+	</string>
 	<string name="ScriptTakeMoney">
 		Tomar linden dólares (L$) de você
 	</string>
@@ -868,6 +871,9 @@ Pessoas com contas gratuitas não poderão acessar o Second Life no momento para
 	<string name="ControlYourCamera">
 		Controle sua camera
 	</string>
+	<string name="TeleportYourAgent">
+		Teletransportá-lo
+	</string>
 	<string name="SIM_ACCESS_PG">
 		Público geral
 	</string>
diff --git a/indra/newview/skins/default/xui/ru/floater_hardware_settings.xml b/indra/newview/skins/default/xui/ru/floater_hardware_settings.xml
index 7400f1df3b5fb48d5a26f4f3a4ecdf3ddeb280ad..43f8c364734de444741691165fefb79923367707 100644
--- a/indra/newview/skins/default/xui/ru/floater_hardware_settings.xml
+++ b/indra/newview/skins/default/xui/ru/floater_hardware_settings.xml
@@ -25,6 +25,10 @@
 		Включить VBO:
 	</text>
 	<check_box initial_value="истина" label="Включить объекты вершинных буферов OpenGL" name="vbo" tool_tip="Включение этого параметра на современном оборудовании даст увеличение производительности.  Однако на старом оборудовании это может привести к сбою приложения."/>
+	<text name="tc label">
+		Включить S3TC:
+	</text>
+	<check_box initial_value="true" label="Разрешить сжатие текстур (требует перезагрузки)" name="texture compression" tool_tip="Сжатие текстур в видеопамяти, что позволяет загружать текстуры большего размера за счет некоторого падения качества цвета."/>
 	<slider label="Память для текстур (Мб):" name="GraphicsCardTextureMemory" tool_tip="Количество памяти, отводимое для текстур. По умолчанию равно памяти видеокарты. Уменьшение поможет увеличить производительность, но текстуры могут стать размытыми."/>
 	<spinner label="Дистанция тумана:" name="fog"/>
 	<button label="OK" label_selected="OK" name="OK"/>
diff --git a/indra/newview/skins/default/xui/ru/floater_stats.xml b/indra/newview/skins/default/xui/ru/floater_stats.xml
index b1f60c8029be566bbb76584419a1ac0af9b5be03..2243c0f385d63bda63b8eaa792f787ce86ca2e5f 100644
--- a/indra/newview/skins/default/xui/ru/floater_stats.xml
+++ b/indra/newview/skins/default/xui/ru/floater_stats.xml
@@ -14,8 +14,11 @@
 					<stat_bar label="Треугольников в секунду" name="ktrissec"/>
 					<stat_bar label="Всего объектов" name="objs"/>
 					<stat_bar label="Новых объектов" name="newobjs"/>
+					<stat_bar label="Частота попаданий в кэш объектов" name="object_cache_hits"/>
 				</stat_view>
 				<stat_view label="Текстура" name="texture">
+					<stat_bar label="Частота попаданий в кэш" name="texture_cache_hits"/>
+					<stat_bar label="Задержка чтения кэша" name="texture_cache_read_latency"/>
 					<stat_bar label="Количество" name="numimagesstat"/>
 					<stat_bar label="Необраб. изображений" name="numrawimagesstat"/>
 					<stat_bar label="Память GL" name="gltexmemstat"/>
diff --git a/indra/newview/skins/default/xui/ru/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/ru/floater_texture_ctrl.xml
index d55daea836533fccf58663971741aca954e754bb..f8693b835990d6dd48bbec78dee24d3341b43b85 100644
--- a/indra/newview/skins/default/xui/ru/floater_texture_ctrl.xml
+++ b/indra/newview/skins/default/xui/ru/floater_texture_ctrl.xml
@@ -9,15 +9,26 @@
 	<text name="Multiple">
 		Несколько текстур
 	</text>
+	<radio_group name="mode_selection">
+		<radio_item label="Инвентарь" name="inventory" value="0"/>
+		<radio_item label="Локально" name="local" value="1"/>
+	</radio_group>
 	<text name="unknown">
 		Размер: [DIMENSIONS]
 	</text>
 	<button label="По умолчанию" label_selected="По умолчанию" name="Default"/>
-	<button label="Нет" label_selected="Нет" name="None"/>
 	<button label="Очистить" label_selected="Очистить" name="Blank"/>
-	<check_box initial_value="истина" label="Применить сейчас" name="apply_immediate_check"/>
+	<button label="Нет" label_selected="Нет" name="None"/>
 	<filter_editor label="Фильтровать текстуры" name="inventory search editor"/>
 	<check_box initial_value="ложь" label="Показывать папки" name="show_folders_check"/>
+	<button label="Добавить" label_selected="Добавить" name="l_add_btn"/>
+	<button label="Удалить" label_selected="Удалить" name="l_rem_btn"/>
+	<button label="Передать" label_selected="Передать" name="l_upl_btn"/>
+	<scroll_list name="l_name_list">
+		<column label="Имя" name="unit_name"/>
+		<column label="ID" name="unit_id_HIDDEN"/>
+	</scroll_list>
 	<button label="ОК" label_selected="ОК" name="Select"/>
 	<button label="Отмена" label_selected="Отмена" name="Cancel"/>
+	<check_box initial_value="истина" label="Применить сейчас" name="apply_immediate_check"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/ru/floater_texture_fetch_debugger.xml b/indra/newview/skins/default/xui/ru/floater_texture_fetch_debugger.xml
new file mode 100644
index 0000000000000000000000000000000000000000..034106f24c45e3062278a7a35a36e037c73e91d9
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/floater_texture_fetch_debugger.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="TexFetchDebugger" title="Отладчик извлечения текстур">
+	<text name="total_num_fetched_label">
+		1, Общее количество извлеченных текстур: [NUM]
+	</text>
+	<text name="total_num_fetching_requests_label">
+		2, Общее количество запросов на извлечение: [NUM]
+	</text>
+	<text name="total_num_cache_hits_label">
+		3, Общее количество попаданий в кэш: [NUM]
+	</text>
+	<text name="total_num_visible_tex_label">
+		4, Общее количество видимых текстур: [NUM]
+	</text>
+	<text name="total_num_visible_tex_fetch_req_label">
+		5, Общее количество запросов на извлечение видимых текстур: [NUM]
+	</text>
+	<text name="total_fetched_data_label">
+		6, Общий объем извлеченных данных: [SIZE1] КБ, декодированные данные: [SIZE2] КБ, [PIXEL] Мпикселов
+	</text>
+	<text name="total_fetched_vis_data_label">
+		7, Общий объем видимых данных: [SIZE1] КБ, декодированные данные: [SIZE2] КБ
+	</text>
+	<text name="total_fetched_rendered_data_label">
+		8, Общий объем визуализированных данных: [SIZE1] КБ, декодированные данные: [SIZE2] КБ, [PIXEL] Мпикселов
+	</text>
+	<text name="total_time_cache_read_label">
+		9, Общее время чтения из кэша: [TIME] с
+	</text>
+	<text name="total_time_cache_write_label">
+		10, Общее время записи в кэш: [TIME] с
+	</text>
+	<text name="total_time_decode_label">
+		11, Общее время декодирования: [TIME] с
+	</text>
+	<text name="total_time_gl_label">
+		12, Общее время создания текстур: [TIME] с
+	</text>
+	<text name="total_time_http_label">
+		13, Общее время HTTP-извлечения: [TIME] с
+	</text>
+	<text name="total_time_fetch_label">
+		14, Общее время полного извлечения: [TIME] с
+	</text>
+	<text name="total_time_refetch_vis_cache_label">
+		15, Повторное извлечение из кэша, время: [TIME] с, извлечено: [SIZE] КБ, [PIXEL] Мпикселов
+	</text>
+	<text name="total_time_refetch_vis_http_label">
+		16, Повторное извлечение из HTTP, время: [TIME] с, извлечено: [SIZE] КБ, [PIXEL] Мпикселов
+	</text>
+	<spinner label="17, Отношение текселы/пикселы" name="texel_pixel_ratio"/>
+	<button label="Пуск" name="start_btn"/>
+	<button label="Сброс" name="clear_btn"/>
+	<button label="Закрыть" name="close_btn"/>
+	<button label="Чтение кэша" name="cacheread_btn"/>
+	<button label="Запись в кэш" name="cachewrite_btn"/>
+	<button label="HTTP" name="http_btn"/>
+	<button label="Декодировать" name="decode_btn"/>
+	<button label="Текстура GL" name="gl_btn"/>
+	<button label="Повторно извлечь из кэша" name="refetchviscache_btn"/>
+	<button label="Повторно извлечь из HTTP" name="refetchvishttp_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/ru/floater_window_size.xml b/indra/newview/skins/default/xui/ru/floater_window_size.xml
index 24865a6ba5df0facb48c715c3fedbae249274ec4..fbff6a72b276bce4ea42f8d2bcfd66ec7e546c1e 100644
--- a/indra/newview/skins/default/xui/ru/floater_window_size.xml
+++ b/indra/newview/skins/default/xui/ru/floater_window_size.xml
@@ -7,10 +7,17 @@
 		Задать размер окна:
 	</text>
 	<combo_box name="window_size_combo" tool_tip="ширина x высота">
-		<combo_box.item label="1000 x 700 (по умолчанию)" name="item0"/>
-		<combo_box.item label="1024 x 768" name="item1"/>
-		<combo_box.item label="1280 x 720 (720p)" name="item2"/>
-		<combo_box.item label="1920 x 1080 (1080p)" name="item3"/>
+		<combo_box.item label="1000 x 700 (по умолчанию)" name="item1"/>
+		<combo_box.item label="1024 x 768 (4:3 XGA)" name="item2"/>
+		<combo_box.item label="1280 x 720 (16:9 HDTV)" name="item3"/>
+		<combo_box.item label="1280 x 800 (5:8 WXGA)" name="item4"/>
+		<combo_box.item label="1280 x 1024 (5:4 WXGA)" name="item5"/>
+		<combo_box.item label="1440 x 900 (8:5 WSXGA)" name="item7"/>
+		<combo_box.item label="1600 x 900 (16:9 HD+)" name="item8"/>
+		<combo_box.item label="1600 x 1200 (4:3 UXGA)" name="item9"/>
+		<combo_box.item label="1680 x 1050 (8:5 WSXGA)" name="item10"/>
+		<combo_box.item label="1920 x 1080 (16:9 HDTV)" name="item11"/>
+		<combo_box.item label="1920 x 1200 (8:5 UXGA)" name="item12"/>
 	</combo_box>
 	<button label="Задать" name="set_btn"/>
 	<button label="Отмена" name="cancel_btn"/>
diff --git a/indra/newview/skins/default/xui/ru/menu_viewer.xml b/indra/newview/skins/default/xui/ru/menu_viewer.xml
index 0699314d971f643dffd13e1c8ffc10ab3b50bddf..701f097ddb9fd9dab4dfe2b5b1537c8daca10bde 100644
--- a/indra/newview/skins/default/xui/ru/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/ru/menu_viewer.xml
@@ -225,11 +225,10 @@
 			<menu_item_check label="Консоль текстур" name="Texture Console"/>
 			<menu_item_check label="Консоль отладки" name="Debug Console"/>
 			<menu_item_call label="Консоль уведомлений" name="Notifications"/>
-			<menu_item_check label="Консоль размера текстуры" name="Texture Size"/>
-			<menu_item_check label="Консоль категории текстуры" name="Texture Category"/>
 			<menu_item_check label="Оперативные таймеры" name="Fast Timers"/>
 			<menu_item_check label="Память" name="Memory"/>
 			<menu_item_check label="Статистика по сцене" name="Scene Statistics"/>
+			<menu_item_call label="Консоль отладки извлечения текстур" name="Texture Fetch Debug Console"/>
 			<menu_item_call label="Данные о регионе на консоль отладки" name="Region Info to Debug Console"/>
 			<menu_item_call label="Данны о группе на консоль отладки" name="Group Info to Debug Console"/>
 			<menu_item_call label="Данные о способностях на консоль отладки" name="Capabilities Info to Debug Console"/>
@@ -287,6 +286,12 @@
 			<menu_item_check label="Сложность визуализации" name="rendercomplexity"/>
 			<menu_item_check label="Байты присоединения" name="attachment bytes"/>
 			<menu_item_check label="Лепка" name="Sculpt"/>
+			<menu label="Плотность текстуры" name="Texture Density">
+				<menu_item_check label="Нет" name="None"/>
+				<menu_item_check label="Текущая" name="Current"/>
+				<menu_item_check label="Желаемая" name="Desired"/>
+				<menu_item_check label="Полная" name="Full"/>
+			</menu>
 		</menu>
 		<menu label="Визуализация" name="Rendering">
 			<menu_item_check label="Оси" name="Axes"/>
@@ -304,7 +309,6 @@
 			<menu_item_check label="Текстуры анимаций" name="Animation Textures"/>
 			<menu_item_check label="Отключить текстуры" name="Disable Textures"/>
 			<menu_item_check label="Текстуры в полном разрешении" name="Rull Res Textures"/>
-			<menu_item_check label="Проверить текстуры" name="Audit Textures"/>
 			<menu_item_check label="Атлас текстур (экспериментальная функция)" name="Texture Atlas"/>
 			<menu_item_check label="Визуализация присоединенных источников света" name="Render Attached Lights"/>
 			<menu_item_check label="Визуализация присоединенных частиц" name="Render Attached Particles"/>
diff --git a/indra/newview/skins/default/xui/ru/notifications.xml b/indra/newview/skins/default/xui/ru/notifications.xml
index b4692385d185f4bef55731d65d59b4834aebd300..97e5ee8c65409dabd673db1180ef3f716b35f4e1 100644
--- a/indra/newview/skins/default/xui/ru/notifications.xml
+++ b/indra/newview/skins/default/xui/ru/notifications.xml
@@ -495,6 +495,15 @@
 		</url>
 		<usetemplate ignoretext="Оборудование моего компьютера не поддерживается" name="okcancelignore" notext="Нет" yestext="Да"/>
 	</notification>
+	<notification name="IntelOldDriver">
+		Возможно, для вашей видеокарты имеется более новый драйвер.  Обновление драйвера может существенно повысить быстродействие.
+
+    Проверить наличие обновления для драйвера по адресу [_URL]?
+		<url name="url">
+			http://www.intel.com/p/ru_RU/support/detect/graphics
+		</url>
+		<usetemplate ignoretext="Мой графический драйвер устарел" name="okcancelignore" notext="Нет" yestext="Да"/>
+	</notification>
 	<notification name="UnknownGPU">
 		В вашей системе установлена графическая карта, которую [APP_NAME] не может распознать.
 Так часто бывает, если новое оборудование еще не было проверено на работу с [APP_NAME].  Скорее всего, оно будет работать нормально, но, возможно, придется отрегулировать параметры графики.
@@ -2614,16 +2623,12 @@ http://secondlife.com/download.
 		</form>
 	</notification>
 	<notification name="ScriptQuestionCaution">
-		Объект «&lt;nolink&gt;[OBJECTNAME]&lt;/nolink&gt;», владелец которого – «[NAME]», желает:
-
-[QUESTIONS]
-Если вы не доверяете этому объекту или его создателю, отклоните запрос.
-
-Принять этот запрос?
+		Предупреждение. Объект «&lt;nolink&gt;[OBJECTNAME]&lt;/nolink&gt;» требует полного доступа к вашему аккаунту для Linden-долларов. Если разрешить такой доступ, объект сможет в любое время снимать средства с вашего аккаунта или полностью опустошать его неоднократно и без предупреждения.
+  
+Такое требование чаще всего незаконно. Не разрешайте доступ к своему аккаунту, если только не полностью осознаете, зачем он нужен этому объекту.
 		<form name="form">
-			<button name="Grant" text="Принять"/>
+			<button name="Grant" text="Разрешить полный доступ"/>
 			<button name="Deny" text="Отклонить"/>
-			<button name="Details" text="Подробности..."/>
 		</form>
 	</notification>
 	<notification name="ScriptDialog">
@@ -3122,4 +3127,16 @@ http://secondlife.com/download.
 	<global name="You died and have been teleported to your home location">
 		Вы умерли и были телепортированы в ваше домашнее местоположение.
 	</global>
+	<notification name="LocalBitmapsUpdateFileNotFound">
+		Не удалось обновить [FNAME]: файл не найден.
+Последующее обновление этого файла запрещается.
+	</notification>
+	<notification name="LocalBitmapsUpdateFailedFinal">
+		Не удалось открыть или декодировать [FNAME] с [NRETRIES] попыток. Этот файл считается поврежденным.
+Последующее обновление этого файла запрещается.
+	</notification>
+	<notification name="LocalBitmapsVerifyFail">
+		Попытка добавить недопустимый или нечитаемый файл изображения [FNAME], который не удалось открыть или декодировать.
+Попытка отменена.
+	</notification>
 </notifications>
diff --git a/indra/newview/skins/default/xui/ru/panel_script_question_toast.xml b/indra/newview/skins/default/xui/ru/panel_script_question_toast.xml
new file mode 100644
index 0000000000000000000000000000000000000000..a2d0237da010e5c72549a283f6a34c7561e17eab
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/panel_script_question_toast.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel label="script_question_panel" name="panel_script_question_toast">
+	<panel label="buttons_panel" name="buttons_panel"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/ru/strings.xml b/indra/newview/skins/default/xui/ru/strings.xml
index 8dbc4f092d05f7d3c4f7080857d8ff0a0825a6dd..6461e10e2d6fa43b74654df346a39a822d913246 100644
--- a/indra/newview/skins/default/xui/ru/strings.xml
+++ b/indra/newview/skins/default/xui/ru/strings.xml
@@ -883,6 +883,9 @@ support@secondlife.com.
 	<string name="ScriptQuestionCautionChatDenied">
 		Объекту «[OBJECTNAME]», который принадлежит пользователю «[OWNERNAME]» и находится в [REGIONPOS] в регионе «[REGIONNAME]», отказано в разрешении: [PERMISSIONS].
 	</string>
+	<string name="AdditionalPermissionsRequestHeader">
+		Разрешив доступ к своему аккаунту, вы также разрешите объекту:
+	</string>
 	<string name="ScriptTakeMoney">
 		У вас берут Linden-деньги
 	</string>
@@ -916,6 +919,9 @@ support@secondlife.com.
 	<string name="ControlYourCamera">
 		Управлять камерой
 	</string>
+	<string name="TeleportYourAgent">
+		Телепортировать вас
+	</string>
 	<string name="NotConnected">
 		Нет подключения
 	</string>
diff --git a/indra/newview/skins/default/xui/tr/floater_hardware_settings.xml b/indra/newview/skins/default/xui/tr/floater_hardware_settings.xml
index 8e056b9b0d0353bfe45d6c5e389fddcdb2ab5934..b204389083fb98bb0f53b8420697872d283ca2bb 100644
--- a/indra/newview/skins/default/xui/tr/floater_hardware_settings.xml
+++ b/indra/newview/skins/default/xui/tr/floater_hardware_settings.xml
@@ -25,6 +25,10 @@
 		VBO EtkinleÅŸtir:
 	</text>
 	<check_box initial_value="true" label="OpenGL Vertex Tampon Nesnelerini Etkinleştir" name="vbo" tool_tip="Modern donanımlarda bunun etkinleştirilmesi performans artışı sağlar.  Ancak, eski donanımlardaki VBO uygulamaları yetersizdir ve etkinleştirildiğinde bilgisayarınız çökebilir."/>
+	<text name="tc label">
+		S3TC&apos;ü Etkinleştir:
+	</text>
+	<check_box initial_value="true" label="Doku Sıkıştırmasını Etkinleştir (yeniden başlatma gerektirir)" name="texture compression" tool_tip="Video bellekteki dokuları sıkıştırır, renk kalitesinde bazı kayıplar olmasına karşın daha yüksek çözünürlükte dokuların yüklenmesine imkan tanır."/>
 	<slider label="Doku Belleği (MB):" name="GraphicsCardTextureMemory" tool_tip="Dokular için tahsis edilecek bellek miktarı. Varsayılan değer video kartı belleğidir. Bu değerin küçültülmesi performansı artırabilir, ama ayrıca dokuları bulanıklaştırabilir."/>
 	<spinner label="Sis Mesafe Oranı:" name="fog"/>
 	<button label="Tamam" label_selected="Tamam" name="OK"/>
diff --git a/indra/newview/skins/default/xui/tr/floater_stats.xml b/indra/newview/skins/default/xui/tr/floater_stats.xml
index 17f1166c4681b99b185301fa5daae64cf98080a4..e3f54fc338f4a0a6e865bbf32965534e2539b242 100644
--- a/indra/newview/skins/default/xui/tr/floater_stats.xml
+++ b/indra/newview/skins/default/xui/tr/floater_stats.xml
@@ -14,8 +14,11 @@
 					<stat_bar label="Saniyede Bir Çizilen Üçgenler" name="ktrissec"/>
 					<stat_bar label="Toplam Nesne" name="objs"/>
 					<stat_bar label="Yeni Nesne" name="newobjs"/>
+					<stat_bar label="Nesne Önbellek İsabet Oranı" name="object_cache_hits"/>
 				</stat_view>
 				<stat_view label="Doku" name="texture">
+					<stat_bar label="Önbellek İsabet Oranı" name="texture_cache_hits"/>
+					<stat_bar label="Önbellek Okuma Gecikme Süresi" name="texture_cache_read_latency"/>
 					<stat_bar label="Sayım" name="numimagesstat"/>
 					<stat_bar label="Ham Sayım" name="numrawimagesstat"/>
 					<stat_bar label="GL BelleÄŸi" name="gltexmemstat"/>
diff --git a/indra/newview/skins/default/xui/tr/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/tr/floater_texture_ctrl.xml
index 4ef789f58594c8f700c3da42b9038c4724e2aa91..67bf9071b352eb34a03f28ed1ec9f14e4fa5ba11 100644
--- a/indra/newview/skins/default/xui/tr/floater_texture_ctrl.xml
+++ b/indra/newview/skins/default/xui/tr/floater_texture_ctrl.xml
@@ -9,15 +9,26 @@
 	<text name="Multiple">
 		Birden çok doku
 	</text>
+	<radio_group name="mode_selection">
+		<radio_item label="Envanter" name="inventory" value="0"/>
+		<radio_item label="Yerel" name="local" value="1"/>
+	</radio_group>
 	<text name="unknown">
 		Büyüklük: [DIMENSIONS]
 	</text>
 	<button label="Varsayılan" label_selected="Varsayılan" name="Default"/>
-	<button label="Hiçbiri" label_selected="Hiçbiri" name="None"/>
 	<button label="BoÅŸ" label_selected="BoÅŸ" name="Blank"/>
-	<check_box initial_value="true" label="Åžimdi uygula" name="apply_immediate_check"/>
+	<button label="Hiçbiri" label_selected="Hiçbiri" name="None"/>
 	<filter_editor label="Dokuları Filtrele" name="inventory search editor"/>
 	<check_box initial_value="false" label="Klasörleri göster" name="show_folders_check"/>
+	<button label="Ekle" label_selected="Ekle" name="l_add_btn"/>
+	<button label="Kaldır" label_selected="Kaldır" name="l_rem_btn"/>
+	<button label="Karşıya Yükle" label_selected="Karşıya Yükle" name="l_upl_btn"/>
+	<scroll_list name="l_name_list">
+		<column label="Ad" name="unit_name"/>
+		<column label="Kimlik" name="unit_id_HIDDEN"/>
+	</scroll_list>
 	<button label="Tamam" label_selected="Tamam" name="Select"/>
 	<button label="Ä°ptal" label_selected="Ä°ptal" name="Cancel"/>
+	<check_box initial_value="true" label="Åžimdi uygula" name="apply_immediate_check"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/tr/floater_texture_fetch_debugger.xml b/indra/newview/skins/default/xui/tr/floater_texture_fetch_debugger.xml
new file mode 100644
index 0000000000000000000000000000000000000000..a592479b6ce5de4e71ed3e8fb510549912ebfe29
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/floater_texture_fetch_debugger.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="TexFetchDebugger" title="Doku Alımı Hata Ayıklayıcı">
+	<text name="total_num_fetched_label">
+		1, Alınan dokuların toplam sayısı: [NUM]
+	</text>
+	<text name="total_num_fetching_requests_label">
+		2, Toplam alım talebi sayısı: [NUM]
+	</text>
+	<text name="total_num_cache_hits_label">
+		3, Toplam önbellek isabet sayısı: [NUM]
+	</text>
+	<text name="total_num_visible_tex_label">
+		4, Görünür dokuların toplam sayısı: [NUM]
+	</text>
+	<text name="total_num_visible_tex_fetch_req_label">
+		5, Görünür dokuların alınması için toplam talep sayısı: [NUM]
+	</text>
+	<text name="total_fetched_data_label">
+		6, Alınan verilerin toplam sayısı: [SIZE1]KB, Şifresi Çözülen Veri: [SIZE2]KB, [PIXEL]MPiksel
+	</text>
+	<text name="total_fetched_vis_data_label">
+		7, Görünür verilerin toplam sayısı: [SIZE1]KB, Şifresi Çözülen Veri: [SIZE2]KB
+	</text>
+	<text name="total_fetched_rendered_data_label">
+		8, İşlenen verilerin toplam sayısı: [SIZE1]KB, Şifresi Çözülen Veri: [SIZE2]KB, [PIXEL]MPiksel
+	</text>
+	<text name="total_time_cache_read_label">
+		9, Önbellek okunması için toplam süre: [TIME] saniye
+	</text>
+	<text name="total_time_cache_write_label">
+		10, Önbellek yazılması için toplam süre: [TIME] saniye
+	</text>
+	<text name="total_time_decode_label">
+		11, Şifre çözülmesi için toplam süre: [TIME] saniye
+	</text>
+	<text name="total_time_gl_label">
+		12, GL doku oluşturma için toplam süre: [TIME] saniye
+	</text>
+	<text name="total_time_http_label">
+		13, HTTP alımı için toplam süre: [TIME] saniye
+	</text>
+	<text name="total_time_fetch_label">
+		14, Tüm alımlar için toplam süre: [TIME] saniye
+	</text>
+	<text name="total_time_refetch_vis_cache_label">
+		15, Görünür dokuların önbellekten tekrar alınması, Süre: [TIME] saniye, Alınan: [SIZE]KB, [PIXEL]MPiksel
+	</text>
+	<text name="total_time_refetch_vis_http_label">
+		16, Görünür dokuların HTTP&apos;den tekrar alınması, Süre: [TIME] saniye, Alınan: [SIZE]KB, [PIXEL]MPiksel
+	</text>
+	<spinner label="17, Teksel/Piksel Oranı:" name="texel_pixel_ratio"/>
+	<button label="BaÅŸla" name="start_btn"/>
+	<button label="Sıfırla" name="clear_btn"/>
+	<button label="Kapat" name="close_btn"/>
+	<button label="Önbellek Okunması" name="cacheread_btn"/>
+	<button label="Önbellek Yazılması" name="cachewrite_btn"/>
+	<button label="HTTP" name="http_btn"/>
+	<button label="Şifre Çöz" name="decode_btn"/>
+	<button label="GL Dokusu" name="gl_btn"/>
+	<button label="Görünür Dokuları Önbellekten Tekrar Al" name="refetchviscache_btn"/>
+	<button label="Görünür Dokuları HTTP&apos;den Tekrar Al" name="refetchvishttp_btn"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/tr/floater_window_size.xml b/indra/newview/skins/default/xui/tr/floater_window_size.xml
index acc2cc3376fe9087266b5b703216bc0ff808e829..aff20e7960d99cd3adfae18ff3f9040569a7ad68 100644
--- a/indra/newview/skins/default/xui/tr/floater_window_size.xml
+++ b/indra/newview/skins/default/xui/tr/floater_window_size.xml
@@ -7,10 +7,17 @@
 		Pencere büyüklüğünü ayarla:
 	</text>
 	<combo_box name="window_size_combo" tool_tip="genişlik x yükseklik">
-		<combo_box.item label="1000 x 700 (varsayılan)" name="item0"/>
-		<combo_box.item label="1024 x 768" name="item1"/>
-		<combo_box.item label="1280 x 720 (720p)" name="item2"/>
-		<combo_box.item label="1920 x 1080 (1080p)" name="item3"/>
+		<combo_box.item label="1000 x 700 (varsayılan)" name="item1"/>
+		<combo_box.item label="1024 x 768 (4:3 XGA)" name="item2"/>
+		<combo_box.item label="1280 x 720 (16:9 HDTV)" name="item3"/>
+		<combo_box.item label="1280 x 800 (5:8 WXGA)" name="item4"/>
+		<combo_box.item label="1280 x 1024 (5:4 SXGA)" name="item5"/>
+		<combo_box.item label="1440 x 900 (8:5 WSXGA)" name="item7"/>
+		<combo_box.item label="1600 x 900 (16:9 HD+)" name="item8"/>
+		<combo_box.item label="1600 x 1200 (4:3 UXGA)" name="item9"/>
+		<combo_box.item label="1680 x 1050 (8:5 WSXGA+)" name="item10"/>
+		<combo_box.item label="1920 x 1080 (16:9 HDTV)" name="item11"/>
+		<combo_box.item label="1920 x 1200 (8:5 WUXGA)" name="item12"/>
 	</combo_box>
 	<button label="Ayarla" name="set_btn"/>
 	<button label="Ä°ptal" name="cancel_btn"/>
diff --git a/indra/newview/skins/default/xui/tr/menu_viewer.xml b/indra/newview/skins/default/xui/tr/menu_viewer.xml
index d7b20bac4b4ef248562ad776de00ad683fdcbca8..ea84e7d24b3f9740063f0269da2f8d37d9360e46 100644
--- a/indra/newview/skins/default/xui/tr/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/tr/menu_viewer.xml
@@ -225,11 +225,10 @@
 			<menu_item_check label="Doku Konsolu" name="Texture Console"/>
 			<menu_item_check label="Hata Ayıklama Konsolu" name="Debug Console"/>
 			<menu_item_call label="Bildirimler Konsolu" name="Notifications"/>
-			<menu_item_check label="Doku Büyüklüğü Konsolu" name="Texture Size"/>
-			<menu_item_check label="Doku Kategorisi Konsolu" name="Texture Category"/>
 			<menu_item_check label="Hızlı Zamanlayıcılar" name="Fast Timers"/>
 			<menu_item_check label="Bellek" name="Memory"/>
 			<menu_item_check label="Sahne Ä°statistikleri" name="Scene Statistics"/>
+			<menu_item_call label="Doku Alınması Hata Ayıklama Konsolu" name="Texture Fetch Debug Console"/>
 			<menu_item_call label="Hata Ayıklama Konsoluna giden Bölge Bilgisi" name="Region Info to Debug Console"/>
 			<menu_item_call label="Hata Ayıklama Konsoluna giden Grup Bilgisi" name="Group Info to Debug Console"/>
 			<menu_item_call label="Hata Ayıklama Konsoluna giden Özellikler Bilgisi" name="Capabilities Info to Debug Console"/>
@@ -287,6 +286,12 @@
 			<menu_item_check label="İşleme Karmaşıklığı" name="rendercomplexity"/>
 			<menu_item_check label="Aksesuar Bayt Büyüklüğü" name="attachment bytes"/>
 			<menu_item_check label="Åžekillendir" name="Sculpt"/>
+			<menu label="Doku YoÄŸunluÄŸu" name="Texture Density">
+				<menu_item_check label="Yok" name="None"/>
+				<menu_item_check label="Mevcut" name="Current"/>
+				<menu_item_check label="Arzulanan" name="Desired"/>
+				<menu_item_check label="Tam" name="Full"/>
+			</menu>
 		</menu>
 		<menu label="Ä°ÅŸleme" name="Rendering">
 			<menu_item_check label="Eksenler" name="Axes"/>
@@ -304,7 +309,6 @@
 			<menu_item_check label="Animasyon Dokuları" name="Animation Textures"/>
 			<menu_item_check label="Dokuları Devre Dışı Bırak" name="Disable Textures"/>
 			<menu_item_check label="Tam Çöz. Dokular" name="Rull Res Textures"/>
-			<menu_item_check label="Dokuları Denetle" name="Audit Textures"/>
 			<menu_item_check label="Doku Atlas (deneysel)" name="Texture Atlas"/>
 			<menu_item_check label="Eklenmiş Işıkları İşle" name="Render Attached Lights"/>
 			<menu_item_check label="Eklenmiş Parçacıkları İşle" name="Render Attached Particles"/>
diff --git a/indra/newview/skins/default/xui/tr/notifications.xml b/indra/newview/skins/default/xui/tr/notifications.xml
index 6681cdac7affacb6b216590ff983ae55b8b78b5f..27f0deaf4ac500fc98e875847e969edc97a95a10 100644
--- a/indra/newview/skins/default/xui/tr/notifications.xml
+++ b/indra/newview/skins/default/xui/tr/notifications.xml
@@ -495,6 +495,15 @@ Daha fazla bilgi için [_URL] adresini ziyaret etmek ister misiniz?
 		</url>
 		<usetemplate ignoretext="Bilgisayar donanımım desteklenmiyor" name="okcancelignore" notext="Hayır" yestext="Evet"/>
 	</notification>
+	<notification name="IntelOldDriver">
+		Grafik yonganız için muhtemelen daha yeni bir sürücü mevcut.  Grafik sürücüleri güncellemek performansınızı kayda değer şekilde artırabilir.
+
+    Sürücü güncellemeleri için [_URL] adresini ziyaret etmek ister misiniz?
+		<url name="url">
+			http://www.intel.com/p/en_US/support/detect/graphics
+		</url>
+		<usetemplate ignoretext="Grafik sürücüm güncel değil" name="okcancelignore" notext="Hayır" yestext="Evet"/>
+	</notification>
 	<notification name="UnknownGPU">
 		Sisteminiz [APP_NAME] uygulamasının tanımadığı bir grafik kartı içeriyor.
 Bu durum genellikle [APP_NAME] uygulaması ile henüz denenmemiş yeni donanımlar kullanıldığında ortaya çıkar.  Büyük olasılıkla bir sorun çıkmayacaktır, fakat grafik ayarlarınızı değiştirmeniz gerekebilir.
@@ -2614,16 +2623,12 @@ Kabul ediyor musunuz?
 		</form>
 	</notification>
 	<notification name="ScriptQuestionCaution">
-		&apos;[NAME]&apos; adlı kişiye ait &apos;&lt;nolink&gt;[OBJECTNAME]&lt;/nolink&gt;&apos; adındaki bir nesne şunu yapmak istiyor:
-
-[QUESTIONS]
-Bu nesneye ya da onu oluşturan kişiye güvenmiyorsanız, bu talebi reddetmelisiniz.
-
-Talep kabul edilsin mi?
+		Uyarı: &apos;&lt;nolink&gt;[OBJECTNAME]&lt;/nolink&gt;&apos; nesnesi, Linden Dolar hesabınıza tam erişim istiyor. Eğer erişime izin verirseniz, süregelen bir şekilde, ilave uyarı olmaksızın, hesabınızdan herhangi bir zamanda fon çekebilir veya hesabınızı tamamen boşaltabilir.
+  
+Bu türden bir talebin yerinde olması nadir bir durumdur. Eğer hesabınıza neden erişmek istediğini tam olarak anlamıyorsanız, erişime izin vermeyin.
 		<form name="form">
-			<button name="Grant" text="Kabul Et"/>
+			<button name="Grant" text="Tam eriÅŸime izin ver"/>
 			<button name="Deny" text="Reddet"/>
-			<button name="Details" text="Ayrıntılar..."/>
 		</form>
 	</notification>
 	<notification name="ScriptDialog">
@@ -3122,4 +3127,16 @@ Bir araziye sahip değilseniz, Harita&apos;ya bakıp &quot;Bilgi İstasyonu&quot
 	<global name="You died and have been teleported to your home location">
 		Hayatınızı kaybettiniz ve ana konumunuza ışınlandınız.
 	</global>
+	<notification name="LocalBitmapsUpdateFileNotFound">
+		[FNAME] güncellenemedi çünkü bu dosya artık bulunamıyor.
+Bundan sonra bu dosya için güncellemeler devre dışı bırakılacak.
+	</notification>
+	<notification name="LocalBitmapsUpdateFailedFinal">
+		[NRETRIES] girişimde [FNAME] açılamadı veya şifresi çözülemedi, bu dosya artık bozuk olarak değerlendiriliyor.
+Bundan sonra bu dosya için güncellemeler devre dışı bırakılacak.
+	</notification>
+	<notification name="LocalBitmapsVerifyFail">
+		Geçersiz veya okunamayan bir görüntü dosyası [FNAME] eklenmeye kalkışıldı, ancak dosya açılamadı veya şifresi çözülemedi.
+GiriÅŸim iptal edildi.
+	</notification>
 </notifications>
diff --git a/indra/newview/skins/default/xui/tr/panel_script_question_toast.xml b/indra/newview/skins/default/xui/tr/panel_script_question_toast.xml
new file mode 100644
index 0000000000000000000000000000000000000000..a2d0237da010e5c72549a283f6a34c7561e17eab
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/panel_script_question_toast.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel label="script_question_panel" name="panel_script_question_toast">
+	<panel label="buttons_panel" name="buttons_panel"/>
+</panel>
diff --git a/indra/newview/skins/default/xui/tr/strings.xml b/indra/newview/skins/default/xui/tr/strings.xml
index 2a4e2c20a7e6d83eeb1c0fcddac7c1a0ecffa97f..a8a691a98e1f9dcaf846b1024625b374952702a5 100644
--- a/indra/newview/skins/default/xui/tr/strings.xml
+++ b/indra/newview/skins/default/xui/tr/strings.xml
@@ -883,6 +883,9 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin.
 	<string name="ScriptQuestionCautionChatDenied">
 		&apos;[OWNERNAME]&apos; adlı kişiye ait, [REGIONPOS] üzerinde [REGIONNAME] içerisinde bulunan &apos;[OBJECTNAME]&apos; nesnesine şunu yapma izni verilmedi: [PERMISSIONS].
 	</string>
+	<string name="AdditionalPermissionsRequestHeader">
+		Eğer hesabınıza erişime izin verirseniz, bu nesneye aynı zamanda şunun için izin vermiş olacaksınız:
+	</string>
 	<string name="ScriptTakeMoney">
 		Sizden Linden dolar (L$) almak
 	</string>
@@ -916,6 +919,9 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin.
 	<string name="ControlYourCamera">
 		Kameranızı kontrol etmek
 	</string>
+	<string name="TeleportYourAgent">
+		Sizi ışınlama
+	</string>
 	<string name="NotConnected">
 		Bağlı Değil
 	</string>
diff --git a/indra/newview/tests/llagentaccess_test.cpp b/indra/newview/tests/llagentaccess_test.cpp
index 0141a219c5a8416cf93c1d9c6a70885cfd707923..3ba25f3c10963b160bfd1dc6a824b341d39cc1d2 100644
--- a/indra/newview/tests/llagentaccess_test.cpp
+++ b/indra/newview/tests/llagentaccess_test.cpp
@@ -84,19 +84,25 @@ namespace tut
 		LLAgentAccess aa(cgr);
 		
 		cgr.setU32("PreferredMaturity", SIM_ACCESS_PG);
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("1 prefersPG",     aa.prefersPG());
 		ensure("1 prefersMature", !aa.prefersMature());
 		ensure("1 prefersAdult",  !aa.prefersAdult());
+#endif // HACKED_GODLIKE_VIEWER
 		
 		cgr.setU32("PreferredMaturity", SIM_ACCESS_MATURE);
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("2 prefersPG",     !aa.prefersPG());
 		ensure("2 prefersMature", aa.prefersMature());
 		ensure("2 prefersAdult",  !aa.prefersAdult());
+#endif // HACKED_GODLIKE_VIEWER
 		
 		cgr.setU32("PreferredMaturity", SIM_ACCESS_ADULT);
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("3 prefersPG",     !aa.prefersPG());
 		ensure("3 prefersMature", aa.prefersMature());
 		ensure("3 prefersAdult",  aa.prefersAdult());
+#endif // HACKED_GODLIKE_VIEWER
     }
     
 	template<> template<>
@@ -107,33 +113,43 @@ namespace tut
 		LLAgentAccess aa(cgr);
 		
 		// make sure default is PG
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("1 isTeen",     aa.isTeen());
 		ensure("1 isMature",   !aa.isMature());
 		ensure("1 isAdult",    !aa.isAdult());
+#endif // HACKED_GODLIKE_VIEWER
 		
 		// check the conversion routine
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure_equals("1 conversion", SIM_ACCESS_PG, aa.convertTextToMaturity('P'));
 		ensure_equals("2 conversion", SIM_ACCESS_MATURE, aa.convertTextToMaturity('M'));
 		ensure_equals("3 conversion", SIM_ACCESS_ADULT, aa.convertTextToMaturity('A'));
 		ensure_equals("4 conversion", SIM_ACCESS_MIN, aa.convertTextToMaturity('Q'));
+#endif // HACKED_GODLIKE_VIEWER
 		
 		// now try the other method of setting it - PG
 		aa.setMaturity('P');
 		ensure("2 isTeen",     aa.isTeen());
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("2 isMature",   !aa.isMature());
 		ensure("2 isAdult",    !aa.isAdult());
+#endif // HACKED_GODLIKE_VIEWER
 		
 		// Mature
 		aa.setMaturity('M');
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("3 isTeen",     !aa.isTeen());
 		ensure("3 isMature",   aa.isMature());
 		ensure("3 isAdult",    !aa.isAdult());
+#endif // HACKED_GODLIKE_VIEWER
 		
 		// Adult
 		aa.setMaturity('A');
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("4 isTeen",     !aa.isTeen());
 		ensure("4 isMature",   aa.isMature());
 		ensure("4 isAdult",    aa.isAdult());
+#endif // HACKED_GODLIKE_VIEWER
 		
 	}
 
@@ -144,21 +160,35 @@ namespace tut
 		cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", FALSE);
 		LLAgentAccess aa(cgr);
 		
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("starts normal", !aa.isGodlike());
+#endif // HACKED_GODLIKE_VIEWER
 		aa.setGodLevel(GOD_NOT);
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("stays normal", !aa.isGodlike());
+#endif // HACKED_GODLIKE_VIEWER
 		aa.setGodLevel(GOD_FULL);
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("sets full", aa.isGodlike());
+#endif // HACKED_GODLIKE_VIEWER
 		aa.setGodLevel(GOD_NOT);
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("resets normal", !aa.isGodlike());
+#endif // HACKED_GODLIKE_VIEWER
 		aa.setAdminOverride(true);
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("admin true", aa.getAdminOverride());
 		ensure("overrides 1", aa.isGodlike());
+#endif // HACKED_GODLIKE_VIEWER
 		aa.setGodLevel(GOD_FULL);
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("overrides 2", aa.isGodlike());
+#endif // HACKED_GODLIKE_VIEWER
 		aa.setAdminOverride(false);
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("admin false", !aa.getAdminOverride());
 		ensure("overrides 3", aa.isGodlike());
+#endif // HACKED_GODLIKE_VIEWER
     }
     
 	template<> template<>
@@ -168,55 +198,73 @@ namespace tut
 		cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", FALSE);
 		LLAgentAccess aa(cgr);
 		
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("1 pg to start", aa.wantsPGOnly());
 		ensure("2 pg to start", !aa.canAccessMature());
 		ensure("3 pg to start", !aa.canAccessAdult());
+#endif // HACKED_GODLIKE_VIEWER
 		
 		aa.setGodLevel(GOD_FULL);
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("1 full god", !aa.wantsPGOnly());
 		ensure("2 full god", aa.canAccessMature());
 		ensure("3 full god", aa.canAccessAdult());
+#endif // HACKED_GODLIKE_VIEWER
 				
 		aa.setGodLevel(GOD_NOT);
 		aa.setAdminOverride(true);
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("1 admin mode", !aa.wantsPGOnly());
 		ensure("2 admin mode", aa.canAccessMature());
 		ensure("3 admin mode", aa.canAccessAdult());
+#endif // HACKED_GODLIKE_VIEWER
 
 		aa.setAdminOverride(false);
 		aa.setMaturity('M');
 		// preferred is still pg by default
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("1 mature pref pg", aa.wantsPGOnly());
 		ensure("2 mature pref pg", !aa.canAccessMature());
 		ensure("3 mature pref pg", !aa.canAccessAdult());
+#endif // HACKED_GODLIKE_VIEWER
 		
 		cgr.setU32("PreferredMaturity", SIM_ACCESS_MATURE);
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("1 mature", !aa.wantsPGOnly());
 		ensure("2 mature", aa.canAccessMature());
 		ensure("3 mature", !aa.canAccessAdult());
+#endif // HACKED_GODLIKE_VIEWER
 		
 		cgr.setU32("PreferredMaturity", SIM_ACCESS_PG);
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("1 mature pref pg", aa.wantsPGOnly());
 		ensure("2 mature pref pg", !aa.canAccessMature());
 		ensure("3 mature pref pg", !aa.canAccessAdult());
+#endif // HACKED_GODLIKE_VIEWER
 		
 		aa.setMaturity('A');
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("1 adult pref pg", aa.wantsPGOnly());
 		ensure("2 adult pref pg", !aa.canAccessMature());
 		ensure("3 adult pref pg", !aa.canAccessAdult());
+#endif // HACKED_GODLIKE_VIEWER
 
 		cgr.setU32("PreferredMaturity", SIM_ACCESS_ADULT);
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("1 adult", !aa.wantsPGOnly());
 		ensure("2 adult", aa.canAccessMature());
 		ensure("3 adult", aa.canAccessAdult());
+#endif // HACKED_GODLIKE_VIEWER
 
 		// make sure that even if pref is high, if access is low we block access
 		// this shouldn't occur in real life but we want to be safe
 		cgr.setU32("PreferredMaturity", SIM_ACCESS_ADULT);
 		aa.setMaturity('P');
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("1 pref adult, actual pg", aa.wantsPGOnly());
 		ensure("2 pref adult, actual pg", !aa.canAccessMature());
 		ensure("3 pref adult, actual pg", !aa.canAccessAdult());
+#endif // HACKED_GODLIKE_VIEWER
 		
 	}
 
@@ -229,10 +277,14 @@ namespace tut
 		
 		cgr.setU32("PreferredMaturity", SIM_ACCESS_ADULT);
 		aa.setMaturity('M');
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("1 preferred maturity pegged to M when maturity is M", cgr.getU32("PreferredMaturity") == SIM_ACCESS_MATURE);
+#endif // HACKED_GODLIKE_VIEWER
 		
 		aa.setMaturity('P');
+#ifndef HACKED_GODLIKE_VIEWER
 		ensure("1 preferred maturity pegged to P when maturity is P", cgr.getU32("PreferredMaturity") == SIM_ACCESS_PG);
+#endif // HACKED_GODLIKE_VIEWER
 	}
 }
 
diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp
index 9e321db889941a0054cf133c03c2ba66ac8e582a..b7e81c4199826d463f34ed5311b6323d91f0495b 100644
--- a/indra/newview/tests/lllogininstance_test.cpp
+++ b/indra/newview/tests/lllogininstance_test.cpp
@@ -114,8 +114,9 @@ LLGridManager::~LLGridManager()
 {
 }
 
-void LLGridManager::addGrid(LLSD& grid_data)
+bool LLGridManager::addGrid(LLSD& grid_data)
 {
+	return true;
 }
 LLGridManager::LLGridManager()
 :
@@ -136,7 +137,7 @@ void LLGridManager::addSystemGrid(const std::string& label,
 								  const std::string& login_id)
 {
 }
-std::map<std::string, std::string> LLGridManager::getKnownGrids(bool favorite_only)
+std::map<std::string, std::string> LLGridManager::getKnownGrids()
 {
 	std::map<std::string, std::string> result;
 	return result;
@@ -151,8 +152,6 @@ bool LLGridManager::isInProductionGrid()
 	return false;
 }
 
-void LLGridManager::saveFavorites()
-{}
 std::string LLGridManager::getSLURLBase(const std::string& grid_name)
 {
 	return "myslurl";
diff --git a/indra/newview/tests/llslurl_test.cpp b/indra/newview/tests/llslurl_test.cpp
index f96f79006a12aa0948d39f2ce9eb1e85192219fd..09343ef227b209efdc0ecc8ce7522dddc7dcd5f4 100644
--- a/indra/newview/tests/llslurl_test.cpp
+++ b/indra/newview/tests/llslurl_test.cpp
@@ -1,4 +1,4 @@
-/** 
+/**
  * @file llsecapi_test.cpp
  * @author Roxie
  * @date 2009-02-10
@@ -7,21 +7,21 @@
  * $LicenseInfo:firstyear=2009&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$
  */
@@ -31,8 +31,8 @@
 #include "../llslurl.h"
 #include "../../llxml/llcontrol.h"
 #include "llsdserialize.h"
-//----------------------------------------------------------------------------               
-// Mock objects for the dependencies of the code we're testing                               
+//----------------------------------------------------------------------------
+// Mock objects for the dependencies of the code we're testing
 
 LLControlGroup::LLControlGroup(const std::string& name)
 : LLInstanceTracker<LLControlGroup, std::string>(name) {}
@@ -80,6 +80,39 @@ LLPointer<LLControlVariable> LLControlGroup::getControl(const std::string& name)
 }
 
 LLControlGroup gSavedSettings("test");
+const char *gSampleGridFile =
+	"<?xml version=\"1.0\"?>"
+	"<llsd>"
+	"  <map>"
+	"    <key>foo.bar.com</key>"
+	"    <map>"
+	"      <key>helper_uri</key><string>https://foobar/helpers/</string>"
+	"      <key>label</key><string>Foobar Grid</string>"
+	"      <key>login_page</key><string>foobar/loginpage</string>"
+	"      <key>login_uri</key>"
+	"      <array>"
+	"        <string>foobar/loginuri</string>"
+	"      </array>"
+	"      <key>keyname</key><string>foo.bar.com</string>"
+	"      <key>credential_type</key><string>agent</string>"
+	"      <key>grid_login_id</key><string>FooBar</string>"
+	"    </map>"
+	"    <key>my.grid.com</key>"
+	"    <map>"
+	"      <key>helper_uri</key><string>https://mygrid/helpers/</string>"
+	"      <key>label</key><string>My Grid</string>"
+	"      <key>login_page</key><string>mygrid/loginpage</string>"
+	"      <key>login_uri</key>"
+	"      <array>"
+	"        <string>mygrid/loginuri</string>"
+	"      </array>"
+	"      <key>keyname</key><string>my.grid.com</string>"
+	"      <key>credential_type</key><string>agent</string>"
+	"      <key>grid_login_id</key><string>MyGrid</string>"
+	"    </map>"
+	"  </map>"
+	"</llsd>"
+	;
 
 // -------------------------------------------------------------------------------------------
 // TUT
@@ -90,171 +123,189 @@ namespace tut
 	struct slurlTest
 	{
 		slurlTest()
-		{	
+		{
 			LLGridManager::getInstance()->initialize(std::string(""));
 		}
 		~slurlTest()
 		{
 		}
 	};
-	
+
 	// Tut templating thingamagic: test group, object and test instance
 	typedef test_group<slurlTest> slurlTestFactory;
 	typedef slurlTestFactory::object slurlTestObject;
 	tut::slurlTestFactory tut_test("LLSlurl");
-	
+
 	// ---------------------------------------------------------------------------------------
-	// Test functions 
+	// Test functions
 	// ---------------------------------------------------------------------------------------
 	// construction from slurl string
 	template<> template<>
 	void slurlTestObject::test<1>()
 	{
+		llofstream gridfile("grid_test.xml");
+		gridfile << gSampleGridFile;
+		gridfile.close();
+
+		LLGridManager::getInstance()->initialize("grid_test.xml");
+
 		LLGridManager::getInstance()->setGridChoice("util.agni.lindenlab.com");
-		
+
 		LLSLURL slurl = LLSLURL("");
 		ensure_equals("null slurl", (int)slurl.getType(), LLSLURL::LAST_LOCATION);
-		
+
 		slurl = LLSLURL("http://slurl.com/secondlife/myregion");
 		ensure_equals("slurl.com slurl, region only - type", slurl.getType(), LLSLURL::LOCATION);
-		ensure_equals("slurl.com slurl, region only", slurl.getSLURLString(), 
+		ensure_equals("slurl.com slurl, region only", slurl.getSLURLString(),
 					  "http://maps.secondlife.com/secondlife/myregion/128/128/0");
-		
+
 		slurl = LLSLURL("http://maps.secondlife.com/secondlife/myregion/1/2/3");
 		ensure_equals("maps.secondlife.com slurl, region + coords - type", slurl.getType(), LLSLURL::LOCATION);
-		ensure_equals("maps.secondlife.com slurl, region + coords", slurl.getSLURLString(), 
+		ensure_equals("maps.secondlife.com slurl, region + coords", slurl.getSLURLString(),
 					  "http://maps.secondlife.com/secondlife/myregion/1/2/3");
 
 		slurl = LLSLURL("secondlife://myregion");
 		ensure_equals("secondlife: slurl, region only - type", slurl.getType(), LLSLURL::LOCATION);
-		ensure_equals("secondlife: slurl, region only", slurl.getSLURLString(), 
+		ensure_equals("secondlife: slurl, region only", slurl.getSLURLString(),
 					  "http://maps.secondlife.com/secondlife/myregion/128/128/0");
-		
+
 		slurl = LLSLURL("secondlife://myregion/1/2/3");
 		ensure_equals("secondlife: slurl, region + coords - type", slurl.getType(), LLSLURL::LOCATION);
-		ensure_equals("secondlife slurl, region + coords", slurl.getSLURLString(), 
+		ensure_equals("secondlife slurl, region + coords", slurl.getSLURLString(),
 					  "http://maps.secondlife.com/secondlife/myregion/1/2/3");
-		
+
 		slurl = LLSLURL("/myregion");
 		ensure_equals("/region slurl, region- type", slurl.getType(), LLSLURL::LOCATION);
-		ensure_equals("/region slurl, region ", slurl.getSLURLString(), 
+		ensure_equals("/region slurl, region ", slurl.getSLURLString(),
 					  "http://maps.secondlife.com/secondlife/myregion/128/128/0");
-		
+
 		slurl = LLSLURL("/myregion/1/2/3");
 		ensure_equals("/: slurl, region + coords - type", slurl.getType(), LLSLURL::LOCATION);
-		ensure_equals("/ slurl, region + coords", slurl.getSLURLString(), 
-					  "http://maps.secondlife.com/secondlife/myregion/1/2/3");	
-		
+		ensure_equals("/ slurl, region + coords", slurl.getSLURLString(),
+					  "http://maps.secondlife.com/secondlife/myregion/1/2/3");
+
 		slurl = LLSLURL("my region/1/2/3");
 		ensure_equals(" slurl, region + coords - type", slurl.getType(), LLSLURL::LOCATION);
-		ensure_equals(" slurl, region + coords", slurl.getSLURLString(), 
-					  "http://maps.secondlife.com/secondlife/my%20region/1/2/3");	
-		
-		LLGridManager::getInstance()->setGridChoice("my.grid.com");		
+		ensure_equals(" slurl, region + coords", slurl.getSLURLString(),
+					  "http://maps.secondlife.com/secondlife/my%20region/1/2/3");
+
+		LLGridManager::getInstance()->setGridChoice("my.grid.com");
 		slurl = LLSLURL("https://my.grid.com/region/my%20region/1/2/3");
 		ensure_equals("grid slurl, region + coords - type", slurl.getType(), LLSLURL::LOCATION);
-		ensure_equals("grid slurl, region + coords", slurl.getSLURLString(), 
-					  "https://my.grid.com/region/my%20region/1/2/3");	
-		
+		ensure_equals("grid slurl, region + coords", slurl.getSLURLString(),
+					  "https://my.grid.com/region/my%20region/1/2/3");
+
 		slurl = LLSLURL("https://my.grid.com/region/my region");
 		ensure_equals("grid slurl, region + coords - type", slurl.getType(), LLSLURL::LOCATION);
-		ensure_equals("grid slurl, region + coords", slurl.getSLURLString(), 
+		ensure_equals("grid slurl, region + coords", slurl.getSLURLString(),
 					  "https://my.grid.com/region/my%20region/128/128/0");
-		
-		LLGridManager::getInstance()->setGridChoice("foo.bar.com");		
+
+		LLGridManager::getInstance()->setGridChoice("foo.bar.com");
 		slurl = LLSLURL("/myregion/1/2/3");
 		ensure_equals("/: slurl, region + coords - type", slurl.getType(), LLSLURL::LOCATION);
-		ensure_equals("/ slurl, region + coords", slurl.getSLURLString(), 
-					  "https://foo.bar.com/region/myregion/1/2/3");		
-		
+		ensure_equals("/ slurl, region + coords", slurl.getSLURLString(),
+					  "https://foo.bar.com/region/myregion/1/2/3");
+
 		slurl = LLSLURL("myregion/1/2/3");
 		ensure_equals(": slurl, region + coords - type", slurl.getType(), LLSLURL::LOCATION);
-		ensure_equals(" slurl, region + coords", slurl.getSLURLString(), 
-					  "https://foo.bar.com/region/myregion/1/2/3");		
-		
+		ensure_equals(" slurl, region + coords", slurl.getSLURLString(),
+					  "https://foo.bar.com/region/myregion/1/2/3");
+
 		slurl = LLSLURL(LLSLURL::SIM_LOCATION_HOME);
 		ensure_equals("home", slurl.getType(), LLSLURL::HOME_LOCATION);
 
 		slurl = LLSLURL(LLSLURL::SIM_LOCATION_LAST);
 		ensure_equals("last", slurl.getType(), LLSLURL::LAST_LOCATION);
-		
+
 		slurl = LLSLURL("secondlife:///app/foo/bar?12345");
-		ensure_equals("app", slurl.getType(), LLSLURL::APP);		
+		ensure_equals("app", slurl.getType(), LLSLURL::APP);
 		ensure_equals("appcmd", slurl.getAppCmd(), "foo");
 		ensure_equals("apppath", slurl.getAppPath().size(), 1);
 		ensure_equals("apppath2", slurl.getAppPath()[0].asString(), "bar");
 		ensure_equals("appquery", slurl.getAppQuery(), "12345");
-		ensure_equals("grid1", "foo.bar.com", slurl.getGrid());
-	
+		ensure_equals("grid1", slurl.getGrid(), "FooBar");
+
 		slurl = LLSLURL("secondlife://Aditi/app/foo/bar?12345");
-		ensure_equals("app", slurl.getType(), LLSLURL::APP);		
+		ensure_equals("app", slurl.getType(), LLSLURL::APP);
 		ensure_equals("appcmd", slurl.getAppCmd(), "foo");
 		ensure_equals("apppath", slurl.getAppPath().size(), 1);
 		ensure_equals("apppath2", slurl.getAppPath()[0].asString(), "bar");
 		ensure_equals("appquery", slurl.getAppQuery(), "12345");
-		ensure_equals("grid2", "util.aditi.lindenlab.com", slurl.getGrid());		
+		ensure_equals("grid2",  slurl.getGrid(), "Aditi");
 
-		LLGridManager::getInstance()->setGridChoice("foo.bar.com");			
+		LLGridManager::getInstance()->setGridChoice("foo.bar.com");
 		slurl = LLSLURL("secondlife:///secondlife/myregion/1/2/3");
 		ensure_equals("/: slurl, region + coords - type", slurl.getType(), LLSLURL::LOCATION);
 		ensure_equals("location", slurl.getType(), LLSLURL::LOCATION);
 		ensure_equals("region" , "myregion", slurl.getRegion());
-		ensure_equals("grid3", "util.agni.lindenlab.com", slurl.getGrid());
-				
+		ensure_equals("grid3", slurl.getGrid(), "util.agni.lindenlab.com");
+
 		slurl = LLSLURL("secondlife://Aditi/secondlife/myregion/1/2/3");
 		ensure_equals("/: slurl, region + coords - type", slurl.getType(), LLSLURL::LOCATION);
 		ensure_equals("location", slurl.getType(), LLSLURL::LOCATION);
 		ensure_equals("region" , "myregion", slurl.getRegion());
-		ensure_equals("grid4", "util.aditi.lindenlab.com", slurl.getGrid());		
-		
+		ensure_equals("grid4", slurl.getGrid(), "Aditi" );
+
 		LLGridManager::getInstance()->setGridChoice("my.grid.com");
 		slurl = LLSLURL("https://my.grid.com/app/foo/bar?12345");
-		ensure_equals("app", slurl.getType(), LLSLURL::APP);		
+		ensure_equals("app", slurl.getType(), LLSLURL::APP);
 		ensure_equals("appcmd", slurl.getAppCmd(), "foo");
 		ensure_equals("apppath", slurl.getAppPath().size(), 1);
 		ensure_equals("apppath2", slurl.getAppPath()[0].asString(), "bar");
-		ensure_equals("appquery", slurl.getAppQuery(), "12345");	
-		
+		ensure_equals("appquery", slurl.getAppQuery(), "12345");
+
 	}
-	
+
 	// construction from grid/region/vector combos
 	template<> template<>
 	void slurlTestObject::test<2>()
 	{
-		LLSLURL slurl = LLSLURL("mygrid.com", "my region");
+		llofstream gridfile("grid_test.xml");
+		gridfile << gSampleGridFile;
+		gridfile.close();
+
+		LLGridManager::getInstance()->initialize("grid_test.xml");
+
+		LLSLURL slurl = LLSLURL("my.grid.com", "my region");
 		ensure_equals("grid/region - type", slurl.getType(), LLSLURL::LOCATION);
-		ensure_equals("grid/region", slurl.getSLURLString(), 
-					  "https://mygrid.com/region/my%20region/128/128/0");	
-		
-		slurl = LLSLURL("mygrid.com", "my region", LLVector3(1,2,3));
+		ensure_equals("grid/region", slurl.getSLURLString(),
+					  "https://my.grid.com/region/my%20region/128/128/0");
+
+		slurl = LLSLURL("my.grid.com", "my region", LLVector3(1,2,3));
 		ensure_equals("grid/region/vector - type", slurl.getType(), LLSLURL::LOCATION);
-		ensure_equals(" grid/region/vector", slurl.getSLURLString(), 
-					  "https://mygrid.com/region/my%20region/1/2/3");			
+		ensure_equals(" grid/region/vector", slurl.getSLURLString(),
+					  "https://my.grid.com/region/my%20region/1/2/3");
 
-		LLGridManager::getInstance()->setGridChoice("foo.bar.com.bar");			
+		LLGridManager::getInstance()->setGridChoice("util.agni.lindenlab.com");
 		slurl = LLSLURL("my region", LLVector3(1,2,3));
-		ensure_equals("grid/region/vector - type", slurl.getType(), LLSLURL::LOCATION);
-		ensure_equals(" grid/region/vector", slurl.getSLURLString(), 
-					  "https://foo.bar.com.bar/region/my%20region/1/2/3");	
-		
-		LLGridManager::getInstance()->setGridChoice("util.agni.lindenlab.com");	
+		ensure_equals("default grid/region/vector - type", slurl.getType(), LLSLURL::LOCATION);
+		ensure_equals(" default grid/region/vector", slurl.getSLURLString(),
+					  "http://maps.secondlife.com/secondlife/my%20region/1/2/3");
+
+		LLGridManager::getInstance()->setGridChoice("MyGrid");
 		slurl = LLSLURL("my region", LLVector3(1,2,3));
 		ensure_equals("default grid/region/vector - type", slurl.getType(), LLSLURL::LOCATION);
-		ensure_equals(" default grid/region/vector", slurl.getSLURLString(), 
-					  "http://maps.secondlife.com/secondlife/my%20region/1/2/3");	
-		
+		ensure_equals(" default grid/region/vector", slurl.getSLURLString(),
+					  "https://my.grid.com/region/my%20region/1/2/3");
+
 	}
 	// Accessors
 	template<> template<>
 	void slurlTestObject::test<3>()
 	{
-		LLGridManager::getInstance()->setGridChoice("my.grid.com");		
+		llofstream gridfile("grid_test.xml");
+		gridfile << gSampleGridFile;
+		gridfile.close();
+
+		LLGridManager::getInstance()->initialize("grid_test.xml");
+
+		LLGridManager::getInstance()->setGridChoice("my.grid.com");
 		LLSLURL slurl = LLSLURL("https://my.grid.com/region/my%20region/1/2/3");
 		ensure_equals("login string", slurl.getLoginString(), "uri:my region&amp;1&amp;2&amp;3");
 		ensure_equals("location string", slurl.getLocationString(), "my region/1/2/3");
 		ensure_equals("grid", slurl.getGrid(), "my.grid.com");
 		ensure_equals("region", slurl.getRegion(), "my region");
 		ensure_equals("position", slurl.getPosition(), LLVector3(1, 2, 3));
-		
+
 	}
 }
diff --git a/indra/newview/tests/llviewernetwork_test.cpp b/indra/newview/tests/llviewernetwork_test.cpp
index 3c89b64d5218376b3b810f56508e0cf4738eed5c..a1e97ea17eac6641eb0788d97b0fa1a1aac1e595 100644
--- a/indra/newview/tests/llviewernetwork_test.cpp
+++ b/indra/newview/tests/llviewernetwork_test.cpp
@@ -1,4 +1,4 @@
-/** 
+/**
  * @file llviewernetwork_test.cpp
  * @author Roxie
  * @date 2009-03-9
@@ -7,21 +7,21 @@
  * $LicenseInfo:firstyear=2009&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$
  */
@@ -31,8 +31,8 @@
 #include "../../llxml/llcontrol.h"
 #include "llfile.h"
 
-//----------------------------------------------------------------------------               
-// Mock objects for the dependencies of the code we're testing                               
+//----------------------------------------------------------------------------
+// Mock objects for the dependencies of the code we're testing
 
 LLControlGroup::LLControlGroup(const std::string& name)
 : LLInstanceTracker<LLControlGroup, std::string>(name) {}
@@ -81,26 +81,57 @@ LLPointer<LLControlVariable> LLControlGroup::getControl(const std::string& name)
 
 LLControlGroup gSavedSettings("test");
 
-const char *gSampleGridFile = "<llsd><map>"
-"<key>grid1</key><map>"
-"  <key>favorite</key><integer>1</integer>"
-"  <key>helper_uri</key><string>https://helper1/helpers/</string>"
-"  <key>label</key><string>mylabel</string>"
-"  <key>login_page</key><string>loginpage</string>"
-"  <key>login_uri</key><array><string>myloginuri</string></array>"
-"  <key>name</key><string>grid1</string>"
-"  <key>visible</key><integer>1</integer>"
-"  <key>credential_type</key><string>agent</string>"
-"  <key>grid_login_id</key><string>MyGrid</string>"
-"</map>"
-"<key>util.agni.lindenlab.com</key><map>"
-"  <key>favorite</key><integer>1</integer>"
-"  <key>helper_uri</key><string>https://helper1/helpers/</string>"
-"  <key>label</key><string>mylabel</string>"
-"  <key>login_page</key><string>loginpage</string>"
-"  <key>login_uri</key><array><string>myloginuri</string></array>"
-"  <key>name</key><string>util.agni.lindenlab.com</string>"
-"</map></map></llsd>";
+const char *gSampleGridFile =
+	"<?xml version=\"1.0\"?>"
+	"<llsd>"
+	"  <map>"
+	"    <key>altgrid.long.name</key>"
+	"    <map>"
+	"      <key>helper_uri</key><string>https://helper1/helpers/</string>"
+	"      <key>label</key><string>Alternative Grid</string>"
+	"      <key>login_page</key><string>altgrid/loginpage</string>"
+	"      <key>login_uri</key>"
+	"      <array>"
+	"        <string>altgrid/myloginuri1</string>"
+	"        <string>altgrid/myloginuri2</string>"
+	"      </array>"
+	"      <key>keyname</key><string>altgrid.long.name</string>"
+	"      <key>credential_type</key><string>agent</string>"
+	"      <key>grid_login_id</key><string>AltGrid</string>"
+	"    </map>"
+	"    <key>minimal.long.name</key>"
+	"    <map>"
+	"      <key>keyname</key><string>minimal.long.name</string>"
+	"    </map>"
+	"    <!-- Note that the values for agni and aditi below are deliberately"
+	"         incorrect to test that they are not overwritten -->"
+	"    <key>util.agni.lindenlab.com</key> <!-- conflict -->"
+	"    <map>"
+	"      <key>helper_uri</key><string>https://helper1/helpers/</string>"
+	"      <key>grid_login_id</key><string>mylabel</string>"
+	"      <key>label</key><string>mylabel</string>"
+	"      <key>login_page</key><string>loginpage</string>"
+	"      <key>login_uri</key>"
+	"      <array>"
+	"        <string>myloginuri</string>"
+	"      </array>"
+	"      <key>keyname</key><string>util.agni.lindenlab.com</string> <!-- conflict -->"
+	"    </map>"
+	"    <key>util.foobar.lindenlab.com</key>"
+	"    <map>"
+	"      <key>helper_uri</key><string>https://helper1/helpers/</string>"
+	"      <key>grid_login_id</key><string>Aditi</string> <!-- conflict -->"
+	"      <key>label</key><string>mylabel</string>"
+	"      <key>login_page</key><string>loginpage</string>"
+	"      <key>login_uri</key>"
+	"      <array>"
+	"        <string>myloginuri</string>"
+	"      </array>"
+	"      <key>keyname</key><string>util.foobar.lindenlab.com</string>"
+	"    </map>"
+	"  </map>"
+	"</llsd>"
+	;
 // -------------------------------------------------------------------------------------------
 // TUT
 // -------------------------------------------------------------------------------------------
@@ -116,63 +147,89 @@ namespace tut
 			gCmdLineGridChoice.clear();
 			gCmdLineHelperURI.clear();
 			gLoginPage.clear();
-			gCurrentGrid.clear();			
+			gCurrentGrid.clear();
 		}
 		~viewerNetworkTest()
 		{
 			LLFile::remove("grid_test.xml");
 		}
 	};
-	
+
 	// Tut templating thingamagic: test group, object and test instance
 	typedef test_group<viewerNetworkTest> viewerNetworkTestFactory;
 	typedef viewerNetworkTestFactory::object viewerNetworkTestObject;
 	tut::viewerNetworkTestFactory tut_test("LLViewerNetwork");
-	
+
 	// ---------------------------------------------------------------------------------------
-	// Test functions 
+	// Test functions
 	// ---------------------------------------------------------------------------------------
 	// initialization without a grid file
 	template<> template<>
 	void viewerNetworkTestObject::test<1>()
 	{
-
 		LLGridManager *manager = LLGridManager::getInstance();
 		// grid file doesn't exist
 		manager->initialize("grid_test.xml");
 		// validate that some of the defaults are available.
 		std::map<std::string, std::string> known_grids = manager->getKnownGrids();
-		ensure_equals("Known grids is a string-string map of size 23", known_grids.size(), 23);
-		ensure_equals("Agni has the right name and label", 
-					  known_grids[std::string("util.agni.lindenlab.com")], std::string("Agni"));
-		ensure_equals("None exists", known_grids[""], "None");
-		
-		LLSD grid;
-		LLGridManager::getInstance()->getGridInfo("util.agni.lindenlab.com", grid);
-		ensure("Grid info for agni is a map", grid.isMap());
-		ensure_equals("name is correct for agni", 
-					  grid[GRID_VALUE].asString(), std::string("util.agni.lindenlab.com"));
-		ensure_equals("label is correct for agni", 
-					  grid[GRID_LABEL_VALUE].asString(), std::string("Agni"));
-		ensure("Login URI is an array", 
-			   grid[GRID_LOGIN_URI_VALUE].isArray());
-		ensure_equals("Agni login uri is correct", 
-					  grid[GRID_LOGIN_URI_VALUE][0].asString(), 
+		ensure_equals("Known grids is a string-string map of size 2", known_grids.size(), 2);
+		ensure_equals("Agni has the right name and label",
+					  known_grids[std::string("util.agni.lindenlab.com")],
+					  std::string("Second Life Main Grid (Agni)"));
+		ensure_equals("Aditi has the right name and label",
+					  known_grids[std::string("util.aditi.lindenlab.com")],
+					  std::string("Second Life Beta Test Grid (Aditi)"));
+		ensure_equals("name for agni",
+					  LLGridManager::getInstance()->getGrid("util.agni.lindenlab.com"),
+					  std::string("util.agni.lindenlab.com"));
+		ensure_equals("id for agni",
+					  std::string("Agni"),
+					  LLGridManager::getInstance()->getGridId("util.agni.lindenlab.com"));
+		ensure_equals("label for agni",
+					  LLGridManager::getInstance()->getGridLabel("util.agni.lindenlab.com"),
+					  std::string("Second Life Main Grid (Agni)"));
+
+		std::vector<std::string> login_uris;
+		LLGridManager::getInstance()->getLoginURIs(std::string("util.agni.lindenlab.com"), login_uris);
+		ensure_equals("Number of login uris for agni", 1, login_uris.size());
+		ensure_equals("Agni login uri",
+					  login_uris[0],
 					  std::string("https://login.agni.lindenlab.com/cgi-bin/login.cgi"));
-		ensure_equals("Agni helper uri is correct",
-					  grid[GRID_HELPER_URI_VALUE].asString(), 
+		ensure_equals("Agni helper uri",
+					  LLGridManager::getInstance()->getHelperURI("util.agni.lindenlab.com"),
 					  std::string("https://secondlife.com/helpers/"));
-		ensure_equals("Agni login page is correct",
-					  grid[GRID_LOGIN_PAGE_VALUE].asString(), 
+		ensure_equals("Agni login page",
+					  LLGridManager::getInstance()->getLoginPage("util.agni.lindenlab.com"),
 					  std::string("http://viewer-login.agni.lindenlab.com/"));
-		ensure("Agni is a favorite",
-			   grid.has(GRID_IS_FAVORITE_VALUE));
-		ensure("Agni is a system grid", 
-			   grid.has(GRID_IS_SYSTEM_GRID_VALUE));
-		ensure("Grid file wasn't greated as it wasn't saved", 
-			   !LLFile::isfile("grid_test.xml"));
+		ensure("Agni is a system grid",
+			   LLGridManager::getInstance()->isSystemGrid("util.agni.lindenlab.com"));
+
+		ensure_equals("name for aditi",
+					  LLGridManager::getInstance()->getGrid("util.aditi.lindenlab.com"),
+					  std::string("util.aditi.lindenlab.com"));
+		ensure_equals("id for aditi",
+					  LLGridManager::getInstance()->getGridId("util.aditi.lindenlab.com"),
+					  std::string("Aditi"));
+		ensure_equals("label for aditi",
+					  LLGridManager::getInstance()->getGridLabel("util.aditi.lindenlab.com"),
+					  std::string("Second Life Beta Test Grid (Aditi)"));
+
+		LLGridManager::getInstance()->getLoginURIs(std::string("util.aditi.lindenlab.com"), login_uris);
+
+		ensure_equals("Number of login uris for aditi", 1, login_uris.size());
+		ensure_equals("Aditi login uri",
+					  login_uris[0],
+					  std::string("https://login.aditi.lindenlab.com/cgi-bin/login.cgi"));
+		ensure_equals("Aditi helper uri",
+					  LLGridManager::getInstance()->getHelperURI("util.aditi.lindenlab.com"),
+					  std::string("http://aditi-secondlife.webdev.lindenlab.com/helpers/"));
+		ensure_equals("Aditi login page",
+					  LLGridManager::getInstance()->getLoginPage("util.aditi.lindenlab.com"),
+					  std::string("http://viewer-login.agni.lindenlab.com/"));
+		ensure("Aditi is a system grid",
+			   LLGridManager::getInstance()->isSystemGrid("util.aditi.lindenlab.com"));
 	}
-	
+
 	// initialization with a grid file
 	template<> template<>
 	void viewerNetworkTestObject::test<2>()
@@ -180,402 +237,172 @@ namespace tut
 		llofstream gridfile("grid_test.xml");
 		gridfile << gSampleGridFile;
 		gridfile.close();
-		
+
 		LLGridManager::getInstance()->initialize("grid_test.xml");
 		std::map<std::string, std::string> known_grids = LLGridManager::getInstance()->getKnownGrids();
-		ensure_equals("adding a grid via a grid file increases known grid size", 
-					  known_grids.size(), 24);
-		ensure_equals("Agni is still there after we've added a grid via a grid file", 
-					  known_grids["util.agni.lindenlab.com"], std::string("Agni"));
-	
-		
-		// assure Agni doesn't get overwritten
-		LLSD grid;
-		LLGridManager::getInstance()->getGridInfo("util.agni.lindenlab.com", grid);
+		ensure_equals("adding a grid via a grid file increases known grid size",4, 
+					  known_grids.size());
 
-		ensure_equals("Agni grid label was not modified by grid file", 
-					  grid[GRID_LABEL_VALUE].asString(), std::string("Agni"));
-		
-		ensure_equals("Agni name wasn't modified by grid file",
-					  grid[GRID_VALUE].asString(), std::string("util.agni.lindenlab.com"));
-		ensure("Agni grid URI is still an array after grid file", 
-			   grid[GRID_LOGIN_URI_VALUE].isArray());
-		ensure_equals("Agni login uri still the same after grid file", 
-					  grid[GRID_LOGIN_URI_VALUE][0].asString(),  
+		// Verify that Agni and Aditi were not overwritten
+		ensure_equals("Agni has the right name and label",
+					  known_grids[std::string("util.agni.lindenlab.com")], 
+					  std::string("Second Life Main Grid (Agni)"));
+		ensure_equals("Aditi has the right name and label",
+					  known_grids[std::string("util.aditi.lindenlab.com")], 
+					  std::string("Second Life Beta Test Grid (Aditi)"));
+		ensure_equals("name for agni",
+					  LLGridManager::getInstance()->getGrid("util.agni.lindenlab.com"),
+					  std::string("util.agni.lindenlab.com"));
+		ensure_equals("id for agni",
+					  LLGridManager::getInstance()->getGridId("util.agni.lindenlab.com"),
+					  std::string("Agni"));
+		ensure_equals("label for agni",
+					  LLGridManager::getInstance()->getGridLabel("util.agni.lindenlab.com"),
+					  std::string("Second Life Main Grid (Agni)"));
+		std::vector<std::string> login_uris;
+		LLGridManager::getInstance()->getLoginURIs(std::string("util.agni.lindenlab.com"), login_uris);
+		ensure_equals("Number of login uris for agni", 1, login_uris.size());
+		ensure_equals("Agni login uri",
+					  login_uris[0],
 					  std::string("https://login.agni.lindenlab.com/cgi-bin/login.cgi"));
-		ensure_equals("Agni helper uri still the same after grid file", 
-					  grid[GRID_HELPER_URI_VALUE].asString(), 
+		ensure_equals("Agni helper uri",
+					  LLGridManager::getInstance()->getHelperURI("util.agni.lindenlab.com"),
 					  std::string("https://secondlife.com/helpers/"));
-		ensure_equals("Agni login page the same after grid file", 
-					  grid[GRID_LOGIN_PAGE_VALUE].asString(), 
+		ensure_equals("Agni login page",
+					  LLGridManager::getInstance()->getLoginPage("util.agni.lindenlab.com"),
 					  std::string("http://viewer-login.agni.lindenlab.com/"));
-		ensure("Agni still a favorite after grid file", 
-			   grid.has(GRID_IS_FAVORITE_VALUE));
-		ensure("Agni system grid still set after grid file", 
-			   grid.has(GRID_IS_SYSTEM_GRID_VALUE));
-		
-		ensure_equals("Grid file adds to name<->label map", 
-					  known_grids["grid1"], std::string("mylabel"));
-		LLGridManager::getInstance()->getGridInfo("grid1", grid);
-		ensure_equals("grid file grid name is set",
-					  grid[GRID_VALUE].asString(), std::string("grid1"));
-		ensure_equals("grid file label is set", 
-					  grid[GRID_LABEL_VALUE].asString(), std::string("mylabel"));
-		ensure("grid file login uri is an array",
-			   grid[GRID_LOGIN_URI_VALUE].isArray());
-		ensure_equals("grid file login uri is set",
-					  grid[GRID_LOGIN_URI_VALUE][0].asString(), 
-					  std::string("myloginuri"));
-		ensure_equals("grid file helper uri is set",
-					  grid[GRID_HELPER_URI_VALUE].asString(), 
-					  std::string("https://helper1/helpers/"));
-		ensure_equals("grid file login page is set",
-					  grid[GRID_LOGIN_PAGE_VALUE].asString(), 
-					  std::string("loginpage"));
-		ensure("grid file favorite is set",
-			   grid.has(GRID_IS_FAVORITE_VALUE));
-		ensure("grid file isn't a system grid",
-			   !grid.has(GRID_IS_SYSTEM_GRID_VALUE));		
-		ensure("Grid file still exists after loading", 
-			   LLFile::isfile("grid_test.xml"));
-	}
-	
-	// Initialize via command line
-	
-	template<> template<>
-	void viewerNetworkTestObject::test<3>()
-	{	
-		// USE --grid command line
-		// initialize with a known grid
-		LLSD grid;
-		gCmdLineGridChoice = "Aditi";
-		LLGridManager::getInstance()->initialize("grid_test.xml");
-		// with single login uri specified.
-		std::map<std::string, std::string> known_grids = LLGridManager::getInstance()->getKnownGrids();
-		ensure_equals("Using a known grid via command line doesn't increase number of known grids", 
-					  known_grids.size(), 23);
-		ensure_equals("getGridLabel", LLGridManager::getInstance()->getGridLabel(), std::string("Aditi"));
-		// initialize with a known grid in lowercase
-		gCmdLineGridChoice = "agni";
-		LLGridManager::getInstance()->initialize("grid_test.xml");
-		ensure_equals("getGridLabel", LLGridManager::getInstance()->getGridLabel(), std::string("Agni"));		
-		
-		// now try a command line with a custom grid identifier
-		gCmdLineGridChoice = "mycustomgridchoice";		
-		LLGridManager::getInstance()->initialize("grid_test.xml");
-		known_grids = LLGridManager::getInstance()->getKnownGrids();
-		ensure_equals("adding a command line grid with custom name increases known grid size", 
-					  known_grids.size(), 24);
-		ensure_equals("Custom Command line grid is added to the list of grids", 
-					  known_grids["mycustomgridchoice"], std::string("mycustomgridchoice"));
-		LLGridManager::getInstance()->getGridInfo("mycustomgridchoice", grid);
-		ensure_equals("Custom Command line grid name is set",
-					  grid[GRID_VALUE].asString(), std::string("mycustomgridchoice"));
-		ensure_equals("Custom Command line grid label is set", 
-					  grid[GRID_LABEL_VALUE].asString(), std::string("mycustomgridchoice"));		
-		ensure("Custom Command line grid login uri is an array",
-			   grid[GRID_LOGIN_URI_VALUE].isArray());
-		ensure_equals("Custom Command line grid login uri is set",
-					  grid[GRID_LOGIN_URI_VALUE][0].asString(), 
-					  std::string("https://mycustomgridchoice/cgi-bin/login.cgi"));
-		ensure_equals("Custom Command line grid helper uri is set",
-					  grid[GRID_HELPER_URI_VALUE].asString(), 
-					  std::string("https://mycustomgridchoice/helpers/"));
-		ensure_equals("Custom Command line grid login page is set",
-					  grid[GRID_LOGIN_PAGE_VALUE].asString(), 
-					  std::string("http://mycustomgridchoice/app/login/"));
-	}
-	
-	// validate override of login uri with cmd line
-	template<> template<>
-	void viewerNetworkTestObject::test<4>()
-	{			
-		// Override with loginuri
-		// override known grid
-		LLSD grid;
-		gCmdLineGridChoice = "Aditi";
-		gCmdLineLoginURI = "https://my.login.uri/cgi-bin/login.cgi";		
-		LLGridManager::getInstance()->initialize("grid_test.xml");		
-		std::map<std::string, std::string> known_grids = LLGridManager::getInstance()->getKnownGrids();		
-		ensure_equals("Override known grid login uri: No grids are added", 
-					  known_grids.size(), 23);
-		LLGridManager::getInstance()->getGridInfo(grid);
-		ensure("Override known grid login uri: login uri is an array",
-			   grid[GRID_LOGIN_URI_VALUE].isArray());
-		ensure_equals("Override known grid login uri: Command line grid login uri is set",
-					  grid[GRID_LOGIN_URI_VALUE][0].asString(), 
-					  std::string("https://my.login.uri/cgi-bin/login.cgi"));
-		ensure_equals("Override known grid login uri: helper uri is not changed",
-					  grid[GRID_HELPER_URI_VALUE].asString(), 
-					  std::string("http://aditi-secondlife.webdev.lindenlab.com/helpers/"));
-		ensure_equals("Override known grid login uri: login page is not set",
-					  grid[GRID_LOGIN_PAGE_VALUE].asString(), 
-					  std::string("http://viewer-login.agni.lindenlab.com/"));		
-		
-		// Override with loginuri
-		// override custom grid
-		gCmdLineGridChoice = "mycustomgridchoice";
-		gCmdLineLoginURI = "https://my.login.uri/cgi-bin/login.cgi";		
-		LLGridManager::getInstance()->initialize("grid_test.xml");		
-		known_grids = LLGridManager::getInstance()->getKnownGrids();
-		LLGridManager::getInstance()->getGridInfo(grid);
-		ensure_equals("Override custom grid login uri: Grid is added", 
-					  known_grids.size(), 24);		
-		ensure("Override custom grid login uri: login uri is an array",
-			   grid[GRID_LOGIN_URI_VALUE].isArray());
-		ensure_equals("Override custom grid login uri: login uri is set",
-					  grid[GRID_LOGIN_URI_VALUE][0].asString(), 
-					  std::string("https://my.login.uri/cgi-bin/login.cgi"));
-		ensure_equals("Override custom grid login uri: Helper uri is not set",
-					  grid[GRID_HELPER_URI_VALUE].asString(), 
-					  std::string("https://mycustomgridchoice/helpers/"));
-		ensure_equals("Override custom grid login uri: Login page is not set",
-					  grid[GRID_LOGIN_PAGE_VALUE].asString(), 
-					  std::string("http://mycustomgridchoice/app/login/"));
-	}
-	
-	// validate override of helper uri with cmd line
-	template<> template<>
-	void viewerNetworkTestObject::test<5>()
-	{	
-		// Override with helperuri
-		// override known grid
-		LLSD grid;
-		gCmdLineGridChoice = "Aditi";
-		gCmdLineLoginURI = "";
-		gCmdLineHelperURI = "https://my.helper.uri/mycustomhelpers";		
-		LLGridManager::getInstance()->initialize("grid_test.xml");		
-		std::map<std::string, std::string> known_grids = LLGridManager::getInstance()->getKnownGrids();		
-		ensure_equals("Override known grid helper uri: No grids are added", 
-					  known_grids.size(), 23);
-		LLGridManager::getInstance()->getGridInfo(grid);
-		ensure("Override known known helper uri: login uri is an array",
-			   grid[GRID_LOGIN_URI_VALUE].isArray());
-		ensure_equals("Override known grid helper uri: login uri is not changed",
-					  grid[GRID_LOGIN_URI_VALUE][0].asString(), 
-					  std::string("https://login.aditi.lindenlab.com/cgi-bin/login.cgi"));
-		ensure_equals("Override known grid helper uri: helper uri is changed",
-					  grid[GRID_HELPER_URI_VALUE].asString(), 
-					  std::string("https://my.helper.uri/mycustomhelpers"));
-		ensure_equals("Override known grid helper uri: login page is not changed",
-					  grid[GRID_LOGIN_PAGE_VALUE].asString(), 
-					  std::string("http://viewer-login.agni.lindenlab.com/"));		
-		
-		// Override with helperuri
-		// override custom grid
-		gCmdLineGridChoice = "mycustomgridchoice";
-		gCmdLineHelperURI = "https://my.helper.uri/mycustomhelpers";		
-		LLGridManager::getInstance()->initialize("grid_test.xml");	
-		known_grids = LLGridManager::getInstance()->getKnownGrids();
-		ensure_equals("Override custom grid helper uri: grids is added", 
-					  known_grids.size(), 24);
-		LLGridManager::getInstance()->getGridInfo(grid);
-		ensure("Override custom helper uri: login uri is an array",
-			   grid[GRID_LOGIN_URI_VALUE].isArray());
-		ensure_equals("Override custom grid helper uri: login uri is not changed",
-					  grid[GRID_LOGIN_URI_VALUE][0].asString(), 
-					  std::string("https://mycustomgridchoice/cgi-bin/login.cgi"));
-		ensure_equals("Override custom grid helper uri: helper uri is changed",
-					  grid[GRID_HELPER_URI_VALUE].asString(), 
-					  std::string("https://my.helper.uri/mycustomhelpers"));
-		ensure_equals("Override custom grid helper uri: login page is not changed",
-					  grid[GRID_LOGIN_PAGE_VALUE].asString(), 
-					  std::string("http://mycustomgridchoice/app/login/"));
-	}
-	
-	// validate overriding of login page via cmd line
-	template<> template<>
-	void viewerNetworkTestObject::test<6>()
-	{	
-		// Override with login page
-		// override known grid
-		LLSD grid;
-		gCmdLineGridChoice = "Aditi";
-		gCmdLineHelperURI = "";
-		gLoginPage = "myloginpage";		
-		LLGridManager::getInstance()->initialize("grid_test.xml");		
-		std::map<std::string, std::string> known_grids = LLGridManager::getInstance()->getKnownGrids();				
-		ensure_equals("Override known grid login page: No grids are added", 
-					  known_grids.size(), 23);
-		LLGridManager::getInstance()->getGridInfo(grid);
-		ensure("Override known grid login page: Command line grid login uri is an array",
-			   grid[GRID_LOGIN_URI_VALUE].isArray());
-		ensure_equals("Override known grid login page: login uri is not changed",
-					  grid[GRID_LOGIN_URI_VALUE][0].asString(), 
+		ensure("Agni is a system grid",
+			   LLGridManager::getInstance()->isSystemGrid("util.agni.lindenlab.com"));
+
+		ensure_equals("name for aditi",
+					  LLGridManager::getInstance()->getGrid("util.aditi.lindenlab.com"),
+					  std::string("util.aditi.lindenlab.com"));
+		ensure_equals("id for aditi",
+					  LLGridManager::getInstance()->getGridId("util.aditi.lindenlab.com"),
+					  std::string("Aditi"));
+		ensure_equals("label for aditi",
+					  LLGridManager::getInstance()->getGridLabel("util.aditi.lindenlab.com"),
+					  std::string("Second Life Beta Test Grid (Aditi)"));
+
+		LLGridManager::getInstance()->getLoginURIs(std::string("util.aditi.lindenlab.com"), login_uris);
+		ensure_equals("Number of login uris for aditi", 1, login_uris.size());
+		ensure_equals("Aditi login uri",
+					  login_uris[0],
 					  std::string("https://login.aditi.lindenlab.com/cgi-bin/login.cgi"));
-		ensure_equals("Override known grid login page: helper uri is not changed",
-					  grid[GRID_HELPER_URI_VALUE].asString(), 
+		ensure_equals("Aditi helper uri",
+					  LLGridManager::getInstance()->getHelperURI("util.aditi.lindenlab.com"),
 					  std::string("http://aditi-secondlife.webdev.lindenlab.com/helpers/"));
-		ensure_equals("Override known grid login page: login page is changed",
-					  grid[GRID_LOGIN_PAGE_VALUE].asString(), 
-					  std::string("myloginpage"));		
-		
-		// Override with login page
-		// override custom grid
-		gCmdLineGridChoice = "mycustomgridchoice";
-		gLoginPage = "myloginpage";
-		LLGridManager::getInstance()->initialize("grid_test.xml");		
-		known_grids = LLGridManager::getInstance()->getKnownGrids();
-		ensure_equals("Override custom grid login page: grids are added", 
-					  known_grids.size(), 24);
-		LLGridManager::getInstance()->getGridInfo(grid);
-		ensure("Override custom grid login page: Command line grid login uri is an array",
-			   grid[GRID_LOGIN_URI_VALUE].isArray());
-		ensure_equals("Override custom grid login page: login uri is not changed",
-					  grid[GRID_LOGIN_URI_VALUE][0].asString(), 
-					  std::string("https://mycustomgridchoice/cgi-bin/login.cgi"));
-		ensure_equals("Override custom grid login page: helper uri is not changed",
-					  grid[GRID_HELPER_URI_VALUE].asString(), 
-					  std::string("https://mycustomgridchoice/helpers/"));
-		ensure_equals("Override custom grid login page: login page is changed",
-					  grid[GRID_LOGIN_PAGE_VALUE].asString(), 
-					  std::string("myloginpage"));	
-		
+		ensure_equals("Aditi login page",
+					  LLGridManager::getInstance()->getLoginPage("util.aditi.lindenlab.com"),
+					  std::string("http://viewer-login.agni.lindenlab.com/"));
+		ensure("Aditi is a system grid",
+			   LLGridManager::getInstance()->isSystemGrid("util.aditi.lindenlab.com"));
+
+		// Check the additional grid from the file
+		ensure_equals("alternative grid is in name<->label map",
+					  known_grids["altgrid.long.name"], 
+					  std::string("Alternative Grid"));
+		ensure_equals("alternative grid name is set",
+					  LLGridManager::getInstance()->getGrid("altgrid.long.name"),
+					  std::string("altgrid.long.name"));
+		ensure_equals("alternative grid id",
+					  LLGridManager::getInstance()->getGridId("altgrid.long.name"),
+					  std::string("AltGrid"));
+		ensure_equals("alternative grid label",
+					  LLGridManager::getInstance()->getGridLabel("altgrid.long.name"),
+					  std::string("Alternative Grid"));
+		std::vector<std::string> alt_login_uris;
+		LLGridManager::getInstance()->getLoginURIs(std::string("altgrid.long.name"), alt_login_uris);
+		ensure_equals("Number of login uris for altgrid", 2, alt_login_uris.size());
+		ensure_equals("alternative grid first login uri",
+					  alt_login_uris[0],
+					  std::string("altgrid/myloginuri1"));
+		ensure_equals("alternative grid second login uri",
+					  alt_login_uris[1],
+					  std::string("altgrid/myloginuri2"));
+		ensure_equals("alternative grid helper uri",
+					  LLGridManager::getInstance()->getHelperURI("altgrid.long.name"),
+					  std::string("https://helper1/helpers/"));
+		ensure_equals("alternative grid login page",
+					  LLGridManager::getInstance()->getLoginPage("altgrid.long.name"),
+					  std::string("altgrid/loginpage"));
+		ensure("alternative grid is NOT a system grid",
+			   ! LLGridManager::getInstance()->isSystemGrid("altgrid.long.name"));
+
+		ensure_equals("minimal grid is in name<->label map",
+					  known_grids["minimal.long.name"], 
+					  std::string("minimal.long.name"));
+		ensure_equals("minimal grid name is set",
+					  LLGridManager::getInstance()->getGrid("minimal.long.name"),
+					  std::string("minimal.long.name"));
+		ensure_equals("minimal grid id",
+					  LLGridManager::getInstance()->getGridId("minimal.long.name"),
+					  std::string("minimal.long.name"));
+		ensure_equals("minimal grid label",
+					  LLGridManager::getInstance()->getGridLabel("minimal.long.name"),
+					  std::string("minimal.long.name"));
+
+		LLGridManager::getInstance()->getLoginURIs(std::string("minimal.long.name"), alt_login_uris);
+		ensure_equals("Number of login uris for altgrid", 1, alt_login_uris.size());
+		ensure_equals("minimal grid login uri",
+					  alt_login_uris[0],
+					  std::string("https://minimal.long.name/cgi-bin/login.cgi"));
+		ensure_equals("minimal grid helper uri",
+					  LLGridManager::getInstance()->getHelperURI("minimal.long.name"),
+					  std::string("https://minimal.long.name/helpers/"));
+		ensure_equals("minimal grid login page",
+					  LLGridManager::getInstance()->getLoginPage("minimal.long.name"),
+					  std::string("http://minimal.long.name/app/login/"));
+
 	}
-	
+
+
 	// validate grid selection
 	template<> template<>
 	void viewerNetworkTestObject::test<7>()
-	{	
-		LLSD loginURI = LLSD::emptyArray();
-		LLSD grid = LLSD::emptyMap();
+	{
 		// adding a grid with simply a name will populate the values.
-		grid[GRID_VALUE] = "myaddedgrid";
+		llofstream gridfile("grid_test.xml");
+		gridfile << gSampleGridFile;
+		gridfile.close();
 
 		LLGridManager::getInstance()->initialize("grid_test.xml");
-		LLGridManager::getInstance()->addGrid(grid);
-		LLGridManager::getInstance()->setGridChoice("util.agni.lindenlab.com");	
-		ensure_equals("getGridLabel", LLGridManager::getInstance()->getGridLabel(), std::string("Agni"));
-		ensure_equals("getGrid", LLGridManager::getInstance()->getGrid(), 
+
+		LLGridManager::getInstance()->setGridChoice("util.agni.lindenlab.com");
+		ensure_equals("getGridLabel",
+					  LLGridManager::getInstance()->getGridLabel(),
+					  std::string("Second Life Main Grid (Agni)"));
+		ensure_equals("getGridId",
+					  LLGridManager::getInstance()->getGridId(),
+					  std::string("Agni"));
+		ensure_equals("getGrid",
+					  LLGridManager::getInstance()->getGrid(),
 					  std::string("util.agni.lindenlab.com"));
-		ensure_equals("getHelperURI", LLGridManager::getInstance()->getHelperURI(), 
+		ensure_equals("getHelperURI",
+					  LLGridManager::getInstance()->getHelperURI(),
 					  std::string("https://secondlife.com/helpers/"));
-		ensure_equals("getLoginPage", LLGridManager::getInstance()->getLoginPage(), 
+		ensure_equals("getLoginPage",
+					  LLGridManager::getInstance()->getLoginPage(),
 					  std::string("http://viewer-login.agni.lindenlab.com/"));
-		ensure_equals("getLoginPage2", LLGridManager::getInstance()->getLoginPage("util.agni.lindenlab.com"), 
-					  std::string("http://viewer-login.agni.lindenlab.com/"));
-		ensure("Is Agni a production grid", LLGridManager::getInstance()->isInProductionGrid());		
+		ensure("Is Agni a production grid", LLGridManager::getInstance()->isInProductionGrid());
 		std::vector<std::string> uris;
 		LLGridManager::getInstance()->getLoginURIs(uris);
-		ensure_equals("getLoginURIs size", uris.size(), 1);
-		ensure_equals("getLoginURIs", uris[0], 
+		ensure_equals("getLoginURIs size", 1, uris.size());
+		ensure_equals("getLoginURIs",
+					  uris[0],
 					  std::string("https://login.agni.lindenlab.com/cgi-bin/login.cgi"));
-		LLGridManager::getInstance()->setGridChoice("myaddedgrid");
-		ensure_equals("getGridLabel", LLGridManager::getInstance()->getGridLabel(), std::string("myaddedgrid"));		
-		ensure("Is myaddedgrid a production grid", !LLGridManager::getInstance()->isInProductionGrid());
-		
-		LLGridManager::getInstance()->setFavorite();
-		LLGridManager::getInstance()->getGridInfo("myaddedgrid", grid);
-		ensure("setting favorite", grid.has(GRID_IS_FAVORITE_VALUE));
-	}
-	
-	// name based grid population
-	template<> template<>
-	void viewerNetworkTestObject::test<8>()
-	{
-		LLGridManager::getInstance()->initialize("grid_test.xml");
-		LLSD grid = LLSD::emptyMap();
-		// adding a grid with simply a name will populate the values.
-		grid[GRID_VALUE] = "myaddedgrid";
-		LLGridManager::getInstance()->addGrid(grid);
-		LLGridManager::getInstance()->getGridInfo("myaddedgrid", grid);
-		
-		ensure_equals("name based grid has name value", 
-					  grid[GRID_VALUE].asString(),
-					  std::string("myaddedgrid"));
-		ensure_equals("name based grid has label value", 
-					  grid[GRID_LABEL_VALUE].asString(),
-					  std::string("myaddedgrid"));
-		ensure_equals("name based grid has name value", 
-					  grid[GRID_HELPER_URI_VALUE].asString(),
-					  std::string("https://myaddedgrid/helpers/"));
-		ensure_equals("name based grid has name value", 
-					  grid[GRID_LOGIN_PAGE_VALUE].asString(),
-					  std::string("http://myaddedgrid/app/login/"));
-		ensure("name based grid has array loginuri", 
-			   grid[GRID_LOGIN_URI_VALUE].isArray());
-		ensure_equals("name based grid has single login uri value",
-			   grid[GRID_LOGIN_URI_VALUE].size(), 1);
-		ensure_equals("Name based grid login uri is correct",
-					  grid[GRID_LOGIN_URI_VALUE][0].asString(),
-					  std::string("https://myaddedgrid/cgi-bin/login.cgi"));
-		ensure("name based grid is not a favorite yet", 
-			   !grid.has(GRID_IS_FAVORITE_VALUE));
-		ensure("name based grid does not have system setting",
-			   !grid.has(GRID_IS_SYSTEM_GRID_VALUE));
-		
-		llofstream gridfile("grid_test.xml");
-		gridfile << gSampleGridFile;
-		gridfile.close();
-	}
-	
-	// persistence of the grid list with an empty gridfile.
-	template<> template<>
-	void viewerNetworkTestObject::test<9>()
-	{
-		// try with initial grid list without a grid file,
-		// without setting the grid to a saveable favorite.
-		LLGridManager::getInstance()->initialize("grid_test.xml");
-		LLSD grid = LLSD::emptyMap();
-		grid[GRID_VALUE] = std::string("mynewgridname");
-		LLGridManager::getInstance()->addGrid(grid);
-		LLGridManager::getInstance()->saveFavorites();
-		ensure("Grid file exists after saving", 
-			   LLFile::isfile("grid_test.xml"));
-		LLGridManager::getInstance()->initialize("grid_test.xml");
-		// should not be there
-		std::map<std::string, std::string> known_grids = LLGridManager::getInstance()->getKnownGrids();
-		ensure("New grid wasn't added to persisted list without being marked a favorite",
-					  known_grids.find(std::string("mynewgridname")) == known_grids.end());
-		
-		// mark a grid a favorite to make sure it's persisted
-		LLGridManager::getInstance()->addGrid(grid);
-		LLGridManager::getInstance()->setGridChoice("mynewgridname");
-		LLGridManager::getInstance()->setFavorite();
-		LLGridManager::getInstance()->saveFavorites();
-		ensure("Grid file exists after saving", 
-			   LLFile::isfile("grid_test.xml"));
-		LLGridManager::getInstance()->initialize("grid_test.xml");
-		// should not be there
-		known_grids = LLGridManager::getInstance()->getKnownGrids();
-		ensure("New grid wasn't added to persisted list after being marked a favorite",
-					  known_grids.find(std::string("mynewgridname")) !=
-					  known_grids.end());
-	}
-	
-	// persistence of the grid file with existing gridfile
-	template<> template<>
-	void viewerNetworkTestObject::test<10>()
-	{
-		
-		llofstream gridfile("grid_test.xml");
-		gridfile << gSampleGridFile;
-		gridfile.close();
-		
-		LLGridManager::getInstance()->initialize("grid_test.xml");
-		LLSD grid = LLSD::emptyMap();
-		grid[GRID_VALUE] = std::string("mynewgridname");
-		LLGridManager::getInstance()->addGrid(grid);
-		LLGridManager::getInstance()->saveFavorites();
-		// validate we didn't lose existing favorites
-		LLGridManager::getInstance()->initialize("grid_test.xml");
-		std::map<std::string, std::string> known_grids = LLGridManager::getInstance()->getKnownGrids();
-		ensure("New grid wasn't added to persisted list after being marked a favorite",
-			   known_grids.find(std::string("grid1")) !=
-			   known_grids.end());
-		
-		// add a grid
-		LLGridManager::getInstance()->addGrid(grid);
-		LLGridManager::getInstance()->setGridChoice("mynewgridname");
-		LLGridManager::getInstance()->setFavorite();
-		LLGridManager::getInstance()->saveFavorites();
-		known_grids = LLGridManager::getInstance()->getKnownGrids();
-		ensure("New grid wasn't added to persisted list after being marked a favorite",
-			   known_grids.find(std::string("grid1")) !=
-			   known_grids.end());
-		known_grids = LLGridManager::getInstance()->getKnownGrids();
-		ensure("New grid wasn't added to persisted list after being marked a favorite",
-			   known_grids.find(std::string("mynewgridname")) !=
-			   known_grids.end());
+
+		LLGridManager::getInstance()->setGridChoice("altgrid.long.name");
+		ensure_equals("getGridLabel",
+					  LLGridManager::getInstance()->getGridLabel(),
+					  std::string("Alternative Grid"));
+		ensure_equals("getGridId",
+					  LLGridManager::getInstance()->getGridId(),
+					  std::string("AltGrid"));
+		ensure("alternative grid is not a system grid",
+			   !LLGridManager::getInstance()->isSystemGrid());
+		ensure("alternative grid is not a production grid",
+			   !LLGridManager::getInstance()->isInProductionGrid());
 	}
+
 }
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 7c6b5403e1df44391369b6ebd40a95e2c477abc7..d1c952ac3bd275fdc410bffe2996327e46a4f902 100644
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -1062,6 +1062,7 @@ def construct(self):
             self.path("libalut.so")
             self.path("libopenal.so", "libopenal.so.1")
             self.path("libopenal.so", "libvivoxoal.so.1") # vivox's sdk expects this soname
+
             # KLUDGE: As of 2012-04-11, the 'fontconfig' package installs
             # libfontconfig.so.1.4.4, along with symlinks libfontconfig.so.1
             # and libfontconfig.so. Before we added support for library-file
diff --git a/indra/test/test.cpp b/indra/test/test.cpp
index 9d24383bcc754b4e7f74f5fc6be7e4c76e25671e..dc8580fe697a632d9a691bb670db266a8928ddfd 100644
--- a/indra/test/test.cpp
+++ b/indra/test/test.cpp
@@ -181,13 +181,16 @@ class LLTestCallback : public tut::callback
 	virtual void run_started()
 	{
 		//std::cout << "run_started" << std::endl;
+		LL_INFOS("TestRunner")<<"Test Started"<< LL_ENDL;
 	}
 
 	virtual void group_started(const std::string& name) {
+		LL_INFOS("TestRunner")<<"Unit test group_started name=" << name << LL_ENDL;
 		*mStream << "Unit test group_started name=" << name << std::endl;
 	}
 
 	virtual void group_completed(const std::string& name) {
+		LL_INFOS("TestRunner")<<"Unit test group_completed name=" << name << LL_ENDL;
 		*mStream << "Unit test group_completed name=" << name << std::endl;
 	}
 
@@ -245,9 +248,11 @@ class LLTestCallback : public tut::callback
 			if(!tr.message.empty())
 			{
 				*mStream << ": '" << tr.message << "'";
+				LL_WARNS("TestRunner") << "not ok : "<<tr.message << LL_ENDL;
 			}
 			*mStream << std::endl;
 		}
+		LL_INFOS("TestRunner")<<out.str()<<LL_ENDL;
 	}
 
 	virtual int getFailedTests() const { return mFailedTests; }
@@ -451,6 +456,13 @@ void stream_usage(std::ostream& s, const char* app)
 	s << "\tList all available test groups." << std::endl;
 	s << "  " << app << " --group=uuid" << std::endl;
 	s << "\tRun the test group 'uuid'." << std::endl;
+
+	s << "\n\n"
+	  << "In any event, logs are recorded in the build directory by appending\n"
+	  << "the suffix '.log' to the full path name of this application.\n"
+	  << "If no level is specified as described above, these log files are at\n"
+	  << "DEBUG level.\n"
+		;
 }
 
 void stream_groups(std::ostream& s, const char* app)
@@ -477,17 +489,24 @@ int main(int argc, char **argv)
 #ifndef LL_WINDOWS
 	::testing::InitGoogleMock(&argc, argv);
 #endif
-	LLError::initForApplication(".");
-	LLError::setFatalFunction(wouldHaveCrashed);
-	LLError::setDefaultLevel(LLError::LEVEL_ERROR);
-	// ^ possibly overridden by --debug, LOGTEST or LOGFAIL
-
 	// LOGTEST overrides default, but can be overridden by --debug or LOGFAIL.
 	const char* LOGTEST = getenv("LOGTEST");
 	if (LOGTEST)
 	{
+		LLError::initForApplication(".", true /* log to stderr */);
 		LLError::setDefaultLevel(LLError::decodeLevel(LOGTEST));
 	}
+	else
+	{
+		LLError::initForApplication(".", false /* do not log to stderr */);
+		LLError::setDefaultLevel(LLError::LEVEL_DEBUG);
+	}	
+	LLError::setFatalFunction(wouldHaveCrashed);
+	LLError::setPrintLocation(true);
+	std::string test_app_name(argv[0]);
+	std::string test_log = test_app_name + ".log";
+	LLFile::remove(test_log);
+	LLError::logToFile(test_log);
 
 #ifdef CTYPE_WORKAROUND
 	ctype_workaround();