diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2019-05-22 23:57:16 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2019-05-23 00:33:27 +0300 |
commit | 91aafd56e3af8313b49a87a9821c9abe9b901126 (patch) | |
tree | ccb5c2005dd1f5c6252baeda2e7bc5acabf113c1 /source/blender/blenkernel | |
parent | d1f96f9b1194404ffafd2540cd2928048779656e (diff) |
Fix (unreported) broken collections after undo/redo, or remapping (leading to crashes).
Those are two cases where keeping infamous backward `parents` pointers
of collections in sync is kind of impossible to do... So rebuilding
those relationships from scratch instead.
Fixes e.g. a crash when undoing, then reloading a library, and likely
many more weird ones like that.
Uncovered while investigating T64764.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/library_remap.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/library_remap.c b/source/blender/blenkernel/intern/library_remap.c index 4e5eac7924b..e0e473978f8 100644 --- a/source/blender/blenkernel/intern/library_remap.c +++ b/source/blender/blenkernel/intern/library_remap.c @@ -368,6 +368,11 @@ static void libblock_remap_data_postprocess_collection_update(Main *bmain, * I'd consider optimizing that whole collection remapping process a TODO for later. */ BKE_collections_child_remove_nulls(bmain, NULL /*old_collection*/); } + else { + /* Temp safe fix, but a "tad" brute force... We should probably be able to use parents from + * old_collection instead? */ + BKE_main_collections_parent_relations_rebuild(bmain); + } BKE_main_collection_sync_remap(bmain); } |