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:
authorChris Blackbourn <chrisbblend@gmail.com>2022-06-29 03:27:58 +0300
committerChris Blackbourn <chrisbblend@gmail.com>2022-06-29 03:31:16 +0300
commitf32d7dd0c8aeee53d5bca4e6ff2f2e96468cd062 (patch)
tree8971142c21fb79ac17fd27bcba8b406b947e453a /source/blender/geometry
parent68d037190f1864292c6117b7d16b4a6c77a67fff (diff)
Cleanup(UV): Store nboundaries on pchart (no functional changes)
Prep for D15263
Diffstat (limited to 'source/blender/geometry')
-rw-r--r--source/blender/geometry/intern/uv_parametrizer.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/source/blender/geometry/intern/uv_parametrizer.c b/source/blender/geometry/intern/uv_parametrizer.c
index dcfd148587a..c75a302f8dc 100644
--- a/source/blender/geometry/intern/uv_parametrizer.c
+++ b/source/blender/geometry/intern/uv_parametrizer.c
@@ -131,6 +131,7 @@ typedef struct PChart {
PEdge *edges;
PFace *faces;
int nverts, nedges, nfaces;
+ int nboundaries;
PVert *collapsed_verts;
PEdge *collapsed_edges;
@@ -1138,14 +1139,12 @@ static bool p_quad_split_direction(ParamHandle *handle, const float **co, const
/* Construction: boundary filling */
-static void p_chart_boundaries(PChart *chart, int *r_nboundaries, PEdge **r_outer)
+static void p_chart_boundaries(PChart *chart, PEdge **r_outer)
{
PEdge *e, *be;
float len, maxlen = -1.0;
- if (r_nboundaries) {
- *r_nboundaries = 0;
- }
+ chart->nboundaries = 0;
if (r_outer) {
*r_outer = NULL;
}
@@ -1155,9 +1154,7 @@ static void p_chart_boundaries(PChart *chart, int *r_nboundaries, PEdge **r_oute
continue;
}
- if (r_nboundaries) {
- (*r_nboundaries)++;
- }
+ chart->nboundaries++;
len = 0.0f;
@@ -3079,7 +3076,7 @@ static void p_chart_lscm_begin(PChart *chart, bool live, bool abf)
/* No pins, let's find some ourself. */
PEdge *outer;
- p_chart_boundaries(chart, NULL, &outer);
+ p_chart_boundaries(chart, &outer);
/* Outer can be NULL with non-finite coords. */
if (!(outer && p_chart_symmetry_pins(chart, outer, &pin1, &pin2))) {
@@ -3465,7 +3462,7 @@ static bool p_chart_convex_hull(PChart *chart, PVert ***r_verts, int *r_nverts,
int npoints = 0, i, ulen, llen;
PVert **U, **L, **points, **p;
- p_chart_boundaries(chart, NULL, &be);
+ p_chart_boundaries(chart, &be);
if (!be) {
return false;
@@ -3949,7 +3946,7 @@ void GEO_uv_parametrizer_construct_end(ParamHandle *phandle,
int *count_fail)
{
PChart *chart = phandle->construction_chart;
- int i, j, nboundaries = 0;
+ int i, j;
PEdge *outer;
param_assert(phandle->state == PHANDLE_STATE_ALLOCATED);
@@ -3969,9 +3966,9 @@ void GEO_uv_parametrizer_construct_end(ParamHandle *phandle,
PVert *v;
chart = phandle->charts[i];
- p_chart_boundaries(chart, &nboundaries, &outer);
+ p_chart_boundaries(chart, &outer);
- if (!topology_from_uvs && nboundaries == 0) {
+ if (!topology_from_uvs && chart->nboundaries == 0) {
p_chart_delete(chart);
if (count_fail != NULL) {
*count_fail += 1;
@@ -3982,7 +3979,7 @@ void GEO_uv_parametrizer_construct_end(ParamHandle *phandle,
phandle->charts[j] = chart;
j++;
- if (fill && (nboundaries > 1)) {
+ if (fill && (chart->nboundaries > 1)) {
p_chart_fill_boundaries(chart, outer);
}