[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49621] branches/soc-2011-tomato: svn merge ^/trunk/blender -r49601:49620

Campbell Barton ideasman42 at gmail.com
Mon Aug 6 16:02:03 CEST 2012


Revision: 49621
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49621
Author:   campbellbarton
Date:     2012-08-06 14:02:03 +0000 (Mon, 06 Aug 2012)
Log Message:
-----------
svn merge ^/trunk/blender -r49601:49620

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

Modified Paths:
--------------
    branches/soc-2011-tomato/intern/string/STR_HashedString.h
    branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_image.py
    branches/soc-2011-tomato/source/blender/blenkernel/BKE_mask.h
    branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c
    branches/soc-2011-tomato/source/blender/blenkernel/intern/mask_rasterize.c
    branches/soc-2011-tomato/source/blender/blenlib/intern/stack.c
    branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.c
    branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_knife.c
    branches/soc-2011-tomato/source/blender/editors/space_image/space_image.c
    branches/soc-2011-tomato/source/blender/editors/space_node/node_edit.c
    branches/soc-2011-tomato/source/blender/editors/space_node/node_group.c
    branches/soc-2011-tomato/source/blender/editors/transform/transform.c
    branches/soc-2011-tomato/source/blender/editors/transform/transform.h
    branches/soc-2011-tomato/source/blender/editors/transform/transform_conversions.c
    branches/soc-2011-tomato/source/blender/editors/uvedit/uvedit_ops.c
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_space.c

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-49601
   + /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-49620

Modified: branches/soc-2011-tomato/intern/string/STR_HashedString.h
===================================================================
--- branches/soc-2011-tomato/intern/string/STR_HashedString.h	2012-08-06 13:59:11 UTC (rev 49620)
+++ branches/soc-2011-tomato/intern/string/STR_HashedString.h	2012-08-06 14:02:03 UTC (rev 49621)
@@ -27,14 +27,10 @@
 
 /** \file string/STR_HashedString.h
  *  \ingroup string
- */
-
-
-/**
-
+ *
  * Copyright (C) 2001 NaN Technologies B.V.
  * This file was formerly known as: GEN_StdString.cpp.
- * @date	November, 14, 2001
+ * \date	November, 14, 2001
  */
 
 #ifndef __STR_HASHEDSTRING_H__
@@ -53,22 +49,22 @@
 //
 static inline void STR_gHashMix(dword& a, dword& b, dword& c)
 {
-	a -= b; a -= c; a ^= (c>>13);
-	b -= c; b -= a; b ^= (a<<8);
-	c -= a; c -= b; c ^= (b>>13);
-	a -= b; a -= c; a ^= (c>>12);
-	b -= c; b -= a; b ^= (a<<16);
-	c -= a; c -= b; c ^= (b>>5);
-	a -= b; a -= c; a ^= (c>>3);
-	b -= c; b -= a; b ^= (a<<10);
-	c -= a; c -= b; c ^= (b>>15);
+	a -= b; a -= c; a ^= (c >> 13);
+	b -= c; b -= a; b ^= (a << 8);
+	c -= a; c -= b; c ^= (b >> 13);
+	a -= b; a -= c; a ^= (c >> 12);
+	b -= c; b -= a; b ^= (a << 16);
+	c -= a; c -= b; c ^= (b >> 5);
+	a -= b; a -= c; a ^= (c >> 3);
+	b -= c; b -= a; b ^= (a << 10);
+	c -= a; c -= b; c ^= (b >> 15);
 }
 
 //
 // Fast Hashable<int32> functionality
 // http://www.concentric.net/~Ttwang/tech/inthash.htm
 //
-static inline dword			STR_gHash(dword inDWord)
+static inline dword         STR_gHash(dword inDWord)
 {
 	dword key = inDWord;
 	key += ~(key << 16);
@@ -80,43 +76,43 @@
 	return key;
 }
 
-enum { GOLDEN_RATIO = 0x9e3779b9 }; // arbitrary value to initialize hash funtion, well not so arbitrary
-									// as this value is taken from the pigs library (Orange Games/Lost Boys)
+enum { GOLDEN_RATIO = 0x9e3779b9 }; /* arbitrary value to initialize hash funtion, well not so arbitrary
+                                     * as this value is taken from the pigs library (Orange Games/Lost Boys) */
 
 
 
