diff --git a/scripts/presets/keyconfig/keymap_data/blender_default.py b/scripts/presets/keyconfig/keymap_data/blender_default.py index f43c27d3a2f..171b098d921 100644 --- a/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -1894,7 +1894,7 @@ def km_graph_editor(params): ("graph.easing_type", {"type": 'E', "value": 'PRESS', "ctrl": True}, None), ("graph.smooth", {"type": 'O', "value": 'PRESS', "alt": True}, None), ("graph.sample", {"type": 'O', "value": 'PRESS', "shift": True, "alt": True}, None), - ("graph.bake", {"type": 'C', "value": 'PRESS', "alt": True}, None), + ("graph.keys_to_samples", {"type": 'C', "value": 'PRESS', "alt": True}, None), op_menu("GRAPH_MT_delete", {"type": 'X', "value": 'PRESS'}), ("graph.delete", {"type": 'DEL', "value": 'PRESS'}, {"properties": [("confirm", False)]}), ("graph.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True}, None), diff --git a/scripts/startup/bl_ui/space_graph.py b/scripts/startup/bl_ui/space_graph.py index 373dcbacb86..721aad93a70 100644 --- a/scripts/startup/bl_ui/space_graph.py +++ b/scripts/startup/bl_ui/space_graph.py @@ -283,8 +283,8 @@ class GRAPH_MT_channel(Menu): layout.operator("anim.channels_fcurves_enable") layout.separator() - layout.operator("graph.bake") - layout.operator("graph.unbake") + layout.operator("graph.keys_to_samples") + layout.operator("graph.samples_to_keys") layout.operator("graph.sound_bake") layout.separator() diff --git a/source/blender/editors/space_graph/graph_edit.cc b/source/blender/editors/space_graph/graph_edit.cc index c7ba391b9c3..cecd61151e6 100644 --- a/source/blender/editors/space_graph/graph_edit.cc +++ b/source/blender/editors/space_graph/graph_edit.cc @@ -894,13 +894,13 @@ void GRAPH_OT_clean(wmOperatorType *ot) /** \} */ /* -------------------------------------------------------------------- */ -/** \name Bake F-Curve Operator +/** \name Keys to Samples Operator * * This operator bakes the data of the selected F-Curves to F-Points. * \{ */ /* Bake each F-Curve into a set of samples. */ -static void bake_graph_curves(bAnimContext *ac, int start, int end) +static void convert_keys_to_samples(bAnimContext *ac, int start, int end) { ListBase anim_data = {nullptr, nullptr}; int filter; @@ -934,7 +934,7 @@ static void bake_graph_curves(bAnimContext *ac, int start, int end) /* ------------------- */ -static int graphkeys_bake_exec(bContext *C, wmOperator * /*op*/) +static int graphkeys_keys_to_samples_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; Scene *scene = nullptr; @@ -951,8 +951,8 @@ static int graphkeys_bake_exec(bContext *C, wmOperator * /*op*/) start = PSFRA; end = PEFRA; - /* Bake keyframes. */ - bake_graph_curves(&ac, start, end); + /* Sample keyframes. */ + convert_keys_to_samples(&ac, start, end); /* Set notifier that keyframes have changed. */ /* NOTE: some distinction between order/number of keyframes and type should be made? */ @@ -961,16 +961,17 @@ static int graphkeys_bake_exec(bContext *C, wmOperator * /*op*/) return OPERATOR_FINISHED; } -void GRAPH_OT_bake(wmOperatorType *ot) +void GRAPH_OT_keys_to_samples(wmOperatorType *ot) { /* Identifiers */ - ot->name = "Bake Curve"; - ot->idname = "GRAPH_OT_bake"; - ot->description = "Bake selected F-Curves to a set of sampled points defining a similar curve"; + ot->name = "Keys to Samples"; + ot->idname = "GRAPH_OT_keys_to_samples"; + ot->description = + "Convert selected channels to an uneditable set of samples to save storage space"; /* API callbacks */ ot->invoke = WM_operator_confirm_or_exec; - ot->exec = graphkeys_bake_exec; + ot->exec = graphkeys_keys_to_samples_exec; ot->poll = graphop_selected_fcurve_poll; /* Flags */ @@ -983,13 +984,13 @@ void GRAPH_OT_bake(wmOperatorType *ot) /** \} */ /* -------------------------------------------------------------------- */ -/** \name Un-Bake F-Curve Operator +/** \name Samples to Keys Operator * - * This operator un-bakes the data of the selected F-Points to F-Curves. + * This operator converts the data of the selected F-Points to F-Curves. * \{ */ -/* Un-Bake F-Points into F-Curves. */ -static void unbake_graph_curves(bAnimContext *ac, int start, int end) +/* Convert F-Points into F-Curves. */ +static void convert_samples_to_keys(bAnimContext *ac, int start, int end) { ListBase anim_data = {nullptr, nullptr}; @@ -1014,7 +1015,7 @@ static void unbake_graph_curves(bAnimContext *ac, int start, int end) /* ------------------- */ -static int graphkeys_unbake_exec(bContext *C, wmOperator * /*op*/) +static int graphkeys_samples_to_keys_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; Scene *scene = nullptr; @@ -1029,8 +1030,7 @@ static int graphkeys_unbake_exec(bContext *C, wmOperator * /*op*/) start = PSFRA; end = PEFRA; - /* Unbake keyframes. */ - unbake_graph_curves(&ac, start, end); + convert_samples_to_keys(&ac, start, end); /* Set notifier that keyframes have changed. */ /* NOTE: some distinction between order/number of keyframes and type should be made? */ @@ -1039,15 +1039,15 @@ static int graphkeys_unbake_exec(bContext *C, wmOperator * /*op*/) return OPERATOR_FINISHED; } -void GRAPH_OT_unbake(wmOperatorType *ot) +void GRAPH_OT_samples_to_keys(wmOperatorType *ot) { /* Identifiers */ - ot->name = "Un-Bake Curve"; - ot->idname = "GRAPH_OT_unbake"; - ot->description = "Un-Bake selected F-Points to F-Curves"; + ot->name = "Samples to Keys"; + ot->idname = "GRAPH_OT_samples_to_keys"; + ot->description = "Convert selected channels from samples to keyframes"; /* API callbacks */ - ot->exec = graphkeys_unbake_exec; + ot->exec = graphkeys_samples_to_keys_exec; ot->poll = graphop_selected_fcurve_poll; /* Flags */ @@ -1059,9 +1059,9 @@ void GRAPH_OT_unbake(wmOperatorType *ot) /** \} */ /* -------------------------------------------------------------------- */ -/** \name Sound Bake F-Curve Operator +/** \name Sound to Samples Operator * - * This operator bakes the given sound to the selected F-Curves. + * This operator converts the given sound to samples on the selected F-Curves. * \{ */ /* ------------------- */ @@ -1094,7 +1094,7 @@ static float fcurve_samplingcb_sound(FCurve * /*fcu*/, void *data, float evaltim /* ------------------- */ -static int graphkeys_sound_bake_exec(bContext *C, wmOperator *op) +static int graphkeys_sound_to_samples_exec(bContext *C, wmOperator *op) { bAnimContext ac; ListBase anim_data = {nullptr, nullptr}; @@ -1175,7 +1175,7 @@ static int graphkeys_sound_bake_exec(bContext *C, wmOperator *op) #else /* WITH_AUDASPACE */ -static int graphkeys_sound_bake_exec(bContext * /*C*/, wmOperator *op) +static int graphkeys_sound_to_samples_exec(bContext * /*C*/, wmOperator *op) { BKE_report(op->reports, RPT_ERROR, "Compiled without sound support"); @@ -1184,7 +1184,7 @@ static int graphkeys_sound_bake_exec(bContext * /*C*/, wmOperator *op) #endif /* WITH_AUDASPACE */ -static int graphkeys_sound_bake_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static int graphkeys_sound_to_samples_invoke(bContext *C, wmOperator *op, const wmEvent *event) { bAnimContext ac; @@ -1196,16 +1196,16 @@ static int graphkeys_sound_bake_invoke(bContext *C, wmOperator *op, const wmEven return WM_operator_filesel(C, op, event); } -void GRAPH_OT_sound_bake(wmOperatorType *ot) +void GRAPH_OT_sound_to_samples(wmOperatorType *ot) { /* Identifiers */ - ot->name = "Bake Sound to F-Curves"; - ot->idname = "GRAPH_OT_sound_bake"; - ot->description = "Bakes a sound wave to selected F-Curves"; + ot->name = "Sound to Samples"; + ot->idname = "GRAPH_OT_sound_to_samples"; + ot->description = "Bakes a sound wave to samples on selected channels"; /* API callbacks */ - ot->invoke = graphkeys_sound_bake_invoke; - ot->exec = graphkeys_sound_bake_exec; + ot->invoke = graphkeys_sound_to_samples_invoke; + ot->exec = graphkeys_sound_to_samples_exec; ot->poll = graphop_selected_fcurve_poll; /* Flags */ diff --git a/source/blender/editors/space_graph/graph_intern.h b/source/blender/editors/space_graph/graph_intern.h index 6b3956d37de..f8815c43f23 100644 --- a/source/blender/editors/space_graph/graph_intern.h +++ b/source/blender/editors/space_graph/graph_intern.h @@ -128,9 +128,9 @@ void GRAPH_OT_blend_to_default(struct wmOperatorType *ot); void GRAPH_OT_butterworth_smooth(struct wmOperatorType *ot); void GRAPH_OT_gaussian_smooth(struct wmOperatorType *ot); void GRAPH_OT_sample(struct wmOperatorType *ot); -void GRAPH_OT_bake(struct wmOperatorType *ot); -void GRAPH_OT_unbake(struct wmOperatorType *ot); -void GRAPH_OT_sound_bake(struct wmOperatorType *ot); +void GRAPH_OT_keys_to_samples(struct wmOperatorType *ot); +void GRAPH_OT_samples_to_keys(struct wmOperatorType *ot); +void GRAPH_OT_sound_to_samples(struct wmOperatorType *ot); void GRAPH_OT_smooth(struct wmOperatorType *ot); void GRAPH_OT_euler_filter(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_graph/graph_ops.cc b/source/blender/editors/space_graph/graph_ops.cc index c192cd30156..13b4c666926 100644 --- a/source/blender/editors/space_graph/graph_ops.cc +++ b/source/blender/editors/space_graph/graph_ops.cc @@ -460,9 +460,9 @@ void graphedit_operatortypes() WM_operatortype_append(GRAPH_OT_extrapolation_type); WM_operatortype_append(GRAPH_OT_easing_type); WM_operatortype_append(GRAPH_OT_sample); - WM_operatortype_append(GRAPH_OT_bake); - WM_operatortype_append(GRAPH_OT_unbake); - WM_operatortype_append(GRAPH_OT_sound_bake); + WM_operatortype_append(GRAPH_OT_keys_to_samples); + WM_operatortype_append(GRAPH_OT_samples_to_keys); + WM_operatortype_append(GRAPH_OT_sound_to_samples); WM_operatortype_append(GRAPH_OT_smooth); WM_operatortype_append(GRAPH_OT_clean); WM_operatortype_append(GRAPH_OT_decimate);