Camera tracking integration
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 21 Jul 2011 16:04:01 +0000 (16:04 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 21 Jul 2011 16:04:01 +0000 (16:04 +0000)
===========================

Fixed own mistake in changed Select All operator.

source/blender/editors/space_clip/tracking_ops.c

index 28abd9ce7c6e890fd338608c0204e51658971f8d..edec7bd3582979ef8df01ffeb37d552fdadb477c 100644 (file)
@@ -668,7 +668,13 @@ static int select_all_exec(bContext *C, wmOperator *op)
                action= SEL_SELECT;
                track= clip->tracking.tracks.first;
                while(track) {
-                       if(TRACK_SELECTED(track)) {
+                       int selected= 0;
+
+                       selected|= track->flag&SELECT;
+                       if(sc->flag&SC_SHOW_MARKER_PATTERN) selected|= track->pat_flag&SELECT;
+                       if(sc->flag&SC_SHOW_MARKER_SEARCH) selected|= track->search_flag&SELECT;
+
+                       if(selected) {
                                action= SEL_DESELECT;
                                break;
                        }
@@ -691,13 +697,15 @@ static int select_all_exec(bContext *C, wmOperator *op)
                                                break;
                                        case SEL_DESELECT:
                                                track->flag&= ~SELECT;
-                                               if(sc->flag&SC_SHOW_MARKER_PATTERN) track->pat_flag&= ~SELECT;
-                                               if(sc->flag&SC_SHOW_MARKER_SEARCH) track->search_flag&= ~SELECT;
+                                               track->pat_flag&= ~SELECT;
+                                               track->search_flag&= ~SELECT;
                                                break;
                                        case SEL_INVERT:
                                                track->flag^= SELECT;
-                                               if(sc->flag&SC_SHOW_MARKER_PATTERN) track->pat_flag^= SELECT;
-                                               if(sc->flag&SC_SHOW_MARKER_SEARCH) track->search_flag^= SELECT;
+                                               if(sc->flag&SC_SHOW_MARKER_PATTERN && (track->pat_flag&SELECT))
+                                                       track->pat_flag^= SELECT;
+                                               if(sc->flag&SC_SHOW_MARKER_SEARCH && (track->search_flag&SELECT))
+                                                       track->search_flag^= SELECT;
                                                break;
                                }
                        }