*test*
parent
87a4abac50
commit
016e58e354
|
@ -349,6 +349,8 @@ namespace OpenSim.Framework
|
||||||
public List<ISceneObject> AttachmentObjects;
|
public List<ISceneObject> AttachmentObjects;
|
||||||
public List<string> AttachmentObjectStates;
|
public List<string> AttachmentObjectStates;
|
||||||
|
|
||||||
|
public Dictionary<string, UUID> MovementAnimationOverRides = new Dictionary<string, UUID>();
|
||||||
|
|
||||||
public virtual OSDMap Pack()
|
public virtual OSDMap Pack()
|
||||||
{
|
{
|
||||||
// m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Pack data");
|
// m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Pack data");
|
||||||
|
@ -417,6 +419,21 @@ namespace OpenSim.Framework
|
||||||
args["animation_state"] = AnimState.PackUpdateMessage();
|
args["animation_state"] = AnimState.PackUpdateMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (MovementAnimationOverRides.Count > 0)
|
||||||
|
{
|
||||||
|
OSDArray AOs = new OSDArray(MovementAnimationOverRides.Count);
|
||||||
|
{
|
||||||
|
foreach (KeyValuePair<string, UUID> kvp in MovementAnimationOverRides)
|
||||||
|
{
|
||||||
|
OSDMap ao = new OSDMap(2);
|
||||||
|
ao["state"] = OSD.FromString(kvp.Key);
|
||||||
|
ao["uuid"] = OSD.FromUUID(kvp.Value);
|
||||||
|
AOs.Add(ao);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
args["movementAO"] = AOs;
|
||||||
|
}
|
||||||
|
|
||||||
if (Appearance != null)
|
if (Appearance != null)
|
||||||
args["packed_appearance"] = Appearance.Pack();
|
args["packed_appearance"] = Appearance.Pack();
|
||||||
|
|
||||||
|
@ -640,6 +657,25 @@ namespace OpenSim.Framework
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MovementAnimationOverRides.Clear();
|
||||||
|
|
||||||
|
if (args["movementAO"] != null && args["movementAO"].Type == OSDType.Array)
|
||||||
|
{
|
||||||
|
OSDArray AOs = (OSDArray)(args["movementAO"]);
|
||||||
|
int count = AOs.Count;
|
||||||
|
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
OSDMap ao = (OSDMap)AOs[i];
|
||||||
|
if (ao["state"] != null && ao["uuid"] != null)
|
||||||
|
{
|
||||||
|
string state = ao["state"].AsString();
|
||||||
|
UUID id = ao["uuid"].AsUUID();
|
||||||
|
MovementAnimationOverRides[state] = id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array)
|
//if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array)
|
||||||
//{
|
//{
|
||||||
// OSDArray textures = (OSDArray)(args["agent_textures"]);
|
// OSDArray textures = (OSDArray)(args["agent_textures"]);
|
||||||
|
|
|
@ -80,5 +80,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
return UUID.Zero;
|
return UUID.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Dictionary<string, UUID> CloneAOPairs()
|
||||||
|
{
|
||||||
|
lock (m_overrides)
|
||||||
|
{
|
||||||
|
return new Dictionary<string, UUID>(m_overrides);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CopyAOPairsFrom(Dictionary<string, UUID> src)
|
||||||
|
{
|
||||||
|
lock (m_overrides)
|
||||||
|
{
|
||||||
|
m_overrides.Clear();
|
||||||
|
m_overrides = new Dictionary<string, UUID>(src);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4212,6 +4212,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
cAgent.DefaultAnim = Animator.Animations.DefaultAnimation;
|
cAgent.DefaultAnim = Animator.Animations.DefaultAnimation;
|
||||||
cAgent.AnimState = Animator.Animations.ImplicitDefaultAnimation;
|
cAgent.AnimState = Animator.Animations.ImplicitDefaultAnimation;
|
||||||
|
|
||||||
|
cAgent.MovementAnimationOverRides = Overrides.CloneAOPairs();
|
||||||
|
|
||||||
if (Scene.AttachmentsModule != null)
|
if (Scene.AttachmentsModule != null)
|
||||||
Scene.AttachmentsModule.CopyAttachments(this, cAgent);
|
Scene.AttachmentsModule.CopyAttachments(this, cAgent);
|
||||||
}
|
}
|
||||||
|
@ -4282,7 +4284,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
catch { }
|
catch { }
|
||||||
|
|
||||||
Animator.ResetAnimations();
|
Animator.ResetAnimations();
|
||||||
|
|
||||||
|
Overrides.CopyAOPairsFrom(cAgent.MovementAnimationOverRides);
|
||||||
|
|
||||||
// FIXME: Why is this null check necessary? Where are the cases where we get a null Anims object?
|
// FIXME: Why is this null check necessary? Where are the cases where we get a null Anims object?
|
||||||
if (cAgent.DefaultAnim != null)
|
if (cAgent.DefaultAnim != null)
|
||||||
Animator.Animations.SetDefaultAnimation(cAgent.DefaultAnim.AnimID, cAgent.DefaultAnim.SequenceNum, UUID.Zero);
|
Animator.Animations.SetDefaultAnimation(cAgent.DefaultAnim.AnimID, cAgent.DefaultAnim.SequenceNum, UUID.Zero);
|
||||||
|
|
Loading…
Reference in New Issue