Fix #114828: Don't rebuild outliner tree when frame scrubbing

Before this PR, whenever the frame changed during scrubbing,
the whole outliner tree would be rebuilt.
This rebuilding did not happen when playing back.
This was a major bottleneck, especially on scenes with many objects.

As far as I can tell there is no need to do that,
since there is no function that changes the
scene structure when the frame is changed.
The only way to do that is to add a python handler
for `post_frame_change`, but that also fires when playing back.

The performance gains can be quite significant.
I've made a scene with 32.000 cubes
and the `wm_draw_update` function goes from
~60ms
to
~30ms

Pull Request: https://projects.blender.org/blender/blender/pulls/114845
This commit is contained in:
Christoph Lendenfeld
2023-12-05 11:04:24 +01:00
committed by Christoph Lendenfeld
parent 5fea1eda36
commit b549260aa4

View File

@@ -123,11 +123,14 @@ static void outliner_main_region_listener(const wmRegionListenerParams *params)
ED_region_tag_redraw_no_rebuild(region);
}
break;
case ND_FRAME:
/* Rebuilding the outliner tree is expensive and shouldn't be done when scrubbing. */
ED_region_tag_redraw_no_rebuild(region);
break;
case ND_OB_VISIBLE:
case ND_OB_RENDER:
case ND_MODE:
case ND_KEYINGSET:
case ND_FRAME:
case ND_RENDER_OPTIONS:
case ND_SEQUENCER:
case ND_LAYER_CONTENT: