Outliner Tree is rebuilt every time you scrub the timeline #114828

Closed
opened 2023-11-14 10:20:09 +01:00 by Christoph Lendenfeld · 5 comments

System Information
Operating system: Linux Mint
Graphics card: RTX 3070

Blender Version
Broken: latest main
Worked: didn't check yet

Short description of error
When scrubbing the timeline on heavy scenes the update rate is significantly slower than when playing back.
After profiling the scene it turns out that the outliner tree is rebuilt on every frame when scrubbing.

Exact steps for others to reproduce the error
Based on the default startup or an attached .blend file (as simple as possible).

  • Open the attached file (it just has a bunch of instanced cubes)
  • scrub the timeline, then play back. Scrubbing is a lot slower

I ran the scene through a profiler to see what the exact issue is. That's how I found out that rebuilding the outliner tree is the difference/issue. That also means closing the outliner makes scrubbing faster.

Here's the flame graph for scrubbing the timeline
image

It may be, that rebuilding the tree is needed for some reason. But if possible we should really avoid doing it.

**System Information** Operating system: Linux Mint Graphics card: RTX 3070 **Blender Version** Broken: latest main Worked: didn't check yet **Short description of error** When scrubbing the timeline on heavy scenes the update rate is significantly slower than when playing back. After profiling the scene it turns out that the outliner tree is rebuilt on every frame when scrubbing. **Exact steps for others to reproduce the error** Based on the default startup or an attached .blend file (as simple as possible). * Open the attached file (it just has a bunch of instanced cubes) * scrub the timeline, then play back. Scrubbing is a lot slower I ran the scene through a profiler to see what the exact issue is. That's how I found out that rebuilding the outliner tree is the difference/issue. That also means closing the outliner makes scrubbing faster. Here's the flame graph for scrubbing the timeline ![image](/attachments/cd543c32-551e-4483-b8fc-8e7e0ae962fd) It may be, that rebuilding the tree is needed for some reason. But if possible we should really avoid doing it.
Member

Can confirm, I'll check

Can confirm, I'll check
Pratik Borhade added
Status
Confirmed
and removed
Status
Needs Triage
labels 2023-11-14 11:27:45 +01:00
Member

It seems this is due to the ND_FRAME notifier in change_frame_apply and change_frame_modal
Simple fix would be to remove ND_FRAME to avoid redraw in outliner_main_region_listener:
I think the purpose of redraw is to update outliner when object visibility is animated (cc @JulianEisel ).

diff --git a/source/blender/editors/space_outliner/space_outliner.cc b/source/blender/editors/space_outliner/space_outliner.cc
index c2a05ede58a..f26b679a44d 100644
--- a/source/blender/editors/space_outliner/space_outliner.cc
+++ b/source/blender/editors/space_outliner/space_outliner.cc
@@ -127,7 +127,6 @@ static void outliner_main_region_listener(const wmRegionListenerParams *params)
         case ND_OB_RENDER:
         case ND_MODE:
         case ND_KEYINGSET:
-        case ND_FRAME:
         case ND_RENDER_OPTIONS:
         case ND_SEQUENCER:
         case ND_LAYER_CONTENT:
It seems this is due to the `ND_FRAME` notifier in `change_frame_apply` and `change_frame_modal` Simple fix would be to remove `ND_FRAME` to avoid redraw in `outliner_main_region_listener`: I think the purpose of redraw is to update outliner when object visibility is animated (cc @JulianEisel ). ``` diff --git a/source/blender/editors/space_outliner/space_outliner.cc b/source/blender/editors/space_outliner/space_outliner.cc index c2a05ede58a..f26b679a44d 100644 --- a/source/blender/editors/space_outliner/space_outliner.cc +++ b/source/blender/editors/space_outliner/space_outliner.cc @@ -127,7 +127,6 @@ static void outliner_main_region_listener(const wmRegionListenerParams *params) case ND_OB_RENDER: case ND_MODE: case ND_KEYINGSET: - case ND_FRAME: case ND_RENDER_OPTIONS: case ND_SEQUENCER: case ND_LAYER_CONTENT: ```
Author
Member

redrawing the outliner is fine, and we need that if e.g. the visibility is animated.
I am just wondering if we need to rebuild the whole tree for that

redrawing the outliner is fine, and we need that if e.g. the visibility is animated. I am just wondering if we need to rebuild the whole tree for that
Member

Redrawing the outliner on frame changes is definitely needed, not just for visibility changes, we also show animated properties in the Data API and library overrides display mode for example.

If there is no case where the tree actually changes on frame changes (like items added/removed or reordered), we can tag the region with ED_region_tag_redraw_no_rebuild() instead. Then the region would be redrawn but the tree not rebuilt.

We used to rebuild the tree a lot, nowadays we try to be more careful since it can have a significant performance impact.

Redrawing the outliner on frame changes is definitely needed, not just for visibility changes, we also show animated properties in the Data API and library overrides display mode for example. If there is no case where the tree actually changes on frame changes (like items added/removed or reordered), we can tag the region with `ED_region_tag_redraw_no_rebuild()` instead. Then the region would be redrawn but the tree not rebuilt. We used to rebuild the tree a lot, nowadays we try to be more careful since it can have a significant performance impact.
Author
Member

thanks, that makes sense. Off the top of my head I can't think of anything that would modify the scene during scrubbing but not playback, but I'll do some digging.

thanks, that makes sense. Off the top of my head I can't think of anything that would modify the scene during scrubbing but not playback, but I'll do some digging.
Christoph Lendenfeld self-assigned this 2023-11-14 15:50:13 +01:00
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-12-05 11:04:37 +01:00
Sign in to join this conversation.
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
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#114828
No description provided.