diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-13 18:47:53 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-13 18:47:53 +0400 |
commit | c8ebfe1d12f87ae453fc9191fa7e3ae30aa800d4 (patch) | |
tree | 5fec94cb3019a6957fb8f094e51d34577c6dbeaa /source/blender/editors/uvedit | |
parent | a55e97058b409dc9d62cbfc1634acd3810a2af0e (diff) |
code cleanup:
- use bmesh iterator macros in more places
- rename scanfill variables (were using same names as mesh faces/verts which was confusing)
Diffstat (limited to 'source/blender/editors/uvedit')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_unwrap_ops.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index e504e37cb20..c8dbee65f6a 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -216,8 +216,8 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em, BLI_srand(0); BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) { - ScanFillVert *v, *lastv, *firstv; - ScanFillFace *sefa; + ScanFillVert *sf_vert, *sf_vert_last, *sf_vert_first; + ScanFillFace *sf_tri; ParamKey key, vkeys[4]; ParamBool pin[4], select[4]; BMLoop *ls[3]; @@ -264,35 +264,35 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em, /* ngon - scanfill time! */ BLI_scanfill_begin(&sf_ctx); - firstv = lastv = NULL; + sf_vert_first = sf_vert_last = NULL; BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) { int i; - v = BLI_scanfill_vert_add(&sf_ctx, l->v->co); + sf_vert = BLI_scanfill_vert_add(&sf_ctx, l->v->co); /* add small random offset */ for (i = 0; i < 3; i++) { - v->co[i] += (BLI_frand() - 0.5f) * FLT_EPSILON * 50; + sf_vert->co[i] += (BLI_frand() - 0.5f) * FLT_EPSILON * 50; } - v->tmp.p = l; + sf_vert->tmp.p = l; - if (lastv) { - BLI_scanfill_edge_add(&sf_ctx, lastv, v); + if (sf_vert_last) { + BLI_scanfill_edge_add(&sf_ctx, sf_vert_last, sf_vert); } - lastv = v; - if (!firstv) - firstv = v; + sf_vert_last = sf_vert; + if (!sf_vert_first) + sf_vert_first = sf_vert; } - BLI_scanfill_edge_add(&sf_ctx, firstv, v); + BLI_scanfill_edge_add(&sf_ctx, sf_vert_first, sf_vert); BLI_scanfill_calc_ex(&sf_ctx, TRUE, efa->no); - for (sefa = sf_ctx.fillfacebase.first; sefa; sefa = sefa->next) { - ls[0] = sefa->v1->tmp.p; - ls[1] = sefa->v2->tmp.p; - ls[2] = sefa->v3->tmp.p; + for (sf_tri = sf_ctx.fillfacebase.first; sf_tri; sf_tri = sf_tri->next) { + ls[0] = sf_tri->v1->tmp.p; + ls[1] = sf_tri->v2->tmp.p; + ls[2] = sf_tri->v3->tmp.p; for (i = 0; i < 3; i++) { MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, ls[i]->head.data, CD_MLOOPUV); |