diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-04-07 07:05:39 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-04-07 07:05:39 +0400 |
commit | 212717416b40419c085853b26f4311dde74b1557 (patch) | |
tree | 1001f3d89d058272b048873151d1f1d590b23353 /source/blender/blenkernel | |
parent | 5c5d643938c975bda53f04013ce88486afca2ecf (diff) |
Dyntopo: avoid mask layer lookups while adding/removing verts
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/pbvh_bmesh.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c index 98efc112125..6e481b761d6 100644 --- a/source/blender/blenkernel/intern/pbvh_bmesh.c +++ b/source/blender/blenkernel/intern/pbvh_bmesh.c @@ -285,7 +285,8 @@ static PBVHNode *pbvh_bmesh_node_lookup(PBVH *bvh, GHash *map, void *key) static BMVert *pbvh_bmesh_vert_create(PBVH *bvh, int node_index, const float co[3], - const BMVert *example) + const BMVert *example, + const int cd_vert_mask_offset) { BMVert *v = BM_vert_create(bvh->bm, co, example, BM_CREATE_NOP); void *val = SET_INT_IN_POINTER(node_index); @@ -296,7 +297,7 @@ static BMVert *pbvh_bmesh_vert_create(PBVH *bvh, int node_index, BLI_ghash_insert(bvh->bm_vert_to_node, v, val); /* Log the new vertex */ - BM_log_vert_added(bvh->bm, bvh->bm_log, v); + BM_log_vert_added(bvh->bm_log, v, cd_vert_mask_offset); return v; } @@ -695,7 +696,7 @@ static void pbvh_bmesh_split_edge(EdgeQueueContext *eq_ctx, PBVH *bvh, node_index = GET_INT_FROM_POINTER(BLI_ghash_lookup(bvh->bm_vert_to_node, e->v1)); - v_new = pbvh_bmesh_vert_create(bvh, node_index, mid, e->v1); + v_new = pbvh_bmesh_vert_create(bvh, node_index, mid, e->v1, eq_ctx->cd_vert_mask_offset); /* update paint mask */ if (eq_ctx->cd_vert_mask_offset != -1) { @@ -942,7 +943,7 @@ static void pbvh_bmesh_collapse_edge(PBVH *bvh, BMEdge *e, BMVert *v1, /* Delete unused vertices */ for (j = 0; j < 3; j++) { if (v_tri[j]) { - BM_log_vert_removed(bvh->bm, bvh->bm_log, v_tri[j]); + BM_log_vert_removed(bvh->bm_log, v_tri[j], cd_vert_mask_offset); BM_vert_kill(bvh->bm, v_tri[j]); } } @@ -951,14 +952,14 @@ static void pbvh_bmesh_collapse_edge(PBVH *bvh, BMEdge *e, BMVert *v1, /* Move v_conn to the midpoint of v_conn and v_del (if v_conn still exists, it * may have been deleted above) */ if (!BLI_ghash_haskey(deleted_verts, v_conn)) { - BM_log_vert_before_modified(bvh->bm, bvh->bm_log, v_conn); + BM_log_vert_before_modified(bvh->bm_log, v_conn, cd_vert_mask_offset); mid_v3_v3v3(v_conn->co, v_conn->co, v_del->co); } /* Delete v_del */ BLI_assert(BM_vert_face_count(v_del) == 0); BLI_ghash_insert(deleted_verts, v_del, NULL); - BM_log_vert_removed(bvh->bm, bvh->bm_log, v_del); + BM_log_vert_removed(bvh->bm_log, v_del, cd_vert_mask_offset); BM_vert_kill(bvh->bm, v_del); } |