Created
June 1, 2014 11:46
-
-
Save PatHightree/a7168104ee9604fa1404 to your computer and use it in GitHub Desktop.
Unity postprocessor, sets the scale to 1 on fbx files exported from 3dsmax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
using UnityEngine; | |
/// <summary> | |
/// This asset preprocessor sets the importer's global scale to 1.0. | |
/// This way the scale in 3dsmax corresponds correctly to the scale in Unity. | |
/// </summary> | |
class PostProcessor_GlobalScale1 : AssetPostprocessor { | |
/// <summary> | |
/// This method is called just before importing an FBX. | |
/// </summary> | |
void OnPreprocessModel() { | |
ModelImporter modelImporter = assetImporter as ModelImporter; | |
modelImporter.globalScale = 1.0f; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment