From 33573003620674f4a4f6c8fadd969c7aa6576a5d Mon Sep 17 00:00:00 2001
From: teravus
Date: Wed, 12 Jun 2013 18:13:00 -0500
Subject: * This fixes having to select and deselect prim to get keyframemotion
 to start running when pulled from data storage.

---
 OpenSim/Data/MySQL/MySQLSimulationData.cs           | 2 --
 OpenSim/Data/SQLite/SQLiteSimulationData.cs         | 5 +++--
 OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 5 +++++
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs
index 448962a..de52623 100644
--- a/OpenSim/Data/MySQL/MySQLSimulationData.cs
+++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs
@@ -457,8 +457,6 @@ namespace OpenSim.Data.MySQL
                 if (prim.ParentUUID == UUID.Zero)
                 {
                     objects[prim.UUID] = new SceneObjectGroup(prim);
-                    if (prim.KeyframeMotion != null)
-                        prim.KeyframeMotion.UpdateSceneObject(objects[prim.UUID]);
                 }
             }
 
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
index 70b76c9..c35bba2 100644
--- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
@@ -732,11 +732,12 @@ namespace OpenSim.Data.SQLite
                             }
 
                             SceneObjectGroup group = new SceneObjectGroup(prim);
-                            if (prim.KeyframeMotion != null)
-                                prim.KeyframeMotion.UpdateSceneObject(group);
+                            
                             createdObjects.Add(group.UUID, group);
                             retvals.Add(group);
                             LoadItems(prim);
+
+                           
                         }
                     }
                     catch (Exception e)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index da80e4f..7b5fdcb 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -763,6 +763,11 @@ namespace OpenSim.Region.Framework.Scenes
             for (int i = 0; i < parts.Length; i++)
             {
                 SceneObjectPart part = parts[i];
+                if (part.KeyframeMotion != null)
+                {
+                    part.KeyframeMotion.UpdateSceneObject(this);
+                }
+
                 if (Object.ReferenceEquals(part, m_rootPart))
                     continue;
 
-- 
cgit v1.1