add wm job types they are not used yet, so this just defines them for new jobs add add argument to search by job type.

This commit is contained in:
2012-08-15 09:42:06 +00:00
parent b174610a84
commit 97859e8709
17 changed files with 83 additions and 46 deletions

View File

@@ -457,7 +457,7 @@ static int screen_render_modal(bContext *C, wmOperator *op, wmEvent *event)
Scene *scene = (Scene *) op->customdata;
/* no running blender, remove handler and pass through */
if (0 == WM_jobs_test(CTX_wm_manager(C), scene)) {
if (0 == WM_jobs_test(CTX_wm_manager(C), scene, WM_JOB_TYPE_ANY)) {
return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH;
}
@@ -489,7 +489,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
const char *name;
/* only one render job at a time */
if (WM_jobs_test(CTX_wm_manager(C), scene))
if (WM_jobs_test(CTX_wm_manager(C), scene, WM_JOB_TYPE_ANY))
return OPERATOR_CANCELLED;
if (!RE_is_rendering_allowed(scene, camera_override, op->reports)) {
@@ -564,7 +564,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
if (RE_seq_render_active(scene, &scene->r)) name = "Sequence Render";
else name = "Render";
steve = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), scene, name, jobflag);
steve = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), scene, name, jobflag, WM_JOB_TYPE_RENDER);
WM_jobs_customdata_set(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);