diff options
Diffstat (limited to 'source/blender/editors/space_graph/graph_edit.c')
-rw-r--r-- | source/blender/editors/space_graph/graph_edit.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 8c64fb5bb40..03151da8d4d 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -126,7 +126,8 @@ void get_graph_keyframe_extents(bAnimContext *ac, float unitFac, offset; /* get range */ - if (calc_fcurve_bounds(fcu, &txmin, &txmax, &tymin, &tymax, do_sel_only, include_handles)) { + if (BKE_fcurve_calc_bounds( + fcu, &txmin, &txmax, &tymin, &tymax, do_sel_only, include_handles)) { short mapping_flag = ANIM_get_normalization_flags(ac); /* apply NLA scaling */ @@ -328,7 +329,7 @@ static int graphkeys_view_selected_exec(bContext *C, wmOperator *op) void GRAPH_OT_view_all(wmOperatorType *ot) { /* identifiers */ - ot->name = "View All"; + ot->name = "Frame All"; ot->idname = "GRAPH_OT_view_all"; ot->description = "Reset viewable area to show full keyframe range"; @@ -385,7 +386,7 @@ void GRAPH_OT_view_frame(wmOperatorType *ot) /* identifiers */ ot->name = "Go to Current Frame"; ot->idname = "GRAPH_OT_view_frame"; - ot->description = "Move the view to the playhead"; + ot->description = "Move the view to the current frame"; /* api callbacks */ ot->exec = graphkeys_view_frame_exec; @@ -409,7 +410,7 @@ static void create_ghost_curves(bAnimContext *ac, int start, int end) int filter; /* free existing ghost curves */ - free_fcurves(&sipo->runtime.ghost_curves); + BKE_fcurves_free(&sipo->runtime.ghost_curves); /* sanity check */ if (start >= end) { @@ -425,7 +426,7 @@ static void create_ghost_curves(bAnimContext *ac, int start, int end) /* loop through filtered data and add keys between selected keyframes on every frame */ for (ale = anim_data.first; ale; ale = ale->next) { FCurve *fcu = (FCurve *)ale->key_data; - FCurve *gcu = MEM_callocN(sizeof(FCurve), "Ghost FCurve"); + FCurve *gcu = BKE_fcurve_create(); AnimData *adt = ANIM_nla_mapping_get(ac, ale); ChannelDriver *driver = fcu->driver; FPoint *fpt; @@ -536,7 +537,7 @@ static int graphkeys_clear_ghostcurves_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_CANCELLED; } /* free ghost curves */ - free_fcurves(&sipo->runtime.ghost_curves); + BKE_fcurves_free(&sipo->runtime.ghost_curves); /* update this editor only */ ED_area_tag_redraw(CTX_wm_area(C)); @@ -806,7 +807,7 @@ static int graphkeys_click_insert_exec(bContext *C, wmOperator *op) /* when there are F-Modifiers on the curve, only allow adding * keyframes if these will be visible after doing so... */ - if (fcurve_is_keyframable(fcu)) { + if (BKE_fcurve_is_keyframable(fcu)) { ListBase anim_data; ToolSettings *ts = ac.scene->toolsettings; @@ -1336,7 +1337,7 @@ static void decimate_graph_keys(bAnimContext *ac, float remove_ratio, float erro typedef struct tDecimateGraphOp { bAnimContext ac; Scene *scene; - ScrArea *sa; + ScrArea *area; ARegion *region; /** A 0-1 value for determining how much we should decimate. */ @@ -1409,7 +1410,7 @@ static void decimate_exit(bContext *C, wmOperator *op) return; } - ScrArea *sa = dgo->sa; + ScrArea *area = dgo->area; LinkData *link; for (link = dgo->bezt_arr_list.first; link != NULL; link = link->next) { @@ -1423,7 +1424,7 @@ static void decimate_exit(bContext *C, wmOperator *op) /* Return to normal cursor and header status. */ WM_cursor_modal_restore(win); - ED_area_status_text(sa, NULL); + ED_area_status_text(area, NULL); /* cleanup */ op->customdata = NULL; @@ -1450,7 +1451,7 @@ static void decimate_draw_status_header(wmOperator *op, tDecimateGraphOp *dgo) status_str, sizeof(status_str), "%s: %d %%", mode_str, (int)(percentage * 100.0f)); } - ED_area_status_text(dgo->sa, status_str); + ED_area_status_text(dgo->area, status_str); } /* Calculate percentage based on position of mouse (we only use x-axis for now. @@ -1482,7 +1483,7 @@ static int graphkeys_decimate_invoke(bContext *C, wmOperator *op, const wmEvent dgo->percentage_prop = RNA_struct_find_property(op->ptr, "remove_ratio"); dgo->scene = CTX_data_scene(C); - dgo->sa = CTX_wm_area(C); + dgo->area = CTX_wm_area(C); dgo->region = CTX_wm_region(C); /* initialise percentage so that it will have the correct value before the first mouse move. */ @@ -2647,7 +2648,7 @@ static int graphkeys_euler_filter_exec(bContext *C, wmOperator *op) for (f = 0; f < 3; f++) { FCurve *fcu = euf->fcurves[f]; BezTriple *bezt, *prev; - unsigned int i; + uint i; /* skip if not enough vets to do a decent analysis of... */ if (fcu->totvert <= 2) { @@ -3569,7 +3570,7 @@ static int graph_driver_delete_invalid_exec(bContext *C, wmOperator *op) bAnimListElem *ale; int filter; bool ok = false; - unsigned int deleted = 0; + uint deleted = 0; /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) { @@ -3623,10 +3624,10 @@ static int graph_driver_delete_invalid_exec(bContext *C, wmOperator *op) static bool graph_driver_delete_invalid_poll(bContext *C) { bAnimContext ac; - ScrArea *sa = CTX_wm_area(C); + ScrArea *area = CTX_wm_area(C); /* firstly, check if in Graph Editor */ - if ((sa == NULL) || (sa->spacetype != SPACE_GRAPH)) { + if ((area == NULL) || (area->spacetype != SPACE_GRAPH)) { return 0; } |