Bugfix #24621: NLA strips move insensitively across tracks
This was a 2-part bug: 1) "Track index" (i.e. "index of NLA track within NLA Stack") was calculated incorrectly when the transform data is created. A typo meant that this was actually "index of strip within original track" 2) Strips were flying around madly vertically (especially for downward movements, and with extreme difficulty for upwards) as the track index was being updated incorrectly. I suspect at the time I was misreading it as trackIndex = ... vs trackIndex += ..., though it obviously looked wrong looking at it now!
This commit is contained in:
@@ -2662,6 +2662,7 @@ static void createTransNlaData(bContext *C, TransInfo *t)
|
||||
for (ale= anim_data.first; ale; ale= ale->next) {
|
||||
/* only if a real NLA-track */
|
||||
if (ale->type == ANIMTYPE_NLATRACK) {
|
||||
AnimData *adt = ale->adt;
|
||||
NlaTrack *nlt= (NlaTrack *)ale->data;
|
||||
NlaStrip *strip;
|
||||
|
||||
@@ -2686,7 +2687,7 @@ static void createTransNlaData(bContext *C, TransInfo *t)
|
||||
tdn->id= ale->id;
|
||||
tdn->oldTrack= tdn->nlt= nlt;
|
||||
tdn->strip= strip;
|
||||
tdn->trackIndex= BLI_findindex(&nlt->strips, strip);
|
||||
tdn->trackIndex= BLI_findindex(&adt->nla_tracks, nlt);
|
||||
|
||||
yval= (float)(tdn->trackIndex * NLACHANNEL_STEP);
|
||||
|
||||
|
@@ -582,7 +582,7 @@ void recalcData(TransInfo *t)
|
||||
BKE_nlatrack_add_strip(track, strip);
|
||||
|
||||
tdn->nlt= track;
|
||||
tdn->trackIndex += (n + 1); /* + 1, since n==0 would mean that we didn't change track */
|
||||
tdn->trackIndex++;
|
||||
}
|
||||
else /* can't move any further */
|
||||
break;
|
||||
@@ -600,7 +600,7 @@ void recalcData(TransInfo *t)
|
||||
BKE_nlatrack_add_strip(track, strip);
|
||||
|
||||
tdn->nlt= track;
|
||||
tdn->trackIndex -= (n - 1); /* - 1, since n==0 would mean that we didn't change track */
|
||||
tdn->trackIndex--;
|
||||
}
|
||||
else /* can't move any further */
|
||||
break;
|
||||
|
Reference in New Issue
Block a user