Read animation data from avataranimations.xml to allow default animations
to be started and stopped by name from scripts.
0.6.0-stable
Melanie Thielker 2008-09-13 19:51:56 +00:00
parent ae9e4e8144
commit 8830b8b72c
3 changed files with 15 additions and 6 deletions

View File

@ -33,6 +33,7 @@ using System.Reflection;
using System.Text;
using System.Threading;
using System.Timers;
using System.Xml;
using OpenMetaverse;
using OpenMetaverse.Packets;
using log4net;
@ -3478,6 +3479,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private void InitDefaultAnimations()
{
using (XmlTextReader reader = new XmlTextReader("data/avataranimations.xml"))
{
XmlDocument doc = new XmlDocument();
doc.Load(reader);
foreach (XmlNode nod in doc.DocumentElement.ChildNodes)
{
if (nod.Attributes["name"] != null)
{
string name = (string)nod.Attributes["name"].Value.ToLower();
string id = (string)nod.InnerText;
m_defaultAnimations.Add(name, id);
}
}
}
}
public UUID GetDefaultAnimation(string name)

View File

@ -2660,9 +2660,6 @@ namespace OpenSim.Region.ScriptEngine.Common
animID=InventoryKey(anim);
}
if (animID == UUID.Zero)
return;
ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter);
if (presence != null)

View File

@ -2497,9 +2497,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
animID=InventoryKey(anim);
}
if (animID == UUID.Zero)
return;
ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter);
if (presence != null)