Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_clip/space_clip.c
| Show First 20 Lines • Show All 217 Lines • ▼ Show 20 Lines | |||||
| static void clip_area_sync_frame_from_scene(ScrArea *area, const Scene *scene) | static void clip_area_sync_frame_from_scene(ScrArea *area, const Scene *scene) | ||||
| { | { | ||||
| SpaceClip *space_clip = (SpaceClip *)area->spacedata.first; | SpaceClip *space_clip = (SpaceClip *)area->spacedata.first; | ||||
| BKE_movieclip_user_set_frame(&space_clip->user, scene->r.cfra); | BKE_movieclip_user_set_frame(&space_clip->user, scene->r.cfra); | ||||
| } | } | ||||
| /* ******************** default callbacks for clip space ***************** */ | /* ******************** default callbacks for clip space ***************** */ | ||||
| static SpaceLink *clip_create(const ScrArea *area, const Scene *scene) | static SpaceLink *clip_create(const wmWindow *win, const ScrArea *area) | ||||
| { | { | ||||
| const Scene *scene = WM_window_get_active_scene(win); | |||||
| ARegion *region; | ARegion *region; | ||||
| SpaceClip *sc; | SpaceClip *sc; | ||||
| sc = DNA_struct_default_alloc(SpaceClip); | sc = DNA_struct_default_alloc(SpaceClip); | ||||
| /* header */ | /* header */ | ||||
| region = MEM_callocN(sizeof(ARegion), "header for clip"); | region = MEM_callocN(sizeof(ARegion), "header for clip"); | ||||
| ▲ Show 20 Lines • Show All 747 Lines • ▼ Show 20 Lines | if (sc->flag & SC_SHOW_SECONDS) { | ||||
| cfra_flag |= DRAWCFRA_UNIT_SECONDS; | cfra_flag |= DRAWCFRA_UNIT_SECONDS; | ||||
| } | } | ||||
| ANIM_draw_cfra(C, v2d, cfra_flag); | ANIM_draw_cfra(C, v2d, cfra_flag); | ||||
| /* 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, FPS, sc->flag & SC_SHOW_SECONDS, true); | ||||
| /* current frame indicator */ | /* current frame indicator */ | ||||
| ED_time_scrub_draw_current_frame(region, scene, sc->flag & SC_SHOW_SECONDS); | ED_time_scrub_draw_current_frame(region, &scene->r, sc->flag & SC_SHOW_SECONDS); | ||||
| /* scrollers */ | /* scrollers */ | ||||
| UI_view2d_scrollers_draw(v2d, NULL); | UI_view2d_scrollers_draw(v2d, NULL); | ||||
| /* scale indicators */ | /* scale indicators */ | ||||
| { | { | ||||
| rcti rect; | rcti rect; | ||||
| BLI_rcti_init( | BLI_rcti_init( | ||||
| Show All 15 Lines | static void dopesheet_region_draw(const bContext *C, ARegion *region) | ||||
| } | } | ||||
| /* clear and setup matrix */ | /* clear and setup matrix */ | ||||
| UI_ThemeClearColor(TH_BACK); | UI_ThemeClearColor(TH_BACK); | ||||
| UI_view2d_view_ortho(v2d); | UI_view2d_view_ortho(v2d); | ||||
| /* time grid */ | /* time grid */ | ||||
| UI_view2d_draw_lines_x__discrete_frames_or_seconds(v2d, scene, sc->flag & SC_SHOW_SECONDS, true); | UI_view2d_draw_lines_x__discrete_frames_or_seconds(v2d, FPS, sc->flag & SC_SHOW_SECONDS, true); | ||||
| /* data... */ | /* data... */ | ||||
| clip_draw_dopesheet_main(sc, region, scene); | clip_draw_dopesheet_main(sc, region, scene); | ||||
| /* current frame indicator line */ | /* current frame indicator line */ | ||||
| if (sc->flag & SC_SHOW_SECONDS) { | if (sc->flag & SC_SHOW_SECONDS) { | ||||
| cfra_flag |= DRAWCFRA_UNIT_SECONDS; | cfra_flag |= DRAWCFRA_UNIT_SECONDS; | ||||
| } | } | ||||
| ANIM_draw_cfra(C, v2d, cfra_flag); | ANIM_draw_cfra(C, v2d, cfra_flag); | ||||
| /* 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, FPS, sc->flag & SC_SHOW_SECONDS, true); | ||||
| /* current frame indicator */ | /* current frame indicator */ | ||||
| ED_time_scrub_draw_current_frame(region, scene, sc->flag & SC_SHOW_SECONDS); | ED_time_scrub_draw_current_frame(region, &scene->r, sc->flag & SC_SHOW_SECONDS); | ||||
| /* scrollers */ | /* scrollers */ | ||||
| UI_view2d_scrollers_draw(v2d, NULL); | UI_view2d_scrollers_draw(v2d, NULL); | ||||
| } | } | ||||
| 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); | ||||
| ▲ Show 20 Lines • Show All 314 Lines • Show Last 20 Lines | |||||