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:
authorAntony Riakiotakis <kalast@gmail.com>2014-03-22 19:47:18 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-03-22 19:47:18 +0400
commit0ef416722ebce6b87158429580a55cf729ebb020 (patch)
tree0d8fc1fd22e499aa6c67decd5850db39c46e481e /source/blender/blenkernel/intern/pbvh_bmesh.c
parent1206faeb99ab6c09baeb39ce0ed89539621ccebe (diff)
Flood fill for dyntopo constant detail mode.
Nothing spectacular here, fill tools are easy. Just take the dyntopo code and repeat until nothing more to do. The tool can be located in the dyntopo panel when the dyntopo constant detail is on. Also added scale factor for constant detail. This may change when detail sampling gets in, I am not very happy with having two numbers here, still it will give some more control for now.
Diffstat (limited to 'source/blender/blenkernel/intern/pbvh_bmesh.c')
-rw-r--r--source/blender/blenkernel/intern/pbvh_bmesh.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c
index 0176d2055cd..3fae446f1f4 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -1104,7 +1104,7 @@ void BKE_pbvh_build_bmesh(PBVH *bvh, BMesh *bm, int smooth_shading,
}
/* Collapse short edges, subdivide long edges */
-int BKE_pbvh_bmesh_update_topology(PBVH *bvh, PBVHTopologyUpdateMode mode,
+bool BKE_pbvh_bmesh_update_topology(PBVH *bvh, PBVHTopologyUpdateMode mode,
const float center[3], float radius)
{
/* 2 is enough for edge faces - manifold edge */
@@ -1112,7 +1112,7 @@ int BKE_pbvh_bmesh_update_topology(PBVH *bvh, PBVHTopologyUpdateMode mode,
BLI_buffer_declare_static(BMFace *, deleted_faces, BLI_BUFFER_NOP, 32);
const int cd_vert_mask_offset = CustomData_get_offset(&bvh->bm->vdata, CD_PAINT_MASK);
- int modified = FALSE;
+ bool modified = false;
int n;
if (mode & PBVH_Collapse) {
@@ -1122,6 +1122,7 @@ int BKE_pbvh_bmesh_update_topology(PBVH *bvh, PBVHTopologyUpdateMode mode,
EdgeQueueContext eq_ctx = {&q, queue_pool, bvh->bm, cd_vert_mask_offset};
short_edge_queue_create(&eq_ctx, bvh, center, radius);
+ modified |= !BLI_heap_is_empty(q.heap);
pbvh_bmesh_collapse_short_edges(&eq_ctx, bvh, &edge_loops,
&deleted_faces);
BLI_heap_free(q.heap, NULL);
@@ -1135,6 +1136,7 @@ int BKE_pbvh_bmesh_update_topology(PBVH *bvh, PBVHTopologyUpdateMode mode,
EdgeQueueContext eq_ctx = {&q, queue_pool, bvh->bm, cd_vert_mask_offset};
long_edge_queue_create(&eq_ctx, bvh, center, radius);
+ modified |= !BLI_heap_is_empty(q.heap);
pbvh_bmesh_subdivide_long_edges(&eq_ctx, bvh, &edge_loops);
BLI_heap_free(q.heap, NULL);
BLI_mempool_destroy(queue_pool);