aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Data/SQLite/Resources/RegionStore.migrations8
-rw-r--r--OpenSim/Data/SQLite/SQLiteSimulationData.cs24
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs5
3 files changed, 35 insertions, 2 deletions
diff --git a/OpenSim/Data/SQLite/Resources/RegionStore.migrations b/OpenSim/Data/SQLite/Resources/RegionStore.migrations
index c6f4b48..bff039d 100644
--- a/OpenSim/Data/SQLite/Resources/RegionStore.migrations
+++ b/OpenSim/Data/SQLite/Resources/RegionStore.migrations
@@ -592,3 +592,11 @@ ALTER TABLE prims ADD COLUMN `Friction` double NOT NULL default '0.6';
592ALTER TABLE prims ADD COLUMN `Restitution` double NOT NULL default '0.5'; 592ALTER TABLE prims ADD COLUMN `Restitution` double NOT NULL default '0.5';
593 593
594COMMIT; 594COMMIT;
595
596:VERSION 29 #---------------- Keyframes
597
598BEGIN;
599
600ALTER TABLE prims ADD COLUMN `KeyframeMotion` blob;
601
602COMMIT;
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
index d4734a6..70b76c9 100644
--- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
@@ -732,6 +732,8 @@ namespace OpenSim.Data.SQLite
732 } 732 }
733 733
734 SceneObjectGroup group = new SceneObjectGroup(prim); 734 SceneObjectGroup group = new SceneObjectGroup(prim);
735 if (prim.KeyframeMotion != null)
736 prim.KeyframeMotion.UpdateSceneObject(group);
735 createdObjects.Add(group.UUID, group); 737 createdObjects.Add(group.UUID, group);
736 retvals.Add(group); 738 retvals.Add(group);
737 LoadItems(prim); 739 LoadItems(prim);
@@ -1241,6 +1243,7 @@ namespace OpenSim.Data.SQLite
1241 createCol(prims, "Friction", typeof(Double)); 1243 createCol(prims, "Friction", typeof(Double));
1242 createCol(prims, "Restitution", typeof(Double)); 1244 createCol(prims, "Restitution", typeof(Double));
1243 1245
1246 createCol(prims, "KeyframeMotion", typeof(Byte[]));
1244 // Add in contraints 1247 // Add in contraints
1245 prims.PrimaryKey = new DataColumn[] { prims.Columns["UUID"] }; 1248 prims.PrimaryKey = new DataColumn[] { prims.Columns["UUID"] };
1246 1249
@@ -1736,6 +1739,20 @@ namespace OpenSim.Data.SQLite
1736 prim.Friction = Convert.ToSingle(row["Friction"]); 1739 prim.Friction = Convert.ToSingle(row["Friction"]);
1737 prim.Restitution = Convert.ToSingle(row["Restitution"]); 1740 prim.Restitution = Convert.ToSingle(row["Restitution"]);
1738 1741
1742
1743 if (!(row["KeyframeMotion"] is DBNull))
1744 {
1745 Byte[] data = (byte[])row["KeyframeMotion"];
1746 if (data.Length > 0)
1747 prim.KeyframeMotion = KeyframeMotion.FromData(null, data);
1748 else
1749 prim.KeyframeMotion = null;
1750 }
1751 else
1752 {
1753 prim.KeyframeMotion = null;
1754 }
1755
1739 return prim; 1756 return prim;
1740 } 1757 }
1741 1758
@@ -2168,6 +2185,13 @@ namespace OpenSim.Data.SQLite
2168 row["GravityModifier"] = (double)prim.GravityModifier; 2185 row["GravityModifier"] = (double)prim.GravityModifier;
2169 row["Friction"] = (double)prim.Friction; 2186 row["Friction"] = (double)prim.Friction;
2170 row["Restitution"] = (double)prim.Restitution; 2187 row["Restitution"] = (double)prim.Restitution;
2188
2189 if (prim.KeyframeMotion != null)
2190 row["KeyframeMotion"] = prim.KeyframeMotion.Serialize();
2191 else
2192 row["KeyframeMotion"] = new Byte[0];
2193
2194
2171 } 2195 }
2172 2196
2173 /// <summary> 2197 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index ff3f738..482d958 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -779,7 +779,8 @@ namespace OpenSim.Region.Framework.Scenes
779 } 779 }
780 780
781 // Tell the physics engines that this prim changed. 781 // Tell the physics engines that this prim changed.
782 ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); 782 if (ParentGroup != null && ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene != null)
783 ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor);
783 } 784 }
784 catch (Exception e) 785 catch (Exception e)
785 { 786 {
@@ -892,7 +893,7 @@ namespace OpenSim.Region.Framework.Scenes
892 //m_log.Info("[PART]: RO2:" + actor.Orientation.ToString()); 893 //m_log.Info("[PART]: RO2:" + actor.Orientation.ToString());
893 } 894 }
894 895
895 if (ParentGroup != null) 896 if (ParentGroup != null && ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene != null)
896 ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); 897 ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor);
897 //} 898 //}
898 } 899 }