diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2019-02-19 15:44:23 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2019-02-19 15:49:54 +0300 |
commit | cba447966ec51db48459e57d838e8b4562b96c5e (patch) | |
tree | bbe99275f4c252163e9218843ae9f35b13cca5f3 /source/blender/windowmanager | |
parent | 4df88960627aa9560e70e4bcfcfa5c3acfb2c8b7 (diff) |
Fix T61683: Linking the instance of a collection crashes Blender.
Do not instance linked object immediately in scene, this was never a
good idea and is doomed to fail nowadays, with complex relations between
objects, collections and scenes.
Instead, this commit refactors a bit linking code to add loose objects
to current scene *after* everything has been imported, and ID pointers
have been properly remapped to new ones - i.e. once new linked data is
supposed to be fully valid, just like we were already doing with
collections.
As a bonus, it means we do not have to pass around scene, view3d etc. to
`BLO_library_link_named_part_ex()` and co.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files_link.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c index b64cf0f2d15..3b27d2199b6 100644 --- a/source/blender/windowmanager/intern/wm_files_link.c +++ b/source/blender/windowmanager/intern/wm_files_link.c @@ -253,9 +253,7 @@ static void wm_link_do( continue; } - new_id = BLO_library_link_named_part_ex( - mainl, &bh, item->idcode, item->name, flag, bmain, - scene, view_layer, v3d); + new_id = BLO_library_link_named_part_ex(mainl, &bh, item->idcode, item->name, flag); if (new_id) { /* If the link is successful, clear item's libs 'todo' flags. |