Commit: 54df4699c3d3abfd171a42050dc96e63ebd8be78 Author: Shrey Aggarwal Date: Thu Apr 21 00:44:57 2022 +0200 Branches: draw-deferred-compilation-experiment https://developer.blender.org/rB54df4699c3d3abfd171a42050dc96e63ebd8be78
Fix T70844: Incorrect snappping of strips when effects attached Sometimes, when moving strip with 2 input effect attached and causing strip overlap, this overlap is resolved incorrectly - too big offset is applied. This is because effects are not taken into consideration when "shuffeling" to resolve overlap. To fix usual cases (transitions), overlap between strip and it's effect is considered to be impossible. There are edge cases, but these would be much more complicated to implement and could have negative impact on performance. Reviewed By: ISS Differential Revision: https://developer.blender.org/D14578 =================================================================== M source/blender/sequencer/SEQ_relations.h M source/blender/sequencer/intern/strip_relations.c M source/blender/sequencer/intern/strip_transform.c =================================================================== diff --git a/source/blender/sequencer/SEQ_relations.h b/source/blender/sequencer/SEQ_relations.h index 735b5659ca9..917f549f16d 100644 --- a/source/blender/sequencer/SEQ_relations.h +++ b/source/blender/sequencer/SEQ_relations.h @@ -18,6 +18,10 @@ struct ReportList; struct Scene; struct Sequence; +/** + * Check if one sequence is input to the other. + */ +bool SEQ_relation_is_effect_of_strip(const struct Sequence *effect, const struct Sequence *input); /** * Function to free imbuf and anim data on changes. */ @@ -64,6 +68,7 @@ void SEQ_cache_iterate( struct Sequence *SEQ_find_metastrip_by_sequence(ListBase *seqbase /* = ed->seqbase */, struct Sequence *meta /* = NULL */, struct Sequence *seq); + #ifdef __cplusplus } #endif diff --git a/source/blender/sequencer/intern/strip_relations.c b/source/blender/sequencer/intern/strip_relations.c index a65a331c650..ff6d9481f42 100644 --- a/source/blender/sequencer/intern/strip_relations.c +++ b/source/blender/sequencer/intern/strip_relations.c @@ -34,6 +34,11 @@ #include "image_cache.h" #include "utils.h" +bool SEQ_relation_is_effect_of_strip(const Sequence *effect, const Sequence *input) +{ + return ELEM(input, effect->seq1, effect->seq2); +} + /* check whether sequence cur depends on seq */ static bool seq_relations_check_depend(Sequence *seq, Sequence *cur) { diff --git a/source/blender/sequencer/intern/strip_transform.c b/source/blender/sequencer/intern/strip_transform.c index e614dfa9b82..2c9ab0a3335 100644 --- a/source/blender/sequencer/intern/strip_transform.c +++ b/source/blender/sequencer/intern/strip_transform.c @@ -297,6 +297,9 @@ static int shuffle_seq_time_offset_test(SeqCollection *strips_to_shuffle, if (!SEQ_transform_test_overlap_seq_seq(seq, seq_other)) { continue; } + if (SEQ_relation_is_effect_of_strip(seq_other, seq)) { + continue; + } if (UNLIKELY(SEQ_collection_has_strip(seq_other, strips_to_shuffle))) { CLOG_WARN(&LOG, "Strip overlaps with itself or another strip, that is to be shuffled. " _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs