[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50189] branches/soc-2011-tomato: Mergin trunk into soc-2011-tomato up to rev 50188

Sergey Sharybin sergey.vfx at gmail.com
Fri Aug 24 16:11:04 CEST 2012


Revision: 50189
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50189
Author:   nazgul
Date:     2012-08-24 14:11:04 +0000 (Fri, 24 Aug 2012)
Log Message:
-----------
Mergin trunk into soc-2011-tomato up to rev 50188

All reverted commits should be merged again.

--
svn merge -r50173:50188 ^/trunk/blender

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

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/editors/mask/mask_add.c
    branches/soc-2011-tomato/source/blender/editors/uvedit/uvedit_parametrizer.c
    branches/soc-2011-tomato/source/blender/imbuf/intern/openexr/CMakeLists.txt
    branches/soc-2011-tomato/source/blender/imbuf/intern/openexr/SConscript
    branches/soc-2011-tomato/source/blender/imbuf/intern/openexr/openexr_api.cpp
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_nodetree.c
    branches/soc-2011-tomato/source/blender/windowmanager/intern/wm_playanim.c
    branches/soc-2011-tomato/source/blender/windowmanager/intern/wm_window.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-50173,50179
   + /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-50188


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-50173,50179
   + /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-50188

Modified: branches/soc-2011-tomato/source/blender/editors/mask/mask_add.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/mask/mask_add.c	2012-08-24 14:04:21 UTC (rev 50188)
+++ branches/soc-2011-tomato/source/blender/editors/mask/mask_add.c	2012-08-24 14:11:04 UTC (rev 50189)
@@ -182,7 +182,8 @@
 
 static void setup_vertex_point(const bContext *C, Mask *mask, MaskSpline *spline, MaskSplinePoint *new_point,
                                const float point_co[2], const float tangent[2], const float u,
-                               MaskSplinePoint *reference_point, const short reference_adjacent)
+                               MaskSplinePoint *reference_point, const short reference_adjacent,
+                               const float view_zoom)
 {
 	ScrArea *sa = CTX_wm_area(C);
 
@@ -225,8 +226,8 @@
 	/* initial offset for handles */
 	if (spline->tot_point == 1) {
 		/* first point of splien is aligned horizontally */
-		bezt->vec[0][0] -= len / width;
-		bezt->vec[2][0] += len / width;
+		bezt->vec[0][0] -= len / maxi(width, height) * view_zoom;
+		bezt->vec[2][0] += len / maxi(width, height) * view_zoom;
 	}
 	else if (tangent) {
 		float vec[2];
@@ -391,7 +392,7 @@
 
 		new_point = &spline->points[point_index + 1];
 
-		setup_vertex_point(C, mask, spline, new_point, co, tangent, u, NULL, TRUE);
+		setup_vertex_point(C, mask, spline, new_point, co, tangent, u, NULL, TRUE, 1.0f);
 
 		/* TODO - we could pass the spline! */
 		BKE_mask_layer_shape_changed_add(masklay, BKE_mask_layer_shape_spline_to_index(masklay, spline) + point_index + 1, TRUE, TRUE);
@@ -490,7 +491,7 @@
 
 	masklay->act_point = new_point;
 
-	setup_vertex_point(C, mask, spline, new_point, co, NULL, 0.5f, ref_point, FALSE);
+	setup_vertex_point(C, mask, spline, new_point, co, NULL, 0.5f, ref_point, FALSE, 1.0f);
 
 	if (masklay->splines_shapes.first) {
 		point_index = (((int)(new_point - spline->points) + 0) % spline->tot_point);
@@ -512,6 +513,7 @@
 	MaskSpline *spline;
 	MaskSplinePoint *point;
 	MaskSplinePoint *new_point = NULL, *ref_point = NULL;
+	float view_zoom;
 
 	if (!masklay) {
 		/* if there's no masklay currently operationg on, create new one */
@@ -536,8 +538,27 @@
 
 	masklay->act_point = new_point;
 
-	setup_vertex_point(C, mask, spline, new_point, co, NULL, 0.5f, ref_point, FALSE);
+	{
+		ScrArea *sa = CTX_wm_area(C);
+		ARegion *ar = CTX_wm_region(C);
 
+		/* calc view zoom in a simplistic way */
+		float co_a[2];
+		float co_b[2];
+		int mval_a[2] = {0, 0};
+		int mval_b[2] = {1, 1};
+
+		ED_mask_mouse_pos(sa, ar, mval_a, co_a);
+		ED_mask_mouse_pos(sa, ar, mval_b, co_b);
+
+		view_zoom = ((co_b[0] - co_a[0]) + (co_b[1] - co_a[1])) / 2.0f;
+
+		/* scale up - arbitrarty but works well in the view */
+		view_zoom *= 200.0f;
+	}
+
+	setup_vertex_point(C, mask, spline, new_point, co, NULL, 0.5f, ref_point, FALSE, view_zoom);
+
 	{
 		int point_index = (((int)(new_point - spline->points) + 0) % spline->tot_point);
 		BKE_mask_layer_shape_changed_add(masklay, BKE_mask_layer_shape_spline_to_index(masklay, spline) + point_index, TRUE, TRUE);


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-50173,50179
   + /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-50188

Modified: branches/soc-2011-tomato/source/blender/editors/uvedit/uvedit_parametrizer.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/uvedit/uvedit_parametrizer.c	2012-08-24 14:04:21 UTC (rev 50188)
+++ branches/soc-2011-tomato/source/blender/editors/uvedit/uvedit_parametrizer.c	2012-08-24 14:11:04 UTC (rev 50189)
@@ -1135,7 +1135,11 @@
 
 static PBool p_quad_split_direction(PHandle *handle, float **co, PHashKey *vkeys)
 {
-	float fac = len_v3v3(co[0], co[2]) - len_v3v3(co[1], co[3]);
+	/* slight bias to prefer one edge over the other in case they are equal, so
+	 * that in symmetric models we choose the same split direction instead of
+	 * depending on floating point errors to decide */
+	float bias = 1.0f + 1e-6f;
+	float fac = len_v3v3(co[0], co[2])*bias - len_v3v3(co[1], co[3]);
 	PBool dir = (fac <= 0.0f);
 
 	/* the face exists check is there because of a special case: when

Modified: branches/soc-2011-tomato/source/blender/imbuf/intern/openexr/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/source/blender/imbuf/intern/openexr/CMakeLists.txt	2012-08-24 14:04:21 UTC (rev 50188)
+++ branches/soc-2011-tomato/source/blender/imbuf/intern/openexr/CMakeLists.txt	2012-08-24 14:11:04 UTC (rev 50189)
@@ -31,6 +31,7 @@
 	../../../blenlib
 	../../../makesdna
 	../../../../../intern/guardedalloc
+	../../../../../intern/utfconv
 )
 
 set(INC_SYS

Modified: branches/soc-2011-tomato/source/blender/imbuf/intern/openexr/SConscript
===================================================================
--- branches/soc-2011-tomato/source/blender/imbuf/intern/openexr/SConscript	2012-08-24 14:04:21 UTC (rev 50188)
+++ branches/soc-2011-tomato/source/blender/imbuf/intern/openexr/SConscript	2012-08-24 14:11:04 UTC (rev 50189)
@@ -10,7 +10,9 @@
     '../../../blenlib',
     'intern/include',
     '#/intern/guardedalloc',
-    '../../../makesdna']
+    '../../../makesdna',
+    '#/intern/utfconv']
+
 incs += Split(env['BF_OPENEXR_INC'])
 
 defs = ['WITH_OPENEXR']

Modified: branches/soc-2011-tomato/source/blender/imbuf/intern/openexr/openexr_api.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/imbuf/intern/openexr/openexr_api.cpp	2012-08-24 14:04:21 UTC (rev 50188)
+++ branches/soc-2011-tomato/source/blender/imbuf/intern/openexr/openexr_api.cpp	2012-08-24 14:11:04 UTC (rev 50189)
@@ -32,12 +32,17 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <stddef.h>
+#include <fstream>
 #include <string>
 #include <set>
+#include <errno.h>
 
-
 #include <openexr_api.h>
 
+#if defined (WIN32) && !defined(FREE_WINDOWS)
+#include "utfconv.h"
+#endif
+
 extern "C"
 {
 
@@ -66,6 +71,7 @@
 
 #if defined(_WIN32) && !defined(FREE_WINDOWS)
 #include <half.h>
+#include <Iex/Iex.h>
 #include <IlmImf/ImfVersion.h>
 #include <IlmImf/ImfArray.h>
 #include <IlmImf/ImfIO.h>
@@ -79,6 +85,7 @@
 #include <Imath/ImathBox.h>
 #else
 #include <half.h>
+#include <Iex.h>
 #include <ImfVersion.h>
 #include <ImathBox.h>
 #include <ImfArray.h>
@@ -95,6 +102,8 @@
 using namespace Imf;
 using namespace Imath;
 
+/* Memory Input Stream */
+
 class Mem_IStream : public Imf::IStream
 {
 public:
@@ -142,6 +151,122 @@
 {
 }
 
+/* File Input Stream */
+
+class IFileStream : public IStream
+{
+public:
+	IFileStream(const char *filename)
+	: IStream(filename)
+	{
+		/* utf-8 file path support on windows */
+#if defined (WIN32) && !defined(FREE_WINDOWS)
+		wchar_t *wfilename = alloc_utf16_from_8(filename, 0);
+		ifs.open(wfilename, std::ios_base::binary);
+		free(wfilename);
+#else
+		ifs.open(filename, std::ios_base::binary);
+#endif
+
+		if (!ifs)
+			Iex::throwErrnoExc();
+	}
+
+	virtual bool read(char c[], int n)
+	{
+		if (!ifs)
+			throw Iex::InputExc("Unexpected end of file.");
+
+		errno = 0;
+		ifs.read(c, n);
+		return check_error();
+	}
+
+	virtual Int64 tellg()
+	{
+		return std::streamoff(ifs.tellg());
+	}
+
+	virtual void seekg(Int64 pos)
+	{
+		ifs.seekg(pos);
+		check_error();
+	}
+
+	virtual void clear()
+	{
+		ifs.clear();
+	}
+
+private:
+	bool check_error()
+	{
+		if (!ifs) {
+			if (errno)
+				Iex::throwErrnoExc();
+
+			return false;
+		}
+
+		return true;
+	}
+
+	std::ifstream ifs;
+};
+
+/* File Output Stream */
+

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list