From 120f872d2b2f58560ab026f35a9f523e8540d2c6 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Mon, 25 Nov 2013 19:22:53 +0200 Subject: After an object with KeyframeMotion is copied into inventory, resume the motion (previously it remained stopped) --- .../Framework/InventoryAccess/InventoryAccessModule.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 781cc69..d30ce72 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -355,11 +355,17 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess CoalescedSceneObjects coa = new CoalescedSceneObjects(UUID.Zero); // Dictionary originalPositions = new Dictionary(); + Dictionary group2Keyframe = new Dictionary(); + foreach (SceneObjectGroup objectGroup in objlist) { if (objectGroup.RootPart.KeyframeMotion != null) - objectGroup.RootPart.KeyframeMotion.Stop(); - objectGroup.RootPart.KeyframeMotion = null; + { + objectGroup.RootPart.KeyframeMotion.Pause(); + group2Keyframe.Add(objectGroup, objectGroup.RootPart.KeyframeMotion); + objectGroup.RootPart.KeyframeMotion = null; + } + // Vector3 inventoryStoredPosition = new Vector3 // (((objectGroup.AbsolutePosition.X > (int)Constants.RegionSize) // ? 250 @@ -477,6 +483,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess } } + // Restore KeyframeMotion + foreach (SceneObjectGroup objectGroup in group2Keyframe.Keys) + { + objectGroup.RootPart.KeyframeMotion = group2Keyframe[objectGroup]; + objectGroup.RootPart.KeyframeMotion.Start(); + } + // This is a hook to do some per-asset post-processing for subclasses that need that if (remoteClient != null) ExportAsset(remoteClient.AgentId, asset.FullID); -- cgit v1.1