[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55080] branches/soc-2011-tomato: Merging r55060 through r55079 from trunk into soc-2011-tomato

Sergey Sharybin sergey.vfx at gmail.com
Wed Mar 6 19:17:01 CET 2013


Revision: 55080
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55080
Author:   nazgul
Date:     2013-03-06 18:17:01 +0000 (Wed, 06 Mar 2013)
Log Message:
-----------
Merging r55060 through r55079 from trunk into soc-2011-tomato

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

Modified Paths:
--------------
    branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_dopesheet.py
    branches/soc-2011-tomato/source/blender/blenkernel/BKE_DerivedMesh.h
    branches/soc-2011-tomato/source/blender/blenkernel/intern/DerivedMesh.c
    branches/soc-2011-tomato/source/blender/blenkernel/intern/customdata.c
    branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c
    branches/soc-2011-tomato/source/blender/editors/animation/anim_channels_defines.c
    branches/soc-2011-tomato/source/blender/editors/animation/anim_filter.c
    branches/soc-2011-tomato/source/blender/editors/include/UI_resources.h
    branches/soc-2011-tomato/source/blender/editors/interface/interface.c
    branches/soc-2011-tomato/source/blender/editors/interface/interface_intern.h
    branches/soc-2011-tomato/source/blender/editors/interface/resources.c
    branches/soc-2011-tomato/source/blender/editors/object/object_modifier.c
    branches/soc-2011-tomato/source/blender/editors/sculpt_paint/paint_cursor.c
    branches/soc-2011-tomato/source/blender/makesdna/DNA_userdef_types.h
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_access.c
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_tracking.c
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_userdef.c
    branches/soc-2011-tomato/source/blender/modifiers/intern/MOD_cloth.c
    branches/soc-2011-tomato/source/blender/modifiers/intern/MOD_meshcache_pc2.c
    branches/soc-2011-tomato/source/blenderplayer/bad_level_call_stubs/stubs.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-55059
   + /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-55079

Modified: branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_dopesheet.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_dopesheet.py	2013-03-06 18:01:24 UTC (rev 55079)
+++ branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_dopesheet.py	2013-03-06 18:17:01 UTC (rev 55080)
@@ -29,7 +29,6 @@
 def dopesheet_filter(layout, context, genericFiltersOnly=False):
     dopesheet = context.space_data.dopesheet
     is_nla = context.area.type == 'NLA_EDITOR'
-    is_drivers = (context.area.type == 'GRAPH_EDITOR' and context.space_data.mode == 'DRIVERS')
 
     row = layout.row(align=True)
     row.prop(dopesheet, "show_only_selected", text="")
@@ -37,8 +36,7 @@
 
     if is_nla:
         row.prop(dopesheet, "show_missing_nla", text="")
-
-    if is_drivers:
+    else: # graph and dopesheet editors - F-Curves and drivers only
         row.prop(dopesheet, "show_only_errors", text="")
 
     if not genericFiltersOnly:

Modified: branches/soc-2011-tomato/source/blender/blenkernel/BKE_DerivedMesh.h
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/BKE_DerivedMesh.h	2013-03-06 18:01:24 UTC (rev 55079)
+++ branches/soc-2011-tomato/source/blender/blenkernel/BKE_DerivedMesh.h	2013-03-06 18:17:01 UTC (rev 55080)
@@ -608,7 +608,7 @@
                          float *weights, int count, int dest_index);
 
 /* Temporary? A function to give a colorband to derivedmesh for vertexcolor ranges */
