[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47740] branches/soc-2011-tomato: Merging r47727 through r47739 from trunk into soc-2011-tomato

Sergey Sharybin sergey.vfx at gmail.com
Mon Jun 11 13:43:07 CEST 2012


Revision: 47740
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47740
Author:   nazgul
Date:     2012-06-11 11:43:06 +0000 (Mon, 11 Jun 2012)
Log Message:
-----------
Merging r47727 through r47739 from trunk into soc-2011-tomato

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

Modified Paths:
--------------
    branches/soc-2011-tomato/doc/python_api/sphinx_doc_gen.py
    branches/soc-2011-tomato/extern/libmv/libmv-capi.cpp
    branches/soc-2011-tomato/extern/libmv/libmv-capi.h
    branches/soc-2011-tomato/source/blender/blenkernel/BKE_tracking.h
    branches/soc-2011-tomato/source/blender/blenkernel/intern/armature.c
    branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c
    branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_marking.c
    branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_operators.c
    branches/soc-2011-tomato/source/blender/editors/animation/keyframes_general.c
    branches/soc-2011-tomato/source/blender/editors/gpencil/gpencil_buttons.c
    branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_loopcut.c
    branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_select.c
    branches/soc-2011-tomato/source/blender/editors/space_node/space_node.c
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_color.c
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_pose.c
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_tracking.c
    branches/soc-2011-tomato/source/blender/modifiers/intern/MOD_array.c

Added Paths:
-----------
    branches/soc-2011-tomato/release/scripts/templates/operator_node.py

Property Changed:
----------------
    branches/soc-2011-tomato/
    branches/soc-2011-tomato/source/blender/editors/interface/interface.c
    branches/soc-2011-tomato/source/blender/editors/space_outliner/


Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-47726
   + /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-47739

Modified: branches/soc-2011-tomato/doc/python_api/sphinx_doc_gen.py
===================================================================
--- branches/soc-2011-tomato/doc/python_api/sphinx_doc_gen.py	2012-06-11 11:40:54 UTC (rev 47739)
+++ branches/soc-2011-tomato/doc/python_api/sphinx_doc_gen.py	2012-06-11 11:43:06 UTC (rev 47740)
@@ -934,6 +934,8 @@
         "image_context_dir",
         "node_context_dir",
         "text_context_dir",
+        "clip_context_dir",
+        "sequencer_context_dir",
     )
 
     # Changes in blender will force errors here
@@ -943,6 +945,7 @@
         "active_object": ("Object", False),
         "active_operator": ("Operator", False),
         "active_pose_bone": ("PoseBone", False),
+        "active_node": ("Node", False),
         "armature": ("Armature", False),
         "bone": ("Bone", False),
         "brush": ("Brush", False),
@@ -953,6 +956,8 @@
         "dynamic_paint": ("DynamicPaintModifier", False),
         "edit_bone": ("EditBone", False),
         "edit_image": ("Image", False),
+        "edit_mask": ("Mask", False),
+        "edit_movieclip": ("MovieClip", False),
         "edit_object": ("Object", False),
         "edit_text": ("Text", False),
         "editable_bones": ("EditBone", True),

Modified: branches/soc-2011-tomato/extern/libmv/libmv-capi.cpp
===================================================================
--- branches/soc-2011-tomato/extern/libmv/libmv-capi.cpp	2012-06-11 11:40:54 UTC (rev 47739)
+++ branches/soc-2011-tomato/extern/libmv/libmv-capi.cpp	2012-06-11 11:43:06 UTC (rev 47740)
@@ -357,8 +357,8 @@
 
 /* TrackRegion (new planar tracker) */
 int libmv_trackRegion(const struct libmv_trackRegionOptions *options,
-                      const float *image1, const float *image2,
-                      int width, int height, 
+                      const float *image1, int image1_width, int image1_height,
+                      const float *image2, int image2_width, int image2_height,
                       const double *x1, const double *y1,
                       struct libmv_trackRegionResult *result,
                       double *x2, double *y2)
