[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45152] trunk/blender/source/blender/ editors/mesh: style cleanup: editors/ mesh - mostly whitespace around operators
Campbell Barton
ideasman42 at gmail.com
Mon Mar 26 04:56:56 CEST 2012
Revision: 45152
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45152
Author: campbellbarton
Date: 2012-03-26 02:56:48 +0000 (Mon, 26 Mar 2012)
Log Message:
-----------
style cleanup: editors/mesh - mostly whitespace around operators
Modified Paths:
--------------
trunk/blender/source/blender/editors/mesh/editface.c
trunk/blender/source/blender/editors/mesh/editmesh_add.c
trunk/blender/source/blender/editors/mesh/editmesh_bvh.c
trunk/blender/source/blender/editors/mesh/editmesh_knife.c
trunk/blender/source/blender/editors/mesh/editmesh_loopcut.c
trunk/blender/source/blender/editors/mesh/editmesh_select.c
trunk/blender/source/blender/editors/mesh/editmesh_tools.c
trunk/blender/source/blender/editors/mesh/editmesh_utils.c
trunk/blender/source/blender/editors/mesh/mesh_data.c
trunk/blender/source/blender/editors/mesh/mesh_navmesh.c
trunk/blender/source/blender/editors/mesh/mesh_ops.c
trunk/blender/source/blender/editors/mesh/meshtools.c
Modified: trunk/blender/source/blender/editors/mesh/editface.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editface.c 2012-03-26 02:39:05 UTC (rev 45151)
+++ trunk/blender/source/blender/editors/mesh/editface.c 2012-03-26 02:56:48 UTC (rev 45152)
@@ -27,8 +27,6 @@
* \ingroup edmesh
*/
-
-
#include <math.h>
#include <string.h>
@@ -77,7 +75,7 @@
int totface, totpoly;
int i;
- if (me==NULL || dm==NULL)
+ if (me == NULL || dm == NULL)
return;
/*
@@ -92,7 +90,7 @@
totface = me->totface;
/* loop over tessfaces */
- for (i= 0; i<totface; i++) {
+ for (i = 0; i < totface; i++) {
/* Copy flags onto the original tessface from its original poly */
mp_orig = me->mpoly + index_array[i];
faces[i].flag = mp_orig->flag;
@@ -104,7 +102,7 @@
totpoly = dm->getNumPolys(dm);
/* loop over final derived polys */
- for (i= 0; i<totpoly; i++) {
+ for (i = 0; i < totpoly; i++) {
/* Copy flags onto the final derived poly from the original mesh poly */
mp_orig = me->mpoly + index_array[i];
polys[i].flag = mp_orig->flag;
@@ -117,7 +115,7 @@
totface = dm->getNumTessFaces(dm);
/* loop over tessfaces */
- for (i= 0; i<totface; i++) {
+ for (i = 0; i < totface; i++) {
/* Copy flags onto the final tessface from its final poly */
mp_orig = polys + index_array[i];
faces[i].flag = mp_orig->flag;
@@ -132,29 +130,29 @@
ViewContext vc;
view3d_set_viewcontext(C, &vc);
- if (!me || me->totpoly==0)
+ if (!me || me->totpoly == 0)
return 0;
makeDerivedMesh(scene, ob, NULL, CD_MASK_BAREMESH, 0);
- // XXX if (v3d->flag & V3D_INVALID_BACKBUF) {
+ // XXX if (v3d->flag & V3D_INVALID_BACKBUF) {
// XXX drawview.c! check_backbuf();
// XXX persp(PERSP_VIEW);
-// XXX }
+// XXX }
if (rect) {
/* sample rect to increase changes of selecting, so that when clicking
* on an edge in the backbuf, we can still select a face */
int dist;
- *index = view3d_sample_backbuf_rect(&vc, mval, 3, 1, me->totpoly+1, &dist,0,NULL, NULL);
+ *index = view3d_sample_backbuf_rect(&vc, mval, 3, 1, me->totpoly + 1, &dist, 0, NULL, NULL);
}
else {
/* sample only on the exact position */
*index = view3d_sample_backbuf(&vc, mval[0], mval[1]);
}
- if ((*index)<=0 || (*index)>(unsigned int)me->totpoly)
+ if ((*index) <= 0 || (*index) > (unsigned int)me->totpoly)
return 0;
(*index)--;
@@ -168,15 +166,15 @@
MPoly *mface;
int a;
- me= get_mesh(ob);
- if (me==NULL || me->totpoly==0) return;
+ me = get_mesh(ob);
+ if (me == NULL || me->totpoly == 0) return;
- mface= me->mpoly;
- a= me->totpoly;
+ mface = me->mpoly;
+ a = me->totpoly;
while (a--) {
if ((mface->flag & ME_HIDE) == 0) {
if (unselected) {
- if ( (mface->flag & ME_FACE_SEL)==0) mface->flag |= ME_HIDE;
+ if ( (mface->flag & ME_FACE_SEL) == 0) mface->flag |= ME_HIDE;
}
else {
if ( (mface->flag & ME_FACE_SEL)) mface->flag |= ME_HIDE;
@@ -197,11 +195,11 @@
MPoly *mface;
int a;
- me= get_mesh(ob);
- if (me==NULL || me->totpoly==0) return;
+ me = get_mesh(ob);
+ if (me == NULL || me->totpoly == 0) return;
- mface= me->mpoly;
- a= me->totpoly;
+ mface = me->mpoly;
+ a = me->totpoly;
while (a--) {
if (mface->flag & ME_HIDE) {
mface->flag |= ME_FACE_SEL;
@@ -220,7 +218,7 @@
MLoop *ml;
int i;
- for (i=0, ml=mloop; i<mp->totloop; i++, ml++) {
+ for (i = 0, ml = mloop; i < mp->totloop; i++, ml++) {
BLI_edgehash_insert(ehash, ml->v, ME_POLY_LOOP_NEXT(mloop, mp, i)->v, NULL);
}
}
@@ -233,59 +231,59 @@
MLoop *ml;
MEdge *med;
char *linkflag;
- int a, b, doit=1, mark=0;
+ int a, b, doit = 1, mark = 0;
- ehash= BLI_edgehash_new();
+ ehash = BLI_edgehash_new();
seamhash = BLI_edgehash_new();
- linkflag= MEM_callocN(sizeof(char)*me->totpoly, "linkflaguv");
+ linkflag = MEM_callocN(sizeof(char) * me->totpoly, "linkflaguv");
- for (med=me->medge, a=0; a < me->totedge; a++, med++)
+ for (med = me->medge, a = 0; a < me->totedge; a++, med++)
if (med->flag & ME_SEAM)
BLI_edgehash_insert(seamhash, med->v1, med->v2, NULL);
- if (mode==0 || mode==1) {
+ if (mode == 0 || mode == 1) {
/* only put face under cursor in array */
- mf= ((MPoly*)me->mpoly) + index;
+ mf = ((MPoly *)me->mpoly) + index;
hash_add_face(ehash, mf, me->mloop + mf->loopstart);
- linkflag[index]= 1;
+ linkflag[index] = 1;
}
else {
/* fill array by selection */
- mf= me->mpoly;
- for (a=0; a<me->totpoly; a++, mf++) {
- if (mf->flag & ME_HIDE);
+ mf = me->mpoly;
+ for (a = 0; a < me->totpoly; a++, mf++) {
+ if (mf->flag & ME_HIDE) ;
else if (mf->flag & ME_FACE_SEL) {
hash_add_face(ehash, mf, me->mloop + mf->loopstart);
- linkflag[a]= 1;
+ linkflag[a] = 1;
}
}
}
while (doit) {
- doit= 0;
+ doit = 0;
/* expand selection */
- mf= me->mpoly;
- for (a=0; a<me->totpoly; a++, mf++) {
+ mf = me->mpoly;
+ for (a = 0; a < me->totpoly; a++, mf++) {
if (mf->flag & ME_HIDE)
continue;
if (!linkflag[a]) {
MLoop *mnextl;
- mark= 0;
+ mark = 0;
ml = me->mloop + mf->loopstart;
- for (b=0; b<mf->totloop; b++, ml++) {
- mnextl = b < mf->totloop-1 ? ml - 1 : me->mloop + mf->loopstart;
+ for (b = 0; b < mf->totloop; b++, ml++) {
+ mnextl = b < mf->totloop - 1 ? ml - 1 : me->mloop + mf->loopstart;
if (!BLI_edgehash_haskey(seamhash, ml->v, mnextl->v))
if (!BLI_edgehash_haskey(ehash, ml->v, mnextl->v))
mark = 1;
}
if (mark) {
- linkflag[a]= 1;
+ linkflag[a] = 1;
hash_add_face(ehash, mf, me->mloop + mf->loopstart);
- doit= 1;
+ doit = 1;
}
}
}
@@ -295,25 +293,25 @@
BLI_edgehash_free(ehash, NULL);
BLI_edgehash_free(seamhash, NULL);
- if (mode==0 || mode==2) {
- for (a=0, mf=me->mpoly; a<me->totpoly; a++, mf++)
+ if (mode == 0 || mode == 2) {
+ for (a = 0, mf = me->mpoly; a < me->totpoly; a++, mf++)
if (linkflag[a])
mf->flag |= ME_FACE_SEL;
else
mf->flag &= ~ME_FACE_SEL;
}
- else if (mode==1) {
- for (a=0, mf=me->mpoly; a<me->totpoly; a++, mf++)
+ else if (mode == 1) {
+ for (a = 0, mf = me->mpoly; a < me->totpoly; a++, mf++)
if (linkflag[a] && (mf->flag & ME_FACE_SEL))
break;
- if (a<me->totpoly) {
- for (a=0, mf=me->mpoly; a<me->totpoly; a++, mf++)
+ if (a < me->totpoly) {
+ for (a = 0, mf = me->mpoly; a < me->totpoly; a++, mf++)
if (linkflag[a])
mf->flag &= ~ME_FACE_SEL;
}
else {
- for (a=0, mf=me->mpoly; a<me->totpoly; a++, mf++)
+ for (a = 0, mf = me->mpoly; a < me->totpoly; a++, mf++)
if (linkflag[a])
mf->flag |= ME_FACE_SEL;
}
@@ -325,12 +323,12 @@
void paintface_select_linked(bContext *UNUSED(C), Object *ob, int UNUSED(mval[2]), int mode)
{
Mesh *me;
- unsigned int index=0;
+ unsigned int index = 0;
me = get_mesh(ob);
- if (me==NULL || me->totpoly==0) return;
+ if (me == NULL || me->totpoly == 0) return;
- if (mode==0 || mode==1) {
+ if (mode == 0 || mode == 1) {
// XXX - Causes glitches, not sure why
#if 0
if (!facesel_face_pick(C, me, mval, &index, 1))
@@ -349,12 +347,12 @@
MPoly *mface;
int a;
- me= get_mesh(ob);
- if (me==NULL) return;
+ me = get_mesh(ob);
+ if (me == NULL) return;
if (action == SEL_INVERT) {
- mface= me->mpoly;
- a= me->totpoly;
+ mface = me->mpoly;
+ a = me->totpoly;
while (a--) {
if ((mface->flag & ME_HIDE) == 0) {
mface->flag ^= ME_FACE_SEL;
@@ -366,8 +364,8 @@
if (action == SEL_TOGGLE) {
action = SEL_SELECT;
- mface= me->mpoly;
- a= me->totpoly;
+ mface = me->mpoly;
+ a = me->totpoly;
while (a--) {
if ((mface->flag & ME_HIDE) == 0 && mface->flag & ME_FACE_SEL) {
action = SEL_DESELECT;
@@ -377,20 +375,20 @@
}
}
- mface= me->mpoly;
- a= me->totpoly;
+ mface = me->mpoly;
+ a = me->totpoly;
while (a--) {
if ((mface->flag & ME_HIDE) == 0) {
switch (action) {
- case SEL_SELECT:
- mface->flag |= ME_FACE_SEL;
- break;
- case SEL_DESELECT:
- mface->flag &= ~ME_FACE_SEL;
- break;
- case SEL_INVERT:
- mface->flag ^= ME_FACE_SEL;
- break;
+ case SEL_SELECT:
+ mface->flag |= ME_FACE_SEL;
+ break;
+ case SEL_DESELECT:
+ mface->flag &= ~ME_FACE_SEL;
+ break;
+ case SEL_INVERT:
+ mface->flag ^= ME_FACE_SEL;
+ break;
}
}
mface++;
@@ -409,30 +407,30 @@
MTexPoly *tf;
MLoop *ml;
MVert *mvert;
- int a, b, ok=0;
+ int a, b, ok = 0;
float vec[3], bmat[3][3];
- me= get_mesh(ob);
+ me = get_mesh(ob);
if (!me || !me->mtpoly) return ok;
copy_m3_m4(bmat, ob->obmat);
- mvert= me->mvert;
- mf= me->mpoly;
- tf= me->mtpoly;
- for (a=me->totpoly; a>0; a--, mf++, tf++) {
+ mvert = me->mvert;
+ mf = me->mpoly;
+ tf = me->mtpoly;
+ for (a = me->totpoly; a > 0; a--, mf++, tf++) {
if (mf->flag & ME_HIDE || !(mf->flag & ME_FACE_SEL))
continue;
ml = me->mloop + mf->totloop;
- for (b=0; b<mf->totloop; b++, ml++) {
+ for (b = 0; b < mf->totloop; b++, ml++) {
copy_v3_v3(vec, (mvert[ml->v].co));
mul_m3_v3(bmat, vec);
add_v3_v3v3(vec, vec, ob->obmat[3]);
DO_MINMAX(vec, min, max);
}
- ok= 1;
+ ok = 1;
}
return ok;
@@ -445,9 +443,9 @@
MLoop *ml1, *ml2;
int a;
- for (a=0; a<mf->totloop; a++) {
+ for (a = 0; a < mf->totloop; a++) {
ml1 = loopstart + a;
- ml2 = loopstart + (a+1) % mf->totloop;
+ ml2 = loopstart + (a + 1) % mf->totloop;
BLI_edgehash_insert(ehash, ml1->v, ml2->v, NULL);
}
@@ -461,8 +459,8 @@
MEdge *med;
int a, b;
- me= get_mesh(OBACT);
- if (me==0 || me->totpoly==0) return;
+ me = get_mesh(OBACT);
+ if (me == 0 || me->totpoly == 0) return;
if (mode == 0)
mode = pupmenu("Seams%t|Mark Border Seam %x1|Clear Seam %x2");
@@ -473,11 +471,11 @@
if (mode == 2) {
EdgeHash *ehash = BLI_edgehash_new();
- for (a=0, mf=me->mpoly; a<me->totpoly; a++, mf++)
+ for (a = 0, mf = me->mpoly; a < me->totpoly; a++, mf++)
if (!(mf->flag & ME_HIDE) && (mf->flag & ME_FACE_SEL))
seam_edgehash_insert_face(ehash, mf, me->mloop + mf->loopstart);
- for (a=0, med=me->medge; a<me->totedge; a++, med++)
+ for (a = 0, med = me->medge; a < me->totedge; a++, med++)
if (BLI_edgehash_haskey(ehash, med->v1, med->v2))
med->flag &= ~ME_SEAM;
@@ -488,16 +486,16 @@
EdgeHash *ehash1 = BLI_edgehash_new();
EdgeHash *ehash2 = BLI_edgehash_new();
- for (a=0, mf=me->mpoly; a<me->totpoly; a++, mf++) {
+ for (a = 0, mf = me->mpoly; a < me->totpoly; a++, mf++) {
if ((mf->flag & ME_HIDE) || !(mf->flag & ME_FACE_SEL))
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list