Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-01-08 18:30:44 +0300
committerJacques Lucke <jacques@blender.org>2021-01-08 18:39:42 +0300
commitbc788929aa2bd259670a5562a1f403f25cad4625 (patch)
treee8aa0b6746a5bffa2c97b8cb42a817659b20fff9 /source/blender/editors/scene/scene_edit.c
parent2d3f96cace6d63dbf15544dbe8a9a4fa912f6d6d (diff)
Scenes: forbid deleting last local scene
Previously, it was only forbidden to delete the last scene. This can lead to the situation where a .blend file only contains linked scenes. This is problematic, because linked data might not always be available or can be removed from a .blend file without having an additional check for remaining scenes. Now there always has to be at least one local scene. Reviewers: mont29 Differential Revision: https://developer.blender.org/D10049
Diffstat (limited to 'source/blender/editors/scene/scene_edit.c')
-rw-r--r--source/blender/editors/scene/scene_edit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/scene/scene_edit.c b/source/blender/editors/scene/scene_edit.c
index 47edb322701..2b2a0d10e29 100644
--- a/source/blender/editors/scene/scene_edit.c
+++ b/source/blender/editors/scene/scene_edit.c
@@ -240,8 +240,9 @@ static void SCENE_OT_new(wmOperatorType *ot)
static bool scene_delete_poll(bContext *C)
{
+ Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
- return (scene->id.prev || scene->id.next);
+ return BKE_scene_can_be_removed(bmain, scene);
}
static int scene_delete_exec(bContext *C, wmOperator *UNUSED(op))