QMorphingAnimation#
A class implementing blend-shape morphing animation. More…
Synopsis#
Properties#
Functions#
def
addMorphTarget
(target)def
easing
()def
getWeights
(positionIndex)def
interpolator
()def
method
()def
morphTargetList
()def
removeMorphTarget
(target)def
setMorphTargets
(targets)def
setWeights
(positionIndex, weights)def
target
()def
targetName
()def
targetPositions
()
Slots#
def
setEasing
(easing)def
setMethod
(method)def
setTarget
(target)def
setTargetName
(name)def
setTargetPositions
(targetPositions)
Signals#
def
easingChanged
(easing)def
interpolatorChanged
(interpolator)def
methodChanged
(method)def
targetChanged
(target)def
targetNameChanged
(name)def
targetPositionsChanged
(targetPositions)
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 PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation([parent=None])#
- Parameters:
parent –
PySide6.QtCore.QObject
Construct a new QMorphingAnimation
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.QMorphingAnimation.easing: PySide6.QtCore.QEasingCurve#
Holds the easing curve of the interpolator between morph targets.
- Access functions:
easing
()setEasing
(easing)Signal
easingChanged
(easing)
- property PᅟySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.interpolator: float#
Holds the interpolator between base and target attributes.
- Access functions:
interpolator
()Signal
interpolatorChanged
(interpolator)
- property PᅟySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.method: Method#
Holds the morphing method. The default is Relative.
- Access functions:
method
()setMethod
(method)Signal
methodChanged
(method)
- property PᅟySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.target: PySide6.Qt3DRender.Qt3DRender.QGeometryRenderer#
Holds the target QGeometryRenderer the morphing animation is applied to.
- Access functions:
target
()setTarget
(target)Signal
targetChanged
(target)
- property PᅟySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.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:
targetName
()setTargetName
(name)Signal
targetNameChanged
(name)
- property PᅟySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.targetPositions#
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:
setTargetPositions
(targetPositions)Signal
targetPositionsChanged
(targetPositions)
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.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]
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.addMorphTarget(target)#
- Parameters:
Add new morph target
at the end of the animation.
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.easing()#
- Return type:
See also
Getter of property easing
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.easingChanged(easing)#
- Parameters:
easing –
PySide6.QtCore.QEasingCurve
Notification signal of property easing
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.getWeights(positionIndex)#
- Parameters:
positionIndex – int
- Return type:
Return morph weights at positionIndex
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.interpolator()#
- Return type:
float
Getter of property interpolator
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.interpolatorChanged(interpolator)#
- Parameters:
interpolator – float
Notification signal of property interpolator
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.method()#
- Return type:
See also
Getter of property method
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.methodChanged(method)#
- Parameters:
method –
Method
Notification signal of property method
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.morphTargetList()#
- Return type:
Return morph target list.
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.removeMorphTarget(target)#
- Parameters:
Remove morph target
from the animation.
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.setEasing(easing)#
- Parameters:
easing –
PySide6.QtCore.QEasingCurve
See also
Setter of property easing
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.setMethod(method)#
- Parameters:
method –
Method
See also
Setter of property method
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.setMorphTargets(targets)#
- Parameters:
targets –
Set morph targets
to animation. Old targets are cleared.
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.setTarget(target)#
- Parameters:
See also
Setter of property target
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.setTargetName(name)#
- Parameters:
name – str
See also
Setter of property targetName
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.setTargetPositions(targetPositions)#
- Parameters:
targetPositions –
See also
Setter of property targetPositions
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.setWeights(positionIndex, weights)#
- Parameters:
positionIndex – int
weights –
Sets morph weights
at positionIndex
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.target()#
- Return type:
See also
Getter of property target
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.targetChanged(target)#
- Parameters:
Notification signal of property target
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.targetName()#
- Return type:
str
See also
Getter of property targetName
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.targetNameChanged(name)#
- Parameters:
name – str
Notification signal of property targetName
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.targetPositions()#
- Return type:
See also
Getter of property targetPositions
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QMorphingAnimation.targetPositionsChanged(targetPositions)#
- Parameters:
targetPositions –
Notification signal of property targetPositions
.