Page MenuHome

WIP: Fix T85752: Collection Instance Crash when instancing collections with view-layer excluded subcollections.
AbandonedPublic

Authored by Bastien Montagne (mont29) on Mar 30 2021, 2:25 PM.

Details

Summary

The root of the issue was that excluding the LayerCollection would
prevent depsgraph to build the collection itself.

But this is wrong, for many reasons, mostly boiling down to the fact
that ecluding a LayerCollection should only remove bases (objects) from
the excluded collection, but not the LayerCollection itself (since its
evaluated version is still used in some code, like the outliner), and
therefore not the Collection ID either (since Blender code does not
expect layerCollections with no valid Collection pointer).

NOTE: this is likely shifting the problem to the objects-of-the-evaluated-Collection level, since those may not be evaluated at all (if not required into the evaluated viewlayer through another user). That patch seems to fix the issue and not cause any new one currently, but still need to check what exactly is hapening with the objects of the excluded collection...

Diff Detail

Repository
rB Blender
Branch
T85752 (branched from master)
Build Status
Buildable 13824
Build 13824: arc lint + arc unit

Event Timeline

Bastien Montagne (mont29) requested review of this revision.Mar 30 2021, 2:25 PM
Bastien Montagne (mont29) created this revision.

@Sergey Sharybin (sergey) would not mind getting your advice on that, even though i don't think this is enough/fully fixing all possible issues there?

Scratch that, while it does fix the issue, it is not a proper way nor is it addressing the root of the problem.

Root of the problem being, when the visibility status of a collection (either directly, or indirectly through one of its LayerCollection) changes, all of its parent collections need to be CoW-updated in depsgraph. Still trying to figure out the best way to do so.