Tweaking the Bevel modifier UV generation

Hi,

I’ve been using the 2.8 Bevel modifier to a huge extent, and it’s working great, except for one issue I have with how existing UV mapping is affected. I’ve created a small test scene that highlights the problem and took some pictures : https://imgur.com/a/jlYJlSg

Basically, when a nearby face has to be modified to account for a bevel, a discontinuity is introduced in the UV map along the newly created edge. The discontinuity extends along that edge until the next vertex. This is when no UV seam exists.

When a nearby UV seam exists, the behavior seems even worse : https://imgur.com/a/uLY3cbP

I know of alternatives workaround the issue - applying the modifier and then doing the unwrapping, or using the destructive Bevel tool instead - but I feel like the Bevel modifier should be able to behave in a way similar to the Bevel tool as far as unwrapping is concerned.

Thoughts ?

You are finding the behavior of the bevel modifier is different from the bevel tool? That is strange - the code is the same for both.

I (the bevel developer) just recently updated the algorithm used for assigning UVs to the odd middle segments of bevel edges. It will be more consistent about which UV island is chosen for new edges, and in other cases make a more visually consistent choice (same goes for materials assigned to the odd middle segments). This change is in nightly builds now, and will be in 2.90. I hope it works better for you.

But I suspect it might not, and need another feature request that I am considering for the release after that. The issue is: when you have to extend the UV map to new edges, should the new UV map fit within the boundaries of the old one, or not? Can new parts of the UV map overlap old parts, or not? If you are using the UV map for images, you likely don’t want it to “go out of the lines” of the old map, nor do you want overlaps with the existing map. But if you are using an endless texture (like checker, in you pictures), then you don’t care about any of that. I have always been assuming the image use case and programmed for that, but have recently been alerted to the other use case, and will probably put an option into bevel to allow that.

1 Like

Hi Howard, thank you for your detailed explanation.

I pulled the latest changes on the repo and found that the behavior didn’t change. I did see in the source code that the same code path was taken in both cases, and found out that I actually beveled the entire mesh with the tool, while the modifier had an angle limit or a weight limit applied, so I understand the issue better now.

The problem I see happens along edges that are not beveled, but connect to edges that are. Here’s another example without (left) and with (right) an angle limit - the UV seams only show up with the limit, right where unbeveled edges connect. I applied the angle-limited modifier to look at the unwrapping, and you can see weird stuff going on where the UV layout splits the vertex connecting unbeveled and beveled edges. Applying the modifier and using “remove double UVs” in the UV editor fixes the issue, and I basically would like the modifier to avoid needing that.

I don’t believe this is strictly speaking an issue of overlapping the original UVs or not because clearly, edges are being moved already and some of the generated faces have perfect UVs - all of them really if I disable angle limits. I am using image maps here with the intent to bake maps for use in a game, but as I’m not going to be painting directly on the image but rather let Blender do it, I don’t need exact matches either, as long as the outlines of UV islands are not drastically affected.

Thank you for your time, and keep up the amazing work on the bevel tool !

Hi Gwenn,

It is harder for me to reproduce your examples from only pictures. Would it be possible to upload your example .blend file, preferably by filing a bug?

1 Like

Alright, I created a bug here : https://developer.blender.org/T79163