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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-04-28 21:44:28 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-04-28 21:44:28 +0400
commit3d4c652041892eeec64133574c980e979cd0b174 (patch)
tree9695f4fc966706d879a04896172063f183531156 /source
parent2286c3ea3e82a870c099cba3ad31fb8031493f35 (diff)
fix for bug with edge-slide doing UV correction when the faces connected to one of the sliding edges dont have contiguous UV's (or vcols etc).
resolve by using faces adjacent to the ones directly connected to the edge that sliding. This isnt a prefect solution but it resolves the common case where an edge slides along a UV seam.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/transform/transform.c55
1 files changed, 48 insertions, 7 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 0bf522dea9a..a07ddbdb092 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -5671,24 +5671,65 @@ void projectEdgeSlideData(TransInfo *t, bool is_final)
* in fact whenever the face being copied is not 'f_copy' this can happen,
* we could be a lot smarter about this but would need to deal with every UV channel or
* add a way to mask out lauers when calling #BM_loop_interp_from_face() */
+
+ /*
+ * + +----------------+
+ * \ | |
+ * (this) l_adj| |
+ * \ | |
+ * \| e_sel |
+ * +----------+----------------+ <- the edge we are sliding.
+ * /|sv->v |
+ * / | |
+ * (or) l_adj| |
+ * / | |
+ * + +----------------+
+ * (above)
+ * 'other connected loops', attached to sv->v slide faces.
+ *
+ * NOTE: The faces connected to the edge may not have contiguous UV's
+ * so step around the loops to find l_adj.
+ * However if the 'other loops' are not cotiguous it will still give problems.
+ *
+ * A full solution to this would have to store
+ * per-customdata-layer map of which loops are contiguous
+ * and take this into account when interpolating.
+ *
+ * NOTE: If l_adj's edge isnt manifold then use then
+ * interpolate the loop from its own face.
+ * Can happen when 'other connected loops' are disconnected from the face-fan.
+ */
+
+ BMLoop *l_adj = NULL;
if (sld->perc < 0.0f) {
if (BM_vert_in_face(e_sel->l->f, sv->v_b)) {
- f_copy_flip = BLI_smallhash_lookup(&sld->origfaces, (uintptr_t)e_sel->l->f);
+ l_adj = e_sel->l;
}
else if (BM_vert_in_face(e_sel->l->radial_next->f, sv->v_b)) {
- f_copy_flip = BLI_smallhash_lookup(&sld->origfaces,
- (uintptr_t)e_sel->l->radial_next->f);
+ l_adj = e_sel->l->radial_next;
}
-
}
else if (sld->perc > 0.0f) {
if (BM_vert_in_face(e_sel->l->f, sv->v_a)) {
- f_copy_flip = BLI_smallhash_lookup(&sld->origfaces, (uintptr_t)e_sel->l->f);
+ l_adj = e_sel->l;
}
else if (BM_vert_in_face(e_sel->l->radial_next->f, sv->v_a)) {
- f_copy_flip = BLI_smallhash_lookup(&sld->origfaces,
- (uintptr_t)e_sel->l->radial_next->f);
+ l_adj = e_sel->l->radial_next;
+ }
+ }
+
+ /* step across to the face */
+ if (l_adj) {
+ l_adj = BM_loop_other_edge_loop(l_adj, sv->v);
+ if (!BM_edge_is_boundary(l_adj->e)) {
+ l_adj = l_adj->radial_next;
+ }
+ else {
+ /* disconnected face-fan, fallback to self */
+ l_adj = l;
}
+
+ f_copy_flip = BLI_smallhash_lookup(&sld->origfaces, (uintptr_t)l_adj->f);
}
}
}