Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_sequencer_api.cc
- This file was moved from source/blender/makesrna/intern/rna_sequencer_api.c.
| Show All 16 Lines | |||||
| #include "RNA_define.h" | #include "RNA_define.h" | ||||
| #include "SEQ_edit.h" | #include "SEQ_edit.h" | ||||
| #include "rna_internal.h" | #include "rna_internal.h" | ||||
| #ifdef RNA_RUNTIME | #ifdef RNA_RUNTIME | ||||
| //#include "DNA_anim_types.h" | // #include "DNA_anim_types.h" | ||||
| # include "DNA_image_types.h" | # include "DNA_image_types.h" | ||||
| # include "DNA_mask_types.h" | # include "DNA_mask_types.h" | ||||
| # include "DNA_sound_types.h" | # include "DNA_sound_types.h" | ||||
| # include "BLI_path_util.h" /* BLI_split_dirfile */ | # include "BLI_path_util.h" /* BLI_split_dirfile */ | ||||
| # include "BKE_image.h" | # include "BKE_image.h" | ||||
| # include "BKE_mask.h" | # include "BKE_mask.h" | ||||
| Show All 12 Lines | |||||
| # include "SEQ_render.h" | # include "SEQ_render.h" | ||||
| # include "SEQ_sequencer.h" | # include "SEQ_sequencer.h" | ||||
| # include "SEQ_time.h" | # include "SEQ_time.h" | ||||
| # include "WM_api.h" | # include "WM_api.h" | ||||
| static StripElem *rna_Sequence_strip_elem_from_frame(ID *id, Sequence *self, int timeline_frame) | static StripElem *rna_Sequence_strip_elem_from_frame(ID *id, Sequence *self, int timeline_frame) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | Scene *scene = reinterpret_cast<Scene *>(id); | ||||
| return SEQ_render_give_stripelem(scene, self, timeline_frame); | return SEQ_render_give_stripelem(scene, self, timeline_frame); | ||||
| } | } | ||||
| static void rna_Sequence_swap_internal(ID *id, | static void rna_Sequence_swap_internal(ID *id, | ||||
| Sequence *seq_self, | Sequence *seq_self, | ||||
| ReportList *reports, | ReportList *reports, | ||||
| Sequence *seq_other) | Sequence *seq_other) | ||||
| { | { | ||||
| const char *error_msg; | const char *error_msg; | ||||
| Scene *scene = (Scene *)id; | Scene *scene = reinterpret_cast<Scene *>(id); | ||||
| if (SEQ_edit_sequence_swap(scene, seq_self, seq_other, &error_msg) == false) { | if (SEQ_edit_sequence_swap(scene, seq_self, seq_other, &error_msg) == false) { | ||||
| BKE_report(reports, RPT_ERROR, error_msg); | BKE_report(reports, RPT_ERROR, error_msg); | ||||
| } | } | ||||
| } | } | ||||
| static void rna_Sequences_move_strip_to_meta( | static void rna_Sequences_move_strip_to_meta( | ||||
| ID *id, Sequence *seq_self, Main *bmain, ReportList *reports, Sequence *meta_dst) | ID *id, Sequence *seq_self, Main *bmain, ReportList *reports, Sequence *meta_dst) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | Scene *scene = reinterpret_cast<Scene *>(id); | ||||
| const char *error_msg; | const char *error_msg; | ||||
| /* Move strip to meta. */ | /* Move strip to meta. */ | ||||
| if (!SEQ_edit_move_strip_to_meta(scene, seq_self, meta_dst, &error_msg)) { | if (!SEQ_edit_move_strip_to_meta(scene, seq_self, meta_dst, &error_msg)) { | ||||
| BKE_report(reports, RPT_ERROR, error_msg); | BKE_report(reports, RPT_ERROR, error_msg); | ||||
| } | } | ||||
| /* Update depsgraph. */ | /* Update depsgraph. */ | ||||
| DEG_relations_tag_update(bmain); | DEG_relations_tag_update(bmain); | ||||
| DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); | DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); | ||||
| WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); | WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); | ||||
| } | } | ||||
| static Sequence *rna_Sequence_split( | static Sequence *rna_Sequence_split( | ||||
| ID *id, Sequence *seq, Main *bmain, ReportList *reports, int frame, int split_method) | ID *id, Sequence *seq, Main *bmain, ReportList *reports, int frame, int split_method) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | Scene *scene = reinterpret_cast<Scene *>(id); | ||||
| ListBase *seqbase = SEQ_get_seqbase_by_seq(scene, seq); | ListBase *seqbase = SEQ_get_seqbase_by_seq(scene, seq); | ||||
| const char *error_msg = NULL; | const char *error_msg = NULL; | ||||
| Sequence *r_seq = SEQ_edit_strip_split( | Sequence *r_seq = SEQ_edit_strip_split( | ||||
| bmain, scene, seqbase, seq, frame, split_method, &error_msg); | bmain, scene, seqbase, seq, frame, (eSeqSplitMethod)split_method, &error_msg); | ||||
| if (error_msg != NULL) { | if (error_msg != NULL) { | ||||
| BKE_report(reports, RPT_ERROR, error_msg); | BKE_report(reports, RPT_ERROR, error_msg); | ||||
| } | } | ||||
| /* Update depsgraph. */ | /* Update depsgraph. */ | ||||
| DEG_relations_tag_update(bmain); | DEG_relations_tag_update(bmain); | ||||
| DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); | DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); | ||||
| WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); | WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); | ||||
| return r_seq; | return r_seq; | ||||
| } | } | ||||
| static Sequence *rna_Sequence_parent_meta(ID *id, Sequence *seq_self) | static Sequence *rna_Sequence_parent_meta(ID *id, Sequence *seq_self) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | Scene *scene = reinterpret_cast<Scene *>(id); | ||||
| Editing *ed = SEQ_editing_get(scene); | Editing *ed = SEQ_editing_get(scene); | ||||
| return SEQ_find_metastrip_by_sequence(&ed->seqbase, NULL, seq_self); | return SEQ_find_metastrip_by_sequence(&ed->seqbase, NULL, seq_self); | ||||
| } | } | ||||
| static Sequence *rna_Sequences_new_clip(ID *id, | static Sequence *rna_Sequences_new_clip(ID *id, | ||||
| ListBase *seqbase, | ListBase *seqbase, | ||||
| Main *bmain, | Main *bmain, | ||||
| const char *name, | const char *name, | ||||
| MovieClip *clip, | MovieClip *clip, | ||||
| int channel, | int channel, | ||||
| int frame_start) | int frame_start) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | Scene *scene = reinterpret_cast<Scene *>(id); | ||||
| SeqLoadData load_data; | SeqLoadData load_data; | ||||
| SEQ_add_load_data_init(&load_data, name, NULL, frame_start, channel); | SEQ_add_load_data_init(&load_data, name, NULL, frame_start, channel); | ||||
| load_data.clip = clip; | load_data.clip = clip; | ||||
| Sequence *seq = SEQ_add_movieclip_strip(scene, seqbase, &load_data); | Sequence *seq = SEQ_add_movieclip_strip(scene, seqbase, &load_data); | ||||
| DEG_relations_tag_update(bmain); | DEG_relations_tag_update(bmain); | ||||
| DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); | DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); | ||||
| WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); | WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); | ||||
| Show All 26 Lines | |||||
| static Sequence *rna_Sequences_new_mask(ID *id, | static Sequence *rna_Sequences_new_mask(ID *id, | ||||
| ListBase *seqbase, | ListBase *seqbase, | ||||
| Main *bmain, | Main *bmain, | ||||
| const char *name, | const char *name, | ||||
| Mask *mask, | Mask *mask, | ||||
| int channel, | int channel, | ||||
| int frame_start) | int frame_start) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | Scene *scene = reinterpret_cast<Scene *>(id); | ||||
| SeqLoadData load_data; | SeqLoadData load_data; | ||||
| SEQ_add_load_data_init(&load_data, name, NULL, frame_start, channel); | SEQ_add_load_data_init(&load_data, name, NULL, frame_start, channel); | ||||
| load_data.mask = mask; | load_data.mask = mask; | ||||
| Sequence *seq = SEQ_add_mask_strip(scene, seqbase, &load_data); | Sequence *seq = SEQ_add_mask_strip(scene, seqbase, &load_data); | ||||
| DEG_relations_tag_update(bmain); | DEG_relations_tag_update(bmain); | ||||
| DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); | DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); | ||||
| WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); | WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); | ||||
| Show All 15 Lines | |||||
| static Sequence *rna_Sequences_new_scene(ID *id, | static Sequence *rna_Sequences_new_scene(ID *id, | ||||
| ListBase *seqbase, | ListBase *seqbase, | ||||
| Main *bmain, | Main *bmain, | ||||
| const char *name, | const char *name, | ||||
| Scene *sce_seq, | Scene *sce_seq, | ||||
| int channel, | int channel, | ||||
| int frame_start) | int frame_start) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | Scene *scene = reinterpret_cast<Scene *>(id); | ||||
| SeqLoadData load_data; | SeqLoadData load_data; | ||||
| SEQ_add_load_data_init(&load_data, name, NULL, frame_start, channel); | SEQ_add_load_data_init(&load_data, name, NULL, frame_start, channel); | ||||
| load_data.scene = sce_seq; | load_data.scene = sce_seq; | ||||
| Sequence *seq = SEQ_add_scene_strip(scene, seqbase, &load_data); | Sequence *seq = SEQ_add_scene_strip(scene, seqbase, &load_data); | ||||
| DEG_relations_tag_update(bmain); | DEG_relations_tag_update(bmain); | ||||
| DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); | DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); | ||||
| WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); | WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); | ||||
| Show All 28 Lines | static Sequence *rna_Sequences_new_image(ID *id, | ||||
| Main *bmain, | Main *bmain, | ||||
| ReportList *UNUSED(reports), | ReportList *UNUSED(reports), | ||||
| const char *name, | const char *name, | ||||
| const char *file, | const char *file, | ||||
| int channel, | int channel, | ||||
| int frame_start, | int frame_start, | ||||
| int fit_method) | int fit_method) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | Scene *scene = reinterpret_cast<Scene *>(id); | ||||
| SeqLoadData load_data; | SeqLoadData load_data; | ||||
| SEQ_add_load_data_init(&load_data, name, file, frame_start, channel); | SEQ_add_load_data_init(&load_data, name, file, frame_start, channel); | ||||
| load_data.image.len = 1; | load_data.image.len = 1; | ||||
| load_data.fit_method = fit_method; | load_data.fit_method = eSeqImageFitMethod(fit_method); | ||||
campbellbarton: Can use function style cast `eSeqImageFitMethod(fit_method)` | |||||
| Sequence *seq = SEQ_add_image_strip(bmain, scene, seqbase, &load_data); | Sequence *seq = SEQ_add_image_strip(bmain, scene, seqbase, &load_data); | ||||
| char dir[FILE_MAX], filename[FILE_MAX]; | char dir[FILE_MAX], filename[FILE_MAX]; | ||||
| BLI_split_dirfile(file, dir, filename, sizeof(dir), sizeof(filename)); | BLI_split_dirfile(file, dir, filename, sizeof(dir), sizeof(filename)); | ||||
| SEQ_add_image_set_directory(seq, dir); | SEQ_add_image_set_directory(seq, dir); | ||||
| SEQ_add_image_load_file(scene, seq, 0, filename); | SEQ_add_image_load_file(scene, seq, 0, filename); | ||||
| SEQ_add_image_init_alpha_mode(seq); | SEQ_add_image_init_alpha_mode(seq); | ||||
| Show All 36 Lines | static Sequence *rna_Sequences_new_movie(ID *id, | ||||
| ListBase *seqbase, | ListBase *seqbase, | ||||
| Main *bmain, | Main *bmain, | ||||
| const char *name, | const char *name, | ||||
| const char *file, | const char *file, | ||||
| int channel, | int channel, | ||||
| int frame_start, | int frame_start, | ||||
| int fit_method) | int fit_method) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | Scene *scene = reinterpret_cast<Scene *>(id); | ||||
| SeqLoadData load_data; | SeqLoadData load_data; | ||||
| SEQ_add_load_data_init(&load_data, name, file, frame_start, channel); | SEQ_add_load_data_init(&load_data, name, file, frame_start, channel); | ||||
| load_data.fit_method = fit_method; | load_data.fit_method = (eSeqImageFitMethod)fit_method; | ||||
| load_data.allow_invalid_file = true; | load_data.allow_invalid_file = true; | ||||
| Sequence *seq = SEQ_add_movie_strip(bmain, scene, seqbase, &load_data); | Sequence *seq = SEQ_add_movie_strip(bmain, scene, seqbase, &load_data); | ||||
| DEG_relations_tag_update(bmain); | DEG_relations_tag_update(bmain); | ||||
| DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); | DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); | ||||
| WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); | WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); | ||||
| return seq; | return seq; | ||||
| Show All 30 Lines | static Sequence *rna_Sequences_new_sound(ID *id, | ||||
| ListBase *seqbase, | ListBase *seqbase, | ||||
| Main *bmain, | Main *bmain, | ||||
| ReportList *reports, | ReportList *reports, | ||||
| const char *name, | const char *name, | ||||
| const char *file, | const char *file, | ||||
| int channel, | int channel, | ||||
| int frame_start) | int frame_start) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | Scene *scene = reinterpret_cast<Scene *>(id); | ||||
| SeqLoadData load_data; | SeqLoadData load_data; | ||||
| SEQ_add_load_data_init(&load_data, name, file, frame_start, channel); | SEQ_add_load_data_init(&load_data, name, file, frame_start, channel); | ||||
| load_data.allow_invalid_file = true; | load_data.allow_invalid_file = true; | ||||
| Sequence *seq = SEQ_add_sound_strip(bmain, scene, seqbase, &load_data); | Sequence *seq = SEQ_add_sound_strip(bmain, scene, seqbase, &load_data); | ||||
| if (seq == NULL) { | if (seq == NULL) { | ||||
| BKE_report(reports, RPT_ERROR, "Sequences.new_sound: unable to open sound file"); | BKE_report(reports, RPT_ERROR, "Sequences.new_sound: unable to open sound file"); | ||||
| return NULL; | return NULL; | ||||
| ▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /* Meta sequence | /* Meta sequence | ||||
| * Possibility to create an empty meta to avoid plenty of meta toggling | * Possibility to create an empty meta to avoid plenty of meta toggling | ||||
| * Created meta have a length equal to 1, must be set through the API. */ | * Created meta have a length equal to 1, must be set through the API. */ | ||||
| static Sequence *rna_Sequences_new_meta( | static Sequence *rna_Sequences_new_meta( | ||||
| ID *id, ListBase *seqbase, const char *name, int channel, int frame_start) | ID *id, ListBase *seqbase, const char *name, int channel, int frame_start) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | Scene *scene = reinterpret_cast<Scene *>(id); | ||||
| SeqLoadData load_data; | SeqLoadData load_data; | ||||
| SEQ_add_load_data_init(&load_data, name, NULL, frame_start, channel); | SEQ_add_load_data_init(&load_data, name, NULL, frame_start, channel); | ||||
| Sequence *seqm = SEQ_add_meta_strip(scene, seqbase, &load_data); | Sequence *seqm = SEQ_add_meta_strip(scene, seqbase, &load_data); | ||||
| return seqm; | return seqm; | ||||
| } | } | ||||
| static Sequence *rna_Sequences_editing_new_meta( | static Sequence *rna_Sequences_editing_new_meta( | ||||
| Show All 15 Lines | static Sequence *rna_Sequences_new_effect(ID *id, | ||||
| int type, | int type, | ||||
| int channel, | int channel, | ||||
| int frame_start, | int frame_start, | ||||
| int frame_end, | int frame_end, | ||||
| Sequence *seq1, | Sequence *seq1, | ||||
| Sequence *seq2, | Sequence *seq2, | ||||
| Sequence *seq3) | Sequence *seq3) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | Scene *scene = reinterpret_cast<Scene *>(id); | ||||
| Sequence *seq; | Sequence *seq; | ||||
| const int num_inputs = SEQ_effect_get_num_inputs(type); | const int num_inputs = SEQ_effect_get_num_inputs(type); | ||||
| switch (num_inputs) { | switch (num_inputs) { | ||||
| case 0: | case 0: | ||||
| if (frame_end <= frame_start) { | if (frame_end <= frame_start) { | ||||
| BKE_report(reports, RPT_ERROR, "Sequences.new_effect: end frame not set"); | BKE_report(reports, RPT_ERROR, "Sequences.new_effect: end frame not set"); | ||||
| return NULL; | return NULL; | ||||
| ▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| return rna_Sequences_new_effect( | return rna_Sequences_new_effect( | ||||
| id, &seq->seqbase, reports, name, type, channel, frame_start, frame_end, seq1, seq2, seq3); | id, &seq->seqbase, reports, name, type, channel, frame_start, frame_end, seq1, seq2, seq3); | ||||
| } | } | ||||
| static void rna_Sequences_remove( | static void rna_Sequences_remove( | ||||
| ID *id, ListBase *seqbase, Main *bmain, ReportList *reports, PointerRNA *seq_ptr) | ID *id, ListBase *seqbase, Main *bmain, ReportList *reports, PointerRNA *seq_ptr) | ||||
| { | { | ||||
| Sequence *seq = seq_ptr->data; | Sequence *seq = static_cast<Sequence *>(seq_ptr->data); | ||||
| Scene *scene = (Scene *)id; | Scene *scene = reinterpret_cast<Scene *>(id); | ||||
| if (BLI_findindex(seqbase, seq) == -1) { | if (BLI_findindex(seqbase, seq) == -1) { | ||||
| BKE_reportf( | BKE_reportf( | ||||
| reports, RPT_ERROR, "Sequence '%s' not in scene '%s'", seq->name + 2, scene->id.name + 2); | reports, RPT_ERROR, "Sequence '%s' not in scene '%s'", seq->name + 2, scene->id.name + 2); | ||||
| return; | return; | ||||
| } | } | ||||
| SEQ_edit_flag_for_removal(scene, seqbase, seq); | SEQ_edit_flag_for_removal(scene, seqbase, seq); | ||||
| Show All 14 Lines | |||||
| static void rna_Sequences_meta_remove( | static void rna_Sequences_meta_remove( | ||||
| ID *id, Sequence *seq, Main *bmain, ReportList *reports, PointerRNA *seq_ptr) | ID *id, Sequence *seq, Main *bmain, ReportList *reports, PointerRNA *seq_ptr) | ||||
| { | { | ||||
| rna_Sequences_remove(id, &seq->seqbase, bmain, reports, seq_ptr); | rna_Sequences_remove(id, &seq->seqbase, bmain, reports, seq_ptr); | ||||
| } | } | ||||
| static StripElem *rna_SequenceElements_append(ID *id, Sequence *seq, const char *filename) | static StripElem *rna_SequenceElements_append(ID *id, Sequence *seq, const char *filename) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | Scene *scene = reinterpret_cast<Scene *>(id); | ||||
| StripElem *se; | StripElem *se; | ||||
| seq->strip->stripdata = se = MEM_reallocN(seq->strip->stripdata, | seq->strip->stripdata = se = static_cast<StripElem *>( | ||||
| sizeof(StripElem) * (seq->len + 1)); | MEM_reallocN(seq->strip->stripdata, sizeof(StripElem) * (seq->len + 1))); | ||||
| se += seq->len; | se += seq->len; | ||||
| BLI_strncpy(se->name, filename, sizeof(se->name)); | BLI_strncpy(se->name, filename, sizeof(se->name)); | ||||
| seq->len++; | seq->len++; | ||||
| WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); | WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); | ||||
| return se; | return se; | ||||
| } | } | ||||
| static void rna_SequenceElements_pop(ID *id, Sequence *seq, ReportList *reports, int index) | static void rna_SequenceElements_pop(ID *id, Sequence *seq, ReportList *reports, int index) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | Scene *scene = reinterpret_cast<Scene *>(id); | ||||
| StripElem *new_seq, *se; | StripElem *new_seq, *se; | ||||
| if (seq->len == 1) { | if (seq->len == 1) { | ||||
| BKE_report(reports, RPT_ERROR, "SequenceElements.pop: cannot pop the last element"); | BKE_report(reports, RPT_ERROR, "SequenceElements.pop: cannot pop the last element"); | ||||
| return; | return; | ||||
| } | } | ||||
| /* python style negative indexing */ | /* python style negative indexing */ | ||||
| if (index < 0) { | if (index < 0) { | ||||
| index += seq->len; | index += seq->len; | ||||
| } | } | ||||
| if (seq->len <= index || index < 0) { | if (seq->len <= index || index < 0) { | ||||
| BKE_report(reports, RPT_ERROR, "SequenceElements.pop: index out of range"); | BKE_report(reports, RPT_ERROR, "SequenceElements.pop: index out of range"); | ||||
| return; | return; | ||||
| } | } | ||||
| new_seq = MEM_callocN(sizeof(StripElem) * (seq->len - 1), "SequenceElements_pop"); | new_seq = static_cast<StripElem *>( | ||||
| MEM_callocN(sizeof(StripElem) * (seq->len - 1), "SequenceElements_pop")); | |||||
| seq->len--; | seq->len--; | ||||
| se = seq->strip->stripdata; | se = seq->strip->stripdata; | ||||
| if (index > 0) { | if (index > 0) { | ||||
| memcpy(new_seq, se, sizeof(StripElem) * index); | memcpy(new_seq, se, sizeof(StripElem) * index); | ||||
| } | } | ||||
| if (index < seq->len) { | if (index < seq->len) { | ||||
| memcpy(&new_seq[index], &se[index + 1], sizeof(StripElem) * (seq->len - index)); | memcpy(&new_seq[index], &se[index + 1], sizeof(StripElem) * (seq->len - index)); | ||||
| } | } | ||||
| MEM_freeN(seq->strip->stripdata); | MEM_freeN(seq->strip->stripdata); | ||||
| seq->strip->stripdata = new_seq; | seq->strip->stripdata = new_seq; | ||||
| WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); | WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); | ||||
| } | } | ||||
| static void rna_Sequence_invalidate_cache_rnafunc(ID *id, Sequence *self, int type) | static void rna_Sequence_invalidate_cache_rnafunc(ID *id, Sequence *self, int type) | ||||
| { | { | ||||
| switch (type) { | switch (type) { | ||||
| case SEQ_CACHE_STORE_RAW: | case SEQ_CACHE_STORE_RAW: | ||||
| SEQ_relations_invalidate_cache_raw((Scene *)id, self); | SEQ_relations_invalidate_cache_raw(reinterpret_cast<Scene *>(id), self); | ||||
| break; | break; | ||||
| case SEQ_CACHE_STORE_PREPROCESSED: | case SEQ_CACHE_STORE_PREPROCESSED: | ||||
| SEQ_relations_invalidate_cache_preprocessed((Scene *)id, self); | SEQ_relations_invalidate_cache_preprocessed(reinterpret_cast<Scene *>(id), self); | ||||
| break; | break; | ||||
| case SEQ_CACHE_STORE_COMPOSITE: | case SEQ_CACHE_STORE_COMPOSITE: | ||||
| SEQ_relations_invalidate_cache_composite((Scene *)id, self); | SEQ_relations_invalidate_cache_composite(reinterpret_cast<Scene *>(id), self); | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| #else | #else | ||||
| void RNA_api_sequence_strip(StructRNA *srna) | void RNA_api_sequence_strip(StructRNA *srna) | ||||
| { | { | ||||
| Show All 20 Lines | parm = RNA_def_int(func, | ||||
| "frame", | "frame", | ||||
| 0, | 0, | ||||
| -MAXFRAME, | -MAXFRAME, | ||||
| MAXFRAME, | MAXFRAME, | ||||
| "Frame", | "Frame", | ||||
| "The frame to get the strip element from", | "The frame to get the strip element from", | ||||
| -MAXFRAME, | -MAXFRAME, | ||||
| MAXFRAME); | MAXFRAME); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| RNA_def_function_return( | RNA_def_function_return( | ||||
| func, | func, | ||||
| RNA_def_pointer(func, "elem", "SequenceElement", "", "strip element of the current frame")); | RNA_def_pointer(func, "elem", "SequenceElement", "", "strip element of the current frame")); | ||||
| func = RNA_def_function(srna, "swap", "rna_Sequence_swap_internal"); | func = RNA_def_function(srna, "swap", "rna_Sequence_swap_internal"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID); | RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| parm = RNA_def_pointer(func, "other", "Sequence", "Other", ""); | parm = RNA_def_pointer(func, "other", "Sequence", "Other", ""); | ||||
| Show All 22 Lines | void RNA_api_sequence_strip(StructRNA *srna) | ||||
| parm = RNA_def_enum(func, "type", seq_cahce_type_items, 0, "Type", "Cache Type"); | parm = RNA_def_enum(func, "type", seq_cahce_type_items, 0, "Type", "Cache Type"); | ||||
| RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| func = RNA_def_function(srna, "split", "rna_Sequence_split"); | func = RNA_def_function(srna, "split", "rna_Sequence_split"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID | FUNC_USE_MAIN); | RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID | FUNC_USE_MAIN); | ||||
| RNA_def_function_ui_description(func, "Split Sequence"); | RNA_def_function_ui_description(func, "Split Sequence"); | ||||
| parm = RNA_def_int( | parm = RNA_def_int( | ||||
| func, "frame", 0, INT_MIN, INT_MAX, "", "Frame where to split the strip", INT_MIN, INT_MAX); | func, "frame", 0, INT_MIN, INT_MAX, "", "Frame where to split the strip", INT_MIN, INT_MAX); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| parm = RNA_def_enum(func, "split_method", seq_split_method_items, 0, "", ""); | parm = RNA_def_enum(func, "split_method", seq_split_method_items, 0, "", ""); | ||||
| RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| /* Return type. */ | /* Return type. */ | ||||
| parm = RNA_def_pointer(func, "sequence", "Sequence", "", "Right side Sequence"); | parm = RNA_def_pointer(func, "sequence", "Sequence", "", "Right side Sequence"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| } | } | ||||
| void RNA_api_sequence_elements(BlenderRNA *brna, PropertyRNA *cprop) | void RNA_api_sequence_elements(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *parm; | PropertyRNA *parm; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| RNA_def_property_srna(cprop, "SequenceElements"); | RNA_def_property_srna(cprop, "SequenceElements"); | ||||
| srna = RNA_def_struct(brna, "SequenceElements", NULL); | srna = RNA_def_struct(brna, "SequenceElements", NULL); | ||||
| RNA_def_struct_sdna(srna, "Sequence"); | RNA_def_struct_sdna(srna, "Sequence"); | ||||
| RNA_def_struct_ui_text(srna, "SequenceElements", "Collection of SequenceElement"); | RNA_def_struct_ui_text(srna, "SequenceElements", "Collection of SequenceElement"); | ||||
| func = RNA_def_function(srna, "append", "rna_SequenceElements_append"); | func = RNA_def_function(srna, "append", "rna_SequenceElements_append"); | ||||
| RNA_def_function_flag(func, FUNC_USE_SELF_ID); | RNA_def_function_flag(func, FUNC_USE_SELF_ID); | ||||
| RNA_def_function_ui_description(func, "Push an image from ImageSequence.directory"); | RNA_def_function_ui_description(func, "Push an image from ImageSequence.directory"); | ||||
| parm = RNA_def_string(func, "filename", "File", 0, "", "Filepath to image"); | parm = RNA_def_string(func, "filename", "File", 0, "", "Filepath to image"); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| /* return type */ | /* return type */ | ||||
| parm = RNA_def_pointer(func, "elem", "SequenceElement", "", "New SequenceElement"); | parm = RNA_def_pointer(func, "elem", "SequenceElement", "", "New SequenceElement"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "pop", "rna_SequenceElements_pop"); | func = RNA_def_function(srna, "pop", "rna_SequenceElements_pop"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID); | RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID); | ||||
| RNA_def_function_ui_description(func, "Pop an image off the collection"); | RNA_def_function_ui_description(func, "Pop an image off the collection"); | ||||
| parm = RNA_def_int( | parm = RNA_def_int( | ||||
| func, "index", -1, INT_MIN, INT_MAX, "", "Index of image to remove", INT_MIN, INT_MAX); | func, "index", -1, INT_MIN, INT_MAX, "", "Index of image to remove", INT_MIN, INT_MAX); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| } | } | ||||
| void RNA_api_sequences(BlenderRNA *brna, PropertyRNA *cprop, const bool metastrip) | void RNA_api_sequences(BlenderRNA *brna, PropertyRNA *cprop, const bool metastrip) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *parm; | PropertyRNA *parm; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| ▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | void RNA_api_sequences(BlenderRNA *brna, PropertyRNA *cprop, const bool metastrip) | ||||
| } | } | ||||
| RNA_def_struct_ui_text(srna, "Sequences", "Collection of Sequences"); | RNA_def_struct_ui_text(srna, "Sequences", "Collection of Sequences"); | ||||
| func = RNA_def_function(srna, "new_clip", new_clip_func_name); | func = RNA_def_function(srna, "new_clip", new_clip_func_name); | ||||
| RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN); | RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN); | ||||
| RNA_def_function_ui_description(func, "Add a new movie clip sequence"); | RNA_def_function_ui_description(func, "Add a new movie clip sequence"); | ||||
| parm = RNA_def_string(func, "name", "Name", 0, "", "Name for the new sequence"); | parm = RNA_def_string(func, "name", "Name", 0, "", "Name for the new sequence"); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| parm = RNA_def_pointer(func, "clip", "MovieClip", "", "Movie clip to add"); | parm = RNA_def_pointer(func, "clip", "MovieClip", "", "Movie clip to add"); | ||||
| RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| parm = RNA_def_int( | parm = RNA_def_int( | ||||
| func, "channel", 0, 1, MAXSEQ, "Channel", "The channel for the new sequence", 1, MAXSEQ); | func, "channel", 0, 1, MAXSEQ, "Channel", "The channel for the new sequence", 1, MAXSEQ); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| parm = RNA_def_int(func, | parm = RNA_def_int(func, | ||||
| "frame_start", | "frame_start", | ||||
| 0, | 0, | ||||
| -MAXFRAME, | -MAXFRAME, | ||||
| MAXFRAME, | MAXFRAME, | ||||
| "", | "", | ||||
| "The start frame for the new sequence", | "The start frame for the new sequence", | ||||
| -MAXFRAME, | -MAXFRAME, | ||||
| MAXFRAME); | MAXFRAME); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| /* return type */ | /* return type */ | ||||
| parm = RNA_def_pointer(func, "sequence", "Sequence", "", "New Sequence"); | parm = RNA_def_pointer(func, "sequence", "Sequence", "", "New Sequence"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "new_mask", new_mask_func_name); | func = RNA_def_function(srna, "new_mask", new_mask_func_name); | ||||
| RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN); | RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN); | ||||
| RNA_def_function_ui_description(func, "Add a new mask sequence"); | RNA_def_function_ui_description(func, "Add a new mask sequence"); | ||||
| parm = RNA_def_string(func, "name", "Name", 0, "", "Name for the new sequence"); | parm = RNA_def_string(func, "name", "Name", 0, "", "Name for the new sequence"); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| parm = RNA_def_pointer(func, "mask", "Mask", "", "Mask to add"); | parm = RNA_def_pointer(func, "mask", "Mask", "", "Mask to add"); | ||||
| RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| parm = RNA_def_int( | parm = RNA_def_int( | ||||
| func, "channel", 0, 1, MAXSEQ, "Channel", "The channel for the new sequence", 1, MAXSEQ); | func, "channel", 0, 1, MAXSEQ, "Channel", "The channel for the new sequence", 1, MAXSEQ); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| parm = RNA_def_int(func, | parm = RNA_def_int(func, | ||||
| "frame_start", | "frame_start", | ||||
| 0, | 0, | ||||
| -MAXFRAME, | -MAXFRAME, | ||||
| MAXFRAME, | MAXFRAME, | ||||
| "", | "", | ||||
| "The start frame for the new sequence", | "The start frame for the new sequence", | ||||
| -MAXFRAME, | -MAXFRAME, | ||||
| MAXFRAME); | MAXFRAME); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| /* return type */ | /* return type */ | ||||
| parm = RNA_def_pointer(func, "sequence", "Sequence", "", "New Sequence"); | parm = RNA_def_pointer(func, "sequence", "Sequence", "", "New Sequence"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "new_scene", new_scene_func_name); | func = RNA_def_function(srna, "new_scene", new_scene_func_name); | ||||
| RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN); | RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN); | ||||
| RNA_def_function_ui_description(func, "Add a new scene sequence"); | RNA_def_function_ui_description(func, "Add a new scene sequence"); | ||||
| parm = RNA_def_string(func, "name", "Name", 0, "", "Name for the new sequence"); | parm = RNA_def_string(func, "name", "Name", 0, "", "Name for the new sequence"); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene to add"); | parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene to add"); | ||||
| RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| parm = RNA_def_int( | parm = RNA_def_int( | ||||
| func, "channel", 0, 1, MAXSEQ, "Channel", "The channel for the new sequence", 1, MAXSEQ); | func, "channel", 0, 1, MAXSEQ, "Channel", "The channel for the new sequence", 1, MAXSEQ); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| parm = RNA_def_int(func, | parm = RNA_def_int(func, | ||||
| "frame_start", | "frame_start", | ||||
| 0, | 0, | ||||
| -MAXFRAME, | -MAXFRAME, | ||||
| MAXFRAME, | MAXFRAME, | ||||
| "", | "", | ||||
| "The start frame for the new sequence", | "The start frame for the new sequence", | ||||
| -MAXFRAME, | -MAXFRAME, | ||||
| MAXFRAME); | MAXFRAME); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| /* return type */ | /* return type */ | ||||
| parm = RNA_def_pointer(func, "sequence", "Sequence", "", "New Sequence"); | parm = RNA_def_pointer(func, "sequence", "Sequence", "", "New Sequence"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "new_image", new_image_func_name); | func = RNA_def_function(srna, "new_image", new_image_func_name); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID | FUNC_USE_MAIN); | RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID | FUNC_USE_MAIN); | ||||
| RNA_def_function_ui_description(func, "Add a new image sequence"); | RNA_def_function_ui_description(func, "Add a new image sequence"); | ||||
| parm = RNA_def_string(func, "name", "Name", 0, "", "Name for the new sequence"); | parm = RNA_def_string(func, "name", "Name", 0, "", "Name for the new sequence"); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| parm = RNA_def_string(func, "filepath", "File", 0, "", "Filepath to image"); | parm = RNA_def_string(func, "filepath", "File", 0, "", "Filepath to image"); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| parm = RNA_def_int( | parm = RNA_def_int( | ||||
| func, "channel", 0, 1, MAXSEQ, "Channel", "The channel for the new sequence", 1, MAXSEQ); | func, "channel", 0, 1, MAXSEQ, "Channel", "The channel for the new sequence", 1, MAXSEQ); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| parm = RNA_def_int(func, | parm = RNA_def_int(func, | ||||
| "frame_start", | "frame_start", | ||||
| 0, | 0, | ||||
| -MAXFRAME, | -MAXFRAME, | ||||
| MAXFRAME, | MAXFRAME, | ||||
| "", | "", | ||||
| "The start frame for the new sequence", | "The start frame for the new sequence", | ||||
| -MAXFRAME, | -MAXFRAME, | ||||
| MAXFRAME); | MAXFRAME); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| parm = RNA_def_enum( | parm = RNA_def_enum( | ||||
| func, "fit_method", scale_fit_methods, SEQ_USE_ORIGINAL_SIZE, "Image Fit Method", NULL); | func, "fit_method", scale_fit_methods, SEQ_USE_ORIGINAL_SIZE, "Image Fit Method", NULL); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_PYFUNC_OPTIONAL); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_PYFUNC_OPTIONAL); | ||||
| /* return type */ | /* return type */ | ||||
| parm = RNA_def_pointer(func, "sequence", "Sequence", "", "New Sequence"); | parm = RNA_def_pointer(func, "sequence", "Sequence", "", "New Sequence"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "new_movie", new_movie_func_name); | func = RNA_def_function(srna, "new_movie", new_movie_func_name); | ||||
| RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN); | RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN); | ||||
| RNA_def_function_ui_description(func, "Add a new movie sequence"); | RNA_def_function_ui_description(func, "Add a new movie sequence"); | ||||
| parm = RNA_def_string(func, "name", "Name", 0, "", "Name for the new sequence"); | parm = RNA_def_string(func, "name", "Name", 0, "", "Name for the new sequence"); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| parm = RNA_def_string(func, "filepath", "File", 0, "", "Filepath to movie"); | parm = RNA_def_string(func, "filepath", "File", 0, "", "Filepath to movie"); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| parm = RNA_def_int( | parm = RNA_def_int( | ||||
| func, "channel", 0, 1, MAXSEQ, "Channel", "The channel for the new sequence", 1, MAXSEQ); | func, "channel", 0, 1, MAXSEQ, "Channel", "The channel for the new sequence", 1, MAXSEQ); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| parm = RNA_def_int(func, | parm = RNA_def_int(func, | ||||
| "frame_start", | "frame_start", | ||||
| 0, | 0, | ||||
| -MAXFRAME, | -MAXFRAME, | ||||
| MAXFRAME, | MAXFRAME, | ||||
| "", | "", | ||||
| "The start frame for the new sequence", | "The start frame for the new sequence", | ||||
| -MAXFRAME, | -MAXFRAME, | ||||
| MAXFRAME); | MAXFRAME); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| parm = RNA_def_enum( | parm = RNA_def_enum( | ||||
| func, "fit_method", scale_fit_methods, SEQ_USE_ORIGINAL_SIZE, "Image Fit Method", NULL); | func, "fit_method", scale_fit_methods, SEQ_USE_ORIGINAL_SIZE, "Image Fit Method", NULL); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_PYFUNC_OPTIONAL); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_PYFUNC_OPTIONAL); | ||||
| /* return type */ | /* return type */ | ||||
| parm = RNA_def_pointer(func, "sequence", "Sequence", "", "New Sequence"); | parm = RNA_def_pointer(func, "sequence", "Sequence", "", "New Sequence"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "new_sound", new_sound_func_name); | func = RNA_def_function(srna, "new_sound", new_sound_func_name); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID | FUNC_USE_MAIN); | RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID | FUNC_USE_MAIN); | ||||
| RNA_def_function_ui_description(func, "Add a new sound sequence"); | RNA_def_function_ui_description(func, "Add a new sound sequence"); | ||||
| parm = RNA_def_string(func, "name", "Name", 0, "", "Name for the new sequence"); | parm = RNA_def_string(func, "name", "Name", 0, "", "Name for the new sequence"); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| parm = RNA_def_string(func, "filepath", "File", 0, "", "Filepath to movie"); | parm = RNA_def_string(func, "filepath", "File", 0, "", "Filepath to movie"); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| parm = RNA_def_int( | parm = RNA_def_int( | ||||
| func, "channel", 0, 1, MAXSEQ, "Channel", "The channel for the new sequence", 1, MAXSEQ); | func, "channel", 0, 1, MAXSEQ, "Channel", "The channel for the new sequence", 1, MAXSEQ); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| parm = RNA_def_int(func, | parm = RNA_def_int(func, | ||||
| "frame_start", | "frame_start", | ||||
| 0, | 0, | ||||
| -MAXFRAME, | -MAXFRAME, | ||||
| MAXFRAME, | MAXFRAME, | ||||
| "", | "", | ||||
| "The start frame for the new sequence", | "The start frame for the new sequence", | ||||
| -MAXFRAME, | -MAXFRAME, | ||||
| MAXFRAME); | MAXFRAME); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| /* return type */ | /* return type */ | ||||
| parm = RNA_def_pointer(func, "sequence", "Sequence", "", "New Sequence"); | parm = RNA_def_pointer(func, "sequence", "Sequence", "", "New Sequence"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "new_meta", new_meta_func_name); | func = RNA_def_function(srna, "new_meta", new_meta_func_name); | ||||
| RNA_def_function_flag(func, FUNC_USE_SELF_ID); | RNA_def_function_flag(func, FUNC_USE_SELF_ID); | ||||
| RNA_def_function_ui_description(func, "Add a new meta sequence"); | RNA_def_function_ui_description(func, "Add a new meta sequence"); | ||||
| parm = RNA_def_string(func, "name", "Name", 0, "", "Name for the new sequence"); | parm = RNA_def_string(func, "name", "Name", 0, "", "Name for the new sequence"); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| parm = RNA_def_int( | parm = RNA_def_int( | ||||
| func, "channel", 0, 1, MAXSEQ, "Channel", "The channel for the new sequence", 1, MAXSEQ); | func, "channel", 0, 1, MAXSEQ, "Channel", "The channel for the new sequence", 1, MAXSEQ); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| parm = RNA_def_int(func, | parm = RNA_def_int(func, | ||||
| "frame_start", | "frame_start", | ||||
| 0, | 0, | ||||
| -MAXFRAME, | -MAXFRAME, | ||||
| MAXFRAME, | MAXFRAME, | ||||
| "", | "", | ||||
| "The start frame for the new sequence", | "The start frame for the new sequence", | ||||
| -MAXFRAME, | -MAXFRAME, | ||||
| MAXFRAME); | MAXFRAME); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| /* return type */ | /* return type */ | ||||
| parm = RNA_def_pointer(func, "sequence", "Sequence", "", "New Sequence"); | parm = RNA_def_pointer(func, "sequence", "Sequence", "", "New Sequence"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "new_effect", new_effect_func_name); | func = RNA_def_function(srna, "new_effect", new_effect_func_name); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID); | RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID); | ||||
| RNA_def_function_ui_description(func, "Add a new effect sequence"); | RNA_def_function_ui_description(func, "Add a new effect sequence"); | ||||
| parm = RNA_def_string(func, "name", "Name", 0, "", "Name for the new sequence"); | parm = RNA_def_string(func, "name", "Name", 0, "", "Name for the new sequence"); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| parm = RNA_def_enum(func, "type", seq_effect_items, 0, "Type", "type for the new sequence"); | parm = RNA_def_enum(func, "type", seq_effect_items, 0, "Type", "type for the new sequence"); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| parm = RNA_def_int( | parm = RNA_def_int( | ||||
| func, "channel", 0, 1, MAXSEQ, "Channel", "The channel for the new sequence", 1, MAXSEQ); | func, "channel", 0, 1, MAXSEQ, "Channel", "The channel for the new sequence", 1, MAXSEQ); | ||||
| /* don't use MAXFRAME since it makes importer scripts fail */ | /* don't use MAXFRAME since it makes importer scripts fail */ | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| parm = RNA_def_int(func, | parm = RNA_def_int(func, | ||||
| "frame_start", | "frame_start", | ||||
| 0, | 0, | ||||
| INT_MIN, | INT_MIN, | ||||
| INT_MAX, | INT_MAX, | ||||
| "", | "", | ||||
| "The start frame for the new sequence", | "The start frame for the new sequence", | ||||
| INT_MIN, | INT_MIN, | ||||
| INT_MAX); | INT_MAX); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); | ||||
| RNA_def_int(func, | RNA_def_int(func, | ||||
| "frame_end", | "frame_end", | ||||
| 0, | 0, | ||||
| INT_MIN, | INT_MIN, | ||||
| INT_MAX, | INT_MAX, | ||||
| "", | "", | ||||
| "The end frame for the new sequence", | "The end frame for the new sequence", | ||||
| INT_MIN, | INT_MIN, | ||||
| INT_MAX); | INT_MAX); | ||||
| RNA_def_pointer(func, "seq1", "Sequence", "", "Sequence 1 for effect"); | RNA_def_pointer(func, "seq1", "Sequence", "", "Sequence 1 for effect"); | ||||
| RNA_def_pointer(func, "seq2", "Sequence", "", "Sequence 2 for effect"); | RNA_def_pointer(func, "seq2", "Sequence", "", "Sequence 2 for effect"); | ||||
| RNA_def_pointer(func, "seq3", "Sequence", "", "Sequence 3 for effect"); | RNA_def_pointer(func, "seq3", "Sequence", "", "Sequence 3 for effect"); | ||||
| /* return type */ | /* return type */ | ||||
| parm = RNA_def_pointer(func, "sequence", "Sequence", "", "New Sequence"); | parm = RNA_def_pointer(func, "sequence", "Sequence", "", "New Sequence"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "remove", remove_func_name); | func = RNA_def_function(srna, "remove", remove_func_name); | ||||
| RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_REPORTS | FUNC_USE_MAIN); | RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_REPORTS | FUNC_USE_MAIN); | ||||
| RNA_def_function_ui_description(func, "Remove a Sequence"); | RNA_def_function_ui_description(func, "Remove a Sequence"); | ||||
| parm = RNA_def_pointer(func, "sequence", "Sequence", "", "Sequence to remove"); | parm = RNA_def_pointer(func, "sequence", "Sequence", "", "Sequence to remove"); | ||||
| RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, ParameterFlag(PARM_REQUIRED | PARM_RNAPTR)); | ||||
| RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); | RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, ParameterFlag(0)); | ||||
| } | } | ||||
| #endif | #endif | ||||
Can use function style cast eSeqImageFitMethod(fit_method)