Merge branch 'master' into blender2.8
[blender.git] / source / blender / editors / space_outliner / outliner_ops.c
1 /*
2  * ***** BEGIN GPL LICENSE BLOCK *****
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18  * The Original Code is Copyright (C) 2008 Blender Foundation.
19  * All rights reserved.
20  *
21  *
22  * Contributor(s): Blender Foundation
23  *
24  * ***** END GPL LICENSE BLOCK *****
25  */
26
27 /** \file blender/editors/space_outliner/outliner_ops.c
28  *  \ingroup spoutliner
29  */
30
31 #include "MEM_guardedalloc.h"
32
33 #include "BLI_listbase.h"
34 #include "BLI_math.h"
35
36 #include "DNA_group_types.h"
37
38 #include "BLT_translation.h"
39
40 #include "BKE_context.h"
41 #include "BKE_main.h"
42
43 #include "GPU_immediate.h"
44
45 #include "RNA_access.h"
46
47 #include "UI_interface.h"
48 #include "UI_view2d.h"
49
50 #include "WM_api.h"
51 #include "WM_types.h"
52
53 #include "ED_screen.h"
54
55 #include "outliner_intern.h"
56
57 typedef struct OutlinerDragDropTooltip {
58         TreeElement *te;
59         void *handle;
60 } OutlinerDragDropTooltip;
61
62 enum {
63         OUTLINER_ITEM_DRAG_CANCEL,
64         OUTLINER_ITEM_DRAG_CONFIRM,
65 };
66
67 static int outliner_item_drag_drop_poll(bContext *C)
68 {
69         SpaceOops *soops = CTX_wm_space_outliner(C);
70         return ED_operator_outliner_active(C) &&
71                /* Only collection display modes supported for now. Others need more design work */
72                ELEM(soops->outlinevis, SO_VIEW_LAYER, SO_LIBRARIES);
73 }
74
75 static TreeElement *outliner_item_drag_element_find(SpaceOops *soops, ARegion *ar, const wmEvent *event)
76 {
77         /* note: using EVT_TWEAK_ events to trigger dragging is fine,
78          * it sends coordinates from where dragging was started */
79         const float my = UI_view2d_region_to_view_y(&ar->v2d, event->mval[1]);
80         return outliner_find_item_at_y(soops, &soops->tree, my);
81 }
82
83 static void outliner_item_drag_end(wmWindow *win, OutlinerDragDropTooltip *data)
84 {
85         MEM_SAFE_FREE(data->te->drag_data);
86
87         if (data->handle) {
88                 WM_draw_cb_exit(win, data->handle);
89         }
90
91         MEM_SAFE_FREE(data);
92 }
93
94 static void outliner_item_drag_get_insert_data(
95         const SpaceOops *soops, ARegion *ar, const wmEvent *event, TreeElement *te_dragged,
96         TreeElement **r_te_insert_handle, TreeElementInsertType *r_insert_type)
97 {
98         TreeElement *te_hovered;
99         float view_mval[2];
100
101         UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &view_mval[0], &view_mval[1]);
102         te_hovered = outliner_find_item_at_y(soops, &soops->tree, view_mval[1]);
103
104         if (te_hovered) {
105                 /* mouse hovers an element (ignoring x-axis), now find out how to insert the dragged item exactly */
106
107                 if (te_hovered == te_dragged) {
108                         *r_te_insert_handle = te_dragged;
109                 }
110                 else if (te_hovered != te_dragged) {
111                         const float margin = UI_UNIT_Y * (1.0f / 4);
112
113                         *r_te_insert_handle = te_hovered;
114                         if (view_mval[1] < (te_hovered->ys + margin)) {
115                                 if (TSELEM_OPEN(TREESTORE(te_hovered), soops)) {
116                                         /* inserting after a open item means we insert into it, but as first child */
117                                         if (BLI_listbase_is_empty(&te_hovered->subtree)) {
118                                                 *r_insert_type = TE_INSERT_INTO;
119                                         }
120                                         else {
121                                                 *r_insert_type = TE_INSERT_BEFORE;
122                                                 *r_te_insert_handle = te_hovered->subtree.first;
123                                         }
124                                 }
125                                 else {
126                                         *r_insert_type = TE_INSERT_AFTER;
127                                 }
128                         }
129                         else if (view_mval[1] > (te_hovered->ys + (3 * margin))) {
130                                 *r_insert_type = TE_INSERT_BEFORE;
131                         }
132                         else {
133                                 *r_insert_type = TE_INSERT_INTO;
134                         }
135                 }
136         }
137         else {
138                 /* mouse doesn't hover any item (ignoring x-axis), so it's either above list bounds or below. */
139
140                 TreeElement *first = soops->tree.first;
141                 TreeElement *last = soops->tree.last;
142
143                 if (view_mval[1] < last->ys) {
144                         *r_te_insert_handle = last;
145                         *r_insert_type = TE_INSERT_AFTER;
146                 }
147                 else if (view_mval[1] > (first->ys + UI_UNIT_Y)) {
148                         *r_te_insert_handle = first;
149                         *r_insert_type = TE_INSERT_BEFORE;
150                 }
151                 else {
152                         BLI_assert(0);
153                 }
154         }
155 }
156
157 static void outliner_item_drag_handle(
158         SpaceOops *soops, ARegion *ar, const wmEvent *event, TreeElement *te_dragged)
159 {
160         TreeElement *te_insert_handle;
161         TreeElementInsertType insert_type;
162
163         outliner_item_drag_get_insert_data(soops, ar, event, te_dragged, &te_insert_handle, &insert_type);
164
165         if (!te_dragged->reinsert_poll &&
166             /* there is no reinsert_poll, so we do some generic checks (same types and reinsert callback is available) */
167             (TREESTORE(te_dragged)->type == TREESTORE(te_insert_handle)->type) &&
168             te_dragged->reinsert)
169         {
170                 /* pass */
171         }
172         else if (te_dragged == te_insert_handle) {
173                 /* nothing will happen anyway, no need to do poll check */
174         }
175         else if (!te_dragged->reinsert_poll ||
176                  !te_dragged->reinsert_poll(te_dragged, &te_insert_handle, &insert_type))
177         {
178                 te_insert_handle = NULL;
179         }
180         te_dragged->drag_data->insert_type = insert_type;
181         te_dragged->drag_data->insert_handle = te_insert_handle;
182 }
183
184 /**
185  * Returns true if it is a collection and empty.
186  */
187 static bool is_empty_collection(TreeElement *te)
188 {
189         Collection *collection = outliner_collection_from_tree_element(te);
190
191         if (!collection) {
192                 return false;
193         }
194
195         return BLI_listbase_is_empty(&collection->gobject) &&
196                BLI_listbase_is_empty(&collection->children);
197 }
198
199 static bool outliner_item_drag_drop_apply(
200         Main *bmain,
201         Scene *scene,
202         SpaceOops *soops,
203         OutlinerDragDropTooltip *data,
204         const wmEvent *event)
205 {
206         TreeElement *dragged_te = data->te;
207         TreeElement *insert_handle = dragged_te->drag_data->insert_handle;
208         TreeElementInsertType insert_type = dragged_te->drag_data->insert_type;
209
210         if ((insert_handle == dragged_te) || !insert_handle) {
211                 /* No need to do anything */
212         }
213         else if (dragged_te->reinsert) {
214                 BLI_assert(!dragged_te->reinsert_poll || dragged_te->reinsert_poll(dragged_te, &insert_handle,
215                                                                                    &insert_type));
216                 /* call of assert above should not have changed insert_handle and insert_type at this point */
217                 BLI_assert(dragged_te->drag_data->insert_handle == insert_handle &&
218                            dragged_te->drag_data->insert_type == insert_type);
219
220                 /* If the collection was just created and you moved objects/collections inside it,
221                  * it is strange to have it closed and we not see the newly dragged elements. */
222                 const bool should_open_collection = (insert_type == TE_INSERT_INTO) && is_empty_collection(insert_handle);
223
224                 dragged_te->reinsert(bmain, scene, soops, dragged_te, insert_handle, insert_type, event);
225
226                 if (should_open_collection && !is_empty_collection(insert_handle)) {
227                         TREESTORE(insert_handle)->flag &= ~TSE_CLOSED;
228                 }
229                 return true;
230         }
231
232         return false;
233 }
234
235 static int outliner_item_drag_drop_modal(bContext *C, wmOperator *op, const wmEvent *event)
236 {
237         Main *bmain = CTX_data_main(C);
238         Scene *scene = CTX_data_scene(C);
239         ARegion *ar = CTX_wm_region(C);
240         SpaceOops *soops = CTX_wm_space_outliner(C);
241         OutlinerDragDropTooltip *data = op->customdata;
242         TreeElement *te_dragged = data->te;
243         int retval = OPERATOR_RUNNING_MODAL;
244         bool redraw = false;
245         bool skip_rebuild = true;
246
247         switch (event->type) {
248                 case EVT_MODAL_MAP:
249                         if (event->val == OUTLINER_ITEM_DRAG_CONFIRM) {
250                                 if (outliner_item_drag_drop_apply(bmain, scene, soops, data, event)) {
251                                         skip_rebuild = false;
252                                 }
253                                 retval = OPERATOR_FINISHED;
254                         }
255                         else if (event->val == OUTLINER_ITEM_DRAG_CANCEL) {
256                                 retval = OPERATOR_CANCELLED;
257                         }
258                         else {
259                                 BLI_assert(0);
260                         }
261                         WM_event_add_mousemove(C); /* update highlight */
262                         outliner_item_drag_end(CTX_wm_window(C), data);
263                         redraw = true;
264                         break;
265                 case MOUSEMOVE:
266                         outliner_item_drag_handle(soops, ar, event, te_dragged);
267                         redraw = true;
268                         break;
269         }
270
271         if (redraw) {
272                 if (skip_rebuild) {
273                         ED_region_tag_redraw_no_rebuild(ar);
274                 }
275                 else {
276                         ED_region_tag_redraw(ar);
277                 }
278         }
279
280         return retval;
281 }
282
283 static const char *outliner_drag_drop_tooltip_get(
284         const TreeElement *te_float)
285 {
286         const char *name = NULL;
287
288         const TreeElement *te_insert = te_float->drag_data->insert_handle;
289         if (te_float && outliner_is_collection_tree_element(te_float)) {
290                 if (te_insert == NULL) {
291                         name = TIP_("Move collection");
292                 }
293                 else {
294                         switch (te_float->drag_data->insert_type) {
295                                 case TE_INSERT_BEFORE:
296                                         if (te_insert->prev && outliner_is_collection_tree_element(te_insert->prev)) {
297                                                 name = TIP_("Move between collections");
298                                         }
299                                         else {
300                                                 name = TIP_("Move before collection");
301                                         }
302                                         break;
303                                 case TE_INSERT_AFTER:
304                                         if (te_insert->next && outliner_is_collection_tree_element(te_insert->next)) {
305                                                 name = TIP_("Move between collections");
306                                         }
307                                         else {
308                                                 name = TIP_("Move after collection");
309                                         }
310                                         break;
311                                 case TE_INSERT_INTO:
312                                         name = TIP_("Move inside collection");
313                                         break;
314                         }
315                 }
316         }
317         else if ((TREESTORE(te_float)->type == 0) && (te_float->idcode == ID_OB)) {
318                 name = TIP_("Move to collection (Ctrl to link)");
319         }
320
321         return name;
322 }
323
324 static void outliner_drag_drop_tooltip_cb(const wmWindow *win, void *vdata)
325 {
326         OutlinerDragDropTooltip *data = vdata;
327         const char *tooltip;
328
329         int cursorx, cursory;
330         int x, y;
331
332         tooltip = outliner_drag_drop_tooltip_get(data->te);
333         if (tooltip == NULL) {
334                 return;
335         }
336
337         cursorx = win->eventstate->x;
338         cursory = win->eventstate->y;
339
340         x = cursorx + U.widget_unit;
341         y = cursory - U.widget_unit;
342
343         /* Drawing. */
344         const uiFontStyle *fstyle = UI_FSTYLE_WIDGET;
345
346         const float col_fg[4] = {1.0f, 1.0f, 1.0f, 1.0f};
347         const float col_bg[4] = {0.0f, 0.0f, 0.0f, 0.2f};
348
349         glEnable(GL_BLEND);
350         UI_fontstyle_draw_simple_backdrop(fstyle, x, y, tooltip, col_fg, col_bg);
351         glDisable(GL_BLEND);
352 }
353
354 static int outliner_item_drag_drop_invoke(bContext *C, wmOperator *op, const wmEvent *event)
355 {
356         ARegion *ar = CTX_wm_region(C);
357         SpaceOops *soops = CTX_wm_space_outliner(C);
358         TreeElement *te_dragged = outliner_item_drag_element_find(soops, ar, event);
359
360         if (!te_dragged) {
361                 return (OPERATOR_FINISHED | OPERATOR_PASS_THROUGH);
362         }
363
364         OutlinerDragDropTooltip *data = MEM_mallocN(sizeof(OutlinerDragDropTooltip), __func__);
365         data->te = te_dragged;
366
367         op->customdata = data;
368         te_dragged->drag_data = MEM_callocN(sizeof(*te_dragged->drag_data), __func__);
369         /* by default we don't change the item position */
370         te_dragged->drag_data->insert_handle = te_dragged;
371         /* unset highlighted tree element, dragged one will be highlighted instead */
372         outliner_set_flag(&soops->tree, TSE_HIGHLIGHTED, false);
373
374         ED_region_tag_redraw_no_rebuild(ar);
375
376         WM_event_add_modal_handler(C, op);
377
378         data->handle = WM_draw_cb_activate(CTX_wm_window(C), outliner_drag_drop_tooltip_cb, data);
379
380         return OPERATOR_RUNNING_MODAL;
381 }
382
383 /**
384  * Notes about Outliner Item Drag 'n Drop:
385  * Right now only collections display mode is supported. But ideally all/most modes would support this. There are
386  * just some open design questions that have to be answered: do we want to allow mixing order of different data types
387  * (like render-layers and objects)? Would that be a purely visual change or would that have any other effect? ...
388  */
389 static void OUTLINER_OT_item_drag_drop(wmOperatorType *ot)
390 {
391         ot->name = "Drag and Drop Item";
392         ot->idname = "OUTLINER_OT_item_drag_drop";
393         ot->description = "Change the hierarchical position of an item by repositioning it using drag and drop";
394
395         ot->invoke = outliner_item_drag_drop_invoke;
396         ot->modal = outliner_item_drag_drop_modal;
397
398         ot->poll = outliner_item_drag_drop_poll;
399
400         ot->flag = OPTYPE_UNDO;
401 }
402
403
404 /* ************************** registration **********************************/
405
406 void outliner_operatortypes(void)
407 {
408         WM_operatortype_append(OUTLINER_OT_highlight_update);
409         WM_operatortype_append(OUTLINER_OT_item_activate);
410         WM_operatortype_append(OUTLINER_OT_select_border);
411         WM_operatortype_append(OUTLINER_OT_item_openclose);
412         WM_operatortype_append(OUTLINER_OT_item_rename);
413         WM_operatortype_append(OUTLINER_OT_item_drag_drop);
414         WM_operatortype_append(OUTLINER_OT_operation);
415         WM_operatortype_append(OUTLINER_OT_scene_operation);
416         WM_operatortype_append(OUTLINER_OT_object_operation);
417         WM_operatortype_append(OUTLINER_OT_lib_operation);
418         WM_operatortype_append(OUTLINER_OT_lib_relocate);
419         WM_operatortype_append(OUTLINER_OT_id_operation);
420         WM_operatortype_append(OUTLINER_OT_id_delete);
421         WM_operatortype_append(OUTLINER_OT_id_remap);
422         WM_operatortype_append(OUTLINER_OT_data_operation);
423         WM_operatortype_append(OUTLINER_OT_animdata_operation);
424         WM_operatortype_append(OUTLINER_OT_action_set);
425         WM_operatortype_append(OUTLINER_OT_constraint_operation);
426         WM_operatortype_append(OUTLINER_OT_modifier_operation);
427
428         WM_operatortype_append(OUTLINER_OT_show_one_level);
429         WM_operatortype_append(OUTLINER_OT_show_active);
430         WM_operatortype_append(OUTLINER_OT_show_hierarchy);
431         WM_operatortype_append(OUTLINER_OT_scroll_page);
432
433         WM_operatortype_append(OUTLINER_OT_selected_toggle);
434         WM_operatortype_append(OUTLINER_OT_expanded_toggle);
435
436         WM_operatortype_append(OUTLINER_OT_keyingset_add_selected);
437         WM_operatortype_append(OUTLINER_OT_keyingset_remove_selected);
438
439         WM_operatortype_append(OUTLINER_OT_drivers_add_selected);
440         WM_operatortype_append(OUTLINER_OT_drivers_delete_selected);
441
442         WM_operatortype_append(OUTLINER_OT_orphans_purge);
443
444         WM_operatortype_append(OUTLINER_OT_parent_drop);
445         WM_operatortype_append(OUTLINER_OT_parent_clear);
446         WM_operatortype_append(OUTLINER_OT_scene_drop);
447         WM_operatortype_append(OUTLINER_OT_material_drop);
448         WM_operatortype_append(OUTLINER_OT_collection_drop);
449
450         /* collections */
451         WM_operatortype_append(OUTLINER_OT_collection_new);
452         WM_operatortype_append(OUTLINER_OT_collection_duplicate);
453         WM_operatortype_append(OUTLINER_OT_collection_delete);
454         WM_operatortype_append(OUTLINER_OT_collection_objects_select);
455         WM_operatortype_append(OUTLINER_OT_collection_objects_deselect);
456         WM_operatortype_append(OUTLINER_OT_collection_link);
457         WM_operatortype_append(OUTLINER_OT_collection_instance);
458         WM_operatortype_append(OUTLINER_OT_collection_exclude_set);
459         WM_operatortype_append(OUTLINER_OT_collection_include_set);
460 }
461
462 static wmKeyMap *outliner_item_drag_drop_modal_keymap(wmKeyConfig *keyconf)
463 {
464         static EnumPropertyItem modal_items[] = {
465                 {OUTLINER_ITEM_DRAG_CANCEL,  "CANCEL",  0, "Cancel", ""},
466                 {OUTLINER_ITEM_DRAG_CONFIRM, "CONFIRM", 0, "Confirm/Drop", ""},
467                 {0, NULL, 0, NULL, NULL}
468         };
469         const char *map_name = "Outliner Item Drap 'n Drop Modal Map";
470
471         wmKeyMap *keymap = WM_modalkeymap_get(keyconf, map_name);
472
473         /* this function is called for each spacetype, only needs to add map once */
474         if (keymap && keymap->modal_items)
475                 return NULL;
476
477         keymap = WM_modalkeymap_add(keyconf, map_name, modal_items);
478
479         /* items for modal map */
480         WM_modalkeymap_add_item(keymap, ESCKEY, KM_PRESS, KM_ANY, 0, OUTLINER_ITEM_DRAG_CANCEL);
481         WM_modalkeymap_add_item(keymap, RIGHTMOUSE, KM_PRESS, KM_ANY, 0, OUTLINER_ITEM_DRAG_CANCEL);
482
483         WM_modalkeymap_add_item(keymap, LEFTMOUSE, KM_RELEASE, KM_ANY, 0, OUTLINER_ITEM_DRAG_CONFIRM);
484         WM_modalkeymap_add_item(keymap, RETKEY, KM_RELEASE, KM_ANY, 0, OUTLINER_ITEM_DRAG_CONFIRM);
485         WM_modalkeymap_add_item(keymap, PADENTER, KM_RELEASE, KM_ANY, 0, OUTLINER_ITEM_DRAG_CONFIRM);
486
487         WM_modalkeymap_assign(keymap, "OUTLINER_OT_item_drag_drop");
488
489         return keymap;
490 }
491
492 void outliner_keymap(wmKeyConfig *keyconf)
493 {
494         wmKeyMap *keymap = WM_keymap_find(keyconf, "Outliner", SPACE_OUTLINER, 0);
495         wmKeyMapItem *kmi;
496
497         WM_keymap_add_item(keymap, "OUTLINER_OT_highlight_update", MOUSEMOVE, KM_ANY, KM_ANY, 0);
498
499         WM_keymap_add_item(keymap, "OUTLINER_OT_item_rename", LEFTMOUSE, KM_DBL_CLICK, 0, 0);
500
501         kmi = WM_keymap_add_item(keymap, "OUTLINER_OT_item_activate", LEFTMOUSE, KM_CLICK, 0, 0);
502         RNA_boolean_set(kmi->ptr, "recursive", false);
503         RNA_boolean_set(kmi->ptr, "extend", false);
504
505         kmi = WM_keymap_add_item(keymap, "OUTLINER_OT_item_activate", LEFTMOUSE, KM_CLICK, KM_SHIFT, 0);
506         RNA_boolean_set(kmi->ptr, "recursive", false);
507         RNA_boolean_set(kmi->ptr, "extend", true);
508
509         kmi = WM_keymap_add_item(keymap, "OUTLINER_OT_item_activate", LEFTMOUSE, KM_CLICK, KM_CTRL, 0);
510         RNA_boolean_set(kmi->ptr, "recursive", true);
511         RNA_boolean_set(kmi->ptr, "extend", false);
512
513         kmi = WM_keymap_add_item(keymap, "OUTLINER_OT_item_activate", LEFTMOUSE, KM_CLICK, KM_CTRL | KM_SHIFT, 0);
514         RNA_boolean_set(kmi->ptr, "recursive", true);
515         RNA_boolean_set(kmi->ptr, "extend", true);
516
517
518         WM_keymap_add_item(keymap, "OUTLINER_OT_select_border", BKEY, KM_PRESS, 0, 0);
519
520         kmi = WM_keymap_add_item(keymap, "OUTLINER_OT_item_openclose", RETKEY, KM_PRESS, 0, 0);
521         RNA_boolean_set(kmi->ptr, "all", false);
522         kmi = WM_keymap_add_item(keymap, "OUTLINER_OT_item_openclose", RETKEY, KM_PRESS, KM_SHIFT, 0);
523         RNA_boolean_set(kmi->ptr, "all", true);
524
525         WM_keymap_add_item(keymap, "OUTLINER_OT_item_rename", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
526         WM_keymap_add_item(keymap, "OUTLINER_OT_operation", RIGHTMOUSE, KM_PRESS, 0, 0);
527
528         WM_keymap_add_item(keymap, "OUTLINER_OT_item_drag_drop", EVT_TWEAK_L, KM_ANY, 0, 0);
529
530         WM_keymap_add_item(keymap, "OUTLINER_OT_show_hierarchy", HOMEKEY, KM_PRESS, 0, 0);
531
532         WM_keymap_add_item(keymap, "OUTLINER_OT_show_active", PERIODKEY, KM_PRESS, 0, 0);
533         WM_keymap_add_item(keymap, "OUTLINER_OT_show_active", PADPERIOD, KM_PRESS, 0, 0);
534
535         kmi = WM_keymap_add_item(keymap, "OUTLINER_OT_scroll_page", PAGEDOWNKEY, KM_PRESS, 0, 0);
536         RNA_boolean_set(kmi->ptr, "up", false);
537         kmi = WM_keymap_add_item(keymap, "OUTLINER_OT_scroll_page", PAGEUPKEY, KM_PRESS, 0, 0);
538         RNA_boolean_set(kmi->ptr, "up", true);
539
540         WM_keymap_add_item(keymap, "OUTLINER_OT_show_one_level", PADPLUSKEY, KM_PRESS, 0, 0); /* open */
541         kmi = WM_keymap_add_item(keymap, "OUTLINER_OT_show_one_level", PADMINUS, KM_PRESS, 0, 0);
542         RNA_boolean_set(kmi->ptr, "open", false); /* close */
543
544         WM_keymap_verify_item(keymap, "OUTLINER_OT_selected_toggle", AKEY, KM_PRESS, 0, 0);
545         WM_keymap_verify_item(keymap, "OUTLINER_OT_expanded_toggle", AKEY, KM_PRESS, KM_SHIFT, 0);
546
547         /* keying sets - only for databrowse */
548         WM_keymap_verify_item(keymap, "OUTLINER_OT_keyingset_add_selected", KKEY, KM_PRESS, 0, 0);
549         WM_keymap_verify_item(keymap, "OUTLINER_OT_keyingset_remove_selected", KKEY, KM_PRESS, KM_ALT, 0);
550
551         WM_keymap_verify_item(keymap, "ANIM_OT_keyframe_insert", IKEY, KM_PRESS, 0, 0);
552         WM_keymap_verify_item(keymap, "ANIM_OT_keyframe_delete", IKEY, KM_PRESS, KM_ALT, 0);
553
554         WM_keymap_verify_item(keymap, "OUTLINER_OT_drivers_add_selected", DKEY, KM_PRESS, 0, 0);
555         WM_keymap_verify_item(keymap, "OUTLINER_OT_drivers_delete_selected", DKEY, KM_PRESS, KM_ALT, 0);
556
557         WM_keymap_verify_item(keymap, "OUTLINER_OT_collection_new", CKEY, KM_PRESS, 0, 0);
558         WM_keymap_verify_item(keymap, "OUTLINER_OT_collection_delete", XKEY, KM_PRESS, 0, 0);
559
560         WM_keymap_verify_item(keymap, "OBJECT_OT_move_to_collection", MKEY, KM_PRESS, 0, 0);
561         WM_keymap_verify_item(keymap, "OBJECT_OT_link_to_collection", MKEY, KM_PRESS, KM_SHIFT, 0);
562
563         outliner_item_drag_drop_modal_keymap(keyconf);
564 }
565