Fix T66028: Move sequence, movieclip and text editor progressbars to status bar

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5219
This commit is contained in:
Richard Antalik 2019-08-01 12:40:57 -07:00
parent aa0322524e
commit 2c4dfbb002
Notes: blender-bot 2023-02-14 07:47:59 +01:00
Referenced by commit ebf3c87912, Fix T74699: File browser closing while loading crash.
Referenced by issue #74699, File browser closing while loading crash.
Referenced by issue #70973, Where is the progress bar of Rebuild Proxy and Timecode Indices in VES
Referenced by issue #66028, Proxy in VSE does not work
9 changed files with 97 additions and 85 deletions

View File

@ -180,8 +180,6 @@ class CLIP_HT_header(Header):
active_object = tracking.objects.active
if sc.view == 'CLIP':
layout.template_running_jobs()
r = active_object.reconstruction
if r.is_valid and sc.view == 'CLIP':

View File

@ -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)) {
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_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)) {
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) {

View File

@ -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);

View File

@ -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);

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);

View File

@ -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);

View File

@ -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);