Ctrl+RMB support for selecting markers when sync markers is enabled.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 8 Mar 2010 11:10:04 +0000 (11:10 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 8 Mar 2010 11:10:04 +0000 (11:10 +0000)
source/blender/blenkernel/intern/scene.c
source/blender/editors/space_action/action_select.c

index 630ddb49c7e9437177bd3692d2d9b583c2ddcf93..ca5efbef053ed48083fdcae0e43a31b44644229c 100644 (file)
@@ -807,7 +807,7 @@ int scene_marker_tfm_extend(Scene *scene, int delta, int flag, int frame, char s
 
        for (marker= scene->markers.first; marker; marker= marker->next) {
                if ((marker->flag & flag) == flag) {
-                       if((side=='L' && marker->frame < frame) || (side=='R' && marker->frame > frame)) {
+                       if((side=='L' && marker->frame < frame) || (side=='R' && marker->frame >= frame)) {
                                marker->frame += delta;
                                tot++;
                        }
index 98caf1a25cbca5debecb2624160ffc502ed2de8f..e8e44fa3ebf61c1052a766b0329cf4e8905ef42e 100644 (file)
@@ -785,6 +785,25 @@ static void actkeys_mselect_leftright (bAnimContext *ac, short leftright, short
                        ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL);
        }
        
+       /* Sync marker support */
+       if((select_mode==SELECT_ADD) && (ac->spacetype==SPACE_ACTION) && ELEM(leftright, ACTKEYS_LRSEL_LEFT, ACTKEYS_LRSEL_RIGHT)) {
+               SpaceAction *saction= ac->sa->spacedata.first;
+               if (saction && saction->flag & SACTION_MARKERS_MOVE) {
+                       TimeMarker *marker;
+
+                       for (marker= scene->markers.first; marker; marker= marker->next) {
+                               if(     ((leftright == ACTKEYS_LRSEL_LEFT) && marker->frame < CFRA) ||
+                                       ((leftright == ACTKEYS_LRSEL_RIGHT) && marker->frame >= CFRA)
+                               ) {
+                                       marker->flag |= SELECT;
+                               }
+                               else {
+                                       marker->flag &= ~SELECT;
+                               }
+                       }
+               }
+       }
+
        /* Cleanup */
        BLI_freelistN(&anim_data);
 }