LlGetAnimationList/fr - Second Life Wiki

LlGetAnimationList/fr

From Second Life Wiki

Jump to: navigation, search

Fonction: list llGetAnimationList( key id );

Renvoie un de toutes les animations jouées (actuellement) par l'avatar identifié par sa clé id.

• key id UUID d'avatar qui est dans la même region

Inconvénients

  • Il n'existe aucune fonction ou mécanique interne pour obtenir le nom d'une animation jouée.

Exemples

Cet exemple est quelque peu complexe, mais il n'y a pas beaucoup d'applications simples de cette fonction.

// Remplacement simple de l'animation de marche (AO, Animation Overrider)
 
key vieille_anim = "6ed24bd8-91aa-4b12-ccc7-c97c857ab4e0";
string nouvelle_anim = "yoga_float";
integer etat;
list verif;
key proprio;
 
default
{
    state_entry()
    {
        proprio = llGetOwner();
        llRequestPermissions(proprio, PERMISSION_TRIGGER_ANIMATION);
        verif = [ vieille_anim ];
    }
 
    run_time_permissions(integer p)
    {
        if (p & PERMISSION_TRIGGER_ANIMATION)
        {
            llSetTimerEvent(0.2);
        }
    }
 
    timer()
    {
        if (llGetAgentInfo(proprio) & AGENT_WALKING)
        {
            list anims = llGetAnimationList(proprio);
            if (~llListFindList(anims, verif))
            {
                etat = 1;
                llStartAnimation(nouvelle_anim);
                llStopAnimation(vieille_anim);
            }
        }
        else if (etat)
        {
            llStopAnimation(nouvelle_anim);
            etat = 0;
        }
    }
 
    on_rez(integer p)
    {
        llResetScript();
    }
}

Voir également

Fonctions

•  llGetAgentInfo Renvoie des informations sur l'avatar
•  llGetAnimation Renvoie une information simplifiée à outrance sur l'animation en cours
•  llStartAnimation Lance une animation
•  llStopAnimation Stoppe une animation en cours