[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58527] branches/soc-2013-cycles_mblur/ intern/cycles/blender/blender_object.cpp: Added code to extract the export times.
Gavin Howard
gavin.d.howard at gmail.com
Tue Jul 23 07:14:12 CEST 2013
Revision: 58527
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58527
Author: gdh
Date: 2013-07-23 05:14:11 +0000 (Tue, 23 Jul 2013)
Log Message:
-----------
Added code to extract the export times. These times take into account
the shuttertime set by the user.
Modified Paths:
--------------
branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_object.cpp
Modified: branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_object.cpp
===================================================================
--- branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_object.cpp 2013-07-23 04:59:20 UTC (rev 58526)
+++ branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_object.cpp 2013-07-23 05:14:11 UTC (rev 58527)
@@ -339,7 +339,24 @@
/* Get the new export times. */
+ /* We need to use the shutter time. */
+ float shuttertime = scene->camera->shuttertime;
+ float half_frame = 0.5f * shuttertime;
+ /* This is a float to prevent a lot of casting in a for loop. */
+ float frame = static_cast<float>(b_scene.frame_current());
+
+ /* XXX: Do ALL compilers optimize the divide by 2? */
+ int half_steps = mblur_steps / 2;
+ float step_width = half_frame / half_steps;
+ float time;
+
+ for (int i = 1; i <= half_steps; ++i) {
+ time = i * step_width;
+ object_export->insert(frame - time);
+ object_export->insert(frame + time);
+ }
+
/* Add the new export times to the object. */
object->export_times = object_export;
}
More information about the Bf-blender-cvs
mailing list