diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2017-05-26 13:55:07 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2017-05-30 14:47:51 +0300 |
commit | cfce8623a808d04904e00ac93d7d90d369a569e8 (patch) | |
tree | 32ee85e4665cc8fd3d835e8612903c0791d595b0 /source/blender/alembic/intern | |
parent | 71dcead79098bbe0e5a9570e3fe28b5aa2da4b17 (diff) |
Alembic export: prevent rounding error buildup in frame sample time
Diffstat (limited to 'source/blender/alembic/intern')
-rw-r--r-- | source/blender/alembic/intern/abc_exporter.cc | 6 |
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); } } } |