[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48241] branches/soc-2011-tomato: Merging r48238 through r48240 from trunk into soc-2011-tomato

Sergey Sharybin sergey.vfx at gmail.com
Sun Jun 24 17:31:40 CEST 2012


Revision: 48241
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48241
Author:   nazgul
Date:     2012-06-24 15:31:40 +0000 (Sun, 24 Jun 2012)
Log Message:
-----------
Merging r48238 through r48240 from trunk into soc-2011-tomato

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

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingScreenOperation.cpp
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingScreenOperation.h
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_nodetree_types.h

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-48237
   + /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-48240

Modified: branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingScreenOperation.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingScreenOperation.cpp	2012-06-24 15:29:43 UTC (rev 48240)
+++ branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingScreenOperation.cpp	2012-06-24 15:31:40 UTC (rev 48241)
@@ -65,6 +65,9 @@
 		if (triangulation->triangles)
 			MEM_freeN(triangulation->triangles);
 
+		if (triangulation->triangles_AABB)
+			MEM_freeN(triangulation->triangles_AABB);
+
 		MEM_freeN(this->cachedTriangulation);
 
 		this->cachedTriangulation = NULL;
@@ -155,6 +158,33 @@
 	MEM_freeN(sites);
 	BLI_freelistN(&edges);
 
+	if (triangulation->triangles_total) {
+		rctf *rect;
+		rect = triangulation->triangles_AABB =
+			(rctf *) MEM_callocN(sizeof(rctf) * triangulation->triangles_total, "voronoi triangulation AABB");
+
+		for (i = 0; i < triangulation->triangles_total; i++, rect++) {
+			int *triangle = triangulation->triangles[i];
+			VoronoiTriangulationPoint *a = &triangulation->triangulated_points[triangle[0]],
+			                          *b = &triangulation->triangulated_points[triangle[1]],
+			                          *c = &triangulation->triangulated_points[triangle[2]];
+
+			float min[2], max[2];
+
+			INIT_MINMAX2(min, max);
+
+			DO_MINMAX2(a->co, min, max);
+			DO_MINMAX2(b->co, min, max);
+			DO_MINMAX2(c->co, min, max);
+
+			rect->xmin = min[0];
+			rect->ymin = min[1];
+
+			rect->xmax = max[0];
+			rect->ymax = max[1];
+		}
+	}
+
 	return triangulation;
 }
 
