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:
authorPhilipp Oeser <info@graphics-engineer.com>2019-11-27 17:02:41 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2019-11-27 17:55:32 +0300
commit6992fc0b3bf85e985169157b2e7ced1e1ed7fcdf (patch)
tree6af1fd9209963ca17e38d3037961e7fea47f5948 /source/blender/editors/mesh/editmesh_knife_project.c
parent7959dcd4f6316ade726209f2452323406f3672ea (diff)
Add 'EDBM_selectmode_disable_multi' and use in knifeproject
As a followup to rB6f4e595e9ba9 and as per @campbellbarton suggestion, this adds EDBM_selectmode_disable_multi, similar to EDBM_mesh_deselect_all_multi & EDBM_mesh_deselect_all, so other similar uses don't need to be done in a loop. Also, selected_objects isn't a reliable way to handle this case - since objects can be in edit-mode & not selected, use BKE_view_layer_array_from_bases_in_edit_mode_unique_data instead Differential Revision: https://developer.blender.org/D6317
Diffstat (limited to 'source/blender/editors/mesh/editmesh_knife_project.c')
-rw-r--r--source/blender/editors/mesh/editmesh_knife_project.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/source/blender/editors/mesh/editmesh_knife_project.c b/source/blender/editors/mesh/editmesh_knife_project.c
index a709bd010aa..ebd1e62e596 100644
--- a/source/blender/editors/mesh/editmesh_knife_project.c
+++ b/source/blender/editors/mesh/editmesh_knife_project.c
@@ -22,7 +22,6 @@
*/
#include "DNA_curve_types.h"
-#include "DNA_mesh_types.h"
#include "DNA_object_types.h"
#include "BLI_math.h"
@@ -143,21 +142,7 @@ static int knifeproject_exec(bContext *C, wmOperator *op)
/* select only tagged faces */
BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, false);
- CTX_DATA_BEGIN (C, Object *, ob, selected_objects) {
- if (ob->type == OB_MESH) {
- Mesh *me = (Mesh *)ob->data;
- BMEditMesh *embm = me->edit_mesh;
- if (embm) {
- /* not essential, but switch out of vertex mode since the
- * selected regions wont be nicely isolated after flushing.
- * note: call after de-select to avoid selection flushing.
- * note: do this on all participating meshes so this is in sync
- * e.g. for later selection picking, see T68852.*/
- EDBM_selectmode_disable(scene, embm, SCE_SELECT_VERTEX, SCE_SELECT_EDGE);
- }
- }
- }
- CTX_DATA_END;
+ EDBM_selectmode_disable_multi(C, SCE_SELECT_VERTEX, SCE_SELECT_EDGE);
BM_mesh_elem_hflag_enable_test(em->bm, BM_FACE, BM_ELEM_SELECT, true, false, BM_ELEM_TAG);