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.
This commit is contained in:
parent
6f7392312c
commit
5d455a7a90
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue