Mesh: Add operator to select elements based on boolean attribute #113772

Merged
Hans Goudey merged 3 commits from HooglyBoogly/blender:mesh-edit-select-by-attribute into blender-v4.0-release 2023-10-17 09:25:00 +02:00
Member

Adds a "Select by Attribute" operator as mentioned in the discussion in
#105317. This is done in 4.0 to limit the breaking aspect of the removal
of face maps. The selection storage functionality is replaced by boolean
attributes. We already have a way to control the data in the boolean
attribute with the "Set Attribute" operator, but we didn't have a way to
convert the attribute into a selection.

This operator works on the active attribute if is a boolean attribute
and isn't on the face corner domain. It adds to the existing selection
similar to other existing operators.

While this behavior can be recreated as a node tool, we add it as a
builtin operator here to avoid limitations of the new node-based
tool system and to make the late-in-the-release-cycle change safer.


image

Adds a "Select by Attribute" operator as mentioned in the discussion in #105317. This is done in 4.0 to limit the breaking aspect of the removal of face maps. The selection storage functionality is replaced by boolean attributes. We already have a way to control the data in the boolean attribute with the "Set Attribute" operator, but we didn't have a way to convert the attribute into a selection. This operator works on the active attribute if is a boolean attribute and isn't on the face corner domain. It adds to the existing selection similar to other existing operators. While this behavior can be recreated as a node tool, we add it as a builtin operator here to avoid limitations of the new node-based tool system and to make the late-in-the-release-cycle change safer. --- ![image](/attachments/6574f95d-4302-471f-8388-3e2090d57c9a)
Hans Goudey added this to the 4.0 milestone 2023-10-16 14:18:44 +02:00
Hans Goudey added the
Module
Modeling
label 2023-10-16 14:18:45 +02:00
Hans Goudey added 1 commit 2023-10-16 14:18:56 +02:00
Adds a "Select by Attribute" operator as mentioned in the discussion in
#105317. This is done in 4.0 to limit the breaking aspect of the removal
of face maps. The selection storage functionality is replaced by boolean
attributes. We already have a way to control the data in the boolean
attribute with the "Set Attribute" operator, but we didn't have a way to
convert the attribute into a selection.

This operator works on the active attribute if is a boolean attribute
and isn't on the face corner domain. It adds to the existing selection
similar to other existing operators.

While this behavior can be recreated as a node tool, we add it as a
builtin operator here to avoid limitations of the new node-based
tool system and to make the late-in-the-release-cycle change safer.
Campbell Barton approved these changes 2023-10-17 04:15:48 +02:00
Campbell Barton left a comment
Owner

Accepting with minor request.

Accepting with minor request.
@ -5361,0 +5427,4 @@
continue;
}
BMElem *elem;

Prefer to skip items when they're unchanged as this can add some overhead updating the display meshes, unnecessarily in some cases:

    changed = false;
    BMElem *elem;
    BMIter iter;
    BM_ITER_MESH (elem, &iter, bm, *iter_type) {
      if (BM_elem_flag_test(efa, BM_ELEM_HIDDEN | BM_ELEM_SELECT)) {
        continue; 
      } 
      if (BM_ELEM_CD_GET_BOOL(elem, layer->offset)) {
        BM_elem_select_set(bm, elem, true);
        changed = true;
      }
    }

    if (changed) {
      EDBM_selectmode_flush(em);

      DEG_id_tag_update(static_cast<ID *>(obedit->data), ID_RECALC_SELECT);
      WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
    }
Prefer to skip items when they're unchanged as this can add some overhead updating the display meshes, unnecessarily in some cases: ``` changed = false; BMElem *elem; BMIter iter; BM_ITER_MESH (elem, &iter, bm, *iter_type) { if (BM_elem_flag_test(efa, BM_ELEM_HIDDEN | BM_ELEM_SELECT)) { continue; } if (BM_ELEM_CD_GET_BOOL(elem, layer->offset)) { BM_elem_select_set(bm, elem, true); changed = true; } } if (changed) { EDBM_selectmode_flush(em); DEG_id_tag_update(static_cast<ID *>(obedit->data), ID_RECALC_SELECT); WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data); } ```
Hans Goudey added 2 commits 2023-10-17 09:24:06 +02:00
Hans Goudey merged commit 3d236bc858 into blender-v4.0-release 2023-10-17 09:25:00 +02:00
Hans Goudey deleted branch mesh-edit-select-by-attribute 2023-10-17 09:25:02 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
FBX
Interest
Freestyle
Interest
Geometry Nodes
Interest
glTF
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 & 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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
2 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#113772
No description provided.