Page MenuHome

Fix T83027: Incorrect outliner collection state after operator
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Jan 28 2021, 10:00 PM.

Details

Summary

The "Hide Collection" operators assigned to the number keys in edit mode
trigger a redraw of the outliner, but as an optimization, they do *not*
trigger a rebuild of the tree.

This optimization is valid because unlike the collection exclude toggle,
the heirarchy is not affected by collection visibility. However, it means
that currently you must trigger a rebuild to get the correct "grayed out"
status after using the operator.

Rather than trigger a rebuild in this case to solve the bug, this patch
moves the decision for whether to gray out the text of a tree element
to the draw step rather than the build step. This means that any change
to the corresponding properties doesn't require a full rebuild of the tree.

Note that changing the "hide_viewport" property from the outliner still
causes a tree rebuild. I think that's because of the checks in
outliner_collection_set_flag_recursive_fn.
That could be optimized in the future.

Diff Detail

Repository
rB Blender
Branch
fix-outliner-collection-visible-refresh (branched from master)
Build Status
Buildable 12457
Build 12457: arc lint + arc unit

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Jan 28 2021, 10:00 PM
Hans Goudey (HooglyBoogly) created this revision.

This looks good to me! I think it makes perfect sense to determine the draw opacity in the draw step rather than at build time, especially since the function isn't very complex. I don't have any super heavy scenes to see if there's a difference, but I don't think there would be.

source/blender/editors/space_outliner/outliner_draw.c
2989

Typo is_visible :)

This revision is now accepted and ready to land.Jan 30 2021, 3:43 AM
Julian Eisel (Severin) added inline comments.
source/blender/editors/space_outliner/outliner_draw.c
2967

Reads like an action, not like a query. element_should_draw_faded()?

Hans Goudey (HooglyBoogly) marked 2 inline comments as done.Feb 19 2021, 9:06 PM