GSOC 2024: UV Stitching Improvements

Hello Everyone,

I’m Anish Bharadwaj, and I will be working on the UV stitch tool for GSOC 2024. The goal of this projects is to develop tools that will allow Blender users to have greater control over UVs, enabling more complex merging and manipulation operations.

If you would like to view my complete proposal you can see it at this link here.

Synopsis

The project focuses on enhancing UV mapping workflows by introducing a user-friendly weld-seams utility for efficient UV island merging, drawing inspiration from community suggestions. It will further develop an advanced welding operation that adjusts surrounding geometry to reduce distortion, alongside exploring sophisticated fitting techniques for improved accuracy. Additionally, the initiative will broaden its toolset to include specialized welding tools for both shared vertex and arbitrary island merging, aiming to streamline and refine the UV mapping process for users.

Benefits

This project aims to significantly enhance Blender’s UV mapping capabilities by providing a suite of tools that streamline and improve the efficiency and precision of UV mapping tasks. With a user-friendly weld-seams utility and advanced operations to minimize distortion, the project targets a future where fully merging UV islands is intuitive and seamless. While the ultimate goal is to automate this process comprehensively, the current focus on sophisticated fitting techniques and specialized welding tools ensures substantial immediate benefits. Even if the project’s timeline doesn’t allow the full realization of automatic UV island merging, the developed tools will offer valuable, albeit more hands-on, methods for users to achieve their desired outcomes. This approach not only provides immediate improvements to UV mapping workflows but also lays the groundwork for reaching the eventual solution.

Deliverables

  • Develop Weld-Seams Utility
    • User defined Merge by Distance Parameter
    • User defined SubSeam Selection Parameter
  • Explore Distortion Minimization Techniques
  • Implement Geometry Deformation Tool
    • Introduce ability to Weld non-connected geometry
  • Write Developer & User Documentation
12 Likes

Week 1 Progress:

During the first week of my project on improving the UV Stitch Tool for Blender, I focused on reviewing the previous year’s GSOC project related to the tool. This review helped me gain a better understanding of the current codebase. However, I encountered a setback when a bug in the debug build prevented me from entering the UV workflow. I filed a bug report, and with the help of the Blender development community, the issue was resolved, allowing me to proceed with my planned work.

In the upcoming weeks, my primary objective is to develop the functionality to merge a subsection of the shared edges between two UV islands. For week 2, I will focus on implementing the functionality to highlight shared edges between islands. Additionally, I will begin working on the UI popup that allows for sub-seam selection.

5 Likes

Week 2 Progress: Seam-Weld Functionality Development

After discussing with my mentor, we decided to shift the focus from subseam selection to developing a seam-weld functionality for the Blender project. This decision was made to prioritize a more impactful feature that would enhance the user experience and streamline the UV mapping process. I have implemented a new boilerplate operator into the codebase, and I have successfully added all the necessary UI elements to initiate the seam-weld functionality.


The next step will be understanding the uv_remove_doubles_to_selected function. Gaining a thorough understanding of how this function operates will help with developing a weld-seam feature that is based on the UV islands’ relative positions to one another. I will also be considering adding an ability to weld seams based on underlying geometry so that the islands will be welded in an orientation that is respective to their relative positions in 3D space.

If you have any feedback, please leave a comment in the dedicated feedback thread here

8 Likes

Week 3 Progress: Seam-Weld Functionality Development Continued

In week 3, I continued working on the implementation of the UV Seam-Weld tool. Significant progress has been made, and I am now close to completing this feature.

Given that this deliverable is so close to completion, I will keep this update brief. I anticipate providing a more comprehensive post midway through this week, once the UV Seam-Weld tool is fully implemented. This upcoming post will include an in-depth description of the functionality and the improvements introduced.

Stay tuned for more detailed updates!

10 Likes

This week, I completed the development of the UV Seam-Weld tool. It took a bit more time than expected, but the extra effort was worth it. I made sure to account for various scenarios to ensure the tool is robust and doesn’t crash or break unexpectedly. This involved extensive testing to cover edge cases and ensure stability across different use cases.

I am currently in the middle of resolving the pull request for the UV Seam-Weld tool. Once this PR is completed and approved, I will move on to the next deliverable. This next phase involves introducing parameters for distortion to the UV Stitch tool.

Thank you for following my progress, and stay tuned for more updates!


18 Likes

Week 5 Report

This week, I refactored the UV Seam Weld code and created a standalone API to enhance the UV stitch tool. The code cleanup and new API for edge loop extraction should improve the reusability of the Logic and improves the overall readability of my code.

I also began researching the next deliverable, which will introduce distortion parameters to adjust UV coordinates, ensuring the UV faces better match the 3D mesh angles. This will enhance UV mapping quality and accuracy. My research included reviewing related literature as well as looking into the UV pinning and Live Unwrap functionality that currently exist in blender.

