Fix: GPv3: Crash on loading file with layer parents
The issue was that the `grease_pencil_foreach_id` did not walk the parent object pointers which meant they were pointing to garbage memory. The fix makes sure to walk all the parent pointers.
This commit is contained in:
@@ -178,6 +178,11 @@ static void grease_pencil_foreach_id(ID *id, LibraryForeachIDData *data)
|
||||
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, drawing_reference->id_reference, IDWALK_CB_USER);
|
||||
}
|
||||
}
|
||||
for (const blender::bke::greasepencil::Layer *layer : grease_pencil->layers()) {
|
||||
if (layer->parent) {
|
||||
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, layer->parent, IDWALK_CB_USER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void grease_pencil_blend_write(BlendWriter *writer, ID *id, const void *id_address)
|
||||
|
||||
Reference in New Issue
Block a user