diff options
author | Kaj Grönholm <kaj.gronholm@qt.io> | 2018-05-03 13:25:16 +0300 |
---|---|---|
committer | Kaj Grönholm <kaj.gronholm@qt.io> | 2018-05-04 10:20:35 +0000 |
commit | 308dba44c93ded6ccf1ea3933056500193c12945 (patch) | |
tree | 6a5452fe73ec795bba0d251ed17438e607a9c509 | |
parent | 71389e596f9146fedb6d28459d4b7aa0cbba8e44 (diff) |
Support "Set Changed Keyframes" for new timeline
Task-number: QT3DS-1522
Change-Id: I7876a0475cddece54aa7afbd45ddd0738978e2ce
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r-- | src/Authoring/Studio/Palettes/TimelineGraphicsView/KeyframeManager.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/KeyframeManager.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/KeyframeManager.cpp index ab585928..335cebe4 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/KeyframeManager.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/KeyframeManager.cpp @@ -602,7 +602,24 @@ void KeyframeManager::DeselectAllKeyframes() void KeyframeManager::SetChangedKeyframes() { - // Mahmoud_TODO: implement if needed + CDoc *theDoc = g_StudioApp.GetCore()->GetDoc(); + qt3dsdm::Qt3DSDMInstanceHandle selectedInstance = theDoc->GetSelectedInstance(); + if (selectedInstance.Valid()) { + using namespace Q3DStudio; + Q3DStudio::ScopedDocumentEditor editor(*theDoc, L"Set Changed Keyframes", + __FILE__, __LINE__); + CStudioSystem *theStudioSystem = theDoc->GetStudioSystem(); + // Get all animated properties. + TPropertyHandleList properties; + theStudioSystem->GetPropertySystem()->GetAggregateInstanceProperties(selectedInstance, + properties); + for (size_t i = 0; i < properties.size(); ++i) { + if (theStudioSystem->GetAnimationSystem()->IsPropertyAnimated( + selectedInstance, properties[i])) { + editor->KeyframeProperty(selectedInstance, properties[i], true); + } + } + } } // Mahmoud_TODO: this Map is not used anymore, will be removed by finishing the new timeline |