pluginiPlugin

Model Animations

Learn about the mechanics of model animation playback

Model Animation Trigger Mechanism

There are two main ways to trigger model animations:

  • Directly invoking model animations using Kether scripts.
  • Using the interaction feedback mechanism between pet behaviors and model animations.

Triggering Animations with Kether Scripts

When playing model animations through Kether scripts, the animation is played forcefully.

Example of use:

pet select <pet_name>
pet animation <action>

When using Kether scripts to play model animations, you must ensure that the corresponding model animation is defined in the pet's configuration.

Kether scripts cannot play animations that are not defined in the configuration.

For example:

imiPetCore/pet/xxx.yml
pet:
  model:
    state:
      - id: attack
        lerpin: 0
        lerpout: 1
        speed: 1.0
      - id: lookowner
        time: 3

In the configuration above, a valid Kether call would be:

pet animation attack

However, the following call would be invalid because the model.state does not include an abab action:

pet animation abab

Interaction Feedback

Model animations can also be triggered automatically through the pet's behaviors. This approach relies on the interaction between behavior actions and model states as configured.

imiPetCore/pet/xxx.yml
pet:
  action:
    - id: attack
      priority: 11
    - id: walk
      priority: 10
    - id: lookowner
      priority: 9
  model:
    state:
      - id: attack
        lerpin: 0
        lerpout: 1
        speed: 1.0
      - id: lookowner
        time: 3

From the configuration above, you can see that the pet's behavior actions (pet.action) include: attack, walk, and lookowner.

Meanwhile, the model states (model.state) define animations for attack and lookowner.

Based on this configuration, when the pet performs different actions, the following effects occur:

  • When performing the attack action: The model plays the attack animation, as it is defined in model.state.
  • When performing the walk action: No model animation is played because walk is not defined in model.state.
  • When performing the lookowner action: The model plays the lookowner animation, as defined in the configuration.

This interaction mechanism allows pets to automatically display corresponding animations when performing specific behaviors, enhancing interactivity and visual appeal.

On this page