28 using System.Collections.Generic;
29 using System.Reflection;
40 public static readonly
string DefaultAnimationsPath =
"data/avataranimations.xml";
42 public static Dictionary<string, UUID> AnimsUUID =
new Dictionary<string, UUID>();
43 public static Dictionary<UUID, string> AnimsNames =
new Dictionary<UUID, string>();
44 public static Dictionary<UUID, string> AnimStateNames =
new Dictionary<UUID, string>();
48 LoadAnimations(DefaultAnimationsPath);
55 private static void LoadAnimations(
string path)
59 using (XmlTextReader reader =
new XmlTextReader(path))
61 XmlDocument doc =
new XmlDocument();
65 foreach (XmlNode nod
in doc.DocumentElement.ChildNodes)
67 if (nod.Attributes[
"name"] != null)
69 string name = nod.Attributes[
"name"].Value;
70 UUID
id = (UUID)nod.InnerText;
71 string animState = (
string)nod.Attributes[
"state"].Value;
73 AnimsUUID.Add(name, id);
74 AnimsNames.Add(id, name);
76 AnimStateNames.Add(id, animState);
97 if (AnimsUUID.ContainsKey(name))
102 return AnimsUUID[name];
114 string ret =
"unknown";
115 if (AnimsUUID.ContainsValue(uuid))
117 foreach (KeyValuePair<string, UUID> kvp
in AnimsUUID)
119 if (kvp.Value == uuid)
128 ret = uuid.ToString();
static string GetDefaultAnimationName(UUID uuid)
Get the name of the animation given a UUID. If there is no matching animation return the UUID as a st...
static UUID GetDefaultAnimation(string name)
Get the default avatar animation with the given name.
OpenSim.Framework.Animation Animation