6

I wanted to ask, if there is a way to disable the automatic UV stretching after an image size got changed?

enter image description here

CharlesL
  • 15,316
  • 7
  • 53
  • 88
myclay
  • 317
  • 4
  • 11

2 Answers2

3

Normally, it is not likely to happen. You need to learn more about how the UV coordinate space works. However, you can correct it by manually scale it down to the old proportion if you really want to keep the aspect ratio of that UV:

For example, let's say the old image resolution is 1000px * 1000px, and the new resolution is 500px * 1600px:

  1. First, calculate two ratios: Rw={image_width_old}/{image_width_new} and Rh={image_height_old}/{image_height_new}. In this case, Rw=1000/500=2, and Rh=1000/1600=0.625.
  2. Press A to select all UV elements, and SX2Enter, then SY0.625Enter. Done.

Furthermore, if you just simply unwrap it directly by some of the unwrap methods listed in the U menu (e.g. Project From View), then you can also consider do that again after switching to a different image, instead.

I'm sure this can also be done by scripting to make it semi-automatic, at least. So, welcome anyone who know the scripting version of this method and edit my answer.

Leon Cheung
  • 27,718
  • 11
  • 89
  • 161
  • Unwrapping again wont do anything, the same UV-coordinates will be the result. – Gunslinger Dec 25 '13 at 14:47
  • @Gunslinger As I said, such as Project From View, which will certainly do something. :) – Leon Cheung Dec 25 '13 at 15:40
  • ah that is making the process easier :) many thanks. I tried to fix it with the snap to pixels mode and that process was taking a lot of time. – myclay Dec 25 '13 at 17:55
  • 1
    @LeonCheung I did a plain unwrap of a cube and assigned a 500x1024 texture. UV looks stretched. Tries unwrap again, UV still looks stretched. Tries project form view, UV still looks stretched. I might be missing something. There is a checkbox "Correct aspect" but it doesn't do the thing I expect. Can you provide an example? – Gunslinger Dec 25 '13 at 19:41
0

While Leon's answer will work, he also hints that you need to understand how UV coordinates work, or you're going to continue having this same problem.

Short of explaining UVs, I can offer you a better answer. The main cause of the problem is that your test texture is not the same aspect ratio as your final texture. If your test texture is the same aspect ratio (not necessarily the same resolution, but that would also work) as your real texture, then you can swap between your test texture and your final texture without having to adjust anything at all.

The main reason I'm interested in offering an addition solution is that there's a REASON it works this way. If you circumvent that reason, you loose the benefits that come along with it. E.g. Leon's answer doesn't do you much good if you spent 3 hours using the test texture to manually tweak the UV layout (which is a great idea, and you should keep using the test texture). If you then have to re-unwrap for use with the real texture, you've just lost all that work. Even manually scaling it is imprecise, at best. However, if your aspect ratios are the same, then you can change from one texture to the other, without having to adjust at all, because it automatically scales to the size of the new texture ;-) Which is why it's a feature...

Matt
  • 11,126
  • 3
  • 32
  • 67