[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38346] branches/soc-2011-salad: Merging r38317 through r38343 from soc-2011-tomato into soc-2011-salad

Sergey Sharybin g.ulairi at gmail.com
Tue Jul 12 21:15:54 CEST 2011


Revision: 38346
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38346
Author:   nazgul
Date:     2011-07-12 19:15:53 +0000 (Tue, 12 Jul 2011)
Log Message:
-----------
Merging r38317 through r38343 from soc-2011-tomato into soc-2011-salad

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38317
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38343

Modified Paths:
--------------
    branches/soc-2011-salad/release/scripts/startup/bl_ui/space_clip.py
    branches/soc-2011-salad/source/blender/blenkernel/BKE_movieclip.h
    branches/soc-2011-salad/source/blender/blenkernel/intern/constraint.c
    branches/soc-2011-salad/source/blender/blenkernel/intern/movieclip.c
    branches/soc-2011-salad/source/blender/blenkernel/intern/tracking.c
    branches/soc-2011-salad/source/blender/editors/space_clip/clip_buttons.c
    branches/soc-2011-salad/source/blender/editors/space_clip/clip_draw.c
    branches/soc-2011-salad/source/blender/editors/space_clip/space_clip.c
    branches/soc-2011-salad/source/blender/editors/space_clip/tracking_ops.c
    branches/soc-2011-salad/source/blender/makesdna/DNA_movieclip_types.h
    branches/soc-2011-salad/source/blender/makesdna/DNA_space_types.h
    branches/soc-2011-salad/source/blender/makesrna/intern/rna_movieclip.c
    branches/soc-2011-salad/source/blender/makesrna/intern/rna_space.c
    branches/soc-2011-salad/source/blender/makesrna/intern/rna_tracking.c

Property Changed:
----------------
    branches/soc-2011-salad/


Property changes on: branches/soc-2011-salad
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30783,30792-30793,30797-30798,30815
/branches/soc-2011-carrot:36854,37548,37564,37602,37622,37848,38043,38064,38226,38231,38282
/branches/soc-2011-cucumber:36829-36994
/branches/soc-2011-onion:36833-38309
/branches/soc-2011-pepper:36830-38208
/branches/soc-2011-tomato:36831-38316
/trunk/blender:36834-38341
   + /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30783,30792-30793,30797-30798,30815
/branches/soc-2011-carrot:36854,37548,37564,37602,37622,37848,38043,38064,38226,38231,38282
/branches/soc-2011-cucumber:36829-36994
/branches/soc-2011-onion:36833-38309
/branches/soc-2011-pepper:36830-38208
/branches/soc-2011-tomato:36831-38343
/trunk/blender:36834-38342

Modified: branches/soc-2011-salad/release/scripts/startup/bl_ui/space_clip.py
===================================================================
--- branches/soc-2011-salad/release/scripts/startup/bl_ui/space_clip.py	2011-07-12 19:06:06 UTC (rev 38345)
+++ branches/soc-2011-salad/release/scripts/startup/bl_ui/space_clip.py	2011-07-12 19:15:53 UTC (rev 38346)
@@ -57,6 +57,44 @@
         return {'FINISHED'}
 
 
+class CLIP_OT_bundles_to_mesh(bpy.types.Operator):
+    bl_idname = "clip.bundles_to_mesh"
+    bl_label = "Bundles to Mesh"
+    bl_options = {'UNDO', 'REGISTER'}
+
+    @classmethod
+    def poll(cls, context):
+        if context.space_data.type != 'CLIP_EDITOR':
+            return False
+
+        sc = context.space_data
+        clip = sc.clip
+
+        return clip
+
+    def execute(self, context):
+        sc = context.space_data
+        clip = sc.clip
+
+        mesh = bpy.data.meshes.new(name="Bundles")
+        for track in clip.tracking.tracks:
+            if track.has_bundle:
+                mesh.vertices.add(1)
+                mesh.vertices[-1].co = track.bundle
+
+        ob = bpy.data.objects.new(name="Bundles", object_data=mesh)
+
+        camera = bpy.context.scene.camera
+        if camera:
+            ob.location = camera.location
+            ob.rotation_quaternion = camera.rotation_quaternion
+            ob.rotation_euler = camera.rotation_euler
+
+        bpy.context.scene.objects.link(ob)
+
+        return {'FINISHED'}
+
+
 class CLIP_HT_header(bpy.types.Header):
     bl_space_type = 'CLIP_EDITOR'
 
@@ -89,6 +127,7 @@
     def draw(self, context):
         layout = self.layout
         clip = context.space_data.clip
+        settings = clip.tracking.settings
 
         if clip:
             col = layout.column(align=True)
@@ -131,10 +170,18 @@
 
             col = layout.column(align=True)
             col.label(text="Reconstruction:")
