Fix T92046: Mesh to GPencil fails because materials are not created

This bug was introduced in D12190 because the list of types that support materials did not include GPencil and this caused all materials to be removed after they were created during conversion.
This commit is contained in:
Antonio Vazquez 2021-10-08 16:49:28 +02:00
parent ff57ce8617
commit 94d2736dfb
Notes: blender-bot 2023-02-14 00:06:52 +01:00
Referenced by issue #92046, Mesh to Grease pencil conversion makes planes look like wireframe (3.0a regression)
1 changed files with 10 additions and 2 deletions

View File

@ -5772,6 +5772,14 @@ void BKE_object_replace_data_on_shallow_copy(Object *ob, ID *new_data)
bool BKE_object_supports_material_slots(struct Object *ob)
{
return ELEM(
ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL, OB_HAIR, OB_POINTCLOUD, OB_VOLUME);
return ELEM(ob->type,
OB_MESH,
OB_CURVE,
OB_SURF,
OB_FONT,
OB_MBALL,
OB_HAIR,
OB_POINTCLOUD,
OB_VOLUME,
OB_GPENCIL);
}