Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/scene/scene_edit.c
| Show First 20 Lines • Show All 234 Lines • ▼ Show 20 Lines | static void SCENE_OT_new(wmOperatorType *ot) | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ||||
| /* properties */ | /* properties */ | ||||
| ot->prop = RNA_def_enum(ot->srna, "type", type_items, 0, "Type", ""); | ot->prop = RNA_def_enum(ot->srna, "type", type_items, 0, "Type", ""); | ||||
| } | } | ||||
| static bool scene_delete_poll(bContext *C) | static bool scene_delete_poll(bContext *C) | ||||
| { | { | ||||
| Main *bmain = CTX_data_main(C); | |||||
| Scene *scene = CTX_data_scene(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)) | static int scene_delete_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| if (ED_scene_delete(C, CTX_data_main(C), scene) == false) { | if (ED_scene_delete(C, CTX_data_main(C), scene) == false) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| Show All 31 Lines | |||||