[Bf-blender-cvs] [fc38e0a] soc-2016-multiview: daily commit before rebase

Tianwei Shen noreply at git.blender.org
Mon May 30 12:55:05 CEST 2016


Commit: fc38e0a39f1185c9fc907cfd418f3d54c55aca7c
Author: Tianwei Shen
Date:   Mon May 30 18:49:00 2016 +0800
Branches: soc-2016-multiview
https://developer.blender.org/rBfc38e0a39f1185c9fc907cfd418f3d54c55aca7c

daily commit before rebase

===================================================================

M	source/blender/blenkernel/BKE_tracking.h
M	source/blender/blenkernel/CMakeLists.txt
A	source/blender/blenkernel/intern/tracking_correspondence.c
M	source/blender/editors/space_clip/clip_ops.c
M	source/blender/editors/space_clip/space_clip.c
M	source/blender/editors/space_clip/tracking_ops_correspondence.c
M	source/blender/makesdna/DNA_tracking_types.h

===================================================================

diff --git a/source/blender/blenkernel/BKE_tracking.h b/source/blender/blenkernel/BKE_tracking.h
index 2ca8842..4366d00 100644
--- a/source/blender/blenkernel/BKE_tracking.h
+++ b/source/blender/blenkernel/BKE_tracking.h
@@ -287,6 +287,8 @@ void BKE_tracking_stabilization_data_to_mat4(int width, int height, float aspect
 void BKE_tracking_dopesheet_tag_update(struct MovieTracking *tracking);
 void BKE_tracking_dopesheet_update(struct MovieTracking *tracking);
 
+/* Correspondence */
+
 #define TRACK_SELECTED(track)               ((track)->flag & SELECT || (track)->pat_flag & SELECT || (track)->search_flag & SELECT)
 
 #define TRACK_AREA_SELECTED(track, area)    ((area) == TRACK_AREA_POINT ? (track)->flag & SELECT : \
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index afab0cc..abfad01 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -177,6 +177,7 @@ set(SRC
 	intern/texture.c
 	intern/tracking.c
 	intern/tracking_auto.c
+	intern/tracking_correspondence.c
 	intern/tracking_detect.c
 	intern/tracking_plane_tracker.c
 	intern/tracking_region_tracker.c
diff --git a/source/blender/blenkernel/intern/tracking_correspondence.c b/source/blender/blenkernel/intern/tracking_correspondence.c
new file mode 100644
index 0000000..b1c4e3c
--- /dev/null
+++ b/source/blender/blenkernel/intern/tracking_correspondence.c
@@ -0,0 +1,43 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2011 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Blender Foundation,
+ *                 Tianwei Shen
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/blenkernel/intern/tracking_correspondence.c
+ *  \ingroup bke
+ *
+ * This file contains blender-side correspondence functions for witness camera support
+ */
+
+#include "DNA_movieclip_types.h"
+#include "DNA_object_types.h"   /* SELECT */
+
+#include "BLI_utildefines.h"
+
+#include "BKE_tracking.h"
+
+#include "IMB_imbuf_types.h"
+
+#include "libmv-capi.h"
+
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c
index 6cf1f65..17cd9be 100644
--- a/source/blender/editors/space_clip/clip_ops.c
+++ b/source/blender/editors/space_clip/clip_ops.c
@@ -917,7 +917,7 @@ static void change_frame_apply(bContext *C, wmOperator *op)
 	//BKE_sound_seek_scene(CTX_data_main(C), scene);
 	//WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene);
 
-	// Todo(Tianwei): decouple frame for now, find a better way
+	// TODO(Tianwei): decouple frame for now, find a better way
 	SpaceClip *sc = CTX_wm_space_clip(C);
 	BKE_movieclip_user_set_frame(&sc->user, RNA_int_get(op->ptr, "frame"));
 	WM_event_add_notifier(C, NC_MOVIECLIP | ND_DISPLAY, NULL);
diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c
index c49491d..9690382 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -1083,6 +1083,7 @@ static void clip_refresh(const bContext *C, ScrArea *sa)
 		ED_area_tag_redraw(sa);
 	}
 
+	// TODO(tianwei): find a better way to decouple frames
 	//BKE_movieclip_user_set_frame(&sc->user, scene->r.cfra);
 }
 
diff --git a/source/blender/editors/space_clip/tracking_ops_correspondence.c b/source/blender/editors/space_clip/tracking_ops_correspondence.c
index beb58e2..f8f9d14 100644
--- a/source/blender/editors/space_clip/tracking_ops_correspondence.c
+++ b/source/blender/editors/space_clip/tracking_ops_correspondence.c
@@ -107,7 +107,8 @@ static int add_correspondence_exec(bContext *C, wmOperator *op)
 		return OPERATOR_CANCELLED;
 	}
 
-	// link two tracks
+	// link two tracks, mark these two tracks in a different color
+	ed_tracking_delect_all_tracks(tracksbase);
 
 	return OPERATOR_FINISHED;
 }
diff --git a/source/blender/makesdna/DNA_tracking_types.h b/source/blender/makesdna/DNA_tracking_types.h
index 9888b73..c2117b1 100644
--- a/source/blender/makesdna/DNA_tracking_types.h
+++ b/source/blender/makesdna/DNA_tracking_types.h
@@ -48,6 +48,7 @@ struct MovieReconstructedCamera;
 struct MovieTrackingCamera;
 struct MovieTrackingMarker;
 struct MovieTrackingTrack;
+struct MovieTrackingCorrespondence;
 struct MovieTracking;
 
 typedef struct MovieReconstructedCamera {
@@ -161,6 +162,12 @@ typedef struct MovieTrackingTrack {
 	float weight, pad;
 } MovieTrackingTrack;
 
+typedef struct MovieTrackingCorrespondence {
+	//TODO(tianwei): expand the fields, now only two tracks
+	MovieTrackingTrack *primary_track;
+	MovieTrackingTrack *witness_track;
+} MovieTrackingCorrespondence;
+
 typedef struct MovieTrackingPlaneMarker {
 	/* Corners of the plane in the following order:
 	 *




More information about the Bf-blender-cvs mailing list