diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-08-25 10:40:46 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-08-25 10:42:27 +0400 |
commit | 470e694652a28d20d31e001240fdb9727a6d1480 (patch) | |
tree | 36cc6bd5195bdc06e5dd0994665ef6ccf6f8bf4f /source/blender | |
parent | 93d40aef05318cdc1f5ff0dac3e229cba2cc9527 (diff) |
BMesh: New operator flag not to clear history
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mesh.c | 12 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_opdefines.c | 266 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_operator_api.h | 5 |
3 files changed, 201 insertions, 82 deletions
diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c index 26a224c7c71..b16ea42304a 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.c +++ b/source/blender/bmesh/intern/bmesh_mesh.c @@ -766,6 +766,8 @@ void bmesh_edit_begin(BMesh *UNUSED(bm), BMOpTypeFlag UNUSED(type_flag)) */ void bmesh_edit_end(BMesh *bm, BMOpTypeFlag type_flag) { + ListBase select_history; + /* BMO_OPTYPE_FLAG_UNTAN_MULTIRES disabled for now, see comment above in bmesh_edit_begin. */ #ifdef BMOP_UNTAN_MULTIRES_ENABLED /* switch multires data into tangent space */ @@ -784,9 +786,19 @@ void bmesh_edit_end(BMesh *bm, BMOpTypeFlag type_flag) BM_mesh_normals_update(bm); } + + if ((type_flag & BMO_OPTYPE_FLAG_SELECT_VALIDATE) == 0) { + select_history = bm->selected; + BLI_listbase_clear(&bm->selected); + } + if (type_flag & BMO_OPTYPE_FLAG_SELECT_FLUSH) { BM_mesh_select_mode_flush(bm); } + + if ((type_flag & BMO_OPTYPE_FLAG_SELECT_VALIDATE) == 0) { + bm->selected = select_history; + } } void BM_mesh_elem_index_ensure(BMesh *bm, const char htype) diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c index 7dc46cf0678..5e568f88843 100644 --- a/source/blender/bmesh/intern/bmesh_opdefines.c +++ b/source/blender/bmesh/intern/bmesh_opdefines.c @@ -115,7 +115,7 @@ static BMOpDefine bmo_smooth_vert_def = { }, {{{'\0'}}}, /* no output */ bmo_smooth_vert_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC, + (BMO_OPTYPE_FLAG_NORMALS_CALC), }; /* @@ -138,7 +138,7 @@ static BMOpDefine bmo_smooth_laplacian_vert_def = { }, {{{'\0'}}}, /* no output */ bmo_smooth_laplacian_vert_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC, + (BMO_OPTYPE_FLAG_NORMALS_CALC), }; /* @@ -154,7 +154,8 @@ static BMOpDefine bmo_recalc_face_normals_def = { }, {{{'\0'}}}, /* no output */ bmo_recalc_face_normals_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC), }; /* @@ -180,7 +181,8 @@ static BMOpDefine bmo_region_extend_def = { {{'\0'}}, }, bmo_region_extend_exec, - BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -201,7 +203,10 @@ static BMOpDefine bmo_rotate_edges_def = { {{'\0'}}, }, bmo_rotate_edges_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -218,7 +223,8 @@ static BMOpDefine bmo_reverse_faces_def = { }, {{{'\0'}}}, /* no output */ bmo_reverse_faces_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC), }; /* @@ -240,7 +246,10 @@ static BMOpDefine bmo_bisect_edges_def = { {{'\0'}}, }, bmo_bisect_edges_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -266,7 +275,9 @@ static BMOpDefine bmo_mirror_def = { {{'\0'}}, }, bmo_mirror_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -291,7 +302,7 @@ static BMOpDefine bmo_find_doubles_def = { {{'\0'}}, }, bmo_find_doubles_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NOP), }; /* @@ -309,7 +320,10 @@ static BMOpDefine bmo_remove_doubles_def = { }, {{{'\0'}}}, /* no output */ bmo_remove_doubles_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -328,7 +342,10 @@ static BMOpDefine bmo_automerge_def = { }, {{{'\0'}}}, /* no output */ bmo_automerge_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -344,7 +361,10 @@ static BMOpDefine bmo_collapse_def = { }, {{{'\0'}}}, /* no output */ bmo_collapse_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -361,7 +381,7 @@ static BMOpDefine bmo_pointmerge_facedata_def = { }, {{{'\0'}}}, /* no output */ bmo_pointmerge_facedata_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NOP), }; /* @@ -379,7 +399,7 @@ static BMOpDefine bmo_average_vert_facedata_def = { }, {{{'\0'}}}, /* no output */ bmo_average_vert_facedata_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NOP), }; /* @@ -396,7 +416,10 @@ static BMOpDefine bmo_pointmerge_def = { }, {{{'\0'}}}, /* no output */ bmo_pointmerge_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -412,7 +435,7 @@ static BMOpDefine bmo_collapse_uvs_def = { }, {{{'\0'}}}, /* no output */ bmo_collapse_uvs_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NOP), }; /* @@ -431,7 +454,10 @@ static BMOpDefine bmo_weld_verts_def = { }, {{{'\0'}}}, /* no output */ bmo_weld_verts_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -451,7 +477,7 @@ static BMOpDefine bmo_create_vert_def = { {{'\0'}}, }, bmo_create_vert_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NOP), }; /* @@ -476,7 +502,10 @@ static BMOpDefine bmo_join_triangles_def = { {{'\0'}}, }, bmo_join_triangles_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -504,7 +533,10 @@ static BMOpDefine bmo_contextual_create_def = { {{'\0'}}, }, bmo_contextual_create_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -527,7 +559,9 @@ static BMOpDefine bmo_bridge_loops_def = { {{'\0'}}, }, bmo_bridge_loops_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -551,7 +585,8 @@ static BMOpDefine bmo_grid_fill_def = { {{'\0'}}, }, bmo_grid_fill_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH), }; @@ -573,7 +608,8 @@ static BMOpDefine bmo_holes_fill_def = { {{'\0'}}, }, bmo_holes_fill_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH), }; @@ -596,7 +632,7 @@ static BMOpDefine bmo_face_attribute_fill_def = { {{'\0'}}, }, bmo_face_attribute_fill_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC), }; /* @@ -619,7 +655,8 @@ static BMOpDefine bmo_edgeloop_fill_def = { {{'\0'}}, }, bmo_edgeloop_fill_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH), }; @@ -643,7 +680,8 @@ static BMOpDefine bmo_edgenet_fill_def = { {{'\0'}}, }, bmo_edgenet_fill_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH), }; /* @@ -667,7 +705,7 @@ static BMOpDefine bmo_edgenet_prepare_def = { {{'\0'}}, }, bmo_edgenet_prepare_exec, - BMO_OPTYPE_FLAG_NOP, + (BMO_OPTYPE_FLAG_NOP), }; /* @@ -686,7 +724,7 @@ static BMOpDefine bmo_rotate_def = { }, {{{'\0'}}}, /* no output */ bmo_rotate_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC, + (BMO_OPTYPE_FLAG_NORMALS_CALC), }; /* @@ -704,7 +742,7 @@ static BMOpDefine bmo_translate_def = { }, {{{'\0'}}}, /* no output */ bmo_translate_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC, + (BMO_OPTYPE_FLAG_NORMALS_CALC), }; /* @@ -722,7 +760,7 @@ static BMOpDefine bmo_scale_def = { }, {{{'\0'}}}, /* no output */ bmo_scale_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC, + (BMO_OPTYPE_FLAG_NORMALS_CALC), }; @@ -742,7 +780,7 @@ static BMOpDefine bmo_transform_def = { }, {{{'\0'}}}, /* no output */ bmo_transform_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC, + (BMO_OPTYPE_FLAG_NORMALS_CALC), }; /* @@ -760,7 +798,7 @@ static BMOpDefine bmo_object_load_bmesh_def = { }, {{{'\0'}}}, /* no output */ bmo_object_load_bmesh_exec, - BMO_OPTYPE_FLAG_NOP, + (BMO_OPTYPE_FLAG_NOP), }; @@ -782,7 +820,7 @@ static BMOpDefine bmo_bmesh_to_mesh_def = { }, {{{'\0'}}}, /* no output */ bmo_bmesh_to_mesh_exec, - BMO_OPTYPE_FLAG_NOP, + (BMO_OPTYPE_FLAG_NOP), }; /* @@ -804,7 +842,7 @@ static BMOpDefine bmo_mesh_to_bmesh_def = { }, {{{'\0'}}}, /* no output */ bmo_mesh_to_bmesh_exec, - BMO_OPTYPE_FLAG_NOP, + (BMO_OPTYPE_FLAG_NOP), }; /* @@ -823,7 +861,7 @@ static BMOpDefine bmo_extrude_discrete_faces_def = { {{'\0'}}, }, bmo_extrude_discrete_faces_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC), }; /* @@ -843,7 +881,7 @@ static BMOpDefine bmo_extrude_edge_only_def = { {{'\0'}}, }, bmo_extrude_edge_only_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC), }; /* @@ -863,7 +901,7 @@ static BMOpDefine bmo_extrude_vert_indiv_def = { {{'\0'}}, }, bmo_extrude_vert_indiv_exec, - BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_SELECT_FLUSH), }; /* @@ -883,7 +921,9 @@ static BMOpDefine bmo_connect_verts_def = { {{'\0'}}, }, bmo_connect_verts_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH), }; /* @@ -904,7 +944,9 @@ static BMOpDefine bmo_connect_verts_nonplanar_def = { {{'\0'}}, }, bmo_connect_verts_nonplanar_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH), }; /* @@ -923,7 +965,9 @@ static BMOpDefine bmo_connect_vert_pair_def = { {{'\0'}}, }, bmo_connect_vert_pair_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH), }; @@ -945,7 +989,7 @@ static BMOpDefine bmo_extrude_face_region_def = { {{'\0'}}, }, bmo_extrude_face_region_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC), }; /* @@ -961,7 +1005,10 @@ static BMOpDefine bmo_dissolve_verts_def = { }, {{{'\0'}}}, /* no output */ bmo_dissolve_verts_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -980,7 +1027,10 @@ static BMOpDefine bmo_dissolve_edges_def = { {{'\0'}}, }, bmo_dissolve_edges_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -998,7 +1048,10 @@ static BMOpDefine bmo_dissolve_faces_def = { {{'\0'}}, }, bmo_dissolve_faces_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -1020,7 +1073,10 @@ static BMOpDefine bmo_dissolve_limit_def = { {{"region.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, {{'\0'}}}, bmo_dissolve_limit_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -1038,7 +1094,10 @@ static BMOpDefine bmo_dissolve_degenerate_def = { /* slots_out */ {{{'\0'}}}, bmo_dissolve_degenerate_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -1059,7 +1118,9 @@ static BMOpDefine bmo_triangulate_def = { {{'\0'}}, }, bmo_triangulate_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH), }; /* @@ -1076,7 +1137,10 @@ static BMOpDefine bmo_unsubdivide_def = { }, {{{'\0'}}}, /* no output */ bmo_unsubdivide_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -1114,7 +1178,10 @@ static BMOpDefine bmo_subdivide_edges_def = { {{'\0'}}, }, bmo_subdivide_edges_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -1136,7 +1203,10 @@ static BMOpDefine bmo_subdivide_edgering_def = { {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */ {{'\0'}}}, bmo_subdivide_edgering_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -1160,7 +1230,10 @@ static BMOpDefine bmo_bisect_plane_def = { {"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* input and output geometry (result of cut) */ {{'\0'}}}, bmo_bisect_plane_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -1177,7 +1250,9 @@ static BMOpDefine bmo_delete_def = { }, {{{'\0'}}}, /* no output */ bmo_delete_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -1207,7 +1282,8 @@ static BMOpDefine bmo_duplicate_def = { {{'\0'}}, }, bmo_duplicate_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH), }; /* @@ -1232,7 +1308,8 @@ static BMOpDefine bmo_split_def = { {{'\0'}}, }, bmo_split_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH), }; /* @@ -1259,7 +1336,8 @@ static BMOpDefine bmo_spin_def = { {{'\0'}}, }, bmo_spin_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH), }; @@ -1282,7 +1360,7 @@ static BMOpDefine bmo_similar_faces_def = { {{'\0'}}, }, bmo_similar_faces_exec, - BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_SELECT_FLUSH), }; /* @@ -1304,7 +1382,7 @@ static BMOpDefine bmo_similar_edges_def = { {{'\0'}}, }, bmo_similar_edges_exec, - BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_SELECT_FLUSH), }; /* @@ -1326,7 +1404,7 @@ static BMOpDefine bmo_similar_verts_def = { {{'\0'}}, }, bmo_similar_verts_exec, - BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_SELECT_FLUSH), }; /* @@ -1343,7 +1421,7 @@ static BMOpDefine bmo_rotate_uvs_def = { }, {{{'\0'}}}, /* no output */ bmo_rotate_uvs_exec, - BMO_OPTYPE_FLAG_NOP, + (BMO_OPTYPE_FLAG_NOP), }; /* @@ -1359,7 +1437,7 @@ static BMOpDefine bmo_reverse_uvs_def = { }, {{{'\0'}}}, /* no output */ bmo_reverse_uvs_exec, - BMO_OPTYPE_FLAG_NOP, + (BMO_OPTYPE_FLAG_NOP), }; /* @@ -1376,7 +1454,7 @@ static BMOpDefine bmo_rotate_colors_def = { }, {{{'\0'}}}, /* no output */ bmo_rotate_colors_exec, - BMO_OPTYPE_FLAG_NOP, + (BMO_OPTYPE_FLAG_NOP), }; /* @@ -1392,7 +1470,7 @@ static BMOpDefine bmo_reverse_colors_def = { }, {{{'\0'}}}, /* no output */ bmo_reverse_colors_exec, - BMO_OPTYPE_FLAG_NOP, + (BMO_OPTYPE_FLAG_NOP), }; /* @@ -1414,7 +1492,9 @@ static BMOpDefine bmo_split_edges_def = { {{'\0'}}, }, bmo_split_edges_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH), }; /* @@ -1436,7 +1516,8 @@ static BMOpDefine bmo_create_grid_def = { {{'\0'}}, }, bmo_create_grid_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH), }; /* @@ -1458,7 +1539,8 @@ static BMOpDefine bmo_create_uvsphere_def = { {{'\0'}}, }, bmo_create_uvsphere_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH), }; /* @@ -1479,7 +1561,8 @@ static BMOpDefine bmo_create_icosphere_def = { {{'\0'}}, }, bmo_create_icosphere_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH), }; /* @@ -1498,7 +1581,8 @@ static BMOpDefine bmo_create_monkey_def = { {{'\0'}}, }, bmo_create_monkey_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH), }; /* @@ -1523,7 +1607,8 @@ static BMOpDefine bmo_create_cone_def = { {{'\0'}}, }, bmo_create_cone_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH), }; /* @@ -1544,7 +1629,8 @@ static BMOpDefine bmo_create_circle_def = { {{'\0'}}, }, bmo_create_circle_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH), }; /* @@ -1564,7 +1650,8 @@ static BMOpDefine bmo_create_cube_def = { {{'\0'}}, }, bmo_create_cube_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH), }; /* @@ -1590,7 +1677,10 @@ static BMOpDefine bmo_bevel_def = { }, bmo_bevel_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -1612,7 +1702,10 @@ static BMOpDefine bmo_beautify_fill_def = { {{'\0'}}, }, bmo_beautify_fill_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -1634,7 +1727,9 @@ static BMOpDefine bmo_triangle_fill_def = { {{'\0'}}, }, bmo_triangle_fill_exec, - BMO_OPTYPE_FLAG_UNTAN_MULTIRES | BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | + BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH), }; /* @@ -1654,7 +1749,8 @@ static BMOpDefine bmo_solidify_def = { {{'\0'}}, }, bmo_solidify_face_region_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH), }; /* @@ -1678,7 +1774,8 @@ static BMOpDefine bmo_inset_individual_def = { {{'\0'}}, }, bmo_inset_individual_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC, /* caller needs to handle BMO_OPTYPE_FLAG_SELECT_FLUSH */ + /* caller needs to handle BMO_OPTYPE_FLAG_SELECT_FLUSH */ + (BMO_OPTYPE_FLAG_NORMALS_CALC), }; /* @@ -1705,7 +1802,8 @@ static BMOpDefine bmo_inset_region_def = { {{'\0'}}, }, bmo_inset_region_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH), }; /* @@ -1734,7 +1832,9 @@ static BMOpDefine bmo_wireframe_def = { {{'\0'}}, }, bmo_wireframe_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; /* @@ -1757,7 +1857,9 @@ static BMOpDefine bmo_poke_def = { {{'\0'}}, }, bmo_poke_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; #ifdef WITH_BULLET @@ -1791,7 +1893,9 @@ static BMOpDefine bmo_convex_hull_def = { {{'\0'}}, }, bmo_convex_hull_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; #endif @@ -1818,7 +1922,9 @@ static BMOpDefine bmo_symmetrize_def = { {{'\0'}}, }, bmo_symmetrize_exec, - BMO_OPTYPE_FLAG_NORMALS_CALC | BMO_OPTYPE_FLAG_SELECT_FLUSH, + (BMO_OPTYPE_FLAG_NORMALS_CALC | + BMO_OPTYPE_FLAG_SELECT_FLUSH | + BMO_OPTYPE_FLAG_SELECT_VALIDATE), }; const BMOpDefine *bmo_opdefines[] = { diff --git a/source/blender/bmesh/intern/bmesh_operator_api.h b/source/blender/bmesh/intern/bmesh_operator_api.h index 7fad3a8c20e..ef4990ab56e 100644 --- a/source/blender/bmesh/intern/bmesh_operator_api.h +++ b/source/blender/bmesh/intern/bmesh_operator_api.h @@ -182,8 +182,9 @@ typedef struct BMOpSlot { typedef enum { BMO_OPTYPE_FLAG_NOP = 0, BMO_OPTYPE_FLAG_UNTAN_MULTIRES = (1 << 0), /* switch from multires tangent space to absolute coordinates */ - BMO_OPTYPE_FLAG_NORMALS_CALC = (1 << 1), /*switch from multires tangent space to absolute coordinates*/ - BMO_OPTYPE_FLAG_SELECT_FLUSH = (1 << 2) /*switch from multires tangent space to absolute coordinates*/ + BMO_OPTYPE_FLAG_NORMALS_CALC = (1 << 1), + BMO_OPTYPE_FLAG_SELECT_FLUSH = (1 << 2), + BMO_OPTYPE_FLAG_SELECT_VALIDATE = (1 << 3), } BMOpTypeFlag; typedef struct BMOperator { |