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
user_profiles
Justin Clark-Casey (justincc) 2013-01-18 23:22:02 +00:00
parent 74256c0cc4
commit 115e1c2abb
4 changed files with 48 additions and 24 deletions

View File

@ -86,7 +86,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation
if (m_scenePresence.IsChildAgent) if (m_scenePresence.IsChildAgent)
return; 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)) if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID))
SendAnimPack(); SendAnimPack();
@ -122,7 +125,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation
if (m_scenePresence.IsChildAgent) if (m_scenePresence.IsChildAgent)
return; 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, allowNoDefault)) if (m_animations.Remove(animID, allowNoDefault))
SendAnimPack(); SendAnimPack();
@ -145,9 +151,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation
public void ResetAnimations() public void ResetAnimations()
{ {
// m_log.DebugFormat( if (m_scenePresence.Scene.DebugAnimations)
// "[SCENE PRESENCE ANIMATOR]: Resetting animations for {0} in {1}", m_log.DebugFormat(
// m_scenePresence.Name, m_scenePresence.Scene.RegionInfo.RegionName); "[SCENE PRESENCE ANIMATOR]: Resetting animations for {0} in {1}",
m_scenePresence.Name, m_scenePresence.Scene.RegionInfo.RegionName);
m_animations.Clear(); m_animations.Clear();
} }
@ -558,5 +565,21 @@ namespace OpenSim.Region.Framework.Scenes.Animation
SendAnimPack(animIDs, sequenceNums, objectIDs); 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;
}
} }
} }

View File

@ -67,6 +67,11 @@ namespace OpenSim.Region.Framework.Scenes
public bool EmergencyMonitoring = false; public bool EmergencyMonitoring = false;
/// <summary>
/// Show debug information about animations.
/// </summary>
public bool DebugAnimations { get; set; }
/// <summary> /// <summary>
/// Show debug information about teleports. /// Show debug information about teleports.
/// </summary> /// </summary>

View File

@ -161,12 +161,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Animations
UUID defaultAnimId = anims.DefaultAnimation.AnimID; UUID defaultAnimId = anims.DefaultAnimation.AnimID;
cdl.AddRow( cdl.AddRow(
"Default anim", "Default anim",
string.Format("{0}, {1}", defaultAnimId, GetAnimName(sp.Scene.AssetService, defaultAnimId))); string.Format("{0}, {1}", defaultAnimId, sp.Animator.GetAnimName(defaultAnimId)));
UUID implicitDefaultAnimId = anims.ImplicitDefaultAnimation.AnimID; UUID implicitDefaultAnimId = anims.ImplicitDefaultAnimation.AnimID;
cdl.AddRow( cdl.AddRow(
"Implicit default anim", "Implicit default anim",
string.Format("{0}, {1}", implicitDefaultAnimId, GetAnimName(sp.Scene.AssetService, implicitDefaultAnimId))); string.Format("{0}, {1}",
implicitDefaultAnimId, sp.Animator.GetAnimName(implicitDefaultAnimId)));
cdl.AddToStringBuilder(sb); cdl.AddToStringBuilder(sb);
@ -185,7 +186,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Animations
for (int i = 0; i < animIds.Length; i++) for (int i = 0; i < animIds.Length; i++)
{ {
UUID animId = animIds[i]; UUID animId = animIds[i];
string animName = GetAnimName(sp.Scene.AssetService, animId); string animName = sp.Animator.GetAnimName(animId);
int seq = sequenceNumbers[i]; int seq = sequenceNumbers[i];
UUID objectId = objectIds[i]; UUID objectId = objectIds[i];
@ -195,21 +196,5 @@ namespace OpenSim.Region.OptionalModules.Avatar.Animations
cdt.AddToStringBuilder(sb); cdt.AddToStringBuilder(sb);
sb.Append("\n"); sb.Append("\n");
} }
private string GetAnimName(IAssetService assetService, UUID animId)
{
string animName;
if (!DefaultAvatarAnimations.AnimsNames.TryGetValue(animId, out animName))
{
AssetMetadata amd = assetService.GetMetadata(animId.ToString());
if (amd != null)
animName = amd.Name;
else
animName = "Unknown";
}
return animName;
}
} }
} }

View File

@ -94,6 +94,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
"debug scene get", "debug scene get",
"List current scene options.", "List current scene options.",
"If active is false then main scene update and maintenance loops are suspended.\n" "If active is false then main scene update and maintenance loops are suspended.\n"
+ "If animations is true then extra animations debug information is logged.\n"
+ "If collisions is false then collisions with other objects are turned off.\n" + "If collisions is false then collisions with other objects are turned off.\n"
+ "If pbackup is false then periodic scene backup is turned off.\n" + "If pbackup is false then periodic scene backup is turned off.\n"
+ "If physics is false then all physics objects are non-physical.\n" + "If physics is false then all physics objects are non-physical.\n"
@ -107,6 +108,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
"debug scene set active|collisions|pbackup|physics|scripting|teleport|updates true|false", "debug scene set active|collisions|pbackup|physics|scripting|teleport|updates true|false",
"Turn on scene debugging options.", "Turn on scene debugging options.",
"If active is false then main scene update and maintenance loops are suspended.\n" "If active is false then main scene update and maintenance loops are suspended.\n"
+ "If animations is true then extra animations debug information is logged.\n"
+ "If collisions is false then collisions with other objects are turned off.\n" + "If collisions is false then collisions with other objects are turned off.\n"
+ "If pbackup is false then periodic scene backup is turned off.\n" + "If pbackup is false then periodic scene backup is turned off.\n"
+ "If physics is false then all physics objects are non-physical.\n" + "If physics is false then all physics objects are non-physical.\n"
@ -135,6 +137,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
{ {
ConsoleDisplayList cdl = new ConsoleDisplayList(); ConsoleDisplayList cdl = new ConsoleDisplayList();
cdl.AddRow("active", m_scene.Active); cdl.AddRow("active", m_scene.Active);
cdl.AddRow("animations", m_scene.DebugAnimations);
cdl.AddRow("pbackup", m_scene.PeriodicBackup); cdl.AddRow("pbackup", m_scene.PeriodicBackup);
cdl.AddRow("physics", m_scene.PhysicsEnabled); cdl.AddRow("physics", m_scene.PhysicsEnabled);
cdl.AddRow("scripting", m_scene.ScriptsEnabled); cdl.AddRow("scripting", m_scene.ScriptsEnabled);
@ -178,6 +181,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
m_scene.Active = active; m_scene.Active = active;
} }
if (options.ContainsKey("animations"))
{
bool active;
if (bool.TryParse(options["animations"], out active))
m_scene.DebugAnimations = active;
}
if (options.ContainsKey("pbackup")) if (options.ContainsKey("pbackup"))
{ {
bool active; bool active;