Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_templates.c
| Show First 20 Lines • Show All 3,332 Lines • ▼ Show 20 Lines | |||||
| /************************* Running Jobs Template **************************/ | /************************* Running Jobs Template **************************/ | ||||
| #define B_STOPRENDER 1 | #define B_STOPRENDER 1 | ||||
| #define B_STOPCAST 2 | #define B_STOPCAST 2 | ||||
| #define B_STOPANIM 3 | #define B_STOPANIM 3 | ||||
| #define B_STOPCOMPO 4 | #define B_STOPCOMPO 4 | ||||
| #define B_STOPSEQ 5 | #define B_STOPSEQ 5 | ||||
| #define B_STOPCLIP 6 | #define B_STOPCLIP 6 | ||||
| #define B_STOPOTHER 7 | #define B_STOPFILE 7 | ||||
| #define B_STOPOTHER 8 | |||||
| static void do_running_jobs(bContext *C, void *UNUSED(arg), int event) | static void do_running_jobs(bContext *C, void *UNUSED(arg), int event) | ||||
| { | { | ||||
| switch (event) { | switch (event) { | ||||
| case B_STOPRENDER: | case B_STOPRENDER: | ||||
| G.is_break = true; | G.is_break = true; | ||||
| break; | break; | ||||
| case B_STOPCAST: | case B_STOPCAST: | ||||
| WM_jobs_stop(CTX_wm_manager(C), CTX_wm_screen(C), NULL); | WM_jobs_stop(CTX_wm_manager(C), CTX_wm_screen(C), NULL); | ||||
| break; | break; | ||||
| case B_STOPANIM: | case B_STOPANIM: | ||||
| WM_operator_name_call(C, "SCREEN_OT_animation_play", WM_OP_INVOKE_SCREEN, NULL); | WM_operator_name_call(C, "SCREEN_OT_animation_play", WM_OP_INVOKE_SCREEN, NULL); | ||||
| break; | break; | ||||
| case B_STOPCOMPO: | case B_STOPCOMPO: | ||||
| WM_jobs_stop(CTX_wm_manager(C), CTX_data_scene(C), NULL); | WM_jobs_stop(CTX_wm_manager(C), CTX_data_scene(C), NULL); | ||||
| break; | break; | ||||
| case B_STOPSEQ: | case B_STOPSEQ: | ||||
| WM_jobs_stop(CTX_wm_manager(C), CTX_wm_area(C), NULL); | WM_jobs_stop(CTX_wm_manager(C), CTX_wm_area(C), NULL); | ||||
| break; | break; | ||||
| case B_STOPCLIP: | case B_STOPCLIP: | ||||
| WM_jobs_stop(CTX_wm_manager(C), CTX_wm_area(C), NULL); | WM_jobs_stop(CTX_wm_manager(C), CTX_wm_area(C), NULL); | ||||
| break; | break; | ||||
| case B_STOPFILE: | |||||
| WM_jobs_stop(CTX_wm_manager(C), CTX_wm_area(C), NULL); | |||||
| break; | |||||
| case B_STOPOTHER: | case B_STOPOTHER: | ||||
| G.is_break = true; | G.is_break = true; | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| void uiTemplateRunningJobs(uiLayout *layout, bContext *C) | void uiTemplateRunningJobs(uiLayout *layout, bContext *C) | ||||
| { | { | ||||
| Show All 14 Lines | if (WM_jobs_test(wm, sa, WM_JOB_TYPE_ANY)) | ||||
| owner = sa; | owner = sa; | ||||
| handle_event = B_STOPSEQ; | handle_event = B_STOPSEQ; | ||||
| } | } | ||||
| else if (sa->spacetype == SPACE_CLIP) { | else if (sa->spacetype == SPACE_CLIP) { | ||||
| if (WM_jobs_test(wm, sa, WM_JOB_TYPE_ANY)) | if (WM_jobs_test(wm, sa, WM_JOB_TYPE_ANY)) | ||||
| owner = sa; | owner = sa; | ||||
| handle_event = B_STOPCLIP; | handle_event = B_STOPCLIP; | ||||
| } | } | ||||
| else if (sa->spacetype == SPACE_FILE) { | |||||
| if (WM_jobs_test(wm, sa, WM_JOB_TYPE_FILESEL_READDIR)) { | |||||
| owner = sa; | |||||
| } | |||||
| handle_event = B_STOPFILE; | |||||
| } | |||||
| else { | else { | ||||
| Scene *scene; | Scene *scene; | ||||
| /* another scene can be rendering too, for example via compositor */ | /* another scene can be rendering too, for example via compositor */ | ||||
| for (scene = CTX_data_main(C)->scene.first; scene; scene = scene->id.next) { | for (scene = CTX_data_main(C)->scene.first; scene; scene = scene->id.next) { | ||||
| if (WM_jobs_test(wm, scene, WM_JOB_TYPE_RENDER)) { | if (WM_jobs_test(wm, scene, WM_JOB_TYPE_RENDER)) { | ||||
| handle_event = B_STOPRENDER; | handle_event = B_STOPRENDER; | ||||
| break; | break; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 304 Lines • Show Last 20 Lines | |||||