Blender V4.5
sequencer_add.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cctype>
10#include <cstdlib>
11#include <cstring>
12
13#include "DNA_sequence_types.h"
14#include "MEM_guardedalloc.h"
15
16#include "BLI_listbase.h"
17#include "BLI_path_utils.hh"
18#include "BLI_string.h"
19#include "BLI_utildefines.h"
20
21#include "BLT_translation.hh"
22
23#include "DNA_scene_types.h"
24#include "DNA_space_types.h"
25
26#include "BKE_context.hh"
27#include "BKE_global.hh"
28#include "BKE_main.hh"
29#include "BKE_report.hh"
30#include "BKE_scene.hh"
31
32#include "IMB_imbuf_enums.h"
33
34#include "SEQ_channels.hh"
35#include "WM_api.hh"
36#include "WM_types.hh"
37
38#include "RNA_define.hh"
39#include "RNA_enum_types.hh"
40#include "RNA_prototypes.hh"
41
42#include "SEQ_add.hh"
43#include "SEQ_connect.hh"
44#include "SEQ_effects.hh"
45#include "SEQ_proxy.hh"
46#include "SEQ_select.hh"
47#include "SEQ_sequencer.hh"
48#include "SEQ_time.hh"
49#include "SEQ_transform.hh"
50
51#include "ED_scene.hh"
52/* For menu, popup, icons, etc. */
53#include "ED_screen.hh"
54#include "ED_sequencer.hh"
55
56#include "UI_interface.hh"
57#include "UI_view2d.hh"
58
59#ifdef WITH_AUDASPACE
60# include <AUD_Sequence.h>
61#endif
62
63#include "DEG_depsgraph.hh"
65
66/* Own include. */
67#include "sequencer_intern.hh"
68
69namespace blender::ed::vse {
70
74
75/* Generic functions, reused by add strip operators. */
76
77/* Avoid passing multiple args and be more verbose. */
78#define SEQPROP_STARTFRAME (1 << 0)
79#define SEQPROP_ENDFRAME (1 << 1)
80/* Skip pre-setting filepath to active strip media directory */
81#define SEQPROP_NOPATHS (1 << 2)
82#define SEQPROP_NOCHAN (1 << 3)
83#define SEQPROP_FIT_METHOD (1 << 4)
84#define SEQPROP_VIEW_TRANSFORM (1 << 5)
85#define SEQPROP_PLAYBACK_RATE (1 << 6)
86
88 {SEQ_SCALE_TO_FIT, "FIT", 0, "Scale to Fit", "Scale image to fit within the canvas"},
89 {SEQ_SCALE_TO_FILL, "FILL", 0, "Scale to Fill", "Scale image to completely fill the canvas"},
90 {SEQ_STRETCH_TO_FILL, "STRETCH", 0, "Stretch to Fill", "Stretch image to fill the canvas"},
91 {SEQ_USE_ORIGINAL_SIZE, "ORIGINAL", 0, "Use Original Size", "Keep image at its original size"},
92 {0, nullptr, 0, nullptr, nullptr},
93};
94
96{
97 PropertyRNA *prop;
98
100 RNA_def_int(ot->srna,
101 "frame_start",
102 0,
103 INT_MIN,
104 INT_MAX,
105 "Start Frame",
106 "Start frame of the sequence strip",
107 -MAXFRAME,
108 MAXFRAME);
109 }
110
111 if (flag & SEQPROP_ENDFRAME) {
112 /* Not usual since most strips have a fixed length. */
113 RNA_def_int(ot->srna,
114 "frame_end",
115 0,
116 INT_MIN,
117 INT_MAX,
118 "End Frame",
119 "End frame for the color strip",
120 -MAXFRAME,
121 MAXFRAME);
122 }
123
124 RNA_def_int(ot->srna,
125 "channel",
126 1,
127 1,
129 "Channel",
130 "Channel to place this strip into",
131 1,
133
135 ot->srna, "replace_sel", true, "Replace Selection", "Deselect previously selected strips");
136
137 /* Only for python scripts which import strips and place them after. */
138 prop = RNA_def_boolean(
139 ot->srna, "overlap", false, "Allow Overlap", "Don't correct overlap on new sequence strips");
141
142 prop = RNA_def_boolean(
143 ot->srna,
144 "overlap_shuffle_override",
145 false,
146 "Override Overlap Shuffle Behavior",
147 "Use the overlap_mode tool settings to determine how to shuffle overlapping strips");
149
150 prop = RNA_def_boolean(ot->srna,
151 "skip_locked_or_muted_channels",
152 true,
153 "Skip Locked or Muted Channels",
154 "Add strips to muted or locked channels when adding movie strips");
156
157 if (flag & SEQPROP_FIT_METHOD) {
158 ot->prop = RNA_def_enum(ot->srna,
159 "fit_method",
162 "Fit Method",
163 "Scale fit method");
164 }
165
167 ot->prop = RNA_def_boolean(ot->srna,
168 "set_view_transform",
169 true,
170 "Set View Transform",
171 "Set appropriate view transform based on media color space");
172 }
173
175 ot->prop = RNA_def_boolean(ot->srna,
176 "adjust_playback_rate",
177 true,
178 "Adjust Playback Rate",
179 "Play at normal speed regardless of scene FPS");
180 }
181}
182
184 wmOperator *op,
185 const char *identifier)
186{
187 if (RNA_struct_find_property(op->ptr, identifier)) {
188 Scene *scene = CTX_data_scene(C);
189 Strip *last_seq = seq::select_active_get(scene);
190 if (last_seq && last_seq->data && STRIP_HAS_PATH(last_seq)) {
191 Main *bmain = CTX_data_main(C);
192 char dirpath[FILE_MAX];
193 STRNCPY(dirpath, last_seq->data->dirpath);
194 BLI_path_abs(dirpath, BKE_main_blendfile_path(bmain));
195 RNA_string_set(op->ptr, identifier, dirpath);
196 }
197 }
198}
199
200static int find_unlocked_unmuted_channel(const Editing *ed, int channel_index)
201{
202 const ListBase *channels = seq::channels_displayed_get(ed);
203
204 while (channel_index < seq::MAX_CHANNELS) {
205 SeqTimelineChannel *channel = seq::channel_get_by_index(channels, channel_index);
206 if (!seq::channel_is_muted(channel) && !seq::channel_is_locked(channel)) {
207 break;
208 }
209 channel_index++;
210 }
211
212 return channel_index;
213}
214
216{
217 Strip *tgt = nullptr;
218 Scene *scene = CTX_data_scene(C);
220 int timeline_frame = scene->r.cfra;
221 int proximity = INT_MAX;
222
223 if (!ed || !ed->seqbasep) {
224 return 1;
225 }
226
227 LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) {
228 const int strip_end = seq::time_right_handle_frame_get(scene, strip);
229 if (ELEM(type, -1, strip->type) && (strip_end <= timeline_frame) &&
230 (timeline_frame - strip_end < proximity))
231 {
232 tgt = strip;
233 proximity = timeline_frame - strip_end;
234 }
235 }
236
237 int best_channel = 1;
238 if (tgt) {
239 best_channel = (type == STRIP_TYPE_MOVIE) ? tgt->channel - 1 : tgt->channel;
240 }
241
242 best_channel = find_unlocked_unmuted_channel(ed, best_channel);
243
244 return math::clamp(best_channel, 0, seq::MAX_CHANNELS);
245}
246
248 wmOperator *op,
249 int need_channels,
250 const char **r_error_msg)
251{
252 const int channel = RNA_int_get(op->ptr, "channel");
253 const int frame_start = RNA_int_get(op->ptr, "frame_start");
254
255 /* First check simple case - strip is added to very top of timeline. */
256 const int max_channel = seq::MAX_CHANNELS - need_channels + 1;
257 if (channel > max_channel) {
258 *r_error_msg = RPT_("No available channel for the current frame.");
259 return false;
260 }
261
262 /* When adding strip(s) to lower channels, we must count number of free channels. There can be
263 * gaps. */
264 Set<int> used_channels;
265 for (Strip *strip : all_strips_from_context(C)) {
266 if (seq::time_strip_intersects_frame(CTX_data_scene(C), strip, frame_start)) {
267 used_channels.add(strip->channel);
268 }
269 }
270
271 int free_channels = 0;
272 for (int i : IndexRange(channel, seq::MAX_CHANNELS - channel + 1)) {
273 if (!used_channels.contains(i)) {
274 free_channels++;
275 }
276 if (free_channels == need_channels) {
277 return true;
278 }
279 }
280
281 *r_error_msg = RPT_("No available channel for the current frame.");
282 return false;
283}
284
285/* Sets `channel` and `frame_start` properties when the operator is likely to have been invoked
286 * with drag-and-drop data. */
288 wmOperator *op,
289 const wmEvent *event)
290{
292 !RNA_collection_is_empty(op->ptr, "files")) ||
293 RNA_struct_property_is_set(op->ptr, "filepath"));
294
295 if (RNA_struct_property_is_set(op->ptr, "channel") ||
296 RNA_struct_property_is_set(op->ptr, "frame_start"))
297 {
298 return;
299 }
300
301 ARegion *region = CTX_wm_region(C);
302 if (!region || region->regiontype != RGN_TYPE_WINDOW) {
303 return;
304 }
305
306 float frame_start, channel;
307 UI_view2d_region_to_view(&region->v2d, event->mval[0], event->mval[1], &frame_start, &channel);
308 RNA_int_set(op->ptr, "channel", int(channel));
309 RNA_int_set(op->ptr, "frame_start", int(frame_start));
310}
311
313 bContext *C, wmOperator *op, int flag, int type, const wmEvent *event = nullptr)
314{
315 Scene *scene = CTX_data_scene(C);
316
317 int timeline_frame = scene->r.cfra;
318 if ((flag & SEQPROP_NOPATHS) && event) {
320 }
321
322 /* Effect strips don't need a channel initialized from the mouse. */
323 if (!(flag & SEQPROP_NOCHAN) && RNA_struct_property_is_set(op->ptr, "channel") == 0) {
325 }
326
327 if (!RNA_struct_property_is_set(op->ptr, "frame_start")) {
328 RNA_int_set(op->ptr, "frame_start", timeline_frame);
329 }
330
331 if ((flag & SEQPROP_ENDFRAME) && RNA_struct_property_is_set(op->ptr, "frame_end") == 0) {
333 op->ptr, "frame_end", RNA_int_get(op->ptr, "frame_start") + DEFAULT_IMG_STRIP_LENGTH);
334 }
335
336 if (!(flag & SEQPROP_NOPATHS)) {
339 }
340}
341
343{
344 Main *bmain = CTX_data_main(C);
345
346 PropertyRNA *prop;
347 const bool relative = (prop = RNA_struct_find_property(op->ptr, "relative_path")) &&
348 RNA_property_boolean_get(op->ptr, prop);
349 memset(load_data, 0, sizeof(seq::LoadData));
350
351 load_data->start_frame = RNA_int_get(op->ptr, "frame_start");
352 load_data->channel = RNA_int_get(op->ptr, "channel");
353 load_data->image.end_frame = load_data->start_frame;
354 load_data->image.len = 1;
355
356 if ((prop = RNA_struct_find_property(op->ptr, "fit_method"))) {
357 load_data->fit_method = eSeqImageFitMethod(RNA_enum_get(op->ptr, "fit_method"));
359 }
360
361 if ((prop = RNA_struct_find_property(op->ptr, "adjust_playback_rate"))) {
362 load_data->adjust_playback_rate = RNA_boolean_get(op->ptr, "adjust_playback_rate");
363 }
364
365 if ((prop = RNA_struct_find_property(op->ptr, "filepath"))) {
366 RNA_property_string_get(op->ptr, prop, load_data->path);
367 /* File basename might be too long, better report it now than silently
368 * truncating the basename later. */
369 const char *basename = BLI_path_basename(load_data->path);
370 if (strlen(basename) >= sizeof(StripElem::filename)) {
372 RPT_ERROR,
373 "Filename '%s' too long (max length %zu, was %zu)",
374 basename,
375 sizeof(StripElem::filename),
376 strlen(basename));
377 return false;
378 }
379 STRNCPY(load_data->name, basename);
380 }
381 else if ((prop = RNA_struct_find_property(op->ptr, "directory"))) {
382 char *directory = RNA_string_get_alloc(op->ptr, "directory", nullptr, 0, nullptr);
383
384 if ((prop = RNA_struct_find_property(op->ptr, "files"))) {
385 RNA_PROP_BEGIN (op->ptr, itemptr, prop) {
386 char *filename = RNA_string_get_alloc(&itemptr, "name", nullptr, 0, nullptr);
387 STRNCPY(load_data->name, filename);
388 BLI_path_join(load_data->path, sizeof(load_data->path), directory, filename);
389 MEM_freeN(filename);
390 break;
391 }
393 }
394 MEM_freeN(directory);
395 }
396
397 if (relative) {
398 BLI_path_rel(load_data->path, BKE_main_blendfile_path(bmain));
399 }
400
401 if ((prop = RNA_struct_find_property(op->ptr, "frame_end"))) {
402 load_data->image.end_frame = RNA_property_int_get(op->ptr, prop);
403 load_data->effect.end_frame = load_data->image.end_frame;
404 }
405
406 if ((prop = RNA_struct_find_property(op->ptr, "cache")) &&
407 RNA_property_boolean_get(op->ptr, prop))
408 {
409 load_data->flags |= seq::SEQ_LOAD_SOUND_CACHE;
410 }
411
412 if ((prop = RNA_struct_find_property(op->ptr, "mono")) &&
413 RNA_property_boolean_get(op->ptr, prop))
414 {
415 load_data->flags |= seq::SEQ_LOAD_SOUND_MONO;
416 }
417
418 if ((prop = RNA_struct_find_property(op->ptr, "use_framerate")) &&
419 RNA_property_boolean_get(op->ptr, prop))
420 {
422 }
423
424 if ((prop = RNA_struct_find_property(op->ptr, "set_view_transform")) &&
425 RNA_property_boolean_get(op->ptr, prop))
426 {
428 }
429
430 if ((prop = RNA_struct_find_property(op->ptr, "use_multiview")) &&
431 RNA_property_boolean_get(op->ptr, prop))
432 {
433 if (op->customdata) {
434 SequencerAddData *sad = static_cast<SequencerAddData *>(op->customdata);
435 ImageFormatData *imf = &sad->im_format;
436
437 load_data->use_multiview = true;
438 load_data->views_format = imf->views_format;
439 load_data->stereo3d_format = &imf->stereo3d_format;
440 }
441 }
442 return true;
443}
444
446{
447 Scene *scene = CTX_data_scene(C);
448 Editing *ed = seq::editing_get(scene);
449
450 if (strip == nullptr) {
451 return;
452 }
453
454 if (RNA_boolean_get(op->ptr, "replace_sel")) {
455 strip->flag |= SELECT;
456 seq::select_active_set(scene, strip);
457 }
458
459 if (RNA_boolean_get(op->ptr, "overlap") == true ||
460 !seq::transform_test_overlap(scene, ed->seqbasep, strip))
461 {
462 /* No overlap should be handled or the strip is not overlapping, exit early. */
463 return;
464 }
465
466 if (RNA_boolean_get(op->ptr, "overlap_shuffle_override")) {
467 /* Use set overlap_mode to fix overlaps. */
469 strip_col.add(strip);
470
471 ScrArea *area = CTX_wm_area(C);
472 const bool use_sync_markers = (((SpaceSeq *)area->spacedata.first)->flag & SEQ_MARKER_TRANS) !=
473 0;
474 seq::transform_handle_overlap(scene, ed->seqbasep, strip_col, use_sync_markers);
475 }
476 else {
477 /* Shuffle strip channel to fix overlaps. */
478 seq::transform_seqbase_shuffle(ed->seqbasep, strip, scene);
479 }
480}
481
482/* In this alternative version we only check for overlap, but do not do anything about them. */
484 wmOperator *op,
485 Strip *strip)
486{
487 Scene *scene = CTX_data_scene(C);
488 Editing *ed = seq::editing_get(scene);
489
490 if (strip == nullptr) {
491 return false;
492 }
493
494 if (RNA_boolean_get(op->ptr, "replace_sel")) {
495 strip->flag |= SELECT;
496 seq::select_active_set(scene, strip);
497 }
498
499 return seq::transform_test_overlap(scene, ed->seqbasep, strip);
500}
501
502static bool seq_effect_add_properties_poll(const bContext * /*C*/,
503 wmOperator *op,
504 const PropertyRNA *prop)
505{
506 const char *prop_id = RNA_property_identifier(prop);
507 int type = RNA_enum_get(op->ptr, "type");
508
509 /* Hide start/end frames for effect strips that are locked to their parents' location. */
510 if (seq::effect_get_num_inputs(type) != 0) {
511 if (STR_ELEM(prop_id, "frame_start", "frame_end")) {
512 return false;
513 }
514 }
515 if ((type != STRIP_TYPE_COLOR) && STREQ(prop_id, "color")) {
516 return false;
517 }
518
519 return true;
520}
521
523{
524 Main *bmain = CTX_data_main(C);
525 Scene *scene = CTX_data_scene(C);
526 const Editing *ed = seq::editing_ensure(scene);
527 Scene *sce_seq = static_cast<Scene *>(
528 BLI_findlink(&bmain->scenes, RNA_enum_get(op->ptr, "scene")));
529
530 if (sce_seq == nullptr) {
531 BKE_report(op->reports, RPT_ERROR, "Scene not found");
532 return OPERATOR_CANCELLED;
533 }
534
535 const char *error_msg;
536 if (!have_free_channels(C, op, 1, &error_msg)) {
537 BKE_report(op->reports, RPT_ERROR, error_msg);
538 return OPERATOR_CANCELLED;
539 }
540
541 if (RNA_boolean_get(op->ptr, "replace_sel")) {
542 deselect_all_strips(scene);
543 }
544
545 seq::LoadData load_data;
546 load_data_init_from_operator(&load_data, C, op);
547 load_data.scene = sce_seq;
548
549 Strip *strip = seq::add_scene_strip(scene, ed->seqbasep, &load_data);
551
555
556 return OPERATOR_FINISHED;
557}
558
560{
562 /* Disable following properties if there are any existing strips, unless overridden by user. */
563 if (ed && ed->seqbasep && ed->seqbasep->first) {
564 if (RNA_struct_find_property(op->ptr, "use_framerate")) {
565 RNA_boolean_set(op->ptr, "use_framerate", false);
566 }
567 if (RNA_struct_find_property(op->ptr, "set_view_transform")) {
568 RNA_boolean_set(op->ptr, "set_view_transform", false);
569 }
570 }
571}
572
585
587{
588 PropertyRNA *prop;
589
590 /* Identifiers. */
591 ot->name = "Add Scene Strip";
592 ot->idname = "SEQUENCER_OT_scene_strip_add";
593 ot->description = "Add a strip to the sequencer using a Blender scene as a source";
594
595 /* API callbacks. */
599
600 /* Flags. */
602
604 prop = RNA_def_enum(ot->srna, "scene", rna_enum_dummy_NULL_items, 0, "Scene", "");
607 ot->prop = prop;
608}
609
611 {SCE_COPY_NEW, "NEW", 0, "New", "Add new Strip with a new empty Scene with default settings"},
613 "EMPTY",
614 0,
615 "Copy Settings",
616 "Add a new Strip, with an empty scene, and copy settings from the current scene"},
618 "LINK_COPY",
619 0,
620 "Linked Copy",
621 "Add a Strip and link in the collections from the current scene (shallow copy)"},
623 "FULL_COPY",
624 0,
625 "Full Copy",
626 "Add a Strip and make a full copy of the current scene"},
627 {0, nullptr, 0, nullptr, nullptr},
628};
629
631{
632 Main *bmain = CTX_data_main(C);
633 Scene *scene = CTX_data_scene(C);
634 const Editing *ed = seq::editing_ensure(scene);
635
636 const char *error_msg;
637 if (!have_free_channels(C, op, 1, &error_msg)) {
638 BKE_report(op->reports, RPT_ERROR, error_msg);
639 return OPERATOR_CANCELLED;
640 }
641
642 if (RNA_boolean_get(op->ptr, "replace_sel")) {
643 deselect_all_strips(scene);
644 }
645
646 seq::LoadData load_data;
647 load_data_init_from_operator(&load_data, C, op);
648
649 int type = RNA_enum_get(op->ptr, "type");
650 Scene *scene_new = ED_scene_sequencer_add(bmain, C, eSceneCopyMethod(type), false);
651 if (scene_new == nullptr) {
652 return OPERATOR_CANCELLED;
653 }
654 load_data.scene = scene_new;
655
656 Strip *strip = seq::add_scene_strip(scene, ed->seqbasep, &load_data);
658
662
663 return OPERATOR_FINISHED;
664}
665
674
676 PointerRNA * /*ptr*/,
677 PropertyRNA * /*prop*/,
678 bool *r_free)
679{
680 EnumPropertyItem *item = nullptr;
681 int totitem = 0;
682 uint item_index;
683
685 RNA_enum_item_add(&item, &totitem, &strip_new_scene_items[item_index]);
686
687 bool has_scene_or_no_context = false;
688 if (C == nullptr) {
689 /* For documentation generation. */
690 has_scene_or_no_context = true;
691 }
692 else {
693 Scene *scene = CTX_data_scene(C);
694 Strip *strip = seq::select_active_get(scene);
695 if (strip && (strip->type == STRIP_TYPE_SCENE) && (strip->scene != nullptr)) {
696 has_scene_or_no_context = true;
697 }
698 }
699
700 if (has_scene_or_no_context) {
702 for (int i = 0; i < ARRAY_SIZE(values); i++) {
703 item_index = RNA_enum_from_value(strip_new_scene_items, values[i]);
704 RNA_enum_item_add(&item, &totitem, &strip_new_scene_items[item_index]);
705 }
706 }
707
708 RNA_enum_item_end(&item, &totitem);
709 *r_free = true;
710 return item;
711}
712
714{
715 /* Identifiers. */
716 ot->name = "Add Strip with a new Scene";
717 ot->idname = "SEQUENCER_OT_scene_strip_add_new";
718 ot->description = "Create a new Strip and assign a new Scene as source";
719
720 /* API callbacks. */
724
725 /* Flags. */
727
729
730 ot->prop = RNA_def_enum(ot->srna, "type", strip_new_scene_items, SCE_COPY_NEW, "Type", "");
732}
733
735{
736 Main *bmain = CTX_data_main(C);
737 Scene *scene = CTX_data_scene(C);
738 const Editing *ed = seq::editing_ensure(scene);
739 MovieClip *clip = static_cast<MovieClip *>(
740 BLI_findlink(&bmain->movieclips, RNA_enum_get(op->ptr, "clip")));
741
742 if (clip == nullptr) {
743 BKE_report(op->reports, RPT_ERROR, "Movie clip not found");
744 return OPERATOR_CANCELLED;
745 }
746
747 const char *error_msg;
748 if (!have_free_channels(C, op, 1, &error_msg)) {
749 BKE_report(op->reports, RPT_ERROR, error_msg);
750 return OPERATOR_CANCELLED;
751 }
752
753 if (RNA_boolean_get(op->ptr, "replace_sel")) {
754 deselect_all_strips(scene);
755 }
756
757 seq::LoadData load_data;
758 if (!load_data_init_from_operator(&load_data, C, op)) {
759 return OPERATOR_CANCELLED;
760 }
761 load_data.clip = clip;
762
763 Strip *strip = seq::add_movieclip_strip(scene, ed->seqbasep, &load_data);
765
768
769 return OPERATOR_FINISHED;
770}
771
773 wmOperator *op,
774 const wmEvent *event)
775{
776 if (!RNA_struct_property_is_set(op->ptr, "clip")) {
777 return WM_enum_search_invoke(C, op, event);
778 }
779
782}
783
785{
786 PropertyRNA *prop;
787
788 /* Identifiers. */
789 ot->name = "Add MovieClip Strip";
790 ot->idname = "SEQUENCER_OT_movieclip_strip_add";
791 ot->description = "Add a movieclip strip to the sequencer";
792
793 /* API callbacks. */
797
798 /* Flags. */
800
802 prop = RNA_def_enum(ot->srna, "clip", rna_enum_dummy_NULL_items, 0, "Clip", "");
806 ot->prop = prop;
807}
808
810{
811 Main *bmain = CTX_data_main(C);
812 Scene *scene = CTX_data_scene(C);
813 const Editing *ed = seq::editing_ensure(scene);
814 Mask *mask = static_cast<Mask *>(BLI_findlink(&bmain->masks, RNA_enum_get(op->ptr, "mask")));
815
816 if (mask == nullptr) {
817 BKE_report(op->reports, RPT_ERROR, "Mask not found");
818 return OPERATOR_CANCELLED;
819 }
820
821 const char *error_msg;
822 if (!have_free_channels(C, op, 1, &error_msg)) {
823 BKE_report(op->reports, RPT_ERROR, error_msg);
824 return OPERATOR_CANCELLED;
825 }
826
827 if (RNA_boolean_get(op->ptr, "replace_sel")) {
828 deselect_all_strips(scene);
829 }
830
831 seq::LoadData load_data;
832 load_data_init_from_operator(&load_data, C, op);
833 load_data.mask = mask;
834
835 Strip *strip = seq::add_mask_strip(scene, ed->seqbasep, &load_data);
837
840
841 return OPERATOR_FINISHED;
842}
843
845 wmOperator *op,
846 const wmEvent *event)
847{
848 if (!RNA_struct_property_is_set(op->ptr, "mask")) {
849 return WM_enum_search_invoke(C, op, event);
850 }
851
854}
855
857{
858 PropertyRNA *prop;
859
860 /* Identifiers. */
861 ot->name = "Add Mask Strip";
862 ot->idname = "SEQUENCER_OT_mask_strip_add";
863 ot->description = "Add a mask strip to the sequencer";
864
865 /* API callbacks. */
869
870 /* Flags. */
872
874 prop = RNA_def_enum(ot->srna, "mask", rna_enum_dummy_NULL_items, 0, "Mask", "");
877 ot->prop = prop;
878}
879
880static void sequencer_add_init(bContext * /*C*/, wmOperator *op)
881{
882 op->customdata = MEM_callocN(sizeof(SequencerAddData), __func__);
883}
884
885static void sequencer_add_cancel(bContext * /*C*/, wmOperator *op)
886{
887 if (op->customdata) {
888 SequencerAddData *sad = static_cast<SequencerAddData *>(op->customdata);
889 MEM_freeN(sad);
890 op->customdata = nullptr;
891 }
892}
893
895 PropertyRNA *prop,
896 void * /*user_data*/)
897{
898 const char *prop_id = RNA_property_identifier(prop);
899
900 return !STR_ELEM(prop_id, "filepath", "directory", "filename");
901}
902
903/* Strips are added in context of timeline which has different preview size than actual preview. We
904 * must search for preview area. In most cases there will be only one preview area, but there can
905 * be more with different preview sizes. */
907{
908 bScreen *screen = CTX_wm_screen(C);
910 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
911 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
912 switch (sl->spacetype) {
913 case SPACE_SEQ: {
914 SpaceSeq *sseq = (SpaceSeq *)sl;
916 continue;
917 }
919 }
920 }
921 }
922 }
923 return proxy_sizes;
924}
925
927{
928 if (U.sequencer_proxy_setup != USER_SEQ_PROXY_SETUP_AUTOMATIC) {
929 return;
930 }
931
934
935 for (Strip *strip : movie_strips) {
936 /* Enable and set proxy size. */
937 seq::proxy_set(strip, true);
938 strip->data->proxy->build_size_flags = seq_get_proxy_size_flags(C);
939 strip->data->proxy->build_flags |= SEQ_PROXY_SKIP_EXISTING;
941 pj->main, pj->depsgraph, pj->scene, strip, nullptr, &pj->queue, true);
942 }
943
944 if (!WM_jobs_is_running(wm_job)) {
945 G.is_break = false;
947 }
949}
950
952 Main *bmain, Scene *scene, Strip *strip_movie, Strip *strip_sound, seq::LoadData *load_data)
953{
954 if (ELEM(nullptr, strip_movie, strip_sound)) {
955 return;
956 }
957
958 /* Make sure that the sound strip start time relative to the movie is taken into account. */
959 seq::add_sound_av_sync(bmain, scene, strip_sound, load_data);
960
961 /* Ensure that the sound strip start/end matches the movie strip even if the actual
962 * length and true position of the sound doesn't match up exactly.
963 */
965 scene, strip_sound, seq::time_right_handle_frame_get(scene, strip_movie));
967 scene, strip_sound, seq::time_left_handle_frame_get(scene, strip_movie));
968}
969
971 wmOperator *op,
972 seq::LoadData *load_data,
973 blender::VectorSet<Strip *> &r_movie_strips)
974{
975 Main *bmain = CTX_data_main(C);
976 Scene *scene = CTX_data_scene(C);
977 const Editing *ed = seq::editing_ensure(scene);
978 bool overlap_shuffle_override = RNA_boolean_get(op->ptr, "overlap") == false &&
979 RNA_boolean_get(op->ptr, "overlap_shuffle_override");
980 bool has_seq_overlap = false;
981 blender::Vector<Strip *> added_strips;
982
983 RNA_BEGIN (op->ptr, itemptr, "files") {
984 char dir_only[FILE_MAX];
985 char file_only[FILE_MAX];
986 RNA_string_get(op->ptr, "directory", dir_only);
987 RNA_string_get(&itemptr, "name", file_only);
988 BLI_path_join(load_data->path, sizeof(load_data->path), dir_only, file_only);
989 STRNCPY(load_data->name, file_only);
990 Strip *strip_movie = nullptr;
991 Strip *strip_sound = nullptr;
992
993 strip_movie = seq::add_movie_strip(bmain, scene, ed->seqbasep, load_data);
994
995 if (strip_movie == nullptr) {
996 BKE_reportf(op->reports, RPT_ERROR, "File '%s' could not be loaded", load_data->path);
997 }
998 else {
999 if (RNA_boolean_get(op->ptr, "sound")) {
1000 strip_sound = seq::add_sound_strip(bmain, scene, ed->seqbasep, load_data);
1001 sequencer_add_movie_sync_sound_strip(bmain, scene, strip_movie, strip_sound, load_data);
1002 added_strips.append(strip_movie);
1003
1004 if (strip_sound) {
1005 /* The video has sound, shift the video strip up a channel to make room for the sound
1006 * strip. */
1007 added_strips.append(strip_sound);
1008 seq::strip_channel_set(strip_movie,
1009 find_unlocked_unmuted_channel(ed, strip_movie->channel + 1));
1010 }
1011 }
1012
1013 load_data->start_frame += seq::time_right_handle_frame_get(scene, strip_movie) -
1014 seq::time_left_handle_frame_get(scene, strip_movie);
1015 if (overlap_shuffle_override) {
1016 has_seq_overlap |= seq_load_apply_generic_options_only_test_overlap(C, op, strip_sound);
1017 has_seq_overlap |= seq_load_apply_generic_options_only_test_overlap(C, op, strip_movie);
1018 }
1019 else {
1020 seq_load_apply_generic_options(C, op, strip_sound);
1021 seq_load_apply_generic_options(C, op, strip_movie);
1022 }
1023
1024 if (U.sequencer_editor_flag & USER_SEQ_ED_CONNECT_STRIPS_BY_DEFAULT) {
1025 seq::connect(strip_movie, strip_sound);
1026 }
1027
1028 r_movie_strips.add(strip_movie);
1029 }
1030 }
1031 RNA_END;
1032
1033 if (overlap_shuffle_override) {
1034 if (has_seq_overlap) {
1035 ScrArea *area = CTX_wm_area(C);
1036 const bool use_sync_markers = (((SpaceSeq *)area->spacedata.first)->flag &
1037 SEQ_MARKER_TRANS) != 0;
1038 seq::transform_handle_overlap(scene, ed->seqbasep, added_strips, use_sync_markers);
1039 }
1040 }
1041}
1042
1044 wmOperator *op,
1045 seq::LoadData *load_data,
1046 blender::VectorSet<Strip *> &r_movie_strips)
1047{
1048 Main *bmain = CTX_data_main(C);
1049 Scene *scene = CTX_data_scene(C);
1050 const Editing *ed = seq::editing_ensure(scene);
1051
1052 Strip *strip_movie = nullptr;
1053 Strip *strip_sound = nullptr;
1054 blender::Vector<Strip *> added_strips;
1055
1056 strip_movie = seq::add_movie_strip(bmain, scene, ed->seqbasep, load_data);
1057
1058 if (strip_movie == nullptr) {
1059 BKE_reportf(op->reports, RPT_ERROR, "File '%s' could not be loaded", load_data->path);
1060 return false;
1061 }
1062 if (RNA_boolean_get(op->ptr, "sound")) {
1063 strip_sound = seq::add_sound_strip(bmain, scene, ed->seqbasep, load_data);
1064 sequencer_add_movie_sync_sound_strip(bmain, scene, strip_movie, strip_sound, load_data);
1065 added_strips.append(strip_movie);
1066
1067 if (strip_sound) {
1068 added_strips.append(strip_sound);
1069
1070 /* The video has sound, shift the video strip up a channel to make room for the sound
1071 * strip. */
1072 int movie_channel = strip_movie->channel + 1;
1073
1074 if (RNA_boolean_get(op->ptr, "skip_locked_or_muted_channels")) {
1075 movie_channel = find_unlocked_unmuted_channel(ed, strip_movie->channel + 1);
1076 }
1077
1078 seq::strip_channel_set(strip_movie, movie_channel);
1079 }
1080 }
1081
1082 bool overlap_shuffle_override = RNA_boolean_get(op->ptr, "overlap") == false &&
1083 RNA_boolean_get(op->ptr, "overlap_shuffle_override");
1084 if (overlap_shuffle_override) {
1085 bool has_seq_overlap = false;
1086
1087 has_seq_overlap |= seq_load_apply_generic_options_only_test_overlap(C, op, strip_sound);
1088 has_seq_overlap |= seq_load_apply_generic_options_only_test_overlap(C, op, strip_movie);
1089
1090 if (has_seq_overlap) {
1091 ScrArea *area = CTX_wm_area(C);
1092 const bool use_sync_markers = (((SpaceSeq *)area->spacedata.first)->flag &
1093 SEQ_MARKER_TRANS) != 0;
1094 seq::transform_handle_overlap(scene, ed->seqbasep, added_strips, use_sync_markers);
1095 }
1096 }
1097 else {
1098 seq_load_apply_generic_options(C, op, strip_sound);
1099 seq_load_apply_generic_options(C, op, strip_movie);
1100 }
1101
1102 if (U.sequencer_editor_flag & USER_SEQ_ED_CONNECT_STRIPS_BY_DEFAULT) {
1103 seq::connect(strip_movie, strip_sound);
1104 }
1105
1106 r_movie_strips.add(strip_movie);
1107
1108 return true;
1109}
1110
1112{
1113 Main *bmain = CTX_data_main(C);
1114 Scene *scene = CTX_data_scene(C);
1115 seq::LoadData load_data;
1116
1117 if (!load_data_init_from_operator(&load_data, C, op)) {
1118 return OPERATOR_CANCELLED;
1119 }
1120
1122
1123 const char *error_msg;
1124 if (!have_free_channels(C, op, 2, &error_msg)) {
1125 BKE_report(op->reports, RPT_ERROR, error_msg);
1126 return OPERATOR_CANCELLED;
1127 }
1128
1129 if (RNA_boolean_get(op->ptr, "replace_sel")) {
1130 deselect_all_strips(scene);
1131 }
1132
1133 blender::VectorSet<Strip *> movie_strips;
1134 const int tot_files = RNA_property_collection_length(op->ptr,
1135 RNA_struct_find_property(op->ptr, "files"));
1136
1137 char vt_old[64];
1138 STRNCPY(vt_old, scene->view_settings.view_transform);
1139 float fps_old = scene->r.frs_sec / scene->r.frs_sec_base;
1140
1141 if (tot_files > 1) {
1142 sequencer_add_movie_multiple_strips(C, op, &load_data, movie_strips);
1143 }
1144 else {
1145 sequencer_add_movie_single_strip(C, op, &load_data, movie_strips);
1146 }
1147
1148 if (!STREQ(vt_old, scene->view_settings.view_transform)) {
1149 BKE_reportf(op->reports,
1151 "View transform set to %s (converted from %s)",
1153 vt_old);
1154 }
1155
1156 if (fps_old != scene->r.frs_sec / scene->r.frs_sec_base) {
1157 BKE_reportf(op->reports,
1159 "Scene frame rate set to %.4g (converted from %.4g)",
1160 scene->r.frs_sec / scene->r.frs_sec_base,
1161 fps_old);
1162 }
1163
1164 if (movie_strips.is_empty()) {
1166 return OPERATOR_CANCELLED;
1167 }
1168
1169 seq_build_proxy(C, movie_strips);
1173
1174 /* Free custom data. */
1176
1177 return OPERATOR_FINISHED;
1178}
1179
1181 wmOperator *op,
1182 const wmEvent *event)
1183{
1184 PropertyRNA *prop;
1185 Scene *scene = CTX_data_scene(C);
1186
1188
1189 RNA_enum_set(op->ptr, "fit_method", seq::tool_settings_fit_method_get(scene));
1190 RNA_boolean_set(op->ptr, "adjust_playback_rate", true);
1191
1192 /* This is for drag and drop. */
1193 if ((RNA_struct_property_is_set(op->ptr, "files") &&
1194 !RNA_collection_is_empty(op->ptr, "files")) ||
1195 RNA_struct_property_is_set(op->ptr, "filepath"))
1196 {
1198
1199 const char *error_msg;
1200 if (!have_free_channels(C, op, 2, &error_msg)) {
1201 BKE_report(op->reports, RPT_ERROR, error_msg);
1202 return OPERATOR_CANCELLED;
1203 }
1204
1206 }
1207
1209 sequencer_add_init(C, op);
1210
1211 /* Show multiview save options only if scene use multiview. */
1212 prop = RNA_struct_find_property(op->ptr, "show_multiview");
1213 RNA_property_boolean_set(op->ptr, prop, (scene->r.scemode & R_MULTIVIEW) != 0);
1214
1217}
1218
1219static void sequencer_add_draw(bContext * /*C*/, wmOperator *op)
1220{
1221 uiLayout *layout = op->layout;
1222 SequencerAddData *sad = static_cast<SequencerAddData *>(op->customdata);
1223 ImageFormatData *imf = &sad->im_format;
1224
1225 /* Main draw call. */
1226 uiDefAutoButsRNA(layout,
1227 op->ptr,
1229 nullptr,
1230 nullptr,
1232 false);
1233
1234 /* Image template. */
1235 PointerRNA imf_ptr = RNA_pointer_create_discrete(nullptr, &RNA_ImageFormatSettings, imf);
1236
1237 /* Multiview template. */
1238 if (RNA_boolean_get(op->ptr, "show_multiview")) {
1239 uiTemplateImageFormatViews(layout, &imf_ptr, op->ptr);
1240 }
1241}
1242
1244{
1245
1246 /* Identifiers. */
1247 ot->name = "Add Movie Strip";
1248 ot->idname = "SEQUENCER_OT_movie_strip_add";
1249 ot->description = "Add a movie strip to the sequencer";
1250
1251 /* API callbacks. */
1254 ot->cancel = sequencer_add_cancel;
1255 ot->ui = sequencer_add_draw;
1257
1258 /* Flags. */
1259 ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
1260
1272 RNA_def_boolean(ot->srna, "sound", true, "Sound", "Load sound with the movie");
1273 RNA_def_boolean(ot->srna,
1274 "use_framerate",
1275 true,
1276 "Set Scene Frame Rate",
1277 "Set frame rate of the current scene to the frame rate of the movie");
1278}
1279
1281 wmOperator *op,
1282 seq::LoadData *load_data)
1283{
1284 Main *bmain = CTX_data_main(C);
1285 Scene *scene = CTX_data_scene(C);
1286 Editing *ed = seq::editing_ensure(scene);
1287
1288 RNA_BEGIN (op->ptr, itemptr, "files") {
1289 char dir_only[FILE_MAX];
1290 char file_only[FILE_MAX];
1291 RNA_string_get(op->ptr, "directory", dir_only);
1292 RNA_string_get(&itemptr, "name", file_only);
1293 BLI_path_join(load_data->path, sizeof(load_data->path), dir_only, file_only);
1294 STRNCPY(load_data->name, file_only);
1295 Strip *strip = seq::add_sound_strip(bmain, scene, ed->seqbasep, load_data);
1296 if (strip == nullptr) {
1297 BKE_reportf(op->reports, RPT_ERROR, "File '%s' could not be loaded", load_data->path);
1298 }
1299 else {
1301 load_data->start_frame += seq::time_right_handle_frame_get(scene, strip) -
1302 seq::time_left_handle_frame_get(scene, strip);
1303 }
1304 }
1305 RNA_END;
1306}
1307
1309{
1310 Main *bmain = CTX_data_main(C);
1311 Scene *scene = CTX_data_scene(C);
1312 Editing *ed = seq::editing_ensure(scene);
1313
1314 Strip *strip = seq::add_sound_strip(bmain, scene, ed->seqbasep, load_data);
1315 if (strip == nullptr) {
1316 BKE_reportf(op->reports, RPT_ERROR, "File '%s' could not be loaded", load_data->path);
1317 return false;
1318 }
1320
1321 return true;
1322}
1323
1325{
1326 Main *bmain = CTX_data_main(C);
1327 Scene *scene = CTX_data_scene(C);
1328 seq::LoadData load_data;
1329 load_data_init_from_operator(&load_data, C, op);
1330
1331 const char *error_msg;
1332 if (!have_free_channels(C, op, 1, &error_msg)) {
1333 BKE_report(op->reports, RPT_ERROR, error_msg);
1334 return OPERATOR_CANCELLED;
1335 }
1336
1337 if (RNA_boolean_get(op->ptr, "replace_sel")) {
1338 deselect_all_strips(scene);
1339 }
1340
1341 const int tot_files = RNA_property_collection_length(op->ptr,
1342 RNA_struct_find_property(op->ptr, "files"));
1343 if (tot_files > 1) {
1344 sequencer_add_sound_multiple_strips(C, op, &load_data);
1345 }
1346 else {
1347 if (!sequencer_add_sound_single_strip(C, op, &load_data)) {
1349 return OPERATOR_CANCELLED;
1350 }
1351 }
1352
1354
1358
1359 return OPERATOR_FINISHED;
1360}
1361
1363 wmOperator *op,
1364 const wmEvent *event)
1365{
1366 /* This is for drag and drop. */
1367 if ((RNA_struct_property_is_set(op->ptr, "files") &&
1368 !RNA_collection_is_empty(op->ptr, "files")) ||
1369 RNA_struct_property_is_set(op->ptr, "filepath"))
1370 {
1372
1373 const char *error_msg;
1374 if (!have_free_channels(C, op, 1, &error_msg)) {
1375 BKE_report(op->reports, RPT_ERROR, error_msg);
1376 return OPERATOR_CANCELLED;
1377 }
1378
1380 }
1381
1383
1386}
1387
1389{
1390
1391 /* Identifiers. */
1392 ot->name = "Add Sound Strip";
1393 ot->idname = "SEQUENCER_OT_sound_strip_add";
1394 ot->description = "Add a sound strip to the sequencer";
1395
1396 /* API callbacks. */
1400
1401 /* Flags. */
1402 ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
1403
1413 RNA_def_boolean(ot->srna, "cache", false, "Cache", "Cache the sound in memory");
1414 RNA_def_boolean(ot->srna, "mono", false, "Mono", "Merge all the sound's channels into one");
1415}
1416
1418 int sfra,
1419 int *r_minframe,
1420 int *r_numdigits)
1421{
1422 int minframe = INT32_MAX, maxframe = INT32_MIN;
1423 int numdigits = 0;
1424
1425 RNA_BEGIN (op->ptr, itemptr, "files") {
1426 char *filename;
1427 int frame;
1428 filename = RNA_string_get_alloc(&itemptr, "name", nullptr, 0, nullptr);
1429
1430 if (filename) {
1431 if (BLI_path_frame_get(filename, &frame, &numdigits)) {
1432 minframe = min_ii(minframe, frame);
1433 maxframe = max_ii(maxframe, frame);
1434 }
1435
1436 MEM_freeN(filename);
1437 }
1438 }
1439 RNA_END;
1440
1441 if (minframe == INT32_MAX) {
1442 minframe = sfra;
1443 maxframe = minframe + 1;
1444 }
1445
1446 *r_minframe = minframe;
1447 *r_numdigits = numdigits;
1448
1449 return maxframe - minframe + 1;
1450}
1451
1453 wmOperator *op, StripElem *se, int len, int minframe, int numdigits)
1454{
1455 char *filename = nullptr;
1456 RNA_BEGIN (op->ptr, itemptr, "files") {
1457 filename = RNA_string_get_alloc(&itemptr, "name", nullptr, 0, nullptr);
1458 break;
1459 }
1460 RNA_END;
1461
1462 if (filename) {
1463 char ext[FILE_MAX];
1464 char filename_stripped[FILE_MAX];
1465 /* Strip the frame from filename and substitute with `#`. */
1466 BLI_path_frame_strip(filename, ext, sizeof(ext));
1467
1468 for (int i = 0; i < len; i++, se++) {
1469 STRNCPY(filename_stripped, filename);
1470 BLI_path_frame(filename_stripped, sizeof(filename_stripped), minframe + i, numdigits);
1471 SNPRINTF(se->filename, "%s%s", filename_stripped, ext);
1472 }
1473
1474 MEM_freeN(filename);
1475 }
1476}
1477
1479 const int start_frame,
1480 int *minframe,
1481 int *numdigits)
1482{
1483 const bool use_placeholders = RNA_boolean_get(op->ptr, "use_placeholders");
1484
1485 if (use_placeholders) {
1486 return sequencer_image_seq_get_minmax_frame(op, start_frame, minframe, numdigits);
1487 }
1489}
1490
1492 Scene *scene,
1493 Strip *strip,
1494 seq::LoadData *load_data,
1495 const int minframe,
1496 const int numdigits)
1497{
1498 const bool use_placeholders = RNA_boolean_get(op->ptr, "use_placeholders");
1499 char dirpath[sizeof(strip->data->dirpath)];
1500 BLI_path_split_dir_part(load_data->path, dirpath, sizeof(dirpath));
1501 seq::add_image_set_directory(strip, dirpath);
1502
1503 if (use_placeholders) {
1505 op, strip->data->stripdata, load_data->image.len, minframe, numdigits);
1506 }
1507 else {
1508 size_t strip_frame = 0;
1509 RNA_BEGIN (op->ptr, itemptr, "files") {
1510 char *filename = RNA_string_get_alloc(&itemptr, "name", nullptr, 0, nullptr);
1511 seq::add_image_load_file(scene, strip, strip_frame, filename);
1512 MEM_freeN(filename);
1513 strip_frame++;
1514 }
1515 RNA_END;
1516 }
1517}
1518
1520{
1521 Scene *scene = CTX_data_scene(C);
1522 Editing *ed = seq::editing_ensure(scene);
1523
1524 seq::LoadData load_data;
1525 if (!load_data_init_from_operator(&load_data, C, op)) {
1526 return OPERATOR_CANCELLED;
1527 }
1528
1529 const char *error_msg;
1530 if (!have_free_channels(C, op, 1, &error_msg)) {
1531 BKE_report(op->reports, RPT_ERROR, error_msg);
1532 return OPERATOR_CANCELLED;
1533 }
1534
1535 int minframe, numdigits;
1537 op, load_data.start_frame, &minframe, &numdigits);
1538 if (load_data.image.len == 0) {
1540 return OPERATOR_CANCELLED;
1541 }
1542
1543 if (RNA_boolean_get(op->ptr, "replace_sel")) {
1544 deselect_all_strips(scene);
1545 }
1546
1547 char vt_old[64];
1548 STRNCPY(vt_old, scene->view_settings.view_transform);
1549
1550 Strip *strip = seq::add_image_strip(CTX_data_main(C), scene, ed->seqbasep, &load_data);
1551
1552 if (!STREQ(vt_old, scene->view_settings.view_transform)) {
1553 BKE_reportf(op->reports,
1555 "View transform set to %s (converted from %s)",
1557 vt_old);
1558 }
1559
1560 sequencer_add_image_strip_load_files(op, scene, strip, &load_data, minframe, numdigits);
1562
1563 /* Adjust length. */
1564 if (load_data.image.len == 1) {
1565 seq::time_right_handle_frame_set(scene, strip, load_data.image.end_frame);
1566 }
1567
1569
1572
1573 /* Free custom data. */
1575
1576 return OPERATOR_FINISHED;
1577}
1578
1580 wmOperator *op,
1581 const wmEvent *event)
1582{
1583 PropertyRNA *prop;
1584 Scene *scene = CTX_data_scene(C);
1585
1587
1588 RNA_enum_set(op->ptr, "fit_method", seq::tool_settings_fit_method_get(scene));
1589
1590 /* Name set already by drag and drop. */
1591 if (RNA_struct_property_is_set(op->ptr, "files") && !RNA_collection_is_empty(op->ptr, "files")) {
1594
1595 const char *error_msg;
1596 if (!have_free_channels(C, op, 1, &error_msg)) {
1597 BKE_report(op->reports, RPT_ERROR, error_msg);
1598 return OPERATOR_CANCELLED;
1599 }
1600
1602 }
1603
1605 sequencer_add_init(C, op);
1606
1607 /* Show multiview save options only if scene use multiview. */
1608 prop = RNA_struct_find_property(op->ptr, "show_multiview");
1609 RNA_property_boolean_set(op->ptr, prop, (scene->r.scemode & R_MULTIVIEW) != 0);
1610
1613}
1614
1616{
1617
1618 /* Identifiers. */
1619 ot->name = "Add Image Strip";
1620 ot->idname = "SEQUENCER_OT_image_strip_add";
1621 ot->description = "Add an image or image sequence to the sequencer";
1622
1623 /* API callbacks. */
1626 ot->cancel = sequencer_add_cancel;
1627 ot->ui = sequencer_add_draw;
1629
1630 /* Flags. */
1631 ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
1632
1634 ot,
1643
1644 RNA_def_boolean(ot->srna,
1645 "use_placeholders",
1646 false,
1647 "Use Placeholders",
1648 "Use placeholders for missing frames of the strip");
1649}
1650
1652{
1653 Scene *scene = CTX_data_scene(C);
1654 Editing *ed = seq::editing_ensure(scene);
1655
1656 const char *error;
1657 if (!have_free_channels(C, op, 1, &error)) {
1659 return OPERATOR_CANCELLED;
1660 }
1661
1662 seq::LoadData load_data;
1663 load_data_init_from_operator(&load_data, C, op);
1664 load_data.effect.type = RNA_enum_get(op->ptr, "type");
1665 const int num_inputs = seq::effect_get_num_inputs(load_data.effect.type);
1666
1668 StringRef error_msg = effect_inputs_validate(inputs, num_inputs);
1669
1670 if (!error_msg.is_empty()) {
1671 BKE_report(op->reports, RPT_ERROR, error_msg.data());
1672 return OPERATOR_CANCELLED;
1673 }
1674
1675 if (RNA_boolean_get(op->ptr, "replace_sel")) {
1676 deselect_all_strips(scene);
1677 }
1678
1679 Strip *input1 = inputs.size() > 0 ? inputs[0] : nullptr;
1680 Strip *input2 = inputs.size() == 2 ? inputs[1] : nullptr;
1681
1682 load_data.effect.input1 = input1;
1683 load_data.effect.input2 = input2;
1684
1685 /* Set channel. If unset, use lowest free one above strips. */
1686 if (!RNA_struct_property_is_set(op->ptr, "channel")) {
1687 if (input1 != nullptr) {
1688 int chan = max_ii(input1 ? input1->channel : 0, input2 ? input2->channel : 0);
1689 if (chan < seq::MAX_CHANNELS) {
1690 load_data.channel = chan;
1691 }
1692 }
1693 }
1694
1695 Strip *strip = seq::add_effect_strip(scene, ed->seqbasep, &load_data);
1697
1698 if (strip->type == STRIP_TYPE_COLOR) {
1699 SolidColorVars *colvars = (SolidColorVars *)strip->effectdata;
1700 RNA_float_get_array(op->ptr, "color", colvars->col);
1701 }
1702
1705
1706 return OPERATOR_FINISHED;
1707}
1708
1710 wmOperator *op,
1711 const wmEvent * /*event*/)
1712{
1713 bool is_type_set = RNA_struct_property_is_set(op->ptr, "type");
1714 int type = -1;
1715 int prop_flag = SEQPROP_ENDFRAME | SEQPROP_NOPATHS;
1716
1717 if (is_type_set) {
1718 type = RNA_enum_get(op->ptr, "type");
1719
1720 /* When invoking an effect strip which uses inputs, skip initializing the channel from the
1721 * mouse. */
1722 if (seq::effect_get_num_inputs(type) != 0) {
1723 prop_flag |= SEQPROP_NOCHAN;
1724 }
1725 }
1726
1727 sequencer_generic_invoke_xy__internal(C, op, prop_flag, type);
1728
1730}
1731
1733 wmOperatorType * /*ot*/,
1734 PointerRNA *ptr)
1735{
1736 const int type = RNA_enum_get(ptr, "type");
1737
1738 switch (type) {
1739 case STRIP_TYPE_CROSS:
1740 return TIP_("Add a crossfade transition strip for two selected strips with video content");
1741 case STRIP_TYPE_ADD:
1742 return TIP_("Add an add blend mode effect strip for two selected strips with video content");
1743 case STRIP_TYPE_SUB:
1744 return TIP_(
1745 "Add a subtract blend mode effect strip for two selected strips with video content");
1747 return TIP_(
1748 "Add an alpha over blend mode effect strip for two selected strips with video content");
1750 return TIP_(
1751 "Add an alpha under blend mode effect strip for two selected strips with video content");
1753 return TIP_(
1754 "Add a gamma crossfade transition strip for two selected strips with video content");
1755 case STRIP_TYPE_MUL:
1756 return TIP_(
1757 "Add a multiply blend mode effect strip for two selected strips with video content");
1758 case STRIP_TYPE_WIPE:
1759 return TIP_("Add a wipe transition strip for two selected strips with video content");
1760 case STRIP_TYPE_GLOW:
1761 return TIP_("Add a glow effect strip for a single selected strip with video content");
1763 return TIP_("Add a transform effect strip for a single selected strip with video content");
1764 case STRIP_TYPE_COLOR:
1765 return TIP_("Add a color strip to the sequencer");
1766 case STRIP_TYPE_SPEED:
1767 return TIP_("Add a video speed effect strip for a single selected strip with video content");
1769 return TIP_("Add a multicam selector effect strip to the sequencer");
1771 return TIP_("Add an adjustment layer effect strip to the sequencer");
1773 return TIP_(
1774 "Add a gaussian blur effect strip for a single selected strip with video content");
1775 case STRIP_TYPE_TEXT:
1776 return TIP_("Add a text strip to the sequencer");
1778 return TIP_("Add a color mix effect strip to the sequencer");
1779 default:
1780 break;
1781 }
1782
1783 /* Use default description. */
1784 return "";
1785}
1786
1788{
1789 PropertyRNA *prop;
1790
1791 /* Identifiers. */
1792 ot->name = "Add Effect Strip";
1793 ot->idname = "SEQUENCER_OT_effect_strip_add";
1794 ot->description = "Add an effect to the sequencer, most are applied on top of existing strips";
1795
1796 /* API callbacks. */
1800 ot->poll_property = seq_effect_add_properties_poll;
1802
1803 /* Flags. */
1804 ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
1805
1806 prop = RNA_def_enum(ot->srna,
1807 "type",
1810 "Type",
1811 "Sequencer effect type");
1814 /* Only used when strip is of the Color type. */
1815 prop = RNA_def_float_color(ot->srna,
1816 "color",
1817 3,
1818 nullptr,
1819 0.0f,
1820 1.0f,
1821 "Color",
1822 "Initialize the strip with this color",
1823 0.0f,
1824 1.0f);
1826}
1827
1828} // namespace blender::ed::vse
bScreen * CTX_wm_screen(const bContext *C)
ScrArea * CTX_wm_area(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
Definition main.cc:877
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:126
eSceneCopyMethod
Definition BKE_scene.hh:29
@ SCE_COPY_EMPTY
Definition BKE_scene.hh:31
@ SCE_COPY_NEW
Definition BKE_scene.hh:30
@ SCE_COPY_FULL
Definition BKE_scene.hh:33
@ SCE_COPY_LINK_COLLECTION
Definition BKE_scene.hh:32
#define BLI_assert(a)
Definition BLI_assert.h:46
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:534
#define LISTBASE_FOREACH(type, var, list)
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
bool BLI_path_abs(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1
bool void BLI_path_frame_strip(char *path, char *r_ext, size_t ext_maxncpy) ATTR_NONNULL(1
void void void const char * BLI_path_basename(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
#define FILE_MAX
#define BLI_path_join(...)
bool BLI_path_frame_get(const char *path, int *r_frame, int *r_digits_len) ATTR_NONNULL(1
void void BLI_path_split_dir_part(const char *filepath, char *dir, size_t dir_maxncpy) ATTR_NONNULL(1
bool void BLI_path_rel(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1)
bool BLI_path_frame(char *path, size_t path_maxncpy, int frame, int digits) ATTR_NONNULL(1)
#define STR_ELEM(...)
Definition BLI_string.h:656
#define SNPRINTF(dst, format,...)
Definition BLI_string.h:599
char * STRNCPY(char(&dst)[N], const char *src)
Definition BLI_string.h:688
unsigned int uint
#define ARRAY_SIZE(arr)
#define ELEM(...)
#define STREQ(a, b)
#define RPT_(msgid)
#define BLT_I18NCONTEXT_ID_SEQUENCE
#define TIP_(msgid)
#define BLT_I18NCONTEXT_ID_MOVIECLIP
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
@ ID_RECALC_SEQUENCER_STRIPS
Definition DNA_ID.h:1030
eSeqImageFitMethod
@ SEQ_SCALE_TO_FILL
@ SEQ_STRETCH_TO_FILL
@ SEQ_USE_ORIGINAL_SIZE
@ SEQ_SCALE_TO_FIT
@ R_MULTIVIEW
#define MAXFRAME
@ RGN_TYPE_WINDOW
@ SEQ_PROXY_SKIP_EXISTING
@ STRIP_TYPE_GAUSSIAN_BLUR
@ STRIP_TYPE_GAMCROSS
@ STRIP_TYPE_SCENE
@ STRIP_TYPE_MOVIECLIP
@ STRIP_TYPE_COLORMIX
@ STRIP_TYPE_WIPE
@ STRIP_TYPE_TEXT
@ STRIP_TYPE_SOUND_RAM
@ STRIP_TYPE_ADD
@ STRIP_TYPE_TRANSFORM
@ STRIP_TYPE_IMAGE
@ STRIP_TYPE_MOVIE
@ STRIP_TYPE_GLOW
@ STRIP_TYPE_SUB
@ STRIP_TYPE_MUL
@ STRIP_TYPE_SPEED
@ STRIP_TYPE_COLOR
@ STRIP_TYPE_ADJUSTMENT
@ STRIP_TYPE_MULTICAM
@ STRIP_TYPE_MASK
@ STRIP_TYPE_ALPHAUNDER
@ STRIP_TYPE_CROSS
@ STRIP_TYPE_ALPHAOVER
#define STRIP_HAS_PATH(_strip)
@ FILE_SORT_DEFAULT
@ FILE_SPECIAL
@ FILE_TYPE_MOVIE
@ FILE_TYPE_SOUND
@ FILE_TYPE_FOLDER
@ FILE_TYPE_IMAGE
@ SPACE_SEQ
@ SEQ_VIEW_SEQUENCE_PREVIEW
@ SEQ_VIEW_PREVIEW
@ FILE_DEFAULTDISPLAY
@ SEQ_MARKER_TRANS
@ USER_SEQ_PROXY_SETUP_AUTOMATIC
@ USER_SEQ_ED_CONNECT_STRIPS_BY_DEFAULT
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
@ OPERATOR_RUNNING_MODAL
Scene * ED_scene_sequencer_add(Main *bmain, bContext *C, eSceneCopyMethod method, bool assign_strip)
Definition scene_edit.cc:68
void ED_area_tag_redraw(ScrArea *area)
Definition area.cc:714
bool ED_operator_sequencer_active_editable(bContext *C)
IMB_Proxy_Size
Read Guarded memory(de)allocation.
#define RNA_PROP_END
#define RNA_BEGIN(sptr, itemptr, propname)
#define RNA_END
#define RNA_PROP_BEGIN(sptr, itemptr, prop)
const EnumPropertyItem * RNA_movieclip_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free)
const EnumPropertyItem * RNA_scene_without_active_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free)
const EnumPropertyItem * RNA_mask_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free)
@ PROP_ENUM_NO_TRANSLATE
Definition RNA_types.hh:406
@ PROP_SKIP_SAVE
Definition RNA_types.hh:330
@ PROP_HIDDEN
Definition RNA_types.hh:324
@ PROP_COLOR_GAMMA
Definition RNA_types.hh:260
#define C
Definition RandGen.cpp:29
@ UI_BUT_LABEL_ALIGN_NONE
eAutoPropButsReturn uiDefAutoButsRNA(uiLayout *layout, PointerRNA *ptr, bool(*check_prop)(PointerRNA *ptr, PropertyRNA *prop, void *user_data), void *user_data, PropertyRNA *prop_activate_init, eButLabelAlign label_align, bool compact)
void uiTemplateImageFormatViews(uiLayout *layout, PointerRNA *imfptr, PointerRNA *ptr)
void UI_view2d_region_to_view(const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
Definition view2d.cc:1667
@ WM_FILESEL_FILES
Definition WM_api.hh:1076
@ WM_FILESEL_DIRECTORY
Definition WM_api.hh:1073
@ WM_FILESEL_RELPATH
Definition WM_api.hh:1072
@ WM_FILESEL_SHOW_PROPS
Definition WM_api.hh:1078
@ WM_FILESEL_FILEPATH
Definition WM_api.hh:1075
@ FILE_OPENFILE
Definition WM_api.hh:1084
@ OPTYPE_UNDO
Definition WM_types.hh:182
@ OPTYPE_REGISTER
Definition WM_types.hh:180
#define U
bool contains(const Key &key) const
Definition BLI_set.hh:310
bool add(const Key &key)
Definition BLI_set.hh:248
constexpr bool is_empty() const
constexpr const char * data() const
bool add(const Key &key)
void append(const T &value)
#define SELECT
#define INT32_MAX
#define INT32_MIN
void * MEM_callocN(size_t len, const char *str)
Definition mallocn.cc:118
void MEM_freeN(void *vmemh)
Definition mallocn.cc:113
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
#define G(x, y, z)
static void error(const char *str)
static const IMB_Proxy_Size proxy_sizes[]
static void sequencer_add_image_strip_load_files(wmOperator *op, Scene *scene, Strip *strip, seq::LoadData *load_data, const int minframe, const int numdigits)
void SEQUENCER_OT_mask_strip_add(wmOperatorType *ot)
static int find_unlocked_unmuted_channel(const Editing *ed, int channel_index)
static int sequencer_generic_invoke_xy_guess_channel(bContext *C, int type)
static void sequencer_disable_one_time_properties(bContext *C, wmOperator *op)
static void seq_load_apply_generic_options(bContext *C, wmOperator *op, Strip *strip)
static void sequencer_generic_invoke_path__internal(bContext *C, wmOperator *op, const char *identifier)
void sequencer_image_seq_reserve_frames(wmOperator *op, StripElem *se, int len, int minframe, int numdigits)
static wmOperatorStatus sequencer_add_image_strip_exec(bContext *C, wmOperator *op)
static wmOperatorStatus sequencer_add_movie_strip_exec(bContext *C, wmOperator *op)
void SEQUENCER_OT_movieclip_strip_add(wmOperatorType *ot)
static bool seq_load_apply_generic_options_only_test_overlap(bContext *C, wmOperator *op, Strip *strip)
static wmOperatorStatus sequencer_add_mask_strip_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus sequencer_add_mask_strip_exec(bContext *C, wmOperator *op)
static const EnumPropertyItem scale_fit_methods[]
blender::VectorSet< Strip * > all_strips_from_context(bContext *C)
void SEQUENCER_OT_effect_strip_add(wmOperatorType *ot)
static void sequencer_add_movie_sync_sound_strip(Main *bmain, Scene *scene, Strip *strip_movie, Strip *strip_sound, seq::LoadData *load_data)
const EnumPropertyItem sequencer_prop_effect_types[]
static void sequencer_add_sound_multiple_strips(bContext *C, wmOperator *op, seq::LoadData *load_data)
static IMB_Proxy_Size seq_get_proxy_size_flags(bContext *C)
static wmOperatorStatus sequencer_add_scene_strip_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int sequencer_add_image_strip_calculate_length(wmOperator *op, const int start_frame, int *minframe, int *numdigits)
static wmOperatorStatus sequencer_add_movieclip_strip_invoke(bContext *C, wmOperator *op, const wmEvent *event)
StringRef effect_inputs_validate(const VectorSet< Strip * > &inputs, int num_inputs)
VectorSet< Strip * > strip_effect_get_new_inputs(const Scene *scene, int num_inputs, bool ignore_active)
static wmOperatorStatus sequencer_add_scene_strip_new_invoke(bContext *C, wmOperator *op, const wmEvent *)
static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, int flag, int type, const wmEvent *event=nullptr)
static std::string sequencer_add_effect_strip_get_description(bContext *, wmOperatorType *, PointerRNA *ptr)
void SEQUENCER_OT_movie_strip_add(wmOperatorType *ot)
void sequencer_select_do_updates(const bContext *C, Scene *scene)
static bool sequencer_add_movie_single_strip(bContext *C, wmOperator *op, seq::LoadData *load_data, blender::VectorSet< Strip * > &r_movie_strips)
static const EnumPropertyItem * strip_new_sequencer_enum_itemf(bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
static wmOperatorStatus sequencer_add_movie_strip_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static EnumPropertyItem strip_new_scene_items[]
void SEQUENCER_OT_scene_strip_add(wmOperatorType *ot)
static void sequencer_generic_props__internal(wmOperatorType *ot, int flag)
static bool have_free_channels(bContext *C, wmOperator *op, int need_channels, const char **r_error_msg)
static void sequencer_add_cancel(bContext *, wmOperator *op)
static bool sequencer_add_sound_single_strip(bContext *C, wmOperator *op, seq::LoadData *load_data)
bool deselect_all_strips(const Scene *scene)
void SEQUENCER_OT_sound_strip_add(wmOperatorType *ot)
static bool seq_effect_add_properties_poll(const bContext *, wmOperator *op, const PropertyRNA *prop)
static wmOperatorStatus sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
static bool sequencer_add_draw_check_fn(PointerRNA *, PropertyRNA *prop, void *)
static wmOperatorStatus sequencer_add_scene_strip_new_exec(bContext *C, wmOperator *op)
int sequencer_image_seq_get_minmax_frame(wmOperator *op, int sfra, int *r_minframe, int *r_numdigits)
static void sequencer_add_draw(bContext *, wmOperator *op)
static void sequencer_add_init(bContext *, wmOperator *op)
static wmOperatorStatus sequencer_add_effect_strip_invoke(bContext *C, wmOperator *op, const wmEvent *)
static wmOperatorStatus sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
static wmOperatorStatus sequencer_add_sound_strip_exec(bContext *C, wmOperator *op)
static void seq_build_proxy(bContext *C, blender::Span< Strip * > movie_strips)
void SEQUENCER_OT_image_strip_add(wmOperatorType *ot)
static bool load_data_init_from_operator(seq::LoadData *load_data, bContext *C, wmOperator *op)
static void sequencer_file_drop_channel_frame_set(bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus sequencer_add_image_strip_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus sequencer_add_movieclip_strip_exec(bContext *C, wmOperator *op)
static wmOperatorStatus sequencer_add_sound_strip_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void sequencer_add_movie_multiple_strips(bContext *C, wmOperator *op, seq::LoadData *load_data, blender::VectorSet< Strip * > &r_movie_strips)
void SEQUENCER_OT_scene_strip_add_new(wmOperatorType *ot)
T clamp(const T &a, const T &min, const T &max)
int time_right_handle_frame_get(const Scene *scene, const Strip *strip)
SeqTimelineChannel * channel_get_by_index(const ListBase *channels, const int channel_index)
Definition channels.cc:65
ListBase * channels_displayed_get(const Editing *ed)
Definition channels.cc:28
eSeqImageFitMethod tool_settings_fit_method_get(Scene *scene)
Definition sequencer.cc:378
bool channel_is_locked(const SeqTimelineChannel *channel)
Definition channels.cc:81
void add_image_init_alpha_mode(Strip *strip)
Definition strip_add.cc:207
void strip_channel_set(Strip *strip, int channel)
bool transform_test_overlap(const Scene *scene, Strip *strip1, Strip *strip2)
Editing * editing_get(const Scene *scene)
Definition sequencer.cc:272
Strip * add_effect_strip(Scene *scene, ListBase *seqbase, LoadData *load_data)
Definition strip_add.cc:165
void add_image_load_file(Scene *scene, Strip *strip, size_t strip_frame, const char *filename)
Definition strip_add.cc:201
void add_image_set_directory(Strip *strip, const char *dirpath)
Definition strip_add.cc:196
int time_left_handle_frame_get(const Scene *, const Strip *strip)
Strip * add_sound_strip(Main *, Scene *, ListBase *, LoadData *)
Definition strip_add.cc:370
int rendersize_to_proxysize(int render_size)
Definition proxy.cc:72
bool proxy_rebuild_context(Main *bmain, Depsgraph *depsgraph, Scene *scene, Strip *strip, blender::Set< std::string > *processed_paths, ListBase *queue, bool build_only_on_bad_performance)
Definition proxy.cc:426
void add_sound_av_sync(Main *, Scene *, Strip *, LoadData *)
Definition strip_add.cc:363
void connect(Strip *strip1, Strip *strip2)
Editing * editing_ensure(Scene *scene)
Definition sequencer.cc:277
void proxy_set(Strip *strip, bool value)
Definition proxy.cc:601
Strip * select_active_get(const Scene *scene)
constexpr int MAX_CHANNELS
ProxyJob * ED_seq_proxy_job_get(const bContext *C, wmJob *wm_job)
Definition proxy_job.cc:70
Strip * add_scene_strip(Scene *scene, ListBase *seqbase, LoadData *load_data)
Definition strip_add.cc:130
bool time_strip_intersects_frame(const Scene *scene, const Strip *strip, const int timeline_frame)
Strip * add_image_strip(Main *bmain, Scene *scene, ListBase *seqbase, LoadData *load_data)
Definition strip_add.cc:238
Strip * add_movieclip_strip(Scene *scene, ListBase *seqbase, LoadData *load_data)
Definition strip_add.cc:142
void tool_settings_fit_method_set(Scene *scene, eSeqImageFitMethod fit_method)
Definition sequencer.cc:402
void select_active_set(Scene *scene, Strip *strip)
@ SEQ_LOAD_SOUND_MONO
Definition SEQ_add.hh:28
@ SEQ_LOAD_SET_VIEW_TRANSFORM
Definition SEQ_add.hh:30
@ SEQ_LOAD_SOUND_CACHE
Definition SEQ_add.hh:27
@ SEQ_LOAD_MOVIE_SYNC_FPS
Definition SEQ_add.hh:29
Strip * add_mask_strip(Scene *scene, ListBase *seqbase, LoadData *load_data)
Definition strip_add.cc:154
void time_left_handle_frame_set(const Scene *scene, Strip *strip, int timeline_frame)
bool channel_is_muted(const SeqTimelineChannel *channel)
Definition channels.cc:86
void transform_handle_overlap(Scene *scene, ListBase *seqbasep, blender::Span< Strip * > transformed_strips, bool use_sync_markers)
void time_right_handle_frame_set(const Scene *scene, Strip *strip, int timeline_frame)
Strip * add_movie_strip(Main *bmain, Scene *scene, ListBase *seqbase, LoadData *load_data)
Definition strip_add.cc:397
bool transform_seqbase_shuffle(ListBase *seqbasep, Strip *test, Scene *evil_scene)
wmJob * ED_seq_proxy_wm_job_get(const bContext *C)
Definition proxy_job.cc:87
int effect_get_num_inputs(int strip_type)
Definition effects.cc:286
static blender::bke::bNodeSocketTemplate inputs[]
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
bool RNA_collection_is_empty(PointerRNA *ptr, const char *name)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
int RNA_int_get(PointerRNA *ptr, const char *name)
char * RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, int fixedlen, int *r_len)
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
std::string RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop)
int RNA_enum_from_value(const EnumPropertyItem *item, const int value)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
int RNA_enum_get(PointerRNA *ptr, const char *name)
const char * RNA_property_identifier(const PropertyRNA *prop)
int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop)
PropertyRNA * RNA_def_float_color(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
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)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
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)
void RNA_def_property_subtype(PropertyRNA *prop, PropertySubType subtype)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
const EnumPropertyItem rna_enum_dummy_NULL_items[]
Definition rna_rna.cc:26
#define SEQPROP_NOPATHS
#define SEQPROP_ENDFRAME
#define SEQPROP_VIEW_TRANSFORM
#define SEQPROP_STARTFRAME
#define SEQPROP_NOCHAN
#define SEQPROP_PLAYBACK_RATE
#define SEQPROP_FIT_METHOD
#define DEFAULT_IMG_STRIP_LENGTH
Stereo3dFormat stereo3d_format
void * first
ListBase masks
Definition BKE_main.hh:281
ListBase scenes
Definition BKE_main.hh:245
ListBase movieclips
Definition BKE_main.hh:280
ColorManagedViewSettings view_settings
struct RenderData r
ListBase spacedata
short render_size
StripElem * stripdata
char dirpath[768]
char filename[256]
StripData * data
struct Scene * scene
void * effectdata
ListBase areabase
struct blender::seq::LoadData::@153152276245330147232163273366304251377253076051 effect
eSeqImageFitMethod fit_method
Definition SEQ_add.hh:55
struct blender::seq::LoadData::@023153262234117060143000107015250011003344047212 image
Stereo3dFormat * stereo3d_format
Definition SEQ_add.hh:58
Depsgraph * depsgraph
Definition SEQ_proxy.hh:45
int mval[2]
Definition WM_types.hh:760
struct ReportList * reports
struct uiLayout * layout
struct PointerRNA * ptr
i
Definition text_draw.cc:230
uint len
void WM_event_add_fileselect(bContext *C, wmOperator *op)
PointerRNA * ptr
Definition wm_files.cc:4227
wmOperatorType * ot
Definition wm_files.cc:4226
bool WM_jobs_is_running(const wmJob *wm_job)
Definition wm_jobs.cc:318
void WM_jobs_start(wmWindowManager *wm, wmJob *wm_job)
Definition wm_jobs.cc:456
void WM_operator_properties_filesel(wmOperatorType *ot, const int filter, const short type, const eFileSel_Action action, const eFileSel_Flag flag, const short display, const short sort)
wmOperatorStatus WM_enum_search_invoke(bContext *C, wmOperator *op, const wmEvent *)
uint8_t flag
Definition wm_window.cc:139