Skip to content

Instantly share code, notes, and snippets.

@PatHightree
Created June 1, 2014 11:46
Show Gist options
  • Save PatHightree/a7168104ee9604fa1404 to your computer and use it in GitHub Desktop.
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
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