GPv3: Merge by distance Operator #120385
No reviewers
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#120385
Loading…
Reference in New Issue
No description provided.
Delete Branch "Chao-Li/blender:merge-by-distance"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The algorithm to merge points based on distance threshold has been implemented in
8b7d5f8587
. This patch moves the function to blender::ed::greasepencil namespace and use it to implement merge by distance operator.There are two parameters for the operator:
threshold
: Distance threshold used for merging.use_unselected
: Use whole stroke or only selected pointsIssue: #113917
1182a86ff3
to92c0becba1
Why this is not in geometry module?
@mod_moder @HooglyBoogly was not in favor of putting it in the geometry module: #118616 (comment)
ace52265fd
tod67b577f23
Added some cleanup comments.
@ -2436,0 +2445,4 @@
const float threshold = RNA_float_get(op->ptr, "threshold");
const bool use_unselected = RNA_boolean_get(op->ptr, "use_unselected");
bool changed = false;
For correctness, this should be
std::atomic<bool>
.@ -2436,0 +2451,4 @@
threading::parallel_for_each(drawings, [&](const MutableDrawingInfo &info) {
bke::greasepencil::Drawing &drawing = info.drawing;
IndexMaskMemory memory;
IndexMask points = use_unselected ?
const IndexMask
@ -2436,0 +2458,4 @@
if (points.is_empty()) {
return;
}
const bke::CurvesGeometry &curves = drawing.strokes();
The
curves
variable is not needed. It's ok to passdrawing.strokes()
to the merge by distance function.@ -8292,6 +8292,7 @@ class VIEW3D_MT_greasepencil_edit_context_menu(Menu):
col.separator()
col.operator("grease_pencil.stroke_merge_by_distance", text="Merge by Distance")
Hi, Instead expose operator in
clean up
menu:VIEW3D_MT_edit_greasepencil_cleanup
(same as GPv2)
Hi. I updated the patch. Just to confirm, is "PAINT_GREASE_PENCIL" in the gpv3 the equivalent of "PAINT_GPENCIL" in gpv2?
Thanks.
Yes, see:
rna_enum_context_mode_items
Checkout
From your project repository, check out a new branch and test the changes.