PySide6.Qt3DAnimation.Qt3DAnimation

class Qt3DAnimation

Contains classes from the Qt3DAnimation module. More_

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

class QMorphTarget

A class providing morph targets to blend-shape animation. More_

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QMorphTarget

Synopsis

Properties

Methods

Signals

Static functions

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

A QMorphTarget class is a convenience class, which provides a list of QAttributes , which the QMorphingAnimation uses to animate geometry. A QMorphTarget can also be created based on existing QGeometry .

Note

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

property attributeNamesᅟ: list of strings

Holds a list of attribute names contained in the morph target.

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

parentQObject

Constructs a QMorphTarget with given parent.

addAttribute(attribute)
Parameters:

attributeQAttribute

Adds an attribute the morph target. An attribute with the same name must not have been added previously to the morph target.

attributeList()
Return type:

.list of Qt3DCore.QAttribute

Returns a list of attributes contained in the morph target.

attributeNames()
Return type:

list of strings

Getter of property attributeNamesᅟ .

attributeNamesChanged(attributeNames)
Parameters:

attributeNames – list of strings

Notification signal of property attributeNamesᅟ .

static fromGeometry(geometry, attributes)
Parameters:
  • geometryQGeometry

  • attributes – list of strings

Return type:

QMorphTarget

Returns a morph target based on the attributes in the given geometry.

removeAttribute(attribute)
Parameters:

attributeQAttribute

Removes an attribute from the morph target.

setAttributes(attributes)
Parameters:

attributes – .list of Qt3DCore.QAttribute

Sets attributes to the morph target. Old attributes are cleared.

class QKeyFrame

A base class for handling keyframes. More_

Synopsis

Methods

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

class InterpolationType
__init__()
__init__(coords)
Parameters:

coordsQVector2D

__init__(coords, lh, rh)
Parameters:
coordinates()
Return type:

QVector2D

interpolationType()
Return type:

InterpolationType

leftControlPoint()
Return type:

QVector2D

__ne__(rhs)
Parameters:

rhsQKeyFrame

Return type:

bool

__eq__(rhs)
Parameters:

rhsQKeyFrame

Return type:

bool

rightControlPoint()
Return type:

QVector2D

setCoordinates(coords)
Parameters:

coordsQVector2D

setInterpolationType(interp)
Parameters:

interpInterpolationType

setLeftControlPoint(lh)
Parameters:

lhQVector2D

setRightControlPoint(rh)
Parameters:

rhQVector2D

class QClock

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QClock

Synopsis

Properties

Methods

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

Note

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

property playbackRateᅟ: float
Access functions:
__init__([parent=None])
Parameters:

parentQNode

playbackRate()
Return type:

float

Getter of property playbackRateᅟ .

playbackRateChanged(playbackRate)
Parameters:

playbackRate – float

Notification signal of property playbackRateᅟ .

setPlaybackRate(playbackRate)
Parameters:

playbackRate – float

Setter of property playbackRateᅟ .

class QChannelMapper

Allows to map the channels within the clip onto properties of objects in the application. More_

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QChannelMapper

Added in version 6.1.

Synopsis

Methods

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

__init__([parent=None])
Parameters:

parentQNode

addMapping(mapping)
Parameters:

mappingQAbstractChannelMapping

mappings()
Return type:

.list of Qt3DAnimation.QAbstractChannelMapping

removeMapping(mapping)
Parameters:

mappingQAbstractChannelMapping

class QChannelComponent

Synopsis

Methods

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

__init__()
__init__(name)
Parameters:

name – str

__init__(arg__1)
Parameters:

arg__1QChannelComponent

appendKeyFrame(kf)
Parameters:

kfQKeyFrame

begin()
Return type:

QKeyFrame

cbegin()
Return type:

QKeyFrame

cend()
Return type:

QKeyFrame

clearKeyFrames()
end()
Return type:

QKeyFrame

insertKeyFrame(index, kf)
Parameters:
keyFrameCount()
Return type:

int

name()
Return type:

str

removeKeyFrame(index)
Parameters:

index – int

setName(name)
Parameters:

name – str

class QChannel

Defines a channel for a QAnimationClipData . The animation system interpolates each channel component independently except in the case the QChannel is called “Rotation” (case sensitive), it has four QChannelComponents and the same number of keyframes for each QChannelComponent. In that case the interpolation will be performed using SLERP. More_

Synopsis

Methods

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

__init__()
__init__(name)
Parameters:

name – str

__init__(arg__1)
Parameters:

arg__1QChannel

appendChannelComponent(component)
Parameters:

componentQChannelComponent

begin()
Return type:

QChannelComponent

cbegin()
Return type:

QChannelComponent

cend()
Return type:

QChannelComponent

channelComponentCount()
Return type:

int

clearChannelComponents()
end()
Return type:

QChannelComponent

insertChannelComponent(index, component)
Parameters:
jointIndex()
Return type:

int

name()
Return type:

str

removeChannelComponent(index)
Parameters:

index – int

setJointIndex(jointIndex)
Parameters:

jointIndex – int

setName(name)
Parameters:

name – str

class QAnimationGroup

A class grouping animations together. More_

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationGroup

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

QAnimationGroup class is used to group multiple animations so that they can act as one animation. The position set to the group is also set to all animations in a group. The duration is the maximum of the individual animations. The animations can be any supported animation type and do not have to have the same name.

Note

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

property durationᅟ: float

Holds the maximum duration of the animations in the group.

Access functions:
property nameᅟ: str

Holds the name of the animation group.

Access functions:
property positionᅟ: float

Holds the animation position.

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

parentQObject

Constructs an QAnimationGroup with parent.

addAnimation(animation)
Parameters:

