Changeset View
Changeset View
Standalone View
Standalone View
source/blender/sequencer/intern/sequencer.c
| Show First 20 Lines • Show All 996 Lines • ▼ Show 20 Lines | static bool seq_blend_read_expand(Sequence *seq, void *user_data) | ||||
| return true; | return true; | ||||
| } | } | ||||
| void SEQ_blend_read_expand(BlendExpander *expander, ListBase *seqbase) | void SEQ_blend_read_expand(BlendExpander *expander, ListBase *seqbase) | ||||
| { | { | ||||
| SEQ_for_each_callback(seqbase, seq_blend_read_expand, expander); | SEQ_for_each_callback(seqbase, seq_blend_read_expand, expander); | ||||
| } | } | ||||
| /** | |||||
| * Make sure Blender never tries to read or write more channels than it can handle. | |||||
| * | |||||
| * This is a sanity check to allow us to bump the channels limit in the future without | |||||
| * risking breaking old versions of Blender that can't handle more channels than what | |||||
| * we can guarantee. | |||||
| */ | |||||
| static bool seq_blend_sanitize_channels_cb(Sequence *seq, void *UNUSED(user_data)) | |||||
| { | |||||
| /* Sanity check, never writes more data than the .blend supports. */ | |||||
| if (seq->machine > MAXSEQ) { | |||||
| if (seq->prev) { | |||||
| seq->prev->next = seq->next; | |||||
| } | |||||
| if (seq->next) { | |||||
| seq->next->prev = seq->prev; | |||||
| } | |||||
ISS: Now thinking about this, this is not bulletproof too, because strip above threshold can have… | |||||
| /* Since this is a sanity check, we don't need to worry about freeing the memory. | |||||
| * That actually increases the likehood of more information being available. */ | |||||
| } | |||||
| /* Keep the for looping going regardless of whether the channel was valid. */ | |||||
| return true; | |||||
| } | |||||
Not Done Inline ActionsI don't quite understand this part, if you want to skip metas while iterating then you can use LISTBASE_FOREACH? It is not quite evident why changing strip type is harmless, and even why you don't check inside metas - there can be strips with large channel number. I guess metas have own writer? ISS: I don't quite understand this part, if you want to skip metas while iterating then you can use… | |||||
| void SEQ_blend_sanitize_channels(struct ListBase *seqbase) | |||||
| { | |||||
| SEQ_for_each_callback(seqbase, seq_blend_sanitize_channels_cb, NULL); | |||||
| } | |||||
| /* Depsgraph update functions. */ | /* Depsgraph update functions. */ | ||||
| static bool seq_disable_sound_strips_cb(Sequence *seq, void *user_data) | static bool seq_disable_sound_strips_cb(Sequence *seq, void *user_data) | ||||
| { | { | ||||
| Scene *scene = (Scene *)user_data; | Scene *scene = (Scene *)user_data; | ||||
| if (seq->scene_sound != NULL) { | if (seq->scene_sound != NULL) { | ||||
| BKE_sound_remove_scene_sound(scene, seq->scene_sound); | BKE_sound_remove_scene_sound(scene, seq->scene_sound); | ||||
| seq->scene_sound = NULL; | seq->scene_sound = NULL; | ||||
| ▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines | |||||
Now thinking about this, this is not bulletproof too, because strip above threshold can have effects under itself and it can be used as mask for other strip. Best is to use SEQ_edit_flag_for_removal and SEQ_edit_remove_flagged_sequences which will handle all relationships.