[Bf-blender-cvs] [eb7b450c0c6] blender2.8: Cleanup: style

Campbell Barton noreply at git.blender.org
Fri Aug 10 00:14:13 CEST 2018


Commit: eb7b450c0c65388758fcec5764a759d3d347c314
Author: Campbell Barton
Date:   Fri Aug 10 08:10:07 2018 +1000
Branches: blender2.8
https://developer.blender.org/rBeb7b450c0c65388758fcec5764a759d3d347c314

Cleanup: style

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

M	source/blender/bmesh/intern/bmesh_mesh.c
M	source/blender/bmesh/intern/bmesh_mesh.h
M	source/blender/bmesh/operators/bmo_bevel.c
M	source/blender/bmesh/tools/bmesh_bevel.c
M	source/blender/bmesh/tools/bmesh_bevel.h
M	source/blender/draw/intern/draw_cache_impl_mesh.c
M	source/blender/editors/mesh/editmesh_bevel.c
M	source/blender/editors/mesh/editmesh_tools.c
M	source/blender/editors/transform/transform.c
M	source/blender/editors/uvedit/uvedit_smart_stitch.c
M	source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c
M	source/blender/imbuf/intern/jp2.c
M	source/blender/modifiers/intern/MOD_bevel.c
M	source/blender/modifiers/intern/MOD_weighted_normal.c

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

diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c
index 292453fac4b..a454fb7e948 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.c
+++ b/source/blender/bmesh/intern/bmesh_mesh.c
@@ -1115,7 +1115,7 @@ void BM_lnorspace_invalidate(BMesh *bm, const bool do_invalidate_all)
 				/* Note that we only handle unselected neighbor vertices here, main loop will take care of
 				* selected ones. */
 				if ((!BM_elem_flag_test(l->prev->v, BM_ELEM_SELECT)) &&
-					!BLI_BITMAP_TEST(done_verts, BM_elem_index_get(l->prev->v)))
+				    !BLI_BITMAP_TEST(done_verts, BM_elem_index_get(l->prev->v)))
 				{
 
 					BMLoop *l_prev;
@@ -1127,7 +1127,7 @@ void BM_lnorspace_invalidate(BMesh *bm, const bool do_invalidate_all)
 				}
 
 				if ((!BM_elem_flag_test(l->next->v, BM_ELEM_SELECT)) &&
-					!BLI_BITMAP_TEST(done_verts, BM_elem_index_get(l->next->v)))
+				    !BLI_BITMAP_TEST(done_verts, BM_elem_index_get(l->next->v)))
 				{
 
 					BMLoop *l_next;
@@ -1174,8 +1174,9 @@ void BM_lnorspace_rebuild(BMesh *bm, bool preserve_clnor)
 					short(*clnor)[2] = BM_ELEM_CD_GET_VOID_P(l, cd_loop_clnors_offset);
 					int l_index = BM_elem_index_get(l);
 
-					BKE_lnor_space_custom_data_to_normal(bm->lnor_spacearr->lspacearr[l_index], *clnor,
-														 oldnors[l_index]);
+					BKE_lnor_space_custom_data_to_normal(
+					        bm->lnor_spacearr->lspacearr[l_index], *clnor,
+					        oldnors[l_index]);
 				}
 			}
 		}
@@ -1194,8 +1195,9 @@ void BM_lnorspace_rebuild(BMesh *bm, bool preserve_clnor)
 				if (preserve_clnor) {
 					short(*clnor)[2] = BM_ELEM_CD_GET_VOID_P(l, cd_loop_clnors_offset);
 					int l_index = BM_elem_index_get(l);
-					BKE_lnor_space_custom_normal_to_data(bm->lnor_spacearr->lspacearr[l_index], oldnors[l_index],
-														 *clnor);
+					BKE_lnor_space_custom_normal_to_data(
+					        bm->lnor_spacearr->lspacearr[l_index], oldnors[l_index],
+					        *clnor);
 				}
 				BM_ELEM_API_FLAG_DISABLE(l, BM_LNORSPACE_UPDATE);
 			}
@@ -1401,9 +1403,10 @@ BMLoopNorEditDataArray *BM_loop_normal_editdata_array_init(BMesh *bm)
 
 	BLI_assert(bm->spacearr_dirty == 0);
 
