Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-05-27 16:42:48 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-05-27 16:42:48 +0400
commit083115c5e790d5c6e87a7a4a42daea70da1ded1b (patch)
tree75314e71ff24b7de4a8508e76662b3afbc3e5ddf /source/blender/bmesh
parente51ee75e826846d44dcbb7028ee44e8f3e7b6858 (diff)
bmesh optimization: use offsets for deform-vert lookups to avoid customdata layer lookups within loops.
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r--source/blender/bmesh/operators/bmo_similar.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/source/blender/bmesh/operators/bmo_similar.c b/source/blender/bmesh/operators/bmo_similar.c
index 5bea47969da..b02f9cdfaa6 100644
--- a/source/blender/bmesh/operators/bmo_similar.c
+++ b/source/blender/bmesh/operators/bmo_similar.c
@@ -530,6 +530,7 @@ void bmo_similar_verts_exec(BMesh *bm, BMOperator *op)
{
#define VERT_MARK 1
+ const int cd_dvert_offset = CustomData_get_offset(&bm->vdata, CD_MDEFORMVERT);
BMOIter vs_iter; /* selected verts iterator */
BMIter v_iter; /* mesh verts iterator */
BMVert *vs; /* selected vertex */
@@ -573,13 +574,9 @@ void bmo_similar_verts_exec(BMesh *bm, BMOperator *op)
break;
case SIMVERT_VGROUP:
- if (CustomData_has_layer(&(bm->vdata), CD_MDEFORMVERT)) {
- v_ext[i].dvert = CustomData_bmesh_get(&bm->vdata, v_ext[i].v->head.data, CD_MDEFORMVERT);
- }
- else {
- v_ext[i].dvert = NULL;
- }
+ v_ext[i].dvert = (cd_dvert_offset != -1) ? BM_ELEM_CD_GET_VOID_P(v_ext[i].v, cd_dvert_offset) : NULL;
break;
+
case SIMVERT_EDGE:
v_ext[i].num_edges = BM_vert_edge_count(v);
break;