Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/metaball')
-rw-r--r--source/blender/editors/metaball/CMakeLists.txt35
-rw-r--r--source/blender/editors/metaball/Makefile2
-rw-r--r--source/blender/editors/metaball/mball_edit.c66
3 files changed, 48 insertions, 55 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/Makefile b/source/blender/editors/metaball/Makefile
index d971ec9b412..c28ef59e9db 100644
--- a/source/blender/editors/metaball/Makefile
+++ b/source/blender/editors/metaball/Makefile
@@ -15,7 +15,7 @@
#
# 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.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2007 Blender Foundation
# All rights reserved.
diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c
index 961968959ff..80cea4eea1c 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"
@@ -47,10 +43,9 @@
#include "RNA_define.h"
#include "RNA_access.h"
-#include "BKE_utildefines.h"
#include "BKE_depsgraph.h"
-#include "BKE_object.h"
#include "BKE_context.h"
+#include "BKE_mball.h"
#include "ED_screen.h"
#include "ED_view3d.h"
@@ -63,6 +58,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
@@ -84,13 +83,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) */
@@ -108,49 +103,12 @@ MetaElem *add_metaball_primitive(bContext *C, float mat[4][4], int type, int new
ml->flag &= ~SELECT;
ml= ml->next;
}
-
- ml= MEM_callocN(sizeof(MetaElem), "metaelem");
-
- ml->x= mat[3][0];
- ml->y= mat[3][1];
- ml->z= mat[3][2];
- ml->quat[0]= 1.0;
- ml->quat[1]= 0.0;
- ml->quat[2]= 0.0;
- ml->quat[3]= 0.0;
- ml->rad= 2.0;
- ml->s= 2.0;
- ml->flag= SELECT | MB_SCALE_RAD;
-
- switch(type) {
- 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;
- }
+ ml= add_metaball_element(mball, type);
+ copy_v3_v3(&ml->x, mat[3]);
+
+ ml->flag |= SELECT;
mball->lastelem= ml;
-
return ml;
}
@@ -202,7 +160,7 @@ static int select_all_exec(bContext *C, wmOperator *op)
void MBALL_OT_select_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select/Deselect All";
+ ot->name= "Select or Deselect All";
ot->description= "Change selection of all meta elements";
ot->idname= "MBALL_OT_select_all";
@@ -548,7 +506,7 @@ int mouse_mball(bContext *C, short mval[2], int extend)
if(ml==startelem) break;
}
- /* When some metaelem was found, then it is neccessary to select or
+ /* When some metaelem was found, then it is necessary to select or
* deselet it. */
if(act) {
if(extend==0) {