Kuesa Runtime

AnimationPlayer QML Type

Play animations defined in glTF files. More...

Since: Kuesa 1.0
Instantiates: AnimationPlayer

Properties

Detailed Description

AnimationPlayer is a utility class designed to easily control animations where the clip and mapping data is stored in a collections (typically loaded from glTF files).

Clip and mapper data are referenced by name. These will be used to look up actual assets in the appropriate collection.

AnimationPlayer internally uses an instance of Qt3DAnimation::QClipAnimator and mirrors it's api.

Additionally, AnimationPlayer can be used to map clip data to other target objects than those specified in a mapper. For example, an animation where the clip data affect transformation properties, can be applied to any Qt3DCore::QTransform instance, not just the one specified in the mapper data.

Property Documentation

clip : string

the name of the clip asset.

This will be used to lookup the asset in the AnimationClipCollection instance of the SceneEntity.


clock : Clock

intense of Qt3DAnimation::QClock used to control animation speed and direction

A Qt3DAnimation::QClock can be used to control the speed (by setting the playBackRate) and direction (like reversing by setting negative playBackRate values) of the animation.

This reflects the state of the internal Qt3DAnimation::QClipAnimator instance.


duration : float

duration of the animation in secconds

This property was introduced in Qt 1.1.


loops : int

controls the number of time the animation should repeat.

If the value is 0 (default), the animation will run only once.

If the value is AnimationPlayer::Infinite, the animation will loop indefinitly until explicitly stopped.

Otherwise, it will repeat the specified number of times.

This reflects the state of the internal Qt3DAnimation::QClipAnimator instance.


mapper : string

the name of the mapper asset.

This will be used to lookup the asset in the AnimationMappingCollection instance of the SceneEntity.

If empty (default), the name of the clip will be used as it is a common convention that they should match.


normalizedTime : float

progress of the animation as a uniform value between 0. and 1.

This reflects the state of the internal Qt3DAnimation::QClipAnimator instance.


running : bool

controls if the animation is running or not

This reflects the state of the internal Qt3DAnimation::QClipAnimator instance.


status : enumeration

the current status of the player

  • None Unknown state (default).
  • Ready Both clip and mapper data have been found and are valid (included target nodes if they have been defined).
  • Error An error occurred when looking for assets or trying to match clip and mapper properties.