6
$\begingroup$

Is there a method to scale a texture in relation to the measurements of the model?

For example, consider an architectural model with a concrete paving. Its image texture is a "real world" photo measuring 3×3 times which makes it 180cm × 180cm. Is it possible to make Blender scale the texture in model-units? Or the other way around: is it possible to automatically scale the UV coordinates so they fit the "real world size"?

$\endgroup$
  • 1
    $\begingroup$ This is a bit difficult to try and tell exactly what you are asking. $\endgroup$ – iKlsR Jul 5 '13 at 14:32
  • $\begingroup$ example: i do a balkony with size 3x8m. i want to map a picture of concrete paving to it. the picute is tileable and has a size of 200x200 pixel. i want to tell blender that the length of the picture is 1m. If i can do this i only have move my uv coordinates to an corner of the picture and the size is like "in real world" - in this easy example it is no problem to fix it by hand - in larger buildings with non perpendicular and not quadratic rooms, or a texture that is not that clear in size as concrete pavings, its not that simple to fix. $\endgroup$ – Rosebarb Jul 5 '13 at 23:02
6
$\begingroup$

If you only work with planes or meshes in which all faces have 90° angles between them, following the local object's coordinates, yes (typically planes and cubes which were only rotated in object mode and on which you didn't apply the rotation). You have to apply scale first with Ctrl + A -> scale.

1) Unwrap in edit mode with U, select the cube projection mode. By default it will make the smallest image's side to be 2 Blender Units long.

2) In Node Editor: Connect a Texture Coordinate Node with UV output to a Mapping node. Connect this Mapping node output to the vector input of your Image Texture Node.

3) Choose the appropriate Scale values in the Mapping node. "Scale factor" = 2 / "image's smallest side in Real World distance". The 2 is because of the cube projection scaling the smallest side to 2 BU. If you know your image is 1m on x and on 4m on y (in the real world), then give 2/1= 2 for x an y scale in the Mapping node

enter image description here Other UV projection modes aren't predictable. If you want an always working solution, I think you will have to write it in OSL, but your render time will be 4-5 times slower.

$\endgroup$
  • $\begingroup$ hm dont work for me. if i unwrap with a cube projection. different object get differnt sized uw layout. the same texture is scaled different on each object.maybe its possible to use the uv coodrdinates of another object? (cycles) so its possible to place a plane with 1x1m sized- i place the texture there and use this coordinates with another object. $\endgroup$ – Rosebarb Jul 5 '13 at 20:22
  • $\begingroup$ did you apply the scale on your objects ? I can't reproduce your problem if my scale are 1, 1 and 1 on x, y and z $\endgroup$ – matali Jul 6 '13 at 5:40
  • $\begingroup$ As I said, It only works for 90° faces (faces follow world coordinates). If you want more complicated object, use smart UV project, but it doesn't always work as you want. $\endgroup$ – matali Jul 6 '13 at 5:50
  • $\begingroup$ I corrected the solution, I made a mistake yesterday, sorry, I was tired :D Please try again and with scale applied. $\endgroup$ – matali Jul 6 '13 at 5:56
2
$\begingroup$

There are a number of places that affect texture scale:

  1. Object scale.
  2. UV scale, see UV editing and the UV Warp modifier.
  3. Texture space: Object | Transform | Scale Texture Space (Shift+Alt+T). For numeric input see the Texture Space panel under Object data tab of the Properties editor.
  4. Image mapping:
    • For BI this is found in the Mapping panel of the Texture tab of the Properties editor.
    • For Cycles this is done using the Mapping node.
$\endgroup$
0
$\begingroup$

The Magic UV addon (available here) can be used to accomplish this.

To install the Magic UV addon:

  • Place uv_magic_uv folder in the Blender/(version number)/scripts/addons folder.
  • In Blender, go to File > User Preferences > Add-ons.
  • Scroll down the list and enable "UV: Magic UV".

Use:

  • For a given texture intended to be X units by X units in size, make a reference square (e.g., the side of cube) of those dimensions.
  • Switch to the UV Editing screen layout.
  • UV map the square such that it occupies the entire UV area (no margin).
  • With the square selected, press U and select World Scale UV > Measure.
  • To apply the same scaling to other faces, select them, press U, and select World Scale UV > Apply.

A video demonstrating Magic UV's World Scale UV functionality is available here (recorded by Nutti, the creator of the addon).

$\endgroup$
  • $\begingroup$ please do not post link only answers. By all means link to the addon and where to read the full docs, but links can not be your entire answer. Please edit your answer, adding the necessary steps so your answer could be read and useful right here. $\endgroup$ – David Sep 22 '16 at 20:55
  • $\begingroup$ @David fair point; I've included the full text of the answer. $\endgroup$ – Reign of Error Sep 23 '16 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.