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/blenloader/BLO_readfile.h | |
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/blenloader/BLO_readfile.h')
-rw-r--r-- | source/blender/blenloader/BLO_readfile.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h index bddfdf6926f..c3a1c0e5185 100644 --- a/source/blender/blenloader/BLO_readfile.h +++ b/source/blender/blenloader/BLO_readfile.h @@ -133,8 +133,7 @@ struct Main *BLO_library_link_begin(struct Main *mainvar, BlendHandle **bh, cons struct ID *BLO_library_link_named_part(struct Main *mainl, BlendHandle **bh, const short idcode, const char *name); struct ID *BLO_library_link_named_part_ex( struct Main *mainl, BlendHandle **bh, - const short idcode, const char *name, const int flag, - struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer, const struct View3D *v3d); + const short idcode, const char *name, const int flag); void BLO_library_link_end( struct Main *mainl, BlendHandle **bh, int flag, struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer, const struct View3D *v3d); |