4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * Contributor(s): Blender Foundation (2008)
22 * ***** END GPL LICENSE BLOCK *****
28 #include "RNA_access.h"
29 #include "RNA_define.h"
30 #include "RNA_types.h"
32 #include "rna_internal.h"
34 #include "DNA_object_types.h"
35 #include "DNA_scene_types.h"
36 #include "DNA_sequence_types.h"
38 #include "BKE_sequencer.h"
40 #include "MEM_guardedalloc.h"
46 /* build a temp referene to the parent */
47 static void meta_tmp_ref(Sequence *seq_par, Sequence *seq)
49 for (; seq; seq= seq->next) {
51 if(seq->type == SEQ_META) {
52 meta_tmp_ref(seq, seq->seqbase.first);
57 static void rna_SequenceEditor_sequences_all_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
59 Scene *scene= (Scene*)ptr->id.data;
60 Editing *ed= seq_give_editing(scene, FALSE);
62 meta_tmp_ref(NULL, ed->seqbase.first);
64 rna_iterator_listbase_begin(iter, &ed->seqbase, NULL);
67 static void rna_SequenceEditor_sequences_all_next(CollectionPropertyIterator *iter)
69 ListBaseIterator *internal= iter->internal;
70 Sequence *seq= (Sequence*)internal->link;
72 if(seq->seqbase.first)
73 internal->link= (Link*)seq->seqbase.first;
75 internal->link= (Link*)seq->next;
80 seq= seq->tmp; // XXX - seq's dont reference their parents!
81 if(seq && seq->next) {
82 internal->link= (Link*)seq->next;
88 iter->valid= (internal->link != NULL);
92 static void rna_Sequence_frame_change_update(Scene *scene, Sequence *seq)
94 Editing *ed= seq_give_editing(scene, FALSE);
95 ListBase *seqbase= seq_seqbase(&ed->seqbase, seq);
96 calc_sequence_disp(seq);
98 if(seq_test_overlap(seqbase, seq)) {
99 shuffle_seq(seqbase, seq);
104 static void rna_Sequence_start_frame_set(PointerRNA *ptr, int value)
106 Sequence *seq= (Sequence*)ptr->data;
107 Scene *scene= (Scene*)ptr->id.data;
110 rna_Sequence_frame_change_update(scene, seq);
113 static void rna_Sequence_start_frame_final_set(PointerRNA *ptr, int value)
115 Sequence *seq= (Sequence*)ptr->data;
116 Scene *scene= (Scene*)ptr->id.data;
118 seq_tx_set_final_left(seq, value);
120 rna_Sequence_frame_change_update(scene, seq);
123 static void rna_Sequence_end_frame_final_set(PointerRNA *ptr, int value)
125 Sequence *seq= (Sequence*)ptr->data;
126 Scene *scene= (Scene*)ptr->id.data;
128 seq_tx_set_final_right(seq, value);
130 rna_Sequence_frame_change_update(scene, seq);
133 static void rna_Sequence_length_set(PointerRNA *ptr, int value)
135 Sequence *seq= (Sequence*)ptr->data;
136 Scene *scene= (Scene*)ptr->id.data;
138 seq_tx_set_final_right(seq, seq->start+value);
139 rna_Sequence_frame_change_update(scene, seq);
142 static int rna_Sequence_length_get(PointerRNA *ptr)
144 Sequence *seq= (Sequence*)ptr->data;
145 return seq_tx_get_final_right(seq, 0)-seq_tx_get_final_left(seq, 0);
148 static void rna_Sequence_channel_set(PointerRNA *ptr, int value)
150 Sequence *seq= (Sequence*)ptr->data;
151 Scene *scene= (Scene*)ptr->id.data;
152 Editing *ed= seq_give_editing(scene, FALSE);
153 ListBase *seqbase= seq_seqbase(&ed->seqbase, seq);
157 if( seq_test_overlap(seqbase, seq) ) {
158 shuffle_seq(seqbase, seq);
163 /* properties that need to allocate structs */
164 static void rna_Sequence_use_color_balance_set(PointerRNA *ptr, int value)
166 Sequence *seq= (Sequence*)ptr->data;
170 seq->flag |= SEQ_USE_COLOR_BALANCE;
171 if(seq->strip->color_balance == NULL) {
172 seq->strip->color_balance = MEM_callocN(sizeof(struct StripColorBalance), "StripColorBalance");
173 for (c=0; c<3; c++) {
174 seq->strip->color_balance->lift[c] = 1.0f;
175 seq->strip->color_balance->gamma[c] = 1.0f;
176 seq->strip->color_balance->gain[c] = 1.0f;
180 seq->flag ^= SEQ_USE_COLOR_BALANCE;
184 static void rna_Sequence_use_proxy_set(PointerRNA *ptr, int value)
186 Sequence *seq= (Sequence*)ptr->data;
188 seq->flag |= SEQ_USE_PROXY;
189 if(seq->strip->proxy == NULL) {
190 seq->strip->proxy = MEM_callocN(sizeof(struct StripProxy), "StripProxy");
193 seq->flag ^= SEQ_USE_PROXY;
197 static void rna_Sequence_use_translation_set(PointerRNA *ptr, int value)
199 Sequence *seq= (Sequence*)ptr->data;
201 seq->flag |= SEQ_USE_TRANSFORM;
202 if(seq->strip->transform == NULL) {
203 seq->strip->transform = MEM_callocN(sizeof(struct StripTransform), "StripTransform");
206 seq->flag ^= SEQ_USE_TRANSFORM;
210 static void rna_Sequence_use_crop_set(PointerRNA *ptr, int value)
212 Sequence *seq= (Sequence*)ptr->data;
214 seq->flag |= SEQ_USE_CROP;
215 if(seq->strip->crop == NULL) {
216 seq->strip->crop = MEM_callocN(sizeof(struct StripCrop), "StripCrop");
219 seq->flag ^= SEQ_USE_CROP;
222 /* name functions that ignore the first two characters */
223 static void rna_Sequence_name_get(PointerRNA *ptr, char *value)
225 Sequence *seq= (Sequence*)ptr->data;
226 BLI_strncpy(value, seq->name+2, sizeof(seq->name)-2);
229 static int rna_Sequence_name_length(PointerRNA *ptr)
231 Sequence *seq= (Sequence*)ptr->data;
232 return strlen(seq->name+2);
235 static void rna_Sequence_name_set(PointerRNA *ptr, const char *value)
237 Scene *scene= (Scene*)ptr->id.data;
238 // Editing *ed= seq_give_editing(scene, FALSE);
239 Sequence *seq= (Sequence*)ptr->data;
241 BLI_strncpy(seq->name+2, value, sizeof(seq->name)-2);
243 seqUniqueName(&scene->ed->seqbase, seq);
245 // TODO, unique name for all meta's
247 SEQ_BEGIN(ed, iseq) {
248 if(iseq->seqbase.first)
249 seqUniqueName(&iseq->seqbase, seq);
256 static StructRNA* rna_Sequence_refine(struct PointerRNA *ptr)
258 Sequence *seq= (Sequence*)ptr->data;
262 return &RNA_ImageSequence;
264 return &RNA_MetaSequence;
266 return &RNA_SceneSequence;
268 return &RNA_MovieSequence;
270 return &RNA_SoundSequence;
279 return &RNA_EffectSequence;
281 return &RNA_PluginSequence;
283 return &RNA_WipeSequence;
285 return &RNA_GlowSequence;
287 return &RNA_TransformSequence;
289 return &RNA_ColorSequence;
291 return &RNA_SpeedControlSequence;
293 return &RNA_Sequence;
297 static char *rna_Sequence_path(PointerRNA *ptr)
299 Sequence *seq= (Sequence*)ptr->data;
301 /* sequencer data comes from scene...
302 * TODO: would be nice to make SequenceEditor data a datablock of its own (for shorter paths)
305 return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"]", seq->name+2);
307 return BLI_strdup("");
310 static PointerRNA rna_SequenceEditor_meta_stack_get(CollectionPropertyIterator *iter)
312 ListBaseIterator *internal= iter->internal;
313 MetaStack *ms= (MetaStack*)internal->link;
315 return rna_pointer_inherit_refine(&iter->parent, &RNA_Sequence, ms->parseq);
318 static void rna_MovieSequence_filename_set(PointerRNA *ptr, const char *value)
320 Sequence *seq= (Sequence*)(ptr->data);
321 char dir[FILE_MAX], name[FILE_MAX];
323 BLI_split_dirfile_basic(value, dir, name);
324 BLI_strncpy(seq->strip->dir, dir, sizeof(seq->strip->dir));
325 BLI_strncpy(seq->strip->stripdata->name, name, sizeof(seq->strip->stripdata->name));
328 static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value)
330 Sequence *seq= (Sequence*)(ptr->data);
331 char dir[FILE_MAX], name[FILE_MAX];
333 BLI_split_dirfile_basic(value, dir, name);
334 BLI_strncpy(seq->strip->dir, dir, sizeof(seq->strip->dir));
335 BLI_strncpy(seq->strip->stripdata->name, name, sizeof(seq->strip->stripdata->name));
338 static void rna_SequenceElement_filename_set(PointerRNA *ptr, const char *value)
340 StripElem *elem= (StripElem*)(ptr->data);
343 BLI_split_dirfile_basic(value, NULL, name);
344 BLI_strncpy(elem->name, name, sizeof(elem->name));
347 static void rna_Sequence_update(Main *bmain, Scene *scene, PointerRNA *ptr)
349 Editing *ed= seq_give_editing(scene, FALSE);
351 free_imbuf_seq(scene, &ed->seqbase, FALSE);
353 if(RNA_struct_is_a(ptr->type, &RNA_SoundSequence))
354 seq_update_sound(ptr->data);
357 static void rna_Sequence_mute_update(Main *bmain, Scene *scene, PointerRNA *ptr)
359 Editing *ed= seq_give_editing(scene, FALSE);
361 seq_update_muting(ed);
362 rna_Sequence_update(bmain, scene, ptr);
367 static void rna_def_strip_element(BlenderRNA *brna)
372 srna = RNA_def_struct(brna, "SequenceElement", NULL);
373 RNA_def_struct_ui_text(srna, "Sequence Element", "Sequence strip data for a single frame.");
374 RNA_def_struct_sdna(srna, "StripElem");
376 prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
377 RNA_def_property_string_sdna(prop, NULL, "name");
378 RNA_def_property_ui_text(prop, "Filename", "");
379 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SequenceElement_filename_set");
380 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
383 static void rna_def_strip_crop(BlenderRNA *brna)
388 srna = RNA_def_struct(brna, "SequenceCrop", NULL);
389 RNA_def_struct_ui_text(srna, "Sequence Crop", "Cropping parameters for a sequence strip.");
390 RNA_def_struct_sdna(srna, "StripCrop");
392 prop= RNA_def_property(srna, "top", PROP_INT, PROP_UNSIGNED);
393 RNA_def_property_ui_text(prop, "Top", "");
394 RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
395 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
397 prop= RNA_def_property(srna, "bottom", PROP_INT, PROP_UNSIGNED);
398 RNA_def_property_ui_text(prop, "Bottom", "");
399 RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
400 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
402 prop= RNA_def_property(srna, "left", PROP_INT, PROP_UNSIGNED);
403 RNA_def_property_ui_text(prop, "Left", "");
404 RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
405 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
407 prop= RNA_def_property(srna, "right", PROP_INT, PROP_UNSIGNED);
408 RNA_def_property_ui_text(prop, "Right", "");
409 RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
410 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
413 static void rna_def_strip_transform(BlenderRNA *brna)
418 srna = RNA_def_struct(brna, "SequenceTransform", NULL);
419 RNA_def_struct_ui_text(srna, "Sequence Transform", "Transform parameters for a sequence strip.");
420 RNA_def_struct_sdna(srna, "StripTransform");
422 prop= RNA_def_property(srna, "offset_x", PROP_INT, PROP_NONE);
423 RNA_def_property_int_sdna(prop, NULL, "xofs");
424 RNA_def_property_ui_text(prop, "Offset Y", "");
425 RNA_def_property_ui_range(prop, -4096, 4096, 1, 0);
426 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
428 prop= RNA_def_property(srna, "offset_y", PROP_INT, PROP_NONE);
429 RNA_def_property_int_sdna(prop, NULL, "yofs");
430 RNA_def_property_ui_text(prop, "Offset Y", "");
431 RNA_def_property_ui_range(prop, -4096, 4096, 1, 0);
432 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
435 static void rna_def_strip_proxy(BlenderRNA *brna)
440 srna = RNA_def_struct(brna, "SequenceProxy", NULL);
441 RNA_def_struct_ui_text(srna, "Sequence Proxy", "Proxy parameters for a sequence strip.");
442 RNA_def_struct_sdna(srna, "StripProxy");
444 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
445 RNA_def_property_string_sdna(prop, NULL, "dir");
446 RNA_def_property_ui_text(prop, "Directory", "Location to story the proxy file");
447 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
449 prop= RNA_def_property(srna, "file", PROP_STRING, PROP_DIRPATH);
450 RNA_def_property_string_sdna(prop, NULL, "file");
451 RNA_def_property_ui_text(prop, "File", "Proxy file name");
452 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
455 static void rna_def_strip_color_balance(BlenderRNA *brna)
460 srna = RNA_def_struct(brna, "SequenceColorBalance", NULL);
461 RNA_def_struct_ui_text(srna, "Sequence Color Balance", "Color balance parameters for a sequence strip.");
462 RNA_def_struct_sdna(srna, "StripColorBalance");
464 prop= RNA_def_property(srna, "lift", PROP_FLOAT, PROP_COLOR);
465 RNA_def_property_ui_text(prop, "Lift", "Color balance lift (shadows).");
466 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
468 prop= RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_COLOR);
469 RNA_def_property_ui_text(prop, "Gamma", "Color balance gamma (midtones).");
470 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
472 prop= RNA_def_property(srna, "gain", PROP_FLOAT, PROP_COLOR);
473 RNA_def_property_ui_text(prop, "Gain", "Color balance gain (highlights).");
474 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
476 prop= RNA_def_property(srna, "inverse_gain", PROP_BOOLEAN, PROP_NONE);
477 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_GAIN);
478 RNA_def_property_ui_text(prop, "Inverse Gain", "");
479 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
481 prop= RNA_def_property(srna, "inverse_gamma", PROP_BOOLEAN, PROP_NONE);
482 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_GAMMA);
483 RNA_def_property_ui_text(prop, "Inverse Gamma", "");
484 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
486 prop= RNA_def_property(srna, "inverse_lift", PROP_BOOLEAN, PROP_NONE);
487 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_LIFT);
488 RNA_def_property_ui_text(prop, "Inverse Lift", "");
489 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
492 prop= RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE);
493 RNA_def_property_range(prop, 0.0f, 1.0f);
494 RNA_def_property_ui_text(prop, "Exposure", "");
495 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
497 prop= RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE);
498 RNA_def_property_range(prop, 0.0f, 1.0f);
499 RNA_def_property_ui_text(prop, "Saturation", "");
500 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); */
503 static void rna_def_sequence(BlenderRNA *brna)
509 static const EnumPropertyItem seq_type_items[]= {
510 {SEQ_IMAGE, "IMAGE", 0, "Image", ""},
511 {SEQ_META, "META", 0, "Meta", ""},
512 {SEQ_SCENE, "SCENE", 0, "Scene", ""},
513 {SEQ_MOVIE, "MOVIE", 0, "Movie", ""},
514 {SEQ_SOUND, "SOUND", 0, "Sound", ""},
515 {SEQ_CROSS, "CROSS", 0, "Cross", ""},
516 {SEQ_ADD, "ADD", 0, "Add", ""},
517 {SEQ_SUB, "SUBTRACT", 0, "Subtract", ""},
518 {SEQ_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
519 {SEQ_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
520 {SEQ_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
521 {SEQ_MUL, "MULTIPLY", 0, "Multiply", ""},
522 {SEQ_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
523 {SEQ_PLUGIN, "PLUGIN", 0, "plugin", ""},
524 {SEQ_WIPE, "WIPE", 0, "Wipe", ""},
525 {SEQ_GLOW, "GLOW", 0, "Glow", ""},
526 {SEQ_TRANSFORM, "TRANSFORM", 0, "Transform", ""},
527 {SEQ_COLOR, "COLOR", 0, "Color", ""},
528 {SEQ_SPEED, "SPEED", 0, "Speed", ""},
529 {0, NULL, 0, NULL, NULL}};
531 static const EnumPropertyItem blend_mode_items[]= {
532 {SEQ_BLEND_REPLACE, "REPLACE", 0, "Replace", ""},
533 {SEQ_CROSS, "CROSS", 0, "Cross", ""},
534 {SEQ_ADD, "ADD", 0, "Add", ""},
535 {SEQ_SUB, "SUBTRACT", 0, "Subtract", ""},
536 {SEQ_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
537 {SEQ_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
538 {SEQ_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
539 {SEQ_MUL, "MULTIPLY", 0, "Multiply", ""},
540 {SEQ_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
541 {0, NULL, 0, NULL, NULL}};
543 srna = RNA_def_struct(brna, "Sequence", NULL);
544 RNA_def_struct_ui_text(srna, "Sequence", "Sequence strip in the sequence editor.");
545 RNA_def_struct_refine_func(srna, "rna_Sequence_refine");
546 RNA_def_struct_path_func(srna, "rna_Sequence_path");
548 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
549 RNA_def_property_string_funcs(prop, "rna_Sequence_name_get", "rna_Sequence_name_length", "rna_Sequence_name_set");
550 RNA_def_property_string_maxlength(prop, sizeof(((Sequence*)NULL)->name)-2);
551 RNA_def_property_ui_text(prop, "Name", "");
552 RNA_def_struct_name_property(srna, prop);
553 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
555 prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
556 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
557 RNA_def_property_enum_items(prop, seq_type_items);
558 RNA_def_property_ui_text(prop, "Type", "");
559 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
561 //prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
562 //RNA_def_property_ui_text(prop, "Ipo Curves", "Ipo curves used by this sequence.");
566 prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
567 RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
568 RNA_def_property_ui_text(prop, "Selected", "");
569 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER_SELECT, NULL);
571 prop= RNA_def_property(srna, "left_handle_selected", PROP_BOOLEAN, PROP_NONE);
572 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LEFTSEL);
573 RNA_def_property_ui_text(prop, "Left Handle Selected", "");
574 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER_SELECT, NULL);
576 prop= RNA_def_property(srna, "right_handle_selected", PROP_BOOLEAN, PROP_NONE);
577 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_RIGHTSEL);
578 RNA_def_property_ui_text(prop, "Right Handle Selected", "");
579 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER_SELECT, NULL);
581 prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
582 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MUTE);
583 RNA_def_property_ui_text(prop, "Mute", "");
584 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_mute_update");
586 prop= RNA_def_property(srna, "frame_locked", PROP_BOOLEAN, PROP_NONE);
587 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_IPO_FRAME_LOCKED);
588 RNA_def_property_ui_text(prop, "Frame Locked", "Lock the animation curve to the global frame counter.");
589 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
591 prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
592 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LOCK);
593 RNA_def_property_ui_text(prop, "Lock", "Lock strip so that it can't be transformed.");
594 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
596 /* strip positioning */
598 prop= RNA_def_property(srna, "length", PROP_INT, PROP_TIME);
599 RNA_def_property_int_sdna(prop, NULL, "len");
600 RNA_def_property_range(prop, 1, MAXFRAME);
601 RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip before the handles are applied");
602 RNA_def_property_int_funcs(prop, "rna_Sequence_length_get", "rna_Sequence_length_set",NULL);
603 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
605 prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_TIME);
606 RNA_def_property_int_sdna(prop, NULL, "start");
607 RNA_def_property_ui_text(prop, "Start Frame", "");
608 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_set",NULL); // overlap tests and calc_seq_disp
609 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
611 prop= RNA_def_property(srna, "start_frame_final", PROP_INT, PROP_TIME);
612 RNA_def_property_int_sdna(prop, NULL, "startdisp");
613 RNA_def_property_ui_text(prop, "Start Frame", "Start frame displayed in the sequence editor after offsets are applied, setting this is equivilent to moving the handle, not the actual start frame.");
614 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_final_set", NULL); // overlap tests and calc_seq_disp
615 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
617 prop= RNA_def_property(srna, "end_frame_final", PROP_INT, PROP_TIME);
618 RNA_def_property_int_sdna(prop, NULL, "enddisp");
619 RNA_def_property_ui_text(prop, "End Frame", "End frame displayed in the sequence editor after offsets are applied.");
620 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_end_frame_final_set", NULL); // overlap tests and calc_seq_disp
621 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
623 prop= RNA_def_property(srna, "start_offset", PROP_INT, PROP_TIME);
624 RNA_def_property_int_sdna(prop, NULL, "startofs");
625 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
626 RNA_def_property_ui_text(prop, "Start Offset", "");
627 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
629 prop= RNA_def_property(srna, "end_offset", PROP_INT, PROP_TIME);
630 RNA_def_property_int_sdna(prop, NULL, "endofs");
631 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
632 RNA_def_property_ui_text(prop, "End offset", "");
633 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
635 prop= RNA_def_property(srna, "start_still", PROP_INT, PROP_TIME);
636 RNA_def_property_int_sdna(prop, NULL, "startstill");
637 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
638 RNA_def_property_range(prop, 0, MAXFRAME);
639 RNA_def_property_ui_text(prop, "Start Still", "");
640 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
642 prop= RNA_def_property(srna, "end_still", PROP_INT, PROP_TIME);
643 RNA_def_property_int_sdna(prop, NULL, "endstill");
644 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
645 RNA_def_property_range(prop, 0, MAXFRAME);
646 RNA_def_property_ui_text(prop, "End Still", "");
647 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
649 prop= RNA_def_property(srna, "channel", PROP_INT, PROP_UNSIGNED);
650 RNA_def_property_int_sdna(prop, NULL, "machine");
651 RNA_def_property_range(prop, 0, MAXSEQ-1);
652 RNA_def_property_ui_text(prop, "Channel", "Y position of the sequence strip.");
653 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_channel_set",NULL); // overlap test
654 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
658 prop= RNA_def_property(srna, "blend_mode", PROP_ENUM, PROP_NONE);
659 RNA_def_property_enum_items(prop, blend_mode_items);
660 RNA_def_property_ui_text(prop, "Blend Mode", "");
661 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
663 prop= RNA_def_property(srna, "blend_opacity", PROP_FLOAT, PROP_NONE);
664 RNA_def_property_range(prop, 0.0f, 100.0f);
665 RNA_def_property_ui_text(prop, "Blend Opacity", "");
666 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
668 prop= RNA_def_property(srna, "effect_fader", PROP_FLOAT, PROP_NONE);
669 RNA_def_property_range(prop, 0.0f, 1.0f);
670 RNA_def_property_float_sdna(prop, NULL, "effect_fader");
671 RNA_def_property_ui_text(prop, "Effect fader position", "");
672 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
674 prop= RNA_def_property(srna, "use_effect_default_fade", PROP_BOOLEAN, PROP_NONE);
675 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_EFFECT_DEFAULT_FADE);
676 RNA_def_property_ui_text(prop, "Use Default Fade", "Fade effect using the builtin default (usually make transition as long as effect strip).");
677 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
680 prop= RNA_def_property(srna, "speed_fader", PROP_FLOAT, PROP_NONE);
681 RNA_def_property_float_sdna(prop, NULL, "speed_fader");
682 RNA_def_property_ui_text(prop, "Speed effect fader position", "");
683 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
686 func= RNA_def_function(srna, "getStripElem", "give_stripelem");
687 RNA_def_function_ui_description(func, "Return the strip element from a given frame or None.");
688 prop= RNA_def_int(func, "frame", 0, -MAXFRAME, MAXFRAME, "Frame", "The frame to get the strip element from", -MAXFRAME, MAXFRAME);
689 RNA_def_property_flag(prop, PROP_REQUIRED);
690 RNA_def_function_return(func, RNA_def_pointer(func, "elem", "SequenceElement", "", "strip element of the current frame"));
693 static void rna_def_editor(BlenderRNA *brna)
698 srna = RNA_def_struct(brna, "SequenceEditor", NULL);
699 RNA_def_struct_ui_text(srna, "Sequence Editor", "Sequence editing data for a Scene datablock.");
700 RNA_def_struct_ui_icon(srna, ICON_SEQUENCE);
701 RNA_def_struct_sdna(srna, "Editing");
703 prop= RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE);
704 RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
705 RNA_def_property_struct_type(prop, "Sequence");
706 RNA_def_property_ui_text(prop, "Sequences", "");
708 prop= RNA_def_property(srna, "sequences_all", PROP_COLLECTION, PROP_NONE);
709 RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
710 RNA_def_property_struct_type(prop, "Sequence");
711 RNA_def_property_ui_text(prop, "Sequences", "");
712 RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_sequences_all_begin", "rna_SequenceEditor_sequences_all_next", 0, 0, 0, 0, 0);
714 prop= RNA_def_property(srna, "meta_stack", PROP_COLLECTION, PROP_NONE);
715 RNA_def_property_collection_sdna(prop, NULL, "metastack", NULL);
716 RNA_def_property_struct_type(prop, "Sequence");
717 RNA_def_property_ui_text(prop, "Meta Stack", "Meta strip stack, last is currently edited meta strip.");
718 RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_SequenceEditor_meta_stack_get", 0, 0, 0);
720 prop= RNA_def_property(srna, "active_strip", PROP_POINTER, PROP_NONE);
721 RNA_def_property_pointer_sdna(prop, NULL, "act_seq");
722 RNA_def_property_ui_text(prop, "Active Strip", "Sequencers active strip");
725 static void rna_def_filter_video(StructRNA *srna)
729 prop= RNA_def_property(srna, "de_interlace", PROP_BOOLEAN, PROP_NONE);
730 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FILTERY);
731 RNA_def_property_ui_text(prop, "De-Interlace", "For video movies to remove fields.");
733 prop= RNA_def_property(srna, "premultiply", PROP_BOOLEAN, PROP_NONE);
734 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_PREMUL);
735 RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha.");
736 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
738 prop= RNA_def_property(srna, "flip_x", PROP_BOOLEAN, PROP_NONE);
739 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPX);
740 RNA_def_property_ui_text(prop, "Flip X", "Flip on the X axis.");
741 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
743 prop= RNA_def_property(srna, "flip_y", PROP_BOOLEAN, PROP_NONE);
744 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPY);
745 RNA_def_property_ui_text(prop, "Flip Y", "Flip on the Y axis.");
746 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
748 prop= RNA_def_property(srna, "convert_float", PROP_BOOLEAN, PROP_NONE);
749 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_FLOAT);
750 RNA_def_property_ui_text(prop, "Convert Float", "Convert input to float data.");
751 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
753 prop= RNA_def_property(srna, "reverse_frames", PROP_BOOLEAN, PROP_NONE);
754 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_REVERSE_FRAMES);
755 RNA_def_property_ui_text(prop, "Flip Time", "Reverse frame order.");
756 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
758 prop= RNA_def_property(srna, "multiply_colors", PROP_FLOAT, PROP_UNSIGNED);
759 RNA_def_property_float_sdna(prop, NULL, "mul");
760 RNA_def_property_range(prop, 0.0f, 20.0f);
761 RNA_def_property_ui_text(prop, "Multiply Colors", "");
762 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
764 prop= RNA_def_property(srna, "strobe", PROP_FLOAT, PROP_NONE);
765 RNA_def_property_range(prop, 1.0f, 30.0f);
766 RNA_def_property_ui_text(prop, "Strobe", "Only display every nth frame.");
767 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
769 prop= RNA_def_property(srna, "use_color_balance", PROP_BOOLEAN, PROP_NONE);
770 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_COLOR_BALANCE);
771 RNA_def_property_ui_text(prop, "Use Color Balance", "(3-Way color correction) on input.");
772 RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_color_balance_set");
773 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
775 prop= RNA_def_property(srna, "color_balance", PROP_POINTER, PROP_NONE);
776 RNA_def_property_pointer_sdna(prop, NULL, "strip->color_balance");
777 RNA_def_property_ui_text(prop, "Color Balance", "");
779 prop= RNA_def_property(srna, "use_translation", PROP_BOOLEAN, PROP_NONE);
780 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_TRANSFORM);
781 RNA_def_property_ui_text(prop, "Use Translation", "Translate image before processing.");
782 RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_translation_set");
783 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
785 prop= RNA_def_property(srna, "transform", PROP_POINTER, PROP_NONE);
786 RNA_def_property_pointer_sdna(prop, NULL, "strip->transform");
787 RNA_def_property_ui_text(prop, "Transform", "");
789 prop= RNA_def_property(srna, "use_crop", PROP_BOOLEAN, PROP_NONE);
790 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_CROP);
791 RNA_def_property_ui_text(prop, "Use Crop", "Crop image before processing.");
792 RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_crop_set");
793 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
795 prop= RNA_def_property(srna, "crop", PROP_POINTER, PROP_NONE);
796 RNA_def_property_pointer_sdna(prop, NULL, "strip->crop");
797 RNA_def_property_ui_text(prop, "Crop", "");
800 static void rna_def_proxy(StructRNA *srna)
804 prop= RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE);
805 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY);
806 RNA_def_property_ui_text(prop, "Use Proxy", "Use a preview proxy for this strip.");
807 RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_proxy_set");
809 prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
810 RNA_def_property_pointer_sdna(prop, NULL, "strip->proxy");
811 RNA_def_property_ui_text(prop, "Proxy", "");
813 prop= RNA_def_property(srna, "proxy_custom_directory", PROP_BOOLEAN, PROP_NONE);
814 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY_CUSTOM_DIR);
815 RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Use a custom directory to store data.");
816 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
819 static void rna_def_input(StructRNA *srna)
823 prop= RNA_def_property(srna, "animation_start_offset", PROP_INT, PROP_UNSIGNED);
824 RNA_def_property_int_sdna(prop, NULL, "anim_startofs");
825 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap test
826 RNA_def_property_ui_text(prop, "Animation Start Offset", "Animation start offset (trim start).");
827 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
829 prop= RNA_def_property(srna, "animation_end_offset", PROP_INT, PROP_UNSIGNED);
830 RNA_def_property_int_sdna(prop, NULL, "anim_endofs");
831 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap test
832 RNA_def_property_ui_text(prop, "Animation End Offset", "Animation end offset (trim end).");
833 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
836 static void rna_def_image(BlenderRNA *brna)
841 srna = RNA_def_struct(brna, "ImageSequence", "Sequence");
842 RNA_def_struct_ui_text(srna, "Image Sequence", "Sequence strip to load one or more images.");
843 RNA_def_struct_sdna(srna, "Sequence");
845 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
846 RNA_def_property_string_sdna(prop, NULL, "strip->dir");
847 RNA_def_property_ui_text(prop, "Directory", "");
848 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
850 prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE);
851 RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", "strip->len");
852 RNA_def_property_struct_type(prop, "SequenceElement");
853 RNA_def_property_ui_text(prop, "Elements", "");
855 rna_def_filter_video(srna);
860 static void rna_def_meta(BlenderRNA *brna)
865 srna = RNA_def_struct(brna, "MetaSequence", "Sequence");
866 RNA_def_struct_ui_text(srna, "Meta Sequence", "Sequence strip to group other strips as a single sequence strip.");
867 RNA_def_struct_sdna(srna, "Sequence");
869 prop = RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE);
870 RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
871 RNA_def_property_struct_type(prop, "Sequence");
872 RNA_def_property_ui_text(prop, "Sequences", "");
874 rna_def_filter_video(srna);
879 static void rna_def_scene(BlenderRNA *brna)
884 srna = RNA_def_struct(brna, "SceneSequence", "Sequence");
885 RNA_def_struct_ui_text(srna, "Scene Sequence", "Sequence strip to used the rendered image of a scene.");
886 RNA_def_struct_sdna(srna, "Sequence");
888 prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
889 RNA_def_property_flag(prop, PROP_EDITABLE);
890 RNA_def_property_ui_text(prop, "Scene", "Scene that this sequence uses.");
891 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
893 rna_def_filter_video(srna);
898 static void rna_def_movie(BlenderRNA *brna)
903 srna = RNA_def_struct(brna, "MovieSequence", "Sequence");
904 RNA_def_struct_ui_text(srna, "Movie Sequence", "Sequence strip to load a video.");
905 RNA_def_struct_sdna(srna, "Sequence");
907 prop= RNA_def_property(srna, "mpeg_preseek", PROP_INT, PROP_NONE);
908 RNA_def_property_int_sdna(prop, NULL, "anim_preseek");
909 RNA_def_property_range(prop, 0, 50);
910 RNA_def_property_ui_text(prop, "MPEG Preseek", "For MPEG movies, preseek this many frames.");
911 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
913 prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
914 RNA_def_property_string_sdna(prop, NULL, "strip->stripdata->name");
915 RNA_def_property_ui_text(prop, "Filename", "");
916 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MovieSequence_filename_set");
917 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
919 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
920 RNA_def_property_string_sdna(prop, NULL, "strip->dir");
921 RNA_def_property_ui_text(prop, "Directory", "");
922 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
924 rna_def_filter_video(srna);
929 static void rna_def_sound(BlenderRNA *brna)
934 srna = RNA_def_struct(brna, "SoundSequence", "Sequence");
935 RNA_def_struct_ui_text(srna, "Sound Sequence", "Sequence strip defining a sound to be played over a period of time.");
936 RNA_def_struct_sdna(srna, "Sequence");
938 prop= RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE);
939 RNA_def_property_struct_type(prop, "Sound");
940 RNA_def_property_ui_text(prop, "Sound", "Sound datablock used by this sequence.");
941 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
943 prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
944 RNA_def_property_string_sdna(prop, NULL, "strip->stripdata->name");
945 RNA_def_property_ui_text(prop, "Filename", "");
946 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SoundSequence_filename_set");
947 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
949 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
950 RNA_def_property_string_sdna(prop, NULL, "strip->dir");
951 RNA_def_property_ui_text(prop, "Directory", "");
952 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
956 RNA_def_struct_sdna_from(srna, "SoundHandle", "sound_handle");
958 prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
959 RNA_def_property_float_sdna(prop, NULL, "volume");
960 RNA_def_property_range(prop, 0.0f, 1.0f);
961 RNA_def_property_ui_text(prop, "Volume", "Playback volume of the sound");
962 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
965 static void rna_def_effect(BlenderRNA *brna)
969 srna = RNA_def_struct(brna, "EffectSequence", "Sequence");
970 RNA_def_struct_ui_text(srna, "Effect Sequence", "Sequence strip applying an effect on the images created by other strips.");
971 RNA_def_struct_sdna(srna, "Sequence");
976 static void rna_def_plugin(BlenderRNA *brna)
981 srna = RNA_def_struct(brna, "PluginSequence", "EffectSequence");
982 RNA_def_struct_ui_text(srna, "Plugin Sequence", "Sequence strip applying an effect, loaded from an external plugin.");
983 RNA_def_struct_sdna_from(srna, "PluginSeq", "plugin");
985 prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
986 RNA_def_property_string_sdna(prop, NULL, "name");
987 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
988 RNA_def_property_ui_text(prop, "Filename", "");
989 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
991 /* plugin properties need custom wrapping code like ID properties */
994 static void rna_def_wipe(BlenderRNA *brna)
999 static const EnumPropertyItem wipe_type_items[]= {
1000 {0, "SINGLE", 0, "Single", ""},
1001 {1, "DOUBLE", 0, "Double", ""},
1002 /* not used yet {2, "BOX", 0, "Box", ""}, */
1003 /* not used yet {3, "CROSS", 0, "Cross", ""}, */
1004 {4, "IRIS", 0, "Iris", ""},
1005 {5, "CLOCK", 0, "Clock", ""},
1006 {0, NULL, 0, NULL, NULL}
1009 static const EnumPropertyItem wipe_direction_items[]= {
1010 {0, "OUT", 0, "Out", ""},
1011 {1, "IN", 0, "In", ""},
1012 {0, NULL, 0, NULL, NULL}
1015 srna = RNA_def_struct(brna, "WipeSequence", "EffectSequence");
1016 RNA_def_struct_ui_text(srna, "Wipe Sequence", "Sequence strip creating a wipe transition.");
1017 RNA_def_struct_sdna_from(srna, "WipeVars", "effectdata");
1019 prop= RNA_def_property(srna, "blur_width", PROP_FLOAT, PROP_UNSIGNED);
1020 RNA_def_property_float_sdna(prop, NULL, "edgeWidth");
1021 RNA_def_property_range(prop, 0.0f, 1.0f);
1022 RNA_def_property_ui_text(prop, "Blur Width", "Width of the blur edge, in percentage relative to the image size.");
1023 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1025 prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
1026 RNA_def_property_float_sdna(prop, NULL, "angle");
1027 RNA_def_property_range(prop, -90.0f, 90.0f);
1028 RNA_def_property_ui_text(prop, "Angle", "Edge angle.");
1029 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1031 prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
1032 RNA_def_property_enum_sdna(prop, NULL, "forward");
1033 RNA_def_property_enum_items(prop, wipe_direction_items);
1034 RNA_def_property_ui_text(prop, "Direction", "Wipe direction.");
1035 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1037 prop= RNA_def_property(srna, "transition_type", PROP_ENUM, PROP_NONE);
1038 RNA_def_property_enum_sdna(prop, NULL, "wipetype");
1039 RNA_def_property_enum_items(prop, wipe_type_items);
1040 RNA_def_property_ui_text(prop, "Transition Type", "");
1041 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1044 static void rna_def_glow(BlenderRNA *brna)
1049 srna = RNA_def_struct(brna, "GlowSequence", "EffectSequence");
1050 RNA_def_struct_ui_text(srna, "Glow Sequence", "Sequence strip creating a glow effect.");
1051 RNA_def_struct_sdna_from(srna, "GlowVars", "effectdata");
1053 prop= RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
1054 RNA_def_property_float_sdna(prop, NULL, "fMini");
1055 RNA_def_property_range(prop, 0.0f, 1.0f);
1056 RNA_def_property_ui_text(prop, "Threshold", "Minimum intensity to trigger a glow");
1057 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1059 prop= RNA_def_property(srna, "clamp", PROP_FLOAT, PROP_NONE);
1060 RNA_def_property_float_sdna(prop, NULL, "fClamp");
1061 RNA_def_property_range(prop, 0.0f, 1.0f);
1062 RNA_def_property_ui_text(prop, "Clamp", "rightness limit of intensity.");
1063 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1065 prop= RNA_def_property(srna, "boost_factor", PROP_FLOAT, PROP_NONE);
1066 RNA_def_property_float_sdna(prop, NULL, "fBoost");
1067 RNA_def_property_range(prop, 0.0f, 10.0f);
1068 RNA_def_property_ui_text(prop, "Boost Factor", "Brightness multiplier.");
1069 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1071 prop= RNA_def_property(srna, "blur_distance", PROP_FLOAT, PROP_NONE);
1072 RNA_def_property_float_sdna(prop, NULL, "dDist");
1073 RNA_def_property_range(prop, 0.5f, 20.0f);
1074 RNA_def_property_ui_text(prop, "Blur Distance", "Radius of glow effect.");
1075 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1077 prop= RNA_def_property(srna, "quality", PROP_INT, PROP_NONE);
1078 RNA_def_property_int_sdna(prop, NULL, "dQuality");
1079 RNA_def_property_range(prop, 1, 5);
1080 RNA_def_property_ui_text(prop, "Quality", "Accuracy of the blur effect.");
1081 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1083 prop= RNA_def_property(srna, "only_boost", PROP_BOOLEAN, PROP_NONE);
1084 RNA_def_property_boolean_sdna(prop, NULL, "bNoComp", 0);
1085 RNA_def_property_ui_text(prop, "Only Boost", "Show the glow buffer only.");
1086 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1089 static void rna_def_transform(BlenderRNA *brna)
1094 static const EnumPropertyItem interpolation_items[]= {
1095 {0, "NONE", 0, "None", "No interpolation."},
1096 {1, "BILINEAR", 0, "Bilinear", "Bilinear interpolation."},
1097 {2, "BICUBIC", 0, "Bicubic", "Bicubic interpolation."},
1098 {0, NULL, 0, NULL, NULL}
1101 static const EnumPropertyItem translation_unit_items[]= {
1102 {0, "PIXELS", 0, "Pixels", ""},
1103 {1, "PERCENT", 0, "Percent", ""},
1104 {0, NULL, 0, NULL, NULL}
1107 srna = RNA_def_struct(brna, "TransformSequence", "EffectSequence");
1108 RNA_def_struct_ui_text(srna, "Transform Sequence", "Sequence strip applying affine transformations to other strips.");
1109 RNA_def_struct_sdna_from(srna, "TransformVars", "effectdata");
1111 prop= RNA_def_property(srna, "scale_start_x", PROP_FLOAT, PROP_UNSIGNED);
1112 RNA_def_property_float_sdna(prop, NULL, "ScalexIni");
1113 RNA_def_property_ui_text(prop, "Scale X", "");
1114 RNA_def_property_ui_range(prop, 0, 10, 3, 10);
1115 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1117 prop= RNA_def_property(srna, "scale_start_y", PROP_FLOAT, PROP_UNSIGNED);
1118 RNA_def_property_float_sdna(prop, NULL, "ScaleyIni");
1119 RNA_def_property_ui_text(prop, "Scale Y", "");
1120 RNA_def_property_ui_range(prop, 0, 10, 3, 10);
1121 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1123 prop= RNA_def_property(srna, "uniform_scale", PROP_BOOLEAN, PROP_NONE);
1124 RNA_def_property_boolean_sdna(prop, NULL, "uniform_scale", 0);
1125 RNA_def_property_ui_text(prop, "Uniform Scale", "Scale uniformly, preserving aspect ratio.");
1126 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1128 prop= RNA_def_property(srna, "translate_start_x", PROP_FLOAT, PROP_NONE);
1129 RNA_def_property_float_sdna(prop, NULL, "xIni");
1130 RNA_def_property_ui_text(prop, "Translate X", "");
1131 RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
1132 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1134 prop= RNA_def_property(srna, "translate_start_y", PROP_FLOAT, PROP_NONE);
1135 RNA_def_property_float_sdna(prop, NULL, "yIni");
1136 RNA_def_property_ui_text(prop, "Translate Y", "");
1137 RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
1138 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1140 prop= RNA_def_property(srna, "rotation_start", PROP_FLOAT, PROP_NONE);
1141 RNA_def_property_float_sdna(prop, NULL, "rotIni");
1142 RNA_def_property_range(prop, -360.0f, 360.0f);
1143 RNA_def_property_ui_text(prop, "Rotation", "");
1144 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1146 prop= RNA_def_property(srna, "translation_unit", PROP_ENUM, PROP_NONE);
1147 RNA_def_property_enum_sdna(prop, NULL, "percent");
1148 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* not meant to be animated */
1149 RNA_def_property_enum_items(prop, translation_unit_items);
1150 RNA_def_property_ui_text(prop, "Translation Unit", "");
1151 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1153 prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
1154 RNA_def_property_enum_items(prop, interpolation_items);
1155 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* not meant to be animated */
1156 RNA_def_property_ui_text(prop, "Interpolation", "");
1157 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1160 static void rna_def_solid_color(BlenderRNA *brna)
1165 srna = RNA_def_struct(brna, "ColorSequence", "EffectSequence");
1166 RNA_def_struct_ui_text(srna, "Color Sequence", "Sequence strip creating an image filled with a single color.");
1167 RNA_def_struct_sdna_from(srna, "SolidColorVars", "effectdata");
1169 prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
1170 RNA_def_property_float_sdna(prop, NULL, "col");
1171 RNA_def_property_ui_text(prop, "Color", "");
1172 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1175 static void rna_def_speed_control(BlenderRNA *brna)
1180 srna = RNA_def_struct(brna, "SpeedControlSequence", "EffectSequence");
1181 RNA_def_struct_ui_text(srna, "SpeedControl Sequence", "Sequence strip to control the speed of other strips.");
1182 RNA_def_struct_sdna_from(srna, "SpeedControlVars", "effectdata");
1184 prop= RNA_def_property(srna, "global_speed", PROP_FLOAT, PROP_UNSIGNED);
1185 RNA_def_property_float_sdna(prop, NULL, "globalSpeed");
1186 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* seq->facf0 is used to animate this */
1187 RNA_def_property_ui_text(prop, "Global Speed", "");
1188 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 0);
1189 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1191 prop= RNA_def_property(srna, "curve_velocity", PROP_BOOLEAN, PROP_NONE);
1192 RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_INTEGRATE);
1193 RNA_def_property_ui_text(prop, "F-Curve Velocity", "Interpret the F-Curve value as a velocity instead of a frame number.");
1194 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1196 prop= RNA_def_property(srna, "frame_blending", PROP_BOOLEAN, PROP_NONE);
1197 RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_BLEND);
1198 RNA_def_property_ui_text(prop, "Frame Blending", "Blend two frames into the target for a smoother result.");
1199 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1201 prop= RNA_def_property(srna, "curve_compress_y", PROP_BOOLEAN, PROP_NONE);
1202 RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_COMPRESS_IPO_Y);
1203 RNA_def_property_ui_text(prop, "F-Curve Compress Y", "Scale F-Curve value to get the target frame number, F-Curve value runs from 0.0 to 1.0.");
1204 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1207 void RNA_def_sequencer(BlenderRNA *brna)
1209 rna_def_strip_element(brna);
1210 rna_def_strip_proxy(brna);
1211 rna_def_strip_color_balance(brna);
1212 rna_def_strip_crop(brna);
1213 rna_def_strip_transform(brna);
1215 rna_def_sequence(brna);
1216 rna_def_editor(brna);
1218 rna_def_image(brna);
1220 rna_def_scene(brna);
1221 rna_def_movie(brna);
1222 rna_def_sound(brna);
1223 rna_def_effect(brna);
1224 rna_def_plugin(brna);
1227 rna_def_transform(brna);
1228 rna_def_solid_color(brna);
1229 rna_def_speed_control(brna);