Merge branch 'ubitwork' into avination

avinationmerge
Melanie 2012-08-30 00:36:37 +02:00
commit 927cbc6762
3 changed files with 38 additions and 35 deletions

View File

@ -113,19 +113,22 @@ namespace OpenSim.Region.Framework.Scenes
{ {
set set
{ {
if (!value) if (m_group != null)
{ {
// Once we're let go, recompute positions if (!value)
if (m_selected)
UpdateSceneObject(m_group);
}
else
{
// Save selection position in case we get moved
if (!m_selected)
{ {
StopTimer(); // Once we're let go, recompute positions
m_serializedPosition = m_group.AbsolutePosition; if (m_selected)
UpdateSceneObject(m_group);
}
else
{
// Save selection position in case we get moved
if (!m_selected)
{
StopTimer();
m_serializedPosition = m_group.AbsolutePosition;
}
} }
} }
m_isCrossing = false; m_isCrossing = false;
@ -199,6 +202,9 @@ namespace OpenSim.Region.Framework.Scenes
m_waitingCrossing = false; m_waitingCrossing = false;
StopTimer(); StopTimer();
if (grp == null)
return;
m_group = grp; m_group = grp;
Vector3 grppos = grp.AbsolutePosition; Vector3 grppos = grp.AbsolutePosition;
Vector3 offset = grppos - m_serializedPosition; Vector3 offset = grppos - m_serializedPosition;
@ -228,14 +234,16 @@ namespace OpenSim.Region.Framework.Scenes
m_mode = mode; m_mode = mode;
m_data = data; m_data = data;
m_onTimerLock = new object();
m_group = grp; m_group = grp;
if (grp != null) if (grp != null)
{ {
m_basePosition = grp.AbsolutePosition; m_basePosition = grp.AbsolutePosition;
m_baseRotation = grp.GroupRotation; m_baseRotation = grp.GroupRotation;
} }
m_onTimerLock = new object();
m_timerStopped = true;
m_inOnTimer = false;
m_isCrossing = false; m_isCrossing = false;
m_waitingCrossing = false; m_waitingCrossing = false;
} }
@ -249,18 +257,23 @@ namespace OpenSim.Region.Framework.Scenes
{ {
StopTimer(); StopTimer();
KeyframeMotion newmotion = new KeyframeMotion(newgrp, m_mode, m_data); KeyframeMotion newmotion = new KeyframeMotion(null, m_mode, m_data);
if (newgrp != null && newgrp.IsSelected) newmotion.m_group = newgrp;
newmotion.m_selected = true;
if (m_keyframes != null) if (m_keyframes != null)
{
newmotion.m_keyframes = new Keyframe[m_keyframes.Length];
m_keyframes.CopyTo(newmotion.m_keyframes, 0); m_keyframes.CopyTo(newmotion.m_keyframes, 0);
}
newmotion.m_frames = new List<Keyframe>(m_frames); newmotion.m_frames = new List<Keyframe>(m_frames);
newmotion.m_basePosition = m_basePosition;
newmotion.m_baseRotation = m_baseRotation;
newmotion.m_currentFrame = m_currentFrame; newmotion.m_currentFrame = m_currentFrame;
newmotion.m_nextPosition = m_nextPosition;
if (m_selected) if (m_selected)
newmotion.m_serializedPosition = m_serializedPosition; newmotion.m_serializedPosition = m_serializedPosition;
else else
@ -272,12 +285,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
newmotion.m_iterations = m_iterations; newmotion.m_iterations = m_iterations;
newmotion.m_running = m_running;
newmotion.m_onTimerLock = new object();
newmotion.m_timerStopped = false;
newmotion.m_inOnTimer = false;
newmotion.m_isCrossing = false;
newmotion.m_waitingCrossing = false;
if (m_running && !m_waitingCrossing) if (m_running && !m_waitingCrossing)
StartTimer(); StartTimer();
@ -299,7 +307,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
m_isCrossing = false; m_isCrossing = false;
m_waitingCrossing = false; m_waitingCrossing = false;
if (m_keyframes.Length > 0) if (m_keyframes != null && m_group != null && m_keyframes.Length > 0)
{ {
if (m_timer == null) if (m_timer == null)
{ {

View File

@ -2062,6 +2062,7 @@ namespace OpenSim.Region.Framework.Scenes
HasGroupChangedDueToDelink = false; HasGroupChangedDueToDelink = false;
m_scene.EventManager.TriggerOnSceneObjectPreSave(backup_group, this); m_scene.EventManager.TriggerOnSceneObjectPreSave(backup_group, this);
/*
backup_group.ForEachPart(delegate(SceneObjectPart part) backup_group.ForEachPart(delegate(SceneObjectPart part)
{ {
if (part.KeyframeMotion != null) if (part.KeyframeMotion != null)
@ -2070,7 +2071,7 @@ namespace OpenSim.Region.Framework.Scenes
// part.KeyframeMotion.UpdateSceneObject(this); // part.KeyframeMotion.UpdateSceneObject(this);
} }
}); });
*/
datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID); datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID);
backup_group.ForEachPart(delegate(SceneObjectPart part) backup_group.ForEachPart(delegate(SceneObjectPart part)
@ -4416,15 +4417,6 @@ namespace OpenSim.Region.Framework.Scenes
public virtual ISceneObject CloneForNewScene() public virtual ISceneObject CloneForNewScene()
{ {
SceneObjectGroup sog = Copy(false); SceneObjectGroup sog = Copy(false);
sog.ForEachPart(delegate(SceneObjectPart part)
{
if (part.KeyframeMotion != null)
{
part.KeyframeMotion = KeyframeMotion.FromData(sog, part.KeyframeMotion.Serialize());
// this is called later
// part.KeyframeMotion.UpdateSceneObject(this);
}
});
sog.IsDeleted = false; sog.IsDeleted = false;
return sog; return sog;
} }

View File

@ -2110,6 +2110,9 @@ namespace OpenSim.Region.Framework.Scenes
Array.Copy(Shape.ExtraParams, extraP, extraP.Length); Array.Copy(Shape.ExtraParams, extraP, extraP.Length);
dupe.Shape.ExtraParams = extraP; dupe.Shape.ExtraParams = extraP;
if (KeyframeMotion != null)
dupe.KeyframeMotion = KeyframeMotion.Copy(null);
if (userExposed) if (userExposed)
{ {
if (dupe.m_shape.SculptEntry && dupe.m_shape.SculptTexture != UUID.Zero) if (dupe.m_shape.SculptEntry && dupe.m_shape.SculptTexture != UUID.Zero)