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
This commit is contained in:
Submodule release/scripts/addons updated: a30fce5376...dccf8a462c
@@ -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) &&
|
||||
|
||||
Reference in New Issue
Block a user