From 2110af20f5e636cd4481152e8cbe920dfa1efa8c Mon Sep 17 00:00:00 2001 From: Nathan Craddock Date: Thu, 10 Sep 2020 08:35:58 -0600 Subject: Outliner: Move mode toggling to left column Add a column of icons in the left gutter of the outliner for controlling the interaction modes of objects. When an object is in a mode other than object mode, the mode icon will draw to the left of that object. Any other objects that are valid to be added or swapped into the mode are drawn with a dot to the left of the object. Clicking the dot to the left of an object will swap that object with the current active object in the interaction mode. For edit and pose modes, ctrl clicking the dot will add that object to the current mode. Clicking the mode icon next to the active object removes it and all other objects from the current mode. The behavior is nearly identical to the previous edit/pose mode toggling by selecting the mesh and armature datablocks, with additional support for all interaction modes. Currently two undo steps are pushed to prevent an assert. Part of T77408 Manifest Task: https://developer.blender.org/T68498 Differential Revision: https://developer.blender.org/D8641 --- source/blender/editors/space_outliner/outliner_intern.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/space_outliner/outliner_intern.h') diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h index 7e7fdf4bab2..e02e6118152 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++ b/source/blender/editors/space_outliner/outliner_intern.h @@ -222,7 +222,6 @@ typedef enum TreeItemSelectAction { OL_ITEM_ACTIVATE = (1 << 2), /* Activate the item */ OL_ITEM_EXTEND = (1 << 3), /* Extend the current selection */ OL_ITEM_RECURSIVE = (1 << 4), /* Select recursively */ - OL_ITEM_TOGGLE_MODE = (1 << 5) /* Temporary */ } TreeItemSelectAction; /* outliner_tree.c ----------------------------------------------- */ @@ -289,6 +288,12 @@ void outliner_object_mode_toggle(struct bContext *C, bool outliner_item_is_co_over_name_icons(const TreeElement *te, float view_co_x); bool outliner_item_is_co_within_close_toggle(const TreeElement *te, float view_co_x); +bool outliner_is_co_within_mode_column(SpaceOutliner *space_outliner, const float view_mval[2]); + +void outliner_item_mode_toggle(struct bContext *C, + TreeViewContext *tvc, + TreeElement *te, + const bool do_extend); /* outliner_edit.c ---------------------------------------------- */ typedef void (*outliner_operation_fn)(struct bContext *C, -- cgit v1.2.3