diff options
author | Joshua Leung <aligorith@gmail.com> | 2006-12-05 08:25:34 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2006-12-05 08:25:34 +0300 |
commit | 246ab11255a4f5a3a2f024ef708b6807a5f63317 (patch) | |
tree | ac73976ad240a4cf53af831a8215434c1c8cc219 /source/blender/src/edittime.c | |
parent | 201df23d5474b7257ccf25b5f5b763e94a62d46f (diff) |
Some more action editor goodies:
* Now it is possible to invert the selection status of keyframes and markers.
These options can only be found in the Select menu in the header.
* It is also possible to select the keyframes that occur within the 2
'extreme' selected markers. Hotkey for this is Ctrl K
Diffstat (limited to 'source/blender/src/edittime.c')
-rw-r--r-- | source/blender/src/edittime.c | 63 |
1 files changed, 60 insertions, 3 deletions
diff --git a/source/blender/src/edittime.c b/source/blender/src/edittime.c index ad2d07f590e..d71bc81b143 100644 --- a/source/blender/src/edittime.c +++ b/source/blender/src/edittime.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id: BIF_edittime.c * * ***** BEGIN GPL LICENSE BLOCK ***** * @@ -294,7 +294,10 @@ void deselect_markers(short test, short sel) /* do selection */ for (marker= G.scene->markers.first; marker; marker= marker->next) { - if (sel) { + if (sel == 2) { + marker->flag ^= SELECT; + } + else if (sel == 1) { if ((marker->flag & SELECT)==0) marker->flag |= SELECT; } @@ -307,7 +310,10 @@ void deselect_markers(short test, short sel) else { /* not dependant on existing selection */ for (marker= G.scene->markers.first; marker; marker= marker->next) { - if (sel) { + if (sel==2) { + marker->flag ^= SELECT; + } + else if (sel==1) { if ((marker->flag & SELECT)==0) marker->flag |= SELECT; } @@ -405,6 +411,57 @@ void nextprev_marker(short dir) } } +void get_minmax_markers(short sel, float *first, float *last) +{ + TimeMarker *marker; + ListBase *markers; + float min, max; + int selcount = 0; + + markers= &(G.scene->markers); + + if (sel) + for (marker= markers->first; marker; marker= marker->next) { + if (marker->flag & SELECT) + selcount++; + } + else { + selcount= BLI_countlist(markers); + } + + if (markers->first && markers->last) { + min= ((TimeMarker *)markers->first)->frame; + max= ((TimeMarker *)markers->last)->frame; + } + else { + *first = 0.0f; + *last = 0.0f; + return; + } + + if (selcount > 1) { + for (marker= markers->first; marker; marker= marker->next) { + if (sel) { + if (marker->flag & SELECT) { + if (marker->frame < min) + min= marker->frame; + else if (marker->frame > max) + max= marker->frame; + } + } + else { + if (marker->frame < min) + min= marker->frame; + else if (marker->frame > max) + max= marker->frame; + } + } + } + + *first= min; + *last= max; +} + TimeMarker *find_nearest_marker(int clip_y) { TimeMarker *marker; |