[Bf-blender-cvs] [176444b] soc-2013-paint: Sync with master (remove diff noise) also add WM_DRAG_NOP to show wmDragFlags use

Campbell Barton noreply at git.blender.org
Mon Jun 23 12:20:35 CEST 2014


Commit: 176444b5dac0b3b035ead4e4e7b0efdf231ceaca
Author: Campbell Barton
Date:   Mon Jun 23 20:18:02 2014 +1000
https://developer.blender.org/rB176444b5dac0b3b035ead4e4e7b0efdf231ceaca

Sync with master (remove diff noise)
also add WM_DRAG_NOP to show  wmDragFlags use

===================================================================

M	source/blender/blenkernel/BKE_brush.h
M	source/blender/blenkernel/BKE_paint.h
M	source/blender/blenkernel/intern/DerivedMesh.c
M	source/blender/blenkernel/intern/brush.c
M	source/blender/blenkernel/intern/cdderivedmesh.c
M	source/blender/blenkernel/intern/idcode.c
M	source/blender/blenkernel/intern/paint.c
M	source/blender/blenkernel/intern/subsurf_ccg.c
M	source/blender/blenlib/BLI_math_color_blend.h
M	source/blender/blenlib/intern/math_color_blend_inline.c
M	source/blender/editors/include/UI_interface.h
M	source/blender/editors/interface/interface_handlers.c
M	source/blender/editors/interface/interface_intern.h
M	source/blender/editors/interface/interface_templates.c
M	source/blender/editors/sculpt_paint/CMakeLists.txt
M	source/blender/editors/sculpt_paint/paint_image.c
M	source/blender/editors/sculpt_paint/paint_image_proj.c
M	source/blender/editors/sculpt_paint/paint_ops.c
M	source/blender/editors/sculpt_paint/paint_stroke.c
M	source/blender/editors/sculpt_paint/paint_vertex.c
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/editors/space_image/space_image.c
M	source/blender/editors/space_view3d/space_view3d.c
M	source/blender/editors/space_view3d/view3d_draw.c
M	source/blender/editors/transform/transform_conversions.c
M	source/blender/editors/transform/transform_generics.c
M	source/blender/editors/transform/transform_input.c
M	source/blender/editors/uvedit/uvedit_ops.c
M	source/blender/makesdna/DNA_brush_types.h
M	source/blender/makesdna/DNA_space_types.h
M	source/blender/makesrna/intern/rna_brush.c
M	source/blender/makesrna/intern/rna_lamp.c
M	source/blender/makesrna/intern/rna_material.c
M	source/blender/makesrna/intern/rna_sculpt_paint.c
M	source/blender/windowmanager/WM_types.h
M	source/blender/windowmanager/intern/wm_window.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_brush.h b/source/blender/blenkernel/BKE_brush.h
index 3d6de83..d487535 100644
--- a/source/blender/blenkernel/BKE_brush.h
+++ b/source/blender/blenkernel/BKE_brush.h
@@ -85,7 +85,7 @@ struct ImBuf *BKE_brush_gen_radial_control_imbuf(struct Brush *br, bool secondar
 
 float *BKE_brush_color_get(const struct Scene *scene, struct Brush *brush);
 float *BKE_brush_secondary_color_get(const struct Scene *scene, struct Brush *brush);
-void BKE_brush_color_set(struct Scene *scene, struct Brush *brush, float color[3]);
+void BKE_brush_color_set(struct Scene *scene, struct Brush *brush, const float color[3]);
 
 int  BKE_brush_size_get(const struct Scene *scene, struct Brush *brush);
 void BKE_brush_size_set(struct Scene *scene, struct Brush *brush, int value);
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index 35563d7..6cffafb 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -40,12 +40,15 @@ struct CurveMapping;
 struct MDisps;
 struct MeshElemMap;
 struct GridPaintMask;
+struct Main;
 struct MFace;
 struct MultireModifierData;
 struct MVert;
 struct Object;
 struct Paint;
 struct PaintCurve;
+struct Palette;
+struct PaletteColor;
 struct PBVH;
 struct Scene;
 struct Sculpt;
@@ -53,9 +56,6 @@ struct StrokeCache;
 struct Tex;
 struct ImagePool;
 struct UnifiedPaintSettings;
-struct Palette;
-struct PaletteColor;
-struct Main;
 struct wmOperator;
 
 enum OverlayFlags;
@@ -145,6 +145,7 @@ void paint_calculate_rake_rotation(struct UnifiedPaintSettings *ups, const float
 void paint_bucket_fill(struct bContext *C, float color[3], struct wmOperator *op);
 
 /* Session data (mode-specific) */
+
 typedef struct SculptSession {
 	/* Mesh data (not copied) can come either directly from a Mesh, or from a MultiresDM */
 	struct MultiresModifierData *multires; /* Special handling for multires meshes */
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index cc15307..1536820 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -501,8 +501,8 @@ void DM_update_materials(DerivedMesh *dm, Object *ob)
 
 	dm->mat = MEM_callocN(totmat * sizeof(*dm->mat), "DerivedMesh.mat");
 
-	for (i = 0; i < totmat - 1; i++) {
-		dm->mat[i] = give_current_material(ob, i + 1);
+	for (i = 1; i < totmat; i++) {
+		dm->mat[i] = give_current_material(ob, i);
 	}
 }
 
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 2e1ce95..a7ce754 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -90,9 +90,7 @@ static void brush_defaults(Brush *brush)
 	brush->rgb[1] = 1.0f;
 	brush->rgb[2] = 1.0f;
 
-	brush->secondary_rgb[0] = 0.0f;
-	brush->secondary_rgb[1] = 0.0f;
-	brush->secondary_rgb[2] = 0.0f;
+	zero_v3(brush->secondary_rgb);
 
 	/* BRUSH STROKE SETTINGS */
 	brush->flag |= (BRUSH_SPACE | BRUSH_SPACE_ATTEN);
@@ -800,7 +798,7 @@ float *BKE_brush_secondary_color_get(const struct Scene *scene, struct Brush *br
 	return (ups->flag & UNIFIED_PAINT_COLOR) ? ups->secondary_rgb : brush->secondary_rgb;
 }
 
-void BKE_brush_color_set(struct Scene *scene, struct Brush *brush, float color[3])
+void BKE_brush_color_set(struct Scene *scene, struct Brush *brush, const float color[3])
 {
 	UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
 
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 345a71a..b921dd1 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -680,7 +680,7 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
 	MCol *mcol;
 	int i, orig;
 	int colType, startFace = 0;
-	bool use_tface = uvflag & DM_DRAW_USE_ACTIVE_UV;
+	bool use_tface = (uvflag & DM_DRAW_USE_ACTIVE_UV) != 0;
 
 	/* double lookup */
 	const int *index_mf_to_mpoly = dm->getTessFaceDataArray(dm, CD_ORIGINDEX);
diff --git a/source/blender/blenkernel/intern/idcode.c b/source/blender/blenkernel/intern/idcode.c
index 1102b00..1b7a03e 100644
--- a/source/blender/blenkernel/intern/idcode.c
+++ b/source/blender/blenkernel/intern/idcode.c
@@ -74,7 +74,7 @@ static IDType idtypes[] = {
 	{ ID_OB,     "Object",           "objects",         IDTYPE_FLAGS_ISLINKABLE },
 	{ ID_PA,     "ParticleSettings", "particles",       0                       },
 	{ ID_PAL,    "Palettes",         "palettes",        IDTYPE_FLAGS_ISLINKABLE },
-	{ ID_PC,   "PaintCurve",       "paint_curves",    IDTYPE_FLAGS_ISLINKABLE },
+	{ ID_PC,     "PaintCurve",       "paint_curves",    IDTYPE_FLAGS_ISLINKABLE },
 	{ ID_SCE,    "Scene",            "scenes",          IDTYPE_FLAGS_ISLINKABLE },
 	{ ID_SCR,    "Screen",           "screens",         0                       },
 	{ ID_SEQ,    "Sequence",         "sequences",       0                       }, /* not actually ID data */
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index f943aa5..9666dc8 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -122,7 +122,6 @@ void BKE_paint_set_overlay_override(OverlayFlags flags)
 	}
 }
 
-
 void BKE_paint_reset_overlay_invalid(OverlayControlFlags flag)
 {
 	overlay_flags &= ~(flag);
@@ -401,7 +400,6 @@ void BKE_paint_init(Paint *p, const char col[3])
 	brush = BKE_paint_brush(p);
 	if (brush == NULL)
 		brush = BKE_brush_add(G.main, "Brush");
-
 	BKE_paint_brush_set(p, brush);
 
 	memcpy(p->paint_cursor_col, col, 3);
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index d995371..9f74809 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -2356,11 +2356,13 @@ static void ccgDM_drawFacesTex_common(DerivedMesh *dm,
 						tf_base = CustomData_get_layer_named(&dm->faceData, CD_MTFACE,
 						                                     dm->mat[mat_nr]->texpaintslot[dm->mat[mat_nr]->paint_active_slot].uvname);
 					}
-					else
+					else {
 						tf_base = CustomData_get_layer(&dm->faceData, CD_MTFACE);
+					}
 				}
-				else
+				else {
 					tf_base = CustomData_get_layer(&dm->faceData, CD_MTFACE);
+				}
 
 				mat_nr_cache = mat_nr;
 			}
diff --git a/source/blender/blenlib/BLI_math_color_blend.h b/source/blender/blenlib/BLI_math_color_blend.h
index 35630e8..2535a31 100644
--- a/source/blender/blenlib/BLI_math_color_blend.h
+++ b/source/blender/blenlib/BLI_math_color_blend.h
@@ -69,7 +69,6 @@ MINLINE void blend_color_luminosity_byte(unsigned char dst[4], unsigned const ch
 
 MINLINE void blend_color_interpolate_byte(unsigned char dst[4], const unsigned char src1[4], const unsigned char src2[4], float t);
 
-
 MINLINE void blend_color_mix_float(float dst[4], const float src1[4], const float src2[4]);
 MINLINE void blend_color_add_float(float dst[4], const float src1[4], const float src2[4]);
 MINLINE void blend_color_sub_float(float dst[4], const float src1[4], const float src2[4]);
diff --git a/source/blender/blenlib/intern/math_color_blend_inline.c b/source/blender/blenlib/intern/math_color_blend_inline.c
index 9613132..90321c7 100644
--- a/source/blender/blenlib/intern/math_color_blend_inline.c
+++ b/source/blender/blenlib/intern/math_color_blend_inline.c
@@ -944,9 +944,9 @@ MINLINE void blend_color_lighten_float(float dst[4], const float src1[4], const
 		const float mt = 1.0f - t;
 		const float map_alpha = src1[3] / src2[3];
 
-		dst[0] = mt * src1[0] + t *max_ff(src1[0], src2[0] *map_alpha);
-		dst[1] = mt * src1[1] + t *max_ff(src1[1], src2[1] *map_alpha);
-		dst[2] = mt * src1[2] + t *max_ff(src1[2], src2[2] *map_alpha);
+		dst[0] = mt * src1[0] + t * max_ff(src1[0], src2[0] * map_alpha);
+		dst[1] = mt * src1[1] + t * max_ff(src1[1], src2[1] * map_alpha);
+		dst[2] = mt * src1[2] + t * max_ff(src1[2], src2[2] * map_alpha);
 		dst[3] = src1[3];
 	}
 	else {
@@ -967,9 +967,9 @@ MINLINE void blend_color_darken_float(float dst[4], const float src1[4], const f
 		const float mt = 1.0f - t;
 		const float map_alpha = src1[3] / src2[3];
 
-		dst[0] = mt * src1[0] + t *min_ff(src1[0], src2[0] *map_alpha);
-		dst[1] = mt * src1[1] + t *min_ff(src1[1], src2[1] *map_alpha);
-		dst[2] = mt * src1[2] + t *min_ff(src1[2], src2[2] *map_alpha);
+		dst[0] = mt * src1[0] + t * min_ff(src1[0], src2[0] * map_alpha);
+		dst[1] = mt * src1[1] + t * min_ff(src1[1], src2[1] * map_alpha);
+		dst[2] = mt * src1[2] + t * min_ff(src1[2], src2[2] * map_alpha);
 		dst[3] = src1[3];
 	}
 	else {
@@ -1628,5 +1628,6 @@ MINLINE void blend_color_interpolate_float(float dst[4], const float src1[4], co
 }
 
 #undef EPS_SATURATION
+#undef EPS_ALPHA
 
 #endif /* __MATH_COLOR_BLEND_INLINE_C__ */
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 16c6df1..05ac127 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -443,7 +443,6 @@ void    uiButSetDragImage(uiBut *but, const char *path, int icon, struct ImBuf *
 
 bool    UI_but_active_drop_name(struct bContext *C);
 bool    UI_but_active_drop_color(struct bContext *C);
-struct uiBut  *ui_but_find_mouse_over(struct ARegion *ar, const struct wmEvent *event);
 
 void    uiButSetFlag(uiBut *but, int flag);
 void    uiButClearFlag(uiBut *but, int flag);
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 6d556ad..55b92b3 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -314,6 +314,7 @@ static bool ui_is_but_interactive(const uiBut *but, const bool labeledit);
 static bool ui_but_contains_pt(uiBut *but, float mx, float my);
 static bool ui_mouse_inside_button(ARegion *ar, uiBut *but, int x, int y);
 static uiBut *ui_but_find_mouse_over_ex(ARegion *ar, const int x, const int y, const bool labeledit);
+static uiBut *ui_but_find_mouse_over(ARegion *ar, const wmEvent 

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list