[Bf-blender-cvs] [978052ca4e8] greasepencil-object: GPencil: Add Use Mask to Dopesheet
Antonio Vazquez
noreply at git.blender.org
Wed Nov 27 20:23:22 CET 2019
Commit: 978052ca4e868144ab614643687de57486efd5bb
Author: Antonio Vazquez
Date: Wed Nov 27 20:15:45 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB978052ca4e868144ab614643687de57486efd5bb
GPencil: Add Use Mask to Dopesheet
===================================================================
M source/blender/editors/animation/anim_channels_defines.c
===================================================================
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index bd51e1849cd..9861a4ebc35 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -5062,12 +5062,21 @@ void ANIM_channel_draw_widgets(const bContext *C,
char *gp_rna_path = NULL;
bGPDlayer *gpl = (bGPDlayer *)ale->data;
- const short width = SLIDER_WIDTH / 4;
+ const short width = SLIDER_WIDTH / 5;
/* Create the RNA pointers. */
RNA_pointer_create(ale->id, &RNA_GPencilLayer, ale->data, &ptr);
RNA_id_pointer_create(ale->id, &id_ptr);
+ int icon;
+ /* Mask Layer. */
+ prop = RNA_struct_find_property(&ptr, "mask_layer");
+ gp_rna_path = RNA_path_from_ID_to_property(&ptr, prop);
+ if (RNA_path_resolve_property(&id_ptr, gp_rna_path, &ptr, &prop)) {
+ icon = (gpl->onion_flag & GP_LAYER_USE_MASK) ? ICON_MOD_MASK : ICON_LAYER_ACTIVE;
+ uiDefAutoButR(
+ block, &ptr, prop, array_index, "", icon, offset, ymid, width, channel_height);
+ }
/* Layer opacity. */
prop = RNA_struct_find_property(&ptr, "opacity");
gp_rna_path = RNA_path_from_ID_to_property(&ptr, prop);
@@ -5078,7 +5087,7 @@ void ANIM_channel_draw_widgets(const bContext *C,
array_index,
"",
ICON_NONE,
- offset,
+ offset + width,
ymid,
width * 3,
channel_height);
@@ -5088,15 +5097,14 @@ void ANIM_channel_draw_widgets(const bContext *C,
prop = RNA_struct_find_property(&ptr, "use_onion_skinning");
gp_rna_path = RNA_path_from_ID_to_property(&ptr, prop);
if (RNA_path_resolve_property(&id_ptr, gp_rna_path, &ptr, &prop)) {
- int icon = (gpl->onion_flag & GP_LAYER_ONIONSKIN) ? ICON_ONIONSKIN_ON :
- ICON_ONIONSKIN_OFF;
+ icon = (gpl->onion_flag & GP_LAYER_ONIONSKIN) ? ICON_ONIONSKIN_ON : ICON_ONIONSKIN_OFF;
uiDefAutoButR(block,
&ptr,
prop,
array_index,
"",
icon,
- offset + (width * 3),
+ offset + (width * 4),
ymid,
width,
channel_height);
More information about the Bf-blender-cvs
mailing list