[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58459] branches/soc-2013-cycles_mblur/ intern/cycles/blender: More work to getting export working for deformation motion blur.

Gavin Howard gavin.d.howard at gmail.com
Sat Jul 20 21:50:50 CEST 2013


Revision: 58459
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58459
Author:   gdh
Date:     2013-07-20 19:50:49 +0000 (Sat, 20 Jul 2013)
Log Message:
-----------
More work to getting export working for deformation motion blur.

WARNING: This commit does remove some functionality. It will build 
successfully, but by the nature of the changes made, it removes Cycles 
capability for motion blur. Hopefully, that will be fixed by the end of 
today.

Modified Paths:
--------------
    branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_object.cpp
    branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_sync.cpp
    branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_sync.h

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-20 18:52:28 UTC (rev 58458)
+++ branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_object.cpp	2013-07-20 19:50:49 UTC (rev 58459)
@@ -262,7 +262,7 @@
 
 /* Object */
 
-Object *BlenderSync::sync_object(BL::Object b_parent, int persistent_id[OBJECT_PERSISTENT_ID_SIZE], BL::DupliObject b_dupli_ob, Transform& tfm, uint layer_flag, int motion, bool hide_tris)
+Object *BlenderSync::sync_object(BL::Object b_parent, int persistent_id[OBJECT_PERSISTENT_ID_SIZE], BL::DupliObject b_dupli_ob, Transform& tfm, uint layer_flag, float motion, bool hide_tris)
 {
 	BL::Object b_ob = (b_dupli_ob ? b_dupli_ob.object() : b_parent);
 	
@@ -448,7 +448,7 @@
 
 /* Object Loop */
 
-void BlenderSync::sync_objects(BL::SpaceView3D b_v3d, int motion)
+void BlenderSync::sync_objects(BL::SpaceView3D b_v3d, std::set<float> *export_times, float motion)
 {
 	/* layer data */
 	uint scene_layer = render_layer.scene_layer;
@@ -471,8 +471,6 @@
 
 	bool cancel = false;
 
-	std::set<float> export_times;
-
 	for(; b_sce && !cancel; b_sce = b_sce.background_set()) {
 		for(b_sce.objects.begin(b_ob); b_ob != b_sce.objects.end() && !cancel; ++b_ob) {
 			bool hide = (render_layer.use_viewport_visibility)? b_ob->hide(): b_ob->hide_render();
@@ -552,7 +550,7 @@
 	}
 }
 
-void BlenderSync::sync_motion(BL::SpaceView3D b_v3d, BL::Object b_override)
+void BlenderSync::sync_motion(BL::SpaceView3D b_v3d, BL::Object b_override, std::set<float> *export_times)
 {
 	if(scene->need_motion() == Scene::MOTION_NONE)
 		return;
@@ -563,20 +561,32 @@
 		b_cam = b_override;
 
 	Camera prevcam = *(scene->camera);
-	
+
+	/*
+	 * Sync the camera motion. Currently, this is a
+	 * workaround until everything is set in order
+	 * for deformation motion blur. Then we'll add
+	 * something a lot more interesting for cameras.
+	 */
+	if (b_cam) {
+		sync_camera_motion(b_cam, -1);
+		sync_camera_motion(b_cam, 1);
+	}
+
 	/* go back and forth one frame */
 	int frame = b_scene.frame_current();
 
-	for(int motion = -1; motion <= 1; motion += 2) {
-		b_scene.frame_set(frame + motion, 0.0f);
+	set<float>::iterator i;
+	for(i = export_times->begin(); i != export_times->end(); i++) {
+		
+	}
 
-		/* camera object */
-		if(b_cam)
-			sync_camera_motion(b_cam, motion);
+//	for(int motion = -1; motion <= 1; motion += 2) {
+//		b_scene.frame_set(frame + motion, 0.0f);
 
-		/* mesh objects */
-		sync_objects(b_v3d, motion);
-	}
+//		/* mesh objects */
+//		sync_objects(b_v3d, motion);
+//	}
 
 	b_scene.frame_set(frame, 0.0f);
 

Modified: branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_sync.cpp
===================================================================
--- branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_sync.cpp	2013-07-20 18:52:28 UTC (rev 58458)
+++ branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_sync.cpp	2013-07-20 19:50:49 UTC (rev 58459)
@@ -143,8 +143,10 @@
 	sync_film();
 	sync_shaders();
 	sync_curve_settings();
-	sync_objects(b_v3d);
-	sync_motion(b_v3d, b_override);
+	
+	std::set<float> export_times;
+	sync_objects(b_v3d, &export_times);
+	sync_motion(b_v3d, b_override, &export_times);
 }
 
 /* Integrator */

Modified: branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_sync.h
===================================================================
--- branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_sync.h	2013-07-20 18:52:28 UTC (rev 58458)
+++ branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_sync.h	2013-07-20 19:50:49 UTC (rev 58459)
@@ -73,8 +73,8 @@
 	/* sync */
 	void sync_lamps(bool update_all);
 	void sync_materials(bool update_all);
-	void sync_objects(BL::SpaceView3D b_v3d, int motion = 0);
-	void sync_motion(BL::SpaceView3D b_v3d, BL::Object b_override);
+	void sync_objects(BL::SpaceView3D b_v3d, std::set<float> *export_times, float motion = 0.0f);
+	void sync_motion(BL::SpaceView3D b_v3d, BL::Object b_override, std::set<float> *export_times);
 	void sync_film();
 	void sync_view();
 	void sync_world(bool update_all);
@@ -84,7 +84,7 @@
 	void sync_nodes(Shader *shader, BL::ShaderNodeTree b_ntree);
 	Mesh *sync_mesh(BL::Object b_ob, bool object_updated, bool hide_tris);
 	void sync_curves(Mesh *mesh, BL::Mesh b_mesh, BL::Object b_ob, bool object_updated);
-	Object *sync_object(BL::Object b_parent, int persistent_id[OBJECT_PERSISTENT_ID_SIZE], BL::DupliObject b_dupli_object, Transform& tfm, uint layer_flag, int motion, bool hide_tris);
+	Object *sync_object(BL::Object b_parent, int persistent_id[OBJECT_PERSISTENT_ID_SIZE], BL::DupliObject b_dupli_object, Transform& tfm, uint layer_flag, float motion, bool hide_tris);
 	void sync_light(BL::Object b_parent, int persistent_id[OBJECT_PERSISTENT_ID_SIZE], BL::Object b_ob, Transform& tfm);
 	void sync_background_light();
 	void sync_mesh_motion(BL::Object b_ob, Mesh *mesh, int motion);




More information about the Bf-blender-cvs mailing list