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:
committed by
Falk David
parent
791f90ab8d
commit
301b2ae183
@@ -2212,8 +2212,10 @@ static size_t animdata_filter_grease_pencil_data(bAnimContext *ac,
|
|||||||
*/
|
*/
|
||||||
if (filter_mode & ANIMFILTER_ANIMDATA) {
|
if (filter_mode & ANIMFILTER_ANIMDATA) {
|
||||||
/* Just add data block container. */
|
/* Just add data block container. */
|
||||||
ANIMCHANNEL_NEW_CHANNEL(
|
if (grease_pencil->adt != nullptr) {
|
||||||
ac->bmain, grease_pencil, ANIMTYPE_GREASE_PENCIL_DATABLOCK, grease_pencil, nullptr);
|
ANIMCHANNEL_NEW_CHANNEL(
|
||||||
|
ac->bmain, grease_pencil, ANIMTYPE_GREASE_PENCIL_DATABLOCK, grease_pencil, nullptr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ListBase tmp_data = {nullptr, nullptr};
|
ListBase tmp_data = {nullptr, nullptr};
|
||||||
|
|||||||
Reference in New Issue
Block a user