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 /* generic factors, should these be exposed some other way? */
536 prop= RNA_def_property(srna, "factor_0", PROP_FLOAT, PROP_NONE);
537 RNA_def_property_float_sdna(prop, NULL, "facf0");
538 RNA_def_property_ui_text(prop, "Generic Factor 0", "");
539 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
541 prop= RNA_def_property(srna, "factor_1", PROP_FLOAT, PROP_NONE);
542 RNA_def_property_float_sdna(prop, NULL, "facf1");
543 RNA_def_property_ui_text(prop, "Generic Factor 0", "");
544 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
547 func= RNA_def_function(srna, "getStripElem", "give_stripelem");
548 RNA_def_function_ui_description(func, "Return the strip element from a given frame or None.");
549 prop= RNA_def_int(func, "frame", 0, -MAXFRAME, MAXFRAME, "Frame", "The frame to get the strip element from", -MAXFRAME, MAXFRAME);
550 RNA_def_property_flag(prop, PROP_REQUIRED);
551 RNA_def_function_return(func, RNA_def_pointer(func, "elem", "SequenceElement", "", "strip element of the current frame"));
554 static void rna_def_editor(BlenderRNA *brna)
559 srna = RNA_def_struct(brna, "SequenceEditor", NULL);
560 RNA_def_struct_ui_text(srna, "Sequence Editor", "Sequence editing data for a Scene datablock.");
561 RNA_def_struct_ui_icon(srna, ICON_SEQUENCE);
562 RNA_def_struct_sdna(srna, "Editing");
564 prop= RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE);
565 RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
566 RNA_def_property_struct_type(prop, "Sequence");
567 RNA_def_property_ui_text(prop, "Sequences", "");
569 prop= RNA_def_property(srna, "meta_stack", PROP_COLLECTION, PROP_NONE);
570 RNA_def_property_collection_sdna(prop, NULL, "metastack", NULL);
571 RNA_def_property_struct_type(prop, "Sequence");
572 RNA_def_property_ui_text(prop, "Meta Stack", "Meta strip stack, last is currently edited meta strip.");
573 RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_SequenceEditor_meta_stack_get", 0, 0, 0);
575 prop= RNA_def_property(srna, "active_strip", PROP_POINTER, PROP_NONE);
576 RNA_def_property_pointer_sdna(prop, NULL, "act_seq");
577 RNA_def_property_ui_text(prop, "Active Strip", "Sequencers active strip");
580 static void rna_def_filter_video(StructRNA *srna)
584 prop= RNA_def_property(srna, "de_interlace", PROP_BOOLEAN, PROP_NONE);
585 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FILTERY);
586 RNA_def_property_ui_text(prop, "De-Interlace", "For video movies to remove fields.");
588 prop= RNA_def_property(srna, "premultiply", PROP_BOOLEAN, PROP_NONE);
589 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_PREMUL);
590 RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha.");
591 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
593 prop= RNA_def_property(srna, "flip_x", PROP_BOOLEAN, PROP_NONE);
594 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPX);
595 RNA_def_property_ui_text(prop, "Flip X", "Flip on the X axis.");
596 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
598 prop= RNA_def_property(srna, "flip_y", PROP_BOOLEAN, PROP_NONE);
599 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPY);
600 RNA_def_property_ui_text(prop, "Flip Y", "Flip on the Y axis.");
601 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
603 prop= RNA_def_property(srna, "convert_float", PROP_BOOLEAN, PROP_NONE);
604 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_FLOAT);
605 RNA_def_property_ui_text(prop, "Convert Float", "Convert input to float data.");
606 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
608 prop= RNA_def_property(srna, "reverse_frames", PROP_BOOLEAN, PROP_NONE);
609 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_REVERSE_FRAMES);
610 RNA_def_property_ui_text(prop, "Flip Time", "Reverse frame order.");
611 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
613 prop= RNA_def_property(srna, "multiply_colors", PROP_FLOAT, PROP_UNSIGNED);
614 RNA_def_property_float_sdna(prop, NULL, "mul");
615 RNA_def_property_range(prop, 0.0f, 20.0f);
616 RNA_def_property_ui_text(prop, "Multiply Colors", "");
617 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
619 prop= RNA_def_property(srna, "strobe", PROP_FLOAT, PROP_NONE);
620 RNA_def_property_range(prop, 1.0f, 30.0f);
621 RNA_def_property_ui_text(prop, "Strobe", "Only display every nth frame.");
622 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
624 prop= RNA_def_property(srna, "use_color_balance", PROP_BOOLEAN, PROP_NONE);
625 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_COLOR_BALANCE);
626 RNA_def_property_ui_text(prop, "Use Color Balance", "(3-Way color correction) on input.");
627 RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_use_color_balance_set");
628 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
630 prop= RNA_def_property(srna, "color_balance", PROP_POINTER, PROP_NONE);
631 RNA_def_property_pointer_sdna(prop, NULL, "strip->color_balance");
632 RNA_def_property_ui_text(prop, "Color Balance", "");
633 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
635 prop= RNA_def_property(srna, "use_translation", PROP_BOOLEAN, PROP_NONE);
636 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_TRANSFORM);
637 RNA_def_property_ui_text(prop, "Use Translation", "Translate image before processing.");
638 RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_use_translation_set");
639 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
641 prop= RNA_def_property(srna, "transform", PROP_POINTER, PROP_NONE);
642 RNA_def_property_pointer_sdna(prop, NULL, "strip->transform");
643 RNA_def_property_ui_text(prop, "Transform", "");
644 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
646 prop= RNA_def_property(srna, "use_crop", PROP_BOOLEAN, PROP_NONE);
647 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_CROP);
648 RNA_def_property_ui_text(prop, "Use Crop", "Crop image before processing.");
649 RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_use_crop_set");
650 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
652 prop= RNA_def_property(srna, "crop", PROP_POINTER, PROP_NONE);
653 RNA_def_property_pointer_sdna(prop, NULL, "strip->crop");
654 RNA_def_property_ui_text(prop, "Crop", "");
655 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
658 static void rna_def_proxy(StructRNA *srna)
662 prop= RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE);
663 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY);
664 RNA_def_property_ui_text(prop, "Use Proxy", "Use a preview proxy for this strip.");
665 RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_use_proxy_set");
667 prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
668 RNA_def_property_pointer_sdna(prop, NULL, "strip->proxy");
669 RNA_def_property_ui_text(prop, "Proxy", "");
671 prop= RNA_def_property(srna, "proxy_custom_directory", PROP_BOOLEAN, PROP_NONE);
672 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY_CUSTOM_DIR);
673 RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Use a custom directory to store data.");
676 static void rna_def_input(StructRNA *srna)
680 prop= RNA_def_property(srna, "animation_start_offset", PROP_INT, PROP_UNSIGNED);
681 RNA_def_property_int_sdna(prop, NULL, "anim_startofs");
682 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap test
683 RNA_def_property_ui_text(prop, "Animation Start Offset", "Animation start offset (trim start).");
684 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
686 prop= RNA_def_property(srna, "animation_end_offset", PROP_INT, PROP_UNSIGNED);
687 RNA_def_property_int_sdna(prop, NULL, "anim_endofs");
688 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap test
689 RNA_def_property_ui_text(prop, "Animation End Offset", "Animation end offset (trim end).");
690 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
693 static void rna_def_image(BlenderRNA *brna)
698 srna = RNA_def_struct(brna, "ImageSequence", "Sequence");
699 RNA_def_struct_ui_text(srna, "Image Sequence", "Sequence strip to load one or more images.");
700 RNA_def_struct_sdna(srna, "Sequence");
702 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
703 RNA_def_property_string_sdna(prop, NULL, "strip->dir");
704 RNA_def_property_ui_text(prop, "Directory", "");
706 prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE);
707 RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", "strip->len");
708 RNA_def_property_struct_type(prop, "SequenceElement");
709 RNA_def_property_ui_text(prop, "Elements", "");
712 rna_def_filter_video(srna);
717 static void rna_def_meta(BlenderRNA *brna)
722 srna = RNA_def_struct(brna, "MetaSequence", "Sequence");
723 RNA_def_struct_ui_text(srna, "Meta Sequence", "Sequence strip to group other strips as a single sequence strip.");
724 RNA_def_struct_sdna(srna, "Sequence");
726 prop = RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE);
727 RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
728 RNA_def_property_struct_type(prop, "Sequence");
729 RNA_def_property_ui_text(prop, "Sequences", "");
731 rna_def_filter_video(srna);
736 static void rna_def_scene(BlenderRNA *brna)
741 srna = RNA_def_struct(brna, "SceneSequence", "Sequence");
742 RNA_def_struct_ui_text(srna, "Scene Sequence", "Sequence strip to used the rendered image of a scene.");
743 RNA_def_struct_sdna(srna, "Sequence");
745 prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
746 RNA_def_property_ui_text(prop, "Scene", "Scene that this sequence uses.");
748 rna_def_filter_video(srna);
753 static void rna_def_movie(BlenderRNA *brna)
758 srna = RNA_def_struct(brna, "MovieSequence", "Sequence");
759 RNA_def_struct_ui_text(srna, "Movie Sequence", "Sequence strip to load a video.");
760 RNA_def_struct_sdna(srna, "Sequence");
762 prop= RNA_def_property(srna, "mpeg_preseek", PROP_INT, PROP_NONE);
763 RNA_def_property_int_sdna(prop, NULL, "anim_preseek");
764 RNA_def_property_range(prop, 0, 50);
765 RNA_def_property_ui_text(prop, "MPEG Preseek", "For MPEG movies, preseek this many frames.");
767 prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
768 RNA_def_property_string_sdna(prop, NULL, "strip->stripdata->name");
769 RNA_def_property_ui_text(prop, "Filename", "");
770 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MovieSequence_filename_set");
772 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
773 RNA_def_property_string_sdna(prop, NULL, "strip->dir");
774 RNA_def_property_ui_text(prop, "Directory", "");
776 rna_def_filter_video(srna);
781 static void rna_def_sound(BlenderRNA *brna)
786 srna = RNA_def_struct(brna, "SoundSequence", "Sequence");
787 RNA_def_struct_ui_text(srna, "Sound Sequence", "Sequence strip defining a sound to be played over a period of time.");
788 RNA_def_struct_sdna(srna, "Sequence");
790 prop= RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE);
791 RNA_def_property_struct_type(prop, "Sound");
792 RNA_def_property_ui_text(prop, "Sound", "Sound datablock used by this sequence.");
794 prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
795 RNA_def_property_string_sdna(prop, NULL, "strip->stripdata->name");
796 RNA_def_property_ui_text(prop, "Filename", "");
797 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SoundSequence_filename_set");
799 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
800 RNA_def_property_string_sdna(prop, NULL, "strip->dir");
801 RNA_def_property_ui_text(prop, "Directory", "");
805 RNA_def_struct_sdna_from(srna, "SoundHandle", "sound_handle");
807 prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
808 RNA_def_property_float_sdna(prop, NULL, "volume");
809 RNA_def_property_range(prop, 0.0f, 1.0f);
810 RNA_def_property_ui_text(prop, "Volume", "Playback volume of the sound");
811 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
814 static void rna_def_effect(BlenderRNA *brna)
818 srna = RNA_def_struct(brna, "EffectSequence", "Sequence");
819 RNA_def_struct_ui_text(srna, "Effect Sequence", "Sequence strip applying an effect on the images created by other strips.");
820 RNA_def_struct_sdna(srna, "Sequence");
825 static void rna_def_plugin(BlenderRNA *brna)
830 srna = RNA_def_struct(brna, "PluginSequence", "EffectSequence");
831 RNA_def_struct_ui_text(srna, "Plugin Sequence", "Sequence strip applying an effect, loaded from an external plugin.");
832 RNA_def_struct_sdna_from(srna, "PluginSeq", "plugin");
834 prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
835 RNA_def_property_string_sdna(prop, NULL, "name");
836 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
837 RNA_def_property_ui_text(prop, "Filename", "");
839 /* plugin properties need custom wrapping code like ID properties */
842 static void rna_def_wipe(BlenderRNA *brna)
847 static const EnumPropertyItem wipe_type_items[]= {
848 {0, "SINGLE", 0, "Single", ""},
849 {1, "DOUBLE", 0, "Double", ""},
850 /* not used yet {2, "BOX", 0, "Box", ""}, */
851 /* not used yet {3, "CROSS", 0, "Cross", ""}, */
852 {4, "IRIS", 0, "Iris", ""},
853 {5, "CLOCK", 0, "Clock", ""},
854 {0, NULL, 0, NULL, NULL}
857 static const EnumPropertyItem wipe_direction_items[]= {
858 {0, "OUT", 0, "Out", ""},
859 {1, "IN", 0, "In", ""},
860 {0, NULL, 0, NULL, NULL}
863 srna = RNA_def_struct(brna, "WipeSequence", "EffectSequence");
864 RNA_def_struct_ui_text(srna, "Wipe Sequence", "Sequence strip creating a wipe transition.");
865 RNA_def_struct_sdna_from(srna, "WipeVars", "effectdata");
867 prop= RNA_def_property(srna, "blur_width", PROP_FLOAT, PROP_UNSIGNED);
868 RNA_def_property_float_sdna(prop, NULL, "edgeWidth");
869 RNA_def_property_range(prop, 0.0f, 1.0f);
870 RNA_def_property_ui_text(prop, "Blur Width", "Width of the blur edge, in percentage relative to the image size.");
871 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
873 prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
874 RNA_def_property_float_sdna(prop, NULL, "angle");
875 RNA_def_property_range(prop, -90.0f, 90.0f);
876 RNA_def_property_ui_text(prop, "Angle", "Edge angle.");
877 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
879 prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
880 RNA_def_property_enum_sdna(prop, NULL, "forward");
881 RNA_def_property_enum_items(prop, wipe_direction_items);
882 RNA_def_property_ui_text(prop, "Direction", "Wipe direction.");
883 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
885 prop= RNA_def_property(srna, "transition_type", PROP_ENUM, PROP_NONE);
886 RNA_def_property_enum_sdna(prop, NULL, "wipetype");
887 RNA_def_property_enum_items(prop, wipe_type_items);
888 RNA_def_property_ui_text(prop, "Transition Type", "");
889 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
892 static void rna_def_glow(BlenderRNA *brna)
897 srna = RNA_def_struct(brna, "GlowSequence", "EffectSequence");
898 RNA_def_struct_ui_text(srna, "Glow Sequence", "Sequence strip creating a glow effect.");
899 RNA_def_struct_sdna_from(srna, "GlowVars", "effectdata");
901 prop= RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
902 RNA_def_property_float_sdna(prop, NULL, "fMini");
903 RNA_def_property_range(prop, 0.0f, 1.0f);
904 RNA_def_property_ui_text(prop, "Threshold", "Minimum intensity to trigger a glow");
905 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
907 prop= RNA_def_property(srna, "clamp", PROP_FLOAT, PROP_NONE);
908 RNA_def_property_float_sdna(prop, NULL, "fClamp");
909 RNA_def_property_range(prop, 0.0f, 1.0f);
910 RNA_def_property_ui_text(prop, "Clamp", "rightness limit of intensity.");
911 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
913 prop= RNA_def_property(srna, "boost_factor", PROP_FLOAT, PROP_NONE);
914 RNA_def_property_float_sdna(prop, NULL, "fBoost");
915 RNA_def_property_range(prop, 0.0f, 10.0f);
916 RNA_def_property_ui_text(prop, "Boost Factor", "Brightness multiplier.");
917 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
919 prop= RNA_def_property(srna, "blur_distance", PROP_FLOAT, PROP_NONE);
920 RNA_def_property_float_sdna(prop, NULL, "dDist");
921 RNA_def_property_range(prop, 0.5f, 20.0f);
922 RNA_def_property_ui_text(prop, "Blur Distance", "Radius of glow effect.");
923 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
925 prop= RNA_def_property(srna, "quality", PROP_INT, PROP_NONE);
926 RNA_def_property_int_sdna(prop, NULL, "dQuality");
927 RNA_def_property_range(prop, 1, 5);
928 RNA_def_property_ui_text(prop, "Quality", "Accuracy of the blur effect.");
929 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
931 prop= RNA_def_property(srna, "only_boost", PROP_BOOLEAN, PROP_NONE);
932 RNA_def_property_boolean_sdna(prop, NULL, "bNoComp", 0);
933 RNA_def_property_ui_text(prop, "Only Boost", "Show the glow buffer only.");
934 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
937 static void rna_def_transform(BlenderRNA *brna)
942 static const EnumPropertyItem interpolation_items[]= {
943 {0, "NONE", 0, "None", "No interpolation."},
944 {1, "BILINEAR", 0, "Bilinear", "Bilinear interpolation."},
945 {2, "BICUBIC", 0, "Bicubic", "Bicubic interpolation."},
946 {0, NULL, 0, NULL, NULL}
949 static const EnumPropertyItem translation_unit_items[]= {
950 {0, "PIXELS", 0, "Pixels", ""},
951 {1, "PERCENT", 0, "Percent", ""},
952 {0, NULL, 0, NULL, NULL}
955 srna = RNA_def_struct(brna, "TransformSequence", "EffectSequence");
956 RNA_def_struct_ui_text(srna, "Transform Sequence", "Sequence strip applying affine transformations to other strips.");
957 RNA_def_struct_sdna_from(srna, "TransformVars", "effectdata");
959 prop= RNA_def_property(srna, "scale_start_x", PROP_FLOAT, PROP_UNSIGNED);
960 RNA_def_property_float_sdna(prop, NULL, "ScalexIni");
961 RNA_def_property_ui_text(prop, "Scale Start X", "");
962 RNA_def_property_ui_range(prop, 0, 10, 3, 10);
963 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
965 prop= RNA_def_property(srna, "scale_start_y", PROP_FLOAT, PROP_UNSIGNED);
966 RNA_def_property_float_sdna(prop, NULL, "ScaleyIni");
967 RNA_def_property_ui_text(prop, "Scale Start Y", "");
968 RNA_def_property_ui_range(prop, 0, 10, 3, 10);
969 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
971 prop= RNA_def_property(srna, "scale_end_x", PROP_FLOAT, PROP_UNSIGNED);
972 RNA_def_property_float_sdna(prop, NULL, "ScalexFin");
973 RNA_def_property_ui_text(prop, "Scale End X", "");
974 RNA_def_property_ui_range(prop, 0, 10, 3, 10);
975 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
977 prop= RNA_def_property(srna, "scale_end_y", PROP_FLOAT, PROP_UNSIGNED);
978 RNA_def_property_float_sdna(prop, NULL, "ScaleyFin");
979 RNA_def_property_ui_text(prop, "Scale End Y", "");
980 RNA_def_property_ui_range(prop, 0, 10, 3, 10);
981 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
983 prop= RNA_def_property(srna, "translate_start_x", PROP_FLOAT, PROP_NONE);
984 RNA_def_property_float_sdna(prop, NULL, "xIni");
985 RNA_def_property_ui_text(prop, "Translate Start X", "");
986 RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
987 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
989 prop= RNA_def_property(srna, "translate_start_y", PROP_FLOAT, PROP_NONE);
990 RNA_def_property_float_sdna(prop, NULL, "yIni");
991 RNA_def_property_ui_text(prop, "Translate Start Y", "");
992 RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
993 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
995 prop= RNA_def_property(srna, "translate_end_x", PROP_FLOAT, PROP_NONE);
996 RNA_def_property_float_sdna(prop, NULL, "xFin");
997 RNA_def_property_ui_text(prop, "Translate End X", "");
998 RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
999 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
1001 prop= RNA_def_property(srna, "translate_end_y", PROP_FLOAT, PROP_NONE);
1002 RNA_def_property_float_sdna(prop, NULL, "yFin");
1003 RNA_def_property_ui_text(prop, "Translate End Y", "");
1004 RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
1005 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
1007 prop= RNA_def_property(srna, "rotation_start", PROP_FLOAT, PROP_NONE);
1008 RNA_def_property_float_sdna(prop, NULL, "rotIni");
1009 RNA_def_property_range(prop, 0.0f, 360.0f);
1010 RNA_def_property_ui_text(prop, "Rotation Start", "");
1011 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
1013 prop= RNA_def_property(srna, "rotation_end", PROP_FLOAT, PROP_NONE);
1014 RNA_def_property_float_sdna(prop, NULL, "rotFin");
1015 RNA_def_property_range(prop, 0.0f, 360.0f);
1016 RNA_def_property_ui_text(prop, "Rotation End", "");
1017 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
1019 prop= RNA_def_property(srna, "translation_unit", PROP_ENUM, PROP_NONE);
1020 RNA_def_property_enum_sdna(prop, NULL, "percent");
1021 RNA_def_property_enum_items(prop, translation_unit_items);
1022 RNA_def_property_ui_text(prop, "Translation Unit", "");
1023 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
1025 prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
1026 RNA_def_property_enum_items(prop, interpolation_items);
1027 RNA_def_property_ui_text(prop, "Interpolation", "");
1028 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
1031 static void rna_def_solid_color(BlenderRNA *brna)
1036 srna = RNA_def_struct(brna, "ColorSequence", "EffectSequence");
1037 RNA_def_struct_ui_text(srna, "Color Sequence", "Sequence strip creating an image filled with a single color.");
1038 RNA_def_struct_sdna_from(srna, "SolidColorVars", "effectdata");
1040 prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
1041 RNA_def_property_float_sdna(prop, NULL, "col");
1042 RNA_def_property_ui_text(prop, "Color", "");
1043 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
1046 static void rna_def_speed_control(BlenderRNA *brna)
1051 srna = RNA_def_struct(brna, "SpeedControlSequence", "EffectSequence");
1052 RNA_def_struct_ui_text(srna, "SpeedControl Sequence", "Sequence strip to control the speed of other strips.");
1053 RNA_def_struct_sdna_from(srna, "SpeedControlVars", "effectdata");
1055 prop= RNA_def_property(srna, "global_speed", PROP_FLOAT, PROP_UNSIGNED);
1056 RNA_def_property_float_sdna(prop, NULL, "globalSpeed");
1057 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); /* seq->facf0 is used to animate this */
1058 RNA_def_property_ui_text(prop, "Global Speed", "");
1059 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 0);
1061 prop= RNA_def_property(srna, "curve_velocity", PROP_BOOLEAN, PROP_NONE);
1062 RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_INTEGRATE);
1063 RNA_def_property_ui_text(prop, "F-Curve Velocity", "Interpret the F-Curve value as a velocity instead of a frame number.");
1065 prop= RNA_def_property(srna, "frame_blending", PROP_BOOLEAN, PROP_NONE);
1066 RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_BLEND);
1067 RNA_def_property_ui_text(prop, "Frame Blending", "Blend two frames into the target for a smoother result.");
1069 prop= RNA_def_property(srna, "curve_compress_y", PROP_BOOLEAN, PROP_NONE);
1070 RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_COMPRESS_IPO_Y);
1071 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.");
1074 void RNA_def_sequence(BlenderRNA *brna)
1076 rna_def_strip_element(brna);
1077 rna_def_strip_proxy(brna);
1078 rna_def_strip_color_balance(brna);
1079 rna_def_strip_crop(brna);
1080 rna_def_strip_transform(brna);
1082 rna_def_sequence(brna);
1083 rna_def_editor(brna);
1085 rna_def_image(brna);
1087 rna_def_scene(brna);
1088 rna_def_movie(brna);
1089 rna_def_sound(brna);
1090 rna_def_effect(brna);
1091 rna_def_plugin(brna);
1094 rna_def_transform(brna);
1095 rna_def_solid_color(brna);
1096 rna_def_speed_control(brna);