Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_sequencer_api.c
| Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | |||||
| # include "SEQ_relations.h" | # include "SEQ_relations.h" | ||||
| # include "SEQ_render.h" | # include "SEQ_render.h" | ||||
| # include "SEQ_sequencer.h" | # include "SEQ_sequencer.h" | ||||
| # include "WM_api.h" | # include "WM_api.h" | ||||
| static void rna_Sequence_update_rnafunc(ID *id, Sequence *self, bool do_data) | static void rna_Sequence_update_rnafunc(ID *id, Sequence *self, bool do_data) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | |||||
| Editing *ed = SEQ_editing_get(scene); | |||||
| ListBase *seqbase = SEQ_get_seqbase_by_seq(&ed->seqbase, self); | |||||
| if (do_data) { | if (do_data) { | ||||
| SEQ_relations_update_changed_seq_and_deps((Scene *)id, self, true, true); | SEQ_relations_update_changed_seq_and_deps(scene, self, true, true); | ||||
| // new_tstripdata(self); /* need 2.6x version of this. */ | // new_tstripdata(self); /* need 2.6x version of this. */ | ||||
| } | } | ||||
| SEQ_time_update_sequence((Scene *)id, self); | |||||
| SEQ_time_update_sequence_bounds((Scene *)id, self); | SEQ_time_update_sequence(scene, seqbase, self); | ||||
| } | } | ||||
| static void rna_Sequence_swap_internal(Sequence *seq_self, | static void rna_Sequence_swap_internal(Sequence *seq_self, | ||||
| ReportList *reports, | ReportList *reports, | ||||
| Sequence *seq_other) | Sequence *seq_other) | ||||
| { | { | ||||
| const char *error_msg; | const char *error_msg; | ||||
| ▲ Show 20 Lines • Show All 500 Lines • ▼ Show 20 Lines | 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 = (Scene *)id; | ||||
| Editing *ed = SEQ_editing_get(scene); | |||||
| ListBase *seqbase = SEQ_get_seqbase_by_seq(&ed->seqbase, seq); | |||||
| StripElem *se; | StripElem *se; | ||||
| seq->strip->stripdata = se = MEM_reallocN(seq->strip->stripdata, | seq->strip->stripdata = se = MEM_reallocN(seq->strip->stripdata, | ||||
| sizeof(StripElem) * (seq->len + 1)); | 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++; | ||||
| SEQ_time_update_sequence_bounds(scene, seq); | SEQ_time_update_sequence(scene, seqbase, seq); | ||||
| 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 = (Scene *)id; | ||||
| Editing *ed = SEQ_editing_get(scene); | |||||
| ListBase *seqbase = SEQ_get_seqbase_by_seq(&ed->seqbase, seq); | |||||
| 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 */ | ||||
| Show All 16 Lines | static void rna_SequenceElements_pop(ID *id, Sequence *seq, ReportList *reports, int 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; | ||||
| SEQ_time_update_sequence_bounds(scene, seq); | SEQ_time_update_sequence(scene, seqbase, 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: | ||||
| ▲ Show 20 Lines • Show All 412 Lines • Show Last 20 Lines | |||||