+
+            col.prop(settings, "keyframe1")
+            col.prop(settings, "keyframe2")
+
+            col = layout.column(align=True)
             col.operator("clip.solve_camera")
             col.operator("clip.clear_reconstruction")
 
             col = layout.column(align=True)
+            col.operator("clip.bundles_to_mesh")
+
+            col = layout.column(align=True)
             col.label(text="Scene Orientation:")
             col.operator("clip.set_origin")
         else:
@@ -196,10 +243,6 @@
         row.active = settings.use_frames_limit
         row.prop(settings, "frames_limit")
 
-        layout.label(text="Reconstruction:")
-        col = layout.column(align=True)
-        col.prop(settings, "keyframe1")
-        col.prop(settings, "keyframe2")
 
 
 class CLIP_PT_tracking_camera(bpy.types.Panel):
@@ -222,9 +265,10 @@
 
         layout.prop(clip.tracking.camera, "sensor_width")
 
-        row = layout.row()
-        row.prop(clip.tracking.camera, "focal_length")
-        row.prop(clip.tracking.camera, "units", text="")
+        row = layout.row(align=True)
+        sub = row.split(percentage=0.65)
+        sub.prop(clip.tracking.camera, "focal_length")
+        sub.prop(clip.tracking.camera, "units", text="")
 
         layout.label(text="Principal Point")
         layout.prop(clip.tracking.camera, "principal", text="")
@@ -245,17 +289,19 @@
         layout = self.layout
         sc = context.space_data
 
-        layout.prop(sc, "show_marker_pattern")
-        layout.prop(sc, "show_marker_search")
-        layout.prop(sc, "lock_selection")
-        layout.prop(sc, "show_marker_path")
+        row = layout.row()
+        row.prop(sc, "show_marker_pattern", text="Pattern")
+        row.prop(sc, "show_marker_search", text="Search")
 
         row = layout.row()
-        row.active = sc.show_marker_path
-        row.prop(sc, "path_length")
+        row.prop(sc, "show_track_path", text="Path")
+        row.active = sc.show_track_path
+        row.prop(sc, "path_length", text="Length")
 
-        layout.prop(sc, "show_tiny_markers")
-        layout.prop(sc, "show_bundles")
+        layout.prop(sc, "show_tiny_markers", text="Tiny Markers")
+        layout.prop(sc, "show_bundles", text="Bundles")
+
+        layout.prop(sc, "lock_selection")
         layout.prop(sc, "use_mute_footage")
 
 

Modified: branches/soc-2011-salad/source/blender/blenkernel/BKE_movieclip.h
===================================================================
--- branches/soc-2011-salad/source/blender/blenkernel/BKE_movieclip.h	2011-07-12 19:06:06 UTC (rev 38345)
+++ branches/soc-2011-salad/source/blender/blenkernel/BKE_movieclip.h	2011-07-12 19:15:53 UTC (rev 38346)
@@ -48,7 +48,6 @@
 
 struct ImBuf *BKE_movieclip_acquire_ibuf(struct MovieClip *clip, struct MovieClipUser *user);
 void BKE_movieclip_acquire_size(struct MovieClip *clip, struct MovieClipUser *user, int *width, int *height);
-void BKE_movieclip_approx_size(struct MovieClip *clip, int *width, int *height);
 int BKE_movieclip_has_frame(struct MovieClip *clip, struct MovieClipUser *user);
 void BKE_movieclip_user_set_frame(struct MovieClipUser *user, int framenr);
 

Modified: branches/soc-2011-salad/source/blender/blenkernel/intern/constraint.c
===================================================================
--- branches/soc-2011-salad/source/blender/blenkernel/intern/constraint.c	2011-07-12 19:06:06 UTC (rev 38345)
+++ branches/soc-2011-salad/source/blender/blenkernel/intern/constraint.c	2011-07-12 19:15:53 UTC (rev 38346)
@@ -3941,6 +3941,7 @@
 
 	data->clip= NULL;
 	data->flag|= FOLLOWTRACK_DEFAULTCLIP;
+	data->reference= FOLLOWTRACK_TRACK;
 }
 
 static void followtrack_id_looper (bConstraint *con, ConstraintIDFunc func, void *userdata)

Modified: branches/soc-2011-salad/source/blender/blenkernel/intern/movieclip.c
===================================================================
--- branches/soc-2011-salad/source/blender/blenkernel/intern/movieclip.c	2011-07-12 19:06:06 UTC (rev 38345)
+++ branches/soc-2011-salad/source/blender/blenkernel/intern/movieclip.c	2011-07-12 19:15:53 UTC (rev 38346)
@@ -296,9 +296,13 @@
 			put_imbuf_cache(clip, user, ibuf);
 	}
 
-	if(ibuf)
+	if(ibuf) {
 		clip->lastframe= framenr;
 
+		clip->lastsize[0]= ibuf->x;
+		clip->lastsize[1]= ibuf->y;
+	}
+
 	return ibuf;
 }
 
