2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2008-12-28 00:08:34 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
2018-06-01 18:19:39 +02:00
|
|
|
* of the License, or (at your option) any later version.
|
2008-12-28 00:08:34 +00:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2008-12-28 00:08:34 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2008 Blender Foundation.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
2018-06-01 18:19:39 +02:00
|
|
|
*
|
2008-12-28 00:08:34 +00:00
|
|
|
* Contributor(s): Blender Foundation, Nathan Letwory
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
2011-02-27 20:29:51 +00:00
|
|
|
/** \file blender/editors/space_node/node_ops.c
|
|
|
|
* \ingroup spnode
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2008-12-28 00:08:34 +00:00
|
|
|
#include "DNA_node_types.h"
|
|
|
|
|
2012-01-14 22:59:51 +00:00
|
|
|
#include "BLI_utildefines.h"
|
|
|
|
|
2013-04-05 17:56:54 +00:00
|
|
|
#include "BKE_context.h"
|
|
|
|
|
2012-08-02 23:03:16 +00:00
|
|
|
#include "ED_node.h" /* own include */
|
2008-12-28 00:08:34 +00:00
|
|
|
#include "ED_screen.h"
|
2009-07-08 16:17:47 +00:00
|
|
|
#include "ED_transform.h"
|
2009-01-02 23:58:03 +00:00
|
|
|
|
2008-12-28 00:08:34 +00:00
|
|
|
#include "RNA_access.h"
|
|
|
|
|
|
|
|
#include "WM_api.h"
|
|
|
|
#include "WM_types.h"
|
|
|
|
|
2012-08-02 23:03:16 +00:00
|
|
|
#include "node_intern.h" /* own include */
|
2008-12-28 00:08:34 +00:00
|
|
|
|
|
|
|
void node_operatortypes(void)
|
|
|
|
{
|
2009-11-11 08:12:54 +00:00
|
|
|
WM_operatortype_append(NODE_OT_properties);
|
2012-12-12 12:50:39 +00:00
|
|
|
WM_operatortype_append(NODE_OT_toolbar);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2008-12-28 00:08:34 +00:00
|
|
|
WM_operatortype_append(NODE_OT_select);
|
2009-09-14 08:47:13 +00:00
|
|
|
WM_operatortype_append(NODE_OT_select_all);
|
|
|
|
WM_operatortype_append(NODE_OT_select_linked_to);
|
|
|
|
WM_operatortype_append(NODE_OT_select_linked_from);
|
2009-03-29 02:15:13 +00:00
|
|
|
WM_operatortype_append(NODE_OT_select_border);
|
2013-11-06 19:21:42 +00:00
|
|
|
WM_operatortype_append(NODE_OT_select_circle);
|
2012-08-22 13:34:06 +00:00
|
|
|
WM_operatortype_append(NODE_OT_select_lasso);
|
2014-07-04 14:17:54 +02:00
|
|
|
WM_operatortype_append(NODE_OT_select_grouped);
|
2013-03-27 18:28:25 +00:00
|
|
|
WM_operatortype_append(NODE_OT_select_same_type_step);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2013-04-01 15:07:22 +00:00
|
|
|
WM_operatortype_append(NODE_OT_find_node);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2009-11-20 06:31:49 +00:00
|
|
|
WM_operatortype_append(NODE_OT_view_all);
|
2012-08-07 16:30:34 +00:00
|
|
|
WM_operatortype_append(NODE_OT_view_selected);
|
2011-12-18 12:51:50 +00:00
|
|
|
|
2010-06-07 20:03:40 +00:00
|
|
|
WM_operatortype_append(NODE_OT_mute_toggle);
|
|
|
|
WM_operatortype_append(NODE_OT_hide_toggle);
|
|
|
|
WM_operatortype_append(NODE_OT_preview_toggle);
|
2011-12-18 12:51:50 +00:00
|
|
|
WM_operatortype_append(NODE_OT_options_toggle);
|
2010-06-07 20:03:40 +00:00
|
|
|
WM_operatortype_append(NODE_OT_hide_socket_toggle);
|
2012-05-22 14:13:33 +00:00
|
|
|
WM_operatortype_append(NODE_OT_node_copy_color);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2009-11-20 06:31:49 +00:00
|
|
|
WM_operatortype_append(NODE_OT_duplicate);
|
2009-03-29 02:15:13 +00:00
|
|
|
WM_operatortype_append(NODE_OT_delete);
|
2011-07-12 18:59:54 +00:00
|
|
|
WM_operatortype_append(NODE_OT_delete_reconnect);
|
2009-04-15 15:40:31 +00:00
|
|
|
WM_operatortype_append(NODE_OT_resize);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2009-11-20 06:31:49 +00:00
|
|
|
WM_operatortype_append(NODE_OT_link);
|
|
|
|
WM_operatortype_append(NODE_OT_link_make);
|
2009-02-07 14:03:34 +00:00
|
|
|
WM_operatortype_append(NODE_OT_links_cut);
|
2012-02-27 17:38:16 +00:00
|
|
|
WM_operatortype_append(NODE_OT_links_detach);
|
2012-06-01 12:38:03 +00:00
|
|
|
WM_operatortype_append(NODE_OT_add_reroute);
|
2011-07-12 18:59:54 +00:00
|
|
|
|
2009-09-15 11:35:10 +00:00
|
|
|
WM_operatortype_append(NODE_OT_group_make);
|
2013-03-18 16:34:57 +00:00
|
|
|
WM_operatortype_append(NODE_OT_group_insert);
|
2009-09-15 11:35:10 +00:00
|
|
|
WM_operatortype_append(NODE_OT_group_ungroup);
|
2012-06-12 08:44:46 +00:00
|
|
|
WM_operatortype_append(NODE_OT_group_separate);
|
2009-09-15 11:35:10 +00:00
|
|
|
WM_operatortype_append(NODE_OT_group_edit);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2010-04-05 18:34:18 +00:00
|
|
|
WM_operatortype_append(NODE_OT_link_viewer);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2015-08-01 17:39:48 +02:00
|
|
|
WM_operatortype_append(NODE_OT_insert_offset);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2010-04-06 17:47:21 +00:00
|
|
|
WM_operatortype_append(NODE_OT_read_renderlayers);
|
|
|
|
WM_operatortype_append(NODE_OT_read_fullsamplelayers);
|
2011-02-07 16:41:57 +00:00
|
|
|
WM_operatortype_append(NODE_OT_render_changed);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2010-04-07 17:06:22 +00:00
|
|
|
WM_operatortype_append(NODE_OT_backimage_move);
|
2010-04-08 16:36:50 +00:00
|
|
|
WM_operatortype_append(NODE_OT_backimage_zoom);
|
2013-09-01 09:50:56 +00:00
|
|
|
WM_operatortype_append(NODE_OT_backimage_fit);
|
2011-01-31 14:42:55 +00:00
|
|
|
WM_operatortype_append(NODE_OT_backimage_sample);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2010-05-12 04:25:33 +00:00
|
|
|
WM_operatortype_append(NODE_OT_add_file);
|
2013-07-22 19:24:39 +00:00
|
|
|
WM_operatortype_append(NODE_OT_add_mask);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2011-09-05 21:01:50 +00:00
|
|
|
WM_operatortype_append(NODE_OT_new_node_tree);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2012-03-01 07:56:15 +00:00
|
|
|
WM_operatortype_append(NODE_OT_output_file_add_socket);
|
|
|
|
WM_operatortype_append(NODE_OT_output_file_remove_active_socket);
|
2012-05-02 07:18:51 +00:00
|
|
|
WM_operatortype_append(NODE_OT_output_file_move_active_socket);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2012-05-22 14:13:33 +00:00
|
|
|
WM_operatortype_append(NODE_OT_parent_set);
|
|
|
|
WM_operatortype_append(NODE_OT_join);
|
|
|
|
WM_operatortype_append(NODE_OT_attach);
|
|
|
|
WM_operatortype_append(NODE_OT_detach);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2012-08-02 09:52:37 +00:00
|
|
|
WM_operatortype_append(NODE_OT_clipboard_copy);
|
|
|
|
WM_operatortype_append(NODE_OT_clipboard_paste);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2012-11-03 14:32:26 +00:00
|
|
|
WM_operatortype_append(NODE_OT_shader_script_update);
|
2013-03-07 17:47:30 +00:00
|
|
|
|
|
|
|
WM_operatortype_append(NODE_OT_viewer_border);
|
2014-06-05 20:05:41 +06:00
|
|
|
WM_operatortype_append(NODE_OT_clear_viewer_border);
|
2013-03-18 16:34:57 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
WM_operatortype_append(NODE_OT_switch_view_update);
|
|
|
|
|
2013-03-18 16:34:57 +00:00
|
|
|
WM_operatortype_append(NODE_OT_tree_socket_add);
|
|
|
|
WM_operatortype_append(NODE_OT_tree_socket_remove);
|
|
|
|
WM_operatortype_append(NODE_OT_tree_socket_move);
|
2008-12-28 00:08:34 +00:00
|
|
|
}
|
|
|
|
|
2009-11-20 21:04:41 +00:00
|
|
|
void ED_operatormacros_node(void)
|
|
|
|
{
|
|
|
|
wmOperatorType *ot;
|
2011-07-17 18:04:28 +00:00
|
|
|
wmOperatorTypeMacro *mot;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2012-05-22 14:13:33 +00:00
|
|
|
ot = WM_operatortype_append_macro("NODE_OT_select_link_viewer", "Link Viewer",
|
|
|
|
"Select node and link it to a viewer node",
|
|
|
|
OPTYPE_UNDO);
|
|
|
|
WM_operatortype_macro_define(ot, "NODE_OT_select");
|
|
|
|
WM_operatortype_macro_define(ot, "NODE_OT_link_viewer");
|
|
|
|
|
|
|
|
ot = WM_operatortype_append_macro("NODE_OT_translate_attach", "Move and Attach",
|
|
|
|
"Move nodes and attach to frame",
|
2012-08-04 12:54:27 +00:00
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
2012-05-22 14:13:33 +00:00
|
|
|
mot = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(mot->ptr, "release_confirm", true);
|
2012-05-22 14:13:33 +00:00
|
|
|
WM_operatortype_macro_define(ot, "NODE_OT_attach");
|
2015-08-01 17:39:48 +02:00
|
|
|
WM_operatortype_macro_define(ot, "NODE_OT_insert_offset");
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2015-08-01 17:39:48 +02:00
|
|
|
/* NODE_OT_translate_attach with remove_on_canel set to true */
|
|
|
|
ot = WM_operatortype_append_macro("NODE_OT_translate_attach_remove_on_cancel", "Move and Attach",
|
|
|
|
"Move nodes and attach to frame",
|
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
|
|
|
mot = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
|
|
|
RNA_boolean_set(mot->ptr, "release_confirm", true);
|
|
|
|
RNA_boolean_set(mot->ptr, "remove_on_cancel", true);
|
|
|
|
WM_operatortype_macro_define(ot, "NODE_OT_attach");
|
|
|
|
WM_operatortype_macro_define(ot, "NODE_OT_insert_offset");
|
2012-05-22 14:13:33 +00:00
|
|
|
|
2014-11-05 11:35:48 +01:00
|
|
|
/* Note: Currently not in a default keymap or menu due to messy keymaps
|
|
|
|
* and tricky invoke functionality.
|
|
|
|
* Kept around in case users want to make own shortcuts.
|
|
|
|
*/
|
2012-05-22 14:13:33 +00:00
|
|
|
ot = WM_operatortype_append_macro("NODE_OT_detach_translate_attach", "Detach and Move",
|
|
|
|
"Detach nodes, move and attach to frame",
|
2012-08-04 12:54:27 +00:00
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
2012-05-22 14:13:33 +00:00
|
|
|
WM_operatortype_macro_define(ot, "NODE_OT_detach");
|
|
|
|
mot = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(mot->ptr, "release_confirm", true);
|
2012-05-22 14:13:33 +00:00
|
|
|
WM_operatortype_macro_define(ot, "NODE_OT_attach");
|
|
|
|
|
|
|
|
ot = WM_operatortype_append_macro("NODE_OT_duplicate_move", "Duplicate",
|
|
|
|
"Duplicate selected nodes and move them",
|
2012-08-04 12:54:27 +00:00
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
2009-11-20 21:04:41 +00:00
|
|
|
WM_operatortype_macro_define(ot, "NODE_OT_duplicate");
|
2012-05-22 14:13:33 +00:00
|
|
|
WM_operatortype_macro_define(ot, "NODE_OT_translate_attach");
|
2010-04-05 18:34:18 +00:00
|
|
|
|
2011-07-17 18:04:28 +00:00
|
|
|
/* modified operator call for duplicating with input links */
|
2012-05-05 19:26:53 +00:00
|
|
|
ot = WM_operatortype_append_macro("NODE_OT_duplicate_move_keep_inputs", "Duplicate",
|
|
|
|
"Duplicate selected nodes keeping input links and move them",
|
2012-08-04 12:54:27 +00:00
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
2011-07-17 18:04:28 +00:00
|
|
|
mot = WM_operatortype_macro_define(ot, "NODE_OT_duplicate");
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(mot->ptr, "keep_inputs", true);
|
2012-05-22 14:13:33 +00:00
|
|
|
WM_operatortype_macro_define(ot, "NODE_OT_translate_attach");
|
2012-02-27 17:38:16 +00:00
|
|
|
|
2012-05-05 19:26:53 +00:00
|
|
|
ot = WM_operatortype_append_macro("NODE_OT_move_detach_links", "Detach", "Move a node to detach links",
|
2012-08-04 12:54:27 +00:00
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
2012-02-27 17:38:16 +00:00
|
|
|
WM_operatortype_macro_define(ot, "NODE_OT_links_detach");
|
2012-05-01 08:19:11 +00:00
|
|
|
WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
2015-08-01 20:59:55 +02:00
|
|
|
WM_operatortype_macro_define(ot, "NODE_OT_insert_offset");
|
2012-05-01 08:19:11 +00:00
|
|
|
|
2012-05-05 19:26:53 +00:00
|
|
|
ot = WM_operatortype_append_macro("NODE_OT_move_detach_links_release", "Detach", "Move a node to detach links",
|
2012-08-04 12:54:27 +00:00
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
2012-05-01 08:19:11 +00:00
|
|
|
WM_operatortype_macro_define(ot, "NODE_OT_links_detach");
|
2012-10-01 15:27:50 +00:00
|
|
|
WM_operatortype_macro_define(ot, "NODE_OT_translate_attach");
|
2012-05-22 14:13:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* helper function for repetitive select operator keymap */
|
|
|
|
static void node_select_keymap(wmKeyMap *keymap, int extend)
|
|
|
|
{
|
|
|
|
/* modifier combinations */
|
2012-08-04 12:54:27 +00:00
|
|
|
const int mod_single[] = { 0, KM_CTRL, KM_ALT, KM_CTRL | KM_ALT,
|
2012-05-22 14:13:33 +00:00
|
|
|
-1 /* terminator */
|
2012-08-04 12:54:27 +00:00
|
|
|
};
|
|
|
|
const int mod_extend[] = { KM_SHIFT, KM_SHIFT | KM_CTRL,
|
|
|
|
KM_SHIFT | KM_ALT, KM_SHIFT | KM_CTRL | KM_ALT,
|
2012-05-22 14:13:33 +00:00
|
|
|
-1 /* terminator */
|
2012-08-04 12:54:27 +00:00
|
|
|
};
|
2012-05-22 14:13:33 +00:00
|
|
|
const int *mod = (extend ? mod_extend : mod_single);
|
|
|
|
wmKeyMapItem *kmi;
|
|
|
|
int i;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2012-08-04 12:54:27 +00:00
|
|
|
for (i = 0; mod[i] >= 0; ++i) {
|
2012-05-22 14:13:33 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "NODE_OT_select", ACTIONMOUSE, KM_PRESS, mod[i], 0);
|
|
|
|
RNA_boolean_set(kmi->ptr, "extend", extend);
|
|
|
|
kmi = WM_keymap_add_item(keymap, "NODE_OT_select", SELECTMOUSE, KM_PRESS, mod[i], 0);
|
|
|
|
RNA_boolean_set(kmi->ptr, "extend", extend);
|
|
|
|
}
|
2011-09-22 15:35:25 +00:00
|
|
|
}
|
2009-11-20 21:04:41 +00:00
|
|
|
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
void node_keymap(struct wmKeyConfig *keyconf)
|
2008-12-28 00:08:34 +00:00
|
|
|
{
|
2009-11-11 08:12:54 +00:00
|
|
|
wmKeyMap *keymap;
|
2009-11-20 04:19:57 +00:00
|
|
|
wmKeyMapItem *kmi;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2009-11-11 08:12:54 +00:00
|
|
|
/* Entire Editor only ----------------- */
|
2012-03-24 02:51:46 +00:00
|
|
|
keymap = WM_keymap_find(keyconf, "Node Generic", SPACE_NODE, 0);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2009-11-11 08:12:54 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_properties", NKEY, KM_PRESS, 0, 0);
|
2012-12-12 12:50:39 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_toolbar", TKEY, KM_PRESS, 0, 0);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2015-11-28 17:14:45 +01:00
|
|
|
/* Main Region only ----------------- */
|
2012-03-24 02:51:46 +00:00
|
|
|
keymap = WM_keymap_find(keyconf, "Node Editor", SPACE_NODE, 0);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
|
|
|
/* mouse select in nodes used to be both keys, but perhaps this should be reduced?
|
2009-11-20 04:19:57 +00:00
|
|
|
* NOTE: mouse-clicks on left-mouse will fall through to allow transform-tweak, but also link/resize
|
2012-03-09 10:16:41 +00:00
|
|
|
* NOTE 2: socket select is part of the node select operator, to handle overlapping cases
|
2012-05-22 14:13:33 +00:00
|
|
|
* NOTE 3: select op is registered for various combinations of modifier key, so the specialized
|
|
|
|
* grab operators (unlink, attach, etc.) can work easily on single nodes.
|
2009-11-20 04:19:57 +00:00
|
|
|
*/
|
2014-04-01 11:34:00 +11:00
|
|
|
node_select_keymap(keymap, false);
|
|
|
|
node_select_keymap(keymap, true);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2012-01-16 16:12:03 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "NODE_OT_select_border", EVT_TWEAK_S, KM_ANY, 0, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "tweak", true);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2012-08-22 13:34:06 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "NODE_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_CTRL | KM_ALT, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "deselect", false);
|
2012-08-22 13:34:06 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "NODE_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_CTRL | KM_SHIFT | KM_ALT, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "deselect", true);
|
2012-08-22 13:34:06 +00:00
|
|
|
|
2013-11-06 19:21:42 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_select_circle", CKEY, KM_PRESS, 0, 0);
|
|
|
|
|
2009-11-20 04:19:57 +00:00
|
|
|
/* each of these falls through if not handled... */
|
2013-03-18 16:34:57 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "NODE_OT_link", LEFTMOUSE, KM_PRESS, 0, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "detach", false);
|
2012-05-15 12:40:43 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "NODE_OT_link", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "detach", true);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2009-11-20 06:31:49 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_resize", LEFTMOUSE, KM_PRESS, 0, 0);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2012-06-01 12:38:03 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_add_reroute", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0);
|
2010-01-04 04:26:28 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_links_cut", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
|
2012-08-04 12:54:27 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_select_link_viewer", LEFTMOUSE, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2010-04-07 17:06:22 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_backimage_move", MIDDLEMOUSE, KM_PRESS, KM_ALT, 0);
|
2012-03-24 02:51:46 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "NODE_OT_backimage_zoom", VKEY, KM_PRESS, 0, 0);
|
2012-08-04 12:54:27 +00:00
|
|
|
RNA_float_set(kmi->ptr, "factor", 0.83333f);
|
2012-03-24 02:51:46 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "NODE_OT_backimage_zoom", VKEY, KM_PRESS, KM_ALT, 0);
|
2012-08-04 12:54:27 +00:00
|
|
|
RNA_float_set(kmi->ptr, "factor", 1.2f);
|
2013-09-01 09:50:56 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_backimage_fit", HOMEKEY, KM_PRESS, KM_ALT, 0);
|
2011-01-31 15:18:30 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_backimage_sample", ACTIONMOUSE, KM_PRESS, KM_ALT, 0);
|
2012-01-16 16:12:03 +00:00
|
|
|
|
|
|
|
kmi = WM_keymap_add_item(keymap, "NODE_OT_link_make", FKEY, KM_PRESS, 0, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "replace", false);
|
2013-04-02 12:38:05 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "NODE_OT_link_make", FKEY, KM_PRESS, KM_SHIFT, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "replace", true);
|
2012-01-16 16:12:03 +00:00
|
|
|
|
2009-11-20 06:31:49 +00:00
|
|
|
WM_keymap_add_menu(keymap, "NODE_MT_add", AKEY, KM_PRESS, KM_SHIFT, 0);
|
2009-11-20 21:04:41 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_duplicate_move", DKEY, KM_PRESS, KM_SHIFT, 0);
|
2011-07-17 18:04:28 +00:00
|
|
|
/* modified operator call for duplicating with input links */
|
2012-08-04 12:54:27 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_duplicate_move_keep_inputs", DKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2012-05-22 14:13:33 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
|
2014-11-05 11:35:48 +01:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_detach", PKEY, KM_PRESS, KM_ALT, 0);
|
2012-05-22 14:13:33 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_join", JKEY, KM_PRESS, KM_CTRL, 0);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2010-06-07 20:03:40 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_hide_toggle", HKEY, KM_PRESS, 0, 0);
|
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_mute_toggle", MKEY, KM_PRESS, 0, 0);
|
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_preview_toggle", HKEY, KM_PRESS, KM_SHIFT, 0);
|
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_hide_socket_toggle", HKEY, KM_PRESS, KM_CTRL, 0);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2009-03-29 02:15:13 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_view_all", HOMEKEY, KM_PRESS, 0, 0);
|
2016-08-18 00:21:55 -04:00
|
|
|
#ifdef WITH_INPUT_NDOF
|
2014-02-18 11:55:53 +11:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_view_all", NDOF_BUTTON_FIT, KM_PRESS, 0, 0);
|
2016-08-18 00:21:55 -04:00
|
|
|
#endif
|
2012-08-07 16:30:34 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_view_selected", PADPERIOD, KM_PRESS, 0, 0);
|
2012-01-16 16:12:03 +00:00
|
|
|
|
|
|
|
kmi = WM_keymap_add_item(keymap, "NODE_OT_select_border", BKEY, KM_PRESS, 0, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "tweak", false);
|
2012-01-16 16:12:03 +00:00
|
|
|
|
2009-03-29 02:15:13 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_delete", XKEY, KM_PRESS, 0, 0);
|
2009-09-15 12:45:05 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_delete", DELKEY, KM_PRESS, 0, 0);
|
2011-07-12 18:59:54 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_delete_reconnect", XKEY, KM_PRESS, KM_CTRL, 0);
|
2009-09-14 08:47:13 +00:00
|
|
|
|
2012-08-01 13:28:19 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "NODE_OT_select_all", AKEY, KM_PRESS, 0, 0);
|
|
|
|
RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
|
|
|
|
kmi = WM_keymap_add_item(keymap, "NODE_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0);
|
|
|
|
RNA_enum_set(kmi->ptr, "action", SEL_INVERT);
|
|
|
|
|
2009-09-14 08:47:13 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_select_linked_to", LKEY, KM_PRESS, KM_SHIFT, 0);
|
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_select_linked_from", LKEY, KM_PRESS, 0, 0);
|
2014-07-04 14:17:54 +02:00
|
|
|
kmi = WM_keymap_add_item(keymap, "NODE_OT_select_grouped", GKEY, KM_PRESS, KM_SHIFT, 0);
|
|
|
|
RNA_boolean_set(kmi->ptr, "extend", false);
|
|
|
|
kmi = WM_keymap_add_item(keymap, "NODE_OT_select_grouped", GKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
|
|
|
|
RNA_boolean_set(kmi->ptr, "extend", true);
|
2009-09-15 11:35:10 +00:00
|
|
|
|
2013-03-27 18:28:25 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "NODE_OT_select_same_type_step", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "prev", false);
|
2013-03-27 18:28:25 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "NODE_OT_select_same_type_step", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "prev", true);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2013-04-02 12:38:05 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_find_node", FKEY, KM_PRESS, KM_CTRL, 0);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2013-04-20 16:50:05 +00:00
|
|
|
/* node group operators */
|
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_group_make", GKEY, KM_PRESS, KM_CTRL, 0);
|
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_group_ungroup", GKEY, KM_PRESS, KM_ALT, 0);
|
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_group_separate", PKEY, KM_PRESS, 0, 0);
|
|
|
|
kmi = WM_keymap_add_item(keymap, "NODE_OT_group_edit", TABKEY, KM_PRESS, 0, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "exit", false);
|
2015-03-15 22:35:26 +01:00
|
|
|
kmi = WM_keymap_add_item(keymap, "NODE_OT_group_edit", TABKEY, KM_PRESS, KM_CTRL, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "exit", true);
|
2013-03-18 16:34:57 +00:00
|
|
|
|
2011-02-02 10:26:14 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_read_renderlayers", RKEY, KM_PRESS, KM_CTRL, 0);
|
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_read_fullsamplelayers", RKEY, KM_PRESS, KM_SHIFT, 0);
|
2011-02-07 16:41:57 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_render_changed", ZKEY, KM_PRESS, 0, 0);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2012-08-02 09:52:37 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_clipboard_copy", CKEY, KM_PRESS, KM_CTRL, 0);
|
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_clipboard_paste", VKEY, KM_PRESS, KM_CTRL, 0);
|
2013-05-11 01:12:29 +00:00
|
|
|
#ifdef __APPLE__
|
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_clipboard_copy", CKEY, KM_PRESS, KM_OSKEY, 0);
|
2013-05-10 13:47:28 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_clipboard_paste", VKEY, KM_PRESS, KM_OSKEY, 0);
|
2013-05-11 01:12:29 +00:00
|
|
|
#endif
|
2013-03-07 17:47:30 +00:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_viewer_border", BKEY, KM_PRESS, KM_CTRL, 0);
|
2014-06-05 20:05:41 +06:00
|
|
|
WM_keymap_add_item(keymap, "NODE_OT_clear_viewer_border", BKEY, KM_PRESS, KM_ALT | KM_CTRL, 0);
|
2013-03-07 17:47:30 +00:00
|
|
|
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
transform_keymap_for_space(keyconf, keymap, SPACE_NODE);
|
2008-12-28 00:08:34 +00:00
|
|
|
}
|