[Bf-blender-cvs] [c60c721b5d3] greasepencil-edit-curve: GPencil: New prop to determine if a stroke is using Curve Edit mode

Antonio Vazquez noreply at git.blender.org
Sat Jun 6 12:29:45 CEST 2020


Commit: c60c721b5d3be32d0d21c11399fdc287826ea371
Author: Antonio Vazquez
Date:   Sat Jun 6 12:26:47 2020 +0200
Branches: greasepencil-edit-curve
https://developer.blender.org/rBc60c721b5d3be32d0d21c11399fdc287826ea371

GPencil: New prop to determine if a stroke is using Curve Edit mode

This flag will be used to determine if the selection must be done for points to generate handles or the handles are already visibles.

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

M	source/blender/makesdna/DNA_gpencil_types.h
M	source/blender/makesrna/intern/rna_gpencil.c

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

diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index 209ac9976a2..b86d8a50bfd 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -295,6 +295,8 @@ typedef enum eGPDstroke_Flag {
   GP_STROKE_TAG = (1 << 14),
   /* only for use with stroke-buffer (while drawing eraser) */
   GP_STROKE_ERASER = (1 << 15),
+  /* Stroke is actually using curve edition */
+  GP_STROKE_CURVE_MODE = (1 << 16),
 } eGPDstroke_Flag;
 
 /* bGPDstroke->caps */
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 66ac64725b0..8959d2913a4 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -1311,6 +1311,12 @@ static void rna_def_gpencil_stroke(BlenderRNA *brna)
   RNA_def_property_ui_text(prop, "Cyclic", "Enable cyclic drawing, closing the stroke");
   RNA_def_property_update(prop, 0, "rna_GPencil_update");
 
+  /* The stroke is actually using Curve Edit mode. */
+  prop = RNA_def_property(srna, "use_curve_edit", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_STROKE_CURVE_MODE);
+  RNA_def_property_ui_text(prop, "Curve Edit", "Stroke is using a Curve to edit shape");
+  RNA_def_property_update(prop, 0, "rna_GPencil_update");
+
   /* Caps mode */
   prop = RNA_def_property(srna, "start_cap_mode", PROP_ENUM, PROP_NONE);
   RNA_def_property_enum_sdna(prop, NULL, "caps[0]");



More information about the Bf-blender-cvs mailing list