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:
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_geodesic.c')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_geodesic.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_geodesic.c b/source/blender/editors/sculpt_paint/sculpt_geodesic.c
index 5d74853be8c..0a5d2949ef0 100644
--- a/source/blender/editors/sculpt_paint/sculpt_geodesic.c
+++ b/source/blender/editors/sculpt_paint/sculpt_geodesic.c
@@ -34,8 +34,12 @@
#define SCULPT_GEODESIC_VERTEX_NONE -1
/* Propagate distance from v1 and v2 to v0. */
-static bool sculpt_geodesic_mesh_test_dist_add(
- MVert *mvert, const int v0, const int v1, const int v2, float *dists, GSet *initial_verts)
+static bool sculpt_geodesic_mesh_test_dist_add(const float (*positions)[3],
+ const int v0,
+ const int v1,
+ const int v2,
+ float *dists,
+ GSet *initial_verts)
{
if (BLI_gset_haskey(initial_verts, POINTER_FROM_INT(v0))) {
return false;
@@ -53,11 +57,11 @@ static bool sculpt_geodesic_mesh_test_dist_add(
return false;
}
dist0 = geodesic_distance_propagate_across_triangle(
- mvert[v0].co, mvert[v1].co, mvert[v2].co, dists[v1], dists[v2]);
+ positions[v0], positions[v1], positions[v2], dists[v1], dists[v2]);
}
else {
float vec[3];
- sub_v3_v3v3(vec, mvert[v1].co, mvert[v0].co);
+ sub_v3_v3v3(vec, positions[v1], positions[v0]);
dist0 = dists[v1] + len_v3(vec);
}
@@ -81,7 +85,7 @@ static float *SCULPT_geodesic_mesh_create(Object *ob,
const float limit_radius_sq = limit_radius * limit_radius;
- MVert *verts = SCULPT_mesh_deformed_mverts_get(ss);
+ float(*positions)[3] = SCULPT_mesh_deformed_positions_get(ss);
const MEdge *edges = BKE_mesh_edges(mesh);
const MPoly *polys = BKE_mesh_polys(mesh);
const MLoop *loops = BKE_mesh_loops(mesh);
@@ -135,9 +139,9 @@ static float *SCULPT_geodesic_mesh_create(Object *ob,
* number of vertices (usually just 1 or 2). */
GSET_ITER (gs_iter, initial_verts) {
const int v = POINTER_AS_INT(BLI_gsetIterator_getKey(&gs_iter));
- float *v_co = verts[v].co;
+ float *v_co = positions[v];
for (int i = 0; i < totvert; i++) {
- if (len_squared_v3v3(v_co, verts[i].co) <= limit_radius_sq) {
+ if (len_squared_v3v3(v_co, positions[i]) <= limit_radius_sq) {
BLI_BITMAP_ENABLE(affected_vertex, i);
}
}
@@ -167,7 +171,7 @@ static float *SCULPT_geodesic_mesh_create(Object *ob,
SWAP(int, v1, v2);
}
sculpt_geodesic_mesh_test_dist_add(
- verts, v2, v1, SCULPT_GEODESIC_VERTEX_NONE, dists, initial_verts);
+ positions, v2, v1, SCULPT_GEODESIC_VERTEX_NONE, dists, initial_verts);
}
if (ss->epmap[e].count != 0) {
@@ -184,7 +188,8 @@ static float *SCULPT_geodesic_mesh_create(Object *ob,
if (ELEM(v_other, v1, v2)) {
continue;
}
- if (sculpt_geodesic_mesh_test_dist_add(verts, v_other, v1, v2, dists, initial_verts)) {
+ if (sculpt_geodesic_mesh_test_dist_add(
+ positions, v_other, v1, v2, dists, initial_verts)) {
for (int edge_map_index = 0; edge_map_index < ss->vemap[v_other].count;
edge_map_index++) {
const int e_other = ss->vemap[v_other].indices[edge_map_index];