Please excuse the epic ranting rambling of this post, been writing bits of it for weeks, It’s not just for script writers, it’s for everyone who uses 3dsmax, It’s really worth a read and very very important to understand and I wish all 3ds max artists would understand this to avoid lots of common unnecessary problems.
We use a lot of Turbosquid models and model collections and one of the most annoying things is to find that scale hasn’t been taken into consideration, also I see a lot of posts on CGTalk that complain about the way max’s viewport isn’t working properly, getting clipping planes and weird behaviour when trying to move verts, and often this is all to do with using inappropriate unit scale. So here is a quick guide to scale in 3ds Max, and why it is so very important to understand it.
In max you have display units and system units, there is a key difference between the two and it’s very important to use the correct one.
System Units are the important ones, these are the ones that determine what a generic max unit equates to. As a general rule it’s good to put your system unit scale to match the scale of your object. So if you are working on a large environment covering hundreds of metres then you probably want to set it to metres, if you are working on something like a car then centimetres would be more appropriate. If you are working on something very small like a watch or a diamond ring then you probably want to work in millimetres.
Here’s a quick visual example showing how the system scale can mess up your clipping planes if you use it incorrectly.
A 10x10x10cm box, and in 3 different unit setups, look at how using the a smaller scale system unit setup can allow you to get really close to the tiny chamfer on the object.
Centimeters gives you the ability to get quite close to this chamfer, but meters causes massive problems with clipping planes, look at the scale of the grid in each of the images above. Millimeters allows you to get really really close but it’s not great for working on a larger scale, for this you’ll need to recreate the following setup and give it a go….
Create a 10x10x10cm box at 0,0,0 move it it using the transform dialog (right click on move, or press F12) and type in -1000 metres in X and Y, now frame your object (press z) and try and move it around by small amount using your mouse….
Your object is now 1,000,000 millimeters, or to think of it in context, 1,000,000 max units away from the point of origin. And for reasons I won’t bother explaining because it makes my head hurt, computers can’t store numbers completely accurately over a certain number of decimal points, so don’t think of it as just 1million, think of it as 1,000,000.000000 and it suddenly becomes a large complex number value to store in memory… look up double-precision floating points if you’re interested, it confuses me every time. If you were working in metre scale the box would only be 1000 units away from the origin, so would require a lot less accuracy, confused? YES, me too, just learn to deal with it, it’s not just a 3dsmax issue, other programs just mask the problem from you.
See the problem in Maxscript also with a small decimal value….
(1.0 * 5.0 / 200000000000000000000) == 0.000000000000000000025
Will return false, which is confusing as both numbers should be the same… remove a 0 from both sides
(1.0 * 5.0 / 20000000000000000000) == 0.00000000000000000025
and it returns true…. strange….
Because of this (im)precision issue there is a maxscript function for checking if float values are close enough a match…..
close_enough (1.0 * 5.0 / 2000000000000000000000) 0.0000000000000000000025 10
Ok enough geeking out on that.
Max has internally ‘Generic Units’ it doesn’t really know how big anything is in reality, this is why we can tell it what a generic unit actually equates to.
But what if you want to have an animation where the camera started a mile away from a car and ended up inside looking at a diamond ring, which unit setup then? Well the great thing about max is that it understands the relationship of unit setups, so if you modelled the individual assets in their own system unit setups and then merge all the scenes together they would be appropriately re-sized.
When working with files of different system unit setups you’ll get a query message box when you open up different scenes, it’s vitally important that you understand what’s going on here, if you press the wrong thing it can ruin lots of hard work, it can break Xrefs and cause modifiers to go crazy!
There are two options, Rescale and Adopt, we are getting this error because the previous file we had open was in metres unit setup, and the file we are opening is in Centimetres, most of the time you just want to Adopt the new unit scale, it’s not good to just rescale units, but it’s good that max tells you that the units are different, just think of it as a info message. If you were to click Rescale then something that was measuring 1cm in the scene you open would be 1 metre instead, potentially problematic, but occasionally useful.
So what about Display units? Well these are just for your comfort really, what do you prefer to think in? If you have your system units set to metres and your display units set to metres and you want to put a Shell Modifier with a 2mm thickness you might rack your brains trying to think how many decimal points you need. You can have the display units set to anything without it upsetting any of the scale values that are so important in the scene. You can also type different unit scales into values. For instance, lets take the Shell Modifier again, your system units are set to Metres, your display to centimetres and you can type in for your shell thickness ‘2mm’ and max will convert this value to centimetres for you, you can even type in 2″ to get a 2 inch thickness, even though you are working in the metric system. This is really useful, and this is why if you ever make your own maxscript tools to use world units for spinners….
spinner spn_testSpinner range:[0,1000,0] type:#worldunit
This will mean you don’t need to do any funny conversions within your script to adjust for different unit scales.
If you are ever in doubt of what size your object actually is, you can use the Measure utility in the Utilities panel to find out, it can be quite easy, especially for beginners to just start scaling objects when they’re playing around blocking out scenes with primitives rather than using the parameters to change the size of the box for example.
So why is xForm so important to understand? Surely it doesn’t matter as the objects look the same size, well lets take a cube which is 10x10x10cm (in Red below) and a 1x1x1cm cube which has been scale up to 10cm (in Bluebelow).
if we add the same Shell Modifier on both of these objects and set the thickness to 1cm we get two very different results.
The Red box has had a 1cm thickness added to it, but the blue box has effectively had a 10cm thickness added to it as the 1cm thickness is multiplied by the scale of the object.
We can use the ‘Reset XForm’ utility to reset our scale values for everything above in the stack. Note that this is different from just adding an XForm modifier, just adding the modifier doesn’t reset the scale for you, and if you use the ‘Reset Scale’ and ‘Reset Transform’ in the Hierarchy Tab it doesn’t work either.
But be aware the resetting the xForm does funny things, and it’s normally good practice to collapse the object, lets see what happens if we turn that modifier off…..
It can all get quite confusing…..
And whilst we’re at it, to complete this hideously complicated topic, lets factor in the most complicated part of it, hierarchies and scale.
So in this example, the green box was 10x10x10cm and the pink box is 1x1x1m, the green box is linked to the helper and the helper is scaled up to 1000%, this makes our green box 1x1x1m, but if you click on the box and look at the scale properties it will tell you it’s 100,100,100, not some crazy scale value.
So despite the box apparentally being at 100% scale, if we add out 10cm Shell thickness to both objects, again we get a very different result.
So you may just think, ok that’s great I’ll just reset the XForm of the object, but if we try that with an object that is linked to a hierachy it won’t work.
If we de-link the object from the helper and look at its scale value, now it reads 1000,1000,1000 and we can now use the Reset X Form utility to fix the scale.
Doing this and re-linking it to our helper, we can add our Shell modifier on both objects and they are the same size.
So how can I scale an object without messing up the transforms/XForm? Well you can go into subobject mode and scale the polygons themselves,. but you may be asking yourself why bother with all this if you’re not going to be adding modifiers. Well lets see what happens with a real-world map scale bitmap. Two objects of the ‘same size’ different scales and look how different the same map with Real World Map Sizing is!
And as for non-uniformed scale.. well I’ll leave that for another rant.