Anim: Ctrl-shift channel selection. #118429
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#118429
Loading…
Reference in New Issue
No description provided.
Delete Branch "PratikPB2123/blender:anim-ctrl-shift-channels"
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?
New keymap (ctrl-shift LMB) to extend range selection without clearing
previous selection.
In
click_select_channel_*
functions, order ofextend_range
andextend
is interchanged.
Resolves #108448
WIP: Anim: Ctrl-shift channel selection.to Anim: Ctrl-shift channel selection.@ -3599,3 +3601,2 @@
{"properties": [("extend", True)]}),
("anim.channels_click", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True},
{"properties": [("children_only", True)]}),
# ("anim.channels_click", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True},
I've commented this keymap. Does anyone have alternative keymap for
children_only
? 🙂I suggest Ctrl + Alt + LEFTMOUSE
This is also unused in the outliner so we might be able to introduce it there as well. Selecting the hierarchy can be quite useful.
I noticed though in the channels this isn't even working properly. It only works when selecting the FCurve group, not e.g. the action or the object channel. But that's for a different time to fix
I am unsure about the decision to turn the
selectmode
into a bitflag.This can now have conflicting flags which makes things confusing.
I suggest moving the
SELECT_INVERT
flag into a separate boolean so you can keep the mode a simple enum class.That way you can also use
switch
statements.I'll let @dr.sybren be the judge on this though because this bloats the PR a bit.
@ -3494,4 +3504,1 @@
ANIM_anim_channels_select_set(ac, ACHANNEL_SETFLAG_EXTEND_RANGE);
animchannel_select_range(ac, ale);
}
else if (selectmode == -1) {
This PR also changes the behavior of
children_only
because this will now only work if no selection flags are set. Because ofselectmode |= -1
further down.oops wrong button
Thanks for the patch Pratik!
I think that these changes clearly show the limitations of Blender's existing code. For extra clarity: I'm pointing out problems in the existing code here, not yours, Pratik. Some of the code is over a decade old, and it shows.
short selectmode
(instead of using theeEditKeyframes_Select
enum type). Furthermore, there is a "special" value that's used that is not part of the enum (-1
) that may or may not be interpreted differently by different parts of the code.eEditKeyframes_Select
enum items have values that suggest they can be used as bitflags, but still the code that's interpreting them doesn't use them as such. Instead, direct comparison (selectmode == SELECT_xxx
) is used.Since in this PR the combinatory bitflags of
selectmode
are used much more, I think this warrants a bit of a bigger refactor, whereselectmode
is actually passed aseEditKeyframes_Select
. For that to work, you have to addENUM_OPERATORS(eEditKeyframes_Select, SELECT_EXTEND_RANGE);
right after theenum eEditKeyframes_Select
declaration.@PratikPB2123 would you be up for that?
@ -3917,2 +3930,3 @@
int notifierFlags = 0;
short selectmode;
short selectmode = 0;
bool select_mode_set = false;
This
bool
doesn't seem necessary. Just initialiseshort selectmode = SELECT_EXTEND_RANGE
and then overwrite that value when necessary.@ -3938,3 +3954,3 @@
/* this is a bit of a special case for ActionGroups only...
* should it be removed or extended to all instead? */
selectmode = -1;
selectmode |= -1;
|= -1
is a bit of a dubious operation.-1
is all-ones in two's complement, which means that you're OR-ing with all-ones, which means that you're effectively setting the value to-1
. So why not just set the value to that directly?Hi, sure. Want me to do the refactor in separate PR? I can do that.
Checkout
From your project repository, check out a new branch and test the changes.