52 Scene *scene_new =
nullptr;
72 const bool assign_strip)
76 Scene *scene_strip =
nullptr;
81 if (seq && seq->
scene) {
82 scene_strip = seq->
scene;
87 if (scene_strip ==
nullptr) {
101 if (scene_new && seq) {
102 seq->
scene = scene_new;
135 if (scene->id.prev) {
136 scene_new =
static_cast<Scene *
>(scene->id.prev);
138 else if (scene->id.next) {
139 scene_new =
static_cast<Scene *
>(scene->id.next);
146 if (win->parent !=
nullptr) {
149 if (win->scene == scene) {
178 if ((scene->view_layers.first == scene->view_layers.last) && (scene->view_layers.first == layer))
189 int act_layer_index =
BLI_findindex(&scene->view_layers, layer);
192 sce =
static_cast<Scene *
>(sce->id.next))
206 "View layer '%s' could not be removed from scene '%s'",
223 if (win->scene == scene &&
STREQ(win->view_layer_name, layer->name)) {
258 {
SCE_COPY_NEW,
"NEW", 0,
"New",
"Add a new, empty scene with default settings"},
263 "Add a new, empty scene, and copy settings from the current scene"},
268 "Link in the collections from the current scene (shallow copy)"},
269 {
SCE_COPY_FULL,
"FULL_COPY", 0,
"Full Copy",
"Make a full copy of the current scene"},
270 {0,
nullptr, 0,
nullptr,
nullptr},
330 bool has_scene_or_no_context =
false;
333 has_scene_or_no_context =
true;
339 has_scene_or_no_context =
true;
343 if (has_scene_or_no_context) {
345 for (
int i = 0; i <
ARRAY_SIZE(values); i++) {
361 ot->
description =
"Add new scene by type in the sequence editor and assign to active strip";
362 ot->
idname =
"SCENE_OT_new_sequencer";
400 printf(
"scene delete %p\n", scene);
411 ot->
name =
"Delete Scene";
wmWindow * CTX_wm_window(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
ViewLayer * BKE_view_layer_default_view(const Scene *scene)
void BKE_view_layer_free(ViewLayer *view_layer)
void BKE_id_delete(Main *bmain, void *idv) ATTR_NONNULL()
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
@ SCE_COPY_LINK_COLLECTION
void BKE_scene_free_view_layer_depsgraph(Scene *scene, ViewLayer *view_layer)
Depsgraph * BKE_scene_ensure_depsgraph(Main *bmain, Scene *scene, ViewLayer *view_layer)
bool BKE_scene_can_be_removed(const Main *bmain, const Scene *scene)
Scene * BKE_scene_duplicate(Main *bmain, Scene *sce, eSceneCopyMethod type)
Scene * BKE_scene_add(Main *bmain, const char *name)
void BKE_scene_set_background(Main *bmain, Scene *sce)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define STRNCPY(dst, src)
#define BLT_I18NCONTEXT_ID_SCENE
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_tag_on_visible_update(Main *bmain, bool do_time)
void DEG_relations_tag_update(Main *bmain)
void DEG_graph_relations_update(Depsgraph *graph)
@ ID_RECALC_SEQUENCER_STRIPS
void ED_render_engine_changed(Main *bmain, bool update_scene_data)
void ED_update_for_newframe(Main *bmain, Depsgraph *depsgraph)
bool ED_editors_flush_edits(Main *bmain)
const Depsgraph * depsgraph
void node_tree_remove_layer_n(bNodeTree *ntree, Scene *scene, int layer_index)
int RNA_enum_from_value(const EnumPropertyItem *item, const int value)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
static int scene_delete_exec(bContext *C, wmOperator *)
Scene * ED_scene_sequencer_add(Main *bmain, bContext *C, eSceneCopyMethod method, const bool assign_strip)
static const EnumPropertyItem * scene_new_sequencer_enum_itemf(bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
Scene * ED_scene_add(Main *bmain, bContext *C, wmWindow *win, eSceneCopyMethod method)
static void view_layer_remove_unset_nodetrees(const Main *bmain, Scene *scene, ViewLayer *layer)
bool ED_scene_delete(bContext *C, Main *bmain, Scene *scene)
static void SCENE_OT_new(wmOperatorType *ot)
static void SCENE_OT_new_sequencer(wmOperatorType *ot)
static int scene_new_sequencer_exec(bContext *C, wmOperator *op)
static Scene * scene_add(Main *bmain, Scene *scene_old, eSceneCopyMethod method)
bool ED_scene_view_layer_delete(Main *bmain, Scene *scene, ViewLayer *layer, ReportList *reports)
static int scene_new_exec(bContext *C, wmOperator *op)
static bool scene_delete_poll(bContext *C)
void ED_operatortypes_scene()
static bool scene_new_sequencer_poll(bContext *C)
static bool view_layer_remove_poll(const Scene *scene, const ViewLayer *layer)
static void SCENE_OT_delete(wmOperatorType *ot)
void ED_scene_change_update(Main *bmain, Scene *scene, ViewLayer *layer)
static EnumPropertyItem scene_new_items[]
void SEQ_relations_invalidate_cache_raw(Scene *scene, Sequence *seq)
Sequence * SEQ_select_active_get(const Scene *scene)
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
void WM_main_add_notifier(uint type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void WM_jobs_kill_all_from_owner(wmWindowManager *wm, const void *owner)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)
void WM_window_set_active_scene(Main *bmain, bContext *C, wmWindow *win, Scene *scene)
Scene * WM_window_get_active_scene(const wmWindow *win)