retopoflow
retopoflow copied to clipboard
Tweak: Slide can jump vertex to other boundaries
When using boundary slide in Tweak, the verts can jump across to other boundaries if you pull them perpendicular to their own boundary.
the previous implementation should be "snap to boundary" instead of "slide along boundary". here is a quick explanation of how it worked... at the very start of the tool (before moving verts), all the boundary edges are detected and stored. when moving the verts, the vert is offset from the original location by how far the brush has moved since first mousedown, then boundary verts are snapped to previously stored boundary edges.
alternatively, we could iteratively move the verts by the latest brush delta, then snap back to stored boundary edges. this would allow verts to "slide" about the edge (as long as the brush didn't make a suddenly large move!), but it has issues too. namely, the vert "crawls" across the surface, so moving it from one part to another part where there is a hole between would require the artist to move all the verts around the hole.
alternatively, we could maybe combine the two, and only allow boundary verts snap to stored boundary edges as long as it's not too far away from the previous snapped position.
i decided to take a slightly different approach in commit 4378664. here, boundary verts are not moved large distances, but instead take multiple "short" jumps, but snap back to a boundary edge after each jump. the problem here is that if the artist tweaks a great distance, there are a lot of boundary edges, or there are a lot of boundary verts under the brush, performance could drop a bit. note: this change should only affect moved boundary verts
This does the trick! Since this does have a hit on performance though, it sounds like this second option could be better in most cases:
alternatively, we could iteratively move the verts by the latest brush delta, then snap back to stored boundary edges
That's closer to how I would have expected it to work, and I really wouldn't worry about having to move verts around a hole TBH. I'm sure somebody has done it at some point, but I can't really think of when that would be needed to be done with Tweak.