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_define.h"
29 #include "RNA_types.h"
31 #include "rna_internal.h"
33 #include "DNA_object_types.h"
34 #include "DNA_scene_types.h"
35 #include "DNA_sequence_types.h"
37 #include "BKE_sequence.h"
39 #include "MEM_guardedalloc.h"
45 static void rna_SequenceEditor_start_frame_set(PointerRNA *ptr, int value)
47 Sequence *seq= (Sequence*)ptr->data;
48 Scene *sce= (Scene*)ptr->id.data;
49 Editing *ed= seq_give_editing(sce, FALSE);
52 calc_sequence_disp(seq);
54 if( seq_test_overlap(ed->seqbasep, seq) ) {
55 shuffle_seq(ed->seqbasep, seq);
60 static void rna_SequenceEditor_length_set(PointerRNA *ptr, int value)
62 Sequence *seq= (Sequence*)ptr->data;
63 Scene *sce= (Scene*)ptr->id.data;
64 Editing *ed= seq_give_editing(sce, FALSE);
66 seq_tx_set_final_right(seq, seq->start+value);
67 calc_sequence_disp(seq);
69 if( seq_test_overlap(ed->seqbasep, seq) ) {
70 shuffle_seq(ed->seqbasep, seq);
75 static int rna_SequenceEditor_length_get(PointerRNA *ptr)
77 Sequence *seq= (Sequence*)ptr->data;
78 return seq_tx_get_final_right(seq, 0)-seq_tx_get_final_left(seq, 0);
81 static void rna_SequenceEditor_channel_set(PointerRNA *ptr, int value)
83 Sequence *seq= (Sequence*)ptr->data;
84 Scene *sce= (Scene*)ptr->id.data;
85 Editing *ed= seq_give_editing(sce, FALSE);
89 if( seq_test_overlap(ed->seqbasep, seq) ) {
90 shuffle_seq(ed->seqbasep, seq);
95 /* properties that need to allocate structs */
96 static void rna_SequenceEditor_use_color_balance_set(PointerRNA *ptr, int value)
98 Sequence *seq= (Sequence*)ptr->data;
102 seq->flag |= SEQ_USE_COLOR_BALANCE;
103 if(seq->strip->color_balance == NULL) {
104 seq->strip->color_balance = MEM_callocN(sizeof(struct StripColorBalance), "StripColorBalance");
105 for (c=0; c<3; c++) {
106 seq->strip->color_balance->lift[c] = 1.0f;
107 seq->strip->color_balance->gamma[c] = 1.0f;
108 seq->strip->color_balance->gain[c] = 1.0f;
112 seq->flag ^= SEQ_USE_COLOR_BALANCE;
116 static void rna_SequenceEditor_use_proxy_set(PointerRNA *ptr, int value)
118 Sequence *seq= (Sequence*)ptr->data;
120 seq->flag |= SEQ_USE_PROXY;
121 if(seq->strip->proxy == NULL) {
122 seq->strip->proxy = MEM_callocN(sizeof(struct StripProxy), "StripProxy");
125 seq->flag ^= SEQ_USE_PROXY;
129 static void rna_SequenceEditor_use_translation_set(PointerRNA *ptr, int value)
131 Sequence *seq= (Sequence*)ptr->data;
133 seq->flag |= SEQ_USE_TRANSFORM;
134 if(seq->strip->transform == NULL) {
135 seq->strip->transform = MEM_callocN(sizeof(struct StripTransform), "StripTransform");
138 seq->flag ^= SEQ_USE_TRANSFORM;
142 static void rna_SequenceEditor_use_crop_set(PointerRNA *ptr, int value)
144 Sequence *seq= (Sequence*)ptr->data;
146 seq->flag |= SEQ_USE_CROP;
147 if(seq->strip->crop == NULL) {
148 seq->strip->crop = MEM_callocN(sizeof(struct StripCrop), "StripCrop");
151 seq->flag ^= SEQ_USE_CROP;
154 /* name functions that ignore the first two characters */
155 static void rna_Sequence_name_get(PointerRNA *ptr, char *value)
157 Sequence *seq= (Sequence*)ptr->data;
158 BLI_strncpy(value, seq->name+2, sizeof(seq->name)-2);
161 static int rna_Sequence_name_length(PointerRNA *ptr)
163 Sequence *seq= (Sequence*)ptr->data;
164 return strlen(seq->name+2);
167 static void rna_Sequence_name_set(PointerRNA *ptr, const char *value)
169 Scene *sce= (Scene*)ptr->id.data;
170 Sequence *seq= (Sequence*)ptr->data;
171 BLI_strncpy(seq->name+2, value, sizeof(seq->name)-2);
172 seqUniqueName(&sce->ed->seqbase, seq);
175 static StructRNA* rna_Sequence_refine(struct PointerRNA *ptr)
177 Sequence *seq= (Sequence*)ptr->data;
181 return &RNA_ImageSequence;
183 return &RNA_MetaSequence;
185 return &RNA_SceneSequence;
187 return &RNA_MovieSequence;
189 return &RNA_SoundSequence;
198 return &RNA_EffectSequence;
200 return &RNA_PluginSequence;
202 return &RNA_WipeSequence;
204 return &RNA_GlowSequence;
206 return &RNA_TransformSequence;
208 return &RNA_ColorSequence;
210 return &RNA_SpeedControlSequence;
212 return &RNA_Sequence;
216 static char *rna_Sequence_path(PointerRNA *ptr)
218 Sequence *seq= (Sequence*)ptr->data;
220 /* sequencer data comes from scene...
221 * TODO: would be nice to make SequenceEditor data a datablock of its own (for shorter paths)
224 return BLI_sprintfN("sequence_editor.sequences[\"%s\"]", seq->name+2);
226 return BLI_strdup("");
229 static PointerRNA rna_SequenceEditor_meta_stack_get(CollectionPropertyIterator *iter)
231 ListBaseIterator *internal= iter->internal;
232 MetaStack *ms= (MetaStack*)internal->link;
234 return rna_pointer_inherit_refine(&iter->parent, &RNA_Sequence, ms->parseq);
237 static void rna_MovieSequence_filename_set(PointerRNA *ptr, const char *value)
239 Sequence *seq= (Sequence*)(ptr->data);
240 char dir[FILE_MAX], name[FILE_MAX];
242 BLI_split_dirfile_basic(value, dir, name);
243 BLI_strncpy(seq->strip->dir, dir, sizeof(seq->strip->dir));
244 BLI_strncpy(seq->strip->stripdata->name, name, sizeof(seq->strip->stripdata->name));
247 static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value)
249 Sequence *seq= (Sequence*)(ptr->data);
250 char dir[FILE_MAX], name[FILE_MAX];
252 BLI_split_dirfile_basic(value, dir, name);
253 BLI_strncpy(seq->strip->dir, dir, sizeof(seq->strip->dir));
254 BLI_strncpy(seq->strip->stripdata->name, name, sizeof(seq->strip->stripdata->name));
257 static void rna_SequenceElement_filename_set(PointerRNA *ptr, const char *value)
259 StripElem *elem= (StripElem*)(ptr->data);
262 BLI_split_dirfile_basic(value, NULL, name);
263 BLI_strncpy(elem->name, name, sizeof(elem->name));
268 static void rna_def_strip_element(BlenderRNA *brna)
273 srna = RNA_def_struct(brna, "SequenceElement", NULL);
274 RNA_def_struct_ui_text(srna, "Sequence Element", "Sequence strip data for a single frame.");
275 RNA_def_struct_sdna(srna, "StripElem");
277 prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
278 RNA_def_property_string_sdna(prop, NULL, "name");
279 RNA_def_property_ui_text(prop, "Filename", "");
280 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SequenceElement_filename_set");
283 static void rna_def_strip_crop(BlenderRNA *brna)
288 srna = RNA_def_struct(brna, "SequenceCrop", NULL);
289 RNA_def_struct_ui_text(srna, "Sequence Crop", "Cropping parameters for a sequence strip.");
290 RNA_def_struct_sdna(srna, "StripCrop");
292 prop= RNA_def_property(srna, "top", PROP_INT, PROP_UNSIGNED);
293 RNA_def_property_ui_text(prop, "Top", "");
294 RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
296 prop= RNA_def_property(srna, "bottom", PROP_INT, PROP_UNSIGNED);
297 RNA_def_property_ui_text(prop, "Bottom", "");
298 RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
300 prop= RNA_def_property(srna, "left", PROP_INT, PROP_UNSIGNED);
301 RNA_def_property_ui_text(prop, "Left", "");
302 RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
304 prop= RNA_def_property(srna, "right", PROP_INT, PROP_UNSIGNED);
305 RNA_def_property_ui_text(prop, "Right", "");
306 RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
309 static void rna_def_strip_transform(BlenderRNA *brna)
314 srna = RNA_def_struct(brna, "SequenceTransform", NULL);
315 RNA_def_struct_ui_text(srna, "Sequence Transform", "Transform parameters for a sequence strip.");
316 RNA_def_struct_sdna(srna, "StripTransform");
318 prop= RNA_def_property(srna, "offset_x", PROP_INT, PROP_NONE);
319 RNA_def_property_int_sdna(prop, NULL, "xofs");
320 RNA_def_property_ui_text(prop, "Offset Y", "");
321 RNA_def_property_ui_range(prop, -4096, 4096, 1, 0);
323 prop= RNA_def_property(srna, "offset_y", PROP_INT, PROP_NONE);
324 RNA_def_property_int_sdna(prop, NULL, "yofs");
325 RNA_def_property_ui_text(prop, "Offset Y", "");
326 RNA_def_property_ui_range(prop, -4096, 4096, 1, 0);
329 static void rna_def_strip_proxy(BlenderRNA *brna)
334 srna = RNA_def_struct(brna, "SequenceProxy", NULL);
335 RNA_def_struct_ui_text(srna, "Sequence Proxy", "Proxy parameters for a sequence strip.");
336 RNA_def_struct_sdna(srna, "StripProxy");
338 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
339 RNA_def_property_string_sdna(prop, NULL, "dir");
340 RNA_def_property_ui_text(prop, "Directory", "Location to story the proxy file");
342 prop= RNA_def_property(srna, "file", PROP_STRING, PROP_DIRPATH);
343 RNA_def_property_string_sdna(prop, NULL, "file");
344 RNA_def_property_ui_text(prop, "File", "Proxy file name");
347 static void rna_def_strip_color_balance(BlenderRNA *brna)
352 srna = RNA_def_struct(brna, "SequenceColorBalance", NULL);
353 RNA_def_struct_ui_text(srna, "Sequence Color Balance", "Color balance parameters for a sequence strip.");
354 RNA_def_struct_sdna(srna, "StripColorBalance");
356 prop= RNA_def_property(srna, "lift", PROP_FLOAT, PROP_COLOR);
357 RNA_def_property_ui_text(prop, "Lift", "Color balance lift (shadows).");
359 prop= RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_COLOR);
360 RNA_def_property_ui_text(prop, "Gamma", "Color balance gamma (midtones).");
362 prop= RNA_def_property(srna, "gain", PROP_FLOAT, PROP_COLOR);
363 RNA_def_property_ui_text(prop, "Gain", "Color balance gain (highlights).");
365 prop= RNA_def_property(srna, "inverse_gain", PROP_BOOLEAN, PROP_NONE);
366 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_GAIN);
367 RNA_def_property_ui_text(prop, "Inverse Gain", "");
369 prop= RNA_def_property(srna, "inverse_gamma", PROP_BOOLEAN, PROP_NONE);
370 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_GAMMA);
371 RNA_def_property_ui_text(prop, "Inverse Gamma", "");
373 prop= RNA_def_property(srna, "inverse_lift", PROP_BOOLEAN, PROP_NONE);
374 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_LIFT);
375 RNA_def_property_ui_text(prop, "Inverse Lift", "");
378 prop= RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE);
379 RNA_def_property_range(prop, 0.0f, 1.0f);
380 RNA_def_property_ui_text(prop, "Exposure", "");
382 prop= RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE);
383 RNA_def_property_range(prop, 0.0f, 1.0f);
384 RNA_def_property_ui_text(prop, "Saturation", "");*/
387 static void rna_def_sequence(BlenderRNA *brna)
393 static const EnumPropertyItem seq_type_items[]= {
394 {SEQ_IMAGE, "IMAGE", 0, "Image", ""},
395 {SEQ_META, "META", 0, "Meta", ""},
396 {SEQ_SCENE, "SCENE", 0, "Scene", ""},
397 {SEQ_MOVIE, "MOVIE", 0, "Movie", ""},
398 {SEQ_SOUND, "SOUND", 0, "Sound", ""},
399 {SEQ_EFFECT, "REPLACE", 0, "Replace", ""},
400 {SEQ_CROSS, "CROSS", 0, "Cross", ""},
401 {SEQ_ADD, "ADD", 0, "Add", ""},
402 {SEQ_SUB, "SUBTRACT", 0, "Subtract", ""},
403 {SEQ_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
404 {SEQ_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
405 {SEQ_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
406 {SEQ_MUL, "MULTIPLY", 0, "Multiply", ""},
407 {SEQ_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
408 {SEQ_PLUGIN, "PLUGIN", 0, "plugin", ""},
409 {SEQ_WIPE, "WIPE", 0, "Wipe", ""},
410 {SEQ_GLOW, "GLOW", 0, "Glow", ""},
411 {SEQ_TRANSFORM, "TRANSFORM", 0, "Transform", ""},
412 {SEQ_COLOR, "COLOR", 0, "Color", ""},
413 {SEQ_SPEED, "SPEED", 0, "Speed", ""},
414 {0, NULL, 0, NULL, NULL}};
416 static const EnumPropertyItem blend_mode_items[]= {
417 {SEQ_BLEND_REPLACE, "REPLACE", 0, "Replace", ""},
418 {SEQ_CROSS, "CROSS", 0, "Cross", ""},
419 {SEQ_ADD, "ADD", 0, "Add", ""},
420 {SEQ_SUB, "SUBTRACT", 0, "Subtract", ""},
421 {SEQ_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
422 {SEQ_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
423 {SEQ_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
424 {SEQ_MUL, "MULTIPLY", 0, "Multiply", ""},
425 {SEQ_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
426 {0, NULL, 0, NULL, NULL}};
428 srna = RNA_def_struct(brna, "Sequence", NULL);
429 RNA_def_struct_ui_text(srna, "Sequence", "Sequence strip in the sequence editor.");
430 RNA_def_struct_refine_func(srna, "rna_Sequence_refine");
431 RNA_def_struct_path_func(srna, "rna_Sequence_path");
433 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
434 RNA_def_property_string_funcs(prop, "rna_Sequence_name_get", "rna_Sequence_name_length", "rna_Sequence_name_set");
435 RNA_def_property_string_maxlength(prop, sizeof(((Sequence*)NULL)->name)-2);
436 RNA_def_property_ui_text(prop, "Name", "");
437 RNA_def_struct_name_property(srna, prop);
439 prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
440 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
441 RNA_def_property_enum_items(prop, seq_type_items);
442 RNA_def_property_ui_text(prop, "Type", "");
444 //prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
445 //RNA_def_property_ui_text(prop, "Ipo Curves", "Ipo curves used by this sequence.");
449 prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
450 RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
451 RNA_def_property_ui_text(prop, "Selected", "");
453 prop= RNA_def_property(srna, "left_handle_selected", PROP_BOOLEAN, PROP_NONE);
454 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LEFTSEL);
455 RNA_def_property_ui_text(prop, "Left Handle Selected", "");
457 prop= RNA_def_property(srna, "right_handle_selected", PROP_BOOLEAN, PROP_NONE);
458 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_RIGHTSEL);
459 RNA_def_property_ui_text(prop, "Right Handle Selected", "");
461 prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
462 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MUTE);
463 RNA_def_property_ui_text(prop, "Mute", "");
464 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
466 prop= RNA_def_property(srna, "frame_locked", PROP_BOOLEAN, PROP_NONE);
467 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_IPO_FRAME_LOCKED);
468 RNA_def_property_ui_text(prop, "Frame Locked", "Lock the animation curve to the global frame counter.");
469 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
471 prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
472 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LOCK);
473 RNA_def_property_ui_text(prop, "Lock", "Lock strip so that it can't be transformed.");
475 /* strip positioning */
477 prop= RNA_def_property(srna, "length", PROP_INT, PROP_TIME);
478 RNA_def_property_int_sdna(prop, NULL, "len");
479 RNA_def_property_range(prop, 1, MAXFRAME);
480 RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip before the handles are applied");
481 RNA_def_property_int_funcs(prop, "rna_SequenceEditor_length_get", "rna_SequenceEditor_length_set",NULL);
482 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
484 prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_TIME);
485 RNA_def_property_int_sdna(prop, NULL, "start");
486 RNA_def_property_ui_text(prop, "Start Frame", "");
487 RNA_def_property_int_funcs(prop, NULL, "rna_SequenceEditor_start_frame_set",NULL); // overlap tests and calc_seq_disp
488 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
490 prop= RNA_def_property(srna, "start_offset", PROP_INT, PROP_TIME);
491 RNA_def_property_int_sdna(prop, NULL, "startofs");
492 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
493 RNA_def_property_ui_text(prop, "Start Offset", "");
494 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
496 prop= RNA_def_property(srna, "end_offset", PROP_INT, PROP_TIME);
497 RNA_def_property_int_sdna(prop, NULL, "endofs");
498 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
499 RNA_def_property_ui_text(prop, "End offset", "");
500 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
502 prop= RNA_def_property(srna, "start_still", PROP_INT, PROP_TIME);
503 RNA_def_property_int_sdna(prop, NULL, "startstill");
504 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
505 RNA_def_property_range(prop, 0, MAXFRAME);
506 RNA_def_property_ui_text(prop, "Start Still", "");
507 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
509 prop= RNA_def_property(srna, "end_still", PROP_INT, PROP_TIME);
510 RNA_def_property_int_sdna(prop, NULL, "endstill");
511 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
512 RNA_def_property_range(prop, 0, MAXFRAME);
513 RNA_def_property_ui_text(prop, "End Still", "");
514 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
516 prop= RNA_def_property(srna, "channel", PROP_INT, PROP_UNSIGNED);
517 RNA_def_property_int_sdna(prop, NULL, "machine");
518 RNA_def_property_range(prop, 0, MAXSEQ-1);
519 RNA_def_property_ui_text(prop, "Channel", "Y position of the sequence strip.");
520 RNA_def_property_int_funcs(prop, NULL, "rna_SequenceEditor_channel_set",NULL); // overlap test
521 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
525 prop= RNA_def_property(srna, "blend_mode", PROP_ENUM, PROP_NONE);
526 RNA_def_property_enum_items(prop, blend_mode_items);
527 RNA_def_property_ui_text(prop, "Blend Mode", "");
528 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
530 prop= RNA_def_property(srna, "blend_opacity", PROP_FLOAT, PROP_NONE);
531 RNA_def_property_range(prop, 0.0f, 100.0f);
532 RNA_def_property_ui_text(prop, "Blend Opacity", "");
533 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
535 prop= RNA_def_property(srna, "effect_fader", PROP_FLOAT, PROP_NONE);
536 RNA_def_property_range(prop, 0.0f, 1.0f);
537 RNA_def_property_float_sdna(prop, NULL, "effect_fader");
538 RNA_def_property_ui_text(prop, "Effect fader position", "");
539 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
541 prop= RNA_def_property(srna, "use_effect_default_fade", PROP_BOOLEAN, PROP_NONE);
542 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_EFFECT_DEFAULT_FADE);
543 RNA_def_property_ui_text(prop, "Use Default Fade", "Fade effect using the builtin default (usually make transition as long as effect strip).");
544 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
547 prop= RNA_def_property(srna, "speed_fader", PROP_FLOAT, PROP_NONE);
548 RNA_def_property_float_sdna(prop, NULL, "speed_fader");
549 RNA_def_property_ui_text(prop, "Speed effect fader position", "");
550 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
553 func= RNA_def_function(srna, "getStripElem", "give_stripelem");
554 RNA_def_function_ui_description(func, "Return the strip element from a given frame or None.");
555 prop= RNA_def_int(func, "frame", 0, -MAXFRAME, MAXFRAME, "Frame", "The frame to get the strip element from", -MAXFRAME, MAXFRAME);
556 RNA_def_property_flag(prop, PROP_REQUIRED);
557 RNA_def_function_return(func, RNA_def_pointer(func, "elem", "SequenceElement", "", "strip element of the current frame"));
560 static void rna_def_editor(BlenderRNA *brna)
565 srna = RNA_def_struct(brna, "SequenceEditor", NULL);
566 RNA_def_struct_ui_text(srna, "Sequence Editor", "Sequence editing data for a Scene datablock.");
567 RNA_def_struct_ui_icon(srna, ICON_SEQUENCE);
568 RNA_def_struct_sdna(srna, "Editing");
570 prop= RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE);
571 RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
572 RNA_def_property_struct_type(prop, "Sequence");
573 RNA_def_property_ui_text(prop, "Sequences", "");
575 prop= RNA_def_property(srna, "meta_stack", PROP_COLLECTION, PROP_NONE);
576 RNA_def_property_collection_sdna(prop, NULL, "metastack", NULL);
577 RNA_def_property_struct_type(prop, "Sequence");
578 RNA_def_property_ui_text(prop, "Meta Stack", "Meta strip stack, last is currently edited meta strip.");
579 RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_SequenceEditor_meta_stack_get", 0, 0, 0);
581 prop= RNA_def_property(srna, "active_strip", PROP_POINTER, PROP_NONE);
582 RNA_def_property_pointer_sdna(prop, NULL, "act_seq");
583 RNA_def_property_ui_text(prop, "Active Strip", "Sequencers active strip");
586 static void rna_def_filter_video(StructRNA *srna)
590 prop= RNA_def_property(srna, "de_interlace", PROP_BOOLEAN, PROP_NONE);
591 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FILTERY);
592 RNA_def_property_ui_text(prop, "De-Interlace", "For video movies to remove fields.");
594 prop= RNA_def_property(srna, "premultiply", PROP_BOOLEAN, PROP_NONE);
595 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_PREMUL);
596 RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha.");
597 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
599 prop= RNA_def_property(srna, "flip_x", PROP_BOOLEAN, PROP_NONE);
600 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPX);
601 RNA_def_property_ui_text(prop, "Flip X", "Flip on the X axis.");
602 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
604 prop= RNA_def_property(srna, "flip_y", PROP_BOOLEAN, PROP_NONE);
605 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPY);
606 RNA_def_property_ui_text(prop, "Flip Y", "Flip on the Y axis.");
607 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
609 prop= RNA_def_property(srna, "convert_float", PROP_BOOLEAN, PROP_NONE);
610 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_FLOAT);
611 RNA_def_property_ui_text(prop, "Convert Float", "Convert input to float data.");
612 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
614 prop= RNA_def_property(srna, "reverse_frames", PROP_BOOLEAN, PROP_NONE);
615 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_REVERSE_FRAMES);
616 RNA_def_property_ui_text(prop, "Flip Time", "Reverse frame order.");
617 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
619 prop= RNA_def_property(srna, "multiply_colors", PROP_FLOAT, PROP_UNSIGNED);
620 RNA_def_property_float_sdna(prop, NULL, "mul");
621 RNA_def_property_range(prop, 0.0f, 20.0f);
622 RNA_def_property_ui_text(prop, "Multiply Colors", "");
623 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
625 prop= RNA_def_property(srna, "strobe", PROP_FLOAT, PROP_NONE);
626 RNA_def_property_range(prop, 1.0f, 30.0f);
627 RNA_def_property_ui_text(prop, "Strobe", "Only display every nth frame.");
628 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
630 prop= RNA_def_property(srna, "use_color_balance", PROP_BOOLEAN, PROP_NONE);
631 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_COLOR_BALANCE);
632 RNA_def_property_ui_text(prop, "Use Color Balance", "(3-Way color correction) on input.");
633 RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_use_color_balance_set");
634 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
636 prop= RNA_def_property(srna, "color_balance", PROP_POINTER, PROP_NONE);
637 RNA_def_property_pointer_sdna(prop, NULL, "strip->color_balance");
638 RNA_def_property_ui_text(prop, "Color Balance", "");
639 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
641 prop= RNA_def_property(srna, "use_translation", PROP_BOOLEAN, PROP_NONE);
642 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_TRANSFORM);
643 RNA_def_property_ui_text(prop, "Use Translation", "Translate image before processing.");
644 RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_use_translation_set");
645 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
647 prop= RNA_def_property(srna, "transform", PROP_POINTER, PROP_NONE);
648 RNA_def_property_pointer_sdna(prop, NULL, "strip->transform");
649 RNA_def_property_ui_text(prop, "Transform", "");
650 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
652 prop= RNA_def_property(srna, "use_crop", PROP_BOOLEAN, PROP_NONE);
653 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_CROP);
654 RNA_def_property_ui_text(prop, "Use Crop", "Crop image before processing.");
655 RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_use_crop_set");
656 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
658 prop= RNA_def_property(srna, "crop", PROP_POINTER, PROP_NONE);
659 RNA_def_property_pointer_sdna(prop, NULL, "strip->crop");
660 RNA_def_property_ui_text(prop, "Crop", "");
661 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
664 static void rna_def_proxy(StructRNA *srna)
668 prop= RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE);
669 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY);
670 RNA_def_property_ui_text(prop, "Use Proxy", "Use a preview proxy for this strip.");
671 RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_use_proxy_set");
673 prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
674 RNA_def_property_pointer_sdna(prop, NULL, "strip->proxy");
675 RNA_def_property_ui_text(prop, "Proxy", "");
677 prop= RNA_def_property(srna, "proxy_custom_directory", PROP_BOOLEAN, PROP_NONE);
678 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY_CUSTOM_DIR);
679 RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Use a custom directory to store data.");
682 static void rna_def_input(StructRNA *srna)
686 prop= RNA_def_property(srna, "animation_start_offset", PROP_INT, PROP_UNSIGNED);
687 RNA_def_property_int_sdna(prop, NULL, "anim_startofs");
688 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap test
689 RNA_def_property_ui_text(prop, "Animation Start Offset", "Animation start offset (trim start).");
690 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
692 prop= RNA_def_property(srna, "animation_end_offset", PROP_INT, PROP_UNSIGNED);
693 RNA_def_property_int_sdna(prop, NULL, "anim_endofs");
694 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap test
695 RNA_def_property_ui_text(prop, "Animation End Offset", "Animation end offset (trim end).");
696 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
699 static void rna_def_image(BlenderRNA *brna)
704 srna = RNA_def_struct(brna, "ImageSequence", "Sequence");
705 RNA_def_struct_ui_text(srna, "Image Sequence", "Sequence strip to load one or more images.");
706 RNA_def_struct_sdna(srna, "Sequence");
708 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
709 RNA_def_property_string_sdna(prop, NULL, "strip->dir");
710 RNA_def_property_ui_text(prop, "Directory", "");
712 prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE);
713 RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", "strip->len");
714 RNA_def_property_struct_type(prop, "SequenceElement");
715 RNA_def_property_ui_text(prop, "Elements", "");
718 rna_def_filter_video(srna);
723 static void rna_def_meta(BlenderRNA *brna)
728 srna = RNA_def_struct(brna, "MetaSequence", "Sequence");
729 RNA_def_struct_ui_text(srna, "Meta Sequence", "Sequence strip to group other strips as a single sequence strip.");
730 RNA_def_struct_sdna(srna, "Sequence");
732 prop = RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE);
733 RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
734 RNA_def_property_struct_type(prop, "Sequence");
735 RNA_def_property_ui_text(prop, "Sequences", "");
737 rna_def_filter_video(srna);
742 static void rna_def_scene(BlenderRNA *brna)
747 srna = RNA_def_struct(brna, "SceneSequence", "Sequence");
748 RNA_def_struct_ui_text(srna, "Scene Sequence", "Sequence strip to used the rendered image of a scene.");
749 RNA_def_struct_sdna(srna, "Sequence");
751 prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
752 RNA_def_property_flag(prop, PROP_EDITABLE);
753 RNA_def_property_ui_text(prop, "Scene", "Scene that this sequence uses.");
754 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
756 rna_def_filter_video(srna);
761 static void rna_def_movie(BlenderRNA *brna)
766 srna = RNA_def_struct(brna, "MovieSequence", "Sequence");
767 RNA_def_struct_ui_text(srna, "Movie Sequence", "Sequence strip to load a video.");
768 RNA_def_struct_sdna(srna, "Sequence");
770 prop= RNA_def_property(srna, "mpeg_preseek", PROP_INT, PROP_NONE);
771 RNA_def_property_int_sdna(prop, NULL, "anim_preseek");
772 RNA_def_property_range(prop, 0, 50);
773 RNA_def_property_ui_text(prop, "MPEG Preseek", "For MPEG movies, preseek this many frames.");
775 prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
776 RNA_def_property_string_sdna(prop, NULL, "strip->stripdata->name");
777 RNA_def_property_ui_text(prop, "Filename", "");
778 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MovieSequence_filename_set");
780 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
781 RNA_def_property_string_sdna(prop, NULL, "strip->dir");
782 RNA_def_property_ui_text(prop, "Directory", "");
784 rna_def_filter_video(srna);
789 static void rna_def_sound(BlenderRNA *brna)
794 srna = RNA_def_struct(brna, "SoundSequence", "Sequence");
795 RNA_def_struct_ui_text(srna, "Sound Sequence", "Sequence strip defining a sound to be played over a period of time.");
796 RNA_def_struct_sdna(srna, "Sequence");
798 prop= RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE);
799 RNA_def_property_struct_type(prop, "Sound");
800 RNA_def_property_ui_text(prop, "Sound", "Sound datablock used by this sequence.");
802 prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
803 RNA_def_property_string_sdna(prop, NULL, "strip->stripdata->name");
804 RNA_def_property_ui_text(prop, "Filename", "");
805 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SoundSequence_filename_set");
807 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
808 RNA_def_property_string_sdna(prop, NULL, "strip->dir");
809 RNA_def_property_ui_text(prop, "Directory", "");
813 RNA_def_struct_sdna_from(srna, "SoundHandle", "sound_handle");
815 prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
816 RNA_def_property_float_sdna(prop, NULL, "volume");
817 RNA_def_property_range(prop, 0.0f, 1.0f);
818 RNA_def_property_ui_text(prop, "Volume", "Playback volume of the sound");
819 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
822 static void rna_def_effect(BlenderRNA *brna)
826 srna = RNA_def_struct(brna, "EffectSequence", "Sequence");
827 RNA_def_struct_ui_text(srna, "Effect Sequence", "Sequence strip applying an effect on the images created by other strips.");
828 RNA_def_struct_sdna(srna, "Sequence");
833 static void rna_def_plugin(BlenderRNA *brna)
838 srna = RNA_def_struct(brna, "PluginSequence", "EffectSequence");
839 RNA_def_struct_ui_text(srna, "Plugin Sequence", "Sequence strip applying an effect, loaded from an external plugin.");
840 RNA_def_struct_sdna_from(srna, "PluginSeq", "plugin");
842 prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
843 RNA_def_property_string_sdna(prop, NULL, "name");
844 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
845 RNA_def_property_ui_text(prop, "Filename", "");
847 /* plugin properties need custom wrapping code like ID properties */
850 static void rna_def_wipe(BlenderRNA *brna)
855 static const EnumPropertyItem wipe_type_items[]= {
856 {0, "SINGLE", 0, "Single", ""},
857 {1, "DOUBLE", 0, "Double", ""},
858 /* not used yet {2, "BOX", 0, "Box", ""}, */
859 /* not used yet {3, "CROSS", 0, "Cross", ""}, */
860 {4, "IRIS", 0, "Iris", ""},
861 {5, "CLOCK", 0, "Clock", ""},
862 {0, NULL, 0, NULL, NULL}
865 static const EnumPropertyItem wipe_direction_items[]= {
866 {0, "OUT", 0, "Out", ""},
867 {1, "IN", 0, "In", ""},
868 {0, NULL, 0, NULL, NULL}
871 srna = RNA_def_struct(brna, "WipeSequence", "EffectSequence");
872 RNA_def_struct_ui_text(srna, "Wipe Sequence", "Sequence strip creating a wipe transition.");
873 RNA_def_struct_sdna_from(srna, "WipeVars", "effectdata");
875 prop= RNA_def_property(srna, "blur_width", PROP_FLOAT, PROP_UNSIGNED);
876 RNA_def_property_float_sdna(prop, NULL, "edgeWidth");
877 RNA_def_property_range(prop, 0.0f, 1.0f);
878 RNA_def_property_ui_text(prop, "Blur Width", "Width of the blur edge, in percentage relative to the image size.");
879 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
881 prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
882 RNA_def_property_float_sdna(prop, NULL, "angle");
883 RNA_def_property_range(prop, -90.0f, 90.0f);
884 RNA_def_property_ui_text(prop, "Angle", "Edge angle.");
885 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
887 prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
888 RNA_def_property_enum_sdna(prop, NULL, "forward");
889 RNA_def_property_enum_items(prop, wipe_direction_items);
890 RNA_def_property_ui_text(prop, "Direction", "Wipe direction.");
891 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
893 prop= RNA_def_property(srna, "transition_type", PROP_ENUM, PROP_NONE);
894 RNA_def_property_enum_sdna(prop, NULL, "wipetype");
895 RNA_def_property_enum_items(prop, wipe_type_items);
896 RNA_def_property_ui_text(prop, "Transition Type", "");
897 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
900 static void rna_def_glow(BlenderRNA *brna)
905 srna = RNA_def_struct(brna, "GlowSequence", "EffectSequence");
906 RNA_def_struct_ui_text(srna, "Glow Sequence", "Sequence strip creating a glow effect.");
907 RNA_def_struct_sdna_from(srna, "GlowVars", "effectdata");
909 prop= RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
910 RNA_def_property_float_sdna(prop, NULL, "fMini");
911 RNA_def_property_range(prop, 0.0f, 1.0f);
912 RNA_def_property_ui_text(prop, "Threshold", "Minimum intensity to trigger a glow");
913 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
915 prop= RNA_def_property(srna, "clamp", PROP_FLOAT, PROP_NONE);
916 RNA_def_property_float_sdna(prop, NULL, "fClamp");
917 RNA_def_property_range(prop, 0.0f, 1.0f);
918 RNA_def_property_ui_text(prop, "Clamp", "rightness limit of intensity.");
919 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
921 prop= RNA_def_property(srna, "boost_factor", PROP_FLOAT, PROP_NONE);
922 RNA_def_property_float_sdna(prop, NULL, "fBoost");
923 RNA_def_property_range(prop, 0.0f, 10.0f);
924 RNA_def_property_ui_text(prop, "Boost Factor", "Brightness multiplier.");
925 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
927 prop= RNA_def_property(srna, "blur_distance", PROP_FLOAT, PROP_NONE);
928 RNA_def_property_float_sdna(prop, NULL, "dDist");
929 RNA_def_property_range(prop, 0.5f, 20.0f);
930 RNA_def_property_ui_text(prop, "Blur Distance", "Radius of glow effect.");
931 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
933 prop= RNA_def_property(srna, "quality", PROP_INT, PROP_NONE);
934 RNA_def_property_int_sdna(prop, NULL, "dQuality");
935 RNA_def_property_range(prop, 1, 5);
936 RNA_def_property_ui_text(prop, "Quality", "Accuracy of the blur effect.");
937 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
939 prop= RNA_def_property(srna, "only_boost", PROP_BOOLEAN, PROP_NONE);
940 RNA_def_property_boolean_sdna(prop, NULL, "bNoComp", 0);
941 RNA_def_property_ui_text(prop, "Only Boost", "Show the glow buffer only.");
942 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
945 static void rna_def_transform(BlenderRNA *brna)
950 static const EnumPropertyItem interpolation_items[]= {
951 {0, "NONE", 0, "None", "No interpolation."},
952 {1, "BILINEAR", 0, "Bilinear", "Bilinear interpolation."},
953 {2, "BICUBIC", 0, "Bicubic", "Bicubic interpolation."},
954 {0, NULL, 0, NULL, NULL}
957 static const EnumPropertyItem translation_unit_items[]= {
958 {0, "PIXELS", 0, "Pixels", ""},
959 {1, "PERCENT", 0, "Percent", ""},
960 {0, NULL, 0, NULL, NULL}
963 srna = RNA_def_struct(brna, "TransformSequence", "EffectSequence");
964 RNA_def_struct_ui_text(srna, "Transform Sequence", "Sequence strip applying affine transformations to other strips.");
965 RNA_def_struct_sdna_from(srna, "TransformVars", "effectdata");
967 prop= RNA_def_property(srna, "scale_start_x", PROP_FLOAT, PROP_UNSIGNED);
968 RNA_def_property_float_sdna(prop, NULL, "ScalexIni");
969 RNA_def_property_ui_text(prop, "Scale Start X", "");
970 RNA_def_property_ui_range(prop, 0, 10, 3, 10);
971 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
973 prop= RNA_def_property(srna, "scale_start_y", PROP_FLOAT, PROP_UNSIGNED);
974 RNA_def_property_float_sdna(prop, NULL, "ScaleyIni");
975 RNA_def_property_ui_text(prop, "Scale Start Y", "");
976 RNA_def_property_ui_range(prop, 0, 10, 3, 10);
977 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
979 prop= RNA_def_property(srna, "scale_end_x", PROP_FLOAT, PROP_UNSIGNED);
980 RNA_def_property_float_sdna(prop, NULL, "ScalexFin");
981 RNA_def_property_ui_text(prop, "Scale End X", "");
982 RNA_def_property_ui_range(prop, 0, 10, 3, 10);
983 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
985 prop= RNA_def_property(srna, "scale_end_y", PROP_FLOAT, PROP_UNSIGNED);
986 RNA_def_property_float_sdna(prop, NULL, "ScaleyFin");
987 RNA_def_property_ui_text(prop, "Scale End Y", "");
988 RNA_def_property_ui_range(prop, 0, 10, 3, 10);
989 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
991 prop= RNA_def_property(srna, "translate_start_x", PROP_FLOAT, PROP_NONE);
992 RNA_def_property_float_sdna(prop, NULL, "xIni");
993 RNA_def_property_ui_text(prop, "Translate Start X", "");
994 RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
995 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
997 prop= RNA_def_property(srna, "translate_start_y", PROP_FLOAT, PROP_NONE);
998 RNA_def_property_float_sdna(prop, NULL, "yIni");
999 RNA_def_property_ui_text(prop, "Translate Start Y", "");
1000 RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
1001 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
1003 prop= RNA_def_property(srna, "translate_end_x", PROP_FLOAT, PROP_NONE);
1004 RNA_def_property_float_sdna(prop, NULL, "xFin");
1005 RNA_def_property_ui_text(prop, "Translate End X", "");
1006 RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
1007 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
1009 prop= RNA_def_property(srna, "translate_end_y", PROP_FLOAT, PROP_NONE);
1010 RNA_def_property_float_sdna(prop, NULL, "yFin");
1011 RNA_def_property_ui_text(prop, "Translate End Y", "");
1012 RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
1013 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
1015 prop= RNA_def_property(srna, "rotation_start", PROP_FLOAT, PROP_NONE);
1016 RNA_def_property_float_sdna(prop, NULL, "rotIni");
1017 RNA_def_property_range(prop, 0.0f, 360.0f);
1018 RNA_def_property_ui_text(prop, "Rotation Start", "");
1019 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
1021 prop= RNA_def_property(srna, "rotation_end", PROP_FLOAT, PROP_NONE);
1022 RNA_def_property_float_sdna(prop, NULL, "rotFin");
1023 RNA_def_property_range(prop, 0.0f, 360.0f);
1024 RNA_def_property_ui_text(prop, "Rotation End", "");
1025 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
1027 prop= RNA_def_property(srna, "translation_unit", PROP_ENUM, PROP_NONE);
1028 RNA_def_property_enum_sdna(prop, NULL, "percent");
1029 RNA_def_property_enum_items(prop, translation_unit_items);
1030 RNA_def_property_ui_text(prop, "Translation Unit", "");
1031 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
1033 prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
1034 RNA_def_property_enum_items(prop, interpolation_items);
1035 RNA_def_property_ui_text(prop, "Interpolation", "");
1036 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
1039 static void rna_def_solid_color(BlenderRNA *brna)
1044 srna = RNA_def_struct(brna, "ColorSequence", "EffectSequence");
1045 RNA_def_struct_ui_text(srna, "Color Sequence", "Sequence strip creating an image filled with a single color.");
1046 RNA_def_struct_sdna_from(srna, "SolidColorVars", "effectdata");
1048 prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
1049 RNA_def_property_float_sdna(prop, NULL, "col");
1050 RNA_def_property_ui_text(prop, "Color", "");
1051 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
1054 static void rna_def_speed_control(BlenderRNA *brna)
1059 srna = RNA_def_struct(brna, "SpeedControlSequence", "EffectSequence");
1060 RNA_def_struct_ui_text(srna, "SpeedControl Sequence", "Sequence strip to control the speed of other strips.");
1061 RNA_def_struct_sdna_from(srna, "SpeedControlVars", "effectdata");
1063 prop= RNA_def_property(srna, "global_speed", PROP_FLOAT, PROP_UNSIGNED);
1064 RNA_def_property_float_sdna(prop, NULL, "globalSpeed");
1065 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* seq->facf0 is used to animate this */
1066 RNA_def_property_ui_text(prop, "Global Speed", "");
1067 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 0);
1069 prop= RNA_def_property(srna, "curve_velocity", PROP_BOOLEAN, PROP_NONE);
1070 RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_INTEGRATE);
1071 RNA_def_property_ui_text(prop, "F-Curve Velocity", "Interpret the F-Curve value as a velocity instead of a frame number.");
1073 prop= RNA_def_property(srna, "frame_blending", PROP_BOOLEAN, PROP_NONE);
1074 RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_BLEND);
1075 RNA_def_property_ui_text(prop, "Frame Blending", "Blend two frames into the target for a smoother result.");
1077 prop= RNA_def_property(srna, "curve_compress_y", PROP_BOOLEAN, PROP_NONE);
1078 RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_COMPRESS_IPO_Y);
1079 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.");
1082 void RNA_def_sequence(BlenderRNA *brna)
1084 rna_def_strip_element(brna);
1085 rna_def_strip_proxy(brna);
1086 rna_def_strip_color_balance(brna);
1087 rna_def_strip_crop(brna);
1088 rna_def_strip_transform(brna);
1090 rna_def_sequence(brna);
1091 rna_def_editor(brna);
1093 rna_def_image(brna);
1095 rna_def_scene(brna);
1096 rna_def_movie(brna);
1097 rna_def_sound(brna);
1098 rna_def_effect(brna);
1099 rna_def_plugin(brna);
1102 rna_def_transform(brna);
1103 rna_def_solid_color(brna);
1104 rna_def_speed_control(brna);