rename defines to upper case.

This commit is contained in:
2012-02-06 22:57:25 +00:00
parent b0f9d3a8af
commit c6f07c651e
15 changed files with 104 additions and 103 deletions

View File

@@ -364,7 +364,7 @@ void bmesh_begin_edit(BMesh *bm, int flag);
void bmesh_end_edit(BMesh *bm, int flag);
#define bm_firstfaceloop(p) ((BMLoopList*)(p->loops.first))->first
#define BM_FACE_FIRST_LOOP(p) ((BMLoopList *)((p)->loops.first))->first
/* size to use for static arrays when dealing with NGons,
* alloc after this limit is reached.

View File

@@ -216,7 +216,7 @@ void BM_face_interp_from_face(BMesh *bm, BMFace *target, BMFace *source)
BM_Copy_Attributes(bm, bm, source, target);
i = 0;
l2 = l_first = bm_firstfaceloop(source);
l2 = l_first = BM_FACE_FIRST_LOOP(source);
do {
copy_v3_v3(cos[i], l2->v->co);
blocks[i] = l2->head.data;
@@ -224,7 +224,7 @@ void BM_face_interp_from_face(BMesh *bm, BMFace *target, BMFace *source)
} while ((l2 = l2->next) != l_first);
i = 0;
l1 = l_first = bm_firstfaceloop(target);
l1 = l_first = BM_FACE_FIRST_LOOP(target);
do {
interp_weights_poly_v3(w, cos, source->len, l1->v->co);
CustomData_bmesh_interp(&bm->ldata, blocks, w, NULL, source->len, l1->head.data);
@@ -395,13 +395,13 @@ static int compute_mdisp_quad(BMLoop *l, double v1[3], double v2[3], double v3[3
BMLoop *l2;
/* computer center */
l2 = bm_firstfaceloop(l->f);
l2 = BM_FACE_FIRST_LOOP(l->f);
do {
cent[0] += (double)l2->v->co[0];
cent[1] += (double)l2->v->co[1];
cent[2] += (double)l2->v->co[2];
l2 = l2->next;
} while (l2 != bm_firstfaceloop(l->f));
} while (l2 != BM_FACE_FIRST_LOOP(l->f));
VECMUL(cent, (1.0 / (double)l->f->len));
@@ -561,7 +561,7 @@ static void bmesh_loop_interp_mdisps(BMesh *bm, BMLoop *target, BMFace *source)
/* if no disps data allocate a new grid, the size of the first grid in source. */
if (!mdisps->totdisp) {
MDisps *md2 = CustomData_bmesh_get(&bm->ldata, bm_firstfaceloop(source)->head.data, CD_MDISPS);
MDisps *md2 = CustomData_bmesh_get(&bm->ldata, BM_FACE_FIRST_LOOP(source)->head.data, CD_MDISPS);
mdisps->totdisp = md2->totdisp;
if (mdisps->totdisp) {
@@ -598,7 +598,7 @@ static void bmesh_loop_interp_mdisps(BMesh *bm, BMLoop *target, BMFace *source)
VECMUL(co, x);
VECADD2(co, co1);
l2 = bm_firstfaceloop(source);
l2 = BM_FACE_FIRST_LOOP(source);
do {
double x2, y2;
MDisps *md1, *md2;
@@ -613,7 +613,7 @@ static void bmesh_loop_interp_mdisps(BMesh *bm, BMLoop *target, BMFace *source)
old_mdisps_bilinear(md1->disps[iy * res + ix], md2->disps, res, (float)x2, (float)y2);
}
l2 = l2->next;
} while (l2 != bm_firstfaceloop(source));
} while (l2 != BM_FACE_FIRST_LOOP(source));
}
}
}
@@ -742,7 +742,7 @@ void BM_loop_interp_from_face(BMesh *bm, BMLoop *target, BMFace *source,
BM_Copy_Attributes(bm, bm, source, target->f);
i = 0;
l = l_first = bm_firstfaceloop(source);
l = l_first = BM_FACE_FIRST_LOOP(source);
do {
copy_v3_v3(cos[i], l->v->co);
add_v3_v3(cent, cos[i]);
@@ -814,7 +814,7 @@ void BM_vert_interp_from_face(BMesh *bm, BMVert *v, BMFace *source)
int i;
i = 0;
l = l_first = bm_firstfaceloop(source);
l = l_first = BM_FACE_FIRST_LOOP(source);
do {
copy_v3_v3(cos[i], l->v->co);
add_v3_v3(cent, cos[i]);

View File

@@ -394,7 +394,7 @@ void *bmiter__edge_of_face_step(BMIter *iter)
void bmiter__loop_of_face_begin(BMIter *iter)
{
init_iterator(iter);
iter->firstloop = iter->nextloop = bm_firstfaceloop(iter->pdata);
iter->firstloop = iter->nextloop = BM_FACE_FIRST_LOOP(iter->pdata);
}
void *bmiter__loop_of_face_step(BMIter *iter)

View File

@@ -98,12 +98,12 @@ void BM_SelectMode_Flush(BMesh *bm)
}
for (f = BMIter_New(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BMIter_Step(&faces)) {
totsel = 0;
l = (BMLoop *) bm_firstfaceloop(f);
l = (BMLoop *) BM_FACE_FIRST_LOOP(f);
do {
if (BM_TestHFlag(l->v, BM_SELECT))
totsel++;
l = l->next;
} while (l != bm_firstfaceloop(f));
} while (l != BM_FACE_FIRST_LOOP(f));
if (totsel == f->len && !BM_TestHFlag(f, BM_HIDDEN)) {
BM_SetHFlag(f, BM_SELECT);
@@ -116,12 +116,12 @@ void BM_SelectMode_Flush(BMesh *bm)
else if (bm->selectmode & SCE_SELECT_EDGE) {
for (f = BMIter_New(&faces, bm, BM_FACES_OF_MESH, bm); f; f = BMIter_Step(&faces)) {
totsel = 0;
l = bm_firstfaceloop(f);
l = BM_FACE_FIRST_LOOP(f);
do {
if (BM_TestHFlag(&(l->e->head), BM_SELECT))
totsel++;
l = l->next;
} while (l != bm_firstfaceloop(f));
} while (l != BM_FACE_FIRST_LOOP(f));
if (totsel == f->len && !BM_TestHFlag(f, BM_HIDDEN)) {
BM_SetHFlag(f, BM_SELECT);
@@ -250,12 +250,12 @@ void BM_Select_Face(BMesh *bm, BMFace *f, int select)
if (!BM_TestHFlag(f, BM_SELECT)) bm->totfacesel += 1;
BM_SetHFlag(&(f->head), BM_SELECT);
l = (BMLoop *) bm_firstfaceloop(f);
l = (BMLoop *) BM_FACE_FIRST_LOOP(f);
do {
BM_Select_Vert(bm, l->v, TRUE);
BM_Select_Edge(bm, l->e, TRUE);
l = l->next;
} while (l != bm_firstfaceloop(f));
} while (l != BM_FACE_FIRST_LOOP(f));
}
else {
BMIter liter;

View File

@@ -266,14 +266,14 @@ BMFace *BM_Join_TwoFaces(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e)
jed = e;
if (!jed) {
/* search for an edge that has both these faces in its radial cycl */
l1 = bm_firstfaceloop(f1);
l1 = BM_FACE_FIRST_LOOP(f1);
do {
if (l1->radial_next->f == f2) {
jed = l1->e;
break;
}
l1 = l1->next;
} while (l1 != bm_firstfaceloop(f1));
} while (l1 != BM_FACE_FIRST_LOOP(f1));
}
if (!jed) {
@@ -367,17 +367,17 @@ BMFace *BM_Split_Face(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2, BMLoop **nl,
if (has_mdisp && (nf != f)) {
BMLoop *l;
l = bm_firstfaceloop(f);
l = BM_FACE_FIRST_LOOP(f);
do {
BM_loop_interp_from_face(bm, l, of, 0, 1);
l = l->next;
} while (l != bm_firstfaceloop(f));
} while (l != BM_FACE_FIRST_LOOP(f));
l = bm_firstfaceloop(nf);
l = BM_FACE_FIRST_LOOP(nf);
do {
BM_loop_interp_from_face(bm, l, of, 0, 1);
l = l->next;
} while (l != bm_firstfaceloop(nf));
} while (l != BM_FACE_FIRST_LOOP(nf));
BM_Kill_Face(bm, of);
@@ -607,11 +607,11 @@ BMVert *BM_Split_Edge(BMesh *bm, BMVert *v, BMEdge *e, BMEdge **ne, float percen
do {
if (!BLI_smallhash_haskey(&hash, (intptr_t)l->f)) {
l2 = bm_firstfaceloop(l->f);
l2 = BM_FACE_FIRST_LOOP(l->f);
do {
BM_loop_interp_multires(bm, l2, oldfaces[i]);
l2 = l2->next;
} while (l2 != bm_firstfaceloop(l->f));
} while (l2 != BM_FACE_FIRST_LOOP(l->f));
}
l = l->radial_next;
} while (l != e1->l);

View File

@@ -207,7 +207,7 @@ BMFace *BM_Copy_Face(BMesh *bm, BMFace *f, int copyedges, int copyverts)
BMFace *f2;
int i;
l = bm_firstfaceloop(f);
l = BM_FACE_FIRST_LOOP(f);
do {
if (copyverts) {
BMVert *v = BM_Make_Vert(bm, l->v->co, l->v);
@@ -217,9 +217,9 @@ BMFace *BM_Copy_Face(BMesh *bm, BMFace *f, int copyedges, int copyverts)
BLI_array_append(verts, l->v);
}
l = l->next;
} while (l != bm_firstfaceloop(f));
} while (l != BM_FACE_FIRST_LOOP(f));
l = bm_firstfaceloop(f);
l = BM_FACE_FIRST_LOOP(f);
i = 0;
do {
if (copyedges) {
@@ -244,19 +244,19 @@ BMFace *BM_Copy_Face(BMesh *bm, BMFace *f, int copyedges, int copyverts)
i++;
l = l->next;
} while (l != bm_firstfaceloop(f));
} while (l != BM_FACE_FIRST_LOOP(f));
f2 = BM_Make_Face(bm, verts, edges, f->len, 0);
BM_Copy_Attributes(bm, bm, f, f2);
l = bm_firstfaceloop(f);
l2 = bm_firstfaceloop(f2);
l = BM_FACE_FIRST_LOOP(f);
l2 = BM_FACE_FIRST_LOOP(f2);
do {
BM_Copy_Attributes(bm, bm, l, l2);
l = l->next;
l2 = l2->next;
} while (l != bm_firstfaceloop(f));
} while (l != BM_FACE_FIRST_LOOP(f));
return f2;
}
@@ -408,7 +408,7 @@ int bmesh_check_element(BMesh *UNUSED(bm), void *element, const char htype)
if (!f->loops.first)
err |= (1 << 16);
l = bm_firstfaceloop(f);
l = BM_FACE_FIRST_LOOP(f);
do {
if (l->f != f) {
fprintf(stderr, "%s: loop inside one face points to another! (bmesh internal error)\n", __func__);
@@ -431,7 +431,7 @@ int bmesh_check_element(BMesh *UNUSED(bm), void *element, const char htype)
len++;
l = l->next;
} while (l != bm_firstfaceloop(f));
} while (l != BM_FACE_FIRST_LOOP(f));
if (len != f->len)
err |= (1 << 23);
@@ -509,11 +509,11 @@ void BM_Kill_Face_Edges(BMesh *bm, BMFace *f)
BMLoop *l;
int i;
l = bm_firstfaceloop(f);
l = BM_FACE_FIRST_LOOP(f);
do {
BLI_array_append(edges, l->e);
l = l->next;
} while (l != bm_firstfaceloop(f));
} while (l != BM_FACE_FIRST_LOOP(f));
for (i = 0; i < BLI_array_count(edges); i++) {
BM_Kill_Edge(bm, edges[i]);
@@ -529,11 +529,11 @@ void BM_Kill_Face_Verts(BMesh *bm, BMFace *f)
BMLoop *l;
int i;
l = bm_firstfaceloop(f);
l = BM_FACE_FIRST_LOOP(f);
do {
BLI_array_append(verts, l->v);
l = l->next;
} while (l != bm_firstfaceloop(f));
} while (l != BM_FACE_FIRST_LOOP(f));
for (i = 0; i < BLI_array_count(verts); i++) {
BM_Kill_Vert(bm, verts[i]);
@@ -861,7 +861,7 @@ BMFace *BM_Join_Faces(BMesh *bm, BMFace **faces, int totface)
for (i = 0; i < totface; i++) {
f = faces[i];
l = bm_firstfaceloop(f);
l = BM_FACE_FIRST_LOOP(f);
do {
int rlen = count_flagged_radial(bm, l, _FLAG_JF);
@@ -902,7 +902,7 @@ BMFace *BM_Join_Faces(BMesh *bm, BMFace **faces, int totface)
}
l = l->next;
} while (l != bm_firstfaceloop(f));
} while (l != BM_FACE_FIRST_LOOP(f));
for (lst = f->loops.first; lst; lst = lst->next) {
if (lst == f->loops.first) continue;
@@ -921,7 +921,7 @@ BMFace *BM_Join_Faces(BMesh *bm, BMFace **faces, int totface)
}
/* copy over loop dat */
l = bm_firstfaceloop(newf);
l = BM_FACE_FIRST_LOOP(newf);
do {
BMLoop *l2 = l->radial_next;
@@ -941,7 +941,7 @@ BMFace *BM_Join_Faces(BMesh *bm, BMFace **faces, int totface)
}
l = l->next;
} while (l != bm_firstfaceloop(newf));
} while (l != BM_FACE_FIRST_LOOP(newf));
BM_Copy_Attributes(bm, bm, faces[0], newf);
@@ -962,14 +962,14 @@ BMFace *BM_Join_Faces(BMesh *bm, BMFace **faces, int totface)
/* handle multires dat */
if (CustomData_has_layer(&bm->ldata, CD_MDISPS)) {
l = bm_firstfaceloop(newf);
l = BM_FACE_FIRST_LOOP(newf);
do {
for (i = 0; i < totface; i++) {
BM_loop_interp_multires(bm, l, faces[i]);
}
l = l->next;
} while (l != bm_firstfaceloop(newf));
} while (l != BM_FACE_FIRST_LOOP(newf));
}
/* delete old geometr */
@@ -1080,7 +1080,7 @@ BMFace *bmesh_sfme(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2,
/* verify that v1 and v2 are in face */
len = f->len;
for (i = 0, curloop = bm_firstfaceloop(f); i < len; i++, curloop = curloop->next) {
for (i = 0, curloop = BM_FACE_FIRST_LOOP(f); i < len; i++, curloop = curloop->next) {
if (curloop->v == v1) v1loop = curloop;
else if (curloop->v == v2) v2loop = curloop;
}
@@ -1409,8 +1409,8 @@ int bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv)
killoop->next->prev = killoop->prev;
killoop->prev->next = killoop->next;
if (bm_firstfaceloop(killoop->f) == killoop)
bm_firstfaceloop(killoop->f) = killoop->next;
if (BM_FACE_FIRST_LOOP(killoop->f) == killoop)
BM_FACE_FIRST_LOOP(killoop->f) = killoop->next;
killoop->next = NULL;
killoop->prev = NULL;
@@ -1568,31 +1568,31 @@ BMFace *bmesh_jfke(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e)
}
/* validate no internal join */
for (i = 0, curloop = bm_firstfaceloop(f1); i < f1len; i++, curloop = curloop->next) {
for (i = 0, curloop = BM_FACE_FIRST_LOOP(f1); i < f1len; i++, curloop = curloop->next) {
bmesh_api_setindex(curloop->v, 0);
}
for (i = 0, curloop = bm_firstfaceloop(f2); i < f2len; i++, curloop = curloop->next) {
for (i = 0, curloop = BM_FACE_FIRST_LOOP(f2); i < f2len; i++, curloop = curloop->next) {
bmesh_api_setindex(curloop->v, 0);
}
for (i = 0, curloop = bm_firstfaceloop(f1); i < f1len; i++, curloop = curloop->next) {
for (i = 0, curloop = BM_FACE_FIRST_LOOP(f1); i < f1len; i++, curloop = curloop->next) {
if (curloop != f1loop) {
bmesh_api_setindex(curloop->v, bmesh_api_getindex(curloop->v) + 1);
}
}
for (i = 0, curloop = bm_firstfaceloop(f2); i < f2len; i++, curloop = curloop->next) {
for (i = 0, curloop = BM_FACE_FIRST_LOOP(f2); i < f2len; i++, curloop = curloop->next) {
if (curloop != f2loop) {
bmesh_api_setindex(curloop->v, bmesh_api_getindex(curloop->v) + 1);
}
}
for (i = 0, curloop = bm_firstfaceloop(f1); i < f1len; i++, curloop = curloop->next) {
for (i = 0, curloop = BM_FACE_FIRST_LOOP(f1); i < f1len; i++, curloop = curloop->next) {
if (bmesh_api_getindex(curloop->v) > 1) {
return NULL;
}
}
for (i = 0, curloop = bm_firstfaceloop(f2); i < f2len; i++, curloop = curloop->next) {
for (i = 0, curloop = BM_FACE_FIRST_LOOP(f2); i < f2len; i++, curloop = curloop->next) {
if (bmesh_api_getindex(curloop->v) > 1) {
return NULL;
}
@@ -1606,15 +1606,15 @@ BMFace *bmesh_jfke(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e)
f2loop->prev->next = f1loop->next;
/* if f1loop was baseloop, make f1loop->next the base. */
if (bm_firstfaceloop(f1) == f1loop)
bm_firstfaceloop(f1) = f1loop->next;
if (BM_FACE_FIRST_LOOP(f1) == f1loop)
BM_FACE_FIRST_LOOP(f1) = f1loop->next;
/* increase length of f1 */
f1->len += (f2->len - 2);
/* make sure each loop points to the proper fac */
newlen = f1->len;
for (i = 0, curloop = bm_firstfaceloop(f1); i < newlen; i++, curloop = curloop->next)
for (i = 0, curloop = BM_FACE_FIRST_LOOP(f1); i < newlen; i++, curloop = curloop->next)
curloop->f = f1;
/* remove edge from the disk cycle of its two vertices */
@@ -1942,7 +1942,7 @@ BMVert *bmesh_urmv(BMesh *bm, BMFace *sf, BMVert *sv)
{
BMLoop *hl, *sl;
hl = sl = bm_firstfaceloop(sf);
hl = sl = BM_FACE_FIRST_LOOP(sf);
do {
if (sl->v == sv) break;
sl = sl->next;

View File

@@ -1101,16 +1101,17 @@ typedef struct bflag {
int flag;
} bflag;
#define b(f) {#f, f},
#define PAIR(f) {#f, f},
static const char *bmesh_flags = {
b(BM_SELECT);
b(BM_SEAM);
b(BM_FGON);
b(BM_HIDDEN);
b(BM_SHARP);
b(BM_SMOOTH);
PAIR(BM_SELECT);
PAIR(BM_SEAM);
PAIR(BM_FGON);
PAIR(BM_HIDDEN);
PAIR(BM_SHARP);
PAIR(BM_SMOOTH);
{NULL, 0};
};
#undef PAIR
int bmesh_str_to_flag(const char *str)
{
@@ -1139,7 +1140,7 @@ int bmesh_str_to_flag(const char *str)
* ff - flagged faces
*/
#define nextc(fmt) ((fmt)[0] != 0 ? (fmt)[1] : 0)
#define NEXT_CHAR(fmt) ((fmt)[0] != 0 ? (fmt)[1] : 0)
static int bmesh_name_to_slotcode(BMOpDefine *def, const char *name)
{
@@ -1252,7 +1253,7 @@ int BMO_VInitOpf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist)
case 'm': {
int size, c;
c = nextc(fmt);
c = NEXT_CHAR(fmt);
fmt++;
if (c == '3') size = 3;
@@ -1301,14 +1302,14 @@ int BMO_VInitOpf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist)
case 'a':
type = *fmt;
if (nextc(fmt) == ' ' || nextc(fmt) == '\t' || nextc(fmt) == '\0') {
if (NEXT_CHAR(fmt) == ' ' || NEXT_CHAR(fmt) == '\t' || NEXT_CHAR(fmt) == '\0') {
BMO_Set_Float(op, slotname, va_arg(vlist, double));
}
else {
ret = 0;
stop = 0;
while (1) {
switch (nextc(fmt)) {
switch (NEXT_CHAR(fmt)) {
case 'f': ret |= BM_FACE; break;
case 'e': ret |= BM_EDGE; break;
case 'v': ret |= BM_VERT; break;

View File

@@ -515,7 +515,7 @@ void bmesh_update_face_normal(BMesh *bm, BMFace *f, float no[3],
switch (f->len) {
case 4:
{
BMVert *v1 = (l = bm_firstfaceloop(f))->v;
BMVert *v1 = (l = BM_FACE_FIRST_LOOP(f))->v;
BMVert *v2 = (l = l->next)->v;
BMVert *v3 = (l = l->next)->v;
BMVert *v4 = (l->next)->v;
@@ -524,7 +524,7 @@ void bmesh_update_face_normal(BMesh *bm, BMFace *f, float no[3],
}
case 3:
{
BMVert *v1 = (l = bm_firstfaceloop(f))->v;
BMVert *v1 = (l = BM_FACE_FIRST_LOOP(f))->v;
BMVert *v2 = (l = l->next)->v;
BMVert *v3 = (l->next)->v;
normal_tri_v3(no, v1->co, v2->co, v3->co);
@@ -561,7 +561,7 @@ void bmesh_update_face_normal_vertex_cos(BMesh *bm, BMFace *f, float no[3],
switch (f->len) {
case 4:
{
BMVert *v1 = (l = bm_firstfaceloop(f))->v;
BMVert *v1 = (l = BM_FACE_FIRST_LOOP(f))->v;
BMVert *v2 = (l = l->next)->v;
BMVert *v3 = (l = l->next)->v;
BMVert *v4 = (l->next)->v;
@@ -574,7 +574,7 @@ void bmesh_update_face_normal_vertex_cos(BMesh *bm, BMFace *f, float no[3],
}
case 3:
{
BMVert *v1 = (l = bm_firstfaceloop(f))->v;
BMVert *v1 = (l = BM_FACE_FIRST_LOOP(f))->v;
BMVert *v2 = (l = l->next)->v;
BMVert *v3 = (l->next)->v;
normal_tri_v3(no,
@@ -709,16 +709,16 @@ int BM_Point_In_Face(BMesh *bm, BMFace *f, const float co[3])
co2[1] = co[ay];
co2[2] = 0;
l = bm_firstfaceloop(f);
l = BM_FACE_FIRST_LOOP(f);
do {
cent[0] += l->v->co[ax];
cent[1] += l->v->co[ay];
l = l->next;
} while (l != bm_firstfaceloop(f));
} while (l != BM_FACE_FIRST_LOOP(f));
mul_v2_fl(cent, 1.0f / (float)f->len);
l = bm_firstfaceloop(f);
l = BM_FACE_FIRST_LOOP(f);
do {
float v1[3], v2[3];
@@ -733,7 +733,7 @@ int BM_Point_In_Face(BMesh *bm, BMFace *f, const float co[3])
crosses += linecrossesf(v1, v2, co2, out) != 0;
l = l->next;
} while (l != bm_firstfaceloop(f));
} while (l != BM_FACE_FIRST_LOOP(f));
return crosses % 2 != 0;
}
@@ -741,7 +741,7 @@ int BM_Point_In_Face(BMesh *bm, BMFace *f, const float co[3])
static int goodline(float (*projectverts)[3], BMFace *f, int v1i,
int v2i, int v3i, int UNUSED(nvert))
{
BMLoop *l = bm_firstfaceloop(f);
BMLoop *l = BM_FACE_FIRST_LOOP(f);
double v1[3], v2[3], v3[3], pv1[3], pv2[3];
int i;
@@ -769,7 +769,7 @@ static int goodline(float (*projectverts)[3], BMFace *f, int v1i,
if (point_in_triangle(v3, v2, v1, pv1)) return 0;
l = l->next;
} while (l != bm_firstfaceloop(f));
} while (l != BM_FACE_FIRST_LOOP(f));
return 1;
}
/*
@@ -789,7 +789,7 @@ static BMLoop *find_ear(BMesh *UNUSED(bm), BMFace *f, float (*verts)[3],
/* float angle, bestangle = 180.0f; */
int isear /*, i = 0 */;
l = bm_firstfaceloop(f);
l = BM_FACE_FIRST_LOOP(f);
do {
isear = 1;
@@ -818,7 +818,7 @@ static BMLoop *find_ear(BMesh *UNUSED(bm), BMFace *f, float (*verts)[3],
}
l = l->next;
}
while (l != bm_firstfaceloop(f));
while (l != BM_FACE_FIRST_LOOP(f));
return bestear;
}
@@ -848,13 +848,13 @@ void BM_Triangulate_Face(BMesh *bm, BMFace *f, float (*projectverts)[3],
/* copy vertex coordinates to vertspace arra */
i = 0;
l = bm_firstfaceloop(f);
l = BM_FACE_FIRST_LOOP(f);
do {
copy_v3_v3(projectverts[i], l->v->co);
BM_SetIndex(l->v, i); /* set dirty! */
i++;
l = l->next;
} while (l != bm_firstfaceloop(f));
} while (l != BM_FACE_FIRST_LOOP(f));
bm->elem_index_dirty |= BM_VERT; /* see above */
@@ -904,7 +904,7 @@ void BM_Triangulate_Face(BMesh *bm, BMFace *f, float (*projectverts)[3],
}
if (f->len > 3) {
l = bm_firstfaceloop(f);
l = BM_FACE_FIRST_LOOP(f);
while (l->f->len > 3) {
nextloop = l->next->next;
f = BM_Split_Face(bm, l->f, l->v, nextloop->v,
@@ -973,7 +973,7 @@ void BM_LegalSplits(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len)
poly_rotate_plane(no, projverts, f->len);
poly_rotate_plane(no, edgeverts, len * 2);
l = bm_firstfaceloop(f);
l = BM_FACE_FIRST_LOOP(f);
for (i = 0; i < f->len; i++) {
p1 = projverts[i];
out[0] = MAX2(out[0], p1[0]) + 0.01f;

View File

@@ -82,14 +82,14 @@ int BM_Vert_In_Edge(BMEdge *e, BMVert *v)
BMLoop *BM_OtherFaceLoop(BMEdge *e, BMFace *f, BMVert *v)
{
BMLoop *l = bm_firstfaceloop(f) /*, *l2, *l3 */;
BMLoop *l = BM_FACE_FIRST_LOOP(f) /*, *l2, *l3 */;
/* int found = 0; */ /* UNUSED */
do {
if (l->e == e) break;
/* found = 1; */ /* UNUSED */
l = l->next;
} while (l != bm_firstfaceloop(f));
} while (l != BM_FACE_FIRST_LOOP(f));
return l->v == v ? l->prev : l->next;
}
@@ -164,14 +164,14 @@ int BM_Edge_In_Face(BMFace *f, BMEdge *e)
{
BMLoop *l;
l = bm_firstfaceloop(f);
l = BM_FACE_FIRST_LOOP(f);
do {
if (l->e == e) {
return 1;
}
l = l->next;
} while (l != bm_firstfaceloop(f));
} while (l != BM_FACE_FIRST_LOOP(f));
return 0;
}
@@ -434,11 +434,11 @@ int BM_Face_Share_Edges(BMFace *f1, BMFace *f2)
BMLoop *l;
int count = 0;
l = bm_firstfaceloop(f1);
l = BM_FACE_FIRST_LOOP(f1);
do {
if (bmesh_radial_find_face(l->e, f2)) count++;
l = l->next;
} while (l != bm_firstfaceloop(f1));
} while (l != BM_FACE_FIRST_LOOP(f1));
return count;
}

View File

@@ -534,7 +534,7 @@ int bmesh_loop_validate(BMFace *f)
int i;
int len = f->len;
BMLoop *curloop, *head;
head = bm_firstfaceloop(f);
head = BM_FACE_FIRST_LOOP(f);
if (head == NULL)
return 0;

View File

@@ -452,9 +452,9 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op)
}
}
e = BM_Make_Edge(bm, firstv, lastv, bm_firstfaceloop(faces[i])->e, 1);
if (bm_firstfaceloop(faces[i])->prev->e != e)
BM_Copy_Attributes(bm, bm, bm_firstfaceloop(faces[i])->prev->e, e);
e = BM_Make_Edge(bm, firstv, lastv, BM_FACE_FIRST_LOOP(faces[i])->e, 1);
if (BM_FACE_FIRST_LOOP(faces[i])->prev->e != e)
BM_Copy_Attributes(bm, bm, BM_FACE_FIRST_LOOP(faces[i])->prev->e, e);
BLI_array_append(edges, e);
f = BM_Make_Ngon(bm, verts[0], verts[1], edges, BLI_array_count(edges), 0);
@@ -833,7 +833,7 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op)
/* clean up any remaining 2-edged face */
BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
if (f->len == 2) {
BMFace *faces[2] = {f, bm_firstfaceloop(f)->radial_next->f};
BMFace *faces[2] = {f, BM_FACE_FIRST_LOOP(f)->radial_next->f};
if (faces[0] == faces[1])
BM_Kill_Face(bm, f);

View File

@@ -103,10 +103,10 @@ void bmesh_extrude_face_indiv_exec(BMesh *bm, BMOperator *op)
f3 = BM_Make_Face_QuadTri(bm, l3->v, l4->v, l2->v, l->v, f, 0);
BM_Copy_Attributes(bm, bm, l->next, bm_firstfaceloop(f3));
BM_Copy_Attributes(bm, bm, l->next, bm_firstfaceloop(f3)->next);
BM_Copy_Attributes(bm, bm, l, bm_firstfaceloop(f3)->next->next);
BM_Copy_Attributes(bm, bm, l, bm_firstfaceloop(f3)->next->next->next);
BM_Copy_Attributes(bm, bm, l->next, BM_FACE_FIRST_LOOP(f3));
BM_Copy_Attributes(bm, bm, l->next, BM_FACE_FIRST_LOOP(f3)->next);
BM_Copy_Attributes(bm, bm, l, BM_FACE_FIRST_LOOP(f3)->next->next);
BM_Copy_Attributes(bm, bm, l, BM_FACE_FIRST_LOOP(f3)->next->next->next);
l2 = BMIter_Step(&liter2);
}

View File

@@ -662,7 +662,7 @@ static BMFace *BME_bevel_poly(BMesh *bm, BMFace *f, float value, int options, BM
/* Can't use a BM_LOOPS_OF_FACE iterator here, because the loops are being modified
* and so the end condition will never hi */
for (l = bm_firstfaceloop(f)->prev, i = 0, len = f->len; i < len; i++, l = l->next) {
for (l = BM_FACE_FIRST_LOOP(f)->prev, i = 0, len = f->len; i < len; i++, l = l->next) {
if (BMO_TestFlag(bm, l->e, BME_BEVEL_BEVEL) && BMO_TestFlag(bm, l->e, BME_BEVEL_ORIG)) {
max = 1.0f;
l = BME_bevel_edge(bm, l, value, options, up_vec, td);

View File

@@ -1773,7 +1773,7 @@ static int select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event
}
else {
if (efa) {
eed = bm_firstfaceloop(efa)->e;
eed = BM_FACE_FIRST_LOOP(efa)->e;
}
else if (!eed) {
if (!eve || !eve->e)

View File

@@ -1902,11 +1902,11 @@ static void knifenet_fill_faces(knifetool_opdata *kcd)
f2 = BM_Make_Face_QuadTri(bm, v1, v2, v3, NULL, NULL, 0);
BMO_SetFlag(bm, f2, FACE_NEW);
l = bm_firstfaceloop(f2);
l = BM_FACE_FIRST_LOOP(f2);
do {
BMO_ClearFlag(bm, l->e, DEL);
l = l->next;
} while (l != bm_firstfaceloop(f2));
} while (l != BM_FACE_FIRST_LOOP(f2));
BMO_ClearFlag(bm, f2, DEL);
BM_SetIndex(f2, i); /* set_dirty! */ /* note, not 100% sure this is dirty? need to check */