[Bf-blender-cvs] [34644f520a4] master: UI: Outliner - GP Icon Changes
Harley Acheson
noreply at git.blender.org
Fri Jun 14 18:56:51 CEST 2019
Commit: 34644f520a467d39854d95ecd7af6d41c3a4745e
Author: Harley Acheson
Date: Fri Jun 14 09:55:07 2019 -0700
Branches: master
https://developer.blender.org/rB34644f520a467d39854d95ecd7af6d41c3a4745e
UI: Outliner - GP Icon Changes
Changes all GP layer icons to Pencil and highlights selected layer with background color.
Differential Revision: https://developer.blender.org/D5073
Reviewed by Dalai Felinto
===================================================================
M release/scripts/addons
M source/blender/editors/space_outliner/outliner_draw.c
===================================================================
diff --git a/release/scripts/addons b/release/scripts/addons
index a30fce5376c..dccf8a462cc 160000
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit a30fce5376c5a70cb64cff58298b8a392512ef2d
+Subproject commit dccf8a462ccf10141149dc35416fc27c93abac3a
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 40632eee364..4485475d658 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -2151,17 +2151,8 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te)
data.icon = ICON_GROUP;
break;
}
- /* Removed the icons from outliner.
- * Need a better structure with Layers, Palettes and Colors. */
case TSE_GP_LAYER: {
- /* indicate whether layer is active */
- bGPDlayer *gpl = te->directdata;
- if (gpl->flag & GP_LAYER_ACTIVE) {
- data.icon = ICON_GREASEPENCIL;
- }
- else {
- data.icon = ICON_DOT;
- }
+ data.icon = ICON_GREASEPENCIL;
break;
}
default:
@@ -2641,12 +2632,16 @@ static void outliner_draw_iconrow(bContext *C,
active = tree_element_active(C, scene, view_layer, soops, te, OL_SETSEL_NONE, false);
}
}
+ else if (tselem->type == TSE_GP_LAYER) {
+ bGPDlayer *gpl = te->directdata;
+ active = (gpl->flag & GP_LAYER_ACTIVE) ? OL_DRAWSEL_ACTIVE : OL_DRAWSEL_NONE;
+ }
else {
active = tree_element_type_active(
C, scene, view_layer, soops, te, tselem, OL_SETSEL_NONE, false);
}
- if (!ELEM(tselem->type, 0, TSE_LAYER_COLLECTION, TSE_R_LAYER)) {
+ if (!ELEM(tselem->type, 0, TSE_LAYER_COLLECTION, TSE_R_LAYER, TSE_GP_LAYER)) {
outliner_draw_iconrow_doit(block, te, fstyle, xmax, offsx, ys, alpha_fac, active, 1);
}
else {
@@ -2808,12 +2803,20 @@ static void outliner_draw_tree_element(bContext *C,
}
}
}
- else {
- active = tree_element_type_active(
- C, scene, view_layer, soops, te, tselem, OL_SETSEL_NONE, false);
- /* active collection*/
- icon_bgcolor[3] = 0.2f;
+ else if (tselem->type == TSE_GP_LAYER) {
+ /* Active grease pencil layer. */
+ if (((bGPDlayer *)te->directdata)->flag & GP_LAYER_ACTIVE) {
+ icon_bgcolor[3] = 0.2f;
+ active = OL_DRAWSEL_ACTIVE;
+ }
}
+ else
+ {
+ active = tree_element_type_active(
+ C, scene, view_layer, soops, te, tselem, OL_SETSEL_NONE, false);
+ /* active collection*/
+ icon_bgcolor[3] = 0.2f;
+ }
/* Checkbox to enable collections. */
if ((tselem->type == TSE_LAYER_COLLECTION) &&
More information about the Bf-blender-cvs
mailing list