diff options
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_add.c')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_add.c | 278 |
1 files changed, 188 insertions, 90 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 96e837eb95b..7c5f1a1543f 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -52,9 +52,9 @@ #include "BKE_global.h" #include "BKE_main.h" #include "BKE_sequencer.h" +#include "BKE_movieclip.h" #include "BKE_report.h" - #include "WM_api.h" #include "WM_types.h" @@ -88,10 +88,10 @@ static void sequencer_generic_props__internal(wmOperatorType *ot, int flag) { - if(flag & SEQPROP_STARTFRAME) + if (flag & SEQPROP_STARTFRAME) RNA_def_int(ot->srna, "frame_start", 0, INT_MIN, INT_MAX, "Start Frame", "Start frame of the sequence strip", INT_MIN, INT_MAX); - if(flag & SEQPROP_ENDFRAME) + if (flag & SEQPROP_ENDFRAME) 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 usual since most strips have a fixed length */ RNA_def_int(ot->srna, "channel", 1, 1, MAXSEQ, "Channel", "Channel to place this strip into", 1, MAXSEQ); @@ -103,10 +103,10 @@ static void sequencer_generic_props__internal(wmOperatorType *ot, int flag) static void sequencer_generic_invoke_path__internal(bContext *C, wmOperator *op, const char *identifier) { - if(RNA_struct_find_property(op->ptr, identifier)) { + if (RNA_struct_find_property(op->ptr, identifier)) { Scene *scene= CTX_data_scene(C); Sequence *last_seq= seq_active_get(scene); - if(last_seq && last_seq->strip && SEQ_HAS_PATH(last_seq)) { + if (last_seq && last_seq->strip && SEQ_HAS_PATH(last_seq)) { char path[sizeof(last_seq->strip->dir)]; BLI_strncpy(path, last_seq->strip->dir, sizeof(path)); BLI_path_abs(path, G.main->name); @@ -123,8 +123,8 @@ static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, w UI_view2d_region_to_view(v2d, event->mval[0], event->mval[1], &mval_v2d[0], &mval_v2d[1]); - /* effect strips dont need a channel initialized from the mouse */ - if(!(flag & SEQPROP_NOCHAN)) { + /* effect strips don't need a channel initialized from the mouse */ + if (!(flag & SEQPROP_NOCHAN)) { RNA_int_set(op->ptr, "channel", (int)mval_v2d[1]+0.5f); } @@ -149,17 +149,18 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, wmOperator *op) seq_load->end_frame= seq_load->start_frame; /* un-set */ seq_load->channel= RNA_int_get(op->ptr, "channel"); - seq_load->len= 1; // images only, if endframe isnt set! + seq_load->len= 1; // images only, if endframe isn't set! - if(RNA_struct_find_property(op->ptr, "filepath")) { + if (RNA_struct_find_property(op->ptr, "filepath")) { RNA_string_get(op->ptr, "filepath", seq_load->path); /* full path, file is set by the caller */ is_file= 1; - } else if (RNA_struct_find_property(op->ptr, "directory")) { + } + else if (RNA_struct_find_property(op->ptr, "directory")) { RNA_string_get(op->ptr, "directory", seq_load->path); /* full path, file is set by the caller */ is_file= 0; } - if((is_file != -1) && relative) + if ((is_file != -1) && relative) BLI_path_rel(seq_load->path, G.main->name); @@ -180,10 +181,10 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, wmOperator *op) seq_load->flag |= SEQ_LOAD_FRAME_ADVANCE; - if(is_file==1) { + if (is_file==1) { BLI_strncpy(seq_load->name, BLI_path_basename(seq_load->path), sizeof(seq_load->name)); } - else if(RNA_struct_find_property(op->ptr, "files")) { + else if (RNA_struct_find_property(op->ptr, "files")) { /* used for image strip */ /* best guess, first images name */ RNA_BEGIN(op->ptr, itemptr, "files") { @@ -224,19 +225,16 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op) seq->blend_mode= SEQ_CROSS; /* so alpha adjustment fade to the strip below */ seq->scene= sce_seq; - seq->sfra= sce_seq->r.sfra; /* basic defaults */ seq->strip= strip= MEM_callocN(sizeof(Strip), "strip"); - strip->len = seq->len = sce_seq->r.efra - sce_seq->r.sfra + 1; + seq->len = sce_seq->r.efra - sce_seq->r.sfra + 1; strip->us= 1; - strip->stripdata= MEM_callocN(seq->len*sizeof(StripElem), "stripelem"); - BLI_strncpy(seq->name+2, sce_seq->id.name+2, sizeof(seq->name)-2); seqbase_unique_name_recursive(&ed->seqbase, seq); - seq->scene_sound = sound_scene_add_scene_sound(scene, seq, start_frame, start_frame + strip->len, 0); + seq->scene_sound = sound_scene_add_scene_sound(scene, seq, start_frame, start_frame + seq->len, 0); calc_sequence_disp(scene, seq); sort_seq(scene); @@ -247,8 +245,8 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op) seq->flag |= SELECT; } - if(RNA_boolean_get(op->ptr, "overlap") == FALSE) { - if(seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene); + if (RNA_boolean_get(op->ptr, "overlap") == FALSE) { + if (seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene); } WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene); @@ -259,12 +257,12 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op) static int sequencer_add_scene_strip_invoke(bContext *C, wmOperator *op, wmEvent *event) { - if(!ED_operator_sequencer_active(C)) { + if (!ED_operator_sequencer_active(C)) { BKE_report(op->reports, RPT_ERROR, "Sequencer area not active"); return OPERATOR_CANCELLED; } - if(!RNA_struct_property_is_set(op->ptr, "scene")) + if (!RNA_struct_property_is_set(op->ptr, "scene")) return WM_enum_search_invoke(C, op, event); sequencer_generic_invoke_xy__internal(C, op, event, 0); @@ -279,25 +277,122 @@ void SEQUENCER_OT_scene_strip_add(struct wmOperatorType *ot) PropertyRNA *prop; /* identifiers */ - ot->name= "Add Scene Strip"; - ot->idname= "SEQUENCER_OT_scene_strip_add"; - ot->description= "Add a strip to the sequencer using a blender scene as a source"; + ot->name = "Add Scene Strip"; + ot->idname = "SEQUENCER_OT_scene_strip_add"; + ot->description = "Add a strip to the sequencer using a blender scene as a source"; /* api callbacks */ - ot->invoke= sequencer_add_scene_strip_invoke; - ot->exec= sequencer_add_scene_strip_exec; + ot->invoke = sequencer_add_scene_strip_invoke; + ot->exec = sequencer_add_scene_strip_exec; - ot->poll= ED_operator_scene_editable; + ot->poll = ED_operator_scene_editable; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME); prop= RNA_def_enum(ot->srna, "scene", DummyRNA_NULL_items, 0, "Scene", ""); RNA_def_enum_funcs(prop, RNA_scene_itemf); - ot->prop= prop; + ot->prop = prop; } +/* add movieclip operator */ +static int sequencer_add_movieclip_strip_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Editing *ed= seq_give_editing(scene, TRUE); + + MovieClip *clip; + + Sequence *seq; /* generic strip vars */ + Strip *strip; + + int start_frame, channel; /* operator props */ + + start_frame= RNA_int_get(op->ptr, "frame_start"); + channel= RNA_int_get(op->ptr, "channel"); + + clip= BLI_findlink(&CTX_data_main(C)->movieclip, RNA_enum_get(op->ptr, "clip")); + + if (clip == NULL) { + BKE_report(op->reports, RPT_ERROR, "MovieClip not found"); + return OPERATOR_CANCELLED; + } + + seq = alloc_sequence(ed->seqbasep, start_frame, channel); + seq->type= SEQ_MOVIECLIP; + seq->blend_mode= SEQ_CROSS; + seq->clip = clip; + + /* basic defaults */ + seq->strip= strip= MEM_callocN(sizeof(Strip), "strip"); + seq->len = BKE_movieclip_get_duration(clip); + strip->us= 1; + + BLI_strncpy(seq->name+2, clip->id.name+2, sizeof(seq->name)-2); + seqbase_unique_name_recursive(&ed->seqbase, seq); + + calc_sequence_disp(scene, seq); + sort_seq(scene); + + if (RNA_boolean_get(op->ptr, "replace_sel")) { + deselect_all_seq(scene); + seq_active_set(scene, seq); + seq->flag |= SELECT; + } + + if (RNA_boolean_get(op->ptr, "overlap") == FALSE) { + if (seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene); + } + + WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene); + + return OPERATOR_FINISHED; +} + + +static int sequencer_add_movieclip_strip_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + if (!ED_operator_sequencer_active(C)) { + BKE_report(op->reports, RPT_ERROR, "Sequencer area not active"); + return OPERATOR_CANCELLED; + } + + if (!RNA_struct_property_is_set(op->ptr, "clip")) + return WM_enum_search_invoke(C, op, event); + + sequencer_generic_invoke_xy__internal(C, op, event, 0); + return sequencer_add_movieclip_strip_exec(C, op); + // needs a menu + // return WM_menu_invoke(C, op, event); +} + + +void SEQUENCER_OT_movieclip_strip_add(struct wmOperatorType *ot) +{ + PropertyRNA *prop; + + /* identifiers */ + ot->name = "Add MovieClip Strip"; + ot->idname = "SEQUENCER_OT_movieclip_strip_add"; + ot->description = "Add a movieclip strip to the sequencer"; + + /* api callbacks */ + ot->invoke = sequencer_add_movieclip_strip_invoke; + ot->exec = sequencer_add_movieclip_strip_exec; + + ot->poll = ED_operator_scene_editable; + + /* flags */ + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + + sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME); + prop= RNA_def_enum(ot->srna, "clip", DummyRNA_NULL_items, 0, "Clip", ""); + RNA_def_enum_funcs(prop, RNA_movieclip_itemf); + ot->prop = prop; +} + + static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoadFunc seq_load_func) { Scene *scene= CTX_data_scene(C); /* only for sound */ @@ -314,7 +409,7 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad tot_files= RNA_property_collection_length(op->ptr, RNA_struct_find_property(op->ptr, "files")); - if(tot_files) { + if (tot_files) { /* multiple files */ char dir_only[FILE_MAX]; char file_only[FILE_MAX]; @@ -327,8 +422,8 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad seq = seq_load_func(C, ed->seqbasep, &seq_load); if (seq) { - if(overlap == FALSE) { - if(seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene); + if (overlap == FALSE) { + if (seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene); } } } @@ -338,8 +433,8 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad /* single file */ seq = seq_load_func(C, ed->seqbasep, &seq_load); if (seq) { - if(overlap == FALSE) { - if(seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene); + if (overlap == FALSE) { + if (seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene); } } } @@ -367,13 +462,15 @@ static int sequencer_add_movie_strip_exec(bContext *C, wmOperator *op) static int sequencer_add_movie_strip_invoke(bContext *C, wmOperator *op, wmEvent *event) { - if(!ED_operator_sequencer_active(C)) { + if (!ED_operator_sequencer_active(C)) { BKE_report(op->reports, RPT_ERROR, "Sequencer area not active"); return OPERATOR_CANCELLED; } /* This is for drag and drop */ - if(RNA_collection_length(op->ptr, "files") || RNA_struct_property_is_set(op->ptr, "filepath")) { + if ((RNA_struct_property_is_set(op->ptr, "files") && RNA_collection_length(op->ptr, "files")) || + RNA_struct_property_is_set(op->ptr, "filepath")) + { sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_NOPATHS); return sequencer_add_movie_strip_exec(C, op); } @@ -391,18 +488,18 @@ void SEQUENCER_OT_movie_strip_add(struct wmOperatorType *ot) { /* identifiers */ - ot->name= "Add Movie Strip"; - ot->idname= "SEQUENCER_OT_movie_strip_add"; - ot->description= "Add a movie strip to the sequencer"; + ot->name = "Add Movie Strip"; + ot->idname = "SEQUENCER_OT_movie_strip_add"; + ot->description = "Add a movie strip to the sequencer"; /* api callbacks */ - ot->invoke= sequencer_add_movie_strip_invoke; - ot->exec= sequencer_add_movie_strip_exec; + ot->invoke = sequencer_add_movie_strip_invoke; + ot->exec = sequencer_add_movie_strip_exec; - ot->poll= ED_operator_scene_editable; + ot->poll = ED_operator_scene_editable; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; WM_operator_properties_filesel(ot, FOLDERFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH|WM_FILESEL_FILES, FILE_DEFAULTDISPLAY); sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME); @@ -419,13 +516,15 @@ static int sequencer_add_sound_strip_exec(bContext *C, wmOperator *op) static int sequencer_add_sound_strip_invoke(bContext *C, wmOperator *op, wmEvent *event) { - if(!ED_operator_sequencer_active(C)) { + if (!ED_operator_sequencer_active(C)) { BKE_report(op->reports, RPT_ERROR, "Sequencer area not active"); return OPERATOR_CANCELLED; } /* This is for drag and drop */ - if(RNA_collection_length(op->ptr, "files") || RNA_struct_property_is_set(op->ptr, "filepath")) { + if ((RNA_struct_property_is_set(op->ptr, "files") && RNA_collection_length(op->ptr, "files")) || + RNA_struct_property_is_set(op->ptr, "filepath")) + { sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_NOPATHS); return sequencer_add_sound_strip_exec(C, op); } @@ -443,18 +542,18 @@ void SEQUENCER_OT_sound_strip_add(struct wmOperatorType *ot) { /* identifiers */ - ot->name= "Add Sound Strip"; - ot->idname= "SEQUENCER_OT_sound_strip_add"; - ot->description= "Add a sound strip to the sequencer"; + ot->name = "Add Sound Strip"; + ot->idname = "SEQUENCER_OT_sound_strip_add"; + ot->description = "Add a sound strip to the sequencer"; /* api callbacks */ - ot->invoke= sequencer_add_sound_strip_invoke; - ot->exec= sequencer_add_sound_strip_exec; + ot->invoke = sequencer_add_sound_strip_invoke; + ot->exec = sequencer_add_sound_strip_exec; - ot->poll= ED_operator_scene_editable; + ot->poll = ED_operator_scene_editable; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH|WM_FILESEL_FILES, FILE_DEFAULTDISPLAY); sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME); @@ -479,10 +578,10 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op) /* images are unique in how they handle this - 1 per strip elem */ seq_load.len= RNA_property_collection_length(op->ptr, RNA_struct_find_property(op->ptr, "files")); - if(seq_load.len==0) + if (seq_load.len==0) return OPERATOR_CANCELLED; - if(seq_load.flag & SEQ_LOAD_REPLACE_SEL) + if (seq_load.flag & SEQ_LOAD_REPLACE_SEL) deselect_all_seq(scene); @@ -499,8 +598,8 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op) } RNA_END; - if(seq_load.len == 1) { - if(seq_load.start_frame < seq_load.end_frame) { + if (seq_load.len == 1) { + if (seq_load.start_frame < seq_load.end_frame) { seq->endstill= seq_load.end_frame - seq_load.start_frame; } } @@ -512,8 +611,8 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op) /* last active name */ strncpy(ed->act_imagedir, strip->dir, FILE_MAXDIR-1); - if(RNA_boolean_get(op->ptr, "overlap") == FALSE) { - if(seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene); + if (RNA_boolean_get(op->ptr, "overlap") == FALSE) { + if (seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene); } WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene); @@ -524,14 +623,14 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op) static int sequencer_add_image_strip_invoke(bContext *C, wmOperator *op, wmEvent *event) { - if(!ED_operator_sequencer_active(C)) { + if (!ED_operator_sequencer_active(C)) { BKE_report(op->reports, RPT_ERROR, "Sequencer area not active"); return OPERATOR_CANCELLED; } /* drag drop has set the names */ - if(RNA_collection_length(op->ptr, "files")) { + if (RNA_struct_property_is_set(op->ptr, "files") && RNA_collection_length(op->ptr, "files")) { sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_ENDFRAME|SEQPROP_NOPATHS); return sequencer_add_image_strip_exec(C, op); } @@ -547,18 +646,18 @@ void SEQUENCER_OT_image_strip_add(struct wmOperatorType *ot) { /* identifiers */ - ot->name= "Add Image Strip"; - ot->idname= "SEQUENCER_OT_image_strip_add"; - ot->description= "Add an image or image sequence to the sequencer"; + ot->name = "Add Image Strip"; + ot->idname = "SEQUENCER_OT_image_strip_add"; + ot->description = "Add an image or image sequence to the sequencer"; /* api callbacks */ - ot->invoke= sequencer_add_image_strip_invoke; - ot->exec= sequencer_add_image_strip_exec; + ot->invoke = sequencer_add_image_strip_invoke; + ot->exec = sequencer_add_image_strip_exec; - ot->poll= ED_operator_scene_editable; + ot->poll = ED_operator_scene_editable; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_DIRECTORY|WM_FILESEL_RELPATH|WM_FILESEL_FILES, FILE_DEFAULTDISPLAY); sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_ENDFRAME); @@ -587,7 +686,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op) type= RNA_enum_get(op->ptr, "type"); // XXX move to invoke - if(!seq_effect_find_selected(scene, NULL, type, &seq1, &seq2, &seq3, &error_msg)) { + if (!seq_effect_find_selected(scene, NULL, type, &seq1, &seq2, &seq3, &error_msg)) { BKE_report(op->reports, RPT_ERROR, error_msg); return OPERATOR_CANCELLED; } @@ -624,10 +723,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op) /* basic defaults */ seq->strip= strip= MEM_callocN(sizeof(Strip), "strip"); - strip->len = seq->len; strip->us= 1; - if(seq->len>0) - strip->stripdata= MEM_callocN(seq->len*sizeof(StripElem), "stripelem"); if (seq->type==SEQ_PLUGIN) { char path[FILE_MAX]; @@ -635,35 +731,37 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op) sh.init_plugin(seq, path); - if(seq->plugin==NULL) { + if (seq->plugin==NULL) { BLI_remlink(ed->seqbasep, seq); seq_free_sequence(scene, seq); BKE_reportf(op->reports, RPT_ERROR, "Sequencer plugin \"%s\" could not load", path); return OPERATOR_CANCELLED; } - } else if (seq->type == SEQ_COLOR) { + } + else if (seq->type == SEQ_COLOR) { SolidColorVars *colvars= (SolidColorVars *)seq->effectdata; RNA_float_get_array(op->ptr, "color", colvars->col); seq->blend_mode= SEQ_CROSS; /* so alpha adjustment fade to the strip below */ - } else if (seq->type == SEQ_ADJUSTMENT) { + } + else if (seq->type == SEQ_ADJUSTMENT) { seq->blend_mode= SEQ_CROSS; } /* an unset channel is a special case where we automatically go above * the other strips. */ - if(!RNA_struct_property_is_set(op->ptr, "channel")) { - if(seq->seq1) { + if (!RNA_struct_property_is_set(op->ptr, "channel")) { + if (seq->seq1) { int chan= MAX3( seq->seq1 ? seq->seq1->machine : 0, seq->seq2 ? seq->seq2->machine : 0, seq->seq3 ? seq->seq3->machine : 0); - if(chan < MAXSEQ) + if (chan < MAXSEQ) seq->machine= chan; } } - if(RNA_boolean_get(op->ptr, "overlap") == FALSE) { - if(seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene); + if (RNA_boolean_get(op->ptr, "overlap") == FALSE) { + if (seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene); } update_changed_seq_and_deps(scene, seq, 1, 1); /* runs calc_sequence */ @@ -692,19 +790,19 @@ static int sequencer_add_effect_strip_invoke(bContext *C, wmOperator *op, wmEven int type= -1; int prop_flag= SEQPROP_ENDFRAME; - if(!ED_operator_sequencer_active(C)) { + if (!ED_operator_sequencer_active(C)) { BKE_report(op->reports, RPT_ERROR, "Sequencer area not active"); return OPERATOR_CANCELLED; } - if(is_type_set) { + if (is_type_set) { type= RNA_enum_get(op->ptr, "type"); /* when invoking an effect strip which uses inputs, * skip initializing the channel from the mouse. * Instead leave the property unset so exec() initializes it to be * above the strips its applied to. */ - if(get_sequence_effect_num_inputs(type) != 0) { + if (get_sequence_effect_num_inputs(type) != 0) { prop_flag |= SEQPROP_NOCHAN; } } @@ -724,18 +822,18 @@ static int sequencer_add_effect_strip_invoke(bContext *C, wmOperator *op, wmEven void SEQUENCER_OT_effect_strip_add(struct wmOperatorType *ot) { /* identifiers */ - ot->name= "Add Effect Strip"; - ot->idname= "SEQUENCER_OT_effect_strip_add"; - ot->description= "Add an effect to the sequencer, most are applied on top of existing strips"; + ot->name = "Add Effect Strip"; + ot->idname = "SEQUENCER_OT_effect_strip_add"; + ot->description = "Add an effect to the sequencer, most are applied on top of existing strips"; /* api callbacks */ - ot->invoke= sequencer_add_effect_strip_invoke; - ot->exec= sequencer_add_effect_strip_exec; + ot->invoke = sequencer_add_effect_strip_invoke; + ot->exec = sequencer_add_effect_strip_exec; - ot->poll= ED_operator_scene_editable; + ot->poll = ED_operator_scene_editable; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY); sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_ENDFRAME); |