-	BMLoopNorEditDataArray *lnors_ed_arr = MEM_mallocN(sizeof(*lnors_ed_arr), __func__);
-	lnors_ed_arr->lidx_to_lnor_editdata = MEM_callocN(sizeof(*lnors_ed_arr->lidx_to_lnor_editdata) * bm->totloop,
-													  __func__);
+	BMLoopNorEditDataArray *lnors_ed_arr = MEM_mallocN(
+	        sizeof(*lnors_ed_arr), __func__);
+	lnors_ed_arr->lidx_to_lnor_editdata = MEM_callocN(
+	        sizeof(*lnors_ed_arr->lidx_to_lnor_editdata) * bm->totloop, __func__);
 
 	if (!CustomData_has_layer(&bm->ldata, CD_CUSTOMLOOPNORMAL)) {
 		BM_data_layer_add(bm, &bm->ldata, CD_CUSTOMLOOPNORMAL);
diff --git a/source/blender/bmesh/intern/bmesh_mesh.h b/source/blender/bmesh/intern/bmesh_mesh.h
index 89077d84447..c7192590b79 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.h
+++ b/source/blender/bmesh/intern/bmesh_mesh.h
@@ -49,10 +49,10 @@ void   BM_mesh_clear(BMesh *bm);
 void BM_mesh_normals_update(BMesh *bm);
 void BM_verts_calc_normal_vcos(BMesh *bm, const float (*fnos)[3], const float (*vcos)[3], float (*vnos)[3]);
 void BM_loops_calc_normal_vcos(
-		BMesh *bm, const float(*vcos)[3], const float(*vnos)[3], const float(*pnos)[3],
-		const bool use_split_normals, const float split_angle, float(*r_lnos)[3],
-		struct MLoopNorSpaceArray *r_lnors_spacearr, short(*clnors_data)[2],
-		const int cd_loop_clnors_offset, const bool do_rebuild);
+        BMesh *bm, const float(*vcos)[3], const float(*vnos)[3], const float(*pnos)[3],
+        const bool use_split_normals, const float split_angle, float(*r_lnos)[3],
+        struct MLoopNorSpaceArray *r_lnors_spacearr, short(*clnors_data)[2],
+        const int cd_loop_clnors_offset, const bool do_rebuild);
 
 bool BM_loop_check_cyclic_smooth_fan(BMLoop *l_curr);
 void BM_lnorspacearr_store(BMesh *bm, float(*r_lnors)[3]);
diff --git a/source/blender/bmesh/operators/bmo_bevel.c b/source/blender/bmesh/operators/bmo_bevel.c
index eb299dbba60..8bc219d8421 100644
--- a/source/blender/bmesh/operators/bmo_bevel.c
+++ b/source/blender/bmesh/operators/bmo_bevel.c
@@ -66,8 +66,9 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op)
 			}
 		}
 
-		BM_mesh_bevel(bm, offset, offset_type, seg, profile, vonly, false, clamp_overlap, NULL, -1, material,
-					  loop_slide, mark_seam, mark_sharp, hnmode, op);
+		BM_mesh_bevel(
+		        bm, offset, offset_type, seg, profile, vonly, false, clamp_overlap, NULL, -1, material,
+		        loop_slide, mark_seam, mark_sharp, hnmode, op);
 
 		BMO_slot_buffer_from_enabled_hflag(bm, op, op->slots_out, "faces.out", BM_FACE, BM_ELEM_TAG);
 		BMO_slot_buffer_from_enabled_hflag(bm, op, op->slots_out, "edges.out", BM_EDGE, BM_ELEM_TAG);
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c
index 071b82afeb9..0415526574d 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -1553,28 +1553,32 @@ static void check_edge_data_seam_sharp_edges(BevVert *bv, int flag, bool neg)
 	if ((!neg && !BEV_EXTEND_EDGE_DATA_CHECK(e, flag)) || (neg && BEV_EXTEND_EDGE_DATA_CHECK(e, flag)))
 		return;
 
-	efirst = e;			/* Set efirst to this first encountered edge*/
+	/* Set efirst to this first encountered edge. */
+	efirst = e;
 
 	do {
 		int flag_count = 0;
 		EdgeHalf *ne = e->next;
 
 		while (((!neg && !BEV_EXTEND_EDGE_DATA_CHECK(ne, flag)) || (neg && BEV_EXTEND_EDGE_DATA_CHECK(ne, flag))) &&
-				ne != efirst)
+		       ne != efirst)
 		{
 			if (ne->is_bev)
 				flag_count++;
 			ne = ne->next;
 		}
 		if (ne == e || (ne == efirst && ((!neg && !BEV_EXTEND_EDGE_DATA_CHECK(efirst, flag)) ||
-										(neg && BEV_EXTEND_EDGE_DATA_CHECK(efirst, flag)))))
+		                                 (neg && BEV_EXTEND_EDGE_DATA_CHECK(efirst, flag)))))
 		{
 			break;
 		}
-		if (flag == BM_ELEM_SEAM)				/* Set seam_len / sharp_len of starting edge */
+		/* Set seam_len / sharp_len of starting edge */
+		if (flag == BM_ELEM_SEAM) {
 			e->rightv->seam_len = flag_count;
-		else if (flag == BM_ELEM_SMOOTH)
+		}
+		else if (flag == BM_ELEM_SMOOTH) {
 			e->rightv->sharp_len = flag_count;
+		}
 		e = ne;
 	} while (e != efirst);
 }
