Blender  V2.59
mball_ops.c
Go to the documentation of this file.
00001 /*
00002  * $Id: mball_ops.c 35694 2011-03-22 12:53:36Z campbellbarton $
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version. 
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * The Original Code is Copyright (C) 2008 Blender Foundation.
00021  * All rights reserved.
00022  *
00023  * 
00024  * Contributor(s): Blender Foundation
00025  *
00026  * ***** END GPL LICENSE BLOCK *****
00027  */
00028 
00034 #include "WM_api.h"
00035 #include "WM_types.h"
00036 
00037 #include "RNA_access.h"
00038 
00039 #include "ED_mball.h"
00040 #include "ED_screen.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_inverse_metaelems);
00054         WM_operatortype_append(MBALL_OT_select_random_metaelems);
00055 }
00056 
00057 void ED_keymap_metaball(wmKeyConfig *keyconf)
00058 {
00059         wmKeyMap *keymap;
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         WM_keymap_add_item(keymap, "MBALL_OT_hide_metaelems", HKEY, KM_PRESS, 0, 0);
00068         RNA_boolean_set(WM_keymap_add_item(keymap, "MBALL_OT_hide_metaelems", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1);
00069         
00070         WM_keymap_add_item(keymap, "MBALL_OT_delete_metaelems", XKEY, KM_PRESS, 0, 0);
00071         WM_keymap_add_item(keymap, "MBALL_OT_delete_metaelems", DELKEY, KM_PRESS, 0, 0);
00072         WM_keymap_add_item(keymap, "MBALL_OT_duplicate_metaelems", DKEY, KM_PRESS, KM_SHIFT, 0);
00073         
00074         WM_keymap_add_item(keymap, "MBALL_OT_select_all", AKEY, KM_PRESS, 0, 0);
00075         WM_keymap_add_item(keymap, "MBALL_OT_select_inverse_metaelems", IKEY, KM_PRESS, KM_CTRL, 0);
00076 }
00077