Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/sequencer.c
| Show All 40 Lines | |||||
| #include "DNA_space_types.h" | #include "DNA_space_types.h" | ||||
| #include "DNA_windowmanager_types.h" | #include "DNA_windowmanager_types.h" | ||||
| #include "BLI_fileops.h" | #include "BLI_fileops.h" | ||||
| #include "BLI_linklist.h" | #include "BLI_linklist.h" | ||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_path_util.h" | #include "BLI_path_util.h" | ||||
| #include "BLI_session_uuid.h" | |||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #include "BLI_string_utf8.h" | #include "BLI_string_utf8.h" | ||||
| #include "BLI_threads.h" | #include "BLI_threads.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #ifdef WIN32 | #ifdef WIN32 | ||||
| # include "BLI_winstuff.h" | # include "BLI_winstuff.h" | ||||
| #else | #else | ||||
| ▲ Show 20 Lines • Show All 5,290 Lines • ▼ Show 20 Lines | Sequence *BKE_sequence_alloc(ListBase *lb, int cfra, int machine, int type) | ||||
| seq->pitch = 1.0f; | seq->pitch = 1.0f; | ||||
| seq->scene_sound = NULL; | seq->scene_sound = NULL; | ||||
| seq->type = type; | seq->type = type; | ||||
| seq->strip = seq_strip_alloc(type); | seq->strip = seq_strip_alloc(type); | ||||
| seq->stereo3d_format = MEM_callocN(sizeof(Stereo3dFormat), "Sequence Stereo Format"); | seq->stereo3d_format = MEM_callocN(sizeof(Stereo3dFormat), "Sequence Stereo Format"); | ||||
| seq->cache_flag = SEQ_CACHE_STORE_RAW | SEQ_CACHE_STORE_PREPROCESSED | SEQ_CACHE_STORE_COMPOSITE; | seq->cache_flag = SEQ_CACHE_STORE_RAW | SEQ_CACHE_STORE_PREPROCESSED | SEQ_CACHE_STORE_COMPOSITE; | ||||
| BKE_sequence_session_uuid_generate(seq); | |||||
| return seq; | return seq; | ||||
| } | } | ||||
| void BKE_sequence_session_uuid_generate(struct Sequence *sequence) | |||||
| { | |||||
| sequence->runtime.session_uuid = BLI_session_uuid_generate(); | |||||
| } | |||||
| void BKE_sequence_alpha_mode_from_extension(Sequence *seq) | void BKE_sequence_alpha_mode_from_extension(Sequence *seq) | ||||
| { | { | ||||
| if (seq->strip && seq->strip->stripdata) { | if (seq->strip && seq->strip->stripdata) { | ||||
| const char *filename = seq->strip->stripdata->name; | const char *filename = seq->strip->stripdata->name; | ||||
| seq->alpha_mode = BKE_image_alpha_mode_from_extension_ex(filename); | seq->alpha_mode = BKE_image_alpha_mode_from_extension_ex(filename); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 293 Lines • ▼ Show 20 Lines | static Sequence *seq_dupli(const Scene *scene_src, | ||||
| Scene *scene_dst, | Scene *scene_dst, | ||||
| ListBase *new_seq_list, | ListBase *new_seq_list, | ||||
| Sequence *seq, | Sequence *seq, | ||||
| int dupe_flag, | int dupe_flag, | ||||
| const int flag) | const int flag) | ||||
| { | { | ||||
| Sequence *seqn = MEM_dupallocN(seq); | Sequence *seqn = MEM_dupallocN(seq); | ||||
| if ((flag & LIB_ID_CREATE_NO_MAIN) == 0) { | |||||
| BKE_sequence_session_uuid_generate(seq); | |||||
| } | |||||
| seq->tmp = seqn; | seq->tmp = seqn; | ||||
| seqn->strip = MEM_dupallocN(seq->strip); | seqn->strip = MEM_dupallocN(seq->strip); | ||||
| seqn->stereo3d_format = MEM_dupallocN(seq->stereo3d_format); | seqn->stereo3d_format = MEM_dupallocN(seq->stereo3d_format); | ||||
| /* XXX: add F-Curve duplication stuff? */ | /* XXX: add F-Curve duplication stuff? */ | ||||
| if (seq->strip->crop) { | if (seq->strip->crop) { | ||||
| ▲ Show 20 Lines • Show All 389 Lines • ▼ Show 20 Lines | bool BKE_sequencer_render_loop_check(Sequence *seq_main, Sequence *seq) | ||||
| for (smd = seq_main->modifiers.first; smd; smd = smd->next) { | for (smd = seq_main->modifiers.first; smd; smd = smd->next) { | ||||
| if (smd->mask_sequence && BKE_sequencer_render_loop_check(smd->mask_sequence, seq)) { | if (smd->mask_sequence && BKE_sequencer_render_loop_check(smd->mask_sequence, seq)) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| void BKE_sequencer_check_uuids_unique_and_report(const Scene *scene) | |||||
| { | |||||
| if (scene->ed == NULL) { | |||||
| return; | |||||
| } | |||||
| struct GSet *used_uuids = BLI_gset_new( | |||||
| BLI_session_uuid_ghash_hash, BLI_session_uuid_ghash_compare, "sequencer used uuids"); | |||||
| const Sequence *sequence; | |||||
| SEQ_BEGIN (scene->ed, sequence) { | |||||
| const SessionUUID *session_uuid = &sequence->runtime.session_uuid; | |||||
| if (!BLI_session_uuid_is_generated(session_uuid)) { | |||||
| printf("Sequence %s does not have UUID generated.\n", sequence->name); | |||||
| continue; | |||||
| } | |||||
| if (BLI_gset_lookup(used_uuids, session_uuid) != NULL) { | |||||
| printf("Sequence %s has duplicate UUID generated.\n", sequence->name); | |||||
| continue; | |||||
| } | |||||
| BLI_gset_insert(used_uuids, (void *)session_uuid); | |||||
| } | |||||
| SEQ_END; | |||||
| BLI_gset_free(used_uuids, NULL); | |||||
| } | |||||