From 14cbb72253505977c448b960bacc7d471ed5f6f3 Mon Sep 17 00:00:00 2001 From: Jeremy Hu Date: Sat, 29 Feb 2020 20:56:08 +0930 Subject: [PATCH] Fix motion regeneration Fix motion not regenerating when related pose changed. --- src/document.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/document.cpp b/src/document.cpp index 8d3303be..877241ae 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -527,9 +527,22 @@ void Document::setPoseFrames(QUuid poseId, std::vectorsecond.frames = frames; findPoseResult->second.dirty = true; + bool foundMotion = false; + for (auto &it: motionMap) { + for (const auto &clip: it.second.clips) { + if (poseId == clip.linkToId) { + it.second.dirty = true; + foundMotion = true; + break; + } + } + } emit posesChanged(); emit poseFramesChanged(poseId); emit optionsChanged(); + if (foundMotion) { + emit motionsChanged(); + } } void Document::setPoseTurnaroundImageId(QUuid poseId, QUuid imageId)