Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@stuvel.eu>2017-05-26 13:55:07 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2017-05-30 14:47:51 +0300
commitcfce8623a808d04904e00ac93d7d90d369a569e8 (patch)
tree32ee85e4665cc8fd3d835e8612903c0791d595b0 /source/blender/alembic
parent71dcead79098bbe0e5a9570e3fe28b5aa2da4b17 (diff)
Alembic export: prevent rounding error buildup in frame sample time
Diffstat (limited to 'source/blender/alembic')
-rw-r--r--source/blender/alembic/intern/abc_exporter.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/alembic/intern/abc_exporter.cc b/source/blender/alembic/intern/abc_exporter.cc
index 1fb59357f5d..ced58e4964e 100644
--- a/source/blender/alembic/intern/abc_exporter.cc
+++ b/source/blender/alembic/intern/abc_exporter.cc
@@ -209,8 +209,10 @@ void AbcExporter::getShutterSamples(double step, bool time_relative,
const int nsamples = static_cast<int>(std::max((1.0 / step) - 1.0, 1.0));
const double time_inc = (shutter_close - shutter_open) / nsamples;
- for (double t = shutter_open; t <= shutter_close; t += time_inc) {
- samples.push_back((t + m_settings.frame_start) / time_factor);
+ for (int sample=0; sample < nsamples; ++sample) {
+ double sample_time = shutter_open + time_inc * sample;
+ double time = (m_settings.frame_start + sample_time) / time_factor;
+ samples.push_back(time);
}
}
}