diff options
Diffstat (limited to 'source/blender/editors/render')
-rw-r--r-- | source/blender/editors/render/render_internal.c | 15 | ||||
-rw-r--r-- | source/blender/editors/render/render_preview.c | 6 |
2 files changed, 16 insertions, 5 deletions
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 7a8ffbac811..268acba1db7 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -441,6 +441,7 @@ typedef struct RenderJob { ImageUser iuser; short *stop; short *do_update; + float *progress; ReportList *reports; } RenderJob; @@ -519,6 +520,14 @@ static void image_renderinfo_cb(void *rjv, RenderStats *rs) } +static void render_progress_update(void *rjv, float progress) +{ + RenderJob *rj= rjv; + + if (rj->progress) + *rj->progress = progress; +} + static void image_rect_update(void *rjv, RenderResult *rr, volatile rcti *renrect) { RenderJob *rj= rjv; @@ -540,13 +549,14 @@ static void image_rect_update(void *rjv, RenderResult *rr, volatile rcti *renrec BKE_image_release_ibuf(ima, lock); } -static void render_startjob(void *rjv, short *stop, short *do_update) +static void render_startjob(void *rjv, short *stop, short *do_update, float *progress) { RenderJob *rj= rjv; // Main *mainp= BKE_undo_get_main(&rj->scene); rj->stop= stop; rj->do_update= do_update; + rj->progress= progress; if(rj->anim) RE_BlenderAnim(rj->re, rj->scene, rj->lay, rj->scene->r.sfra, rj->scene->r.efra, rj->scene->r.frame_step, rj->reports); @@ -663,7 +673,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) rj->reports= op->reports; /* setup job */ - steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), scene, WM_JOB_EXCL_RENDER|WM_JOB_PRIORITY); + steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), scene, "Render", WM_JOB_EXCL_RENDER|WM_JOB_PRIORITY|WM_JOB_PROGRESS); WM_jobs_customdata(steve, rj, render_freejob); WM_jobs_timer(steve, 0.2, NC_SCENE|ND_RENDER_RESULT, 0); WM_jobs_callbacks(steve, render_startjob, NULL, NULL, render_endjob); @@ -679,6 +689,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) RE_test_break_cb(re, rj, render_breakjob); RE_display_draw_cb(re, rj, image_rect_update); RE_stats_draw_cb(re, rj, image_renderinfo_cb); + RE_progress_cb(re, rj, render_progress_update); rj->re= re; G.afbreek= 0; diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 112b0ea6cd4..898a8f527c3 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -1090,7 +1090,7 @@ static void icon_preview_startjob(void *customdata, short *stop, short *do_updat /* use same function for icon & shader, so the job manager does not run two of them at the same time. */ -static void common_preview_startjob(void *customdata, short *stop, short *do_update) +static void common_preview_startjob(void *customdata, short *stop, short *do_update, float *progress) { ShaderPreview *sp= customdata; @@ -1107,7 +1107,7 @@ void ED_preview_icon_job(const bContext *C, void *owner, ID *id, unsigned int *r wmJob *steve; ShaderPreview *sp; - steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), owner, WM_JOB_EXCL_RENDER); + steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), owner, "Icon Preview", WM_JOB_EXCL_RENDER); sp= MEM_callocN(sizeof(ShaderPreview), "shader preview"); /* customdata for preview thread */ @@ -1132,7 +1132,7 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, M wmJob *steve; ShaderPreview *sp; - steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), owner, WM_JOB_EXCL_RENDER); + steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), owner, "Shader Preview", WM_JOB_EXCL_RENDER); sp= MEM_callocN(sizeof(ShaderPreview), "shader preview"); /* customdata for preview thread */ |