GPv3: Select Similar #109734

Open
opened 2023-07-05 12:34:11 +02:00 by Falk David · 6 comments
Member

This operator should replace the GPENCIL_OT_select_grouped and GPENCIL_OT_select_vertex_color operators.

Difficulty: 🔴🔴🔴

Add a new operator GREASE_PENCIL_OT_select_similar in blender/source/blender/editors/grease_pencil/intern/grease_pencil_select.cc. It should have an enum for the type, values for comparing to color, and floats as well as a threshold. The type should support layer, material, vertex_color, radius and opacity.
It's probably a good idea to write a static templated function that can return an IndexMask (either for the curves domain or the point domain) with the curves/points that should be selected. Something like mask_similar_elements.
Then it's possible to use index_mask::masked_fill to fill the masked indices in the selection attribute. Similar to how it is done in select_ends_exec in blender/source/blender/editors/curves/intern/curves_ops.cc.

This operator should replace the `GPENCIL_OT_select_grouped` and `GPENCIL_OT_select_vertex_color` operators. Difficulty: 🔴🔴🔴 Add a new operator `GREASE_PENCIL_OT_select_similar` in `blender/source/blender/editors/grease_pencil/intern/grease_pencil_select.cc`. It should have an enum for the `type`, values for comparing to color, and floats as well as a threshold. The type should support `layer`, `material`, `vertex_color`, `radius` and `opacity`. It's probably a good idea to write a static templated function that can return an `IndexMask` (either for the curves domain or the point domain) with the curves/points that should be selected. Something like `mask_similar_elements`. Then it's possible to use `index_mask::masked_fill` to fill the masked indices in the selection attribute. Similar to how it is done in `select_ends_exec` in `blender/source/blender/editors/curves/intern/curves_ops.cc`.
Falk David added the
Type
To Do
label 2023-07-05 12:34:11 +02:00
Falk David added this to the Grease Pencil project 2023-07-05 12:34:13 +02:00

Other selection could be added to this operator like select similar stroke length, vertex group, etc. See
https://projects.blender.org/blender/blender/pulls/104502#issuecomment-884237

Other selection could be added to this operator like select similar **stroke length**, **vertex group**, etc. See [https://projects.blender.org/blender/blender/pulls/104502#issuecomment-884237](url)
Contributor

Hello. Has this task been taken? Although this seems a bit challenging to me, I'd like to give it a try.

Hello. Has this task been taken? Although this seems a bit challenging to me, I'd like to give it a try.
Author
Member

@Chao-Li Not as far as I know. If you want to give it a try, I'll move the task to the In Progress column

@Chao-Li Not as far as I know. If you want to give it a try, I'll move the task to the In Progress column
Contributor

Thank you but please leave it in the To Do column for now. I just took a closer look. I feel like it's out of my scope and it may take more time than I have to figure it out. Hopefully someone will pick this up soon. I look forward to contribute to other community tasks in the future!

Thank you but please leave it in the To Do column for now. I just took a closer look. I feel like it's out of my scope and it may take more time than I have to figure it out. Hopefully someone will pick this up soon. I look forward to contribute to other community tasks in the future!
Contributor

If it's not urgent, I would like to pick up this task :)

If it's not urgent, I would like to pick up this task :)
Author
Member

@Lorenzo-Carpaneto Great. I moved it to the "In Progress" column

@Lorenzo-Carpaneto Great. I moved it to the "In Progress" column
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
4 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#109734
No description provided.