animationQAbstractAnimation

Adds new animation to the group.

animationList()
Return type:

.list of Qt3DAnimation.QAbstractAnimation

Returns the list of animations in the group.

duration()
Return type:

float

Getter of property durationᅟ .

durationChanged(duration)
Parameters:

duration – float

Notification signal of property durationᅟ .

name()
Return type:

str

See also

setName()

Getter of property nameᅟ .

nameChanged(name)
Parameters:

name – str

Notification signal of property nameᅟ .

position()
Return type:

float

See also

setPosition()

Getter of property positionᅟ .

positionChanged(position)
Parameters:

position – float

Notification signal of property positionᅟ .

removeAnimation(animation)
Parameters:

animationQAbstractAnimation

Removes animation from the group.

setAnimations(animations)
Parameters:

animations – .list of Qt3DAnimation.QAbstractAnimation

Sets the animations to the group. Old animations are removed.

setName(name)
Parameters:

name – str

See also

name()

Setter of property nameᅟ .

setPosition(position)
Parameters:

position – float

See also

position()

Setter of property positionᅟ .

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

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

Getter of property positionOffsetᅟ .

positionOffsetChanged(offset)
Parameters:

offset – float

Notification signal of property positionOffsetᅟ .

positionScale()
Return type:

float

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

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ᅟ .

class QAnimationClipData

Class containing the animation data. More_

Added in version 6.1.

Synopsis

Methods

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

__init__()
__init__(arg__1)
Parameters:

arg__1QAnimationClipData

appendChannel(c)
Parameters:

cQChannel

begin()
Return type:

QChannel

cbegin()
Return type:

QChannel

cend()
Return type:

QChannel

channelCount()
Return type:

int

clearChannels()
end()
Return type:

QChannel

insertChannel(index, c)
Parameters:
isValid()
Return type:

bool

name()
Return type:

str

__ne__(rhs)
Parameters:

rhsQAnimationClipData

Return type:

bool

__eq__(rhs)
Parameters:

rhsQAnimationClipData

Return type:

bool

removeChannel(index)
Parameters:

index – int

setName(name)
Parameters:

name – str

class QAnimationCallback

Represents an animation callback object. More_

Synopsis

Virtual methods

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

class Flag

(inherits enum.Flag) Flags to indicate how the valueChanged() function is called.

Constant

Description

Qt3DAnimation.QAnimationCallback.OnOwningThread

Callback function is called on the owning (GUI or main) thread.

Qt3DAnimation.QAnimationCallback.OnThreadPool

Callback function is called on the thread pool’s worker thread.

abstract valueChanged(value)
Parameters:

value – object

Callback function that is triggered for changes in the animated value.

See also

setCallback()

class QAnimationAspect

Provides key-frame animation capabilities to Qt 3D. More_

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationAspect

Synopsis

Methods

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

QAnimationAspect provides key-frame animation to Qt 3D.

__init__([parent=None])
Parameters:

parentQObject

Constructs a new QAnimationAspect with parent.

class QAbstractClipBlendNode

QAbstractClipBlendNode is the base class for types used to construct animation blend trees. More_

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QAbstractClipBlendNode

Inherited by: QLerpClipBlend, QClipBlendValue, QAdditiveClipBlend

Synopsis

Methods

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

Animation blend trees are used with a QBlendedClipAnimator to dynamically blend a set of animation clips together. The way in which the blending of animation clips is performed is controlled by the structure of the blend tree and the properties on the nodes it contains.

The leaf nodes in a blend tree are containers for the input animation clips. These clips can be baked clips read from file via QAnimationClipLoader , or they can be clips that you build within your application with QAnimatitonClip and QAnimationClipData . To include a clip in your blend tree, wrap it in a QClipBlendValue node.

The interior nodes of a blend tree represent blending operations that will be applied to their arguments which hold the input clips or even entire sub-trees of other blend tree nodes.

At present, the Qt 3D Animation module provides the following blend tree node types:

Additional node types representing other blending operations will be added in the future.

See also

QBlendedClipAnimator

__init__([parent=None])
Parameters:

parentQNode

class QLerpClipBlend

Performs a linear interpolation of two animation clips based on a normalized factor. More_

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QLerpClipBlend

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

QLerpClipBlend can be useful to create advanced animation effects based on individual animation clips. For instance, given a player character, lerp blending could be used to combine a walking animation clip with an injured animation clip based on a blend factor that increases the more the player gets injured. This would then allow with blend factor == 0 to have a non injured walking player, with blend factor == 1 a fully injured player, with blend factor == 0.5 a partially walking and injured player.

See also

QBlendedClipAnimator

Note

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

property blendFactorᅟ: float

Specifies the blending factor between 0 and 1 to control the blending of two animation clips.

Access functions:
property endClipᅟ: QAbstractClipBlendNode

Holds the sub-tree that should be used as the start clip for this lerp blend node. That is, the clip returned by this blend node when the blendFactor is set to a value of 1.

Access functions:
property startClipᅟ: QAbstractClipBlendNode

Holds the sub-tree that should be used as the start clip for this lerp blend node. That is, the clip returned by this blend node when the blendFactor is set to a value of 0.

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

parentQNode

blendFactor()
Return type:

float

See also

setBlendFactor()

Getter of property blendFactorᅟ .

blendFactorChanged(blendFactor)
Parameters:

blendFactor – float

Notification signal of property blendFactorᅟ .

endClip()
Return type:

QAbstractClipBlendNode

See also

setEndClip()

Getter of property endClipᅟ .

endClipChanged(endClip)
Parameters:

endClipQAbstractClipBlendNode

Notification signal of property endClipᅟ .

setBlendFactor(blendFactor)
Parameters:

