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:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2016-08-17 23:06:05 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2016-08-17 23:26:50 +0300
commit294b0756b441ac7a41d861ea6fd1088a8a6fd8ba (patch)
treecb8a617e183e72e5a6eb5b5b46c8295858e7270d /source/blender/alembic
parentc783e65762aaded75074493fd565a930185f9f78 (diff)
Fix T49081: Alembic sampling times are not taking start frame into
account. This resulted in animations always starting at frame 0.
Diffstat (limited to 'source/blender/alembic')
-rw-r--r--source/blender/alembic/intern/abc_exporter.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/alembic/intern/abc_exporter.cc b/source/blender/alembic/intern/abc_exporter.cc
index 127e8853789..f71d78bd60e 100644
--- a/source/blender/alembic/intern/abc_exporter.cc
+++ b/source/blender/alembic/intern/abc_exporter.cc
@@ -175,7 +175,7 @@ void AbcExporter::getShutterSamples(double step, bool time_relative,
/* sample all frame */
if (shutter_open == 0.0 && shutter_close == 1.0) {
for (double t = 0; t < 1.0; t += step) {
- samples.push_back(t / time_factor);
+ samples.push_back((t + m_settings.frame_start) / time_factor);
}
}
else {
@@ -184,7 +184,7 @@ void AbcExporter::getShutterSamples(double step, bool time_relative,
const double time_inc = (shutter_close - shutter_open) / nsamples;
for (double t = shutter_open; t <= shutter_close; t += time_inc) {
- samples.push_back(t / time_factor);
+ samples.push_back((t + m_settings.frame_start) / time_factor);
}
}
}
@@ -325,16 +325,18 @@ void AbcExporter::operator()(Main *bmain, float &progress, bool &was_canceled)
break;
}
- double f = *begin;
- setCurrentFrame(bmain, f);
+ const double frame = *begin;
- if (shape_frames.count(f) != 0) {
+ /* 'frame' is offset by start frame, so need to cancel the offset. */
+ setCurrentFrame(bmain, frame - m_settings.frame_start);
+
+ if (shape_frames.count(frame) != 0) {
for (int i = 0, e = m_shapes.size(); i != e; ++i) {
m_shapes[i]->write();
}
}
- if (xform_frames.count(f) == 0) {
+ if (xform_frames.count(frame) == 0) {
continue;
}