TrackEdit.truncate() will always add an extra keyframe to the end of the track, however, there should be an exception.
If the endTime equals the lastFrame time then it should just overwrite the last frame and do not add a new frame, otherwise, the generated track will have repetitious keyframes. (at the end frame and its previous frame).
Hi
TrackEdit.truncate()
will always add an extra keyframe to the end of the track, however, there should be an exception.If the
endTime
equals thelastFrame
time then it should just overwrite the last frame and do not add a new frame, otherwise, the generated track will have repetitious keyframes. (at the end frame and its previous frame).My suggestion would be to change this
int newCount = 2 + lastFrame;
to something like