Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Official New FBX Exporter in 2017.2

Discussion in 'Asset Importing & Exporting' started by ans_unity, Oct 12, 2017.

Thread Status:
Not open for further replies.
  1. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Hello! We have released a new version of the FBX exporter package (3.2.0-preview.2), with the following changes:

    Added

    - Added an option to the Autodesk® Maya® integration Unity menu for creating an export set.
    - The option can be found in File > Unity > Create Export Set
    - Selecting this option will open a dialog allowing the user to select the desired export locations for model and animation files.
    - File > Unity > Export [Model Only|Animation Only] will also open the same dialog if the objects selected for export
    are not already in an export set.

    Changed
    - Do not search for Autodesk® installs in `D:/Program Files/Autodesk` (not a standard drive).
    - Update Unity Recorder dependency to version 2.2.0-preview.4.

    Fixed
    - Added a null check when inspecting whether a Timeline Clip is selected for export. This fixes a NullReferenceException when an object in the selection is null.
    - Fix issue where different Materials and Meshes with identical names export as a single material/mesh.
    - Fix skinned mesh always exports in bind pose regardless of current pose.
    - Import/Export in Maya Integration fails if FBX Import/Export settings file missing.
     
  2. wdw8903

    wdw8903

    Joined:
    Apr 2, 2015
    Posts:
    48
    Hello, I try the fbx recorder function in Recorder, "Compatible Naming" toggle is missing in Recorder, fbx files are automatic replaced empty space to "_" by Recorder. But 3ds max support empty space naming, so object names in fbx become different with 3ds max original files. upload_2020-7-3_10-34-10.png


    I also encounter unit convert problem when export fbx with animation. fbx exporter export file is cm unit, I can't import the fbx animation to inch unit 3ds max file correctly. I tried I can modify FbxExporter.cs to get an inch unit fbx file.
    Replace "UnitScaleFactor = 100f;" to "UnitScaleFactor = 1/0.0254f;".
    Replace "FbxSystemUnit.cm" to "FbxSystemUnit.Inch".
    Then I can get an inch unit animation only fbx file, and import it to 3ds max correctly.
    So why not add public unit convert option? Which will be more convenient for 3ds max users. 3ds max use inch as default unit, and many people won't change it. I get 3ds max files from others, so I can't change the unit in 3ds max, which will break their files.
     
  3. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Hi @DrabanL, thank you for the additional information. Unfortunately, I was still not able to reproduce the issue by either importing or exporting the file.
    If you see the issue again (or are still experiencing the issue) please log it through the Unity bug reporter. This can help ensure that we have all the correct versions and files to reproduce the issue.

    upload_2020-7-6_11-23-48.png
     
  4. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Hi @wdw8903,

    Thank you for letting us know, I will log a task to add the Compatible Naming toggle to the recorder options.

    I'm glad you were able to find a workaround. The reason there isn't a public unit conversion option is that unit conversion on import/export into different DCCs does not always produce a consistent result, which causes issues especially when roundtripping between Unity and another DCC. We found that we got the best results when leaving the system unit as cm and scaling to m (Unity's unit).
    For most DCCs you can still convert the unit on import if desired. Alternatively if you will be exporting the FBX back to Unity from 3ds Max, I would recommend changing the unit in 3ds Max to cm in order to get the most consistent results.

    Best,
    Viktoria
     
  5. SympaK

    SympaK

    Joined:
    Apr 14, 2010
    Posts:
    134
    Excuse me, I installed UnityFBXExporter1_2_0, I see the package in the packages' folder but I do not see any writings of it from any menu tab whence to invoke it. I'm in the latest LTS.
     
    Last edited: Jul 7, 2020
  6. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Right-click in the hierarchy. Should be one of the last items in the popup menu.
     
  7. HampusSVRVIVE

    HampusSVRVIVE

    Joined:
    Oct 3, 2016
    Posts:
    3
    Found a really annoying bug. If you have custom UVs for say, lightmaps, in UV slot 2, for some reason, it cuts it up when exporting from Unity, and then importing into Maya again. The UVs are layed-out the same way as before, but has gotten random cuts everywhere, which adds ugly lightbake issues when baking Dx

    Edit: Solved it by importing everything in the models, all the tangents, smoothing groups, e.t.c. Seems that letting Unity calculate stuff only brings in more trouble. For some reason these things can't be seen within Unity, though, which is really strange.
     
    Last edited: Jul 9, 2020
  8. rg_software

    rg_software

    Joined:
    Apr 29, 2017
    Posts:
    10
    Hi,
    I encountered a problem with FBX Exporter. It throws null reference exception when I am trying to export my prefab. I reported it with a builtin bug reporter (case 1262667), but just decided to post it here as well if some additional info is necessary.
     

    Attached Files:

  9. SympaK

    SympaK

    Joined:
    Apr 14, 2010
    Posts:
    134
    Why this script is still not available in the store?
     
  10. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Hi @rg_software,

    Thank you for reporting the issue. It looks like the problem is that the root of the prefab that you are exporting is a bone, which the FBX exporter does not currently handle. I'll log an issue to fix this.

    Additionally, the root is both a bone and a skinned mesh renderer. Currently the FBX SDK does not support an object to be both a mesh and a bone, therefore even if the export succeeds it would likely export the root as only a bone and not a skinned mesh.

    Best,
    Viktoria
     
    Last edited: Jul 20, 2020
  11. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Hi @SympK,

    The FBX exporter has moved from the Asset Store to the Package Manager inside Unity.
    In order to install the FBX exporter you can follow these steps:
    1. Open your Unity project that you wish to install the package into
    2. Open Window > Package Manager
    3. Depending on your Unity version you may need to click "Show Preview Packages" under the "Advanced"
    dropdown in the window
    4. Search for "FBX Exporter" and click Install

    upload_2020-7-17_13-1-31.png
     
    SympaK likes this.
  12. cyf649669121

    cyf649669121

    Joined:
    Aug 28, 2017
    Posts:
    3
    Nothing changed in 3dsMax after I Installed Fbx Exporter ...

    Version:
    Unity : 2019.4.4 f1
    3dsMax 2018 ;
    Fbx Export 3.2.0-preview.2


    Steps:

    I clicked "Install Unity Integration",and chosen folder :
    D:\Autodesk\3ds Max 2018\Plugins
    (I also tried other folders, but nothing has changed)

    Then 3dsMax ran twice , but pop up a error :


    unable to convert: undefined to type:String

    Then I Found that Script : configureUnityFbxForMax.ms, and modified it like this :


    Code (CSharp):
    1. global UnityPluginScript_Source = @"D:/Autodesk/3ds Max 2018/Plugins/Integrations/Autodesk/max/scripts/UnityFbxForMaxPlugin.ms";
    2. global UnityPluginScript_Name = @"UnityFbxForMaxPlugin.ms";
    3. global UnityProject = @"F:/Project/FantacyArtSource/";
    4. global UnityFbxExportSettings = @"D:/Autodesk/3ds Max 2018/Plugins/Integrations/Autodesk/max/scripts/unityFbxExportSettings.ms";
    5. global UnityFbxImportSettings = @"D:/Autodesk/3ds Max 2018/Plugins/Integrations/Autodesk/max/scripts/unityFbxImportSettings.ms";
    6.  
    7. temp = pathConfig.GetDir(#userStartupScripts) + "/" + UnityPluginScript_Name;
    8. deleteFile temp;
    9. copyFile UnityPluginScript_Source temp;
    10.  
    11. maxIniFile = (GetMAXIniFile())
    12. unityCategory = "Unity"
    13. setINISetting maxIniFile unityCategory "UnityProject" UnityProject
    14. setINISetting maxIniFile unityCategory "UnityFbxExportSettings" UnityFbxExportSettings
    15. setINISetting maxIniFile unityCategory "UnityFbxImportSettings" UnityFbxImportSettings
    16.  
    17. -- quitmax()

    Then I ran the new script ,and no warning no error .
    I checked the folder : C:\Users\Administrator\AppData\Local\Autodesk\3dsMax\2018 - 64bit\CHS\scripts\startup
    there is existed the script : UnityFbxForMaxPlugin.ms;

    Then I Checked the file 3dsMax.ini , It's changed with [Unity] category .

    But there in nothing changed in my 3dsMax ! Just like I never install anything ...

    How can I Fix it ?
     
    Last edited: Jul 25, 2020
  13. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,363
    This looks good but I was hoping to be able to export to fbx at runtime and the code does not look easy to convert for that purpose. Edit: can be done, bit many editor dependencies to remove
    it would be a useful addition to this package.

    Also code notes: Often you don't have just 1 class per file, with file named as per the class (interesting!!)
    And sealed classes, no hope to extend or say customise material treatment - not everyone uses standard materials?
     
    Last edited: Aug 10, 2020
  14. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,363
    The exporter seems to include hidden objects which might not be desired.
     
  15. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,363
    & texture export is buggy?
    The full texture path is exported for full & relative (!) paths (in ASCII at least), but loading the fbx in any software I have - blender, fbx review etc. no textures are loaded with the fbx and it would be nice to have the option to embed textures in the binary fbx.
     
  16. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Hi @cyf649669121,

    I recommend installing the integration outside of the 3ds Max install location. Some of the scripts are meant to be run from Unity and cause these kinds of issues when placed in the 3ds Max install directory as they are run on opening 3ds Max instead of when the installation runs from Unity.

    If this does not solve the problem, particularly with the UI, then it could be an issue with the plugin currently expecting 3ds Max to be installed in English. In this case I have a few workarounds mentioned in this post.

    Best,
    Viktoria
     
  17. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Hi @andyz,

    Making the FBX exporter usable at runtime is not currently on the roadmap as it could only be supported on the editor platforms. However, I will log a task to look into adding it.

    For the materials, the best that FBX can do natively will still result in most of the visual quality of a modern shader being lost. For this reason, creating an API to handle shaders beyond the standard shader was not prioritized. The easiest workaround is to create high-quality materials in Maya and connect them by name on import into Maya.

    Just want to make sure I understand correctly, by hidden objects do you mean objects that are disabled as in the image below?
    upload_2020-8-12_13-33-56.png

    What would be the scenario you would like to achieve? would you like to have the visibility of the object exported or not export these objects at all?

    In the upcoming release there will be a fix related to the relative path being incorrect. Also, I have created a task for adding the option to embed textures on export.

    Best,
    Viktoria
     
  18. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,363
    Thanks, I hacked together a working solution from your code which was very helpful in the circumstance

    Yes, so I modified the code to ignore GameObjects which are .activeInHierarchy == false.
    Otherwise the exported model could have additional visible objects versus the scene view.

    Also I noticed all imported meshes in the scene must be set to enable read/write else you get errors on trying to export.
    Might this affect the amount of memory used at runtime if all meshes set like this?
     
  19. cyf649669121

    cyf649669121

    Joined:
    Aug 28, 2017
    Posts:
    3
    I tired many folders , include outside of the 3ds Max install location ,but still wrong.
    Thank you , I'll try it .
     
  20. Ziboo

    Ziboo

    Joined:
    Aug 30, 2011
    Posts:
    356
    Hello.
    Is it possible to use Prefab Link with Blender ?
    Importing a fbx without loosing reference or scripts in Unity ?

    Thanks
     
  21. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Yes when the mesh is read/write enabled it will be kept in both GPU and CPU addressable memory. See this link for more information.
     
  22. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Hi @Ziboo,

    Yes the Linked Prefab should work regardless of which DCC you use. Once the prefab and FBX are created (by right clicking and selecting "Convert To FBX Linked Prefab"), the prefab will be linked to the FBX file and anytime the FBX is modified/overwritten, the prefab will reflect the changes in the FBX while retaining references/scripts/components.

    For more information on FBX Linked Prefabs, check out the documentation here.

    Let me know if you have any issues.

    Best,
    Viktoria
     
    Ziboo likes this.
  23. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,363
    I understand, but it tripped me up because generally you would not set it on for the reason I quote from that link:
    "In most cases, you should disable this option to save runtime memory usage."
     
  24. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Yes, however it needs to be enabled in order for the exporter to access the mesh data and write it out to FBX. Depending on your use case, it could be possible to disable the option at runtime when you no longer need it:
    "- To set the value to false at run time, set the markNoLongerReadable argument of Mesh.UploadMeshData."
     
  25. zulaman

    zulaman

    Joined:
    May 12, 2017
    Posts:
    26
    Is there a way to control the exporter options from a script?
    I'm using the exporter from an editor script like the following:
    Code (CSharp):
    1. ModelExporter.ExportObjects(objPath, Selection.gameObjects);
    The issue that I'm having is that it exports it with the objectPosition set to "Local Centered" instead of "World Absolute". Any way I can control that ?
    Thanks.
     
  26. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Hi @zulaman,

    It is not currently possible to change the settings with the public API, however we plan to make the functions that allow you to change the export settings public in the future.

    Until then, you can also make it public by modifying the source code locally. Here are the steps:

    1. In the Unity Project view, under "Packages", select the FBX Exporter.
    2. Right click and select "Show in Explorer" to find the downloaded package location.
    3. Copy the com.unity.formats.fbx folder to a new location
    4. In Unity remove the FBX exporter package from the Package Manager
    5. In the Package Manager use the "+" button in the top left corner to add the copied package from disk
    6. In the copied com.unity.formats.fbx package, in Editor/FbxExporter.cs search for ExportObject(s) and
    find the ones that take export settings as an argument and change them from internal to public.

    You may also need to make other classes related to the export settings public as well.

    Best,
    Viktoria
     
  27. zulaman

    zulaman

    Joined:
    May 12, 2017
    Posts:
    26
    Haha, thank you for pointing that out.
    I should be able to get it working there.
     
  28. marcovida

    marcovida

    Joined:
    May 8, 2019
    Posts:
    4
  29. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Hi @marcovida,

    Yes it will export animation by default. Is it not the case for you? If you are seeing any issues, please send the file(s) that are not exporting correctly if possible, or you can also log the bug from Unity (Help > Report a Bug...).

    As for the public API, it might be helpful to check out the source code in the public repo: https://github.com/Unity-Technologies/com.unity.formats.fbx/. The FbxExporter.cs file in particular.

    Best,
    Viktoria
     
  30. arisdev82

    arisdev82

    Joined:
    Feb 27, 2019
    Posts:
    39
    Hi boys!

    I'm trying to export a very big gameobject to fbx. Using editor options the asset sizes to about 70Mb but when i'm doing it by code using ModelExporter.ExportObject the ammount grows to 1.9GB.

    Is it possible to setup the exporter when using ModelExporter.ExportObject?

    Thanks in advance!
     
  31. highkite

    highkite

    Joined:
    Aug 28, 2020
    Posts:
    5
    Hello there.

    I'm working on a tool that uses FBXExporter but I realize that FBXExporter exports models with centimeters as its default unit. I'm trying to change the unit to meter, but it returns with a model that is 100x larger than the original when I do that.

    Is it possible to change the unit to meters without enlarging the model? Thanks in advance.
     
  32. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Hi @arisdev82 ,

    Unfortunately the export settings cannot currently be changed with the public API, however we plan to make it possible to change the export settings with the public API in the future.

    Until then, you can also make it public by modifying the source code locally. Here are the steps:

    1. In the Unity Project view, under "Packages", select the FBX Exporter.
    2. Right click and select "Show in Explorer" to find the downloaded package location.
    3. Copy the com.unity.formats.fbx folder to a new location
    4. In Unity remove the FBX exporter package from the Package Manager
    5. In the Package Manager use the "+" button in the top left corner to add the copied package from disk
    6. In the copied com.unity.formats.fbx package, in Editor/FbxExporter.cs search for ExportObject(s) and
    find the ones that take export settings as an argument and change them from internal to public.

    You may also need to make other classes related to the export settings (such as those in {package}/Editor/ExportModelSettings.cs) public as well.

    Best,
    Viktoria
     
  33. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Hi @highkite ,

    Currently the unit is set to cm in the FBX file, however the objects are set to real world meter scale.
    For example, if vertex[0] is at [1, 1, 1] m, it is converted to [100, 100, 100] cm.

    The reason for this is that cm is the default FBX file unit and it gives the most consistent results when roundtripping files between DCCs with different scale units.

    In order to convert the file to meters without the 100x scaling, in addition to changing the unit to meters you will need to change the `UnitScaleFactor` in Editor/FbxExporter.cs to 1 instead of 100:

    Code (csharp):
    1.  
    2. internal const float UnitScaleFactor = 100f;
    3.  
    https://github.com/Unity-Technologi....unity.formats.fbx/Editor/FbxExporter.cs#L104

    Best,
    Viktoria
     
  34. arisdev82

    arisdev82

    Joined:
    Feb 27, 2019
    Posts:
    39
    Last week I did it all exactly :D

    Anyway, thanks for the answer!
     
    vkovec likes this.
  35. Sybaris

    Sybaris

    Joined:
    Aug 19, 2013
    Posts:
    91
    I'm not sure whether this is the right thread for my issue...
    I'm using the fbx exporter package 4.0.0 with Unity 2020.1.16. I'm exporting a prefab from unity to an fbx file and reread it into Unity again to check whether the two are identical. It works more or less but a couple of things seem to be missing: "Metallic" and "Smoothness" values are different in the exported fbx file; also the normal map multiplier is fixed at 1 instead of the original 0.6; texture tiling is 1,1 instead of 0.5, 0.5 and so on.

    Is this by intention or am I doing something wrong?

    Thanks in advance!
     
  36. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Hi @Sybaris,

    You are in the right place :)

    Material export from Unity is currently limited, as there isn't a straightforward way to map between the FBX and Unity materials.
    Most materials will export as Lambert in FBX with color, emission color, and bump scale as well as corresponding textures. Specular materials will export as Phong and also include the specular color and texture.
    Export of properties such as metallic and smoothness are not supported at this time.

    For the reimported FBX I recommend using the original Unity materials if possible. For example by remapping them on the FBX in the inspector under Remapped Materials.

    upload_2021-2-3_11-39-13.png

    Alternatively, if you are sending the FBX to Maya or another DCC, if you apply a material such as a Stingray PBS material to your mesh, it should carry over into Unity when you send it back.

    Best,
    Viktoria
     
  37. Pode

    Pode

    Joined:
    Nov 13, 2013
    Posts:
    145
    @vkovec
    Since the Unity Standard Shader is a PBR one, and the FBX format support the "Physical Material" from Autodesk, isn't it possible to remap the shader values and textures in the exported FBX, using a "Physical Material" ?
     
  38. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,363
    It is hard to believe there is no standard for PBR materials in 3d models yet!
    But I suspect if Unity's importer was adjusted then this exporter could export models with full info
     
  39. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    As there isn't yet a clear standard with how materials are handled/supported between DCCs, it is unfortunately difficult to support a specific format/more than what we currently do.
     
  40. highkite

    highkite

    Joined:
    Aug 28, 2020
    Posts:
    5
    @vkovec

    Thanks for being forward about the material export. The response is quite timely with the issue I'm encountering.

    Alas, I would like to get a good idea on how to get around it. I wanted to do a side-by-side comparison of the before and after exporting using the FBX Exporter. The tree on the left is the original prefab and the tree on the right is an fbx object after being exported. I noticed that the tree on the right is a bit less saturated.

    I went through the inspector and I could not find any indication of any differences in the inspector. Main texture, metallic, smoothness, shader. They all match, but the output still looks different.

    Is there anything I can do so that the output can look accurate to the original prefab?

    Thanks in advance.
     

    Attached Files:

  41. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Hi @highkite ,

    I think I was able to recreate the issue, is the albedo of the exported material different from the original?

    I will log a bug for this.

    Best,
    Viktoria
     
  42. highkite

    highkite

    Joined:
    Aug 28, 2020
    Posts:
    5
    The albedo is a direct match to the original.

    Looking forward to hearing how this develops.

    Edit: I should also mention that I am currently using FBX Exporter version 3.2.1
     
    Last edited: Feb 19, 2021
  43. Sybaris

    Sybaris

    Joined:
    Aug 19, 2013
    Posts:
    91
    Sorry for taking so long to reply, Viktoria.
    Thanks for your answer anyway!
     
    vkovec likes this.
  44. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Interesting, would it be possible to please share the original prefab/material as well as the exported FBX?
    Either here or from within Unity (in the top menu: Help > Report a Bug...).

    Thanks!
     
  45. highkite

    highkite

    Joined:
    Aug 28, 2020
    Posts:
    5
    Yeah, I'm attaching a unity package with the original prefab and the exported fbx inside.
     

    Attached Files:

  46. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Thank you for sending the files. It looks like the exported material is missing shader keywords that the original material has.

    upload_2021-2-24_14-32-18.png

    In order to see them you can enter Debug mode for the inspector by clicking on the menu at the top right of the inspector window and selecting "Debug" instead of "Normal".
     
  47. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,363
    Hi I used a version of this exporter in a standalone Windows app and it works fine on my PC and in the editor, but on some people's machines it can not use the fbx dll and has errors in the log like:
    Code (CSharp):
    1. Fallback handler could not load library ..._Data/Mono/UnityFbxSdkNative
    2. Fallback handler could not load library ..._Data/Mono/UnityFbxSdkNative.dll
    3. Fallback handler could not load library ..._Data/Mono/UnityFbxSdkNative
    4. Fallback handler could not load library ..._Data/Mono/libUnityFbxSdkNative
    5. Fallback handler could not load library ..._Data/Mono/libUnityFbxSdkNative.dll
    6. Fallback handler could not load library ..._Data/Mono/libUnityFbxSdkNative
    Any idea?

    (I still hope official runtime support is added, but I had to remove editor code to allow it, but maybe the dll requires vc runtime components or something?)

    Edit: was a case of missing vc runtime dlls - not sure if can be compiled into dll on creation to void the requirement
     
    Last edited: Mar 4, 2021
  48. daniel_lochner

    daniel_lochner

    Joined:
    Jun 9, 2016
    Posts:
    175
    Hi @vkovec,

    I'm trying to export a
    GameObject
    to Fbx at runtime, however am stuck on how to add an
    FbxObject
    to the
    FbxScene
    which is being exported?

    Have been using the following code snippet from this article as a reference, which currently exports an empty scene to a project's root directory.
    Code (CSharp):
    1. using Autodesk.Fbx;
    2. using UnityEngine;
    3. using UnityEditor;
    4.  
    5. protected void ExportScene (string fileName)
    6. {
    7.     using(FbxManager fbxManager = FbxManager.Create ()){
    8.         // configure IO settings.
    9.         fbxManager.SetIOSettings (FbxIOSettings.Create (fbxManager, Globals.IOSROOT));
    10.  
    11.         // Export the scene
    12.         using (FbxExporter exporter = FbxExporter.Create (fbxManager, "myExporter")) {
    13.  
    14.             // Initialize the exporter.
    15.             bool status = exporter.Initialize (fileName, -1, fbxManager.GetIOSettings ());
    16.  
    17.             // Create a new scene to export
    18.             FbxScene scene = FbxScene.Create (fbxManager, "myScene");
    19.  
    20.             // Export the scene to the file.
    21.             exporter.Export (scene);
    22.         }
    23.     }
    24. }
    25.  
    Thanks!
     
  49. markvi

    markvi

    Joined:
    Oct 31, 2016
    Posts:
    118
  50. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Hi @andyz,

    Thank you for bringing this issue to our attention, I have logged a bug for further investigation.
    Currently a workaround would be shipping the vs redistributable with the app.
     
Thread Status:
Not open for further replies.