Autodesk.fbx build error

Hello,

the FbxExporter package from Unity gives the possibility to export GameObjects as FBX files. According to the documentation this is also possible at runtime when implementing the exporter completely using Autodesk.Fbx (the autodesk fbx sdk).

I achieved now to successfully export the models in the editor. However, when I try to build the application as a Windows Standalone x64, I always get the following error:

Assets\StandardAssets\FbxExport.cs(5,7): error CS0246: The type or namespace name ‘Autodesk’ could not be found (are you missing a using directive or an assembly reference?)

According to the following link it also should work in the build as well:
https://docs.unity3d.com/Packages/com.unity.formats.fbx@2.0/manual/devguide.html

Can anybody help me? I already looked into some files of the Autodesk package and I found the NativeMethods.cs script where one can specify the DllImportName as following:

#if UNITY_EDITOR_OSX
  const string DllImportName = "Packages/com.autodesk.fbx/Runtime/Plugins/x86_64/UnityFbxSdkNative.bundle/Contents/MacOS/UnityFbxSdkNative";
#elif UNITY_EDITOR_LINUX
  const string DllImportName = "Packages/com.autodesk.fbx/Runtime/Plugins/x86_64/UnityFbxSdkNative.so";
#elif UNITY_EDITOR_WIN
  const string DllImportName = "Assets/Autodesk/Plugins/x86_64/UnityFbxSdkNative.dll";
#elif COM_UNITY_FORMATS_FBX_AS_ASSET || UNITY_STANDALONE
  const string DllImportName = "UnityFbxSdkNative";
#else
#error "FbxSdk: C# bindings for this platform haven't been implemented yet, sorry."
        const string DllImportName = "UnityFbxSdkNative";
#endif

One can see, that also the UNITY_STANDALONE is supported. I have tried to set a correct path to the dll here, but this did not change anything.

Thanks for any help!

Just had this problem too. Fixed by copying the “com.autodesk.fbx@2.0.1-preview.1” folder to my Assets folder, then uninstalling the FBX Exporter package. Once that is done the problem still exists, so in the project click on the “com.autodesk.fbx@2.0.1-preview.1/Runtime/Autodesk.Fbx.asmdef” and tick the “Windows 64-bit” option in “Include Platforms”. Then the build should work. Note that I could not tick this box when the package was in the normal install location, so had to copy it into the Assets folder.

Hello thank you for you reply,

your hint with the Include Platforms option did the trick! :slight_smile: