From 2c4dfbb00246ff59cac424392588d55363aa2400 Mon Sep 17 00:00:00 2001 From: Richard Antalik Date: Thu, 1 Aug 2019 12:40:57 -0700 Subject: Fix T66028: Move sequence, movieclip and text editor progressbars to status bar Reviewed By: brecht Differential Revision: https://developer.blender.org/D5219 --- .../editors/interface/interface_templates.c | 156 ++++++++++++--------- source/blender/editors/space_clip/clip_editor.c | 2 +- source/blender/editors/space_clip/clip_ops.c | 2 +- .../editors/space_clip/tracking_ops_solve.c | 7 +- .../editors/space_clip/tracking_ops_track.c | 7 +- source/blender/editors/space_file/filelist.c | 2 +- .../editors/space_sequencer/sequencer_edit.c | 2 +- .../editors/space_sequencer/sequencer_preview.c | 2 +- 8 files changed, 97 insertions(+), 83 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 1fc1af9815f..654483c2182 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -6057,13 +6057,13 @@ static void do_running_jobs(bContext *C, void *UNUSED(arg), int event) WM_jobs_stop(CTX_wm_manager(C), CTX_data_scene(C), NULL); break; case B_STOPSEQ: - WM_jobs_stop(CTX_wm_manager(C), CTX_wm_area(C), NULL); + WM_jobs_stop(CTX_wm_manager(C), CTX_data_scene(C), NULL); break; case B_STOPCLIP: - WM_jobs_stop(CTX_wm_manager(C), CTX_wm_area(C), NULL); + WM_jobs_stop(CTX_wm_manager(C), CTX_data_scene(C), NULL); break; case B_STOPFILE: - WM_jobs_stop(CTX_wm_manager(C), CTX_wm_area(C), NULL); + WM_jobs_stop(CTX_wm_manager(C), CTX_data_scene(C), NULL); break; case B_STOPOTHER: G.is_break = true; @@ -6116,80 +6116,96 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C) UI_block_func_handle_set(block, do_running_jobs, NULL); - if (sa->spacetype == SPACE_SEQ) { - if (WM_jobs_test(wm, sa, WM_JOB_TYPE_ANY)) { - owner = sa; + Scene *scene; + /* another scene can be rendering too, for example via compositor */ + for (scene = CTX_data_main(C)->scenes.first; scene; scene = scene->id.next) { + if (WM_jobs_test(wm, scene, WM_JOB_TYPE_ANY)) { + handle_event = B_STOPOTHER; + icon = ICON_NONE; + owner = scene; } - handle_event = B_STOPSEQ; - icon = ICON_SEQUENCE; - } - else if (sa->spacetype == SPACE_CLIP) { - if (WM_jobs_test(wm, sa, WM_JOB_TYPE_ANY)) { - owner = sa; + else { + continue; } - handle_event = B_STOPCLIP; - icon = ICON_TRACKER; - } - else if (sa->spacetype == SPACE_FILE) { - if (WM_jobs_test(wm, sa, WM_JOB_TYPE_FILESEL_READDIR)) { - owner = sa; + + if (WM_jobs_test(wm, scene, WM_JOB_TYPE_SEQ_BUILD_PROXY)) { + handle_event = B_STOPSEQ; + icon = ICON_SEQUENCE; + owner = scene; + break; } - handle_event = B_STOPFILE; - icon = ICON_FILEBROWSER; - } - else { - Scene *scene; - /* another scene can be rendering too, for example via compositor */ - for (scene = CTX_data_main(C)->scenes.first; scene; scene = scene->id.next) { - if (WM_jobs_test(wm, scene, WM_JOB_TYPE_RENDER)) { - handle_event = B_STOPRENDER; - icon = ICON_SCENE; - break; - } - else if (WM_jobs_test(wm, scene, WM_JOB_TYPE_COMPOSITE)) { - handle_event = B_STOPCOMPO; - icon = ICON_RENDERLAYERS; - break; - } - else if (WM_jobs_test(wm, scene, WM_JOB_TYPE_OBJECT_BAKE_TEXTURE) || - WM_jobs_test(wm, scene, WM_JOB_TYPE_OBJECT_BAKE)) { - /* Skip bake jobs in compositor to avoid compo header displaying - * progress bar which is not being updated (bake jobs only need - * to update NC_IMAGE context. - */ - if (sa->spacetype != SPACE_NODE) { - handle_event = B_STOPOTHER; - icon = ICON_IMAGE; - break; - } - } - else if (WM_jobs_test(wm, scene, WM_JOB_TYPE_DPAINT_BAKE)) { - handle_event = B_STOPOTHER; - icon = ICON_MOD_DYNAMICPAINT; - break; - } - else if (WM_jobs_test(wm, scene, WM_JOB_TYPE_POINTCACHE)) { - handle_event = B_STOPOTHER; - icon = ICON_PHYSICS; - break; - } - else if (WM_jobs_test(wm, scene, WM_JOB_TYPE_OBJECT_SIM_FLUID)) { - handle_event = B_STOPOTHER; - icon = ICON_MOD_FLUIDSIM; - break; - } - else if (WM_jobs_test(wm, scene, WM_JOB_TYPE_OBJECT_SIM_OCEAN)) { - handle_event = B_STOPOTHER; - icon = ICON_MOD_OCEAN; - break; - } - else if (WM_jobs_test(wm, scene, WM_JOB_TYPE_ANY)) { + else if (WM_jobs_test(wm, scene, WM_JOB_TYPE_SEQ_BUILD_PREVIEW)) { + handle_event = B_STOPSEQ; + icon = ICON_SEQUENCE; + break; + } + else if (WM_jobs_test(wm, scene, WM_JOB_TYPE_CLIP_BUILD_PROXY)) { + handle_event = B_STOPCLIP; + icon = ICON_TRACKER; + break; + } + else if (WM_jobs_test(wm, scene, WM_JOB_TYPE_CLIP_PREFETCH)) { + handle_event = B_STOPCLIP; + icon = ICON_TRACKER; + break; + } + else if (WM_jobs_test(wm, scene, WM_JOB_TYPE_CLIP_TRACK_MARKERS)) { + handle_event = B_STOPCLIP; + icon = ICON_TRACKER; + break; + } + else if (WM_jobs_test(wm, scene, WM_JOB_TYPE_CLIP_SOLVE_CAMERA)) { + handle_event = B_STOPCLIP; + icon = ICON_TRACKER; + break; + } + else if (WM_jobs_test(wm, scene, WM_JOB_TYPE_FILESEL_READDIR)) { + handle_event = B_STOPFILE; + icon = ICON_FILEBROWSER; + break; + } + else if (WM_jobs_test(wm, scene, WM_JOB_TYPE_RENDER)) { + handle_event = B_STOPRENDER; + icon = ICON_SCENE; + break; + } + else if (WM_jobs_test(wm, scene, WM_JOB_TYPE_COMPOSITE)) { + handle_event = B_STOPCOMPO; + icon = ICON_RENDERLAYERS; + break; + } + else if (WM_jobs_test(wm, scene, WM_JOB_TYPE_OBJECT_BAKE_TEXTURE) || + WM_jobs_test(wm, scene, WM_JOB_TYPE_OBJECT_BAKE)) { + /* Skip bake jobs in compositor to avoid compo header displaying + * progress bar which is not being updated (bake jobs only need + * to update NC_IMAGE context. + */ + if (sa->spacetype != SPACE_NODE) { handle_event = B_STOPOTHER; - icon = ICON_NONE; + icon = ICON_IMAGE; break; } } - owner = scene; + else if (WM_jobs_test(wm, scene, WM_JOB_TYPE_DPAINT_BAKE)) { + handle_event = B_STOPOTHER; + icon = ICON_MOD_DYNAMICPAINT; + break; + } + else if (WM_jobs_test(wm, scene, WM_JOB_TYPE_POINTCACHE)) { + handle_event = B_STOPOTHER; + icon = ICON_PHYSICS; + break; + } + else if (WM_jobs_test(wm, scene, WM_JOB_TYPE_OBJECT_SIM_FLUID)) { + handle_event = B_STOPOTHER; + icon = ICON_MOD_FLUIDSIM; + break; + } + else if (WM_jobs_test(wm, scene, WM_JOB_TYPE_OBJECT_SIM_OCEAN)) { + handle_event = B_STOPOTHER; + icon = ICON_MOD_OCEAN; + break; + } } if (owner) { diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c index b0b6aa47df1..fbefc884589 100644 --- a/source/blender/editors/space_clip/clip_editor.c +++ b/source/blender/editors/space_clip/clip_editor.c @@ -1153,7 +1153,7 @@ void clip_start_prefetch_job(const bContext *C) wm_job = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), - CTX_wm_area(C), + CTX_data_scene(C), "Prefetching", WM_JOB_PROGRESS, WM_JOB_TYPE_CLIP_PREFETCH); diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index 5f04d0863a7..af998fda6f9 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -1458,7 +1458,7 @@ static int clip_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op)) wm_job = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), - sa, + scene, "Building Proxies", WM_JOB_PROGRESS, WM_JOB_TYPE_CLIP_BUILD_PROXY); diff --git a/source/blender/editors/space_clip/tracking_ops_solve.c b/source/blender/editors/space_clip/tracking_ops_solve.c index 806df4dbaff..96b00ec5463 100644 --- a/source/blender/editors/space_clip/tracking_ops_solve.c +++ b/source/blender/editors/space_clip/tracking_ops_solve.c @@ -191,7 +191,6 @@ static int solve_camera_exec(bContext *C, wmOperator *op) static int solve_camera_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { SolveCameraJob *scj; - ScrArea *sa = CTX_wm_area(C); SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; @@ -199,7 +198,7 @@ static int solve_camera_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSE wmJob *wm_job; char error_msg[256] = "\0"; - if (WM_jobs_test(CTX_wm_manager(C), sa, WM_JOB_TYPE_ANY)) { + if (WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C), WM_JOB_TYPE_CLIP_SOLVE_CAMERA)) { /* only one solve is allowed at a time */ return OPERATOR_CANCELLED; } @@ -224,7 +223,7 @@ static int solve_camera_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSE /* Setup job. */ wm_job = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), - sa, + CTX_data_scene(C), "Solve Camera", WM_JOB_PROGRESS, WM_JOB_TYPE_CLIP_SOLVE_CAMERA); @@ -246,7 +245,7 @@ static int solve_camera_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSE static int solve_camera_modal(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { /* No running solver, remove handler and pass through. */ - if (0 == WM_jobs_test(CTX_wm_manager(C), CTX_wm_area(C), WM_JOB_TYPE_ANY)) { + if (0 == WM_jobs_test(CTX_wm_manager(C), CTX_wm_area(C), WM_JOB_TYPE_CLIP_SOLVE_CAMERA)) { return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH; } diff --git a/source/blender/editors/space_clip/tracking_ops_track.c b/source/blender/editors/space_clip/tracking_ops_track.c index e9a685f9e21..9536c64c415 100644 --- a/source/blender/editors/space_clip/tracking_ops_track.c +++ b/source/blender/editors/space_clip/tracking_ops_track.c @@ -288,7 +288,6 @@ static void track_markers_freejob(void *tmv) static int track_markers(bContext *C, wmOperator *op, bool use_job) { TrackMarkersJob *tmj; - ScrArea *sa = CTX_wm_area(C); SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); wmJob *wm_job; @@ -296,7 +295,7 @@ static int track_markers(bContext *C, wmOperator *op, bool use_job) bool sequence = RNA_boolean_get(op->ptr, "sequence"); int framenr = ED_space_clip_get_clip_frame_number(sc); - if (WM_jobs_test(CTX_wm_manager(C), sa, WM_JOB_TYPE_ANY)) { + if (WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C), WM_JOB_TYPE_ANY)) { /* Only one tracking is allowed at a time. */ return OPERATOR_CANCELLED; } @@ -319,7 +318,7 @@ static int track_markers(bContext *C, wmOperator *op, bool use_job) if (use_job && sequence) { wm_job = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), - sa, + CTX_data_scene(C), "Track Markers", WM_JOB_PROGRESS, WM_JOB_TYPE_CLIP_TRACK_MARKERS); @@ -372,7 +371,7 @@ static int track_markers_invoke(bContext *C, wmOperator *op, const wmEvent *UNUS static int track_markers_modal(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { /* No running tracking, remove handler and pass through. */ - if (0 == WM_jobs_test(CTX_wm_manager(C), CTX_wm_area(C), WM_JOB_TYPE_ANY)) { + if (0 == WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C), WM_JOB_TYPE_ANY)) { return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH; } diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index e06ee620ea7..f7dda1defe8 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -2917,7 +2917,7 @@ void filelist_readjob_start(FileList *filelist, const bContext *C) /* setup job */ wm_job = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), - CTX_wm_area(C), + CTX_data_scene(C), "Listing Dirs...", WM_JOB_PROGRESS, WM_JOB_TYPE_FILESEL_READDIR); diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 2cdadfbd2ab..bf138e5bc91 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -194,7 +194,7 @@ static void seq_proxy_build_job(const bContext *C) wm_job = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), - sa, + scene, "Building Proxies", WM_JOB_PROGRESS, WM_JOB_TYPE_SEQ_BUILD_PROXY); diff --git a/source/blender/editors/space_sequencer/sequencer_preview.c b/source/blender/editors/space_sequencer/sequencer_preview.c index 81ddd0dd8cc..8ec3ed850d2 100644 --- a/source/blender/editors/space_sequencer/sequencer_preview.c +++ b/source/blender/editors/space_sequencer/sequencer_preview.c @@ -134,7 +134,7 @@ void sequencer_preview_add_sound(const bContext *C, Sequence *seq) PreviewJobAudio *audiojob = MEM_callocN(sizeof(PreviewJobAudio), "preview_audio"); wm_job = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), - sa, + CTX_data_scene(C), "Strip Previews", WM_JOB_PROGRESS, WM_JOB_TYPE_SEQ_BUILD_PREVIEW); -- cgit v1.2.3