aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie Thielker2010-07-14 21:06:49 +0200
committerMelanie Thielker2010-07-14 21:06:49 +0200
commitddfff55cc76144607086fbca03c86df57a271ed0 (patch)
tree6a0b10c9f4341b5be07fb3e99676acf747a2bcd5 /OpenSim
parentDetach attachments displaced by other attachments (diff)
downloadopensim-SC-ddfff55cc76144607086fbca03c86df57a271ed0.zip
opensim-SC-ddfff55cc76144607086fbca03c86df57a271ed0.tar.gz
opensim-SC-ddfff55cc76144607086fbca03c86df57a271ed0.tar.bz2
opensim-SC-ddfff55cc76144607086fbca03c86df57a271ed0.tar.xz
Preserve attachment data while a prim is in world. Allows attachment
editing on the ground without losing attachpoint and position
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs8
2 files changed, 18 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 1a7da61..1bf3a66 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -219,6 +219,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
219 219
220 Vector3 originalPosition = objectGroup.AbsolutePosition; 220 Vector3 originalPosition = objectGroup.AbsolutePosition;
221 221
222 // Restore attachment data after trip through the sim
223 if (objectGroup.RootPart.AttachPoint > 0)
224 inventoryStoredPosition = objectGroup.RootPart.AttachOffset;
225 objectGroup.RootPart.Shape.State = objectGroup.RootPart.AttachPoint;
226
222 objectGroup.AbsolutePosition = inventoryStoredPosition; 227 objectGroup.AbsolutePosition = inventoryStoredPosition;
223 228
224 string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup); 229 string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup);
@@ -516,6 +521,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
516 string xmlData = Utils.BytesToString(rezAsset.Data); 521 string xmlData = Utils.BytesToString(rezAsset.Data);
517 SceneObjectGroup group 522 SceneObjectGroup group
518 = SceneObjectSerializer.FromOriginalXmlFormat(itemId, xmlData); 523 = SceneObjectSerializer.FromOriginalXmlFormat(itemId, xmlData);
524 Vector3 storedPosition = group.AbsolutePosition;
519 525
520 group.RootPart.FromFolderID = item.Folder; 526 group.RootPart.FromFolderID = item.Folder;
521 527
@@ -635,6 +641,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
635 { 641 {
636 if (group.RootPart.Shape.PCode == (byte)PCode.Prim) 642 if (group.RootPart.Shape.PCode == (byte)PCode.Prim)
637 { 643 {
644 // Save attachment data
645 group.RootPart.AttachPoint = group.RootPart.Shape.State;
646 group.RootPart.AttachOffset = storedPosition;
647
638 group.ClearPartAttachmentData(); 648 group.ClearPartAttachmentData();
639 } 649 }
640 650
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index f8ae321..87b2d74 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -182,6 +182,14 @@ namespace OpenSim.Region.Framework.Scenes
182 [XmlIgnore] 182 [XmlIgnore]
183 public UUID FromFolderID; 183 public UUID FromFolderID;
184 184
185 // The following two are to hold the attachment data
186 // while an object is inworld
187 [XmlIgnore]
188 public byte AttachPoint = 0;
189
190 [XmlIgnore]
191 public Vector3 AttachOffset = Vector3.Zero;
192
185 [XmlIgnore] 193 [XmlIgnore]
186 public int STATUS_ROTATE_X; 194 public int STATUS_ROTATE_X;
187 195