From c1fa7592c751005cde427fc0f4bf7b683d0eefe5 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 15 Aug 2008 21:18:08 +0000 Subject: Pantis #1957 Thank you, Leaf, for a patch that implements llGetAnimationList() XEngine implementation added by myself. --- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 9 +++++++++ OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 14 +++++++++++--- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 14 +++++++++++--- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index b4cf70a..b22643f 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -39,6 +39,7 @@ using OpenSim.Framework.Communications.Cache; using OpenSim.Region.Environment.Types; using OpenSim.Region.Physics.Manager; + namespace OpenSim.Region.Environment.Scenes { enum ScriptControlled : int @@ -1346,6 +1347,14 @@ namespace OpenSim.Region.Environment.Scenes RemoveAnimation(animID); } + + public LLUUID[] GetAnimationArray() + { + LLUUID[] animIDs; + int[] sequenceNums; + m_animations.GetArrays( out animIDs, out sequenceNums ); + return animIDs; + } public void HandleStartAnim(IClientAPI remoteClient, LLUUID animID) { diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index f6cc7f0..32e9085 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -5698,11 +5698,19 @@ namespace OpenSim.Region.ScriptEngine.Common return (double)Math.Log(val); } - public LSL_Types.list llGetAnimationList(string id) + public LSL_Types.list llGetAnimationList( string id ) { m_host.AddScriptLPS(1); - NotImplemented("llGetAnimationList"); - return new LSL_Types.list(); + + LSL_Types.list l = new LSL_Types.list(); + ScenePresence av = World.GetScenePresence(id); + if( av == null ) + return l; + LLUUID[] anims; + anims = av.GetAnimationArray(); + foreach( LLUUID foo in anims ) + l.Add( foo.ToString() ); + return l; } public void llSetParcelMusicURL(string url) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 09377a1..15793e4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -5502,11 +5502,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return (double)Math.Log(val); } - public LSL_Types.list llGetAnimationList(string id) + public LSL_Types.list llGetAnimationList( string id ) { m_host.AddScriptLPS(1); - NotImplemented("llGetAnimationList"); - return new LSL_Types.list(); + + LSL_Types.list l = new LSL_Types.list(); + ScenePresence av = World.GetScenePresence(id); + if( av == null ) + return l; + LLUUID[] anims; + anims = av.GetAnimationArray(); + foreach( LLUUID foo in anims ) + l.Add( foo.ToString() ); + return l; } public void llSetParcelMusicURL(string url) -- cgit v1.1