[Bf-blender-cvs] [6a3c082fe9c] temp-T97352-3d-texturing-seam-bleeding-b2: Do not output vertex to debug svg.
Jeroen Bakker
noreply at git.blender.org
Fri Jun 17 15:06:52 CEST 2022
Commit: 6a3c082fe9c719a7ebb015200af0bf98ff726df2
Author: Jeroen Bakker
Date: Fri Jun 17 15:06:49 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding-b2
https://developer.blender.org/rB6a3c082fe9c719a7ebb015200af0bf98ff726df2
Do not output vertex to debug svg.
===================================================================
M source/blender/blenkernel/BKE_uv_islands.hh
M source/blender/blenkernel/intern/uv_islands.cc
===================================================================
diff --git a/source/blender/blenkernel/BKE_uv_islands.hh b/source/blender/blenkernel/BKE_uv_islands.hh
index 1c6607da15d..2530dfa4d3b 100644
--- a/source/blender/blenkernel/BKE_uv_islands.hh
+++ b/source/blender/blenkernel/BKE_uv_islands.hh
@@ -731,7 +731,7 @@ struct UVIsland {
/* Debug functions to export to a SVG file. */
void svg_header(std::ostream &ss);
-void svg(std::ostream &ss, const UVIsland &islands, int step);
+void svg(std::ostream &ss, const UVIsland &islands, int step, int64_t first_new_prim_index);
void svg(std::ostream &ss, const UVIslands &islands, int step);
void svg(std::ostream &ss, const UVPrimitive &primitive);
void svg(std::ostream &ss, const UVPrimitive &primitive, int step);
diff --git a/source/blender/blenkernel/intern/uv_islands.cc b/source/blender/blenkernel/intern/uv_islands.cc
index 87dd1af8322..18419e0e57e 100644
--- a/source/blender/blenkernel/intern/uv_islands.cc
+++ b/source/blender/blenkernel/intern/uv_islands.cc
@@ -521,11 +521,8 @@ void UVIsland::extend_border(const UVIslandsMask &mask,
std::ofstream of;
of.open(filename.str());
svg_header(of);
- svg(of, *this, step++);
- for (UVBorder &border : borders) {
- svg(of, border, step);
- }
- step++;
+ uint64_t first_new_prim_index = uv_primitives.size();
+ svg(of, *this, step++, first_new_prim_index);
#endif
int64_t border_index = 0;
@@ -562,11 +559,8 @@ void UVIsland::extend_border(const UVIslandsMask &mask,
extension_corner->second->flags.extendable = false;
num_iterations--;
#ifdef DEBUG_SVG
- svg(of, *this, step++);
- for (UVBorder &border : borders) {
- svg(of, border, step);
- }
- step++;
+ svg(of, *this, step++, first_new_prim_index);
+ first_new_prim_index = uv_primitives.size();
#endif
}
#ifdef DEBUG_SVG
@@ -845,14 +839,23 @@ void svg(std::ostream &ss, const UVEdge &edge)
<< "\"/>\n";
}
-void svg(std::ostream &ss, const UVIsland &island, int step)
+void svg(std::ostream &ss, const UVIsland &island, int step, int64_t first_new_prim_index)
{
ss << "<g transform=\"translate(" << step * 1024 << " 0)\">\n";
ss << " <g fill=\"none\">\n";
/* Inner edges */
ss << " <g stroke=\"grey\" stroke-width=\"1\">\n";
- for (const UVPrimitive &primitive : island.uv_primitives) {
+ for (const UVPrimitive &primitive :
+ Span<const UVPrimitive>(island.uv_primitives.begin(), first_new_prim_index)) {
+ svg(ss, primitive);
+ }
+ ss << " </g>\n";
+
+ ss << " <g stroke=\"grey\" fill=\"green\" stroke-width=\"1\">\n";
+ for (const UVPrimitive &primitive :
+ Span<const UVPrimitive>(&island.uv_primitives[first_new_prim_index],
+ island.uv_primitives.size() - first_new_prim_index)) {
svg(ss, primitive);
}
ss << " </g>\n";
@@ -986,6 +989,7 @@ void svg(std::ostream &ss, const UVPrimitive &primitive)
svg_coords(ss, edge.get_uv_vertex(0)->uv);
}
ss << "\"/>\n";
+#if 0
float2 center(0.0, 0.0);
for (const UVBorderEdge &edge : border.edges) {
@@ -1005,6 +1009,7 @@ void svg(std::ostream &ss, const UVPrimitive &primitive)
ss << edge.get_uv_vertex(0)->vertex->v;
ss << "</text>\n";
}
+#endif
}
void svg(std::ostream &ss, const UVPrimitive &primitive, int step)
More information about the Bf-blender-cvs
mailing list