Fix for property change interpolation during playback with screenshots

This commit is contained in:
Gene Payne
2020-12-11 12:40:22 -07:00
parent ba4e47b54e
commit 5ed85d8fcd
3 changed files with 10 additions and 1 deletions

View File

@@ -645,6 +645,7 @@ protected:
std::chrono::steady_clock::duration _saveRenderingDeltaTime_interpolation_usec;
std::chrono::steady_clock::time_point _saveRenderingCurrentRecordedTime_interpolation;
long long _saveRenderingClockInterpolation_countsPerSec;
bool _saveRendering_isFirstFrame = true;
unsigned char _keyframeBuffer[_saveBufferMaxSize_bytes];

View File

@@ -333,6 +333,7 @@ bool SessionRecording::startPlayback(std::string& filename,
_saveRenderingCurrentRecordedTime_interpolation = steady_clock::now();
_saveRenderingClockInterpolation_countsPerSec =
system_clock::duration::period::den / system_clock::duration::period::num;
_saveRendering_isFirstFrame = true;
//Set playback flags to true for all modes
_playbackActive_camera = true;
@@ -457,6 +458,7 @@ void SessionRecording::cleanUpPlayback() {
_idxTimeline_cameraPtrPrev = 0;
_hasHitEndOfCameraKeyframes = false;
_saveRenderingDuringPlayback = false;
_saveRendering_isFirstFrame = true;
_cleanupNeeded = false;
}
@@ -1403,6 +1405,12 @@ void SessionRecording::moveAheadInTime() {
double currTime = currentTime();
lookForNonCameraKeyframesThatHaveComeDue(currTime);
updateCameraWithOrWithoutNewKeyframes(currTime);
//Unfortunately the first frame is sometimes rendered because globebrowsing reports
// that all chunks are rendered when they apparently are not.
if (_saveRendering_isFirstFrame) {
_saveRendering_isFirstFrame = false;
return;
}
if (isSavingFramesDuringPlayback()) {
// Check if renderable in focus is still resolving tile loading
// do not adjust time while we are doing this, or take screenshot

View File

@@ -513,7 +513,7 @@ void Scene::addPropertyInterpolation(properties::Property* prop, float durationS
PropertyInterpolationInfo i = {
prop,
std::chrono::steady_clock::now(),
now,
durationSeconds,
func
};