diff options
author | BlueWall | 2013-01-23 08:16:18 -0500 |
---|---|---|
committer | BlueWall | 2013-01-23 08:16:18 -0500 |
commit | 2841ed05cf003fef8dc820d0327c1fcce0d76e93 (patch) | |
tree | 2d3647e4ffad8220e5b30fbdfbf7b3a36be0597c /OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | |
parent | Add additional return status (diff) | |
parent | BulletSim: Tweeks to vehicle motion. (diff) | |
download | opensim-SC-2841ed05cf003fef8dc820d0327c1fcce0d76e93.zip opensim-SC-2841ed05cf003fef8dc820d0327c1fcce0d76e93.tar.gz opensim-SC-2841ed05cf003fef8dc820d0327c1fcce0d76e93.tar.bz2 opensim-SC-2841ed05cf003fef8dc820d0327c1fcce0d76e93.tar.xz |
Merge branch 'master' of /home/opensim/var/repo/opensim
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | 47 |
1 files changed, 39 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index 5b16b67..e92a087 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | |||
@@ -86,7 +86,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
86 | if (m_scenePresence.IsChildAgent) | 86 | if (m_scenePresence.IsChildAgent) |
87 | return; | 87 | return; |
88 | 88 | ||
89 | // m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Adding animation {0} for {1}", animID, m_scenePresence.Name); | 89 | if (m_scenePresence.Scene.DebugAnimations) |
90 | m_log.DebugFormat( | ||
91 | "[SCENE PRESENCE ANIMATOR]: Adding animation {0} {1} for {2}", | ||
92 | GetAnimName(animID), animID, m_scenePresence.Name); | ||
90 | 93 | ||
91 | if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID)) | 94 | if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID)) |
92 | SendAnimPack(); | 95 | SendAnimPack(); |
@@ -109,14 +112,25 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
109 | AddAnimation(animID, objectID); | 112 | AddAnimation(animID, objectID); |
110 | } | 113 | } |
111 | 114 | ||
112 | public void RemoveAnimation(UUID animID) | 115 | /// <summary> |
116 | /// Remove the specified animation | ||
117 | /// </summary> | ||
118 | /// <param name='animID'></param> | ||
119 | /// <param name='allowNoDefault'> | ||
120 | /// If true, then the default animation can be entirely removed. | ||
121 | /// If false, then removing the default animation will reset it to the simulator default (currently STAND). | ||
122 | /// </param> | ||
123 | public void RemoveAnimation(UUID animID, bool allowNoDefault) | ||
113 | { | 124 | { |
114 | if (m_scenePresence.IsChildAgent) | 125 | if (m_scenePresence.IsChildAgent) |
115 | return; | 126 | return; |
116 | 127 | ||
117 | // m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Removing animation {0} for {1}", animID, m_scenePresence.Name); | 128 | if (m_scenePresence.Scene.DebugAnimations) |
129 | m_log.DebugFormat( | ||
130 | "[SCENE PRESENCE ANIMATOR]: Removing animation {0} {1} for {2}", | ||
131 | GetAnimName(animID), animID, m_scenePresence.Name); | ||
118 | 132 | ||
119 | if (m_animations.Remove(animID)) | 133 | if (m_animations.Remove(animID, allowNoDefault)) |
120 | SendAnimPack(); | 134 | SendAnimPack(); |
121 | } | 135 | } |
122 | 136 | ||
@@ -132,14 +146,15 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
132 | if (animID == UUID.Zero) | 146 | if (animID == UUID.Zero) |
133 | return; | 147 | return; |
134 | 148 | ||
135 | RemoveAnimation(animID); | 149 | RemoveAnimation(animID, true); |
136 | } | 150 | } |
137 | 151 | ||
138 | public void ResetAnimations() | 152 | public void ResetAnimations() |
139 | { | 153 | { |
140 | // m_log.DebugFormat( | 154 | if (m_scenePresence.Scene.DebugAnimations) |
141 | // "[SCENE PRESENCE ANIMATOR]: Resetting animations for {0} in {1}", | 155 | m_log.DebugFormat( |
142 | // m_scenePresence.Name, m_scenePresence.Scene.RegionInfo.RegionName); | 156 | "[SCENE PRESENCE ANIMATOR]: Resetting animations for {0} in {1}", |
157 | m_scenePresence.Name, m_scenePresence.Scene.RegionInfo.RegionName); | ||
143 | 158 | ||
144 | m_animations.Clear(); | 159 | m_animations.Clear(); |
145 | } | 160 | } |
@@ -550,5 +565,21 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
550 | 565 | ||
551 | SendAnimPack(animIDs, sequenceNums, objectIDs); | 566 | SendAnimPack(animIDs, sequenceNums, objectIDs); |
552 | } | 567 | } |
568 | |||
569 | public string GetAnimName(UUID animId) | ||
570 | { | ||
571 | string animName; | ||
572 | |||
573 | if (!DefaultAvatarAnimations.AnimsNames.TryGetValue(animId, out animName)) | ||
574 | { | ||
575 | AssetMetadata amd = m_scenePresence.Scene.AssetService.GetMetadata(animId.ToString()); | ||
576 | if (amd != null) | ||
577 | animName = amd.Name; | ||
578 | else | ||
579 | animName = "Unknown"; | ||
580 | } | ||
581 | |||
582 | return animName; | ||
583 | } | ||
553 | } | 584 | } |
554 | } | 585 | } |