Implement KeyframedMotion selection behavior
parent
8cdc115c91
commit
416f39a561
|
@ -72,6 +72,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
private DataFormat m_data = DataFormat.Translation | DataFormat.Rotation;
|
||||
|
||||
private bool m_running = false;
|
||||
[NonSerialized()]
|
||||
private bool m_selected = false;
|
||||
|
||||
private int m_iterations = 0;
|
||||
|
||||
|
@ -82,6 +84,25 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
get { return m_data; }
|
||||
}
|
||||
|
||||
public bool Selected
|
||||
{
|
||||
set
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
// Once we're let go, recompute positions
|
||||
if (m_selected)
|
||||
UpdateSceneObject(m_group);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Save selection position in case we get moved
|
||||
if (!m_selected)
|
||||
m_serializedPosition = tmp.AbsolutePosition;
|
||||
}
|
||||
m_selected = value; }
|
||||
}
|
||||
|
||||
public static KeyframeMotion FromData(SceneObjectGroup grp, Byte[] data)
|
||||
{
|
||||
MemoryStream ms = new MemoryStream(data);
|
||||
|
@ -276,6 +297,16 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
m_currentFrame = m_frames[0];
|
||||
}
|
||||
|
||||
if (m_selected)
|
||||
{
|
||||
if (m_group.RootPart.Velocity != Vector3.Zero)
|
||||
{
|
||||
m_group.RootPart.Velocity = Vector3.Zero;
|
||||
m_group.SendGroupRootTerseUpdate();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Do the frame processing
|
||||
double steps = (double)m_currentFrame.TimeMS / timerInterval;
|
||||
float complete = ((float)m_currentFrame.TimeTotal - (float)m_currentFrame.TimeMS) / (float)m_currentFrame.TimeTotal;
|
||||
|
|
|
@ -138,12 +138,12 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
{
|
||||
SceneObjectGroup sog = part.ParentGroup;
|
||||
sog.SendPropertiesToClient(remoteClient);
|
||||
sog.IsSelected = true;
|
||||
|
||||
// A prim is only tainted if it's allowed to be edited by the person clicking it.
|
||||
if (Permissions.CanEditObject(sog.UUID, remoteClient.AgentId)
|
||||
|| Permissions.CanMoveObject(sog.UUID, remoteClient.AgentId))
|
||||
{
|
||||
sog.IsSelected = true;
|
||||
EventManager.TriggerParcelPrimCountTainted();
|
||||
}
|
||||
}
|
||||
|
@ -215,6 +215,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// handled by group, but by prim. Legacy cruft.
|
||||
// TODO: Make selection flagging per prim!
|
||||
//
|
||||
if (Permissions.CanEditObject(part.ParentGroup.UUID, remoteClient.AgentId)
|
||||
|| Permissions.CanMoveObject(part.ParentGroup.UUID, remoteClient.AgentId))
|
||||
part.ParentGroup.IsSelected = false;
|
||||
|
||||
if (part.ParentGroup.IsAttachment)
|
||||
|
|
|
@ -726,6 +726,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
child.PhysActor.Selected = value;
|
||||
}
|
||||
}
|
||||
if (KeyframeMotion != null)
|
||||
KeyframeMotion.Selected = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue