Obsolete Members for Qt3DAnimation
The following members of class Qt3DAnimation are deprecated. They are provided to keep old source code working. We strongly advise against using them in new code.
Classes
(deprecated) class | QAbstractAnimation |
(deprecated) class | QAbstractAnimationClip |
(deprecated) class | QAbstractClipAnimator |
(deprecated) class | QAbstractClipBlendNode |
(deprecated) class | QAdditiveClipBlend |
(deprecated) class | QAnimationAspect |
(deprecated) class | QAnimationCallback |
(deprecated) class | QAnimationClip |
(deprecated) class | QAnimationClipData |
(deprecated) class | QAnimationClipLoader |
(deprecated) class | QAnimationController |
(deprecated) class | QAnimationGroup |
(deprecated) class | QBlendedClipAnimator |
(deprecated) class | QCallbackMapping |
(deprecated) class | QChannel |
(deprecated) class | QChannelMapper |
(deprecated) class | QChannelMapping |
(deprecated) class | QClipAnimator |
(deprecated) class | QClipBlendValue |
(deprecated) class | QKeyFrame |
(deprecated) class | QKeyframeAnimation |
(deprecated) class | QLerpClipBlend |
(deprecated) class | QMorphTarget |
(deprecated) class | QMorphingAnimation |
(deprecated) class | QVertexBlendAnimation |
Classes
[deprecated] class Qt3DAnimation::QAbstractAnimation
This class is deprecated. We strongly advise against using it in new code.
Qt3DAnimation::QAbstractAnimation is an abstract base class for all animations. Qt3DAnimation::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.
[deprecated] class Qt3DAnimation::QAbstractAnimationClip
This class is deprecated. We strongly advise against using it in new code.
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);
See also Qt3DAnimation::QAnimationClip and Qt3DAnimation::QAnimationClipLoader.
[deprecated] class Qt3DAnimation::QAbstractClipAnimator
This class is deprecated. We strongly advise against using it in new code.
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:
[deprecated] class Qt3DAnimation::QAbstractClipBlendNode
This class is deprecated. We strongly advise against using it in new code.
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.
[deprecated] class Qt3DAnimation::QAdditiveClipBlend
This class is deprecated. We strongly advise against using it in new code.
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.
[deprecated] class Qt3DAnimation::QAnimationAspect
This class is deprecated. We strongly advise against using it in new code.
QAnimationAspect provides key-frame animation to Qt 3D.
[deprecated] class Qt3DAnimation::QAnimationCallback
This class is deprecated. We strongly advise against using it in new code.
[deprecated] class Qt3DAnimation::QAnimationClip
This class is deprecated. We strongly advise against using it in new code.
[deprecated] class Qt3DAnimation::QAnimationClipData
This class is deprecated. We strongly advise against using it in new code.
[deprecated] class Qt3DAnimation::QAnimationClipLoader
This class is deprecated. We strongly advise against using it in new code.
[deprecated] class Qt3DAnimation::QAnimationController
This class is deprecated. We strongly advise against using it in new code.
Qt3DAnimation::QAnimationController class controls the selection and playback of animations. The class can be used to find all animations from Qt3DCore::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.
[deprecated] class Qt3DAnimation::QAnimationGroup
This class is deprecated. We strongly advise against using it in new code.
Qt3DAnimation::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.
[deprecated] class Qt3DAnimation::QBlendedClipAnimator
This class is deprecated. We strongly advise against using it in new code.
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.
[deprecated] class Qt3DAnimation::QCallbackMapping
This class is deprecated. We strongly advise against using it in new code.
[deprecated] class Qt3DAnimation::QChannel
This class is deprecated. We strongly advise against using it in new code.
[deprecated] class Qt3DAnimation::QChannelMapper
This class is deprecated. We strongly advise against using it in new code.
[deprecated] class Qt3DAnimation::QChannelMapping
This class is deprecated. We strongly advise against using it in new code.
[deprecated] class Qt3DAnimation::QClipAnimator
This class is deprecated. We strongly advise against using it in new code.
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.
See also Qt3DAnimation::QAbstractClipAnimator, Qt3DAnimation::QAbstractAnimationClip, Qt3DAnimation::QChannelMapper, and Qt3DAnimation::QBlendedClipAnimator.
[deprecated] class Qt3DAnimation::QClipBlendValue
This class is deprecated. We strongly advise against using it in new code.
[deprecated] class Qt3DAnimation::QKeyFrame
This class is deprecated. We strongly advise against using it in new code.
[deprecated] class Qt3DAnimation::QKeyframeAnimation
This class is deprecated. We strongly advise against using it in new code.
A Qt3DAnimation::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.
[deprecated] class Qt3DAnimation::QLerpClipBlend
This class is deprecated. We strongly advise against using it in new code.
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.
[deprecated] class Qt3DAnimation::QMorphTarget
This class is deprecated. We strongly advise against using it in new code.
A Qt3DAnimation::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 Qt3DCore::QGeometry.
[deprecated] class Qt3DAnimation::QMorphingAnimation
This class is deprecated. We strongly advise against using it in new code.
A Qt3DAnimation::QMorphingAnimation class implements blend-shape morphing animation to a target QGeometryRenderer. The QMorphingAnimation sets the correct QAttributes from the morph targets to the target QGeometryRenderer::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.
[deprecated] class Qt3DAnimation::QVertexBlendAnimation
This class is deprecated. We strongly advise against using it in new code.
A Qt3DAnimation::QVertexBlendAnimation class implements vertex-blend morphing animation to a target QGeometryRenderer. The QVertexBlendAnimation sets the correct QAttributes from the morph targets to the target QGeometryRenderer::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.