diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 4c111352c3..a606d76958 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -359,13 +359,19 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess { CoalescedSceneObjects coa = new CoalescedSceneObjects(UUID.Zero); Dictionary originalPositions = new Dictionary(); + // this possible is not needed if keyframes are saved + Dictionary originalKeyframes = new Dictionary(); foreach (SceneObjectGroup objectGroup in objlist) { if (objectGroup.RootPart.KeyframeMotion != null) - objectGroup.RootPart.KeyframeMotion.Stop(); + { + objectGroup.RootPart.KeyframeMotion.Suspend(); + } objectGroup.RootPart.SetForce(Vector3.Zero); objectGroup.RootPart.SetAngularImpulse(Vector3.Zero, false); + + originalKeyframes[objectGroup.UUID] = objectGroup.RootPart.KeyframeMotion; objectGroup.RootPart.KeyframeMotion = null; Vector3 inventoryStoredPosition = new Vector3 @@ -425,7 +431,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess // Restore the position of each group now that it has been stored to inventory. foreach (SceneObjectGroup objectGroup in objlist) + { objectGroup.AbsolutePosition = originalPositions[objectGroup.UUID]; + objectGroup.RootPart.KeyframeMotion = originalKeyframes[objectGroup.UUID]; + if (objectGroup.RootPart.KeyframeMotion != null) + objectGroup.RootPart.KeyframeMotion.Resume(); + } InventoryItemBase item = CreateItemForObject(action, remoteClient, objlist[0], folderID);