2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * Contributor(s): Blender Foundation (2008)
20 * ***** END GPL LICENSE BLOCK *****
23 /** \file blender/makesrna/intern/rna_sequencer.c
30 #include "DNA_anim_types.h"
31 #include "DNA_object_types.h"
32 #include "DNA_scene_types.h"
33 #include "DNA_sequence_types.h"
34 #include "DNA_movieclip_types.h"
38 #include "BLF_translation.h"
40 #include "BKE_animsys.h"
41 #include "BKE_global.h"
42 #include "BKE_sequencer.h"
43 #include "BKE_sound.h"
45 #include "MEM_guardedalloc.h"
47 #include "RNA_access.h"
48 #include "RNA_define.h"
49 #include "RNA_enum_types.h"
51 #include "rna_internal.h"
55 typedef struct EffectInfo {
56 const char *struct_name;
59 void (*func)(StructRNA *);
63 EnumPropertyItem sequence_modifier_type_items[] = {
64 {seqModifierType_ColorBalance, "COLOR_BALANCE", ICON_NONE, "Color Balance", ""},
65 {seqModifierType_Curves, "CURVES", ICON_NONE, "Curves", ""},
66 {seqModifierType_HueCorrect, "HUE_CORRECT", ICON_NONE, "Hue Correct", ""},
67 {seqModifierType_BrightContrast, "BRIGHT_CONTRAST", ICON_NONE, "Bright/Contrast", ""},
68 {seqModifierType_Mask, "MASK", ICON_NONE, "Mask", ""},
69 {0, NULL, 0, NULL, NULL}
74 #include "BKE_report.h"
75 #include "BKE_idprop.h"
79 #include "IMB_imbuf.h"
81 typedef struct SequenceSearchData {
84 SequenceModifierData *smd;
87 /* build a temp reference to the parent */
88 static void meta_tmp_ref(Sequence *seq_par, Sequence *seq)
90 for (; seq; seq = seq->next) {
92 if (seq->type == SEQ_TYPE_META) {
93 meta_tmp_ref(seq, seq->seqbase.first);
98 static void rna_SequenceElement_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
100 Scene *scene = (Scene *) ptr->id.data;
101 Editing *ed = BKE_sequencer_editing_get(scene, false);
104 StripElem *se = (StripElem *)ptr->data;
107 /* slow but we can't avoid! */
108 seq = BKE_sequencer_from_elem(&ed->seqbase, se);
110 BKE_sequence_invalidate_cache(scene, seq);
115 static void rna_Sequence_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
117 Scene *scene = (Scene *) ptr->id.data;
118 Editing *ed = BKE_sequencer_editing_get(scene, false);
121 Sequence *seq = (Sequence *) ptr->data;
123 BKE_sequence_invalidate_cache(scene, seq);
127 static void rna_SequenceEditor_sequences_all_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
129 Scene *scene = (Scene *)ptr->id.data;
130 Editing *ed = BKE_sequencer_editing_get(scene, false);
132 meta_tmp_ref(NULL, ed->seqbase.first);
134 rna_iterator_listbase_begin(iter, &ed->seqbase, NULL);
137 static void rna_SequenceEditor_update_cache(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
139 Editing *ed = scene->ed;
141 BKE_sequencer_free_imbuf(scene, &ed->seqbase, false);
145 static void rna_SequenceEditor_sequences_all_next(CollectionPropertyIterator *iter)
147 ListBaseIterator *internal = &iter->internal.listbase;
148 Sequence *seq = (Sequence *)internal->link;
150 if (seq->seqbase.first)
151 internal->link = (Link *)seq->seqbase.first;
153 internal->link = (Link *)seq->next;
155 internal->link = NULL;
158 seq = seq->tmp; /* XXX - seq's don't reference their parents! */
159 if (seq && seq->next) {
160 internal->link = (Link *)seq->next;
166 iter->valid = (internal->link != NULL);
170 static int rna_SequenceEditor_elements_length(PointerRNA *ptr)
172 Sequence *seq = (Sequence *)ptr->data;
174 /* Hack? copied from sequencer.c::reload_sequence_new_file() */
175 size_t olen = MEM_allocN_len(seq->strip->stripdata) / sizeof(struct StripElem);
177 /* the problem with seq->strip->len and seq->len is that it's discounted from the offset (hard cut trim) */
181 static void rna_SequenceEditor_elements_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
183 Sequence *seq = (Sequence *)ptr->data;
184 rna_iterator_array_begin(iter, (void *)seq->strip->stripdata, sizeof(StripElem),
185 rna_SequenceEditor_elements_length(ptr), 0, NULL);
188 static void rna_Sequence_views_format_update(Main *bmain, Scene *scene, PointerRNA *ptr)
190 rna_Sequence_update(bmain, scene, ptr);
193 static void do_sequence_frame_change_update(Scene *scene, Sequence *seq)
195 Editing *ed = BKE_sequencer_editing_get(scene, false);
196 ListBase *seqbase = BKE_sequence_seqbase(&ed->seqbase, seq);
198 BKE_sequence_calc_disp(scene, seq);
200 /* ensure effects are always fit in length to their input */
202 /* TODO(sergey): probably could be optimized.
203 * in terms skipping update of non-changing strips
205 for (tseq = seqbase->first; tseq; tseq = tseq->next) {
206 if (tseq->seq1 || tseq->seq2 || tseq->seq3) {
207 BKE_sequence_calc(scene, tseq);
211 if (BKE_sequence_test_overlap(seqbase, seq)) {
212 BKE_sequence_base_shuffle(seqbase, seq, scene); /* XXX - BROKEN!, uses context seqbasep */
214 BKE_sequencer_sort(scene);
217 /* A simple wrapper around above func, directly usable as prop update func.
218 * Also invalidate cache if needed.
220 static void rna_Sequence_frame_change_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
222 Scene *scene = (Scene *)ptr->id.data;
223 do_sequence_frame_change_update(scene, (Sequence *)ptr->data);
224 rna_Sequence_update(bmain, scene, ptr);
227 static void rna_Sequence_start_frame_set(PointerRNA *ptr, int value)
229 Sequence *seq = (Sequence *)ptr->data;
230 Scene *scene = (Scene *)ptr->id.data;
232 BKE_sequence_translate(scene, seq, value - seq->start);
233 do_sequence_frame_change_update(scene, seq);
236 static void rna_Sequence_start_frame_final_set(PointerRNA *ptr, int value)
238 Sequence *seq = (Sequence *)ptr->data;
239 Scene *scene = (Scene *)ptr->id.data;
241 BKE_sequence_tx_set_final_left(seq, value);
242 BKE_sequence_single_fix(seq);
243 do_sequence_frame_change_update(scene, seq);
246 static void rna_Sequence_end_frame_final_set(PointerRNA *ptr, int value)
248 Sequence *seq = (Sequence *)ptr->data;
249 Scene *scene = (Scene *)ptr->id.data;
251 BKE_sequence_tx_set_final_right(seq, value);
252 BKE_sequence_single_fix(seq);
253 do_sequence_frame_change_update(scene, seq);
256 static void rna_Sequence_anim_startofs_final_set(PointerRNA *ptr, int value)
258 Sequence *seq = (Sequence *)ptr->data;
259 Scene *scene = (Scene *)ptr->id.data;
261 seq->anim_startofs = MIN2(value, seq->len + seq->anim_startofs);
263 BKE_sequence_reload_new_file(scene, seq, false);
264 do_sequence_frame_change_update(scene, seq);
267 static void rna_Sequence_anim_endofs_final_set(PointerRNA *ptr, int value)
269 Sequence *seq = (Sequence *)ptr->data;
270 Scene *scene = (Scene *)ptr->id.data;
272 seq->anim_endofs = MIN2(value, seq->len + seq->anim_endofs);
274 BKE_sequence_reload_new_file(scene, seq, false);
275 do_sequence_frame_change_update(scene, seq);
278 static void rna_Sequence_frame_length_set(PointerRNA *ptr, int value)
280 Sequence *seq = (Sequence *)ptr->data;
281 Scene *scene = (Scene *)ptr->id.data;
283 BKE_sequence_tx_set_final_right(seq, seq->start + value);
284 do_sequence_frame_change_update(scene, seq);
287 static int rna_Sequence_frame_length_get(PointerRNA *ptr)
289 Sequence *seq = (Sequence *)ptr->data;
290 return BKE_sequence_tx_get_final_right(seq, false) - BKE_sequence_tx_get_final_left(seq, false);
293 static int rna_Sequence_frame_editable(PointerRNA *ptr)
295 Sequence *seq = (Sequence *)ptr->data;
296 /* Effect sequences' start frame and length must be readonly! */
297 return (BKE_sequence_effect_get_num_inputs(seq->type)) ? 0 : PROP_EDITABLE;
300 static void rna_Sequence_channel_set(PointerRNA *ptr, int value)
302 Sequence *seq = (Sequence *)ptr->data;
303 Scene *scene = (Scene *)ptr->id.data;
304 Editing *ed = BKE_sequencer_editing_get(scene, false);
305 ListBase *seqbase = BKE_sequence_seqbase(&ed->seqbase, seq);
307 /* check channel increment or decrement */
308 const int channel_delta = (value >= seq->machine) ? 1 : -1;
309 seq->machine = value;
311 if (BKE_sequence_test_overlap(seqbase, seq)) {
312 /* XXX - BROKEN!, uses context seqbasep */
313 BKE_sequence_base_shuffle_ex(seqbase, seq, scene, channel_delta);
315 BKE_sequencer_sort(scene);
318 static void rna_Sequence_frame_offset_range(PointerRNA *ptr, int *min, int *max,
319 int *UNUSED(softmin), int *UNUSED(softmax))
321 Sequence *seq = (Sequence *)ptr->data;
322 *min = ELEM(seq->type, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SOUND_HD) ? 0 : INT_MIN;
326 static void rna_Sequence_use_proxy_set(PointerRNA *ptr, int value)
328 Sequence *seq = (Sequence *)ptr->data;
329 BKE_sequencer_proxy_set(seq, value != 0);
332 static void rna_Sequence_use_translation_set(PointerRNA *ptr, int value)
334 Sequence *seq = (Sequence *)ptr->data;
336 seq->flag |= SEQ_USE_TRANSFORM;
337 if (seq->strip->transform == NULL) {
338 seq->strip->transform = MEM_callocN(sizeof(struct StripTransform), "StripTransform");
342 seq->flag ^= SEQ_USE_TRANSFORM;
346 static void rna_Sequence_use_crop_set(PointerRNA *ptr, int value)
348 Sequence *seq = (Sequence *)ptr->data;
350 seq->flag |= SEQ_USE_CROP;
351 if (seq->strip->crop == NULL) {
352 seq->strip->crop = MEM_callocN(sizeof(struct StripCrop), "StripCrop");
356 seq->flag ^= SEQ_USE_CROP;
360 static int transform_seq_cmp_cb(Sequence *seq, void *arg_pt)
362 SequenceSearchData *data = arg_pt;
364 if (seq->strip && seq->strip->transform == data->data) {
366 return -1; /* done so bail out */
371 static Sequence *sequence_get_by_transform(Editing *ed, StripTransform *transform)
373 SequenceSearchData data;
376 data.data = transform;
378 /* irritating we need to search for our sequence! */
379 BKE_sequencer_base_recursive_apply(&ed->seqbase, transform_seq_cmp_cb, &data);
384 static char *rna_SequenceTransform_path(PointerRNA *ptr)
386 Scene *scene = ptr->id.data;
387 Editing *ed = BKE_sequencer_editing_get(scene, false);
388 Sequence *seq = sequence_get_by_transform(ed, ptr->data);
390 if (seq && seq->name + 2) {
391 char name_esc[(sizeof(seq->name) - 2) * 2];
393 BLI_strescape(name_esc, seq->name + 2, sizeof(name_esc));
394 return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].transform", name_esc);
397 return BLI_strdup("");
401 static void rna_SequenceTransform_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
403 Scene *scene = (Scene *) ptr->id.data;
404 Editing *ed = BKE_sequencer_editing_get(scene, false);
405 Sequence *seq = sequence_get_by_transform(ed, ptr->data);
407 BKE_sequence_invalidate_cache(scene, seq);
410 static int crop_seq_cmp_cb(Sequence *seq, void *arg_pt)
412 SequenceSearchData *data = arg_pt;
414 if (seq->strip && seq->strip->crop == data->data) {
416 return -1; /* done so bail out */
421 static Sequence *sequence_get_by_crop(Editing *ed, StripCrop *crop)
423 SequenceSearchData data;
428 /* irritating we need to search for our sequence! */
429 BKE_sequencer_base_recursive_apply(&ed->seqbase, crop_seq_cmp_cb, &data);
434 static char *rna_SequenceCrop_path(PointerRNA *ptr)
436 Scene *scene = ptr->id.data;
437 Editing *ed = BKE_sequencer_editing_get(scene, false);
438 Sequence *seq = sequence_get_by_crop(ed, ptr->data);
440 if (seq && seq->name + 2) {
441 char name_esc[(sizeof(seq->name) - 2) * 2];
443 BLI_strescape(name_esc, seq->name + 2, sizeof(name_esc));
444 return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].crop", name_esc);
447 return BLI_strdup("");
451 static void rna_SequenceCrop_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
453 Scene *scene = (Scene *) ptr->id.data;
454 Editing *ed = BKE_sequencer_editing_get(scene, false);
455 Sequence *seq = sequence_get_by_crop(ed, ptr->data);
457 BKE_sequence_invalidate_cache(scene, seq);
460 /* name functions that ignore the first two characters */
461 static void rna_Sequence_name_get(PointerRNA *ptr, char *value)
463 Sequence *seq = (Sequence *)ptr->data;
464 BLI_strncpy(value, seq->name + 2, sizeof(seq->name) - 2);
467 static int rna_Sequence_name_length(PointerRNA *ptr)
469 Sequence *seq = (Sequence *)ptr->data;
470 return strlen(seq->name + 2);
473 static void rna_Sequence_name_set(PointerRNA *ptr, const char *value)
475 Scene *scene = (Scene *)ptr->id.data;
476 Sequence *seq = (Sequence *)ptr->data;
477 char oldname[sizeof(seq->name)];
480 /* make a copy of the old name first */
481 BLI_strncpy(oldname, seq->name + 2, sizeof(seq->name) - 2);
483 /* copy the new name into the name slot */
484 BLI_strncpy_utf8(seq->name + 2, value, sizeof(seq->name) - 2);
486 /* make sure the name is unique */
487 BKE_sequence_base_unique_name_recursive(&scene->ed->seqbase, seq);
489 /* fix all the animation data which may link to this */
491 /* don't rename everywhere because these are per scene */
492 /* BKE_animdata_fix_paths_rename_all(NULL, "sequence_editor.sequences_all", oldname, seq->name + 2); */
493 adt = BKE_animdata_from_id(&scene->id);
495 BKE_animdata_fix_paths_rename(&scene->id, adt, NULL, "sequence_editor.sequences_all", oldname, seq->name + 2, 0, 0, 1);
498 static StructRNA *rna_Sequence_refine(struct PointerRNA *ptr)
500 Sequence *seq = (Sequence *)ptr->data;
504 return &RNA_ImageSequence;
506 return &RNA_MetaSequence;
508 return &RNA_SceneSequence;
510 return &RNA_MovieSequence;
511 case SEQ_TYPE_MOVIECLIP:
512 return &RNA_MovieClipSequence;
514 return &RNA_MaskSequence;
515 case SEQ_TYPE_SOUND_RAM:
516 return &RNA_SoundSequence;
518 return &RNA_CrossSequence;
520 return &RNA_AddSequence;
522 return &RNA_SubtractSequence;
523 case SEQ_TYPE_ALPHAOVER:
524 return &RNA_AlphaOverSequence;
525 case SEQ_TYPE_ALPHAUNDER:
526 return &RNA_AlphaUnderSequence;
527 case SEQ_TYPE_GAMCROSS:
528 return &RNA_GammaCrossSequence;
530 return &RNA_MultiplySequence;
531 case SEQ_TYPE_OVERDROP:
532 return &RNA_OverDropSequence;
533 case SEQ_TYPE_MULTICAM:
534 return &RNA_MulticamSequence;
535 case SEQ_TYPE_ADJUSTMENT:
536 return &RNA_AdjustmentSequence;
538 return &RNA_WipeSequence;
540 return &RNA_GlowSequence;
541 case SEQ_TYPE_TRANSFORM:
542 return &RNA_TransformSequence;
544 return &RNA_ColorSequence;
546 return &RNA_SpeedControlSequence;
547 case SEQ_TYPE_GAUSSIAN_BLUR:
548 return &RNA_GaussianBlurSequence;
550 return &RNA_Sequence;
554 static char *rna_Sequence_path(PointerRNA *ptr)
556 Sequence *seq = (Sequence *)ptr->data;
558 /* sequencer data comes from scene...
559 * TODO: would be nice to make SequenceEditor data a datablock of its own (for shorter paths)
562 char name_esc[(sizeof(seq->name) - 2) * 2];
564 BLI_strescape(name_esc, seq->name + 2, sizeof(name_esc));
565 return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"]", name_esc);
568 return BLI_strdup("");
572 static IDProperty *rna_Sequence_idprops(PointerRNA *ptr, bool create)
574 Sequence *seq = ptr->data;
576 if (create && !seq->prop) {
577 IDPropertyTemplate val = {0};
578 seq->prop = IDP_New(IDP_GROUP, &val, "Sequence ID properties");
584 static PointerRNA rna_SequenceEditor_meta_stack_get(CollectionPropertyIterator *iter)
586 ListBaseIterator *internal = &iter->internal.listbase;
587 MetaStack *ms = (MetaStack *)internal->link;
589 return rna_pointer_inherit_refine(&iter->parent, &RNA_Sequence, ms->parseq);
592 /* TODO, expose seq path setting as a higher level sequencer BKE function */
593 static void rna_Sequence_filepath_set(PointerRNA *ptr, const char *value)
595 Sequence *seq = (Sequence *)(ptr->data);
597 if (seq->type == SEQ_TYPE_SOUND_RAM && seq->sound) {
598 /* for sound strips we need to update the sound as well.
599 * arguably, this could load in a new sound rather than modify an existing one.
600 * but while using the sequencer its most likely your not using the sound in the game engine too.
603 RNA_id_pointer_create((ID *)seq->sound, &id_ptr);
604 RNA_string_set(&id_ptr, "filepath", value);
605 BKE_sound_load(G.main, seq->sound);
606 BKE_sound_update_scene_sound(seq->scene_sound, seq->sound);
609 BLI_split_dirfile(value, seq->strip->dir, seq->strip->stripdata->name, sizeof(seq->strip->dir),
610 sizeof(seq->strip->stripdata->name));
613 static void rna_Sequence_filepath_get(PointerRNA *ptr, char *value)
615 Sequence *seq = (Sequence *)(ptr->data);
617 BLI_join_dirfile(value, FILE_MAX, seq->strip->dir, seq->strip->stripdata->name);
620 static int rna_Sequence_filepath_length(PointerRNA *ptr)
622 Sequence *seq = (Sequence *)(ptr->data);
625 BLI_join_dirfile(path, sizeof(path), seq->strip->dir, seq->strip->stripdata->name);
629 static void rna_Sequence_proxy_filepath_set(PointerRNA *ptr, const char *value)
631 StripProxy *proxy = (StripProxy *)(ptr->data);
632 BLI_split_dirfile(value, proxy->dir, proxy->file, sizeof(proxy->dir), sizeof(proxy->file));
634 IMB_free_anim(proxy->anim);
639 static void rna_Sequence_proxy_filepath_get(PointerRNA *ptr, char *value)
641 StripProxy *proxy = (StripProxy *)(ptr->data);
643 BLI_join_dirfile(value, FILE_MAX, proxy->dir, proxy->file);
646 static int rna_Sequence_proxy_filepath_length(PointerRNA *ptr)
648 StripProxy *proxy = (StripProxy *)(ptr->data);
651 BLI_join_dirfile(path, sizeof(path), proxy->dir, proxy->file);
655 static void rna_Sequence_volume_set(PointerRNA *ptr, float value)
657 Sequence *seq = (Sequence *)(ptr->data);
660 if (seq->scene_sound)
661 BKE_sound_set_scene_sound_volume(seq->scene_sound, value, (seq->flag & SEQ_AUDIO_VOLUME_ANIMATED) != 0);
664 static void rna_Sequence_pitch_set(PointerRNA *ptr, float value)
666 Sequence *seq = (Sequence *)(ptr->data);
669 if (seq->scene_sound)
670 BKE_sound_set_scene_sound_pitch(seq->scene_sound, value, (seq->flag & SEQ_AUDIO_PITCH_ANIMATED) != 0);
673 static void rna_Sequence_pan_set(PointerRNA *ptr, float value)
675 Sequence *seq = (Sequence *)(ptr->data);
678 if (seq->scene_sound)
679 BKE_sound_set_scene_sound_pan(seq->scene_sound, value, (seq->flag & SEQ_AUDIO_PAN_ANIMATED) != 0);
683 static int rna_Sequence_input_count_get(PointerRNA *ptr)
685 Sequence *seq = (Sequence *)(ptr->data);
687 return BKE_sequence_effect_get_num_inputs(seq->type);
691 static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value)
693 Sequence *seq = (Sequence *)(ptr->data);
694 BLI_split_dirfile(value, seq->strip->dir, seq->strip->stripdata->name, sizeof(seq->strip->dir),
695 sizeof(seq->strip->stripdata->name));
698 static void rna_SequenceElement_filename_set(PointerRNA *ptr, const char *value)
700 StripElem *elem = (StripElem *)(ptr->data);
701 BLI_split_file_part(value, elem->name, sizeof(elem->name));
705 static void rna_Sequence_update_reopen_files(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
707 Scene *scene = (Scene *) ptr->id.data;
708 Editing *ed = BKE_sequencer_editing_get(scene, false);
710 BKE_sequencer_free_imbuf(scene, &ed->seqbase, false);
712 if (RNA_struct_is_a(ptr->type, &RNA_SoundSequence))
713 BKE_sequencer_update_sound_bounds(scene, ptr->data);
716 static void rna_Sequence_mute_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
718 Scene *scene = (Scene *) ptr->id.data;
719 Editing *ed = BKE_sequencer_editing_get(scene, false);
721 BKE_sequencer_update_muting(ed);
722 rna_Sequence_update(bmain, scene, ptr);
725 static void rna_Sequence_filepath_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
727 Scene *scene = (Scene *) ptr->id.data;
728 Sequence *seq = (Sequence *)(ptr->data);
729 BKE_sequence_reload_new_file(scene, seq, true);
730 BKE_sequence_calc(scene, seq);
731 rna_Sequence_update(bmain, scene, ptr);
734 static int seqproxy_seq_cmp_cb(Sequence *seq, void *arg_pt)
736 SequenceSearchData *data = arg_pt;
738 if (seq->strip && seq->strip->proxy == data->data) {
740 return -1; /* done so bail out */
745 static Sequence *sequence_get_by_proxy(Editing *ed, StripProxy *proxy)
747 SequenceSearchData data;
752 BKE_sequencer_base_recursive_apply(&ed->seqbase, seqproxy_seq_cmp_cb, &data);
756 static void rna_Sequence_tcindex_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
758 Scene *scene = (Scene *) ptr->id.data;
759 Editing *ed = BKE_sequencer_editing_get(scene, false);
760 Sequence *seq = sequence_get_by_proxy(ed, ptr->data);
762 BKE_sequence_reload_new_file(scene, seq, false);
763 do_sequence_frame_change_update(scene, seq);
766 static void rna_SequenceProxy_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
768 Scene *scene = (Scene *) ptr->id.data;
769 Editing *ed = BKE_sequencer_editing_get(scene, false);
770 Sequence *seq = sequence_get_by_proxy(ed, ptr->data);
772 BKE_sequence_invalidate_cache(scene, seq);
776 static float rna_Sequence_opacity_get(PointerRNA *ptr)
778 Sequence *seq = (Sequence *)(ptr->data);
779 return seq->blend_opacity / 100.0f;
781 static void rna_Sequence_opacity_set(PointerRNA *ptr, float value)
783 Sequence *seq = (Sequence *)(ptr->data);
784 CLAMP(value, 0.0f, 1.0f);
785 seq->blend_opacity = value * 100.0f;
788 static int colbalance_seq_cmp_cb(Sequence *seq, void *arg_pt)
790 SequenceSearchData *data = arg_pt;
792 if (seq->modifiers.first) {
793 SequenceModifierData *smd = seq->modifiers.first;
795 for (smd = seq->modifiers.first; smd; smd = smd->next) {
796 if (smd->type == seqModifierType_ColorBalance) {
797 ColorBalanceModifierData *cbmd = (ColorBalanceModifierData *) smd;
799 if (&cbmd->color_balance == data->data) {
802 return -1; /* done so bail out */
811 static Sequence *sequence_get_by_colorbalance(Editing *ed, StripColorBalance *cb, SequenceModifierData **r_smd)
813 SequenceSearchData data;
819 /* irritating we need to search for our sequence! */
820 BKE_sequencer_base_recursive_apply(&ed->seqbase, colbalance_seq_cmp_cb, &data);
827 static char *rna_SequenceColorBalance_path(PointerRNA *ptr)
829 Scene *scene = ptr->id.data;
830 SequenceModifierData *smd;
831 Editing *ed = BKE_sequencer_editing_get(scene, false);
832 Sequence *seq = sequence_get_by_colorbalance(ed, ptr->data, &smd);
834 if (seq && seq->name + 2) {
835 char name_esc[(sizeof(seq->name) - 2) * 2];
837 BLI_strescape(name_esc, seq->name + 2, sizeof(name_esc));
840 /* path to old filter color balance */
841 return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].color_balance", name_esc);
844 /* path to modifier */
845 char name_esc[(sizeof(seq->name) - 2) * 2];
846 char name_esc_smd[sizeof(smd->name) * 2];
848 BLI_strescape(name_esc, seq->name + 2, sizeof(name_esc));
849 BLI_strescape(name_esc_smd, smd->name, sizeof(name_esc_smd));
850 return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].modifiers[\"%s\"].color_balance",
851 name_esc, name_esc_smd);
855 return BLI_strdup("");
858 static void rna_SequenceColorBalance_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
860 Scene *scene = (Scene *) ptr->id.data;
861 Editing *ed = BKE_sequencer_editing_get(scene, false);
862 SequenceModifierData *smd;
863 Sequence *seq = sequence_get_by_colorbalance(ed, ptr->data, &smd);
866 BKE_sequence_invalidate_cache(scene, seq);
868 BKE_sequence_invalidate_cache_for_modifier(scene, seq);
871 static void rna_SequenceEditor_overlay_lock_set(PointerRNA *ptr, int value)
873 Scene *scene = ptr->id.data;
874 Editing *ed = BKE_sequencer_editing_get(scene, false);
879 /* convert from abs to relative and back */
880 if ((ed->over_flag & SEQ_EDIT_OVERLAY_ABS) == 0 && value) {
881 ed->over_cfra = scene->r.cfra + ed->over_ofs;
882 ed->over_flag |= SEQ_EDIT_OVERLAY_ABS;
884 else if ((ed->over_flag & SEQ_EDIT_OVERLAY_ABS) && !value) {
885 ed->over_ofs = ed->over_cfra - scene->r.cfra;
886 ed->over_flag &= ~SEQ_EDIT_OVERLAY_ABS;
890 static int rna_SequenceEditor_overlay_frame_get(PointerRNA *ptr)
892 Scene *scene = (Scene *)ptr->id.data;
893 Editing *ed = BKE_sequencer_editing_get(scene, false);
896 return scene->r.cfra;
898 if (ed->over_flag & SEQ_EDIT_OVERLAY_ABS)
899 return ed->over_cfra - scene->r.cfra;
905 static void rna_SequenceEditor_overlay_frame_set(PointerRNA *ptr, int value)
907 Scene *scene = (Scene *)ptr->id.data;
908 Editing *ed = BKE_sequencer_editing_get(scene, false);
914 if (ed->over_flag & SEQ_EDIT_OVERLAY_ABS)
915 ed->over_cfra = (scene->r.cfra + value);
917 ed->over_ofs = value;
920 static int modifier_seq_cmp_cb(Sequence *seq, void *arg_pt)
922 SequenceSearchData *data = arg_pt;
924 if (BLI_findindex(&seq->modifiers, data->data) != -1) {
926 return -1; /* done so bail out */
932 static Sequence *sequence_get_by_modifier(Editing *ed, SequenceModifierData *smd)
934 SequenceSearchData data;
939 /* irritating we need to search for our sequence! */
940 BKE_sequencer_base_recursive_apply(&ed->seqbase, modifier_seq_cmp_cb, &data);
945 static StructRNA *rna_SequenceModifier_refine(struct PointerRNA *ptr)
947 SequenceModifierData *smd = (SequenceModifierData *) ptr->data;
950 case seqModifierType_ColorBalance:
951 return &RNA_ColorBalanceModifier;
952 case seqModifierType_Curves:
953 return &RNA_CurvesModifier;
954 case seqModifierType_HueCorrect:
955 return &RNA_HueCorrectModifier;
956 case seqModifierType_BrightContrast:
957 return &RNA_BrightContrastModifier;
959 return &RNA_SequenceModifier;
963 static char *rna_SequenceModifier_path(PointerRNA *ptr)
965 Scene *scene = ptr->id.data;
966 Editing *ed = BKE_sequencer_editing_get(scene, false);
967 SequenceModifierData *smd = ptr->data;
968 Sequence *seq = sequence_get_by_modifier(ed, smd);
970 if (seq && seq->name + 2) {
971 char name_esc[(sizeof(seq->name) - 2) * 2];
972 char name_esc_smd[sizeof(smd->name) * 2];
974 BLI_strescape(name_esc, seq->name + 2, sizeof(name_esc));
975 BLI_strescape(name_esc_smd, smd->name, sizeof(name_esc_smd));
976 return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].modifiers[\"%s\"]",
977 name_esc, name_esc_smd);
980 return BLI_strdup("");
984 static void rna_SequenceModifier_name_set(PointerRNA *ptr, const char *value)
986 SequenceModifierData *smd = ptr->data;
987 Scene *scene = (Scene *) ptr->id.data;
988 Editing *ed = BKE_sequencer_editing_get(scene, false);
989 Sequence *seq = sequence_get_by_modifier(ed, smd);
991 char oldname[sizeof(smd->name)];
993 /* make a copy of the old name first */
994 BLI_strncpy(oldname, smd->name, sizeof(smd->name));
996 /* copy the new name into the name slot */
997 BLI_strncpy_utf8(smd->name, value, sizeof(smd->name));
999 /* make sure the name is truly unique */
1000 BKE_sequence_modifier_unique_name(seq, smd);
1002 /* fix all the animation data which may link to this */
1003 adt = BKE_animdata_from_id(&scene->id);
1007 BLI_snprintf(path, sizeof(path), "sequence_editor.sequences_all[\"%s\"].modifiers", seq->name + 2);
1008 BKE_animdata_fix_paths_rename(&scene->id, adt, NULL, path, oldname, smd->name, 0, 0, 1);
1012 static void rna_SequenceModifier_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
1014 /* strip from other scenes could be modified, so using active scene is not reliable */
1015 Scene *scene = (Scene *) ptr->id.data;
1016 Editing *ed = BKE_sequencer_editing_get(scene, false);
1017 Sequence *seq = sequence_get_by_modifier(ed, ptr->data);
1019 BKE_sequence_invalidate_cache_for_modifier(scene, seq);
1022 static int rna_SequenceModifier_otherSequence_poll(PointerRNA *ptr, PointerRNA value)
1024 Scene *scene = (Scene *) ptr->id.data;
1025 Editing *ed = BKE_sequencer_editing_get(scene, false);
1026 Sequence *seq = sequence_get_by_modifier(ed, ptr->data);
1027 Sequence *cur = (Sequence *) value.data;
1035 static SequenceModifierData *rna_Sequence_modifier_new(Sequence *seq, bContext *C, ReportList *reports, const char *name, int type)
1037 if (!BKE_sequence_supports_modifiers(seq)) {
1038 BKE_report(reports, RPT_ERROR, "Sequence type does not support modifiers");
1043 Scene *scene = CTX_data_scene(C);
1044 SequenceModifierData *smd;
1046 smd = BKE_sequence_modifier_new(seq, name, type);
1048 BKE_sequence_invalidate_cache_for_modifier(scene, seq);
1050 WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, NULL);
1056 static void rna_Sequence_modifier_remove(Sequence *seq, bContext *C, ReportList *reports, PointerRNA *smd_ptr)
1058 SequenceModifierData *smd = smd_ptr->data;
1059 Scene *scene = CTX_data_scene(C);
1061 if (BKE_sequence_modifier_remove(seq, smd) == false) {
1062 BKE_report(reports, RPT_ERROR, "Modifier was not found in the stack");
1066 RNA_POINTER_INVALIDATE(smd_ptr);
1067 BKE_sequence_invalidate_cache_for_modifier(scene, seq);
1069 WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, NULL);
1072 static void rna_Sequence_modifier_clear(Sequence *seq, bContext *C)
1074 Scene *scene = CTX_data_scene(C);
1076 BKE_sequence_modifier_clear(seq);
1078 BKE_sequence_invalidate_cache_for_modifier(scene, seq);
1080 WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, NULL);
1085 static void rna_def_strip_element(BlenderRNA *brna)
1090 srna = RNA_def_struct(brna, "SequenceElement", NULL);
1091 RNA_def_struct_ui_text(srna, "Sequence Element", "Sequence strip data for a single frame");
1092 RNA_def_struct_sdna(srna, "StripElem");
1094 prop = RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME);
1095 RNA_def_property_string_sdna(prop, NULL, "name");
1096 RNA_def_property_ui_text(prop, "Filename", "");
1097 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceElement_update");
1099 prop = RNA_def_property(srna, "orig_width", PROP_INT, PROP_NONE);
1100 RNA_def_property_int_sdna(prop, NULL, "orig_width");
1101 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1102 RNA_def_property_ui_text(prop, "Orig Width", "Original image width");
1104 prop = RNA_def_property(srna, "orig_height", PROP_INT, PROP_NONE);
1105 RNA_def_property_int_sdna(prop, NULL, "orig_height");
1106 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1107 RNA_def_property_ui_text(prop, "Orig Height", "Original image height");
1110 static void rna_def_strip_crop(BlenderRNA *brna)
1115 srna = RNA_def_struct(brna, "SequenceCrop", NULL);
1116 RNA_def_struct_ui_text(srna, "Sequence Crop", "Cropping parameters for a sequence strip");
1117 RNA_def_struct_sdna(srna, "StripCrop");
1119 prop = RNA_def_property(srna, "max_y", PROP_INT, PROP_UNSIGNED);
1120 RNA_def_property_int_sdna(prop, NULL, "top");
1121 RNA_def_property_ui_text(prop, "Top", "");
1122 RNA_def_property_ui_range(prop, 0, 4096, 1, -1);
1123 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceCrop_update");
1125 prop = RNA_def_property(srna, "min_y", PROP_INT, PROP_UNSIGNED);
1126 RNA_def_property_int_sdna(prop, NULL, "bottom");
1127 RNA_def_property_ui_text(prop, "Bottom", "");
1128 RNA_def_property_ui_range(prop, 0, 4096, 1, -1);
1129 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceCrop_update");
1131 prop = RNA_def_property(srna, "min_x", PROP_INT, PROP_UNSIGNED);
1132 RNA_def_property_int_sdna(prop, NULL, "left");
1133 RNA_def_property_ui_text(prop, "Left", "");
1134 RNA_def_property_ui_range(prop, 0, 4096, 1, -1);
1135 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceCrop_update");
1137 prop = RNA_def_property(srna, "max_x", PROP_INT, PROP_UNSIGNED);
1138 RNA_def_property_int_sdna(prop, NULL, "right");
1139 RNA_def_property_ui_text(prop, "Right", "");
1140 RNA_def_property_ui_range(prop, 0, 4096, 1, -1);
1141 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceCrop_update");
1143 RNA_def_struct_path_func(srna, "rna_SequenceCrop_path");
1146 static void rna_def_strip_transform(BlenderRNA *brna)
1151 srna = RNA_def_struct(brna, "SequenceTransform", NULL);
1152 RNA_def_struct_ui_text(srna, "Sequence Transform", "Transform parameters for a sequence strip");
1153 RNA_def_struct_sdna(srna, "StripTransform");
1155 prop = RNA_def_property(srna, "offset_x", PROP_INT, PROP_NONE);
1156 RNA_def_property_int_sdna(prop, NULL, "xofs");
1157 RNA_def_property_ui_text(prop, "Offset X", "");
1158 RNA_def_property_ui_range(prop, -4096, 4096, 1, -1);
1159 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceTransform_update");
1161 prop = RNA_def_property(srna, "offset_y", PROP_INT, PROP_NONE);
1162 RNA_def_property_int_sdna(prop, NULL, "yofs");
1163 RNA_def_property_ui_text(prop, "Offset Y", "");
1164 RNA_def_property_ui_range(prop, -4096, 4096, 1, -1);
1165 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceTransform_update");
1167 RNA_def_struct_path_func(srna, "rna_SequenceTransform_path");
1171 static void rna_def_strip_proxy(BlenderRNA *brna)
1176 static const EnumPropertyItem seq_tc_items[] = {
1177 {SEQ_PROXY_TC_NONE, "NONE", 0, "No TC in use", ""},
1178 {SEQ_PROXY_TC_RECORD_RUN, "RECORD_RUN", 0, "Record Run",
1179 "Use images in the order as they are recorded"},
1180 {SEQ_PROXY_TC_FREE_RUN, "FREE_RUN", 0, "Free Run",
1181 "Use global timestamp written by recording device"},
1182 {SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN, "FREE_RUN_REC_DATE", 0, "Free Run (rec date)",
1183 "Interpolate a global timestamp using the "
1184 "record date and time written by recording device"},
1185 {SEQ_PROXY_TC_RECORD_RUN_NO_GAPS, "RECORD_RUN_NO_GAPS", 0, "Record Run No Gaps",
1186 "Like record run, but ignore timecode, "
1187 "changes in framerate or dropouts"},
1188 {0, NULL, 0, NULL, NULL}
1191 srna = RNA_def_struct(brna, "SequenceProxy", NULL);
1192 RNA_def_struct_ui_text(srna, "Sequence Proxy", "Proxy parameters for a sequence strip");
1193 RNA_def_struct_sdna(srna, "StripProxy");
1195 prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
1196 RNA_def_property_string_sdna(prop, NULL, "dir");
1197 RNA_def_property_ui_text(prop, "Directory", "Location to store the proxy files");
1198 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceProxy_update");
1200 prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
1201 RNA_def_property_ui_text(prop, "Path", "Location of custom proxy file");
1202 RNA_def_property_string_funcs(prop, "rna_Sequence_proxy_filepath_get", "rna_Sequence_proxy_filepath_length",
1203 "rna_Sequence_proxy_filepath_set");
1205 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceProxy_update");
1207 prop = RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
1208 RNA_def_property_boolean_negative_sdna(prop, NULL, "build_flags", SEQ_PROXY_SKIP_EXISTING);
1209 RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing proxy files when building");
1211 prop = RNA_def_property(srna, "build_25", PROP_BOOLEAN, PROP_NONE);
1212 RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_25);
1213 RNA_def_property_ui_text(prop, "25%", "Build 25% proxy resolution");
1215 prop = RNA_def_property(srna, "build_50", PROP_BOOLEAN, PROP_NONE);
1216 RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_50);
1217 RNA_def_property_ui_text(prop, "50%", "Build 50% proxy resolution");
1219 prop = RNA_def_property(srna, "build_75", PROP_BOOLEAN, PROP_NONE);
1220 RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_75);
1221 RNA_def_property_ui_text(prop, "75%", "Build 75% proxy resolution");
1223 prop = RNA_def_property(srna, "build_100", PROP_BOOLEAN, PROP_NONE);
1224 RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_100);
1225 RNA_def_property_ui_text(prop, "100%", "Build 100% proxy resolution");
1227 prop = RNA_def_property(srna, "build_record_run", PROP_BOOLEAN, PROP_NONE);
1228 RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flags", SEQ_PROXY_TC_RECORD_RUN);
1229 RNA_def_property_ui_text(prop, "Rec Run", "Build record run time code index");
1231 prop = RNA_def_property(srna, "build_free_run", PROP_BOOLEAN, PROP_NONE);
1232 RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flags", SEQ_PROXY_TC_FREE_RUN);
1233 RNA_def_property_ui_text(prop, "Free Run", "Build free run time code index");
1235 prop = RNA_def_property(srna, "build_free_run_rec_date", PROP_BOOLEAN, PROP_NONE);
1236 RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flags", SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN);
1237 RNA_def_property_ui_text(prop, "Free Run (Rec Date)", "Build free run time code index using Record Date/Time");
1239 prop = RNA_def_property(srna, "quality", PROP_INT, PROP_UNSIGNED);
1240 RNA_def_property_int_sdna(prop, NULL, "quality");
1241 RNA_def_property_ui_text(prop, "Quality", "JPEG Quality of proxies to build");
1242 RNA_def_property_ui_range(prop, 1, 100, 1, -1);
1244 prop = RNA_def_property(srna, "timecode", PROP_ENUM, PROP_NONE);
1245 RNA_def_property_enum_sdna(prop, NULL, "tc");
1246 RNA_def_property_enum_items(prop, seq_tc_items);
1247 RNA_def_property_ui_text(prop, "Timecode", "");
1248 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_tcindex_update");
1250 prop = RNA_def_property(srna, "use_proxy_custom_directory", PROP_BOOLEAN, PROP_NONE);
1251 RNA_def_property_boolean_sdna(prop, NULL, "storage", SEQ_STORAGE_PROXY_CUSTOM_DIR);
1252 RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Use a custom directory to store data");
1253 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1255 prop = RNA_def_property(srna, "use_proxy_custom_file", PROP_BOOLEAN, PROP_NONE);
1256 RNA_def_property_boolean_sdna(prop, NULL, "storage", SEQ_STORAGE_PROXY_CUSTOM_FILE);
1257 RNA_def_property_ui_text(prop, "Proxy Custom File", "Use a custom file to read proxy data from");
1258 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1261 static void rna_def_color_balance(BlenderRNA *brna)
1266 srna = RNA_def_struct(brna, "SequenceColorBalanceData", NULL);
1267 RNA_def_struct_ui_text(srna, "Sequence Color Balance Data", "Color balance parameters for a sequence strip and it's modifiers");
1268 RNA_def_struct_sdna(srna, "StripColorBalance");
1270 prop = RNA_def_property(srna, "lift", PROP_FLOAT, PROP_COLOR_GAMMA);
1271 RNA_def_property_ui_text(prop, "Lift", "Color balance lift (shadows)");
1272 RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
1273 RNA_def_property_float_default(prop, 1.0f);
1274 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
1276 prop = RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_COLOR_GAMMA);
1277 RNA_def_property_ui_text(prop, "Gamma", "Color balance gamma (midtones)");
1278 RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
1279 RNA_def_property_float_default(prop, 1.0f);
1280 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
1282 prop = RNA_def_property(srna, "gain", PROP_FLOAT, PROP_COLOR_GAMMA);
1283 RNA_def_property_ui_text(prop, "Gain", "Color balance gain (highlights)");
1284 RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
1285 RNA_def_property_float_default(prop, 1.0f);
1286 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
1288 prop = RNA_def_property(srna, "invert_gain", PROP_BOOLEAN, PROP_NONE);
1289 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_GAIN);
1290 RNA_def_property_ui_text(prop, "Inverse Gain", "");
1291 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
1293 prop = RNA_def_property(srna, "invert_gamma", PROP_BOOLEAN, PROP_NONE);
1294 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_GAMMA);
1295 RNA_def_property_ui_text(prop, "Inverse Gamma", "");
1296 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
1298 prop = RNA_def_property(srna, "invert_lift", PROP_BOOLEAN, PROP_NONE);
1299 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_LIFT);
1300 RNA_def_property_ui_text(prop, "Inverse Lift", "");
1301 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
1305 prop = RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE);
1306 RNA_def_property_range(prop, 0.0f, 1.0f);
1307 RNA_def_property_ui_text(prop, "Exposure", "");
1308 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_ColorBabalnce_update");
1310 prop = RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE);
1311 RNA_def_property_range(prop, 0.0f, 1.0f);
1312 RNA_def_property_ui_text(prop, "Saturation", "");
1313 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_ColorBabalnce_update");
1316 RNA_def_struct_path_func(srna, "rna_SequenceColorBalance_path");
1319 static void rna_def_strip_color_balance(BlenderRNA *brna)
1323 srna = RNA_def_struct(brna, "SequenceColorBalance", "SequenceColorBalanceData");
1324 RNA_def_struct_ui_text(srna, "Sequence Color Balance", "Color balance parameters for a sequence strip");
1325 RNA_def_struct_sdna(srna, "StripColorBalance");
1328 static EnumPropertyItem blend_mode_items[] = {
1329 {SEQ_BLEND_REPLACE, "REPLACE", 0, "Replace", ""},
1330 {SEQ_TYPE_CROSS, "CROSS", 0, "Cross", ""},
1331 {SEQ_TYPE_ADD, "ADD", 0, "Add", ""},
1332 {SEQ_TYPE_SUB, "SUBTRACT", 0, "Subtract", ""},
1333 {SEQ_TYPE_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
1334 {SEQ_TYPE_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
1335 {SEQ_TYPE_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
1336 {SEQ_TYPE_MUL, "MULTIPLY", 0, "Multiply", ""},
1337 {SEQ_TYPE_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
1338 {0, NULL, 0, NULL, NULL}
1341 static void rna_def_sequence_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
1348 RNA_def_property_srna(cprop, "SequenceModifiers");
1349 srna = RNA_def_struct(brna, "SequenceModifiers", NULL);
1350 RNA_def_struct_sdna(srna, "Sequence");
1351 RNA_def_struct_ui_text(srna, "Strip Modifiers", "Collection of strip modifiers");
1354 func = RNA_def_function(srna, "new", "rna_Sequence_modifier_new");
1355 RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
1356 RNA_def_function_ui_description(func, "Add a new modifier");
1357 parm = RNA_def_string(func, "name", "Name", 0, "", "New name for the modifier");
1358 RNA_def_property_flag(parm, PROP_REQUIRED);
1359 /* modifier to add */
1360 parm = RNA_def_enum(func, "type", sequence_modifier_type_items, seqModifierType_ColorBalance, "", "Modifier type to add");
1361 RNA_def_property_flag(parm, PROP_REQUIRED);
1363 parm = RNA_def_pointer(func, "modifier", "SequenceModifier", "", "Newly created modifier");
1364 RNA_def_function_return(func, parm);
1366 /* remove modifier */
1367 func = RNA_def_function(srna, "remove", "rna_Sequence_modifier_remove");
1368 RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
1369 RNA_def_function_ui_description(func, "Remove an existing modifier from the sequence");
1370 /* modifier to remove */
1371 parm = RNA_def_pointer(func, "modifier", "SequenceModifier", "", "Modifier to remove");
1372 RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
1373 RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
1375 /* clear all modifiers */
1376 func = RNA_def_function(srna, "clear", "rna_Sequence_modifier_clear");
1377 RNA_def_function_flag(func, FUNC_USE_CONTEXT);
1378 RNA_def_function_ui_description(func, "Remove all modifiers from the sequence");
1381 static void rna_def_sequence(BlenderRNA *brna)
1386 static const EnumPropertyItem seq_type_items[] = {
1387 {SEQ_TYPE_IMAGE, "IMAGE", 0, "Image", ""},
1388 {SEQ_TYPE_META, "META", 0, "Meta", ""},
1389 {SEQ_TYPE_SCENE, "SCENE", 0, "Scene", ""},
1390 {SEQ_TYPE_MOVIE, "MOVIE", 0, "Movie", ""},
1391 {SEQ_TYPE_MOVIECLIP, "MOVIECLIP", 0, "Clip", ""},
1392 {SEQ_TYPE_MASK, "MASK", 0, "Mask", ""},
1393 {SEQ_TYPE_SOUND_RAM, "SOUND", 0, "Sound", ""},
1394 {SEQ_TYPE_CROSS, "CROSS", 0, "Cross", ""},
1395 {SEQ_TYPE_ADD, "ADD", 0, "Add", ""},
1396 {SEQ_TYPE_SUB, "SUBTRACT", 0, "Subtract", ""},
1397 {SEQ_TYPE_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
1398 {SEQ_TYPE_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
1399 {SEQ_TYPE_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
1400 {SEQ_TYPE_MUL, "MULTIPLY", 0, "Multiply", ""},
1401 {SEQ_TYPE_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
1402 {SEQ_TYPE_WIPE, "WIPE", 0, "Wipe", ""},
1403 {SEQ_TYPE_GLOW, "GLOW", 0, "Glow", ""},
1404 {SEQ_TYPE_TRANSFORM, "TRANSFORM", 0, "Transform", ""},
1405 {SEQ_TYPE_COLOR, "COLOR", 0, "Color", ""},
1406 {SEQ_TYPE_SPEED, "SPEED", 0, "Speed", ""},
1407 {SEQ_TYPE_MULTICAM, "MULTICAM", 0, "Multicam Selector", ""},
1408 {SEQ_TYPE_ADJUSTMENT, "ADJUSTMENT", 0, "Adjustment Layer", ""},
1409 {SEQ_TYPE_GAUSSIAN_BLUR, "GAUSSIAN_BLUR", 0, "Gaussian Blur", ""},
1410 {0, NULL, 0, NULL, NULL}
1413 srna = RNA_def_struct(brna, "Sequence", NULL);
1414 RNA_def_struct_ui_text(srna, "Sequence", "Sequence strip in the sequence editor");
1415 RNA_def_struct_refine_func(srna, "rna_Sequence_refine");
1416 RNA_def_struct_path_func(srna, "rna_Sequence_path");
1417 RNA_def_struct_idprops_func(srna, "rna_Sequence_idprops");
1419 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1420 RNA_def_property_string_funcs(prop, "rna_Sequence_name_get", "rna_Sequence_name_length", "rna_Sequence_name_set");
1421 RNA_def_property_string_maxlength(prop, sizeof(((Sequence *)NULL)->name) - 2);
1422 RNA_def_property_ui_text(prop, "Name", "");
1423 RNA_def_struct_name_property(srna, prop);
1424 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
1426 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
1427 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1428 RNA_def_property_enum_items(prop, seq_type_items);
1429 RNA_def_property_ui_text(prop, "Type", "");
1430 RNA_def_property_translation_context(prop, BLF_I18NCONTEXT_ID_SEQUENCE);
1431 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1435 prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
1436 RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
1437 RNA_def_property_ui_text(prop, "Select", "");
1438 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER | NA_SELECTED, NULL);
1440 prop = RNA_def_property(srna, "select_left_handle", PROP_BOOLEAN, PROP_NONE);
1441 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LEFTSEL);
1442 RNA_def_property_ui_text(prop, "Left Handle Selected", "");
1443 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER | NA_SELECTED, NULL);
1445 prop = RNA_def_property(srna, "select_right_handle", PROP_BOOLEAN, PROP_NONE);
1446 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_RIGHTSEL);
1447 RNA_def_property_ui_text(prop, "Right Handle Selected", "");
1448 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER | NA_SELECTED, NULL);
1450 prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
1451 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MUTE);
1452 RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, true);
1453 RNA_def_property_ui_text(prop, "Mute", "");
1454 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_mute_update");
1456 prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
1457 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LOCK);
1458 RNA_def_property_ui_icon(prop, ICON_UNLOCKED, true);
1459 RNA_def_property_ui_text(prop, "Lock", "Lock strip so that it can't be transformed");
1460 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
1462 /* strip positioning */
1463 prop = RNA_def_property(srna, "frame_final_duration", PROP_INT, PROP_TIME);
1464 RNA_def_property_range(prop, 1, MAXFRAME);
1465 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1466 RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip after the handles are applied");
1467 RNA_def_property_int_funcs(prop, "rna_Sequence_frame_length_get", "rna_Sequence_frame_length_set", NULL);
1468 RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
1469 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1471 prop = RNA_def_property(srna, "frame_duration", PROP_INT, PROP_TIME);
1472 RNA_def_property_int_sdna(prop, NULL, "len");
1473 RNA_def_property_clear_flag(prop, PROP_EDITABLE | PROP_ANIMATABLE);
1474 RNA_def_property_range(prop, 1, MAXFRAME);
1475 RNA_def_property_ui_text(prop, "Length",
1476 "The length of the contents of this strip before the handles are applied");
1478 prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
1479 RNA_def_property_int_sdna(prop, NULL, "start");
1480 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1481 RNA_def_property_ui_text(prop, "Start Frame", "");
1482 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_set", NULL); /* overlap tests and calc_seq_disp */
1483 RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
1484 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1486 prop = RNA_def_property(srna, "frame_final_start", PROP_INT, PROP_TIME);
1487 RNA_def_property_int_sdna(prop, NULL, "startdisp");
1488 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1489 RNA_def_property_ui_text(prop, "Start Frame",
1490 "Start frame displayed in the sequence editor after offsets are applied, setting this is "
1491 "equivalent to moving the handle, not the actual start frame");
1492 /* overlap tests and calc_seq_disp */
1493 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_final_set", NULL);
1494 RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
1495 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1497 prop = RNA_def_property(srna, "frame_final_end", PROP_INT, PROP_TIME);
1498 RNA_def_property_int_sdna(prop, NULL, "enddisp");
1499 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1500 RNA_def_property_ui_text(prop, "End Frame",
1501 "End frame displayed in the sequence editor after offsets are applied");
1502 /* overlap tests and calc_seq_disp */
1503 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_end_frame_final_set", NULL);
1504 RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
1505 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1507 prop = RNA_def_property(srna, "frame_offset_start", PROP_INT, PROP_TIME);
1508 RNA_def_property_int_sdna(prop, NULL, "startofs");
1509 // RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
1510 RNA_def_property_ui_text(prop, "Start Offset", "");
1511 RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Sequence_frame_offset_range");
1512 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update");
1514 prop = RNA_def_property(srna, "frame_offset_end", PROP_INT, PROP_TIME);
1515 RNA_def_property_int_sdna(prop, NULL, "endofs");
1516 // RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
1517 RNA_def_property_ui_text(prop, "End Offset", "");
1518 RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Sequence_frame_offset_range");
1519 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update");
1521 prop = RNA_def_property(srna, "frame_still_start", PROP_INT, PROP_TIME);
1522 RNA_def_property_int_sdna(prop, NULL, "startstill");
1523 // RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
1524 RNA_def_property_range(prop, 0, MAXFRAME);
1525 RNA_def_property_ui_text(prop, "Start Still", "");
1526 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update");
1528 prop = RNA_def_property(srna, "frame_still_end", PROP_INT, PROP_TIME);
1529 RNA_def_property_int_sdna(prop, NULL, "endstill");
1530 // RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
1531 RNA_def_property_range(prop, 0, MAXFRAME);
1532 RNA_def_property_ui_text(prop, "End Still", "");
1533 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update");
1535 prop = RNA_def_property(srna, "channel", PROP_INT, PROP_UNSIGNED);
1536 RNA_def_property_int_sdna(prop, NULL, "machine");
1537 RNA_def_property_range(prop, 1, MAXSEQ);
1538 RNA_def_property_ui_text(prop, "Channel", "Y position of the sequence strip");
1539 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_channel_set", NULL); /* overlap test */
1540 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1542 prop = RNA_def_property(srna, "use_linear_modifiers", PROP_BOOLEAN, PROP_NONE);
1543 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_LINEAR_MODIFIERS);
1544 RNA_def_property_ui_text(prop, "Use Linear Modifiers", "Calculate modifiers in linear space instead of sequencer's space");
1545 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1549 prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
1550 RNA_def_property_enum_sdna(prop, NULL, "blend_mode");
1551 RNA_def_property_enum_items(prop, blend_mode_items);
1552 RNA_def_property_ui_text(prop, "Blend Mode", "");
1553 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1555 prop = RNA_def_property(srna, "blend_alpha", PROP_FLOAT, PROP_FACTOR);
1556 RNA_def_property_range(prop, 0.0f, 1.0f);
1557 RNA_def_property_ui_text(prop, "Blend Opacity", "");
1558 /* stupid 0-100 -> 0-1 */
1559 RNA_def_property_float_funcs(prop, "rna_Sequence_opacity_get", "rna_Sequence_opacity_set", NULL);
1560 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1562 prop = RNA_def_property(srna, "effect_fader", PROP_FLOAT, PROP_NONE);
1563 RNA_def_property_range(prop, 0.0f, 1.0f);
1564 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
1565 RNA_def_property_float_sdna(prop, NULL, "effect_fader");
1566 RNA_def_property_ui_text(prop, "Effect fader position", "");
1567 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1569 prop = RNA_def_property(srna, "use_default_fade", PROP_BOOLEAN, PROP_NONE);
1570 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_EFFECT_DEFAULT_FADE);
1571 RNA_def_property_ui_text(prop, "Use Default Fade",
1572 "Fade effect using the built-in default (usually make transition as long as "
1574 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1577 prop = RNA_def_property(srna, "speed_factor", PROP_FLOAT, PROP_NONE);
1578 RNA_def_property_float_sdna(prop, NULL, "speed_fader");
1579 RNA_def_property_ui_text(prop, "Speed factor",
1580 "Multiply the current speed of the sequence with this number or remap current frame "
1582 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1585 prop = RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE);
1586 RNA_def_property_struct_type(prop, "SequenceModifier");
1587 RNA_def_property_ui_text(prop, "Modifiers", "Modifiers affecting this strip");
1588 rna_def_sequence_modifiers(brna, prop);
1590 RNA_api_sequence_strip(srna);
1593 static void rna_def_editor(BlenderRNA *brna)
1598 static const EnumPropertyItem editing_storage_items[] = {
1599 {0, "PER_STRIP", 0, "Per Strip", "Store proxies using per strip settings"},
1600 {SEQ_EDIT_PROXY_DIR_STORAGE, "PROJECT", 0, "Project", "Store proxies using project directory"},
1601 {0, NULL, 0, NULL, NULL}
1603 srna = RNA_def_struct(brna, "SequenceEditor", NULL);
1604 RNA_def_struct_ui_text(srna, "Sequence Editor", "Sequence editing data for a Scene datablock");
1605 RNA_def_struct_ui_icon(srna, ICON_SEQUENCE);
1606 RNA_def_struct_sdna(srna, "Editing");
1608 prop = RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE);
1609 RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
1610 RNA_def_property_struct_type(prop, "Sequence");
1611 RNA_def_property_ui_text(prop, "Sequences", "Top-level strips only");
1612 RNA_api_sequences(brna, prop);
1614 prop = RNA_def_property(srna, "sequences_all", PROP_COLLECTION, PROP_NONE);
1615 RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
1616 RNA_def_property_struct_type(prop, "Sequence");
1617 RNA_def_property_ui_text(prop, "All Sequences", "All strips, recursively including those inside metastrips");
1618 RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_sequences_all_begin",
1619 "rna_SequenceEditor_sequences_all_next", NULL, NULL, NULL, NULL, NULL, NULL);
1621 prop = RNA_def_property(srna, "meta_stack", PROP_COLLECTION, PROP_NONE);
1622 RNA_def_property_collection_sdna(prop, NULL, "metastack", NULL);
1623 RNA_def_property_struct_type(prop, "Sequence");
1624 RNA_def_property_ui_text(prop, "Meta Stack", "Meta strip stack, last is currently edited meta strip");
1625 RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_SequenceEditor_meta_stack_get",
1626 NULL, NULL, NULL, NULL);
1628 prop = RNA_def_property(srna, "active_strip", PROP_POINTER, PROP_NONE);
1629 RNA_def_property_pointer_sdna(prop, NULL, "act_seq");
1630 RNA_def_property_flag(prop, PROP_EDITABLE);
1631 RNA_def_property_ui_text(prop, "Active Strip", "Sequencer's active strip");
1633 prop = RNA_def_property(srna, "show_overlay", PROP_BOOLEAN, PROP_NONE);
1634 RNA_def_property_boolean_sdna(prop, NULL, "over_flag", SEQ_EDIT_OVERLAY_SHOW);
1635 RNA_def_property_ui_text(prop, "Draw Axes", "Partial overlay on top of the sequencer");
1636 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
1638 prop = RNA_def_property(srna, "use_overlay_lock", PROP_BOOLEAN, PROP_NONE);
1639 RNA_def_property_boolean_sdna(prop, NULL, "over_flag", SEQ_EDIT_OVERLAY_ABS);
1640 RNA_def_property_ui_text(prop, "Overlay Lock", "");
1641 RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_overlay_lock_set");
1642 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
1644 /* access to fixed and relative frame */
1645 prop = RNA_def_property(srna, "overlay_frame", PROP_INT, PROP_NONE);
1646 RNA_def_property_ui_text(prop, "Overlay Offset", "");
1647 RNA_def_property_int_funcs(prop, "rna_SequenceEditor_overlay_frame_get",
1648 "rna_SequenceEditor_overlay_frame_set", NULL);
1649 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
1651 prop = RNA_def_property(srna, "proxy_storage", PROP_ENUM, PROP_NONE);
1652 RNA_def_property_enum_items(prop, editing_storage_items);
1653 RNA_def_property_ui_text(prop, "Proxy Storage", "How to store proxies for this project");
1654 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache");
1656 prop = RNA_def_property(srna, "proxy_dir", PROP_STRING, PROP_DIRPATH);
1657 RNA_def_property_string_sdna(prop, NULL, "proxy_dir");
1658 RNA_def_property_ui_text(prop, "Proxy Directory", "");
1659 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache");
1662 static void rna_def_filter_video(StructRNA *srna)
1666 static const EnumPropertyItem alpha_mode_items[] = {
1667 {SEQ_ALPHA_STRAIGHT, "STRAIGHT", 0, "Straight", "RGB channels in transparent pixels are unaffected by the alpha channel"},
1668 {SEQ_ALPHA_PREMUL, "PREMUL", 0, "Premultiplied", "RGB channels in transparent pixels are multiplied by the alpha channel"},
1669 {0, NULL, 0, NULL, NULL}
1672 prop = RNA_def_property(srna, "use_deinterlace", PROP_BOOLEAN, PROP_NONE);
1673 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FILTERY);
1674 RNA_def_property_ui_text(prop, "De-Interlace", "For video movies to remove fields");
1675 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update_reopen_files");
1677 prop = RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE);
1678 RNA_def_property_enum_items(prop, alpha_mode_items);
1679 RNA_def_property_ui_text(prop, "Alpha Mode", "Representation of alpha information in the RGBA pixels");
1680 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1682 prop = RNA_def_property(srna, "use_flip_x", PROP_BOOLEAN, PROP_NONE);
1683 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPX);
1684 RNA_def_property_ui_text(prop, "Flip X", "Flip on the X axis");
1685 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1687 prop = RNA_def_property(srna, "use_flip_y", PROP_BOOLEAN, PROP_NONE);
1688 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPY);
1689 RNA_def_property_ui_text(prop, "Flip Y", "Flip on the Y axis");
1690 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1692 prop = RNA_def_property(srna, "use_float", PROP_BOOLEAN, PROP_NONE);
1693 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_FLOAT);
1694 RNA_def_property_ui_text(prop, "Convert Float", "Convert input to float data");
1695 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1697 prop = RNA_def_property(srna, "use_reverse_frames", PROP_BOOLEAN, PROP_NONE);
1698 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_REVERSE_FRAMES);
1699 RNA_def_property_ui_text(prop, "Flip Time", "Reverse frame order");
1700 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1702 prop = RNA_def_property(srna, "color_multiply", PROP_FLOAT, PROP_UNSIGNED);
1703 RNA_def_property_float_sdna(prop, NULL, "mul");
1704 RNA_def_property_range(prop, 0.0f, 20.0f);
1705 RNA_def_property_float_default(prop, 1.0f);
1706 RNA_def_property_ui_text(prop, "Multiply Colors", "");
1707 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1709 prop = RNA_def_property(srna, "color_saturation", PROP_FLOAT, PROP_UNSIGNED);
1710 RNA_def_property_float_sdna(prop, NULL, "sat");
1711 RNA_def_property_range(prop, 0.0f, 20.0f);
1712 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 3, 3);
1713 RNA_def_property_float_default(prop, 1.0f);
1714 RNA_def_property_ui_text(prop, "Saturation", "");
1715 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1717 prop = RNA_def_property(srna, "strobe", PROP_FLOAT, PROP_NONE);
1718 RNA_def_property_range(prop, 1.0f, 30.0f);
1719 RNA_def_property_ui_text(prop, "Strobe", "Only display every nth frame");
1720 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1722 prop = RNA_def_property(srna, "use_translation", PROP_BOOLEAN, PROP_NONE);
1723 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_TRANSFORM);
1724 RNA_def_property_ui_text(prop, "Use Translation", "Translate image before processing");
1725 RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_translation_set");
1726 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1728 prop = RNA_def_property(srna, "transform", PROP_POINTER, PROP_NONE);
1729 RNA_def_property_pointer_sdna(prop, NULL, "strip->transform");
1730 RNA_def_property_ui_text(prop, "Transform", "");
1732 prop = RNA_def_property(srna, "use_crop", PROP_BOOLEAN, PROP_NONE);
1733 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_CROP);
1734 RNA_def_property_ui_text(prop, "Use Crop", "Crop image before processing");
1735 RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_crop_set");
1736 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1738 prop = RNA_def_property(srna, "crop", PROP_POINTER, PROP_NONE);
1739 RNA_def_property_pointer_sdna(prop, NULL, "strip->crop");
1740 RNA_def_property_ui_text(prop, "Crop", "");
1743 static void rna_def_proxy(StructRNA *srna)
1747 prop = RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE);
1748 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY);
1749 RNA_def_property_ui_text(prop, "Use Proxy / Timecode", "Use a preview proxy and/or timecode index for this strip");
1750 RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_proxy_set");
1752 prop = RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
1753 RNA_def_property_pointer_sdna(prop, NULL, "strip->proxy");
1754 RNA_def_property_ui_text(prop, "Proxy", "");
1757 static void rna_def_input(StructRNA *srna)
1761 prop = RNA_def_property(srna, "animation_offset_start", PROP_INT, PROP_UNSIGNED);
1762 RNA_def_property_int_sdna(prop, NULL, "anim_startofs");
1763 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1764 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_anim_startofs_final_set", NULL); /* overlap tests */
1765 RNA_def_property_ui_text(prop, "Animation Start Offset", "Animation start offset (trim start)");
1766 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1768 prop = RNA_def_property(srna, "animation_offset_end", PROP_INT, PROP_UNSIGNED);
1769 RNA_def_property_int_sdna(prop, NULL, "anim_endofs");
1770 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1771 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_anim_endofs_final_set", NULL); /* overlap tests */
1772 RNA_def_property_ui_text(prop, "Animation End Offset", "Animation end offset (trim end)");
1773 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1776 static void rna_def_effect_inputs(StructRNA *srna, int count)
1780 prop = RNA_def_property(srna, "input_count", PROP_INT, PROP_UNSIGNED);
1781 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1782 RNA_def_property_int_funcs(prop, "rna_Sequence_input_count_get", NULL, NULL);
1785 prop = RNA_def_property(srna, "input_1", PROP_POINTER, PROP_NONE);
1786 RNA_def_property_pointer_sdna(prop, NULL, "seq1");
1787 RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL);
1788 RNA_def_property_ui_text(prop, "Input 1", "First input for the effect strip");
1792 prop = RNA_def_property(srna, "input_2", PROP_POINTER, PROP_NONE);
1793 RNA_def_property_pointer_sdna(prop, NULL, "seq2");
1794 RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL);
1795 RNA_def_property_ui_text(prop, "Input 2", "Second input for the effect strip");
1799 if (count == 3) { // not used by any effects (perhaps one day plugins?)
1800 prop = RNA_def_property(srna, "input_3", PROP_POINTER, PROP_NONE);
1801 RNA_def_property_pointer_sdna(prop, NULL, "seq3");
1802 RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL);
1803 RNA_def_property_ui_text(prop, "Input 3", "Third input for the effect strip");
1808 static void rna_def_color_management(StructRNA *srna)
1812 prop = RNA_def_property(srna, "colorspace_settings", PROP_POINTER, PROP_NONE);
1813 RNA_def_property_pointer_sdna(prop, NULL, "strip->colorspace_settings");
1814 RNA_def_property_struct_type(prop, "ColorManagedInputColorspaceSettings");
1815 RNA_def_property_ui_text(prop, "Color Space Settings", "Input color space settings");
1818 static void rna_def_image(BlenderRNA *brna)
1823 srna = RNA_def_struct(brna, "ImageSequence", "Sequence");
1824 RNA_def_struct_ui_text(srna, "Image Sequence", "Sequence strip to load one or more images");
1825 RNA_def_struct_sdna(srna, "Sequence");
1827 prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
1828 RNA_def_property_string_sdna(prop, NULL, "strip->dir");
1829 RNA_def_property_ui_text(prop, "Directory", "");
1830 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1832 prop = RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE);
1833 RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", NULL);
1834 RNA_def_property_struct_type(prop, "SequenceElement");
1835 RNA_def_property_ui_text(prop, "Elements", "");
1836 RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_elements_begin", "rna_iterator_array_next",
1837 "rna_iterator_array_end", "rna_iterator_array_get",
1838 "rna_SequenceEditor_elements_length", NULL, NULL, NULL);
1839 RNA_api_sequence_elements(brna, prop);
1842 prop = RNA_def_property(srna, "use_multiview", PROP_BOOLEAN, PROP_NONE);
1843 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_VIEWS);
1844 RNA_def_property_ui_text(prop, "Use Multi-View", "Use Multiple Views (when available)");
1845 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_views_format_update");
1847 prop = RNA_def_property(srna, "views_format", PROP_ENUM, PROP_NONE);
1848 RNA_def_property_enum_sdna(prop, NULL, "views_format");
1849 RNA_def_property_enum_items(prop, views_format_items);
1850 RNA_def_property_ui_text(prop, "Views Format", "Mode to load image views");
1851 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Sequence_views_format_update");
1853 prop = RNA_def_property(srna, "stereo_3d_format", PROP_POINTER, PROP_NONE);
1854 RNA_def_property_pointer_sdna(prop, NULL, "stereo3d_format");
1855 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1856 RNA_def_property_struct_type(prop, "Stereo3dFormat");
1857 RNA_def_property_ui_text(prop, "Stereo 3D Format", "Settings for stereo 3d");
1859 rna_def_filter_video(srna);
1860 rna_def_proxy(srna);
1861 rna_def_input(srna);
1862 rna_def_color_management(srna);
1865 static void rna_def_meta(BlenderRNA *brna)
1870 srna = RNA_def_struct(brna, "MetaSequence", "Sequence");
1871 RNA_def_struct_ui_text(srna, "Meta Sequence", "Sequence strip to group other strips as a single sequence strip");
1872 RNA_def_struct_sdna(srna, "Sequence");
1874 prop = RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE);
1875 RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
1876 RNA_def_property_struct_type(prop, "Sequence");
1877 RNA_def_property_ui_text(prop, "Sequences", "");
1879 rna_def_filter_video(srna);
1880 rna_def_proxy(srna);
1881 rna_def_input(srna);
1884 static void rna_def_scene(BlenderRNA *brna)
1889 srna = RNA_def_struct(brna, "SceneSequence", "Sequence");
1890 RNA_def_struct_ui_text(srna, "Scene Sequence", "Sequence strip to used the rendered image of a scene");
1891 RNA_def_struct_sdna(srna, "Sequence");
1893 prop = RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
1894 RNA_def_property_flag(prop, PROP_EDITABLE);
1895 RNA_def_property_ui_text(prop, "Scene", "Scene that this sequence uses");
1896 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1898 prop = RNA_def_property(srna, "scene_camera", PROP_POINTER, PROP_NONE);
1899 RNA_def_property_flag(prop, PROP_EDITABLE);
1900 RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Camera_object_poll");
1901 RNA_def_property_ui_text(prop, "Camera Override", "Override the scenes active camera");
1902 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1904 prop = RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
1905 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SEQ_SCENE_NO_GPENCIL);
1906 RNA_def_property_ui_text(prop, "Use Grease Pencil", "Show Grease Pencil strokes in OpenGL previews");
1907 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1909 rna_def_filter_video(srna);
1910 rna_def_proxy(srna);
1911 rna_def_input(srna);
1914 static void rna_def_movie(BlenderRNA *brna)
1919 srna = RNA_def_struct(brna, "MovieSequence", "Sequence");
1920 RNA_def_struct_ui_text(srna, "Movie Sequence", "Sequence strip to load a video");
1921 RNA_def_struct_sdna(srna, "Sequence");
1923 prop = RNA_def_property(srna, "mpeg_preseek", PROP_INT, PROP_NONE);
1924 RNA_def_property_int_sdna(prop, NULL, "anim_preseek");
1925 RNA_def_property_range(prop, 0, 50);
1926 RNA_def_property_ui_text(prop, "MPEG Preseek", "For MPEG movies, preseek this many frames");
1927 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1929 prop = RNA_def_property(srna, "stream_index", PROP_INT, PROP_NONE);
1930 RNA_def_property_int_sdna(prop, NULL, "streamindex");
1931 RNA_def_property_range(prop, 0, 20);
1932 RNA_def_property_ui_text(prop, "Stream Index",
1933 "For files with several movie streams, use the stream with the given index");
1934 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update_reopen_files");
1936 prop = RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE);
1937 RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", NULL);
1938 RNA_def_property_struct_type(prop, "SequenceElement");
1939 RNA_def_property_ui_text(prop, "Elements", "");
1940 RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_elements_begin", "rna_iterator_array_next",
1941 "rna_iterator_array_end", "rna_iterator_array_get",
1942 "rna_SequenceEditor_elements_length", NULL, NULL, NULL);
1944 prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
1945 RNA_def_property_ui_text(prop, "File", "");
1946 RNA_def_property_string_funcs(prop, "rna_Sequence_filepath_get", "rna_Sequence_filepath_length",
1947 "rna_Sequence_filepath_set");
1948 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_filepath_update");
1951 prop = RNA_def_property(srna, "use_multiview", PROP_BOOLEAN, PROP_NONE);
1952 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_VIEWS);
1953 RNA_def_property_ui_text(prop, "Use Multi-View", "Use Multiple Views (when available)");
1954 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_views_format_update");
1956 prop = RNA_def_property(srna, "views_format", PROP_ENUM, PROP_NONE);
1957 RNA_def_property_enum_sdna(prop, NULL, "views_format");
1958 RNA_def_property_enum_items(prop, views_format_items);
1959 RNA_def_property_ui_text(prop, "Views Format", "Mode to load movie views");
1960 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Sequence_views_format_update");
1962 prop = RNA_def_property(srna, "stereo_3d_format", PROP_POINTER, PROP_NONE);
1963 RNA_def_property_pointer_sdna(prop, NULL, "stereo3d_format");
1964 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1965 RNA_def_property_struct_type(prop, "Stereo3dFormat");
1966 RNA_def_property_ui_text(prop, "Stereo 3D Format", "Settings for stereo 3d");
1968 rna_def_filter_video(srna);
1969 rna_def_proxy(srna);
1970 rna_def_input(srna);
1971 rna_def_color_management(srna);
1974 static void rna_def_movieclip(BlenderRNA *brna)
1979 srna = RNA_def_struct(brna, "MovieClipSequence", "Sequence");
1980 RNA_def_struct_ui_text(srna, "MovieClip Sequence", "Sequence strip to load a video from the clip editor");
1981 RNA_def_struct_sdna(srna, "Sequence");
1983 /* TODO - add clip property? */
1985 prop = RNA_def_property(srna, "undistort", PROP_BOOLEAN, PROP_NONE);
1986 RNA_def_property_boolean_sdna(prop, NULL, "clip_flag", SEQ_MOVIECLIP_RENDER_UNDISTORTED);
1987 RNA_def_property_ui_text(prop, "Undistort Clip", "Use the undistorted version of the clip");
1988 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1990 prop = RNA_def_property(srna, "stabilize2d", PROP_BOOLEAN, PROP_NONE);
1991 RNA_def_property_boolean_sdna(prop, NULL, "clip_flag", SEQ_MOVIECLIP_RENDER_STABILIZED);
1992 RNA_def_property_ui_text(prop, "Stabilize 2D Clip", "Use the 2D stabilized version of the clip");
1993 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
1995 rna_def_filter_video(srna);
1996 rna_def_input(srna);
1999 static void rna_def_mask(BlenderRNA *brna)
2004 srna = RNA_def_struct(brna, "MaskSequence", "Sequence");
2005 RNA_def_struct_ui_text(srna, "Mask Sequence", "Sequence strip to load a video from a mask");
2006 RNA_def_struct_sdna(srna, "Sequence");
2008 prop = RNA_def_property(srna, "mask", PROP_POINTER, PROP_NONE);
2009 RNA_def_property_flag(prop, PROP_EDITABLE);
2010 RNA_def_property_ui_text(prop, "Mask", "Mask that this sequence uses");
2011 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2013 rna_def_filter_video(srna);
2014 rna_def_input(srna);
2017 static void rna_def_sound(BlenderRNA *brna)
2022 srna = RNA_def_struct(brna, "SoundSequence", "Sequence");
2023 RNA_def_struct_ui_text(srna, "Sound Sequence",
2024 "Sequence strip defining a sound to be played over a period of time");
2025 RNA_def_struct_sdna(srna, "Sequence");
2027 prop = RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE);
2028 RNA_def_property_struct_type(prop, "Sound");
2029 RNA_def_property_ui_text(prop, "Sound", "Sound datablock used by this sequence");
2030 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2032 prop = RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
2033 RNA_def_property_float_sdna(prop, NULL, "volume");
2034 RNA_def_property_range(prop, 0.0f, 100.0f);
2035 RNA_def_property_ui_text(prop, "Volume", "Playback volume of the sound");
2036 RNA_def_property_translation_context(prop, BLF_I18NCONTEXT_ID_SOUND);
2037 RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_volume_set", NULL);
2038 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2040 prop = RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
2041 RNA_def_property_float_sdna(prop, NULL, "pitch");
2042 RNA_def_property_range(prop, 0.1f, 10.0f);
2043 RNA_def_property_ui_text(prop, "Pitch", "Playback pitch of the sound");
2044 RNA_def_property_translation_context(prop, BLF_I18NCONTEXT_ID_SOUND);
2045 RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_pitch_set", NULL);
2046 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2048 prop = RNA_def_property(srna, "pan", PROP_FLOAT, PROP_NONE);
2049 RNA_def_property_float_sdna(prop, NULL, "pan");
2050 RNA_def_property_range(prop, -2.0f, 2.0f);
2051 RNA_def_property_ui_text(prop, "Pan", "Playback panning of the sound (only for Mono sources)");
2052 RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_pan_set", NULL);
2053 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2055 prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
2056 RNA_def_property_ui_text(prop, "File", "");
2057 RNA_def_property_string_funcs(prop, "rna_Sequence_filepath_get", "rna_Sequence_filepath_length",
2058 "rna_Sequence_filepath_set");
2059 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_filepath_update");
2061 prop = RNA_def_property(srna, "show_waveform", PROP_BOOLEAN, PROP_NONE);
2062 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_AUDIO_DRAW_WAVEFORM);
2063 RNA_def_property_ui_text(prop, "Draw Waveform", "Whether to draw the sound's waveform");
2064 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
2066 rna_def_input(srna);
2069 static void rna_def_effect(BlenderRNA *brna)
2073 srna = RNA_def_struct(brna, "EffectSequence", "Sequence");
2074 RNA_def_struct_ui_text(srna, "Effect Sequence",
2075 "Sequence strip applying an effect on the images created by other strips");
2076 RNA_def_struct_sdna(srna, "Sequence");
2078 rna_def_filter_video(srna);
2079 rna_def_proxy(srna);
2082 static void rna_def_multicam(StructRNA *srna)
2086 prop = RNA_def_property(srna, "multicam_source", PROP_INT, PROP_UNSIGNED);
2087 RNA_def_property_int_sdna(prop, NULL, "multicam_source");
2088 RNA_def_property_range(prop, 0, MAXSEQ - 1);
2089 RNA_def_property_ui_text(prop, "Multicam Source Channel", "");
2090 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2092 rna_def_input(srna);
2095 static void rna_def_wipe(StructRNA *srna)
2099 static const EnumPropertyItem wipe_type_items[] = {
2100 {0, "SINGLE", 0, "Single", ""},
2101 {1, "DOUBLE", 0, "Double", ""},
2102 /* not used yet {2, "BOX", 0, "Box", ""}, */
2103 /* not used yet {3, "CROSS", 0, "Cross", ""}, */
2104 {4, "IRIS", 0, "Iris", ""},
2105 {5, "CLOCK", 0, "Clock", ""},
2106 {0, NULL, 0, NULL, NULL}
2109 static const EnumPropertyItem wipe_direction_items[] = {
2110 {0, "OUT", 0, "Out", ""},
2111 {1, "IN", 0, "In", ""},
2112 {0, NULL, 0, NULL, NULL}
2115 RNA_def_struct_sdna_from(srna, "WipeVars", "effectdata");
2117 prop = RNA_def_property(srna, "blur_width", PROP_FLOAT, PROP_UNSIGNED);
2118 RNA_def_property_float_sdna(prop, NULL, "edgeWidth");
2119 RNA_def_property_range(prop, 0.0f, 1.0f);
2120 RNA_def_property_ui_text(prop, "Blur Width",
2121 "Width of the blur edge, in percentage relative to the image size");
2122 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2124 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
2125 RNA_def_property_range(prop, DEG2RADF(-90.0f), DEG2RADF(90.0f));
2126 RNA_def_property_ui_text(prop, "Angle", "Edge angle");
2127 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2129 prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
2130 RNA_def_property_enum_sdna(prop, NULL, "forward");
2131 RNA_def_property_enum_items(prop, wipe_direction_items);
2132 RNA_def_property_ui_text(prop, "Direction", "Wipe direction");
2133 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2135 prop = RNA_def_property(srna, "transition_type", PROP_ENUM, PROP_NONE);
2136 RNA_def_property_enum_sdna(prop, NULL, "wipetype");
2137 RNA_def_property_enum_items(prop, wipe_type_items);
2138 RNA_def_property_ui_text(prop, "Transition Type", "");
2139 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2142 static void rna_def_glow(StructRNA *srna)
2146 RNA_def_struct_sdna_from(srna, "GlowVars", "effectdata");
2148 prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
2149 RNA_def_property_float_sdna(prop, NULL, "fMini");
2150 RNA_def_property_range(prop, 0.0f, 1.0f);
2151 RNA_def_property_ui_text(prop, "Threshold", "Minimum intensity to trigger a glow");
2152 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2154 prop = RNA_def_property(srna, "clamp", PROP_FLOAT, PROP_NONE);
2155 RNA_def_property_float_sdna(prop, NULL, "fClamp");
2156 RNA_def_property_range(prop, 0.0f, 1.0f);
2157 RNA_def_property_ui_text(prop, "Clamp", "Brightness limit of intensity");
2158 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2160 prop = RNA_def_property(srna, "boost_factor", PROP_FLOAT, PROP_NONE);
2161 RNA_def_property_float_sdna(prop, NULL, "fBoost");
2162 RNA_def_property_range(prop, 0.0f, 10.0f);
2163 RNA_def_property_ui_text(prop, "Boost Factor", "Brightness multiplier");
2164 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2166 prop = RNA_def_property(srna, "blur_radius", PROP_FLOAT, PROP_NONE);
2167 RNA_def_property_float_sdna(prop, NULL, "dDist");
2168 RNA_def_property_range(prop, 0.5f, 20.0f);
2169 RNA_def_property_ui_text(prop, "Blur Distance", "Radius of glow effect");
2170 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2172 prop = RNA_def_property(srna, "quality", PROP_INT, PROP_NONE);
2173 RNA_def_property_int_sdna(prop, NULL, "dQuality");
2174 RNA_def_property_range(prop, 1, 5);
2175 RNA_def_property_ui_text(prop, "Quality", "Accuracy of the blur effect");
2176 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2178 prop = RNA_def_property(srna, "use_only_boost", PROP_BOOLEAN, PROP_NONE);
2179 RNA_def_property_boolean_sdna(prop, NULL, "bNoComp", 0);
2180 RNA_def_property_ui_text(prop, "Only Boost", "Show the glow buffer only");
2181 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2184 static void rna_def_transform(StructRNA *srna)
2188 static const EnumPropertyItem interpolation_items[] = {
2189 {0, "NONE", 0, "None", "No interpolation"},
2190 {1, "BILINEAR", 0, "Bilinear", "Bilinear interpolation"},
2191 {2, "BICUBIC", 0, "Bicubic", "Bicubic interpolation"},
2192 {0, NULL, 0, NULL, NULL}
2195 static const EnumPropertyItem translation_unit_items[] = {
2196 {0, "PIXELS", 0, "Pixels", ""},
2197 {1, "PERCENT", 0, "Percent", ""},
2198 {0, NULL, 0, NULL, NULL}
2201 RNA_def_struct_sdna_from(srna, "TransformVars", "effectdata");
2203 prop = RNA_def_property(srna, "scale_start_x", PROP_FLOAT, PROP_UNSIGNED);
2204 RNA_def_property_float_sdna(prop, NULL, "ScalexIni");
2205 RNA_def_property_ui_text(prop, "Scale X", "");
2206 RNA_def_property_ui_range(prop, 0, 10, 3, 6);
2207 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2209 prop = RNA_def_property(srna, "scale_start_y", PROP_FLOAT, PROP_UNSIGNED);
2210 RNA_def_property_float_sdna(prop, NULL, "ScaleyIni");
2211 RNA_def_property_ui_text(prop, "Scale Y", "");
2212 RNA_def_property_ui_range(prop, 0, 10, 3, 6);
2213 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2215 prop = RNA_def_property(srna, "use_uniform_scale", PROP_BOOLEAN, PROP_NONE);
2216 RNA_def_property_boolean_sdna(prop, NULL, "uniform_scale", 0);
2217 RNA_def_property_ui_text(prop, "Uniform Scale", "Scale uniformly, preserving aspect ratio");
2218 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2220 prop = RNA_def_property(srna, "translate_start_x", PROP_FLOAT, PROP_NONE);
2221 RNA_def_property_float_sdna(prop, NULL, "xIni");
2222 RNA_def_property_ui_text(prop, "Translate X", "");
2223 RNA_def_property_ui_range(prop, -4000.0f, 4000.0f, 3, 6);
2224 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2226 prop = RNA_def_property(srna, "translate_start_y", PROP_FLOAT, PROP_NONE);
2227 RNA_def_property_float_sdna(prop, NULL, "yIni");
2228 RNA_def_property_ui_text(prop, "Translate Y", "");
2229 RNA_def_property_ui_range(prop, -4000.0f, 4000.0f, 3, 6);
2230 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2232 prop = RNA_def_property(srna, "rotation_start", PROP_FLOAT, PROP_NONE);
2233 RNA_def_property_float_sdna(prop, NULL, "rotIni");
2234 RNA_def_property_range(prop, -360.0f, 360.0f);
2235 RNA_def_property_ui_text(prop, "Rotation", "");
2236 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2238 prop = RNA_def_property(srna, "translation_unit", PROP_ENUM, PROP_NONE);
2239 RNA_def_property_enum_sdna(prop, NULL, "percent");
2240 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* not meant to be animated */
2241 RNA_def_property_enum_items(prop, translation_unit_items);
2242 RNA_def_property_ui_text(prop, "Translation Unit", "");
2243 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2245 prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
2246 RNA_def_property_enum_items(prop, interpolation_items);
2247 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* not meant to be animated */
2248 RNA_def_property_ui_text(prop, "Interpolation", "");
2249 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2252 static void rna_def_solid_color(StructRNA *srna)
2256 RNA_def_struct_sdna_from(srna, "SolidColorVars", "effectdata");
2258 prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
2259 RNA_def_property_float_sdna(prop, NULL, "col");
2260 RNA_def_property_ui_text(prop, "Color", "");
2261 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2264 static void rna_def_speed_control(StructRNA *srna)
2268 RNA_def_struct_sdna_from(srna, "SpeedControlVars", "effectdata");
2270 prop = RNA_def_property(srna, "multiply_speed", PROP_FLOAT, PROP_UNSIGNED);
2271 RNA_def_property_float_sdna(prop, NULL, "globalSpeed");
2272 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* seq->facf0 is used to animate this */
2273 RNA_def_property_ui_text(prop, "Multiply Speed", "Multiply the resulting speed after the speed factor");
2274 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, -1);
2275 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2277 prop = RNA_def_property(srna, "use_as_speed", PROP_BOOLEAN, PROP_NONE);
2278 RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_INTEGRATE);
2279 RNA_def_property_ui_text(prop, "Use as speed", "Interpret the value as speed instead of a frame number");
2280 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2282 prop = RNA_def_property(srna, "scale_to_length", PROP_BOOLEAN, PROP_NONE);
2283 RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_COMPRESS_IPO_Y);
2284 RNA_def_property_ui_text(prop, "Scale to length", "Scale values from 0.0 to 1.0 to target sequence length");
2285 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2289 static void rna_def_gaussian_blur(StructRNA *srna)
2293 RNA_def_struct_sdna_from(srna, "GaussianBlurVars", "effectdata");
2294 prop = RNA_def_property(srna, "size_x", PROP_FLOAT, PROP_UNSIGNED);
2295 RNA_def_property_ui_text(prop, "Size X", "Size of the blur along X axis");
2296 RNA_def_property_ui_range(prop, 0.0f, FLT_MAX, 1, -1);
2297 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2299 prop = RNA_def_property(srna, "size_y", PROP_FLOAT, PROP_UNSIGNED);
2300 RNA_def_property_ui_text(prop, "Size Y", "Size of the blur along Y axis");
2301 RNA_def_property_ui_range(prop, 0.0f, FLT_MAX, 1, -1);
2302 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
2305 static EffectInfo def_effects[] = {
2306 {"AddSequence", "Add Sequence", "Add Sequence", NULL, 2},
2307 {"AdjustmentSequence", "Adjustment Layer Sequence",
2308 "Sequence strip to perform filter adjustments to layers below", rna_def_input, 0},
2309 {"AlphaOverSequence", "Alpha Over Sequence", "Alpha Over Sequence", NULL, 2},
2310 {"AlphaUnderSequence", "Alpha Under Sequence", "Alpha Under Sequence", NULL, 2},
2311 {"ColorSequence", "Color Sequence",
2312 "Sequence strip creating an image filled with a single color", rna_def_solid_color, 0},
2313 {"CrossSequence", "Cross Sequence", "Cross Sequence", NULL, 2},
2314 {"GammaCrossSequence", "Gamma Cross Sequence", "Gamma Cross Sequence", NULL, 2},
2315 {"GlowSequence", "Glow Sequence", "Sequence strip creating a glow effect", rna_def_glow, 1},
2316 {"MulticamSequence", "Multicam Select Sequence", "Sequence strip to perform multicam editing",
2317 rna_def_multicam, 0},
2318 {"MultiplySequence", "Multiply Sequence", "Multiply Sequence", NULL, 2},
2319 {"OverDropSequence", "Over Drop Sequence", "Over Drop Sequence", NULL, 2},
2320 {"SpeedControlSequence", "SpeedControl Sequence",
2321 "Sequence strip to control the speed of other strips", rna_def_speed_control, 1},
2322 {"SubtractSequence", "Subtract Sequence", "Subtract Sequence", NULL, 2},
2323 {"TransformSequence", "Transform Sequence",
2324 "Sequence strip applying affine transformations to other strips", rna_def_transform, 1},
2325 {"WipeSequence", "Wipe Sequence", "Sequence strip creating a wipe transition",
2327 {"GaussianBlurSequence", "Gaussian Blur Sequence", "Sequence strip creating a gaussian blur",
2328 rna_def_gaussian_blur, 1},
2329 {"", "", "", NULL, 0}
2332 static void rna_def_effects(BlenderRNA *brna)
2337 for (effect = def_effects; effect->struct_name[0] != '\0'; effect++) {
2338 srna = RNA_def_struct(brna, effect->struct_name, "EffectSequence");
2339 RNA_def_struct_ui_text(srna, effect->ui_name, effect->ui_desc);
2340 RNA_def_struct_sdna(srna, "Sequence");
2342 rna_def_effect_inputs(srna, effect->inputs);
2349 static void rna_def_modifier(BlenderRNA *brna)
2354 static const EnumPropertyItem mask_input_type_items[] = {
2355 {SEQUENCE_MASK_INPUT_STRIP, "STRIP", 0, "Strip", "Use sequencer strip as mask input"},
2356 {SEQUENCE_MASK_INPUT_ID, "ID", 0, "Mask", "Use mask ID as mask input"},
2357 {0, NULL, 0, NULL, NULL}
2360 srna = RNA_def_struct(brna, "SequenceModifier", NULL);
2361 RNA_def_struct_sdna(srna, "SequenceModifierData");
2362 RNA_def_struct_ui_text(srna, "SequenceModifier", "Modifier for sequence strip");
2363 RNA_def_struct_refine_func(srna, "rna_SequenceModifier_refine");
2364 RNA_def_struct_path_func(srna, "rna_SequenceModifier_path");
2366 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
2367 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SequenceModifier_name_set");
2368 RNA_def_property_ui_text(prop, "Name", "");
2369 RNA_def_struct_name_property(srna, prop);
2370 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
2372 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
2373 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2374 RNA_def_property_enum_items(prop, sequence_modifier_type_items);
2375 RNA_def_property_ui_text(prop, "Type", "");
2376 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
2378 prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
2379 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQUENCE_MODIFIER_MUTE);
2380 RNA_def_property_ui_text(prop, "Mute", "Mute this modifier");
2381 RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 1);
2382 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
2384 prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
2385 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQUENCE_MODIFIER_EXPANDED);
2386 RNA_def_property_ui_text(prop, "Expanded", "Mute expanded settings for the modifier");
2387 RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
2388 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
2390 prop = RNA_def_property(srna, "input_mask_type", PROP_ENUM, PROP_NONE);
2391 RNA_def_property_enum_sdna(prop, NULL, "mask_input_type");
2392 RNA_def_property_enum_items(prop, mask_input_type_items);
2393 RNA_def_property_ui_text(prop, "Mask Input Type", "Type of input data used for mask");
2394 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
2396 prop = RNA_def_property(srna, "input_mask_strip", PROP_POINTER, PROP_NONE);
2397 RNA_def_property_pointer_sdna(prop, NULL, "mask_sequence");
2398 RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_SequenceModifier_otherSequence_poll");
2399 RNA_def_property_flag(prop, PROP_EDITABLE);
2400 RNA_def_property_ui_text(prop, "Mask Strip", "Strip used as mask input for the modifier");
2401 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
2403 prop = RNA_def_property(srna, "input_mask_id", PROP_POINTER, PROP_NONE);
2404 RNA_def_property_pointer_sdna(prop, NULL, "mask_id");
2405 RNA_def_property_flag(prop, PROP_EDITABLE);
2406 RNA_def_property_ui_text(prop, "Mask", "Mask ID used as mask input for the modifier");
2407 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
2410 static void rna_def_colorbalance_modifier(BlenderRNA *brna)
2415 srna = RNA_def_struct(brna, "ColorBalanceModifier", "SequenceModifier");
2416 RNA_def_struct_sdna(srna, "ColorBalanceModifierData");
2417 RNA_def_struct_ui_text(srna, "ColorBalanceModifier", "Color balance modifier for sequence strip");
2419 prop = RNA_def_property(srna, "color_balance", PROP_POINTER, PROP_NONE);
2420 RNA_def_property_struct_type(prop, "SequenceColorBalanceData");
2422 prop = RNA_def_property(srna, "color_multiply", PROP_FLOAT, PROP_UNSIGNED);
2423 RNA_def_property_float_sdna(prop, NULL, "color_multiply");
2424 RNA_def_property_range(prop, 0.0f, 20.0f);
2425 RNA_def_property_float_default(prop, 1.0f);
2426 RNA_def_property_ui_text(prop, "Multiply Colors", "");
2427 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
2430 static void rna_def_curves_modifier(BlenderRNA *brna)
2435 srna = RNA_def_struct(brna, "CurvesModifier", "SequenceModifier");
2436 RNA_def_struct_sdna(srna, "CurvesModifierData");
2437 RNA_def_struct_ui_text(srna, "CurvesModifier", "RGB curves modifier for sequence strip");
2439 prop = RNA_def_property(srna, "curve_mapping", PROP_POINTER, PROP_NONE);
2440 RNA_def_property_pointer_sdna(prop, NULL, "curve_mapping");
2441 RNA_def_property_struct_type(prop, "CurveMapping");
2442 RNA_def_property_ui_text(prop, "Curve Mapping", "");
2443 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
2446 static void rna_def_hue_modifier(BlenderRNA *brna)
2451 srna = RNA_def_struct(brna, "HueCorrectModifier", "SequenceModifier");
2452 RNA_def_struct_sdna(srna, "HueCorrectModifierData");
2453 RNA_def_struct_ui_text(srna, "HueCorrectModifier", "Hue correction modifier for sequence strip");
2455 prop = RNA_def_property(srna, "curve_mapping", PROP_POINTER, PROP_NONE);
2456 RNA_def_property_pointer_sdna(prop, NULL, "curve_mapping");
2457 RNA_def_property_struct_type(prop, "CurveMapping");
2458 RNA_def_property_ui_text(prop, "Curve Mapping", "");
2459 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
2462 static void rna_def_brightcontrast_modifier(BlenderRNA *brna)
2467 srna = RNA_def_struct(brna, "BrightContrastModifier", "SequenceModifier");
2468 RNA_def_struct_sdna(srna, "BrightContrastModifierData");
2469 RNA_def_struct_ui_text(srna, "BrightContrastModifier", "Bright/contrast modifier data for sequence strip");
2471 prop = RNA_def_property(srna, "bright", PROP_FLOAT, PROP_UNSIGNED);
2472 RNA_def_property_float_sdna(prop, NULL, "bright");
2473 RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
2474 RNA_def_property_ui_text(prop, "Bright", "");
2475 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
2477 prop = RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_UNSIGNED);
2478 RNA_def_property_float_sdna(prop, NULL, "contrast");
2479 RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
2480 RNA_def_property_ui_text(prop, "Contrast", "");
2481 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
2484 static void rna_def_modifiers(BlenderRNA *brna)
2486 rna_def_modifier(brna);
2488 rna_def_colorbalance_modifier(brna);
2489 rna_def_curves_modifier(brna);
2490 rna_def_hue_modifier(brna);
2491 rna_def_brightcontrast_modifier(brna);
2494 void RNA_def_sequencer(BlenderRNA *brna)
2496 rna_def_color_balance(brna);
2498 rna_def_strip_element(brna);
2499 rna_def_strip_proxy(brna);
2500 rna_def_strip_color_balance(brna);
2501 rna_def_strip_crop(brna);
2502 rna_def_strip_transform(brna);
2504 rna_def_sequence(brna);
2505 rna_def_editor(brna);
2507 rna_def_image(brna);
2509 rna_def_scene(brna);
2510 rna_def_movie(brna);
2511 rna_def_movieclip(brna);
2513 rna_def_sound(brna);
2514 rna_def_effect(brna);
2515 rna_def_effects(brna);
2516 rna_def_modifiers(brna);