-void vDM_ColorBand_store(struct ColorBand *coba);
+void vDM_ColorBand_store(const struct ColorBand *coba, const char alert_color[4]);
 
 /** Simple function to get me->totvert amount of vertices/normals,
  * correctly deformed and subsurfered. Needed especially when vertexgroups are involved.

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/DerivedMesh.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/DerivedMesh.c	2013-03-06 18:01:24 UTC (rev 55079)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/DerivedMesh.c	2013-03-06 18:17:01 UTC (rev 55080)
@@ -1025,12 +1025,18 @@
 	CALC_WP_AUTO_NORMALIZE      = (1 << 4)
 };
 
-static void weightpaint_color(unsigned char r_col[4], ColorBand *coba, const float input)
+typedef struct DMWeightColorInfo {
+	const ColorBand *coba;
+	const char *alert_color;
+} DMWeightColorInfo;
+
+
+static void weightpaint_color(unsigned char r_col[4], DMWeightColorInfo *dm_wcinfo, const float input)
 {
 	float colf[4];
 
-	if (coba) {
-		do_colorband(coba, input, colf);
+	if (dm_wcinfo->coba) {
+		do_colorband(dm_wcinfo->coba, input, colf);
 	}
 	else {
 		weight_to_rgb(colf, input);
@@ -1047,17 +1053,19 @@
 
 static void calc_weightpaint_vert_color(
         unsigned char r_col[4],
-        MDeformVert *dv, ColorBand *coba,
+        MDeformVert *dv, 
+        DMWeightColorInfo *dm_wcinfo,
         const int defbase_tot, const int defbase_act,
         const char *defbase_sel, const int defbase_sel_tot,
         const int draw_flag)
 {
 	float input = 0.0f;
 	
-	bool make_black = false;
+	bool show_alert_color = false;
 
 	if ((defbase_sel_tot > 1) && (draw_flag & CALC_WP_MULTIPAINT)) {
-		int was_a_nonzero = FALSE;
+		/* Multi-Paint feature */
+		bool was_a_nonzero = false;
 		unsigned int i;
 
 		MDeformWeight *dw = dv->dw;
@@ -1068,15 +1076,15 @@
 				if (defbase_sel[dw->def_nr]) {
 					if (dw->weight) {
 						input += dw->weight;
-						was_a_nonzero = TRUE;
+						was_a_nonzero = true;
 					}
 				}
 			}
 		}
 
 		/* make it black if the selected groups have no weight on a vertex */
-		if (was_a_nonzero == FALSE) {
-			make_black = true;
+		if (was_a_nonzero == false) {
+			show_alert_color = true;
 		}
 		else if ((draw_flag & CALC_WP_AUTO_NORMALIZE) == FALSE) {
 			input /= defbase_sel_tot; /* get the average */
@@ -1088,33 +1096,32 @@
 
 		if (draw_flag & CALC_WP_GROUP_USER_ACTIVE) {
 			if (input == 0.0f) {
-				make_black = true;
+				show_alert_color = true;
 			}
 		}
 		else if (draw_flag & CALC_WP_GROUP_USER_ALL) {
 			if (input == 0.0f) {
-				make_black = defvert_is_weight_zero(dv, defbase_tot);
+				show_alert_color = defvert_is_weight_zero(dv, defbase_tot);
 			}
 		}
 	}
 
-	if (make_black) { /* TODO, theme color */
-		r_col[3] = 255;
-		r_col[2] = 0;
-		r_col[1] = 0;
-		r_col[0] = 0;
+	if (show_alert_color == false) {
+		CLAMP(input, 0.0f, 1.0f);
+		weightpaint_color(r_col, dm_wcinfo, input);
 	}
 	else {
-		CLAMP(input, 0.0f, 1.0f);
-		weightpaint_color(r_col, coba, input);
+		copy_v3_v3_char((char *)r_col, dm_wcinfo->alert_color);
+		r_col[3] = 255;
 	}
 }
 
-static ColorBand *stored_cb = NULL;
+static DMWeightColorInfo dm_wcinfo;
 
-void vDM_ColorBand_store(ColorBand *coba)
+void vDM_ColorBand_store(const ColorBand *coba, const char alert_color[4])
 {
-	stored_cb = coba;
+	dm_wcinfo.coba        = coba;
+	dm_wcinfo.alert_color = alert_color;
 }
 
 /* return an array of vertex weight colors, caller must free.
@@ -1122,7 +1129,7 @@
  * note that we could save some memory and allocate RGB only but then we'd need to
  * re-arrange the colors when copying to the face since MCol has odd ordering,
  * so leave this as is - campbell */
-static unsigned char *calc_weightpaint_vert_array(Object *ob, DerivedMesh *dm, int const draw_flag, ColorBand *coba)
+static unsigned char *calc_weightpaint_vert_array(Object *ob, DerivedMesh *dm, int const draw_flag, DMWeightColorInfo *dm_wcinfo)
 {
 	MDeformVert *dv = DM_get_vert_data_layer(dm, CD_MDEFORMVERT);
 	int numVerts = dm->getNumVerts(dm);
@@ -1144,7 +1151,7 @@
 		}
 
 		for (i = numVerts; i != 0; i--, wc += 4, dv++) {
-			calc_weightpaint_vert_color(wc, dv, coba, defbase_tot, defbase_act, defbase_sel, defbase_sel_tot, draw_flag);
+			calc_weightpaint_vert_color(wc, dv, dm_wcinfo, defbase_tot, defbase_act, defbase_sel, defbase_sel_tot, draw_flag);
 		}
 
 		if (defbase_sel) {
@@ -1157,7 +1164,7 @@
 			col_i = 0;
 		}
 		else {
-			weightpaint_color((unsigned char *)&col_i, coba, 0.0f);
+			weightpaint_color((unsigned char *)&col_i, dm_wcinfo, 0.0f);
 		}
 		fill_vn_i((int *)wtcol_v, numVerts, col_i);
 	}
