Fix #128831: GPv3: Crash when adding action track
When grease pencil has no actions (ale->adt), id data block channel is still added due to `ANIMFILTER_ANIMDATA`. This would lead to crash if operator is accessing the AnimData (ale->adt). To fix this, make sure adt exists before creating an animchannel. Pull Request: https://projects.blender.org/blender/blender/pulls/128841
This commit is contained in:
@@ -2212,8 +2212,10 @@ static size_t animdata_filter_grease_pencil_data(bAnimContext *ac,
|
||||
*/
|
||||
if (filter_mode & ANIMFILTER_ANIMDATA) {
|
||||
/* Just add data block container. */
|
||||
ANIMCHANNEL_NEW_CHANNEL(
|
||||
ac->bmain, grease_pencil, ANIMTYPE_GREASE_PENCIL_DATABLOCK, grease_pencil, nullptr);
|
||||
if (grease_pencil->adt != nullptr) {
|
||||
ANIMCHANNEL_NEW_CHANNEL(
|
||||
ac->bmain, grease_pencil, ANIMTYPE_GREASE_PENCIL_DATABLOCK, grease_pencil, nullptr);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ListBase tmp_data = {nullptr, nullptr};
|
||||
|
||||
Reference in New Issue
Block a user