From e79bb957fc3d59a659d176cdd7f8b7faf5f0963f Mon Sep 17 00:00:00 2001 From: Lukas Stockner Date: Fri, 7 Dec 2018 03:26:20 +0100 Subject: User Interface: Add button color for indicating that the value differs from the interpolated one One issue that especially newer users often run into is that they accidentally reset changes to the scene by switching frame without creating a keyframe first. Therefore, this commit adds a new color that is used to draw properties if their current value differs from the one that would be set when switching to this frame. This works both for existing keyframes as well as for currently interpolated frames. Unfortunately the flags in but->flag are full, so I had to move the new flag to but->drawflag and pass that to all relevant functions. I went with orange for the color since afaics it fits with the green and yellow that are currently used for keyframe states and since it's somewhat reddish to signify that there might be something to look out for here. Reviewers: campbellbarton, #user_interface, brecht Reviewed By: campbellbarton Subscribers: brecht, predoe Differential Revision: https://developer.blender.org/D3949 --- source/blender/editors/interface/interface_anim.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/editors/interface/interface_anim.c') diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c index 4fe555615c2..42615821ee0 100644 --- a/source/blender/editors/interface/interface_anim.c +++ b/source/blender/editors/interface/interface_anim.c @@ -76,6 +76,7 @@ void ui_but_anim_flag(uiBut *but, float cfra) bool special; but->flag &= ~(UI_BUT_ANIMATED | UI_BUT_ANIMATED_KEY | UI_BUT_DRIVEN); + but->drawflag &= ~UI_BUT_ANIMATED_CHANGED; /* NOTE: "special" is reserved for special F-Curves stored on the animation data * itself (which are used to animate properties of the animation data). @@ -96,6 +97,9 @@ void ui_but_anim_flag(uiBut *but, float cfra) if (fcurve_frame_has_keyframe(fcu, cfra, 0)) but->flag |= UI_BUT_ANIMATED_KEY; + + if (fcurve_is_changed(but->rnapoin, but->rnaprop, fcu, cfra)) + but->drawflag |= UI_BUT_ANIMATED_CHANGED; } else { but->flag |= UI_BUT_DRIVEN; -- cgit v1.2.3