3
$\begingroup$

How can I for example double size of my uv map? Just add 1 more empty "block" of space of the size of my original map? I tried just doubling image in other image editors, but then i can't line up "islands" perfectly.

$\endgroup$
2
  • $\begingroup$ If I'm understanding correctly... if you're doubling the size of your image in the X direction (horizontal) then just scale your UV map by 2 in the X direction. If that's not your issue, please add more information/images. $\endgroup$
    – bertmoog
    Sep 12, 2017 at 20:30
  • 1
    $\begingroup$ Your question is not clear. You can't change the size of UV map - it is texture space which is 0-1 range regardless and it can't be changed. If you scale UV islands over the texture space texture will start repeating and baking won't take that information into account. If you want to change size of the image texture which is mapped using UV map then either change it in the image options in the UV editor (if image isn't saved on disk) or bake to bigger one. $\endgroup$
    – Mr Zak
    Sep 12, 2017 at 20:47

2 Answers 2

4
$\begingroup$

As Mr Zak mentioned, the UV map represents points in Texture Space that range from 0.0 to 1.0 and this cannot be changed. However, from your question it appears that you have a UV mapping that relates to an existing image and you want to make some additional space - presumably to add additional faces.

If this is the case then you can resize the image in an external application (for example, in Gimp you could use the Canvas Size option to increase the canvas to 200% in each direction, leaving the original unchanged and some 'blank' space to the right, top and top-right.

When you re-import this image back into Blender the 'islands' obviously no longer match up - since they are still positioned in the original locations in the 0.0 to 1.0 UV texture space but the image is now twice as large (and so the relevant parts of the image are half the size in relating to the mapping).

To address this you simply need to accurately resize the UV mapping (rather than trying to line it up by hand) and you can use the editing tools to achieve this.

Select all faces in the 3D view in Edit mode (Tab). Then in the UV Editor window, select all with A. Open the Properties panel with N and set the Cursor Location to the corner of the UV map relating to where you've positioned your original image (eg, top-left (0.0,1.0), top-right (1.0,1.0), bottom-left (0.0,0.0), bottom-right (1.0,0.0)).

Next set the Rotation/Scaling pivot point (in the toolbar at the bottom of the UV Editor window) to 2d Cursor - this will make the scaling relative to the Cursor Location you have just set.

Next, to accurately rescale your UV map to your 200% rescaled image you need to resize it to 50% - so press S, type '0.5', press Enter.

Since the image was rescaled to 200% and the UV map coordinates are scaled to 50% the UV mapping and the image islands should match up - as they were before rescaling.

$\endgroup$
1
  • 1
    $\begingroup$ That is exactly what i meant, thank you! I was able to"double the surface" in other softwere but didn't think of 2d cursor. $\endgroup$
    – Matthew
    Sep 12, 2017 at 23:22
0
$\begingroup$

I had the same issue with multiple models, eventually ended up using this script which works perfectly:

import bpy, bmesh


class ScaleUV:
    
    """ How many times the image got scaled 
    e.g. if your image is scaled from 32 to 64 pixels scaled by should be 2 (32*2=64)
    """
    scaled_by = 2

    def run(self):
        objs = bpy.context.selected_objects
        bpy.ops.object.mode_set(mode='EDIT')

        for obj in objs:
            bm = bmesh.from_edit_mesh(obj.data)
            uv_layer = bm.loops.layers.uv.verify()
            multiplier = 1 / self.scaled_by
            for f in bm.faces:
                # move all of the UVs in this face up one UDIM tile
                for loop in f.loops:
                    loop[uv_layer].uv = (loop[uv_layer].uv[0] * multiplier, 0.5 + loop[uv_layer].uv[1] * multiplier)

            bmesh.update_edit_mesh(obj.data)


ScaleUV().run()

Before running this script, select all objects you want to remap, go in edit mode, select all faces and run the script.

I don't know how this script reacts on images that are scaled down, so maybe you need to tweak it a little bit. But for scaled up images you only need to tweak the "scaled_by" value.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .