Fix #97202: Channels of animation editors disappearing when applying filters #118006
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#118006
Loading…
Reference in New Issue
No description provided.
Delete Branch "ChrisLend/blender:fix_channels_filter_to_empty"
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?
Note: while the report only mentions the Dope Sheet, this fix is applied to
the Graph Editor and NLA editor as well since they had the same issues.
The issue is that when applying filters, the list of channels shrink, but the
View2D
isn't updated accordingly.When you move the viewport, the channels would jump back into view but not before.
The total height of the channel stack is computed every frame,
and the issue is fixed by calling the
UI_view2d_curRect_clamp_y
after that.Since this has to be done before
UI_view2d_view_ortho
is called, I had to extractthe height calculations into the caller function.
I thought about making a generic function for all 3 editors but they were too different
to meaningfully do that.
I removed the fix that stopped the channels going off screen when using the cursor to scroll,
since the new logic already does that.
Also fixes #46649
@ -31,0 +30,4 @@
void graph_draw_channel_names(struct bContext *C,
struct bAnimContext *ac,
struct ARegion *region,
ListBase /* bAnimElem */ *anim_data);
Would these be
bAnimListElem
?Also, why is this a pointer, while the other two are references?
🤦 yes you are right
not sure why I made this one a pointer, changed it to a const reference
@ -990,7 +984,6 @@ void draw_nla_track_list(const bContext *C, bAnimContext *ac, ARegion *region)
}
/* free temporary tracks */
Comment is now irrelevant.
@ -31,0 +30,4 @@
void draw_nla_track_list(const bContext *C,
bAnimContext *ac,
ARegion *region,
const ListBase /* bAnimElem */ &anim_data);
Same here: would these be
bAnimListElem
?LGTM :)
There are a couple of code comments that look like they don't belong to any code anymore. But otherwise, looks good to me.
@ -1539,4 +1532,4 @@
/* Update max-extent of channels here (taking into account scrollers):
* - this is done to allow the channel list to be scrollable, but must be done here
* to avoid regenerating the list again and/or also because channels list is drawn first */
Is this comment still relevant? I might be mis-reading it, but I think it was referring to the code that got removed.
@ -932,8 +928,6 @@ void draw_nla_track_list(const bContext *C, bAnimContext *ac, ARegion *region)
* - offset of NLATRACK_HEIGHT*2 is added to the height of the tracks, as first is for
* start of list offset, and the second is as a correction for the scrollers.
*/
This also looks like a comment for now-deleted code. (It also looks out-of-date even for the code that was there.)
Looking through this again, the only remaining (mild) reservation I have is due to the removal of the
on_view2d_changed
callbacks. The callbacks aren't needed anymore, of course, since the relevant updates are now handled while drawing. So it's not their removal per se that gives me reservations. But rather, it makes me wonder if these kinds of things are supposed to be handled in theon_view2d_changed
callback, and thus if this PR is the "right" fix. Some of the discussion in #46649 (particularly @dr.sybren's comments) also make me wonder.I think another approach that could work would be to split the height calculation out into a separate function that also gets called from the
on_view2d_changed
callback to make the appropriate updates.In any case, I don't personally feel strongly one way or the other, so I'm approving. But it might indeed be good to wait for a review from @dr.sybren as well before merging, after all.
I will wait for sybren then, but since each view change also triggers a redraw I don't think
on_view2d_changed
is needed in this case.What we'd need is a
on_view2d_containing_data_changed
or similar to fix this issue in a callback.LGTM, just a few tiny comments that can be addressed when landing.
@ -56,3 +56,3 @@
* \{ */
void draw_channel_names(bContext *C, bAnimContext *ac, ARegion *region)
void draw_channel_names(bContext *C, bAnimContext *ac, ARegion *region, const ListBase &anim_data)
Can have a comment here too:
const ListBase /*bAnimListElem*/ &anim_data
@ -1525,0 +1524,4 @@
void graph_draw_channel_names(bContext *C,
bAnimContext *ac,
ARegion *region,
const ListBase &anim_data)
Same, add comment to
ListBase