[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38399] branches/soc-2011-tomato/source/ blender/editors/space_clip/tracking_ops.c: Camera tracking integration

Sergey Sharybin g.ulairi at gmail.com
Thu Jul 14 17:21:59 CEST 2011


Revision: 38399
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38399
Author:   nazgul
Date:     2011-07-14 15:21:59 +0000 (Thu, 14 Jul 2011)
Log Message:
-----------
Camera tracking integration
===========================

"Clear Path" now clears track for all selected markers.

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/editors/space_clip/tracking_ops.c

Modified: branches/soc-2011-tomato/source/blender/editors/space_clip/tracking_ops.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_clip/tracking_ops.c	2011-07-14 15:21:55 UTC (rev 38398)
+++ branches/soc-2011-tomato/source/blender/editors/space_clip/tracking_ops.c	2011-07-14 15:21:59 UTC (rev 38399)
@@ -1110,39 +1110,21 @@
 
 /********************** clear track operator *********************/
 
-static int clear_track_path_poll(bContext *C)
-{
-	SpaceClip *sc= CTX_wm_space_clip(C);
-
-	if(sc) {
-		MovieClip *clip= ED_space_clip(sc);
-
-		if(clip && BKE_movieclip_has_frame(clip, &sc->user)) {
-			int sel_type;
-			void *sel;
-
-			BKE_movieclip_last_selection(clip, &sel_type, &sel);
-
-			return sel_type == MCLIP_SEL_TRACK;
-		}
-	}
-
-	return 0;
-}
-
 static int clear_track_path_exec(bContext *C, wmOperator *op)
 {
 	SpaceClip *sc= CTX_wm_space_clip(C);
 	MovieClip *clip= ED_space_clip(sc);
-	int sel_type, action;
 	MovieTrackingTrack *track;
+	int action= RNA_enum_get(op->ptr, "action");
 
-	action= RNA_enum_get(op->ptr, "action");
+	track= clip->tracking.tracks.first;
+	while(track) {
+		if(TRACK_SELECTED(track))
+			BKE_tracking_clear_path(track, sc->user.framenr, action);
 
-	BKE_movieclip_last_selection(clip, &sel_type, (void**)&track);
+		track= track->next;
+	}
 
-	BKE_tracking_clear_path(track, sc->user.framenr, action);
-
 	WM_event_add_notifier(C, NC_MOVIECLIP|NA_EVALUATED, clip);
 
 	return OPERATOR_FINISHED;
@@ -1164,7 +1146,7 @@
 
 	/* api callbacks */
 	ot->exec= clear_track_path_exec;
-	ot->poll= clear_track_path_poll;
+	ot->poll= space_clip_tracking_poll;
 
 	/* flags */
 	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;




More information about the Bf-blender-cvs mailing list