x


Import settings

Why do my models always appear in unity at 0.01 scale when I import them as assets? from what I have read its better to avoid scaling meshes in unity, but by default all my meshes import at 0.01. why is this?

more ▼

asked Feb 26 '10 at 02:25 PM

Betamaxamillion gravatar image

Betamaxamillion
42 2 2 4

(comments are locked)
10|3000 characters needed characters left

5 answers: sort voted first

We solve this issue with an Editor script:

using UnityEditor;

public class FBXScaleFix : AssetPostprocessor
{
    public void OnPreprocessModel()
    {
        ModelImporter modelImporter = (ModelImporter) assetImporter;                    
        modelImporter.globalScale = 1;          
    }   
}

Note: This is an editor class. To use it you have to place your script in Assets/Editor inside your project folder. Editor classes are in the UnityEditor namespace so for C# scripts you need to add "using UnityEditor;" at the beginning of the script.

more ▼

answered Jul 27 '10 at 12:34 PM

Herman Tulleken gravatar image

Herman Tulleken
1.6k 25 36 56

Thank you so much, it worked perfectly!

Sep 10 '10 at 07:14 AM agentsmith

Nice! I've been searching all over for a way to fix my mesh scale issue. Only thing I must ask is what extension does C# use? I use java mainly so I know to put .js for that, but have no clue what to name this script. I tried naming it "fbxscale.cs" and placed in my Editor folder, but it didn't do anything. Thanks for the help!

Mar 23 '12 at 06:29 PM Angelus1818
(comments are locked)
10|3000 characters needed characters left

You can set the import scale in the import settings as well as other settings like calculate normals etc. When you then apply these settings the model will be reimported.

These settings are done on a per model basis. Select your model in the project view and you can change these in the inspector. Right click and select Import Settings in Unity iPhone.

The default import scale is 0.01 and i don't think this can be globally altered (although I've never looked at the default import settings work fine for me).

more ▼

answered Feb 26 '10 at 04:06 PM

fallingbrickwork gravatar image

fallingbrickwork
122 7

This means extra steps for the import pipeline, as every model needs someone to go and manually set the scale factor to 1. Also, if you have animations on that mesh you need to make sure you set the animation scale factor to 1, which sometimes causes other problems: http://answers.unity3d.com/questions/7092/lerpz-characters-scaling-is-not-respected

May 24 '10 at 05:20 PM Jeremy 1
(comments are locked)
10|3000 characters needed characters left

All of this is Unnecessary.
When working in Maya I figured out to work in Meters as I always do, Then when exporting set the scale factor to centimeters, and after importing it to Unity, set the scale factor of the imported object back to 1 and it solved it.

more ▼

answered Apr 02 at 08:01 PM

gfg_Timo gravatar image

gfg_Timo
1

(comments are locked)
10|3000 characters needed characters left

So sorry to bump this, but I need some related help, and didn't think I should create a whole other topic.

Herman posted a C# script that seems to do exactly what I need. I bought some Unity package files containing lots of .fbx meshes fully textured and ready to go. However I am having the same problem of everything importing at a 0.01 scale. I am not a coder at all, so here is where I'm stuck.

The few times I use scripts, I use java. So I know to put a .js extension to my script. I don't work with C/C# at all. I did some searching and found some posts say that C# uses the ".cs" extension. When I made a text file, and copied the text Herman posted, and saved as a .cs file, placed into my Editor folder, it doesn't do anything. This leads me to believe I am messing up.

Could someone please tell me what extension to use, and if there is a specific file name I should use? For example I just called it "fbxscale.cs" Also should I re-import my unity package files? Or will it update them once I place this script in my editor folder?

Thanks for the help!

-Angelus

more ▼

answered Mar 23 '12 at 08:02 PM

Angelus1818 gravatar image

Angelus1818
1 1

Herman's script changes the default import setting; so in other words it will only ensure an import scale of 1 for any newly imported models. That's all it does.

Your unity packages however will still have whatever import scale they had originally. Herman's script only applies to new models.

Jul 04 '12 at 10:47 AM Guessmyname
(comments are locked)
10|3000 characters needed characters left

This worked perfectly for me.

more ▼

answered Dec 11 '10 at 09:25 PM

JakeT gravatar image

JakeT
2 3 3 4

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x973
x389

asked: Feb 26 '10 at 02:25 PM

Seen: 8922 times

Last Updated: Apr 02 at 08:01 PM