[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58645] branches/soc-2013-cycles_mblur/ intern/cycles/blender/blender_object.cpp: Add some more code to correctly handle export times.

Gavin Howard gavin.d.howard at gmail.com
Sat Jul 27 05:08:05 CEST 2013


Revision: 58645
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58645
Author:   gdh
Date:     2013-07-27 03:08:02 +0000 (Sat, 27 Jul 2013)
Log Message:
-----------
Add some more code to correctly handle export times.

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-27 03:00:06 UTC (rev 58644)
+++ branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_object.cpp	2013-07-27 03:08:02 UTC (rev 58645)
@@ -16,7 +16,6 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-#include <iostream>
 #include "camera.h"
 #include "integrator.h"
 #include "graph.h"
@@ -339,25 +338,28 @@
 
 		/* Get the new export times. */
 
-		/* First, clear the old ones. */
-		object->export_times->clear();
+		if (object->use_motion) {
 
-		/* We need to use the shutter time. */
-		float shuttertime = scene->camera->shuttertime;
-		float half_frame = 0.5f * shuttertime;
+			/* First, clear the old ones. */
+			object->export_times->clear();
 
-		/* This is a float to prevent a lot of casting in a for loop. */
-		float frame = static_cast<float>(b_scene.frame_current());
+			/* We need to use the shutter time. */
+			float shuttertime = scene->camera->shuttertime;
+			float half_frame = 0.5f * shuttertime;
 
-		/* XXX: Do ALL compilers optimize the divide by 2? */
-		int half_steps = mblur_steps / 2;
-		float step_width = half_frame / half_steps;
-		float time;
+			/* This is a float to prevent a lot of casting in a for loop. */
+			float frame = static_cast<float>(b_scene.frame_current());
 
-		for (int i = 1; i <= half_steps; ++i) {
-			time = i * step_width;
-			object->export_times->insert(frame - time);
-			object->export_times->insert(frame + time);
+			/* 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_times->insert(frame - time);
+				object->export_times->insert(frame + time);
+			}
 		}
 	}
 




More information about the Bf-blender-cvs mailing list