Blender V2.61 - r43446
|
00001 /* 00002 * ***** BEGIN GPL LICENSE BLOCK ***** 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software Foundation, 00016 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 * 00018 * The Original Code is Copyright (C) 2008 Blender Foundation. 00019 * All rights reserved. 00020 * 00021 * 00022 * Contributor(s): Blender Foundation 00023 * 00024 * ***** END GPL LICENSE BLOCK ***** 00025 */ 00026 00032 #include "WM_api.h" 00033 #include "WM_types.h" 00034 00035 #include "RNA_access.h" 00036 00037 #include "ED_mball.h" 00038 #include "ED_screen.h" 00039 00040 #include "BLI_utildefines.h" 00041 00042 #include "mball_intern.h" 00043 00044 void ED_operatortypes_metaball(void) 00045 { 00046 WM_operatortype_append(MBALL_OT_delete_metaelems); 00047 WM_operatortype_append(MBALL_OT_duplicate_metaelems); 00048 00049 WM_operatortype_append(MBALL_OT_hide_metaelems); 00050 WM_operatortype_append(MBALL_OT_reveal_metaelems); 00051 00052 WM_operatortype_append(MBALL_OT_select_all); 00053 WM_operatortype_append(MBALL_OT_select_random_metaelems); 00054 } 00055 00056 void ED_keymap_metaball(wmKeyConfig *keyconf) 00057 { 00058 wmKeyMap *keymap; 00059 wmKeyMapItem *kmi; 00060 00061 keymap= WM_keymap_find(keyconf, "Metaball", 0, 0); 00062 keymap->poll= ED_operator_editmball; 00063 00064 WM_keymap_add_item(keymap, "OBJECT_OT_metaball_add", AKEY, KM_PRESS, KM_SHIFT, 0); 00065 00066 WM_keymap_add_item(keymap, "MBALL_OT_reveal_metaelems", HKEY, KM_PRESS, KM_ALT, 0); 00067 kmi = WM_keymap_add_item(keymap, "MBALL_OT_hide_metaelems", HKEY, KM_PRESS, 0, 0); 00068 RNA_boolean_set(kmi->ptr, "unselected", FALSE); 00069 kmi = WM_keymap_add_item(keymap, "MBALL_OT_hide_metaelems", HKEY, KM_PRESS, KM_SHIFT, 0); 00070 RNA_boolean_set(kmi->ptr, "unselected", TRUE); 00071 00072 WM_keymap_add_item(keymap, "MBALL_OT_delete_metaelems", XKEY, KM_PRESS, 0, 0); 00073 WM_keymap_add_item(keymap, "MBALL_OT_delete_metaelems", DELKEY, KM_PRESS, 0, 0); 00074 WM_keymap_add_item(keymap, "MBALL_OT_duplicate_metaelems", DKEY, KM_PRESS, KM_SHIFT, 0); 00075 00076 kmi = WM_keymap_add_item(keymap, "MBALL_OT_select_all", AKEY, KM_PRESS, 0, 0); 00077 RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE); 00078 kmi = WM_keymap_add_item(keymap, "MBALL_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0); 00079 RNA_enum_set(kmi->ptr, "action", SEL_INVERT); 00080 } 00081