diff options
author | Joshua Leung <aligorith@gmail.com> | 2015-07-24 05:15:28 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2015-07-24 05:20:16 +0300 |
commit | 20d516dc35dadfe549b6cacc21611deca5ad9161 (patch) | |
tree | 3bf3aa2b27c5a40e33fe5d1f7f5022655cc76729 /source/blender/editors/interface/interface_anim.c | |
parent | 15cb94c65a071b1436a414fadb491662ad2886c1 (diff) |
Fix: Autokeying of buttons doesn't work on NLA Strip properties
Diffstat (limited to 'source/blender/editors/interface/interface_anim.c')
-rw-r--r-- | source/blender/editors/interface/interface_anim.c | 21 |
1 files 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 */ |