diff options
author | Joseph Eagar <joeedh@gmail.com> | 2010-09-07 09:47:34 +0400 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2010-09-07 09:47:34 +0400 |
commit | 82432d0d99f2101ee2ceba86bdc49669b5fa306f (patch) | |
tree | ada47d0a65cb7614ead93fcdbb3421e5398ff3dc /source/blender/editors/metaball | |
parent | 859c5a42f0fe8b9bec0d3ddce1612942942619a7 (diff) | |
parent | 8a320974f1b3e6004db3b3ad64f97742f878cbee (diff) |
merge from trunk at r31523
Diffstat (limited to 'source/blender/editors/metaball')
-rw-r--r-- | source/blender/editors/metaball/mball_edit.c | 51 |
1 files changed, 5 insertions, 46 deletions
diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c index d097caac63d..62ebe84e078 100644 --- a/source/blender/editors/metaball/mball_edit.c +++ b/source/blender/editors/metaball/mball_edit.c @@ -45,6 +45,7 @@ #include "BKE_depsgraph.h" #include "BKE_context.h" +#include "BKE_mball.h" #include "ED_screen.h" #include "ED_view3d.h" @@ -103,53 +104,11 @@ MetaElem *add_metaball_primitive(bContext *C, float mat[4][4], int type, int new 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; } |