diff options
author | Mahmoud Badri <mahmoud.badri@qt.io> | 2019-06-26 15:29:19 +0300 |
---|---|---|
committer | Mahmoud Badri <mahmoud.badri@qt.io> | 2019-06-26 15:29:19 +0300 |
commit | 44b46a24048db25081d49c84448b89896cf4118a (patch) | |
tree | 0fddcfdba77e9c3265fc916d68034a13f93d02ee | |
parent | 9252d50d3cce477a0d071223fb68cf5b611a7dfa (diff) |
Fix Copy/Paste keyframes for color properties
Task-number: QT3DS-3703
Change-Id: I1c1f8b594dae96f28dfc43d5ab0641357d2cf6e0
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r-- | src/Authoring/Client/Code/Core/Commands/CmdDataModelInsertKeyframe.h | 7 | ||||
-rw-r--r-- | src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/KeyframeManager.cpp | 9 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/Authoring/Client/Code/Core/Commands/CmdDataModelInsertKeyframe.h b/src/Authoring/Client/Code/Core/Commands/CmdDataModelInsertKeyframe.h index 0d99aa7f..a1182280 100644 --- a/src/Authoring/Client/Code/Core/Commands/CmdDataModelInsertKeyframe.h +++ b/src/Authoring/Client/Code/Core/Commands/CmdDataModelInsertKeyframe.h @@ -52,7 +52,7 @@ public: { qt3dsdm::Qt3DSDMPropertyHandle m_Property; float m_KeyframeTime; - qt3dsdm::SGetOrSetKeyframeInfo m_Infos[3]; + qt3dsdm::SGetOrSetKeyframeInfo m_Infos[4]; size_t m_ValidInfoCount; STimeKeyframeData(qt3dsdm::Qt3DSDMPropertyHandle inProperty, float inKeyframeTime, @@ -60,10 +60,9 @@ public: : m_Property(inProperty) , m_KeyframeTime(inKeyframeTime) { - m_ValidInfoCount = inInfoCount <= 3 ? inInfoCount : 3; - for (size_t idx = 0, end = m_ValidInfoCount; idx < end; ++idx) { + m_ValidInfoCount = inInfoCount <= 4 ? inInfoCount : 4; + for (size_t idx = 0, end = m_ValidInfoCount; idx < end; ++idx) m_Infos[idx] = inInfos[idx]; - } } }; diff --git a/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/KeyframeManager.cpp b/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/KeyframeManager.cpp index 9a12aab3..7b39b272 100644 --- a/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/KeyframeManager.cpp +++ b/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/KeyframeManager.cpp @@ -296,7 +296,7 @@ void KeyframeManager::copySelectedKeyframes() Qt3DSDMTimelineKeyframe *kf = keyframe->binding; Qt3DSDMTimelineKeyframe::TKeyframeHandleList theKeyframeHandles; kf->GetKeyframeHandles(theKeyframeHandles); - qt3dsdm::SGetOrSetKeyframeInfo info[3]; + qt3dsdm::SGetOrSetKeyframeInfo info[4]; size_t infoCount = 0; if (!theKeyframeHandles.empty()) { switch (theKeyframeHandles.size()) { @@ -310,6 +310,13 @@ void KeyframeManager::copySelectedKeyframes() info[2] = setKeyframeInfo(theKeyframeHandles[2], *animationCore); infoCount = 3; break; + case 4: + info[0] = setKeyframeInfo(theKeyframeHandles[0], *animationCore); + info[1] = setKeyframeInfo(theKeyframeHandles[1], *animationCore); + info[2] = setKeyframeInfo(theKeyframeHandles[2], *animationCore); + info[3] = setKeyframeInfo(theKeyframeHandles[3], *animationCore); + infoCount = 4; + break; default: break; } |