From 20d516dc35dadfe549b6cacc21611deca5ad9161 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 24 Jul 2015 14:15:28 +1200 Subject: Fix: Autokeying of buttons doesn't work on NLA Strip properties --- source/blender/editors/interface/interface_anim.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c index f6757b35462..37895a711fd 100644 --- a/source/blender/editors/interface/interface_anim.c +++ b/source/blender/editors/interface/interface_anim.c @@ -223,8 +223,25 @@ void ui_but_anim_autokey(bContext *C, uiBut *but, Scene *scene, float cfra) bool special; fcu = ui_but_get_fcurve(but, NULL, &action, &driven, &special); - - if (fcu && !driven) { + + if (fcu == NULL) + return; + + if (special) { + /* NLA Strip property */ + if (IS_AUTOKEY_ON(scene)) { + ReportList *reports = CTX_wm_reports(C); + PointerRNA ptr = {{NULL}}; + PropertyRNA *prop = NULL; + int index; + + UI_context_active_but_prop_get(C, &ptr, &prop, &index); + + insert_keyframe_direct(reports, ptr, prop, fcu, cfra, 0); + WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); + } + } + else if (!driven) { id = but->rnapoin.id.data; /* TODO: this should probably respect the keyingset only option for anim */ -- cgit v1.2.3