[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49855] branches/soc-2011-tomato: Merging r49840 through r49854 from trunk into soc-2011-tomato

Sergey Sharybin sergey.vfx at gmail.com
Sun Aug 12 20:39:05 CEST 2012


Revision: 49855
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49855
Author:   nazgul
Date:     2012-08-12 18:39:05 +0000 (Sun, 12 Aug 2012)
Log Message:
-----------
Merging r49840 through r49854 from trunk into soc-2011-tomato

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

Modified Paths:
--------------
    branches/soc-2011-tomato/extern/eltopo/SConscript
    branches/soc-2011-tomato/extern/eltopo/common/runstats.h
    branches/soc-2011-tomato/source/blender/blenkernel/BKE_material.h
    branches/soc-2011-tomato/source/blender/blenkernel/CMakeLists.txt
    branches/soc-2011-tomato/source/blender/blenkernel/SConscript
    branches/soc-2011-tomato/source/blender/blenkernel/intern/depsgraph.c
    branches/soc-2011-tomato/source/blender/blenkernel/intern/material.c
    branches/soc-2011-tomato/source/blender/blenkernel/intern/sequencer.c
    branches/soc-2011-tomato/source/blender/collada/DocumentImporter.cpp
    branches/soc-2011-tomato/source/blender/collada/EffectExporter.cpp
    branches/soc-2011-tomato/source/blender/collada/GeometryExporter.cpp
    branches/soc-2011-tomato/source/blender/collada/InstanceWriter.cpp
    branches/soc-2011-tomato/source/blender/collada/MaterialExporter.h
    branches/soc-2011-tomato/source/blender/collada/MeshImporter.cpp
    branches/soc-2011-tomato/source/blender/collada/MeshImporter.h
    branches/soc-2011-tomato/source/blender/collada/collada_utils.cpp
    branches/soc-2011-tomato/source/blender/collada/collada_utils.h
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_InpaintOperation.cpp
    branches/soc-2011-tomato/source/blender/datatoc/datatoc.c
    branches/soc-2011-tomato/source/blender/editors/object/object_relations.c
    branches/soc-2011-tomato/source/blender/editors/object/object_select.c
    branches/soc-2011-tomato/source/blender/editors/space_outliner/outliner_edit.c
    branches/soc-2011-tomato/source/blender/makesdna/DNA_object_types.h
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_main_api.c
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_object.c
    branches/soc-2011-tomato/source/blender/modifiers/intern/MOD_boolean_util.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-49839
   + /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-49854

Modified: branches/soc-2011-tomato/extern/eltopo/SConscript
===================================================================
--- branches/soc-2011-tomato/extern/eltopo/SConscript	2012-08-12 18:38:01 UTC (rev 49854)
+++ branches/soc-2011-tomato/extern/eltopo/SConscript	2012-08-12 18:39:05 UTC (rev 49855)
@@ -2,15 +2,15 @@
 
 Import('env')
 
+import os
+
 defs = []
 
 
-eltopo_src = env.Glob("common/*.cpp") + env.Glob("eltopo3d/*.cpp") + env.Glob("common/newsparse/*.cpp") + env.Glob("common/sparse/*.cpp") + ["eltopo-capi.cpp"]
-eltopo_src.remove( "common\\gluvi.cpp" )
-eltopo_src.remove( "common\\openglutils.cpp" )
+eltopo_src = env.Glob("common/*.cpp") + env.Glob("eltopo3d/*.cpp") + env.Glob("common/newsparse/*.cpp") + env.Glob("common/tunicate/*.cpp") + env.Glob("common/sparse/*.cpp") + ["eltopo-capi.cpp"]
+eltopo_src.remove( "common" + os.sep + "gluvi.cpp" )
+eltopo_src.remove( "common" + os.sep + "openglutils.cpp" )
 
-# print(eltopo_src)
-
 defs.append('USE_FORTRAN_BLAS')
 defs.append('NO_GUI')
 

Modified: branches/soc-2011-tomato/extern/eltopo/common/runstats.h
===================================================================
--- branches/soc-2011-tomato/extern/eltopo/common/runstats.h	2012-08-12 18:38:01 UTC (rev 49854)
+++ branches/soc-2011-tomato/extern/eltopo/common/runstats.h	2012-08-12 18:39:05 UTC (rev 49855)
@@ -13,7 +13,7 @@
 
 #include <map>
 #include <string>
-#  if _MSC_VER < 1600
+#  if (defined(_MSC_VER) && _MSC_VER < 1600)
 // stdint.h is not available before VS2010
 #if defined(_WIN32) && !defined(__MINGW32__)
 /* The __intXX are built-in types of the visual complier! So we don't

Modified: branches/soc-2011-tomato/source/blender/blenkernel/BKE_material.h
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/BKE_material.h	2012-08-12 18:38:01 UTC (rev 49854)
+++ branches/soc-2011-tomato/source/blender/blenkernel/BKE_material.h	2012-08-12 18:39:05 UTC (rev 49855)
@@ -67,10 +67,16 @@
 struct Material ***give_matarar_id(struct ID *id); /* same but for ID's */
 short *give_totcolp_id(struct ID *id);
 
+enum {
+	BKE_MAT_ASSIGN_USERPREF,
+	BKE_MAT_ASSIGN_OBDATA,
+	BKE_MAT_ASSIGN_OBJECT
+};
+
 struct Material *give_current_material(struct Object *ob, short act);
 struct ID *material_from(struct Object *ob, short act);
 void assign_material_id(struct ID *id, struct Material *ma, short act);
-void assign_material(struct Object *ob, struct Material *ma, short act);
+void assign_material(struct Object *ob, struct Material *ma, short act, int assign_type);
 void assign_matarar(struct Object *ob, struct Material ***matar, short totcol);
 
 short find_material_index(struct Object *ob, struct Material *ma);

Modified: branches/soc-2011-tomato/source/blender/blenkernel/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/CMakeLists.txt	2012-08-12 18:38:01 UTC (rev 49854)
+++ branches/soc-2011-tomato/source/blender/blenkernel/CMakeLists.txt	2012-08-12 18:39:05 UTC (rev 49855)
@@ -254,6 +254,7 @@
 if(WITH_MOD_CLOTH_ELTOPO)
 	list(APPEND INC
 		../../../extern/eltopo
+		../../../extern/eltopo/eltopo3d
 	)
 	add_definitions(-DWITH_ELTOPO)
 endif()

Modified: branches/soc-2011-tomato/source/blender/blenkernel/SConscript
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/SConscript	2012-08-12 18:38:01 UTC (rev 49854)
+++ branches/soc-2011-tomato/source/blender/blenkernel/SConscript	2012-08-12 18:39:05 UTC (rev 49855)
@@ -41,7 +41,8 @@
         defs.append('DEBUG')
 
 if env['WITH_BF_ELTOPO']:
