diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-10-11 03:15:52 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-10-11 03:15:52 +0400 |
commit | fc44a97b73ce802a09eafc1c607afc123f970fec (patch) | |
tree | d05339ac6b8318426a99754cbc0d38bac8dad525 /source/blender/editors/mesh/editmesh_add.c | |
parent | a3f6b0ed00e2f93c7e666763e94bdf29003110ee (diff) |
adding a cone didnt work
Diffstat (limited to 'source/blender/editors/mesh/editmesh_add.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_add.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index cb71765906c..d703ba1fb35 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -1184,14 +1184,14 @@ static void make_prim(Object *obedit, int type, float mat[4][4], int tot, int se /* center vertices */ /* type PRIM_CONE can only have 1 one side filled * if the cone has no capping, dont add vtop */ - if((fill && type>1) || type == PRIM_CONE) { + if(type == PRIM_CONE || (fill && !ELEM(type, PRIM_PLANE, PRIM_CUBE))) { vec[0]= vec[1]= 0.0f; - vec[2]= -depth; + vec[2]= type==PRIM_CONE ? depth : -depth; Mat4MulVecfl(mat, vec); vdown= addvertlist(em, vec, NULL); if((ext || type==PRIM_CONE) && fill) { vec[0]= vec[1]= 0.0f; - vec[2]= depth; + vec[2]= type==PRIM_CONE ? -depth : depth; Mat4MulVecfl(mat,vec); vtop= addvertlist(em, vec, NULL); } @@ -1204,7 +1204,7 @@ static void make_prim(Object *obedit, int type, float mat[4][4], int tot, int se /* top and bottom face */ if(fill || type==PRIM_CONE) { - if(tot==4 && (type==0 || type==1)) { + if(tot==4 && ELEM(type, PRIM_PLANE, PRIM_CUBE)) { v3= v1->next->next; if(ext) v4= v2->next->next; @@ -1223,7 +1223,7 @@ static void make_prim(Object *obedit, int type, float mat[4][4], int tot, int se v4= v4->next; } } - if(type>1) { + if(!ELEM(type, PRIM_PLANE, PRIM_CUBE)) { addfacelist(em, vdown, v3, v1, 0, NULL, NULL); if(ext) addfacelist(em, vtop, v4, v2, 0, NULL, NULL); } @@ -1248,7 +1248,7 @@ static void make_prim(Object *obedit, int type, float mat[4][4], int tot, int se } addfacelist(em, v3, v1, v2, v4, NULL, NULL); } - else if(type==PRIM_CONE && fill) { + else if(fill && type==PRIM_CONE) { /* add the bottom flat area of the cone * if capping is disabled dont bother */ v3= v1; @@ -1264,7 +1264,7 @@ static void make_prim(Object *obedit, int type, float mat[4][4], int tot, int se /* simple selection flush OK, based on fact it's a single model */ EM_select_flush(em); /* flushes vertex -> edge -> face selection */ - if(type!=0 && type!=13) + if(type!=PRIM_PLANE && type!=PRIM_MONKEY) righthandfaces(em, 1); /* otherwise monkey has eyes in wrong direction */ BKE_mesh_end_editmesh(obedit->data, em); @@ -1525,7 +1525,7 @@ void MESH_OT_primitive_grid_add(wmOperatorType *ot) /* props */ RNA_def_int(ot->srna, "x_subdivisions", 10, INT_MIN, INT_MAX, "X Subdivisions", "", 3, 1000); - RNA_def_int(ot->srna, "y_subdivisions", 10, INT_MIN, INT_MAX, "Y Subdivisons", "", 3, 1000); + RNA_def_int(ot->srna, "y_subdivisions", 10, INT_MIN, INT_MAX, "Y Subdivisions", "", 3, 1000); RNA_def_float(ot->srna, "size", 1.0f, 0.0, FLT_MAX, "Size", "", 0.001, FLT_MAX); } |