Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_outliner/outliner_select.c
| Show All 33 Lines | |||||
| #include "DNA_armature_types.h" | #include "DNA_armature_types.h" | ||||
| #include "DNA_group_types.h" | #include "DNA_group_types.h" | ||||
| #include "DNA_lamp_types.h" | #include "DNA_lamp_types.h" | ||||
| #include "DNA_material_types.h" | #include "DNA_material_types.h" | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #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_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" | ||||
| #include "ED_armature.h" | #include "ED_armature.h" | ||||
| #include "ED_object.h" | #include "ED_object.h" | ||||
| #include "ED_screen.h" | #include "ED_screen.h" | ||||
| #include "ED_sequencer.h" | #include "ED_sequencer.h" | ||||
| #include "ED_util.h" | #include "ED_util.h" | ||||
| #include "ED_gpencil.h" | |||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "UI_view2d.h" | #include "UI_view2d.h" | ||||
| ▲ Show 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | if (base) { | ||||
| } | } | ||||
| if (set != OL_SETSEL_NONE) { | if (set != OL_SETSEL_NONE) { | ||||
| ED_object_base_activate(C, base); /* adds notifier */ | ED_object_base_activate(C, base); /* adds notifier */ | ||||
| WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); | WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); | ||||
| } | } | ||||
| } | } | ||||
| /* set special grease pencil modes */ | |||||
| if (ob->type == OB_GPENCIL) { | |||||
| /* set cursor */ | |||||
| if (ob->mode == OB_MODE_GPENCIL_PAINT) { | |||||
| WM_cursor_modal_set(CTX_wm_window(C), BC_PAINTBRUSHCURSOR); | |||||
| ED_gpencil_toggle_brush_cursor(C, false); | |||||
| } | |||||
| else if (ob->mode == OB_MODE_GPENCIL_SCULPT) { | |||||
| WM_cursor_modal_set(CTX_wm_window(C), BC_CROSSCURSOR); | |||||
| ED_gpencil_toggle_brush_cursor(C, true); | |||||
| } | |||||
| else if (ob->mode == OB_MODE_GPENCIL_WEIGHT) { | |||||
| WM_cursor_modal_set(CTX_wm_window(C), BC_CROSSCURSOR); | |||||
| ED_gpencil_toggle_brush_cursor(C, true); | |||||
| } | |||||
| else { | |||||
| WM_cursor_modal_set(CTX_wm_window(C), CURSOR_STD); | |||||
| ED_gpencil_toggle_brush_cursor(C, false); | |||||
| } | |||||
| /* set workspace mode */ | |||||
| BKE_workspace_object_mode_set(CTX_wm_workspace(C), ob->mode); | |||||
| } | |||||
| if (ob != scene->obedit) | if (ob != scene->obedit) | ||||
| ED_object_editmode_exit(C, EM_FREEDATA | EM_FREEUNDO | EM_WAITCURSOR | EM_DO_UNDO); | ED_object_editmode_exit(C, EM_FREEDATA | EM_FREEUNDO | EM_WAITCURSOR | EM_DO_UNDO); | ||||
| return OL_DRAWSEL_NORMAL; | return OL_DRAWSEL_NORMAL; | ||||
| } | } | ||||
| static eOLDrawState tree_element_active_material( | static eOLDrawState tree_element_active_material( | ||||
| bContext *C, Scene *UNUSED(scene), SceneLayer *sl, SpaceOops *soops, | bContext *C, Scene *UNUSED(scene), SceneLayer *sl, SpaceOops *soops, | ||||
| ▲ Show 20 Lines • Show All 727 Lines • ▼ Show 20 Lines | else if (te->idcode == ID_GR) { | ||||
| } | } | ||||
| } | } | ||||
| WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); | WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); | ||||
| } | } | ||||
| 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 */ | |||||
| scene->toolsettings->gpencil_src = GP_TOOL_SOURCE_OBJECT; | |||||
| 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, sl, soops, te, OL_SETSEL_NORMAL, false); | tree_element_active(C, scene, sl, soops, te, OL_SETSEL_NORMAL, false); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| tree_element_type_active(C, scene, sl, soops, te, tselem, | tree_element_type_active(C, scene, sl, soops, te, tselem, | ||||
| extend ? OL_SETSEL_EXTEND : OL_SETSEL_NORMAL, | extend ? OL_SETSEL_EXTEND : OL_SETSEL_NORMAL, | ||||
| ▲ Show 20 Lines • Show All 181 Lines • Show Last 20 Lines | |||||