Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_action/space_action.c
| Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
| #include "ED_time_scrub_ui.h" | #include "ED_time_scrub_ui.h" | ||||
| #include "BLO_read_write.h" | #include "BLO_read_write.h" | ||||
| #include "action_intern.h" /* own include */ | #include "action_intern.h" /* own include */ | ||||
| /* ******************** default callbacks for action space ***************** */ | /* ******************** default callbacks for action space ***************** */ | ||||
| static SpaceLink *action_create(const ScrArea *area, const Scene *scene) | static SpaceLink *action_create(const wmWindow *win, const ScrArea *area) | ||||
| { | { | ||||
| const Scene *scene = WM_window_get_active_scene(win); | |||||
| SpaceAction *saction; | SpaceAction *saction; | ||||
| ARegion *region; | ARegion *region; | ||||
| saction = MEM_callocN(sizeof(SpaceAction), "initaction"); | saction = MEM_callocN(sizeof(SpaceAction), "initaction"); | ||||
| saction->spacetype = SPACE_ACTION; | saction->spacetype = SPACE_ACTION; | ||||
| saction->autosnap = SACTSNAP_FRAME; | saction->autosnap = SACTSNAP_FRAME; | ||||
| saction->mode = SACTCONT_DOPESHEET; | saction->mode = SACTCONT_DOPESHEET; | ||||
| ▲ Show 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | static void action_main_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( | UI_view2d_draw_lines_x__discrete_frames_or_seconds( | ||||
| v2d, scene, saction->flag & SACTION_DRAWTIME, true); | v2d, FPS, saction->flag & SACTION_DRAWTIME, true); | ||||
| ED_region_draw_cb_draw(C, region, REGION_DRAW_PRE_VIEW); | ED_region_draw_cb_draw(C, region, REGION_DRAW_PRE_VIEW); | ||||
| /* start and end frame */ | /* start and end frame */ | ||||
| ANIM_draw_framerange(scene, v2d); | ANIM_draw_framerange(scene, v2d); | ||||
| /* Draw the manually set intended playback frame range highlight in the Action editor. */ | /* Draw the manually set intended playback frame range highlight in the Action editor. */ | ||||
| if (ELEM(saction->mode, SACTCONT_ACTION, SACTCONT_SHAPEKEY) && saction->action) { | if (ELEM(saction->mode, SACTCONT_ACTION, SACTCONT_SHAPEKEY) && saction->action) { | ||||
| Show All 32 Lines | static void action_main_region_draw(const bContext *C, ARegion *region) | ||||
| /* reset view matrix */ | /* reset view matrix */ | ||||
| UI_view2d_view_restore(C); | UI_view2d_view_restore(C); | ||||
| /* gizmos */ | /* gizmos */ | ||||
| WM_gizmomap_draw(region->gizmo_map, C, WM_GIZMOMAP_DRAWSTEP_2D); | WM_gizmomap_draw(region->gizmo_map, C, WM_GIZMOMAP_DRAWSTEP_2D); | ||||
| /* scrubbing region */ | /* scrubbing region */ | ||||
| ED_time_scrub_draw(region, scene, saction->flag & SACTION_DRAWTIME, true); | ED_time_scrub_draw(region, FPS, saction->flag & SACTION_DRAWTIME, true); | ||||
| } | } | ||||
| static void action_main_region_draw_overlay(const bContext *C, ARegion *region) | static void action_main_region_draw_overlay(const bContext *C, ARegion *region) | ||||
| { | { | ||||
| /* draw entirely, view changes should be handled here */ | /* draw entirely, view changes should be handled here */ | ||||
| const SpaceAction *saction = CTX_wm_space_action(C); | const SpaceAction *saction = CTX_wm_space_action(C); | ||||
| const Scene *scene = CTX_data_scene(C); | const Scene *scene = CTX_data_scene(C); | ||||
| View2D *v2d = ®ion->v2d; | View2D *v2d = ®ion->v2d; | ||||
| /* scrubbing region */ | /* scrubbing region */ | ||||
| ED_time_scrub_draw_current_frame(region, scene, saction->flag & SACTION_DRAWTIME); | ED_time_scrub_draw_current_frame(region, &scene->r, saction->flag & SACTION_DRAWTIME); | ||||
| /* scrollers */ | /* scrollers */ | ||||
| UI_view2d_scrollers_draw(v2d, NULL); | UI_view2d_scrollers_draw(v2d, NULL); | ||||
| } | } | ||||
| /* add handlers, stuff you only do once or on area/region changes */ | /* add handlers, stuff you only do once or on area/region changes */ | ||||
| static void action_channel_region_init(wmWindowManager *wm, ARegion *region) | static void action_channel_region_init(wmWindowManager *wm, ARegion *region) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 689 Lines • Show Last 20 Lines | |||||