@@ -5635,7 +5639,7 @@ void BM_mesh_bevel(
         const bool vertex_only, const bool use_weights, const bool limit_offset,
         const struct MDeformVert *dvert, const int vertex_group, const int mat,
         const bool loop_slide, const bool mark_seam, const bool mark_sharp,
-		const int hnmode, void *mod_bmop_customdata)
+        const int hnmode, void *mod_bmop_customdata)
 {
 	BMIter iter;
 	BMVert *v, *v_next;
diff --git a/source/blender/bmesh/tools/bmesh_bevel.h b/source/blender/bmesh/tools/bmesh_bevel.h
index 5cf8b1e78bb..f8a77d431cc 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.h
+++ b/source/blender/bmesh/tools/bmesh_bevel.h
@@ -34,6 +34,6 @@ void BM_mesh_bevel(
         const float profile, const bool vertex_only, const bool use_weights,
         const bool limit_offset, const struct MDeformVert *dvert, const int vertex_group,
         const int mat, const bool loop_slide, const bool mark_seam, const bool mark_sharp,
-		const int hnmode, void *mod_bmop_customdata);
+        const int hnmode, void *mod_bmop_customdata);
 
 #endif /* __BMESH_BEVEL_H__ */
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index dcfb9229cc1..1cf270048e1 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -428,8 +428,9 @@ static MeshRenderData *mesh_render_data_create_ex(
 			if (is_auto_smooth) {
 				rdata->loop_normals = MEM_mallocN(sizeof(*rdata->loop_normals) * totloop, __func__);
 				int cd_loop_clnors_offset = CustomData_get_layer_index(&bm->ldata, CD_CUSTOMLOOPNORMAL);
-				BM_loops_calc_normal_vcos(bm, NULL, NULL, NULL, true, split_angle, rdata->loop_normals, NULL, NULL,
-										  cd_loop_clnors_offset, false);
+				BM_loops_calc_normal_vcos(
+				        bm, NULL, NULL, NULL, true, split_angle, rdata->loop_normals, NULL, NULL,
+				        cd_loop_clnors_offset, false);
 			}
 			rdata->loop_len = totloop;
 			bm_ensure_types |= BM_LOOP;
diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c
index 8d1832e84a4..e87abc6adf7 100644
--- a/source/blender/editors/mesh/editmesh_bevel.c
+++ b/source/blender/editors/mesh/editmesh_bevel.c
@@ -136,7 +136,7 @@ static void edbm_bevel_update_header(bContext *C, wmOperator *op)
 	}
 }
 
-static void bevel_harden_normals(BMEditMesh *em, BMOperator *bmop, float face_strength, int hnmode)
+static void bevel_harden_normals(BMEditMesh *em, BMOperator *bmop, float face_strength)
 {
 	BKE_editmesh_lnorspace_update(em);
 	BM_normals_loops_edges_tag(em->bm, true);
@@ -154,8 +154,8 @@ static void bevel_harden_normals(BMEditMesh *em, BMOperator *bmop, float face_st
 		l_cur = l_first = BM_FACE_FIRST_LOOP(f);
 		do {
 			if ((BM_elem_flag_test(l_cur->v, BM_ELEM_SELECT)) &&
-				((!BM_elem_flag_test(l_cur->e, BM_ELEM_TAG)) ||
-				(!BM_elem_flag_test(l_cur, BM_ELEM_TAG) && BM_loop_check_cyclic_smooth_fan(l_cur))))
+			    ((!BM_elem_flag_test(l_cur->e, BM_ELEM_TAG)) ||
+			     (!BM_elem_flag_test(l_cur, BM_ELEM_TAG) && BM_loop_check_cyclic_smooth_fan(l_cur))))
 			{
 				/* Both adjacent loops are sharp, set clnor to face normal */
 				if (!BM_elem_flag_test(l_cur->e, BM_ELEM_TAG) && !BM_elem_flag_test(l_cur->prev->e, BM_ELEM_TAG)) {
@@ -213,11 +213,13 @@ static void bevel_harden_normals(BMEditMesh *em, BMOperator *bmop, float face_st
 						const int l_index = BM_elem_index_get(l);
 						short *clnors = BM_ELEM_CD_GET_VOID_P(l, cd_clnors_offset);
 						if (calc_n) {
-							BKE_lnor_space_custom_normal_to_data(bm->lnor_spacearr->lspacearr[l_index], calc_n, clnors);
+							BKE_lnor_space_custom_normal_to_data(
+							        bm->lnor_spacearr->lspacearr[l_index], calc_n, clnors);
+						}
+						else {
+							BKE_lnor_space_custom_normal_to_data(
+							        bm->lnor_spacearr->lspacearr[l_index], cn_unwght, clnors);
 						}
-						else
-							BKE_lnor_space_cust

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list