Changeset View
Standalone View
source/blender/blenkernel/intern/sequencer.c
| Show First 20 Lines • Show All 5,915 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| Editing *ed = BKE_sequencer_editing_get(scene, false); | Editing *ed = BKE_sequencer_editing_get(scene, false); | ||||
| if (ed == NULL) { | if (ed == NULL) { | ||||
| return; | return; | ||||
| } | } | ||||
| sequencer_all_free_anim_ibufs(&ed->seqbase, cfra); | sequencer_all_free_anim_ibufs(&ed->seqbase, cfra); | ||||
| BKE_sequencer_cache_cleanup(scene); | BKE_sequencer_cache_cleanup(scene); | ||||
| } | } | ||||
| /* Check if used will try to render user. */ | |||||
sergey: Think it's more clear to operate in terms
`Check if "user" (indirectly) uses strip "used"`. | |||||
| bool BKE_sequencer_check_recursivity(Sequence *used, Sequence *user) | |||||
campbellbartonUnsubmitted Done Inline ActionsThis removes the seq_is_parent compared to seq_is_predecessor, as far as I can tell for Python there is nothing stopping the user from assigning a parent/child strip. campbellbarton: This removes the `seq_is_parent` compared to `seq_is_predecessor`, as far as I can tell for… | |||||
ISSAuthorUnsubmitted Done Inline ActionsIt's more or less same function. seq_is_parent, seq_is_predecessor, and BKE_sequencer_check_recursivity all boil down to hierarchy traversing and comparing pointers of used and user. Will add check for assigning from python. ISS: It's more or less same function. `seq_is_parent`, seq_is_predecessor, and… | |||||
Done Inline ActionsNames user/used while correct read a bit odd, not sure of better names though. campbellbarton: Names user/used while correct read a bit odd, not sure of better names though.
Also, I'd expect… | |||||
Not Done Inline ActionsSuggestion: I was looking at other parts of the API and I find this reads better . BKE_object_parent_loop_check(parent, ob). Even though parent/child terminology doesn't quite apply, we could use same naming here. eg: BKE_sequencer_parent_loop_check(seq_parent, seq). campbellbarton: Suggestion: I was looking at other parts of the API and I find this reads better . | |||||
Done Inline ActionsPersonally I would avoid using term parent for this. I think BKE_sequencer_render_loop_check(seq_main, seq) is good compromise. ISS: Personally I would avoid using term parent for this.
I think `BKE_sequencer_render_loop_check… | |||||
| { | |||||
| if (used == user) { | |||||
| return true; | |||||
| } | |||||
| if (used->seq1 && BKE_sequencer_check_recursivity(used->seq1, user) || | |||||
| used->seq2 && BKE_sequencer_check_recursivity(used->seq2, user) || | |||||
| used->seq3 && BKE_sequencer_check_recursivity(used->seq3, user)) { | |||||
| return true; | |||||
| } | |||||
| SequenceModifierData *smd; | |||||
| for (smd = used->modifiers.first; smd; smd = smd->next) { | |||||
| if (smd->mask_sequence && BKE_sequencer_check_recursivity(smd->mask_sequence, user)) { | |||||
| return true; | |||||
| } | |||||
| } | |||||
| return false; | |||||
| } | |||||
Think it's more clear to operate in terms
Check if "user" (indirectly) uses strip "used".