- [#22492] [29159] commit breaks importing of script file that has a reload to self...
[blender.git] / source / blender / editors / space_sequencer / sequencer_add.c
1 /**
2  *
3  * ***** BEGIN GPL LICENSE BLOCK *****
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software Foundation,
17  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  *
19  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
20  * All rights reserved.
21  *
22  * Contributor(s): Blender Foundation, 2003-2009, Campbell Barton
23  *
24  * ***** END GPL LICENSE BLOCK *****
25  */
26
27 #include <stdlib.h>
28 #include <math.h>
29 #include <string.h>
30
31 #ifndef WIN32
32 #include <unistd.h>
33 #else
34 #include <io.h>
35 #endif
36 #include <sys/types.h>
37
38 #include "MEM_guardedalloc.h"
39
40 #include "BLI_blenlib.h"
41 #include "BLI_math.h"
42 #include "BLI_storage_types.h"
43
44
45 #include "DNA_scene_types.h"
46
47 #include "BKE_context.h"
48 #include "BKE_global.h"
49 #include "BKE_image.h"
50 #include "BKE_library.h"
51 #include "BKE_main.h"
52 #include "BKE_plugin_types.h"
53 #include "BKE_sequencer.h"
54 #include "BKE_scene.h"
55 #include "BKE_utildefines.h"
56 #include "BKE_report.h"
57
58 #include "BIF_gl.h"
59 #include "BIF_glutil.h"
60
61 #include "WM_api.h"
62 #include "WM_types.h"
63
64 #include "RNA_define.h"
65 #include "RNA_enum_types.h"
66
67 /* for menu/popup icons etc etc*/
68
69 #include "ED_screen.h"
70
71 #include "UI_view2d.h"
72
73 #include "BKE_sound.h"
74 #include "AUD_C-API.h"
75
76 /* own include */
77 #include "sequencer_intern.h"
78
79 /* Generic functions, reused by add strip operators */
80
81 /* avoid passing multiple args and be more verbose */
82 #define SEQPROP_STARTFRAME      1<<0
83 #define SEQPROP_ENDFRAME        1<<1
84 #define SEQPROP_FILES           1<<2
85
86 static void sequencer_generic_props__internal(wmOperatorType *ot, int flag)
87 {
88         RNA_def_string(ot->srna, "name", "", MAX_ID_NAME-2, "Name", "Name of the new sequence strip");
89
90         if(flag & SEQPROP_STARTFRAME)
91                 RNA_def_int(ot->srna, "frame_start", 0, INT_MIN, INT_MAX, "Start Frame", "Start frame of the sequence strip", INT_MIN, INT_MAX);
92         
93         if(flag & SEQPROP_ENDFRAME)
94                 RNA_def_int(ot->srna, "frame_end", 0, INT_MIN, INT_MAX, "End Frame", "End frame for the color strip", INT_MIN, INT_MAX); /* not useual since most strips have a fixed length */
95         
96         RNA_def_int(ot->srna, "channel", 1, 1, MAXSEQ, "Channel", "Channel to place this strip into", 1, MAXSEQ);
97         
98         RNA_def_boolean(ot->srna, "replace_sel", 1, "Replace Selection", "replace the current selection");
99
100         if(flag & SEQPROP_FILES)
101                 RNA_def_collection_runtime(ot->srna, "files", &RNA_OperatorFileListElement, "Files", "");
102 }
103
104 static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, wmEvent *event, int flag)
105 {
106         ARegion *ar= CTX_wm_region(C);
107         View2D *v2d= UI_view2d_fromcontext(C);
108         
109         short mval[2];  
110         float mval_v2d[2];
111         
112
113         mval[0]= event->x - ar->winrct.xmin;
114         mval[1]= event->y - ar->winrct.ymin;
115         
116         UI_view2d_region_to_view(v2d, mval[0], mval[1], &mval_v2d[0], &mval_v2d[1]);
117         
118         RNA_int_set(op->ptr, "channel", (int)mval_v2d[1]+0.5f);
119         RNA_int_set(op->ptr, "frame_start", (int)mval_v2d[0]);
120         
121         if ((flag & SEQPROP_ENDFRAME) && RNA_property_is_set(op->ptr, "frame_end")==0)
122                 RNA_int_set(op->ptr, "frame_end", (int)mval_v2d[0] + 25); // XXX arbitary but ok for now.
123         
124 }
125
126 static void seq_load_operator_info(SeqLoadInfo *seq_load, wmOperator *op)
127 {
128         memset(seq_load, 0, sizeof(SeqLoadInfo));
129
130         seq_load->start_frame=  RNA_int_get(op->ptr, "frame_start");
131         seq_load->end_frame=    seq_load->start_frame; /* un-set */
132
133         seq_load->channel=              RNA_int_get(op->ptr, "channel");
134         seq_load->len=                  1; // images only, if endframe isnt set!
135
136         RNA_string_get(op->ptr, "name", seq_load->name+2);
137
138         RNA_string_get(op->ptr, "path", seq_load->path); /* full path, file is set by the caller */
139
140         if (RNA_struct_find_property(op->ptr, "frame_end")) {
141                 seq_load->end_frame = RNA_int_get(op->ptr, "frame_end");
142         }
143
144         if (RNA_struct_find_property(op->ptr, "replace_sel") && RNA_boolean_get(op->ptr, "replace_sel"))
145                 seq_load->flag |= SEQ_LOAD_REPLACE_SEL;
146
147         if (RNA_struct_find_property(op->ptr, "cache") && RNA_boolean_get(op->ptr, "cache"))
148                 seq_load->flag |= SEQ_LOAD_SOUND_CACHE;
149
150         if (RNA_struct_find_property(op->ptr, "sound") && RNA_boolean_get(op->ptr, "sound"))
151                 seq_load->flag |= SEQ_LOAD_MOVIE_SOUND;
152
153         /* always use this for ops */
154         seq_load->flag |= SEQ_LOAD_FRAME_ADVANCE;
155 }
156
157 /* add scene operator */
158 static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
159 {
160         Scene *scene= CTX_data_scene(C);
161         Editing *ed= seq_give_editing(scene, TRUE);
162         
163         Scene *sce_seq;
164
165         Sequence *seq;  /* generic strip vars */
166         Strip *strip;
167         StripElem *se;
168         
169         int start_frame, channel; /* operator props */
170         
171         start_frame= RNA_int_get(op->ptr, "frame_start");
172         channel= RNA_int_get(op->ptr, "channel");
173         
174         sce_seq= BLI_findlink(&CTX_data_main(C)->scene, RNA_enum_get(op->ptr, "scene"));
175         
176         if (sce_seq==NULL) {
177                 BKE_report(op->reports, RPT_ERROR, "Scene not found");
178                 return OPERATOR_CANCELLED;
179         }
180         
181         seq = alloc_sequence(ed->seqbasep, start_frame, channel);
182         
183         seq->type= SEQ_SCENE;
184         seq->scene= sce_seq;
185         seq->sfra= sce_seq->r.sfra;
186         
187         /* basic defaults */
188         seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
189         strip->len = seq->len = sce_seq->r.efra - sce_seq->r.sfra + 1;
190         strip->us= 1;
191         
192         strip->stripdata= se= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
193         
194         if(RNA_property_is_set(op->ptr, "name"))
195                 RNA_string_get(op->ptr, "name", seq->name+2);
196         else
197                 strcpy(seq->name+2, sce_seq->id.name+2);
198         
199         seq->scene_sound = sound_scene_add_scene_sound(scene, seq, start_frame, start_frame + strip->len, 0);
200
201         calc_sequence_disp(scene, seq);
202         sort_seq(scene);
203         
204         if (RNA_boolean_get(op->ptr, "replace_sel")) {
205                 deselect_all_seq(scene);
206                 active_seq_set(scene, seq);
207                 seq->flag |= SELECT;
208         }
209         
210         WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
211         
212         return OPERATOR_FINISHED;
213 }
214
215
216 static int sequencer_add_scene_strip_invoke(bContext *C, wmOperator *op, wmEvent *event)
217 {
218         if(!ED_operator_sequencer_active(C)) {
219                 BKE_report(op->reports, RPT_ERROR, "Sequencer area not active");
220                 return OPERATOR_CANCELLED;
221         }
222
223         sequencer_generic_invoke_xy__internal(C, op, event, 0);
224         return sequencer_add_scene_strip_exec(C, op);
225         // needs a menu
226         // return WM_menu_invoke(C, op, event);
227 }
228
229
230 void SEQUENCER_OT_scene_strip_add(struct wmOperatorType *ot)
231 {
232         PropertyRNA *prop;
233         
234         /* identifiers */
235         ot->name= "Add Scene Strip";
236         ot->idname= "SEQUENCER_OT_scene_strip_add";
237         ot->description= "Add a strip to the sequencer using a blender scene as a source";
238
239         /* api callbacks */
240         ot->invoke= sequencer_add_scene_strip_invoke;
241         ot->exec= sequencer_add_scene_strip_exec;
242
243         ot->poll= ED_operator_scene_editable;
244         
245         /* flags */
246         ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
247         
248         sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME);
249         prop= RNA_def_enum(ot->srna, "scene", DummyRNA_NULL_items, 0, "Scene", "");
250         RNA_def_enum_funcs(prop, RNA_scene_itemf);
251         ot->prop= prop;
252 }
253
254 static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoadFunc seq_load_func)
255 {
256         Scene *scene= CTX_data_scene(C); /* only for sound */
257         Editing *ed= seq_give_editing(scene, TRUE);
258         SeqLoadInfo seq_load;
259         Sequence *seq;
260         int tot_files;
261
262         seq_load_operator_info(&seq_load, op);
263
264         if (seq_load.flag & SEQ_LOAD_REPLACE_SEL)
265                 deselect_all_seq(scene);
266
267         tot_files= RNA_property_collection_length(op->ptr, RNA_struct_find_property(op->ptr, "files"));
268
269         if(tot_files) {
270                 /* multiple files */
271                 char dir_only[FILE_MAX];
272                 char file_only[FILE_MAX];
273
274                 BLI_split_dirfile(seq_load.path, dir_only, NULL);
275
276                 RNA_BEGIN(op->ptr, itemptr, "files") {
277                         RNA_string_get(&itemptr, "name", file_only);
278                         BLI_join_dirfile(seq_load.path, dir_only, file_only);
279
280                         seq= seq_load_func(C, ed->seqbasep, &seq_load);
281                 }
282                 RNA_END;
283         }
284         else {
285                 /* single file */
286                 seq= seq_load_func(C, ed->seqbasep, &seq_load);
287         }
288
289         if (seq_load.tot_success==0) {
290                 BKE_reportf(op->reports, RPT_ERROR, "File \"%s\" could not be loaded", seq_load.path);
291                 return OPERATOR_CANCELLED;
292         }
293
294         sort_seq(scene);
295         seq_update_muting(scene, ed);
296
297         WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
298
299         return OPERATOR_FINISHED;
300 }
301
302 /* add movie operator */
303 static int sequencer_add_movie_strip_exec(bContext *C, wmOperator *op)
304 {
305         return sequencer_add_generic_strip_exec(C, op, sequencer_add_movie_strip);
306 }
307
308
309 static int sequencer_add_movie_strip_invoke(bContext *C, wmOperator *op, wmEvent *event)
310 {
311         if(!ED_operator_sequencer_active(C)) {
312                 BKE_report(op->reports, RPT_ERROR, "Sequencer area not active");
313                 return OPERATOR_CANCELLED;
314         }
315
316         sequencer_generic_invoke_xy__internal(C, op, event, 0);
317         return WM_operator_filesel(C, op, event);
318         //return sequencer_add_movie_strip_exec(C, op);
319 }
320
321
322 void SEQUENCER_OT_movie_strip_add(struct wmOperatorType *ot)
323 {
324         
325         /* identifiers */
326         ot->name= "Add Movie Strip";
327         ot->idname= "SEQUENCER_OT_movie_strip_add";
328         ot->description= "Add a movie strip to the sequencer";
329
330         /* api callbacks */
331         ot->invoke= sequencer_add_movie_strip_invoke;
332         ot->exec= sequencer_add_movie_strip_exec;
333
334         ot->poll= ED_operator_scene_editable;
335         
336         /* flags */
337         ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
338         
339         WM_operator_properties_filesel(ot, FOLDERFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE);
340         sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_FILES);
341         RNA_def_boolean(ot->srna, "sound", TRUE, "Sound", "Load sound with the movie");
342 }
343
344 /* add sound operator */
345
346 static int sequencer_add_sound_strip_exec(bContext *C, wmOperator *op)
347 {
348         return sequencer_add_generic_strip_exec(C, op, sequencer_add_sound_strip);
349 }
350
351 static int sequencer_add_sound_strip_invoke(bContext *C, wmOperator *op, wmEvent *event)
352 {
353         if(!ED_operator_sequencer_active(C)) {
354                 BKE_report(op->reports, RPT_ERROR, "Sequencer area not active");
355                 return OPERATOR_CANCELLED;
356         }
357
358         sequencer_generic_invoke_xy__internal(C, op, event, 0);
359         return WM_operator_filesel(C, op, event);
360         //return sequencer_add_sound_strip_exec(C, op);
361 }
362
363
364 void SEQUENCER_OT_sound_strip_add(struct wmOperatorType *ot)
365 {
366         
367         /* identifiers */
368         ot->name= "Add Sound Strip";
369         ot->idname= "SEQUENCER_OT_sound_strip_add";
370         ot->description= "Add a sound strip to the sequencer";
371
372         /* api callbacks */
373         ot->invoke= sequencer_add_sound_strip_invoke;
374         ot->exec= sequencer_add_sound_strip_exec;
375
376         ot->poll= ED_operator_scene_editable;
377         
378         /* flags */
379         ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
380         
381         WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE, FILE_SPECIAL, FILE_OPENFILE);
382         sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_FILES);
383         RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory.");
384 }
385
386 /* add image operator */
387 static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op)
388 {
389         /* cant use the generic function for this */
390
391         Scene *scene= CTX_data_scene(C); /* only for sound */
392         Editing *ed= seq_give_editing(scene, TRUE);
393         SeqLoadInfo seq_load;
394         Sequence *seq;
395
396         Strip *strip;
397         StripElem *se;
398
399         seq_load_operator_info(&seq_load, op);
400
401         /* images are unique in how they handle this - 1 per strip elem */
402         seq_load.len= RNA_property_collection_length(op->ptr, RNA_struct_find_property(op->ptr, "files"));
403
404         if(seq_load.len==0)
405                 seq_load.len= 1;
406
407         if(seq_load.flag & SEQ_LOAD_REPLACE_SEL)
408                 deselect_all_seq(scene);
409
410         
411         /* main adding function */
412         seq= sequencer_add_image_strip(C, ed->seqbasep, &seq_load);
413         strip= seq->strip;
414         se= strip->stripdata;
415
416         if(seq_load.len > 1) {
417                 RNA_BEGIN(op->ptr, itemptr, "files") {
418                         RNA_string_get(&itemptr, "name", se->name);
419                         se++;
420                 }
421                 RNA_END;
422         }
423         else {
424                 BLI_strncpy(se->name, BLI_path_basename(seq_load.path), sizeof(se->name));
425                 if(seq_load.start_frame < seq_load.end_frame) {
426                         seq->endstill= seq_load.end_frame - seq_load.start_frame;
427                 }
428         }
429         
430         calc_sequence_disp(scene, seq);
431
432         sort_seq(scene);
433
434         /* last active name */
435         strncpy(ed->act_imagedir, strip->dir, FILE_MAXDIR-1);
436         
437         WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
438
439         return OPERATOR_FINISHED;
440 }
441
442 static int sequencer_add_image_strip_invoke(bContext *C, wmOperator *op, wmEvent *event)
443 {
444         if(!ED_operator_sequencer_active(C)) {
445                 BKE_report(op->reports, RPT_ERROR, "Sequencer area not active");
446                 return OPERATOR_CANCELLED;
447         }
448
449         sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_ENDFRAME);
450         return WM_operator_filesel(C, op, event);       
451         //return sequencer_add_image_strip_exec(C, op);
452 }
453
454
455 void SEQUENCER_OT_image_strip_add(struct wmOperatorType *ot)
456 {
457         
458         /* identifiers */
459         ot->name= "Add Image Strip";
460         ot->idname= "SEQUENCER_OT_image_strip_add";
461         ot->description= "Add an image or image sequence to the sequencer";
462
463         /* api callbacks */
464         ot->invoke= sequencer_add_image_strip_invoke;
465         ot->exec= sequencer_add_image_strip_exec;
466
467         ot->poll= ED_operator_scene_editable;
468         
469         /* flags */
470         ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
471         
472         WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE);
473         sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_ENDFRAME|SEQPROP_FILES);
474 }
475
476
477 /* add_effect_strip operator */
478 static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
479 {
480         Scene *scene= CTX_data_scene(C);
481         Editing *ed= seq_give_editing(scene, TRUE);
482
483         Sequence *seq;  /* generic strip vars */
484         Strip *strip;
485         StripElem *se;
486         struct SeqEffectHandle sh;
487
488         int start_frame, end_frame, channel, type; /* operator props */
489         
490         Sequence *seq1, *seq2, *seq3;
491         char *error_msg;
492
493         start_frame= RNA_int_get(op->ptr, "frame_start");
494         end_frame= RNA_int_get(op->ptr, "frame_end");
495         channel= RNA_int_get(op->ptr, "channel");
496
497         type= RNA_enum_get(op->ptr, "type");
498         
499         // XXX We need unique names and move to invoke
500         if(!seq_effect_find_selected(scene, NULL, type, &seq1, &seq2, &seq3, &error_msg)) {
501                 BKE_report(op->reports, RPT_ERROR, error_msg);
502                 return OPERATOR_CANCELLED;
503         }
504
505         /* If seq1 is NULL and no error was rasied it means the seq is standalone
506          * (like color strips) and we need to check its start and end frames are valid */
507         if (seq1==NULL && end_frame <= start_frame) {
508                 BKE_report(op->reports, RPT_ERROR, "Start and end frame are not set");
509                 return OPERATOR_CANCELLED;
510         }
511
512         seq = alloc_sequence(ed->seqbasep, start_frame, channel);
513         seq->type= type;
514
515         if(RNA_property_is_set(op->ptr, "name"))
516                 RNA_string_get(op->ptr, "name", seq->name+2);
517         else
518                 strcpy(seq->name+2, give_seqname(seq));
519
520         seqbase_unique_name_recursive(&ed->seqbase, seq);
521
522         sh = get_sequence_effect(seq);
523
524         seq->seq1= seq1;
525         seq->seq2= seq2;
526         seq->seq3= seq3;
527
528         sh.init(seq);
529
530         if (!seq1) { /* effect has no deps */
531                 seq->len= 1;
532                 seq_tx_set_final_right(seq, end_frame);
533         }
534
535         seq->flag |= SEQ_USE_EFFECT_DEFAULT_FADE;
536
537         calc_sequence(scene, seq);
538         
539         /* basic defaults */
540         seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
541         strip->len = seq->len;
542         strip->us= 1;
543         if(seq->len>0)
544                 strip->stripdata= se= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
545
546         if (seq->type==SEQ_PLUGIN) {
547                 char path[FILE_MAX];
548                 RNA_string_get(op->ptr, "path", path);
549
550                 sh.init_plugin(seq, path);
551
552                 if(seq->plugin==NULL) {
553                         BLI_remlink(ed->seqbasep, seq);
554                         seq_free_sequence(scene, seq);
555                         BKE_reportf(op->reports, RPT_ERROR, "Sequencer plugin \"%s\" could not load.", path);
556                         return OPERATOR_CANCELLED;
557                 }
558         }
559         else if (seq->type==SEQ_COLOR) {
560                 SolidColorVars *colvars= (SolidColorVars *)seq->effectdata;
561                 RNA_float_get_array(op->ptr, "color", colvars->col);
562         }
563
564         if(seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
565
566         update_changed_seq_and_deps(scene, seq, 1, 1); /* runs calc_sequence */
567
568
569         /* not sure if this is needed with update_changed_seq_and_deps.
570          * it was NOT called in blender 2.4x, but wont hurt */
571         sort_seq(scene); 
572
573         if (RNA_boolean_get(op->ptr, "replace_sel")) {
574                 deselect_all_seq(scene);
575                 active_seq_set(scene, seq);
576                 seq->flag |= SELECT;
577         }
578
579         WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
580
581         return OPERATOR_FINISHED;
582 }
583
584
585 /* add color */
586 static int sequencer_add_effect_strip_invoke(bContext *C, wmOperator *op, wmEvent *event)
587 {
588         if(!ED_operator_sequencer_active(C)) {
589                 BKE_report(op->reports, RPT_ERROR, "Sequencer area not active");
590                 return OPERATOR_CANCELLED;
591         }
592
593         sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_ENDFRAME);
594
595         if (RNA_property_is_set(op->ptr, "type") && RNA_enum_get(op->ptr, "type")==SEQ_PLUGIN) {
596                 /* only plugins need the file selector */
597                 return WM_operator_filesel(C, op, event);
598         }
599         else {
600                 return sequencer_add_effect_strip_exec(C, op);
601         }
602 }
603
604 void SEQUENCER_OT_effect_strip_add(struct wmOperatorType *ot)
605 {
606         /* identifiers */
607         ot->name= "Add Effect Strip";
608         ot->idname= "SEQUENCER_OT_effect_strip_add";
609         ot->description= "Add an effect to the sequencer, most are applied on top of existing strips";
610
611         /* api callbacks */
612         ot->invoke= sequencer_add_effect_strip_invoke;
613         ot->exec= sequencer_add_effect_strip_exec;
614
615         ot->poll= ED_operator_scene_editable;
616         
617         /* flags */
618         ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
619         
620         WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE);
621         sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_ENDFRAME);
622         RNA_def_enum(ot->srna, "type", sequencer_prop_effect_types, SEQ_CROSS, "Type", "Sequencer effect type");
623         RNA_def_float_vector(ot->srna, "color", 3, NULL, 0.0f, 1.0f, "Color", "Initialize the strip with this color (only used when type='COLOR')", 0.0f, 1.0f);
624 }