Curves: Add select linked #104569
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#104569
Loading…
Reference in New Issue
No description provided.
Delete Branch "filedescriptor/blender:curves-select-linked"
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?
This adds a new
select_linked
function that selects all the pointson a curve if there is at least one point already selected.
This also adds a keymap for the operator.
Just a few small comments.
@ -985,1 +985,4 @@
static int select_linked_exec(bContext *C, wmOperator */*op*/)
{
VectorSet<Curves *> unique_curves = curves::get_unique_editable_curves(*C);
(I know, copied code) but the
curves::
namespace specification shouldn't be necessary here, since we're already in that namespace.@ -986,0 +989,4 @@
for (Curves *curves_id : unique_curves) {
CurvesGeometry &curves = curves_id->geometry.wrap();
select_linked(curves);
/* Use #ID_RECALC_GEOMETRY instead of #ID_RECALC_SELECT because it is handled as a generic
Might be nice to replace these three lines with a utility function like
update_tag_selection_changed(C, curves_id)
, especially so that comment doesn't have to be repeated everywhere. A separate commit though obviously.I can create a PR for this after, yes.
@ -986,0 +1002,4 @@
{
ot->name = "Select Linked";
ot->idname = __func__;
ot->description = "Select linked points of curves";
Best to avoid reusing the word "linked" in the description. How about
Select all points in curves with any point selection
?@ -240,0 +250,4 @@
threading::parallel_for(curves.curves_range(), 256, [&](const IndexRange range) {
for (const int curve_i : range) {
MutableSpan<T> selection_curve_typed = selection_typed.slice(points_by_curve[curve_i]);
if (selection_curve_typed.as_span().contains(T(1))) {
For proper float support, this should probably check for anything greater than 0, right?
I'd suggest separating that check to a small local function BTW as a way to give it a nice name and to make it easier to generalize in the future if we want to.
@ -92,0 +92,4 @@
/**
* Return true if any element in the span is selected, on either domain with either type.
*/
bool has_any_selected(const GSpan selection);
Not that it's better, but maybe using the same name
has_anything_selected
would be better for consistency?Looks great!
@ -91,1 +91,4 @@
/**
* Return true if any element in the span is selected, on either domain with either type.
*/
const GSpan selection
->GSpan selection