[Bf-blender-cvs] [5dde38214fe] refactor-mesh-uv-map-generic: Cleanup: clang-format
Martijn Versteegh
noreply at git.blender.org
Thu Nov 24 21:36:37 CET 2022
Commit: 5dde38214fe51fce52d2d72b92918816cdaff91a
Author: Martijn Versteegh
Date: Thu Nov 24 21:36:11 2022 +0100
Branches: refactor-mesh-uv-map-generic
https://developer.blender.org/rB5dde38214fe51fce52d2d72b92918816cdaff91a
Cleanup: clang-format
===================================================================
M source/blender/bmesh/intern/bmesh_mesh_convert.cc
M source/blender/draw/intern/draw_manager_data.cc
M source/blender/editors/sculpt_paint/paint_image_proj.cc
M source/blender/editors/uvedit/uvedit_ops.c
M source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_ico_sphere.cc
M source/blender/python/bmesh/bmesh_py_types_customdata.c
===================================================================
diff --git a/source/blender/bmesh/intern/bmesh_mesh_convert.cc b/source/blender/bmesh/intern/bmesh_mesh_convert.cc
index 08d971f48be..58ae011e093 100644
--- a/source/blender/bmesh/intern/bmesh_mesh_convert.cc
+++ b/source/blender/bmesh/intern/bmesh_mesh_convert.cc
@@ -151,33 +151,33 @@ void BM_mesh_bm_from_me(BMesh *bm, const Mesh *me, const struct BMeshFromMeshPar
blender::Vector<std::string> temporary_layers_to_delete;
- for (size_t l = 0; l < CustomData_number_of_layers(&mesh_ldata, CD_PROP_FLOAT2); l++)
- {
+ for (size_t l = 0; l < CustomData_number_of_layers(&mesh_ldata, CD_PROP_FLOAT2); l++) {
char name[MAX_CUSTOMDATA_LAYER_NAME];
- get_uv_map_vert_selection_name(CustomData_get_layer_name(&mesh_ldata, CD_PROP_FLOAT2, l), name);
- if (CustomData_get_named_layer_index(&mesh_ldata, CD_PROP_BOOL, name) < 0)
- {
- CustomData_add_layer_named(&mesh_ldata, CD_PROP_BOOL, CD_SET_DEFAULT, nullptr, me->totloop, name);
- temporary_layers_to_delete.append(std::string(name));
+ get_uv_map_vert_selection_name(CustomData_get_layer_name(&mesh_ldata, CD_PROP_FLOAT2, l),
+ name);
+ if (CustomData_get_named_layer_index(&mesh_ldata, CD_PROP_BOOL, name) < 0) {
+ CustomData_add_layer_named(
+ &mesh_ldata, CD_PROP_BOOL, CD_SET_DEFAULT, nullptr, me->totloop, name);
+ temporary_layers_to_delete.append(std::string(name));
}
- get_uv_map_edge_selection_name(CustomData_get_layer_name(&mesh_ldata, CD_PROP_FLOAT2, l), name);
- if (CustomData_get_named_layer_index(&mesh_ldata, CD_PROP_BOOL, name) < 0)
- {
- CustomData_add_layer_named(&mesh_ldata, CD_PROP_BOOL, CD_SET_DEFAULT, nullptr, me->totloop, name);
- temporary_layers_to_delete.append(std::string(name));
+ get_uv_map_edge_selection_name(CustomData_get_layer_name(&mesh_ldata, CD_PROP_FLOAT2, l),
+ name);
+ if (CustomData_get_named_layer_index(&mesh_ldata, CD_PROP_BOOL, name) < 0) {
+ CustomData_add_layer_named(
+ &mesh_ldata, CD_PROP_BOOL, CD_SET_DEFAULT, nullptr, me->totloop, name);
+ temporary_layers_to_delete.append(std::string(name));
}
get_uv_map_pin_name(CustomData_get_layer_name(&mesh_ldata, CD_PROP_FLOAT2, l), name);
- if (CustomData_get_named_layer_index(&mesh_ldata, CD_PROP_BOOL, name) < 0)
- {
- CustomData_add_layer_named(&mesh_ldata, CD_PROP_BOOL, CD_SET_DEFAULT, nullptr, me->totloop, name);
- temporary_layers_to_delete.append(std::string(name));
+ if (CustomData_get_named_layer_index(&mesh_ldata, CD_PROP_BOOL, name) < 0) {
+ CustomData_add_layer_named(
+ &mesh_ldata, CD_PROP_BOOL, CD_SET_DEFAULT, nullptr, me->totloop, name);
+ temporary_layers_to_delete.append(std::string(name));
}
}
BLI_SCOPED_DEFER([&]() {
- for (auto n : temporary_layers_to_delete)
- {
- CustomData_free_layer_named(&mesh_ldata, n.c_str(), me->totloop);
+ for (auto n : temporary_layers_to_delete) {
+ CustomData_free_layer_named(&mesh_ldata, n.c_str(), me->totloop);
}
MEM_SAFE_FREE(mesh_vdata.layers);
diff --git a/source/blender/draw/intern/draw_manager_data.cc b/source/blender/draw/intern/draw_manager_data.cc
index b398acd9aab..dfbe8355cb3 100644
--- a/source/blender/draw/intern/draw_manager_data.cc
+++ b/source/blender/draw/intern/draw_manager_data.cc
@@ -695,7 +695,7 @@ static void drw_call_obinfos_init(DRWObjectInfos *ob_infos, Object *ob)
drw_call_calc_orco(ob, ob_infos->orcotexfac);
/* Random float value. */
uint random = (DST.dupli_source) ?
- DST.dupli_source->random_id :
+ DST.dupli_source->random_id :
/* TODO(fclem): this is rather costly to do at runtime. Maybe we can
* put it in ob->runtime and make depsgraph ensure it is up to date. */
BLI_hash_int_2d(BLI_hash_string(ob->id.name + 2), 0);
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.cc b/source/blender/editors/sculpt_paint/paint_image_proj.cc
index 60728f26e79..45ffdcebc08 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.cc
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.cc
@@ -4087,7 +4087,8 @@ static bool proj_paint_state_mesh_eval_init(const bContext *C, ProjPaintState *p
ps->mlooptri_eval = BKE_mesh_runtime_looptri_ensure(ps->me_eval);
ps->totlooptri_eval = BKE_mesh_runtime_looptri_len(ps->me_eval);
- ps->poly_to_loop_uv = static_cast<const float (**)[2]>(MEM_mallocN(ps->totpoly_eval * sizeof(float(*)[2]), "proj_paint_mtfaces"));
+ ps->poly_to_loop_uv = static_cast<const float(**)[2]>(
+ MEM_mallocN(ps->totpoly_eval * sizeof(float(*)[2]), "proj_paint_mtfaces"));
return true;
}
@@ -4108,16 +4109,16 @@ static void proj_paint_layer_clone_init(ProjPaintState *ps, ProjPaintLayerClone
CD_PROP_FLOAT2);
ps->poly_to_loop_uv_clone = static_cast<const float(**)[2]>(
- MEM_mallocN(ps->totpoly_eval * sizeof(float (*)[2]), "proj_paint_mtfaces"));
+ MEM_mallocN(ps->totpoly_eval * sizeof(float(*)[2]), "proj_paint_mtfaces"));
if (layer_num != -1) {
- mloopuv_clone_base = static_cast<const float (*)[2](
- CustomData_get_layer_n(&ps->me_eval->ldata, CD_PROP_FLOAT2, layer_num));
+ mloopuv_clone_base = static_cast < const float(*)[2](CustomData_get_layer_n(
+ &ps->me_eval->ldata, CD_PROP_FLOAT2, layer_num));
}
if (mloopuv_clone_base == nullptr) {
/* get active instead */
- mloopuv_clone_base = static_cast<const float (*)[2]>(
+ mloopuv_clone_base = static_cast<const float(*)[2]>(
CustomData_get_layer(&ps->me_eval->ldata, CD_PROP_FLOAT2));
}
}
@@ -4147,7 +4148,7 @@ static bool project_paint_clone_face_skip(ProjPaintState *ps,
if (ps->do_material_slots) {
if (lc->slot_clone != lc->slot_last_clone) {
if (!lc->slot_clone->uvname ||
- !(lc->mloopuv_clone_base = static_cast<const float (*)[2]>(CustomData_get_layer_named(
+ !(lc->mloopuv_clone_base = static_cast<const float(*)[2]>(CustomData_get_layer_named(
&ps->me_eval->ldata, CD_PROP_FLOAT2, lc->slot_clone->uvname)))) {
lc->mloopuv_clone_base = static_cast<const float(*)[2]>(
CustomData_get_layer(&ps->me_eval->ldata, CD_PROP_FLOAT2));
@@ -4318,14 +4319,17 @@ static void project_paint_prepare_all_faces(ProjPaintState *ps,
slot = project_paint_face_paint_slot(ps, tri_index);
/* all faces should have a valid slot, reassert here */
if (slot == nullptr) {
- mloopuv_base = static_cast<const float (*)[2]>(CustomData_get_layer(&ps->me_eval->ldata, CD_PROP_FLOAT2));
+ mloopuv_base = static_cast<const float(*)[2]>(
+ CustomData_get_layer(&ps->me_eval->ldata, CD_PROP_FLOAT2));
tpage = ps->canvas_ima;
}
else {
if (slot != slot_last) {
- if (!slot->uvname || !(mloopuv_base = static_cast<const float (*)[2]>(CustomData_get_layer_named(
- &ps->me_eval->ldata, CD_PROP_FLOAT2, slot->uvname)))) {
- mloopuv_base = static_cast<const float (*)[2]>(CustomData_get_layer(&ps->me_eval->ldata, CD_PROP_FLOAT2));
+ if (!slot->uvname ||
+ !(mloopuv_base = static_cast<const float(*)[2]>(CustomData_get_layer_named(
+ &ps->me_eval->ldata, CD_PROP_FLOAT2, slot->uvname)))) {
+ mloopuv_base = static_cast<const float(*)[2]>(
+ CustomData_get_layer(&ps->me_eval->ldata, CD_PROP_FLOAT2));
}
slot_last = slot;
}
@@ -4501,13 +4505,14 @@ static void project_paint_begin(const bContext *C,
// int layer_num = CustomData_get_stencil_layer(&ps->me_eval->ldata, CD_PROP_FLOAT2);
int layer_num = CustomData_get_stencil_layer(&((Mesh *)ps->ob->data)->ldata, CD_PROP_FLOAT2);
if (layer_num != -1) {
- ps->mloopuv_stencil_eval = static_cast<const float(*)[2]>(CustomData_get_layer_n(
- &ps->me_eval->ldata, CD_PROP_FLOAT2, layer_num));
+ ps->mloopuv_stencil_eval = static_cast<const float(*)[2]>(
+ CustomData_get_layer_n(&ps->me_eval->ldata, CD_PROP_FLOAT2, layer_num));
}
if (ps->mloopuv_stencil_eval == nullptr) {
/* get active instead */
- ps->mloopuv_stencil_eval = static_cast<const float (*)[2]>(CustomData_get_layer(&ps->me_eval->ldata, CD_PROP_FLOAT2));
+ ps->mloopuv_stencil_eval = static_cast<const float(*)[2]>(
+ CustomData_get_layer(&ps->me_eval->ldata, CD_PROP_FLOAT2));
}
if (ps->do_stencil_brush) {
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index ae8aba5f5aa..e117e57054a 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -1414,11 +1414,9 @@ static void UV_OT_pin(wmOperatorType *ot)
/* check if we are selected or unselected based on 'bool_test' arg,
* needed for select swap support */
-#define UV_VERT_SEL_TEST(l, bool_test) \
- (BM_ELEM_CD_GET_BOOL(l, offsets.select_vert) == bool_test)
+#define UV_VERT_SEL_TEST(l, bool_test) (BM_ELEM_CD_GET_BOOL(l, offsets.select_vert) == bool_test)
-#define UV_EDGE_SEL_TEST(l, bool_test) \
- (BM_ELEM_CD_GET_BOOL(l, offsets.select_edge) == bool_test)
+#define UV_EDGE_SEL_TEST(l, bool_test) (BM_ELEM_CD_GET_BOOL(l, offsets.select_edge) == bool_test)
/* is every UV vert selected or unselected depending on bool_test */
static bool bm_face_is_all_uv_sel(BMFace *f, bool select_test, const BMUVOffsets offsets)
diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_ico_sphere.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_ico_sphere.cc
index 3e8de937379..89945fdf87a 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_ico_sphere.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_ico_sphere.cc
@@ -38,7 +38,8 @@ static Mesh *create_ico_sphere_mesh(const int subdivisions, const float radius)
BMesh *bm = BM_mesh_create(&a
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list