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:
authorClément Foucault <foucault.clem@gmail.com>2018-09-25 00:18:02 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-09-25 23:51:54 +0300
commita3bb385ca0ba37bf1cdc1b74de9ce872b262fb95 (patch)
tree250974f326d38cf9bebec98ad5b79a2fb64add10 /source/blender/editors/mesh
parent7cc9998809359dead38bd20de851494e11ab3da1 (diff)
Edit Mesh: Move Edit Mesh display settings to overlay's
This makes the Edit Mesh display settings common to all objects. They can also be set differently per viewport. Modifying extra data (seams, sharp edges etc...) will no longer set them automaticaly visible. Bumping version because we need to force set all extra draw options for older files.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r--source/blender/editors/mesh/editmesh_path.c26
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c29
-rw-r--r--source/blender/editors/mesh/mesh_data.c4
3 files changed, 1 insertions, 58 deletions
diff --git a/source/blender/editors/mesh/editmesh_path.c b/source/blender/editors/mesh/editmesh_path.c
index c8bf4a9cc4d..c7f82a36eed 100644
--- a/source/blender/editors/mesh/editmesh_path.c
+++ b/source/blender/editors/mesh/editmesh_path.c
@@ -319,7 +319,7 @@ static void edgetag_ensure_cd_flag(Mesh *me, const char edge_mode)
/* since you want to create paths with multiple selects, it doesn't have extend option */
static void mouse_mesh_shortest_path_edge(
- Scene *scene, Object *obedit, const struct PathSelectParams *op_params,
+ Scene *UNUSED(scene), Object *obedit, const struct PathSelectParams *op_params,
BMEdge *e_act, BMEdge *e_dst)
{
BMEditMesh *em = BKE_editmesh_from_object(obedit);
@@ -327,7 +327,6 @@ static void mouse_mesh_shortest_path_edge(
struct UserData user_data = {bm, obedit->data, op_params};
LinkNode *path = NULL;
- Mesh *me = obedit->data;
bool is_path_ordered = false;
edgetag_ensure_cd_flag(obedit->data, op_params->edge_mode);
@@ -415,29 +414,6 @@ static void mouse_mesh_shortest_path_edge(
}
}
- /* force drawmode for mesh */
- switch (op_params->edge_mode) {
-
- case EDGE_MODE_TAG_SEAM:
- me->drawflag |= ME_DRAWSEAMS;
- ED_uvedit_live_unwrap(scene, obedit);
- break;
- case EDGE_MODE_TAG_SHARP:
- me->drawflag |= ME_DRAWSHARP;
- break;
- case EDGE_MODE_TAG_CREASE:
- me->drawflag |= ME_DRAWCREASES;
- break;
- case EDGE_MODE_TAG_BEVEL:
- me->drawflag |= ME_DRAWBWEIGHTS;
- break;
-#ifdef WITH_FREESTYLE
- case EDGE_MODE_TAG_FREESTYLE:
- me->drawflag |= ME_DRAW_FREESTYLE_EDGE;
- break;
-#endif
- }
-
EDBM_update_generic(em, false, false);
}
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 5793fae79fe..1f77dc9aa6a 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -988,13 +988,6 @@ static int edbm_mark_seam_exec(bContext *C, wmOperator *op)
continue;
}
- Mesh *me = ((Mesh *)obedit->data);
-
- /* auto-enable seams drawing */
- if (clear == 0) {
- me->drawflag |= ME_DRAWSEAMS;
- }
-
if (clear) {
BM_ITER_MESH (eed, &iter, bm, BM_EDGES_OF_MESH) {
if (!BM_elem_flag_test(eed, BM_ELEM_SELECT) || BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {
@@ -1063,17 +1056,11 @@ static int edbm_mark_sharp_exec(bContext *C, wmOperator *op)
Object *obedit = objects[ob_index];
BMEditMesh *em = BKE_editmesh_from_object(obedit);
BMesh *bm = em->bm;
- Mesh *me = ((Mesh *)obedit->data);
if (bm->totedgesel == 0) {
continue;
}
- /* auto-enable sharp edge drawing */
- if (clear == 0) {
- me->drawflag |= ME_DRAWSHARP;
- }
-
BM_ITER_MESH (eed, &iter, bm, BM_EDGES_OF_MESH) {
if (use_verts) {
if (!(BM_elem_flag_test(eed->v1, BM_ELEM_SELECT) || BM_elem_flag_test(eed->v2, BM_ELEM_SELECT))) {
@@ -6937,17 +6924,11 @@ static int edbm_mark_freestyle_edge_exec(bContext *C, wmOperator *op)
}
BMesh *bm = em->bm;
- Mesh *me = ((Mesh *)obedit->data);
if (bm->totedgesel == 0) {
continue;
}
- /* auto-enable Freestyle edge mark drawing */
- if (clear == 0) {
- me->drawflag |= ME_DRAW_FREESTYLE_EDGE;
- }
-
if (!CustomData_has_layer(&em->bm->edata, CD_FREESTYLE_EDGE)) {
BM_data_layer_add(em->bm, &em->bm->edata, CD_FREESTYLE_EDGE);
}
@@ -7015,7 +6996,6 @@ static int edbm_mark_freestyle_face_exec(bContext *C, wmOperator *op)
Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len);
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- Mesh *me = (Mesh *)obedit->data;
BMEditMesh *em = BKE_editmesh_from_object(obedit);
if (em == NULL) {
@@ -7026,11 +7006,6 @@ static int edbm_mark_freestyle_face_exec(bContext *C, wmOperator *op)
continue;
}
- /* auto-enable Freestyle face mark drawing */
- if (!clear) {
- me->drawflag |= ME_DRAW_FREESTYLE_FACE;
- }
-
if (!CustomData_has_layer(&em->bm->pdata, CD_FREESTYLE_FACE)) {
BM_data_layer_add(em->bm, &em->bm->pdata, CD_FREESTYLE_FACE);
}
@@ -7715,10 +7690,6 @@ static int normals_split_merge(bContext *C, const bool do_merge)
BM_elem_flag_set(e, BM_ELEM_SMOOTH, do_merge);
}
}
- if (do_merge == 0) {
- Mesh *me = obedit->data;
- me->drawflag |= ME_DRAWSHARP;
- }
bm->spacearr_dirty |= BM_SPACEARR_DIRTY_ALL;
BKE_editmesh_lnorspace_update(em);
diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c
index 3598262ecf4..438cbb8da91 100644
--- a/source/blender/editors/mesh/mesh_data.c
+++ b/source/blender/editors/mesh/mesh_data.c
@@ -798,8 +798,6 @@ static int mesh_customdata_custom_splitnormals_add_exec(bContext *C, wmOperator
/* Tag edges as sharp according to smooth threshold if needed, to preserve autosmooth shading. */
if (me->flag & ME_AUTOSMOOTH) {
BM_edges_sharp_from_angle_set(me->edit_btmesh->bm, me->smoothresh);
-
- me->drawflag |= ME_DRAWSHARP;
}
BM_data_layer_add(me->edit_btmesh->bm, data, CD_CUSTOMLOOPNORMAL);
@@ -823,8 +821,6 @@ static int mesh_customdata_custom_splitnormals_add_exec(bContext *C, wmOperator
me->smoothresh);
MEM_freeN(polynors);
-
- me->drawflag |= ME_DRAWSHARP;
}
CustomData_add_layer(data, CD_CUSTOMLOOPNORMAL, CD_DEFAULT, NULL, me->totloop);