From 986bbbfe8ab61daf0bd22e8891b559238dba0806 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 28 Mar 2013 20:34:12 +0000 Subject: don't save select extend state for marker selection. --- source/blender/editors/animation/anim_markers.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/animation') diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 205f67cf96a..deb018ac74a 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -1121,6 +1121,8 @@ static int ed_marker_select_invoke_wrapper(bContext *C, wmOperator *op, const wm static void MARKER_OT_select(wmOperatorType *ot) { + PropertyRNA *prop; + /* identifiers */ ot->name = "Select Time Marker"; ot->description = "Select time marker(s)"; @@ -1133,9 +1135,11 @@ static void MARKER_OT_select(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend the selection"); + prop = RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend the selection"); + RNA_def_property_flag(prop, PROP_SKIP_SAVE); #ifdef DURIAN_CAMERA_SWITCH - RNA_def_boolean(ot->srna, "camera", 0, "Camera", "Select the camera"); + prop = RNA_def_boolean(ot->srna, "camera", 0, "Camera", "Select the camera"); + RNA_def_property_flag(prop, PROP_SKIP_SAVE); #endif } -- cgit v1.2.3 From 93deb27dd4b4e12f118cd74ca5c70a485c19e81b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 28 Mar 2013 20:58:14 +0000 Subject: fix [#34804] Only timeline_markers[0] is selectable if multiple markers at same frame also add macros for looping on listbases as if they were circular lists which is handy for cycling over items. --- source/blender/editors/animation/anim_markers.c | 39 ++++++++++++++++--------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'source/blender/editors/animation') diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index deb018ac74a..b4bbb14245d 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -1017,24 +1017,35 @@ static void MARKER_OT_duplicate(wmOperatorType *ot) /* ************************** selection ************************************/ /* select/deselect TimeMarker at current frame */ -static void select_timeline_marker_frame(ListBase *markers, int frame, unsigned char shift) +static void select_timeline_marker_frame(ListBase *markers, int frame, bool extend) { - TimeMarker *marker; - int select = 0; - + TimeMarker *marker, *marker_first = NULL; + + /* support for selection cycling */ for (marker = markers->first; marker; marker = marker->next) { - /* if Shift is not set, then deselect Markers */ - if (!shift) marker->flag &= ~SELECT; - - /* this way a not-shift select will allways give 1 selected marker */ - if ((marker->frame == frame) && (!select)) { - if (marker->flag & SELECT) - marker->flag &= ~SELECT; - else - marker->flag |= SELECT; - select = 1; + if (marker->frame == frame) { + if (marker->flag & SELECT) { + marker_first = marker->next; + break; + } + } + } + + /* if extend is not set, then deselect markers */ + if (extend == false) { + for (marker = markers->first; marker; marker = marker->next) { + marker->flag &= ~SELECT; + } + } + + LISTBASE_CIRCULAR_FORWARD_BEGIN (markers, marker, marker_first) { + /* this way a not-extend select will allways give 1 selected marker */ + if (marker->frame == frame) { + marker->flag ^= SELECT; + break; } } + LISTBASE_CIRCULAR_FORWARD_END (markers, marker, marker_first); } static int ed_marker_select(bContext *C, const wmEvent *event, bool extend, bool camera) -- cgit v1.2.3 From e8d532f1dde96c40c1407d39260724fcfee0b606 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 31 Mar 2013 03:28:46 +0000 Subject: style cleanup --- source/blender/editors/animation/anim_channels_defines.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/animation') diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 20ffbd8eac0..3fa1d580fc5 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -3289,13 +3289,13 @@ static void draw_setting_widget(bAnimContext *ac, bAnimListElem *ale, bAnimChann break; case ACHANNEL_SETTING_EXPAND: /* expanded triangle */ - //icon = ((enabled)? ICON_TRIA_DOWN : ICON_TRIA_RIGHT); + //icon = ((enabled) ? ICON_TRIA_DOWN : ICON_TRIA_RIGHT); icon = ICON_TRIA_RIGHT; tooltip = TIP_("Make channels grouped under this channel visible"); break; case ACHANNEL_SETTING_SOLO: /* NLA Tracks only */ - //icon = ((enabled)? ICON_LAYER_ACTIVE : ICON_LAYER_USED); + //icon = ((enabled) ? ICON_LAYER_ACTIVE : ICON_LAYER_USED); icon = ICON_LAYER_USED; tooltip = TIP_("NLA Track is the only one evaluated for the AnimData block it belongs to"); break; @@ -3304,13 +3304,13 @@ static void draw_setting_widget(bAnimContext *ac, bAnimListElem *ale, bAnimChann case ACHANNEL_SETTING_PROTECT: /* protected lock */ // TODO: what about when there's no protect needed? - //icon = ((enabled)? ICON_LOCKED : ICON_UNLOCKED); + //icon = ((enabled) ? ICON_LOCKED : ICON_UNLOCKED); icon = ICON_UNLOCKED; tooltip = TIP_("Editability of keyframes for this channel"); break; case ACHANNEL_SETTING_MUTE: /* muted speaker */ - //icon = ((enabled)? ICON_MUTE_IPO_ON : ICON_MUTE_IPO_OFF); + //icon = ((enabled) ? ICON_MUTE_IPO_ON : ICON_MUTE_IPO_OFF); icon = ICON_MUTE_IPO_OFF; if (ale->type == ALE_FCURVE) -- cgit v1.2.3