aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2012-02-26 18:11:38 +0100
committerMelanie2012-02-26 18:11:38 +0100
commitfca8c82232a42191270cb8d18dba6b54d382a2c2 (patch)
tree0a5b5e3e7d7034b7fd4e620fc0d21ec7c9f5abcb
parentMerge branch 'master' of ssh://3dhosting.de/var/git/careminster (diff)
downloadopensim-SC_OLD-fca8c82232a42191270cb8d18dba6b54d382a2c2.zip
opensim-SC_OLD-fca8c82232a42191270cb8d18dba6b54d382a2c2.tar.gz
opensim-SC_OLD-fca8c82232a42191270cb8d18dba6b54d382a2c2.tar.bz2
opensim-SC_OLD-fca8c82232a42191270cb8d18dba6b54d382a2c2.tar.xz
Move KeyframeMotion from SOG to SOP because we can't persist it any
other way because SOG doesn't technically exist in the DB
-rw-r--r--OpenSim/Data/MySQL/MySQLSimulationData.cs25
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs11
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs26
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs14
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs8
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs22
8 files changed, 75 insertions, 41 deletions
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs
index 04b91ef..5dafc0b 100644
--- a/OpenSim/Data/MySQL/MySQLSimulationData.cs
+++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs
@@ -170,7 +170,7 @@ namespace OpenSim.Data.MySQL
170 "ParticleSystem, ClickAction, Material, " + 170 "ParticleSystem, ClickAction, Material, " +
171 "CollisionSound, CollisionSoundVolume, " + 171 "CollisionSound, CollisionSoundVolume, " +
172 "PassTouches, " + 172 "PassTouches, " +
173 "LinkNumber, MediaURL) values (" + "?UUID, " + 173 "LinkNumber, MediaURL, KeyframeMotion) values (" + "?UUID, " +
174 "?CreationDate, ?Name, ?Text, " + 174 "?CreationDate, ?Name, ?Text, " +
175 "?Description, ?SitName, ?TouchName, " + 175 "?Description, ?SitName, ?TouchName, " +
176 "?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " + 176 "?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " +
@@ -201,7 +201,7 @@ namespace OpenSim.Data.MySQL
201 "?SaleType, ?ColorR, ?ColorG, " + 201 "?SaleType, ?ColorR, ?ColorG, " +
202 "?ColorB, ?ColorA, ?ParticleSystem, " + 202 "?ColorB, ?ColorA, ?ParticleSystem, " +
203 "?ClickAction, ?Material, ?CollisionSound, " + 203 "?ClickAction, ?Material, ?CollisionSound, " +
204 "?CollisionSoundVolume, ?PassTouches, ?LinkNumber, ?MediaURL)"; 204 "?CollisionSoundVolume, ?PassTouches, ?LinkNumber, ?MediaURL, ?KeyframeMotion)";
205 205
206 FillPrimCommand(cmd, prim, obj.UUID, regionUUID); 206 FillPrimCommand(cmd, prim, obj.UUID, regionUUID);
207 207
@@ -446,7 +446,11 @@ namespace OpenSim.Data.MySQL
446 foreach (SceneObjectPart prim in prims.Values) 446 foreach (SceneObjectPart prim in prims.Values)
447 { 447 {
448 if (prim.ParentUUID == UUID.Zero) 448 if (prim.ParentUUID == UUID.Zero)
449 {
449 objects[prim.UUID] = new SceneObjectGroup(prim); 450 objects[prim.UUID] = new SceneObjectGroup(prim);
451 if (prim.KeyframeMotion != null)
452 prim.KeyframeMotion.UpdateSceneObject(objects[prim.UUID]);
453 }
450 } 454 }
451 455
452 // Add all of the children objects to the SOGs 456 // Add all of the children objects to the SOGs
@@ -1227,6 +1231,18 @@ namespace OpenSim.Data.MySQL
1227 if (!(row["MediaURL"] is System.DBNull)) 1231 if (!(row["MediaURL"] is System.DBNull))
1228 prim.MediaUrl = (string)row["MediaURL"]; 1232 prim.MediaUrl = (string)row["MediaURL"];
1229 1233
1234 if (!(row["KeyframeMotion"] is DBNull))
1235 {
1236 Byte[] data = (byte[])row["KeyframeMotion"];
1237 if (data.Length > 0)
1238 prim.KeyframeMotion = KeyframeMotion.FromData(null, data);
1239 else
1240 prim.KeyframeMotion = null;
1241 }
1242 else
1243 {
1244 prim.KeyframeMotion = null;
1245 }
1230 return prim; 1246 return prim;
1231 } 1247 }
1232 1248
@@ -1579,6 +1595,11 @@ namespace OpenSim.Data.MySQL
1579 1595
1580 cmd.Parameters.AddWithValue("LinkNumber", prim.LinkNum); 1596 cmd.Parameters.AddWithValue("LinkNumber", prim.LinkNum);
1581 cmd.Parameters.AddWithValue("MediaURL", prim.MediaUrl); 1597 cmd.Parameters.AddWithValue("MediaURL", prim.MediaUrl);
1598
1599 if (prim.KeyframeMotion != null)
1600 cmd.Parameters.AddWithValue("KeyframeMotion", prim.KeyframeMotion.Serialize());
1601 else
1602 cmd.Parameters.AddWithValue("KeyframeMotion", new Byte[0]);
1582 } 1603 }
1583 1604
1584 /// <summary> 1605 /// <summary>
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 098123a..192d55f 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -355,11 +355,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
355 355
356 foreach (SceneObjectGroup objectGroup in objlist) 356 foreach (SceneObjectGroup objectGroup in objlist)
357 { 357 {
358 if (objectGroup.KeyframeMotion != null) 358 if (objectGroup.RootPart.KeyframeMotion != null)
359 objectGroup.KeyframeMotion.Stop(); 359 objectGroup.RootPart.KeyframeMotion.Stop();
360 objectGroup.RootPart.SetForce(Vector3.Zero); 360 objectGroup.RootPart.SetForce(Vector3.Zero);
361 objectGroup.RootPart.SetAngularImpulse(Vector3.Zero, false); 361 objectGroup.RootPart.SetAngularImpulse(Vector3.Zero, false);
362 objectGroup.KeyframeMotion = null; 362 objectGroup.RootPart.KeyframeMotion = null;
363 363
364 Vector3 inventoryStoredPosition = new Vector3 364 Vector3 inventoryStoredPosition = new Vector3
365 (((objectGroup.AbsolutePosition.X > (int)Constants.RegionSize) 365 (((objectGroup.AbsolutePosition.X > (int)Constants.RegionSize)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index c20da4b..11a41aa 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2421,8 +2421,8 @@ namespace OpenSim.Region.Framework.Scenes
2421 2421
2422 if (newPosition != Vector3.Zero) 2422 if (newPosition != Vector3.Zero)
2423 newObject.RootPart.GroupPosition = newPosition; 2423 newObject.RootPart.GroupPosition = newPosition;
2424 if (newObject.KeyframeMotion != null) 2424 if (newObject.RootPart.KeyframeMotion != null)
2425 newObject.KeyframeMotion.UpdateSceneObject(newObject); 2425 newObject.RootPart.KeyframeMotion.UpdateSceneObject(newObject);
2426 2426
2427 if (!AddSceneObject(newObject)) 2427 if (!AddSceneObject(newObject))
2428 { 2428 {
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 5a7f124..a320601 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1731,6 +1731,12 @@ namespace OpenSim.Region.Framework.Scenes
1731 /// <param name="childPrims"></param> 1731 /// <param name="childPrims"></param>
1732 protected internal void LinkObjects(SceneObjectPart root, List<SceneObjectPart> children) 1732 protected internal void LinkObjects(SceneObjectPart root, List<SceneObjectPart> children)
1733 { 1733 {
1734 if (root.KeyframeMotion != null)
1735 {
1736 root.KeyframeMotion.Stop();
1737 root.KeyframeMotion = null;
1738 }
1739
1734 SceneObjectGroup parentGroup = root.ParentGroup; 1740 SceneObjectGroup parentGroup = root.ParentGroup;
1735 if (parentGroup == null) return; 1741 if (parentGroup == null) return;
1736 1742
@@ -1823,6 +1829,11 @@ namespace OpenSim.Region.Framework.Scenes
1823 { 1829 {
1824 if (part != null) 1830 if (part != null)
1825 { 1831 {
1832 if (part.KeyframeMotion != null)
1833 {
1834 part.KeyframeMotion.Stop();
1835 part.KeyframeMotion = null;
1836 }
1826 if (part.ParentGroup.PrimCount != 1) // Skip single 1837 if (part.ParentGroup.PrimCount != 1) // Skip single
1827 { 1838 {
1828 if (part.LinkNum < 2) // Root 1839 if (part.LinkNum < 2) // Root
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index e509d4e..fefae9d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -114,12 +114,6 @@ namespace OpenSim.Region.Framework.Scenes
114 private Random m_rand; 114 private Random m_rand;
115 private bool m_suspendUpdates; 115 private bool m_suspendUpdates;
116 private List<ScenePresence> m_linkedAvatars = new List<ScenePresence>(); 116 private List<ScenePresence> m_linkedAvatars = new List<ScenePresence>();
117 private KeyframeMotion m_keyframeMotion = null;
118
119 public KeyframeMotion KeyframeMotion
120 {
121 get; set;
122 }
123 117
124 public bool areUpdatesSuspended 118 public bool areUpdatesSuspended
125 { 119 {
@@ -726,8 +720,8 @@ namespace OpenSim.Region.Framework.Scenes
726 child.PhysActor.Selected = value; 720 child.PhysActor.Selected = value;
727 } 721 }
728 } 722 }
729 if (KeyframeMotion != null) 723 if (RootPart.KeyframeMotion != null)
730 KeyframeMotion.Selected = value; 724 RootPart.KeyframeMotion.Selected = value;
731 } 725 }
732 } 726 }
733 727
@@ -1829,11 +1823,6 @@ namespace OpenSim.Region.Framework.Scenes
1829// Name, UUID, m_scene.RegionInfo.RegionName); 1823// Name, UUID, m_scene.RegionInfo.RegionName);
1830 1824
1831 SceneObjectGroup backup_group = Copy(false); 1825 SceneObjectGroup backup_group = Copy(false);
1832 if (KeyframeMotion != null)
1833 {
1834 backup_group.KeyframeMotion = KeyframeMotion.FromData(backup_group, KeyframeMotion.Serialize());
1835 KeyframeMotion.UpdateSceneObject(this);
1836 }
1837 backup_group.RootPart.Velocity = RootPart.Velocity; 1826 backup_group.RootPart.Velocity = RootPart.Velocity;
1838 backup_group.RootPart.Acceleration = RootPart.Acceleration; 1827 backup_group.RootPart.Acceleration = RootPart.Acceleration;
1839 backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity; 1828 backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity;
@@ -1846,6 +1835,11 @@ namespace OpenSim.Region.Framework.Scenes
1846 1835
1847 backup_group.ForEachPart(delegate(SceneObjectPart part) 1836 backup_group.ForEachPart(delegate(SceneObjectPart part)
1848 { 1837 {
1838 if (part.KeyframeMotion != null)
1839 {
1840 part.KeyframeMotion = KeyframeMotion.FromData(backup_group, part.KeyframeMotion.Serialize());
1841 part.KeyframeMotion.UpdateSceneObject(this);
1842 }
1849 part.Inventory.ProcessInventoryBackup(datastore); 1843 part.Inventory.ProcessInventoryBackup(datastore);
1850 }); 1844 });
1851 1845
@@ -2001,9 +1995,9 @@ namespace OpenSim.Region.Framework.Scenes
2001 { 1995 {
2002 if (usePhysics) 1996 if (usePhysics)
2003 { 1997 {
2004 if (KeyframeMotion != null) 1998 if (RootPart.KeyframeMotion != null)
2005 KeyframeMotion.Stop(); 1999 RootPart.KeyframeMotion.Stop();
2006 KeyframeMotion = null; 2000 RootPart.KeyframeMotion = null;
2007 } 2001 }
2008 UpdatePrimFlags(RootPart.LocalId, usePhysics, IsTemporary, IsPhantom, IsVolumeDetect); 2002 UpdatePrimFlags(RootPart.LocalId, usePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
2009 } 2003 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 0728042..ea3d716 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -315,6 +315,14 @@ namespace OpenSim.Region.Framework.Scenes
315 315
316 private SOPVehicle m_vehicle = null; 316 private SOPVehicle m_vehicle = null;
317 317
318 private KeyframeMotion m_keyframeMotion = null;
319
320 public KeyframeMotion KeyframeMotion
321 {
322 get; set;
323 }
324
325
318 #endregion Fields 326 #endregion Fields
319 327
320// ~SceneObjectPart() 328// ~SceneObjectPart()
@@ -1924,9 +1932,9 @@ namespace OpenSim.Region.Framework.Scenes
1924 { 1932 {
1925 if (UsePhysics) 1933 if (UsePhysics)
1926 { 1934 {
1927 if (ParentGroup.KeyframeMotion != null) 1935 if (ParentGroup.RootPart.KeyframeMotion != null)
1928 ParentGroup.KeyframeMotion.Stop(); 1936 ParentGroup.RootPart.KeyframeMotion.Stop();
1929 ParentGroup.KeyframeMotion = null; 1937 ParentGroup.RootPart.KeyframeMotion = null;
1930 ParentGroup.Scene.AddPhysicalPrim(1); 1938 ParentGroup.Scene.AddPhysicalPrim(1);
1931 1939
1932 PhysActor.OnRequestTerseUpdate += PhysicsRequestingTerseUpdate; 1940 PhysActor.OnRequestTerseUpdate += PhysicsRequestingTerseUpdate;
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index 118a63a..51a3320 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -246,9 +246,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
246 246
247 XmlNodeList keymotion = doc.GetElementsByTagName("KeyframeMotion"); 247 XmlNodeList keymotion = doc.GetElementsByTagName("KeyframeMotion");
248 if (keymotion.Count > 0) 248 if (keymotion.Count > 0)
249 sceneObject.KeyframeMotion = KeyframeMotion.FromData(sceneObject, Convert.FromBase64String(keymotion[0].InnerText)); 249 sceneObject.RootPart.KeyframeMotion = KeyframeMotion.FromData(sceneObject, Convert.FromBase64String(keymotion[0].InnerText));
250 else 250 else
251 sceneObject.KeyframeMotion = null; 251 sceneObject.RootPart.KeyframeMotion = null;
252 252
253 // Script state may, or may not, exist. Not having any, is NOT 253 // Script state may, or may not, exist. Not having any, is NOT
254 // ever a problem. 254 // ever a problem.
@@ -1174,9 +1174,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1174 1174
1175 writer.WriteEndElement(); 1175 writer.WriteEndElement();
1176 1176
1177 if (sog.KeyframeMotion != null) 1177 if (sog.RootPart.KeyframeMotion != null)
1178 { 1178 {
1179 Byte[] data = sog.KeyframeMotion.Serialize(); 1179 Byte[] data = sog.RootPart.KeyframeMotion.Serialize();
1180 1180
1181 writer.WriteStartElement(String.Empty, "KeyframeMotion", String.Empty); 1181 writer.WriteStartElement(String.Empty, "KeyframeMotion", String.Empty);
1182 writer.WriteBase64(data, 0, data.Length); 1182 writer.WriteBase64(data, 0, data.Length);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index e4ab14f..e9f9c2d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -11908,9 +11908,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
11908 11908
11909 if (frames.Data.Length > 0) // We are getting a new motion 11909 if (frames.Data.Length > 0) // We are getting a new motion
11910 { 11910 {
11911 if (group.KeyframeMotion != null) 11911 if (group.RootPart.KeyframeMotion != null)
11912 group.KeyframeMotion.Stop(); 11912 group.RootPart.KeyframeMotion.Stop();
11913 group.KeyframeMotion = null; 11913 group.RootPart.KeyframeMotion = null;
11914 11914
11915 int idx = 0; 11915 int idx = 0;
11916 11916
@@ -11953,7 +11953,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
11953 } 11953 }
11954 } 11954 }
11955 11955
11956 group.KeyframeMotion = new KeyframeMotion(group, mode, data); 11956 group.RootPart.KeyframeMotion = new KeyframeMotion(group, mode, data);
11957 11957
11958 idx = 0; 11958 idx = 0;
11959 11959
@@ -11990,17 +11990,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
11990 keyframes.Add(frame); 11990 keyframes.Add(frame);
11991 } 11991 }
11992 11992
11993 group.KeyframeMotion.SetKeyframes(keyframes.ToArray()); 11993 group.RootPart.KeyframeMotion.SetKeyframes(keyframes.ToArray());
11994 group.KeyframeMotion.Start(); 11994 group.RootPart.KeyframeMotion.Start();
11995 } 11995 }
11996 else 11996 else
11997 { 11997 {
11998 if (group.KeyframeMotion == null) 11998 if (group.RootPart.KeyframeMotion == null)
11999 return; 11999 return;
12000 12000
12001 if (options.Data.Length == 0) 12001 if (options.Data.Length == 0)
12002 { 12002 {
12003 group.KeyframeMotion.Stop(); 12003 group.RootPart.KeyframeMotion.Stop();
12004 return; 12004 return;
12005 } 12005 }
12006 12006
@@ -12020,13 +12020,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
12020 switch (cmd) 12020 switch (cmd)
12021 { 12021 {
12022 case ScriptBaseClass.KFM_CMD_PLAY: 12022 case ScriptBaseClass.KFM_CMD_PLAY:
12023 group.KeyframeMotion.Start(); 12023 group.RootPart.KeyframeMotion.Start();
12024 break; 12024 break;
12025 case ScriptBaseClass.KFM_CMD_STOP: 12025 case ScriptBaseClass.KFM_CMD_STOP:
12026 group.KeyframeMotion.Stop(); 12026 group.RootPart.KeyframeMotion.Stop();
12027 break; 12027 break;
12028 case ScriptBaseClass.KFM_CMD_PAUSE: 12028 case ScriptBaseClass.KFM_CMD_PAUSE:
12029 group.KeyframeMotion.Pause(); 12029 group.RootPart.KeyframeMotion.Pause();
12030 break; 12030 break;
12031 } 12031 }
12032 break; 12032 break;