nutti / Magic-UV

Blender Add-on: Magic UV

Home Page:http://nutti.github.io/Magic-UV/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Real world scale not working as expected

kingsushi001 opened this issue · comments

System Information

  • OS: Windows 10
  • Blender version: 2.82a
  • Add-on version: 6.2

For the past few weeks I’ve been messing around with Magic UV and real world UV scales. Everything was working great until 2 or 3 days ago. It seems that applying the scale density to the “loop” mesh doesn’t work as expected, well, the scaling is off.

In the image below you can see the X Dimension is 108mm.
image

After using a 50x50mm mesh and texture to get the scale density, I applied it to the “loop” mesh and as can be seen below, the scaling is off when measured in Photoshop, 129.5mm
image

I have attached my blend file so you can have a look and maybe tell me what I’m missing?
help.zip

commented

@kingsushi001

I need more information to check this issue.
Could you give me your more information?

  • What feature of Magic UV, did you use?
  • What procedure did you try?
  • What is your expected result after using this process?

Especially, I want to the expected result and real result.

Hi @nutti

Thanks for the reply

I'm using the "World Scale UV" feature. I've uploaded a video to youtube showing exactly how I use it:
https://youtu.be/tToaTW_n3hk

Now, when using it the way I did in the video it works perfectly with a cube, cone etc etc. When trying to use it on a weirdly shaped mesh, it gives me the wrong dimensions. For Instance below is a cube showing the dimensions in both Edit and Object mode:
cube
As you can see, it show 85x85x85mm which is correct.

Here is a cone I did the same way as in the video:
cone
This one shows 85x85x104mm which is correct.

Now next is the "loop" mesh I am trying to get real world UV for:
loop
It shows 75mm for the one edge and 40mm for the other edge which is correct, BUT, the UV's dimensions DO NOT match.

Here's the UV's for all 3 meshes on a 500x500mm (scaled down to upload here) texture:
dimensions
The Cube's UV's are 100% correct. Same for the Cone, UV's are correct. The "loop's" UV is all wrong as you can see. I was expecting the UV's for the "loop" to be the same as was shown in Blender.

Here's the blend file with all the textures and reference image I used to measure the scale and apply to the other meshes:
more.zip

I hope this is enough to demonstrate the issue I have.

commented

@kingsushi001

I think this comes from the calculation method.
Until v6.3 is released, the mesh size is decided by the whole mesh.

From v6.3, Area Calculation Method option is introduced.
#123 (comment)

Could you update and try this option?

@kingsushi001

I think this comes from the calculation method.
Until v6.3 is released, the mesh size is decided by the whole mesh.

From v6.3, Area Calculation Method option is introduced.
#123 (comment)

Could you update and try this option?

Hi again @nutti

I have tried v6.3, unfortunately the UV scale for the "loop" mesh is even worse now, it's much bigger than it's supposed to be when using UV Island or Face as area calculation.

@kingsushi001
I think this comes from the calculation method.
Until v6.3 is released, the mesh size is decided by the whole mesh.
From v6.3, Area Calculation Method option is introduced.
#123 (comment)
Could you update and try this option?

Hi again @nutti

I have tried v6.3, unfortunately the UV scale for the "loop" mesh is even worse now, it's much bigger than it's supposed to be when using UV Island or Face as area calculation.

@nutti

Ok, after further testing, seems that only some of the faces on the "loop" mesh's UV are scaled correctly. Some are still too big and then another way too big. If you need another image or video showing what's wrong, just ask and I'll happily provide one.

commented

@kingsushi001

Thanks for your investigation! It helps me a lot.
I will check the issue by using your blend file.
But I'm tackling to release v6.4, so I want to tackling this issue after releasing v6.4.

@nutti

It's my pleasure. I really like your add-on.
Do you have any idea or guesstimate on when v6.4 will be released?

commented

@kingsushi001

Maybe, release will be done in this weekend.
I added this task for v6.5.

commented

@kingsushi001

Hi, I'm tackling this issue now.
But I'm not sure how to calculate UV size described in #139 (comment).
Could you give me suggestions to check this.

