aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs33
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs5
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Animations/AnimationsCommandModule.cs23
-rw-r--r--OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs11
4 files changed, 48 insertions, 24 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
index 3657dc4..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();
@@ -122,7 +125,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation
122 if (m_scenePresence.IsChildAgent) 125 if (m_scenePresence.IsChildAgent)
123 return; 126 return;
124 127
125// 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);
126 132
127 if (m_animations.Remove(animID, allowNoDefault)) 133 if (m_animations.Remove(animID, allowNoDefault))
128 SendAnimPack(); 134 SendAnimPack();
@@ -145,9 +151,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation
145 151
146 public void ResetAnimations() 152 public void ResetAnimations()
147 { 153 {
148// m_log.DebugFormat( 154 if (m_scenePresence.Scene.DebugAnimations)
149// "[SCENE PRESENCE ANIMATOR]: Resetting animations for {0} in {1}", 155 m_log.DebugFormat(
150// 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);
151 158
152 m_animations.Clear(); 159 m_animations.Clear();
153 } 160 }
@@ -558,5 +565,21 @@ namespace OpenSim.Region.Framework.Scenes.Animation
558 565
559 SendAnimPack(animIDs, sequenceNums, objectIDs); 566 SendAnimPack(animIDs, sequenceNums, objectIDs);
560 } 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 }
561 } 584 }
562} 585}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 4859dff..5778176 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -68,6 +68,11 @@ namespace OpenSim.Region.Framework.Scenes
68 public bool EmergencyMonitoring = false; 68 public bool EmergencyMonitoring = false;
69 69
70 /// <summary> 70 /// <summary>
71 /// Show debug information about animations.
72 /// </summary>
73 public bool DebugAnimations { get; set; }
74
75 /// <summary>
71 /// Show debug information about teleports. 76 /// Show debug information about teleports.
72 /// </summary> 77 /// </summary>
73 public bool DebugTeleporting { get; set; } 78 public bool DebugTeleporting { get; set; }
diff --git a/OpenSim/Region/OptionalModules/Avatar/Animations/AnimationsCommandModule.cs b/OpenSim/Region/OptionalModules/Avatar/Animations/AnimationsCommandModule.cs
index e951d9e..84211a9 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Animations/AnimationsCommandModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Animations/AnimationsCommandModule.cs
@@ -161,12 +161,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Animations
161 UUID defaultAnimId = anims.DefaultAnimation.AnimID; 161 UUID defaultAnimId = anims.DefaultAnimation.AnimID;
162 cdl.AddRow( 162 cdl.AddRow(
163 "Default anim", 163 "Default anim",
164 string.Format("{0}, {1}", defaultAnimId, GetAnimName(sp.Scene.AssetService, defaultAnimId))); 164 string.Format("{0}, {1}", defaultAnimId, sp.Animator.GetAnimName(defaultAnimId)));
165 165
166 UUID implicitDefaultAnimId = anims.ImplicitDefaultAnimation.AnimID; 166 UUID implicitDefaultAnimId = anims.ImplicitDefaultAnimation.AnimID;
167 cdl.AddRow( 167 cdl.AddRow(
168 "Implicit default anim", 168 "Implicit default anim",
169 string.Format("{0}, {1}", implicitDefaultAnimId, GetAnimName(sp.Scene.AssetService, implicitDefaultAnimId))); 169 string.Format("{0}, {1}",
170 implicitDefaultAnimId, sp.Animator.GetAnimName(implicitDefaultAnimId)));
170 171
171 cdl.AddToStringBuilder(sb); 172 cdl.AddToStringBuilder(sb);
172 173
@@ -185,7 +186,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Animations
185 for (int i = 0; i < animIds.Length; i++) 186 for (int i = 0; i < animIds.Length; i++)
186 { 187 {
187 UUID animId = animIds[i]; 188 UUID animId = animIds[i];
188 string animName = GetAnimName(sp.Scene.AssetService, animId); 189 string animName = sp.Animator.GetAnimName(animId);
189 int seq = sequenceNumbers[i]; 190 int seq = sequenceNumbers[i];
190 UUID objectId = objectIds[i]; 191 UUID objectId = objectIds[i];
191 192
@@ -195,21 +196,5 @@ namespace OpenSim.Region.OptionalModules.Avatar.Animations
195 cdt.AddToStringBuilder(sb); 196 cdt.AddToStringBuilder(sb);
196 sb.Append("\n"); 197 sb.Append("\n");
197 } 198 }
198
199 private string GetAnimName(IAssetService assetService, UUID animId)
200 {
201 string animName;
202
203 if (!DefaultAvatarAnimations.AnimsNames.TryGetValue(animId, out animName))
204 {
205 AssetMetadata amd = assetService.GetMetadata(animId.ToString());
206 if (amd != null)
207 animName = amd.Name;
208 else
209 animName = "Unknown";
210 }
211
212 return animName;
213 }
214 } 199 }
215} \ No newline at end of file 200} \ No newline at end of file
diff --git a/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs b/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
index 8b8758e..521141a 100644
--- a/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
+++ b/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
@@ -94,6 +94,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
94 "debug scene get", 94 "debug scene get",
95 "List current scene options.", 95 "List current scene options.",
96 "If active is false then main scene update and maintenance loops are suspended.\n" 96 "If active is false then main scene update and maintenance loops are suspended.\n"
97 + "If animations is true then extra animations debug information is logged.\n"
97 + "If collisions is false then collisions with other objects are turned off.\n" 98 + "If collisions is false then collisions with other objects are turned off.\n"
98 + "If pbackup is false then periodic scene backup is turned off.\n" 99 + "If pbackup is false then periodic scene backup is turned off.\n"
99 + "If physics is false then all physics objects are non-physical.\n" 100 + "If physics is false then all physics objects are non-physical.\n"
@@ -107,6 +108,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
107 "debug scene set active|collisions|pbackup|physics|scripting|teleport|updates true|false", 108 "debug scene set active|collisions|pbackup|physics|scripting|teleport|updates true|false",
108 "Turn on scene debugging options.", 109 "Turn on scene debugging options.",
109 "If active is false then main scene update and maintenance loops are suspended.\n" 110 "If active is false then main scene update and maintenance loops are suspended.\n"
111 + "If animations is true then extra animations debug information is logged.\n"
110 + "If collisions is false then collisions with other objects are turned off.\n" 112 + "If collisions is false then collisions with other objects are turned off.\n"
111 + "If pbackup is false then periodic scene backup is turned off.\n" 113 + "If pbackup is false then periodic scene backup is turned off.\n"
112 + "If physics is false then all physics objects are non-physical.\n" 114 + "If physics is false then all physics objects are non-physical.\n"
@@ -135,6 +137,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
135 { 137 {
136 ConsoleDisplayList cdl = new ConsoleDisplayList(); 138 ConsoleDisplayList cdl = new ConsoleDisplayList();
137 cdl.AddRow("active", m_scene.Active); 139 cdl.AddRow("active", m_scene.Active);
140 cdl.AddRow("animations", m_scene.DebugAnimations);
138 cdl.AddRow("pbackup", m_scene.PeriodicBackup); 141 cdl.AddRow("pbackup", m_scene.PeriodicBackup);
139 cdl.AddRow("physics", m_scene.PhysicsEnabled); 142 cdl.AddRow("physics", m_scene.PhysicsEnabled);
140 cdl.AddRow("scripting", m_scene.ScriptsEnabled); 143 cdl.AddRow("scripting", m_scene.ScriptsEnabled);
@@ -178,6 +181,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
178 m_scene.Active = active; 181 m_scene.Active = active;
179 } 182 }
180 183
184 if (options.ContainsKey("animations"))
185 {
186 bool active;
187
188 if (bool.TryParse(options["animations"], out active))
189 m_scene.DebugAnimations = active;
190 }
191
181 if (options.ContainsKey("pbackup")) 192 if (options.ContainsKey("pbackup"))
182 { 193 {
183 bool active; 194 bool active;