[Bf-blender-cvs] [1ffe06d] alembic_pointcache: Incomplete dummy function for baking.

Lukas Tönne noreply at git.blender.org
Thu Oct 16 16:52:51 CEST 2014


Commit: 1ffe06d066555673a7a2ecf04bb963aa8f5b1a0d
Author: Lukas Tönne
Date:   Wed Nov 20 13:10:30 2013 +0100
Branches: alembic_pointcache
https://developer.blender.org/rB1ffe06d066555673a7a2ecf04bb963aa8f5b1a0d

Incomplete dummy function for baking.

===================================================================

M	source/blender/pointcache/PTC_api.cpp
M	source/blender/pointcache/PTC_api.h

===================================================================

diff --git a/source/blender/pointcache/PTC_api.cpp b/source/blender/pointcache/PTC_api.cpp
index 301e9ed..520d2cc 100644
--- a/source/blender/pointcache/PTC_api.cpp
+++ b/source/blender/pointcache/PTC_api.cpp
@@ -46,9 +46,53 @@ void PTC_write_sample(struct PTCWriter *_writer)
 	writer->write_sample();
 }
 
-void PTC_bake(struct PTCWriter *writer, int start_frame, int end_frame)
+void PTC_bake(Main *bmain, Scene *scene, struct PTCWriter *writer, int start_frame, int end_frame)
 {
-	
+	int /*use_timer = FALSE, */sfra, efra;
+//	double stime, ptime, ctime, fetd;
+//	char run[32], cur[32], etd[32];
+
+//	ptcache_bake_data *data = (ptcache_bake_data*)ptr;
+
+//	stime = ptime = PIL_check_seconds_timer();
+	sfra = start_frame;
+	efra = end_frame;
+
+	for (; (*data->cfra_ptr <= data->endframe) && !data->break_operation; *data->cfra_ptr+=data->step) {
+		BKE_scene_update_for_newframe(data->main, data->scene, data->scene->lay);
+#if 0
+		if (G.background) {
+			printf("bake: frame %d :: %d\n", (int)*data->cfra_ptr, data->endframe);
+		}
+		else {
+			ctime = PIL_check_seconds_timer();
+
+			fetd = (ctime-ptime)*(efra-*data->cfra_ptr)/data->step;
+
+			if (use_timer || fetd > 60.0) {
+				use_timer = TRUE;
+
+				ptcache_dt_to_str(cur, ctime-ptime);
+				ptcache_dt_to_str(run, ctime-stime);
+				ptcache_dt_to_str(etd, fetd);
+
+				printf("Baked for %s, current frame: %i/%i (%.3fs), ETC: %s\r", run, *data->cfra_ptr-sfra+1, efra-sfra+1, ctime-ptime, etd);
+			}
+			ptime = ctime;
+		}
+#endif
+	}
+
+#if 0
+	if (use_timer) {
+		/* start with newline because of \r above */
+		ptcache_dt_to_str(run, PIL_check_seconds_timer()-stime);
+		printf("\nBake %s %s (%i frames simulated).\n", (data->break_operation ? "canceled after" : "finished in"), run, *data->cfra_ptr-sfra);
+	}
+#endif
+
+//	data->thread_ended = TRUE;
+//	return NULL;
 }
 
 
diff --git a/source/blender/pointcache/PTC_api.h b/source/blender/pointcache/PTC_api.h
index eceaead..415d83f 100644
--- a/source/blender/pointcache/PTC_api.h
+++ b/source/blender/pointcache/PTC_api.h
@@ -23,6 +23,7 @@
 extern "C" {
 #endif
 
+struct Main;
 struct Scene;
 struct Object;
 struct ParticleSystem;




More information about the Bf-blender-cvs mailing list