user: What is Animations and how is it used in Blender Python scripting?

assistant: A glTF animation changes the transforms of objects or pose bones, or the values of shape keys.
One animation can affect multiple objects, and there can be multiple animations in a glTF file.

### Import

Imported models are set up so that the first animation in the file is playing automatically.
Scrub the Timeline to see it play.

When the file contains multiple animations, the rest will be organized using
the [Nonlinear Animation editor](../../editors/nla/tracks.xhtml). Each animation
becomes an action stashed to an NLA track. The track name is the name of the glTF animation.
To make the animation within that track visible, click Solo (star icon) next to the track you want to play.

[image reference removed]

This is the [fox sample model](https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/Fox)
showing its “Run” animation.

If an animation affects multiple objects, it will be broken up into multiple parts.
The part of the animation that affects one object becomes an action stashed on that object.
Use the track names to tell which actions are part of the same animation.
To play the whole animation, you need to enable Solo (star icon) for all its tracks.

Each animation will be imported as a single action, with multiple slots if the animation affects multiple objects.
One slot will be created for TRS, one for shape keys, etc…

You can find more information about action slots in [Animation](../../animation/actions.xhtml).

You can also use the animation switcher that can be found in [Dope Sheet editor](../../editors/dope_sheet/index.xhtml).

You can switch all animation imported. It automatically enables Solo (star icon) for all needed tracks.
It also reset non animated object to Rest transformation.

### Export

You can export animations using different ways. How glTF animations are made from actions / NLA is controlled by
the Animation ‣ Mode export option.

#### Actions (default)

An action will be exported if it is the active action on an object, or it is stashed to an NLA track
(e.g. with the *Stash* or *Push Down* buttons in the [Action Editor](../../editors/dope_sheet/modes/action.xhtml)).
Actions which are **not** associated with an object in one of these ways are **not exported**.
If you have multiple actions you want to export, make sure they are stashed!

A glTF animation can have a name, which is the action name by default. You can override it
by renaming its NLA track from `NLATrack`/`[Action Stash]` to the name you want to use.
For example, the Fig. [fox model](#fig-gltf-solo-track) will export with three animations,
“Survey”, “Walk”, and “Run”.
If you rename two tracks on two different objects to the same name, they will become part
of the same glTF animation and will play together.

The importer organizes actions so they will be exported correctly with this mode.

This mode is useful if you are exporting for game engine, with an animation library of a character.
Each action must be on its own NLA track.

Before Blender 4.4, tracks was merged regarding their name.
With Blender 4.4, and the introduction of slotted actions, this default behavior has been changed.
Now, tracks are merged by the action they are using, and not by their name.
You can find more information about action slots in [Animation](../../animation/actions.xhtml).

#### Active Actions merged

In this mode, the NLA organization is not used, and only one animation is exported using
the active actions on all objects.

#### NLA Tracks

In this mode, each NLA Track will be export as an independent glTF animation.
This mode is useful if you are using Strip modifiers, or if you get multiple action on a same Track.

If you rename two tracks on two different objects to the same name, they will become part
of the same glTF animation and will play together.

#### Scene

Using [Scene](#scene) option, animations will be exported as you can see them in viewport.
You can choose to export a single glTF animation, or each object separately.