blendFactor – float

See also

blendFactor()

Setter of property blendFactorᅟ .

setEndClip(endClip)
Parameters:

endClipQAbstractClipBlendNode

See also

endClip()

Setter of property endClipᅟ .

setStartClip(startClip)
Parameters:

startClipQAbstractClipBlendNode

See also

startClip()

Setter of property startClipᅟ .

startClip()
Return type:

QAbstractClipBlendNode

See also

setStartClip()

Getter of property startClipᅟ .

startClipChanged(startClip)
Parameters:

startClipQAbstractClipBlendNode

Notification signal of property startClipᅟ .

class QClipBlendValue

Class used for including a clip in a blend tree. More_

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QClipBlendValue

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

Note

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

property clipᅟ: QAbstractAnimationClip

The animation clip that needs to be included in the blend tree.

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

parentQNode

__init__(clip[, parent=None])
Parameters:
clip()
Return type:

QAbstractAnimationClip

See also

setClip()

Getter of property clipᅟ .

clipChanged(clip)
Parameters:

clipQAbstractAnimationClip

Notification signal of property clipᅟ .

setClip(clip)
Parameters:

clipQAbstractAnimationClip

See also

clip()

Setter of property clipᅟ .

class QAdditiveClipBlend

Performs an additive blend of two animation clips based on an additive factor. More_

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QAdditiveClipBlend

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

QAdditiveClipBlend can be useful to create advanced animation effects based on individual animation clips. For example, if you:

  • set the baseClip property to a normal walk cycle animation clip and

  • set the additiveClip property to a shaking head difference clip,

then adjusting the additiveFactor property will control how much of the additiveClip gets added on to the baseClip . This has he effect that with an additiveFactor of zero, this blend node will yield the original walk cycle clip. With an additiveFactor of 1, it will yield the walk cycle including a shaking head animation.

The blending operation implemented by this class is:

resultClip = baseClip + additiveFactor * additiveClip

There is nothing stopping you from using values for the additiveFacor property outside the 0 to 1 range, but please be aware that the input animation clips may not be authored in such a way for this to make sense.

See also

QBlendedClipAnimator

Note

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

property additiveClipᅟ: QAbstractClipBlendNode

This property holds the additive clip to be blended with the baseClip . The amount of blending is controlled by the additiveFactor property.

Access functions:
property additiveFactorᅟ: float

Specifies the blending factor, typically between 0 and 1, to control the blending of two animation clips.

Access functions:
property baseClipᅟ: QAbstractClipBlendNode

This property holds the base animation clip. When the additiveFactor is zero the baseClip will also be the resulting clip of this blend node.

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

parentQNode

additiveClip()
Return type:

QAbstractClipBlendNode

Getter of property additiveClipᅟ .

additiveClipChanged(additiveClip)
Parameters:

additiveClipQAbstractClipBlendNode

Notification signal of property additiveClipᅟ .

additiveFactor()
Return type:

float

Getter of property additiveFactorᅟ .

additiveFactorChanged(additiveFactor)
Parameters:

additiveFactor – float

Notification signal of property additiveFactorᅟ .

baseClip()
Return type:

QAbstractClipBlendNode

See also

setBaseClip()

Getter of property baseClipᅟ .

baseClipChanged(baseClip)
Parameters:

baseClipQAbstractClipBlendNode

Notification signal of property baseClipᅟ .

setAdditiveClip(additiveClip)
Parameters:

additiveClipQAbstractClipBlendNode

See also

additiveClip()

Setter of property additiveClipᅟ .

setAdditiveFactor(additiveFactor)
Parameters:

additiveFactor – float

See also

additiveFactor()

Setter of property additiveFactorᅟ .

setBaseClip(baseClip)
Parameters:

baseClipQAbstractClipBlendNode

See also

baseClip()

Setter of property baseClipᅟ .

class QAbstractClipAnimator

QAbstractClipAnimator is the base class for types providing animation playback capabilities. More_

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QAbstractClipAnimator

Inherited by: QClipAnimator, QBlendedClipAnimator

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

Subclasses of QAbstractClipAnimator can be aggregated by a QEntity to provide animation capabilities. The animator components provide an interface for controlling the animation (e.g. start, stop). Each animator type requires some form of animation data such as a QAbstractAnimationClip as well as a QChannelMapper which describes how the channels in the animation clip should be mapped onto the properties of the objects you wish to animate.

The following subclasses are available:

class Loops

Holds the number of times the animation should play.

Constant

Description

Qt3DAnimation.QAbstractClipAnimator.Infinite

This will repeat the loop continuously until it is explicitly stopped.

Note

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

property channelMapperᅟ: QChannelMapper

This property holds the ChannelMapper that controls how the channels in the animation clip map onto the properties of the target objects.

Access functions:
property clockᅟ: QClock

The clock controls the speed with which an animation is played.

Access functions:
property loopsᅟ: int

Holds the number of times the animation should play.

The value is 1 by default: the animation will be played once and then stop.

If set to Infinite , the animation will continuously repeat until it is explicitly stopped.

Access functions:
property normalizedTimeᅟ: float

This property holds the clips normalized time.

Access functions:
property runningᅟ: bool

This property holds a boolean indicating whether the animation is currently running.

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

parentQNode

channelMapper()
Return type:

QChannelMapper

Getter of property channelMapperᅟ .

channelMapperChanged(channelMapper)
Parameters:

channelMapperQChannelMapper

Notification signal of property channelMapperᅟ .

clock()
Return type:

QClock

See also

setClock()

Getter of property clockᅟ .

clockChanged(clock)
Parameters:

clockQClock

Notification signal of property clockᅟ .

isRunning()
Return type:

bool

Returns a boolean indicating whether the animation is currently running.

Getter of property runningᅟ .

loopCount()
Return type:

int

Returns the number of times the animation should play.

The value is 1 by default: the animation will play through once and then stop.

If set to Infinite , the animation will continuously repeat until it is explicitly stopped.

See also

setLoopCount()

Getter of property loopsᅟ .

loopCountChanged(loops)
Parameters:

loops – int

Notification signal of property loopsᅟ .

normalizedTime()
Return type:

float

Getter of property normalizedTimeᅟ .

normalizedTimeChanged(index)
Parameters:

index – float

Notification signal of property normalizedTimeᅟ .

runningChanged(running)
Parameters:

running – bool

Notification signal of property runningᅟ .

setChannelMapper(channelMapper)
Parameters:

channelMapperQChannelMapper

See also

channelMapper()

Setter of property channelMapperᅟ .

setClock(clock)
Parameters:

clockQClock

See also

clock()

Setter of property clockᅟ .

setLoopCount(loops)
Parameters:

loops – int

See also

loopCount()

Setter of property loopsᅟ .

setNormalizedTime(timeFraction)
Parameters:

timeFraction – float

See also

normalizedTime()

Setter of property normalizedTimeᅟ .

setRunning(running)
Parameters:

running – bool

See also

isRunning()

Setter of property runningᅟ .

start()

Starts the animation.

stop()

Stops the animation.

class QClipAnimator

QClipAnimator is a component providing simple animation playback capabilities. More_

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QClipAnimator

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

An instance of QClipAnimator can be aggregated by a QEntity to add the ability to play back animation clips and to apply the calculated animation values to properties of QObjects.

The animation key frame data is provided via the clip property. This can be created programmatically with QAnimationClip or loaded from file with QAnimationClipLoader .

In order to apply the values played back from the channels of data in the animation clip, the clip animator needs to have a QChannelMapper object assigned to the channelMapper property.

The properties for controlling the animator are provided by the QAbstractClipAnimator base class.

Note

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

property clipᅟ: QAbstractAnimationClip

This property holds the animation clip which contains the key frame data to be played back. The key frame data can be specified in either a QAnimationClip or QAnimationClipLoader .

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

parentQNode

clip()
Return type:

QAbstractAnimationClip

See also

setClip()

Getter of property clipᅟ .

clipChanged(clip)
Parameters:

clipQAbstractAnimationClip

Notification signal of property clipᅟ .

setClip(clip)
Parameters:

clipQAbstractAnimationClip

See also

clip()

Setter of property clipᅟ .

class QBlendedClipAnimator

QBlendedClipAnimator is a component providing animation playback capabilities of a tree of blend nodes. More_

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QBlendedClipAnimator

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

An instance of QBlendedClipAnimator can be aggregated by a QEntity to add the ability to play back animation clips and to apply the calculated animation values to properties of QObjects.

Whereas a QClipAnimator gets its animation data from a single animation clip, QBlendedClipAnimator can blend together multiple clips. The animation data is obtained by evaluating a so called blend tree. A blend tree is a hierarchical tree structure where the leaf nodes are value nodes that encapsulate an animation clip ( QAbstractAnimationClip ); and the internal nodes represent blending operations that operate on the nodes pointed to by their operand properties.

To associate a blend tree with a QBlendedClipAnimator , set the animator’s blendTree property to point at the root node of your blend tree:

auto blendTreeRoot = new QAdditiveClipBlend();
...
auto animator = new QBlendedClipAnimator();
animator->setBlendTree(blendTreeRoot);

A blend tree can be constructed from the following node types:

Note

The blend node tree should only be edited when the animator is not running.

Additional node types will be added over time.

As an example consider the following blend tree:

Clip0----
        |
        Lerp Node----
        |           |
Clip1----           Additive Node
                    |
            Clip2----

This can be created and used as follows:

// Create leaf nodes of blend tree
auto clip0 = new QClipBlendValue(
    new QAnimationClipLoader(QUrl::fromLocalFile("walk.json")));
auto clip1 = new QClipBlendValue(
    new QAnimationClipLoader(QUrl::fromLocalFile("run.json")));
auto clip2 = new QClipBlendValue(
    new QAnimationClipLoader(QUrl::fromLocalFile("wave-arm.json")));

// Create blend tree inner nodes
auto lerpNode = new QLerpClipBlend();
lerpNode->setStartClip(clip0);
lerpNode->setEndClip(clip1);
lerpNode->setBlendFactor(0.5f); // Half-walk, half-run

auto additiveNode = new QAdditiveClipBlend();
additiveNode->setBaseClip(lerpNode); // Comes from lerp sub-tree
additiveNode->setAdditiveClip(clip2);
additiveNode->setAdditiveFactor(1.0f); // Wave arm fully

// Run the animator
auto animator = new QBlendedClipAnimator();
animator->setBlendTree(additiveNode);
animator->setChannelMapper(...);
animator->setRunning(true);

By authoring a set of animation clips and blending between them dynamically at runtime with a blend tree, we open up a huge set of possible resulting animations. As some simple examples of the above blend tree, where alpha is the additive factor and beta is the lerp blend factor we can get a 2D continuum of possible animations:

(alpha = 0, beta = 1) Running, No arm waving --- (alpha = 1, beta = 1) Running, Arm waving
        |                                               |
        |                                               |
        |                                               |
(alpha = 0, beta = 0) Walking, No arm waving --- (alpha = 0, beta = 1) Running, No arm waving

More complex blend trees offer even more flexibility for combining your animation clips. Note that the values used to control the blend tree (alpha and beta above) are simple properties on the blend nodes. This means, that these properties themselves can also be controlled by the animation framework.

Note

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

property blendTreeᅟ: QAbstractClipBlendNode

This property holds the root of the animation blend tree that will be evaluated before being interpolated by the animator.

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

parentQNode

blendTree()
Return type:

QAbstractClipBlendNode

See also

setBlendTree()

Getter of property blendTreeᅟ .

blendTreeChanged(blendTree)
Parameters:

blendTreeQAbstractClipBlendNode

Notification signal of property blendTreeᅟ .

setBlendTree(blendTree)
Parameters:

blendTreeQAbstractClipBlendNode

See also

blendTree()

Setter of property blendTreeᅟ .

class QAbstractChannelMapping

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QAbstractChannelMapping

Inherited by: QSkeletonMapping, QChannelMapping, QCallbackMapping

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

class QSkeletonMapping

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QSkeletonMapping

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

Note

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

property skeletonᅟ: QAbstractSkeleton
Access functions:
__init__([parent=None])
Parameters:

parentQNode

setSkeleton(skeleton)
Parameters:

skeletonQAbstractSkeleton

Setter of property skeletonᅟ .

skeleton()
Return type:

QAbstractSkeleton

Getter of property skeletonᅟ .

skeletonChanged(skeleton)
Parameters:

skeletonQAbstractSkeleton

Notification signal of property skeletonᅟ .

class QChannelMapping

Allows to map the channels within the clip onto properties of objects in the application. More_

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QChannelMapping

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

Note

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

property channelNameᅟ: str
Access functions:
property propertyᅟ: str
Access functions:
property targetᅟ: QNode
Access functions:
__init__([parent=None])
Parameters:

parentQNode

channelName()
Return type:

str

See also

setChannelName()

Getter of property channelNameᅟ .

channelNameChanged(channelName)
Parameters:

channelName – str

Notification signal of property channelNameᅟ .

property()
Return type:

str

See also

setProperty()

Getter of property propertyᅟ .

propertyChanged(property)
Parameters:

property – str

Notification signal of property propertyᅟ .

setChannelName(channelName)
Parameters:

channelName – str

See also

channelName()

Setter of property channelNameᅟ .

setProperty(property)
Parameters:

property – str

See also

property()

Setter of property propertyᅟ .

setTarget(target)
Parameters:

targetQNode

See also

target()

Setter of property targetᅟ .

target()
Return type:

QNode

See also

setTarget()

Getter of property targetᅟ .

targetChanged(target)
Parameters:

targetQNode

Notification signal of property targetᅟ .

class QCallbackMapping

Allows to map the channels within the clip onto an invocation of a callback object. More_

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QCallbackMapping

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

Note

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

property channelNameᅟ: str
Access functions:
__init__([parent=None])
Parameters:

parentQNode

callback()
Return type:

QAnimationCallback

channelName()
Return type:

str

See also

setChannelName()

Getter of property channelNameᅟ .

channelNameChanged(channelName)
Parameters:

channelName – str

Notification signal of property channelNameᅟ .

setCallback(type, callback[, flags=Qt3DAnimation.QAnimationCallback.OnOwningThread])
Parameters:

Associates a callback object with this channel mapping.

Such mappings do not have to have a target object and property name. When the callback object is set, every change in the animated value will lead to invoking the callback’s valueChanged function either on the gui/main thread, or directly on one of the thread pool’s worker thread. This is controlled by flags.

type specifies the type (for example, QMetaType::QVector3D, QMetaType::QColor, or QMetaType::Float) of the animated value. When animating node properties this does not need to be provided separately, however it becomes important to supply this when there is only a callback.

Note

A mapping can be associated both with a node property and a callback. It is important however that type matches the type of the property in this case. Note also that for properties of type QVariant (for example, QParameter::value), the type is the type of the value stored in the QVariant.

Note

The callback pointer is expected to stay valid while any associated animators are running.

setChannelName(channelName)
Parameters:

channelName – str

See also

channelName()

Setter of property channelNameᅟ .

class QAbstractAnimationClip

QAbstractAnimationClip is the base class for types providing key frame animation data. More_

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QAbstractAnimationClip

Inherited by: QAnimationClipLoader, QAnimationClip

Synopsis

Properties

Methods

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

To utilise the key frame animation framework in the Qt 3D Animation module the animator component in use needs to be provided with the key frame animation data. The animation data is provided by one of the concrete subclasses of QAbstractAnimationClip :

QAnimationClip should be used when you want to create the animation data programmatically within your application. The actual data is set with a QAnimationClipData value type.

If you are loading baked animation data from a file, e.g. as created by an artist, then use the QAnimationClipLoader class and set its source property.

Once the animation clip has been populated with data using the above methods, the read-only duration property will be updated by the Qt 3D Animation backend.

The typical usage of animation clips is:

auto animator = new QClipAnimator();
auto clip = new QAnimationClipLoader();
clip->setSource(QUrl::fromLocalFile("bounce.json"));
animator->setClip(clip);
animator->setChannelMapper(...);
animator->setRunning(true);

Animation clips are also used as the leaf node values in animation blend trees:

// Create leaf nodes of blend tree
auto slideClipValue = new QClipBlendValue(
    new QAnimationClipLoader(QUrl::fromLocalFile("slide.json")));
auto bounceClipValue = new QClipBlendValue(
    new QAnimationClipLoader(QUrl::fromLocalFile("bounce.json")));

// Create blend tree inner node
auto additiveNode = new QAdditiveClipBlend();
additiveNode->setBaseClip(slideClipValue);
additiveNode->setAdditiveClip(bounceClipValue);
additiveNode->setAdditiveFactor(0.5f);

