Fix T90989: Annotation opacity must not be animatable

All props of annotations are not animatable by design and opacity must be equal.

As the opacity is reused by gpencil objects, a new prop has been created in order to use different props for annotations and GP objects.
This commit is contained in:
Antonio Vazquez 2021-08-31 14:59:44 +02:00
parent 1be598ba68
commit 84f826ff23
Notes: blender-bot 2023-02-14 11:28:43 +01:00
Referenced by issue #90989, Annotations: Opacity must not be animatable
2 changed files with 9 additions and 1 deletions

View File

@ -454,7 +454,7 @@ class AnnotationDataPanel:
tool_settings = context.tool_settings
if gpd and gpl:
layout.prop(gpl, "opacity", text="Opacity", slider=True)
layout.prop(gpl, "annotation_opacity", text="Opacity", slider=True)
layout.prop(gpl, "thickness")
else:
layout.prop(tool_settings, "annotation_thickness", text="Thickness")

View File

@ -2005,6 +2005,14 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
prop, "Custom Channel Color", "Custom color for animation channel in Dopesheet");
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
/* Layer Opacity (Annotations). */
prop = RNA_def_property(srna, "annotation_opacity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "opacity");
RNA_def_property_range(prop, 0.0, 1.0f);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Opacity", "Annotation Layer Opacity");
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
/* Stroke Drawing Color (Annotations) */
prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);