6 Likes

Week 6 Report:

This week, I added functionality to the UV merge tool and prepared for future tasks. I added a feature to the Merge UVs operator, allowing it to merge based on the underlying geometry. For the implementation of deformation to the Seam-Weld functionality, after consulting with my mentor, we decided to use Laplacian Deformation instead of the initially considered Least Squares method for mesh deformation after welding. I spent time understanding the mathematical Laplacian Operator and began looking into Blender’s Laplacian Deform operator to apply this technique to the UV stitch tool.

9 Likes

Week 7 Report:

This week, I didn’t get to work as much on the deform deliverable as I was cleaning up issues with my previous 2 PRs. Next week I will primarily be working on adding the deformation functionality to the seam weld. For a base implementation to reduce distortion after Welds I will implement a linear interpolation. Afterwards I will look at different solutions that better maintain the angles within UV meshes.

2 Likes

Week 8 Report

I was unable to work much this week due to illness. I will resume working on the Deformation Functionality in Week 9.

1 Like

Week 9 Report

During this week, I continued working on the deformation functionality, and the logic is nearly complete. Next week, I will focus on finalizing the logic for this tool and adding a slider in the modal to allow users to determine the range from the selected seam that is affected by the deformation. Afterwards, I will look into additional optimizations to enhance the efficiency of this process.

8 Likes

Week 10 Report

I have completed the functionality to perform Deformation of the surrounding Mesh through linear interpolation. However Currently I am calculating the factor of the deformation through distance from UV coordinates to the seam that is being welded. I now want to change this deformation to happen through topological distance instead with should improve user’s ability to limit the portion of the mesh that is being deformed. After I add these changes I will include screenshots that show how well the deformation performs in this thread.

6 Likes

Week 11 Report

This week, I completed the implementation of the deform functionality using linear interpolation. Users can now activate this feature by checking the deform checkbox. To fine-tune the effect, I introduced a threshold slider that serves as a range delimiter, allowing users to apply the deformation to only a specific portion of the meshes within the island. Additionally, a deform strength slider was added, which controls the intensity of the deformation on the vertexes within the defined threshold. These enhancements will enable more precise control over how the deform operation impacts the meshes.

Pre-deform operation

Post-deform operation

16 Likes

Week 12

Hello everyone,

This week, I have been working on replacing the deformation method in Seam-Weld to achieve UVs that better represent their 3D objects after the welding operation. I will be switching from the linear interpolation implementation to a Laplacian deformation. Although I will not be able to complete this deliverable by the end of GSOC, I will continue working on the project afterwards and will regularly post updates on my progress.

20 Likes

GSOC Final Report

UV Stitching Improvements
Project Summary:
During Gsoc I completed 3 main deliverables.

  • Seam Weld (PR)
  • Underlying Geometry (PR)
  • UVIsland Deformation (PR)

Current State of UV stitch tool.
Seam Weld:
The Seam Weld feature allows users to select two non-cyclic edge loops on two
separate UV islands and merge those islands together along that seam. This deliverable
took the most time to implement of the three that I worked on due to various
misunderstandings I had about how the UV system works in Blender. One major
challenge was grasping the concept of loops and understanding that the UV islands are
not actually connected to one another but are instead multiple loops sharing locations
in 2D space.
Underlying Geometry:
The Underlying Geometry functionality was implemented without too much difficulty.
Most of the time spent on this task was focused on coding style choices, such as
determining where this functionality should logically reside and ensuring consistency
with the rest of the Blender codebase. Although this was the second feature I worked
on, it was the first PR to be resolved since it involved a smaller amount of code.
UVIsland Deformation:

This section underwent the most changes in terms of how to approach the problem.
Initially, I planned to perform the deformation using a Least Squares solver, but after
many conversations with my mentor, we explored several different implementation
ideas and eventually settled on using linear interpolation. One of the main takeaways
from this deliverable is the importance of focusing on getting the MVP (Minimum Viable
Product) pushed through, as having an initial implementation can greatly aid in further
iterations, even if you end up rewriting the logic entirely.

Future Goals for UV stitch Tool:
As I previously mentioned, for the UV Island Deformation deliverable, my mentor and I
considered several different implementation methods to develop this functionality. One
of the approaches we explored was Laplacian Deformation. I researched this topic more
thoroughly than many of the other ideas, but ultimately chose the linear interpolation
solution. Now I am working on changing the logic of the deformation functionality to
use Laplacian Deformation instead of linear interpolation. I have been working on this
deliverable for the last two weeks of GSoC, and I plan to continue working on this
project after GSoC ends as well.

16 Likes