@@ -1185,7 +1192,6 @@
 void DM_update_weight_mcol(Object *ob, DerivedMesh *dm, int const draw_flag,
                            float *weights, int num, const int *indices)
 {
-	ColorBand *coba = stored_cb; /* warning, not a local var */
 
 	unsigned char *wtcol_v;
 	unsigned char(*wtcol_l)[4] = CustomData_get_layer(dm->getLoopDataLayout(dm), CD_PREVIEW_MLOOPCOL);
@@ -1216,7 +1222,7 @@
 
 	/* No weights given, take them from active vgroup(s). */
 	else
-		wtcol_v = calc_weightpaint_vert_array(ob, dm, draw_flag, coba);
+		wtcol_v = calc_weightpaint_vert_array(ob, dm, draw_flag, &dm_wcinfo);
 
 	/* now add to loops, so the data can be passed through the modifier stack */
 	/* If no CD_PREVIEW_MLOOPCOL existed yet, we have to add a new one! */

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/customdata.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/customdata.c	2013-03-06 18:01:24 UTC (rev 55079)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/customdata.c	2013-03-06 18:17:01 UTC (rev 55080)
@@ -1169,7 +1169,7 @@
     CD_MASK_MSTICKY | CD_MASK_MDEFORMVERT | CD_MASK_MTFACE | CD_MASK_MCOL |
     CD_MASK_PROP_FLT | CD_MASK_PROP_INT | CD_MASK_PROP_STR | CD_MASK_MDISPS |
     CD_MASK_MLOOPUV | CD_MASK_MLOOPCOL | CD_MASK_MPOLY | CD_MASK_MLOOP |
-    CD_MASK_MTEXPOLY | CD_MASK_NORMAL | CD_MASK_RECAST | CD_MASK_PAINT_MASK |
+    CD_MASK_MTEXPOLY | CD_MASK_RECAST | CD_MASK_PAINT_MASK |
     CD_MASK_GRID_PAINT_MASK | CD_MASK_MVERT_SKIN;
 const CustomDataMask CD_MASK_EDITMESH =
     CD_MASK_MSTICKY | CD_MASK_MDEFORMVERT | CD_MASK_MTFACE | CD_MASK_MLOOPUV |

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c	2013-03-06 18:01:24 UTC (rev 55079)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c	2013-03-06 18:17:01 UTC (rev 55080)
@@ -1189,6 +1189,7 @@
 	object->keyframe2 = 30;
 
 	BKE_tracking_object_unique_name(tracking, object);
+	BKE_tracking_dopesheet_tag_update(tracking);
 
 	return object;
 }
@@ -1223,6 +1224,9 @@
 		tracking->objectnr = index - 1;
 	else
 		tracking->objectnr = 0;
+
+	BKE_tracking_dopesheet_tag_update(tracking);
+
 	return TRUE;
 }
 
@@ -1446,7 +1450,7 @@
 	camera_intrinsics_options->k3 = camera->k3;
 
 	camera_intrinsics_options->image_width = calibration_width;
-	camera_intrinsics_options->image_height = (double) calibration_height * aspy;
+	camera_intrinsics_options->image_height = (double) (calibration_height * aspy);
 }
 #endif
 
@@ -1594,8 +1598,8 @@
 
 	libmv_InvertIntrinsics(&camera_intrinsics_options, x, y, &x, &y);
 
-	r_co[0] = x * camera->focal + camera->principal[0];
-	r_co[1] = y * camera->focal + camera->principal[1] * aspy;
+	r_co[0] = (float)x * camera->focal + camera->principal[0];
+	r_co[1] = (float)y * camera->focal + camera->principal[1] * aspy;
 #else
 	(void) camera;
 	(void) co;
@@ -1730,14 +1734,14 @@
 		int a;
 
 		for (a = 0; a < 5; a++) {
-			src_pixel_x[a] += ((track->offset[0] * frame_width) - ((int) (track->offset[0] * frame_width)));
-			src_pixel_y[a] += ((track->offset[1] * frame_height) - ((int) (track->offset[1] * frame_height)));

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list