Qt3DAnimation::QAbstractAnimationClip Class
class Qt3DAnimation::QAbstractAnimationClipQAbstractAnimationClip은 키프레임 애니메이션 데이터를 제공하는 유형의 기본 클래스입니다. 더 보기...
| 헤더: | #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 |
| 상태: | 기술 미리보기 |
이 클래스는 기술 미리보기 단계에 있으며 변경될 수 있습니다.
속성
- duration : float
공개 함수
| virtual | ~QAbstractAnimationClip() |
| float | duration() const |
신호
| void | durationChanged(float duration) |
상세 설명
Qt 3D 애니메이션 모듈의 키 프레임 애니메이션 프레임워크를 활용하려면, 사용 중인 애니메이터 컴포넌트에 키 프레임 애니메이션 데이터를 제공해야 합니다. 애니메이션 데이터는 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도 참조하십시오 .
© 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.