diff options
author | Melanie Thielker | 2010-07-14 21:06:49 +0200 |
---|---|---|
committer | Melanie Thielker | 2010-07-14 21:06:49 +0200 |
commit | ddfff55cc76144607086fbca03c86df57a271ed0 (patch) | |
tree | 6a0b10c9f4341b5be07fb3e99676acf747a2bcd5 /OpenSim/Region/CoreModules/Framework | |
parent | Detach attachments displaced by other attachments (diff) | |
download | opensim-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/Region/CoreModules/Framework')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 10 |
1 files changed, 10 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 | ||