From f75005c2a89f6cc5f1bdac33e26341a14ed92888 Mon Sep 17 00:00:00 2001 From: Jiri Hnidek Date: Wed, 29 Jul 2009 12:35:09 +0000 Subject: 2.5 MetaBalls - It is possible to work with MetaBalls in edit mode now - Added basic UI to the button window (feel free to change it :-)) - Header menus should work - Undo & redo should work - Removed global variable editelems and lastelem (moved it to the MetaBall struct) - All tools from old editmball.c was converted to the operators - Added lastelem to the RNA - Experimental: mb->editelems is only pointer at mb->elems or NULL (depends on Mode). ListBase of MetaElems is not duplicated in edit mode. Tested with scons at Linux and mac OS X TODO: - Recalc data after Undo or Redo - Solve issue with basic MetaBall and Python UI script (only base MetaBall object influence Wiresize and Threshold) - Fix orientation of manipulator in "Normal mode" --- source/blender/editors/metaball/mball_ops.c | 68 +++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 source/blender/editors/metaball/mball_ops.c (limited to 'source/blender/editors/metaball/mball_ops.c') diff --git a/source/blender/editors/metaball/mball_ops.c b/source/blender/editors/metaball/mball_ops.c new file mode 100644 index 00000000000..38593af372f --- /dev/null +++ b/source/blender/editors/metaball/mball_ops.c @@ -0,0 +1,68 @@ +/** + * $Id$ + * + * ***** 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 + * of the License, or (at your option) any later version. + * + * 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, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2008 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "WM_api.h" +#include "WM_types.h" + +#include "RNA_access.h" + +#include "DNA_listBase.h" +#include "DNA_windowmanager_types.h" + +#include "mball_intern.h" + +void ED_operatortypes_metaball(void) +{ + WM_operatortype_append(MBALL_OT_delete_metaelems); + WM_operatortype_append(MBALL_OT_duplicate_metaelems); + + WM_operatortype_append(MBALL_OT_hide_metaelems); + WM_operatortype_append(MBALL_OT_reveal_metaelems); + + WM_operatortype_append(MBALL_OT_select_deselect_all_metaelems); + WM_operatortype_append(MBALL_OT_select_inverse_metaelems); + WM_operatortype_append(MBALL_OT_select_random_metaelems); +} + +void ED_keymap_metaball(wmWindowManager *wm) +{ + ListBase *keymap= WM_keymap_listbase(wm, "Metaball", 0, 0); + + WM_keymap_add_item(keymap, "OBJECT_OT_metaball_add", AKEY, KM_PRESS, KM_SHIFT, 0); + + WM_keymap_add_item(keymap, "MBALL_OT_reveal_metaelems", HKEY, KM_PRESS, KM_ALT, 0); + WM_keymap_add_item(keymap, "MBALL_OT_hide_metaelems", HKEY, KM_PRESS, 0, 0); + RNA_enum_set(WM_keymap_add_item(keymap, "MBALL_OT_hide_metaelems", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1); + + WM_keymap_add_item(keymap, "MBALL_OT_delete_metaelems", XKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "MBALL_OT_duplicate_metaelems", DKEY, KM_PRESS, KM_SHIFT, 0); + + WM_keymap_add_item(keymap, "MBALL_OT_select_deselect_all_metaelems", AKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "MBALL_OT_select_inverse_metaelems", IKEY, KM_PRESS, KM_CTRL, 0); +} + -- cgit v1.2.3