nutti / Magic-UV

Blender Add-on: Magic UV
http://nutti.github.io/Magic-UV/
Other
635 stars 46 forks source link

UV Overlapping issue. #146

Closed mifth closed 3 years ago

mifth commented 3 years ago

Hi Nutty!

I have found one issue with overlapping. If UV is overlapped but also flipped it will not be considered as overlapped. I attached my blend file. tmp1.zip

image image

nutti commented 3 years ago

Thanks. But, I need a time to fix this because of the critical error on Blender 2.93.

mifth commented 3 years ago

No worries. There is nu hurry.

nutti commented 3 years ago

@mifth

I'm now trying to find the reason of this issue, but I could not reproduce this with a simple case (one rect polygon is flipped, another rect polygon is not flipped). Is there any simple case you encountered this issue?

nutti commented 3 years ago

Perhaps, the issue comes from not flipping but rotation. I can reproduce this issue by using rotated UV.

nutti commented 3 years ago

I found this issue is raised when the UVs are in same islands. Maybe, we can solve this issue by checking the overlapped UVs intra-UVisland as well as inter-UVisland.

mifth commented 3 years ago

@nutty Apologies for late reply. Here is my simple test. I attached my blend file.

tmp1.zip

In this situation I suppose all these faces should be considered as overlapped. image

I flipped only these faces: image

nutti commented 3 years ago

@mifth

Maybe this works fine. https://github.com/nutti/Magic-UV/archive/develop.zip

I tried your uploaded zip (the first tmp1.zip) and works fine for me.

P.S. @Nutty is not me. (My account is @nutti )

mifth commented 3 years ago

@nutty Thank you. Thank you a lot! Works fine on this example.

I opened the first model and found some issues: 1) Could I ask to increase default value? image image

2) I have found this face was selected as overlap, but these is no overlaps. image

nutti commented 3 years ago

@mifth

1) Could I ask to increase default value?

Yeah, it is possible to increase default value.

2)

Hmm, it is difficult to fix this. I will investigate more about this.

mifth commented 3 years ago

Aaa, understood.

What if to check if a polygon center is in UV Shell? UV shells could be taken from bpy_extras.mesh_utils.mesh_linked_uv_islands(obj.data) https://docs.blender.org/api/current/bpy_extras.mesh_utils.html?highlight=island#bpy_extras.mesh_utils.mesh_linked_uv_islands

image

mifth commented 3 years ago

Or checking if a polygon center is in other polygon?

nutti commented 3 years ago

Thanks. But I found another way (Only tweaking the current algorithm).

Maybe this works fine. https://github.com/nutti/Magic-UV/archive/develop.zip

mifth commented 3 years ago

@nutti everything is perfect! Thank you a lot for your effort!

nutti commented 3 years ago

Merged. Thanks for your cooperation @mifth .