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);
96 calc_sequence_disp(seq);
98 if( seq_test_overlap(ed->seqbasep, seq) ) {
99 shuffle_seq(ed->seqbasep, 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);
156 if( seq_test_overlap(ed->seqbasep, seq) ) {
157 shuffle_seq(ed->seqbasep, seq);
162 /* properties that need to allocate structs */
163 static void rna_Sequence_use_color_balance_set(PointerRNA *ptr, int value)
165 Sequence *seq= (Sequence*)ptr->data;
169 seq->flag |= SEQ_USE_COLOR_BALANCE;
170 if(seq->strip->color_balance == NULL) {
171 seq->strip->color_balance = MEM_callocN(sizeof(struct StripColorBalance), "StripColorBalance");
172 for (c=0; c<3; c++) {
173 seq->strip->color_balance->lift[c] = 1.0f;
174 seq->strip->color_balance->gamma[c] = 1.0f;
175 seq->strip->color_balance->gain[c] = 1.0f;
179 seq->flag ^= SEQ_USE_COLOR_BALANCE;
183 static void rna_Sequence_use_proxy_set(PointerRNA *ptr, int value)
185 Sequence *seq= (Sequence*)ptr->data;
187 seq->flag |= SEQ_USE_PROXY;
188 if(seq->strip->proxy == NULL) {
189 seq->strip->proxy = MEM_callocN(sizeof(struct StripProxy), "StripProxy");
192 seq->flag ^= SEQ_USE_PROXY;
196 static void rna_Sequence_use_translation_set(PointerRNA *ptr, int value)
198 Sequence *seq= (Sequence*)ptr->data;
200 seq->flag |= SEQ_USE_TRANSFORM;
201 if(seq->strip->transform == NULL) {
202 seq->strip->transform = MEM_callocN(sizeof(struct StripTransform), "StripTransform");
205 seq->flag ^= SEQ_USE_TRANSFORM;
209 static void rna_Sequence_use_crop_set(PointerRNA *ptr, int value)
211 Sequence *seq= (Sequence*)ptr->data;
213 seq->flag |= SEQ_USE_CROP;
214 if(seq->strip->crop == NULL) {
215 seq->strip->crop = MEM_callocN(sizeof(struct StripCrop), "StripCrop");
218 seq->flag ^= SEQ_USE_CROP;
221 /* name functions that ignore the first two characters */
222 static void rna_Sequence_name_get(PointerRNA *ptr, char *value)
224 Sequence *seq= (Sequence*)ptr->data;
225 BLI_strncpy(value, seq->name+2, sizeof(seq->name)-2);
228 static int rna_Sequence_name_length(PointerRNA *ptr)
230 Sequence *seq= (Sequence*)ptr->data;
231 return strlen(seq->name+2);
234 static void rna_Sequence_name_set(PointerRNA *ptr, const char *value)
236 Scene *scene= (Scene*)ptr->id.data;
237 Sequence *seq= (Sequence*)ptr->data;
238 BLI_strncpy(seq->name+2, value, sizeof(seq->name)-2);
239 seqUniqueName(&scene->ed->seqbase, seq);
242 static StructRNA* rna_Sequence_refine(struct PointerRNA *ptr)
244 Sequence *seq= (Sequence*)ptr->data;
248 return &RNA_ImageSequence;
250 return &RNA_MetaSequence;
252 return &RNA_SceneSequence;
254 return &RNA_MovieSequence;
256 return &RNA_SoundSequence;
265 return &RNA_EffectSequence;
267 return &RNA_PluginSequence;
269 return &RNA_WipeSequence;
271 return &RNA_GlowSequence;
273 return &RNA_TransformSequence;
275 return &RNA_ColorSequence;
277 return &RNA_SpeedControlSequence;
279 return &RNA_Sequence;
283 static char *rna_Sequence_path(PointerRNA *ptr)
285 Sequence *seq= (Sequence*)ptr->data;
287 /* sequencer data comes from scene...
288 * TODO: would be nice to make SequenceEditor data a datablock of its own (for shorter paths)
291 return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"]", seq->name+2);
293 return BLI_strdup("");
296 static PointerRNA rna_SequenceEditor_meta_stack_get(CollectionPropertyIterator *iter)
298 ListBaseIterator *internal= iter->internal;
299 MetaStack *ms= (MetaStack*)internal->link;
301 return rna_pointer_inherit_refine(&iter->parent, &RNA_Sequence, ms->parseq);
304 static void rna_MovieSequence_filename_set(PointerRNA *ptr, const char *value)
306 Sequence *seq= (Sequence*)(ptr->data);
307 char dir[FILE_MAX], name[FILE_MAX];
309 BLI_split_dirfile_basic(value, dir, name);
310 BLI_strncpy(seq->strip->dir, dir, sizeof(seq->strip->dir));
311 BLI_strncpy(seq->strip->stripdata->name, name, sizeof(seq->strip->stripdata->name));
314 static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value)
316 Sequence *seq= (Sequence*)(ptr->data);
317 char dir[FILE_MAX], name[FILE_MAX];
319 BLI_split_dirfile_basic(value, dir, name);
320 BLI_strncpy(seq->strip->dir, dir, sizeof(seq->strip->dir));
321 BLI_strncpy(seq->strip->stripdata->name, name, sizeof(seq->strip->stripdata->name));
324 static void rna_SequenceElement_filename_set(PointerRNA *ptr, const char *value)
326 StripElem *elem= (StripElem*)(ptr->data);
329 BLI_split_dirfile_basic(value, NULL, name);
330 BLI_strncpy(elem->name, name, sizeof(elem->name));
333 static void rna_Sequence_update(Main *bmain, Scene *scene, PointerRNA *ptr)
335 Editing *ed= seq_give_editing(scene, FALSE);
337 free_imbuf_seq(scene, &ed->seqbase, FALSE);
339 if(RNA_struct_is_a(ptr->type, &RNA_SoundSequence))
340 seq_update_sound(ptr->data);
343 static void rna_Sequence_mute_update(Main *bmain, Scene *scene, PointerRNA *ptr)
345 Editing *ed= seq_give_editing(scene, FALSE);
347 seq_update_muting(ed);
348 rna_Sequence_update(bmain, scene, ptr);
353 static void rna_def_strip_element(BlenderRNA *brna)
358 srna = RNA_def_struct(brna, "SequenceElement", NULL);
359 RNA_def_struct_ui_text(srna, "Sequence Element", "Sequence strip data for a single frame.");
360 RNA_def_struct_sdna(srna, "StripElem");
362 prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
363 RNA_def_property_string_sdna(prop, NULL, "name");
364 RNA_def_property_ui_text(prop, "Filename", "");
365 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SequenceElement_filename_set");
366 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
369 static void rna_def_strip_crop(BlenderRNA *brna)
374 srna = RNA_def_struct(brna, "SequenceCrop", NULL);
375 RNA_def_struct_ui_text(srna, "Sequence Crop", "Cropping parameters for a sequence strip.");
376 RNA_def_struct_sdna(srna, "StripCrop");
378 prop= RNA_def_property(srna, "top", PROP_INT, PROP_UNSIGNED);
379 RNA_def_property_ui_text(prop, "Top", "");
380 RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
381 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
383 prop= RNA_def_property(srna, "bottom", PROP_INT, PROP_UNSIGNED);
384 RNA_def_property_ui_text(prop, "Bottom", "");
385 RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
386 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
388 prop= RNA_def_property(srna, "left", PROP_INT, PROP_UNSIGNED);
389 RNA_def_property_ui_text(prop, "Left", "");
390 RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
391 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
393 prop= RNA_def_property(srna, "right", PROP_INT, PROP_UNSIGNED);
394 RNA_def_property_ui_text(prop, "Right", "");
395 RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
396 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
399 static void rna_def_strip_transform(BlenderRNA *brna)
404 srna = RNA_def_struct(brna, "SequenceTransform", NULL);
405 RNA_def_struct_ui_text(srna, "Sequence Transform", "Transform parameters for a sequence strip.");
406 RNA_def_struct_sdna(srna, "StripTransform");
408 prop= RNA_def_property(srna, "offset_x", PROP_INT, PROP_NONE);
409 RNA_def_property_int_sdna(prop, NULL, "xofs");
410 RNA_def_property_ui_text(prop, "Offset Y", "");
411 RNA_def_property_ui_range(prop, -4096, 4096, 1, 0);
412 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
414 prop= RNA_def_property(srna, "offset_y", PROP_INT, PROP_NONE);
415 RNA_def_property_int_sdna(prop, NULL, "yofs");
416 RNA_def_property_ui_text(prop, "Offset Y", "");
417 RNA_def_property_ui_range(prop, -4096, 4096, 1, 0);
418 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
421 static void rna_def_strip_proxy(BlenderRNA *brna)
426 srna = RNA_def_struct(brna, "SequenceProxy", NULL);
427 RNA_def_struct_ui_text(srna, "Sequence Proxy", "Proxy parameters for a sequence strip.");
428 RNA_def_struct_sdna(srna, "StripProxy");
430 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
431 RNA_def_property_string_sdna(prop, NULL, "dir");
432 RNA_def_property_ui_text(prop, "Directory", "Location to story the proxy file");
433 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
435 prop= RNA_def_property(srna, "file", PROP_STRING, PROP_DIRPATH);
436 RNA_def_property_string_sdna(prop, NULL, "file");
437 RNA_def_property_ui_text(prop, "File", "Proxy file name");
438 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
441 static void rna_def_strip_color_balance(BlenderRNA *brna)
446 srna = RNA_def_struct(brna, "SequenceColorBalance", NULL);
447 RNA_def_struct_ui_text(srna, "Sequence Color Balance", "Color balance parameters for a sequence strip.");
448 RNA_def_struct_sdna(srna, "StripColorBalance");
450 prop= RNA_def_property(srna, "lift", PROP_FLOAT, PROP_COLOR);
451 RNA_def_property_ui_text(prop, "Lift", "Color balance lift (shadows).");
452 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
454 prop= RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_COLOR);
455 RNA_def_property_ui_text(prop, "Gamma", "Color balance gamma (midtones).");
456 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
458 prop= RNA_def_property(srna, "gain", PROP_FLOAT, PROP_COLOR);
459 RNA_def_property_ui_text(prop, "Gain", "Color balance gain (highlights).");
460 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
462 prop= RNA_def_property(srna, "inverse_gain", PROP_BOOLEAN, PROP_NONE);
463 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_GAIN);
464 RNA_def_property_ui_text(prop, "Inverse Gain", "");
465 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
467 prop= RNA_def_property(srna, "inverse_gamma", PROP_BOOLEAN, PROP_NONE);
468 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_GAMMA);
469 RNA_def_property_ui_text(prop, "Inverse Gamma", "");
470 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
472 prop= RNA_def_property(srna, "inverse_lift", PROP_BOOLEAN, PROP_NONE);
473 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_LIFT);
474 RNA_def_property_ui_text(prop, "Inverse Lift", "");
475 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
478 prop= RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE);
479 RNA_def_property_range(prop, 0.0f, 1.0f);
480 RNA_def_property_ui_text(prop, "Exposure", "");
481 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
483 prop= RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE);
484 RNA_def_property_range(prop, 0.0f, 1.0f);
485 RNA_def_property_ui_text(prop, "Saturation", "");
486 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); */
489 static void rna_def_sequence(BlenderRNA *brna)
495 static const EnumPropertyItem seq_type_items[]= {
496 {SEQ_IMAGE, "IMAGE", 0, "Image", ""},
497 {SEQ_META, "META", 0, "Meta", ""},
498 {SEQ_SCENE, "SCENE", 0, "Scene", ""},
499 {SEQ_MOVIE, "MOVIE", 0, "Movie", ""},
500 {SEQ_SOUND, "SOUND", 0, "Sound", ""},
501 {SEQ_CROSS, "CROSS", 0, "Cross", ""},
502 {SEQ_ADD, "ADD", 0, "Add", ""},
503 {SEQ_SUB, "SUBTRACT", 0, "Subtract", ""},
504 {SEQ_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
505 {SEQ_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
506 {SEQ_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
507 {SEQ_MUL, "MULTIPLY", 0, "Multiply", ""},
508 {SEQ_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
509 {SEQ_PLUGIN, "PLUGIN", 0, "plugin", ""},
510 {SEQ_WIPE, "WIPE", 0, "Wipe", ""},
511 {SEQ_GLOW, "GLOW", 0, "Glow", ""},
512 {SEQ_TRANSFORM, "TRANSFORM", 0, "Transform", ""},
513 {SEQ_COLOR, "COLOR", 0, "Color", ""},
514 {SEQ_SPEED, "SPEED", 0, "Speed", ""},
515 {0, NULL, 0, NULL, NULL}};
517 static const EnumPropertyItem blend_mode_items[]= {
518 {SEQ_BLEND_REPLACE, "REPLACE", 0, "Replace", ""},
519 {SEQ_CROSS, "CROSS", 0, "Cross", ""},
520 {SEQ_ADD, "ADD", 0, "Add", ""},
521 {SEQ_SUB, "SUBTRACT", 0, "Subtract", ""},
522 {SEQ_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
523 {SEQ_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
524 {SEQ_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
525 {SEQ_MUL, "MULTIPLY", 0, "Multiply", ""},
526 {SEQ_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
527 {0, NULL, 0, NULL, NULL}};
529 srna = RNA_def_struct(brna, "Sequence", NULL);
530 RNA_def_struct_ui_text(srna, "Sequence", "Sequence strip in the sequence editor.");
531 RNA_def_struct_refine_func(srna, "rna_Sequence_refine");
532 RNA_def_struct_path_func(srna, "rna_Sequence_path");
534 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
535 RNA_def_property_string_funcs(prop, "rna_Sequence_name_get", "rna_Sequence_name_length", "rna_Sequence_name_set");
536 RNA_def_property_string_maxlength(prop, sizeof(((Sequence*)NULL)->name)-2);
537 RNA_def_property_ui_text(prop, "Name", "");
538 RNA_def_struct_name_property(srna, prop);
539 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
541 prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
542 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
543 RNA_def_property_enum_items(prop, seq_type_items);
544 RNA_def_property_ui_text(prop, "Type", "");
545 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
547 //prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
548 //RNA_def_property_ui_text(prop, "Ipo Curves", "Ipo curves used by this sequence.");
552 prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
553 RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
554 RNA_def_property_ui_text(prop, "Selected", "");
555 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER_SELECT, NULL);
557 prop= RNA_def_property(srna, "left_handle_selected", PROP_BOOLEAN, PROP_NONE);
558 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LEFTSEL);
559 RNA_def_property_ui_text(prop, "Left Handle Selected", "");
560 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER_SELECT, NULL);
562 prop= RNA_def_property(srna, "right_handle_selected", PROP_BOOLEAN, PROP_NONE);
563 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_RIGHTSEL);
564 RNA_def_property_ui_text(prop, "Right Handle Selected", "");
565 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER_SELECT, NULL);
567 prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
568 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MUTE);
569 RNA_def_property_ui_text(prop, "Mute", "");
570 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_mute_update");
572 prop= RNA_def_property(srna, "frame_locked", PROP_BOOLEAN, PROP_NONE);
573 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_IPO_FRAME_LOCKED);
574 RNA_def_property_ui_text(prop, "Frame Locked", "Lock the animation curve to the global frame counter.");
575 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
577 prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
578 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LOCK);
579 RNA_def_property_ui_text(prop, "Lock", "Lock strip so that it can't be transformed.");
580 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
582 /* strip positioning */
584 prop= RNA_def_property(srna, "length", PROP_INT, PROP_TIME);
585 RNA_def_property_int_sdna(prop, NULL, "len");
586 RNA_def_property_range(prop, 1, MAXFRAME);
587 RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip before the handles are applied");
588 RNA_def_property_int_funcs(prop, "rna_Sequence_length_get", "rna_Sequence_length_set",NULL);
589 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
591 prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_TIME);
592 RNA_def_property_int_sdna(prop, NULL, "start");
593 RNA_def_property_ui_text(prop, "Start Frame", "");
594 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_set",NULL); // overlap tests and calc_seq_disp
595 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
597 prop= RNA_def_property(srna, "start_frame_final", PROP_INT, PROP_TIME);
598 RNA_def_property_int_sdna(prop, NULL, "startdisp");
599 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.");
600 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_final_set", NULL); // overlap tests and calc_seq_disp
601 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
603 prop= RNA_def_property(srna, "end_frame_final", PROP_INT, PROP_TIME);
604 RNA_def_property_int_sdna(prop, NULL, "enddisp");
605 RNA_def_property_ui_text(prop, "End Frame", "End frame displayed in the sequence editor after offsets are applied.");
606 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_end_frame_final_set", NULL); // overlap tests and calc_seq_disp
607 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
609 prop= RNA_def_property(srna, "start_offset", PROP_INT, PROP_TIME);
610 RNA_def_property_int_sdna(prop, NULL, "startofs");
611 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
612 RNA_def_property_ui_text(prop, "Start Offset", "");
613 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
615 prop= RNA_def_property(srna, "end_offset", PROP_INT, PROP_TIME);
616 RNA_def_property_int_sdna(prop, NULL, "endofs");
617 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
618 RNA_def_property_ui_text(prop, "End offset", "");
619 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
621 prop= RNA_def_property(srna, "start_still", PROP_INT, PROP_TIME);
622 RNA_def_property_int_sdna(prop, NULL, "startstill");
623 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
624 RNA_def_property_range(prop, 0, MAXFRAME);
625 RNA_def_property_ui_text(prop, "Start Still", "");
626 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
628 prop= RNA_def_property(srna, "end_still", PROP_INT, PROP_TIME);
629 RNA_def_property_int_sdna(prop, NULL, "endstill");
630 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
631 RNA_def_property_range(prop, 0, MAXFRAME);
632 RNA_def_property_ui_text(prop, "End Still", "");
633 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
635 prop= RNA_def_property(srna, "channel", PROP_INT, PROP_UNSIGNED);
636 RNA_def_property_int_sdna(prop, NULL, "machine");
637 RNA_def_property_range(prop, 0, MAXSEQ-1);
638 RNA_def_property_ui_text(prop, "Channel", "Y position of the sequence strip.");
639 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_channel_set",NULL); // overlap test
640 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
644 prop= RNA_def_property(srna, "blend_mode", PROP_ENUM, PROP_NONE);
645 RNA_def_property_enum_items(prop, blend_mode_items);
646 RNA_def_property_ui_text(prop, "Blend Mode", "");
647 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
649 prop= RNA_def_property(srna, "blend_opacity", PROP_FLOAT, PROP_NONE);
650 RNA_def_property_range(prop, 0.0f, 100.0f);
651 RNA_def_property_ui_text(prop, "Blend Opacity", "");
652 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
654 prop= RNA_def_property(srna, "effect_fader", PROP_FLOAT, PROP_NONE);
655 RNA_def_property_range(prop, 0.0f, 1.0f);
656 RNA_def_property_float_sdna(prop, NULL, "effect_fader");
657 RNA_def_property_ui_text(prop, "Effect fader position", "");
658 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
660 prop= RNA_def_property(srna, "use_effect_default_fade", PROP_BOOLEAN, PROP_NONE);
661 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_EFFECT_DEFAULT_FADE);
662 RNA_def_property_ui_text(prop, "Use Default Fade", "Fade effect using the builtin default (usually make transition as long as effect strip).");
663 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
666 prop= RNA_def_property(srna, "speed_fader", PROP_FLOAT, PROP_NONE);
667 RNA_def_property_float_sdna(prop, NULL, "speed_fader");
668 RNA_def_property_ui_text(prop, "Speed effect fader position", "");
669 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
672 func= RNA_def_function(srna, "getStripElem", "give_stripelem");
673 RNA_def_function_ui_description(func, "Return the strip element from a given frame or None.");
674 prop= RNA_def_int(func, "frame", 0, -MAXFRAME, MAXFRAME, "Frame", "The frame to get the strip element from", -MAXFRAME, MAXFRAME);
675 RNA_def_property_flag(prop, PROP_REQUIRED);
676 RNA_def_function_return(func, RNA_def_pointer(func, "elem", "SequenceElement", "", "strip element of the current frame"));
679 static void rna_def_editor(BlenderRNA *brna)
684 srna = RNA_def_struct(brna, "SequenceEditor", NULL);
685 RNA_def_struct_ui_text(srna, "Sequence Editor", "Sequence editing data for a Scene datablock.");
686 RNA_def_struct_ui_icon(srna, ICON_SEQUENCE);
687 RNA_def_struct_sdna(srna, "Editing");
689 prop= RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE);
690 RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
691 RNA_def_property_struct_type(prop, "Sequence");
692 RNA_def_property_ui_text(prop, "Sequences", "");
694 prop= RNA_def_property(srna, "sequences_all", PROP_COLLECTION, PROP_NONE);
695 RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
696 RNA_def_property_struct_type(prop, "Sequence");
697 RNA_def_property_ui_text(prop, "Sequences", "");
698 RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_sequences_all_begin", "rna_SequenceEditor_sequences_all_next", 0, 0, 0, 0, 0);
700 prop= RNA_def_property(srna, "meta_stack", PROP_COLLECTION, PROP_NONE);
701 RNA_def_property_collection_sdna(prop, NULL, "metastack", NULL);
702 RNA_def_property_struct_type(prop, "Sequence");
703 RNA_def_property_ui_text(prop, "Meta Stack", "Meta strip stack, last is currently edited meta strip.");
704 RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_SequenceEditor_meta_stack_get", 0, 0, 0);
706 prop= RNA_def_property(srna, "active_strip", PROP_POINTER, PROP_NONE);
707 RNA_def_property_pointer_sdna(prop, NULL, "act_seq");
708 RNA_def_property_ui_text(prop, "Active Strip", "Sequencers active strip");
711 static void rna_def_filter_video(StructRNA *srna)
715 prop= RNA_def_property(srna, "de_interlace", PROP_BOOLEAN, PROP_NONE);
716 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FILTERY);
717 RNA_def_property_ui_text(prop, "De-Interlace", "For video movies to remove fields.");
719 prop= RNA_def_property(srna, "premultiply", PROP_BOOLEAN, PROP_NONE);
720 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_PREMUL);
721 RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha.");
722 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
724 prop= RNA_def_property(srna, "flip_x", PROP_BOOLEAN, PROP_NONE);
725 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPX);
726 RNA_def_property_ui_text(prop, "Flip X", "Flip on the X axis.");
727 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
729 prop= RNA_def_property(srna, "flip_y", PROP_BOOLEAN, PROP_NONE);
730 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPY);
731 RNA_def_property_ui_text(prop, "Flip Y", "Flip on the Y axis.");
732 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
734 prop= RNA_def_property(srna, "convert_float", PROP_BOOLEAN, PROP_NONE);
735 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_FLOAT);
736 RNA_def_property_ui_text(prop, "Convert Float", "Convert input to float data.");
737 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
739 prop= RNA_def_property(srna, "reverse_frames", PROP_BOOLEAN, PROP_NONE);
740 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_REVERSE_FRAMES);
741 RNA_def_property_ui_text(prop, "Flip Time", "Reverse frame order.");
742 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
744 prop= RNA_def_property(srna, "multiply_colors", PROP_FLOAT, PROP_UNSIGNED);
745 RNA_def_property_float_sdna(prop, NULL, "mul");
746 RNA_def_property_range(prop, 0.0f, 20.0f);
747 RNA_def_property_ui_text(prop, "Multiply Colors", "");
748 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
750 prop= RNA_def_property(srna, "strobe", PROP_FLOAT, PROP_NONE);
751 RNA_def_property_range(prop, 1.0f, 30.0f);
752 RNA_def_property_ui_text(prop, "Strobe", "Only display every nth frame.");
753 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
755 prop= RNA_def_property(srna, "use_color_balance", PROP_BOOLEAN, PROP_NONE);
756 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_COLOR_BALANCE);
757 RNA_def_property_ui_text(prop, "Use Color Balance", "(3-Way color correction) on input.");
758 RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_color_balance_set");
759 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
761 prop= RNA_def_property(srna, "color_balance", PROP_POINTER, PROP_NONE);
762 RNA_def_property_pointer_sdna(prop, NULL, "strip->color_balance");
763 RNA_def_property_ui_text(prop, "Color Balance", "");
765 prop= RNA_def_property(srna, "use_translation", PROP_BOOLEAN, PROP_NONE);
766 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_TRANSFORM);
767 RNA_def_property_ui_text(prop, "Use Translation", "Translate image before processing.");
768 RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_translation_set");
769 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
771 prop= RNA_def_property(srna, "transform", PROP_POINTER, PROP_NONE);
772 RNA_def_property_pointer_sdna(prop, NULL, "strip->transform");
773 RNA_def_property_ui_text(prop, "Transform", "");
775 prop= RNA_def_property(srna, "use_crop", PROP_BOOLEAN, PROP_NONE);
776 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_CROP);
777 RNA_def_property_ui_text(prop, "Use Crop", "Crop image before processing.");
778 RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_crop_set");
779 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
781 prop= RNA_def_property(srna, "crop", PROP_POINTER, PROP_NONE);
782 RNA_def_property_pointer_sdna(prop, NULL, "strip->crop");
783 RNA_def_property_ui_text(prop, "Crop", "");
786 static void rna_def_proxy(StructRNA *srna)
790 prop= RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE);
791 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY);
792 RNA_def_property_ui_text(prop, "Use Proxy", "Use a preview proxy for this strip.");
793 RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_proxy_set");
795 prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
796 RNA_def_property_pointer_sdna(prop, NULL, "strip->proxy");
797 RNA_def_property_ui_text(prop, "Proxy", "");
799 prop= RNA_def_property(srna, "proxy_custom_directory", PROP_BOOLEAN, PROP_NONE);
800 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY_CUSTOM_DIR);
801 RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Use a custom directory to store data.");
802 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
805 static void rna_def_input(StructRNA *srna)
809 prop= RNA_def_property(srna, "animation_start_offset", PROP_INT, PROP_UNSIGNED);
810 RNA_def_property_int_sdna(prop, NULL, "anim_startofs");
811 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap test
812 RNA_def_property_ui_text(prop, "Animation Start Offset", "Animation start offset (trim start).");
813 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
815 prop= RNA_def_property(srna, "animation_end_offset", PROP_INT, PROP_UNSIGNED);
816 RNA_def_property_int_sdna(prop, NULL, "anim_endofs");
817 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap test
818 RNA_def_property_ui_text(prop, "Animation End Offset", "Animation end offset (trim end).");
819 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
822 static void rna_def_image(BlenderRNA *brna)
827 srna = RNA_def_struct(brna, "ImageSequence", "Sequence");
828 RNA_def_struct_ui_text(srna, "Image Sequence", "Sequence strip to load one or more images.");
829 RNA_def_struct_sdna(srna, "Sequence");
831 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
832 RNA_def_property_string_sdna(prop, NULL, "strip->dir");
833 RNA_def_property_ui_text(prop, "Directory", "");
834 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
836 prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE);
837 RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", "strip->len");
838 RNA_def_property_struct_type(prop, "SequenceElement");
839 RNA_def_property_ui_text(prop, "Elements", "");
841 rna_def_filter_video(srna);
846 static void rna_def_meta(BlenderRNA *brna)
851 srna = RNA_def_struct(brna, "MetaSequence", "Sequence");
852 RNA_def_struct_ui_text(srna, "Meta Sequence", "Sequence strip to group other strips as a single sequence strip.");
853 RNA_def_struct_sdna(srna, "Sequence");
855 prop = RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE);
856 RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
857 RNA_def_property_struct_type(prop, "Sequence");
858 RNA_def_property_ui_text(prop, "Sequences", "");
860 rna_def_filter_video(srna);
865 static void rna_def_scene(BlenderRNA *brna)
870 srna = RNA_def_struct(brna, "SceneSequence", "Sequence");
871 RNA_def_struct_ui_text(srna, "Scene Sequence", "Sequence strip to used the rendered image of a scene.");
872 RNA_def_struct_sdna(srna, "Sequence");
874 prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
875 RNA_def_property_flag(prop, PROP_EDITABLE);
876 RNA_def_property_ui_text(prop, "Scene", "Scene that this sequence uses.");
877 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
879 rna_def_filter_video(srna);
884 static void rna_def_movie(BlenderRNA *brna)
889 srna = RNA_def_struct(brna, "MovieSequence", "Sequence");
890 RNA_def_struct_ui_text(srna, "Movie Sequence", "Sequence strip to load a video.");
891 RNA_def_struct_sdna(srna, "Sequence");
893 prop= RNA_def_property(srna, "mpeg_preseek", PROP_INT, PROP_NONE);
894 RNA_def_property_int_sdna(prop, NULL, "anim_preseek");
895 RNA_def_property_range(prop, 0, 50);
896 RNA_def_property_ui_text(prop, "MPEG Preseek", "For MPEG movies, preseek this many frames.");
897 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
899 prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
900 RNA_def_property_string_sdna(prop, NULL, "strip->stripdata->name");
901 RNA_def_property_ui_text(prop, "Filename", "");
902 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MovieSequence_filename_set");
903 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
905 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
906 RNA_def_property_string_sdna(prop, NULL, "strip->dir");
907 RNA_def_property_ui_text(prop, "Directory", "");
908 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
910 rna_def_filter_video(srna);
915 static void rna_def_sound(BlenderRNA *brna)
920 srna = RNA_def_struct(brna, "SoundSequence", "Sequence");
921 RNA_def_struct_ui_text(srna, "Sound Sequence", "Sequence strip defining a sound to be played over a period of time.");
922 RNA_def_struct_sdna(srna, "Sequence");
924 prop= RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE);
925 RNA_def_property_struct_type(prop, "Sound");
926 RNA_def_property_ui_text(prop, "Sound", "Sound datablock used by this sequence.");
927 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
929 prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
930 RNA_def_property_string_sdna(prop, NULL, "strip->stripdata->name");
931 RNA_def_property_ui_text(prop, "Filename", "");
932 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SoundSequence_filename_set");
933 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
935 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
936 RNA_def_property_string_sdna(prop, NULL, "strip->dir");
937 RNA_def_property_ui_text(prop, "Directory", "");
938 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
942 RNA_def_struct_sdna_from(srna, "SoundHandle", "sound_handle");
944 prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
945 RNA_def_property_float_sdna(prop, NULL, "volume");
946 RNA_def_property_range(prop, 0.0f, 1.0f);
947 RNA_def_property_ui_text(prop, "Volume", "Playback volume of the sound");
948 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
951 static void rna_def_effect(BlenderRNA *brna)
955 srna = RNA_def_struct(brna, "EffectSequence", "Sequence");
956 RNA_def_struct_ui_text(srna, "Effect Sequence", "Sequence strip applying an effect on the images created by other strips.");
957 RNA_def_struct_sdna(srna, "Sequence");
962 static void rna_def_plugin(BlenderRNA *brna)
967 srna = RNA_def_struct(brna, "PluginSequence", "EffectSequence");
968 RNA_def_struct_ui_text(srna, "Plugin Sequence", "Sequence strip applying an effect, loaded from an external plugin.");
969 RNA_def_struct_sdna_from(srna, "PluginSeq", "plugin");
971 prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
972 RNA_def_property_string_sdna(prop, NULL, "name");
973 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
974 RNA_def_property_ui_text(prop, "Filename", "");
975 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
977 /* plugin properties need custom wrapping code like ID properties */
980 static void rna_def_wipe(BlenderRNA *brna)
985 static const EnumPropertyItem wipe_type_items[]= {
986 {0, "SINGLE", 0, "Single", ""},
987 {1, "DOUBLE", 0, "Double", ""},
988 /* not used yet {2, "BOX", 0, "Box", ""}, */
989 /* not used yet {3, "CROSS", 0, "Cross", ""}, */
990 {4, "IRIS", 0, "Iris", ""},
991 {5, "CLOCK", 0, "Clock", ""},
992 {0, NULL, 0, NULL, NULL}
995 static const EnumPropertyItem wipe_direction_items[]= {
996 {0, "OUT", 0, "Out", ""},
997 {1, "IN", 0, "In", ""},
998 {0, NULL, 0, NULL, NULL}
1001 srna = RNA_def_struct(brna, "WipeSequence", "EffectSequence");
1002 RNA_def_struct_ui_text(srna, "Wipe Sequence", "Sequence strip creating a wipe transition.");
1003 RNA_def_struct_sdna_from(srna, "WipeVars", "effectdata");
1005 prop= RNA_def_property(srna, "blur_width", PROP_FLOAT, PROP_UNSIGNED);
1006 RNA_def_property_float_sdna(prop, NULL, "edgeWidth");
1007 RNA_def_property_range(prop, 0.0f, 1.0f);
1008 RNA_def_property_ui_text(prop, "Blur Width", "Width of the blur edge, in percentage relative to the image size.");
1009 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1011 prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
1012 RNA_def_property_float_sdna(prop, NULL, "angle");
1013 RNA_def_property_range(prop, -90.0f, 90.0f);
1014 RNA_def_property_ui_text(prop, "Angle", "Edge angle.");
1015 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1017 prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
1018 RNA_def_property_enum_sdna(prop, NULL, "forward");
1019 RNA_def_property_enum_items(prop, wipe_direction_items);
1020 RNA_def_property_ui_text(prop, "Direction", "Wipe direction.");
1021 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1023 prop= RNA_def_property(srna, "transition_type", PROP_ENUM, PROP_NONE);
1024 RNA_def_property_enum_sdna(prop, NULL, "wipetype");
1025 RNA_def_property_enum_items(prop, wipe_type_items);
1026 RNA_def_property_ui_text(prop, "Transition Type", "");
1027 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1030 static void rna_def_glow(BlenderRNA *brna)
1035 srna = RNA_def_struct(brna, "GlowSequence", "EffectSequence");
1036 RNA_def_struct_ui_text(srna, "Glow Sequence", "Sequence strip creating a glow effect.");
1037 RNA_def_struct_sdna_from(srna, "GlowVars", "effectdata");
1039 prop= RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
1040 RNA_def_property_float_sdna(prop, NULL, "fMini");
1041 RNA_def_property_range(prop, 0.0f, 1.0f);
1042 RNA_def_property_ui_text(prop, "Threshold", "Minimum intensity to trigger a glow");
1043 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1045 prop= RNA_def_property(srna, "clamp", PROP_FLOAT, PROP_NONE);
1046 RNA_def_property_float_sdna(prop, NULL, "fClamp");
1047 RNA_def_property_range(prop, 0.0f, 1.0f);
1048 RNA_def_property_ui_text(prop, "Clamp", "rightness limit of intensity.");
1049 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1051 prop= RNA_def_property(srna, "boost_factor", PROP_FLOAT, PROP_NONE);
1052 RNA_def_property_float_sdna(prop, NULL, "fBoost");
1053 RNA_def_property_range(prop, 0.0f, 10.0f);
1054 RNA_def_property_ui_text(prop, "Boost Factor", "Brightness multiplier.");
1055 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1057 prop= RNA_def_property(srna, "blur_distance", PROP_FLOAT, PROP_NONE);
1058 RNA_def_property_float_sdna(prop, NULL, "dDist");
1059 RNA_def_property_range(prop, 0.5f, 20.0f);
1060 RNA_def_property_ui_text(prop, "Blur Distance", "Radius of glow effect.");
1061 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1063 prop= RNA_def_property(srna, "quality", PROP_INT, PROP_NONE);
1064 RNA_def_property_int_sdna(prop, NULL, "dQuality");
1065 RNA_def_property_range(prop, 1, 5);
1066 RNA_def_property_ui_text(prop, "Quality", "Accuracy of the blur effect.");
1067 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1069 prop= RNA_def_property(srna, "only_boost", PROP_BOOLEAN, PROP_NONE);
1070 RNA_def_property_boolean_sdna(prop, NULL, "bNoComp", 0);
1071 RNA_def_property_ui_text(prop, "Only Boost", "Show the glow buffer only.");
1072 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1075 static void rna_def_transform(BlenderRNA *brna)
1080 static const EnumPropertyItem interpolation_items[]= {
1081 {0, "NONE", 0, "None", "No interpolation."},
1082 {1, "BILINEAR", 0, "Bilinear", "Bilinear interpolation."},
1083 {2, "BICUBIC", 0, "Bicubic", "Bicubic interpolation."},
1084 {0, NULL, 0, NULL, NULL}
1087 static const EnumPropertyItem translation_unit_items[]= {
1088 {0, "PIXELS", 0, "Pixels", ""},
1089 {1, "PERCENT", 0, "Percent", ""},
1090 {0, NULL, 0, NULL, NULL}
1093 srna = RNA_def_struct(brna, "TransformSequence", "EffectSequence");
1094 RNA_def_struct_ui_text(srna, "Transform Sequence", "Sequence strip applying affine transformations to other strips.");
1095 RNA_def_struct_sdna_from(srna, "TransformVars", "effectdata");
1097 prop= RNA_def_property(srna, "scale_start_x", PROP_FLOAT, PROP_UNSIGNED);
1098 RNA_def_property_float_sdna(prop, NULL, "ScalexIni");
1099 RNA_def_property_ui_text(prop, "Scale X", "");
1100 RNA_def_property_ui_range(prop, 0, 10, 3, 10);
1101 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1103 prop= RNA_def_property(srna, "scale_start_y", PROP_FLOAT, PROP_UNSIGNED);
1104 RNA_def_property_float_sdna(prop, NULL, "ScaleyIni");
1105 RNA_def_property_ui_text(prop, "Scale Y", "");
1106 RNA_def_property_ui_range(prop, 0, 10, 3, 10);
1107 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1109 prop= RNA_def_property(srna, "uniform_scale", PROP_BOOLEAN, PROP_NONE);
1110 RNA_def_property_boolean_sdna(prop, NULL, "uniform_scale", 0);
1111 RNA_def_property_ui_text(prop, "Uniform Scale", "Scale uniformly, preserving aspect ratio.");
1112 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1114 prop= RNA_def_property(srna, "translate_start_x", PROP_FLOAT, PROP_NONE);
1115 RNA_def_property_float_sdna(prop, NULL, "xIni");
1116 RNA_def_property_ui_text(prop, "Translate X", "");
1117 RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
1118 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1120 prop= RNA_def_property(srna, "translate_start_y", PROP_FLOAT, PROP_NONE);
1121 RNA_def_property_float_sdna(prop, NULL, "yIni");
1122 RNA_def_property_ui_text(prop, "Translate Y", "");
1123 RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
1124 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1126 prop= RNA_def_property(srna, "rotation_start", PROP_FLOAT, PROP_NONE);
1127 RNA_def_property_float_sdna(prop, NULL, "rotIni");
1128 RNA_def_property_range(prop, -360.0f, 360.0f);
1129 RNA_def_property_ui_text(prop, "Rotation", "");
1130 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1132 prop= RNA_def_property(srna, "translation_unit", PROP_ENUM, PROP_NONE);
1133 RNA_def_property_enum_sdna(prop, NULL, "percent");
1134 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* not meant to be animated */
1135 RNA_def_property_enum_items(prop, translation_unit_items);
1136 RNA_def_property_ui_text(prop, "Translation Unit", "");
1137 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1139 prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
1140 RNA_def_property_enum_items(prop, interpolation_items);
1141 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* not meant to be animated */
1142 RNA_def_property_ui_text(prop, "Interpolation", "");
1143 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1146 static void rna_def_solid_color(BlenderRNA *brna)
1151 srna = RNA_def_struct(brna, "ColorSequence", "EffectSequence");
1152 RNA_def_struct_ui_text(srna, "Color Sequence", "Sequence strip creating an image filled with a single color.");
1153 RNA_def_struct_sdna_from(srna, "SolidColorVars", "effectdata");
1155 prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
1156 RNA_def_property_float_sdna(prop, NULL, "col");
1157 RNA_def_property_ui_text(prop, "Color", "");
1158 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1161 static void rna_def_speed_control(BlenderRNA *brna)
1166 srna = RNA_def_struct(brna, "SpeedControlSequence", "EffectSequence");
1167 RNA_def_struct_ui_text(srna, "SpeedControl Sequence", "Sequence strip to control the speed of other strips.");
1168 RNA_def_struct_sdna_from(srna, "SpeedControlVars", "effectdata");
1170 prop= RNA_def_property(srna, "global_speed", PROP_FLOAT, PROP_UNSIGNED);
1171 RNA_def_property_float_sdna(prop, NULL, "globalSpeed");
1172 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* seq->facf0 is used to animate this */
1173 RNA_def_property_ui_text(prop, "Global Speed", "");
1174 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 0);
1175 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1177 prop= RNA_def_property(srna, "curve_velocity", PROP_BOOLEAN, PROP_NONE);
1178 RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_INTEGRATE);
1179 RNA_def_property_ui_text(prop, "F-Curve Velocity", "Interpret the F-Curve value as a velocity instead of a frame number.");
1180 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1182 prop= RNA_def_property(srna, "frame_blending", PROP_BOOLEAN, PROP_NONE);
1183 RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_BLEND);
1184 RNA_def_property_ui_text(prop, "Frame Blending", "Blend two frames into the target for a smoother result.");
1185 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1187 prop= RNA_def_property(srna, "curve_compress_y", PROP_BOOLEAN, PROP_NONE);
1188 RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_COMPRESS_IPO_Y);
1189 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.");
1190 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
1193 void RNA_def_sequencer(BlenderRNA *brna)
1195 rna_def_strip_element(brna);
1196 rna_def_strip_proxy(brna);
1197 rna_def_strip_color_balance(brna);
1198 rna_def_strip_crop(brna);
1199 rna_def_strip_transform(brna);
1201 rna_def_sequence(brna);
1202 rna_def_editor(brna);
1204 rna_def_image(brna);
1206 rna_def_scene(brna);
1207 rna_def_movie(brna);
1208 rna_def_sound(brna);
1209 rna_def_effect(brna);
1210 rna_def_plugin(brna);
1213 rna_def_transform(brna);
1214 rna_def_solid_color(brna);
1215 rna_def_speed_control(brna);