diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-11-15 19:57:29 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-11-15 20:07:43 +0300 |
commit | 141064d7ae3f2e9277ba272d582c0a72c1500e1c (patch) | |
tree | 505da1e006b6f2082f0857831221911e4e991af0 /source/blender | |
parent | eb515f4dc88ed8a1ad13f3127791cced5fbfe8b3 (diff) |
Fix T42567: Color Wheel Buttons do not autokey correctly.
In fact, any button controlling a whole array of values were broken
because they always only keyed the index of the single fcurve returned
by `ui_but_get_fcurve()`, now pass button's rna_index value instead.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/interface_anim.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c index 43899f906ad..aa23184727a 100644 --- a/source/blender/editors/interface/interface_anim.c +++ b/source/blender/editors/interface/interface_anim.c @@ -219,7 +219,14 @@ void ui_but_anim_autokey(bContext *C, uiBut *but, Scene *scene, float cfra) short flag = ANIM_get_keyframing_flags(scene, 1); fcu->flag &= ~FCURVE_SELECTED; - insert_keyframe(reports, id, action, ((fcu->grp) ? (fcu->grp->name) : (NULL)), fcu->rna_path, fcu->array_index, cfra, flag); + + /* Note: We use but->rnaindex instead of fcu->array_index, + * because a button may control all items of an array at once. + * E.g., color wheels (see T42567). */ + BLI_assert((fcu->array_index == but->rnaindex) || (but->rnaindex == -1)); + insert_keyframe(reports, id, action, ((fcu->grp) ? (fcu->grp->name) : (NULL)), + fcu->rna_path, but->rnaindex, cfra, flag); + WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); } } |