- Qt 6.7
- Qt 3D
- QML Types
- Qt3D.Animation
- AnimationController
- Qt 6.7.2 Reference Documentation

# AnimationController QML Type

A controller type for animations. More...

Import Statement: | import Qt3D.Animation 2.7
Instantiates: | QAnimationController

- List of all members, including inherited members

## Properties

- activeAnimationGroup : int
- animationGroups : list<AnimationGroup>
- entity : Entity
- position : real
- positionOffset : real
- positionScale : real
- recursive : bool

## Methods

- int getAnimationIndex(name)
- AnimationGroup getGroup(index)

## Detailed Description

AnimationController type controls the selection and playback of animations. The type can be used to find all animations from Entity tree and create AnimationGroups from the animations with the same name. The user can select which animation group is currently controlled with the animation controller by setting the active animation. The animation position is then propagated to that group after scaling and offsetting the provided position value with the positionScale and positionOffset values.

Note: that the animation controller doesn't have internal timer, but instead the user is responsible for updating the position property in timely manner.

## Property Documentation

activeAnimationGroup : int

Holds the currectly active animation group.

animationGroups : list<AnimationGroup>

Holds the list of animation groups in the controller.

entity : Entity

Holds the entity animations are gathered and grouped from. If the controller already holds animations, they are cleared.

position : real

Holds the current position of the animation. When the position is set, it is scaled and offset with positionScale/positionOffset and propagated to the active animation group.

positionOffset : real

Holds the position offset of the animation.

positionScale : real

Holds the position scale of the animation.

recursive : bool

Holds whether the recursively search the entity tree when gathering animations from the entity. If set to true, the animations are searched also from the child entities of the entity. If set to false, only the entity passed to the controller is searched.

## Method Documentation

int getAnimationIndex(name)

Returns the index of the animation with name. Returns -1 if no AnimationGroup with the given name is found.

AnimationGroup getGroup(index)

Returns the AnimationGroup with the given index.