Blender  V2.93
sequencer_add.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 
24 #include <ctype.h>
25 #include <math.h>
26 #include <stdlib.h>
27 #include <string.h>
28 
29 #include "MEM_guardedalloc.h"
30 
31 #include "BLI_blenlib.h"
32 #include "BLI_ghash.h"
33 #include "BLI_math.h"
34 #include "BLI_utildefines.h"
35 
36 #include "BLT_translation.h"
37 
38 #include "DNA_mask_types.h"
39 #include "DNA_scene_types.h"
40 #include "DNA_sound_types.h"
41 #include "DNA_space_types.h"
42 
43 #include "BKE_context.h"
44 #include "BKE_global.h"
45 #include "BKE_lib_id.h"
46 #include "BKE_main.h"
47 #include "BKE_mask.h"
48 #include "BKE_movieclip.h"
49 #include "BKE_report.h"
50 
51 #include "IMB_imbuf.h"
52 
53 #include "WM_api.h"
54 #include "WM_types.h"
55 
56 #include "RNA_define.h"
57 #include "RNA_enum_types.h"
58 
59 #include "SEQ_add.h"
60 #include "SEQ_effects.h"
61 #include "SEQ_proxy.h"
62 #include "SEQ_relations.h"
63 #include "SEQ_render.h"
64 #include "SEQ_select.h"
65 #include "SEQ_sequencer.h"
66 #include "SEQ_time.h"
67 #include "SEQ_transform.h"
68 #include "SEQ_utils.h"
69 
70 /* For menu, popup, icons, etc. */
71 #include "ED_screen.h"
72 #include "ED_sequencer.h"
73 
74 #include "UI_interface.h"
75 
76 #ifdef WITH_AUDASPACE
77 # include <AUD_Sequence.h>
78 #endif
79 
80 #include "DEG_depsgraph.h"
81 #include "DEG_depsgraph_build.h"
82 
83 /* Own include. */
84 #include "sequencer_intern.h"
85 
86 typedef struct SequencerAddData {
89 
90 /* Generic functions, reused by add strip operators. */
91 
92 /* Avoid passing multiple args and be more verbose. */
93 #define SEQPROP_STARTFRAME (1 << 0)
94 #define SEQPROP_ENDFRAME (1 << 1)
95 #define SEQPROP_NOPATHS (1 << 2)
96 #define SEQPROP_NOCHAN (1 << 3)
97 #define SEQPROP_FIT_METHOD (1 << 4)
98 #define SEQPROP_VIEW_TRANSFORM (1 << 5)
99 
101  {SEQ_SCALE_TO_FIT, "FIT", 0, "Scale to Fit", "Scale image to fit within the canvas"},
102  {SEQ_SCALE_TO_FILL, "FILL", 0, "Scale to Fill", "Scale image to completely fill the canvas"},
103  {SEQ_STRETCH_TO_FILL, "STRETCH", 0, "Stretch to Fill", "Stretch image to fill the canvas"},
104  {SEQ_USE_ORIGINAL_SIZE, "ORIGINAL", 0, "Use Original Size", "Keep image at its original size"},
105  {0, NULL, 0, NULL, NULL},
106 };
107 
109 {
110  PropertyRNA *prop;
111 
112  if (flag & SEQPROP_STARTFRAME) {
114  "frame_start",
115  0,
116  INT_MIN,
117  INT_MAX,
118  "Start Frame",
119  "Start frame of the sequence strip",
120  -MAXFRAME,
121  MAXFRAME);
122  }
123 
124  if (flag & SEQPROP_ENDFRAME) {
125  /* Not usual since most strips have a fixed length. */
127  "frame_end",
128  0,
129  INT_MIN,
130  INT_MAX,
131  "End Frame",
132  "End frame for the color strip",
133  -MAXFRAME,
134  MAXFRAME);
135  }
136 
137  RNA_def_int(
138  ot->srna, "channel", 1, 1, MAXSEQ, "Channel", "Channel to place this strip into", 1, MAXSEQ);
139 
141  ot->srna, "replace_sel", 1, "Replace Selection", "Replace the current selection");
142 
143  /* Only for python scripts which import strips and place them after. */
144  prop = RNA_def_boolean(
145  ot->srna, "overlap", 0, "Allow Overlap", "Don't correct overlap on new sequence strips");
147 
148  if (flag & SEQPROP_FIT_METHOD) {
149  ot->prop = RNA_def_enum(ot->srna,
150  "fit_method",
153  "Fit Method",
154  "Scale fit method");
155  }
156 
157  if (flag & SEQPROP_VIEW_TRANSFORM) {
159  "set_view_transform",
160  true,
161  "Set view transform",
162  "Set appropriate view transform based on media colorspace");
163  }
164 }
165 
167  wmOperator *op,
168  const char *identifier)
169 {
170  if (RNA_struct_find_property(op->ptr, identifier)) {
172  Sequence *last_seq = SEQ_select_active_get(scene);
173  if (last_seq && last_seq->strip && SEQ_HAS_PATH(last_seq)) {
174  Main *bmain = CTX_data_main(C);
175  char path[FILE_MAX];
176  BLI_strncpy(path, last_seq->strip->dir, sizeof(path));
178  RNA_string_set(op->ptr, identifier, path);
179  }
180  }
181 }
182 
184 {
185  Sequence *tgt = NULL;
186  Sequence *seq;
188  Editing *ed = SEQ_editing_get(scene, true);
189  int timeline_frame = (int)CFRA;
190  int proximity = INT_MAX;
191 
192  if (!ed || !ed->seqbasep) {
193  return 1;
194  }
195 
196  for (seq = ed->seqbasep->first; seq; seq = seq->next) {
197  if ((type == -1 || seq->type == type) && (seq->enddisp < timeline_frame) &&
198  (timeline_frame - seq->enddisp < proximity)) {
199  tgt = seq;
200  proximity = timeline_frame - seq->enddisp;
201  }
202  }
203 
204  if (tgt) {
205  return tgt->machine + 1;
206  }
207  return 1;
208 }
209 
211 {
213 
214  int timeline_frame = (int)CFRA;
215 
216  /* Effect strips don't need a channel initialized from the mouse. */
217  if (!(flag & SEQPROP_NOCHAN) && RNA_struct_property_is_set(op->ptr, "channel") == 0) {
219  }
220 
221  RNA_int_set(op->ptr, "frame_start", timeline_frame);
222 
223  if ((flag & SEQPROP_ENDFRAME) && RNA_struct_property_is_set(op->ptr, "frame_end") == 0) {
224  RNA_int_set(op->ptr, "frame_end", timeline_frame + 25); /* XXX arbitrary but ok for now. */
225  }
226 
227  if (!(flag & SEQPROP_NOPATHS)) {
229  sequencer_generic_invoke_path__internal(C, op, "directory");
230  }
231 }
232 
234 {
235  Main *bmain = CTX_data_main(C);
236 
237  PropertyRNA *prop;
238  const bool relative = (prop = RNA_struct_find_property(op->ptr, "relative_path")) &&
239  RNA_property_boolean_get(op->ptr, prop);
240  memset(load_data, 0, sizeof(SeqLoadData));
241 
242  load_data->start_frame = RNA_int_get(op->ptr, "frame_start");
243  load_data->channel = RNA_int_get(op->ptr, "channel");
244  load_data->image.end_frame = load_data->start_frame;
245  load_data->image.len = 1;
246 
247  if ((prop = RNA_struct_find_property(op->ptr, "fit_method"))) {
248  load_data->fit_method = RNA_enum_get(op->ptr, "fit_method");
250  }
251 
252  if ((prop = RNA_struct_find_property(op->ptr, "filepath"))) {
253  RNA_property_string_get(op->ptr, prop, load_data->path);
254  BLI_strncpy(load_data->name, BLI_path_basename(load_data->path), sizeof(load_data->name));
255  }
256  else if ((prop = RNA_struct_find_property(op->ptr, "directory"))) {
257  char *directory = RNA_string_get_alloc(op->ptr, "directory", NULL, 0);
258 
259  if ((prop = RNA_struct_find_property(op->ptr, "files"))) {
260  RNA_PROP_BEGIN (op->ptr, itemptr, prop) {
261  char *filename = RNA_string_get_alloc(&itemptr, "name", NULL, 0);
262  BLI_strncpy(load_data->name, filename, sizeof(load_data->name));
263  BLI_snprintf(load_data->path, sizeof(load_data->path), "%s%s", directory, filename);
264  MEM_freeN(filename);
265  break;
266  }
267  RNA_PROP_END;
268  }
269  MEM_freeN(directory);
270  }
271 
272  if (relative) {
273  BLI_path_rel(load_data->path, BKE_main_blendfile_path(bmain));
274  }
275 
276  if ((prop = RNA_struct_find_property(op->ptr, "frame_end"))) {
277  load_data->image.end_frame = RNA_property_int_get(op->ptr, prop);
278  load_data->effect.end_frame = load_data->image.end_frame;
279  }
280 
281  if ((prop = RNA_struct_find_property(op->ptr, "cache")) &&
282  RNA_property_boolean_get(op->ptr, prop)) {
283  load_data->flags |= SEQ_LOAD_SOUND_CACHE;
284  }
285 
286  if ((prop = RNA_struct_find_property(op->ptr, "mono")) &&
287  RNA_property_boolean_get(op->ptr, prop)) {
288  load_data->flags |= SEQ_LOAD_SOUND_MONO;
289  }
290 
291  if ((prop = RNA_struct_find_property(op->ptr, "use_framerate")) &&
292  RNA_property_boolean_get(op->ptr, prop)) {
293  load_data->flags |= SEQ_LOAD_MOVIE_SYNC_FPS;
294  }
295 
296  if ((prop = RNA_struct_find_property(op->ptr, "set_view_transform")) &&
297  RNA_property_boolean_get(op->ptr, prop)) {
298  load_data->flags |= SEQ_LOAD_SET_VIEW_TRANSFORM;
299  }
300 
301  if ((prop = RNA_struct_find_property(op->ptr, "use_multiview")) &&
302  RNA_property_boolean_get(op->ptr, prop)) {
303  if (op->customdata) {
304  SequencerAddData *sad = op->customdata;
305  ImageFormatData *imf = &sad->im_format;
306 
307  load_data->use_multiview = true;
308  load_data->views_format = imf->views_format;
309  load_data->stereo3d_format = &imf->stereo3d_format;
310  }
311  }
312 }
313 
315 {
317  Editing *ed = SEQ_editing_get(scene, false);
318 
319  if (seq == NULL) {
320  return;
321  }
322 
323  if (RNA_boolean_get(op->ptr, "replace_sel")) {
324  seq->flag |= SELECT;
326  }
327 
328  if (RNA_boolean_get(op->ptr, "overlap") == false) {
329  if (SEQ_transform_test_overlap(ed->seqbasep, seq)) {
331  }
332  }
333 }
334 
336  wmOperator *op,
337  const PropertyRNA *prop)
338 {
339  const char *prop_id = RNA_property_identifier(prop);
340  int type = RNA_enum_get(op->ptr, "type");
341 
342  /* Hide start/end frames for effect strips that are locked to their parents' location. */
343  if (SEQ_effect_get_num_inputs(type) != 0) {
344  if (STR_ELEM(prop_id, "frame_start", "frame_end")) {
345  return false;
346  }
347  }
348  if ((type != SEQ_TYPE_COLOR) && (STREQ(prop_id, "color"))) {
349  return false;
350  }
351 
352  return true;
353 }
354 
356 {
357  Main *bmain = CTX_data_main(C);
359  const Editing *ed = SEQ_editing_get(scene, true);
360  Scene *sce_seq = BLI_findlink(&bmain->scenes, RNA_enum_get(op->ptr, "scene"));
361 
362  if (sce_seq == NULL) {
363  BKE_report(op->reports, RPT_ERROR, "Scene not found");
364  return OPERATOR_CANCELLED;
365  }
366 
367  if (RNA_boolean_get(op->ptr, "replace_sel")) {
369  }
370 
371  SeqLoadData load_data;
372  load_data_init_from_operator(&load_data, C, op);
373  load_data.scene = sce_seq;
374 
375  Sequence *seq = SEQ_add_scene_strip(scene, ed->seqbasep, &load_data);
377 
381 
382  return OPERATOR_FINISHED;
383 }
384 
386 {
387  Editing *ed = SEQ_editing_get(CTX_data_scene(C), false);
388  /* Disable following properties if there are any existing strips, unless overridden by user. */
389  if (ed && ed->seqbasep && ed->seqbasep->first) {
390  if (RNA_struct_find_property(op->ptr, "use_framerate")) {
391  RNA_boolean_set(op->ptr, "use_framerate", false);
392  }
393  if (RNA_struct_find_property(op->ptr, "set_view_transform")) {
394  RNA_boolean_set(op->ptr, "set_view_transform", false);
395  }
396  }
397 }
398 
400 {
402  if (!RNA_struct_property_is_set(op->ptr, "scene")) {
403  return WM_enum_search_invoke(C, op, event);
404  }
405 
407  return sequencer_add_scene_strip_exec(C, op);
408 }
409 
411 {
412  PropertyRNA *prop;
413 
414  /* Identifiers. */
415  ot->name = "Add Scene Strip";
416  ot->idname = "SEQUENCER_OT_scene_strip_add";
417  ot->description = "Add a strip to the sequencer using a blender scene as a source";
418 
419  /* Api callbacks. */
423 
424  /* Flags. */
426 
428  prop = RNA_def_enum(ot->srna, "scene", DummyRNA_NULL_items, 0, "Scene", "");
431  ot->prop = prop;
432 }
433 
435 {
436  Main *bmain = CTX_data_main(C);
438  const Editing *ed = SEQ_editing_get(scene, true);
439  MovieClip *clip = BLI_findlink(&bmain->movieclips, RNA_enum_get(op->ptr, "clip"));
440 
441  if (clip == NULL) {
442  BKE_report(op->reports, RPT_ERROR, "Movie clip not found");
443  return OPERATOR_CANCELLED;
444  }
445 
446  if (RNA_boolean_get(op->ptr, "replace_sel")) {
448  }
449 
450  SeqLoadData load_data;
451  load_data_init_from_operator(&load_data, C, op);
452  load_data.clip = clip;
453 
454  Sequence *seq = SEQ_add_movieclip_strip(scene, ed->seqbasep, &load_data);
456 
459 
460  return OPERATOR_FINISHED;
461 }
462 
464 {
465  if (!RNA_struct_property_is_set(op->ptr, "clip")) {
466  return WM_enum_search_invoke(C, op, event);
467  }
468 
471 }
472 
474 {
475  PropertyRNA *prop;
476 
477  /* Identifiers. */
478  ot->name = "Add MovieClip Strip";
479  ot->idname = "SEQUENCER_OT_movieclip_strip_add";
480  ot->description = "Add a movieclip strip to the sequencer";
481 
482  /* Api callbacks. */
486 
487  /* Flags. */
489 
491  prop = RNA_def_enum(ot->srna, "clip", DummyRNA_NULL_items, 0, "Clip", "");
495  ot->prop = prop;
496 }
497 
499 {
500  Main *bmain = CTX_data_main(C);
502  const Editing *ed = SEQ_editing_get(scene, true);
503  Mask *mask = BLI_findlink(&bmain->masks, RNA_enum_get(op->ptr, "mask"));
504 
505  if (mask == NULL) {
506  BKE_report(op->reports, RPT_ERROR, "Mask not found");
507  return OPERATOR_CANCELLED;
508  }
509 
510  if (RNA_boolean_get(op->ptr, "replace_sel")) {
512  }
513 
514  SeqLoadData load_data;
515  load_data_init_from_operator(&load_data, C, op);
516  load_data.mask = mask;
517 
518  Sequence *seq = SEQ_add_mask_strip(scene, ed->seqbasep, &load_data);
520 
523 
524  return OPERATOR_FINISHED;
525 }
526 
528 {
529  if (!RNA_struct_property_is_set(op->ptr, "mask")) {
530  return WM_enum_search_invoke(C, op, event);
531  }
532 
534  return sequencer_add_mask_strip_exec(C, op);
535 }
536 
538 {
539  PropertyRNA *prop;
540 
541  /* Identifiers. */
542  ot->name = "Add Mask Strip";
543  ot->idname = "SEQUENCER_OT_mask_strip_add";
544  ot->description = "Add a mask strip to the sequencer";
545 
546  /* Api callbacks. */
550 
551  /* Flags. */
553 
555  prop = RNA_def_enum(ot->srna, "mask", DummyRNA_NULL_items, 0, "Mask", "");
558  ot->prop = prop;
559 }
560 
562 {
563  op->customdata = MEM_callocN(sizeof(SequencerAddData), __func__);
564 }
565 
567 {
568  if (op->customdata) {
569  MEM_freeN(op->customdata);
570  }
571  op->customdata = NULL;
572 }
573 
575  PropertyRNA *prop,
576  void *UNUSED(user_data))
577 {
578  const char *prop_id = RNA_property_identifier(prop);
579 
580  return !(STR_ELEM(prop_id, "filepath", "directory", "filename"));
581 }
582 
583 /* Strips are added in context of timeline which has different preview size than actual preview. We
584  * must search for preview area. In most cases there will be only one preview area, but there can
585  * be more with different preview sizes. */
587 {
588  bScreen *screen = CTX_wm_screen(C);
590  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
591  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
592  switch (sl->spacetype) {
593  case SPACE_SEQ: {
594  SpaceSeq *sseq = (SpaceSeq *)sl;
596  continue;
597  }
599  }
600  }
601  }
602  }
603  return proxy_sizes;
604 }
605 
606 static void seq_build_proxy(bContext *C, Sequence *seq)
607 {
608  if (U.sequencer_proxy_setup != USER_SEQ_PROXY_SETUP_AUTOMATIC) {
609  return;
610  }
611 
612  /* Enable and set proxy size. */
613  SEQ_proxy_set(seq, true);
616 
617  /* Build proxy. */
619  wmJob *wm_job = ED_seq_proxy_wm_job_get(C);
620  ProxyJob *pj = ED_seq_proxy_job_get(C, wm_job);
621  SEQ_proxy_rebuild_context(pj->main, pj->depsgraph, pj->scene, seq, file_list, &pj->queue);
622  BLI_gset_free(file_list, MEM_freeN);
623 
624  if (!WM_jobs_is_running(wm_job)) {
625  G.is_break = false;
626  WM_jobs_start(CTX_wm_manager(C), wm_job);
627  }
628 
630 }
631 
633  wmOperator *op,
634  SeqLoadData *load_data)
635 {
636  Main *bmain = CTX_data_main(C);
638  const Editing *ed = SEQ_editing_get(scene, true);
639 
640  RNA_BEGIN (op->ptr, itemptr, "files") {
641  char dir_only[FILE_MAX];
642  char file_only[FILE_MAX];
643  RNA_string_get(op->ptr, "directory", dir_only);
644  RNA_string_get(&itemptr, "name", file_only);
645  BLI_join_dirfile(load_data->path, sizeof(load_data->path), dir_only, file_only);
646  BLI_strncpy(load_data->name, file_only, sizeof(load_data->name));
647  Sequence *seq_movie = NULL;
648  Sequence *seq_sound = NULL;
649  double video_start_offset;
650 
651  load_data->channel++;
652  seq_movie = SEQ_add_movie_strip(bmain, scene, ed->seqbasep, load_data, &video_start_offset);
653  load_data->channel--;
654  if (seq_movie == NULL) {
655  BKE_reportf(op->reports, RPT_ERROR, "File '%s' could not be loaded", load_data->path);
656  }
657  else {
658  if (RNA_boolean_get(op->ptr, "sound")) {
659  seq_sound = SEQ_add_sound_strip(bmain, scene, ed->seqbasep, load_data, video_start_offset);
660  }
661  load_data->start_frame += seq_movie->enddisp - seq_movie->startdisp;
662  seq_load_apply_generic_options(C, op, seq_sound);
663  seq_load_apply_generic_options(C, op, seq_movie);
664  seq_build_proxy(C, seq_movie);
665  }
666  }
667  RNA_END;
668 }
669 
671 {
672  Main *bmain = CTX_data_main(C);
674  const Editing *ed = SEQ_editing_get(scene, true);
675 
676  Sequence *seq_movie = NULL;
677  Sequence *seq_sound = NULL;
678  double video_start_offset;
679 
680  load_data->channel++;
681  seq_movie = SEQ_add_movie_strip(bmain, scene, ed->seqbasep, load_data, &video_start_offset);
682  load_data->channel--;
683 
684  if (seq_movie == NULL) {
685  BKE_reportf(op->reports, RPT_ERROR, "File '%s' could not be loaded", load_data->path);
686  return false;
687  }
688  if (RNA_boolean_get(op->ptr, "sound")) {
689  seq_sound = SEQ_add_sound_strip(bmain, scene, ed->seqbasep, load_data, video_start_offset);
690  }
691  seq_load_apply_generic_options(C, op, seq_sound);
692  seq_load_apply_generic_options(C, op, seq_movie);
693  seq_build_proxy(C, seq_movie);
694 
695  return true;
696 }
697 
699 {
700  Main *bmain = CTX_data_main(C);
702  SeqLoadData load_data;
703 
704  load_data_init_from_operator(&load_data, C, op);
705 
706  if (RNA_boolean_get(op->ptr, "replace_sel")) {
708  }
709 
710  const int tot_files = RNA_property_collection_length(op->ptr,
711  RNA_struct_find_property(op->ptr, "files"));
712  if (tot_files > 1) {
713  sequencer_add_movie_multiple_strips(C, op, &load_data);
714  }
715  else {
716  if (!sequencer_add_movie_single_strip(C, op, &load_data)) {
717  sequencer_add_cancel(C, op);
718  return OPERATOR_CANCELLED;
719  }
720  }
721 
722  /* Free custom data. */
723  sequencer_add_cancel(C, op);
724 
728 
729  return OPERATOR_FINISHED;
730 }
731 
733  wmOperator *op,
734  const wmEvent *UNUSED(event))
735 {
736  PropertyRNA *prop;
738 
740 
742 
743  /* This is for drag and drop. */
744  if ((RNA_struct_property_is_set(op->ptr, "files") && RNA_collection_length(op->ptr, "files")) ||
745  RNA_struct_property_is_set(op->ptr, "filepath")) {
747  return sequencer_add_movie_strip_exec(C, op);
748  }
749 
751  sequencer_add_init(C, op);
752 
753  /* Show multiview save options only if scene use multiview. */
754  prop = RNA_struct_find_property(op->ptr, "show_multiview");
755  RNA_property_boolean_set(op->ptr, prop, (scene->r.scemode & R_MULTIVIEW) != 0);
756 
758  return OPERATOR_RUNNING_MODAL;
759 }
760 
762 {
763  uiLayout *layout = op->layout;
765  SequencerAddData *sad = op->customdata;
766  ImageFormatData *imf = &sad->im_format;
767  PointerRNA imf_ptr, ptr;
768 
769  /* Main draw call. */
770  RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr);
773 
774  /* Image template. */
776 
777  /* Multiview template. */
778  if (RNA_boolean_get(op->ptr, "show_multiview")) {
779  uiTemplateImageFormatViews(layout, &imf_ptr, op->ptr);
780  }
781 }
782 
784 {
785 
786  /* Identifiers. */
787  ot->name = "Add Movie Strip";
788  ot->idname = "SEQUENCER_OT_movie_strip_add";
789  ot->description = "Add a movie strip to the sequencer";
790 
791  /* Api callbacks. */
797 
798  /* Flags. */
800 
803  FILE_SPECIAL,
811  RNA_def_boolean(ot->srna, "sound", true, "Sound", "Load sound with the movie");
813  "use_framerate",
814  true,
815  "Use Movie Framerate",
816  "Use framerate from the movie to keep sound and video in sync");
817 }
818 
820  wmOperator *op,
821  SeqLoadData *load_data)
822 {
823  Main *bmain = CTX_data_main(C);
825  Editing *ed = SEQ_editing_get(scene, true);
826 
827  RNA_BEGIN (op->ptr, itemptr, "files") {
828  char dir_only[FILE_MAX];
829  char file_only[FILE_MAX];
830  RNA_string_get(op->ptr, "directory", dir_only);
831  RNA_string_get(&itemptr, "name", file_only);
832  BLI_join_dirfile(load_data->path, sizeof(load_data->path), dir_only, file_only);
833  BLI_strncpy(load_data->name, file_only, sizeof(load_data->name));
834  Sequence *seq = SEQ_add_sound_strip(bmain, scene, ed->seqbasep, load_data, 0.0f);
835  if (seq == NULL) {
836  BKE_reportf(op->reports, RPT_ERROR, "File '%s' could not be loaded", load_data->path);
837  }
838  else {
840  load_data->start_frame += seq->enddisp - seq->startdisp;
841  }
842  }
843  RNA_END;
844 }
845 
847 {
848  Main *bmain = CTX_data_main(C);
850  Editing *ed = SEQ_editing_get(scene, true);
851 
852  Sequence *seq = SEQ_add_sound_strip(bmain, scene, ed->seqbasep, load_data, 0.0f);
853  if (seq == NULL) {
854  BKE_reportf(op->reports, RPT_ERROR, "File '%s' could not be loaded", load_data->path);
855  return false;
856  }
858 
859  return true;
860 }
861 
863 {
864  Main *bmain = CTX_data_main(C);
866  SeqLoadData load_data;
867  load_data_init_from_operator(&load_data, C, op);
868 
869  if (RNA_boolean_get(op->ptr, "replace_sel")) {
871  }
872 
873  const int tot_files = RNA_property_collection_length(op->ptr,
874  RNA_struct_find_property(op->ptr, "files"));
875  if (tot_files > 1) {
876  sequencer_add_sound_multiple_strips(C, op, &load_data);
877  }
878  else {
879  if (!sequencer_add_sound_single_strip(C, op, &load_data)) {
880  return OPERATOR_CANCELLED;
881  }
882  }
883 
884  if (op->customdata) {
885  MEM_freeN(op->customdata);
886  }
887 
891 
892  return OPERATOR_FINISHED;
893 }
894 
896  wmOperator *op,
897  const wmEvent *UNUSED(event))
898 {
899  /* This is for drag and drop. */
900  if ((RNA_struct_property_is_set(op->ptr, "files") && RNA_collection_length(op->ptr, "files")) ||
901  RNA_struct_property_is_set(op->ptr, "filepath")) {
903  return sequencer_add_sound_strip_exec(C, op);
904  }
905 
907 
909  return OPERATOR_RUNNING_MODAL;
910 }
911 
913 {
914 
915  /* Identifiers. */
916  ot->name = "Add Sound Strip";
917  ot->idname = "SEQUENCER_OT_sound_strip_add";
918  ot->description = "Add a sound strip to the sequencer";
919 
920  /* Api callbacks. */
924 
925  /* Flags. */
927 
930  FILE_SPECIAL,
937  RNA_def_boolean(ot->srna, "cache", false, "Cache", "Cache the sound in memory");
938  RNA_def_boolean(ot->srna, "mono", false, "Mono", "Merge all the sound's channels into one");
939 }
940 
942  int sfra,
943  int *r_minframe,
944  int *r_numdigits)
945 {
946  int minframe = INT32_MAX, maxframe = INT32_MIN;
947  int numdigits = 0;
948 
949  RNA_BEGIN (op->ptr, itemptr, "files") {
950  char *filename;
951  int frame;
952  filename = RNA_string_get_alloc(&itemptr, "name", NULL, 0);
953 
954  if (filename) {
955  if (BLI_path_frame_get(filename, &frame, &numdigits)) {
956  minframe = min_ii(minframe, frame);
957  maxframe = max_ii(maxframe, frame);
958  }
959 
960  MEM_freeN(filename);
961  }
962  }
963  RNA_END;
964 
965  if (minframe == INT32_MAX) {
966  minframe = sfra;
967  maxframe = minframe + 1;
968  }
969 
970  *r_minframe = minframe;
971  *r_numdigits = numdigits;
972 
973  return maxframe - minframe + 1;
974 }
975 
977  wmOperator *op, StripElem *se, int len, int minframe, int numdigits)
978 {
979  char *filename = NULL;
980  RNA_BEGIN (op->ptr, itemptr, "files") {
981  filename = RNA_string_get_alloc(&itemptr, "name", NULL, 0);
982  break;
983  }
984  RNA_END;
985 
986  if (filename) {
987  char ext[PATH_MAX];
988  char filename_stripped[PATH_MAX];
989  /* Strip the frame from filename and substitute with `#`. */
990  BLI_path_frame_strip(filename, ext);
991 
992  for (int i = 0; i < len; i++, se++) {
993  BLI_strncpy(filename_stripped, filename, sizeof(filename_stripped));
994  BLI_path_frame(filename_stripped, minframe + i, numdigits);
995  BLI_snprintf(se->name, sizeof(se->name), "%s%s", filename_stripped, ext);
996  }
997 
998  MEM_freeN(filename);
999  }
1000 }
1001 
1003  const int start_frame,
1004  int *minframe,
1005  int *numdigits)
1006 {
1007  const bool use_placeholders = RNA_boolean_get(op->ptr, "use_placeholders");
1008 
1009  if (use_placeholders) {
1010  return sequencer_image_seq_get_minmax_frame(op, start_frame, minframe, numdigits);
1011  }
1013 }
1014 
1016  wmOperator *op, Sequence *seq, SeqLoadData *load_data, const int minframe, const int numdigits)
1017 {
1018  const bool use_placeholders = RNA_boolean_get(op->ptr, "use_placeholders");
1019  /* size of Strip->dir. */
1020  char directory[768];
1021  BLI_split_dir_part(load_data->path, directory, sizeof(directory));
1022  SEQ_add_image_set_directory(seq, directory);
1023 
1024  if (use_placeholders) {
1026  op, seq->strip->stripdata, load_data->image.len, minframe, numdigits);
1027  }
1028  else {
1029  size_t strip_frame = 0;
1030  RNA_BEGIN (op->ptr, itemptr, "files") {
1031  char *filename = RNA_string_get_alloc(&itemptr, "name", NULL, 0);
1032  SEQ_add_image_load_file(seq, strip_frame, filename);
1033  MEM_freeN(filename);
1034  strip_frame++;
1035  }
1036  RNA_END;
1037  }
1038 }
1039 
1041 {
1043  Editing *ed = SEQ_editing_get(scene, true);
1044 
1045  SeqLoadData load_data;
1046  load_data_init_from_operator(&load_data, C, op);
1047 
1048  int minframe, numdigits;
1050  op, load_data.start_frame, &minframe, &numdigits);
1051  if (load_data.image.len == 0) {
1052  sequencer_add_cancel(C, op);
1053  return OPERATOR_CANCELLED;
1054  }
1055 
1056  if (RNA_boolean_get(op->ptr, "replace_sel")) {
1058  }
1059 
1060  Sequence *seq = SEQ_add_image_strip(CTX_data_main(C), scene, ed->seqbasep, &load_data);
1061  sequencer_add_image_strip_load_files(op, seq, &load_data, minframe, numdigits);
1063 
1064  /* Adjust length. */
1065  if (load_data.image.len == 1) {
1068  }
1069 
1071 
1074 
1075  /* Free custom data. */
1076  sequencer_add_cancel(C, op);
1077 
1078  return OPERATOR_FINISHED;
1079 }
1080 
1082  wmOperator *op,
1083  const wmEvent *UNUSED(event))
1084 {
1085  PropertyRNA *prop;
1087 
1089 
1091 
1092  /* Name set already by drag and drop. */
1093  if (RNA_struct_property_is_set(op->ptr, "files") && RNA_collection_length(op->ptr, "files")) {
1096  return sequencer_add_image_strip_exec(C, op);
1097  }
1098 
1100  sequencer_add_init(C, op);
1101 
1102  /* Show multiview save options only if scene use multiview. */
1103  prop = RNA_struct_find_property(op->ptr, "show_multiview");
1104  RNA_property_boolean_set(op->ptr, prop, (scene->r.scemode & R_MULTIVIEW) != 0);
1105 
1107  return OPERATOR_RUNNING_MODAL;
1108 }
1109 
1111 {
1112 
1113  /* Identifiers. */
1114  ot->name = "Add Image Strip";
1115  ot->idname = "SEQUENCER_OT_image_strip_add";
1116  ot->description = "Add an image or image sequence to the sequencer";
1117 
1118  /* Api callbacks. */
1124 
1125  /* Flags. */
1127 
1130  FILE_SPECIAL,
1131  FILE_OPENFILE,
1138 
1140  "use_placeholders",
1141  false,
1142  "Use Placeholders",
1143  "Use placeholders for missing frames of the strip");
1144 }
1145 
1147 {
1149  Editing *ed = SEQ_editing_get(scene, true);
1150  const char *error_msg;
1151 
1152  SeqLoadData load_data;
1153  load_data_init_from_operator(&load_data, C, op);
1154  load_data.effect.type = RNA_enum_get(op->ptr, "type");
1155 
1156  Sequence *seq1, *seq2, *seq3;
1158  scene, NULL, load_data.effect.type, &seq1, &seq2, &seq3, &error_msg)) {
1159  BKE_report(op->reports, RPT_ERROR, error_msg);
1160  return OPERATOR_CANCELLED;
1161  }
1162 
1163  if (RNA_boolean_get(op->ptr, "replace_sel")) {
1165  }
1166 
1167  load_data.effect.seq1 = seq1;
1168  load_data.effect.seq2 = seq2;
1169  load_data.effect.seq3 = seq3;
1170 
1171  /* Set channel. If unset, use lowest free one above strips. */
1172  if (!RNA_struct_property_is_set(op->ptr, "channel")) {
1173  if (seq1 != NULL) {
1174  int chan = max_iii(
1175  seq1 ? seq1->machine : 0, seq2 ? seq2->machine : 0, seq3 ? seq3->machine : 0);
1176  if (chan < MAXSEQ) {
1177  load_data.channel = chan;
1178  }
1179  }
1180  }
1181 
1182  Sequence *seq = SEQ_add_effect_strip(scene, ed->seqbasep, &load_data);
1184 
1185  if (seq->type == SEQ_TYPE_COLOR) {
1186  SolidColorVars *colvars = (SolidColorVars *)seq->effectdata;
1187  RNA_float_get_array(op->ptr, "color", colvars->col);
1188  }
1189 
1192 
1193  return OPERATOR_FINISHED;
1194 }
1195 
1197  wmOperator *op,
1198  const wmEvent *UNUSED(event))
1199 {
1200  bool is_type_set = RNA_struct_property_is_set(op->ptr, "type");
1201  int type = -1;
1202  int prop_flag = SEQPROP_ENDFRAME | SEQPROP_NOPATHS;
1203 
1204  if (is_type_set) {
1205  type = RNA_enum_get(op->ptr, "type");
1206 
1207  /* When invoking an effect strip which uses inputs, skip initializing the channel from the
1208  * mouse. */
1209  if (SEQ_effect_get_num_inputs(type) != 0) {
1210  prop_flag |= SEQPROP_NOCHAN;
1211  }
1212  }
1213 
1214  sequencer_generic_invoke_xy__internal(C, op, prop_flag, type);
1215 
1216  return sequencer_add_effect_strip_exec(C, op);
1217 }
1218 
1220 {
1221  PropertyRNA *prop;
1222 
1223  /* Identifiers. */
1224  ot->name = "Add Effect Strip";
1225  ot->idname = "SEQUENCER_OT_effect_strip_add";
1226  ot->description = "Add an effect to the sequencer, most are applied on top of existing strips";
1227 
1228  /* Api callbacks. */
1233 
1234  /* Flags. */
1236 
1237  RNA_def_enum(ot->srna,
1238  "type",
1241  "Type",
1242  "Sequencer effect type");
1244  /* Only used when strip is of the Color type. */
1245  prop = RNA_def_float_color(ot->srna,
1246  "color",
1247  3,
1248  NULL,
1249  0.0f,
1250  1.0f,
1251  "Color",
1252  "Initialize the strip with this color",
1253  0.0f,
1254  1.0f);
1256 }
struct ScrArea * CTX_wm_area(const bContext *C)
Definition: context.c:714
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1034
struct wmWindowManager * CTX_wm_manager(const bContext *C)
Definition: context.c:689
struct bScreen * CTX_wm_screen(const bContext *C)
Definition: context.c:709
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1018
const char * BKE_main_blendfile_path(const struct Main *bmain) ATTR_NONNULL()
void BKE_report(ReportList *reports, ReportType type, const char *message)
Definition: report.c:104
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
#define PATH_MAX
Definition: BLI_fileops.h:44
struct GSet GSet
Definition: BLI_ghash.h:189
bool BLI_ghashutil_strcmp(const void *a, const void *b)
unsigned int BLI_ghashutil_strhash_p(const void *ptr)
GSet * BLI_gset_new(GSetHashFP hashfp, GSetCmpFP cmpfp, const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
Definition: BLI_ghash.c:1125
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp)
Definition: BLI_ghash.c:1253
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:172
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
MINLINE int max_iii(int a, int b, int c)
const char * BLI_path_basename(const char *path) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
Definition: path_util.c:1868
bool BLI_path_frame(char *path, int frame, int digits) ATTR_NONNULL()
Definition: path_util.c:802
void BLI_split_dir_part(const char *string, char *dir, const size_t dirlen)
Definition: path_util.c:1682
bool BLI_path_frame_get(char *path, int *r_frame, int *numdigits) ATTR_NONNULL()
Definition: path_util.c:854
void BLI_path_frame_strip(char *path, char *ext) ATTR_NONNULL()
Definition: path_util.c:906
#define FILE_MAX
void BLI_join_dirfile(char *__restrict dst, const size_t maxlen, const char *__restrict dir, const char *__restrict file) ATTR_NONNULL()
Definition: path_util.c:1737
void BLI_path_rel(char *file, const char *relfile) ATTR_NONNULL()
Definition: path_util.c:519
bool BLI_path_abs(char *path, const char *basepath) ATTR_NONNULL()
Definition: path_util.c:1016
#define STR_ELEM(...)
Definition: BLI_string.h:218
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
Definition: string.c:108
#define UNUSED(x)
#define ELEM(...)
#define STREQ(a, b)
#define BLT_I18NCONTEXT_ID_MOVIECLIP
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
@ ID_RECALC_SEQUENCER_STRIPS
Definition: DNA_ID.h:658
#define R_MULTIVIEW
#define CFRA
@ SEQ_SCALE_TO_FILL
@ SEQ_STRETCH_TO_FILL
@ SEQ_USE_ORIGINAL_SIZE
@ SEQ_SCALE_TO_FIT
#define MAXFRAME
#define SEQ_HAS_PATH(_seq)
@ SEQ_PROXY_SKIP_EXISTING
#define MAXSEQ
@ SEQ_TYPE_SOUND_RAM
@ SEQ_TYPE_CROSS
@ SEQ_TYPE_SCENE
@ SEQ_TYPE_MOVIECLIP
@ SEQ_TYPE_IMAGE
@ SEQ_TYPE_COLOR
@ SEQ_TYPE_MOVIE
@ SEQ_TYPE_MASK
@ 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_OPENFILE
@ FILE_DEFAULTDISPLAY
@ USER_SEQ_PROXY_SETUP_AUTOMATIC
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
@ OPERATOR_RUNNING_MODAL
void ED_area_tag_redraw(ScrArea *area)
Definition: area.c:745
bool ED_operator_sequencer_active_editable(struct bContext *C)
Definition: screen_ops.c:324
void ED_sequencer_deselect_all(struct Scene *scene)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
IMB_Proxy_Size
Definition: IMB_imbuf.h:317
Read Guarded memory(de)allocation.
#define RNA_PROP_END
Definition: RNA_access.h:1268
#define RNA_BEGIN(sptr, itemptr, propname)
Definition: RNA_access.h:1248
#define RNA_END
Definition: RNA_access.h:1255
#define RNA_PROP_BEGIN(sptr, itemptr, prop)
Definition: RNA_access.h:1261
StructRNA RNA_ImageFormatSettings
const EnumPropertyItem * RNA_scene_without_active_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, bool *r_free)
const EnumPropertyItem * RNA_movieclip_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, bool *r_free)
const EnumPropertyItem * RNA_mask_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, bool *r_free)
@ PROP_ENUM_NO_TRANSLATE
Definition: RNA_types.h:279
@ PROP_HIDDEN
Definition: RNA_types.h:202
@ PROP_COLOR_GAMMA
Definition: RNA_types.h:151
#define C
Definition: RandGen.cpp:39
@ SEQ_LOAD_SOUND_MONO
Definition: SEQ_add.h:37
@ SEQ_LOAD_SOUND_CACHE
Definition: SEQ_add.h:36
@ SEQ_LOAD_SET_VIEW_TRANSFORM
Definition: SEQ_add.h:39
@ SEQ_LOAD_MOVIE_SYNC_FPS
Definition: SEQ_add.h:38
eAutoPropButsReturn uiDefAutoButsRNA(uiLayout *layout, struct PointerRNA *ptr, bool(*check_prop)(struct PointerRNA *ptr, struct PropertyRNA *prop, void *user_data), void *user_data, struct PropertyRNA *prop_activate_init, eButLabelAlign label_align, const bool compact)
@ UI_BUT_LABEL_ALIGN_NONE
void uiTemplateImageFormatViews(uiLayout *layout, struct PointerRNA *imfptr, struct PointerRNA *ptr)
#define WM_FILESEL_DIRECTORY
Definition: WM_api.h:535
#define WM_FILESEL_SHOW_PROPS
Definition: WM_api.h:540
#define WM_FILESEL_RELPATH
Definition: WM_api.h:533
#define WM_FILESEL_FILEPATH
Definition: WM_api.h:537
#define WM_FILESEL_FILES
Definition: WM_api.h:538
#define ND_SEQUENCER
Definition: WM_types.h:337
@ OPTYPE_UNDO
Definition: WM_types.h:155
@ OPTYPE_REGISTER
Definition: WM_types.h:153
#define NC_SCENE
Definition: WM_types.h:279
unsigned int U
Definition: btGjkEpa3.h:78
#define SELECT
Scene scene
void * user_data
int SEQ_effect_get_num_inputs(int seq_type)
Definition: effects.c:4328
static const int proxy_sizes[]
Definition: indexer.c:57
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
static void area(int d1, int d2, int e1, int e2, float weights[2])
void SEQ_proxy_set(struct Sequence *seq, bool value)
Definition: proxy.c:584
int SEQ_rendersize_to_proxysize(int render_size)
Definition: proxy.c:84
bool SEQ_proxy_rebuild_context(Main *bmain, Depsgraph *depsgraph, Scene *scene, Sequence *seq, struct GSet *file_list, ListBase *queue)
Definition: proxy.c:410
ProxyJob * ED_seq_proxy_job_get(const bContext *C, wmJob *wm_job)
Definition: proxy_job.c:94
struct wmJob * ED_seq_proxy_wm_job_get(const bContext *C)
Definition: proxy_job.c:111
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
Definition: rna_access.c:146
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
Definition: rna_access.c:6550
int RNA_collection_length(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6634
const char * RNA_property_identifier(const PropertyRNA *prop)
Definition: rna_access.c:1145
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
Definition: rna_access.c:6272
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
Definition: rna_access.c:6319
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
Definition: rna_access.c:866
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
Definition: rna_access.c:6378
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:2331
int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:2607
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
Definition: rna_access.c:6514
int RNA_int_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6308
void RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop, char *value)
Definition: rna_access.c:3310
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
Definition: rna_access.c:2358
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
Definition: rna_access.c:6685
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6261
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
Definition: rna_access.c:6413
int RNA_enum_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6402
int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:3903
char * RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, int fixedlen)
Definition: rna_access.c:6527
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3481
PropertyRNA * RNA_def_float_color(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:3911
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
Definition: rna_define.c:2870
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1512
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
Definition: rna_define.c:3585
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
Definition: rna_define.c:3819
void RNA_def_property_subtype(PropertyRNA *prop, PropertySubType subtype)
Definition: rna_define.c:1563
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3771
const EnumPropertyItem DummyRNA_NULL_items[]
Definition: rna_rna.c:40
eSeqImageFitMethod SEQ_tool_settings_fit_method_get(Scene *scene)
Definition: sequencer.c:332
void SEQ_tool_settings_fit_method_set(Scene *scene, eSeqImageFitMethod fit_method)
Definition: sequencer.c:338
Editing * SEQ_editing_get(Scene *scene, bool alloc)
Definition: sequencer.c:232
static void sequencer_add_sound_multiple_strips(bContext *C, wmOperator *op, SeqLoadData *load_data)
static void load_data_init_from_operator(SeqLoadData *load_data, bContext *C, wmOperator *op)
static void sequencer_add_init(bContext *UNUSED(C), wmOperator *op)
#define SEQPROP_NOPATHS
Definition: sequencer_add.c:95
static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
static int sequencer_add_mask_strip_exec(bContext *C, wmOperator *op)
static void sequencer_add_draw(bContext *C, wmOperator *op)
#define SEQPROP_ENDFRAME
Definition: sequencer_add.c:94
static IMB_Proxy_Size seq_get_proxy_size_flags(bContext *C)
static void sequencer_generic_invoke_path__internal(bContext *C, wmOperator *op, const char *identifier)
static int sequencer_add_mask_strip_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int sequencer_add_image_strip_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static int sequencer_add_image_strip_calculate_length(wmOperator *op, const int start_frame, int *minframe, int *numdigits)
void SEQUENCER_OT_mask_strip_add(struct wmOperatorType *ot)
static int sequencer_add_sound_strip_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
#define SEQPROP_VIEW_TRANSFORM
Definition: sequencer_add.c:98
static bool seq_effect_add_properties_poll(const bContext *UNUSED(C), wmOperator *op, const PropertyRNA *prop)
static const EnumPropertyItem scale_fit_methods[]
static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, int flag, int type)
static bool sequencer_add_sound_single_strip(bContext *C, wmOperator *op, SeqLoadData *load_data)
struct SequencerAddData SequencerAddData
static int sequencer_add_movieclip_strip_exec(bContext *C, wmOperator *op)
static int sequencer_add_scene_strip_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
static int sequencer_add_effect_strip_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static void sequencer_add_image_strip_load_files(wmOperator *op, Sequence *seq, SeqLoadData *load_data, const int minframe, const int numdigits)
static void sequencer_generic_props__internal(wmOperatorType *ot, int flag)
static void seq_build_proxy(bContext *C, Sequence *seq)
static int sequencer_add_movieclip_strip_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void seq_load_apply_generic_options(bContext *C, wmOperator *op, Sequence *seq)
static int sequencer_add_movie_strip_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
void SEQUENCER_OT_scene_strip_add(struct wmOperatorType *ot)
static bool sequencer_add_draw_check_fn(PointerRNA *UNUSED(ptr), PropertyRNA *prop, void *UNUSED(user_data))
#define SEQPROP_STARTFRAME
Definition: sequencer_add.c:93
void SEQUENCER_OT_movie_strip_add(struct wmOperatorType *ot)
void SEQUENCER_OT_effect_strip_add(struct wmOperatorType *ot)
static void sequencer_add_cancel(bContext *UNUSED(C), wmOperator *op)
static int sequencer_add_sound_strip_exec(bContext *C, wmOperator *op)
void sequencer_image_seq_reserve_frames(wmOperator *op, StripElem *se, int len, int minframe, int numdigits)
#define SEQPROP_NOCHAN
Definition: sequencer_add.c:96
static void sequencer_add_movie_multiple_strips(bContext *C, wmOperator *op, SeqLoadData *load_data)
void SEQUENCER_OT_movieclip_strip_add(struct wmOperatorType *ot)
static int sequencer_generic_invoke_xy_guess_channel(bContext *C, int type)
static bool sequencer_add_movie_single_strip(bContext *C, wmOperator *op, SeqLoadData *load_data)
static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op)
#define SEQPROP_FIT_METHOD
Definition: sequencer_add.c:97
int sequencer_image_seq_get_minmax_frame(wmOperator *op, int sfra, int *r_minframe, int *r_numdigits)
static int sequencer_add_movie_strip_exec(bContext *C, wmOperator *op)
void SEQUENCER_OT_image_strip_add(struct wmOperatorType *ot)
static void sequencer_disable_one_time_properties(bContext *C, wmOperator *op)
void SEQUENCER_OT_sound_strip_add(struct wmOperatorType *ot)
int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequence **r_selseq1, Sequence **r_selseq2, Sequence **r_selseq3, const char **r_error_str)
EnumPropertyItem sequencer_prop_effect_types[]
#define INT32_MAX
Definition: stdint.h:140
#define INT32_MIN
Definition: stdint.h:139
void SEQ_add_image_load_file(Sequence *seq, size_t strip_frame, char *filename)
Definition: strip_add.c:276
Sequence * SEQ_add_movie_strip(Main *bmain, Scene *scene, ListBase *seqbase, SeqLoadData *load_data, double *r_video_start_offset)
Definition: strip_add.c:508
Sequence * SEQ_add_mask_strip(Scene *scene, ListBase *seqbase, struct SeqLoadData *load_data)
Definition: strip_add.c:200
Sequence * SEQ_add_image_strip(Main *bmain, Scene *scene, ListBase *seqbase, SeqLoadData *load_data)
Definition: strip_add.c:326
Sequence * SEQ_add_effect_strip(Scene *scene, ListBase *seqbase, struct SeqLoadData *load_data)
Definition: strip_add.c:221
Sequence * SEQ_add_movieclip_strip(Scene *scene, ListBase *seqbase, struct SeqLoadData *load_data)
Definition: strip_add.c:179
void SEQ_add_image_set_directory(Sequence *seq, char *path)
Definition: strip_add.c:264
void SEQ_add_image_init_alpha_mode(Sequence *seq)
Definition: strip_add.c:287
Sequence * SEQ_add_sound_strip(Main *UNUSED(bmain), Scene *UNUSED(scene), ListBase *UNUSED(seqbase), SeqLoadData *UNUSED(load_data), const double UNUSED(audio_offset))
Definition: strip_add.c:463
Sequence * SEQ_add_scene_strip(Scene *scene, ListBase *seqbase, struct SeqLoadData *load_data)
Definition: strip_add.c:158
Sequence * SEQ_select_active_get(Scene *scene)
Definition: strip_select.c:35
void SEQ_select_active_set(Scene *scene, Sequence *seq)
Definition: strip_select.c:46
void SEQ_time_update_sequence(Scene *scene, Sequence *seq)
Definition: strip_time.c:197
bool SEQ_transform_seqbase_shuffle(ListBase *seqbasep, Sequence *test, Scene *evil_scene)
bool SEQ_transform_test_overlap(ListBase *seqbasep, Sequence *test)
void SEQ_transform_set_right_handle_frame(Sequence *seq, int val)
ListBase * seqbasep
Stereo3dFormat stereo3d_format
void * first
Definition: DNA_listBase.h:47
Definition: BKE_main.h:116
ListBase masks
Definition: BKE_main.h:178
ListBase scenes
Definition: BKE_main.h:146
ListBase movieclips
Definition: BKE_main.h:177
Scene * scene
Definition: clip_ops.c:1182
struct ListBase queue
Definition: SEQ_proxy.h:60
struct Main * main
Definition: clip_ops.c:1183
struct Depsgraph * depsgraph
Definition: SEQ_proxy.h:58
struct RenderData r
struct Sequence * seq2
Definition: SEQ_add.h:59
int len
Definition: SEQ_add.h:49
char views_format
Definition: SEQ_add.h:65
bool use_multiview
Definition: SEQ_add.h:64
struct MovieClip * clip
Definition: SEQ_add.h:53
struct SeqLoadData::@1139 image
eSeqImageFitMethod fit_method
Definition: SEQ_add.h:63
struct Scene * scene
Definition: SEQ_add.h:52
int channel
Definition: SEQ_add.h:45
struct Sequence * seq3
Definition: SEQ_add.h:60
struct Stereo3dFormat * stereo3d_format
Definition: SEQ_add.h:66
char path[1024]
Definition: SEQ_add.h:47
int end_frame
Definition: SEQ_add.h:50
int start_frame
Definition: SEQ_add.h:44
char name[64]
Definition: SEQ_add.h:46
struct Mask * mask
Definition: SEQ_add.h:54
struct SeqLoadData::@1140 effect
eSeqLoadFlags flags
Definition: SEQ_add.h:62
int type
Definition: SEQ_add.h:56
struct Sequence * seq1
Definition: SEQ_add.h:58
struct Sequence * next
ImageFormatData im_format
Definition: sequencer_add.c:87
short render_size
char name[256]
short build_size_flags
StripProxy * proxy
StripElem * stripdata
char dir[768]
ListBase areabase
Definition: wm_jobs.c:73
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:752
const char * name
Definition: WM_types.h:721
const char * idname
Definition: WM_types.h:723
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:776
bool(* poll_property)(const struct bContext *C, struct wmOperator *op, const PropertyRNA *prop) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:782
void(* cancel)(struct bContext *, struct wmOperator *)
Definition: WM_types.h:760
struct StructRNA * srna
Definition: WM_types.h:802
const char * description
Definition: WM_types.h:726
void(* ui)(struct bContext *, struct wmOperator *)
Definition: WM_types.h:787
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:736
PropertyRNA * prop
Definition: WM_types.h:814
struct ReportList * reports
IDProperty * properties
struct uiLayout * layout
struct wmOperatorType * type
struct PointerRNA * ptr
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
#define G(x, y, z)
uint len
void WM_event_add_fileselect(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
PointerRNA * ptr
Definition: wm_files.c:3157
wmOperatorType * ot
Definition: wm_files.c:3156
void WM_jobs_start(wmWindowManager *wm, wmJob *wm_job)
Definition: wm_jobs.c:450
bool WM_jobs_is_running(wmJob *wm_job)
Definition: wm_jobs.c:325
void WM_operator_properties_filesel(wmOperatorType *ot, int filter, short type, short action, short flag, short display, short sort)
int WM_enum_search_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))