// Run the animator
auto animator = new QBlendedClipAnimator();
animator->setBlendTree(additiveNode);
animator->setChannelMapper(...);
animator->setRunning(true);

Note

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

property durationᅟ: float

Holds the duration of the animation clip in seconds. Gets updated once the animation data is provided to Qt 3D using one of the concrete subclasses.

Access functions:
duration()
Return type:

float

Getter of property durationᅟ .

durationChanged(duration)
Parameters:

duration – float

Notification signal of property durationᅟ .

class QAnimationClipLoader

Enables loading key frame animation data from a file. More_

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationClipLoader

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

class Status

This enum identifies the status of animation clip.

Constant

Description

Qt3DAnimation.QAnimationClipLoader.NotReady

The clip has not been loaded yet

Qt3DAnimation.QAnimationClipLoader.Ready

The clip was successfully loaded

Qt3DAnimation.QAnimationClipLoader.Error

An error occurred while loading the clip

Note

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

property sourceᅟ: QUrl

Holds the source URL from which to load the animation clip. Currently glTF2 and the native Qt 3D json animation file formats are supported.

In the case where a file contains multiple animations, it is possible to select which animation should be loaded by way of query parameters on the source url. The accepted query parameters are animationIndex and animationName. If both are specified, animationName is ignored.

If a file contains only a single animation, there is no need to specify the animationIndex or animationName. We simply use the one available animation.

Access functions:
property statusᅟ: Qt3DAnimation.QAnimationClipLoader.Status

This property contains the status of the animation clip.

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

parentQNode

__init__(source[, parent=None])
Parameters:
  • sourceQUrl

  • parentQNode

setSource(source)
Parameters:

sourceQUrl

See also

source()

Setter of property sourceᅟ .

source()
Return type:

QUrl

See also

setSource()

Getter of property sourceᅟ .

sourceChanged(source)
Parameters:

sourceQUrl

Notification signal of property sourceᅟ .

status()
Return type:

Status

Returns the status of the animation clip.

Getter of property statusᅟ .

statusChanged(status)
Parameters:

statusStatus

Notification signal of property statusᅟ .

class QAnimationClip

Specifies key frame animation data. More_

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QAnimationClip

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

Note

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

property clipDataᅟ: QAnimationClipData
Access functions:
__init__([parent=None])
Parameters:

parentQNode

clipData()
Return type:

QAnimationClipData

Returns the data describing the animation clip.

See also

setClipData()

Getter of property clipDataᅟ .

clipDataChanged(clipData)
Parameters:

clipDataQAnimationClipData

Notification signal of property clipDataᅟ .

setClipData(clipData)
Parameters:

clipDataQAnimationClipData

Set the parameters of the clip according to the clipData provided.

See also

clipData()

Setter of property clipDataᅟ .

class QAbstractAnimation

An abstract base class for Qt3D animations. More_

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QAbstractAnimation

Inherited by: QVertexBlendAnimation, QMorphingAnimation, QKeyframeAnimation

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

QAbstractAnimation is an abstract base class for all animations. QAbstractAnimation can not be directly instantiated, but rather through its subclasses. QAbstractAnimation specifies common properties for all Qt3D animations, such as animation name and type, current position and animation duration, while leaving the actual animating for the subclasses.

class AnimationType

This enumeration specifies the type of the animation

Constant

Description

Qt3DAnimation.QAbstractAnimation.KeyframeAnimation

Simple keyframe animation implementation for QTransform

Qt3DAnimation.QAbstractAnimation.MorphingAnimation

Blend-shape morphing animation

Qt3DAnimation.QAbstractAnimation.VertexBlendAnimation

Vertex-blend animation

Note

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

property animationNameᅟ: str

Holds the name of the animation.

Access functions:
property animationTypeᅟ: Qt3DAnimation.QAbstractAnimation.AnimationType

Holds the type of the animation.

Access functions:
property durationᅟ: float

Holds the duration of the animation.

Access functions:
property positionᅟ: float

Holds the current position of the animation.

Access functions:
animationName()
Return type:

str

See also

setAnimationName()

Getter of property animationNameᅟ .

animationNameChanged(name)
Parameters:

name – str

Notification signal of property animationNameᅟ .

animationType()
Return type:

AnimationType

Getter of property animationTypeᅟ .

duration()
Return type:

float

See also

setDuration()

Getter of property durationᅟ .

durationChanged(duration)
Parameters:

duration – float

Notification signal of property durationᅟ .

position()
Return type:

float

See also

setPosition()

Getter of property positionᅟ .

positionChanged(position)
Parameters:

position – float

Notification signal of property positionᅟ .

setAnimationName(name)
Parameters:

name – str

See also

animationName()

Setter of property animationNameᅟ .

setDuration(duration)
Parameters:

duration – float

Sets the duration of the animation.

See also

duration()

setPosition(position)
Parameters:

position – float

See also

position()

Setter of property positionᅟ .

class QVertexBlendAnimation

A class implementing vertex-blend morphing animation. More_

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QVertexBlendAnimation

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

A QVertexBlendAnimation class implements vertex-blend morphing animation to a target QGeometryRenderer . The QVertexBlendAnimation sets the correct QAttributes from the morph targets to the target geometry and calculates interpolator for the current position. Unlike with QMorphingAnimation , where the blending is controller with blend weights, the blending occurs between sequential morph targets. The actual blending between the attributes must be implemented in the material. Qt3DAnimation::QMorphPhongMaterial implements material with morphing support for phong lighting model. The blending happens between 2 attributes - ‘base’ and ‘target’. The names for the base and target attributes are taken from the morph target names, where the base attribute retains the name it already has and the target attribute name gets ‘Target’ appended to the name. The interpolator can be set as a QParameter to the used material. All morph targets in the animation should contain the attributes with same names as those in the base geometry.

Note

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

property interpolatorᅟ: float

Holds the interpolator between base and target attributes.

Access functions:
property targetᅟ: QGeometryRenderer

Holds the target QGeometryRenderer the morphing animation is applied to.

Access functions:
property targetNameᅟ: str

Holds the name of the target geometry. This is a convenience property making it easier to match the target geometry to the morphing animation. The name is usually same as the name of the parent entity of the target QGeometryRenderer, but does not have to be.

Access functions:
property targetPositionsᅟ: list of float

Holds the position values of the morph target. Each position in the list specifies the position of the corresponding morph target with the same index. The values must be in an ascending order. Values can be positive or negative and do not have any predefined unit.

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

parentQObject

Construct a new QVertexBlendAnimation with parent.

addMorphTarget(target)
Parameters:

targetQMorphTarget

Add new morph target at the end of the animation.

interpolator()
Return type:

float

Getter of property interpolatorᅟ .

interpolatorChanged(interpolator)
Parameters:

interpolator – float

Notification signal of property interpolatorᅟ .

morphTargetList()
Return type:

.list of Qt3DAnimation.QMorphTarget

Return morph target list.

removeMorphTarget(target)
Parameters:

targetQMorphTarget

Remove morph target from the animation.

setMorphTargets(targets)
Parameters:

targets – .list of Qt3DAnimation.QMorphTarget

Set morph targets to animation. Old targets are cleared.

setTarget(target)
Parameters:

targetQGeometryRenderer

See also

target()

Setter of property targetᅟ .

setTargetName(name)
Parameters:

name – str

See also

targetName()

Setter of property targetNameᅟ .

setTargetPositions(targetPositions)
Parameters:

targetPositions – .list of float

Setter of property targetPositionsᅟ .

target()
Return type:

QGeometryRenderer

See also

setTarget()

Getter of property targetᅟ .

targetChanged(target)
Parameters:

targetQGeometryRenderer

Notification signal of property targetᅟ .

targetName()
Return type:

str

See also

setTargetName()

Getter of property targetNameᅟ .

targetNameChanged(name)
Parameters:

name – str

Notification signal of property targetNameᅟ .

targetPositions()
Return type:

.list of float

Getter of property targetPositionsᅟ .

targetPositionsChanged(targetPositions)
Parameters:

targetPositions – .list of float

Notification signal of property targetPositionsᅟ .

class QMorphingAnimation

A class implementing blend-shape morphing animation. More_

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation

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

A QMorphingAnimation class implements blend-shape morphing animation to a target QGeometryRenderer . The QMorphingAnimation sets the correct QAttributes from the morph targets to the target geometry and calculates interpolator for the current position. The actual blending between the attributes must be implemented in the material. Qt3DAnimation::QMorphPhongMaterial implements material with morphing support for phong lighting model. The blending happens between 2 attributes - ‘base’ and ‘target’. The names for the base and target attributes are taken from the morph target names, where the base attribute retains the name it already has and the target attribute name gets ‘Target’ appended to the name. The interpolator can be set as a QParameter to the used material. All morph targets in the animation should contain the attributes with same names as those in the base geometry.

class Method

This enumeration specifies the morphing method.

Constant

Description

Qt3DAnimation.QMorphingAnimation.Normalized

The blending should use the normalized formula; V’ = Vbase * (1.0 - sum(Wi)) + sum[Vi * Wi]

Qt3DAnimation.QMorphingAnimation.Relative

The blending should use the relative formula; V’ = Vbase + sum[Vi * Wi]

Note

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

property easingᅟ: QEasingCurve

Holds the easing curve of the interpolator between morph targets.

Access functions:
property interpolatorᅟ: float

Holds the interpolator between base and target attributes.

Access functions:
property methodᅟ: Qt3DAnimation.QMorphingAnimation.Method

Holds the morphing method. The default is Relative.

Access functions:
property targetᅟ: QGeometryRenderer

Holds the target QGeometryRenderer the morphing animation is applied to.

Access functions:
property targetNameᅟ: str

Holds the name of the target geometry. This is a convenience property making it easier to match the target geometry to the morphing animation. The name is usually same as the name of the parent entity of the target QGeometryRenderer, but does not have to be.

Access functions:
property targetPositionsᅟ: list of float

Holds the position values of the morph target. Each position in the list specifies the position of the corresponding morph target with the same index. The values must be in an ascending order. Values can be positive or negative and do not have any predefined unit.

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

parentQObject

Construct a new QMorphingAnimation with parent.

addMorphTarget(target)
Parameters:

targetQMorphTarget

Add new morph target at the end of the animation.

easing()
Return type:

QEasingCurve

See also

setEasing()

Getter of property easingᅟ .

easingChanged(easing)
Parameters:

easingQEasingCurve

Notification signal of property easingᅟ .

getWeights(positionIndex)
Parameters:

positionIndex – int

Return type:

.list of float

Return morph weights at positionIndex.

interpolator()
Return type:

float

Getter of property interpolatorᅟ .

interpolatorChanged(interpolator)
Parameters:

interpolator – float

Notification signal of property interpolatorᅟ .

method()
Return type:

Method

See also

setMethod()

Getter of property methodᅟ .

methodChanged(method)
Parameters:

methodMethod

Notification signal of property methodᅟ .

morphTargetList()
Return type:

.list of Qt3DAnimation.QMorphTarget

Return morph target list.

removeMorphTarget(target)
Parameters:

targetQMorphTarget

Remove morph target from the animation.

setEasing(easing)
Parameters:

easingQEasingCurve

See also

easing()

Setter of property easingᅟ .

