52 Scene *scene_new =
nullptr;
104 if (sad->
scene == scene) {
112 else if (scene->
id.
next) {
120 if (win->parent !=
nullptr) {
123 if (win->scene == scene) {
130 if (workspace->sequencer_scene == scene) {
131 workspace->sequencer_scene = scene_new;
174 sce =
static_cast<Scene *
>(sce->id.next))
176 if (sce->compositing_node_group) {
188 "View layer '%s' could not be removed from scene '%s'",
205 if (win->scene == scene &&
STREQ(win->view_layer_name, layer->
name)) {
240 {
SCE_COPY_NEW,
"NEW", 0,
"New",
"Add a new, empty scene with default settings"},
245 "Add a new, empty scene, and copy settings from the current scene"},
250 "Link in the collections from the current scene (shallow copy)"},
251 {
SCE_COPY_FULL,
"FULL_COPY", 0,
"Full Copy",
"Make a full copy of the current scene"},
252 {0,
nullptr, 0,
nullptr,
nullptr},
259 ot->name =
"New Scene";
260 ot->description =
"Add new scene by type";
261 ot->idname =
"SCENE_OT_new";
298 strip->
scene = scene_new;
325 bool has_scene_or_no_context =
false;
328 has_scene_or_no_context =
true;
334 has_scene_or_no_context =
true;
338 if (has_scene_or_no_context) {
355 ot->name =
"New Scene";
356 ot->description =
"Add new scene by type in the sequence editor and assign to active strip";
357 ot->idname =
"SCENE_OT_new_sequencer";
421 ot->name =
"New Sequencer Scene";
422 ot->description =
"Add new scene to be used by the sequencer";
423 ot->idname =
"SCENE_OT_new_sequencer_scene";
460 printf(
"scene delete %p\n", scene);
471 ot->name =
"Delete Scene";
472 ot->description =
"Delete active scene";
473 ot->idname =
"SCENE_OT_delete";
492 Scene *scene_asset =
reinterpret_cast<Scene *
>(
509 ot->name =
"Drop Scene";
510 ot->description =
"Import scene and set it as the active one in the window";
511 ot->idname =
"SCENE_OT_drop_scene_asset";
WorkSpace * CTX_wm_workspace(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
Scene * CTX_data_sequencer_scene(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()
@ LIB_ID_DUPLICATE_IS_ROOT_ID
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_add(Main *bmain, const char *name)
Scene * BKE_scene_duplicate(Main *bmain, Scene *sce, eSceneCopyMethod type, eDupli_ID_Flags duplicate_flags, uint duplicate_options)
void BKE_scene_set_background(Main *bmain, Scene *sce)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define STRNCPY_UTF8(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)
wmOperatorStatus ED_screen_animation_play(bContext *C, int sync, int mode)
bScreen * ED_screen_animation_playing(const wmWindowManager *wm)
void ED_update_for_newframe(Main *bmain, Depsgraph *depsgraph)
bool ED_editors_flush_edits(Main *bmain)
BPy_StructRNA * depsgraph
void node_tree_remove_layer_n(bNodeTree *ntree, Scene *scene, int layer_index)
void relations_invalidate_cache_raw(Scene *scene, Strip *strip)
Editing * editing_ensure(Scene *scene)
Strip * select_active_get(const Scene *scene)
int RNA_enum_from_value(const EnumPropertyItem *item, const int value)
void RNA_enum_set(PointerRNA *ptr, const char *name, 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 void SCENE_OT_new_sequencer_scene(wmOperatorType *ot)
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)
static wmOperatorStatus new_sequencer_scene_invoke(bContext *C, wmOperator *op, const wmEvent *event)
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 void SCENE_OT_drop_scene_asset(wmOperatorType *ot)
static wmOperatorStatus drop_scene_asset_exec(bContext *C, wmOperator *op)
static Scene * scene_add(Main *bmain, Scene *scene_old, eSceneCopyMethod method)
static wmOperatorStatus scene_new_sequencer_exec(bContext *C, wmOperator *op)
bool ED_scene_view_layer_delete(Main *bmain, Scene *scene, ViewLayer *layer, ReportList *reports)
static bool scene_delete_poll(bContext *C)
Scene * ED_scene_sequencer_add(Main *bmain, bContext *C, eSceneCopyMethod method)
void ED_operatortypes_scene()
static bool scene_new_sequencer_poll(bContext *C)
static wmOperatorStatus scene_delete_exec(bContext *C, wmOperator *)
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 wmOperatorStatus new_sequencer_scene_exec(bContext *C, wmOperator *op)
static EnumPropertyItem scene_new_items[]
static wmOperatorStatus scene_new_exec(bContext *C, wmOperator *op)
struct Scene * sequencer_scene
struct ReportList * reports
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)
ID * WM_operator_properties_id_lookup_from_name_or_session_uid(Main *bmain, PointerRNA *ptr, const ID_Type type)
void WM_operator_properties_id_lookup(wmOperatorType *ot, const bool add_name_prop)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)
bool WM_operator_winactive(bContext *C)
void WM_window_set_active_scene(Main *bmain, bContext *C, wmWindow *win, Scene *scene)
Scene * WM_window_get_active_scene(const wmWindow *win)