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:
authorRohan Rathi <rohanrathi08@gmail.com>2018-07-02 19:17:15 +0300
committerRohan Rathi <rohanrathi08@gmail.com>2018-07-02 19:17:15 +0300
commit74ace41160bd6e98c904b34e5efe0893b1719387 (patch)
tree123e8d819221be124ec79a35f937b7562acf019f /source/blender/editors/mesh/editmesh_bevel.c
parent0c25881c391b84e238fa9503ec8c6a6fa0e2e439 (diff)
Minor cleanup and fixed normal updating erasing entire mesh
Diffstat (limited to 'source/blender/editors/mesh/editmesh_bevel.c')
-rw-r--r--source/blender/editors/mesh/editmesh_bevel.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c
index 40be91aada1..d92d655641f 100644
--- a/source/blender/editors/mesh/editmesh_bevel.c
+++ b/source/blender/editors/mesh/editmesh_bevel.c
@@ -197,8 +197,8 @@ static void bevel_harden_normals(BMEditMesh *em, BMOperator *bmop, float face_st
normalize_v3(cn_wght);
normalize_v3(cn_unwght);
if (calc_n) {
- mul_v3_fl(calc_n, face_strength);
- mul_v3_fl(cn_wght, 1.0f - face_strength);
+ mul_v3_fl(cn_wght, face_strength);
+ mul_v3_fl(calc_n, 1.0f - face_strength);
add_v3_v3(calc_n, cn_wght);
normalize_v3(calc_n);
}
@@ -341,7 +341,8 @@ 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);
}
- bevel_harden_normals(em, &bmop, strength, hnmode);
+ if(hnmode != BEVEL_HN_NONE)
+ bevel_harden_normals(em, &bmop, strength, hnmode);
/* no need to de-select existing geometry */
if (!EDBM_op_finish(em, &bmop, op, true)) {
@@ -788,5 +789,5 @@ void MESH_OT_bevel(wmOperatorType *ot)
RNA_def_int(ot->srna, "material", -1, -1, INT_MAX, "Material",
"Material for bevel faces (-1 means use adjacent faces)", -1, 100);
RNA_def_float(ot->srna, "strength", 0.5f, 0.0f, 1.0f, "Normal Strength", "Strength of calculated normal", 0.0f, 1.0f);
- RNA_def_enum(ot->srna, "hnmode", harden_normals_items, BEVEL_HN_FACE, "Normal Mode", "Weighting mode for Harden Normals");
+ RNA_def_enum(ot->srna, "hnmode", harden_normals_items, BEVEL_HN_NONE, "Normal Mode", "Weighting mode for Harden Normals");
}