diff options
author | UbitUmarov | 2013-06-06 19:21:21 +0100 |
---|---|---|
committer | UbitUmarov | 2013-06-06 19:21:21 +0100 |
commit | c173c2eed52d20916bcafd2b1b6d4a1a24c46105 (patch) | |
tree | 9f4c780cf0eaadb413af7411d29719b39af5e6cc /OpenSim | |
parent | Merge branch 'avination-current' into ubitwork (diff) | |
download | opensim-SC_OLD-c173c2eed52d20916bcafd2b1b6d4a1a24c46105.zip opensim-SC_OLD-c173c2eed52d20916bcafd2b1b6d4a1a24c46105.tar.gz opensim-SC_OLD-c173c2eed52d20916bcafd2b1b6d4a1a24c46105.tar.bz2 opensim-SC_OLD-c173c2eed52d20916bcafd2b1b6d4a1a24c46105.tar.xz |
try to suspend and resume keyframes on copy to inventory to take copy
doesn't destroy state
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 4c11135..a606d76 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 | |||
359 | { | 359 | { |
360 | CoalescedSceneObjects coa = new CoalescedSceneObjects(UUID.Zero); | 360 | CoalescedSceneObjects coa = new CoalescedSceneObjects(UUID.Zero); |
361 | Dictionary<UUID, Vector3> originalPositions = new Dictionary<UUID, Vector3>(); | 361 | Dictionary<UUID, Vector3> originalPositions = new Dictionary<UUID, Vector3>(); |
362 | // this possible is not needed if keyframes are saved | ||
363 | Dictionary<UUID, KeyframeMotion> originalKeyframes = new Dictionary<UUID, KeyframeMotion>(); | ||
362 | 364 | ||
363 | foreach (SceneObjectGroup objectGroup in objlist) | 365 | foreach (SceneObjectGroup objectGroup in objlist) |
364 | { | 366 | { |
365 | if (objectGroup.RootPart.KeyframeMotion != null) | 367 | if (objectGroup.RootPart.KeyframeMotion != null) |
366 | objectGroup.RootPart.KeyframeMotion.Stop(); | 368 | { |
369 | objectGroup.RootPart.KeyframeMotion.Suspend(); | ||
370 | } | ||
367 | objectGroup.RootPart.SetForce(Vector3.Zero); | 371 | objectGroup.RootPart.SetForce(Vector3.Zero); |
368 | objectGroup.RootPart.SetAngularImpulse(Vector3.Zero, false); | 372 | objectGroup.RootPart.SetAngularImpulse(Vector3.Zero, false); |
373 | |||
374 | originalKeyframes[objectGroup.UUID] = objectGroup.RootPart.KeyframeMotion; | ||
369 | objectGroup.RootPart.KeyframeMotion = null; | 375 | objectGroup.RootPart.KeyframeMotion = null; |
370 | 376 | ||
371 | Vector3 inventoryStoredPosition = new Vector3 | 377 | Vector3 inventoryStoredPosition = new Vector3 |
@@ -425,7 +431,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
425 | 431 | ||
426 | // Restore the position of each group now that it has been stored to inventory. | 432 | // Restore the position of each group now that it has been stored to inventory. |
427 | foreach (SceneObjectGroup objectGroup in objlist) | 433 | foreach (SceneObjectGroup objectGroup in objlist) |
434 | { | ||
428 | objectGroup.AbsolutePosition = originalPositions[objectGroup.UUID]; | 435 | objectGroup.AbsolutePosition = originalPositions[objectGroup.UUID]; |
436 | objectGroup.RootPart.KeyframeMotion = originalKeyframes[objectGroup.UUID]; | ||
437 | if (objectGroup.RootPart.KeyframeMotion != null) | ||
438 | objectGroup.RootPart.KeyframeMotion.Resume(); | ||
439 | } | ||
429 | 440 | ||
430 | InventoryItemBase item = CreateItemForObject(action, remoteClient, objlist[0], folderID); | 441 | InventoryItemBase item = CreateItemForObject(action, remoteClient, objlist[0], folderID); |
431 | 442 | ||