LSL Wiki Mirror 10-5-2006: llGetAnimationList

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings ::
list llGetAnimationList(key id)

Returns a list of keys of all playing animations for avatar id.

llStopAnimation or llStartAnimation may be useful here.

Example:
// stops all currently running animations when clicked
default {
    touch_start(integer num_detected) {
        llRequestPermissions(llDetectedKey(0), PERMISSION_TRIGGER_ANIMATION);
    }

    run_time_permissions(integer perm) {
        if(perm & PERMISSION_TRIGGER_ANIMATION)
        {
            list anims = llGetAnimationList(llGetPermissionsKey());        // get list of animations
            integer len = llGetListLength(anims);
            integer i;
            
            llSay(0, "Stopping " + (string)len + llGetSubString(" animations",0,-1 - (len == 1)));//strip the "s" when there is only 1 to stop.
            for (i = 0; i < len; ++i) llStopAnimation(llList2Key(anims, i));
            llSay(0, "Done");
        }
    }
}


Functions | Agent/Avatar | Animation
There are 2 comments on this page. [Display comments/form]