summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaj Grönholm <kaj.gronholm@qt.io>2019-09-19 10:50:49 +0300
committerKaj Grönholm <kaj.gronholm@qt.io>2019-09-19 12:46:07 +0300
commite401b037bcc6e5599fe55d04627143df3c62a271 (patch)
treef6c7ee248f7ef77963c083b66a9329693c77152e
parent814d037a67c827a5eef0f3d166d5ada498f408fb (diff)
Handle animations without keyframes
Task-number: QT3DS-3955 Change-Id: I50bea22f4232c9dbb1c63db00d3d967e911f7279 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r--src/dm/systems/cores/SimpleAnimationCore.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dm/systems/cores/SimpleAnimationCore.cpp b/src/dm/systems/cores/SimpleAnimationCore.cpp
index 471cf7f..2393f01 100644
--- a/src/dm/systems/cores/SimpleAnimationCore.cpp
+++ b/src/dm/systems/cores/SimpleAnimationCore.cpp
@@ -440,6 +440,11 @@ std::pair<float, float> CSimpleAnimationCore::getAnimationExtrema(
const SAnimationTrack *track = GetAnimationNF(animation, m_Objects);
TKeyframeHandleList keyframeHandles;
GetKeyframes(animation, keyframeHandles);
+
+ // If animation doesn't contain any keyframes, return some default range
+ if (keyframeHandles.empty())
+ return std::make_pair(0, 0);
+
size_t idxFrom = 0;
size_t idxTo = keyframeHandles.size() - 1;