-    incs += ' ../../../extern/eltopo'
+    incs += ' #/extern/eltopo'
+    incs += ' #/extern/eltopo/eltopo3d'
     defs.append('WITH_ELTOPO')
         
 if env['WITH_BF_QUICKTIME']:

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/depsgraph.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/depsgraph.c	2012-08-12 18:38:01 UTC (rev 49854)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/depsgraph.c	2012-08-12 18:39:05 UTC (rev 49855)
@@ -2596,7 +2596,8 @@
 	if (id) {
 		idtype = GS(id->name);
 
-		if (ELEM8(idtype, ID_ME, ID_CU, ID_MB, ID_LA, ID_LT, ID_CA, ID_AR, ID_SPK)) {
+
+		if (OB_DATA_SUPPORT_ID(idtype)) {
 			for (obt = bmain->object.first; obt; obt = obt->id.next) {
 				if (!(ob && obt == ob) && obt->data == id) {
 					obt->recalc |= OB_RECALC_DATA;

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/material.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/material.c	2012-08-12 18:38:01 UTC (rev 49854)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/material.c	2012-08-12 18:39:05 UTC (rev 49855)
@@ -494,6 +494,9 @@
 /* same as above but for ID's */
 Material ***give_matarar_id(ID *id)
 {
+	/* ensure we don't try get materials from non-obdata */
+	BLI_assert(OB_DATA_SUPPORT_ID(GS(id->name)));
+
 	switch (GS(id->name)) {
 		case ID_ME:
 			return &(((Mesh *)id)->mat);
@@ -510,6 +513,9 @@
 
 short *give_totcolp_id(ID *id)
 {
+	/* ensure we don't try get materials from non-obdata */
+	BLI_assert(OB_DATA_SUPPORT_ID(GS(id->name)));
+
 	switch (GS(id->name)) {
 		case ID_ME:
 			return &(((Mesh *)id)->totcol);
@@ -526,6 +532,9 @@
 
 static void data_delete_material_index_id(ID *id, short index)
 {
+	/* ensure we don't try get materials from non-obdata */
+	BLI_assert(OB_DATA_SUPPORT_ID(GS(id->name)));
+
 	switch (GS(id->name)) {
 		case ID_ME:
 			BKE_mesh_delete_material_index((Mesh *)id, index);
@@ -765,11 +774,12 @@
 	test_object_materials(id);
 }
 
-void assign_material(Object *ob, Material *ma, short act)
+void assign_material(Object *ob, Material *ma, short act, int assign_type)
 {
 	Material *mao, **matar, ***matarar;
 	char *matbits;
 	short *totcolp;
+	char bit=0;
 
 	if (act > MAXMAT) return;
 	if (act < 1) act = 1;
@@ -796,8 +806,29 @@
 		*matarar = matar;
 		*totcolp = act;
 	}
-	
+
+	// Determine the object/mesh linking
+	if (assign_type == BKE_MAT_ASSIGN_USERPREF && ob->actcol) {
+		/* copy from previous material */
+		bit = ob->matbits[ob->actcol - 1];
+	}
+	else {
+		switch(assign_type) {
+			case BKE_MAT_ASSIGN_OBDATA:
+				bit = 0;
+				break;
+			case BKE_MAT_ASSIGN_OBJECT:
+				bit = 1;
+				break;
+			case BKE_MAT_ASSIGN_USERPREF:
+			default:
+				bit = (U.flag & USER_MAT_ON_OB) ? 1 : 0;
+				break;
+		}
+	}
+
 	if (act > ob->totcol) {
+		/* Need more space in the material arrays */
 		matar = MEM_callocN(sizeof(void *) * act, "matarray2");
 		matbits = MEM_callocN(sizeof(char) * act, "matbits1");
 		if (ob->totcol) {
@@ -809,17 +840,12 @@
 		ob->mat = matar;
 		ob->matbits = matbits;
 		ob->totcol = act;
-
-		/* copy object/mesh linking, or assign based on userpref */
-		if (ob->actcol)
-			ob->matbits[act - 1] = ob->matbits[ob->actcol - 1];
-		else
-			ob->matbits[act - 1] = (U.flag & USER_MAT_ON_OB) ? 1 : 0;
 	}
 	
 	/* do it */
 
-	if (ob->matbits[act - 1]) {   /* in object */
+	ob->matbits[act - 1] = bit;
+	if (bit == 1) {   /* in object */
 		mao = ob->mat[act - 1];
 		if (mao) mao->id.us--;
 		ob->mat[act - 1] = ma;
@@ -845,7 +871,7 @@
 
 	/* now we have the right number of slots */
 	for (i = 0; i < totcol; i++)
-		assign_material(ob, (*matar)[i], i + 1);
+		assign_material(ob, (*matar)[i], i + 1, BKE_MAT_ASSIGN_USERPREF);
 
 	if (actcol_orig > ob->totcol)
 		actcol_orig = ob->totcol;
@@ -879,7 +905,7 @@
 	if (ob == NULL) return FALSE;
 	if (ob->totcol >= MAXMAT) return FALSE;
 	
-	assign_material(ob, NULL, ob->totcol + 1);
+	assign_material(ob, NULL, ob->totcol + 1, BKE_MAT_ASSIGN_USERPREF);
 	ob->actcol = ob->totcol;
 	return TRUE;
 }

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/sequencer.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/sequencer.c	2012-08-12 18:38:01 UTC (rev 49854)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/sequencer.c	2012-08-12 18:39:05 UTC (rev 49855)
@@ -136,8 +136,6 @@
 		IMB_free_anim(seq->strip->proxy->anim);
 		seq->strip->proxy->anim = NULL;
 	}
-
-	BKE_sequencer_cache_cleanup_sequence(seq);
 }
 
 static void seq_free_strip(Strip *strip)
@@ -205,6 +203,8 @@
 		seq_free_animdata(scene, seq);
 	}
 
+	BKE_sequencer_cache_cleanup_sequence(seq);
+
 	MEM_freeN(seq);
 }
 
@@ -1640,6 +1640,13 @@
 	IMB_processor_apply_threaded(ibuf->y, sizeof(ColorBalanceThread), &init_data,
                                  color_balance_init_handle, color_balance_do_thread);
 
+	/* color balance either happens on float buffer or byte buffer, but never on both,
+	 * free byte buffer if there's float buffer since float buffer would be used for
+	 * color balance in favor of byte buffer
+	 */
+	if (ibuf->rect_float && ibuf->rect)
+		imb_freerectImBuf(ibuf);
+
 	if (init_data.mask)
 		IMB_freeImBuf(init_data.mask);
 }

Modified: branches/soc-2011-tomato/source/blender/collada/DocumentImporter.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/collada/DocumentImporter.cpp	2012-08-12 18:38:01 UTC (rev 49854)
+++ branches/soc-2011-tomato/source/blender/collada/DocumentImporter.cpp	2012-08-12 18:39:05 UTC (rev 49855)
@@ -208,6 +208,10 @@
 			write_node(roots[i], NULL, sce, NULL, false);
 		}
 	}
+
+
+	mesh_importer.optimize_material_assignements();
+

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list