Fix #105430: Curves pick select selects multiple objects #105495

Merged
Hans Goudey merged 5 commits from HooglyBoogly/blender:fix-curves-pick-select-multi-object into blender-v3.5-release 2023-03-07 21:39:58 +01:00
Member

Pick select is only meant to change a single element from a single
data-block. However, the operator worked on each object individually
rather than first finding the closest point, then processing the
selection. Change the operator to find the closest point across all
objects, then deselect if necessary, then select the closest point.

Pick select is only meant to change a single element from a single data-block. However, the operator worked on each object individually rather than first finding the closest point, then processing the selection. Change the operator to find the closest point across all objects, then deselect if necessary, then select the closest point.
Hans Goudey added this to the 3.5 milestone 2023-03-06 16:47:40 +01:00
Hans Goudey added the
Module
Nodes & Physics
label 2023-03-06 16:47:40 +01:00
Hans Goudey added 1 commit 2023-03-06 16:47:56 +01:00
6a0c6fe156 Fix #105430: Curves pick select selects multiple objects
Pick select is only meant to change a single element from a single
data-block. However, the operator worked on each object individually
rather than first finding the closest point, then processing the
selection. Change the operator to find the closest point across all
objects, then deselect if necessary, then select the closest point.
Hans Goudey requested review from Falk David 2023-03-06 16:48:26 +01:00
Hans Goudey reviewed 2023-03-06 16:48:54 +01:00
@ -3004,0 +3037,4 @@
});
std::atomic<bool> deselected = false;
if (params.deselect_all || params.sel_op == SEL_OP_SET) {
Author
Member

I think I'm misunderstanding this check-- the deselection never seems to run.

I think I'm misunderstanding this check-- the deselection never seems to run.
Member

It looks like the call to ed::curves::has_anything_selected(curves) is always returning false when it should return true in case something is selected.

It looks like the call to `ed::curves::has_anything_selected(curves)` is always returning `false` when it should return `true` in case something is selected.
Member

Using if (ed::curves::has_anything_selected(selection.span)) { on the selection span seems to fix the issue for me. Looks like the other function is not doing what we expect it to.

Using `if (ed::curves::has_anything_selected(selection.span)) {` on the selection span seems to fix the issue for me. Looks like the other function is not doing what we expect it to.
Author
Member

Thanks for checking that. Fixed in ea80e14464

Thanks for checking that. Fixed in ea80e144648905c60540e1d7281c6cdec1f528b6
HooglyBoogly marked this conversation as resolved
Hans Goudey added this to the Nodes & Physics project 2023-03-06 17:18:22 +01:00
Falk David requested changes 2023-03-07 20:02:31 +01:00
Falk David left a comment
Member

Overall, I think it makes sense to do it this way.

Overall, I think it makes sense to do it this way.
@ -3004,0 +3022,4 @@
ed::curves::closest_elem_find_screen_space(vc,
curves_ob,
curves_id.geometry.wrap(),
eAttrDomain(curves_id.selection_domain),
Member

This is problematic because we might be mixing selection modes, when we should really be just using the one of the active object (I believe that is what's used to decide what to draw too).

This is problematic because we might be mixing selection modes, when we should really be just using the one of the active object (I believe that is what's used to decide what to draw too).
Author
Member

Good point!

Good point!
HooglyBoogly marked this conversation as resolved
@ -3024,2 +3061,2 @@
WM_event_add_notifier(&C, NC_GEOM | ND_DATA, &curves_id);
}
if (!closest.curves_id) {
return deselected;
Member

Needs a MEM_freeN(bases_ptr).

Needs a `MEM_freeN(bases_ptr)`.
HooglyBoogly marked this conversation as resolved
Hans Goudey added 4 commits 2023-03-07 21:26:07 +01:00
Hans Goudey changed title from WIP: Fix #105430: Curves pick select selects multiple objects to Fix #105430: Curves pick select selects multiple objects 2023-03-07 21:26:24 +01:00
Hans Goudey requested review from Falk David 2023-03-07 21:26:28 +01:00
Falk David approved these changes 2023-03-07 21:37:46 +01:00
Falk David left a comment
Member

Looks good!

Looks good!
Hans Goudey merged commit 281f383c23 into blender-v3.5-release 2023-03-07 21:39:58 +01:00
Hans Goudey deleted branch fix-curves-pick-select-multi-object 2023-03-07 21:40:00 +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#105495
No description provided.