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. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

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:
    44
    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:
    12,161
  3. chealin

    chealin

    Joined:
    Sep 10, 2017
    Posts:
    44
    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