Skip to content

Instantly share code, notes, and snippets.

@musngikd
Created August 13, 2014 18:21
Show Gist options
  • Save musngikd/d83aa4d41cf8532e18d7 to your computer and use it in GitHub Desktop.
Save musngikd/d83aa4d41cf8532e18d7 to your computer and use it in GitHub Desktop.
Sets FBX Mesh Scale Factors to 1 when imported into Unity
// BatchRename.cs
// Sets FBX Mesh Scale Factors to 1 when imported into Unity
// Via Alan Thorn (TW: @thorn_alan)
using UnityEngine;
using UnityEditor;
using System.Collections;
/// <summary>
/// Sets FBX Mesh Scale Factor to 1
/// </summary>
public class FBX_Import : AssetPostprocessor
{
public const float importScale = 1.0f;
void OnPreprocessModel()
{
ModelImporter importer = assetImporter as ModelImporter;
importer.globalScale = importScale;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment