Hi,
I was thinking a bit about this transition desplit problem. What about the following idea and algorithm (sure it’s on very general level)
When transition is created the following object is created:
Transition T
{
clip A with startA, endA, all filters
clip B with startB, endB, all filters
startTransition
endTransition
typeTransition
}
when start, end
are time markers, and they are including transition (so endA>startB
)
Next when we want to de-split transition we use the following algorithm.
- For clip A, we restore it at position
startA, endA
with all filters (that’s simple)
- For clip B (and here it’s more tricky):
2a. we check if ripple is on (for given or all tracks), if yes we do ripple and move all objects after endA
by time (endTransition-startTransition)
(according to rippling rules) and next we put clip B with all filters at position newStartB = endA +1 and newEndB = newStartB + (endB-startB (the values kept in transition object))
; end of procedure
2b. if ripple if off (and here I have the most doubts) I can see few options
first proposal the simplest:
we calculate newStartB
and newEndB
like in point 2a and next we check if between newStartB
and newEndB
points there are any objects on track, if yes we undo transaction and display the message “de-split is not possible, you need more space on track to de-split” (user could do more space on track manually, but still it might be better than working manually according to the algorithm from video), if no objects, then we simply put clip B at newStartB, newEndB
positions with all filters
second option
we calculate newStartB
and newEndB
like in point 2a and next we check if between newStartB and newEndB
points there are any objects on the track
if no, then we just put clip B with newStartB
and newEndB
if yes, then we take start for the first object being on the track, and we set end of clip B as newEndB=this object start point -1
(thus in consequence clip B would be shortened)
third option
would be the most complicated and i would not go into this direction as it would make algorithm quite complicated to be written but also it would be a bit unpredictable from end user perspective so that’s why I mention it only in very simple way - we could analyse all objects being on the track between new
Personally I would select the first option. Firstly because in most cases there will be space for putting the whole clip B. Secondly it’s the most predictable for end user and he can easily make space by moving ex. next clip or clips to another track and then once again de-split automatically.
What do you think about it?