[Bf-blender-cvs] [dbe1b07e058] master: Cleanup: right shift

Campbell Barton noreply at git.blender.org
Mon Jul 2 18:46:07 CEST 2018


Commit: dbe1b07e058db33a9e806d8e9808463d563d4aa5
Author: Campbell Barton
Date:   Mon Jul 2 18:45:26 2018 +0200
Branches: master
https://developer.blender.org/rBdbe1b07e058db33a9e806d8e9808463d563d4aa5

Cleanup: right shift

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

M	source/blender/editors/sculpt_paint/paint_cursor.c
M	source/blender/editors/sculpt_paint/paint_curve.c
M	source/blender/editors/sculpt_paint/paint_hide.c
M	source/blender/editors/sculpt_paint/paint_image.c
M	source/blender/editors/sculpt_paint/paint_image_2d.c
M	source/blender/editors/sculpt_paint/paint_image_proj.c
M	source/blender/editors/sculpt_paint/paint_image_undo.c
M	source/blender/editors/sculpt_paint/paint_intern.h
M	source/blender/editors/sculpt_paint/paint_mask.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_utils.c
M	source/blender/editors/sculpt_paint/paint_vertex.c
M	source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c

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

diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index 769f6116dc6..f503ab37230 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -257,9 +257,10 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima
 
 	int size;
 	bool refresh;
-	eOverlayControlFlags invalid = (primary) ? (overlay_flags & PAINT_INVALID_OVERLAY_TEXTURE_PRIMARY) :
-	                                          (overlay_flags & PAINT_INVALID_OVERLAY_TEXTURE_SECONDARY);
-
+	eOverlayControlFlags invalid = (
+	        (primary) ?
+	        (overlay_flags & PAINT_INVALID_OVERLAY_TEXTURE_PRIMARY) :
+	        (overlay_flags & PAINT_INVALID_OVERLAY_TEXTURE_SECONDARY));
 	target = (primary) ? &primary_snap : &secondary_snap;
 
 	refresh =
@@ -495,9 +496,10 @@ static int load_tex_cursor(Brush *br, ViewContext *vc, float zoom)
 
 
 
