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.
This commit is contained in:
Antonio Vazquez 2019-05-02 10:08:59 +02:00
parent 2b88ed30cc
commit 8c478bb915
1 changed files with 5 additions and 0 deletions

View File

@ -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);