From 03fa66d2740c6ab10df6a86430475dfa98fc0f20 Mon Sep 17 00:00:00 2001 From: Josh Belanich Date: Tue, 19 May 2020 02:51:27 +0200 Subject: Fix T72889: Cycles camera motion blur not usng more than 2 steps Differential Revision: https://developer.blender.org/D7782 --- intern/cycles/blender/blender_object.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index 4b29c28913b..a461982a538 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -460,9 +460,12 @@ void BlenderSync::sync_motion(BL::RenderSettings &b_render, sync_objects(b_depsgraph, b_v3d, 0.0f); } - /* always sample these times for camera motion */ - motion_times.insert(-1.0f); - motion_times.insert(1.0f); + /* Insert motion times from camera. Motion times from other objects + * have already been added in a sync_objects call. */ + uint camera_motion_steps = object_motion_steps(b_cam, b_cam); + for (size_t step = 0; step < camera_motion_steps; step++) { + motion_times.insert(scene->camera->motion_time(step)); + } /* note iteration over motion_times set happens in sorted order */ foreach (float relative_time, motion_times) { @@ -487,10 +490,8 @@ void BlenderSync::sync_motion(BL::RenderSettings &b_render, b_engine.frame_set(frame, subframe); python_thread_state_save(python_thread_state); - /* sync camera, only supports two times at the moment */ - if (relative_time == -1.0f || relative_time == 1.0f) { - sync_camera_motion(b_render, b_cam, width, height, relative_time); - } + /* Syncs camera motion if relative_time is one of the camera's motion times. */ + sync_camera_motion(b_render, b_cam, width, height, relative_time); /* sync object */ sync_objects(b_depsgraph, b_v3d, relative_time); -- cgit v1.2.3