GPencil: Fix unreported datablock type changed using Dopesheet box select

When doing a box selection in the dopesheet in the header area, the data block type was changed to annotation because the pointer was not usable and produced an unexpected result.

Thanks to @pullup for finding a way to reproduce the bug.
This commit is contained in:
Antonio Vazquez
2021-03-18 12:14:05 +01:00
parent 8ab52daa3a
commit d7fb38ddd4

View File

@@ -2689,6 +2689,11 @@ static void box_select_anim_channels(bAnimContext *ac, rcti *rect, short selectm
/* loop over data, doing box select */
for (ale = anim_data.first; ale; ale = ale->next) {
float ymin;
/* Skip grease pencil datablock. Only use grease pencil layers. */
if (ale->type == ANIMTYPE_GPDATABLOCK) {
continue;
}
if (ac->datatype == ANIMCONT_NLA) {
ymin = ymax - NLACHANNEL_STEP(snla);
}