@@ -203,18 +233,24 @@
 	if (this->movieClip && data) {
 		TriangulationData *triangulation = (TriangulationData *) data;
 		int i;
+		float co[2] = {(float) x, (float) y};
+
 		for (i = 0; i < triangulation->triangles_total; i++) {
-			int *triangle = triangulation->triangles[i];
-			VoronoiTriangulationPoint *a = &triangulation->triangulated_points[triangle[0]],
-			*b = &triangulation->triangulated_points[triangle[1]],
-			*c = &triangulation->triangulated_points[triangle[2]];
-			float co[2] = {(float) x, (float) y}, w[3];
+			rctf *rect = &triangulation->triangles_AABB[i];
 
-			if (barycentric_coords_v2(a->co, b->co, c->co, co, w)) {
-				if (barycentric_inside_triangle_v2(w)) {
-					color[0] += a->color[0] * w[0] + b->color[0] * w[1] + c->color[0] * w[2];
-					color[1] += a->color[1] * w[0] + b->color[1] * w[1] + c->color[1] * w[2];
-					color[2] += a->color[2] * w[0] + b->color[2] * w[1] + c->color[2] * w[2];
+			if (IN_RANGE_INCL(x, rect->xmin, rect->xmax) && IN_RANGE_INCL(y, rect->ymin, rect->ymax)) {
+				int *triangle = triangulation->triangles[i];
+				VoronoiTriangulationPoint *a = &triangulation->triangulated_points[triangle[0]],
+				                          *b = &triangulation->triangulated_points[triangle[1]],
+				                          *c = &triangulation->triangulated_points[triangle[2]];
+				float w[3];
+
+				if (barycentric_coords_v2(a->co, b->co, c->co, co, w)) {
+					if (barycentric_inside_triangle_v2(w)) {
+						color[0] += a->color[0] * w[0] + b->color[0] * w[1] + c->color[0] * w[2];
+						color[1] += a->color[1] * w[0] + b->color[1] * w[1] + c->color[1] * w[2];
+						color[2] += a->color[2] * w[0] + b->color[2] * w[1] + c->color[2] * w[2];
+					}
 				}
 			}
 		}

Modified: branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingScreenOperation.h
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingScreenOperation.h	2012-06-24 15:29:43 UTC (rev 48240)
+++ branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingScreenOperation.h	2012-06-24 15:31:40 UTC (rev 48241)
@@ -47,6 +47,7 @@
 		VoronoiTriangulationPoint *triangulated_points;
 		int (*triangles)[3];
 		int triangulated_points_total, triangles_total;
+		rctf *triangles_AABB;
 	} TriangulationData;
 
 	MovieClip *movieClip;


Property changes on: branches/soc-2011-tomato/source/blender/editors/interface/interface.c
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c: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/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989
/trunk/blender/source/blender/editors/interface/interface.c:36831-48237
   + /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c: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/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989
/trunk/blender/source/blender/editors/interface/interface.c:36831-48240


Property changes on: branches/soc-2011-tomato/source/blender/editors/space_outliner
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/soc-2011-cucumber/source/blender/editors/space_outliner:38968,38970,38973,39045,40845
/branches/soc-2011-pepper/source/blender/editors/space_outliner:36831-38987
/trunk/blender/source/blender/editors/space_outliner:36831-48237
   + /branches/soc-2011-cucumber/source/blender/editors/space_outliner:38968,38970,38973,39045,40845
/branches/soc-2011-pepper/source/blender/editors/space_outliner:36831-38987
/trunk/blender/source/blender/editors/space_outliner:36831-48240

Modified: branches/soc-2011-tomato/source/blender/makesrna/intern/rna_nodetree_types.h
===================================================================
--- branches/soc-2011-tomato/source/blender/makesrna/intern/rna_nodetree_types.h	2012-06-24 15:29:43 UTC (rev 48240)
+++ branches/soc-2011-tomato/source/blender/makesrna/intern/rna_nodetree_types.h	2012-06-24 15:31:40 UTC (rev 48241)
@@ -37,7 +37,7 @@
 DefNode( ShaderNode,     SH_NODE_RGB,             0,                      "RGB",            RGB,              "RGB",               ""              )
 DefNode( ShaderNode,     SH_NODE_VALUE,           0,                      "VALUE",          Value,            "Value",             ""              )
 DefNode( ShaderNode,     SH_NODE_MIX_RGB,         def_mix_rgb,            "MIX_RGB",        MixRGB,           "MixRGB",            ""              )
-DefNode( ShaderNode,     SH_NODE_VALTORGB,        def_colorramp,          "VALTORGB",       ValToRGB,         "ColorRamp",      ""              )
+DefNode( ShaderNode,     SH_NODE_VALTORGB,        def_colorramp,          "VALTORGB",       ValToRGB,         "ColorRamp",         ""              )
 DefNode( ShaderNode,     SH_NODE_RGBTOBW,         0,                      "RGBTOBW",        RGBToBW,          "RGB to BW",         ""              )
 DefNode( ShaderNode,     SH_NODE_TEXTURE,         def_texture,            "TEXTURE",        Texture,          "Texture",           ""              )
 DefNode( ShaderNode,     SH_NODE_NORMAL,          0,                      "NORMAL",         Normal,           "Normal",            ""              )
@@ -91,13 +91,13 @@
 DefNode( ShaderNode,     SH_NODE_TEX_MUSGRAVE,       def_sh_tex_musgrave,    "TEX_MUSGRAVE",       TexMusgrave,      "Musgrave Texture",  ""       )
 DefNode( ShaderNode,     SH_NODE_TEX_VORONOI,        def_sh_tex_voronoi,     "TEX_VORONOI",        TexVoronoi,       "Voronoi Texture",   ""       )
 DefNode( ShaderNode,     SH_NODE_TEX_CHECKER,        def_sh_tex_checker,     "TEX_CHECKER",        TexChecker,       "Checker Texture",   ""       )
-DefNode( ShaderNode,     SH_NODE_TEX_COORD,          0,                      "TEX_COORD",          TexCoord,         "Texture Coordinate","")
+DefNode( ShaderNode,     SH_NODE_TEX_COORD,          0,                      "TEX_COORD",          TexCoord,         "Texture Coordinate",""       )
 
 DefNode( CompositorNode, CMP_NODE_VIEWER,         def_cmp_viewer,         "VIEWER",         Viewer,           "Viewer",            ""              )
 DefNode( CompositorNode, CMP_NODE_RGB,            0,                      "RGB",            RGB,              "RGB",               ""              )
 DefNode( CompositorNode, CMP_NODE_VALUE,          0,                      "VALUE",          Value,            "Value",             ""              )
 DefNode( CompositorNode, CMP_NODE_MIX_RGB,        def_mix_rgb,            "MIX_RGB",        MixRGB,           "Mix RGB",           ""              )
-DefNode( CompositorNode, CMP_NODE_VALTORGB,       def_colorramp,          "VALTORGB",       ValToRGB,         "ColorRamp",      ""              )
+DefNode( CompositorNode, CMP_NODE_VALTORGB,       def_colorramp,          "VALTORGB",       ValToRGB,         "ColorRamp",         ""              )

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list