diff options
author | Joseph Eagar <joeedh@gmail.com> | 2010-07-19 08:44:37 +0400 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2010-07-19 08:44:37 +0400 |
commit | c11c196efadf5ef52293d782638497f86a209722 (patch) | |
tree | 43abcd60b2400d28db8686f4dbea68f17475ef58 /source/blender/editors/metaball | |
parent | f54aa7811029c90b6071ccc9e27e57a758e5884d (diff) | |
parent | 7f083c45bee15f7540e2a35a725efe28fc962239 (diff) |
part 1 of merge from trunk at r30358; it compiles, but doesn't link quite yet :)
Diffstat (limited to 'source/blender/editors/metaball')
-rw-r--r-- | source/blender/editors/metaball/CMakeLists.txt | 35 | ||||
-rw-r--r-- | source/blender/editors/metaball/mball_edit.c | 37 | ||||
-rw-r--r-- | source/blender/editors/metaball/mball_ops.c | 3 |
3 files changed, 54 insertions, 21 deletions
diff --git a/source/blender/editors/metaball/CMakeLists.txt b/source/blender/editors/metaball/CMakeLists.txt new file mode 100644 index 00000000000..5e821a5c1e8 --- /dev/null +++ b/source/blender/editors/metaball/CMakeLists.txt @@ -0,0 +1,35 @@ +# $Id: CMakeLists.txt 12931 2007-12-17 18:20:48Z theeth $ +# ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Contributor(s): Jacques Beaurain. +# +# ***** END GPL LICENSE BLOCK ***** + +FILE(GLOB SRC *.c) + +SET(INC + ../include + ../../blenkernel + ../../blenlib + ../../makesdna + ../../makesrna + ../../render/extern/include + ../../windowmanager + ../../../../intern/guardedalloc +) + +BLENDERLIB(bf_editor_metaball "${SRC}" "${INC}") diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c index 625f9b630f4..1d76717e9eb 100644 --- a/source/blender/editors/metaball/mball_edit.c +++ b/source/blender/editors/metaball/mball_edit.c @@ -30,10 +30,6 @@ #include <math.h> #include <string.h> -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" @@ -43,9 +39,6 @@ #include "DNA_meta_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" -#include "DNA_view3d_types.h" -#include "DNA_windowmanager_types.h" -#include "DNA_userdef_types.h" #include "RNA_define.h" #include "RNA_access.h" @@ -54,6 +47,7 @@ #include "BKE_depsgraph.h" #include "BKE_object.h" #include "BKE_context.h" +#include "BKE_library.h" #include "ED_screen.h" #include "ED_view3d.h" @@ -66,6 +60,10 @@ /* This function is used to free all MetaElems from MetaBall */ void free_editMball(Object *obedit) { + MetaBall *mb = (MetaBall*)obedit->data; + + mb->editelems= NULL; + mb->lastelem= NULL; } /* This function is called, when MetaBall Object is @@ -87,13 +85,9 @@ void make_editMball(Object *obedit) /* This function is called, when MetaBall Object switched from * edit mode to object mode. List od MetaElements is copied - * from object->data->edit_elems to to object->data->elems. */ + * from object->data->edit_elems to object->data->elems. */ void load_editMball(Object *obedit) { - MetaBall *mb = (MetaBall*)obedit->data; - - mb->editelems= NULL; - mb->lastelem= NULL; } /* Add metaelem primitive to metaball object (which is in edit mode) */ @@ -129,24 +123,29 @@ MetaElem *add_metaball_primitive(bContext *C, float mat[4][4], int type, int new case MB_BALL: ml->type = MB_BALL; ml->expx= ml->expy= ml->expz= 1.0; + break; case MB_TUBE: ml->type = MB_TUBE; ml->expx= ml->expy= ml->expz= 1.0; + break; case MB_PLANE: ml->type = MB_PLANE; ml->expx= ml->expy= ml->expz= 1.0; + break; case MB_ELIPSOID: ml->type = MB_ELIPSOID; ml->expx= 1.2f; ml->expy= 0.8f; ml->expz= 1.0; + break; case MB_CUBE: ml->type = MB_CUBE; ml->expx= ml->expy= ml->expz= 1.0; + break; default: break; @@ -206,7 +205,7 @@ void MBALL_OT_select_all(wmOperatorType *ot) { /* identifiers */ ot->name= "Select/Deselect All"; - ot->description= "Change selection of all meta elements"; + ot->description= "Change selection of all meta elements"; ot->idname= "MBALL_OT_select_all"; /* callback functions */ @@ -247,7 +246,7 @@ void MBALL_OT_select_inverse_metaelems(wmOperatorType *ot) { /* identifiers */ ot->name= "Inverse"; - ot->description= "Select inverse of (un)selected metaelements"; + ot->description= "Select inverse of (un)selected metaelements"; ot->idname= "MBALL_OT_select_inverse_metaelems"; /* callback functions */ @@ -293,7 +292,7 @@ void MBALL_OT_select_random_metaelems(struct wmOperatorType *ot) { /* identifiers */ ot->name= "Random..."; - ot->description= "Randomly select metaelements"; + ot->description= "Randomly select metaelements"; ot->idname= "MBALL_OT_select_random_metaelems"; /* callback functions */ @@ -352,7 +351,7 @@ void MBALL_OT_duplicate_metaelems(wmOperatorType *ot) { /* identifiers */ ot->name= "Duplicate"; - ot->description= "Delete selected metaelement(s)"; + ot->description= "Delete selected metaelement(s)"; ot->idname= "MBALL_OT_duplicate_metaelems"; /* callback functions */ @@ -398,7 +397,7 @@ void MBALL_OT_delete_metaelems(wmOperatorType *ot) { /* identifiers */ ot->name= "Delete"; - ot->description= "Delete selected metaelement(s)"; + ot->description= "Delete selected metaelement(s)"; ot->idname= "MBALL_OT_delete_metaelems"; /* callback functions */ @@ -448,7 +447,7 @@ void MBALL_OT_hide_metaelems(wmOperatorType *ot) { /* identifiers */ ot->name= "Hide"; - ot->description= "Hide (un)selected metaelement(s)"; + ot->description= "Hide (un)selected metaelement(s)"; ot->idname= "MBALL_OT_hide_metaelems"; /* callback functions */ @@ -489,7 +488,7 @@ void MBALL_OT_reveal_metaelems(wmOperatorType *ot) { /* identifiers */ ot->name= "Reveal"; - ot->description= "Reveal all hidden metaelements"; + ot->description= "Reveal all hidden metaelements"; ot->idname= "MBALL_OT_reveal_metaelems"; /* callback functions */ diff --git a/source/blender/editors/metaball/mball_ops.c b/source/blender/editors/metaball/mball_ops.c index 9b8cccbbfce..e8d2237d8a2 100644 --- a/source/blender/editors/metaball/mball_ops.c +++ b/source/blender/editors/metaball/mball_ops.c @@ -31,8 +31,6 @@ #include "RNA_access.h" -#include "DNA_listBase.h" -#include "DNA_windowmanager_types.h" #include "ED_screen.h" @@ -66,6 +64,7 @@ void ED_keymap_metaball(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "MBALL_OT_delete_metaelems", XKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "MBALL_OT_delete_metaelems", DELKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "MBALL_OT_delete_metaelems", BACKSPACEKEY, 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_all", AKEY, KM_PRESS, 0, 0); |