diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index ad8787a7e..fc68ebc42 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -55,11 +55,14 @@
SGAllowRiggedMeshSelection
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index b4b894858..b438b8fc5 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -3512,7 +3512,8 @@ public:
if (vobj->isAvatar())
{
LLVOAvatar* avatar = (LLVOAvatar*) vobj;
- if (gFloaterTools->getVisible() || LLFloaterInspect::findInstance())
+ bool allow_rigged_pick();
+ if (allow_rigged_pick())
{
LLViewerObject* hit = avatar->lineSegmentIntersectRiggedAttachments(mStart, mEnd, -1, mPickTransparent, mFaceHit, &intersection, mTexCoord, mNormal, mTangent);
if (hit)
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 836ddbed8..578f3a235 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -2339,7 +2339,7 @@ LLViewerObject* LLVOAvatar::lineSegmentIntersectRiggedAttachments(const LLVector
LLVector4a* normal,
LLVector4a* tangent)
{
- static const LLCachedControl allow_mesh_picking("SGAllowRiggedMeshSelection");
+ static const LLCachedControl allow_mesh_picking("SGAllowRiggedMeshSelection", 0);
if (!allow_mesh_picking || (isSelf() && !gAgent.needsRenderAvatar()))
{
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 76b1a2ca8..04f863e88 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -89,6 +89,8 @@
#include "llmaterialmgr.h"
#include "llsculptidsize.h"
+#include "llkeyboard.h" // For allow_rigged_pick()
+
// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.0d)
#include "rlvhandler.h"
#include "rlvlocks.h"
@@ -4283,6 +4285,11 @@ LLVector3 LLVOVolume::volumeDirectionToAgent(const LLVector3& dir) const
return ret;
}
+bool allow_rigged_pick()
+{
+ static const LLCachedControl allow_mesh_picking("SGAllowRiggedMeshSelection", 0);
+ return allow_mesh_picking && (gKeyboard->currentMask(true) == MASK_SHIFT || (allow_mesh_picking !=1 && (gFloaterTools->getVisible() || LLFloaterInspect::findInstance())));
+}
BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, S32 face, BOOL pick_transparent, S32 *face_hitp,
LLVector4a* intersection,LLVector2* tex_coord, LLVector4a* normal, LLVector4a* tangent)
@@ -4310,15 +4317,14 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a&
if (mDrawable->isState(LLDrawable::RIGGED))
{
- static const LLCachedControl allow_mesh_picking("SGAllowRiggedMeshSelection");
- if (allow_mesh_picking && (gFloaterTools->getVisible() || LLFloaterInspect::findInstance()))
+ if (allow_rigged_pick())
{
updateRiggedVolume(true);
volume = mRiggedVolume;
transform = false;
}
else
- { //cannot pick rigged attachments on other avatars or when not in build mode
+ {
return FALSE;
}
}