Curves: Add lasso and circle select #104560

Merged
Falk David merged 7 commits from filedescriptor/blender:curves-mouse-selection into main 2023-02-10 19:06:10 +01:00
Member

This adds a select_lasso and a select_circle function for the Curves object. It is used in the view3d_lasso_select and view3d_circle_select operator.

This adds a `select_lasso` and a `select_circle` function for the Curves object. It is used in the `view3d_lasso_select` and `view3d_circle_select` operator.
Falk David requested review from Hans Goudey 2023-02-10 11:05:06 +01:00
Falk David added this to the Nodes & Physics project 2023-02-10 11:05:15 +01:00
Falk David changed title from Curves: Add lasso select to Curves: Add lasso and circle select 2023-02-10 11:28:25 +01:00
Hans Goudey requested changes 2023-02-10 14:31:41 +01:00
Hans Goudey left a comment
Member

Looks pretty good, just a few small requests.

Looks pretty good, just a few small requests.
@ -471,3 +591,3 @@
ED_view3d_project_float_v2_m4(
vc.region, deformation.positions[point_i], pos_proj, projection.ptr());
if (BLI_rctf_isect_pt_v(&rectf, pos_proj)) {
if (len_squared_v2v2(float2(coord), pos_proj) <= radius_sq) {
Member

math::distance_squared

`math::distance_squared`
filedescriptor marked this conversation as resolved
@ -159,1 +159,4 @@
const eSelectOp sel_op);
/**
* Select points or curves in a (screen-space) polyshape.
Member

polyshape -> poly shape. Picky, but not sure I've seen that as one word before

`polyshape` -> `poly shape`. Picky, but not sure I've seen that as one word before
filedescriptor marked this conversation as resolved
@ -160,0 +163,4 @@
*/
bool select_lasso(const ViewContext &vc,
bke::CurvesGeometry &curves,
const eAttrDomain selection_domain,
Member

const eAttrDomain selection_domain -> eAttrDomain selection_domain

Const for by-value types is meaningless in declarations, it only means something in the definition. Same with the other by-value arguments.

`const eAttrDomain selection_domain` -> `eAttrDomain selection_domain` Const for by-value types is meaningless in declarations, it only means something in the definition. Same with the other by-value arguments.
Author
Member

Looks like this is the case for a whole bunch of declarations. Should I change that in a separate commit?

Looks like this is the case for a whole bunch of declarations. Should I change that in a separate commit?
Member

Sure, but the new code should follow that IMO

Sure, but the new code should follow that IMO
filedescriptor marked this conversation as resolved
@ -160,0 +164,4 @@
bool select_lasso(const ViewContext &vc,
bke::CurvesGeometry &curves,
const eAttrDomain selection_domain,
const int coords[][2],
Member

Span<int2> coords

`Span<int2> coords`
filedescriptor marked this conversation as resolved
@ -1363,2 +1364,4 @@
changed = do_lasso_select_meta(vc, mcoords, mcoords_len, sel_op);
break;
case OB_CURVES: {
Curves &curves_id = *static_cast<Curves *>(vc->obact->data);
Member

Looks like we use vc->obact here and vc->obedit for the update tab below. Is that on purpose?

Looks like we use `vc->obact` here and `vc->obedit` for the update tab below. Is that on purpose?
filedescriptor marked this conversation as resolved
Falk David requested review from Hans Goudey 2023-02-10 18:56:44 +01:00
Hans Goudey reviewed 2023-02-10 19:02:34 +01:00
@ -451,0 +499,4 @@
bool select_lasso(const ViewContext &vc,
bke::CurvesGeometry &curves,
const eAttrDomain selection_domain,
Span<int2> coords,
Member

In the definition const is still nice though ;)

Span<int2> coords -> const Span<int2> coords

In the definition const is still nice though ;) `Span<int2> coords` -> `const Span<int2> coords`
Hans Goudey approved these changes 2023-02-10 19:03:48 +01:00
Hans Goudey left a comment
Member

Looking good!

Looking good!
Falk David force-pushed curves-mouse-selection from 14c8732790 to 0e24475084 2023-02-10 19:04:27 +01:00 Compare
Falk David added 1 commit 2023-02-10 19:05:35 +01:00
Falk David merged commit 7351f533e0 into main 2023-02-10 19:06:10 +01:00
Falk David deleted branch curves-mouse-selection 2023-02-10 19:06:11 +01: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 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#104560
No description provided.