Add the default animation to the child agent data update

avinationmerge
Melanie 2012-05-04 20:33:48 +02:00
parent b5b21013da
commit 333d013b5c
2 changed files with 14 additions and 0 deletions

View File

@ -311,6 +311,7 @@ namespace OpenSim.Framework
public AgentGroupData[] Groups;
public Animation[] Anims;
public Animation DefaultAnim = null;
public UUID GranterID;
public UUID ParentPart;
@ -397,6 +398,11 @@ namespace OpenSim.Framework
args["animations"] = anims;
}
if (DefaultAnim != null)
{
args["default_animation"] = DefaultAnim.PackUpdateMessage();
}
if (Appearance != null)
args["packed_appearance"] = Appearance.Pack();
@ -594,6 +600,11 @@ namespace OpenSim.Framework
}
}
if (args["default_animation"] != null)
{
DefaultAnim = new Animation((OSDMap)args["default_animation"]);
}
//if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array)
//{
// OSDArray textures = (OSDArray)(args["agent_textures"]);

View File

@ -3249,6 +3249,7 @@ namespace OpenSim.Region.Framework.Scenes
cAgent.Anims = Animator.Animations.ToArray();
}
catch { }
cAgent.DefaultAnim = Animator.Animations.DefaultAnimation;
// Attachment objects
List<SceneObjectGroup> attachments = GetAttachments();
@ -3343,6 +3344,8 @@ namespace OpenSim.Region.Framework.Scenes
// FIXME: Why is this null check necessary? Where are the cases where we get a null Anims object?
if (cAgent.Anims != null)
Animator.Animations.FromArray(cAgent.Anims);
if (cAgent.DefaultAnim != null)
Animator.Animations.SetDefaultAnimation(cAgent.DefaultAnim.AnimID, cAgent.DefaultAnim.SequenceNum, UUID.Zero);
if (cAgent.AttachmentObjects != null && cAgent.AttachmentObjects.Count > 0)
{