[Addon] World Scale UV

Description:
Helps you in making tiling textures fit an actual physical size.
For example it would help you make a 60cmx60cm tile texture actually become 60x60 on your model.

Who is this for?
Mostly for people into architectual rendering. If you need to have a more reliable visualisation of how a material would look. You’d most definitly need a material that is to scale on every object you put it on. And since there will be many objects of many different using the same material, it can be annoying to get them in order.

How it’s designed to work:
It’s designed around 2 basic principles being:1. The UV square is always concidered to be 1m x 1m, no matter what
2. The actual size of your texture is determined by it’s scale in the textures panel ( normally found under mapping )

How do I use it?
Make sure you’ve applied your model’s scale before proceeding (CTRL+A).

Press the “Scale UV to world size” button with your object selected.If you’ve selected force unwrap(or your model hasn’t been unwrapped yet), it will automaticlly create a UVlayer called: “UVMapWorldSize” and apply a smart_unwrap with an angle limit of 45.
Otherwise it just creates the UV layer and scales any existing UV map to approximatly fit the world.

Enter the material size in the given field X and Y size( in metric meters )

Press the “set Material size” button. It’ll apply the correct texture scale to every texture within your selected material.

Notes:
1. Ofcourse not every material has textures of the same size attached to it. In case you want to manually set a size for your texture. Go to the texture mapping area of your texture. (Notice it’s set to UV : UVMapWorldSize).
You can calculate the correct size of your material by dividing 1 by the world size of the texture.
Example: A tile texture is 60x60 cm, your scale should be: X = 1/0.6 , Y = 1/0.6

  1. Stretched UV’s can seriously distort the accuracy. Go for 0 stretching if possible.

Installation:

  • place in Blender\2.65\scripts\addons
  • enable in addons: Object:Realsize Unwrap ( found under Testing )
    You can find the tool under “UV tools” on the toolshelf in the 3D viewport ( T ).
    Only shows in object mode

Download:
v0.1 (alpha) - direct
v0.1 (alpha) - adfly

Todo’s:
- add some screenshots, maybe a small video guide. Just make this block of text enjoyable to read

  • make more reliable algorythm ( per face instead of entire mesh )
  • improve UI
  • add automatic island / face rotation depending on face orientation. ( No more need to rotate faces an X degrees to get horizontal or vertical textures.
  • Receive suggestions
  • cleanup code
    Version History:
    - 19-12-'12 :

Lemme know what you think

1 Like

«vBulletin Message
Invalid Attachment specified. If you followed a valid link, please notify the administrator»

Looks like the link isn’t fixed.

The link was broken.pls port another place.tq

I appended a new attachment to this post.
I’ll see if I can upload it somewhere else as well though.

I’m also thinking about adding in something that will facilitate the generation of per mesh AO maps. But that’d force users more into using materials / nodes in the way I invision them to be used ( = somewhat less creative freedom ). Then again it just depends on how much I can separate it from the other nodes. Maybe I can make it come down to you just needing to mix your final output with a kind of AO node.
We’ll see

Attachments

McBuff_RealsizeUV_v0.1(alpha).zip (4.43 KB)

It seems to work here, except for the ‘size’ feature: no matter what values I put in, the texture scale never changes. I have tried with and without the ‘mapping’ node.

On a side note, which pivot point is used for unwrapping and scaling? For a regular cube I get a somewhat strange result: the UVs are centred horizontally, but a little offset vertically. That doesn’t depend on the cursor position on the UV editor.


WOW, just WOW, I definitely have to try this when I get home!
This has got to be the feature I miss the most from 3Ds Max (shame on me), the ability the recycle materials and set texture sizes in units.
Now only if this worked on non mesh type objects like Curves without need to convert and with viewport visual feedback…

It’s still pretty rough, but I’m glad to hear that people are interested

A very usable addon because UV metric setup is very difficult with Blender!
Great job McBuff!
Thanks a lot to you.:eyebrowlift:
Spirou4D

Looks great! :slight_smile:

thankyou for sharing, test soon!

@piergi
About those pivots, right now it scales the uv’s by the median center. I’ve looked into scaling them relative to the 2D cursor but the blender UI is providing me with a big dilemma when it comes to designing it for users. The problem is that users can have multiple image editors open at any time with different 2D cursors, how would my addon know which one is the correct one?
I’m going to think about how to tackle this.

First thing on my list is to map UV locations to the world and orientation of faces. (So that most textures of different objects will align automaticly)

«right now it scales the uv’s by the median center».

Ok, I see.
I personally would prefer a default scaling with pivot on 0,0 coordinates (the bottom left corner of the image), but I guess this would vary wildly based on the mesh and on the texture.

«First thing on my list is to map UV locations to the world and orientation of faces. (So that most textures of different objects will align automaticly)»
That would indeed be great!

Any clue about the scaling issue? Has anyone else here the same problem (i.e. scaling does not work)?

Oh yeah about that issue.
I reckon you’re using nodes right? I’ve not yet written a node that does that yet. The button on the side only works with the traditional properties style blender materials.

For the moment you’ll need to manually insert your texture size in the mapping node under the scale option if you want to use nodes.
It’s a bit annoying but it’s really simple to pull off. The scale you should enter = (1 / texture size in meters).
A 1x1 m texture would have a scale of 1
a 2x2 m texture would have a scale of 0.5
etc…
You can literally just type the equasion in those fields btw. “1/2” will become 0.5

Z is not used.

About the scaling origin. You have a good point about the scale origin being at 0,0, it makes sense and I’ve already implemented it in my dev version.

«For the moment you’ll need to manually insert your texture size in the mapping node under the scale option if you want to use nodes.»

Thanks for the reply. It takes actually the same time to do it in the mapping node or in the addon panel.
I don’t think it is really a priority, better working on the orientation of the faces :wink:

On a side note, AFAIK the «smart unwrap» aligns the faces randomly, am I right? That could give bizarre results, in architectural renders where often the meshes are more or less in the «cube» family. Have you tried experimenting with the «follow active quads» option? (In my experience, it gives always super-stretched results, but the faces are neatly aligned.)

Well, thank you. It is working and very very useful.

How did you manage to make it work?
With Blender 2.66a it crashes each and every time I use it. Actually it does the re-mapping, but I have a ton of error messages and it leaves the UI a mess.

Is there a new version somewhere?

i am missing this feature in blender,will try this.thanks a lot.

The download link for this has gone bad. Is it available anywhere else, or is there an alternative? I seem to often run into this problem of scaling UV’s to a real world dimension eg - make the floor tiles 1 foot x 1 foot etc. It can be done by eye, or with some math, but this addon seems to provide some helpful automation.

Wayne

Very useful addon and great idea! Thanks!

Is this work in version 2.71? Because I can successfully instal it - can’t see in list… :frowning: