Smooth first and last frame of pose sheet

master
Jeremy Hu 2018-11-10 07:06:27 +08:00
parent 8a2298bfcb
commit ddc837b47c
1 changed files with 2 additions and 2 deletions

View File

@ -189,10 +189,10 @@ void MotionsGenerator::generateMotion(const QUuid &motionId, std::set<QUuid> &vi
frame = frames->size() - 1; frame = frames->size() - 1;
int previousFrame = frame - 1; int previousFrame = frame - 1;
if (previousFrame < 0) if (previousFrame < 0)
previousFrame = 0; previousFrame = frames->size() - 1;
int nextFrame = frame + 1; int nextFrame = frame + 1;
if (nextFrame >= (int)frames->size()) if (nextFrame >= (int)frames->size())
nextFrame = frames->size() - 1; nextFrame = 0;
if (frame >= 0 && frame < (int)frames->size()) { if (frame >= 0 && frame < (int)frames->size()) {
const JointNodeTree previousJointNodeTree = poseJointNodeTree(progressClip.linkToId, previousFrame); const JointNodeTree previousJointNodeTree = poseJointNodeTree(progressClip.linkToId, previousFrame);
const JointNodeTree jointNodeTree = poseJointNodeTree(progressClip.linkToId, frame); const JointNodeTree jointNodeTree = poseJointNodeTree(progressClip.linkToId, frame);