[Bf-blender-cvs] [d06d1937efe] blender2.8: GP: Check weight data before using it

Antonioya noreply at git.blender.org
Wed Sep 26 13:12:57 CEST 2018


Commit: d06d1937efe107491aea30e9fcbb6f5fd6a5ca0b
Author: Antonioya
Date:   Wed Sep 26 13:12:49 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBd06d1937efe107491aea30e9fcbb6f5fd6a5ca0b

GP: Check weight data before using it

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

M	source/blender/gpencil_modifiers/intern/MOD_gpencilinstance.c

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

diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilinstance.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilinstance.c
index 613c46803b9..3f4183e5b7a 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilinstance.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilinstance.c
@@ -168,9 +168,10 @@ static void generate_geometry(
 						/* Duplicate stroke */
 						bGPDstroke *gps_dst = MEM_dupallocN(gps);
 						gps_dst->points = MEM_dupallocN(gps->points);
-						gps_dst->dvert = MEM_dupallocN(gps->dvert);
-						BKE_gpencil_stroke_weights_duplicate(gps, gps_dst);
-
+						if (gps->dvert) {
+							gps_dst->dvert = MEM_dupallocN(gps->dvert);
+							BKE_gpencil_stroke_weights_duplicate(gps, gps_dst);
+						}
 						gps_dst->triangles = MEM_dupallocN(gps->triangles);
 
 						/* Move points */



More information about the Bf-blender-cvs mailing list