54 Scene *scene_new =
nullptr;
116 if (sad->
scene == &scene) {
132 if (win.
parent !=
nullptr) {
135 if (win.
scene == &scene) {
218 for (
Scene *sce = bmain->
scenes.first(); sce; sce =
static_cast<Scene *
>(sce->id.next)) {
234 "View layer '%s' could not be removed from scene '%s'",
246 const auto is_using_view_layer = [&](
const bScreen &screen) ->
bool {
302 {
SCE_COPY_NEW,
"NEW", 0,
"New",
"Add a new, empty scene with default settings"},
307 "Add a new, empty scene, and copy settings from the current scene"},
312 "Link in the collections from the current scene (shallow copy)"},
313 {
SCE_COPY_FULL,
"FULL_COPY", 0,
"Full Copy",
"Make a full copy of the current scene"},
314 {0,
nullptr, 0,
nullptr,
nullptr},
321 ot->
name =
"New Scene";
323 ot->
idname =
"SCENE_OT_new";
360 strip->scene = scene_new;
387 bool has_scene_or_no_context =
false;
390 has_scene_or_no_context =
true;
396 has_scene_or_no_context =
true;
400 if (has_scene_or_no_context) {
402 for (
int i = 0; i <
ARRAY_SIZE(values); i++) {
417 ot->
name =
"New Scene";
418 ot->
description =
"Add new scene by type in the sequence editor and assign to active strip";
419 ot->
idname =
"SCENE_OT_new_sequencer";
449 if (scene_old ==
nullptr) {
456 if (workspace !=
nullptr) [[unlikely]] {
489 ot->
name =
"New Sequencer Scene";
490 ot->
description =
"Add new scene to be used by the sequencer";
491 ot->
idname =
"SCENE_OT_new_sequencer_scene";
529 printf(
"scene delete %p\n", scene);
540 ot->
name =
"Delete Scene";
542 ot->
idname =
"SCENE_OT_delete";
561 Scene *scene_asset =
reinterpret_cast<Scene *
>(
578 ot->
name =
"Drop Scene";
579 ot->
description =
"Import scene and set it as the active one in the window";
580 ot->
idname =
"SCENE_OT_drop_scene_asset";
#define STRNCPY_UTF8(dst, src)
#define BLT_I18NCONTEXT_ID_SCENE
#define BPy_BEGIN_ALLOW_THREADS
#define BPy_END_ALLOW_THREADS
void node_tree_remove_layer_n(bNodeTree *ntree, Scene *scene, int layer_index)
void relations_update_view_layer_scene_strips(Main *bmain, Scene *scene, const char *old_name, const char *new_name)
void relations_invalidate_cache_raw(Scene *scene, Strip *strip)
Editing * editing_ensure(Scene *scene)
Strip * select_active_get(const Scene *scene)
static bool scene_delete_poll(bContext *C)
static wmOperatorStatus new_sequencer_scene_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void WM_main_add_notifier(uint type, void *reference)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
static void SCENE_OT_delete(wmOperatorType *ot)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
void WM_window_set_active_scene(Main *bmain, bContext *C, wmWindow *win, Scene *scene)
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
int RNA_enum_get(PointerRNA *ptr, const char *name)
void WM_jobs_kill_all_from_owner(wmWindowManager *wm, const void *owner)
Scene * BKE_scene_find_replacement(const Main &bmain, const Scene &scene, FunctionRef< bool(const Scene &scene)> scene_validate_cb=nullptr)
bool ED_editors_flush_edits(Main *bmain)
Scene * CTX_data_sequencer_scene(const bContext *C)
void BKE_id_delete(Main *bmain, void *idv, const BKEIDDeleteOptions &options={}) ATTR_NONNULL()
static void SCENE_OT_new_sequencer(wmOperatorType *ot)
void WM_operator_properties_id_lookup(wmOperatorType *ot, const bool add_name_prop)
static bool view_layer_remove_poll(bContext *C)
WorkSpace * CTX_wm_workspace(const bContext *C)
bool BKE_scene_can_be_removed(const Main *bmain, const Scene *scene)
ID * WM_operator_properties_id_lookup_from_name_or_session_uid(Main *bmain, PointerRNA *ptr, const ID_Type type)
static void SCENE_OT_drop_scene_asset(wmOperatorType *ot)
static wmOperatorStatus scene_new_sequencer_exec(bContext *C, wmOperator *op)
void BKE_scene_free_view_layer_depsgraph(Scene *scene, ViewLayer *view_layer)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
static wmOperatorStatus scene_new_exec(bContext *C, wmOperator *op)
@ SCE_COPY_LINK_COLLECTION
wmWindow * CTX_wm_window(const bContext *C)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
Scene * ED_scene_add(Main *bmain, bContext *C, wmWindow *win, eSceneCopyMethod method) ATTR_NONNULL()
static bool scene_new_sequencer_poll(bContext *C)
void DEG_make_active(Depsgraph *depsgraph)
bool ED_scene_view_layer_delete(Main *bmain, Scene *scene, ViewLayer *layer, ReportList *reports) ATTR_NONNULL(1
static wmOperatorStatus drop_scene_asset_exec(bContext *C, wmOperator *op)
static wmOperatorStatus scene_delete_exec(bContext *C, wmOperator *)
int RNA_enum_from_value(const EnumPropertyItem *item, const int value)
void ED_screen_animation_stop(Main *bmain, wmWindowManager *wm, FunctionRef< bool(const bScreen &screen)> should_stop_fn)
ViewLayer * BKE_view_layer_default_view(const Scene *scene)
wmOperatorStatus ED_screen_animation_play(bContext *C, int sync, int mode)
void DEG_tag_on_visible_update(Main *bmain, bool do_time)
static void SCENE_OT_new(wmOperatorType *ot)
@ LIB_ID_DUPLICATE_IS_ROOT_ID
static void view_layer_remove_unset_nodetrees(const Main *bmain, Scene *scene, ViewLayer *layer)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
bool ED_scene_replace_active_for_deletion(bContext &C, Main &bmain, Scene &scene, Scene *scene_new=nullptr)
Scene * WM_window_get_active_scene(const wmWindow *win)
static const EnumPropertyItem * scene_new_sequencer_enum_itemf(bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
void ED_render_engine_changed(Main *bmain, bool update_scene_data)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void DEG_id_tag_update(ID *id, unsigned int flags)
wmWindowManager * CTX_wm_manager(const bContext *C)
bool ED_scene_delete(bContext *C, Main *bmain, Scene *scene) ATTR_NONNULL()
Scene * BKE_scene_add(Main *bmain, const char *name)
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
static void SCENE_OT_new_sequencer_scene(wmOperatorType *ot)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
static EnumPropertyItem scene_new_items[]
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void BKE_scene_set_background(Main *bmain, Scene *sce)
static Scene * scene_add(Main *bmain, Scene *scene_old, eSceneCopyMethod method)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void ED_update_for_newframe(Main *bmain, Depsgraph *depsgraph)
void WM_jobs_kill_type(wmWindowManager *wm, const void *owner, int job_type)
void BKE_view_layer_free(ViewLayer *view_layer)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
bool WM_operator_winactive(bContext *C)
Main * CTX_data_main(const bContext *C)
@ ID_RECALC_SEQUENCER_STRIPS
void DEG_graph_relations_update(Depsgraph *graph)
void DEG_relations_tag_update(Main *bmain)
void ED_scene_change_update(Main *bmain, Scene *scene, ViewLayer *layer) ATTR_NONNULL()
bool void ED_operatortypes_scene()
Scene * CTX_data_scene(const bContext *C)
Depsgraph * BKE_scene_ensure_depsgraph(Main *bmain, Scene *scene, ViewLayer *view_layer)
static wmOperatorStatus new_sequencer_scene_exec(bContext *C, wmOperator *op)
Scene * ED_scene_sequencer_add(Main *bmain, bContext *C, eSceneCopyMethod method)
void CTX_data_scene_set(bContext *C, Scene *scene)
bScreen * ED_screen_animation_playing(const wmWindowManager *wm)
Scene * BKE_scene_duplicate(Main *bmain, Scene *sce, eSceneCopyMethod type, eDupli_ID_Flags duplicate_flags, uint duplicate_options)
bool ED_operator_screenactive(bContext *C)
ListBaseT< wmWindowManager > wm
ListBaseT< WorkSpace > workspaces
ListBaseT< Scene > scenes
struct bNodeTree * node_group
ListBaseT< ViewLayer > view_layers
struct Scene * sequencer_scene
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports