[Bf-blender-cvs] [3a8f543b61c] master: Fix T65190: GPencil stroke not correctly initializated using python API

Antonioya noreply at git.blender.org
Mon May 27 19:30:48 CEST 2019


Commit: 3a8f543b61c0b1bc589556699726058185c28b18
Author: Antonioya
Date:   Mon May 27 19:30:27 2019 +0200
Branches: master
https://developer.blender.org/rB3a8f543b61c0b1bc589556699726058185c28b18

Fix T65190: GPencil stroke not correctly initializated using python API

The value of new gradient fields was wrong.

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

M	source/blender/makesrna/intern/rna_gpencil.c

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

diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index cf6d85adc62..a78eebd2618 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -652,6 +652,8 @@ static void rna_GPencil_stroke_point_pop(ID *id,
 static bGPDstroke *rna_GPencil_stroke_new(bGPDframe *frame)
 {
   bGPDstroke *stroke = MEM_callocN(sizeof(bGPDstroke), "gp_stroke");
+  stroke->gradient_f = 1.0f;
+  ARRAY_SET_ITEMS(stroke->gradient_s, 1.0f, 1.0f);
   BLI_addtail(&frame->strokes, stroke);
 
   return stroke;



More information about the Bf-blender-cvs mailing list