[Bf-blender-cvs] [da5a4a2] GPencil_EditStrokes: Grease Pencil layers in the DopeSheet now show interactive color swatches beside the layer name now
Joshua Leung
noreply at git.blender.org
Wed Oct 15 03:08:06 CEST 2014
Commit: da5a4a2f26e1bd392ef60a4b9790e0c84a995746
Author: Joshua Leung
Date: Wed Oct 15 14:07:27 2014 +1300
Branches: GPencil_EditStrokes
https://developer.blender.org/rBda5a4a2f26e1bd392ef60a4b9790e0c84a995746
Grease Pencil layers in the DopeSheet now show interactive color swatches beside the layer name now
===================================================================
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 7d8e278..8974f5f 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -3407,6 +3407,7 @@ void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float
/* step 4) draw special toggles .................................
* - in Graph Editor, checkboxes for visibility in curves area
* - in NLA Editor, glowing dots for solo/not solo...
+ * - in Grease Pencil mode, color swatches for layer color
*/
if (ac->sl) {
if ((ac->spacetype == SPACE_IPO) && acf->has_setting(ac, ale, ACHANNEL_SETTING_VISIBLE)) {
@@ -3431,6 +3432,10 @@ void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float
/* just skip - drawn as widget now */
offset += ICON_WIDTH;
}
+ else if ((ac->datatype == ANIMCONT_GPENCIL) && (ale->type == ANIMTYPE_GPLAYER)) {
+ /* just skip - drawn as a widget */
+ offset += ICON_WIDTH;
+ }
}
/* step 5) draw name ............................................... */
@@ -3878,6 +3883,7 @@ void ANIM_channel_draw_widgets(bContext *C, bAnimContext *ac, bAnimListElem *ale
/* step 3) draw special toggles .................................
* - in Graph Editor, checkboxes for visibility in curves area
* - in NLA Editor, glowing dots for solo/not solo...
+ * - in Grease Pencil mode, color swatches for layer color
*/
if (ac->sl) {
if ((ac->spacetype == SPACE_IPO) && acf->has_setting(ac, ale, ACHANNEL_SETTING_VISIBLE)) {
@@ -3890,6 +3896,23 @@ void ANIM_channel_draw_widgets(bContext *C, bAnimContext *ac, bAnimListElem *ale
draw_setting_widget(ac, ale, acf, block, offset, ymid, ACHANNEL_SETTING_SOLO);
offset += ICON_WIDTH;
}
+ else if ((ac->datatype == ANIMCONT_GPENCIL) && (ale->type == ANIMTYPE_GPLAYER)) {
+ /* color swatch for layer color */
+ bGPDlayer *gpl = (bGPDlayer *)ale->data;
+ PointerRNA ptr;
+
+ RNA_pointer_create(ale->id, &RNA_GPencilLayer, ale->data, &ptr);
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
+
+ uiDefButR(block, COLOR, 1, "", offset, yminc, ICON_WIDTH, ICON_WIDTH,
+ &ptr, "color", -1,
+ 0, 0, 0, 0, gpl->info);
+
+ uiBlockSetEmboss(block, UI_EMBOSSN);
+
+ offset += ICON_WIDTH;
+ }
}
/* step 4) draw text - check if renaming widget is in use... */
More information about the Bf-blender-cvs
mailing list