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);