class QAnimationController

A controller class for animations. More

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController

Synopsis

Properties

Methods

Slots

Signals

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

QAnimationController class controls the selection and playback of animations. The class can be used to find all animations from QEntity tree and create QAnimationGroups 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.

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property activeAnimationGroupᅟ: int

Holds the currectly active animation group.

Access functions:
property entityᅟ: QEntity

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

Access functions:
property positionᅟ: float

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.

Access functions:
property positionOffsetᅟ: float

Holds the position offset of the animation.

Access functions:
property positionScaleᅟ: float

Holds the position scale of the animation.

Access functions:
property 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.

Access functions:
__init__([parent=None])
Parameters:

parentQObject

Constructs a new QAnimationController with parent.

activeAnimationGroup()
Return type:

int

See also

setActiveAnimationGroup()

Getter of property activeAnimationGroupᅟ .

activeAnimationGroupChanged(index)
Parameters:

index – int

Notification signal of property activeAnimationGroupᅟ .

addAnimationGroup(animationGroups)
Parameters:

animationGroupsQAnimationGroup

Adds the given animationGroup to the controller.

animationGroupList()
Return type:

.list of Qt3DAnimation.QAnimationGroup

Returns the list of animation groups the conroller is currently holding.

entity()
Return type:

QEntity

See also

setEntity()

Getter of property entityᅟ .

entityChanged(entity)
Parameters:

entityQEntity

Notification signal of property entityᅟ .

getAnimationIndex(name)
Parameters:

name – str

Return type:

int

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

getGroup(index)
Parameters:

index – int

Return type:

QAnimationGroup

Returns the AnimationGroup with the given index.

position()
Return type:

float

See also

setPosition()

Getter of property positionᅟ .

positionChanged(position)
Parameters:

position – float

Notification signal of property positionᅟ .

positionOffset()
Return type:

float

See also

setPositionOffset()

Getter of property positionOffsetᅟ .

positionOffsetChanged(offset)
Parameters:

offset – float

Notification signal of property positionOffsetᅟ .

positionScale()
Return type:

float

See also

setPositionScale()

Getter of property positionScaleᅟ .

positionScaleChanged(scale)
Parameters:

scale – float

Notification signal of property positionScaleᅟ .

recursive()
Return type:

bool

See also

setRecursive()

Getter of property recursiveᅟ .

recursiveChanged(recursive)
Parameters:

recursive – bool

Notification signal of property recursiveᅟ .

removeAnimationGroup(animationGroups)
Parameters:

animationGroupsQAnimationGroup

Removes the given animationGroup from the controller.

setActiveAnimationGroup(index)
Parameters:

index – int

See also

activeAnimationGroup()

Setter of property activeAnimationGroupᅟ .

setAnimationGroups(animationGroups)
Parameters:

animationGroups – .list of Qt3DAnimation.QAnimationGroup

Sets the animationGroups for the controller. Old groups are cleared.

setEntity(entity)
Parameters:

entityQEntity

See also

entity()

Setter of property entityᅟ .

setPosition(position)
Parameters:

position – float

See also

position()

Setter of property positionᅟ .

setPositionOffset(offset)
Parameters:

offset – float

See also

positionOffset()

Setter of property positionOffsetᅟ .

setPositionScale(scale)
Parameters:

scale – float

See also

positionScale()

Setter of property positionScaleᅟ .

setRecursive(recursive)
Parameters:

recursive – bool

See also

recursive()

Setter of property recursiveᅟ .