diff options
Diffstat (limited to 'source/blender/bmesh/intern')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_log.c | 6 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mesh.c | 32 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mods.c | 10 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_operators.c | 6 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_polygon.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_query.c | 1 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_walkers_impl.c | 5 |
7 files changed, 35 insertions, 27 deletions
diff --git a/source/blender/bmesh/intern/bmesh_log.c b/source/blender/bmesh/intern/bmesh_log.c index 16a534b5e56..fd9439eb158 100644 --- a/source/blender/bmesh/intern/bmesh_log.c +++ b/source/blender/bmesh/intern/bmesh_log.c @@ -1125,11 +1125,9 @@ void bm_log_print(const BMLog *log, const char *description) int i; printf("%s:\n", description); - printf(" % 2d: [ initial ]%s\n", 0, - (!log->current_entry) ? current : ""); + printf(" % 2d: [ initial ]%s\n", 0, (!log->current_entry) ? current : ""); for (entry = log->entries.first, i = 1; entry; entry = entry->next, i++) { - printf(" % 2d: [%p]%s\n", i, entry, - (entry == log->current_entry) ? current : ""); + printf(" % 2d: [%p]%s\n", i, entry, (entry == log->current_entry) ? current : ""); } } #endif diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c index 8d445d428b2..3673c299a0c 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.c +++ b/source/blender/bmesh/intern/bmesh_mesh.c @@ -1026,19 +1026,24 @@ static void bm_mesh_loops_calc_normals_no_autosmooth(BMesh *bm, * Updates the loop normals of a mesh. Assumes vertex and face normals are valid (else call BM_mesh_normals_update() * first)! */ -void BM_mesh_loop_normals_update( - BMesh *bm, const bool use_split_normals, const float split_angle, float (*r_lnos)[3], - MLoopNorSpaceArray *r_lnors_spacearr, short (*clnors_data)[2], const int cd_loop_clnors_offset) +void BM_mesh_loop_normals_update(BMesh *bm, + const bool use_split_normals, + const float split_angle, + float (*r_lnos)[3], + MLoopNorSpaceArray *r_lnors_spacearr, + short (*clnors_data)[2], + const int cd_loop_clnors_offset) { const bool has_clnors = clnors_data || (cd_loop_clnors_offset != -1); if (use_split_normals) { - /* Tag smooth edges and set lnos from vnos when they might be completely smooth... + /* Tag smooth edges and set lnos from vnos when they might be completely smooth... * When using custom loop normals, disable the angle feature! */ - bm_mesh_edges_sharp_tag(bm, NULL, NULL, has_clnors ? (float)M_PI : split_angle, r_lnos); + bm_mesh_edges_sharp_tag(bm, NULL, NULL, has_clnors ? (float)M_PI : split_angle, r_lnos); - /* Finish computing lnos by accumulating face normals in each fan of faces defined by sharp edges. */ - bm_mesh_loops_calc_normals(bm, NULL, NULL, r_lnos, r_lnors_spacearr, clnors_data, cd_loop_clnors_offset); + /* Finish computing lnos by accumulating face normals in each fan of faces defined by sharp edges. */ + bm_mesh_loops_calc_normals( + bm, NULL, NULL, r_lnos, r_lnors_spacearr, clnors_data, cd_loop_clnors_offset); } else { BLI_assert(!r_lnors_spacearr); @@ -1839,8 +1844,13 @@ void BM_mesh_elem_index_validate( /* dirty may have been incorrectly set */ fprintf(stderr, - "Invalid Dirty: at %s, %s (%s), dirty flag was set but all index values are correct, '%s', '%s'\n", - location, func, type_names[i], msg_a, msg_b); + "Invalid Dirty: at %s, %s (%s), dirty flag was set but all index values are " + "correct, '%s', '%s'\n", + location, + func, + type_names[i], + msg_a, + msg_b); #endif } } @@ -1848,9 +1858,7 @@ void BM_mesh_elem_index_validate( #if 0 /* mostly annoying, even in debug mode */ # ifdef DEBUG if (is_any_error == 0) { - fprintf(stderr, - "Valid Index Success: at %s, %s, '%s', '%s'\n", - location, func, msg_a, msg_b); + fprintf(stderr, "Valid Index Success: at %s, %s, '%s', '%s'\n", location, func, msg_a, msg_b); } # endif #endif diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c index 1075b3753da..606051ebefa 100644 --- a/source/blender/bmesh/intern/bmesh_mods.c +++ b/source/blender/bmesh/intern/bmesh_mods.c @@ -531,14 +531,15 @@ BMEdge *BM_vert_collapse_edge( /* in this case we want to keep all faces and not join them, * rather just get rid of the vertex - see bug [#28645] */ - BMVert *tv = BM_edge_other_vert(e_kill, v_kill); + BMVert *tv = BM_edge_other_vert(e_kill, v_kill); if (tv) { BMEdge *e2 = bmesh_disk_edge_next(e_kill, v_kill); if (e2) { BMVert *tv2 = BM_edge_other_vert(e2, v_kill); if (tv2) { /* only action, other calls here only get the edge to return */ - e_new = bmesh_kernel_join_edge_kill_vert(bm, e_kill, v_kill, do_del, true, kill_degenerate_faces); + e_new = bmesh_kernel_join_edge_kill_vert( + bm, e_kill, v_kill, do_del, true, kill_degenerate_faces); } } } @@ -748,11 +749,12 @@ bool BM_face_validate(BMFace *face, FILE *err) } BLI_array_grow_items(verts, face->len); - BM_ITER_ELEM_INDEX (l, &iter, face, BM_LOOPS_OF_FACE, i) { + BM_ITER_ELEM_INDEX(l, &iter, face, BM_LOOPS_OF_FACE, i) + { verts[i] = l->v; if (l->e->v1 == l->e->v2) { fprintf(err, "Found bmesh edge with identical verts!\n"); - fprintf(err, " edge ptr: %p, vert: %p\n", l->e, l->e->v1); + fprintf(err, " edge ptr: %p, vert: %p\n", l->e, l->e->v1); fflush(err); ret = false; } diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c index a7783084c01..0e9b615afe7 100644 --- a/source/blender/bmesh/intern/bmesh_operators.c +++ b/source/blender/bmesh/intern/bmesh_operators.c @@ -741,7 +741,8 @@ void *bmo_slot_buffer_grow(BMesh *bm, BMOperator *op, int slot_code, int totadd) if (slot->len >= slot->size) { slot->size = (slot->size + 1 + totadd) * 2; - allocsize = BMO_OPSLOT_TYPEINFO[bmo_opdefines[op->type]->slot_types[slot_code].type] * slot->size; + allocsize = BMO_OPSLOT_TYPEINFO[bmo_opdefines[op->type]->slot_types[slot_code].type] * + slot->size; tmp = slot->data.buf; slot->data.buf = MEM_callocN(allocsize, "opslot dynamic array"); @@ -756,7 +757,8 @@ void *bmo_slot_buffer_grow(BMesh *bm, BMOperator *op, int slot_code, int totadd) slot->len += totadd; slot->size = slot->len + 2; - allocsize = BMO_OPSLOT_TYPEINFO[bmo_opdefines[op->type]->slot_types[slot_code].type] * slot->len; + allocsize = BMO_OPSLOT_TYPEINFO[bmo_opdefines[op->type]->slot_types[slot_code].type] * + slot->len; tmp = slot->data.buf; slot->data.buf = MEM_callocN(allocsize, "opslot dynamic array"); diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c index 2a734c242ba..6f363e51b49 100644 --- a/source/blender/bmesh/intern/bmesh_polygon.c +++ b/source/blender/bmesh/intern/bmesh_polygon.c @@ -1587,7 +1587,7 @@ void BM_mesh_calc_tessellation_beauty(BMesh *bm, BMLoop *(*looptris)[3], int *r_ */ #if 0 const bool split_13 = (BM_verts_calc_rotate_beauty( - l_v1->v, l_v2->v, l_v3->v, l_v4->v, 0, 0) < 0.0f); + l_v1->v, l_v2->v, l_v3->v, l_v4->v, 0, 0) < 0.0f); #else float axis_mat[3][3], v_quad[4][2]; axis_dominant_v3_to_m3(axis_mat, efa->no); diff --git a/source/blender/bmesh/intern/bmesh_query.c b/source/blender/bmesh/intern/bmesh_query.c index 98ad30b6a28..1986a1c782d 100644 --- a/source/blender/bmesh/intern/bmesh_query.c +++ b/source/blender/bmesh/intern/bmesh_query.c @@ -1917,7 +1917,6 @@ BMEdge *BM_edge_exists(BMVert *v_a, BMVert *v_b) BMIter iter; BMEdge *e; - BLI_assert(v_a != v_b); BLI_assert(v_a->head.htype == BM_VERT && v_b->head.htype == BM_VERT); diff --git a/source/blender/bmesh/intern/bmesh_walkers_impl.c b/source/blender/bmesh/intern/bmesh_walkers_impl.c index c327c10226f..0097e0a3056 100644 --- a/source/blender/bmesh/intern/bmesh_walkers_impl.c +++ b/source/blender/bmesh/intern/bmesh_walkers_impl.c @@ -209,14 +209,13 @@ static void *bmw_VertShellWalker_step(BMWalker *walker) BMW_state_remove(walker); - /* find the next edge whose other vertex has not been visite */ curedge = shellWalk.curedge; do { if (!BLI_gset_haskey(walker->visit_set, curedge)) { if (!walker->restrictflag || - (walker->restrictflag && BMO_edge_flag_test(walker->bm, curedge, walker->restrictflag))) - { + (walker->restrictflag && + BMO_edge_flag_test(walker->bm, curedge, walker->restrictflag))) { BMwShellWalker *newstate; v_old = BM_edge_other_vert(curedge, shellWalk.base); |