@@ -400,8 +400,8 @@
 
 	/* Convert from raw float buffers to libmv's FloatImage. */
 	libmv::FloatImage old_patch, new_patch;
-	floatBufToImage(image1, width, height, 1, &old_patch);
-	floatBufToImage(image2, width, height, 1, &new_patch);
+	floatBufToImage(image1, image1_width, image1_height, 1, &old_patch);
+	floatBufToImage(image2, image2_width, image2_height, 1, &new_patch);
 
 	libmv::TrackRegionResult track_region_result;
 	libmv::TrackRegion(old_patch, new_patch, xx1, yy1, track_region_options, xx2, yy2, &track_region_result);

Modified: branches/soc-2011-tomato/extern/libmv/libmv-capi.h
===================================================================
--- branches/soc-2011-tomato/extern/libmv/libmv-capi.h	2012-06-11 11:40:54 UTC (rev 47739)
+++ branches/soc-2011-tomato/extern/libmv/libmv-capi.h	2012-06-11 11:43:06 UTC (rev 47740)
@@ -65,8 +65,8 @@
   double correlation;
 };
 int libmv_trackRegion(const struct libmv_trackRegionOptions *options,
-                      const float *image1, const float *image2,
-                      int width, int height, 
+                      const float *image1, int image1_width, int image1_height,
+                      const float *image2, int image2_width, int image2_height,
                       const double *x1, const double *y1,
                       struct libmv_trackRegionResult *result,
                       double *x2, double *y2);

Copied: branches/soc-2011-tomato/release/scripts/templates/operator_node.py (from rev 47739, trunk/blender/release/scripts/templates/operator_node.py)
===================================================================
--- branches/soc-2011-tomato/release/scripts/templates/operator_node.py	                        (rev 0)
+++ branches/soc-2011-tomato/release/scripts/templates/operator_node.py	2012-06-11 11:43:06 UTC (rev 47740)
@@ -0,0 +1,58 @@
+import bpy
+
+def main(operator, context):
+    space = context.space_data
+    node_tree = space.node_tree
+    node_active = context.active_node
+    node_selected = context.selected_nodes
+
+    # now we have the context, perform a simple operation
+    if node_active in node_selected:
+        node_selected.remove(node_active)
+    if len(node_selected) != 1:
+        operator.report({'ERROR'}, "2 nodes must be selected")
+        return
+
+    node_other, = node_selected
+    
+    # now we have 2 nodes to operate on
+    if not node_active.inputs:
+        operator.report({'ERROR'}, "Active node has no inputs")
+        return
+
+    if not node_other.outputs:
+        operator.report({'ERROR'}, "Selected node has no outputs")
+        return
+
+    socket_in = node_active.inputs[0]
+    socket_out = node_other.outputs[0]
+
+    # add a link between the two nodes
+    node_link = node_tree.links.new(socket_in, socket_out)
+
+
+class NodeOperator(bpy.types.Operator):
+    '''Tooltip'''
+    bl_idname = "node.simple_operator"
+    bl_label = "Simple Node Operator"
+
+    @classmethod
+    def poll(cls, context):
+        space = context.space_data
+        return space.type == 'NODE_EDITOR'
+
+    def execute(self, context):
+        main(context)
+        return {'FINISHED'}
+
+
+def register():
+    bpy.utils.register_class(NodeOperator)
+
+
+def unregister():
+    bpy.utils.unregister_class(NodeOperator)
+
+
+if __name__ == "__main__":
+    register()

Modified: branches/soc-2011-tomato/source/blender/blenkernel/BKE_tracking.h
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/BKE_tracking.h	2012-06-11 11:40:54 UTC (rev 47739)
+++ branches/soc-2011-tomato/source/blender/blenkernel/BKE_tracking.h	2012-06-11 11:43:06 UTC (rev 47740)
@@ -57,7 +57,7 @@
                                                        struct MovieTrackingMarker *marker);
 void BKE_tracking_delete_marker(struct MovieTrackingTrack *track, int framenr);
 
