Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-01-14 08:48:01 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-01-14 09:11:01 +0300
commit1e0b7903649f69295d1b842d05e015676098ac12 (patch)
tree81377bcffda338de82bbfbc5ca361df4a0fbd144 /source/blender/windowmanager/gizmo
parentfffba2b6530e3bc94db3f27a8912ca112d5e7706 (diff)
Fix T70273: Auto-keyframe ignored by gizmos
Diffstat (limited to 'source/blender/windowmanager/gizmo')
-rw-r--r--source/blender/windowmanager/gizmo/WM_gizmo_api.h4
-rw-r--r--source/blender/windowmanager/gizmo/intern/wm_gizmo_target_props.c16
2 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/windowmanager/gizmo/WM_gizmo_api.h b/source/blender/windowmanager/gizmo/WM_gizmo_api.h
index e66243009f1..7b07546f668 100644
--- a/source/blender/windowmanager/gizmo/WM_gizmo_api.h
+++ b/source/blender/windowmanager/gizmo/WM_gizmo_api.h
@@ -236,6 +236,10 @@ void WM_gizmo_target_property_subscribe_all(struct wmGizmo *gz,
struct wmMsgBus *mbus,
struct ARegion *ar);
+void WM_gizmo_target_property_anim_autokey(struct bContext *C,
+ const struct wmGizmo *gz,
+ struct wmGizmoProperty *gz_prop);
+
/* -------------------------------------------------------------------- */
/* wmGizmoGroup */
diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_target_props.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_target_props.c
index 094fdf3f514..8acdf2de86f 100644
--- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_target_props.c
+++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_target_props.c
@@ -33,6 +33,7 @@
#include "wm.h"
+#include "ED_keyframing.h"
#include "ED_screen.h"
#include "ED_view3d.h"
@@ -357,4 +358,19 @@ void WM_gizmo_target_property_subscribe_all(wmGizmo *gz, struct wmMsgBus *mbus,
}
}
+/**
+ * Auto-key function if auto-key is enabled.
+ */
+void WM_gizmo_target_property_anim_autokey(bContext *C,
+ const wmGizmo *UNUSED(gz),
+ wmGizmoProperty *gz_prop)
+{
+ if (gz_prop->prop != NULL) {
+ Scene *scene = CTX_data_scene(C);
+ const float cfra = (float)CFRA;
+ const int index = gz_prop->index == -1 ? 0 : gz_prop->index;
+ ED_autokeyframe_property(C, scene, &gz_prop->ptr, gz_prop->prop, index, cfra);
+ }
+}
+
/** \} */