-static dword STR_gHash(const void* in, int len, dword init_val)
+static dword STR_gHash(const void *in, int len, dword init_val)
 {
-	unsigned int  length = len;
+	unsigned int length = len;
 	dword a = (dword)GOLDEN_RATIO;
 	dword b = (dword)GOLDEN_RATIO;
-	dword c = init_val;															// the previous hash value
+	dword c = init_val;  /* the previous hash value */
 	byte  *p_in = (byte *)in;
 
 	// Do the largest part of the key
 	while (length >= 12)
 	{
-		a += (p_in[0] + ((dword)p_in[1]<<8) + ((dword)p_in[2] <<16) + ((dword)p_in[3] <<24));
-		b += (p_in[4] + ((dword)p_in[5]<<8) + ((dword)p_in[6] <<16) + ((dword)p_in[7] <<24));
-		c += (p_in[8] + ((dword)p_in[9]<<8) + ((dword)p_in[10]<<16) + ((dword)p_in[11]<<24));
+		a += (p_in[0] + ((dword)p_in[1] << 8) + ((dword)p_in[2]  << 16) + ((dword)p_in[3]  << 24));
+		b += (p_in[4] + ((dword)p_in[5] << 8) + ((dword)p_in[6]  << 16) + ((dword)p_in[7]  << 24));
+		c += (p_in[8] + ((dword)p_in[9] << 8) + ((dword)p_in[10] << 16) + ((dword)p_in[11] << 24));
 		STR_gHashMix(a, b, c);
 		p_in += 12; length -= 12;
 	}
 
 	// Handle the last 11 bytes
 	c += len;
-	switch(length) {
-	case 11: c+=((dword)p_in[10]<<24);
-	case 10: c+=((dword)p_in[9]<<16);
-	case 9 : c+=((dword)p_in[8]<<8);											// the first byte of c is reserved for the length
-	case 8 : b+=((dword)p_in[7]<<24);
-	case 7 : b+=((dword)p_in[6]<<16);
-	case 6 : b+=((dword)p_in[5]<<8);
-	case 5 : b+=p_in[4];
-	case 4 : a+=((dword)p_in[3]<<24);
-	case 3 : a+=((dword)p_in[2]<<16);
-	case 2 : a+=((dword)p_in[1]<<8);
-	case 1 : a+=p_in[0];
+	switch (length) {
+		case 11: c += ((dword)p_in[10] << 24);
+		case 10: c += ((dword)p_in[9]  << 16);
+		case  9: c += ((dword)p_in[8]  << 8);  /* the first byte of c is reserved for the length */
+		case  8: b += ((dword)p_in[7]  << 24);
+		case  7: b += ((dword)p_in[6]  << 16);
+		case  6: b += ((dword)p_in[5]  << 8);
+		case  5: b += p_in[4];
+		case  4: a += ((dword)p_in[3]  << 24);
+		case  3: a += ((dword)p_in[2]  << 16);
+		case  2: a += ((dword)p_in[1]  << 8);
+		case  1: a += p_in[0];
 	}
 	STR_gHashMix(a, b, c);
 
@@ -129,18 +125,18 @@
 class STR_HashedString : public STR_String
 {
 public:
-	STR_HashedString()	: STR_String(),m_Hashed(false) {}
-	STR_HashedString(const char* str)	: STR_String(str),m_Hashed(false) {}
-	STR_HashedString(const STR_String& str) : STR_String(str),m_Hashed(false) {}
+	STR_HashedString() : STR_String(), m_Hashed(false) {}
+	STR_HashedString(const char *str) : STR_String(str), m_Hashed(false) {}
+	STR_HashedString(const STR_String &str) : STR_String(str), m_Hashed(false) {}
 
-	inline dword hash(dword init=0) const
+	inline dword hash(dword init = 0) const
 	{ 
 		if (!m_Hashed) 
 		{
-			const char* str = *this;
+			const char *str = *this;
 			int length = this->Length();
-			m_CachedHash = STR_gHash(str,length,init);
-			m_Hashed=true;
+			m_CachedHash = STR_gHash(str, length, init);
+			m_Hashed = true;
 		} 
 		return m_CachedHash;
 	}

Modified: branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_image.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_image.py	2012-08-06 13:59:11 UTC (rev 49620)
+++ branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_image.py	2012-08-06 14:02:03 UTC (rev 49621)
@@ -383,11 +383,17 @@
 
         layout.prop(sima, "mode", text="")
 
+        if show_maskedit:
+            row = layout.row()
+            row.template_ID(sima, "mask", new="mask.new")
+
+        if show_uvedit or show_maskedit:
+            layout.prop(sima, "pivot_point", text="", icon_only=True)
+
         # uv editing
         if show_uvedit:
             uvedit = sima.uv_editor
 
-            layout.prop(uvedit, "pivot_point", text="", icon_only=True)
             layout.prop(toolsettings, "use_uv_select_sync", text="")
 
             if toolsettings.use_uv_select_sync:
@@ -408,14 +414,6 @@
             mesh = context.edit_object.data
             layout.prop_search(mesh.uv_textures, "active", mesh, "uv_textures", text="")
 
-        if show_maskedit:
-            row = layout.row()
-            row.template_ID(sima, "mask", new="mask.new")
-
-            # reused for mask
-            uvedit = sima.uv_editor
-            layout.prop(uvedit, "pivot_point", text="", icon_only=True)
-
         if ima:
             # layers
             layout.template_image_layers(ima, iuser)
@@ -629,6 +627,7 @@
         sima = context.space_data
         ima = sima.image
         show_uvedit = sima.show_uvedit
+        show_maskedit = sima.show_maskedit
         uvedit = sima.uv_editor
 
         split = layout.split()
@@ -647,12 +646,12 @@
             col.label(text="Coordinates:")
             col.prop(uvedit, "show_normalized_coords", text="Normalized")
 
-        if show_uvedit:
-
+        if show_uvedit or show_maskedit:
             col = layout.column()
             col.label("Cursor Location:")
-            col.row().prop(uvedit, "cursor_location", text="")
+            col.row().prop(sima, "cursor_location", text="")
 
+        if show_uvedit:
             col.separator()
 
             col.label(text="UVs:")

Modified: branches/soc-2011-tomato/source/blender/blenkernel/BKE_mask.h
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/BKE_mask.h	2012-08-06 13:59:11 UTC (rev 49620)
+++ branches/soc-2011-tomato/source/blender/blenkernel/BKE_mask.h	2012-08-06 14:02:03 UTC (rev 49621)
@@ -76,7 +76,7 @@
                                                          const unsigned int resol))[2];
 float (*BKE_mask_spline_differentiate_with_resolution(struct MaskSpline *spline, int width, int height, int *tot_diff_point))[2];
 float (*BKE_mask_spline_feather_differentiated_points_with_resolution_ex(struct MaskSpline *spline, int *tot_feather_point,
-                                                                         const unsigned int resol, const int do_collapse))[2];
+                                                                         const unsigned int resol))[2];
 float (*BKE_mask_spline_feather_differentiated_points_with_resolution(struct MaskSpline *spline, int width, int height, int *tot_feather_point))[2];
 
 float (*BKE_mask_spline_feather_points(struct MaskSpline *spline, int *tot_feather_point))[2];

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c	2012-08-06 13:59:11 UTC (rev 49620)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c	2012-08-06 14:02:03 UTC (rev 49621)
@@ -481,14 +481,29 @@
 			continue;
 
 		if (isect_seg_seg_v2(v1, v2, v3, v4)) {
-			int k, len;
+			int k;
 			float p[2];
+			float min_a[2], max_a[2];
+			float min_b[2], max_b[2];
 
 			isect_seg_seg_v2_point(v1, v2, v3, v4, p);
 
-			/* TODO: for now simply choose the shortest loop, could be made smarter in some way */
-			len = cur_a - check_b;
-			if (len < tot_feather_point - len) {
+			INIT_MINMAX2(min_a, max_a);
+			INIT_MINMAX2(min_b, max_b);
+
+			/* collapse loop with smaller AABB */
+			for (k = 0; k < tot_feather_point; k++) {
+				if (k >= check_b && k <= cur_a) {
+					DO_MINMAX2(feather_points[k], min_a, max_a);
+				}
+				else {
+					DO_MINMAX2(feather_points[k], min_b, max_b);
+				}
+			}
+
+			if (max_a[0] - min_a[0] < max_b[0] - min_b[0] ||
+			    max_a[1] - min_a[1] < max_b[1] - min_b[1])
+			{
 				for (k = check_b; k <= cur_a; k++) {

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list