[Bf-blender-cvs] [8c478bb9151] master: GPencil: Add API property to check annotations

Antonioya noreply at git.blender.org
Thu May 2 10:09:04 CEST 2019


Commit: 8c478bb915128a6ca7945ca7a82ecaedbbc0f3e0
Author: Antonioya
Date:   Thu May 2 10:08:59 2019 +0200
Branches: master
https://developer.blender.org/rB8c478bb915128a6ca7945ca7a82ecaedbbc0f3e0

GPencil: Add API property to check annotations

This new property allows to check if the current datablock is an annotation or is used in a grease pencil object.

This property is required for some Add-ons.

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

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 f87bb69a94f..737dbe36d17 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -1819,6 +1819,11 @@ static void rna_def_gpencil_data(BlenderRNA *brna)
   RNA_def_property_ui_text(prop, "Surface Offset", "Offset amount when drawing in surface mode");
   RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
 
+  prop = RNA_def_property(srna, "is_annotation", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_DATA_ANNOTATIONS);
+  RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+  RNA_def_property_ui_text(prop, "Annotation", "Current datablock is an annotation");
+
   /* Nested Structs */
   prop = RNA_def_property(srna, "grid", PROP_POINTER, PROP_NONE);
   RNA_def_property_flag(prop, PROP_NEVER_NULL);



More information about the Bf-blender-cvs mailing list