[Bf-blender-cvs] [b7ff281fd1f] temp-T97352-3d-texturing-seam-bleeding-b2: Add eartly exit when looking for shared uv edges in islands.
Jeroen Bakker
noreply at git.blender.org
Mon Jul 4 15:48:55 CEST 2022
Commit: b7ff281fd1f3ce8757ebbbed1dd0a89e79135389
Author: Jeroen Bakker
Date: Mon Jul 4 15:48:45 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding-b2
https://developer.blender.org/rBb7ff281fd1f3ce8757ebbbed1dd0a89e79135389
Add eartly exit when looking for shared uv edges in islands.
===================================================================
M release/datafiles/locale
M release/scripts/addons
M source/blender/blenkernel/BKE_uv_islands.hh
===================================================================
diff --git a/release/datafiles/locale b/release/datafiles/locale
index 9a85b137951..055bc5223c1 160000
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit 9a85b13795157560b319235c63f5a13b0107ba41
+Subproject commit 055bc5223c1cd249e32ccbc8e8796ba9925c8c33
diff --git a/release/scripts/addons b/release/scripts/addons
index 807a64cdfc5..849e7196eb4 160000
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit 807a64cdfc50de1cfb263f2eb68680feddb66ec7
+Subproject commit 849e7196eb4ee7bc5ca8a5644da49ffbd3ff3c97
diff --git a/source/blender/blenkernel/BKE_uv_islands.hh b/source/blender/blenkernel/BKE_uv_islands.hh
index c866be32c62..f03bc7e55ae 100644
--- a/source/blender/blenkernel/BKE_uv_islands.hh
+++ b/source/blender/blenkernel/BKE_uv_islands.hh
@@ -9,6 +9,7 @@
#include "BLI_array.hh"
#include "BLI_edgehash.h"
#include "BLI_float3x3.hh"
+#include "BLI_kdtree.h"
#include "BLI_math.h"
#include "BLI_math_vec_types.hh"
#include "BLI_rect.h"
@@ -158,6 +159,7 @@ struct MeshData {
#endif
TIMEIT_END(init_mesh_data);
}
+
void init_vertices()
{
vertices.reserve(vert_len);
@@ -167,6 +169,7 @@ struct MeshData {
vertices.append(vert);
}
}
+
void init_primitives()
{
primitives.reserve(looptri_len);
@@ -572,11 +575,15 @@ struct UVIsland {
*/
Vector<UVBorder> borders;
+ /* UV bounds of this island to add early exits. */
+ rctf uv_bounds;
+
UVIsland()
{
uv_vertices.reserve(100000);
uv_edges.reserve(100000);
uv_primitives.reserve(100000);
+ BLI_rctf_init_minmax(&uv_bounds);
}
UVPrimitive *add_primitive(MeshPrimitive &primitive)
@@ -594,6 +601,8 @@ struct UVIsland {
uv_primitive_ptr->edges.append(uv_edge);
uv_edge->append_to_uv_vertices();
uv_edge->uv_primitives.append(uv_primitive_ptr);
+ BLI_rctf_do_minmax_v(&uv_bounds, v1.uv);
+ BLI_rctf_do_minmax_v(&uv_bounds, v2.uv);
}
return uv_primitive_ptr;
}
@@ -657,8 +666,15 @@ struct UVIsland {
}
return false;
}
+
bool has_shared_edge(const MeshPrimitive &primitive) const
{
+ /* Early exit, uv bounds of the primitive should intersect with the uv bounds of the island. */
+ rctf prim_uv_bounds = primitive.uv_bounds();
+ if (!BLI_rctf_isect(&uv_bounds, &prim_uv_bounds, nullptr)) {
+ return false;
+ }
+
for (const UVPrimitive &prim : uv_primitives) {
if (prim.has_shared_edge(primitive)) {
return true;
More information about the Bf-blender-cvs
mailing list