Fix T81813: Keyframe handles don't follow keyframes

Add a new property `co_ui` to Keyframes, the modification of which will
apply to the keyframe itself as well as its Bézier handles.

Dragging the "Keyframe" slider in the properties panel now maintains the
deltas between the keyframe and its handles, just like moving the key in
the graph editor would.

Reviewed by @sybren in T81813.
This commit is contained in:
2020-11-12 11:53:12 +01:00
committed by Sybren A. Stüvel
parent 9067cd64a5
commit dbbfba9428
2 changed files with 36 additions and 4 deletions

View File

@@ -423,13 +423,14 @@ static void graph_panel_key_properties(const bContext *C, Panel *panel)
but_max_width,
UI_UNIT_Y,
&bezt_ptr,
"co",
"co_ui",
0,
0,
0,
0,
0,
NULL);
UI_but_func_set(but, graphedit_activekey_update_cb, fcu, bezt);
uiItemL_respect_property_split(col, IFACE_("Value"), ICON_NONE);
but = uiDefButR(block,
@@ -441,7 +442,7 @@ static void graph_panel_key_properties(const bContext *C, Panel *panel)
but_max_width,
UI_UNIT_Y,
&bezt_ptr,
"co",
"co_ui",
1,
0,
0,
@@ -450,8 +451,6 @@ static void graph_panel_key_properties(const bContext *C, Panel *panel)
NULL);
UI_but_func_set(but, graphedit_activekey_update_cb, fcu, bezt);
UI_but_unit_type_set(but, unit);
UI_but_func_set(but, graphedit_activekey_update_cb, fcu, bezt);
}
/* previous handle - only if previous was Bezier interpolation */