From e51fff61c54f6d0b9bc81801adeb10cbf97b271d Mon Sep 17 00:00:00 2001 From: Pratik Borhade Date: Tue, 25 Feb 2025 09:44:21 +0100 Subject: [PATCH] Grease Pencil: Channel color for groups `channel_color` property was created for layers in 03b2fc744e. Now exposed for layer groups too. Pull Request: https://projects.blender.org/blender/blender/pulls/135088 --- .../bl_ui/properties_data_grease_pencil.py | 23 +++++++++++++++++++ .../animation/anim_channels_defines.cc | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/scripts/startup/bl_ui/properties_data_grease_pencil.py b/scripts/startup/bl_ui/properties_data_grease_pencil.py index 55a95d57311..a698f660e3c 100644 --- a/scripts/startup/bl_ui/properties_data_grease_pencil.py +++ b/scripts/startup/bl_ui/properties_data_grease_pencil.py @@ -334,6 +334,28 @@ class DATA_PT_grease_pencil_layer_display(LayerDataButtonsPanel, GreasePencil_La bl_options = {'DEFAULT_CLOSED'} +class DATA_PT_grease_pencil_layer_group_display(Panel): + bl_label = "Display" + bl_space_type = 'PROPERTIES' + bl_region_type = 'WINDOW' + bl_context = "data" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + grease_pencil = context.grease_pencil + return grease_pencil and grease_pencil.layer_groups.active + + def draw(self, context): + layout = self.layout + layout.use_property_split = True + + grease_pencil = context.grease_pencil + group = grease_pencil.layer_groups.active + + layout.prop(group, "channel_color", text="Channel Color") + + class DATA_PT_grease_pencil_onion_skinning(DataButtonsPanel, Panel): bl_label = "Onion Skinning" @@ -494,6 +516,7 @@ classes = ( DATA_PT_grease_pencil_layer_adjustments, DATA_PT_grease_pencil_layer_relations, DATA_PT_grease_pencil_layer_display, + DATA_PT_grease_pencil_layer_group_display, DATA_PT_grease_pencil_onion_skinning, DATA_PT_grease_pencil_onion_skinning_custom_colors, DATA_PT_grease_pencil_onion_skinning_display, diff --git a/source/blender/editors/animation/anim_channels_defines.cc b/source/blender/editors/animation/anim_channels_defines.cc index bc9d5e063fe..ecac71c9a8f 100644 --- a/source/blender/editors/animation/anim_channels_defines.cc +++ b/source/blender/editors/animation/anim_channels_defines.cc @@ -4055,7 +4055,7 @@ static bAnimChannelType ACF_GPLGROUP = { /*channel_role*/ ACHANNEL_ROLE_EXPANDER, /*get_backdrop_color*/ greasepencil::layer_group_color, - /*get_channel_color*/ nullptr, + /*get_channel_color*/ greasepencil::layer_channel_color, /*draw_backdrop*/ acf_group_backdrop, /*get_indent_level*/ acf_generic_indentation_0, /*get_offset*/ greasepencil::layer_offset,