From ddc837b47cba7826c6ae36296026023312bf62f2 Mon Sep 17 00:00:00 2001 From: Jeremy Hu Date: Sat, 10 Nov 2018 07:06:27 +0800 Subject: [PATCH] Smooth first and last frame of pose sheet --- src/motionsgenerator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/motionsgenerator.cpp b/src/motionsgenerator.cpp index a4993016..6ac86150 100644 --- a/src/motionsgenerator.cpp +++ b/src/motionsgenerator.cpp @@ -189,10 +189,10 @@ void MotionsGenerator::generateMotion(const QUuid &motionId, std::set &vi frame = frames->size() - 1; int previousFrame = frame - 1; if (previousFrame < 0) - previousFrame = 0; + previousFrame = frames->size() - 1; int nextFrame = frame + 1; if (nextFrame >= (int)frames->size()) - nextFrame = frames->size() - 1; + nextFrame = 0; if (frame >= 0 && frame < (int)frames->size()) { const JointNodeTree previousJointNodeTree = poseJointNodeTree(progressClip.linkToId, previousFrame); const JointNodeTree jointNodeTree = poseJointNodeTree(progressClip.linkToId, frame);