1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2008 Blender Foundation.
17  * All rights reserved.
18  */
19 
20 /** \file
21  * \ingroup edmeta
22  */
23 
24 #include "DNA_scene_types.h"
25 
26 #include "RNA_access.h"
27 
28 #include "WM_api.h"
29 #include "WM_types.h"
30 
31 #include "ED_mball.h"
32 #include "ED_object.h"
33 #include "ED_screen.h"
34 #include "ED_select_utils.h"
35 
36 #include "mball_intern.h"
37 
ED_operatortypes_metaball(void)38 void ED_operatortypes_metaball(void)
39 {
40   WM_operatortype_append(MBALL_OT_delete_metaelems);
41   WM_operatortype_append(MBALL_OT_duplicate_metaelems);
42 
43   WM_operatortype_append(MBALL_OT_hide_metaelems);
44   WM_operatortype_append(MBALL_OT_reveal_metaelems);
45 
46   WM_operatortype_append(MBALL_OT_select_all);
47   WM_operatortype_append(MBALL_OT_select_similar);
48   WM_operatortype_append(MBALL_OT_select_random_metaelems);
49 }
50 
ED_operatormacros_metaball(void)51 void ED_operatormacros_metaball(void)
52 {
53   wmOperatorType *ot;
54   wmOperatorTypeMacro *otmacro;
55 
56   ot = WM_operatortype_append_macro("MBALL_OT_duplicate_move",
57                                     "Duplicate",
58                                     "Make copies of the selected metaelements and move them",
59                                     OPTYPE_UNDO | OPTYPE_REGISTER);
60   WM_operatortype_macro_define(ot, "MBALL_OT_duplicate_metaelems");
61   otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
62   RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
63 }
64 
ED_keymap_metaball(wmKeyConfig * keyconf)65 void ED_keymap_metaball(wmKeyConfig *keyconf)
66 {
67   wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Metaball", 0, 0);
68   keymap->poll = ED_operator_editmball;
69 }
70