diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-09-16 15:52:06 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-09-19 12:32:35 +0300 |
commit | 659ccd9cd2ee79c462147b53c18ecc8b9faf74a6 (patch) | |
tree | dfcb40573e72f2dd3f805baade1ae63d5a7dab3b /source/blender/makesdna/DNA_ID.h | |
parent | e7a514369fe700dcc5a1fe433c8f709ed9595ded (diff) |
Fix T66154: viewlayer hide/exclude settings getting lost for linked collections
The problem was that the object and collection pointers in Base and
LayerCollection would get lost of file read. Normally such ID pointers would
be resolved by pointing to an ID_ID placeholder which has the datablock name,
and then replacing it will the real datablock. However ID_ID is only written
for directly linked datablocks.
This adds the concept of an indirectly linked datablock with a weak reference
to it. For this we write an ID_ID_WEAK_REF code, which is a reference that
will only be resolved if the datablock was read for another reason.
Differential Revision: https://developer.blender.org/D4416
Diffstat (limited to 'source/blender/makesdna/DNA_ID.h')
-rw-r--r-- | source/blender/makesdna/DNA_ID.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index a1bc71ade62..a6212e09567 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -477,6 +477,10 @@ enum { /* The datablock structure is a sub-object of a different one. * Direct persistent references are not allowed. */ LIB_PRIVATE_DATA = 1 << 10, + /* Datablock is from a library and linked indirectly, with LIB_TAG_INDIRECT + * tag set. But the current .blend file also has a weak pointer to it that + * we want to restore if possible, and silently drop if it's missing. */ + LIB_INDIRECT_WEAK_LINK = 1 << 11, }; /** |