QAnimationController#
A controller class for animations. More…
Synopsis#
Properties#
Functions#
def
activeAnimationGroup
()def
addAnimationGroup
(animationGroups)def
animationGroupList
()def
entity
()def
getAnimationIndex
(name)def
getGroup
(index)def
position
()def
positionOffset
()def
positionScale
()def
recursive
()def
removeAnimationGroup
(animationGroups)def
setAnimationGroups
(animationGroups)
Slots#
def
setActiveAnimationGroup
(index)def
setEntity
(entity)def
setPosition
(position)def
setPositionOffset
(offset)def
setPositionScale
(scale)def
setRecursive
(recursive)
Signals#
def
activeAnimationGroupChanged
(index)def
entityChanged
(entity)def
positionChanged
(position)def
positionOffsetChanged
(offset)def
positionScaleChanged
(scale)def
recursiveChanged
(recursive)
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.
- class PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController([parent=None])#
- Parameters:
parent –
PySide6.QtCore.QObject
Constructs a new QAnimationController
with parent
.
Note
Properties can be used directly when from __feature__ import true_property
is used or via accessor functions otherwise.
- property PᅟySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.activeAnimationGroup: int#
Holds the currectly active animation group.
- Access functions:
setActiveAnimationGroup
(index)Signal
activeAnimationGroupChanged
(index)
- property PᅟySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.entity: PySide6.Qt3DCore.Qt3DCore.QEntity#
Holds the entity animations are gathered and grouped from. If the controller already holds animations, they are cleared.
- Access functions:
entity
()setEntity
(entity)Signal
entityChanged
(entity)
- property PᅟySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.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:
position
()setPosition
(position)Signal
positionChanged
(position)
- property PᅟySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.positionOffset: float#
Holds the position offset of the animation.
- Access functions:
setPositionOffset
(offset)Signal
positionOffsetChanged
(offset)
- property PᅟySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.positionScale: float#
Holds the position scale of the animation.
- Access functions:
setPositionScale
(scale)Signal
positionScaleChanged
(scale)
- property PᅟySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.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:
recursive
()setRecursive
(recursive)Signal
recursiveChanged
(recursive)
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.activeAnimationGroup()#
- Return type:
int
See also
Getter of property activeAnimationGroup
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.activeAnimationGroupChanged(index)#
- Parameters:
index – int
Notification signal of property activeAnimationGroup
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.addAnimationGroup(animationGroups)#
- Parameters:
animationGroups –
PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationGroup
Adds the given animationGroup
to the controller.
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.animationGroupList()#
- Return type:
.list of Qt3DAnimation.QAnimationGroup
Returns the list of animation groups the conroller is currently holding.
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.entity()#
- Return type:
See also
Getter of property entity
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.entityChanged(entity)#
- Parameters:
entity –
PySide6.Qt3DCore.Qt3DCore.QEntity
Notification signal of property entity
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.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.
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.getGroup(index)#
- Parameters:
index – int
- Return type:
Returns the AnimationGroup with the given index
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.position()#
- Return type:
float
See also
Getter of property position
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.positionChanged(position)#
- Parameters:
position – float
Notification signal of property position
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.positionOffset()#
- Return type:
float
See also
Getter of property positionOffset
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.positionOffsetChanged(offset)#
- Parameters:
offset – float
Notification signal of property positionOffset
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.positionScale()#
- Return type:
float
See also
Getter of property positionScale
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.positionScaleChanged(scale)#
- Parameters:
scale – float
Notification signal of property positionScale
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.recursive()#
- Return type:
bool
See also
Getter of property recursive
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.recursiveChanged(recursive)#
- Parameters:
recursive – bool
Notification signal of property recursive
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.removeAnimationGroup(animationGroups)#
- Parameters:
animationGroups –
PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationGroup
Removes the given animationGroup
from the controller.
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.setActiveAnimationGroup(index)#
- Parameters:
index – int
See also
Setter of property activeAnimationGroup
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.setAnimationGroups(animationGroups)#
- Parameters:
animationGroups – .list of Qt3DAnimation.QAnimationGroup
Sets the animationGroups
for the controller. Old groups are cleared.
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.setEntity(entity)#
- Parameters:
entity –
PySide6.Qt3DCore.Qt3DCore.QEntity
See also
Setter of property entity
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.setPosition(position)#
- Parameters:
position – float
See also
Setter of property position
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.setPositionOffset(offset)#
- Parameters:
offset – float
See also
Setter of property positionOffset
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.setPositionScale(scale)#
- Parameters:
scale – float
See also
Setter of property positionScale
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationController.setRecursive(recursive)#
- Parameters:
recursive – bool
See also
Setter of property recursive
.