Search Unity

New FBX Exporter in 2017.2

Discussion in 'External Tools Previews' started by ans_unity, Oct 12, 2017.

  1. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    175
    Hi @Goooooooogle,

    We have not yet looked into changing the ModelExporter methods to public, however it is possible to change your local copy of the package to expose these functions.

    Here are the steps to do so:

    1. Under packages select FBX exporter, then right click in the project view and select "Show in Explorer"

    upload_2019-12-12_11-24-49.png

    2. Move the package from this location into your Unity project's Packages/ folder

    3. Now in Unity you can open up the FbxExporter.cs file and make the necessary functions public.


    Alternatively instead of getting the package from the package manager you can also fork our public repo: https://github.com/Unity-Technologies/com.unity.formats.fbx

    Let me know if this doesn't work or if you have any issues.

    Best,
    Viktoria
     
  2. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    175
    Hi @FeastSC2 ,

    Very sorry about this. You are right that exporting should not cause any loss of data or change your scene, this is definitely a high priority bug. I'm glad you were able to find a workaround in the meantime.

    Best,
    Viktoria
     
    FeastSC2 likes this.
  3. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    468
    Hi @vkovec, thanks for the suggestions, but have you actually looked at the bug repro project in (Case 1201937)? It breaks with all the above.
     
  4. AlbyDj90

    AlbyDj90

    Joined:
    Feb 7, 2015
    Posts:
    33
    I found the scripts used in the com.autodesk.fbx package...but it's a little too complicated to figure out what all this does without a proper documentation.
    The example for a basic exporter in https://docs.unity3d.com/Packages/com.unity.formats.fbx@2.0/manual/devguide.html does not show a way to convert and export an object from unity...only an empty single file.
     
  5. bhudson

    bhudson

    Joined:
    Nov 21, 2014
    Posts:
    28
    Hi @AlbyDj90 : indeed, the documentation we provide with the package is intended to be the bare minimum to get an experienced Autodesk FBX SDK programmer to start applying their knowledge to Unity/C#. The com.autodesk.fbx package is a preview package, not easily discoverable via the Package Manager UI, on purpose: we can't provide much support for it.

    At the moment the best link to the SDK's latest documentation is here: https://help.autodesk.com/view/FBX/...ome_to_the_fbx_sdk_what_new_fbx_sdk_2020_html

    The learning curve is quite steep unfortunately.
     
  6. bhudson

    bhudson

    Joined:
    Nov 21, 2014
    Posts:
    28
    If you're using the FBX Exporter package, this post doesn't affect you (yet).


    Hi everyone using the FBX SDK C# Bindings directly!

    We've uploaded the Bindings to version 3.0.0-preview.1 which adds support for FBX SDK 2020.0. If you've manually added the Bindings package to your manifest.json you can use the Package Manager UI to update to the latest. Otherwise, you can add the line:
    Code (csharp):
    1.     "com.autodesk.fbx": "3.0.0-preview.1",
    to the top of the "dependencies" in your manifest.json.

    As mentioned above, this is for experimental use and we can't offer much support.

    The package's CHANGELOG.md documents what changed in the bindings themselves.
    • Access to get/set tangents in animation curves and keys.
    • Access to the new DeepConvertScene (which bakes axis convention changes rather than rotating the root).
    • IL2CPP support.

    Visit Autodesk's page to see what has changed in FBX SDK 2020.0 versus FBX SDK 2018.1.1:
    https://help.autodesk.com/view/FBX/...ome_to_the_fbx_sdk_what_new_fbx_sdk_2020_html
    https://help.autodesk.com/view/FBX/...ome_to_the_fbx_sdk_what_new_fbx_sdk_2019_html
     
  7. bhudson

    bhudson

    Joined:
    Nov 21, 2014
    Posts:
    28
    I was finally able to look at this again. It doesn't seem like the FBX SDK itself has native support for UVWZ: the UV LayerElement class only takes an FbxVector2 (and the Unity FBX Exporter can't go beyond what the FBX SDK provides).

    You'd need to represent your WZ data some other way. You could use a second UV set, or use vertex colours. Then you'd also need scripts to reconstruct it on the other side if it needs to be supported there.

    (Edit: oops, @vkovec ninja'd me two weeks ago)
     
    Last edited: Dec 17, 2019
  8. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    175
    Hi @fherbst,

    I was able to repro the issue. Until we fix this the workaround would be to remap the materials to the correct ones:

    upload_2019-12-18_13-25-9.png

    This worked for me in the project attached to the case. It's not ideal, especially if you have a lot of materials/textures, but would be a temporary workaround.

    Best,
    Viktoria
     
  9. BaskaletGames

    BaskaletGames

    Joined:
    Oct 4, 2016
    Posts:
    1
    I have the same problem!
    did you fix it?
     
  10. toomasio

    toomasio

    Joined:
    Nov 19, 2013
    Posts:
    29
    Apologies if this has been answered already but I noticed in the export description it reads "Quads or Triangles". Where is the option to choose between the two? right now I am only getting Tris being exported to max.

    Also, are there any plans for two-way integration? For example if I edited the object in probuilder and wanted to "update" the linked fbx file so it also updates in max without having to re-export the fbx file again.

    Thanks!
     
  11. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    175
    Hi @BaskaletGames,

    We have logged and were able to reproduce the issue. Until we make the fix here is a temporary workaround:

    1. open the problematic file: [myprojectpath]/Assets/ExportedAssets/Integrations/Autodesk/maya/scripts/unityCommands.mel
    2. find the line with the issue (which you can see in the Maya console error log. In the most recent release it is line ~403). It should look something like this:

    Code (csharp):
    1.  
    2. file -import -type "FBX" -ignoreVersion -ra true -mergeNamespacesOnClash true -pr -importFrameRate true -importTimeRange "override" $filePathStr;
    3.  
    3. remove "-importFrameRate true"
    4. close Maya
    5. In Unity go to Edit > Project Settings > Fbx Export and reinstall the integration for Maya. Install into the same location, and when prompted whether to use existing files or replace them, make sure to keep the existing files.

    upload_2020-1-14_14-43-22.png

    Best,
    Viktoria
     
  12. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    175
    Hi @toomasio,

    I see how the documentation can be a little misleading. It isn't an option but something that happens automatically when exporting a mesh. If the mesh is made up of quads in Unity then it will automatically be exported as quads.

    If you are exporting a mesh containing or made up of FBX files, then in order to get quads, you would need to import the geometry with "Keep Quads" checked:

    upload_2020-1-14_14-49-25.png

    Other examples are exporting Probuilder meshes or procedurally generated meshes with quads. These should maintain the quads on export as well. Let me know if this is not the case for you.

    If you are not changing the hierarchy too much (e.g. just editing a mesh), then you should be able to reexport the object and overwrite the linked FBX (which will update the linked prefab), then import this into Max. Currently there aren't any plans for an integration that does not require re-export.

    Best,
    Viktoria
     
  13. Zolden

    Zolden

    Joined:
    May 9, 2014
    Posts:
    114
    I would like to add Fbx Exporter package to my project, but there's a problem: Fbx Exporter is not listed under Package Manager. I'm using 2019.2.17.f1 version of Unity.

    Any tips on why isn't there Fbx Exporter in the list of packages, and how to add it to my project anyway?

    Edit: Oh, found the solution. Should have checked "Show Preview Packages" under "Advanced".
     
  14. vkovec

    vkovec

    Unity Developer - FBX Exporter

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

    Added
    - FBX Recorder to record animations from the Unity Recorder directly to FBX (adds dependency to Unity Recorder).
    - Export animated focal length and lens shift of cameras.

    Changed
    - Updated dependency to com.autodesk.fbx version 3.0.0-preview.1, which means we update to FBX SDK 2020

    Fixed
    - Fixed camera aspect and gate fit exporting as incorrect values.

    Known Issues
    - Using the FBX Recorder to record animated characters is not supported yet, and fails in some cases.
     
  15. Monil

    Monil

    Joined:
    Apr 24, 2012
    Posts:
    23
    Hello everyone,
    I just installed fbx exporter 3.0 preview 2,
    I recorded facial animations using Cinema Suite -> Cinema Face Cap which records the blendshape animation in .anim file, I need to import the blendshape animation into 3ds max, but the exported file includes the morph modifier with mesh data but with empty name and without the weight animation of each blendshape.

    Thanks to anyone who helps me out
     
  16. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    468
    @Monil please report a bug through Unity Bug Reporter and attach that file.
     
  17. Monil

    Monil

    Joined:
    Apr 24, 2012
    Posts:
    23
    Ok, I have report a bug through Unity Bug Reporter case 1214226.
     
  18. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    175
    Hi @Monil,

    Unfortunately, the FBX exporter does not currently export blendshape animation, only the blendshapes themselves. The mesh data having an empty name however is a bug.

    Best,
    Viktoria
     
  19. vkovec

    vkovec

    Unity Developer - FBX Exporter

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

    Added
    - Added option to export geometry when recording with the FBX recorder (in previous version geometry was always exported).
    - Added settings to transfer animation between two transforms in the recorded hierarchy.

    Fixed
    - It is now possible to record animated characters with the FBX recorder.
     
  20. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    175
    Hi @friuns3,

    Thank you for your patience. Please try with the latest release of the FBX exporter (3.0.1-preview.2). We have updated to using FBX SDK 2020, which seems to have fixed the issue.

    Let me know if you still see problems.
     
  21. Saoirsette

    Saoirsette

    Joined:
    Feb 11, 2020
    Posts:
    2
    I need help! After I exported my model to fbx, the armature bones in the fbx that were created are way smaller than the model itself. Same problem after the fbx is read in blender.



    These are my export settings

    I just want to export a humanoid model from prefab asset to fbx.

    What am I not doing right and how do I fix this? The bones in the model prefab were fine before export!

    EDIT: I selected 'Export Selected Object(s) as a single fbx.'
     
  22. Monil

    Monil

    Joined:
    Apr 24, 2012
    Posts:
    23
    To Saoirsette, the first thing I would do is update the plugin.
     
  23. Saoirsette

    Saoirsette

    Joined:
    Feb 11, 2020
    Posts:
    2
  24. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,153
    These are 2 different assets with similar names. Yours is by "UnLogick Factory. You should contact the developer for assistance.

    This forum thread is for Unity Technology's FBX Exporter that can be downloaded through the package manager. It is free, and it doesn't have the problems you are posting.
     
  25. unity_9476764

    unity_9476764

    Joined:
    Jun 21, 2019
    Posts:
    1
    Hello. I use Unity 2018.4.15f1.
    Fbx exporter 3.0.0
    When I am triyng to export fbx - this message apears:

    Code (CSharp):
    1. KeyNotFoundException: The given key was not present in the dictionary.
    2. System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
    3. UnityEditor.Formats.Fbx.Exporter.ModelExporter.ExportSkeleton (UnityEngine.SkinnedMeshRenderer skinnedMesh, Autodesk.Fbx.FbxScene fbxScene, System.Collections.Generic.Dictionary`2[UnityEngine.SkinnedMeshRenderer,UnityEngine.Transform[]]& skinnedMeshToBonesMap) (at Library/PackageCache/com.unity.formats.fbx@3.0.0-preview.2/Editor/FbxExporter.cs:1003)
    4. UnityEditor.Formats.Fbx.Exporter.ModelExporter.ExportSkinnedMesh (UnityEngine.GameObject unityGo, Autodesk.Fbx.FbxScene fbxScene, Autodesk.Fbx.FbxNode fbxNode) (at Library/PackageCache/com.unity.formats.fbx@3.0.0-preview.2/Editor/FbxExporter.cs:928)
    5. UnityEditor.Formats.Fbx.Exporter.ModelExporter.ExportMesh (UnityEngine.GameObject gameObject, Autodesk.Fbx.FbxNode fbxNode) (at Library/PackageCache/com.unity.formats.fbx@3.0.0-preview.2/Editor/FbxExporter.cs:4072)
    6. UnityEditor.Formats.Fbx.Exporter.ModelExporter.ExportComponents (Autodesk.Fbx.FbxScene fbxScene, System.Boolean exportAnim) (at Library/PackageCache/com.unity.formats.fbx@3.0.0-preview.2/Editor/FbxExporter.cs:3162)
    7. UnityEditor.Formats.Fbx.Exporter.ModelExporter.ExportAll (System.Collections.Generic.IEnumerable`1[T] unityExportSet, System.Collections.Generic.Dictionary`2[TKey,TValue] exportData) (at Library/PackageCache/com.unity.formats.fbx@3.0.0-preview.2/Editor/FbxExporter.cs:3505)
    8. UnityEditor.Formats.Fbx.Exporter.ModelExporter.ExportObjects (System.String filePath, UnityEngine.Object[] objects, UnityEditor.Formats.Fbx.Exporter.IExportOptions exportOptions, System.Collections.Generic.Dictionary`2[TKey,TValue] exportData) (at Library/PackageCache/com.unity.formats.fbx@3.0.0-preview.2/Editor/FbxExporter.cs:4201)
    9. UnityEditor.Formats.Fbx.Exporter.ExportModelEditorWindow.Export () (at Library/PackageCache/com.unity.formats.fbx@3.0.0-preview.2/Editor/ExportModelEditorWindow.cs:643)
    10. UnityEditor.Formats.Fbx.Exporter.ExportOptionsEditorWindow.OnGUI () (at Library/PackageCache/com.unity.formats.fbx@3.0.0-preview.2/Editor/ExportModelEditorWindow.cs:444)
    11. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
    12. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    13. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
    14. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
    15. UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:342)
    16. UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:336)
    17. UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:310)
    18. UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect, System.Boolean customBorder, System.Boolean floatingWindow, System.Boolean isBottomTab) (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:361)
    19. UnityEditor.DockArea.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:320)
    20. UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:266)
    21. UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:438)
    22. UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:421)
    23. UnityEngine.Experimental.UIElements.IMGUIContainer.HandleEvent (UnityEngine.Experimental.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:401)
    24. UnityEngine.Experimental.UIElements.EventDispatcher.ProcessEvent (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:511)
    25. UnityEngine.Experimental.UIElements.EventDispatcher.Dispatch (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel, UnityEngine.Experimental.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:307)
    26. UnityEngine.Experimental.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.Experimental.UIElements.EventBase e, UnityEngine.Experimental.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/Panel.cs:176)
    27. UnityEngine.Experimental.UIElements.UIElementsUtility.DoDispatch (UnityEngine.Experimental.UIElements.BaseVisualElementPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:245)
    28. UnityEngine.Experimental.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:68)
    29. UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
    30.  
     
  26. bhudson

    bhudson

    Joined:
    Nov 21, 2014
    Posts:
    28
    unity_9476764, thanks for the bug report. Are you able to share the model you're trying to export?
     
  27. wfowlerD9

    wfowlerD9

    Joined:
    Jun 26, 2019
    Posts:
    21
    I installed the package from the Unity Package Manager, but I'm getting an error message:
    DllNotFoundException: Packages/com.autodesk.fbx/Windows/UnityFbxSdkNative.dll


    Sure enough, this file does not exist anywhere, and Googling has yielded nothing. Did I forget to install something?
     
unityunity