diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2019-03-26 16:39:43 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2019-03-26 16:41:37 +0300 |
commit | 5d455a7a908d7d93355cc056af937cd5d3271bf7 (patch) | |
tree | 33aa55ac6bdb1eed61cf4188affb38369bdf04ab /source/blender/editors/object | |
parent | 6f7392312c9dbb0e7e4c0aa464d928ed334ffce8 (diff) |
Fix (unreported) crash when making object single user in some cases.
Issue would happen in case affected object is linked to collections that
are shared between different scenes' ViewLayers. When switching back to
another scene after making single user, you'd get immediate crash.
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r-- | source/blender/editors/object/object_relations.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 777770e5812..1f89da51d17 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1670,9 +1670,14 @@ static void single_object_users(Main *bmain, Scene *scene, View3D *v3d, const in /* active camera */ ID_NEW_REMAP(scene->camera); - if (v3d) ID_NEW_REMAP(v3d->camera); + if (v3d) { + ID_NEW_REMAP(v3d->camera); + } - BKE_scene_collection_sync(scene); + /* Making single user may affect other scenes if they share with current one some collections in their ViewLayer. */ + for (Scene *sce = bmain->scenes.first; sce != NULL; sce = sce->id.next) { + BKE_scene_collection_sync(sce); + } } /* not an especially efficient function, only added so the single user |