[Bf-blender-cvs] [94d2736dfb3] master: Fix T92046: Mesh to GPencil fails because materials are not created

Antonio Vazquez noreply at git.blender.org
Fri Oct 8 16:49:49 CEST 2021


Commit: 94d2736dfb33c20a49781eec00168f174ff8b767
Author: Antonio Vazquez
Date:   Fri Oct 8 16:49:28 2021 +0200
Branches: master
https://developer.blender.org/rB94d2736dfb33c20a49781eec00168f174ff8b767

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.

===================================================================

M	source/blender/blenkernel/intern/object.c

===================================================================

diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 274f0394618..e3bb384ffcc 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -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);
 }



More information about the Bf-blender-cvs mailing list