@@ -316,41 +320,23 @@
 
 void BKE_movieclip_acquire_size(MovieClip *clip, MovieClipUser *user, int *width, int *height)
 {
-	ImBuf *ibuf= BKE_movieclip_acquire_ibuf(clip, user);
-
-	if(ibuf && ibuf->x && ibuf->y) {
-		*width= ibuf->x;
-		*height= ibuf->y;
+	if(!user || user->framenr==clip->lastframe) {
+		*width= clip->lastsize[0];
+		*height= clip->lastsize[1];
 	} else {
-		*width= 0;
-		*height= 0;
-	}
+		ImBuf *ibuf= BKE_movieclip_acquire_ibuf(clip, user);
 
-	if(ibuf)
-		IMB_freeImBuf(ibuf);
-}
+		if(ibuf && ibuf->x && ibuf->y) {
+			*width= ibuf->x;
+			*height= ibuf->y;
+		} else {
+			*width= 0;
+			*height= 0;
+		}
 
-void BKE_movieclip_approx_size(MovieClip *clip, int *width, int *height)
-{
-	ImBuf *ibuf= BKE_movieclip_acquire_ibuf(clip, NULL);
-
-	if(!ibuf) {
-		MovieClipUser user;
-		user.framenr= 0;
-
-		ibuf= BKE_movieclip_acquire_ibuf(clip, &user);
+		if(ibuf)
+			IMB_freeImBuf(ibuf);
 	}
-
-	if(ibuf && ibuf->x && ibuf->y) {
-		*width= ibuf->x;
-		*height= ibuf->y;
-	} else {
-		*width= 0;
-		*height= 0;
-	}
-
-	if(ibuf)
-		IMB_freeImBuf(ibuf);
 }
 
 /* get segments of cached frames. useful for debugging cache policies */

Modified: branches/soc-2011-salad/source/blender/blenkernel/intern/tracking.c
===================================================================
--- branches/soc-2011-salad/source/blender/blenkernel/intern/tracking.c	2011-07-12 19:06:06 UTC (rev 38345)
+++ branches/soc-2011-salad/source/blender/blenkernel/intern/tracking.c	2011-07-12 19:15:53 UTC (rev 38346)
@@ -377,7 +377,7 @@
 	MovieTrackingTrack *track;
 
 #ifdef WITH_LIBMV
-	context->region_tracker= libmv_regionTrackerNew(100, 7, 0.2);
+	context->region_tracker= libmv_regionTrackerNew(100, 4, 0.2);
 #endif
 
 	context->settings= *settings;

Modified: branches/soc-2011-salad/source/blender/editors/space_clip/clip_buttons.c
===================================================================
--- branches/soc-2011-salad/source/blender/editors/space_clip/clip_buttons.c	2011-07-12 19:06:06 UTC (rev 38345)
+++ branches/soc-2011-salad/source/blender/editors/space_clip/clip_buttons.c	2011-07-12 19:15:53 UTC (rev 38346)
@@ -122,13 +122,13 @@
 	block= uiLayoutAbsoluteBlock(col);
 	uiBlockBeginAlign(block);
 
-	uiDefBut(block, LABEL, 0, "Position:", 0, 171, 145, 19, NULL, 0, 0, 0, 0, "");
+	uiDefBut(block, LABEL, 0, "Position:", 0, 171, 300, 19, NULL, 0, 0, 0, 0, "");
 	uiDefButF(block, NUM, B_MARKER_POS, "X:", 10, 152, 145, 19, &sc->marker_pos[0],
 		-10*width, 10.0*width, step, digits, "X-position of marker at frame in screen coordinates.");
 	uiDefButF(block, NUM, B_MARKER_POS, "Y:", 165, 152, 145, 19, &sc->marker_pos[1],
 		-10*height, 10.0*height, step, digits, "Y-position of marker at frame in screen coordinates.");
 
-	uiDefBut(block, LABEL, 0, "Pattern Area:", 0, 133, 145, 19, NULL, 0, 0, 0, 0, "");
+	uiDefBut(block, LABEL, 0, "Pattern Area:", 0, 133, 300, 19, NULL, 0, 0, 0, 0, "");
 	uiDefButF(block, NUM, B_MARKER_PAT_POS, "X:", 10, 114, 145, 19, &sc->track_pat_pos[0],
 		-width, width, step, digits, "X-position of pattern at frame in screen coordinates relative to marker's position.");
 	uiDefButF(block, NUM, B_MARKER_PAT_POS, "Y:", 165, 114, 145, 19, &sc->track_pat_pos[1],
@@ -138,7 +138,7 @@
 	uiDefButF(block, NUM, B_MARKER_PAT_DIM, "Height:", 10, 76, 300, 19, &sc->track_pat[1], 3.0f,

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list