Hopefully fixes T91299, where splitting a NLA track with a repeat property would not properly update the strip's different attributes (notably the repeat property which stayed unchanged) and lead to confusion when changing the repeat property after splitting. This way, the track would go back to its original length and repeat n times from its starting point (more info and steps to reproduce on the task page).
The behaviour of the split operation has been changed to split all repeats of the same NLA strip at the same frame relative to the action clip's frame. It leads to splitting all repeats of the source strip in their own single-repeat strip, and split those strips at the chosen frame within the action clip.
As such, the frame to split the strip at is determined one of two ways :
- if the timeline cursor is not over the strip, take the middle frame (unchanged from previous revision)
- if it is, compute the frame under the cursor relative to the source action clip, not the action strip.
Since the original strip uses a certain action clip within frames [actstart, actend] the split strips will use their 'respective parts' of the action clip, and have a repeat of 1. This allows to repeat only the split part of the strip 'n' times after the split.
The only drawback is it splits all repeats of the strip. I personally prefer it this way, since the source strip is a repeat of a single action clip and as such it made more sense to me to split all repeats at the same point.
Some other solutions would include :
- split all repeats into single strips which use the whole action clip, save for the one under the cursor which would be split in twain at the cursor's position
- but then how do you decide where and which one to split when the cursor is not over the track ?
- split the left-hand part of the strip into a single strip with updated repeat property, and let the rest into a single other strip which starts later in the action clip and then repeats the rest of the way from the original strip
- as far as I know, there's no way for a NLA strip to start at a specific actstart for the first repeat, and repeat at the original actstart for the following repeats.
Ran through clang-format, and introduces no new warnings/errors.
Tested quite thouroughly on my side, with the usual caveat that since I was the developer and the tester, there might have been some glaring ommissions from my testing. So external testing is more than encouraged!