i hate unity’s importing stuff at 0.01 scale, it’s just plain wrong. i flat out refuse to make things at 100x size
I fixed it by using this little script
using UnityEngine;
using UnityEditor;
using System;
public class CustomImportSettings : AssetPostprocessor
{
public const float importScale= 1.0f;
void OnPreprocessModel()
{
ModelImporter importer = assetImporter as ModelImporter;
importer.globalScale = importScale;
}
}
It works, but it’s notperfect
For one, it disables the import scale option entirely, and basically hardcodes it to 1.0
this is fine for anything i make but is problematic forr assets i purchase or otherwqise aquire
Secondly, i have a vague suspicion it might cause issues. this just seems like a sloppy way of doing things.
ideally i’d like it to automatically set that field to 1.0, but still allow me to change it, if possible.
is there any way to improve the script to accomplish that? is there a better way to do this?
void OnPostprocessModel ( GameObject g ) {
ModelImporter importer = assetImporter as ModelImporter;
importer.globalScale = 1;
}
Although the number in the import options will always revert to 1, it does actually appear to apply the newly typed-in value to the mesh
Edit: Nah wait, now it doesn’t actually apply 1 to newly imported objects. Lame My first idea was to override the model importer inspectorGUI, and add a tick box, but DrawDefaultInspector doesn’t, you know… draw the default inspector
Why?
The only thing this does different is doesn’t turn the scale down if it’s higher than 1.0, that doesn’t actually solve anything or make any difference to the issue