summaryrefslogtreecommitdiff
path: root/indra/newview/llselectmgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r--[-rwxr-xr-x]indra/newview/llselectmgr.cpp62
1 files changed, 58 insertions, 4 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 4fafbf917b..323689b788 100755..100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -1210,7 +1210,7 @@ void LLSelectMgr::setGridMode(EGridMode mode)
updateSelectionCenter();
}
-void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 &scale)
+void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 &scale, bool for_snap_guides)
{
mGridObjects.cleanupNodes();
@@ -1235,7 +1235,15 @@ void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 &
}
else if (mGridMode == GRID_MODE_REF_OBJECT && first_grid_object && first_grid_object->mDrawable.notNull())
{
- mGridRotation = first_grid_object->getRenderRotation();
+ LLSelectNode *node = mSelectedObjects->findNode(first_grid_object);
+ if (!for_snap_guides && node)
+ {
+ mGridRotation = node->mSavedRotation;
+ }
+ else
+ {
+ mGridRotation = first_grid_object->getRenderRotation();
+ }
LLVector4a min_extents(F32_MAX);
LLVector4a max_extents(-F32_MAX);
@@ -1620,7 +1628,11 @@ void LLSelectMgr::selectionSetImage(const LLUUID& imageid)
f(LLViewerInventoryItem* item, const LLUUID& id) : mItem(item), mImageID(id) {}
bool apply(LLViewerObject* objectp, S32 te)
{
- if (mItem)
+ if(objectp && !objectp->permModify())
+ {
+ return false;
+ }
+ if (mItem)
{
if (te == -1) // all faces
{
@@ -4950,6 +4962,7 @@ void LLSelectMgr::sendListToRegions(const std::string& message_name,
ESendType send_type)
{
LLSelectNode* node;
+ LLSelectNode* linkset_root = NULL;
LLViewerRegion* last_region;
LLViewerRegion* current_region;
@@ -4957,6 +4970,8 @@ void LLSelectMgr::sendListToRegions(const std::string& message_name,
S32 packets_sent = 0;
S32 objects_in_this_packet = 0;
+ bool link_operation = message_name == "ObjectLink";
+
//clear update override data (allow next update through)
struct f : public LLSelectedNodeFunctor
{
@@ -5065,6 +5080,12 @@ void LLSelectMgr::sendListToRegions(const std::string& message_name,
&& (! gMessageSystem->isSendFull(NULL))
&& (objects_in_this_packet < MAX_OBJECTS_PER_PACKET))
{
+ if (link_operation && linkset_root == NULL)
+ {
+ // linksets over 254 will be split into multiple messages,
+ // but we need to provide same root for all messages or we will get separate linksets
+ linkset_root = node;
+ }
// add another instance of the body of the data
(*pack_body)(node, user_data);
// do any related logging
@@ -5093,6 +5114,22 @@ void LLSelectMgr::sendListToRegions(const std::string& message_name,
gMessageSystem->newMessage(message_name.c_str());
(*pack_header)(user_data);
+ if (linkset_root != NULL)
+ {
+ if (current_region != last_region)
+ {
+ // root should be in one region with the child, reset it
+ linkset_root = NULL;
+ }
+ else
+ {
+ // add root instance into new message
+ (*pack_body)(linkset_root, user_data);
+ ++objects_sent;
+ ++objects_in_this_packet;
+ }
+ }
+
// don't move to the next object, we still need to add the
// body data.
}
@@ -6709,7 +6746,8 @@ LLBBox LLSelectMgr::getBBoxOfSelection() const
//-----------------------------------------------------------------------------
BOOL LLSelectMgr::canUndo() const
{
- return const_cast<LLSelectMgr*>(this)->mSelectedObjects->getFirstEditableObject() != NULL; // HACK: casting away constness - MG
+ // Can edit or can move
+ return const_cast<LLSelectMgr*>(this)->mSelectedObjects->getFirstUndoEnabledObject() != NULL; // HACK: casting away constness - MG;
}
//-----------------------------------------------------------------------------
@@ -7635,6 +7673,22 @@ LLViewerObject* LLObjectSelection::getFirstMoveableObject(BOOL get_parent)
}
//-----------------------------------------------------------------------------
+// getFirstUndoEnabledObject()
+//-----------------------------------------------------------------------------
+LLViewerObject* LLObjectSelection::getFirstUndoEnabledObject(BOOL get_parent)
+{
+ struct f : public LLSelectedNodeFunctor
+ {
+ bool apply(LLSelectNode* node)
+ {
+ LLViewerObject* obj = node->getObject();
+ return obj && (obj->permModify() || (obj->permMove() && !obj->isPermanentEnforced()));
+ }
+ } func;
+ return getFirstSelectedObject(&func, get_parent);
+}
+
+//-----------------------------------------------------------------------------
// Position + Rotation update methods called from LLViewerJoystick
//-----------------------------------------------------------------------------
bool LLSelectMgr::selectionMove(const LLVector3& displ,