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.
/* 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