このページでは

Qt3DAnimation::QAbstractAnimationClip Class

class Qt3DAnimation::QAbstractAnimationClip

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

ヘッダー: #include <qabstractanimationclip.h>
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の具体的なサブクラスのいずれかによって提供されます。

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

アーティストによって作成されたものなど、ファイルからベイク済みアニメーションデータを読み込む場合は、QAnimationClipLoader クラスを使用し、そのsource プロパティを設定します。

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

アニメーションクリップの一般的な使用法は次のとおりです:

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 : float

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

アクセス関数:

float duration() const

Notifierシグナル:

void durationChanged(float duration)

メンバ関数のドキュメント

[virtual noexcept] QAbstractAnimationClip::~QAbstractAnimationClip()

このアニメーションクリップを削除します。

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