Blender V4.3
rna_sequencer.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include <climits>
10#include <cstdlib>
11
12#include "DNA_anim_types.h"
13#include "DNA_movieclip_types.h"
14#include "DNA_object_types.h"
15#include "DNA_scene_types.h"
16#include "DNA_sequence_types.h"
17#include "DNA_vfont_types.h"
18
19#include "BLI_iterator.h"
20#include "BLI_listbase.h"
21#include "BLI_math_rotation.h"
23#include "BLI_string_utils.hh"
24
25#include "BLT_translation.hh"
26
27#include "BKE_anim_data.hh"
28#include "BKE_animsys.h"
29#include "BKE_sound.h"
30
31#include "IMB_metadata.hh"
32
33#include "MEM_guardedalloc.h"
34
35#include "RNA_access.hh"
36#include "RNA_define.hh"
37#include "RNA_enum_types.hh"
38
39#include "rna_internal.hh"
40
41#include "SEQ_add.hh"
42#include "SEQ_channels.hh"
43#include "SEQ_effects.hh"
44#include "SEQ_iterator.hh"
45#include "SEQ_modifier.hh"
46#include "SEQ_prefetch.hh"
47#include "SEQ_proxy.hh"
48#include "SEQ_relations.hh"
49#include "SEQ_retiming.hh"
50#include "SEQ_select.hh"
51#include "SEQ_sequencer.hh"
52#include "SEQ_sound.hh"
54#include "SEQ_time.hh"
55#include "SEQ_transform.hh"
56#include "SEQ_utils.hh"
57
58#include "WM_types.hh"
59
60struct EffectInfo {
61 const char *struct_name;
62 const char *ui_name;
63 const char *ui_desc;
64 void (*func)(StructRNA *);
65 int inputs;
66};
67
68/* These wrap strangely, disable formatting for fixed indentation and wrapping. */
69/* clang-format off */
70#define RNA_ENUM_SEQUENCER_VIDEO_MODIFIER_TYPE_ITEMS \
71 {seqModifierType_BrightContrast, "BRIGHT_CONTRAST", ICON_NONE, "Brightness/Contrast", ""}, \
72 {seqModifierType_ColorBalance, "COLOR_BALANCE", ICON_NONE, "Color Balance", ""}, \
73 {seqModifierType_Curves, "CURVES", ICON_NONE, "Curves", ""}, \
74 {seqModifierType_HueCorrect, "HUE_CORRECT", ICON_NONE, "Hue Correct", ""}, \
75 {seqModifierType_Mask, "MASK", ICON_NONE, "Mask", ""}, \
76 {seqModifierType_Tonemap, "TONEMAP", ICON_NONE, "Tone Map", ""}, \
77 {seqModifierType_WhiteBalance, "WHITE_BALANCE", ICON_NONE, "White Balance", ""}
78
79#define RNA_ENUM_SEQUENCER_AUDIO_MODIFIER_TYPE_ITEMS \
80 {seqModifierType_SoundEqualizer, "SOUND_EQUALIZER", ICON_NONE, "Sound Equalizer", ""}
81/* clang-format on */
82
88
93
98
100 {SEQUENCE_COLOR_NONE, "NONE", ICON_X, "None", "Assign no color tag to the collection"},
101 {SEQUENCE_COLOR_01, "COLOR_01", ICON_SEQUENCE_COLOR_01, "Color 01", ""},
102 {SEQUENCE_COLOR_02, "COLOR_02", ICON_SEQUENCE_COLOR_02, "Color 02", ""},
103 {SEQUENCE_COLOR_03, "COLOR_03", ICON_SEQUENCE_COLOR_03, "Color 03", ""},
104 {SEQUENCE_COLOR_04, "COLOR_04", ICON_SEQUENCE_COLOR_04, "Color 04", ""},
105 {SEQUENCE_COLOR_05, "COLOR_05", ICON_SEQUENCE_COLOR_05, "Color 05", ""},
106 {SEQUENCE_COLOR_06, "COLOR_06", ICON_SEQUENCE_COLOR_06, "Color 06", ""},
107 {SEQUENCE_COLOR_07, "COLOR_07", ICON_SEQUENCE_COLOR_07, "Color 07", ""},
108 {SEQUENCE_COLOR_08, "COLOR_08", ICON_SEQUENCE_COLOR_08, "Color 08", ""},
109 {SEQUENCE_COLOR_09, "COLOR_09", ICON_SEQUENCE_COLOR_09, "Color 09", ""},
110 {0, nullptr, 0, nullptr, nullptr},
111};
112
113#ifdef RNA_RUNTIME
114
115# include <algorithm>
116
117# include <fmt/format.h>
118
119# include "BKE_global.hh"
120# include "BKE_idprop.hh"
121# include "BKE_movieclip.h"
122# include "BKE_report.hh"
123
124# include "WM_api.hh"
125
126# include "DEG_depsgraph.hh"
127# include "DEG_depsgraph_build.hh"
128
129# include "IMB_imbuf.hh"
130
131# include "SEQ_edit.hh"
132
133struct SequenceSearchData {
134 Sequence *seq;
135 void *data;
137};
138
139static void rna_SequenceElement_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
140{
141 Scene *scene = (Scene *)ptr->owner_id;
142 Editing *ed = SEQ_editing_get(scene);
143
144 if (ed) {
145 StripElem *se = (StripElem *)ptr->data;
146 Sequence *seq;
147
148 /* slow but we can't avoid! */
150 if (seq) {
152 }
153 }
154}
155
156static void rna_Sequence_invalidate_raw_update(Main * /*bmain*/,
157 Scene * /*scene*/,
159{
160 Scene *scene = (Scene *)ptr->owner_id;
161 Editing *ed = SEQ_editing_get(scene);
162
163 if (ed) {
164 Sequence *seq = (Sequence *)ptr->data;
165
167 }
168}
169
170static void rna_Sequence_invalidate_preprocessed_update(Main * /*bmain*/,
171 Scene * /*scene*/,
173{
174 Scene *scene = (Scene *)ptr->owner_id;
175 Editing *ed = SEQ_editing_get(scene);
176
177 if (ed) {
178 Sequence *seq = (Sequence *)ptr->data;
179
181 }
182}
183
184static void UNUSED_FUNCTION(rna_Sequence_invalidate_composite_update)(Main * /*bmain*/,
185 Scene * /*scene*/,
187{
188 Scene *scene = (Scene *)ptr->owner_id;
189 Editing *ed = SEQ_editing_get(scene);
190
191 if (ed) {
192 Sequence *seq = (Sequence *)ptr->data;
193
195 }
196}
197
198static void rna_Sequence_scene_switch_update(Main *bmain, Scene *scene, PointerRNA *ptr)
199{
200 rna_Sequence_invalidate_raw_update(bmain, scene, ptr);
203}
204
205static void rna_Sequence_use_sequence(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
206{
207 Scene *scene = reinterpret_cast<Scene *>(ptr->owner_id);
208
209 /* General update callback. */
210 rna_Sequence_invalidate_raw_update(bmain, scene, ptr);
211 /* Changing recursion changes set of IDs which needs to be remapped by the copy-on-evaluation.
212 * the only way for this currently is to tag the ID for ID_RECALC_SYNC_TO_EVAL. */
213 Editing *ed = SEQ_editing_get(scene);
214 if (ed) {
215 Sequence *seq = (Sequence *)ptr->data;
216 if (seq->scene != nullptr) {
218 }
219 }
220 /* The sequencer scene is to be updated as well, including new relations from the nested
221 * sequencer. */
224}
225
226static void add_strips_from_seqbase(const ListBase *seqbase, blender::Vector<Sequence *> &strips)
227{
228 LISTBASE_FOREACH (Sequence *, seq, seqbase) {
229 strips.append(seq);
230
231 if (seq->type == SEQ_TYPE_META) {
232 add_strips_from_seqbase(&seq->seqbase, strips);
233 }
234 }
235}
236
237struct SequencesAllIterator {
239 int index;
240};
241
242static std::optional<std::string> rna_SequenceEditor_path(const PointerRNA * /*ptr*/)
243{
244 return "sequence_editor";
245}
246
247static void rna_SequenceEditor_sequences_all_begin(CollectionPropertyIterator *iter,
249{
250 Scene *scene = (Scene *)ptr->owner_id;
251 Editing *ed = SEQ_editing_get(scene);
252
253 SequencesAllIterator *seq_iter = MEM_new<SequencesAllIterator>(__func__);
254 seq_iter->index = 0;
255 add_strips_from_seqbase(&ed->seqbase, seq_iter->strips);
256
257 BLI_Iterator *bli_iter = static_cast<BLI_Iterator *>(
258 MEM_callocN(sizeof(BLI_Iterator), __func__));
259 iter->internal.custom = bli_iter;
260 bli_iter->data = seq_iter;
261
262 Sequence **seq_arr = seq_iter->strips.begin();
263 bli_iter->current = *seq_arr;
264 iter->valid = bli_iter->current != nullptr;
265}
266
267static void rna_SequenceEditor_sequences_all_next(CollectionPropertyIterator *iter)
268{
269 BLI_Iterator *bli_iter = static_cast<BLI_Iterator *>(iter->internal.custom);
270 SequencesAllIterator *seq_iter = static_cast<SequencesAllIterator *>(bli_iter->data);
271
272 seq_iter->index++;
273 Sequence **seq_arr = seq_iter->strips.begin();
274 bli_iter->current = *(seq_arr + seq_iter->index);
275
276 iter->valid = bli_iter->current != nullptr && seq_iter->index < seq_iter->strips.size();
277}
278
279static PointerRNA rna_SequenceEditor_sequences_all_get(CollectionPropertyIterator *iter)
280{
281 Sequence *seq = static_cast<Sequence *>(((BLI_Iterator *)iter->internal.custom)->current);
282 return rna_pointer_inherit_refine(&iter->parent, &RNA_Sequence, seq);
283}
284
285static void rna_SequenceEditor_sequences_all_end(CollectionPropertyIterator *iter)
286{
287 BLI_Iterator *bli_iter = static_cast<BLI_Iterator *>(iter->internal.custom);
288 SequencesAllIterator *seq_iter = static_cast<SequencesAllIterator *>(bli_iter->data);
289
290 MEM_delete(seq_iter);
291 MEM_freeN(bli_iter);
292}
293
294static bool rna_SequenceEditor_sequences_all_lookup_string(PointerRNA *ptr,
295 const char *key,
296 PointerRNA *r_ptr)
297{
298 ID *id = ptr->owner_id;
299 Scene *scene = (Scene *)id;
300
301 Sequence *seq = SEQ_sequence_lookup_seq_by_name(scene, key);
302 if (seq) {
303 *r_ptr = RNA_pointer_create(ptr->owner_id, &RNA_Sequence, seq);
304 return true;
305 }
306 return false;
307}
308
309static void rna_SequenceEditor_update_cache(Main * /*bmain*/, Scene *scene, PointerRNA * /*ptr*/)
310{
311 Editing *ed = scene->ed;
312
313 SEQ_relations_free_imbuf(scene, &ed->seqbase, false);
314 SEQ_cache_cleanup(scene);
315}
316
317/* internal use */
318static int rna_SequenceEditor_elements_length(PointerRNA *ptr)
319{
320 Sequence *seq = (Sequence *)ptr->data;
321
322 /* Hack? copied from `sequencer.cc`, #reload_sequence_new_file(). */
323 size_t olen = MEM_allocN_len(seq->strip->stripdata) / sizeof(StripElem);
324
325 /* The problem with `seq->strip->len` and `seq->len` is that it's discounted from the offset
326 * (hard cut trim). */
327 return int(olen);
328}
329
330static void rna_Sequence_elements_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
331{
332 Sequence *seq = (Sequence *)ptr->data;
334 (void *)seq->strip->stripdata,
335 sizeof(StripElem),
336 rna_SequenceEditor_elements_length(ptr),
337 0,
338 nullptr);
339}
340
341static int rna_Sequence_retiming_keys_length(PointerRNA *ptr)
342{
344}
345
346static void rna_SequenceEditor_retiming_keys_begin(CollectionPropertyIterator *iter,
348{
349 Sequence *seq = (Sequence *)ptr->data;
351 (void *)seq->retiming_keys,
352 sizeof(SeqRetimingKey),
354 0,
355 nullptr);
356}
357
358static Sequence *strip_by_key_find(Scene *scene, SeqRetimingKey *key)
359{
360 Editing *ed = SEQ_editing_get(scene);
362
363 for (Sequence *seq : strips) {
364 const int retiming_keys_count = SEQ_retiming_keys_count(seq);
365 SeqRetimingKey *first = seq->retiming_keys;
366 SeqRetimingKey *last = seq->retiming_keys + retiming_keys_count - 1;
367
368 if (key >= first && key <= last) {
369 return seq;
370 }
371 }
372
373 return nullptr;
374}
375
376static void rna_Sequence_retiming_key_remove(ID *id, SeqRetimingKey *key)
377{
378 Scene *scene = (Scene *)id;
379 Sequence *seq = strip_by_key_find(scene, key);
380
381 if (seq == nullptr) {
382 return;
383 }
384
385 SEQ_retiming_remove_key(scene, seq, key);
386
389}
390
391static int rna_Sequence_retiming_key_frame_get(PointerRNA *ptr)
392{
394 Scene *scene = (Scene *)ptr->owner_id;
395 Sequence *seq = strip_by_key_find(scene, key);
396
397 if (seq == nullptr) {
398 return 0;
399 }
400
402}
403
404static void rna_Sequence_retiming_key_frame_set(PointerRNA *ptr, int value)
405{
407 Scene *scene = (Scene *)ptr->owner_id;
408 Sequence *seq = strip_by_key_find(scene, key);
409
410 if (seq == nullptr) {
411 return;
412 }
413
414 SEQ_retiming_key_timeline_frame_set(scene, seq, key, value);
416}
417
418static bool rna_SequenceEditor_selected_retiming_key_get(PointerRNA *ptr)
419{
420 Scene *scene = (Scene *)ptr->owner_id;
421 return SEQ_retiming_selection_get(SEQ_editing_get(scene)).size() != 0;
422}
423
424static void rna_Sequence_views_format_update(Main *bmain, Scene *scene, PointerRNA *ptr)
425{
426 rna_Sequence_invalidate_raw_update(bmain, scene, ptr);
427}
428
429static void do_sequence_frame_change_update(Scene *scene, Sequence *seq)
430{
431 ListBase *seqbase = SEQ_get_seqbase_by_seq(scene, seq);
432
433 if (SEQ_transform_test_overlap(scene, seqbase, seq)) {
434 SEQ_transform_seqbase_shuffle(seqbase, seq, scene);
435 }
436
437 if (seq->type == SEQ_TYPE_SOUND_RAM) {
439 }
440}
441
442/* A simple wrapper around above func, directly usable as prop update func.
443 * Also invalidate cache if needed.
444 */
445static void rna_Sequence_frame_change_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
446{
447 Scene *scene = (Scene *)ptr->owner_id;
448 do_sequence_frame_change_update(scene, (Sequence *)ptr->data);
449}
450
451static int rna_Sequence_frame_final_start_get(PointerRNA *ptr)
452{
453 Scene *scene = (Scene *)ptr->owner_id;
455}
456
457static int rna_Sequence_frame_final_end_get(PointerRNA *ptr)
458{
459 Scene *scene = (Scene *)ptr->owner_id;
461}
462
463static void rna_Sequence_start_frame_final_set(PointerRNA *ptr, int value)
464{
465 Sequence *seq = (Sequence *)ptr->data;
466 Scene *scene = (Scene *)ptr->owner_id;
467
468 SEQ_time_left_handle_frame_set(scene, seq, value);
469 do_sequence_frame_change_update(scene, seq);
471}
472
473static void rna_Sequence_end_frame_final_set(PointerRNA *ptr, int value)
474{
475 Sequence *seq = (Sequence *)ptr->data;
476 Scene *scene = (Scene *)ptr->owner_id;
477
478 SEQ_time_right_handle_frame_set(scene, seq, value);
479 do_sequence_frame_change_update(scene, seq);
481}
482
483static void rna_Sequence_start_frame_set(PointerRNA *ptr, float value)
484{
485 Sequence *seq = (Sequence *)ptr->data;
486 Scene *scene = (Scene *)ptr->owner_id;
487
488 SEQ_transform_translate_sequence(scene, seq, value - seq->start);
489 do_sequence_frame_change_update(scene, seq);
491}
492
493static void rna_Sequence_frame_offset_start_set(PointerRNA *ptr, float value)
494{
495 Sequence *seq = (Sequence *)ptr->data;
496 Scene *scene = (Scene *)ptr->owner_id;
497
499 seq->startofs = value;
500}
501
502static void rna_Sequence_frame_offset_end_set(PointerRNA *ptr, float value)
503{
504 Sequence *seq = (Sequence *)ptr->data;
505 Scene *scene = (Scene *)ptr->owner_id;
506
508 seq->endofs = value;
509}
510
511static void rna_Sequence_anim_startofs_final_set(PointerRNA *ptr, int value)
512{
513 Sequence *seq = (Sequence *)ptr->data;
514 Scene *scene = (Scene *)ptr->owner_id;
515
516 seq->anim_startofs = std::min(value, seq->len + seq->anim_startofs);
517
518 SEQ_add_reload_new_file(G.main, scene, seq, false);
519 do_sequence_frame_change_update(scene, seq);
520}
521
522static void rna_Sequence_anim_endofs_final_set(PointerRNA *ptr, int value)
523{
524 Sequence *seq = (Sequence *)ptr->data;
525 Scene *scene = (Scene *)ptr->owner_id;
526
527 seq->anim_endofs = std::min(value, seq->len + seq->anim_endofs);
528
529 SEQ_add_reload_new_file(G.main, scene, seq, false);
530 do_sequence_frame_change_update(scene, seq);
531}
532
533static void rna_Sequence_anim_endofs_final_range(
534 PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
535{
536 Sequence *seq = (Sequence *)ptr->data;
537
538 *min = 0;
539 *max = seq->len + seq->anim_endofs - seq->startofs - seq->endofs - 1;
540}
541
542static void rna_Sequence_anim_startofs_final_range(
543 PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
544{
545 Sequence *seq = (Sequence *)ptr->data;
546
547 *min = 0;
548 *max = seq->len + seq->anim_startofs - seq->startofs - seq->endofs - 1;
549}
550
551static void rna_Sequence_frame_offset_start_range(
552 PointerRNA *ptr, float *min, float *max, float * /*softmin*/, float * /*softmax*/)
553{
554 Sequence *seq = (Sequence *)ptr->data;
555 *min = (seq->type == SEQ_TYPE_SOUND_RAM) ? 0 : INT_MIN;
556 *max = seq->len - seq->endofs - 1;
557}
558
559static void rna_Sequence_frame_offset_end_range(
560 PointerRNA *ptr, float *min, float *max, float * /*softmin*/, float * /*softmax*/)
561{
562 Sequence *seq = (Sequence *)ptr->data;
563 *min = (seq->type == SEQ_TYPE_SOUND_RAM) ? 0 : INT_MIN;
564 *max = seq->len - seq->startofs - 1;
565}
566
567static void rna_Sequence_frame_length_set(PointerRNA *ptr, int value)
568{
569 Sequence *seq = (Sequence *)ptr->data;
570 Scene *scene = (Scene *)ptr->owner_id;
571
573 do_sequence_frame_change_update(scene, seq);
575}
576
577static int rna_Sequence_frame_length_get(PointerRNA *ptr)
578{
579 Sequence *seq = (Sequence *)ptr->data;
580 Scene *scene = (Scene *)ptr->owner_id;
582}
583
584static int rna_Sequence_frame_duration_get(PointerRNA *ptr)
585{
586 Sequence *seq = static_cast<Sequence *>(ptr->data);
587 Scene *scene = reinterpret_cast<Scene *>(ptr->owner_id);
588 return SEQ_time_strip_length_get(scene, seq);
589}
590
591static int rna_Sequence_frame_editable(const PointerRNA *ptr, const char ** /*r_info*/)
592{
593 Sequence *seq = (Sequence *)ptr->data;
594 /* Effect sequences' start frame and length must be readonly! */
595 return (SEQ_effect_get_num_inputs(seq->type)) ? PropertyFlag(0) : PROP_EDITABLE;
596}
597
598static void rna_Sequence_channel_set(PointerRNA *ptr, int value)
599{
600 Sequence *seq = (Sequence *)ptr->data;
601 Scene *scene = (Scene *)ptr->owner_id;
602 ListBase *seqbase = SEQ_get_seqbase_by_seq(scene, seq);
603
604 /* check channel increment or decrement */
605 const int channel_delta = (value >= seq->machine) ? 1 : -1;
606 seq->machine = value;
607
608 if (SEQ_transform_test_overlap(scene, seqbase, seq)) {
609 SEQ_transform_seqbase_shuffle_ex(seqbase, seq, scene, channel_delta);
610 }
612}
613
614static void rna_Sequence_use_proxy_set(PointerRNA *ptr, bool value)
615{
616 Sequence *seq = (Sequence *)ptr->data;
617 SEQ_proxy_set(seq, value != 0);
618}
619
620static bool transform_seq_cmp_fn(Sequence *seq, void *arg_pt)
621{
622 SequenceSearchData *data = static_cast<SequenceSearchData *>(arg_pt);
623
624 if (seq->strip && seq->strip->transform == data->data) {
625 data->seq = seq;
626 return false; /* done so bail out */
627 }
628 return true;
629}
630
631static Sequence *sequence_get_by_transform(Editing *ed, StripTransform *transform)
632{
633 SequenceSearchData data;
634
635 data.seq = nullptr;
636 data.data = transform;
637
638 /* irritating we need to search for our sequence! */
639 SEQ_for_each_callback(&ed->seqbase, transform_seq_cmp_fn, &data);
640
641 return data.seq;
642}
643
644static std::optional<std::string> rna_SequenceTransform_path(const PointerRNA *ptr)
645{
646 Scene *scene = (Scene *)ptr->owner_id;
647 Editing *ed = SEQ_editing_get(scene);
648 Sequence *seq = sequence_get_by_transform(ed, static_cast<StripTransform *>(ptr->data));
649
650 if (seq) {
651 char name_esc[(sizeof(seq->name) - 2) * 2];
652 BLI_str_escape(name_esc, seq->name + 2, sizeof(name_esc));
653 return fmt::format("sequence_editor.sequences_all[\"{}\"].transform", name_esc);
654 }
655 return "";
656}
657
658static void rna_SequenceTransform_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
659{
660 Scene *scene = (Scene *)ptr->owner_id;
661 Editing *ed = SEQ_editing_get(scene);
662 Sequence *seq = sequence_get_by_transform(ed, static_cast<StripTransform *>(ptr->data));
663
665}
666
667static bool crop_seq_cmp_fn(Sequence *seq, void *arg_pt)
668{
669 SequenceSearchData *data = static_cast<SequenceSearchData *>(arg_pt);
670
671 if (seq->strip && seq->strip->crop == data->data) {
672 data->seq = seq;
673 return false; /* done so bail out */
674 }
675 return true;
676}
677
678static Sequence *sequence_get_by_crop(Editing *ed, StripCrop *crop)
679{
680 SequenceSearchData data;
681
682 data.seq = nullptr;
683 data.data = crop;
684
685 /* irritating we need to search for our sequence! */
686 SEQ_for_each_callback(&ed->seqbase, crop_seq_cmp_fn, &data);
687
688 return data.seq;
689}
690
691static std::optional<std::string> rna_SequenceCrop_path(const PointerRNA *ptr)
692{
693 Scene *scene = (Scene *)ptr->owner_id;
694 Editing *ed = SEQ_editing_get(scene);
695 Sequence *seq = sequence_get_by_crop(ed, static_cast<StripCrop *>(ptr->data));
696
697 if (seq) {
698 char name_esc[(sizeof(seq->name) - 2) * 2];
699 BLI_str_escape(name_esc, seq->name + 2, sizeof(name_esc));
700 return fmt::format("sequence_editor.sequences_all[\"{}\"].crop", name_esc);
701 }
702 return "";
703}
704
705static void rna_SequenceCrop_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
706{
707 Scene *scene = (Scene *)ptr->owner_id;
708 Editing *ed = SEQ_editing_get(scene);
709 Sequence *seq = sequence_get_by_crop(ed, static_cast<StripCrop *>(ptr->data));
710
712}
713
714static void rna_Sequence_text_font_set(PointerRNA *ptr,
715 PointerRNA ptr_value,
716 ReportList * /*reports*/)
717{
718 Sequence *seq = static_cast<Sequence *>(ptr->data);
719 TextVars *data = static_cast<TextVars *>(seq->effectdata);
720 VFont *value = static_cast<VFont *>(ptr_value.data);
721
722 SEQ_effect_text_font_unload(data, true);
723
724 id_us_plus(&value->id);
725 data->text_blf_id = SEQ_FONT_NOT_LOADED;
726 data->text_font = value;
727}
728
729/* name functions that ignore the first two characters */
730static void rna_Sequence_name_get(PointerRNA *ptr, char *value)
731{
732 Sequence *seq = (Sequence *)ptr->data;
733 strcpy(value, seq->name + 2);
734}
735
736static int rna_Sequence_name_length(PointerRNA *ptr)
737{
738 Sequence *seq = (Sequence *)ptr->data;
739 return strlen(seq->name + 2);
740}
741
742static void rna_Sequence_name_set(PointerRNA *ptr, const char *value)
743{
744 Scene *scene = (Scene *)ptr->owner_id;
745 Sequence *seq = (Sequence *)ptr->data;
746 char oldname[sizeof(seq->name)];
747 AnimData *adt;
748
749 SEQ_prefetch_stop(scene);
750
751 /* make a copy of the old name first */
752 BLI_strncpy(oldname, seq->name + 2, sizeof(seq->name) - 2);
753
754 /* copy the new name into the name slot */
755 SEQ_edit_sequence_name_set(scene, seq, value);
756
757 /* make sure the name is unique */
758 SEQ_sequence_base_unique_name_recursive(scene, &scene->ed->seqbase, seq);
759 /* fix all the animation data which may link to this */
760
761 /* Don't rename everywhere because these are per scene. */
762# if 0
764 nullptr, "sequence_editor.sequences_all", oldname, seq->name + 2);
765# endif
766 adt = BKE_animdata_from_id(&scene->id);
767 if (adt) {
769 adt,
770 nullptr,
771 "sequence_editor.sequences_all",
772 oldname,
773 seq->name + 2,
774 0,
775 0,
776 1);
777 }
778}
779
780static StructRNA *rna_Sequence_refine(PointerRNA *ptr)
781{
782 Sequence *seq = (Sequence *)ptr->data;
783
784 switch (seq->type) {
785 case SEQ_TYPE_IMAGE:
786 return &RNA_ImageSequence;
787 case SEQ_TYPE_META:
788 return &RNA_MetaSequence;
789 case SEQ_TYPE_SCENE:
790 return &RNA_SceneSequence;
791 case SEQ_TYPE_MOVIE:
792 return &RNA_MovieSequence;
794 return &RNA_MovieClipSequence;
795 case SEQ_TYPE_MASK:
796 return &RNA_MaskSequence;
798 return &RNA_SoundSequence;
799 case SEQ_TYPE_CROSS:
800 return &RNA_CrossSequence;
801 case SEQ_TYPE_ADD:
802 return &RNA_AddSequence;
803 case SEQ_TYPE_SUB:
804 return &RNA_SubtractSequence;
806 return &RNA_AlphaOverSequence;
808 return &RNA_AlphaUnderSequence;
810 return &RNA_GammaCrossSequence;
811 case SEQ_TYPE_MUL:
812 return &RNA_MultiplySequence;
814 return &RNA_OverDropSequence;
816 return &RNA_MulticamSequence;
818 return &RNA_AdjustmentSequence;
819 case SEQ_TYPE_WIPE:
820 return &RNA_WipeSequence;
821 case SEQ_TYPE_GLOW:
822 return &RNA_GlowSequence;
824 return &RNA_TransformSequence;
825 case SEQ_TYPE_COLOR:
826 return &RNA_ColorSequence;
827 case SEQ_TYPE_SPEED:
828 return &RNA_SpeedControlSequence;
830 return &RNA_GaussianBlurSequence;
831 case SEQ_TYPE_TEXT:
832 return &RNA_TextSequence;
834 return &RNA_ColorMixSequence;
835 default:
836 return &RNA_Sequence;
837 }
838}
839
840static std::optional<std::string> rna_Sequence_path(const PointerRNA *ptr)
841{
842 const Sequence *seq = (Sequence *)ptr->data;
843
844 /* sequencer data comes from scene...
845 * TODO: would be nice to make SequenceEditor data a data-block of its own (for shorter paths)
846 */
847 char name_esc[(sizeof(seq->name) - 2) * 2];
848
849 BLI_str_escape(name_esc, seq->name + 2, sizeof(name_esc));
850 return fmt::format("sequence_editor.sequences_all[\"{}\"]", name_esc);
851}
852
853static IDProperty **rna_Sequence_idprops(PointerRNA *ptr)
854{
855 Sequence *seq = static_cast<Sequence *>(ptr->data);
856 return &seq->prop;
857}
858
859static bool rna_MovieSequence_reload_if_needed(ID *scene_id, Sequence *seq, Main *bmain)
860{
861 Scene *scene = (Scene *)scene_id;
862
863 bool has_reloaded;
864 bool can_produce_frames;
865
866 SEQ_add_movie_reload_if_needed(bmain, scene, seq, &has_reloaded, &can_produce_frames);
867
868 if (has_reloaded && can_produce_frames) {
870
873 }
874
875 return can_produce_frames;
876}
877
878static PointerRNA rna_MovieSequence_metadata_get(ID *scene_id, Sequence *seq)
879{
880 if (seq == nullptr || seq->anims.first == nullptr) {
881 return PointerRNA_NULL;
882 }
883
884 StripAnim *sanim = static_cast<StripAnim *>(seq->anims.first);
885 if (sanim->anim == nullptr) {
886 return PointerRNA_NULL;
887 }
888
889 IDProperty *metadata = IMB_anim_load_metadata(sanim->anim);
890 if (metadata == nullptr) {
891 return PointerRNA_NULL;
892 }
893
894 PointerRNA ptr = RNA_pointer_create(scene_id, &RNA_IDPropertyWrapPtr, metadata);
895 return ptr;
896}
897
898static PointerRNA rna_SequenceEditor_meta_stack_get(CollectionPropertyIterator *iter)
899{
900 ListBaseIterator *internal = &iter->internal.listbase;
901 MetaStack *ms = (MetaStack *)internal->link;
902
903 return rna_pointer_inherit_refine(&iter->parent, &RNA_Sequence, ms->parseq);
904}
905
906/* TODO: expose seq path setting as a higher level sequencer BKE function. */
907static void rna_Sequence_filepath_set(PointerRNA *ptr, const char *value)
908{
909 Sequence *seq = (Sequence *)(ptr->data);
911 seq->strip->dirpath,
912 sizeof(seq->strip->dirpath),
913 seq->strip->stripdata->filename,
914 sizeof(seq->strip->stripdata->filename));
915}
916
917static void rna_Sequence_filepath_get(PointerRNA *ptr, char *value)
918{
919 Sequence *seq = (Sequence *)(ptr->data);
920 char filepath[FILE_MAX];
921
922 BLI_path_join(filepath, sizeof(filepath), seq->strip->dirpath, seq->strip->stripdata->filename);
923 strcpy(value, filepath);
924}
925
926static int rna_Sequence_filepath_length(PointerRNA *ptr)
927{
928 Sequence *seq = (Sequence *)(ptr->data);
929 char filepath[FILE_MAX];
930
931 BLI_path_join(filepath, sizeof(filepath), seq->strip->dirpath, seq->strip->stripdata->filename);
932 return strlen(filepath);
933}
934
935static void rna_Sequence_proxy_filepath_set(PointerRNA *ptr, const char *value)
936{
937 StripProxy *proxy = (StripProxy *)(ptr->data);
939 value, proxy->dirpath, sizeof(proxy->dirpath), proxy->filename, sizeof(proxy->filename));
940 if (proxy->anim) {
941 IMB_free_anim(proxy->anim);
942 proxy->anim = nullptr;
943 }
944}
945
946static void rna_Sequence_proxy_filepath_get(PointerRNA *ptr, char *value)
947{
948 StripProxy *proxy = (StripProxy *)(ptr->data);
949 char filepath[FILE_MAX];
950
951 BLI_path_join(filepath, sizeof(filepath), proxy->dirpath, proxy->filename);
952 strcpy(value, filepath);
953}
954
955static int rna_Sequence_proxy_filepath_length(PointerRNA *ptr)
956{
957 StripProxy *proxy = (StripProxy *)(ptr->data);
958 char filepath[FILE_MAX];
959
960 BLI_path_join(filepath, sizeof(filepath), proxy->dirpath, proxy->filename);
961 return strlen(filepath);
962}
963
964static void rna_Sequence_audio_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
965{
967}
968
969static void rna_Sequence_pan_range(
970 PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
971{
972 Scene *scene = (Scene *)ptr->owner_id;
973
974 *min = -FLT_MAX;
975 *max = FLT_MAX;
976 *softmax = 1 + int(scene->r.ffcodecdata.audio_channels > 2);
977 *softmin = -*softmax;
978}
979
980static int rna_Sequence_input_count_get(PointerRNA *ptr)
981{
982 Sequence *seq = (Sequence *)(ptr->data);
983
984 return SEQ_effect_get_num_inputs(seq->type);
985}
986
987static void rna_Sequence_input_set(PointerRNA *ptr,
988 const PointerRNA &ptr_value,
989 ReportList *reports,
990 int input_num)
991{
992
993 Sequence *seq = static_cast<Sequence *>(ptr->data);
994 Sequence *input = static_cast<Sequence *>(ptr_value.data);
995
996 if (SEQ_relations_render_loop_check(input, seq)) {
997 BKE_report(reports, RPT_ERROR, "Cannot reassign inputs: recursion detected");
998 return;
999 }
1000
1001 switch (input_num) {
1002 case 1:
1003 seq->seq1 = input;
1004 break;
1005 case 2:
1006 seq->seq2 = input;
1007 break;
1008 }
1009}
1010
1011static void rna_Sequence_input_1_set(PointerRNA *ptr, PointerRNA ptr_value, ReportList *reports)
1012{
1013 rna_Sequence_input_set(ptr, ptr_value, reports, 1);
1014}
1015
1016static void rna_Sequence_input_2_set(PointerRNA *ptr, PointerRNA ptr_value, ReportList *reports)
1017{
1018 rna_Sequence_input_set(ptr, ptr_value, reports, 2);
1019}
1020# if 0
1021static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value)
1022{
1023 Sequence *seq = (Sequence *)(ptr->data);
1025 seq->strip->dirpath,
1026 sizeof(seq->strip->dirpath),
1027 seq->strip->stripdata->name,
1028 sizeof(seq->strip->stripdata->name));
1029}
1030
1031static void rna_SequenceElement_filename_set(PointerRNA *ptr, const char *value)
1032{
1033 StripElem *elem = (StripElem *)(ptr->data);
1034 BLI_path_split_file_part(value, elem->name, sizeof(elem->name));
1035}
1036# endif
1037
1038static void rna_Sequence_reopen_files_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
1039{
1040 Scene *scene = (Scene *)ptr->owner_id;
1041 Editing *ed = SEQ_editing_get(scene);
1042
1043 SEQ_relations_free_imbuf(scene, &ed->seqbase, false);
1044 rna_Sequence_invalidate_raw_update(bmain, scene, ptr);
1045
1046 if (RNA_struct_is_a(ptr->type, &RNA_SoundSequence)) {
1047 SEQ_sound_update_bounds(scene, static_cast<Sequence *>(ptr->data));
1048 }
1049}
1050
1051static void rna_Sequence_filepath_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
1052{
1053 Scene *scene = (Scene *)ptr->owner_id;
1054 Sequence *seq = (Sequence *)(ptr->data);
1055 SEQ_add_reload_new_file(bmain, scene, seq, true);
1056 rna_Sequence_invalidate_raw_update(bmain, scene, ptr);
1057}
1058
1059static void rna_Sequence_sound_update(Main *bmain, Scene * /*active_scene*/, PointerRNA *ptr)
1060{
1061 Scene *scene = (Scene *)ptr->owner_id;
1064}
1065
1066static bool seqproxy_seq_cmp_fn(Sequence *seq, void *arg_pt)
1067{
1068 SequenceSearchData *data = static_cast<SequenceSearchData *>(arg_pt);
1069
1070 if (seq->strip && seq->strip->proxy == data->data) {
1071 data->seq = seq;
1072 return false; /* done so bail out */
1073 }
1074 return true;
1075}
1076
1077static Sequence *sequence_get_by_proxy(Editing *ed, StripProxy *proxy)
1078{
1079 SequenceSearchData data;
1080
1081 data.seq = nullptr;
1082 data.data = proxy;
1083
1084 SEQ_for_each_callback(&ed->seqbase, seqproxy_seq_cmp_fn, &data);
1085 return data.seq;
1086}
1087
1088static void rna_Sequence_tcindex_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
1089{
1090 Scene *scene = (Scene *)ptr->owner_id;
1091 Editing *ed = SEQ_editing_get(scene);
1092 Sequence *seq = sequence_get_by_proxy(ed, static_cast<StripProxy *>(ptr->data));
1093
1094 SEQ_add_reload_new_file(bmain, scene, seq, false);
1095 do_sequence_frame_change_update(scene, seq);
1096}
1097
1098static void rna_SequenceProxy_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1099{
1100 Scene *scene = (Scene *)ptr->owner_id;
1101 Editing *ed = SEQ_editing_get(scene);
1102 Sequence *seq = sequence_get_by_proxy(ed, static_cast<StripProxy *>(ptr->data));
1104}
1105
1106/* do_versions? */
1107static float rna_Sequence_opacity_get(PointerRNA *ptr)
1108{
1109 Sequence *seq = (Sequence *)(ptr->data);
1110 return seq->blend_opacity / 100.0f;
1111}
1112static void rna_Sequence_opacity_set(PointerRNA *ptr, float value)
1113{
1114 Sequence *seq = (Sequence *)(ptr->data);
1115 CLAMP(value, 0.0f, 1.0f);
1116 seq->blend_opacity = value * 100.0f;
1117}
1118
1119static int rna_Sequence_color_tag_get(PointerRNA *ptr)
1120{
1121 Sequence *seq = (Sequence *)(ptr->data);
1122 return seq->color_tag;
1123}
1124
1125static void rna_Sequence_color_tag_set(PointerRNA *ptr, int value)
1126{
1127 Sequence *seq = (Sequence *)(ptr->data);
1128 seq->color_tag = value;
1129}
1130
1131static bool colbalance_seq_cmp_fn(Sequence *seq, void *arg_pt)
1132{
1133 SequenceSearchData *data = static_cast<SequenceSearchData *>(arg_pt);
1134
1135 for (SequenceModifierData *smd = static_cast<SequenceModifierData *>(seq->modifiers.first); smd;
1136 smd = smd->next)
1137 {
1138 if (smd->type == seqModifierType_ColorBalance) {
1140
1141 if (&cbmd->color_balance == data->data) {
1142 data->seq = seq;
1143 data->smd = smd;
1144 return false; /* done so bail out */
1145 }
1146 }
1147 }
1148
1149 return true;
1150}
1151
1152static Sequence *sequence_get_by_colorbalance(Editing *ed,
1154 SequenceModifierData **r_smd)
1155{
1156 SequenceSearchData data;
1157
1158 data.seq = nullptr;
1159 data.smd = nullptr;
1160 data.data = cb;
1161
1162 /* irritating we need to search for our sequence! */
1163 SEQ_for_each_callback(&ed->seqbase, colbalance_seq_cmp_fn, &data);
1164
1165 *r_smd = data.smd;
1166
1167 return data.seq;
1168}
1169
1170static std::optional<std::string> rna_SequenceColorBalance_path(const PointerRNA *ptr)
1171{
1172 Scene *scene = (Scene *)ptr->owner_id;
1174 Editing *ed = SEQ_editing_get(scene);
1175 Sequence *seq = sequence_get_by_colorbalance(
1176 ed, static_cast<StripColorBalance *>(ptr->data), &smd);
1177
1178 if (seq) {
1179 char name_esc[(sizeof(seq->name) - 2) * 2];
1180
1181 BLI_str_escape(name_esc, seq->name + 2, sizeof(name_esc));
1182
1183 if (!smd) {
1184 /* Path to old filter color balance. */
1185 return fmt::format("sequence_editor.sequences_all[\"{}\"].color_balance", name_esc);
1186 }
1187 /* Path to modifier. */
1188 char name_esc_smd[sizeof(smd->name) * 2];
1189
1190 BLI_str_escape(name_esc_smd, smd->name, sizeof(name_esc_smd));
1191 return fmt::format("sequence_editor.sequences_all[\"{}\"].modifiers[\"{}\"].color_balance",
1192 name_esc,
1193 name_esc_smd);
1194 }
1195 return "";
1196}
1197
1198static void rna_SequenceColorBalance_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1199{
1200 Scene *scene = (Scene *)ptr->owner_id;
1201 Editing *ed = SEQ_editing_get(scene);
1203 Sequence *seq = sequence_get_by_colorbalance(
1204 ed, static_cast<StripColorBalance *>(ptr->data), &smd);
1205
1207}
1208
1209static void rna_SequenceEditor_overlay_lock_set(PointerRNA *ptr, bool value)
1210{
1211 Scene *scene = (Scene *)ptr->owner_id;
1212 Editing *ed = SEQ_editing_get(scene);
1213
1214 if (ed == nullptr) {
1215 return;
1216 }
1217
1218 /* convert from abs to relative and back */
1219 if ((ed->overlay_frame_flag & SEQ_EDIT_OVERLAY_FRAME_ABS) == 0 && value) {
1220 ed->overlay_frame_abs = scene->r.cfra + ed->overlay_frame_ofs;
1222 }
1223 else if ((ed->overlay_frame_flag & SEQ_EDIT_OVERLAY_FRAME_ABS) && !value) {
1224 ed->overlay_frame_ofs = ed->overlay_frame_abs - scene->r.cfra;
1225 ed->overlay_frame_flag &= ~SEQ_EDIT_OVERLAY_FRAME_ABS;
1226 }
1227}
1228
1229static int rna_SequenceEditor_overlay_frame_get(PointerRNA *ptr)
1230{
1231 Scene *scene = (Scene *)ptr->owner_id;
1232 Editing *ed = SEQ_editing_get(scene);
1233
1234 if (ed == nullptr) {
1235 return scene->r.cfra;
1236 }
1237
1239 return ed->overlay_frame_abs - scene->r.cfra;
1240 }
1241 else {
1242 return ed->overlay_frame_ofs;
1243 }
1244}
1245
1246static void rna_SequenceEditor_overlay_frame_set(PointerRNA *ptr, int value)
1247{
1248 Scene *scene = (Scene *)ptr->owner_id;
1249 Editing *ed = SEQ_editing_get(scene);
1250
1251 if (ed == nullptr) {
1252 return;
1253 }
1254
1256 ed->overlay_frame_abs = (scene->r.cfra + value);
1257 }
1258 else {
1259 ed->overlay_frame_ofs = value;
1260 }
1261}
1262
1263static void rna_SequenceEditor_display_stack(ID *id,
1264 Editing *ed,
1265 ReportList *reports,
1266 Sequence *seqm)
1267{
1268 /* Check for non-meta sequence */
1269 if (seqm != nullptr && seqm->type != SEQ_TYPE_META && SEQ_exists_in_seqbase(seqm, &ed->seqbase))
1270 {
1271 BKE_report(reports, RPT_ERROR, "Sequence type must be 'META'");
1272 return;
1273 }
1274
1275 /* Get editing base of meta sequence */
1276 Scene *scene = (Scene *)id;
1277 SEQ_meta_stack_set(scene, seqm);
1278 /* De-activate strip. This is to prevent strip from different timeline being drawn. */
1279 SEQ_select_active_set(scene, nullptr);
1280
1282}
1283
1284static bool modifier_seq_cmp_fn(Sequence *seq, void *arg_pt)
1285{
1286 SequenceSearchData *data = static_cast<SequenceSearchData *>(arg_pt);
1287
1288 if (BLI_findindex(&seq->modifiers, data->data) != -1) {
1289 data->seq = seq;
1290 return false; /* done so bail out */
1291 }
1292
1293 return true;
1294}
1295
1296static Sequence *sequence_get_by_modifier(Editing *ed, SequenceModifierData *smd)
1297{
1298 SequenceSearchData data;
1299
1300 data.seq = nullptr;
1301 data.data = smd;
1302
1303 /* irritating we need to search for our sequence! */
1304 SEQ_for_each_callback(&ed->seqbase, modifier_seq_cmp_fn, &data);
1305
1306 return data.seq;
1307}
1308
1309static StructRNA *rna_SequenceModifier_refine(PointerRNA *ptr)
1310{
1312
1313 switch (smd->type) {
1315 return &RNA_ColorBalanceModifier;
1317 return &RNA_CurvesModifier;
1319 return &RNA_HueCorrectModifier;
1321 return &RNA_BrightContrastModifier;
1323 return &RNA_WhiteBalanceModifier;
1325 return &RNA_SequencerTonemapModifierData;
1327 return &RNA_SoundEqualizerModifier;
1328 default:
1329 return &RNA_SequenceModifier;
1330 }
1331}
1332
1333static std::optional<std::string> rna_SequenceModifier_path(const PointerRNA *ptr)
1334{
1335 Scene *scene = (Scene *)ptr->owner_id;
1336 Editing *ed = SEQ_editing_get(scene);
1337 SequenceModifierData *smd = static_cast<SequenceModifierData *>(ptr->data);
1338 Sequence *seq = sequence_get_by_modifier(ed, smd);
1339
1340 if (seq) {
1341 char name_esc[(sizeof(seq->name) - 2) * 2];
1342 char name_esc_smd[sizeof(smd->name) * 2];
1343
1344 BLI_str_escape(name_esc, seq->name + 2, sizeof(name_esc));
1345 BLI_str_escape(name_esc_smd, smd->name, sizeof(name_esc_smd));
1346 return fmt::format(
1347 "sequence_editor.sequences_all[\"{}\"].modifiers[\"{}\"]", name_esc, name_esc_smd);
1348 }
1349 return "";
1350}
1351
1352static void rna_SequenceModifier_name_set(PointerRNA *ptr, const char *value)
1353{
1354 SequenceModifierData *smd = static_cast<SequenceModifierData *>(ptr->data);
1355 Scene *scene = (Scene *)ptr->owner_id;
1356 Editing *ed = SEQ_editing_get(scene);
1357 Sequence *seq = sequence_get_by_modifier(ed, smd);
1358 AnimData *adt;
1359 char oldname[sizeof(smd->name)];
1360
1361 /* make a copy of the old name first */
1362 STRNCPY(oldname, smd->name);
1363
1364 /* copy the new name into the name slot */
1365 STRNCPY_UTF8(smd->name, value);
1366
1367 /* make sure the name is truly unique */
1368 SEQ_modifier_unique_name(seq, smd);
1369
1370 /* fix all the animation data which may link to this */
1371 adt = BKE_animdata_from_id(&scene->id);
1372 if (adt) {
1373 char rna_path_prefix[1024];
1374
1375 char seq_name_esc[(sizeof(seq->name) - 2) * 2];
1376 BLI_str_escape(seq_name_esc, seq->name + 2, sizeof(seq_name_esc));
1377
1378 SNPRINTF(rna_path_prefix, "sequence_editor.sequences_all[\"%s\"].modifiers", seq_name_esc);
1380 &scene->id, adt, nullptr, rna_path_prefix, oldname, smd->name, 0, 0, 1);
1381 }
1382}
1383
1384static void rna_SequenceModifier_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
1385{
1386 /* strip from other scenes could be modified, so using active scene is not reliable */
1387 Scene *scene = (Scene *)ptr->owner_id;
1388 Editing *ed = SEQ_editing_get(scene);
1389 Sequence *seq = sequence_get_by_modifier(ed, static_cast<SequenceModifierData *>(ptr->data));
1390
1394 }
1395 else {
1397 }
1398}
1399
1400/*
1401 * Update of Curve in an EQ Sound Modifier
1402 */
1403static void rna_SequenceModifier_EQCurveMapping_update(Main *bmain,
1404 Scene * /*scene*/,
1405 PointerRNA *ptr)
1406{
1407 Scene *scene = (Scene *)ptr->owner_id;
1408
1412}
1413
1414static bool rna_SequenceModifier_otherSequence_poll(PointerRNA *ptr, PointerRNA value)
1415{
1416 Scene *scene = (Scene *)ptr->owner_id;
1417 Editing *ed = SEQ_editing_get(scene);
1418 Sequence *seq = sequence_get_by_modifier(ed, static_cast<SequenceModifierData *>(ptr->data));
1419 Sequence *cur = (Sequence *)value.data;
1420
1421 if ((seq == cur) || (cur->type == SEQ_TYPE_SOUND_RAM)) {
1422 return false;
1423 }
1424
1425 return true;
1426}
1427
1428static SequenceModifierData *rna_Sequence_modifier_new(
1429 Sequence *seq, bContext *C, ReportList *reports, const char *name, int type)
1430{
1432 BKE_report(reports, RPT_ERROR, "Sequence type does not support modifiers");
1433
1434 return nullptr;
1435 }
1436 else {
1437 Scene *scene = CTX_data_scene(C);
1439
1440 smd = SEQ_modifier_new(seq, name, type);
1441
1443
1445
1446 return smd;
1447 }
1448}
1449
1450static void rna_Sequence_modifier_remove(Sequence *seq,
1451 bContext *C,
1452 ReportList *reports,
1453 PointerRNA *smd_ptr)
1454{
1455 SequenceModifierData *smd = static_cast<SequenceModifierData *>(smd_ptr->data);
1456 Scene *scene = CTX_data_scene(C);
1457
1458 if (SEQ_modifier_remove(seq, smd) == false) {
1459 BKE_report(reports, RPT_ERROR, "Modifier was not found in the stack");
1460 return;
1461 }
1462
1463 RNA_POINTER_INVALIDATE(smd_ptr);
1465
1467}
1468
1469static void rna_Sequence_modifier_clear(Sequence *seq, bContext *C)
1470{
1471 Scene *scene = CTX_data_scene(C);
1472
1473 SEQ_modifier_clear(seq);
1474
1476
1478}
1479
1480static void rna_SequenceModifier_strip_set(PointerRNA *ptr, PointerRNA value, ReportList *reports)
1481{
1482 SequenceModifierData *smd = static_cast<SequenceModifierData *>(ptr->data);
1483 Scene *scene = (Scene *)ptr->owner_id;
1484 Editing *ed = SEQ_editing_get(scene);
1485 Sequence *seq = sequence_get_by_modifier(ed, smd);
1486 Sequence *target = (Sequence *)value.data;
1487
1488 if (target != nullptr && SEQ_relations_render_loop_check(target, seq)) {
1489 BKE_report(reports, RPT_ERROR, "Recursion detected, cannot use this strip");
1490 return;
1491 }
1492
1493 smd->mask_sequence = target;
1494}
1495
1496static float rna_Sequence_fps_get(PointerRNA *ptr)
1497{
1498 Scene *scene = (Scene *)ptr->owner_id;
1499 Sequence *seq = (Sequence *)(ptr->data);
1500 return SEQ_time_sequence_get_fps(scene, seq);
1501}
1502
1503static void rna_Sequence_separate(ID *id, Sequence *seqm, Main *bmain)
1504{
1505 Scene *scene = (Scene *)id;
1506
1507 /* Find the appropriate seqbase */
1508 ListBase *seqbase = SEQ_get_seqbase_by_seq(scene, seqm);
1509
1510 LISTBASE_FOREACH_MUTABLE (Sequence *, seq, &seqm->seqbase) {
1511 SEQ_edit_move_strip_to_seqbase(scene, &seqm->seqbase, seq, seqbase);
1512 }
1513
1514 SEQ_edit_flag_for_removal(scene, seqbase, seqm);
1515 SEQ_edit_remove_flagged_sequences(scene, seqbase);
1516
1517 /* Update depsgraph. */
1520
1522}
1523
1524static void rna_SequenceTimelineChannel_name_set(PointerRNA *ptr, const char *value)
1525{
1527 Scene *scene = (Scene *)ptr->owner_id;
1528 Editing *ed = SEQ_editing_get(scene);
1529
1530 Sequence *channel_owner = SEQ_sequence_lookup_owner_by_channel(scene, channel);
1531 ListBase *channels_base = &ed->channels;
1532
1533 if (channel_owner != nullptr) {
1534 channels_base = &channel_owner->channels;
1535 }
1536
1537 STRNCPY_UTF8(channel->name, value);
1538 BLI_uniquename(channels_base,
1539 channel,
1540 "Channel",
1541 '.',
1543 sizeof(channel->name));
1544}
1545
1546static void rna_SequenceTimelineChannel_mute_update(Main *bmain,
1547 Scene *active_scene,
1548 PointerRNA *ptr)
1549{
1550 Scene *scene = (Scene *)ptr->owner_id;
1551 Editing *ed = SEQ_editing_get(scene);
1553
1554 Sequence *channel_owner = SEQ_sequence_lookup_owner_by_channel(scene, channel);
1555 ListBase *seqbase;
1556 if (channel_owner == nullptr) {
1557 seqbase = &ed->seqbase;
1558 }
1559 else {
1560 seqbase = &channel_owner->seqbase;
1561 }
1562
1563 LISTBASE_FOREACH (Sequence *, seq, seqbase) {
1565 }
1566
1567 rna_Sequence_sound_update(bmain, active_scene, ptr);
1568}
1569
1570static std::optional<std::string> rna_SeqTimelineChannel_path(const PointerRNA *ptr)
1571{
1572 Scene *scene = (Scene *)ptr->owner_id;
1574
1575 Sequence *channel_owner = SEQ_sequence_lookup_owner_by_channel(scene, channel);
1576
1577 char channel_name_esc[(sizeof(channel->name)) * 2];
1578 BLI_str_escape(channel_name_esc, channel->name, sizeof(channel_name_esc));
1579
1580 if (channel_owner == nullptr) {
1581 return fmt::format("sequence_editor.channels[\"{}\"]", channel_name_esc);
1582 }
1583 char owner_name_esc[(sizeof(channel_owner->name) - 2) * 2];
1584 BLI_str_escape(owner_name_esc, channel_owner->name + 2, sizeof(owner_name_esc));
1585 return fmt::format(
1586 "sequence_editor.sequences_all[\"{}\"].channels[\"{}\"]", owner_name_esc, channel_name_esc);
1587}
1588
1589static EQCurveMappingData *rna_Sequence_SoundEqualizer_Curve_add(SoundEqualizerModifierData *semd,
1590 bContext * /*C*/,
1591 float min_freq,
1592 float max_freq)
1593{
1594 EQCurveMappingData *eqcmd = SEQ_sound_equalizermodifier_add_graph(semd, min_freq, max_freq);
1596 return eqcmd;
1597}
1598
1599static void rna_Sequence_SoundEqualizer_Curve_clear(SoundEqualizerModifierData *semd,
1600 bContext * /*C*/)
1601{
1604}
1605
1606#else
1607
1609{
1610 StructRNA *srna;
1611 PropertyRNA *prop;
1612
1613 srna = RNA_def_struct(brna, "SequenceElement", nullptr);
1614 RNA_def_struct_ui_text(srna, "Sequence Element", "Sequence strip data for a single frame");
1615 RNA_def_struct_sdna(srna, "StripElem");
1616
1617 prop = RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME);
1618 RNA_def_property_string_sdna(prop, nullptr, "filename");
1619 RNA_def_property_ui_text(prop, "Filename", "Name of the source file");
1620 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceElement_update");
1621
1622 prop = RNA_def_property(srna, "orig_width", PROP_INT, PROP_NONE);
1623 RNA_def_property_int_sdna(prop, nullptr, "orig_width");
1625 RNA_def_property_ui_text(prop, "Orig Width", "Original image width");
1626
1627 prop = RNA_def_property(srna, "orig_height", PROP_INT, PROP_NONE);
1628 RNA_def_property_int_sdna(prop, nullptr, "orig_height");
1630 RNA_def_property_ui_text(prop, "Orig Height", "Original image height");
1631
1632 prop = RNA_def_property(srna, "orig_fps", PROP_FLOAT, PROP_NONE);
1633 RNA_def_property_float_sdna(prop, nullptr, "orig_fps");
1635 RNA_def_property_ui_text(prop, "Orig FPS", "Original frames per second");
1636}
1637
1639{
1640 StructRNA *srna;
1641 PropertyRNA *prop;
1642
1643 srna = RNA_def_struct(brna, "RetimingKey", nullptr);
1645 srna,
1646 "Retiming Key",
1647 "Key mapped to particular frame that can be moved to change playback speed");
1648 RNA_def_struct_sdna(srna, "SeqRetimingKey");
1649
1650 prop = RNA_def_property(srna, "timeline_frame", PROP_INT, PROP_NONE);
1652 prop, "rna_Sequence_retiming_key_frame_get", "rna_Sequence_retiming_key_frame_set", nullptr);
1653 RNA_def_property_ui_text(prop, "Timeline Frame", "Position of retiming key in timeline");
1654
1655 FunctionRNA *func = RNA_def_function(srna, "remove", "rna_Sequence_retiming_key_remove");
1657 RNA_def_function_ui_description(func, "Remove retiming key");
1658}
1659
1661{
1662 StructRNA *srna;
1663 PropertyRNA *prop;
1664
1665 srna = RNA_def_struct(brna, "SequenceCrop", nullptr);
1666 RNA_def_struct_ui_text(srna, "Sequence Crop", "Cropping parameters for a sequence strip");
1667 RNA_def_struct_sdna(srna, "StripCrop");
1668
1669 prop = RNA_def_property(srna, "max_y", PROP_INT, PROP_PIXEL);
1670 RNA_def_property_int_sdna(prop, nullptr, "top");
1671 RNA_def_property_ui_text(prop, "Top", "Number of pixels to crop from the top");
1672 RNA_def_property_ui_range(prop, 0, 4096, 1, -1);
1673 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceCrop_update");
1674
1675 prop = RNA_def_property(srna, "min_y", PROP_INT, PROP_PIXEL);
1676 RNA_def_property_int_sdna(prop, nullptr, "bottom");
1677 RNA_def_property_ui_text(prop, "Bottom", "Number of pixels to crop from the bottom");
1678 RNA_def_property_ui_range(prop, 0, 4096, 1, -1);
1679 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceCrop_update");
1680
1681 prop = RNA_def_property(srna, "min_x", PROP_INT, PROP_PIXEL);
1682 RNA_def_property_int_sdna(prop, nullptr, "left");
1683 RNA_def_property_ui_text(prop, "Left", "Number of pixels to crop from the left side");
1684 RNA_def_property_ui_range(prop, 0, 4096, 1, -1);
1685 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceCrop_update");
1686
1687 prop = RNA_def_property(srna, "max_x", PROP_INT, PROP_PIXEL);
1688 RNA_def_property_int_sdna(prop, nullptr, "right");
1689 RNA_def_property_ui_text(prop, "Right", "Number of pixels to crop from the right side");
1690 RNA_def_property_ui_range(prop, 0, 4096, 1, -1);
1691 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceCrop_update");
1692
1693 RNA_def_struct_path_func(srna, "rna_SequenceCrop_path");
1694}
1695
1698 "AUTO",
1699 0,
1700 "Auto",
1701 "Automatically choose filter based on scaling factor"},
1702 {SEQ_TRANSFORM_FILTER_NEAREST, "NEAREST", 0, "Nearest", "Use nearest sample"},
1704 "BILINEAR",
1705 0,
1706 "Bilinear",
1707 "Interpolate between 2" BLI_STR_UTF8_MULTIPLICATION_SIGN "2 samples"},
1709 "CUBIC_MITCHELL",
1710 0,
1711 "Cubic Mitchell",
1712 "Cubic Mitchell filter on 4" BLI_STR_UTF8_MULTIPLICATION_SIGN "4 samples"},
1714 "CUBIC_BSPLINE",
1715 0,
1716 "Cubic B-Spline",
1717 "Cubic B-Spline filter (blurry but no ringing) on 4" BLI_STR_UTF8_MULTIPLICATION_SIGN
1718 "4 samples"},
1720 "BOX",
1721 0,
1722 "Box",
1723 "Averages source image samples that fall under destination pixel"},
1724 {0, nullptr, 0, nullptr, nullptr},
1725};
1726
1728{
1729 StructRNA *srna;
1730 PropertyRNA *prop;
1731
1732 srna = RNA_def_struct(brna, "SequenceTransform", nullptr);
1733 RNA_def_struct_ui_text(srna, "Sequence Transform", "Transform parameters for a sequence strip");
1734 RNA_def_struct_sdna(srna, "StripTransform");
1735
1736 prop = RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_UNSIGNED);
1737 RNA_def_property_float_sdna(prop, nullptr, "scale_x");
1738 RNA_def_property_ui_text(prop, "Scale X", "Scale along X axis");
1739 RNA_def_property_ui_range(prop, 0, FLT_MAX, 3, 3);
1741 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceTransform_update");
1742
1743 prop = RNA_def_property(srna, "scale_y", PROP_FLOAT, PROP_UNSIGNED);
1744 RNA_def_property_float_sdna(prop, nullptr, "scale_y");
1745 RNA_def_property_ui_text(prop, "Scale Y", "Scale along Y axis");
1746 RNA_def_property_ui_range(prop, 0, FLT_MAX, 3, 3);
1748 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceTransform_update");
1749
1750 prop = RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_PIXEL);
1751 RNA_def_property_float_sdna(prop, nullptr, "xofs");
1752 RNA_def_property_ui_text(prop, "Translate X", "Move along X axis");
1753 RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 100, 3);
1754 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceTransform_update");
1755
1756 prop = RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_PIXEL);
1757 RNA_def_property_float_sdna(prop, nullptr, "yofs");
1758 RNA_def_property_ui_text(prop, "Translate Y", "Move along Y axis");
1759 RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 100, 3);
1760 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceTransform_update");
1761
1762 prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_ANGLE);
1763 RNA_def_property_float_sdna(prop, nullptr, "rotation");
1764 RNA_def_property_ui_text(prop, "Rotation", "Rotate around image center");
1765 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceTransform_update");
1766
1767 prop = RNA_def_property(srna, "origin", PROP_FLOAT, PROP_NONE);
1768 RNA_def_property_float_sdna(prop, nullptr, "origin");
1769 RNA_def_property_ui_text(prop, "Origin", "Origin of image for transformation");
1770 RNA_def_property_ui_range(prop, 0, 1, 1, 3);
1771 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceTransform_update");
1772
1773 prop = RNA_def_property(srna, "filter", PROP_ENUM, PROP_NONE);
1774 RNA_def_property_enum_sdna(prop, nullptr, "filter");
1777 RNA_def_property_ui_text(prop, "Filter", "Type of filter to use for image transformation");
1778 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceTransform_update");
1779
1780 RNA_def_struct_path_func(srna, "rna_SequenceTransform_path");
1781}
1782
1784{
1785 StructRNA *srna;
1786 PropertyRNA *prop;
1787
1788 static const EnumPropertyItem seq_tc_items[] = {
1790 "NONE",
1791 0,
1792 "None",
1793 "Ignore generated timecodes, seek in movie stream based on calculated timestamp"},
1795 "RECORD_RUN",
1796 0,
1797 "Record Run",
1798 "Seek based on timestamps read from movie stream, giving the best match between scene and "
1799 "movie times"},
1801 "RECORD_RUN_NO_GAPS",
1802 0,
1803 "Record Run No Gaps",
1804 "Effectively convert movie to an image sequence, ignoring incomplete or dropped frames, "
1805 "and changes in frame rate"},
1806 {0, nullptr, 0, nullptr, nullptr},
1807 };
1808
1809 srna = RNA_def_struct(brna, "SequenceProxy", nullptr);
1810 RNA_def_struct_ui_text(srna, "Sequence Proxy", "Proxy parameters for a sequence strip");
1811 RNA_def_struct_sdna(srna, "StripProxy");
1812
1813 prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
1814 RNA_def_property_string_sdna(prop, nullptr, "dirpath");
1815 RNA_def_property_ui_text(prop, "Directory", "Location to store the proxy files");
1816 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceProxy_update");
1817
1818 prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
1819 RNA_def_property_ui_text(prop, "Path", "Location of custom proxy file");
1822 "rna_Sequence_proxy_filepath_get",
1823 "rna_Sequence_proxy_filepath_length",
1824 "rna_Sequence_proxy_filepath_set");
1825
1826 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceProxy_update");
1827
1828 prop = RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
1830 RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing proxy files when building");
1831
1832 prop = RNA_def_property(srna, "build_25", PROP_BOOLEAN, PROP_NONE);
1833 RNA_def_property_boolean_sdna(prop, nullptr, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_25);
1834 RNA_def_property_ui_text(prop, "25%", "Build 25% proxy resolution");
1835
1836 prop = RNA_def_property(srna, "build_50", PROP_BOOLEAN, PROP_NONE);
1837 RNA_def_property_boolean_sdna(prop, nullptr, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_50);
1838 RNA_def_property_ui_text(prop, "50%", "Build 50% proxy resolution");
1839
1840 prop = RNA_def_property(srna, "build_75", PROP_BOOLEAN, PROP_NONE);
1841 RNA_def_property_boolean_sdna(prop, nullptr, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_75);
1842 RNA_def_property_ui_text(prop, "75%", "Build 75% proxy resolution");
1843
1844 prop = RNA_def_property(srna, "build_100", PROP_BOOLEAN, PROP_NONE);
1845 RNA_def_property_boolean_sdna(prop, nullptr, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_100);
1846 RNA_def_property_ui_text(prop, "100%", "Build 100% proxy resolution");
1847
1848 prop = RNA_def_property(srna, "build_record_run", PROP_BOOLEAN, PROP_NONE);
1849 RNA_def_property_boolean_sdna(prop, nullptr, "build_tc_flags", SEQ_PROXY_TC_RECORD_RUN);
1850 RNA_def_property_ui_text(prop, "Rec Run", "Build record run time code index");
1851
1852 prop = RNA_def_property(srna, "quality", PROP_INT, PROP_UNSIGNED);
1853 RNA_def_property_int_sdna(prop, nullptr, "quality");
1854 RNA_def_property_ui_text(prop, "Quality", "Quality of proxies to build");
1855 RNA_def_property_ui_range(prop, 1, 100, 1, -1);
1856
1857 prop = RNA_def_property(srna, "timecode", PROP_ENUM, PROP_NONE);
1858 RNA_def_property_enum_sdna(prop, nullptr, "tc");
1859 RNA_def_property_enum_items(prop, seq_tc_items);
1860 RNA_def_property_ui_text(prop, "Timecode", "Method for reading the inputs timecode");
1861 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_tcindex_update");
1862
1863 prop = RNA_def_property(srna, "use_proxy_custom_directory", PROP_BOOLEAN, PROP_NONE);
1865 RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Use a custom directory to store data");
1867 prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
1868
1869 prop = RNA_def_property(srna, "use_proxy_custom_file", PROP_BOOLEAN, PROP_NONE);
1871 RNA_def_property_ui_text(prop, "Proxy Custom File", "Use a custom file to read proxy data from");
1873 prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
1874}
1875
1877{
1878 StructRNA *srna;
1879 PropertyRNA *prop;
1880
1881 static const EnumPropertyItem method_items[] = {
1882 {SEQ_COLOR_BALANCE_METHOD_LIFTGAMMAGAIN, "LIFT_GAMMA_GAIN", 0, "Lift/Gamma/Gain", ""},
1884 "OFFSET_POWER_SLOPE",
1885 0,
1886 "Offset/Power/Slope (ASC-CDL)",
1887 "ASC-CDL standard color correction"},
1888 {0, nullptr, 0, nullptr, nullptr},
1889 };
1890
1891 srna = RNA_def_struct(brna, "SequenceColorBalanceData", nullptr);
1893 "Sequence Color Balance Data",
1894 "Color balance parameters for a sequence strip and its modifiers");
1895 RNA_def_struct_sdna(srna, "StripColorBalance");
1896
1897 prop = RNA_def_property(srna, "correction_method", PROP_ENUM, PROP_NONE);
1898 RNA_def_property_enum_sdna(prop, nullptr, "method");
1899 RNA_def_property_enum_items(prop, method_items);
1900 RNA_def_property_ui_text(prop, "Correction Method", "");
1901 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
1902
1903 prop = RNA_def_property(srna, "lift", PROP_FLOAT, PROP_COLOR_GAMMA);
1904 RNA_def_property_ui_text(prop, "Lift", "Color balance lift (shadows)");
1905 RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
1907 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
1908
1909 prop = RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_COLOR_GAMMA);
1910 RNA_def_property_ui_text(prop, "Gamma", "Color balance gamma (midtones)");
1911 RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
1913 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
1914
1915 prop = RNA_def_property(srna, "gain", PROP_FLOAT, PROP_COLOR_GAMMA);
1916 RNA_def_property_ui_text(prop, "Gain", "Color balance gain (highlights)");
1917 RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
1919 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
1920
1921 prop = RNA_def_property(srna, "slope", PROP_FLOAT, PROP_COLOR_GAMMA);
1922 RNA_def_property_ui_text(prop, "Slope", "Correction for highlights");
1923 RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
1925 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
1926
1927 prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_COLOR_GAMMA);
1928 RNA_def_property_ui_text(prop, "Offset", "Correction for entire tonal range");
1929 RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
1931 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
1932
1933 prop = RNA_def_property(srna, "power", PROP_FLOAT, PROP_COLOR_GAMMA);
1934 RNA_def_property_ui_text(prop, "Power", "Correction for midtones");
1935 RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
1937 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
1938
1939 prop = RNA_def_property(srna, "invert_lift", PROP_BOOLEAN, PROP_NONE);
1941 RNA_def_property_ui_text(prop, "Inverse Lift", "Invert the lift color");
1942 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
1943
1944 prop = RNA_def_property(srna, "invert_gamma", PROP_BOOLEAN, PROP_NONE);
1946 RNA_def_property_ui_text(prop, "Inverse Gamma", "Invert the gamma color");
1947 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
1948
1949 prop = RNA_def_property(srna, "invert_gain", PROP_BOOLEAN, PROP_NONE);
1951 RNA_def_property_ui_text(prop, "Inverse Gain", "Invert the gain color");
1952 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
1953
1954 prop = RNA_def_property(srna, "invert_slope", PROP_BOOLEAN, PROP_NONE);
1956 RNA_def_property_ui_text(prop, "Inverse Slope", "Invert the slope color");
1957 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
1958
1959 prop = RNA_def_property(srna, "invert_offset", PROP_BOOLEAN, PROP_NONE);
1961 RNA_def_property_ui_text(prop, "Inverse Offset", "Invert the offset color");
1962 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
1963
1964 prop = RNA_def_property(srna, "invert_power", PROP_BOOLEAN, PROP_NONE);
1966 RNA_def_property_ui_text(prop, "Inverse Power", "Invert the power color");
1967 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
1968
1969 /* not yet used */
1970# if 0
1971 prop = RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE);
1972 RNA_def_property_range(prop, 0.0f, 1.0f);
1973 RNA_def_property_ui_text(prop, "Exposure", "");
1974 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_ColorBabalnce_update");
1975
1976 prop = RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE);
1977 RNA_def_property_range(prop, 0.0f, 1.0f);
1978 RNA_def_property_ui_text(prop, "Saturation", "");
1979 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_ColorBabalnce_update");
1980# endif
1981
1982 RNA_def_struct_path_func(srna, "rna_SequenceColorBalance_path");
1983}
1984
1986{
1987 StructRNA *srna;
1988
1989 srna = RNA_def_struct(brna, "SequenceColorBalance", "SequenceColorBalanceData");
1991 srna, "Sequence Color Balance", "Color balance parameters for a sequence strip");
1992 RNA_def_struct_sdna(srna, "StripColorBalance");
1993}
1994
1996 {SEQ_BLEND_REPLACE, "REPLACE", 0, "Replace", ""},
1997 {SEQ_TYPE_CROSS, "CROSS", 0, "Cross", ""},
1999 {SEQ_TYPE_DARKEN, "DARKEN", 0, "Darken", ""},
2000 {SEQ_TYPE_MUL, "MULTIPLY", 0, "Multiply", ""},
2001 {SEQ_TYPE_COLOR_BURN, "BURN", 0, "Color Burn", ""},
2002 {SEQ_TYPE_LINEAR_BURN, "LINEAR_BURN", 0, "Linear Burn", ""},
2004 {SEQ_TYPE_LIGHTEN, "LIGHTEN", 0, "Lighten", ""},
2005 {SEQ_TYPE_SCREEN, "SCREEN", 0, "Screen", ""},
2006 {SEQ_TYPE_DODGE, "DODGE", 0, "Color Dodge", ""},
2007 {SEQ_TYPE_ADD, "ADD", 0, "Add", ""},
2009 {SEQ_TYPE_OVERLAY, "OVERLAY", 0, "Overlay", ""},
2010 {SEQ_TYPE_SOFT_LIGHT, "SOFT_LIGHT", 0, "Soft Light", ""},
2011 {SEQ_TYPE_HARD_LIGHT, "HARD_LIGHT", 0, "Hard Light", ""},
2012 {SEQ_TYPE_VIVID_LIGHT, "VIVID_LIGHT", 0, "Vivid Light", ""},
2013 {SEQ_TYPE_LIN_LIGHT, "LINEAR_LIGHT", 0, "Linear Light", ""},
2014 {SEQ_TYPE_PIN_LIGHT, "PIN_LIGHT", 0, "Pin Light", ""},
2016 {SEQ_TYPE_DIFFERENCE, "DIFFERENCE", 0, "Difference", ""},
2017 {SEQ_TYPE_EXCLUSION, "EXCLUSION", 0, "Exclusion", ""},
2018 {SEQ_TYPE_SUB, "SUBTRACT", 0, "Subtract", ""},
2020 {SEQ_TYPE_HUE, "HUE", 0, "Hue", ""},
2021 {SEQ_TYPE_SATURATION, "SATURATION", 0, "Saturation", ""},
2022 {SEQ_TYPE_BLEND_COLOR, "COLOR", 0, "Color", ""},
2023 {SEQ_TYPE_VALUE, "VALUE", 0, "Value", ""},
2025 {SEQ_TYPE_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
2026 {SEQ_TYPE_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
2027 {SEQ_TYPE_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
2028 {SEQ_TYPE_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
2029 {0, nullptr, 0, nullptr, nullptr},
2030};
2031
2033{
2034 StructRNA *srna;
2035
2036 FunctionRNA *func;
2037 PropertyRNA *parm;
2038
2039 RNA_def_property_srna(cprop, "SequenceModifiers");
2040 srna = RNA_def_struct(brna, "SequenceModifiers", nullptr);
2041 RNA_def_struct_sdna(srna, "Sequence");
2042 RNA_def_struct_ui_text(srna, "Strip Modifiers", "Collection of strip modifiers");
2043
2044 /* add modifier */
2045 func = RNA_def_function(srna, "new", "rna_Sequence_modifier_new");
2047 RNA_def_function_ui_description(func, "Add a new modifier");
2048 parm = RNA_def_string(func, "name", "Name", 0, "", "New name for the modifier");
2050 /* modifier to add */
2051 parm = RNA_def_enum(func,
2052 "type",
2055 "",
2056 "Modifier type to add");
2058 /* return type */
2059 parm = RNA_def_pointer(func, "modifier", "SequenceModifier", "", "Newly created modifier");
2060 RNA_def_function_return(func, parm);
2061
2062 /* remove modifier */
2063 func = RNA_def_function(srna, "remove", "rna_Sequence_modifier_remove");
2065 RNA_def_function_ui_description(func, "Remove an existing modifier from the sequence");
2066 /* modifier to remove */
2067 parm = RNA_def_pointer(func, "modifier", "SequenceModifier", "", "Modifier to remove");
2070
2071 /* clear all modifiers */
2072 func = RNA_def_function(srna, "clear", "rna_Sequence_modifier_clear");
2074 RNA_def_function_ui_description(func, "Remove all modifiers from the sequence");
2075}
2076
2078{
2079 StructRNA *srna;
2080 PropertyRNA *prop;
2081
2082 static const EnumPropertyItem seq_type_items[] = {
2083 {SEQ_TYPE_IMAGE, "IMAGE", 0, "Image", ""},
2084 {SEQ_TYPE_META, "META", 0, "Meta", ""},
2085 {SEQ_TYPE_SCENE, "SCENE", 0, "Scene", ""},
2086 {SEQ_TYPE_MOVIE, "MOVIE", 0, "Movie", ""},
2087 {SEQ_TYPE_MOVIECLIP, "MOVIECLIP", 0, "Clip", ""},
2088 {SEQ_TYPE_MASK, "MASK", 0, "Mask", ""},
2089 {SEQ_TYPE_SOUND_RAM, "SOUND", 0, "Sound", ""},
2090 {SEQ_TYPE_CROSS, "CROSS", 0, "Cross", ""},
2091 {SEQ_TYPE_ADD, "ADD", 0, "Add", ""},
2092 {SEQ_TYPE_SUB, "SUBTRACT", 0, "Subtract", ""},
2093 {SEQ_TYPE_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
2094 {SEQ_TYPE_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
2095 {SEQ_TYPE_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
2096 {SEQ_TYPE_MUL, "MULTIPLY", 0, "Multiply", ""},
2097 {SEQ_TYPE_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
2098 {SEQ_TYPE_WIPE, "WIPE", 0, "Wipe", ""},
2099 {SEQ_TYPE_GLOW, "GLOW", 0, "Glow", ""},
2100 {SEQ_TYPE_TRANSFORM, "TRANSFORM", 0, "Transform", ""},
2101 {SEQ_TYPE_COLOR, "COLOR", 0, "Color", ""},
2102 {SEQ_TYPE_SPEED, "SPEED", 0, "Speed", ""},
2103 {SEQ_TYPE_MULTICAM, "MULTICAM", 0, "Multicam Selector", ""},
2104 {SEQ_TYPE_ADJUSTMENT, "ADJUSTMENT", 0, "Adjustment Layer", ""},
2105 {SEQ_TYPE_GAUSSIAN_BLUR, "GAUSSIAN_BLUR", 0, "Gaussian Blur", ""},
2106 {SEQ_TYPE_TEXT, "TEXT", 0, "Text", ""},
2107 {SEQ_TYPE_COLORMIX, "COLORMIX", 0, "Color Mix", ""},
2108 {0, nullptr, 0, nullptr, nullptr},
2109 };
2110
2111 srna = RNA_def_struct(brna, "Sequence", nullptr);
2112 RNA_def_struct_ui_text(srna, "Sequence", "Sequence strip in the sequence editor");
2113 RNA_def_struct_refine_func(srna, "rna_Sequence_refine");
2114 RNA_def_struct_path_func(srna, "rna_Sequence_path");
2115 RNA_def_struct_idprops_func(srna, "rna_Sequence_idprops");
2116
2117 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
2119 prop, "rna_Sequence_name_get", "rna_Sequence_name_length", "rna_Sequence_name_set");
2121 RNA_def_property_ui_text(prop, "Name", "");
2122 RNA_def_struct_name_property(srna, prop);
2124
2125 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
2127 RNA_def_property_enum_items(prop, seq_type_items);
2128 RNA_def_property_ui_text(prop, "Type", "");
2130 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
2131
2132 /* flags */
2133 prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
2134 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SELECT);
2135 RNA_def_property_ui_text(prop, "Select", "");
2137
2138 prop = RNA_def_property(srna, "select_left_handle", PROP_BOOLEAN, PROP_NONE);
2139 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_LEFTSEL);
2140 RNA_def_property_ui_text(prop, "Left Handle Selected", "");
2142
2143 prop = RNA_def_property(srna, "select_right_handle", PROP_BOOLEAN, PROP_NONE);
2144 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_RIGHTSEL);
2145 RNA_def_property_ui_text(prop, "Right Handle Selected", "");
2147
2148 prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
2149 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_MUTE);
2150 RNA_def_property_ui_icon(prop, ICON_CHECKBOX_HLT, -1);
2152 prop, "Mute", "Disable strip so that it cannot be viewed in the output");
2153 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
2154
2155 prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
2156 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_LOCK);
2158 RNA_def_property_ui_icon(prop, ICON_UNLOCKED, true);
2159 RNA_def_property_ui_text(prop, "Lock", "Lock strip so that it cannot be transformed");
2161
2162 /* strip positioning */
2163 /* Cache has to be invalidated before and after transformation. */
2164 prop = RNA_def_property(srna, "frame_final_duration", PROP_INT, PROP_TIME);
2168 prop, "Length", "The length of the contents of this strip after the handles are applied");
2170 prop, "rna_Sequence_frame_length_get", "rna_Sequence_frame_length_set", nullptr);
2171 RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
2173 prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
2174
2175 prop = RNA_def_property(srna, "frame_duration", PROP_INT, PROP_TIME);
2176 RNA_def_property_int_funcs(prop, "rna_Sequence_frame_duration_get", nullptr, nullptr);
2180 prop, "Length", "The length of the contents of this strip before the handles are applied");
2181
2182 prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_TIME);
2183 RNA_def_property_float_sdna(prop, nullptr, "start");
2185 RNA_def_property_ui_text(prop, "Start Frame", "X position where the strip begins");
2186 RNA_def_property_ui_range(prop, MINFRAME, MAXFRAME, 100.0f, 0);
2188 nullptr,
2189 "rna_Sequence_start_frame_set",
2190 nullptr); /* overlap tests and calc_seq_disp */
2191 RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
2193 prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
2194
2195 prop = RNA_def_property(srna, "frame_final_start", PROP_INT, PROP_TIME);
2196 RNA_def_property_int_sdna(prop, nullptr, "startdisp");
2198 prop, "rna_Sequence_frame_final_start_get", "rna_Sequence_start_frame_final_set", nullptr);
2199 RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
2202 prop,
2203 "Start Frame",
2204 "Start frame displayed in the sequence editor after offsets are applied, setting this is "
2205 "equivalent to moving the handle, not the actual start frame");
2206 /* overlap tests and calc_seq_disp */
2208 prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
2209
2210 prop = RNA_def_property(srna, "frame_final_end", PROP_INT, PROP_TIME);
2211 RNA_def_property_int_sdna(prop, nullptr, "enddisp");
2213 prop, "rna_Sequence_frame_final_end_get", "rna_Sequence_end_frame_final_set", nullptr);
2214 RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
2217 prop, "End Frame", "End frame displayed in the sequence editor after offsets are applied");
2218 /* overlap tests and calc_seq_disp */
2220 prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
2221
2222 prop = RNA_def_property(srna, "frame_offset_start", PROP_FLOAT, PROP_TIME);
2223 RNA_def_property_float_sdna(prop, nullptr, "startofs");
2224 // RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
2225 RNA_def_property_ui_text(prop, "Start Offset", "");
2226 RNA_def_property_ui_range(prop, MINFRAME, MAXFRAME, 100.0f, 0);
2228 nullptr,
2229 "rna_Sequence_frame_offset_start_set",
2230 "rna_Sequence_frame_offset_start_range");
2231 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update");
2232
2233 prop = RNA_def_property(srna, "frame_offset_end", PROP_FLOAT, PROP_TIME);
2234 RNA_def_property_float_sdna(prop, nullptr, "endofs");
2235 // RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
2236 RNA_def_property_ui_text(prop, "End Offset", "");
2237 RNA_def_property_ui_range(prop, MINFRAME, MAXFRAME, 100.0f, 0);
2239 prop, nullptr, "rna_Sequence_frame_offset_end_set", "rna_Sequence_frame_offset_end_range");
2240 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update");
2241
2242 prop = RNA_def_property(srna, "channel", PROP_INT, PROP_UNSIGNED);
2243 RNA_def_property_int_sdna(prop, nullptr, "machine");
2246 RNA_def_property_ui_text(prop, "Channel", "Y position of the sequence strip");
2248 prop, nullptr, "rna_Sequence_channel_set", nullptr); /* overlap test */
2250 prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
2251
2252 prop = RNA_def_property(srna, "use_linear_modifiers", PROP_BOOLEAN, PROP_NONE);
2255 "Use Linear Modifiers",
2256 "Calculate modifiers in linear space instead of sequencer's space");
2258 prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
2259
2260 /* blending */
2261
2262 prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
2263 RNA_def_property_enum_sdna(prop, nullptr, "blend_mode");
2266 prop, "Blending Mode", "Method for controlling how the strip combines with other strips");
2268 prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
2269
2270 prop = RNA_def_property(srna, "blend_alpha", PROP_FLOAT, PROP_FACTOR);
2271 RNA_def_property_range(prop, 0.0f, 1.0f);
2273 prop, "Blend Opacity", "Percentage of how much the strip's colors affect other strips");
2274 /* stupid 0-100 -> 0-1 */
2276 prop, "rna_Sequence_opacity_get", "rna_Sequence_opacity_set", nullptr);
2278 prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
2279
2280 prop = RNA_def_property(srna, "effect_fader", PROP_FLOAT, PROP_FACTOR);
2281 RNA_def_property_range(prop, 0.0f, 1.0f);
2282 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
2283 RNA_def_property_float_sdna(prop, nullptr, "effect_fader");
2284 RNA_def_property_ui_text(prop, "Effect Fader Position", "Custom fade value");
2286 prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
2287
2288 prop = RNA_def_property(srna, "use_default_fade", PROP_BOOLEAN, PROP_NONE);
2291 "Use Default Fade",
2292 "Fade effect using the built-in default (usually makes the transition "
2293 "as long as the effect strip)");
2295 prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
2296
2297 prop = RNA_def_property(srna, "color_tag", PROP_ENUM, PROP_NONE);
2298 RNA_def_property_enum_sdna(prop, nullptr, "color_tag");
2300 prop, "rna_Sequence_color_tag_get", "rna_Sequence_color_tag_set", nullptr);
2302 RNA_def_property_ui_text(prop, "Strip Color", "Color tag for a strip");
2304
2305 /* modifiers */
2306 prop = RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE);
2307 RNA_def_property_struct_type(prop, "SequenceModifier");
2308 RNA_def_property_ui_text(prop, "Modifiers", "Modifiers affecting this strip");
2309 rna_def_sequence_modifiers(brna, prop);
2310
2311 prop = RNA_def_property(srna, "use_cache_raw", PROP_BOOLEAN, PROP_NONE);
2312 RNA_def_property_boolean_sdna(prop, nullptr, "cache_flag", SEQ_CACHE_STORE_RAW);
2314 "Cache Raw",
2315 "Cache raw images read from disk, for faster tweaking of strip "
2316 "parameters at the cost of memory usage");
2317
2318 prop = RNA_def_property(srna, "use_cache_preprocessed", PROP_BOOLEAN, PROP_NONE);
2319 RNA_def_property_boolean_sdna(prop, nullptr, "cache_flag", SEQ_CACHE_STORE_PREPROCESSED);
2321 prop,
2322 "Cache Preprocessed",
2323 "Cache preprocessed images, for faster tweaking of effects at the cost of memory usage");
2324
2325 prop = RNA_def_property(srna, "use_cache_composite", PROP_BOOLEAN, PROP_NONE);
2326 RNA_def_property_boolean_sdna(prop, nullptr, "cache_flag", SEQ_CACHE_STORE_COMPOSITE);
2328 "Cache Composite",
2329 "Cache intermediate composited images, for faster tweaking of stacked "
2330 "strips at the cost of memory usage");
2331
2332 prop = RNA_def_property(srna, "override_cache_settings", PROP_BOOLEAN, PROP_NONE);
2333 RNA_def_property_boolean_sdna(prop, nullptr, "cache_flag", SEQ_CACHE_OVERRIDE);
2334 RNA_def_property_ui_text(prop, "Override Cache Settings", "Override global cache settings");
2335
2336 prop = RNA_def_property(srna, "show_retiming_keys", PROP_BOOLEAN, PROP_NONE);
2337 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_SHOW_RETIMING);
2338 RNA_def_property_ui_text(prop, "Show Retiming Keys", "Show retiming keys, so they can be moved");
2339
2341}
2342
2343static void rna_def_channel(BlenderRNA *brna)
2344{
2345 StructRNA *srna;
2346 PropertyRNA *prop;
2347
2348 srna = RNA_def_struct(brna, "SequenceTimelineChannel", nullptr);
2349 RNA_def_struct_sdna(srna, "SeqTimelineChannel");
2350 RNA_def_struct_path_func(srna, "rna_SeqTimelineChannel_path");
2351 RNA_def_struct_ui_text(srna, "Channel", "");
2352
2353 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
2355 RNA_def_property_ui_text(prop, "Name", "");
2356 RNA_def_struct_name_property(srna, prop);
2357 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_SequenceTimelineChannel_name_set");
2359
2360 prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
2361 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_CHANNEL_LOCK);
2362 RNA_def_property_ui_text(prop, "Lock channel", "");
2364
2365 prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
2366 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_CHANNEL_MUTE);
2367 RNA_def_property_ui_text(prop, "Mute channel", "");
2369 prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceTimelineChannel_mute_update");
2370}
2371
2372static void rna_def_editor(BlenderRNA *brna)
2373{
2374 StructRNA *srna;
2375 FunctionRNA *func;
2376 PropertyRNA *parm;
2377 PropertyRNA *prop;
2378
2379 static const EnumPropertyItem editing_storage_items[] = {
2380 {0, "PER_STRIP", 0, "Per Strip", "Store proxies using per strip settings"},
2382 "PROJECT",
2383 0,
2384 "Project",
2385 "Store proxies using project directory"},
2386 {0, nullptr, 0, nullptr, nullptr},
2387 };
2388 srna = RNA_def_struct(brna, "SequenceEditor", nullptr);
2389 RNA_def_struct_ui_text(srna, "Sequence Editor", "Sequence editing data for a Scene data-block");
2390 RNA_def_struct_path_func(srna, "rna_SequenceEditor_path");
2391 RNA_def_struct_ui_icon(srna, ICON_SEQUENCE);
2392 RNA_def_struct_sdna(srna, "Editing");
2393
2394 prop = RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE);
2395 RNA_def_property_collection_sdna(prop, nullptr, "seqbase", nullptr);
2396 RNA_def_property_struct_type(prop, "Sequence");
2397 RNA_def_property_ui_text(prop, "Sequences", "Top-level strips only");
2398 RNA_api_sequences(brna, prop, false);
2399
2400 prop = RNA_def_property(srna, "sequences_all", PROP_COLLECTION, PROP_NONE);
2401 RNA_def_property_collection_sdna(prop, nullptr, "seqbase", nullptr);
2402 RNA_def_property_struct_type(prop, "Sequence");
2404 prop, "All Sequences", "All strips, recursively including those inside metastrips");
2406 "rna_SequenceEditor_sequences_all_begin",
2407 "rna_SequenceEditor_sequences_all_next",
2408 "rna_SequenceEditor_sequences_all_end",
2409 "rna_SequenceEditor_sequences_all_get",
2410 nullptr,
2411 nullptr,
2412 "rna_SequenceEditor_sequences_all_lookup_string",
2413 nullptr);
2414
2415 prop = RNA_def_property(srna, "meta_stack", PROP_COLLECTION, PROP_NONE);
2416 RNA_def_property_collection_sdna(prop, nullptr, "metastack", nullptr);
2417 RNA_def_property_struct_type(prop, "Sequence");
2419 prop, "Meta Stack", "Meta strip stack, last is currently edited meta strip");
2421 nullptr,
2422 nullptr,
2423 nullptr,
2424 "rna_SequenceEditor_meta_stack_get",
2425 nullptr,
2426 nullptr,
2427 nullptr,
2428 nullptr);
2429
2430 prop = RNA_def_property(srna, "channels", PROP_COLLECTION, PROP_NONE);
2431 RNA_def_property_collection_sdna(prop, nullptr, "channels", nullptr);
2432 RNA_def_property_struct_type(prop, "SequenceTimelineChannel");
2433 RNA_def_property_ui_text(prop, "Channels", "");
2434
2435 prop = RNA_def_property(srna, "active_strip", PROP_POINTER, PROP_NONE);
2436 RNA_def_property_pointer_sdna(prop, nullptr, "act_seq");
2438 RNA_def_property_ui_text(prop, "Active Strip", "Sequencer's active strip");
2439
2440 prop = RNA_def_property(srna, "selected_retiming_keys", PROP_BOOLEAN, PROP_NONE);
2441 RNA_def_property_ui_text(prop, "Retiming Key Selection Status", "");
2442 RNA_def_property_boolean_funcs(prop, "rna_SequenceEditor_selected_retiming_key_get", nullptr);
2444
2445 prop = RNA_def_property(srna, "show_overlay_frame", PROP_BOOLEAN, PROP_NONE);
2446 RNA_def_property_boolean_sdna(prop, nullptr, "overlay_frame_flag", SEQ_EDIT_OVERLAY_FRAME_SHOW);
2448 prop, "Show Overlay", "Partial overlay on top of the sequencer with a frame offset");
2450
2451 prop = RNA_def_property(srna, "use_overlay_frame_lock", PROP_BOOLEAN, PROP_NONE);
2452 RNA_def_property_boolean_sdna(prop, nullptr, "overlay_frame_flag", SEQ_EDIT_OVERLAY_FRAME_ABS);
2453 RNA_def_property_ui_text(prop, "Overlay Lock", "");
2454 RNA_def_property_boolean_funcs(prop, nullptr, "rna_SequenceEditor_overlay_lock_set");
2456
2457 prop = RNA_def_property(srna, "show_missing_media", PROP_BOOLEAN, PROP_NONE);
2459 prop, nullptr, "show_missing_media_flag", SEQ_EDIT_SHOW_MISSING_MEDIA);
2461 prop, "Show Missing Media", "Render missing images/movies with a solid magenta color");
2462 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache");
2463
2464 /* access to fixed and relative frame */
2465 prop = RNA_def_property(srna, "overlay_frame", PROP_INT, PROP_NONE);
2466 RNA_def_property_ui_text(prop, "Overlay Offset", "Number of frames to offset");
2468 "rna_SequenceEditor_overlay_frame_get",
2469 "rna_SequenceEditor_overlay_frame_set",
2470 nullptr);
2472
2473 prop = RNA_def_property(srna, "proxy_storage", PROP_ENUM, PROP_NONE);
2474 RNA_def_property_enum_items(prop, editing_storage_items);
2475 RNA_def_property_ui_text(prop, "Proxy Storage", "How to store proxies for this project");
2477 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache");
2478
2479 prop = RNA_def_property(srna, "proxy_dir", PROP_STRING, PROP_DIRPATH);
2480 RNA_def_property_string_sdna(prop, nullptr, "proxy_dir");
2481 RNA_def_property_ui_text(prop, "Proxy Directory", "");
2482 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache");
2483
2484 /* cache flags */
2485
2486 prop = RNA_def_property(srna, "use_cache_raw", PROP_BOOLEAN, PROP_NONE);
2487 RNA_def_property_boolean_sdna(prop, nullptr, "cache_flag", SEQ_CACHE_STORE_RAW);
2489 "Cache Raw",
2490 "Cache raw images read from disk, for faster tweaking of strip "
2491 "parameters at the cost of memory usage");
2492
2493 prop = RNA_def_property(srna, "use_cache_preprocessed", PROP_BOOLEAN, PROP_NONE);
2494 RNA_def_property_boolean_sdna(prop, nullptr, "cache_flag", SEQ_CACHE_STORE_PREPROCESSED);
2496 prop,
2497 "Cache Preprocessed",
2498 "Cache preprocessed images, for faster tweaking of effects at the cost of memory usage");
2499
2500 prop = RNA_def_property(srna, "use_cache_composite", PROP_BOOLEAN, PROP_NONE);
2501 RNA_def_property_boolean_sdna(prop, nullptr, "cache_flag", SEQ_CACHE_STORE_COMPOSITE);
2503 "Cache Composite",
2504 "Cache intermediate composited images, for faster tweaking of stacked "
2505 "strips at the cost of memory usage");
2506
2507 prop = RNA_def_property(srna, "use_cache_final", PROP_BOOLEAN, PROP_NONE);
2508 RNA_def_property_boolean_sdna(prop, nullptr, "cache_flag", SEQ_CACHE_STORE_FINAL_OUT);
2509 RNA_def_property_ui_text(prop, "Cache Final", "Cache final image for each frame");
2510
2511 prop = RNA_def_property(srna, "use_prefetch", PROP_BOOLEAN, PROP_NONE);
2512 RNA_def_property_boolean_sdna(prop, nullptr, "cache_flag", SEQ_CACHE_PREFETCH_ENABLE);
2514 prop,
2515 "Prefetch Frames",
2516 "Render frames ahead of current frame in the background for faster playback");
2518
2519 /* functions */
2520
2521 func = RNA_def_function(srna, "display_stack", "rna_SequenceEditor_display_stack");
2523 RNA_def_function_ui_description(func, "Display sequences stack");
2524 parm = RNA_def_pointer(
2525 func, "meta_sequence", "Sequence", "Meta Sequence", "Meta to display its stack");
2527}
2528
2530{
2531 PropertyRNA *prop;
2532
2533 static const EnumPropertyItem alpha_mode_items[] = {
2535 "STRAIGHT",
2536 0,
2537 "Straight",
2538 "RGB channels in transparent pixels are unaffected by the alpha channel"},
2540 "PREMUL",
2541 0,
2542 "Premultiplied",
2543 "RGB channels in transparent pixels are multiplied by the alpha channel"},
2544 {0, nullptr, 0, nullptr, nullptr},
2545 };
2546
2547 prop = RNA_def_property(srna, "use_deinterlace", PROP_BOOLEAN, PROP_NONE);
2548 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_FILTERY);
2549 RNA_def_property_ui_text(prop, "Deinterlace", "Remove fields from video movies");
2550 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_reopen_files_update");
2551
2552 prop = RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE);
2553 RNA_def_property_enum_items(prop, alpha_mode_items);
2555 prop, "Alpha Mode", "Representation of alpha information in the RGBA pixels");
2556 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
2557
2558 prop = RNA_def_property(srna, "use_flip_x", PROP_BOOLEAN, PROP_NONE);
2559 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_FLIPX);
2560 RNA_def_property_ui_text(prop, "Flip X", "Flip on the X axis");
2561 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
2562
2563 prop = RNA_def_property(srna, "use_flip_y", PROP_BOOLEAN, PROP_NONE);
2564 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_FLIPY);
2565 RNA_def_property_ui_text(prop, "Flip Y", "Flip on the Y axis");
2566 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
2567
2568 prop = RNA_def_property(srna, "use_float", PROP_BOOLEAN, PROP_NONE);
2569 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_MAKE_FLOAT);
2570 RNA_def_property_ui_text(prop, "Convert Float", "Convert input to float data");
2571 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
2572
2573 prop = RNA_def_property(srna, "use_reverse_frames", PROP_BOOLEAN, PROP_NONE);
2574 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_REVERSE_FRAMES);
2575 RNA_def_property_ui_text(prop, "Reverse Frames", "Reverse frame order");
2577 prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
2578
2579 prop = RNA_def_property(srna, "color_multiply", PROP_FLOAT, PROP_UNSIGNED);
2580 RNA_def_property_float_sdna(prop, nullptr, "mul");
2581 RNA_def_property_range(prop, 0.0f, 20.0f);
2583 RNA_def_property_ui_text(prop, "Multiply Colors", "");
2585 prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
2586
2587 prop = RNA_def_property(srna, "multiply_alpha", PROP_BOOLEAN, PROP_NONE);
2588 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_MULTIPLY_ALPHA);
2589 RNA_def_property_ui_text(prop, "Multiply Alpha", "Multiply alpha along with color channels");
2590 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
2591
2592 prop = RNA_def_property(srna, "color_saturation", PROP_FLOAT, PROP_UNSIGNED);
2593 RNA_def_property_float_sdna(prop, nullptr, "sat");
2594 RNA_def_property_range(prop, 0.0f, 20.0f);
2595 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 3, 3);
2597 RNA_def_property_ui_text(prop, "Saturation", "Adjust the intensity of the input's color");
2599 prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
2600
2601 prop = RNA_def_property(srna, "strobe", PROP_FLOAT, PROP_NONE);
2602 RNA_def_property_range(prop, 1.0f, 30.0f);
2603 RNA_def_property_ui_text(prop, "Strobe", "Only display every nth frame");
2605 prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
2606
2607 prop = RNA_def_property(srna, "transform", PROP_POINTER, PROP_NONE);
2608 RNA_def_property_pointer_sdna(prop, nullptr, "strip->transform");
2609 RNA_def_property_ui_text(prop, "Transform", "");
2610
2611 prop = RNA_def_property(srna, "crop", PROP_POINTER, PROP_NONE);
2612 RNA_def_property_pointer_sdna(prop, nullptr, "strip->crop");
2613 RNA_def_property_ui_text(prop, "Crop", "");
2614}
2615
2616static void rna_def_proxy(StructRNA *srna)
2617{
2618 PropertyRNA *prop;
2619
2620 prop = RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE);
2621 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_USE_PROXY);
2623 prop, "Use Proxy / Timecode", "Use a preview proxy and/or time-code index for this strip");
2624 RNA_def_property_boolean_funcs(prop, nullptr, "rna_Sequence_use_proxy_set");
2626 prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
2627
2628 prop = RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
2629 RNA_def_property_pointer_sdna(prop, nullptr, "strip->proxy");
2630 RNA_def_property_ui_text(prop, "Proxy", "");
2631}
2632
2633static void rna_def_input(StructRNA *srna)
2634{
2635 PropertyRNA *prop;
2636
2637 prop = RNA_def_property(srna, "animation_offset_start", PROP_INT, PROP_UNSIGNED);
2638 RNA_def_property_int_sdna(prop, nullptr, "anim_startofs");
2641 nullptr,
2642 "rna_Sequence_anim_startofs_final_set",
2643 "rna_Sequence_anim_startofs_final_range"); /* overlap tests */
2644 RNA_def_property_ui_text(prop, "Animation Start Offset", "Animation start offset (trim start)");
2646 prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
2647
2648 prop = RNA_def_property(srna, "animation_offset_end", PROP_INT, PROP_UNSIGNED);
2649 RNA_def_property_int_sdna(prop, nullptr, "anim_endofs");
2652 nullptr,
2653 "rna_Sequence_anim_endofs_final_set",
2654 "rna_Sequence_anim_endofs_final_range"); /* overlap tests */
2655 RNA_def_property_ui_text(prop, "Animation End Offset", "Animation end offset (trim end)");
2657 prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
2658}
2659
2661{
2662 PropertyRNA *prop;
2663
2664 prop = RNA_def_property(srna, "input_count", PROP_INT, PROP_UNSIGNED);
2666 RNA_def_property_int_funcs(prop, "rna_Sequence_input_count_get", nullptr, nullptr);
2667
2668 if (count >= 1) {
2669 prop = RNA_def_property(srna, "input_1", PROP_POINTER, PROP_NONE);
2670 RNA_def_property_pointer_sdna(prop, nullptr, "seq1");
2672 RNA_def_property_pointer_funcs(prop, nullptr, "rna_Sequence_input_1_set", nullptr, nullptr);
2673 RNA_def_property_ui_text(prop, "Input 1", "First input for the effect strip");
2674 }
2675
2676 if (count >= 2) {
2677 prop = RNA_def_property(srna, "input_2", PROP_POINTER, PROP_NONE);
2678 RNA_def_property_pointer_sdna(prop, nullptr, "seq2");
2680 RNA_def_property_pointer_funcs(prop, nullptr, "rna_Sequence_input_2_set", nullptr, nullptr);
2681 RNA_def_property_ui_text(prop, "Input 2", "Second input for the effect strip");
2682 }
2683}
2684
2686{
2687 PropertyRNA *prop;
2688
2689 prop = RNA_def_property(srna, "colorspace_settings", PROP_POINTER, PROP_NONE);
2690 RNA_def_property_pointer_sdna(prop, nullptr, "strip->colorspace_settings");
2691 RNA_def_property_struct_type(prop, "ColorManagedInputColorspaceSettings");
2692 RNA_def_property_ui_text(prop, "Color Space Settings", "Input color space settings");
2693}
2694
2696{
2697 PropertyRNA *prop;
2698
2699 prop = RNA_def_property(srna, "fps", PROP_FLOAT, PROP_NONE);
2700 RNA_def_property_ui_text(prop, "FPS", "Frames per second");
2702 RNA_def_property_float_funcs(prop, "rna_Sequence_fps_get", nullptr, nullptr);
2703}
2704
2705static void rna_def_image(BlenderRNA *brna)
2706{
2707 StructRNA *srna;
2708 PropertyRNA *prop;
2709
2710 srna = RNA_def_struct(brna, "ImageSequence", "Sequence");
2711 RNA_def_struct_ui_text(srna, "Image Sequence", "Sequence strip to load one or more images");
2712 RNA_def_struct_sdna(srna, "Sequence");
2713
2714 prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
2715 RNA_def_property_string_sdna(prop, nullptr, "strip->dirpath");
2716 RNA_def_property_ui_text(prop, "Directory", "");
2717 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
2718
2719 prop = RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE);
2720 RNA_def_property_collection_sdna(prop, nullptr, "strip->stripdata", nullptr);
2721 RNA_def_property_struct_type(prop, "SequenceElement");
2722 RNA_def_property_ui_text(prop, "Elements", "");
2724 "rna_Sequence_elements_begin",
2725 "rna_iterator_array_next",
2726 "rna_iterator_array_end",
2727 "rna_iterator_array_get",
2728 "rna_SequenceEditor_elements_length",
2729 nullptr,
2730 nullptr,
2731 nullptr);
2732 RNA_api_sequence_elements(brna, prop);
2733
2734 /* multiview */
2735 prop = RNA_def_property(srna, "use_multiview", PROP_BOOLEAN, PROP_NONE);
2736 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_USE_VIEWS);
2737 RNA_def_property_ui_text(prop, "Use Multi-View", "Use Multiple Views (when available)");
2738 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_views_format_update");
2739
2740 prop = RNA_def_property(srna, "views_format", PROP_ENUM, PROP_NONE);
2741 RNA_def_property_enum_sdna(prop, nullptr, "views_format");
2743 RNA_def_property_ui_text(prop, "Views Format", "Mode to load image views");
2744 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Sequence_views_format_update");
2745
2746 prop = RNA_def_property(srna, "stereo_3d_format", PROP_POINTER, PROP_NONE);
2747 RNA_def_property_pointer_sdna(prop, nullptr, "stereo3d_format");
2749 RNA_def_property_struct_type(prop, "Stereo3dFormat");
2750 RNA_def_property_ui_text(prop, "Stereo 3D Format", "Settings for stereo 3D");
2751
2753 rna_def_proxy(srna);
2754 rna_def_input(srna);
2756}
2757
2758static void rna_def_meta(BlenderRNA *brna)
2759{
2760 StructRNA *srna;
2761 FunctionRNA *func;
2762 PropertyRNA *prop;
2763
2764 srna = RNA_def_struct(brna, "MetaSequence", "Sequence");
2766 srna, "Meta Sequence", "Sequence strip to group other strips as a single sequence strip");
2767 RNA_def_struct_sdna(srna, "Sequence");
2768
2769 prop = RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE);
2770 RNA_def_property_collection_sdna(prop, nullptr, "seqbase", nullptr);
2771 RNA_def_property_struct_type(prop, "Sequence");
2772 RNA_def_property_ui_text(prop, "Sequences", "Sequences nested in meta strip");
2773 RNA_api_sequences(brna, prop, true);
2774
2775 prop = RNA_def_property(srna, "channels", PROP_COLLECTION, PROP_NONE);
2776 RNA_def_property_collection_sdna(prop, nullptr, "channels", nullptr);
2777 RNA_def_property_struct_type(prop, "SequenceTimelineChannel");
2778 RNA_def_property_ui_text(prop, "Channels", "");
2779
2780 func = RNA_def_function(srna, "separate", "rna_Sequence_separate");
2782 RNA_def_function_ui_description(func, "Separate meta");
2783
2785 rna_def_proxy(srna);
2786 rna_def_input(srna);
2787}
2788
2790{
2791 PropertyRNA *prop;
2792
2793 prop = RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
2794 RNA_def_property_float_sdna(prop, nullptr, "volume");
2795 RNA_def_property_range(prop, 0.0f, 100.0f);
2796 RNA_def_property_ui_text(prop, "Volume", "Playback volume of the sound");
2798 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_audio_update");
2799}
2800
2801static void rna_def_scene(BlenderRNA *brna)
2802{
2803 StructRNA *srna;
2804 PropertyRNA *prop;
2805
2806 static const EnumPropertyItem scene_input_items[] = {
2807 {0, "CAMERA", ICON_VIEW3D, "Camera", "Use the Scene's 3D camera as input"},
2809 "SEQUENCER",
2810 ICON_SEQUENCE,
2811 "Sequencer",
2812 "Use the Scene's Sequencer timeline as input"},
2813 {0, nullptr, 0, nullptr, nullptr},
2814 };
2815
2816 srna = RNA_def_struct(brna, "SceneSequence", "Sequence");
2818 srna, "Scene Sequence", "Sequence strip using the rendered image of a scene");
2819 RNA_def_struct_sdna(srna, "Sequence");
2820
2821 prop = RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
2823 RNA_def_property_ui_text(prop, "Scene", "Scene that this sequence uses");
2824 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_scene_switch_update");
2825
2826 prop = RNA_def_property(srna, "scene_camera", PROP_POINTER, PROP_NONE);
2828 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_Camera_object_poll");
2829 RNA_def_property_ui_text(prop, "Camera Override", "Override the scene's active camera");
2830 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
2831
2832 prop = RNA_def_property(srna, "scene_input", PROP_ENUM, PROP_NONE);
2833 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
2834 RNA_def_property_enum_items(prop, scene_input_items);
2835 RNA_def_property_ui_text(prop, "Input", "Input type to use for the Scene strip");
2836 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_use_sequence");
2837
2838 prop = RNA_def_property(srna, "use_annotations", PROP_BOOLEAN, PROP_NONE);
2840 RNA_def_property_ui_text(prop, "Use Annotations", "Show Annotations in OpenGL previews");
2841 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
2842
2845 rna_def_proxy(srna);
2846 rna_def_input(srna);
2847 rna_def_movie_types(srna);
2848}
2849
2850static void rna_def_movie(BlenderRNA *brna)
2851{
2852 StructRNA *srna;
2853 PropertyRNA *prop;
2854 FunctionRNA *func;
2855 PropertyRNA *parm;
2856
2857 srna = RNA_def_struct(brna, "MovieSequence", "Sequence");
2858 RNA_def_struct_ui_text(srna, "Movie Sequence", "Sequence strip to load a video");
2859 RNA_def_struct_sdna(srna, "Sequence");
2860
2861 prop = RNA_def_property(srna, "stream_index", PROP_INT, PROP_NONE);
2862 RNA_def_property_int_sdna(prop, nullptr, "streamindex");
2863 RNA_def_property_range(prop, 0, 20);
2865 prop,
2866 "Stream Index",
2867 "For files with several movie streams, use the stream with the given index");
2868 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_reopen_files_update");
2869
2870 prop = RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE);
2871 RNA_def_property_collection_sdna(prop, nullptr, "strip->stripdata", nullptr);
2872 RNA_def_property_struct_type(prop, "SequenceElement");
2873 RNA_def_property_ui_text(prop, "Elements", "");
2875 "rna_Sequence_elements_begin",
2876 "rna_iterator_array_next",
2877 "rna_iterator_array_end",
2878 "rna_iterator_array_get",
2879 "rna_SequenceEditor_elements_length",
2880 nullptr,
2881 nullptr,
2882 nullptr);
2883
2884 prop = RNA_def_property(srna, "retiming_keys", PROP_COLLECTION, PROP_NONE);
2885 RNA_def_property_collection_sdna(prop, nullptr, "retiming_keys", nullptr);
2886 RNA_def_property_struct_type(prop, "RetimingKey");
2887 RNA_def_property_ui_text(prop, "Retiming Keys", "");
2889 "rna_SequenceEditor_retiming_keys_begin",
2890 "rna_iterator_array_next",
2891 "rna_iterator_array_end",
2892 "rna_iterator_array_get",
2893 "rna_Sequence_retiming_keys_length",
2894 nullptr,
2895 nullptr,
2896 nullptr);
2898
2899 prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
2900 RNA_def_property_ui_text(prop, "File", "");
2902 "rna_Sequence_filepath_get",
2903 "rna_Sequence_filepath_length",
2904 "rna_Sequence_filepath_set");
2905 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_filepath_update");
2906
2907 func = RNA_def_function(srna, "reload_if_needed", "rna_MovieSequence_reload_if_needed");
2909 /* return type */
2910 parm = RNA_def_boolean(func,
2911 "can_produce_frames",
2912 false,
2913 "True if the strip can produce frames, False otherwise",
2914 "");
2915 RNA_def_function_return(func, parm);
2916
2917 /* metadata */
2918 func = RNA_def_function(srna, "metadata", "rna_MovieSequence_metadata_get");
2920 RNA_def_function_ui_description(func, "Retrieve metadata of the movie file");
2921 /* return type */
2922 parm = RNA_def_pointer(
2923 func, "metadata", "IDPropertyWrapPtr", "", "Dict-like object containing the metadata");
2925 RNA_def_function_return(func, parm);
2926
2927 /* multiview */
2928 prop = RNA_def_property(srna, "use_multiview", PROP_BOOLEAN, PROP_NONE);
2929 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_USE_VIEWS);
2930 RNA_def_property_ui_text(prop, "Use Multi-View", "Use Multiple Views (when available)");
2931 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_views_format_update");
2932
2933 prop = RNA_def_property(srna, "views_format", PROP_ENUM, PROP_NONE);
2934 RNA_def_property_enum_sdna(prop, nullptr, "views_format");
2936 RNA_def_property_ui_text(prop, "Views Format", "Mode to load movie views");
2937 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Sequence_views_format_update");
2938
2939 prop = RNA_def_property(srna, "stereo_3d_format", PROP_POINTER, PROP_NONE);
2940 RNA_def_property_pointer_sdna(prop, nullptr, "stereo3d_format");
2942 RNA_def_property_struct_type(prop, "Stereo3dFormat");
2943 RNA_def_property_ui_text(prop, "Stereo 3D Format", "Settings for stereo 3D");
2944
2946 rna_def_proxy(srna);
2947 rna_def_input(srna);
2949 rna_def_movie_types(srna);
2950}
2951
2953{
2954 StructRNA *srna;
2955 PropertyRNA *prop;
2956
2957 srna = RNA_def_struct(brna, "MovieClipSequence", "Sequence");
2959 srna, "MovieClip Sequence", "Sequence strip to load a video from the clip editor");
2960 RNA_def_struct_sdna(srna, "Sequence");
2961
2962 prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
2964 RNA_def_property_ui_text(prop, "Movie Clip", "Movie clip that this sequence uses");
2965 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
2966
2967 prop = RNA_def_property(srna, "undistort", PROP_BOOLEAN, PROP_NONE);
2969 RNA_def_property_ui_text(prop, "Undistort Clip", "Use the undistorted version of the clip");
2970 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
2971
2972 prop = RNA_def_property(srna, "stabilize2d", PROP_BOOLEAN, PROP_NONE);
2974 RNA_def_property_ui_text(prop, "Stabilize 2D Clip", "Use the 2D stabilized version of the clip");
2975 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
2976
2978 rna_def_input(srna);
2979 rna_def_movie_types(srna);
2980}
2981
2982static void rna_def_mask(BlenderRNA *brna)
2983{
2984 StructRNA *srna;
2985 PropertyRNA *prop;
2986
2987 srna = RNA_def_struct(brna, "MaskSequence", "Sequence");
2988 RNA_def_struct_ui_text(srna, "Mask Sequence", "Sequence strip to load a video from a mask");
2989 RNA_def_struct_sdna(srna, "Sequence");
2990
2991 prop = RNA_def_property(srna, "mask", PROP_POINTER, PROP_NONE);
2993 RNA_def_property_ui_text(prop, "Mask", "Mask that this sequence uses");
2994 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
2995
2997 rna_def_input(srna);
2998}
2999
3000static void rna_def_sound(BlenderRNA *brna)
3001{
3002 StructRNA *srna;
3003 PropertyRNA *prop;
3004
3005 srna = RNA_def_struct(brna, "SoundSequence", "Sequence");
3007 "Sound Sequence",
3008 "Sequence strip defining a sound to be played over a period of time");
3009 RNA_def_struct_sdna(srna, "Sequence");
3010
3011 prop = RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE);
3013 RNA_def_property_struct_type(prop, "Sound");
3014 RNA_def_property_ui_text(prop, "Sound", "Sound data-block used by this sequence");
3015 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_sound_update");
3016
3018
3019 prop = RNA_def_property(srna, "pan", PROP_FLOAT, PROP_NONE);
3020 RNA_def_property_float_sdna(prop, nullptr, "pan");
3022 RNA_def_property_ui_range(prop, -2, 2, 1, 2);
3023 RNA_def_property_ui_text(prop, "Pan", "Playback panning of the sound (only for Mono sources)");
3025 RNA_def_property_float_funcs(prop, nullptr, nullptr, "rna_Sequence_pan_range");
3026 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_audio_update");
3027
3028 prop = RNA_def_property(srna, "sound_offset", PROP_FLOAT, PROP_NONE);
3029 RNA_def_property_float_sdna(prop, nullptr, "sound_offset");
3032 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* not meant to be animated */
3034 prop,
3035 "Sound Offset",
3036 "Offset of the sound from the beginning of the strip, expressed in seconds");
3038 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_audio_update");
3039
3040 prop = RNA_def_property(srna, "show_waveform", PROP_BOOLEAN, PROP_NONE);
3043 prop, "Display Waveform", "Display the audio waveform inside the strip");
3045
3046 rna_def_input(srna);
3047}
3048
3049static void rna_def_effect(BlenderRNA *brna)
3050{
3051 StructRNA *srna;
3052
3053 srna = RNA_def_struct(brna, "EffectSequence", "Sequence");
3055 srna,
3056 "Effect Sequence",
3057 "Sequence strip applying an effect on the images created by other strips");
3058 RNA_def_struct_sdna(srna, "Sequence");
3059
3061 rna_def_proxy(srna);
3062}
3063
3064static void rna_def_multicam(StructRNA *srna)
3065{
3066 PropertyRNA *prop;
3067
3068 prop = RNA_def_property(srna, "multicam_source", PROP_INT, PROP_UNSIGNED);
3069 RNA_def_property_int_sdna(prop, nullptr, "multicam_source");
3071 RNA_def_property_ui_text(prop, "Multicam Source Channel", "");
3072 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3073
3074 rna_def_input(srna);
3075}
3076
3077static void rna_def_wipe(StructRNA *srna)
3078{
3079 PropertyRNA *prop;
3080
3081 static const EnumPropertyItem wipe_type_items[] = {
3082 {DO_SINGLE_WIPE, "SINGLE", 0, "Single", ""},
3083 {DO_DOUBLE_WIPE, "DOUBLE", 0, "Double", ""},
3084 /* not used yet {DO_BOX_WIPE, "BOX", 0, "Box", ""}, */
3085 /* not used yet {DO_CROSS_WIPE, "CROSS", 0, "Cross", ""}, */
3086 {DO_IRIS_WIPE, "IRIS", 0, "Iris", ""},
3087 {DO_CLOCK_WIPE, "CLOCK", 0, "Clock", ""},
3088 {0, nullptr, 0, nullptr, nullptr},
3089 };
3090
3091 static const EnumPropertyItem wipe_direction_items[] = {
3092 {0, "OUT", 0, "Out", ""},
3093 {1, "IN", 0, "In", ""},
3094 {0, nullptr, 0, nullptr, nullptr},
3095 };
3096
3097 RNA_def_struct_sdna_from(srna, "WipeVars", "effectdata");
3098
3099 prop = RNA_def_property(srna, "blur_width", PROP_FLOAT, PROP_FACTOR);
3100 RNA_def_property_float_sdna(prop, nullptr, "edgeWidth");
3101 RNA_def_property_range(prop, 0.0f, 1.0f);
3103 prop,
3104 "Blur Width",
3105 "Width of the blur for the transition, in percentage relative to the image size");
3106 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3107
3108 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
3109 RNA_def_property_range(prop, DEG2RADF(-90.0f), DEG2RADF(90.0f));
3110 RNA_def_property_ui_text(prop, "Angle", "Angle of the transition");
3111 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3112
3113 prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
3114 RNA_def_property_enum_sdna(prop, nullptr, "forward");
3115 RNA_def_property_enum_items(prop, wipe_direction_items);
3116 RNA_def_property_ui_text(prop, "Direction", "Whether to fade in or out");
3118 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3119
3120 prop = RNA_def_property(srna, "transition_type", PROP_ENUM, PROP_NONE);
3121 RNA_def_property_enum_sdna(prop, nullptr, "wipetype");
3122 RNA_def_property_enum_items(prop, wipe_type_items);
3124 RNA_def_property_ui_text(prop, "Transition Type", "");
3125 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3126}
3127
3128static void rna_def_glow(StructRNA *srna)
3129{
3130 PropertyRNA *prop;
3131
3132 RNA_def_struct_sdna_from(srna, "GlowVars", "effectdata");
3133
3134 prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_FACTOR);
3135 RNA_def_property_float_sdna(prop, nullptr, "fMini");
3136 RNA_def_property_range(prop, 0.0f, 1.0f);
3137 RNA_def_property_ui_text(prop, "Threshold", "Minimum intensity to trigger a glow");
3138 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3139
3140 prop = RNA_def_property(srna, "clamp", PROP_FLOAT, PROP_FACTOR);
3141 RNA_def_property_float_sdna(prop, nullptr, "fClamp");
3142 RNA_def_property_range(prop, 0.0f, 1.0f);
3143 RNA_def_property_ui_text(prop, "Clamp", "Brightness limit of intensity");
3144 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3145
3146 prop = RNA_def_property(srna, "boost_factor", PROP_FLOAT, PROP_NONE);
3147 RNA_def_property_float_sdna(prop, nullptr, "fBoost");
3148 RNA_def_property_range(prop, 0.0f, 10.0f);
3149 RNA_def_property_ui_text(prop, "Boost Factor", "Brightness multiplier");
3150 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3151
3152 prop = RNA_def_property(srna, "blur_radius", PROP_FLOAT, PROP_NONE);
3153 RNA_def_property_float_sdna(prop, nullptr, "dDist");
3154 RNA_def_property_range(prop, 0.5f, 20.0f);
3155 RNA_def_property_ui_text(prop, "Blur Distance", "Radius of glow effect");
3156 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3157
3158 prop = RNA_def_property(srna, "quality", PROP_INT, PROP_NONE);
3159 RNA_def_property_int_sdna(prop, nullptr, "dQuality");
3160 RNA_def_property_range(prop, 1, 5);
3161 RNA_def_property_ui_text(prop, "Quality", "Accuracy of the blur effect");
3162 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3163
3164 prop = RNA_def_property(srna, "use_only_boost", PROP_BOOLEAN, PROP_NONE);
3165 RNA_def_property_boolean_sdna(prop, nullptr, "bNoComp", 0);
3166 RNA_def_property_ui_text(prop, "Only Boost", "Show the glow buffer only");
3167 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3168}
3169
3171{
3172 PropertyRNA *prop;
3173
3174 static const EnumPropertyItem interpolation_items[] = {
3175 {0, "NONE", 0, "None", "No interpolation"},
3176 {1, "BILINEAR", 0, "Bilinear", "Bilinear interpolation"},
3177 {2, "BICUBIC", 0, "Bicubic", "Bicubic interpolation"},
3178 {0, nullptr, 0, nullptr, nullptr},
3179 };
3180
3181 static const EnumPropertyItem translation_unit_items[] = {
3182 {0, "PIXELS", 0, "Pixels", ""},
3183 {1, "PERCENT", 0, "Percent", ""},
3184 {0, nullptr, 0, nullptr, nullptr},
3185 };
3186
3187 RNA_def_struct_sdna_from(srna, "TransformVars", "effectdata");
3188
3189 prop = RNA_def_property(srna, "scale_start_x", PROP_FLOAT, PROP_UNSIGNED);
3190 RNA_def_property_float_sdna(prop, nullptr, "ScalexIni");
3191 RNA_def_property_ui_text(prop, "Scale X", "Amount to scale the input in the X axis");
3192 RNA_def_property_ui_range(prop, 0, 10, 3, 6);
3193 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3194
3195 prop = RNA_def_property(srna, "scale_start_y", PROP_FLOAT, PROP_UNSIGNED);
3196 RNA_def_property_float_sdna(prop, nullptr, "ScaleyIni");
3197 RNA_def_property_ui_text(prop, "Scale Y", "Amount to scale the input in the Y axis");
3198 RNA_def_property_ui_range(prop, 0, 10, 3, 6);
3199 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3200
3201 prop = RNA_def_property(srna, "use_uniform_scale", PROP_BOOLEAN, PROP_NONE);
3202 RNA_def_property_boolean_sdna(prop, nullptr, "uniform_scale", 0);
3203 RNA_def_property_ui_text(prop, "Uniform Scale", "Scale uniformly, preserving aspect ratio");
3204 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3205
3206 prop = RNA_def_property(srna, "translate_start_x", PROP_FLOAT, PROP_NONE);
3207 RNA_def_property_float_sdna(prop, nullptr, "xIni");
3208 RNA_def_property_ui_text(prop, "Translate X", "Amount to move the input on the X axis");
3209 RNA_def_property_ui_range(prop, -4000.0f, 4000.0f, 3, 6);
3210 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3211
3212 prop = RNA_def_property(srna, "translate_start_y", PROP_FLOAT, PROP_NONE);
3213 RNA_def_property_float_sdna(prop, nullptr, "yIni");
3214 RNA_def_property_ui_text(prop, "Translate Y", "Amount to move the input on the Y axis");
3215 RNA_def_property_ui_range(prop, -4000.0f, 4000.0f, 3, 6);
3216 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3217
3218 prop = RNA_def_property(srna, "rotation_start", PROP_FLOAT, PROP_NONE);
3219 RNA_def_property_float_sdna(prop, nullptr, "rotIni");
3220 RNA_def_property_ui_text(prop, "Rotation", "Degrees to rotate the input");
3221 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3222
3223 prop = RNA_def_property(srna, "translation_unit", PROP_ENUM, PROP_NONE);
3224 RNA_def_property_enum_sdna(prop, nullptr, "percent");
3225 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* not meant to be animated */
3226 RNA_def_property_enum_items(prop, translation_unit_items);
3227 RNA_def_property_ui_text(prop, "Translation Unit", "Unit of measure to translate the input");
3228 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3229
3230 prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
3231 RNA_def_property_enum_items(prop, interpolation_items);
3232 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* not meant to be animated */
3234 prop, "Interpolation", "Method to determine how missing pixels are created");
3235 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3236}
3237
3239{
3240 PropertyRNA *prop;
3241
3242 RNA_def_struct_sdna_from(srna, "SolidColorVars", "effectdata");
3243
3244 prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
3245 RNA_def_property_float_sdna(prop, nullptr, "col");
3246 RNA_def_property_ui_text(prop, "Color", "Effect Strip color");
3247 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3248}
3249
3251{
3252 PropertyRNA *prop;
3253
3254 RNA_def_struct_sdna_from(srna, "SpeedControlVars", "effectdata");
3255
3256 static const EnumPropertyItem speed_control_items[] = {
3258 "STRETCH",
3259 0,
3260 "Stretch",
3261 "Adjust input playback speed, so its duration fits strip length"},
3262 {SEQ_SPEED_MULTIPLY, "MULTIPLY", 0, "Multiply", "Multiply with the speed factor"},
3264 "FRAME_NUMBER",
3265 0,
3266 "Frame Number",
3267 "Frame number of the input strip"},
3268 {SEQ_SPEED_LENGTH, "LENGTH", 0, "Length", "Percentage of the input strip length"},
3269 {0, nullptr, 0, nullptr, nullptr},
3270 };
3271
3272 prop = RNA_def_property(srna, "speed_control", PROP_ENUM, PROP_NONE);
3273 RNA_def_property_enum_sdna(prop, nullptr, "speed_control_type");
3274 RNA_def_property_enum_items(prop, speed_control_items);
3276 RNA_def_property_ui_text(prop, "Speed Control", "Speed control method");
3277 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3278
3279 prop = RNA_def_property(srna, "speed_factor", PROP_FLOAT, PROP_NONE);
3280 RNA_def_property_float_sdna(prop, nullptr, "speed_fader");
3282 prop,
3283 "Multiply Factor",
3284 "Multiply the current speed of the sequence with this number or remap current frame "
3285 "to this frame");
3286 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3287
3288 prop = RNA_def_property(srna, "speed_frame_number", PROP_FLOAT, PROP_NONE);
3289 RNA_def_property_float_sdna(prop, nullptr, "speed_fader_frame_number");
3290 RNA_def_property_ui_text(prop, "Frame Number", "Frame number of input strip");
3291 RNA_def_property_ui_range(prop, 0.0, MAXFRAME, 1.0, -1);
3292 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3293
3294 prop = RNA_def_property(srna, "speed_length", PROP_FLOAT, PROP_PERCENTAGE);
3295 RNA_def_property_float_sdna(prop, nullptr, "speed_fader_length");
3296 RNA_def_property_ui_text(prop, "Length", "Percentage of input strip length");
3297 RNA_def_property_ui_range(prop, 0.0, 100.0, 1, -1);
3298 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3299
3300 prop = RNA_def_property(srna, "use_frame_interpolate", PROP_BOOLEAN, PROP_NONE);
3303 prop, "Frame Interpolation", "Do crossfade blending between current and next frame");
3304 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3305}
3306
3308{
3309 PropertyRNA *prop;
3310
3311 RNA_def_struct_sdna_from(srna, "GaussianBlurVars", "effectdata");
3312 prop = RNA_def_property(srna, "size_x", PROP_FLOAT, PROP_UNSIGNED);
3313 RNA_def_property_ui_text(prop, "Size X", "Size of the blur along X axis");
3314 RNA_def_property_ui_range(prop, 0.0f, FLT_MAX, 1, -1);
3315 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3316
3317 prop = RNA_def_property(srna, "size_y", PROP_FLOAT, PROP_UNSIGNED);
3318 RNA_def_property_ui_text(prop, "Size Y", "Size of the blur along Y axis");
3319 RNA_def_property_ui_range(prop, 0.0f, FLT_MAX, 1, -1);
3320 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3321}
3322
3323static void rna_def_text(StructRNA *srna)
3324{
3325 /* Avoid text icons because they imply this aligns within a frame, see: #71082 */
3326 static const EnumPropertyItem text_align_x_items[] = {
3327 {SEQ_TEXT_ALIGN_X_LEFT, "LEFT", ICON_ANCHOR_LEFT, "Left", ""},
3328 {SEQ_TEXT_ALIGN_X_CENTER, "CENTER", ICON_ANCHOR_CENTER, "Center", ""},
3329 {SEQ_TEXT_ALIGN_X_RIGHT, "RIGHT", ICON_ANCHOR_RIGHT, "Right", ""},
3330 {0, nullptr, 0, nullptr, nullptr},
3331 };
3332 static const EnumPropertyItem text_align_y_items[] = {
3333 {SEQ_TEXT_ALIGN_Y_TOP, "TOP", ICON_ANCHOR_TOP, "Top", ""},
3334 {SEQ_TEXT_ALIGN_Y_CENTER, "CENTER", ICON_ANCHOR_CENTER, "Center", ""},
3335 {SEQ_TEXT_ALIGN_Y_BOTTOM, "BOTTOM", ICON_ANCHOR_BOTTOM, "Bottom", ""},
3336 {0, nullptr, 0, nullptr, nullptr},
3337 };
3338
3339 PropertyRNA *prop;
3340
3341 RNA_def_struct_sdna_from(srna, "TextVars", "effectdata");
3342
3343 prop = RNA_def_property(srna, "font", PROP_POINTER, PROP_NONE);
3344 RNA_def_property_pointer_sdna(prop, nullptr, "text_font");
3345 RNA_def_property_ui_icon(prop, ICON_FILE_FONT, false);
3347 prop, "Font", "Font of the text. Falls back to the UI font by default.");
3349 RNA_def_property_pointer_funcs(prop, nullptr, "rna_Sequence_text_font_set", nullptr, nullptr);
3350 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3351
3352 prop = RNA_def_property(srna, "font_size", PROP_FLOAT, PROP_UNSIGNED);
3353 RNA_def_property_float_sdna(prop, nullptr, "text_size");
3354 RNA_def_property_ui_text(prop, "Size", "Size of the text");
3355 RNA_def_property_range(prop, 0.0, 2000);
3356 RNA_def_property_ui_range(prop, 0.0f, 2000, 10.0f, 1);
3357 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3358
3359 prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
3360 RNA_def_property_float_sdna(prop, nullptr, "color");
3361 RNA_def_property_ui_text(prop, "Color", "Text color");
3362 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3363
3364 prop = RNA_def_property(srna, "shadow_color", PROP_FLOAT, PROP_COLOR_GAMMA);
3365 RNA_def_property_float_sdna(prop, nullptr, "shadow_color");
3366 RNA_def_property_ui_text(prop, "Shadow Color", "");
3367 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3368
3369 prop = RNA_def_property(srna, "shadow_angle", PROP_FLOAT, PROP_ANGLE);
3370 RNA_def_property_float_sdna(prop, nullptr, "shadow_angle");
3371 RNA_def_property_range(prop, 0, M_PI * 2);
3372 RNA_def_property_ui_text(prop, "Shadow Angle", "");
3374 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3375
3376 prop = RNA_def_property(srna, "shadow_offset", PROP_FLOAT, PROP_UNSIGNED);
3377 RNA_def_property_float_sdna(prop, nullptr, "shadow_offset");
3378 RNA_def_property_ui_text(prop, "Shadow Offset", "");
3379 RNA_def_property_float_default(prop, 0.04f);
3380 RNA_def_property_range(prop, 0.0f, 1.0f);
3381 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1.0f, 2);
3382 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3383
3384 prop = RNA_def_property(srna, "shadow_blur", PROP_FLOAT, PROP_UNSIGNED);
3385 RNA_def_property_float_sdna(prop, nullptr, "shadow_blur");
3386 RNA_def_property_ui_text(prop, "Shadow Blur", "");
3388 RNA_def_property_range(prop, 0.0f, 1.0f);
3389 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1.0f, 2);
3390 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3391
3392 prop = RNA_def_property(srna, "outline_color", PROP_FLOAT, PROP_COLOR_GAMMA);
3393 RNA_def_property_float_sdna(prop, nullptr, "outline_color");
3394 RNA_def_property_ui_text(prop, "Outline Color", "");
3395 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3396
3397 prop = RNA_def_property(srna, "outline_width", PROP_FLOAT, PROP_UNSIGNED);
3398 RNA_def_property_float_sdna(prop, nullptr, "outline_width");
3399 RNA_def_property_ui_text(prop, "Outline Width", "");
3400 RNA_def_property_float_default(prop, 0.05f);
3401 RNA_def_property_range(prop, 0.0f, 1.0f);
3402 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1.0f, 2);
3403 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3404
3405 prop = RNA_def_property(srna, "box_color", PROP_FLOAT, PROP_COLOR_GAMMA);
3406 RNA_def_property_float_sdna(prop, nullptr, "box_color");
3407 RNA_def_property_ui_text(prop, "Box Color", "");
3408 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3409
3410 prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ);
3411 RNA_def_property_float_sdna(prop, nullptr, "loc");
3412 RNA_def_property_ui_text(prop, "Location", "Location of the text");
3414 RNA_def_property_ui_range(prop, -10.0, 10.0, 1, -1);
3415 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3416
3417 prop = RNA_def_property(srna, "wrap_width", PROP_FLOAT, PROP_NONE);
3418 RNA_def_property_float_sdna(prop, nullptr, "wrap_width");
3419 RNA_def_property_ui_text(prop, "Wrap Width", "Word wrap width as factor, zero disables");
3421 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, -1);
3422 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3423
3424 prop = RNA_def_property(srna, "box_margin", PROP_FLOAT, PROP_NONE);
3425 RNA_def_property_float_sdna(prop, nullptr, "box_margin");
3426 RNA_def_property_ui_text(prop, "Box Margin", "Box margin as factor of image width");
3427 RNA_def_property_range(prop, 0, 1.0);
3428 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, -1);
3429 RNA_def_property_float_default(prop, 0.01f);
3430 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3431
3432 prop = RNA_def_property(srna, "align_x", PROP_ENUM, PROP_NONE);
3433 RNA_def_property_enum_sdna(prop, nullptr, "align");
3434 RNA_def_property_enum_items(prop, text_align_x_items);
3436 prop, "Align X", "Align the text along the X axis, relative to the text bounds");
3437 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3438
3439 prop = RNA_def_property(srna, "align_y", PROP_ENUM, PROP_NONE);
3440 RNA_def_property_enum_sdna(prop, nullptr, "align_y");
3441 RNA_def_property_enum_items(prop, text_align_y_items);
3443 prop, "Align Y", "Align the text along the Y axis, relative to the text bounds");
3444 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3445
3446 prop = RNA_def_property(srna, "text", PROP_STRING, PROP_NONE);
3447 RNA_def_property_ui_text(prop, "Text", "Text that will be displayed");
3449 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3450
3451 prop = RNA_def_property(srna, "use_shadow", PROP_BOOLEAN, PROP_NONE);
3452 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_TEXT_SHADOW);
3453 RNA_def_property_ui_text(prop, "Shadow", "Display shadow behind text");
3454 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3455
3456 prop = RNA_def_property(srna, "use_outline", PROP_BOOLEAN, PROP_NONE);
3457 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_TEXT_OUTLINE);
3458 RNA_def_property_ui_text(prop, "Outline", "Display outline around text");
3459 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3460
3461 prop = RNA_def_property(srna, "use_box", PROP_BOOLEAN, PROP_NONE);
3462 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_TEXT_BOX);
3463 RNA_def_property_ui_text(prop, "Box", "Display colored box behind text");
3465 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3466
3467 prop = RNA_def_property(srna, "use_bold", PROP_BOOLEAN, PROP_NONE);
3468 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_TEXT_BOLD);
3469 RNA_def_property_ui_text(prop, "Bold", "Display text as bold");
3470 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3471
3472 prop = RNA_def_property(srna, "use_italic", PROP_BOOLEAN, PROP_NONE);
3473 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_TEXT_ITALIC);
3474 RNA_def_property_ui_text(prop, "Italic", "Display text as italic");
3475 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3476}
3477
3479{
3480 static const EnumPropertyItem blend_color_items[] = {
3481 {SEQ_TYPE_DARKEN, "DARKEN", 0, "Darken", ""},
3482 {SEQ_TYPE_MUL, "MULTIPLY", 0, "Multiply", ""},
3483 {SEQ_TYPE_COLOR_BURN, "BURN", 0, "Color Burn", ""},
3484 {SEQ_TYPE_LINEAR_BURN, "LINEAR_BURN", 0, "Linear Burn", ""},
3486 {SEQ_TYPE_LIGHTEN, "LIGHTEN", 0, "Lighten", ""},
3487 {SEQ_TYPE_SCREEN, "SCREEN", 0, "Screen", ""},
3488 {SEQ_TYPE_DODGE, "DODGE", 0, "Color Dodge", ""},
3489 {SEQ_TYPE_ADD, "ADD", 0, "Add", ""},
3491 {SEQ_TYPE_OVERLAY, "OVERLAY", 0, "Overlay", ""},
3492 {SEQ_TYPE_SOFT_LIGHT, "SOFT_LIGHT", 0, "Soft Light", ""},
3493 {SEQ_TYPE_HARD_LIGHT, "HARD_LIGHT", 0, "Hard Light", ""},
3494 {SEQ_TYPE_VIVID_LIGHT, "VIVID_LIGHT", 0, "Vivid Light", ""},
3495 {SEQ_TYPE_LIN_LIGHT, "LINEAR_LIGHT", 0, "Linear Light", ""},
3496 {SEQ_TYPE_PIN_LIGHT, "PIN_LIGHT", 0, "Pin Light", ""},
3498 {SEQ_TYPE_DIFFERENCE, "DIFFERENCE", 0, "Difference", ""},
3499 {SEQ_TYPE_EXCLUSION, "EXCLUSION", 0, "Exclusion", ""},
3500 {SEQ_TYPE_SUB, "SUBTRACT", 0, "Subtract", ""},
3502 {SEQ_TYPE_HUE, "HUE", 0, "Hue", ""},
3503 {SEQ_TYPE_SATURATION, "SATURATION", 0, "Saturation", ""},
3504 {SEQ_TYPE_BLEND_COLOR, "COLOR", 0, "Color", ""},
3505 {SEQ_TYPE_VALUE, "VALUE", 0, "Value", ""},
3506 {0, nullptr, 0, nullptr, nullptr},
3507 };
3508
3509 PropertyRNA *prop;
3510
3511 RNA_def_struct_sdna_from(srna, "ColorMixVars", "effectdata");
3512
3513 prop = RNA_def_property(srna, "blend_effect", PROP_ENUM, PROP_NONE);
3514 RNA_def_property_enum_sdna(prop, nullptr, "blend_effect");
3515 RNA_def_property_enum_items(prop, blend_color_items);
3517 prop, "Blending Mode", "Method for controlling how the strip combines with other strips");
3518 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3519
3520 prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_FACTOR);
3521 RNA_def_property_range(prop, 0.0f, 1.0f);
3523 prop, "Blend Factor", "Percentage of how much the strip's colors affect other strips");
3524 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
3525}
3526
3528 {"AddSequence", "Add Sequence", "Add Sequence", nullptr, 2},
3529 {"AdjustmentSequence",
3530 "Adjustment Layer Sequence",
3531 "Sequence strip to perform filter adjustments to layers below",
3533 0},
3534 {"AlphaOverSequence", "Alpha Over Sequence", "Alpha Over Sequence", nullptr, 2},
3535 {"AlphaUnderSequence", "Alpha Under Sequence", "Alpha Under Sequence", nullptr, 2},
3536 {"ColorSequence",
3537 "Color Sequence",
3538 "Sequence strip creating an image filled with a single color",
3540 0},
3541 {"CrossSequence", "Cross Sequence", "Cross Sequence", nullptr, 2},
3542 {"GammaCrossSequence", "Gamma Cross Sequence", "Gamma Cross Sequence", nullptr, 2},
3543 {"GlowSequence", "Glow Sequence", "Sequence strip creating a glow effect", rna_def_glow, 1},
3544 {"MulticamSequence",
3545 "Multicam Select Sequence",
3546 "Sequence strip to perform multicam editing",
3548 0},
3549 {"MultiplySequence", "Multiply Sequence", "Multiply Sequence", nullptr, 2},
3550 {"OverDropSequence", "Over Drop Sequence", "Over Drop Sequence", nullptr, 2},
3551 {"SpeedControlSequence",
3552 "SpeedControl Sequence",
3553 "Sequence strip to control the speed of other strips",
3555 1},
3556 {"SubtractSequence", "Subtract Sequence", "Subtract Sequence", nullptr, 2},
3557 {"TransformSequence",
3558 "Transform Sequence",
3559 "Sequence strip applying affine transformations to other strips",
3561 1},
3562 {"WipeSequence",
3563 "Wipe Sequence",
3564 "Sequence strip creating a wipe transition",
3566 2},
3567 {"GaussianBlurSequence",
3568 "Gaussian Blur Sequence",
3569 "Sequence strip creating a gaussian blur",
3571 1},
3572 {"TextSequence", "Text Sequence", "Sequence strip creating text", rna_def_text, 0},
3573 {"ColorMixSequence", "Color Mix Sequence", "Color Mix Sequence", rna_def_color_mix, 2},
3574 {"", "", "", nullptr, 0},
3575};
3576
3577static void rna_def_effects(BlenderRNA *brna)
3578{
3579 StructRNA *srna;
3580 EffectInfo *effect;
3581
3582 for (effect = def_effects; effect->struct_name[0] != '\0'; effect++) {
3583 srna = RNA_def_struct(brna, effect->struct_name, "EffectSequence");
3584 RNA_def_struct_ui_text(srna, effect->ui_name, effect->ui_desc);
3585 RNA_def_struct_sdna(srna, "Sequence");
3586
3587 rna_def_effect_inputs(srna, effect->inputs);
3588
3589 if (effect->func) {
3590 effect->func(srna);
3591 }
3592 }
3593}
3594
3596{
3597 StructRNA *srna;
3598 PropertyRNA *prop;
3599
3600 static const EnumPropertyItem mask_input_type_items[] = {
3601 {SEQUENCE_MASK_INPUT_STRIP, "STRIP", 0, "Strip", "Use sequencer strip as mask input"},
3602 {SEQUENCE_MASK_INPUT_ID, "ID", 0, "Mask", "Use mask ID as mask input"},
3603 {0, nullptr, 0, nullptr, nullptr},
3604 };
3605
3606 static const EnumPropertyItem mask_time_items[] = {
3608 "RELATIVE",
3609 0,
3610 "Relative",
3611 "Mask animation is offset to start of strip"},
3613 "ABSOLUTE",
3614 0,
3615 "Absolute",
3616 "Mask animation is in sync with scene frame"},
3617 {0, nullptr, 0, nullptr, nullptr},
3618 };
3619
3620 srna = RNA_def_struct(brna, "SequenceModifier", nullptr);
3621 RNA_def_struct_sdna(srna, "SequenceModifierData");
3622 RNA_def_struct_ui_text(srna, "SequenceModifier", "Modifier for sequence strip");
3623 RNA_def_struct_refine_func(srna, "rna_SequenceModifier_refine");
3624 RNA_def_struct_path_func(srna, "rna_SequenceModifier_path");
3625
3626 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
3627 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_SequenceModifier_name_set");
3628 RNA_def_property_ui_text(prop, "Name", "");
3629 RNA_def_struct_name_property(srna, prop);
3631
3632 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
3635 RNA_def_property_ui_text(prop, "Type", "");
3637
3638 prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
3640 RNA_def_property_ui_text(prop, "Mute", "Mute this modifier");
3641 RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, -1);
3642 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
3643
3644 prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
3647 RNA_def_property_ui_text(prop, "Expanded", "Mute expanded settings for the modifier");
3648 RNA_def_property_ui_icon(prop, ICON_RIGHTARROW, 1);
3650
3651 prop = RNA_def_property(srna, "input_mask_type", PROP_ENUM, PROP_NONE);
3652 RNA_def_property_enum_sdna(prop, nullptr, "mask_input_type");
3653 RNA_def_property_enum_items(prop, mask_input_type_items);
3654 RNA_def_property_ui_text(prop, "Mask Input Type", "Type of input data used for mask");
3655 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
3656
3657 prop = RNA_def_property(srna, "mask_time", PROP_ENUM, PROP_NONE);
3658 RNA_def_property_enum_sdna(prop, nullptr, "mask_time");
3659 RNA_def_property_enum_items(prop, mask_time_items);
3660 RNA_def_property_ui_text(prop, "Mask Time", "Time to use for the Mask animation");
3661 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
3662
3663 prop = RNA_def_property(srna, "input_mask_strip", PROP_POINTER, PROP_NONE);
3664 RNA_def_property_pointer_sdna(prop, nullptr, "mask_sequence");
3666 nullptr,
3667 "rna_SequenceModifier_strip_set",
3668 nullptr,
3669 "rna_SequenceModifier_otherSequence_poll");
3671 RNA_def_property_ui_text(prop, "Mask Strip", "Strip used as mask input for the modifier");
3672 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
3673
3674 prop = RNA_def_property(srna, "input_mask_id", PROP_POINTER, PROP_NONE);
3675 RNA_def_property_pointer_sdna(prop, nullptr, "mask_id");
3677 RNA_def_property_ui_text(prop, "Mask", "Mask ID used as mask input for the modifier");
3678 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
3679}
3680
3682{
3683 StructRNA *srna;
3684 PropertyRNA *prop;
3685
3686 srna = RNA_def_struct(brna, "ColorBalanceModifier", "SequenceModifier");
3687 RNA_def_struct_sdna(srna, "ColorBalanceModifierData");
3689 srna, "ColorBalanceModifier", "Color balance modifier for sequence strip");
3690
3691 prop = RNA_def_property(srna, "color_balance", PROP_POINTER, PROP_NONE);
3692 RNA_def_property_struct_type(prop, "SequenceColorBalanceData");
3693
3694 prop = RNA_def_property(srna, "color_multiply", PROP_FLOAT, PROP_UNSIGNED);
3695 RNA_def_property_float_sdna(prop, nullptr, "color_multiply");
3696 RNA_def_property_range(prop, 0.0f, 20.0f);
3698 RNA_def_property_ui_text(prop, "Multiply Colors", "Multiply the intensity of each pixel");
3699 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
3700}
3701
3703{
3704 StructRNA *srna;
3705 PropertyRNA *prop;
3706
3707 srna = RNA_def_struct(brna, "WhiteBalanceModifier", "SequenceModifier");
3708 RNA_def_struct_sdna(srna, "WhiteBalanceModifierData");
3710 srna, "WhiteBalanceModifier", "White balance modifier for sequence strip");
3711
3712 prop = RNA_def_property(srna, "white_value", PROP_FLOAT, PROP_COLOR_GAMMA);
3713 RNA_def_property_range(prop, 0.0, 1.0);
3714 RNA_def_property_float_sdna(prop, nullptr, "white_value");
3715 RNA_def_property_ui_text(prop, "White Value", "This color defines white in the strip");
3716 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
3717}
3718
3720{
3721 StructRNA *srna;
3722 PropertyRNA *prop;
3723
3724 srna = RNA_def_struct(brna, "CurvesModifier", "SequenceModifier");
3725 RNA_def_struct_sdna(srna, "CurvesModifierData");
3726 RNA_def_struct_ui_text(srna, "CurvesModifier", "RGB curves modifier for sequence strip");
3727
3728 prop = RNA_def_property(srna, "curve_mapping", PROP_POINTER, PROP_NONE);
3729 RNA_def_property_pointer_sdna(prop, nullptr, "curve_mapping");
3730 RNA_def_property_struct_type(prop, "CurveMapping");
3731 RNA_def_property_ui_text(prop, "Curve Mapping", "");
3732 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
3733}
3734
3736{
3737 StructRNA *srna;
3738 PropertyRNA *prop;
3739
3740 srna = RNA_def_struct(brna, "HueCorrectModifier", "SequenceModifier");
3741 RNA_def_struct_sdna(srna, "HueCorrectModifierData");
3742 RNA_def_struct_ui_text(srna, "HueCorrectModifier", "Hue correction modifier for sequence strip");
3743
3744 prop = RNA_def_property(srna, "curve_mapping", PROP_POINTER, PROP_NONE);
3745 RNA_def_property_pointer_sdna(prop, nullptr, "curve_mapping");
3746 RNA_def_property_struct_type(prop, "CurveMapping");
3747 RNA_def_property_ui_text(prop, "Curve Mapping", "");
3748 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
3749}
3750
3752{
3753 StructRNA *srna;
3754 PropertyRNA *prop;
3755
3756 srna = RNA_def_struct(brna, "BrightContrastModifier", "SequenceModifier");
3757 RNA_def_struct_sdna(srna, "BrightContrastModifierData");
3759 srna, "BrightContrastModifier", "Bright/contrast modifier data for sequence strip");
3760
3761 prop = RNA_def_property(srna, "bright", PROP_FLOAT, PROP_UNSIGNED);
3762 RNA_def_property_float_sdna(prop, nullptr, "bright");
3764 RNA_def_property_ui_text(prop, "Brightness", "Adjust the luminosity of the colors");
3765 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
3766
3767 prop = RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_UNSIGNED);
3768 RNA_def_property_float_sdna(prop, nullptr, "contrast");
3769 RNA_def_property_range(prop, -100.0f, 100.0f);
3770 RNA_def_property_ui_text(prop, "Contrast", "Adjust the difference in luminosity between pixels");
3771 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
3772}
3773
3775{
3776 StructRNA *srna;
3777 PropertyRNA *prop;
3778
3779 static const EnumPropertyItem type_items[] = {
3780 {SEQ_TONEMAP_RD_PHOTORECEPTOR, "RD_PHOTORECEPTOR", 0, "R/D Photoreceptor", ""},
3781 {SEQ_TONEMAP_RH_SIMPLE, "RH_SIMPLE", 0, "Rh Simple", ""},
3782 {0, nullptr, 0, nullptr, nullptr},
3783 };
3784
3785 srna = RNA_def_struct(brna, "SequencerTonemapModifierData", "SequenceModifier");
3786 RNA_def_struct_sdna(srna, "SequencerTonemapModifierData");
3787 RNA_def_struct_ui_text(srna, "SequencerTonemapModifierData", "Tone mapping modifier");
3788
3789 prop = RNA_def_property(srna, "tonemap_type", PROP_ENUM, PROP_NONE);
3790 RNA_def_property_enum_sdna(prop, nullptr, "type");
3791 RNA_def_property_enum_items(prop, type_items);
3792 RNA_def_property_ui_text(prop, "Tonemap Type", "Tone mapping algorithm");
3793 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
3794
3795 prop = RNA_def_property(srna, "key", PROP_FLOAT, PROP_FACTOR);
3796 RNA_def_property_range(prop, 0.0f, 1.0f);
3797 RNA_def_property_ui_text(prop, "Key", "The value the average luminance is mapped to");
3798 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
3799
3800 prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
3801 RNA_def_property_range(prop, 0.001f, 10.0f);
3803 prop,
3804 "Offset",
3805 "Normally always 1, but can be used as an extra control to alter the brightness curve");
3806 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
3807
3808 prop = RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_NONE);
3809 RNA_def_property_range(prop, 0.001f, 3.0f);
3810 RNA_def_property_ui_text(prop, "Gamma", "If not used, set to 1");
3811 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
3812
3813 prop = RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE);
3814 RNA_def_property_range(prop, -8.0f, 8.0f);
3816 prop, "Intensity", "If less than zero, darkens image; otherwise, makes it brighter");
3817 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
3818
3819 prop = RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_FACTOR);
3820 RNA_def_property_range(prop, 0.0f, 1.0f);
3821 RNA_def_property_ui_text(prop, "Contrast", "Set to 0 to use estimate from input image");
3822 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
3823
3824 prop = RNA_def_property(srna, "adaptation", PROP_FLOAT, PROP_FACTOR);
3825 RNA_def_property_range(prop, 0.0f, 1.0f);
3826 RNA_def_property_ui_text(prop, "Adaptation", "If 0, global; if 1, based on pixel intensity");
3827 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
3828
3829 prop = RNA_def_property(srna, "correction", PROP_FLOAT, PROP_FACTOR);
3830 RNA_def_property_range(prop, 0.0f, 1.0f);
3832 prop, "Color Correction", "If 0, same for all channels; if 1, each independent");
3833 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
3834}
3835
3847
3849{
3850 StructRNA *srna;
3851 PropertyRNA *prop;
3852
3853 /* Define Sound EQ */
3854 srna = RNA_def_struct(brna, "EQCurveMappingData", nullptr);
3855 RNA_def_struct_sdna(srna, "EQCurveMappingData");
3856 RNA_def_struct_ui_text(srna, "EQCurveMappingData", "EQCurveMappingData");
3857
3858 prop = RNA_def_property(srna, "curve_mapping", PROP_POINTER, PROP_NONE);
3859 RNA_def_property_pointer_sdna(prop, nullptr, "curve_mapping");
3860 RNA_def_property_struct_type(prop, "CurveMapping");
3861 RNA_def_property_ui_text(prop, "Curve Mapping", "");
3863 prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_EQCurveMapping_update");
3864}
3865
3867{
3868 StructRNA *srna;
3869 PropertyRNA *prop;
3870 FunctionRNA *func;
3871 PropertyRNA *parm;
3872
3873 srna = RNA_def_struct(brna, "SoundEqualizerModifier", "SequenceModifier");
3874 RNA_def_struct_sdna(srna, "SoundEqualizerModifierData");
3875 RNA_def_struct_ui_text(srna, "SoundEqualizerModifier", "Equalize audio");
3876
3877 /* Sound Equalizers. */
3878 prop = RNA_def_property(srna, "graphics", PROP_COLLECTION, PROP_NONE);
3879 RNA_def_property_struct_type(prop, "EQCurveMappingData");
3881 prop, "Graphical definition equalization", "Graphical definition equalization");
3882
3883 /* Add band. */
3884 func = RNA_def_function(srna, "new_graphic", "rna_Sequence_SoundEqualizer_Curve_add");
3886 RNA_def_function_ui_description(func, "Add a new EQ band");
3887
3888 parm = RNA_def_float(func,
3889 "min_freq",
3891 0.0,
3892 SOUND_EQUALIZER_DEFAULT_MAX_FREQ, /* Hard min and max */
3893 "Minimum Frequency",
3894 "Minimum Frequency",
3895 0.0,
3896 SOUND_EQUALIZER_DEFAULT_MAX_FREQ); /* Soft min and max */
3898 parm = RNA_def_float(func,
3899 "max_freq",
3901 0.0,
3902 SOUND_EQUALIZER_DEFAULT_MAX_FREQ, /* Hard min and max */
3903 "Maximum Frequency",
3904 "Maximum Frequency",
3905 0.0,
3906 SOUND_EQUALIZER_DEFAULT_MAX_FREQ); /* Soft min and max */
3908
3909 /* return type */
3910 parm = RNA_def_pointer(func,
3911 "graphic_eqs",
3912 "EQCurveMappingData",
3913 "",
3914 "Newly created graphical Equalizer definition");
3915 RNA_def_function_return(func, parm);
3916
3917 /* clear all modifiers */
3918 func = RNA_def_function(srna, "clear_soundeqs", "rna_Sequence_SoundEqualizer_Curve_clear");
3921 "Remove all graphical equalizers from the Equalizer modifier");
3922
3924}
3925
3930
3932{
3934
3937 rna_def_strip_proxy(brna);
3939 rna_def_strip_crop(brna);
3941
3942 rna_def_sequence(brna);
3943 rna_def_editor(brna);
3944 rna_def_channel(brna);
3945
3946 rna_def_image(brna);
3947 rna_def_meta(brna);
3948 rna_def_scene(brna);
3949 rna_def_movie(brna);
3950 rna_def_movieclip(brna);
3951 rna_def_mask(brna);
3952 rna_def_sound(brna);
3953 rna_def_effect(brna);
3954 rna_def_effects(brna);
3955 rna_def_modifiers(brna);
3957}
3958
3959#endif
AnimData * BKE_animdata_from_id(const ID *id)
Definition anim_data.cc:89
void BKE_animdata_fix_paths_rename_all(struct ID *ref_id, const char *prefix, const char *oldName, const char *newName)
void BKE_animdata_fix_paths_rename(struct ID *owner_id, struct AnimData *adt, struct ID *ref_id, const char *prefix, const char *oldName, const char *newName, int oldSubscript, int newSubscript, bool verify_paths)
Scene * CTX_data_scene(const bContext *C)
void id_us_plus(ID *id)
Definition lib_id.cc:351
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:125
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define M_PI
#define DEG2RADF(_deg)
#define FILE_MAX
#define BLI_path_join(...)
void void void BLI_path_split_file_part(const char *filepath, char *file, size_t file_maxncpy) ATTR_NONNULL(1
void BLI_path_split_dir_file(const char *filepath, char *dir, size_t dir_maxncpy, char *file, size_t file_maxncpy) ATTR_NONNULL(1
#define STRNCPY(dst, src)
Definition BLI_string.h:593
#define SNPRINTF(dst, format,...)
Definition BLI_string.h:597
size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define STRNCPY_UTF8(dst, src)
#define BLI_STR_UTF8_MULTIPLICATION_SIGN
void BLI_uniquename(const struct ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_maxncpy) ATTR_NONNULL(1
#define CLAMP(a, b, c)
#define UNUSED_FUNCTION(x)
#define ELEM(...)
#define BLT_I18NCONTEXT_ID_SEQUENCE
#define BLT_I18NCONTEXT_ID_SOUND
#define BLT_I18NCONTEXT_EDITOR_FILEBROWSER
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
@ ID_RECALC_AUDIO
Definition DNA_ID.h:1099
@ ID_RECALC_SYNC_TO_EVAL
Definition DNA_ID.h:1085
@ ID_RECALC_SEQUENCER_STRIPS
Definition DNA_ID.h:1089
Object is a sort of wrapper for general info.
#define MINFRAME
#define MAXFRAME
@ SEQ_BLEND_REPLACE
@ SEQ_STORAGE_PROXY_CUSTOM_FILE
@ SEQ_STORAGE_PROXY_CUSTOM_DIR
@ SEQ_MOVIECLIP_RENDER_UNDISTORTED
@ SEQ_MOVIECLIP_RENDER_STABILIZED
@ SEQ_CACHE_STORE_PREPROCESSED
@ SEQ_CACHE_STORE_RAW
@ SEQ_CACHE_STORE_FINAL_OUT
@ SEQ_CACHE_STORE_COMPOSITE
@ SEQ_CACHE_PREFETCH_ENABLE
@ SEQ_CACHE_OVERRIDE
@ SEQ_TYPE_TRANSFORM
@ SEQ_TYPE_COLOR_BURN
@ SEQ_TYPE_HARD_LIGHT
@ SEQ_TYPE_EXCLUSION
@ SEQ_TYPE_SOUND_RAM
@ SEQ_TYPE_CROSS
@ SEQ_TYPE_SOUND_HD
@ SEQ_TYPE_GLOW
@ SEQ_TYPE_VALUE
@ SEQ_TYPE_COLORMIX
@ SEQ_TYPE_WIPE
@ SEQ_TYPE_META
@ SEQ_TYPE_OVERDROP
@ SEQ_TYPE_PIN_LIGHT
@ SEQ_TYPE_ALPHAUNDER
@ SEQ_TYPE_DODGE
@ SEQ_TYPE_SCENE
@ SEQ_TYPE_HUE
@ SEQ_TYPE_LINEAR_BURN
@ SEQ_TYPE_GAMCROSS
@ SEQ_TYPE_MULTICAM
@ SEQ_TYPE_BLEND_COLOR
@ SEQ_TYPE_MOVIECLIP
@ SEQ_TYPE_DARKEN
@ SEQ_TYPE_MUL
@ SEQ_TYPE_GAUSSIAN_BLUR
@ SEQ_TYPE_ADD
@ SEQ_TYPE_ALPHAOVER
@ SEQ_TYPE_TEXT
@ SEQ_TYPE_IMAGE
@ SEQ_TYPE_SCREEN
@ SEQ_TYPE_SOFT_LIGHT
@ SEQ_TYPE_SUB
@ SEQ_TYPE_VIVID_LIGHT
@ SEQ_TYPE_OVERLAY
@ SEQ_TYPE_SPEED
@ SEQ_TYPE_COLOR
@ SEQ_TYPE_SATURATION
@ SEQ_TYPE_LIN_LIGHT
@ SEQ_TYPE_MOVIE
@ SEQ_TYPE_MASK
@ SEQ_TYPE_DIFFERENCE
@ SEQ_TYPE_ADJUSTMENT
@ SEQ_TYPE_LIGHTEN
@ SEQ_SPEED_STRETCH
@ SEQ_SPEED_MULTIPLY
@ SEQ_SPEED_LENGTH
@ SEQ_SPEED_FRAME_NUMBER
@ SEQ_TEXT_ALIGN_Y_BOTTOM
@ SEQ_TEXT_ALIGN_Y_TOP
@ SEQ_TEXT_ALIGN_Y_CENTER
@ seqModifierType_Curves
@ seqModifierType_WhiteBalance
@ seqModifierType_BrightContrast
@ seqModifierType_ColorBalance
@ seqModifierType_SoundEqualizer
@ seqModifierType_HueCorrect
@ seqModifierType_Tonemap
@ SEQ_ALPHA_PREMUL
@ SEQ_ALPHA_STRAIGHT
@ SEQ_TEXT_ALIGN_X_RIGHT
@ SEQ_TEXT_ALIGN_X_CENTER
@ SEQ_TEXT_ALIGN_X_LEFT
#define SEQ_FONT_NOT_LOADED
@ SEQ_TONEMAP_RD_PHOTORECEPTOR
@ SEQ_TONEMAP_RH_SIMPLE
@ SEQUENCE_COLOR_NONE
@ SEQUENCE_COLOR_05
@ SEQUENCE_COLOR_02
@ SEQUENCE_COLOR_04
@ SEQUENCE_COLOR_06
@ SEQUENCE_COLOR_01
@ SEQUENCE_COLOR_09
@ SEQUENCE_COLOR_08
@ SEQUENCE_COLOR_03
@ SEQUENCE_COLOR_07
@ SEQ_PROXY_SKIP_EXISTING
@ SEQ_TEXT_ITALIC
@ SEQ_TEXT_SHADOW
@ SEQ_TEXT_BOLD
@ SEQ_TEXT_OUTLINE
@ SEQ_TEXT_BOX
@ SEQ_COLOR_BALANCE_METHOD_LIFTGAMMAGAIN
@ SEQ_COLOR_BALANCE_METHOD_SLOPEOFFSETPOWER
@ SEQ_EDIT_SHOW_MISSING_MEDIA
@ SEQ_PROXY_IMAGE_SIZE_100
@ SEQ_PROXY_IMAGE_SIZE_25
@ SEQ_PROXY_IMAGE_SIZE_50
@ SEQ_PROXY_IMAGE_SIZE_75
@ SEQ_EDIT_PROXY_DIR_STORAGE
@ SEQ_FILTERY
@ SEQ_REVERSE_FRAMES
@ SEQ_FLIPX
@ SEQ_RIGHTSEL
@ SEQ_MAKE_FLOAT
@ SEQ_SCENE_STRIPS
@ SEQ_USE_PROXY
@ SEQ_USE_EFFECT_DEFAULT_FADE
@ SEQ_FLIPY
@ SEQ_MULTIPLY_ALPHA
@ SEQ_SHOW_RETIMING
@ SEQ_USE_VIEWS
@ SEQ_USE_LINEAR_MODIFIERS
@ SEQ_SCENE_NO_ANNOTATION
@ SEQ_AUDIO_DRAW_WAVEFORM
@ SEQ_LEFTSEL
@ SEQ_CHANNEL_MUTE
@ SEQ_CHANNEL_LOCK
@ SEQUENCE_MODIFIER_MUTE
@ SEQUENCE_MODIFIER_EXPANDED
@ SEQUENCE_MASK_INPUT_STRIP
@ SEQUENCE_MASK_INPUT_ID
@ SEQ_PROXY_TC_RECORD_RUN_NO_GAPS
@ SEQ_PROXY_TC_RECORD_RUN
@ SEQ_PROXY_TC_NONE
@ SEQUENCE_MASK_TIME_RELATIVE
@ SEQUENCE_MASK_TIME_ABSOLUTE
@ SEQ_TRANSFORM_FILTER_CUBIC_BSPLINE
@ SEQ_TRANSFORM_FILTER_AUTO
@ SEQ_TRANSFORM_FILTER_CUBIC_MITCHELL
@ SEQ_TRANSFORM_FILTER_BILINEAR
@ SEQ_TRANSFORM_FILTER_BOX
@ SEQ_TRANSFORM_FILTER_NEAREST
@ SEQ_SPEED_USE_INTERPOLATION
struct StripElem StripElem
@ SEQ_EDIT_OVERLAY_FRAME_ABS
@ SEQ_EDIT_OVERLAY_FRAME_SHOW
@ SEQ_COLOR_BALANCE_INVERSE_GAIN
@ SEQ_COLOR_BALANCE_INVERSE_LIFT
@ SEQ_COLOR_BALANCE_INVERSE_SLOPE
@ SEQ_COLOR_BALANCE_INVERSE_POWER
@ SEQ_COLOR_BALANCE_INVERSE_OFFSET
@ SEQ_COLOR_BALANCE_INVERSE_GAMMA
void IMB_free_anim(ImBufAnim *anim)
Definition anim_movie.cc:60
IDProperty * IMB_anim_load_metadata(ImBufAnim *anim)
Definition anim_movie.cc:94
Read Guarded memory(de)allocation.
#define RNA_POINTER_INVALIDATE(ptr)
ParameterFlag
Definition RNA_types.hh:396
@ PARM_RNAPTR
Definition RNA_types.hh:399
@ PARM_REQUIRED
Definition RNA_types.hh:397
@ FUNC_USE_REPORTS
Definition RNA_types.hh:680
@ FUNC_USE_MAIN
Definition RNA_types.hh:678
@ FUNC_USE_CONTEXT
Definition RNA_types.hh:679
@ FUNC_USE_SELF_ID
Definition RNA_types.hh:667
@ PROP_FLOAT
Definition RNA_types.hh:67
@ PROP_BOOLEAN
Definition RNA_types.hh:65
@ PROP_ENUM
Definition RNA_types.hh:69
@ PROP_INT
Definition RNA_types.hh:66
@ PROP_STRING
Definition RNA_types.hh:68
@ PROP_POINTER
Definition RNA_types.hh:70
@ PROP_COLLECTION
Definition RNA_types.hh:71
#define RNA_ENUM_ITEM_SEPR
Definition RNA_types.hh:528
PropertyFlag
Definition RNA_types.hh:201
@ PROP_THICK_WRAP
Definition RNA_types.hh:312
@ PROP_ANIMATABLE
Definition RNA_types.hh:220
@ PROP_EDITABLE
Definition RNA_types.hh:207
@ PROP_NEVER_NULL
Definition RNA_types.hh:266
@ PROP_NO_DEG_UPDATE
Definition RNA_types.hh:328
@ PROP_ID_SELF_CHECK
Definition RNA_types.hh:259
@ PROP_TEXTEDIT_UPDATE
Definition RNA_types.hh:227
@ PROP_TIME
Definition RNA_types.hh:156
@ PROP_XYZ
Definition RNA_types.hh:172
@ PROP_FILENAME
Definition RNA_types.hh:141
@ PROP_PIXEL
Definition RNA_types.hh:151
@ PROP_ANGLE
Definition RNA_types.hh:155
@ PROP_NONE
Definition RNA_types.hh:136
@ PROP_DIRPATH
Definition RNA_types.hh:140
@ PROP_PERCENTAGE
Definition RNA_types.hh:153
@ PROP_FACTOR
Definition RNA_types.hh:154
@ PROP_COLOR_GAMMA
Definition RNA_types.hh:175
@ PROP_UNSIGNED
Definition RNA_types.hh:152
@ PROP_FILEPATH
Definition RNA_types.hh:139
constexpr PointerRNA PointerRNA_NULL
Definition RNA_types.hh:45
@ DO_IRIS_WIPE
@ DO_CLOCK_WIPE
@ DO_DOUBLE_WIPE
@ DO_SINGLE_WIPE
constexpr int SEQ_MAX_CHANNELS
#define SOUND_EQUALIZER_DEFAULT_MAX_FREQ
Definition SEQ_sound.hh:24
#define SOUND_EQUALIZER_DEFAULT_MIN_FREQ
Definition SEQ_sound.hh:23
#define ND_SEQUENCER
Definition WM_types.hh:404
#define ND_SPACE_SEQUENCER
Definition WM_types.hh:501
#define ND_DISPLAY
Definition WM_types.hh:458
#define NC_SCENE
Definition WM_types.hh:345
#define NC_IMAGE
Definition WM_types.hh:351
#define NC_SPACE
Definition WM_types.hh:359
#define NA_SELECTED
Definition WM_types.hh:555
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
int64_t size() const
Definition BLI_map.hh:927
void append(const T &value)
#define SELECT
#define NULL
#define offsetof(t, d)
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
void SEQ_effect_text_font_unload(TextVars *data, const bool do_id_user)
Definition effects.cc:2535
int SEQ_effect_get_num_inputs(int seq_type)
Definition effects.cc:3467
void SEQ_cache_cleanup(Scene *scene)
int count
VectorSet< Sequence * > SEQ_query_all_strips_recursive(const ListBase *seqbase)
Definition iterator.cc:90
void SEQ_for_each_callback(ListBase *seqbase, SeqForEachFunc callback, void *user_data)
Definition iterator.cc:43
size_t(* MEM_allocN_len)(const void *vmemh)
Definition mallocn.cc:36
void MEM_freeN(void *vmemh)
Definition mallocn.cc:105
void *(* MEM_callocN)(size_t len, const char *str)
Definition mallocn.cc:42
#define G(x, y, z)
void SEQ_prefetch_stop(Scene *scene)
Definition prefetch.cc:247
void SEQ_proxy_set(Sequence *seq, bool value)
Definition proxy.cc:591
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, bool free_ptr, IteratorSkipFunc skip)
PointerRNA rna_pointer_inherit_refine(const PointerRNA *ptr, StructRNA *type, void *data)
PointerRNA RNA_pointer_create(ID *id, StructRNA *type, void *data)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
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_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength)
void RNA_def_struct_sdna_from(StructRNA *srna, const char *structname, const char *propname)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_struct_idprops_func(StructRNA *srna, const char *idproperties)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_api_sequence_retiming_keys(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_api_sequences(BlenderRNA *brna, PropertyRNA *cprop, bool metastrip)
void RNA_api_sequence_strip(StructRNA *srna)
void RNA_api_sequence_elements(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_views_format_items[]
Definition rna_scene.cc:486
static void rna_def_effect_inputs(StructRNA *srna, int count)
#define RNA_ENUM_SEQUENCER_VIDEO_MODIFIER_TYPE_ITEMS
static void rna_def_filter_video(StructRNA *srna)
static void rna_def_movieclip(BlenderRNA *brna)
static void rna_def_input(StructRNA *srna)
static void rna_def_sound_equalizer_modifier(BlenderRNA *brna)
static void rna_def_color_balance(BlenderRNA *brna)
static void rna_def_modifiers(BlenderRNA *brna)
static void rna_def_gaussian_blur(StructRNA *srna)
static void rna_def_brightcontrast_modifier(BlenderRNA *brna)
void RNA_def_sequencer(BlenderRNA *brna)
static void rna_def_image(BlenderRNA *brna)
static void rna_def_editor(BlenderRNA *brna)
static void rna_def_effect(BlenderRNA *brna)
static void rna_def_channel(BlenderRNA *brna)
static void rna_def_whitebalance_modifier(BlenderRNA *brna)
static void rna_def_mask(BlenderRNA *brna)
static void rna_def_strip_element(BlenderRNA *brna)
static void rna_def_movie_types(StructRNA *srna)
const EnumPropertyItem rna_enum_sequence_modifier_type_items[]
static void rna_def_transform(StructRNA *srna)
static void rna_def_speed_control(StructRNA *srna)
static void rna_def_sound(BlenderRNA *brna)
static void rna_def_tonemap_modifier(BlenderRNA *brna)
static void rna_def_text(StructRNA *srna)
static void rna_def_sequence(BlenderRNA *brna)
static void rna_def_colorbalance_modifier(BlenderRNA *brna)
#define RNA_ENUM_SEQUENCER_AUDIO_MODIFIER_TYPE_ITEMS
static void rna_def_strip_crop(BlenderRNA *brna)
static void rna_def_modifier(BlenderRNA *brna)
static void rna_def_color_mix(StructRNA *srna)
static void rna_def_solid_color(StructRNA *srna)
static void rna_def_audio_options(StructRNA *srna)
static void rna_def_strip_transform(BlenderRNA *brna)
static void rna_def_movie(BlenderRNA *brna)
static void rna_def_wipe(StructRNA *srna)
static void rna_def_graphical_sound_equalizer(BlenderRNA *brna)
static void rna_def_multicam(StructRNA *srna)
static void rna_def_scene(BlenderRNA *brna)
const EnumPropertyItem rna_enum_strip_color_items[]
static void rna_def_effects(BlenderRNA *brna)
static void rna_def_color_management(StructRNA *srna)
static void rna_def_curves_modifier(BlenderRNA *brna)
static void rna_def_strip_color_balance(BlenderRNA *brna)
const EnumPropertyItem rna_enum_sequence_sound_modifier_type_items[]
static EffectInfo def_effects[]
const EnumPropertyItem rna_enum_sequence_video_modifier_type_items[]
static const EnumPropertyItem transform_filter_items[]
static void rna_def_hue_modifier(BlenderRNA *brna)
static void rna_def_strip_proxy(BlenderRNA *brna)
static void rna_def_proxy(StructRNA *srna)
static void rna_def_glow(StructRNA *srna)
static void rna_def_meta(BlenderRNA *brna)
static void rna_def_retiming_key(BlenderRNA *brna)
static const EnumPropertyItem blend_mode_items[]
static void rna_def_sound_modifiers(BlenderRNA *brna)
static void rna_def_sequence_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
Sequence * SEQ_sequence_lookup_owner_by_channel(const Scene *scene, const SeqTimelineChannel *channel)
Sequence * SEQ_sequence_lookup_seq_by_name(const Scene *scene, const char *key)
SequenceModifierData * SEQ_modifier_new(Sequence *seq, const char *name, int type)
bool SEQ_modifier_remove(Sequence *seq, SequenceModifierData *smd)
void SEQ_modifier_clear(Sequence *seq)
int SEQ_sequence_supports_modifiers(Sequence *seq)
void SEQ_modifier_unique_name(Sequence *seq, SequenceModifierData *smd)
EQCurveMappingData * SEQ_sound_equalizermodifier_add_graph(SoundEqualizerModifierData *semd, float min_freq, float max_freq)
void SEQ_sound_equalizermodifier_free(SequenceModifierData *smd)
void SEQ_sound_update_bounds(Scene *scene, Sequence *seq)
ListBase * SEQ_get_seqbase_by_seq(const Scene *scene, Sequence *seq)
void SEQ_sequence_base_unique_name_recursive(Scene *scene, ListBase *seqbasep, Sequence *seq)
Sequence * SEQ_sequence_from_strip_elem(ListBase *seqbase, StripElem *se)
void SEQ_meta_stack_set(const Scene *scene, Sequence *dst_seq)
Definition sequencer.cc:457
Editing * SEQ_editing_get(const Scene *scene)
Definition sequencer.cc:262
#define min(a, b)
Definition sort.c:32
#define FLT_MAX
Definition stdcycles.h:14
void SEQ_add_reload_new_file(Main *bmain, Scene *scene, Sequence *seq, const bool lock_range)
Definition strip_add.cc:525
void SEQ_add_movie_reload_if_needed(Main *bmain, Scene *scene, Sequence *seq, bool *r_was_reloaded, bool *r_can_produce_frames)
Definition strip_add.cc:699
void SEQ_edit_flag_for_removal(Scene *scene, ListBase *seqbase, Sequence *seq)
bool SEQ_edit_move_strip_to_seqbase(Scene *scene, ListBase *seqbase, Sequence *seq, ListBase *dst_seqbase)
void SEQ_edit_sequence_name_set(Scene *scene, Sequence *seq, const char *new_name)
void SEQ_edit_remove_flagged_sequences(Scene *scene, ListBase *seqbase)
bool SEQ_relations_render_loop_check(Sequence *seq_main, Sequence *seq)
void SEQ_relations_invalidate_cache_raw(Scene *scene, Sequence *seq)
bool SEQ_exists_in_seqbase(const Sequence *seq, const ListBase *seqbase)
void SEQ_relations_free_imbuf(Scene *scene, ListBase *seqbase, bool for_render)
void SEQ_relations_invalidate_cache_preprocessed(Scene *scene, Sequence *seq)
void SEQ_relations_invalidate_cache_composite(Scene *scene, Sequence *seq)
int SEQ_retiming_keys_count(const Sequence *seq)
void SEQ_retiming_key_timeline_frame_set(const Scene *scene, Sequence *seq, SeqRetimingKey *key, const int timeline_frame)
void SEQ_retiming_remove_key(const Scene *scene, Sequence *seq, SeqRetimingKey *key)
blender::Map< SeqRetimingKey *, Sequence * > SEQ_retiming_selection_get(const Editing *ed)
void SEQ_select_active_set(Scene *scene, Sequence *seq)
int SEQ_time_strip_length_get(const Scene *scene, const Sequence *seq)
void SEQ_time_right_handle_frame_set(const Scene *scene, Sequence *seq, int timeline_frame)
void SEQ_time_left_handle_frame_set(const Scene *scene, Sequence *seq, int timeline_frame)
int SEQ_time_left_handle_frame_get(const Scene *, const Sequence *seq)
float SEQ_time_sequence_get_fps(Scene *scene, Sequence *seq)
float SEQ_time_start_frame_get(const Sequence *seq)
int SEQ_time_right_handle_frame_get(const Scene *scene, const Sequence *seq)
bool SEQ_transform_seqbase_shuffle_ex(ListBase *seqbasep, Sequence *test, Scene *evil_scene, int channel_delta)
bool SEQ_transform_seqbase_shuffle(ListBase *seqbasep, Sequence *test, Scene *evil_scene)
bool SEQ_transform_test_overlap(const Scene *scene, ListBase *seqbasep, Sequence *test)
void SEQ_transform_translate_sequence(Scene *evil_scene, Sequence *seq, int delta)
ListBaseIterator listbase
Definition RNA_types.hh:455
union CollectionPropertyIterator::@1329 internal
StripColorBalance color_balance
ListBase seqbase
ListBase channels
const char * ui_name
const char * struct_name
const char * ui_desc
void(* func)(StructRNA *)
Definition DNA_ID.h:413
void * first
ID * owner_id
Definition RNA_types.hh:40
StructRNA * type
Definition RNA_types.hh:41
void * data
Definition RNA_types.hh:42
struct SequenceModifierData * next
struct Sequence * mask_sequence
ListBase channels
ListBase modifiers
struct Sequence * seq1
struct Sequence * seq2
struct IDProperty * prop
struct ImBufAnim * anim
char filename[256]
struct ImBufAnim * anim
char dirpath[768]
char filename[256]
char dirpath[768]
StripProxy * proxy
StripTransform * transform
StripElem * stripdata
StripCrop * crop
void WM_main_add_notifier(uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4126