Select expand/contract from face mode to edge mode doesnt flush to faces if there are zero edges selected after contraction #71879

Closed
opened 2019-11-25 09:38:10 +01:00 by Stanislav Blinov · 13 comments

Blender Version
Broken: 2.79b, 2.80, 2.81, 2.82 (ba1e9ae473)

Short description of error
With certain selections, switching from face to edge mode with the Expand option deselects edges, but leaves faces selected.

Exact steps for others to reproduce the error

  1. Load the default scene
  2. Enter edit mode on the cube and switch to face selection mode
  3. Select two opposite faces
  4. Switch to edge selection mode with the Expand option (e.g. ctrl+click the icon or press Ctrl+2 with the default keymap)

Faces will remain selected, but all edges around them will be deselected.

**Blender Version** Broken: 2.79b, 2.80, 2.81, 2.82 (ba1e9ae4733a) **Short description of error** With certain selections, switching from face to edge mode with the Expand option deselects edges, but leaves faces selected. **Exact steps for others to reproduce the error** 1. Load the default scene 2. Enter edit mode on the cube and switch to face selection mode 3. Select two opposite faces 4. Switch to edge selection mode with the Expand option (e.g. ctrl+click the icon or press Ctrl+2 with the default keymap) Faces will remain selected, but all edges around them will be deselected.

Added subscriber: @Stan_Pancakes

Added subscriber: @Stan_Pancakes

Added subscriber: @AnthonyEdlin

Added subscriber: @AnthonyEdlin

Can at least confirm behavior as described. In addition what seems to trigger it is when you ctl click from faces to edges and it would leave no edges selected, it then leaves the faces selected in edge mode. If you then ctl click back to faces they will still be selected. In contrast, if even 1 edge is selected when you first ctl click to edge mode then the faces are unselected and when you ctl click back to face mode only the faces connected to the selected edge are selected.

Linux-5.3.0-20-generic-x86_64-with-Ubuntu-18.04-bionic 64 Bits
GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 440.26
Blender version: 2.81 (sub 16), branch: master, commit date: 2019-11-20 14:27, hash: 26bd5ebd42

Can at least confirm behavior as described. In addition what seems to trigger it is when you ctl click from faces to edges and it would leave no edges selected, it then leaves the faces selected in edge mode. If you then ctl click back to faces they will still be selected. In contrast, if even 1 edge is selected when you first ctl click to edge mode then the faces are unselected and when you ctl click back to face mode only the faces connected to the selected edge are selected. Linux-5.3.0-20-generic-x86_64-with-Ubuntu-18.04-bionic 64 Bits GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 440.26 Blender version: 2.81 (sub 16), branch: master, commit date: 2019-11-20 14:27, hash: 26bd5ebd42

That last part is normal operation: "Expanding" from a single edge is supposed to select the faces connected to it. But I'm not sure what you mean by "if even 1 edge is selected when you first ctrl click to edge mode"?

That last part is normal operation: "Expanding" from a single edge is supposed to select the faces connected to it. But I'm not sure what you mean by "if even 1 edge is selected when you first ctrl click to edge mode"?

Yes the last part is normal operation. The part that is wrong is that if you go from faces to edges and in the process no edges are selected (because you don't have any adjacent faces selected) then the faces remain selected even in edge mode. The faces should be unselected in this case but they are not. If you then ctl click expand back to face mode you would think that no faces would be selected because no edges were selected in edge mode, but now the faces that were selected at the start are still selected.

Yes the last part is normal operation. The part that is wrong is that if you go from faces to edges and in the process no edges are selected (because you don't have any adjacent faces selected) then the faces remain selected even in edge mode. The faces should be unselected in this case but they are not. If you then ctl click expand back to face mode you would think that no faces would be selected because no edges were selected in edge mode, but now the faces that were selected at the start are still selected.

I notice that EDBM_selectmode_convert function is what does the expansion/contraction. All mode switches that go down from higher to lower use BM_mesh_deselect_flush except for the one that goes from faces to edges. I made a patch that just adds BM_mesh_deselect_flush to that code path also, seems to work for me. #71879.diff

I notice that EDBM_selectmode_convert function is what does the expansion/contraction. All mode switches that go down from higher to lower use BM_mesh_deselect_flush except for the one that goes from faces to edges. I made a patch that just adds BM_mesh_deselect_flush to that code path also, seems to work for me. [#71879.diff](https://archive.blender.org/developer/F8175216/T71879.diff)
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

@AnthonyEdlin: guess that would work.

This only happens when there are zero selected edges left after contraction.
Usually this already gets flushed in EDBM_selectmode_set (which happens a bit after EDBM_selectmode_convert in EDBM_selectmode_toggle_multi)
But there, flushing only takes place if there are non-zero edges selected.

Maybe we should even do it there like so [havent tested thourougly though...]?
P1169: T71879_snippet



diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c
index 40d57af97aa..da25d666f07 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -2208,10 +2208,9 @@ void EDBM_selectmode_set(BMEditMesh *em)
           BM_edge_select_set(em->bm, eed, true);
         }
       }
-
-      /* selects faces based on edge status */
-      EDBM_selectmode_flush(em);
     }
+    /* selects faces based on edge status */
+    EDBM_selectmode_flush(em);
   }
   else if (em->selectmode & SCE_SELECT_FACE) {
     /* deselect eges, and select again based on face select */
@AnthonyEdlin: guess that would work. This only happens when there are zero selected edges left after contraction. Usually this already gets flushed in `EDBM_selectmode_set` (which happens a bit after `EDBM_selectmode_convert` in `EDBM_selectmode_toggle_multi`) But there, flushing only takes place if there are non-zero edges selected. Maybe we should even do it there like so [havent tested thourougly though...]? [P1169: T71879_snippet](https://archive.blender.org/developer/P1169.txt) ``` diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index 40d57af97aa..da25d666f07 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -2208,10 +2208,9 @@ void EDBM_selectmode_set(BMEditMesh *em) BM_edge_select_set(em->bm, eed, true); } } - - /* selects faces based on edge status */ - EDBM_selectmode_flush(em); } + /* selects faces based on edge status */ + EDBM_selectmode_flush(em); } else if (em->selectmode & SCE_SELECT_FACE) { /* deselect eges, and select again based on face select */ ```
Philipp Oeser changed title from Select Expand from face mode to edge mode may produce invalid selection to Select expand/contract from face mode to edge mode doesnt flush to faces if there are zero edges selected after contraction 2019-11-28 16:27:43 +01:00
Member

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Member
CC @ideasman42

@lichtwerk Yes I only added it there because the other spots inside EDBM_selectmode_convert that do a contraction use it. Such as Face->Vert and Edge->Vert. It could work in either place, but I think that either way they should be consistent. So maybe remove other flushes in EDBM_selectmode_convert. I am no bmesh expert though.

@lichtwerk Yes I only added it there because the other spots inside EDBM_selectmode_convert that do a contraction use it. Such as Face->Vert and Edge->Vert. It could work in either place, but I think that either way they should be consistent. So maybe remove other flushes in EDBM_selectmode_convert. I am no bmesh expert though.
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Philipp Oeser self-assigned this 2020-04-24 10:04:13 +02:00
Member

Looks like this has just been fixed, see b0b6fb8a93
(same solution @AnthonyEdlin suggested)

Looks like this has just been fixed, see b0b6fb8a93 (same solution @AnthonyEdlin suggested)
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#71879
No description provided.