diff options
Diffstat (limited to 'source/blender/editors/render')
-rw-r--r-- | source/blender/editors/render/render_opengl.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index cdebbf4e103..21074bdc47c 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -517,7 +517,7 @@ static int screen_opengl_render_anim_initialize(bContext *C, wmOperator *op) return 1; } -static int screen_opengl_render_anim_step(bContext *C, wmOperator *op) +static bool screen_opengl_render_anim_step(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); OGLRender *oglrender = op->customdata; @@ -549,12 +549,9 @@ static int screen_opengl_render_anim_step(bContext *C, wmOperator *op) BKE_makepicstring(name, scene->r.pic, oglrender->bmain->name, scene->r.cfra, &scene->r.im_format, scene->r.scemode & R_EXTENSION, TRUE); if ((scene->r.mode & R_NO_OVERWRITE) && BLI_exists(name)) { - printf("skipping existing frame \"%s\"\n", name); - - /* go to next frame */ - oglrender->nfra += scene->r.frame_step; - - return 1; + BKE_reportf(op->reports, RPT_INFO, "Skipping existing frame \"%s\"", name); + ok = true; + goto finally; } } @@ -656,6 +653,9 @@ static int screen_opengl_render_anim_step(bContext *C, wmOperator *op) /* movie stats prints have no line break */ printf("\n"); + +finally: /* Step the frame and bail early if needed */ + /* go to next frame */ oglrender->nfra += scene->r.frame_step; @@ -673,7 +673,7 @@ static int screen_opengl_render_modal(bContext *C, wmOperator *op, const wmEvent { OGLRender *oglrender = op->customdata; int anim = RNA_boolean_get(op->ptr, "animation"); - int ret; + bool ret; switch (event->type) { case ESCKEY: @@ -698,11 +698,12 @@ static int screen_opengl_render_modal(bContext *C, wmOperator *op, const wmEvent screen_opengl_render_end(C, op->customdata); return OPERATOR_FINISHED; } - else + else { ret = screen_opengl_render_anim_step(C, op); + } /* stop at the end or on error */ - if (ret == 0) { + if (ret == false) { return OPERATOR_FINISHED; } @@ -750,7 +751,7 @@ static int screen_opengl_render_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } else { - int ret = 1; + bool ret = true; if (!screen_opengl_render_anim_initialize(C, op)) return OPERATOR_CANCELLED; |