[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36731] branches/cycles/source/blender: Render API: RenderEngine. update_progress function to set progress percentage.

Brecht Van Lommel brechtvanlommel at pandora.be
Tue May 17 17:39:40 CEST 2011


Revision: 36731
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36731
Author:   blendix
Date:     2011-05-17 15:39:40 +0000 (Tue, 17 May 2011)
Log Message:
-----------
Render API: RenderEngine.update_progress function to set progress percentage.

Modified Paths:
--------------
    branches/cycles/source/blender/makesrna/intern/rna_render.c
    branches/cycles/source/blender/render/extern/include/RE_engine.h
    branches/cycles/source/blender/render/intern/pipeline/engine.c

Modified: branches/cycles/source/blender/makesrna/intern/rna_render.c
===================================================================
--- branches/cycles/source/blender/makesrna/intern/rna_render.c	2011-05-17 15:20:12 UTC (rev 36730)
+++ branches/cycles/source/blender/makesrna/intern/rna_render.c	2011-05-17 15:39:40 UTC (rev 36731)
@@ -374,6 +374,10 @@
 	prop= RNA_def_string(func, "info", "", 0, "Info", "");
 	RNA_def_property_flag(prop, PROP_REQUIRED);
 
+	func= RNA_def_function(srna, "update_progress", "RE_engine_update_progress");
+	prop= RNA_def_float(func, "progress", 0, 0.0f, 1.0f, "", "Percentage of render that's done.", 0.0f, 1.0f);
+	RNA_def_property_flag(prop, PROP_REQUIRED);
+
 	func= RNA_def_function(srna, "report", "RE_engine_report");
 	prop= RNA_def_enum_flag(func, "type", wm_report_items, 0, "Type", "");
 	RNA_def_property_flag(prop, PROP_REQUIRED);

Modified: branches/cycles/source/blender/render/extern/include/RE_engine.h
===================================================================
--- branches/cycles/source/blender/render/extern/include/RE_engine.h	2011-05-17 15:20:12 UTC (rev 36730)
+++ branches/cycles/source/blender/render/extern/include/RE_engine.h	2011-05-17 15:39:40 UTC (rev 36731)
@@ -99,6 +99,7 @@
 
 LIBEXPORT int RE_engine_test_break(RenderEngine *engine);
 LIBEXPORT void RE_engine_update_stats(RenderEngine *engine, const char *stats, const char *info);
+LIBEXPORT void RE_engine_update_progress(RenderEngine *engine, float progress);
 LIBEXPORT void RE_engine_report(RenderEngine *engine, int type, const char *msg);
 
 int RE_engine_render(struct Render *re, int do_all);

Modified: branches/cycles/source/blender/render/intern/pipeline/engine.c
===================================================================
--- branches/cycles/source/blender/render/intern/pipeline/engine.c	2011-05-17 15:20:12 UTC (rev 36730)
+++ branches/cycles/source/blender/render/intern/pipeline/engine.c	2011-05-17 15:39:40 UTC (rev 36731)
@@ -209,6 +209,14 @@
 	re->i.statstr= NULL;
 }
 
+void RE_engine_update_progress(RenderEngine *engine, float progress)
+{
+	Render *re= engine->re;
+
+	CLAMP(progress, 0.0f, 1.0f);
+	re->progress(re->prh, progress);
+}
+
 void RE_engine_report(RenderEngine *engine, int type, const char *msg)
 {
 	BKE_report(engine->re->reports, type, msg);




More information about the Bf-blender-cvs mailing list