LlGetAnimationList

From Second Life Wiki

Jump to: navigation, search

Template:Needs Translation/LSL/de Template:Needs Translation/LSL/es Template:Needs Translation/LSL/el Template:Needs Translation/LSL/he Template:Needs Translation/LSL/it Template:Needs Translation/LSL/ko Template:Needs Translation/LSL/nl Template:Needs Translation/LSL/hu Template:Needs Translation/LSL/no Template:Needs Translation/LSL/da Template:Needs Translation/LSL/sv Template:Needs Translation/LSL/tr Template:Needs Translation/LSL/pl Template:Needs Translation/LSL/pt Template:Needs Translation/LSL/ru Template:Needs Translation/LSL/uk Template:Needs Translation/LSL/zh-Hans Template:Needs Translation/LSL/zh-Hant

Contents

Summary

Function: list llGetAnimationList( key id );
266 Function ID
0.0 Delay
10.0 Energy

Returns a list of keys of playing animations for avatar described by the key id.

• key id avatar UUID that is in the same region

Caveats

  • There is no internal mechanism to get the name of the animations playing.
  • Standard animations can be started and stopped by scripts, so the list returned may not accurately reflect the avatar's state. Use llGetAgentInfo and llGetAnimation when this matters.
  • Some motions are local to the viewer and cannot be detected by scripts.

Search JIRA for related Bugs

Examples

This example is a bit involved but there aren't many applications for this function.

//Simple Animation Override for Walk
key old_anim = "6ed24bd8-91aa-4b12-ccc7-c97c857ab4e0";
string new_anim="yoga_float";
integer status;
list check;
key owner;
 
default
{
    state_entry()
    {
        owner = llGetOwner();
        llRequestPermissions(owner, PERMISSION_TRIGGER_ANIMATION);
        check = [old_anim];
    }
 
    run_time_permissions(integer p)
    {
        if(p & PERMISSION_TRIGGER_ANIMATION)
        {
            llSetTimerEvent(0.2);
        }
    }
 
    timer()
    {
        if(llGetAgentInfo(owner) & AGENT_WALKING)
        {
            list anims = llGetAnimationList(owner);
            if(~llListFindList(anims, check))
            {
                status = 1;
                llStartAnimation(new_anim);
                llStopAnimation(old_anim);
            }
        }
        else if(status)
        {
            llStopAnimation(new_anim);
            status = 0;
        }
    }
 
    on_rez(integer p)
    {
        llResetScript();
    }
}

See Also

Functions

•  llGetAgentInfo Gets the avatar info
•  llGetAnimation Get the avatar's base animation state
•  llStartAnimation Start an animation on an avatar
•  llStopAnimation Stop an animation playing on an avatar

Deep Notes

This article wasn't helpful for you? Maybe the related article at the LSL Wiki is able to bring enlightenment.
In other languages