[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23766] trunk/blender/source/blender/ editors/mesh/editmesh_add.c: adding a cone didnt work
Campbell Barton
ideasman42 at gmail.com
Sun Oct 11 01:15:52 CEST 2009
Revision: 23766
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23766
Author: campbellbarton
Date: 2009-10-11 01:15:52 +0200 (Sun, 11 Oct 2009)
Log Message:
-----------
adding a cone didnt work
Modified Paths:
--------------
trunk/blender/source/blender/editors/mesh/editmesh_add.c
Modified: trunk/blender/source/blender/editors/mesh/editmesh_add.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_add.c 2009-10-10 22:34:33 UTC (rev 23765)
+++ trunk/blender/source/blender/editors/mesh/editmesh_add.c 2009-10-10 23:15:52 UTC (rev 23766)
@@ -1184,14 +1184,14 @@
/* 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 @@
/* 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 @@
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 @@
}
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 @@
/* 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 @@
/* 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);
}
More information about the Bf-blender-cvs
mailing list