If the cursor on the Keyframe Timeline is at or near the last keyframe, play from the beginning

This commit is contained in:
CrushedPixel
2015-07-26 12:38:00 +02:00
parent 4f69d9e22f
commit ee2b028ed8

View File

@@ -82,6 +82,13 @@ public class ReplayProcess {
//default camera path, no rendering //default camera path, no rendering
if (renderOptions == null) { if (renderOptions == null) {
initialTimestamp = fromStart ? 0 : ReplayHandler.getRealTimelineCursor(); initialTimestamp = fromStart ? 0 : ReplayHandler.getRealTimelineCursor();
//if the cursor is at (or very near) the end, play from the beginning as well
if(initialTimestamp + 50 >= Math.max(ReplayHandler.getTimeKeyframes().last().getRealTimestamp(),
ReplayHandler.getPositionKeyframes().last().getRealTimestamp())) {
initialTimestamp = 0;
}
lastRealReplayTime = initialTimestamp; lastRealReplayTime = initialTimestamp;
int ts = ReplayHandler.getTimeKeyframes().getInterpolatedValueForTimestamp(initialTimestamp, true).asInt(); int ts = ReplayHandler.getTimeKeyframes().getInterpolatedValueForTimestamp(initialTimestamp, true).asInt();