Search Unity

Question Is there a way to automatically set the 3D model's Rig-Animation Type to Legacy?

Discussion in 'General Discussion' started by chealin, Jun 29, 2022.

  1. chealin

    chealin

    Joined:
    Sep 10, 2017
    Posts:
    76
    Hello

    I need a file with FBX's Rig-Animation Type as Legacy

    But if you get the FBX after working on the 3DMax,

    The Rig-Animation Type is Generic

    When I import FBX from 3DMax, I want FBX's Rig-Animation Type to be set to Legacy
    Is there a way?

    Thank you.


    upload_2022-6-29_10-52-4.png
     
  2. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,571
  3. chealin

    chealin

    Joined:
    Sep 10, 2017
    Posts:
    76
    hello
    I've tried AssetPreprocessor, as you said

    Code (CSharp):
    1.  
    2. public AutoFBXAnim : AssetPostprocessor
    3. {
    4.     void OnPreprocessModel()
    5.     {
    6.         ModelImporter importer = (ModelImporter)assetImporter;
    7.                   importer.animationType = ModelImporterAnimationType.Legacy;
    8.     }
    9. }
    By writing the script like this, the AnimationType of FBX entering the editor changes to Legacy.
    thank you