Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-08-10 01:10:07 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-08-10 01:14:22 +0300
commiteb7b450c0c65388758fcec5764a759d3d347c314 (patch)
tree8d8d593008a4449e010c019ca1608b4f1e607fc9
parent1ee93dc670556593ed9913ef97f839e423120613 (diff)
Cleanup: style
-rw-r--r--source/blender/bmesh/intern/bmesh_mesh.c21
-rw-r--r--source/blender/bmesh/intern/bmesh_mesh.h8
-rw-r--r--source/blender/bmesh/operators/bmo_bevel.c5
-rw-r--r--source/blender/bmesh/tools/bmesh_bevel.c16
-rw-r--r--source/blender/bmesh/tools/bmesh_bevel.h2
-rw-r--r--source/blender/draw/intern/draw_cache_impl_mesh.c5
-rw-r--r--source/blender/editors/mesh/editmesh_bevel.c32
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c6
-rw-r--r--source/blender/editors/transform/transform.c5
-rw-r--r--source/blender/editors/uvedit/uvedit_smart_stitch.c19
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c5
-rw-r--r--source/blender/imbuf/intern/jp2.c2
-rw-r--r--source/blender/modifiers/intern/MOD_bevel.c28
-rw-r--r--source/blender/modifiers/intern/MOD_weighted_normal.c9
14 files changed, 88 insertions, 75 deletions
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_custom_normal_to_data(bm->lnor_spacearr->lspacearr[l_index], cn_unwght,
- clnors);
}
BLI_ghash_remove(nslot->data.ghash, v_pivot, NULL, MEM_freeN);
}
@@ -334,11 +336,12 @@ static bool edbm_bevel_calc(wmOperator *op)
material = CLAMPIS(material, -1, em->ob->totcol - 1);
}
- EDBM_op_init(em, &bmop, op,
- "bevel geom=%hev offset=%f segments=%i vertex_only=%b offset_type=%i profile=%f clamp_overlap=%b "
- "material=%i loop_slide=%b mark_seam=%b mark_sharp=%b strength=%f hnmode=%i",
- BM_ELEM_SELECT, offset, segments, vertex_only, offset_type, profile,
- clamp_overlap, material, loop_slide, mark_seam, mark_sharp, hn_strength, hnmode);
+ EDBM_op_init(
+ em, &bmop, op,
+ "bevel geom=%hev offset=%f segments=%i vertex_only=%b offset_type=%i profile=%f clamp_overlap=%b "
+ "material=%i loop_slide=%b mark_seam=%b mark_sharp=%b strength=%f hnmode=%i",
+ BM_ELEM_SELECT, offset, segments, vertex_only, offset_type, profile,
+ clamp_overlap, material, loop_slide, mark_seam, mark_sharp, hn_strength, hnmode);
BMO_op_exec(em->bm, &bmop);
@@ -349,8 +352,9 @@ static bool edbm_bevel_calc(wmOperator *op)
BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "faces.out", BM_FACE, BM_ELEM_SELECT, true);
}
- if (hnmode != BEVEL_HN_NONE)
- bevel_harden_normals(em, &bmop, hn_strength, hnmode);
+ if (hnmode != BEVEL_HN_NONE) {
+ bevel_harden_normals(em, &bmop, hn_strength);
+ }
/* no need to de-select existing geometry */
if (!EDBM_op_finish(em, &bmop, op, true)) {
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 45ffd3245a3..76ba2e5c67e 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -7064,7 +7064,7 @@ static void point_normals_update_header(bContext *C, wmOperator *op)
WM_MODALKEY(EDBM_CLNOR_MODAL_POINTTO_SET_USE_SELECTED),
WM_MODALKEY(EDBM_CLNOR_MODAL_POINTTO_INVERT), WM_bool_as_string(RNA_boolean_get(op->ptr, "invert")),
WM_MODALKEY(EDBM_CLNOR_MODAL_POINTTO_SPHERIZE),
- WM_bool_as_string(RNA_boolean_get(op->ptr, "spherize")),
+ WM_bool_as_string(RNA_boolean_get(op->ptr, "spherize")),
WM_MODALKEY(EDBM_CLNOR_MODAL_POINTTO_ALIGN), WM_bool_as_string(RNA_boolean_get(op->ptr, "align")));
#undef WM_MODALKEY
@@ -8064,8 +8064,8 @@ static int edbm_set_normals_from_faces_exec(bContext *C, wmOperator *op)
if (BLI_BITMAP_TEST(loop_set, BM_elem_index_get(l))) {
const int loop_index = BM_elem_index_get(l);
short *clnors = BM_ELEM_CD_GET_VOID_P(l, cd_clnors_offset);
- BKE_lnor_space_custom_normal_to_data(bm->lnor_spacearr->lspacearr[loop_index], vnors[v_index],
- clnors);
+ BKE_lnor_space_custom_normal_to_data(
+ bm->lnor_spacearr->lspacearr[loop_index], vnors[v_index], clnors);
}
}
}
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index c7cbf0e6a46..142460bb7fa 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -1831,7 +1831,7 @@ static void drawHelpline(bContext *C, int x, int y, void *customdata)
* an update
*/
if ((t->flag & T_POINTS) && (t->options & CTX_GPENCIL_STROKES) &&
- (t->around != V3D_AROUND_ACTIVE))
+ (t->around != V3D_AROUND_ACTIVE))
{
Object *ob = CTX_data_active_object(C);
if ((ob) && (ob->type == OB_GPENCIL)) {
@@ -4298,7 +4298,6 @@ static void applyRotationValue(TransInfo *t, float angle, float axis[3])
static void applyRotation(TransInfo *t, const int UNUSED(mval[2]))
{
char str[UI_MAX_DRAW_STR];
- size_t ofs = 0;
float final;
@@ -4458,7 +4457,7 @@ static void applyTrackball(TransInfo *t, const int UNUSED(mval[2]))
static void storeCustomLNorValue(TransDataContainer *tc, BMesh *bm)
{
BMLoopNorEditDataArray *lnors_ed_arr = BM_loop_normal_editdata_array_init(bm);
- BMLoopNorEditData *lnor_ed = lnors_ed_arr->lnor_editdata;
+ // BMLoopNorEditData *lnor_ed = lnors_ed_arr->lnor_editdata;
tc->custom.mode.data = lnors_ed_arr;
tc->custom.mode.free_cb = freeCustomNormalArray;
diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c
index a5e18851f12..422c3489e01 100644
--- a/source/blender/editors/uvedit/uvedit_smart_stitch.c
+++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c
@@ -1033,7 +1033,7 @@ static int stitch_process_data(
/* remember stitchable candidates as places the 'I' button */
/* will stop at. */
for (int island_idx = 0; island_idx < state->element_map->totalIslands; island_idx++) {
- state->island_is_stitchable[island_idx] = island_stitch_data[island_idx].stitchableCandidate?true:false;
+ state->island_is_stitchable[island_idx] = island_stitch_data[island_idx].stitchableCandidate ? true : false;
}
if (is_active_state) {
@@ -1810,7 +1810,7 @@ static UvEdge *uv_edge_get(BMLoop *l, StitchState *state)
return BLI_ghash_lookup(state->edge_hash, &tmp_edge);
}
-static StitchState* stitch_init(
+static StitchState *stitch_init(
bContext *C, wmOperator *op,
StitchStateContainer *ssc, Object *obedit)
{
@@ -2132,7 +2132,7 @@ static bool goto_next_island(StitchStateContainer *ssc)
int original_island = ssc->static_island;
- do {
+ do {
ssc->static_island++;
if (ssc->static_island >= active_state->element_map->totalIslands) {
/* go to next object */
@@ -2147,8 +2147,8 @@ static bool goto_next_island(StitchStateContainer *ssc)
/* We're at an island to make active */
return true;
}
- } while (!(active_state == original_active_state
- && ssc->static_island == original_island));
+ } while (!(active_state == original_active_state &&
+ ssc->static_island == original_island));
return false;
}
@@ -2201,15 +2201,14 @@ static int stitch_init_all(bContext *C, wmOperator *op)
uint objects_len = 0;
Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs(view_layer, &objects_len);
- if (!objects_len)
- {
+ if (objects_len == 0) {
MEM_freeN(objects);
state_delete_all(ssc);
return 0;
}
- ssc->objects = MEM_callocN(sizeof(Object*) * objects_len, "Object *ssc->objects");
- ssc->states = MEM_callocN(sizeof(StitchState*) * objects_len, "StitchState");
+ ssc->objects = MEM_callocN(sizeof(Object *) * objects_len, "Object *ssc->objects");
+ ssc->states = MEM_callocN(sizeof(StitchState *) * objects_len, "StitchState");
ssc->objects_len = 0;
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
@@ -2350,7 +2349,7 @@ static int stitch_exec(bContext *C, wmOperator *op)
}
}
-static StitchState* stitch_select(
+static StitchState *stitch_select(
bContext *C, Scene *scene, const wmEvent *event, StitchStateContainer *ssc)
{
/* add uv under mouse to processed uv's */
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c
index 40ffe293d41..0bbd26da670 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c
@@ -127,8 +127,9 @@ static void bakeModifier(
deformStroke(md, depsgraph, ob, gpl, gps);
- gpencil_apply_modifier_material(bmain, ob, mat, gh_color, gps,
- (bool)(mmd->flag & GP_COLOR_CREATE_COLORS));
+ gpencil_apply_modifier_material(
+ bmain, ob, mat, gh_color, gps,
+ (bool)(mmd->flag & GP_COLOR_CREATE_COLORS));
}
}
}
diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c
index e4923e94635..cd6bdd643d5 100644
--- a/source/blender/imbuf/intern/jp2.c
+++ b/source/blender/imbuf/intern/jp2.c
@@ -221,7 +221,7 @@ static opj_stream_t *opj_stream_create_from_buffer(
if (l_stream == NULL) {
return NULL;
}
- opj_stream_set_user_data(l_stream, p_file , opj_read_from_buffer_free);
+ opj_stream_set_user_data(l_stream, p_file, opj_read_from_buffer_free);
opj_stream_set_user_data_length(l_stream, p_file->len);
opj_stream_set_read_function(l_stream, opj_read_from_buffer);
#if 0 /* UNUSED */
diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c
index f1dc73436ee..ba07a3a56cc 100644
--- a/source/blender/modifiers/intern/MOD_bevel.c
+++ b/source/blender/modifiers/intern/MOD_bevel.c
@@ -111,8 +111,8 @@ static void bevel_set_weighted_normal_face_strength(BMesh *bm, Scene *scene)
}
static void bevel_mod_harden_normals(
- BevelModifierData *bmd, BMesh *bm, const float hn_strength,
- const int hnmode, MDeformVert *dvert, int vgroup)
+ BevelModifierData *bmd, BMesh *bm, const float hn_strength,
+ const int hnmode, MDeformVert *dvert, int vgroup)
{
if (bmd->res > 20 || bmd->value == 0)
return;
@@ -136,7 +136,7 @@ static void bevel_mod_harden_normals(
l_cur = l_first = BM_FACE_FIRST_LOOP(f);
do {
if ((!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, BM_ELEM_TAG) && BM_loop_check_cyclic_smooth_fan(l_cur)))
{
/* previous and next edge is sharp, accumulate face normals into loop */
@@ -187,8 +187,9 @@ static void bevel_mod_harden_normals(
}
else if (bmd->lim_flags & MOD_BEVEL_VGROUP) {
const bool has_vgroup = dvert != NULL;
- const bool vert_of_group = has_vgroup &&
- (defvert_find_index(&dvert[BM_elem_index_get(l->v)], vgroup) != NULL);
+ const bool vert_of_group = (
+ has_vgroup &&
+ (defvert_find_index(&dvert[BM_elem_index_get(l->v)], vgroup) != NULL));
if (vert_of_group && hnmode == MOD_BEVEL_HN_FACE) {
float cur[3];
@@ -223,20 +224,21 @@ static void bevel_mod_harden_normals(
/* If vertex is edge vert with 1 reconnected face */
if (recon_face_count == 1 || do_normal_to_recon) {
- BKE_lnor_space_custom_normal_to_data(bm->lnor_spacearr->lspacearr[l_index], recon_face->no,
- clnors);
+ BKE_lnor_space_custom_normal_to_data(
+ bm->lnor_spacearr->lspacearr[l_index], recon_face->no, clnors);
}
else if (vertex_only == false || recon_face_count == 0) {
copy_v3_v3(n_final, l->f->no);
mul_v3_fl(n_final, 1.0f - hn_strength);
add_v3_v3(n_final, cn_wght);
normalize_v3(n_final);
- BKE_lnor_space_custom_normal_to_data(bm->lnor_spacearr->lspacearr[l_index], n_final,
- clnors);
+ BKE_lnor_space_custom_normal_to_data(
+ bm->lnor_spacearr->lspacearr[l_index], n_final, clnors);
+ }
+ else if (BLI_ghash_haskey(faceHash, l->f)) {
+ BKE_lnor_space_custom_normal_to_data(
+ bm->lnor_spacearr->lspacearr[l_index], l->v->no, clnors);
}
- else if (BLI_ghash_haskey(faceHash, l->f))
- BKE_lnor_space_custom_normal_to_data(bm->lnor_spacearr->lspacearr[l_index], l->v->no,
- clnors);
}
}
}
@@ -466,7 +468,7 @@ ModifierTypeInfo modifierType_Bevel = {
eModifierTypeFlag_SupportsEditmode |
eModifierTypeFlag_EnableInEditmode |
eModifierTypeFlag_AcceptsCVs,
-
+
/* copyData */ modifier_copyData_generic,
/* deformVerts_DM */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_weighted_normal.c b/source/blender/modifiers/intern/MOD_weighted_normal.c
index 3e788db9c00..69c71d34dbc 100644
--- a/source/blender/modifiers/intern/MOD_weighted_normal.c
+++ b/source/blender/modifiers/intern/MOD_weighted_normal.c
@@ -514,8 +514,6 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes
MVert *mvert = result->mvert;
MLoop *mloop = result->mloop;
- bool free_polynors = false;
-
/* Right now:
* If weight = 50 then all faces are given equal weight.
* If weight > 50 then more weight given to faces with larger vals (face area / corner angle).
@@ -538,7 +536,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes
if (!polynors) {
polynors = CustomData_add_layer(pdata, CD_NORMAL, CD_CALLOC, NULL, numPolys);
}
- BKE_mesh_calc_normals_poly(mvert, NULL, numVerts, mloop, mpoly, numLoops, numPolys, polynors, false);
+ BKE_mesh_calc_normals_poly(mvert, NULL, numVerts, mloop, mpoly, numLoops, numPolys, polynors, false);
const float split_angle = mesh->smoothresh;
@@ -573,8 +571,9 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes
.mpoly = mpoly,
.polynors = polynors,
- .poly_strength = CustomData_get_layer_named(&result->pdata, CD_PROP_INT,
- MOD_WEIGHTEDNORMALS_FACEWEIGHT_CDLAYER_ID),
+ .poly_strength = CustomData_get_layer_named(
+ &result->pdata, CD_PROP_INT,
+ MOD_WEIGHTEDNORMALS_FACEWEIGHT_CDLAYER_ID),
.dvert = dvert,
.defgrp_index = defgrp_index,