Anim: don't include handles when calculating FCurve bounds in Graph Editor #120519

Merged
Christoph Lendenfeld merged 3 commits from ChrisLend/blender:graph_dont_calc_handles into main 2024-04-12 11:27:45 +02:00

On heavy scenes, the function get_graph_keyframe_extents takes up a considerable amount of the time (~50%) it takes to draw the Graph Editor.
This function is called to set the View2D extents which makes the sliders work properly.
I'd argue that level of precision isn't needed just to display sliders.
Passing the flag as false speeds up the drawing code by 22%.

Timings for graph_main_region_draw

Before After
32ms 25ms

Timings for get_graph_keyframe_extents

Before After
~16ms ~8ms

Test file used
https://download.blender.org/ftp/sybren/animation-rigging/heavy_mocap_test.blend


Before
image

After:
image

Notice the size of the sliders on the bottom and right has changed as a result of no longer factoring the handles in.
Test file attached

On heavy scenes, the function `get_graph_keyframe_extents` takes up a considerable amount of the time (~50%) it takes to draw the Graph Editor. This function is called to set the `View2D` extents which makes the sliders work properly. I'd argue that level of precision isn't needed just to display sliders. Passing the flag as `false` speeds up the drawing code by 22%. Timings for `graph_main_region_draw` | Before | After | | - | - | | 32ms | 25ms | Timings for `get_graph_keyframe_extents` | Before | After | | - | - | | ~16ms | ~8ms | Test file used https://download.blender.org/ftp/sybren/animation-rigging/heavy_mocap_test.blend ------ Before ![image](/attachments/4af14b61-84f1-41da-a326-6d978faca9c6) After: ![image](/attachments/10bd2504-f79b-4a0d-819a-ce07762a83ba) Notice the size of the sliders on the bottom and right has changed as a result of no longer factoring the handles in. Test file attached
Christoph Lendenfeld added the
Module
Animation & Rigging
label 2024-04-11 13:30:21 +02:00
Christoph Lendenfeld added 1 commit 2024-04-11 13:30:32 +02:00
Christoph Lendenfeld added 2 commits 2024-04-12 09:43:09 +02:00
Nathan Vegdahl approved these changes 2024-04-12 11:07:51 +02:00
Nathan Vegdahl left a comment
Member

Thanks for the pictures! Now I understand what you were talking about.

To me this seems totally fine:

  • In practice I don't think many people use the scroll bars for navigation. But even for people that do, the scroll bar extents don't actually affect how far you can drag them (just tested this). In other words, they're purely a visual indication of data bounds, with no effect on interaction.
  • Changing that visual indication to mean "the keys, without handles" seems just as useful to me as "the keys, with handles". It might actually be even more useful.
Thanks for the pictures! Now I understand what you were talking about. To me this seems totally fine: - In practice I don't think many people use the scroll bars for navigation. But even for people that do, the scroll bar extents don't actually affect how far you can drag them (just tested this). In other words, they're purely a visual indication of data bounds, with no effect on interaction. - Changing that visual indication to mean "the keys, without handles" seems just as useful to me as "the keys, with handles". It might actually be even more useful.

This function is called to set the View2D extents which makes the sliders work properly.

Given that there are also the "slider operators", maybe it's clearer to refer to those as the scrollbars? Or the scrollbar sliders?

And 👍 for the functionality, I agree that computing these extents is not the best use of CPU time.

> This function is called to set the `View2D` extents which makes the sliders work properly. Given that there are also the "slider operators", maybe it's clearer to refer to those as the scrollbars? Or the scrollbar sliders? And :+1: for the functionality, I agree that computing these extents is not the best use of CPU time.
Author
Member

Given that there are also the "slider operators", maybe it's clearer to refer to those as the scrollbars? Or the scrollbar sliders?

Ha yeah sorry was led astray by Tons comment which mentions sliders. Scrollbars is indeed the correct word to use

> Given that there are also the "slider operators", maybe it's clearer to refer to those as the scrollbars? Or the scrollbar sliders? Ha yeah sorry was led astray by Tons comment which mentions sliders. Scrollbars is indeed the correct word to use
Christoph Lendenfeld merged commit 0157fede80 into main 2024-04-12 11:27:45 +02:00
Christoph Lendenfeld deleted branch graph_dont_calc_handles 2024-04-12 11:27:48 +02: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 project
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#120519
No description provided.