Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Untick "Use File Scale" through asset preprocessor...

Discussion in 'Scripting' started by Rodolfo-Rubens, Jun 28, 2017.

  1. Rodolfo-Rubens

    Rodolfo-Rubens

    Joined:
    Nov 17, 2012
    Posts:
    1,196
    I noticed that now we can ignore the file scale (that one we had 0.01 in fbx files and we couldn't change) but how one can set that value to false through the asset preprocessor?
     
  2. Steamroller

    Steamroller

    Joined:
    Jan 2, 2013
    Posts:
    71
    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. public class AssetProcessor : AssetPostprocessor
    4. {
    5.     protected virtual void OnPreprocessModel()
    6.     {
    7.         ModelImporter modelImporter = assetImporter as ModelImporter;
    8.         modelImporter.useFileScale = false;
    9.     }
    10. }