aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Framework/ChildAgentDataUpdate.cs36
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs11
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs6
3 files changed, 53 insertions, 0 deletions
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs
index 6d048f4..dfe60aa 100644
--- a/OpenSim/Framework/ChildAgentDataUpdate.cs
+++ b/OpenSim/Framework/ChildAgentDataUpdate.cs
@@ -306,6 +306,8 @@ namespace OpenSim.Framework
306 306
307 public AgentGroupData[] Groups; 307 public AgentGroupData[] Groups;
308 public Animation[] Anims; 308 public Animation[] Anims;
309 public Animation DefaultAnim = null;
310 public Animation AnimState = null;
309 311
310 public UUID GranterID; 312 public UUID GranterID;
311 313
@@ -390,6 +392,16 @@ namespace OpenSim.Framework
390 args["animations"] = anims; 392 args["animations"] = anims;
391 } 393 }
392 394
395 if (DefaultAnim != null)
396 {
397 args["default_animation"] = DefaultAnim.PackUpdateMessage();
398 }
399
400 if (AnimState != null)
401 {
402 args["animation_state"] = AnimState.PackUpdateMessage();
403 }
404
393 if (Appearance != null) 405 if (Appearance != null)
394 args["packed_appearance"] = Appearance.Pack(); 406 args["packed_appearance"] = Appearance.Pack();
395 407
@@ -583,6 +595,30 @@ namespace OpenSim.Framework
583 } 595 }
584 } 596 }
585 597
598 if (args["default_animation"] != null)
599 {
600 try
601 {
602 DefaultAnim = new Animation((OSDMap)args["default_animation"]);
603 }
604 catch
605 {
606 DefaultAnim = null;
607 }
608 }
609
610 if (args["animation_state"] != null)
611 {
612 try
613 {
614 AnimState = new Animation((OSDMap)args["animation_state"]);
615 }
616 catch
617 {
618 AnimState = null;
619 }
620 }
621
586 //if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array) 622 //if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array)
587 //{ 623 //{
588 // OSDArray textures = (OSDArray)(args["agent_textures"]); 624 // OSDArray textures = (OSDArray)(args["agent_textures"]);
diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs
index 3d8e8be..65ae445 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs
@@ -45,6 +45,11 @@ namespace OpenSim.Region.Framework.Scenes.Animation
45 private OpenSim.Framework.Animation m_defaultAnimation = new OpenSim.Framework.Animation(); 45 private OpenSim.Framework.Animation m_defaultAnimation = new OpenSim.Framework.Animation();
46 private List<OpenSim.Framework.Animation> m_animations = new List<OpenSim.Framework.Animation>(); 46 private List<OpenSim.Framework.Animation> m_animations = new List<OpenSim.Framework.Animation>();
47 47
48 public OpenSim.Framework.Animation DefaultAnimation
49 {
50 get { return m_defaultAnimation; }
51 }
52
48 public OpenSim.Framework.Animation ImplicitDefaultAnimation 53 public OpenSim.Framework.Animation ImplicitDefaultAnimation
49 { 54 {
50 get { return m_implicitDefaultAnimation; } 55 get { return m_implicitDefaultAnimation; }
@@ -126,6 +131,12 @@ namespace OpenSim.Region.Framework.Scenes.Animation
126 return false; 131 return false;
127 } 132 }
128 133
134 // Called from serialization only
135 public void SetImplicitDefaultAnimation(UUID animID, int sequenceNum, UUID objectID)
136 {
137 m_implicitDefaultAnimation = new OpenSim.Framework.Animation(animID, sequenceNum, objectID);
138 }
139
129 protected bool ResetDefaultAnimation() 140 protected bool ResetDefaultAnimation()
130 { 141 {
131 return TrySetDefaultAnimation("STAND", 1, UUID.Zero); 142 return TrySetDefaultAnimation("STAND", 1, UUID.Zero);
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index aa82af4..71e322d 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3075,6 +3075,8 @@ namespace OpenSim.Region.Framework.Scenes
3075 cAgent.Anims = Animator.Animations.ToArray(); 3075 cAgent.Anims = Animator.Animations.ToArray();
3076 } 3076 }
3077 catch { } 3077 catch { }
3078 cAgent.DefaultAnim = Animator.Animations.DefaultAnimation;
3079 cAgent.AnimState = Animator.Animations.ImplicitDefaultAnimation;
3078 3080
3079 if (Scene.AttachmentsModule != null) 3081 if (Scene.AttachmentsModule != null)
3080 Scene.AttachmentsModule.CopyAttachments(this, cAgent); 3082 Scene.AttachmentsModule.CopyAttachments(this, cAgent);
@@ -3146,6 +3148,10 @@ namespace OpenSim.Region.Framework.Scenes
3146 // FIXME: Why is this null check necessary? Where are the cases where we get a null Anims object? 3148 // FIXME: Why is this null check necessary? Where are the cases where we get a null Anims object?
3147 if (cAgent.Anims != null) 3149 if (cAgent.Anims != null)
3148 Animator.Animations.FromArray(cAgent.Anims); 3150 Animator.Animations.FromArray(cAgent.Anims);
3151 if (cAgent.DefaultAnim != null)
3152 Animator.Animations.SetDefaultAnimation(cAgent.DefaultAnim.AnimID, cAgent.DefaultAnim.SequenceNum, UUID.Zero);
3153 if (cAgent.AnimState != null)
3154 Animator.Animations.SetImplicitDefaultAnimation(cAgent.AnimState.AnimID, cAgent.AnimState.SequenceNum, UUID.Zero);
3149 3155
3150 if (Scene.AttachmentsModule != null) 3156 if (Scene.AttachmentsModule != null)
3151 Scene.AttachmentsModule.CopyAttachments(cAgent, this); 3157 Scene.AttachmentsModule.CopyAttachments(cAgent, this);