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:
authorJoshua Leung <aligorith@gmail.com>2013-11-20 15:28:12 +0400
committerJoshua Leung <aligorith@gmail.com>2013-11-20 16:33:02 +0400
commitbe971959bc8db20c69cd0b894978fec8985d0abf (patch)
tree992b1437d1178f41342e791bd46cd0ff86f629bd
parent5efad6f6c616124b4db6210cb3bf527bb7c2a696 (diff)
Added button callback so that toggling solo mode on NLA Tracks now works correctly
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 3848eb3ef6b..a67e69e1665 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -63,6 +63,7 @@
#include "BKE_curve.h"
#include "BKE_key.h"
+#include "BKE_nla.h"
#include "BKE_context.h"
#include "UI_interface.h"
@@ -3363,6 +3364,26 @@ static void achannel_setting_flush_widget_cb(bContext *C, void *ale_npoin, void
BLI_freelistN(&anim_data);
}
+/* callback for wrapping NLA Track "solo" toggle logic */
+static void achannel_nlatrack_solo_widget_cb(bContext *C, void *adt_poin, void *nlt_poin)
+{
+ AnimData *adt = adt_poin;
+ NlaTrack *nlt = nlt_poin;
+
+ /* Toggle 'solo' mode. There are several complications here which need explaining:
+ * - The method call is needed to perform a few additional validation operations
+ * to ensure that the mode is applied properly
+ * - BUT, since the button already toggles the value, we need to un-toggle it
+ * before the API call gets to it, otherwise it will end up clearing the result
+ * again!
+ */
+ nlt->flag ^= NLATRACK_SOLO;
+ BKE_nlatrack_solo_toggle(adt, nlt);
+
+ /* send notifiers */
+ WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_RENAME, NULL);
+}
+
/* callback for rename widgets - clear rename-in-progress */
static void achannel_setting_rename_done_cb(bContext *C, void *ads_poin, void *UNUSED(arg2))
{
@@ -3558,9 +3579,13 @@ static void draw_setting_widget(bAnimContext *ac, bAnimListElem *ale, bAnimChann
uiButSetNFunc(but, achannel_setting_flush_widget_cb, MEM_dupallocN(ale), SET_INT_IN_POINTER(setting));
break;
+ /* settings needing special attention */
+ case ACHANNEL_SETTING_SOLO: /* NLA Tracks - Solo toggle */
+ uiButSetFunc(but, achannel_nlatrack_solo_widget_cb, ale->adt, ale->data);
+ break;
+
/* no flushing */
case ACHANNEL_SETTING_EXPAND: /* expanding - cannot flush, otherwise all would open/close at once */
- case ACHANNEL_SETTING_SOLO: /* NLA Tracks - solo flag */
default:
uiButSetFunc(but, achannel_setting_widget_cb, NULL, NULL);
break;