GPv3: domain support for selection operators (domains point and stroke) #108970

Merged
Falk David merged 8 commits from SietseB/blender:gp3-select-modes into main 2023-06-19 16:12:18 +02:00
Member

This patch adds support for two of the three selection domains in the Edit Mode tool settings: point and stroke.

selection domain icons

Affected selection operators: select all, lasso select, select pick, box select.

This patch adds support for two of the three selection domains in the Edit Mode tool settings: point and stroke. ![selection domain icons](/attachments/b01e817b-d35b-4369-b5a1-ca889c4a035c) Affected selection operators: select all, lasso select, select pick, box select.
Sietse Brouwer added 1 commit 2023-06-14 12:17:38 +02:00
Sietse Brouwer added 1 commit 2023-06-14 12:33:37 +02:00
Sietse Brouwer requested review from Falk David 2023-06-14 12:34:08 +02:00
Sietse Brouwer added this to the Grease Pencil project 2023-06-14 12:34:15 +02:00
Hans Goudey reviewed 2023-06-14 14:25:47 +02:00
@ -144,0 +152,4 @@
case GP_SELECTMODE_STROKE:
return ATTR_DOMAIN_CURVE;
break;
case GP_SELECTMODE_SEGMENT:
Member

Hmm, currently I don't think there will ever be a "Segment" domain on curves.

Hmm, currently I don't think there will ever be a "Segment" domain on curves.
SietseB marked this conversation as resolved
@ -3204,3 +3227,3 @@
});
std::atomic<bool> deselected = false;
bool deselected = false;
Member

Removing atomic here seems unrelated, better to not do it now.

Removing `atomic` here seems unrelated, better to not do it now.
SietseB marked this conversation as resolved
Sietse Brouwer added 2 commits 2023-06-14 18:39:50 +02:00
Author
Member

You're fast, @HooglyBoogly! Thanks for the review. I've removed the 'segment' parts for now. Enough other fish to fry first.

You're fast, @HooglyBoogly! Thanks for the review. I've removed the 'segment' parts for now. Enough other fish to fry first.
Falk David requested changes 2023-06-15 14:09:11 +02:00
Falk David left a comment
Member

Thank you! This looks sensible to me, but since a few other non-interactive selection operators already landed in main, I think they should already be supported in this patch.

Thank you! This looks sensible to me, but since a few other non-interactive selection operators already landed in `main`, I think they should already be supported in this patch.
Author
Member

I skipped the operators that only work on the point domain:

  • Select first/last
  • Select more/less
  • Select linked
    They don't work on entire strokes.

Perhaps I should add an additional poll method for these operators, being disabled when in stroke selection mode?

I skipped the operators that only work on the `point` domain: - Select first/last - Select more/less - Select linked They don't work on entire strokes. Perhaps I should add an additional `poll` method for these operators, being disabled when in stroke selection mode?
Member

@SietseB Right, their poll method should fail in case the selection mode is 'stroke'. That will also mean the operators are grayed out in this case.

@SietseB Right, their poll method should fail in case the selection mode is 'stroke'. That will also mean the operators are grayed out in this case.
Sietse Brouwer added 2 commits 2023-06-19 11:17:00 +02:00
Author
Member

I've added the poll method.

I've added the `poll` method.
Falk David requested changes 2023-06-19 14:52:16 +02:00
Falk David left a comment
Member

Some small remaining comments.

Some small remaining comments.
@ -42,17 +43,28 @@ bool editable_grease_pencil_poll(bContext *C)
return true;
}
bool selection_domain_is_point_poll(bContext *C)
Member

selection_domain_is_point_poll -> editable_grease_pencil_point_selection_poll

`selection_domain_is_point_poll` -> `editable_grease_pencil_point_selection_poll`
SietseB marked this conversation as resolved
@ -144,0 +153,4 @@
return ATTR_DOMAIN_CURVE;
break;
default:
BLI_assert_unreachable();
Member

I would add a case GP_SELECTMODE_SEGMENT: return ATTR_DOMAIN_POINT and remove the default case + the BLI_assert_unreachable();

I would add a `case GP_SELECTMODE_SEGMENT: return ATTR_DOMAIN_POINT` and remove the `default` case + the `BLI_assert_unreachable();`
SietseB marked this conversation as resolved
Sietse Brouwer added 1 commit 2023-06-19 15:23:10 +02:00
Falk David requested changes 2023-06-19 15:40:29 +02:00
Falk David left a comment
Member

One last comment that I forgot last time.

One last comment that I forgot last time.
@ -42,17 +43,28 @@ bool editable_grease_pencil_poll(bContext *C)
return true;
}
bool editable_grease_pencil_point_selection_poll(bContext *C)
Member

This should be declared in ED_grease_pencil.h like editable_grease_pencil_poll.

This should be declared in `ED_grease_pencil.h` like `editable_grease_pencil_poll`.
filedescriptor marked this conversation as resolved
Sietse Brouwer added 1 commit 2023-06-19 16:10:44 +02:00
Falk David merged commit 3432fc0b87 into main 2023-06-19 16:12:18 +02:00
Falk David approved these changes 2023-06-19 16:12:20 +02:00
Sietse Brouwer deleted branch gp3-select-modes 2023-06-20 11:07:06 +02:00
Sign in to join this conversation.
No reviewers
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#108970
No description provided.