diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-12-18 16:19:55 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-12-18 16:22:12 +0300 |
commit | 6ccf9619153ea412c7a8c320a3d59d9ec50600c8 (patch) | |
tree | 7d4f8f7afb2bd8f7be01fd7f7f6e123dc9727772 /source/blender/blenkernel/intern/subdiv_ccg.c | |
parent | eb78579bb65820b7eab2049d614a9ad70d1c8d07 (diff) |
Fix T59478: Information Bar Missing Data when in Sculpt Mode
Display statistics from CCG structure.
This makes values to be different from what is shown in object
mode, since CCG is operating on individual grids, and object
mode will stitch those grids. But on another, those values from
CCG is what sculpt mode is actually "sees" or "uses".
The number of faces should be the same in both sculpt and object
modes.
Diffstat (limited to 'source/blender/blenkernel/intern/subdiv_ccg.c')
-rw-r--r-- | source/blender/blenkernel/intern/subdiv_ccg.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/subdiv_ccg.c b/source/blender/blenkernel/intern/subdiv_ccg.c index e488b1129fc..5d8111197c0 100644 --- a/source/blender/blenkernel/intern/subdiv_ccg.c +++ b/source/blender/blenkernel/intern/subdiv_ccg.c @@ -1186,3 +1186,18 @@ void BKE_subdiv_ccg_average_stitch_faces(SubdivCCG *subdiv_ccg, */ subdiv_ccg_average_all_boundaries_and_corners(subdiv_ccg, &key); } + +void BKE_subdiv_ccg_topology_counters( + const SubdivCCG *subdiv_ccg, + int *r_num_vertices, int *r_num_edges, + int *r_num_faces, int *r_num_loops) +{ + const int num_grids = subdiv_ccg->num_grids; + const int grid_size = subdiv_ccg->grid_size; + const int grid_area = grid_size * grid_size; + const int num_edges_per_grid = 2 * (grid_size * (grid_size - 1)); + *r_num_vertices = num_grids * grid_area; + *r_num_edges = num_grids * num_edges_per_grid; + *r_num_faces = num_grids * (grid_size - 1) * (grid_size - 1); + *r_num_loops = *r_num_faces * 4; +} |