Search Unity

FBX versions

Discussion in 'Film, TV, Animation & Cinematics Previews' started by Allan33, May 6, 2021.

  1. Allan33

    Allan33

    Joined:
    Mar 13, 2021
    Posts:
    5
    Hi - Anyone have any info on if it would be possible to control what FBX version this exporter is using - I have some older external hardware that needs older FBX versions that the one Unity use. Thx Allan
     
  2. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    232
    Hi Allan,

    It is not possible to change the version of FBX SDK used directly inside the released package.
    Depending on the version you need, you may be able to use an older version of the FBX exporter.
    You can see which version of FBX is used in the changelog of the Autodesk FBX SDK for Unity (com.autodesk.fbx) package, which the FBX exporter depends on. This package provides access to a subset of the FBX SDK in C#.

    Alternatively it should be possible to rebuild the com.autodesk.fbx package that the exporter uses with a different version of the FBX SDK.

    Note: depending on the version of the FBX SDK you build with, there may be changes necessary to the swig .i files in the Source/ folder. For example if there is a function that doesn't exist or function definitions do not match. This may require using an older version of the FBX exporter or modifying some of the functionality as well.

    In order to do so, you can get the code from here: https://github.com/Unity-Technologies/com.autodesk.fbx

    Follow the instructions in the README for building. At this step:

    Code (csharp):
    1.  
    2. python build.py
    3.  
    It will search for the latest version of FBX SDK at "C:/Program Files/Autodesk/FBX/FBX SDK" on Windows and "/Applications/Autodesk/FBX SDK" on Mac.

    To change the location it searches add "--fbxsdk {path_to_fbxsdk}" as arguments. For example:

    Code (csharp):
    1.  
    2. python build.py --fbxsdk "D:\Program Files\Autodesk\FBX\FBX SDK"
    3.  
    After the build is complete add the built com.autodesk.fbx package (in com.autodesk.fbx/build/install) to your Unity project from the Package Manager.
    The FBX exporter should now use your custom built package.

    Best,
    Viktoria
     
    Last edited: May 6, 2021
  3. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    232
    Hi @Allan33 ,

    I think there may be another way to export a file that would be compatible with older versions of FBX without necessarily changing the version of FBX SDK used.

    It would be using the FbxExporter::SetFileExportVersion() function.
    You can set it by modifying your FBX Exporter installation. This can be done by either cloning the repo or by copying your local install in your Unity project to a new location from {yourProject}\Library\PackageCache\com.unity.formats.fbx. Then uninstall the package from the package manager and add back your local version.

    This setting is already used in the FbxExporter.cs file. Simply modify it to the version you need to be compatible with.

    See here for a list of version strings.

    Hope this helps,
     
unityunity