Tricky UV issue


#1

I have modelled and UV’d a packing carton, and now I need to create another carton which is the same as the first except it is wider at the front and deeper at the sides. I copied my first model, then moved corner points around to create the new carton shape. I then replaced the material with the material for the new pack. The UVs are now completely off - the front face is stretched in a weird way, and I can’t seem to move and scale the UVs to get it working.

What’s the best approach? Would I have been better to scale the original pack’s points to fit the new size, rather than moving the points? Would that keep the UVs right?


#2

Moving and scaling on point level means the same. A point is only a vector described by three numbers (x,y,z); it does not have a matrix that would define a local coordinate system (which could be scaled). But even if you scale the object matrix of the polygon object, that does not help, because the UV coordinates are attached to the polygons’ corner points - so, no matter how you get a poly point to move in global 3D space, the projection into the UV plane is still the same. The area in the UV plane that represents the polygon needs to be stretched in the same way to adapt (or the image in the UV plane needs to be compressed inversely).


#3

Could be nice to see pics of an issue. But moving or scaling points can’t brake UVs if only they’re moved really far away by some strange diagonals. The only reason to break UVs is to create new vertextes\polys. But even this it’s not the case at R21 at some simple situations now.


#4

Here is a pic showing the original carton, and how I moved the left edge points, then the middle points, to make the new longer carton. I can’t show the actual textures so have used a checkerboard material.

Having moved those points, what’s the best way to move the UV points so the texture for the longer carton fits properly?


#5

The easiest case would be if the corresponding UV polygons are orthogonal and axis-parallel to the UV plane, and there is room on the UV plane to move the right and/or left UV polys to stretch the middle UV polygons in the same ratio that you stretched the 3D polys.

But first: Where do you have the material for the carton from? You obviously had a material for the narrower carton. Then you say “replaced the material with the material for the new pack” which indicates that you also have the texture image that you want to project…? That would mean that you need to position the UV points in a way that the proper areas on the texture image are covered by the proper UV polygons.

Where do you get that new texture image from, and what is its relation to the former texture image? Or in other words, what is the actual problem, adapting the UV polys to the existing texture image - or reusing the same texture image for a wider carton (which will not work without stretching) - or just building a distortion-free UV mesh to create a new texture image later?


#6

So I created the original pack by applying a material from supplied artwork to a flat unfolded carton using a flat projection. I then generated a UV map and folded the carton up. The model is a poly model inside an SDS, the SDS being set to subdivide the UVS using edge mode. I use this method very successfully all the time.

The client now needs another carton which is a bit longer and a bit deeper than the first one. They have supplied a new artwork. Rather than adjust the flat model, apply the new artwork, and fold it up from scratch again, I hoped to just drag some points around on the original folded model to create the new model. Then I though I could swap the old artwork for the new artwork and it might magically fit!

The new artwork is wider on the front face and a bit deeper on the side face.


#7

So, if you got the artwork supplied, then I guess that the new artwork is also wider than the old artwork. If the UV map fit the old artwork, then it will obviously not fit the new, wider artwork any more without adapting the UV mesh.

I guess you will need to load the texture image into the UV editor and drag the UV polys around until the mesh fits the artwork again. For specific cases with strictly defined measurements, you could script that but I don’t think your source material is that ridigly specified. So I am afraid you need to do it manually.

A magic fit would only be possible at all with non-UV projections, as any UV points will move with the original 3D points, so the aspect ratio gets distorted.


#8

Yes I realise I need to move the UV polys around to fit the new artwork, I’m just finding it really hard to get it looking right. I moved the points on the new model to the right, first the end points then the middle points. I thought if I moved the UV points in the same way it would work easily, but I’m getting distortion.


#9

Without seeing the UV mesh and the actual artwork overlaid, that is hard to judge.


#10

Discovered I had an overlapping poly problem in the centre of the pack (I used a symmetry object when modelling and mustn’t have had it properly aligned when I made it editable.

Once I fixed the poly mess, the scaling and positioning of the UVs was easier, though not to say it was a doddle, still a pain in the neck.

Thanks for all your help.


#11

TL;DR
One general rule when you have an overall acceptable UV map, and want to change a few UV points or polygons, is to Pin EVERY point that’s correct, and Relax the the rest with Pin points ONLY enabled.


#12

Good info Nose, when I was struggling with the new UV map I tried some relaxing, but wasn’t pinning anything, made a mess and gave up :confused:


#13

Make sure none of the other settings are on in the “Relax UV” panel.
Pin Border points and the others will mess with your Relaxation . You only want to Pin… nothing else.