diff options
author | Joshua Leung <aligorith@gmail.com> | 2015-02-18 03:01:29 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2015-02-18 04:49:42 +0300 |
commit | fda119866d8055529bf22683779911242cb6b37e (patch) | |
tree | 8fa690dc88a5a598028792ee0ba5fa021c97552a /source/blender/editors | |
parent | c7c711bb726b32ded12a921baffda3b434d44ddb (diff) |
GPencil: RMB menu tools in Outliner works for GP Layers now
It would be even better if these used their own dedicated menu which could include
the protect values too, but this one at least works now
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tools.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index d6c3a851801..64e00589712 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -33,6 +33,7 @@ #include "DNA_anim_types.h" #include "DNA_armature_types.h" +#include "DNA_gpencil_types.h" #include "DNA_group_types.h" #include "DNA_lamp_types.h" #include "DNA_linestyle_types.h" @@ -585,6 +586,20 @@ static void sequence_cb(int event, TreeElement *te, TreeStoreElem *tselem, void (void)tselem; } +static void gp_layer_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem), void *UNUSED(arg)) +{ + bGPDlayer *gpl = (bGPDlayer *)te->directdata; + + if (event == OL_DOP_SELECT) + gpl->flag |= GP_LAYER_SELECT; + else if (event == OL_DOP_DESELECT) + gpl->flag &= ~GP_LAYER_SELECT; + else if (event == OL_DOP_HIDE) + gpl->flag |= GP_LAYER_HIDE; + else if (event == OL_DOP_UNHIDE) + gpl->flag &= ~GP_LAYER_HIDE; +} + static void data_select_linked_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem), void *C_v) { if (event == OL_DOP_SELECT_LINKED) { @@ -1453,6 +1468,7 @@ void OUTLINER_OT_modifier_operation(wmOperatorType *ot) /* ******************** */ +// XXX: select linked is for RNA structs only static EnumPropertyItem prop_data_op_types[] = { {OL_DOP_SELECT, "SELECT", 0, "Select", ""}, {OL_DOP_DESELECT, "DESELECT", 0, "Deselect", ""}, @@ -1507,6 +1523,14 @@ static int outliner_data_operation_exec(bContext *C, wmOperator *op) } break; + case TSE_GP_LAYER: + { + outliner_do_data_operation(soops, datalevel, event, &soops->tree, gp_layer_cb, NULL); + WM_event_add_notifier(C, NC_GPENCIL | ND_DATA, NULL); + ED_undo_push(C, "Grease Pencil Layer operation"); + } + break; + case TSE_RNA_STRUCT: if (event == OL_DOP_SELECT_LINKED) { outliner_do_data_operation(soops, datalevel, event, &soops->tree, data_select_linked_cb, C); |