Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_clip/space_clip.c
| Show First 20 Lines • Show All 1,039 Lines • ▼ Show 20 Lines | static void clip_preview_region_init(wmWindowManager *wm, ARegion *region) | ||||
| keymap = WM_keymap_ensure(wm->defaultconf, "Clip Dopesheet Editor", SPACE_CLIP, 0); | keymap = WM_keymap_ensure(wm->defaultconf, "Clip Dopesheet Editor", SPACE_CLIP, 0); | ||||
| WM_event_add_keymap_handler_v2d_mask(®ion->handlers, keymap); | WM_event_add_keymap_handler_v2d_mask(®ion->handlers, keymap); | ||||
| } | } | ||||
| static void graph_region_draw(const bContext *C, ARegion *region) | static void graph_region_draw(const bContext *C, ARegion *region) | ||||
| { | { | ||||
| View2D *v2d = ®ion->v2d; | View2D *v2d = ®ion->v2d; | ||||
| View2DScrollers *scrollers; | |||||
| SpaceClip *sc = CTX_wm_space_clip(C); | SpaceClip *sc = CTX_wm_space_clip(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| short cfra_flag = 0; | short cfra_flag = 0; | ||||
| if (sc->flag & SC_LOCK_TIMECURSOR) { | if (sc->flag & SC_LOCK_TIMECURSOR) { | ||||
| ED_clip_graph_center_current_frame(scene, region); | ED_clip_graph_center_current_frame(scene, region); | ||||
| } | } | ||||
| Show All 14 Lines | static void graph_region_draw(const bContext *C, ARegion *region) | ||||
| /* reset view matrix */ | /* reset view matrix */ | ||||
| UI_view2d_view_restore(C); | UI_view2d_view_restore(C); | ||||
| /* time-scrubbing */ | /* time-scrubbing */ | ||||
| ED_time_scrub_draw(region, scene, sc->flag & SC_SHOW_SECONDS, true); | ED_time_scrub_draw(region, scene, sc->flag & SC_SHOW_SECONDS, true); | ||||
| /* scrollers */ | /* scrollers */ | ||||
| scrollers = UI_view2d_scrollers_calc(v2d, NULL); | UI_view2d_scrollers_draw(v2d, NULL); | ||||
| UI_view2d_scrollers_draw(v2d, scrollers); | |||||
| UI_view2d_scrollers_free(scrollers); | |||||
| /* scale indicators */ | /* scale indicators */ | ||||
| { | { | ||||
| rcti rect; | rcti rect; | ||||
| BLI_rcti_init( | BLI_rcti_init( | ||||
| &rect, 0, 15 * UI_DPI_FAC, 15 * UI_DPI_FAC, region->winy - UI_TIME_SCRUB_MARGIN_Y); | &rect, 0, 15 * UI_DPI_FAC, 15 * UI_DPI_FAC, region->winy - UI_TIME_SCRUB_MARGIN_Y); | ||||
| UI_view2d_draw_scale_y__values(region, v2d, &rect, TH_TEXT); | UI_view2d_draw_scale_y__values(region, v2d, &rect, TH_TEXT); | ||||
| } | } | ||||
| } | } | ||||
| static void dopesheet_region_draw(const bContext *C, ARegion *region) | static void dopesheet_region_draw(const bContext *C, ARegion *region) | ||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| SpaceClip *sc = CTX_wm_space_clip(C); | SpaceClip *sc = CTX_wm_space_clip(C); | ||||
| MovieClip *clip = ED_space_clip_get_clip(sc); | MovieClip *clip = ED_space_clip_get_clip(sc); | ||||
| View2D *v2d = ®ion->v2d; | View2D *v2d = ®ion->v2d; | ||||
| View2DScrollers *scrollers; | |||||
| short cfra_flag = 0; | short cfra_flag = 0; | ||||
| if (clip) { | if (clip) { | ||||
| BKE_tracking_dopesheet_update(&clip->tracking); | BKE_tracking_dopesheet_update(&clip->tracking); | ||||
| } | } | ||||
| /* clear and setup matrix */ | /* clear and setup matrix */ | ||||
| UI_ThemeClearColor(TH_BACK); | UI_ThemeClearColor(TH_BACK); | ||||
| Show All 15 Lines | static void dopesheet_region_draw(const bContext *C, ARegion *region) | ||||
| /* reset view matrix */ | /* reset view matrix */ | ||||
| UI_view2d_view_restore(C); | UI_view2d_view_restore(C); | ||||
| /* time-scrubbing */ | /* time-scrubbing */ | ||||
| ED_time_scrub_draw(region, scene, sc->flag & SC_SHOW_SECONDS, true); | ED_time_scrub_draw(region, scene, sc->flag & SC_SHOW_SECONDS, true); | ||||
| /* scrollers */ | /* scrollers */ | ||||
| scrollers = UI_view2d_scrollers_calc(v2d, NULL); | UI_view2d_scrollers_draw(v2d, NULL); | ||||
| UI_view2d_scrollers_draw(v2d, scrollers); | |||||
| UI_view2d_scrollers_free(scrollers); | |||||
| } | } | ||||
| static void clip_preview_region_draw(const bContext *C, ARegion *region) | static void clip_preview_region_draw(const bContext *C, ARegion *region) | ||||
| { | { | ||||
| SpaceClip *sc = CTX_wm_space_clip(C); | SpaceClip *sc = CTX_wm_space_clip(C); | ||||
| if (sc->view == SC_VIEW_GRAPH) { | if (sc->view == SC_VIEW_GRAPH) { | ||||
| graph_region_draw(C, region); | graph_region_draw(C, region); | ||||
| ▲ Show 20 Lines • Show All 305 Lines • Show Last 20 Lines | |||||