Fix #95855: prioritize selecting keys on active fcurve #107223
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#107223
Loading…
Reference in New Issue
No description provided.
Delete Branch "nathanvegdahl/blender:overlapping_key_selection"
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 addresses #95855 by prioritizing the selection of keys in the following order:
@ -291,0 +292,4 @@
/* Try to find the next vert that's on the active fcurve, falling back to the next
* vert on any selected fcurve if that's not found. */
tNearestVertInfo *nvi_to_select = NULL;
for (tNearestVertInfo *nvi = matches->first; nvi != nvi_first_selected; nvi = nvi->next) {
Note to self when I'm back in the office:
Although the
nvi != nvi_first_selected
check works sincenvi_first_selected
will be null if no selected vert was found, this isn't immediately obvious skimming the code, and feels delicate and easily breakable by future changes. So perhaps being explicit and doingnvi && nvi != nvi_first_selected
would be better here, even though it's functionally unnecessary.71b280bf1d
to091d3508f5
I've left a few ideas to test out.
@ -288,1 +278,3 @@
/* if vert is selected, we've got what we want... */
/* Find the first selected vert in `matches` if one exists. */
tNearestVertInfo *nvi_first_selected = NULL;
for (tNearestVertInfo *nvi = matches->first; nvi; nvi = nvi->next) {
Use the
LISTBASE_FOREACH()
for such loops, they improve readability.Yes, much better! Thanks!
@ -291,0 +293,4 @@
/* Try to find the next vert that's on the active fcurve, falling back to the next
* vert on any selected fcurve if that's not found. */
tNearestVertInfo *nvi_to_select = NULL;
for (tNearestVertInfo *nvi = matches->first; nvi && nvi != nvi_first_selected; nvi = nvi->next) {
Maybe here do a
LISTBASE_FOREACH
, and put thenvi != nvi_first_selected
into the body, something like this (haven't actually tested this):Yeah, this and your other comment below helped me flatten things out in a nice way that makes the code much clearer and a little less delicate, I think. Thanks!
@ -291,0 +297,4 @@
if (nvi->fcu->flag & FCURVE_ACTIVE) {
nvi_to_select = nvi;
break;
} else if (nvi->fcu->flag & FCURVE_SELECTED && !nvi_to_select) {
No
else
after abreak
. Also this seems like your editor isn't automatically using clang-format yet.Ah! Thanks for the reminder. I set it up in vscode, but forgot to do so in Helix as well.
LGTM!