setMethod(method)
Parameters:

methodMethod

See also

method()

Setter of property methodᅟ .

setMorphTargets(targets)
Parameters:

targets – .list of Qt3DAnimation.QMorphTarget

Set morph targets to animation. Old targets are cleared.

setTarget(target)
Parameters:

targetQGeometryRenderer

See also

target()

Setter of property targetᅟ .

setTargetName(name)
Parameters:

name – str

See also

targetName()

Setter of property targetNameᅟ .

setTargetPositions(targetPositions)
Parameters:

targetPositions – .list of float

Setter of property targetPositionsᅟ .

setWeights(positionIndex, weights)
Parameters:
  • positionIndex – int

  • weights – .list of float

Sets morph weights at positionIndex.

target()
Return type:

QGeometryRenderer

See also

setTarget()

Getter of property targetᅟ .

targetChanged(target)
Parameters:

targetQGeometryRenderer

Notification signal of property targetᅟ .

targetName()
Return type:

str

See also

setTargetName()

Getter of property targetNameᅟ .

targetNameChanged(name)
Parameters:

name – str

Notification signal of property targetNameᅟ .

targetPositions()
Return type:

.list of float

Getter of property targetPositionsᅟ .

targetPositionsChanged(targetPositions)
Parameters:

targetPositions – .list of float

Notification signal of property targetPositionsᅟ .

class QKeyframeAnimation

A class implementing simple keyframe animation to a QTransform. More_

Inheritance diagram of PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation

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

A QKeyframeAnimation class implements simple keyframe animation that can be used to animate QTransform. The keyframes consists of multiple timed QTransforms, which are interpolated and applied to the target QTransform. QEasingCurve is used between keyframes to control the interpolator. RepeatMode can be set for when the position set to the QKeyframeAnimation is below or above the values defined in the keyframe positions.

class RepeatMode

This enumeration specifies how position values outside keyframe values are handled.

Constant

Description

Qt3DAnimation.QKeyframeAnimation.None

The animation is not applied to the target transform.

Qt3DAnimation.QKeyframeAnimation.Constant

The edge keyframe value is used.

Qt3DAnimation.QKeyframeAnimation.Repeat

The animation is repeated.

Note

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

property easingᅟ: QEasingCurve

Holds the easing curve of the interpolator between keyframes.

Access functions:
property endModeᅟ: Qt3DAnimation.QKeyframeAnimation.RepeatMode

Holds the repeat mode for the position values greater than the last frame position.

Access functions:
property framePositionsᅟ: list of float

Holds the positions of the keyframes. Each position in the list specifies the position of the corresponding keyframe with the same index. The values must be in an ascending order. Values can be positive or negative and do not have any predefined unit.

Access functions:
property startModeᅟ: Qt3DAnimation.QKeyframeAnimation.RepeatMode

Holds the repeat mode for the position values less than the first frame position.

Access functions:
property targetᅟ: QTransform

Holds the target QTransform the animation is applied to.

Access functions:
property targetNameᅟ: str

Holds the name of the target transform. This is a convenience property making it easier to match the target transform to the keyframe animation. The name is usually same as the name of the parent entity of the target transform, but does not have to be.

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

parentQObject

Constructs an QKeyframeAnimation with parent.

addKeyframe(keyframe)
Parameters:

keyframeQTransform

Adds new keyframe at the end of the animation. The QTransform can be added to the animation multiple times.

easing()
Return type:

QEasingCurve

See also

setEasing()

Getter of property easingᅟ .

easingChanged(easing)
Parameters:

easingQEasingCurve

Notification signal of property easingᅟ .

endMode()
Return type:

RepeatMode

See also

setEndMode()

Getter of property endModeᅟ .

endModeChanged(endMode)
Parameters:

endModeRepeatMode

Notification signal of property endModeᅟ .

framePositions()
Return type:

.list of float

Getter of property framePositionsᅟ .

framePositionsChanged(positions)
Parameters:

positions – .list of float

Notification signal of property framePositionsᅟ .

keyframeList()
Return type:

.list of Qt3DCore.QTransform

Returns the list of keyframes.

removeKeyframe(keyframe)
Parameters:

keyframeQTransform

Removes a keyframe from the animation. If the same QTransform is set as keyframe multiple times, all occurrences are removed.

setEasing(easing)
Parameters:

easingQEasingCurve

See also

easing()

Setter of property easingᅟ .

setEndMode(mode)
Parameters:

modeRepeatMode

See also

endMode()

Setter of property endModeᅟ .

setFramePositions(positions)
Parameters:

positions – .list of float

See also

framePositions()

Setter of property framePositionsᅟ .

setKeyframes(keyframes)
Parameters:

keyframes – .list of Qt3DCore.QTransform

Sets the keyframes of the animation. Old keyframes are cleared.

setStartMode(mode)
Parameters:

modeRepeatMode

See also

startMode()

Setter of property startModeᅟ .

setTarget(target)
Parameters:

targetQTransform

See also

target()

Setter of property targetᅟ .

setTargetName(name)
Parameters:

name – str

See also

targetName()

Setter of property targetNameᅟ .

startMode()
Return type:

RepeatMode

See also

setStartMode()

Getter of property startModeᅟ .

startModeChanged(startMode)
Parameters:

startModeRepeatMode

Notification signal of property startModeᅟ .

target()
Return type:

QTransform

See also

setTarget()

Getter of property targetᅟ .

targetChanged(target)
Parameters:

targetQTransform

Notification signal of property targetᅟ .

targetName()
Return type:

str

See also

setTargetName()

Getter of property targetNameᅟ .

targetNameChanged(name)
Parameters:

name – str

Notification signal of property targetNameᅟ .