diff options
author | Julian Eisel <julian@blender.org> | 2022-05-30 13:49:36 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-05-30 16:17:50 +0300 |
commit | 1f858772638d61a20add3d4c9cdbb6e20e24ff15 (patch) | |
tree | 0dabee0f66506d4a747056a336e7beafd20584b4 /source/blender/editors/space_outliner | |
parent | a8471459fd18f356f730c684665c8dadadad723d (diff) |
Fix T98461: Crash running screenshot from the command-line
When launching Blender with a script creating a screenshot, the Outliner
tree wasn't initialized and built properly. That is because at this
stage, all visible regions were only tagged for a non-rebuild redraw,
not a full redraw. So ensure all regions are tagged for a full redraw
immediately after file reading. Usually the full redraw would be caused
by a file-read notifier, but the Python expression/script is executed
before notifiers are handled.
Note that even before this was crashing, the Outliner would be empty in
the created screenshot.
Additionally adds an assert to the Outliner to note assumptions
explicitly, rather than crashing later.
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tree.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tree.cc b/source/blender/editors/space_outliner/outliner_tree.cc index 7b3ce499929..e6098631a68 100644 --- a/source/blender/editors/space_outliner/outliner_tree.cc +++ b/source/blender/editors/space_outliner/outliner_tree.cc @@ -1682,6 +1682,9 @@ void outliner_build_tree(Main *mainvar, space_outliner->storeflag &= ~SO_TREESTORE_REBUILD; if (region->do_draw & RGN_DRAW_NO_REBUILD) { + BLI_assert_msg(space_outliner->runtime->tree_display != nullptr, + "Skipping rebuild before tree was built properly, a full redraw should be " + "triggered instead"); return; } |