예제 #1
0
void clip_graph_tracking_iterate(SpaceClip *sc, void *userdata,
			void (*func) (void *userdata, MovieTrackingMarker *marker))
{
	MovieClip *clip= ED_space_clip(sc);
	MovieTracking *tracking= &clip->tracking;
	ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
	MovieTrackingTrack *track;

	track= tracksbase->first;
	while(track) {
		if(TRACK_VIEW_SELECTED(sc, track)) {
			int i;

			for(i= 0; i<track->markersnr; i++) {
				MovieTrackingMarker *marker= &track->markers[i];

				if(marker->flag&MARKER_DISABLED)
					continue;

				if(func)
					func(userdata, marker);
			}
		}

		track= track->next;
	}
}
예제 #2
0
static int delete_curve_exec(bContext *C, wmOperator *UNUSED(op))
{
	SpaceClip *sc= CTX_wm_space_clip(C);
	MovieClip *clip= ED_space_clip(sc);
	MovieTracking *tracking= &clip->tracking;
	ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
	MovieTrackingTrack *act_track= BKE_tracking_active_track(tracking);

	if(act_track)
		clip_delete_track(C, clip, tracksbase, act_track);

	return OPERATOR_FINISHED;
}
예제 #3
0
void clip_graph_tracking_values_iterate(SpaceClip *sc, void *userdata,
			void (*func) (void *userdata, MovieTrackingTrack *track, MovieTrackingMarker *marker, int coord, float val),
			void (*segment_start) (void *userdata, MovieTrackingTrack *track, int coord),
			void (*segment_end) (void *userdata))
{
	MovieClip *clip= ED_space_clip(sc);
	MovieTracking *tracking= &clip->tracking;
	ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
	MovieTrackingTrack *track;

	track= tracksbase->first;
	while(track) {
		if(TRACK_VIEW_SELECTED(sc, track)) {
			clip_graph_tracking_values_iterate_track(sc, track, userdata, func, segment_start, segment_end);
		}

		track= track->next;
	}
}
예제 #4
0
static int delete_knot_exec(bContext *C, wmOperator *UNUSED(op))
{
	SpaceClip *sc= CTX_wm_space_clip(C);
	MovieClip *clip= ED_space_clip(sc);
	MovieTracking *tracking= &clip->tracking;
	ListBase *tracksbase= BKE_tracking_get_tracks(tracking);
	MovieTrackingTrack *act_track= BKE_tracking_active_track(tracking);

	if(act_track) {
		int a= 0;

		while(a<act_track->markersnr) {
			MovieTrackingMarker *marker= &act_track->markers[a];

			if(marker->flag & (MARKER_GRAPH_SEL_X|MARKER_GRAPH_SEL_Y))
				clip_delete_marker(C, clip, tracksbase, act_track, marker);
			else
				a++;
		}
	}

	return OPERATOR_FINISHED;
}