Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_outliner/outliner_select.c
| Context not available. | |||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "DNA_sequence_types.h" | #include "DNA_sequence_types.h" | ||||
| #include "DNA_world_types.h" | #include "DNA_world_types.h" | ||||
| #include "DNA_gpencil_types.h" | |||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_gpencil.h" | |||||
| #include "BKE_group.h" | #include "BKE_group.h" | ||||
| #include "BKE_object.h" | #include "BKE_object.h" | ||||
| #include "BKE_layer.h" | #include "BKE_layer.h" | ||||
| #include "BKE_scene.h" | #include "BKE_scene.h" | ||||
| #include "BKE_sequencer.h" | #include "BKE_sequencer.h" | ||||
| #include "BKE_armature.h" | #include "BKE_armature.h" | ||||
| #include "BKE_workspace.h" | |||||
| #include "BKE_paint.h" | |||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| Context not available. | |||||
| #include "ED_screen.h" | #include "ED_screen.h" | ||||
| #include "ED_sequencer.h" | #include "ED_sequencer.h" | ||||
| #include "ED_undo.h" | #include "ED_undo.h" | ||||
| #include "ED_gpencil.h" | |||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| Context not available. | |||||
| return OL_DRAWSEL_NONE; | return OL_DRAWSEL_NONE; | ||||
| } | } | ||||
| static eOLDrawState tree_element_active_gplayer( | |||||
| bContext *C, Scene *UNUSED(scene), TreeElement *te, TreeStoreElem *tselem, const eOLSetState set) | |||||
| { | |||||
| bGPdata *gpd = (bGPdata *)tselem->id; | |||||
| bGPDlayer *gpl = te->directdata; | |||||
| /* We can only have a single "active" layer at a time | |||||
| * and there must always be an active layer... | |||||
| */ | |||||
| if (set != OL_SETSEL_NONE) { | |||||
| if (gpl) { | |||||
| BKE_gpencil_layer_setactive(gpd, gpl); | |||||
| WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_SELECTED, gpd); | |||||
| } | |||||
| } | |||||
| else { | |||||
| return OL_DRAWSEL_NORMAL; | |||||
| } | |||||
| return OL_DRAWSEL_NONE; | |||||
| } | |||||
| static eOLDrawState tree_element_active_posegroup( | static eOLDrawState tree_element_active_posegroup( | ||||
| bContext *C, Scene *UNUSED(scene), ViewLayer *view_layer, TreeElement *te, TreeStoreElem *tselem, const eOLSetState set) | bContext *C, Scene *UNUSED(scene), ViewLayer *view_layer, TreeElement *te, TreeStoreElem *tselem, const eOLSetState set) | ||||
| { | { | ||||
| Context not available. | |||||
| case TSE_KEYMAP_ITEM: | case TSE_KEYMAP_ITEM: | ||||
| return tree_element_active_keymap_item(C, scene, view_layer, te, tselem, set); | return tree_element_active_keymap_item(C, scene, view_layer, te, tselem, set); | ||||
| case TSE_GP_LAYER: | case TSE_GP_LAYER: | ||||
| //return tree_element_active_gplayer(C, scene, s, te, tselem, set); | return tree_element_active_gplayer(C, scene, te, tselem, set); | ||||
| break; | |||||
| case TSE_SCENE_COLLECTION: | case TSE_SCENE_COLLECTION: | ||||
| case TSE_LAYER_COLLECTION: | case TSE_LAYER_COLLECTION: | ||||
| return tree_element_active_collection(C, te, tselem, set); | return tree_element_active_collection(C, te, tselem, set); | ||||
| Context not available. | |||||
| else if (ELEM(te->idcode, ID_ME, ID_CU, ID_MB, ID_LT, ID_AR)) { | else if (ELEM(te->idcode, ID_ME, ID_CU, ID_MB, ID_LT, ID_AR)) { | ||||
| WM_operator_name_call(C, "OBJECT_OT_editmode_toggle", WM_OP_INVOKE_REGION_WIN, NULL); | WM_operator_name_call(C, "OBJECT_OT_editmode_toggle", WM_OP_INVOKE_REGION_WIN, NULL); | ||||
| } | } | ||||
| else if (ELEM(te->idcode, ID_GD)) { | |||||
| /* set grease pencil to object mode */ | |||||
| WM_operator_name_call(C, "GPENCIL_OT_editmode_toggle", WM_OP_INVOKE_REGION_WIN, NULL); | |||||
| } | |||||
| else { // rest of types | else { // rest of types | ||||
| tree_element_active(C, scene, view_layer, soops, te, OL_SETSEL_NORMAL, false); | tree_element_active(C, scene, view_layer, soops, te, OL_SETSEL_NORMAL, false); | ||||
| } | } | ||||
| Context not available. | |||||