Blender V5.3
scene_edit.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cstdio>
10#include <cstring>
11
12#include "BLI_listbase.hh"
13#include "BLI_string_utf8.hh"
14
15#include "DNA_sequence_types.h"
16
17#include "BKE_context.hh"
18#include "BKE_global.hh"
19#include "BKE_layer.hh"
20#include "BKE_lib_id.hh"
21#include "BKE_main.hh"
22#include "BKE_node.hh"
23#include "BKE_report.hh"
24#include "BKE_scene.hh"
25
26#include "DEG_depsgraph.hh"
28
29#include "BLT_translation.hh"
30
31#include "ED_render.hh"
32#include "ED_scene.hh"
33#include "ED_screen.hh"
34#include "ED_util.hh"
35
36#include "SEQ_relations.hh"
37#include "SEQ_select.hh"
38#include "SEQ_sequencer.hh"
39
40#include "RNA_access.hh"
41#include "RNA_define.hh"
42
43#include "WM_api.hh"
44#include "WM_types.hh"
45
46namespace blender {
47
48/* -------------------------------------------------------------------- */
51
52static Scene *scene_add(Main *bmain, Scene *scene_old, eSceneCopyMethod method)
53{
54 Scene *scene_new = nullptr;
55 if (method == SCE_COPY_NEW) {
56 scene_new = BKE_scene_add(bmain, DATA_("Scene"));
57 }
58 else { /* different kinds of copying */
59 /* We are going to deep-copy collections, objects and various object data, we need to have
60 * up-to-date obdata for that. */
61 BLI_assert(scene_old != nullptr);
62 if (method == SCE_COPY_FULL) {
64 }
65
66 scene_new = BKE_scene_duplicate(bmain,
67 scene_old,
68 method,
69 static_cast<eDupli_ID_Flags>(U.dupflag | USER_DUP_OBJECT),
71 }
72
73 return scene_new;
74}
75
77{
78 Scene *active_scene = CTX_data_scene(C);
79 Scene *scene_new = scene_add(bmain, active_scene, method);
80
81 return scene_new;
82}
83
85{
86 Scene *scene_old = WM_window_get_active_scene(win);
87 Scene *scene_new = scene_add(bmain, scene_old, method);
88
89 WM_window_set_active_scene(bmain, C, win, scene_new);
90
92
93 return scene_new;
94}
95
97{
98 BLI_assert(!scene_new || &scene != scene_new);
99 if (!BKE_scene_can_be_removed(&bmain, &scene)) {
100 return false;
101 }
102
103 if (!scene_new) {
104 scene_new = BKE_scene_find_replacement(bmain, scene);
105 }
106 if (!scene_new) {
107 return false;
108 }
109
110 /* NOTE: Usages of BPy_..._ALLOW_THREADS macros below are necessary because this code is also
111 * called from RNA (and therefore BPY). */
112
113 /* Cancel animation playback. */
115 ScreenAnimData *sad = static_cast<ScreenAnimData *>(screen->animtimer->customdata);
116 if (sad->scene == &scene) {
117#ifdef WITH_PYTHON
119#endif
121#ifdef WITH_PYTHON
123#endif
124 }
125 }
126
127 /* Kill running jobs. */
128 wmWindowManager *wm = bmain.wm.first();
130
131 for (wmWindow &win : wm->windows) {
132 if (win.parent != nullptr) { /* We only care about main windows here... */
133 continue;
134 }
135 if (win.scene == &scene) {
136#ifdef WITH_PYTHON
138#endif
139 WM_window_set_active_scene(&bmain, &C, &win, scene_new);
140#ifdef WITH_PYTHON
142#endif
143 }
144 }
145
146 /* Update scenes used by the sequencer. */
147 for (WorkSpace &workspace : bmain.workspaces) {
148 if (workspace.sequencer_scene == &scene) {
149 workspace.sequencer_scene = scene_new;
151 }
152 }
153
154 /* In theory, the call to #WM_window_set_active_scene above should have handled this through
155 * calls to #ED_screen_scene_change. But there can be unusual cases (e.g. on file opening in
156 * background mode) where the state of available Windows may prevent this from happening. */
157 if (CTX_data_scene(&C) == &scene) {
158#ifdef WITH_PYTHON
160#endif
161 CTX_data_scene_set(&C, scene_new);
162#ifdef WITH_PYTHON
164#endif
165 }
166
167 return true;
168}
169
170bool ED_scene_delete(bContext *C, Main *bmain, Scene *scene)
171{
172 if (ED_scene_replace_active_for_deletion(*C, *bmain, *scene)) {
173 BKE_id_delete(bmain, scene);
174 return true;
175 }
176
177 return false;
178}
179
181{
182 Depsgraph *depsgraph = BKE_scene_ensure_depsgraph(bmain, scene, layer);
183 /* When switching to a scene for the first time after loading a file, the dependency graph above
184 * will not be active. This can cause issues (e.g. #151159) because there might be code running
185 * immediately after that expects this dependency graph to be active and then silently fail.
186 * Similar to #CTX_data_depsgraph_pointer. */
187 DEG_make_active(depsgraph);
188
189 BKE_scene_set_background(bmain, scene);
191 DEG_tag_on_visible_update(bmain, false);
192
193 ED_render_engine_changed(bmain, false);
194 ED_update_for_newframe(bmain, depsgraph);
195}
196
197static bool view_layer_remove_poll(const Scene *scene, const ViewLayer *layer)
198{
199 const int act = BLI_findindex(&scene->view_layers, layer);
200
201 if (act == -1) {
202 return false;
203 }
204 if ((scene->view_layers.first_ == scene->view_layers.last()) &&
205 (scene->view_layers.first_ == layer))
206 {
207 /* ensure 1 layer is kept */
208 return false;
209 }
210
211 return true;
212}
213
214static void view_layer_remove_unset_nodetrees(const Main *bmain, Scene *scene, ViewLayer *layer)
215{
216 int act_layer_index = BLI_findindex(&scene->view_layers, layer);
217
218 for (Scene *sce = bmain->scenes.first(); sce; sce = static_cast<Scene *>(sce->id.next)) {
219 for (SceneCompositorEffect &effect : sce->compositor_effects) {
220 if (!effect.node_group || ID_MISSING(effect.node_group)) {
221 continue;
222 }
223 bke::node_tree_remove_layer_n(effect.node_group, scene, act_layer_index);
224 }
225 }
226}
227
229{
230 if (view_layer_remove_poll(scene, layer) == false) {
231 if (reports) {
232 BKE_reportf(reports,
233 RPT_ERROR,
234 "View layer '%s' could not be removed from scene '%s'",
235 layer->name,
236 scene->id.name + 2);
237 }
238
239 return false;
240 }
241
242 /* We need to unset node-trees before removing the layer, otherwise its index will be -1. */
244
245 /* Return whether the given screen uses the to-be-removed view layer. */
246 const auto is_using_view_layer = [&](const bScreen &screen) -> bool {
247 const ScreenAnimData *sad = static_cast<const ScreenAnimData *>(screen.animtimer->customdata);
248 return (sad && sad->scene == scene && sad->view_layer == layer);
249 };
250
251 /* Stop animation playback of this layer before removing it, as the ScreenAnimData struct
252 * has a pointer to it. */
253 wmWindowManager *wm = bmain->wm.first();
254 ED_screen_animation_stop(bmain, wm, is_using_view_layer);
255
256 /* Kill the compositor job since it might be referencing the viewer layer to be removed. */
258
259 BLI_remlink(&scene->view_layers, layer);
260 BLI_assert(scene->view_layers.is_empty() == false);
261
262 /* Remove from windows. */
263 for (wmWindow &win : wm->windows) {
264 if (win.scene == scene && STREQ(win.view_layer_name, layer->name)) {
265 ViewLayer *first_layer = BKE_view_layer_default_view(scene);
266 STRNCPY_UTF8(win.view_layer_name, first_layer->name);
267 }
268 }
269
271
272 /* Update any sequencer scene strips referencing this view layer by name. */
273 seq::relations_update_view_layer_scene_strips(bmain, scene, layer->name, nullptr);
274
276
280
281 return true;
282}
283
285
286/* -------------------------------------------------------------------- */
289
291{
292 Main *bmain = CTX_data_main(C);
293 wmWindow *win = CTX_wm_window(C);
294 int type = RNA_enum_get(op->ptr, "type");
295
296 ED_scene_add(bmain, C, win, eSceneCopyMethod(type));
297
298 return OPERATOR_FINISHED;
299}
300
302 {SCE_COPY_NEW, "NEW", 0, "New", "Add a new, empty scene with default settings"},
304 "EMPTY",
305 0,
306 "Copy Settings",
307 "Add a new, empty scene, and copy settings from the current scene"},
309 "LINK_COPY",
310 0,
311 "Linked Copy",
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},
315};
316
318{
319
320 /* identifiers */
321 ot->name = "New Scene";
322 ot->description = "Add new scene by type";
323 ot->idname = "SCENE_OT_new";
324
325 /* API callbacks. */
326 ot->exec = scene_new_exec;
329
330 /* flags */
332
333 /* properties */
334 ot->prop = RNA_def_enum(ot->srna, "type", scene_new_items, SCE_COPY_NEW, "Type", "");
336}
337
339
340/* -------------------------------------------------------------------- */
343
345{
346 Main *bmain = CTX_data_main(C);
347 int type = RNA_enum_get(op->ptr, "type");
348 Scene *sequencer_scene = CTX_data_sequencer_scene(C);
349 Strip *strip = seq::select_active_get(sequencer_scene);
350 BLI_assert(strip != nullptr);
351
352 if (!strip->scene) {
353 return OPERATOR_CANCELLED;
354 }
355
356 Scene *scene_new = scene_add(bmain, strip->scene, eSceneCopyMethod(type));
357 if (!scene_new) {
358 return OPERATOR_CANCELLED;
359 }
360 strip->scene = scene_new;
361 /* Do a refresh of the sequencer data. */
362 seq::relations_invalidate_cache_raw(sequencer_scene, strip);
365 return OPERATOR_FINISHED;
366}
367
369{
371 const Strip *strip = seq::select_active_get(scene);
372 return (strip && (strip->type == STRIP_TYPE_SCENE));
373}
374
376 PointerRNA * /*ptr*/,
377 PropertyRNA * /*prop*/,
378 bool *r_free)
379{
380 EnumPropertyItem *item = nullptr;
381 int totitem = 0;
382 uint item_index;
383
385 RNA_enum_item_add(&item, &totitem, &scene_new_items[item_index]);
386
387 bool has_scene_or_no_context = false;
388 if (C == nullptr) {
389 /* For documentation generation. */
390 has_scene_or_no_context = true;
391 }
392 else {
394 Strip *strip = seq::select_active_get(scene);
395 if (strip && (strip->type == STRIP_TYPE_SCENE) && (strip->scene != nullptr)) {
396 has_scene_or_no_context = true;
397 }
398 }
399
400 if (has_scene_or_no_context) {
402 for (int i = 0; i < ARRAY_SIZE(values); i++) {
403 item_index = RNA_enum_from_value(scene_new_items, values[i]);
404 RNA_enum_item_add(&item, &totitem, &scene_new_items[item_index]);
405 }
406 }
407
408 RNA_enum_item_end(&item, &totitem);
409 *r_free = true;
410 return item;
411}
412
414{
415
416 /* identifiers */
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";
420
421 /* API callbacks. */
425
426 /* flags */
428
429 /* properties */
430 ot->prop = RNA_def_enum(ot->srna, "type", scene_new_items, SCE_COPY_NEW, "Type", "");
433}
434
436
437/* -------------------------------------------------------------------- */
440
442{
443 Main *bmain = CTX_data_main(C);
444 wmWindow *win = CTX_wm_window(C);
445 WorkSpace *workspace = CTX_wm_workspace(C);
446 Scene *scene_old = CTX_data_sequencer_scene(C);
448 /* When there is no scene to copy from, force new. */
449 if (scene_old == nullptr) {
450 type = SCE_COPY_NEW;
451 }
452 Scene *new_scene = scene_add(bmain, scene_old, eSceneCopyMethod(type));
453 seq::editing_ensure(new_scene);
454
455 /* Unlikely but not impossible as poll doesn't check for this. */
456 if (workspace != nullptr) [[unlikely]] {
457 workspace->sequencer_scene = new_scene;
458 }
459
460 /* Switching the active scene to the newly created sequencer scene should prevent confusion among
461 * new users to the VSE. For example, this prevents the case where attempting to change
462 * resolution properties would have no effect.
463 *
464 * FIXME: This logic is meant to address a temporary paper-cut and may be removed later in 5.1+
465 * when properties for scenes and sequencer scenes can be more properly separated. */
466 WM_window_set_active_scene(bmain, C, win, new_scene);
468 op->reports, RPT_WARNING, TIP_("Active scene changed to '%s'"), new_scene->id.name + 2);
469
471 return OPERATOR_FINISHED;
472}
473
475 wmOperator *op,
476 const wmEvent *event)
477{
478 if (CTX_data_sequencer_scene(C) == nullptr) {
479 /* When there is no sequencer scene set, create a blank new one. */
480 RNA_enum_set(op->ptr, "type", SCE_COPY_NEW);
481 return new_sequencer_scene_exec(C, op);
482 }
483 return WM_menu_invoke(C, op, event);
484}
485
487{
488 /* identifiers */
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";
492
493 /* API callbacks. */
497
498 /* flags */
500
501 /* properties */
502 ot->prop = RNA_def_enum(ot->srna, "type", scene_new_items, SCE_COPY_NEW, "Type", "");
505}
506
508
509/* -------------------------------------------------------------------- */
512
514{
515 Main *bmain = CTX_data_main(C);
516 Scene *scene = CTX_data_scene(C);
517 return BKE_scene_can_be_removed(bmain, scene);
518}
519
521{
522 Scene *scene = CTX_data_scene(C);
523
524 if (ED_scene_delete(C, CTX_data_main(C), scene) == false) {
525 return OPERATOR_CANCELLED;
526 }
527
528 if (G.debug & G_DEBUG) {
529 printf("scene delete %p\n", scene);
530 }
531
533
534 return OPERATOR_FINISHED;
535}
536
538{
539 /* identifiers */
540 ot->name = "Delete Scene";
541 ot->description = "Delete active scene";
542 ot->idname = "SCENE_OT_delete";
543
544 /* API callbacks. */
547
548 /* flags */
550}
551
553
554/* -------------------------------------------------------------------- */
557
559{
560 Main *bmain = CTX_data_main(C);
561 Scene *scene_asset = reinterpret_cast<Scene *>(
563 if (!scene_asset) {
564 return OPERATOR_CANCELLED;
565 }
566
567 wmWindow *win = CTX_wm_window(C);
568 WM_window_set_active_scene(bmain, C, win, scene_asset);
569
571
572 return OPERATOR_FINISHED;
573}
574
576{
577 /* identifiers */
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";
581
582 /* callbacks */
584
585 /* flags */
587
589}
590
592
593/* -------------------------------------------------------------------- */
596
606
608
609} // namespace blender
#define STRNCPY_UTF8(dst, src)
#define TIP_(msgid)
#define BLT_I18NCONTEXT_ID_SCENE
#define DATA_(msgid)
#define BPy_BEGIN_ALLOW_THREADS
Definition BPY_extern.hh:52
#define BPy_END_ALLOW_THREADS
Definition BPY_extern.hh:56
#define ID_MISSING(_id)
Definition DNA_ID.h:695
#define C
Definition RandGen.cpp:29
#define NC_WINDOW
Definition WM_types.hh:388
#define NC_SCENE
Definition WM_types.hh:391
#define NA_REMOVED
Definition WM_types.hh:637
#define ND_LAYER
Definition WM_types.hh:469
#define ND_SCENEBROWSE
Definition WM_types.hh:451
#define STREQ(a, b)
#define layer
void node_tree_remove_layer_n(bNodeTree *ntree, Scene *scene, int layer_index)
Definition node.cc:6279
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)
Definition sequencer.cc:309
Strip * select_active_get(const Scene *scene)
BMesh Iterators.
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)
UserDef U
Definition blender.cc:58
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)
Definition wm_jobs.cc:657
Scene * BKE_scene_find_replacement(const Main &bmain, const Scene &scene, FunctionRef< bool(const Scene &scene)> scene_validate_cb=nullptr)
Definition scene.cc:2170
@ RPT_WARNING
Definition BKE_report.hh:40
bool ED_editors_flush_edits(Main *bmain)
Definition ed_util.cc:335
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)
unsigned int uint
Definition BKE_text.h:55
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)
Definition scene.cc:2150
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)
@ WM_JOB_TYPE_COMPOSITE
Definition WM_api.hh:2010
static wmOperatorStatus scene_new_sequencer_exec(bContext *C, wmOperator *op)
void BKE_scene_free_view_layer_depsgraph(Scene *scene, ViewLayer *view_layer)
Definition scene.cc:3560
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)
eSceneCopyMethod
Definition BKE_scene.hh:35
@ SCE_COPY_NEW
Definition BKE_scene.hh:36
@ SCE_COPY_FULL
Definition BKE_scene.hh:39
@ SCE_COPY_LINK_COLLECTION
Definition BKE_scene.hh:38
@ SCE_COPY_EMPTY
Definition BKE_scene.hh:37
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()
Definition scene_edit.cc:84
static bool scene_new_sequencer_poll(bContext *C)
void DEG_make_active(Depsgraph *depsgraph)
Definition depsgraph.cc:337
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)
Global G
Definition blender.cc:57
@ 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)
Definition listbase.cc:593
bool ED_scene_replace_active_for_deletion(bContext &C, Main &bmain, Scene &scene, Scene *scene_new=nullptr)
Definition scene_edit.cc:96
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)
Definition listbase.cc:138
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)
Definition scene.cc:2200
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)
Definition scene.cc:2233
static Scene * scene_add(Main *bmain, Scene *scene_old, eSceneCopyMethod method)
Definition scene_edit.cc:52
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)
Definition wm_jobs.cc:642
void BKE_view_layer_free(ViewLayer *view_layer)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
Definition report.cc:191
bool WM_operator_winactive(bContext *C)
Main * CTX_data_main(const bContext *C)
@ ID_RECALC_AUDIO
Definition DNA_ID.h:1132
@ ID_RECALC_SEQUENCER_STRIPS
Definition DNA_ID.h:1122
@ ID_RECALC_BASE_FLAGS
Definition DNA_ID.h:1104
@ PROP_SKIP_SAVE
Definition RNA_types.hh:414
@ PROP_ENUM_NO_TRANSLATE
Definition RNA_types.hh:502
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)
Definition scene.cc:3644
@ OPTYPE_REGISTER
Definition WM_types.hh:188
@ OPTYPE_UNDO
Definition WM_types.hh:190
@ OPTYPE_INTERNAL
Definition WM_types.hh:210
static wmOperatorStatus new_sequencer_scene_exec(bContext *C, wmOperator *op)
Scene * ED_scene_sequencer_add(Main *bmain, bContext *C, eSceneCopyMethod method)
Definition scene_edit.cc:76
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)
Definition scene.cc:1917
bool ED_operator_screenactive(bContext *C)
char name[258]
Definition DNA_ID.h:433
ListBaseT< wmWindowManager > wm
Definition BKE_main.hh:415
ListBaseT< WorkSpace > workspaces
Definition BKE_main.hh:423
ListBaseT< Scene > scenes
Definition BKE_main.hh:386
ListBaseT< ViewLayer > view_layers
struct Scene * sequencer_scene
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1125
const char * description
Definition WM_types.hh:1115
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1165
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1141
struct ReportList * reports