diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-01-14 08:48:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-01-14 09:11:01 +0300 |
commit | 1e0b7903649f69295d1b842d05e015676098ac12 (patch) | |
tree | 81377bcffda338de82bbfbc5ca361df4a0fbd144 /source/blender/editors | |
parent | fffba2b6530e3bc94db3f27a8912ca112d5e7706 (diff) |
Fix T70273: Auto-keyframe ignored by gizmos
Diffstat (limited to 'source/blender/editors')
3 files changed, 26 insertions, 6 deletions
diff --git a/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.c index a56b4f43e8f..f1a8bc62cd3 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.c @@ -408,7 +408,14 @@ static void gizmo_arrow_exit(bContext *C, wmGizmo *gz, const bool cancel) wmGizmoProperty *gz_prop = WM_gizmo_target_property_find(gz, "offset"); const bool is_prop_valid = WM_gizmo_target_property_is_valid(gz_prop); - if (!cancel) { + if (cancel) { + GizmoInteraction *inter = gz->interaction_data; + if (is_prop_valid) { + gizmo_property_value_reset(C, gz, inter, gz_prop); + } + data->offset = inter->init_offset; + } + else { /* Assign in case applying the operation needs an updated offset * edit-mesh bisect needs this. */ if (is_prop_valid) { @@ -418,14 +425,13 @@ static void gizmo_arrow_exit(bContext *C, wmGizmo *gz, const bool cancel) const float value = WM_gizmo_target_property_float_get(gz, gz_prop); data->offset = gizmo_offset_from_value(data, value, constrained, inverted); } - return; } - GizmoInteraction *inter = gz->interaction_data; - if (is_prop_valid) { - gizmo_property_value_reset(C, gz, inter, gz_prop); + if (!cancel) { + if (is_prop_valid) { + WM_gizmo_target_property_anim_autokey(C, gz, gz_prop); + } } - data->offset = inter->init_offset; } /* -------------------------------------------------------------------- */ diff --git a/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c index d3121711e28..25a066ae36b 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c @@ -537,6 +537,13 @@ static void gizmo_dial_exit(bContext *C, wmGizmo *gz, const bool cancel) WM_gizmo_target_property_float_set(C, gz, gz_prop, reset_value); } } + + if (!cancel) { + wmGizmoProperty *gz_prop = WM_gizmo_target_property_find(gz, "offset"); + if (WM_gizmo_target_property_is_valid(gz_prop)) { + WM_gizmo_target_property_anim_autokey(C, gz, gz_prop); + } + } } static void gizmo_dial_setup(wmGizmo *gz) diff --git a/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c index 5342f8695b2..f040e67ae44 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c @@ -335,6 +335,13 @@ static void gizmo_move_exit(bContext *C, wmGizmo *gz, const bool cancel) ED_transform_snap_object_context_destroy(inter->snap_context_v3d); inter->snap_context_v3d = NULL; } + + if (!cancel) { + wmGizmoProperty *gz_prop = WM_gizmo_target_property_find(gz, "offset"); + if (WM_gizmo_target_property_is_valid(gz_prop)) { + WM_gizmo_target_property_anim_autokey(C, gz, gz_prop); + } + } } static int gizmo_move_invoke(bContext *C, wmGizmo *gz, const wmEvent *event) |