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, scene); // XXX - BROKEN!, uses context seqbasep
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, scene); // XXX - BROKEN!, uses context seqbasep
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);
366 static float rna_Sequence_opacity_get(PointerRNA *ptr) {
367 return ((Sequence*)(ptr->data))->blend_opacity / 100.0f;
369 static void rna_Sequence_opacity_set(PointerRNA *ptr, float value) {
370 ((Sequence*)(ptr->data))->blend_opacity = value * 100.0f;
375 static void rna_def_strip_element(BlenderRNA *brna)
380 srna = RNA_def_struct(brna, "SequenceElement", NULL);
381 RNA_def_struct_ui_text(srna, "Sequence Element", "Sequence strip data for a single frame.");
382 RNA_def_struct_sdna(srna, "StripElem");
384 prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
385 RNA_def_property_string_sdna(prop, NULL, "name");
386 RNA_def_property_ui_text(prop, "Filename", "");
387 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SequenceElement_filename_set");
388 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
391 static void rna_def_strip_crop(BlenderRNA *brna)
396 srna = RNA_def_struct(brna, "SequenceCrop", NULL);
397 RNA_def_struct_ui_text(srna, "Sequence Crop", "Cropping parameters for a sequence strip.");
398 RNA_def_struct_sdna(srna, "StripCrop");
400 prop= RNA_def_property(srna, "top", PROP_INT, PROP_UNSIGNED);
401 RNA_def_property_ui_text(prop, "Top", "");
402 RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
403 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
405 prop= RNA_def_property(srna, "bottom", PROP_INT, PROP_UNSIGNED);
406 RNA_def_property_ui_text(prop, "Bottom", "");
407 RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
408 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
410 prop= RNA_def_property(srna, "left", PROP_INT, PROP_UNSIGNED);
411 RNA_def_property_ui_text(prop, "Left", "");
412 RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
413 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
415 prop= RNA_def_property(srna, "right", PROP_INT, PROP_UNSIGNED);
416 RNA_def_property_ui_text(prop, "Right", "");
417 RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
418 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
421 static void rna_def_strip_transform(BlenderRNA *brna)
426 srna = RNA_def_struct(brna, "SequenceTransform", NULL);
427 RNA_def_struct_ui_text(srna, "Sequence Transform", "Transform parameters for a sequence strip.");
428 RNA_def_struct_sdna(srna, "StripTransform");
430 prop= RNA_def_property(srna, "offset_x", PROP_INT, PROP_NONE);
431 RNA_def_property_int_sdna(prop, NULL, "xofs");
432 RNA_def_property_ui_text(prop, "Offset Y", "");
433 RNA_def_property_ui_range(prop, -4096, 4096, 1, 0);
434 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
436 prop= RNA_def_property(srna, "offset_y", PROP_INT, PROP_NONE);
437 RNA_def_property_int_sdna(prop, NULL, "yofs");
438 RNA_def_property_ui_text(prop, "Offset Y", "");
439 RNA_def_property_ui_range(prop, -4096, 4096, 1, 0);
440 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
443 static void rna_def_strip_proxy(BlenderRNA *brna)
448 srna = RNA_def_struct(brna, "SequenceProxy", NULL);
449 RNA_def_struct_ui_text(srna, "Sequence Proxy", "Proxy parameters for a sequence strip.");
450 RNA_def_struct_sdna(srna, "StripProxy");
452 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
453 RNA_def_property_string_sdna(prop, NULL, "dir");
454 RNA_def_property_ui_text(prop, "Directory", "Location to story the proxy file");
455 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
457 prop= RNA_def_property(srna, "file", PROP_STRING, PROP_DIRPATH);
458 RNA_def_property_string_sdna(prop, NULL, "file");
459 RNA_def_property_ui_text(prop, "File", "Proxy file name");
460 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
463 static void rna_def_strip_color_balance(BlenderRNA *brna)
468 srna = RNA_def_struct(brna, "SequenceColorBalance", NULL);
469 RNA_def_struct_ui_text(srna, "Sequence Color Balance", "Color balance parameters for a sequence strip.");
470 RNA_def_struct_sdna(srna, "StripColorBalance");
472 prop= RNA_def_property(srna, "lift", PROP_FLOAT, PROP_COLOR);
473 RNA_def_property_ui_text(prop, "Lift", "Color balance lift (shadows).");
474 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
476 prop= RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_COLOR);
477 RNA_def_property_ui_text(prop, "Gamma", "Color balance gamma (midtones).");
478 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
480 prop= RNA_def_property(srna, "gain", PROP_FLOAT, PROP_COLOR);
481 RNA_def_property_ui_text(prop, "Gain", "Color balance gain (highlights).");
482 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
484 prop= RNA_def_property(srna, "inverse_gain", PROP_BOOLEAN, PROP_NONE);
485 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_GAIN);
486 RNA_def_property_ui_text(prop, "Inverse Gain", "");
487 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
489 prop= RNA_def_property(srna, "inverse_gamma", PROP_BOOLEAN, PROP_NONE);
490 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_GAMMA);
491 RNA_def_property_ui_text(prop, "Inverse Gamma", "");
492 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
494 prop= RNA_def_property(srna, "inverse_lift", PROP_BOOLEAN, PROP_NONE);
495 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_LIFT);
496 RNA_def_property_ui_text(prop, "Inverse Lift", "");
497 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
500 prop= RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE);
501 RNA_def_property_range(prop, 0.0f, 1.0f);
502 RNA_def_property_ui_text(prop, "Exposure", "");
503 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
505 prop= RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE);
506 RNA_def_property_range(prop, 0.0f, 1.0f);
507 RNA_def_property_ui_text(prop, "Saturation", "");
508 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); */
511 static void rna_def_sequence(BlenderRNA *brna)
517 static const EnumPropertyItem seq_type_items[]= {
518 {SEQ_IMAGE, "IMAGE", 0, "Image", ""},
519 {SEQ_META, "META", 0, "Meta", ""},
520 {SEQ_SCENE, "SCENE", 0, "Scene", ""},
521 {SEQ_MOVIE, "MOVIE", 0, "Movie", ""},
522 {SEQ_SOUND, "SOUND", 0, "Sound", ""},
523 {SEQ_CROSS, "CROSS", 0, "Cross", ""},
524 {SEQ_ADD, "ADD", 0, "Add", ""},
525 {SEQ_SUB, "SUBTRACT", 0, "Subtract", ""},
526 {SEQ_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
527 {SEQ_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
528 {SEQ_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
529 {SEQ_MUL, "MULTIPLY", 0, "Multiply", ""},
530 {SEQ_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
531 {SEQ_PLUGIN, "PLUGIN", 0, "plugin", ""},
532 {SEQ_WIPE, "WIPE", 0, "Wipe", ""},
533 {SEQ_GLOW, "GLOW", 0, "Glow", ""},
534 {SEQ_TRANSFORM, "TRANSFORM", 0, "Transform", ""},
535 {SEQ_COLOR, "COLOR", 0, "Color", ""},
536 {SEQ_SPEED, "SPEED", 0, "Speed", ""},
537 {0, NULL, 0, NULL, NULL}};
539 static const EnumPropertyItem blend_mode_items[]= {
540 {SEQ_BLEND_REPLACE, "REPLACE", 0, "Replace", ""},
541 {SEQ_CROSS, "CROSS", 0, "Cross", ""},
542 {SEQ_ADD, "ADD", 0, "Add", ""},
543 {SEQ_SUB, "SUBTRACT", 0, "Subtract", ""},
544 {SEQ_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
545 {SEQ_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
546 {SEQ_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
547 {SEQ_MUL, "MULTIPLY", 0, "Multiply", ""},
548 {SEQ_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
549 {0, NULL, 0, NULL, NULL}};
551 srna = RNA_def_struct(brna, "Sequence", NULL);
552 RNA_def_struct_ui_text(srna, "Sequence", "Sequence strip in the sequence editor.");
553 RNA_def_struct_refine_func(srna, "rna_Sequence_refine");
554 RNA_def_struct_path_func(srna, "rna_Sequence_path");
556 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
557 RNA_def_property_string_funcs(prop, "rna_Sequence_name_get", "rna_Sequence_name_length", "rna_Sequence_name_set");
558 RNA_def_property_string_maxlength(prop, sizeof(((Sequence*)NULL)->name)-2);
559 RNA_def_property_ui_text(prop, "Name", "");
560 RNA_def_struct_name_property(srna, prop);
561 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
563 prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
564 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
565 RNA_def_property_enum_items(prop, seq_type_items);
566 RNA_def_property_ui_text(prop, "Type", "");
567 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
569 //prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
570 //RNA_def_property_ui_text(prop, "Ipo Curves", "Ipo curves used by this sequence.");
574 prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
575 RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
576 RNA_def_property_ui_text(prop, "Selected", "");
577 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER_SELECT, NULL);
579 prop= RNA_def_property(srna, "left_handle_selected", PROP_BOOLEAN, PROP_NONE);
580 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LEFTSEL);
581 RNA_def_property_ui_text(prop, "Left Handle Selected", "");
582 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER_SELECT, NULL);
584 prop= RNA_def_property(srna, "right_handle_selected", PROP_BOOLEAN, PROP_NONE);
585 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_RIGHTSEL);
586 RNA_def_property_ui_text(prop, "Right Handle Selected", "");
587 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER_SELECT, NULL);
589 prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
590 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MUTE);
591 RNA_def_property_ui_text(prop, "Mute", "");
592 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_mute_update");
594 prop= RNA_def_property(srna, "frame_locked", PROP_BOOLEAN, PROP_NONE);
595 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_IPO_FRAME_LOCKED);
596 RNA_def_property_ui_text(prop, "Frame Locked", "Lock the animation curve to the global frame counter.");
597 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
599 prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
600 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LOCK);
601 RNA_def_property_ui_text(prop, "Lock", "Lock strip so that it can't be transformed.");
602 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
604 /* strip positioning */
606 prop= RNA_def_property(srna, "length", PROP_INT, PROP_TIME);
607 RNA_def_property_int_sdna(prop, NULL, "len");
608 RNA_def_property_range(prop, 1, MAXFRAME);
609 RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip before the handles are applied");
610 RNA_def_property_int_funcs(prop, "rna_Sequence_length_get", "rna_Sequence_length_set",NULL);
611 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
613 prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_TIME);
614 RNA_def_property_int_sdna(prop, NULL, "start");
615 RNA_def_property_ui_text(prop, "Start Frame", "");
616 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_set",NULL); // overlap tests and calc_seq_disp
617 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
619 prop= RNA_def_property(srna, "start_frame_final", PROP_INT, PROP_TIME);
620 RNA_def_property_int_sdna(prop, NULL, "startdisp");
621 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.");
622 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_final_set", NULL); // overlap tests and calc_seq_disp
623 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
625 prop= RNA_def_property(srna, "end_frame_final", PROP_INT, PROP_TIME);
626 RNA_def_property_int_sdna(prop, NULL, "enddisp");
627 RNA_def_property_ui_text(prop, "End Frame", "End frame displayed in the sequence editor after offsets are applied.");
628 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_end_frame_final_set", NULL); // overlap tests and calc_seq_disp
629 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
631 prop= RNA_def_property(srna, "start_offset", PROP_INT, PROP_TIME);
632 RNA_def_property_int_sdna(prop, NULL, "startofs");
633 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
634 RNA_def_property_ui_text(prop, "Start Offset", "");
635 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
637 prop= RNA_def_property(srna, "end_offset", PROP_INT, PROP_TIME);
638 RNA_def_property_int_sdna(prop, NULL, "endofs");
639 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
640 RNA_def_property_ui_text(prop, "End offset", "");
641 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
643 prop= RNA_def_property(srna, "start_still", PROP_INT, PROP_TIME);
644 RNA_def_property_int_sdna(prop, NULL, "startstill");
645 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
646 RNA_def_property_range(prop, 0, MAXFRAME);
647 RNA_def_property_ui_text(prop, "Start Still", "");
648 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
650 prop= RNA_def_property(srna, "end_still", PROP_INT, PROP_TIME);
651 RNA_def_property_int_sdna(prop, NULL, "endstill");
652 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
653 RNA_def_property_range(prop, 0, MAXFRAME);
654 RNA_def_property_ui_text(prop, "End Still", "");
655 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
657 prop= RNA_def_property(srna, "channel", PROP_INT, PROP_UNSIGNED);
658 RNA_def_property_int_sdna(prop, NULL, "machine");
659 RNA_def_property_range(prop, 0, MAXSEQ-1);
660 RNA_def_property_ui_text(prop, "Channel", "Y position of the sequence strip.");
661 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_channel_set",NULL); // overlap test
662 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
666 prop= RNA_def_property(srna, "blend_mode", PROP_ENUM, PROP_NONE);
667 RNA_def_property_enum_items(prop, blend_mode_items);
668 RNA_def_property_ui_text(prop, "Blend Mode", "");
669 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
671 prop= RNA_def_property(srna, "blend_opacity", PROP_FLOAT, PROP_FACTOR);
672 RNA_def_property_range(prop, 0.0f, 1.0f);
673 RNA_def_property_ui_text(prop, "Blend Opacity", "");
674 RNA_def_property_float_funcs(prop, "rna_Sequence_opacity_get", "rna_Sequence_opacity_set", NULL); // stupid 0-100 -> 0-1
675 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
677 prop= RNA_def_property(srna, "effect_fader", PROP_FLOAT, PROP_NONE);
678 RNA_def_property_range(prop, 0.0f, 1.0f);
679 RNA_def_property_float_sdna(prop, NULL, "effect_fader");
680 RNA_def_property_ui_text(prop, "Effect fader position", "");
681 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
683 prop= RNA_def_property(srna, "use_effect_default_fade", PROP_BOOLEAN, PROP_NONE);
684 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_EFFECT_DEFAULT_FADE);
685 RNA_def_property_ui_text(prop, "Use Default Fade", "Fade effect using the builtin default (usually make transition as long as effect strip).");
686 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
689 prop= RNA_def_property(srna, "speed_fader", PROP_FLOAT, PROP_NONE);
690 RNA_def_property_float_sdna(prop, NULL, "speed_fader");
691 RNA_def_property_ui_text(prop, "Speed effect fader position", "");
692 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
695 func= RNA_def_function(srna, "getStripElem", "give_stripelem");
696 RNA_def_function_ui_description(func, "Return the strip element from a given frame or None.");
697 prop= RNA_def_int(func, "frame", 0, -MAXFRAME, MAXFRAME, "Frame", "The frame to get the strip element from", -MAXFRAME, MAXFRAME);
698 RNA_def_property_flag(prop, PROP_REQUIRED);
699 RNA_def_function_return(func, RNA_def_pointer(func, "elem", "SequenceElement", "", "strip element of the current frame"));
702 static void rna_def_editor(BlenderRNA *brna)
707 srna = RNA_def_struct(brna, "SequenceEditor", NULL);
708 RNA_def_struct_ui_text(srna, "Sequence Editor", "Sequence editing data for a Scene datablock.");
709 RNA_def_struct_ui_icon(srna, ICON_SEQUENCE);
710 RNA_def_struct_sdna(srna, "Editing");
712 prop= RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE);
713 RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
714 RNA_def_property_struct_type(prop, "Sequence");
715 RNA_def_property_ui_text(prop, "Sequences", "");
717 prop= RNA_def_property(srna, "sequences_all", PROP_COLLECTION, PROP_NONE);
718 RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
719 RNA_def_property_struct_type(prop, "Sequence");
720 RNA_def_property_ui_text(prop, "Sequences", "");
721 RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_sequences_all_begin", "rna_SequenceEditor_sequences_all_next", 0, 0, 0, 0, 0);
723 prop= RNA_def_property(srna, "meta_stack", PROP_COLLECTION, PROP_NONE);
724 RNA_def_property_collection_sdna(prop, NULL, "metastack", NULL);
725 RNA_def_property_struct_type(prop, "Sequence");
726 RNA_def_property_ui_text(prop, "Meta Stack", "Meta strip stack, last is currently edited meta strip.");
727 RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_SequenceEditor_meta_stack_get", 0, 0, 0);
729 prop= RNA_def_property(srna, "active_strip", PROP_POINTER, PROP_NONE);
730 RNA_def_property_pointer_sdna(prop, NULL, "act_seq");
731 RNA_def_property_ui_text(prop, "Active Strip", "Sequencers active strip");
734 static void rna_def_filter_video(StructRNA *srna)
738 prop= RNA_def_property(srna, "de_interlace", PROP_BOOLEAN, PROP_NONE);
739 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FILTERY);
740 RNA_def_property_ui_text(prop, "De-Interlace", "For video movies to remove fields.");
742 prop= RNA_def_property(srna, "premultiply", PROP_BOOLEAN, PROP_NONE);
743 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_PREMUL);
744 RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha.");
745 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
747 prop= RNA_def_property(srna, "flip_x", PROP_BOOLEAN, PROP_NONE);
748 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPX);
749 RNA_def_property_ui_text(prop, "Flip X", "Flip on the X axis.");
750 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
752 prop= RNA_def_property(srna, "flip_y", PROP_BOOLEAN, PROP_NONE);
753 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPY);
754 RNA_def_property_ui_text(prop, "Flip Y", "Flip on the Y axis.");
755 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
757 prop= RNA_def_property(srna, "convert_float", PROP_BOOLEAN, PROP_NONE);
758 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_FLOAT);
759 RNA_def_property_ui_text(prop, "Convert Float", "Convert input to float data.");
760 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
762 prop= RNA_def_property(srna, "reverse_frames", PROP_BOOLEAN, PROP_NONE);
763 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_REVERSE_FRAMES);
764 RNA_def_property_ui_text(prop, "Flip Time", "Reverse frame order.");
765 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
767 prop= RNA_def_property(srna, "multiply_colors", PROP_FLOAT, PROP_UNSIGNED);
768 RNA_def_property_float_sdna(prop, NULL, "mul");
769 RNA_def_property_range(prop, 0.0f, 20.0f);
770 RNA_def_property_ui_text(prop, "Multiply Colors", "");
771 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
773 prop= RNA_def_property(srna, "strobe", PROP_FLOAT, PROP_NONE);
774 RNA_def_property_range(prop, 1.0f, 30.0f);
775 RNA_def_property_ui_text(prop, "Strobe", "Only display every nth frame.");
776 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
778 prop= RNA_def_property(srna, "use_color_balance", PROP_BOOLEAN, PROP_NONE);
779 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_COLOR_BALANCE);
780 RNA_def_property_ui_text(prop, "Use Color Balance", "(3-Way color correction) on input.");
781 RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_color_balance_set");
782 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
784 prop= RNA_def_property(srna, "color_balance", PROP_POINTER, PROP_NONE);
785 RNA_def_property_pointer_sdna(prop, NULL, "strip->color_balance");
786 RNA_def_property_ui_text(prop, "Color Balance", "");
788 prop= RNA_def_property(srna, "use_translation", PROP_BOOLEAN, PROP_NONE);
789 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_TRANSFORM);
790 RNA_def_property_ui_text(prop, "Use Translation", "Translate image before processing.");
791 RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_translation_set");
792 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
794 prop= RNA_def_property(srna, "transform", PROP_POINTER, PROP_NONE);
795 RNA_def_property_pointer_sdna(prop, NULL, "strip->transform");
796 RNA_def_property_ui_text(prop, "Transform", "");
798 prop= RNA_def_property(srna, "use_crop", PROP_BOOLEAN, PROP_NONE);
799 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_CROP);
800 RNA_def_property_ui_text(prop, "Use Crop", "Crop image before processing.");
801 RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_crop_set");
802 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
804 prop= RNA_def_property(srna, "crop", PROP_POINTER, PROP_NONE);
805 RNA_def_property_pointer_sdna(prop, NULL, "strip->crop");
806 RNA_def_property_ui_text(prop, "Crop", "");
809 static void rna_def_proxy(StructRNA *srna)
813 prop= RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE);
814 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY);
815 RNA_def_property_ui_text(prop, "Use Proxy", "Use a preview proxy for this strip.");
816 RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_proxy_set");
818 prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
819 RNA_def_property_pointer_sdna(prop, NULL, "strip->proxy");
820 RNA_def_property_ui_text(prop, "Proxy", "");
822 prop= RNA_def_property(srna, "proxy_custom_directory", PROP_BOOLEAN, PROP_NONE);
823 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY_CUSTOM_DIR);
824 RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Use a custom directory to store data.");
825 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
828 static void rna_def_input(StructRNA *srna)
832 prop= RNA_def_property(srna, "animation_start_offset", PROP_INT, PROP_UNSIGNED);
833 RNA_def_property_int_sdna(prop, NULL, "anim_startofs");
834 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap test
835 RNA_def_property_ui_text(prop, "Animation Start Offset", "Animation start offset (trim start).");
836 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
838 prop= RNA_def_property(srna, "animation_end_offset", PROP_INT, PROP_UNSIGNED);
839 RNA_def_property_int_sdna(prop, NULL, "anim_endofs");
840 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap test
841 RNA_def_property_ui_text(prop, "Animation End Offset", "Animation end offset (trim end).");
842 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
845 static void rna_def_image(BlenderRNA *brna)
850 srna = RNA_def_struct(brna, "ImageSequence", "Sequence");
851 RNA_def_struct_ui_text(srna, "Image Sequence", "Sequence strip to load one or more images.");
852 RNA_def_struct_sdna(srna, "Sequence");
854 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
855 RNA_def_property_string_sdna(prop, NULL, "strip->dir");
856 RNA_def_property_ui_text(prop, "Directory", "");
857 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
859 prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE);
860 RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", "strip->len");
861 RNA_def_property_struct_type(prop, "SequenceElement");
862 RNA_def_property_ui_text(prop, "Elements", "");
864 rna_def_filter_video(srna);
869 static void rna_def_meta(BlenderRNA *brna)
874 srna = RNA_def_struct(brna, "MetaSequence", "Sequence");
875 RNA_def_struct_ui_text(srna, "Meta Sequence", "Sequence strip to group other strips as a single sequence strip.");
876 RNA_def_struct_sdna(srna, "Sequence");
878 prop = RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE);
879 RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
880 RNA_def_property_struct_type(prop, "Sequence");
881 RNA_def_property_ui_text(prop, "Sequences", "");
883 rna_def_filter_video(srna);
888 static void rna_def_scene(BlenderRNA *brna)
893 srna = RNA_def_struct(brna, "SceneSequence", "Sequence");
894 RNA_def_struct_ui_text(srna, "Scene Sequence", "Sequence strip to used the rendered image of a scene.");
895 RNA_def_struct_sdna(srna, "Sequence");
897 prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
898 RNA_def_property_flag(prop, PROP_EDITABLE);
899 RNA_def_property_ui_text(prop, "Scene", "Scene that this sequence uses.");
900 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
902 rna_def_filter_video(srna);
907 static void rna_def_movie(BlenderRNA *brna)
912 srna = RNA_def_struct(brna, "MovieSequence", "Sequence");
913 RNA_def_struct_ui_text(srna, "Movie Sequence", "Sequence strip to load a video.");
914 RNA_def_struct_sdna(srna, "Sequence");
916 prop= RNA_def_property(srna, "mpeg_preseek", PROP_INT, PROP_NONE);
917 RNA_def_property_int_sdna(prop, NULL, "anim_preseek");
918 RNA_def_property_range(prop, 0, 50);
919 RNA_def_property_ui_text(prop, "MPEG Preseek", "For MPEG movies, preseek this many frames.");
920 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
922 prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
923 RNA_def_property_string_sdna(prop, NULL, "strip->stripdata->name");
924 RNA_def_property_ui_text(prop, "Filename", "");
925 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MovieSequence_filename_set");
926 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
928 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
929 RNA_def_property_string_sdna(prop, NULL, "strip->dir");
930 RNA_def_property_ui_text(prop, "Directory", "");
931 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
933 rna_def_filter_video(srna);
938 static void rna_def_sound(BlenderRNA *brna)
943 srna = RNA_def_struct(brna, "SoundSequence", "Sequence");
944 RNA_def_struct_ui_text(srna, "Sound Sequence", "Sequence strip defining a sound to be played over a period of time.");
945 RNA_def_struct_sdna(srna, "Sequence");
947 prop= RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE);
948 RNA_def_property_struct_type(prop, "Sound");
949 RNA_def_property_ui_text(prop, "Sound", "Sound datablock used by this sequence.");
950 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
952 prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
953 RNA_def_property_string_sdna(prop, NULL, "strip->stripdata->name");
954 RNA_def_property_ui_text(prop, "Filename", "");
955 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SoundSequence_filename_set");
956 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
958 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
959 RNA_def_property_string_sdna(prop, NULL, "strip->dir");
960 RNA_def_property_ui_text(prop, "Directory", "");
961 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
965 RNA_def_struct_sdna_from(srna, "SoundHandle", "sound_handle");
967 prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
968 RNA_def_property_float_sdna(prop, NULL, "volume");
969 RNA_def_property_range(prop, 0.0f, 1.0f);
970 RNA_def_property_ui_text(prop, "Volume", "Playback volume of the sound");
971 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
974 static void rna_def_effect(BlenderRNA *brna)
978 srna = RNA_def_struct(brna, "EffectSequence", "Sequence");
979 RNA_def_struct_ui_text(srna, "Effect Sequence", "Sequence strip applying an effect on the images created by other strips.");
980 RNA_def_struct_sdna(srna, "Sequence");
985 static void rna_def_plugin(BlenderRNA *brna)
990 srna = RNA_def_struct(brna, "PluginSequence", "EffectSequence");
991 RNA_def_struct_ui_text(srna, "Plugin Sequence", "Sequence strip applying an effect, loaded from an external plugin.");
992 RNA_def_struct_sdna_from(srna, "PluginSeq", "plugin");
994 prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
995 RNA_def_property_string_sdna(prop, NULL, "name");
996 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
997 RNA_def_property_ui_text(prop, "Filename", "");
998 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1000 /* plugin properties need custom wrapping code like ID properties */
1003 static void rna_def_wipe(BlenderRNA *brna)
1008 static const EnumPropertyItem wipe_type_items[]= {
1009 {0, "SINGLE", 0, "Single", ""},
1010 {1, "DOUBLE", 0, "Double", ""},
1011 /* not used yet {2, "BOX", 0, "Box", ""}, */
1012 /* not used yet {3, "CROSS", 0, "Cross", ""}, */
1013 {4, "IRIS", 0, "Iris", ""},
1014 {5, "CLOCK", 0, "Clock", ""},
1015 {0, NULL, 0, NULL, NULL}
1018 static const EnumPropertyItem wipe_direction_items[]= {
1019 {0, "OUT", 0, "Out", ""},
1020 {1, "IN", 0, "In", ""},
1021 {0, NULL, 0, NULL, NULL}
1024 srna = RNA_def_struct(brna, "WipeSequence", "EffectSequence");
1025 RNA_def_struct_ui_text(srna, "Wipe Sequence", "Sequence strip creating a wipe transition.");
1026 RNA_def_struct_sdna_from(srna, "WipeVars", "effectdata");
1028 prop= RNA_def_property(srna, "blur_width", PROP_FLOAT, PROP_UNSIGNED);
1029 RNA_def_property_float_sdna(prop, NULL, "edgeWidth");
1030 RNA_def_property_range(prop, 0.0f, 1.0f);
1031 RNA_def_property_ui_text(prop, "Blur Width", "Width of the blur edge, in percentage relative to the image size.");
1032 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1034 prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
1035 RNA_def_property_float_sdna(prop, NULL, "angle");
1036 RNA_def_property_range(prop, -90.0f, 90.0f);
1037 RNA_def_property_ui_text(prop, "Angle", "Edge angle.");
1038 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1040 prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
1041 RNA_def_property_enum_sdna(prop, NULL, "forward");
1042 RNA_def_property_enum_items(prop, wipe_direction_items);
1043 RNA_def_property_ui_text(prop, "Direction", "Wipe direction.");
1044 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1046 prop= RNA_def_property(srna, "transition_type", PROP_ENUM, PROP_NONE);
1047 RNA_def_property_enum_sdna(prop, NULL, "wipetype");
1048 RNA_def_property_enum_items(prop, wipe_type_items);
1049 RNA_def_property_ui_text(prop, "Transition Type", "");
1050 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1053 static void rna_def_glow(BlenderRNA *brna)
1058 srna = RNA_def_struct(brna, "GlowSequence", "EffectSequence");
1059 RNA_def_struct_ui_text(srna, "Glow Sequence", "Sequence strip creating a glow effect.");
1060 RNA_def_struct_sdna_from(srna, "GlowVars", "effectdata");
1062 prop= RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
1063 RNA_def_property_float_sdna(prop, NULL, "fMini");
1064 RNA_def_property_range(prop, 0.0f, 1.0f);
1065 RNA_def_property_ui_text(prop, "Threshold", "Minimum intensity to trigger a glow");
1066 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1068 prop= RNA_def_property(srna, "clamp", PROP_FLOAT, PROP_NONE);
1069 RNA_def_property_float_sdna(prop, NULL, "fClamp");
1070 RNA_def_property_range(prop, 0.0f, 1.0f);
1071 RNA_def_property_ui_text(prop, "Clamp", "rightness limit of intensity.");
1072 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1074 prop= RNA_def_property(srna, "boost_factor", PROP_FLOAT, PROP_NONE);
1075 RNA_def_property_float_sdna(prop, NULL, "fBoost");
1076 RNA_def_property_range(prop, 0.0f, 10.0f);
1077 RNA_def_property_ui_text(prop, "Boost Factor", "Brightness multiplier.");
1078 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1080 prop= RNA_def_property(srna, "blur_distance", PROP_FLOAT, PROP_NONE);
1081 RNA_def_property_float_sdna(prop, NULL, "dDist");
1082 RNA_def_property_range(prop, 0.5f, 20.0f);
1083 RNA_def_property_ui_text(prop, "Blur Distance", "Radius of glow effect.");
1084 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1086 prop= RNA_def_property(srna, "quality", PROP_INT, PROP_NONE);
1087 RNA_def_property_int_sdna(prop, NULL, "dQuality");
1088 RNA_def_property_range(prop, 1, 5);
1089 RNA_def_property_ui_text(prop, "Quality", "Accuracy of the blur effect.");
1090 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1092 prop= RNA_def_property(srna, "only_boost", PROP_BOOLEAN, PROP_NONE);
1093 RNA_def_property_boolean_sdna(prop, NULL, "bNoComp", 0);
1094 RNA_def_property_ui_text(prop, "Only Boost", "Show the glow buffer only.");
1095 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1098 static void rna_def_transform(BlenderRNA *brna)
1103 static const EnumPropertyItem interpolation_items[]= {
1104 {0, "NONE", 0, "None", "No interpolation."},
1105 {1, "BILINEAR", 0, "Bilinear", "Bilinear interpolation."},
1106 {2, "BICUBIC", 0, "Bicubic", "Bicubic interpolation."},
1107 {0, NULL, 0, NULL, NULL}
1110 static const EnumPropertyItem translation_unit_items[]= {
1111 {0, "PIXELS", 0, "Pixels", ""},
1112 {1, "PERCENT", 0, "Percent", ""},
1113 {0, NULL, 0, NULL, NULL}
1116 srna = RNA_def_struct(brna, "TransformSequence", "EffectSequence");
1117 RNA_def_struct_ui_text(srna, "Transform Sequence", "Sequence strip applying affine transformations to other strips.");
1118 RNA_def_struct_sdna_from(srna, "TransformVars", "effectdata");
1120 prop= RNA_def_property(srna, "scale_start_x", PROP_FLOAT, PROP_UNSIGNED);
1121 RNA_def_property_float_sdna(prop, NULL, "ScalexIni");
1122 RNA_def_property_ui_text(prop, "Scale X", "");
1123 RNA_def_property_ui_range(prop, 0, 10, 3, 10);
1124 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1126 prop= RNA_def_property(srna, "scale_start_y", PROP_FLOAT, PROP_UNSIGNED);
1127 RNA_def_property_float_sdna(prop, NULL, "ScaleyIni");
1128 RNA_def_property_ui_text(prop, "Scale Y", "");
1129 RNA_def_property_ui_range(prop, 0, 10, 3, 10);
1130 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1132 prop= RNA_def_property(srna, "uniform_scale", PROP_BOOLEAN, PROP_NONE);
1133 RNA_def_property_boolean_sdna(prop, NULL, "uniform_scale", 0);
1134 RNA_def_property_ui_text(prop, "Uniform Scale", "Scale uniformly, preserving aspect ratio.");
1135 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1137 prop= RNA_def_property(srna, "translate_start_x", PROP_FLOAT, PROP_NONE);
1138 RNA_def_property_float_sdna(prop, NULL, "xIni");
1139 RNA_def_property_ui_text(prop, "Translate X", "");
1140 RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
1141 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1143 prop= RNA_def_property(srna, "translate_start_y", PROP_FLOAT, PROP_NONE);
1144 RNA_def_property_float_sdna(prop, NULL, "yIni");
1145 RNA_def_property_ui_text(prop, "Translate Y", "");
1146 RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
1147 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1149 prop= RNA_def_property(srna, "rotation_start", PROP_FLOAT, PROP_NONE);
1150 RNA_def_property_float_sdna(prop, NULL, "rotIni");
1151 RNA_def_property_range(prop, -360.0f, 360.0f);
1152 RNA_def_property_ui_text(prop, "Rotation", "");
1153 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1155 prop= RNA_def_property(srna, "translation_unit", PROP_ENUM, PROP_NONE);
1156 RNA_def_property_enum_sdna(prop, NULL, "percent");
1157 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* not meant to be animated */
1158 RNA_def_property_enum_items(prop, translation_unit_items);
1159 RNA_def_property_ui_text(prop, "Translation Unit", "");
1160 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1162 prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
1163 RNA_def_property_enum_items(prop, interpolation_items);
1164 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* not meant to be animated */
1165 RNA_def_property_ui_text(prop, "Interpolation", "");
1166 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1169 static void rna_def_solid_color(BlenderRNA *brna)
1174 srna = RNA_def_struct(brna, "ColorSequence", "EffectSequence");
1175 RNA_def_struct_ui_text(srna, "Color Sequence", "Sequence strip creating an image filled with a single color.");
1176 RNA_def_struct_sdna_from(srna, "SolidColorVars", "effectdata");
1178 prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
1179 RNA_def_property_float_sdna(prop, NULL, "col");
1180 RNA_def_property_ui_text(prop, "Color", "");
1181 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1184 static void rna_def_speed_control(BlenderRNA *brna)
1189 srna = RNA_def_struct(brna, "SpeedControlSequence", "EffectSequence");
1190 RNA_def_struct_ui_text(srna, "SpeedControl Sequence", "Sequence strip to control the speed of other strips.");
1191 RNA_def_struct_sdna_from(srna, "SpeedControlVars", "effectdata");
1193 prop= RNA_def_property(srna, "global_speed", PROP_FLOAT, PROP_UNSIGNED);
1194 RNA_def_property_float_sdna(prop, NULL, "globalSpeed");
1195 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* seq->facf0 is used to animate this */
1196 RNA_def_property_ui_text(prop, "Global Speed", "");
1197 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 0);
1198 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1200 prop= RNA_def_property(srna, "curve_velocity", PROP_BOOLEAN, PROP_NONE);
1201 RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_INTEGRATE);
1202 RNA_def_property_ui_text(prop, "F-Curve Velocity", "Interpret the F-Curve value as a velocity instead of a frame number.");
1203 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1205 prop= RNA_def_property(srna, "frame_blending", PROP_BOOLEAN, PROP_NONE);
1206 RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_BLEND);
1207 RNA_def_property_ui_text(prop, "Frame Blending", "Blend two frames into the target for a smoother result.");
1208 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1210 prop= RNA_def_property(srna, "curve_compress_y", PROP_BOOLEAN, PROP_NONE);
1211 RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_COMPRESS_IPO_Y);
1212 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.");
1213 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1216 void RNA_def_sequencer(BlenderRNA *brna)
1218 rna_def_strip_element(brna);
1219 rna_def_strip_proxy(brna);
1220 rna_def_strip_color_balance(brna);
1221 rna_def_strip_crop(brna);
1222 rna_def_strip_transform(brna);
1224 rna_def_sequence(brna);
1225 rna_def_editor(brna);
1227 rna_def_image(brna);
1229 rna_def_scene(brna);
1230 rna_def_movie(brna);
1231 rna_def_sound(brna);
1232 rna_def_effect(brna);
1233 rna_def_plugin(brna);
1236 rna_def_transform(brna);
1237 rna_def_solid_color(brna);
1238 rna_def_speed_control(brna);