diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-12 14:51:45 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-12 14:51:45 +0400 |
commit | b6dcdb065d9ca6244f2de9e621439f75cf2c386e (patch) | |
tree | db7e8287d27bd6e68085dab6cacb997f5eb473a9 /source/blender/editors/util/crazyspace.c | |
parent | 8b43813b69b36af55635028e18e9b179df217317 (diff) |
code refactor, function renaming for bmesh.
These changes are to make the bmesh api more consistent and easier to learn, grouping similar functions which is convenient for autocomplete.
This uses similar convention to RNA.
* use face/loop/edge/vert as a prefix for functions.
* use 'elem' as a prefix too for functions that can take any type with a BMHeader.
* changed from camel case to underscore separated (like RNA).
Diffstat (limited to 'source/blender/editors/util/crazyspace.c')
-rw-r--r-- | source/blender/editors/util/crazyspace.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/editors/util/crazyspace.c b/source/blender/editors/util/crazyspace.c index c88f6e0d60b..c611a14ae7f 100644 --- a/source/blender/editors/util/crazyspace.c +++ b/source/blender/editors/util/crazyspace.c @@ -146,28 +146,28 @@ void crazyspace_set_quats_editmesh(BMEditMesh *em, float *origcos, float *mapped int *vert_table = MEM_callocN(sizeof(int)*em->bm->totvert, "vert_table"); int index = 0; - BM_ElemIndex_Ensure(em->bm, BM_VERT); + BM_mesh_elem_index_ensure(em->bm, BM_VERT); BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) { - if (!BM_TestHFlag(v, BM_ELEM_SELECT) || BM_TestHFlag(v, BM_ELEM_HIDDEN)) + if (!BM_elem_flag_test(v, BM_ELEM_SELECT) || BM_elem_flag_test(v, BM_ELEM_HIDDEN)) continue; BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_VERT, v) { - BMLoop *l2 = BM_OtherFaceLoop(l->e, l->f, v); + BMLoop *l2 = BM_face_other_loop(l->e, l->f, v); /* retrieve mapped coordinates */ - v1= mappedcos + 3*BM_GetIndex(l->v); - v2= mappedcos + 3*BM_GetIndex(BM_OtherEdgeVert(l2->e, l->v)); - v3= mappedcos + 3*BM_GetIndex(BM_OtherEdgeVert(l->e, l->v)); + v1= mappedcos + 3*BM_elem_index_get(l->v); + v2= mappedcos + 3*BM_elem_index_get(BM_edge_other_vert(l2->e, l->v)); + v3= mappedcos + 3*BM_elem_index_get(BM_edge_other_vert(l->e, l->v)); - co1= (origcos)? origcos + 3*BM_GetIndex(l->v) : l->v->co; - co2= (origcos)? origcos + 3*BM_GetIndex(BM_OtherEdgeVert(l2->e, l->v)) : BM_OtherEdgeVert(l2->e, l->v)->co; - co3= (origcos)? origcos + 3*BM_GetIndex(BM_OtherEdgeVert(l->e, l->v)) : BM_OtherEdgeVert(l->e, l->v)->co; + co1= (origcos)? origcos + 3*BM_elem_index_get(l->v) : l->v->co; + co2= (origcos)? origcos + 3*BM_elem_index_get(BM_edge_other_vert(l2->e, l->v)) : BM_edge_other_vert(l2->e, l->v)->co; + co3= (origcos)? origcos + 3*BM_elem_index_get(BM_edge_other_vert(l->e, l->v)) : BM_edge_other_vert(l->e, l->v)->co; set_crazy_vertex_quat(quats, v1, v2, v3, co1, co2, co3); quats+= 4; - vert_table[BM_GetIndex(l->v)] = index+1; + vert_table[BM_elem_index_get(l->v)] = index+1; index++; break; /*just do one corner*/ @@ -177,9 +177,9 @@ void crazyspace_set_quats_editmesh(BMEditMesh *em, float *origcos, float *mapped index = 0; BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) { if (vert_table[index] != 0) - BM_SetIndex(v, vert_table[index]-1); /* set_dirty! */ + BM_elem_index_set(v, vert_table[index]-1); /* set_dirty! */ else - BM_SetIndex(v, -1); /* set_dirty! */ + BM_elem_index_set(v, -1); /* set_dirty! */ index++; } |