Search Unity

Autodesk.fbx 4.1.0 build error

Discussion in 'Asset Importing & Exporting' started by jeremias-volker, Feb 9, 2022.

  1. jeremias-volker

    jeremias-volker

    Joined:
    Nov 1, 2016
    Posts:
    3
    Hi,

    I have a very similar issue to this one: https://forum.unity.com/threads/autodesk-fbx-build-error.716864/

    I'm trying to use Autodesk.Fbx to export/import FBX at runtime. The difference is I'm using a newer version com.autodesk.fbx@4.1.0 and the recommended fix doesn't work (the same errors remain).

    I've got this working in the editor. However, when creating a build (macOS + Windows 64 bit) I get multiple errors similar to these:

    Code (CSharp):
    1. Error CS0246: The type or namespace name 'Autodesk' could not be found (are you missing a using directive or an assembly reference?)
    2. Error CS0246: The type or namespace name 'FbxMesh' could not be found (are you missing a using directive or an assembly reference?)
    I managed to get rid of this error by moving the package into my Assets and editing `com.autodesk.fbx@4.1.0/Runtime/Scripts/NativeMethods.cs`. I changed the first line from

    #if UNITY_EDITOR || FBXSDK_RUNTIME 
    to

    #if UNITY_EDITOR || FBXSDK_RUNTIME || UNITY_STANDALONE

    That get's rid of those errors but leaves me with new ones:

    Code (CSharp):
    1. error CS0246: The type or namespace name 'FbxDouble4' could not be found (are you missing a using directive or an assembly reference?)
    2.  
    3. error CS0246: The type or namespace name 'FbxColor' could not be found (are you missing a using directive or an assembly reference?)
    4.  
    5. error CS0246: The type or namespace name 'FbxDouble3' could not be found (are you missing a using directive or an assembly reference?)
    How can I fix these errors and create a build for Windows 64bit?

    Thanks a lot in advance.
     
  2. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Hi @jeremias-volker,

    For including the package in the build, you will need to add FBXSDK_RUNTIME to the Scripting Define Symbols:
    1. In the Unity Editor main menu, select Edit > Project Settings.
    2. In Player properties, expand the Other Settings section.
    3. Under Configuration, in the Scripting Define Symbols field, add FBXSDK_RUNTIME
    For more details, please see this section of the documentation.
     
    jeremias-volker likes this.
  3. jeremias-volker

    jeremias-volker

    Joined:
    Nov 1, 2016
    Posts:
    3
    Amazing! This seems to work.

    Thank you so much. :)
     
    vkovec likes this.