QAbstractAnimationClip Class

class Qt3DAnimation::QAbstractAnimationClip

QAbstractAnimationClip は、キーフレームアニメーションデータを提供する型の基本クラスです。詳細...

ヘッダー #include <QAbstractAnimationClip>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3danimation)
target_link_libraries(mytarget PRIVATE Qt6::3danimation)
qmake: QT += 3danimation
を継承する: Qt3DCore::QNode
によって継承される:

Qt3DAnimation::QAnimationClip そしてQt3DAnimation::QAnimationClipLoader

ステータス非推奨

プロパティ

パブリック機能

virtual ~QAbstractAnimationClip()
float duration() const

シグナル

void durationChanged(float duration)

詳細説明

Qt 3D Animation モジュールのキーフレームアニメーションフレームワークを利用するには、使用するアニメーターコンポーネントにキーフレームアニメーションデータを提供する必要があります。アニメーションデータは、QAbstractAnimationClipの具象サブクラスの1つによって提供されます:

QAnimationClip アプリケーション内でプログラム的にアニメーションデータを作成したい場合は、QAbstractAnimationClip:を使用する必要があります。実際のデータは、 の値型で設定されます。QAnimationClipData

アーティストが作成したようなファイルからアニメーションデータを読み込む場合は、QAnimationClipLoader クラスを使用し、source プロパティを設定します。

上記の方法でアニメーションクリップにデータが入力されると、Qt 3D Animation バックエンドによって、読み取り専用の duration プロパティが更新されます。

アニメーションクリップの典型的な使い方は以下の通りです:

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

アニメーションクリップは、アニメーションブレンドツリーのリーフノードの値としても使用されます:

// 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);

Qt3DAnimation::QAnimationClip およびQt3DAnimation::QAnimationClipLoaderも参照して ください。

プロパティの説明

[read-only] duration : const float

アニメーションクリップの継続時間を秒単位で保持します。具体的なサブクラスのいずれかを使用してアニメーションデータがQt 3D に提供されると、更新されます。

アクセス関数

float duration() const

通知シグナル

void durationChanged(float duration)

メンバ関数ドキュメント

[virtual noexcept] QAbstractAnimationClip::~QAbstractAnimationClip()

このアニメーションクリップを破壊する。

© 2025 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.