[Bf-blender-cvs] [d667105ba96] master: Fix T69210: Crash on Making GPencil Materials zero user

Antonio Vazquez noreply at git.blender.org
Tue Aug 27 15:59:08 CEST 2019


Commit: d667105ba96c777ff8eeefc25e5148d5086087f6
Author: Antonio Vazquez
Date:   Tue Aug 27 15:58:58 2019 +0200
Branches: master
https://developer.blender.org/rBd667105ba96c777ff8eeefc25e5148d5086087f6

Fix T69210: Crash on Making GPencil Materials zero user

The evaluated data must not copy the material if it's NULL.

Still the stroke exists in the file, so maybe need some thinking in how resolve this, but anyway this is a different topic not related to bug.

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

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

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

diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c b/source/blender/blenkernel/intern/gpencil_modifier.c
index daa63515c3d..1750a389788 100644
--- a/source/blender/blenkernel/intern/gpencil_modifier.c
+++ b/source/blender/blenkernel/intern/gpencil_modifier.c
@@ -797,8 +797,10 @@ static void gpencil_frame_copy_noalloc(Object *ob, bGPDframe *gpf, bGPDframe *gp
 
     /* copy color to temp fields to apply temporal changes in the stroke */
     MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps_src->mat_nr + 1);
-    copy_v4_v4(gps_dst->runtime.tmp_stroke_rgba, gp_style->stroke_rgba);
-    copy_v4_v4(gps_dst->runtime.tmp_fill_rgba, gp_style->fill_rgba);
+    if (gp_style) {
+      copy_v4_v4(gps_dst->runtime.tmp_stroke_rgba, gp_style->stroke_rgba);
+      copy_v4_v4(gps_dst->runtime.tmp_fill_rgba, gp_style->fill_rgba);
+    }
 
     /* Save original pointers for using in edit and select operators. */
     gps_dst->runtime.gps_orig = gps_src;



More information about the Bf-blender-cvs mailing list