From 10b3c6b5aacb27d40bca803dffa2d2384091ff9a Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 18 Jan 2013 23:22:02 +0000
Subject: Add "debug set set animations true|false" region console command.
Setting this logs extra information about animation add/remove, such as uuid and animation name
Unfortunately cannot be done per client yet
---
.../Scenes/Animation/ScenePresenceAnimator.cs | 33 ++++++++++++++++++----
OpenSim/Region/Framework/Scenes/Scene.cs | 5 ++++
2 files changed, 33 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
index 5b16b67..8bd3cf9 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
if (m_scenePresence.IsChildAgent)
return;
-// m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Adding animation {0} for {1}", animID, m_scenePresence.Name);
+ if (m_scenePresence.Scene.DebugAnimations)
+ m_log.DebugFormat(
+ "[SCENE PRESENCE ANIMATOR]: Adding animation {0} {1} for {2}",
+ GetAnimName(animID), animID, m_scenePresence.Name);
if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID))
SendAnimPack();
@@ -114,7 +117,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation
if (m_scenePresence.IsChildAgent)
return;
-// m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Removing animation {0} for {1}", animID, m_scenePresence.Name);
+ if (m_scenePresence.Scene.DebugAnimations)
+ m_log.DebugFormat(
+ "[SCENE PRESENCE ANIMATOR]: Removing animation {0} {1} for {2}",
+ GetAnimName(animID), animID, m_scenePresence.Name);
if (m_animations.Remove(animID))
SendAnimPack();
@@ -137,9 +143,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation
public void ResetAnimations()
{
-// m_log.DebugFormat(
-// "[SCENE PRESENCE ANIMATOR]: Resetting animations for {0} in {1}",
-// m_scenePresence.Name, m_scenePresence.Scene.RegionInfo.RegionName);
+ if (m_scenePresence.Scene.DebugAnimations)
+ m_log.DebugFormat(
+ "[SCENE PRESENCE ANIMATOR]: Resetting animations for {0} in {1}",
+ m_scenePresence.Name, m_scenePresence.Scene.RegionInfo.RegionName);
m_animations.Clear();
}
@@ -550,5 +557,21 @@ namespace OpenSim.Region.Framework.Scenes.Animation
SendAnimPack(animIDs, sequenceNums, objectIDs);
}
+
+ public string GetAnimName(UUID animId)
+ {
+ string animName;
+
+ if (!DefaultAvatarAnimations.AnimsNames.TryGetValue(animId, out animName))
+ {
+ AssetMetadata amd = m_scenePresence.Scene.AssetService.GetMetadata(animId.ToString());
+ if (amd != null)
+ animName = amd.Name;
+ else
+ animName = "Unknown";
+ }
+
+ return animName;
+ }
}
}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 0c8aa6c..f87d469 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -68,6 +68,11 @@ namespace OpenSim.Region.Framework.Scenes
public bool EmergencyMonitoring = false;
///
+ /// Show debug information about animations.
+ ///
+ public bool DebugAnimations { get; set; }
+
+ ///
/// Show debug information about teleports.
///
public bool DebugTeleporting { get; set; }
--
cgit v1.1