Attempted fix for [#21491] rendering from the api does not work
Render was hanging on to old callbacks from interactive wmJob render when used as a blocking render from py API.
This commit is contained in:
@@ -385,6 +385,10 @@ static void render_error_reports(void *reports, char *str)
|
||||
BKE_report(reports, RPT_ERROR, str);
|
||||
}
|
||||
|
||||
static void result_nothing(void *unused, RenderResult *rr) {}
|
||||
static void result_rcti_nothing(void *unused, RenderResult *rr, volatile struct rcti *rect) {}
|
||||
static void stats_nothing(void *unused, RenderStats *rs) {}
|
||||
|
||||
/* executes blocking render */
|
||||
static int screen_render_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
@@ -397,9 +401,17 @@ static int screen_render_exec(bContext *C, wmOperator *op)
|
||||
if(re==NULL) {
|
||||
re= RE_NewRender(scene->id.name);
|
||||
}
|
||||
|
||||
G.afbreek= 0;
|
||||
RE_test_break_cb(re, NULL, (int (*)(void *)) blender_test_break);
|
||||
RE_error_cb(re, op->reports, render_error_reports);
|
||||
|
||||
/* clear other callbacks that may have previosuly been used by interactive render */
|
||||
RE_display_init_cb(re, NULL, result_nothing);
|
||||
RE_display_clear_cb(re, NULL, result_nothing);
|
||||
RE_display_draw_cb(re, NULL, result_rcti_nothing);
|
||||
RE_stats_draw_cb(re, NULL, stats_nothing);
|
||||
|
||||
ima= BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result");
|
||||
BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE);
|
||||
BKE_image_backup_render(scene, ima);
|
||||
|
||||
Reference in New Issue
Block a user