Fix #94080: clicking empty space in timeline creates undo step #105913

Open
Melissa-Goon wants to merge 7 commits from Melissa-Goon/blender:my-feature into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
First-time contributor

When nothing is found once mouse is released, return OPERATOR_CANCELLED so no undo step is created.

When nothing is found once mouse is released, return OPERATOR_CANCELLED so no undo step is created.
Melissa-Goon added 1 commit 2023-03-20 05:57:24 +01:00
Melissa-Goon added 1 commit 2023-03-20 05:59:13 +01:00
Member

Hi, thanks for the PR. This is a nice improvement.
Though clicking over empty area of timeline/dopesheet selects channel within the clicked region, which is working as expected from code perspective.
So undo step will still be created when no keyframe is selected/deselected (due to selection of channels. see video).
Not sure how to proceed further. Maybe @dr.sybren can have a look at this.

Hi, thanks for the PR. This is a nice improvement. Though clicking over empty area of timeline/dopesheet selects channel within the clicked region, which is working as expected from code perspective. So undo step will still be created when no keyframe is selected/deselected (due to selection of channels. see video). Not sure how to proceed further. Maybe @dr.sybren can have a look at this.
Pratik Borhade requested changes 2023-03-20 15:04:07 +01:00
@ -1748,3 +1748,3 @@
/* reset selection mode for next steps */
select_mode = SELECT_ADD;
Member

remove trailing whitespaces and new-lines

remove trailing whitespaces and new-lines
Melissa-Goon marked this conversation as resolved
Sybren A. Stüvel requested changes 2023-03-21 17:48:35 +01:00
Sybren A. Stüvel left a comment
Member

Thanks for the patch @Melissa-Goon !

To expand on what @PratikPB2123 already said: a patch should contain either functional changes (as in, change the functionality of Blender) or non-functional changes (like cleaning up formatting of the code, doing refactors of the code that don't change its functionality, etc). Mixing both in the same patch is something that's not allowed here, as it makes it much harder to later look at the history of a file and understand what happened.

You can run make format to let the auto-formatter do its work, and/or configure your editor for auto-formatting with Clang-Format. You can read more about this in the style guide.

Thanks for the patch @Melissa-Goon ! To expand on what @PratikPB2123 already said: a patch should contain either functional changes (as in, change the functionality of Blender) or non-functional changes (like cleaning up formatting of the code, doing refactors of the code that don't change its functionality, etc). Mixing both in the same patch is something that's not allowed here, as it makes it much harder to later look at the history of a file and understand what happened. You can run `make format` to let the auto-formatter do its work, and/or configure your editor for auto-formatting with Clang-Format. You can read more about this in the [style guide](https://wiki.blender.org/wiki/Style_Guide/C_Cpp).
@ -1759,1 +1759,3 @@
/* If nothing selected, return OPERATOR_CANCELLED.*/
if (!found && ale == NULL) {

This condition doesn't depend on anything inside this else clause, so it can be moved outside of it. I think that's also better, because after deselect_action_keys() has called something may have changed, and having that undo step is important.

found and ale do not change after the call to actkeys_find_key_at_position(), so this code can be moved directly after that.

This condition doesn't depend on anything inside this `else` clause, so it can be moved outside of it. I think that's also better, because after `deselect_action_keys()` has called something may have changed, and having that undo step is important. `found` and `ale` do not change after the call to `actkeys_find_key_at_position()`, so this code can be moved directly after that.
Melissa-Goon marked this conversation as resolved
Sybren A. Stüvel added the
Module
Animation & Rigging
label 2023-03-21 17:48:49 +01:00
Sybren A. Stüvel added this to the Animation & Rigging project 2023-03-21 17:48:55 +01:00
Author
First-time contributor

Thank you for the feedback, I'll get on it asap!

Thank you for the feedback, I'll get on it asap!
Melissa-Goon added 2 commits 2023-03-24 21:14:55 +01:00
Melissa-Goon force-pushed my-feature from c78793a09f to 6b22a61d22 2023-03-24 21:45:13 +01:00 Compare
Melissa-Goon requested review from Pratik Borhade 2023-03-24 21:46:49 +01:00
Member

Hi, could you update the PR with main? action_select.c file is now moved to c++, see: e858be84fa

For updating the PR, refer this wiki page

Hi, could you update the PR with main? `action_select.c` file is now moved to c++, see: e858be84fa7ea438006bc2e174f537ad92a3eda4 For updating the PR, refer this [wiki page](https://wiki.blender.org/wiki/Tools/Pull_Requests#Workflow:~:text=Update%20a%20Pull%20Request)
Melissa-Goon added 1 commit 2023-03-25 23:46:32 +01:00
Melissa-Goon changed title from WIP: Fix #94080: clicking empty space in timeline creates undo step to Fix #94080: clicking empty space in timeline creates undo step 2023-03-25 23:58:02 +01:00
Pratik Borhade requested changes 2023-03-26 12:32:54 +02:00
Pratik Borhade left a comment
Member

Hi, thanks for updating. Now the undo step is not created when deselecting channel/keyframes with left click. Apart from this issue, change looks good and harmless.

Hi, thanks for updating. Now the undo step is not created when deselecting channel/keyframes with left click. Apart from this issue, change looks good and harmless.
Melissa-Goon added 1 commit 2023-03-27 22:10:33 +02:00
Merge conflict checking is in progress. Try again in few moments.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u my-feature:Melissa-Goon-my-feature
git checkout Melissa-Goon-my-feature
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
3 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#105913
No description provided.