Also, could you give me the example about the definition of loop mesh?
I'm now investigating your blend file (help.blend).

Mesh Size UV Size Density
Square 0.00250 349141.2211519317 11808.660362703222
Loop Mesh? 0.00917 581661.196618416 7962.528584454752

Texture density is calculated from mesh size.
So, UV Size will be (11808 / 7962) = 1.48 times of original.

Does this result meet your assumption?

Hi @nutti

Sorry to keep you waiting. Busy day.

I have prepared a new blend file for you. I think I know why it's calculating it all wrong.
help_02.zip

I have left notes on the UV texture as well. After messing around with it again, I noticed that when I use the Decimate (Planar)
modifier on the mesh, that's when it calculates it all wrong. But when triangulating some of the oddly shaped faces and THEN applying the world scale, it works perfectly.

What I mean by "Loop" mesh, it's the name of the object. In the new blend file (help_02.blend), I have named the objects "loop_mesh_decimated" (the RED object) and "loop_mesh_triangulated" (the GREEN object).

Also I measured the Scaling Density of the "ref_50mm" object and applied it to the "complete.png" texture using the Mesh setting for Area Calculation Method.

I hope this helps

commented

@kingsushi001

Thanks for your answer.

But when triangulating some of the oddly shaped faces and THEN applying the world scale, it works perfectly.

Great inspection!
I think this is a very important clue.

I measured the mesh/UV size to green/red object, and found that measured sizes does not match each other.

Mesh Size UV Size Density
Triangled 0.00295 411717 11811
N-polygon 0.00780 584533 8656

I'll check deeper why this mismatch is raised.

commented

Yeah, I got the reason.
The calculation of mesh size for n-gon is not correct.

commented

@kingsushi001

BTW, do you want to support N-gon for this feature?
Current version does not support more than 5-gon polygon.

As you know, the workaround of this issue is to use only triangle polygon or quad polygon.

@nutti

I think having n-gon support would future proof the add on. Because someone is bound to ask for it eventually.

commented

OK, I will try to support this.
But it takes time to do this because I'm not sure how to calculate the area of n-gon.

OK, I will try to support this.
But it takes time to do this because I'm not sure how to calculate the area of n-gon.

It's all good. Take your time. I won't be near a PC until next week sometime. Having my GPU replaced.

commented

@kingsushi001

Hi, I found the easy way to fix this.
Could you try below one?

https://github.com/nutti/Magic-UV/archive/issue_139.zip

If this version fixes your problem, I will merge this to master branch.

commented

@kingsushi001

Is there any update for this issue?

@kingsushi001

Is there any update for this issue?

Sorry @nutti Not yet. I should have the new GPU at latest next week Tuesday.
I will do thorough testing and get back to you.

Again, sorry for the wait.

commented

@kingsushi001

Don't worry. Hope this fixed version work correctly on your environment.

@kingsushi001

Hi, I found the easy way to fix this.
Could you try below one?

https://github.com/nutti/Magic-UV/archive/issue_139.zip

If this version fixes your problem, I will merge this to master branch.

Hi @nutti

I received my new GPU, so I can continue testing your add-on again.

I downloaded this file https://github.com/nutti/Magic-UV/archive/issue_139.zip
Unfortunately I have no idea what to do with it. Where should I be extracting it to?

commented

@kingsushi001

Sorry for lack of explanation.

Could you follow the installation process as followes?
https://github.com/nutti/Magic-UV/blob/master/docs/installation.md#2-unzip-it-and-check-the-add-on-sources

Thanks

@nutti

Whoop! Everything seems to be working 100% now!

commented

@kingsushi001

Thanks for your quick action!
If you don't have any issue, I will merge to the master branch.
Does fixed version meet your requirement?

@kingsushi001

Thanks for your quick action!
If you don't have any issue, I will merge to the master branch.
Does fixed version meet your requirement?

Yes, it does meet my expectations and is working great now. Thank you very much @nutti

commented

Merged the patch to master branch.

Thanks for your cooperation @kingsushi001