-void BKE_tracking_marker_pattern_minmax(struct MovieTrackingMarker *marker, float min[2], float max[2]);
+void BKE_tracking_marker_pattern_minmax(const struct MovieTrackingMarker *marker, float min[2], float max[2]);
 struct MovieTrackingMarker *BKE_tracking_get_marker(struct MovieTrackingTrack *track, int framenr);
 struct MovieTrackingMarker *BKE_tracking_ensure_marker(struct MovieTrackingTrack *track, int framenr);
 struct MovieTrackingMarker *BKE_tracking_exact_marker(struct MovieTrackingTrack *track, int framenr);

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/armature.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/armature.c	2012-06-11 11:40:54 UTC (rev 47739)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/armature.c	2012-06-11 11:43:06 UTC (rev 47740)
@@ -986,7 +986,7 @@
 
 			for (j = dvert->totweight; j != 0; j--, dw++) {
 				const int index = dw->def_nr;
-				if (index < defbase_tot && (pchan = defnrToPC[index])) {
+				if (index >= 0 && index < defbase_tot && (pchan = defnrToPC[index])) {
 					float weight = dw->weight;
 					Bone *bone = pchan->bone;
 					pdef_info = pdef_info_array + defnrToPCIndex[index];

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c	2012-06-11 11:40:54 UTC (rev 47739)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c	2012-06-11 11:43:06 UTC (rev 47740)
@@ -440,7 +440,7 @@
 	}
 }
 
-void BKE_tracking_marker_pattern_minmax(MovieTrackingMarker *marker, float min[2], float max[2])
+void BKE_tracking_marker_pattern_minmax(const MovieTrackingMarker *marker, float min[2], float max[2])
 {
 	INIT_MINMAX2(min, max);
 
@@ -1606,6 +1606,25 @@
 	return ibuf;
 }
 
+static void marker_search_scale_after_tracking(const MovieTrackingMarker *old_marker, MovieTrackingMarker *new_marker)
+{
+	float old_pat_min[2], old_pat_max[2];
+	float new_pat_min[2], new_pat_max[2];
+	float scale_x, scale_y;
+
+	BKE_tracking_marker_pattern_minmax(old_marker, old_pat_min, old_pat_max);
+	BKE_tracking_marker_pattern_minmax(new_marker, new_pat_min, new_pat_max);
+
+	scale_x = (new_pat_max[0] - new_pat_min[0]) / (old_pat_max[0] - old_pat_min[0]);
+	scale_y = (new_pat_max[1] - new_pat_min[1]) / (old_pat_max[1] - old_pat_min[1]);
+
+	new_marker->search_min[0] *= scale_x;
+	new_marker->search_min[1] *= scale_y;
+
+	new_marker->search_max[0] *= scale_x;
+	new_marker->search_max[1] *= scale_y;
+}
+
 #endif
 
 void BKE_tracking_sync(MovieTrackingContext *context)
@@ -1752,8 +1771,10 @@
 
 				/* Run the tracker! */
 				tracked = libmv_trackRegion(&options,
-				                            track_context->search_area, patch_new,
-				                            width, height,
+				                            track_context->search_area,
+											track_context->search_area_width,
+											track_context->search_area_height,
+											patch_new, width, height,
 				                            src_pixel_x, src_pixel_y,
 				                            &result,
 				                            dst_pixel_x, dst_pixel_y);
@@ -1767,6 +1788,8 @@
 				marker_new.flag |= MARKER_TRACKED;
 				marker_new.framenr = nextfra;
 
+				marker_search_scale_after_tracking(marker, &marker_new);
+
 				#pragma omp critical
 				{
 					if (context->first_time) {


@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list