|qmake:||QT += 3danimation|
- duration : const float
Additional Inherited Members
- 3 public slots inherited from Qt3DCore::QNode
- 1 public slot inherited from QObject
- 1 public variable inherited from QObject
- 10 static public members inherited from QObject
- 2 protected functions inherited from Qt3DCore::QNode
- 9 protected functions inherited from QObject
- 2 protected variables inherited from QObject
QAbstractAnimationClip is the base class for types providing key frame animation data.
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:
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
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);
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.
© 2020 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.