diff options
author | Antonio Vazquez <antoniov> | 2019-10-10 09:11:47 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2019-10-10 09:13:32 +0300 |
commit | ea1174bde9edff7639b1b3de4989084987a29f1e (patch) | |
tree | a10a6fd93460bc278f071db5000a3b920fe60518 /source/blender/makesrna | |
parent | 7e020e70d9ce5e970ff12313f5565e13545058bb (diff) |
Annotations: Use flag to determine if the layer is a Ruler
Proposed fix for T70141.
Before, the ruler was using the name of the layer as key, but this is very weak because if the layer name changes, the layer gets an annotation layer.
Now, the layer is marked using a flag and now it's possible to rename it.
Reviewed By: dfelinto
Differential Revision: https://developer.blender.org/D6028
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_gpencil.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index 3ad18fcc7a3..2601600c6ee 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -1457,6 +1457,12 @@ static void rna_def_gpencil_layer(BlenderRNA *brna) prop, "Solo Mode", "In Paint mode display only layers with keyframe in current frame"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); + /* Layer is used as Ruler. */ + prop = RNA_def_property(srna, "is_ruler", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_IS_RULER); + RNA_def_property_ui_text(prop, "Ruler", "This is a special ruler layer"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + /* exposed as layers.active */ # if 0 prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); |