aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2017-07-16 05:19:27 +0100
committerUbitUmarov2017-07-16 05:19:27 +0100
commit9ae26fc5afc96c793186b79e80ac8f1a8a040d5b (patch)
tree450546e149c8620d422728056f5f0faf820c9c6a
parentode does not like null refs (diff)
downloadopensim-SC_OLD-9ae26fc5afc96c793186b79e80ac8f1a8a040d5b.zip
opensim-SC_OLD-9ae26fc5afc96c793186b79e80ac8f1a8a040d5b.tar.gz
opensim-SC_OLD-9ae26fc5afc96c793186b79e80ac8f1a8a040d5b.tar.bz2
opensim-SC_OLD-9ae26fc5afc96c793186b79e80ac8f1a8a040d5b.tar.xz
store kfm on inventory. this may still be a bit confusing on rez
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/KeyframeMotion.cs11
-rwxr-xr-xOpenSim/Region/Framework/Scenes/Scene.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs23
5 files changed, 42 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 3f3245c..f1409bb 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -412,7 +412,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
412 Dictionary<UUID, Vector3> originalPositions = new Dictionary<UUID, Vector3>(); 412 Dictionary<UUID, Vector3> originalPositions = new Dictionary<UUID, Vector3>();
413 Dictionary<UUID, Quaternion> originalRotations = new Dictionary<UUID, Quaternion>(); 413 Dictionary<UUID, Quaternion> originalRotations = new Dictionary<UUID, Quaternion>();
414 // this possible is not needed if keyframes are saved 414 // this possible is not needed if keyframes are saved
415 Dictionary<UUID, KeyframeMotion> originalKeyframes = new Dictionary<UUID, KeyframeMotion>(); 415// Dictionary<UUID, KeyframeMotion> originalKeyframes = new Dictionary<UUID, KeyframeMotion>();
416 416
417 foreach (SceneObjectGroup objectGroup in objlist) 417 foreach (SceneObjectGroup objectGroup in objlist)
418 { 418 {
@@ -423,8 +423,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
423 objectGroup.RootPart.SetForce(Vector3.Zero); 423 objectGroup.RootPart.SetForce(Vector3.Zero);
424 objectGroup.RootPart.SetAngularImpulse(Vector3.Zero, false); 424 objectGroup.RootPart.SetAngularImpulse(Vector3.Zero, false);
425 425
426 originalKeyframes[objectGroup.UUID] = objectGroup.RootPart.KeyframeMotion; 426// originalKeyframes[objectGroup.UUID] = objectGroup.RootPart.KeyframeMotion;
427 objectGroup.RootPart.KeyframeMotion = null; 427// objectGroup.RootPart.KeyframeMotion = null;
428 428
429 Vector3 inventoryStoredPosition = objectGroup.AbsolutePosition; 429 Vector3 inventoryStoredPosition = objectGroup.AbsolutePosition;
430 originalPositions[objectGroup.UUID] = inventoryStoredPosition; 430 originalPositions[objectGroup.UUID] = inventoryStoredPosition;
@@ -476,7 +476,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
476 { 476 {
477 objectGroup.AbsolutePosition = originalPositions[objectGroup.UUID]; 477 objectGroup.AbsolutePosition = originalPositions[objectGroup.UUID];
478 objectGroup.RootPart.RotationOffset = originalRotations[objectGroup.UUID]; 478 objectGroup.RootPart.RotationOffset = originalRotations[objectGroup.UUID];
479 objectGroup.RootPart.KeyframeMotion = originalKeyframes[objectGroup.UUID]; 479// objectGroup.RootPart.KeyframeMotion = originalKeyframes[objectGroup.UUID];
480 if (objectGroup.RootPart.KeyframeMotion != null) 480 if (objectGroup.RootPart.KeyframeMotion != null)
481 objectGroup.RootPart.KeyframeMotion.Resume(); 481 objectGroup.RootPart.KeyframeMotion.Resume();
482 } 482 }
@@ -989,11 +989,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
989 // one full update during the attachment 989 // one full update during the attachment
990 // process causes some clients to fail to display the 990 // process causes some clients to fail to display the
991 // attachment properly. 991 // attachment properly.
992 m_Scene.AddNewSceneObject(group, true, false);
993 992
994 if (!attachment) 993 if (!attachment)
995 { 994 {
996 group.AbsolutePosition = pos + veclist[i]; 995 group.AbsolutePosition = pos + veclist[i];
996 m_Scene.AddNewSceneObject(group, true, false);
997 997
998 // Fire on_rez 998 // Fire on_rez
999 group.CreateScriptInstances(0, true, m_Scene.DefaultScriptEngine, 1); 999 group.CreateScriptInstances(0, true, m_Scene.DefaultScriptEngine, 1);
@@ -1001,6 +1001,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
1001 1001
1002 group.ScheduleGroupForFullUpdate(); 1002 group.ScheduleGroupForFullUpdate();
1003 } 1003 }
1004 else
1005 m_Scene.AddNewSceneObject(group, true, false);
1006
1004 1007
1005// m_log.DebugFormat( 1008// m_log.DebugFormat(
1006// "[INVENTORY ACCESS MODULE]: Rezzed {0} {1} {2} ownermask={3:X} nextownermask={4:X} groupmask={5:X} everyonemask={6:X} for {7}", 1009// "[INVENTORY ACCESS MODULE]: Rezzed {0} {1} {2} ownermask={3:X} nextownermask={4:X} groupmask={5:X} everyonemask={6:X} for {7}",
diff --git a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
index 712ae01..c64a0f8 100644
--- a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
+++ b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
@@ -755,7 +755,8 @@ namespace OpenSim.Region.Framework.Scenes
755 } 755 }
756 else 756 else
757 { 757 {
758 bool lastSteps = remainingSteps < 4; 758// bool lastSteps = remainingSteps < 4;
759
759 Vector3 currentPosition = m_group.AbsolutePosition; 760 Vector3 currentPosition = m_group.AbsolutePosition;
760 Vector3 motionThisFrame = (Vector3)m_currentFrame.Position - currentPosition; 761 Vector3 motionThisFrame = (Vector3)m_currentFrame.Position - currentPosition;
761 motionThisFrame /= (float)remainingSteps; 762 motionThisFrame /= (float)remainingSteps;
@@ -776,13 +777,13 @@ namespace OpenSim.Region.Framework.Scenes
776 } 777 }
777 778
778 m_group.AbsolutePosition = m_nextPosition; 779 m_group.AbsolutePosition = m_nextPosition;
779 if(lastSteps) 780// if(lastSteps)
780 m_group.RootPart.Velocity = Vector3.Zero; 781// m_group.RootPart.Velocity = Vector3.Zero;
781 else 782// else
782 m_group.RootPart.Velocity = m_currentVel; 783 m_group.RootPart.Velocity = m_currentVel;
783 784
784 if(!update && ( 785 if(!update && (
785 lastSteps || 786// lastSteps ||
786 m_skippedUpdates * tickDuration > 0.5 || 787 m_skippedUpdates * tickDuration > 0.5 ||
787 Math.Abs(m_nextPosition.X - currentPosition.X) > 5f || 788 Math.Abs(m_nextPosition.X - currentPosition.X) > 5f ||
788 Math.Abs(m_nextPosition.Y - currentPosition.Y) > 5f || 789 Math.Abs(m_nextPosition.Y - currentPosition.Y) > 5f ||
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 5e8487d..c06b3dd 100755
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1651,10 +1651,11 @@ namespace OpenSim.Region.Framework.Scenes
1651 physicsMS2 = (float)(tmpMS2 - tmpMS); 1651 physicsMS2 = (float)(tmpMS2 - tmpMS);
1652 tmpMS = tmpMS2; 1652 tmpMS = tmpMS2;
1653 1653
1654/*
1654 // Apply any pending avatar force input to the avatar's velocity 1655 // Apply any pending avatar force input to the avatar's velocity
1655 if (Frame % m_update_entitymovement == 0) 1656 if (Frame % m_update_entitymovement == 0)
1656 m_sceneGraph.UpdateScenePresenceMovement(); 1657 m_sceneGraph.UpdateScenePresenceMovement();
1657 1658*/
1658 if (Frame % (m_update_coarse_locations) == 0 && !m_sendingCoarseLocations) 1659 if (Frame % (m_update_coarse_locations) == 0 && !m_sendingCoarseLocations)
1659 { 1660 {
1660 m_sendingCoarseLocations = true; 1661 m_sendingCoarseLocations = true;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 6f46a92..19449b1 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -657,6 +657,9 @@ namespace OpenSim.Region.Framework.Scenes
657 } 657 }
658 } 658 }
659 659
660 if(!m_scene.IsRunning)
661 return sog;
662
660 if (root.KeyframeMotion != null) 663 if (root.KeyframeMotion != null)
661 root.KeyframeMotion.StartCrossingCheck(); 664 root.KeyframeMotion.StartCrossingCheck();
662 665
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index 3d867a4..cdf275b 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -112,9 +112,22 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
112 while (reader.ReadToNextSibling("Part")); 112 while (reader.ReadToNextSibling("Part"));
113 } 113 }
114 114
115 reader.ReadEndElement();
116
117 if (reader.Name == "KeyframeMotion" && reader.NodeType == XmlNodeType.Element)
118 {
119
120 string innerkeytxt = reader.ReadElementContentAsString();
121 sceneObject.RootPart.KeyframeMotion =
122 KeyframeMotion.FromData(sceneObject, Convert.FromBase64String(innerkeytxt));
123 }
124 else
125 sceneObject.RootPart.KeyframeMotion = null;
126
115 // Script state may, or may not, exist. Not having any, is NOT 127 // Script state may, or may not, exist. Not having any, is NOT
116 // ever a problem. 128 // ever a problem.
117 sceneObject.LoadScriptState(reader); 129 sceneObject.LoadScriptState(reader);
130
118 sceneObject.InvalidateDeepEffectivePerms(); 131 sceneObject.InvalidateDeepEffectivePerms();
119 return sceneObject; 132 return sceneObject;
120 } 133 }
@@ -211,9 +224,19 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
211 224
212 writer.WriteEndElement(); // OtherParts 225 writer.WriteEndElement(); // OtherParts
213 226
227 if (sceneObject.RootPart.KeyframeMotion != null)
228 {
229 Byte[] data = sceneObject.RootPart.KeyframeMotion.Serialize();
230
231 writer.WriteStartElement(String.Empty, "KeyframeMotion", String.Empty);
232 writer.WriteBase64(data, 0, data.Length);
233 writer.WriteEndElement();
234 }
235
214 if (doScriptStates) 236 if (doScriptStates)
215 sceneObject.SaveScriptedState(writer); 237 sceneObject.SaveScriptedState(writer);
216 238
239
217 if (!noRootElement) 240 if (!noRootElement)
218 writer.WriteEndElement(); // SceneObjectGroup 241 writer.WriteEndElement(); // SceneObjectGroup
219 242