-static int project_brush_radius(ViewContext *vc,
-                                float radius,
-                                const float location[3])
+static int project_brush_radius(
+        ViewContext *vc,
+        float radius,
+        const float location[3])
 {
 	float view[3], nonortho[3], ortho[3], offset[3], p1[2], p2[2];
 
@@ -568,10 +570,8 @@ static bool sculpt_get_brush_geometry(
 	if (hit) {
 		Brush *brush = BKE_paint_brush(paint);
 
-		*pixel_radius =
-		        project_brush_radius(vc,
-		                             BKE_brush_unprojected_radius_get(scene, brush),
-		                             location);
+		*pixel_radius = project_brush_radius(
+		        vc, BKE_brush_unprojected_radius_get(scene, brush), location);
 
 		if (*pixel_radius == 0)
 			*pixel_radius = BKE_brush_size_get(scene, brush);
@@ -590,15 +590,18 @@ static bool sculpt_get_brush_geometry(
 
 /* Draw an overlay that shows what effect the brush's texture will
  * have on brush strength */
-static void paint_draw_tex_overlay(UnifiedPaintSettings *ups, Brush *brush,
-                                     ViewContext *vc, int x, int y, float zoom, bool col, bool primary)
+static void paint_draw_tex_overlay(
+        UnifiedPaintSettings *ups, Brush *brush,
+        ViewContext *vc, int x, int y, float zoom, bool col, bool primary)
 {
 	rctf quad;
 	/* check for overlay mode */
 
 	MTex *mtex = (primary) ? &brush->mtex : &brush->mask_mtex;
-	bool valid = (primary) ? (brush->overlay_flags & BRUSH_OVERLAY_PRIMARY) != 0 :
-	                         (brush->overlay_flags & BRUSH_OVERLAY_SECONDARY) != 0;
+	bool valid = (
+	        (primary) ?
+	        (brush->overlay_flags & BRUSH_OVERLAY_PRIMARY) != 0 :
+	        (brush->overlay_flags & BRUSH_OVERLAY_SECONDARY) != 0);
 	int overlay_alpha = (primary) ? brush->texture_overlay_alpha : brush->mask_overlay_alpha;
 
 	if (!(mtex->tex) || !((mtex->brush_map_mode == MTEX_MAP_MODE_STENCIL) ||
@@ -709,8 +712,9 @@ static void paint_draw_tex_overlay(UnifiedPaintSettings *ups, Brush *brush,
 
 /* Draw an overlay that shows what effect the brush's texture will
  * have on brush strength */
-static void paint_draw_cursor_overlay(UnifiedPaintSettings *ups, Brush *brush,
-                                      ViewContext *vc, int x, int y, float zoom)
+static void paint_draw_cursor_overlay(
+        UnifiedPaintSettings *ups, Brush *brush,
+        ViewContext *vc, int x, int y, float zoom)
 {
 	rctf quad;
 	/* check for overlay mode */
@@ -779,8 +783,9 @@ static void paint_draw_cursor_overlay(UnifiedPaintSettings *ups, Brush *brush,
 	}
 }
 
-static void paint_draw_alpha_overlay(UnifiedPaintSettings *ups, Brush *brush,
-                                     ViewContext *vc, int x, int y, float zoom, ePaintMode mode)
+static void paint_draw_alpha_overlay(
+        UnifiedPaintSettings *ups, Brush *brush,
+        ViewContext *vc, int x, int y, float zoom, ePaintMode mode)
 {
 	/* color means that primary brush texture is colured and secondary is used for alpha/mask control */
 	bool col = ELEM(mode, ePaintTextureProjective, ePaintTexture2D, ePaintVertex) ? true : false;
@@ -951,8 +956,9 @@ static void paint_draw_curve_cursor(Brush *brush)
 
 /* Special actions taken when paint cursor goes over mesh */
 /* TODO: sculpt only for now */
-static void paint_cursor_on_hit(UnifiedPaintSettings *ups, Brush *brush, ViewContext *vc,
-                                const float location[3])
+static void paint_cursor_on_hit(
+        UnifiedPaintSettings *ups, Brush *brush, ViewContext *vc,
+        const float location[3])
 {
 	float unprojected_radius, projected_radius;
 
@@ -969,8 +975,8 @@ static void paint_cursor_on_hit(UnifiedPaintSettings *ups, Brush *brush, ViewCon
 		}
 
 		/* convert brush radius from 2D to 3D */
-		unprojected_radius = paint_calc_object_space_radius(vc, location,
-		                                                    projected_radius);
+		unprojected_radius = paint_calc_object_space_radius(
+		        vc, location, projected_radius);
 
 		/* scale 3D brush radius by pressure */
 		if (ups->stroke_active && BKE_brush_use_size_pressure(vc->scene, brush))
diff --git a/source/blender/editors/sculpt_paint/paint_curve.c b/source/blender/editors/sculpt_paint/paint_curve.c
index 8d31ad19a99..0e56a1187e3 100644
--- a/source/blender/editors/sculpt_paint/paint_curve.c
+++ b/source/blender/editors/sculpt_paint/paint_curve.c
@@ -603,8 +603,9 @@ static int paintcurve_slide_modal(bContext *C, wmOperator *op, const wmEvent *ev
 		{
 			ARegion *ar = CTX_wm_region(C);
 			wmWindow *window = CTX_wm_window(C);
-			float diff[2] = {event->mval[0] - psd->initial_loc[0],
-			                 event->mval[1] - psd->initial_loc[1]};
+			float diff[2] = {
+				event->mval[0] - psd->initial_loc[0],
+				event->mval[1] - psd->initial_loc[1]};
 			if (psd->select == 1) {
 				int i;
 				for (i = 0; i < 3; i++)
diff --git a/source/blender/editors/sculpt_paint/paint_hide.c b/source/blender/editors/sculpt_paint/paint_hide.c
index 0bec71f0566..01a54e4360d 100644
--- a/source/blender/editors/sculpt_paint/paint_hide.c
+++ b/source/blender/editors/sculpt_paint/paint_hide.c
@@ -71,10 +71,11 @@
 #include <assert.h>
 
 /* return true if the element should be hidden/shown */
-static bool is_effected(PartialVisArea area,
-                        float planes[4][4],
-                        const float co[3],
-                        const float mask)
+static bool is_effected(
+        PartialVisArea area,
+        float planes[4][4],
+        const float co[3],
+        const float mask)
 {
 	if (area == PARTIALVIS_ALL)
 		return 1;
@@ -88,12 +89,13 @@ static bool is_effected(PartialVisArea area,
 	}
 }
 
-static void partialvis_update_mesh(Object *ob,
-                                   PBVH *pbvh,
-                                   PBVHNode *node,
-                                   PartialVisAction action,
-                                   PartialVisArea area,
-                                   float planes[4][4])
+static void partialvis_update_mesh(
+        Object *ob,
+        PBVH *pbvh,
+        PBVHNode *node,
+        PartialVisAction action,
+        PartialVisArea area,
+        float planes[4][4])
 {
 	Mesh *me = ob->data;
 	MVert *mvert;
@@ -133,12 +135,13 @@ static void partialvis_update_mesh(Object *ob,
 
 /* Hide or show elements in multires grids with a special GridFlags
  * customdata layer. */
-static void partialvis_update_grids(Object *ob,
-                                    PBVH *pbvh,
-                                    PBVHNode *node,
-                                    PartialVisAction action,
-                                    PartialVisArea area,
-                                    float planes[4][4])
+static void partialvis_update_grids(
+        Object *ob,
+        PBVH *pbvh,
+        PBVHNode *node,
+        PartialVisAction action,
+        PartialVisArea area,
+        float planes[4][4])
 {
 	CCGElem **grids;
 	CCGKey key;
@@ -148,9 +151,10 @@ static void partialvis_update_grids(Object *ob,
 
 
 	/* get PBVH data */
-	BKE_pbvh_node_get_grids(pbvh, node,
-	                        &grid_indices, &totgrid, NULL, NULL,
-	                        &grids);
+	BKE_pbvh_node_get_grids(
+	        pbvh, node,
+	        &grid_indices, &totgrid, NULL, NULL,
+	        &grids);
 	grid_hidden = BKE_pbvh_grid_hidden(pbvh);
 	BKE_pbvh_get_grid_key(pbvh, &key);
 
@@ -165,8 +169,9 @@ static void partialvis_update_grids(Object *ob,
 			switch (action) {
 				case PARTIALVIS_HIDE:
 					/* create grid flags data */
-					gh = grid_hidden[g] = BLI_BITMAP_NEW(key.grid_area,
-					                                     "partialvis_update_grids");
+					gh = grid_hidden[g] = BLI_BITMAP_NEW(
+					        key.grid_area,
+					        "partialvis_update_grids");
 					break;
 				case PARTIALVIS_SHOW:
 					/* entire grid is visible, nothing to show */
@@ -192,8 +197,9 @@ static void partialvis_update_grids(Object *ob,
 				/* skip grid element if not in the effected area */
 				if (is_effected(area, planes, co, mask)) {
 					/* set or clear the hide flag */
-					BLI_BITMAP_SET(gh, y * key.grid_size + x,
-					                  action == PARTIALVIS_HIDE);
+					BLI_BITMAP_SET(
+					        gh, y * key.grid_size + x,
+					        action == PARTIALVIS_HIDE);
 
 					any_changed = true;
 				}
@@ -222,21 +228,21 @@ static void partialvis_update_grids(Object *ob,
 	}
 }
 
-static void partialvis_update_bmesh_verts(BMesh *bm,
-                                          GSet *verts,
-                                          PartialVisAction action,
-                                          PartialVisArea area,
-                                          float planes[4][4],
-                                          bool *any_changed,
-                                          bool *any_visible)
+static void partialvis_update_bmesh_verts(
+        BMesh *bm,
+        GSet *verts,
+        PartialVisAction action,
+        PartialVisArea area,
+        float planes[4][4],
+        bool *any_changed,
+        bool *any_visible)
 {
 	GSetIterator gs_iter;
 
 	GSET_ITER (gs_iter, verts) {
 		BMVert *v = BLI_gsetIterator_getKey(&gs_iter);
-		float *vmask = CustomData_bmesh_get(&bm->vdata,
-		  

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list