diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index b4cf70a5dc..b22643fa97 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 f6cc7f0260..32e9085f28 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 09377a16fa..15793e47db 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)