aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
diff options
context:
space:
mode:
authorMelanie2013-01-19 02:38:04 +0000
committerMelanie2013-01-19 02:38:04 +0000
commit12efac494a6f55d85b778bf752a9b6c37c1b0ced (patch)
tree4adec2a3f235f54e47a2216f7c9abaffdfac0c53 /OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
parentMerge branch 'master' into careminster (diff)
parentExplicitly stop PollServiceRequestManager() rather than relying on its destru... (diff)
downloadopensim-SC-12efac494a6f55d85b778bf752a9b6c37c1b0ced.zip
opensim-SC-12efac494a6f55d85b778bf752a9b6c37c1b0ced.tar.gz
opensim-SC-12efac494a6f55d85b778bf752a9b6c37c1b0ced.tar.bz2
opensim-SC-12efac494a6f55d85b778bf752a9b6c37c1b0ced.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs48
1 files changed, 40 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
index d18571c..65c279e 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
@@ -87,6 +87,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation
87 return; 87 return;
88 88
89 // m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Adding animation {0} for {1}", animID, m_scenePresence.Name); 89 // m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Adding animation {0} for {1}", animID, m_scenePresence.Name);
90 if (m_scenePresence.Scene.DebugAnimations)
91 m_log.DebugFormat(
92 "[SCENE PRESENCE ANIMATOR]: Adding animation {0} {1} for {2}",
93 GetAnimName(animID), animID, m_scenePresence.Name);
90 94
91 if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID)) 95 if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID))
92 SendAnimPack(); 96 SendAnimPack();
@@ -109,14 +113,25 @@ namespace OpenSim.Region.Framework.Scenes.Animation
109 AddAnimation(animID, objectID); 113 AddAnimation(animID, objectID);
110 } 114 }
111 115
112 public void RemoveAnimation(UUID animID) 116 /// <summary>
117 /// Remove the specified animation
118 /// </summary>
119 /// <param name='animID'></param>
120 /// <param name='allowNoDefault'>
121 /// If true, then the default animation can be entirely removed.
122 /// If false, then removing the default animation will reset it to the simulator default (currently STAND).
123 /// </param>
124 public void RemoveAnimation(UUID animID, bool allowNoDefault)
113 { 125 {
114 if (m_scenePresence.IsChildAgent) 126 if (m_scenePresence.IsChildAgent)
115 return; 127 return;
116 128
117// m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Removing animation {0} for {1}", animID, m_scenePresence.Name); 129 if (m_scenePresence.Scene.DebugAnimations)
130 m_log.DebugFormat(
131 "[SCENE PRESENCE ANIMATOR]: Removing animation {0} {1} for {2}",
132 GetAnimName(animID), animID, m_scenePresence.Name);
118 133
119 if (m_animations.Remove(animID)) 134 if (m_animations.Remove(animID, allowNoDefault))
120 SendAnimPack(); 135 SendAnimPack();
121 } 136 }
122 137
@@ -130,7 +145,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
130 if (addRemove) 145 if (addRemove)
131 m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, UUID.Zero); 146 m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, UUID.Zero);
132 else 147 else
133 m_animations.Remove(animID); 148 m_animations.Remove(animID, true);
134 } 149 }
135 if(sendPack) 150 if(sendPack)
136 SendAnimPack(); 151 SendAnimPack();
@@ -148,14 +163,15 @@ namespace OpenSim.Region.Framework.Scenes.Animation
148 if (animID == UUID.Zero) 163 if (animID == UUID.Zero)
149 return; 164 return;
150 165
151 RemoveAnimation(animID); 166 RemoveAnimation(animID, true);
152 } 167 }
153 168
154 public void ResetAnimations() 169 public void ResetAnimations()
155 { 170 {
156// m_log.DebugFormat( 171 if (m_scenePresence.Scene.DebugAnimations)
157// "[SCENE PRESENCE ANIMATOR]: Resetting animations for {0} in {1}", 172 m_log.DebugFormat(
158// m_scenePresence.Name, m_scenePresence.Scene.RegionInfo.RegionName); 173 "[SCENE PRESENCE ANIMATOR]: Resetting animations for {0} in {1}",
174 m_scenePresence.Name, m_scenePresence.Scene.RegionInfo.RegionName);
159 175
160 m_animations.Clear(); 176 m_animations.Clear();
161 } 177 }
@@ -566,5 +582,21 @@ namespace OpenSim.Region.Framework.Scenes.Animation
566 582
567 SendAnimPack(animIDs, sequenceNums, objectIDs); 583 SendAnimPack(animIDs, sequenceNums, objectIDs);
568 } 584 }
585
586 public string GetAnimName(UUID animId)
587 {
588 string animName;
589
590 if (!DefaultAvatarAnimations.AnimsNames.TryGetValue(animId, out animName))
591 {
592 AssetMetadata amd = m_scenePresence.Scene.AssetService.GetMetadata(animId.ToString());
593 if (amd != null)
594 animName = amd.Name;
595 else
596 animName = "Unknown";
597 }
598
599 return animName;
600 }
569 } 601 }
570} 602}