[Bf-blender-cvs] [84f826ff231] master: Fix T90989: Annotation opacity must not be animatable
Antonio Vazquez
noreply at git.blender.org
Tue Aug 31 15:00:04 CEST 2021
Commit: 84f826ff2316de610a6545b27071b0fd6e67e16d
Author: Antonio Vazquez
Date: Tue Aug 31 14:59:44 2021 +0200
Branches: master
https://developer.blender.org/rB84f826ff2316de610a6545b27071b0fd6e67e16d
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.
===================================================================
M release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M source/blender/makesrna/intern/rna_gpencil.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index 8de6925c051..f87f5351d6d 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -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")
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 3e5dce64c7b..f06c8a5325c 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -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);
More information about the Bf-blender-cvs
mailing list