Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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. amorinImgSpc

    amorinImgSpc

    Joined:
    Jun 11, 2018
    Posts:
    41
    Unfortunately, I'm afraid not; We looked into it but the issues that arise when using IL2CPP aren't trivial to fix.
     
  2. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    I'm using:
    Unity 2018.2.11f1
    FBX Exporter 1.3.0f1
    Max 2019 with update 2

    The export menu does not appear in Max

    When I try install the integration, like I say, Max opens up, and hangs
    While Max is hanging, Unity is also unresponsive and I can't do anything with either programs.
    I then kill Max via task manager and then Unity returns errors:

    --------------------------
    3ds Max installation error (exit code: 1): 00:00:00 849MB | log started Fri Oct 5 20:42:50 2018
    00:00:00 849MB | Arnold 5.2.0.0 [4fb9451c] windows icc-17.0.2 oiio-1.7.17 osl-1.9.9 vdb-4.0.0 clm-1.0.3.513 rlm-12.4.2 2018/08/09 09:37:24
    00:00:00 849MB | running on MYPC, pid=49452
    00:00:00 849MB | 1 x Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz (6 cores, 12 logical) with 32709MB
    00:00:00 849MB | Nvidia driver version 411.63
    00:00:00 849MB | GPU 0: GeForce GTX 1080 Ti @ 1582MHz (compute 6.1) with 11264MB (11124MB available)
    00:00:00 849MB | GPU 1: GeForce GTX 670 @ 1084MHz (compute 3.0) with 4096MB (2949MB available)
    00:00:00 849MB | Windows 8 Professional (version 6.2, build 9200)
    00:00:00 849MB | soft limit for open files raised from 2048 to 2048
    00:00:00 849MB |
    00:00:00 849MB | loading plugins from c:\programdata\autodesk\applicationplugins\maxtoa ...
    00:00:00 851MB | loaded 14 plugins from 4 lib(s) in 0:00.06

    UnityEngine.Debug:LogError(Object)
    FbxExporters.Editor.MaxIntegration:InstallMaxPlugin(String)
    FbxExporters.Editor.MaxIntegration:InstallIntegration(String)
    FbxExporters.Editor.IntegrationsUI:InstallDCCIntegration()
    UnityEditor.EditorApplication:Internal_CallDelayFunctions()

    ------------------------
    Ran max: [C:/Program Files/Autodesk/3ds Max 2019/3dsmax.exe]
    With args [-q -silent -mxs "global UnityPluginScript_Source = @\"D:/Studio/Software/3D Plugins and Scripts/Unity FBX Max integration/Integrations/Autodesk/max/scripts/UnityFbxForMaxPlugin.ms\";global UnityPluginScript_Name = @\"UnityFbxForMaxPlugin.ms\";global UnityProject = @\"D:/Studio/Work/Mystuff/Unity Blank/temp\";global UnityFbxExportSettings = @\"D:/Studio/Software/3D Plugins and Scripts/Unity FBX Max integration/Integrations/Autodesk/max/scripts/unityFbxExportSettings.ms\";global UnityFbxImportSettings = @\"D:/Studio/Software/3D Plugins and Scripts/Unity FBX Max integration/Integrations/Autodesk/max/scripts/unityFbxImportSettings.ms\";filein \"D:/Studio/Software/3D Plugins and Scripts/Unity FBX Max integration/Integrations/Autodesk/max/scripts/configureUnityFbxForMax.ms\""]
    Result 1
    UnityEngine.Debug:Log(Object)
    FbxExporters.Editor.MaxIntegration:InstallMaxPlugin(String)
    FbxExporters.Editor.MaxIntegration:InstallIntegration(String)
    FbxExporters.Editor.IntegrationsUI:InstallDCCIntegration()
    UnityEditor.EditorApplication:Internal_CallDelayFunctions()

    -------------------------
    Error displaying dialog: The operation completed successfully.

    UnityEditor.EditorUtility:DisplayDialog(String, String, String)
    FbxExporters.Editor.IntegrationsUI:ShowSuccessDialog(String, Int32)
    FbxExporters.Editor.IntegrationsUI:InstallDCCIntegration()
    UnityEditor.EditorApplication:Internal_CallDelayFunctions()
     
    Last edited: Oct 5, 2018
  3. Hertzole

    Hertzole

    Joined:
    Jul 27, 2013
    Posts:
    421
    Hey
    I've seen a few posts mentioning the need for a runtime API to export models in a standalone build and they've only gotten the response "not yet", or similar. Any news on that front? A runtime API is the last thing I need to finish a specific project.
     
  4. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
    Hi @vkovec ,

    I'd like to automate transfering some scene prefabs (FBX Exporterd) step by step into my 3dsmax by a script. For some tests I would like to clone/duplicate existing prefabs are already in the scene several times.

    I tried
    Code (CSharp):
    1.  GameObject clone  = PrefabUtility.InstantiatePrefab(Selection.activeObject as GameObject) as GameObject;
    But the cloned result is NULL. But Instantiate(go) create a "Unpacked Prefab" but that's not useful. Did you have any hint, how to duplicate a prefab is already in the scene per script, same as using duplicate from menu ?

    Thanks a lot.
     
  5. amritt_unity

    amritt_unity

    Joined:
    Jul 30, 2018
    Posts:
    13
    Hey, I have a question regarding this asset. Can I export to FBX, move it to another computer where the artist can modify the FBX and reimport on my side?
     
  6. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
    We use Dropbox.com to do so. Under a single project I have folders:

    _FBX/game/
    _FBX/Steve/
    _FBX/Ryan/

    These folders are located (linked) by Dropbox and are shared instantly with Steve and Ryan on different locations of the world. You can save/load/change original models or FBX. The other workers should have the same model application. In the past we had trouble if different workers use different 3d applications.

    A hint: All workers should use the same project path:
    Same Drive: G:/UnityProjects/MyFirstGame/Assets/_FBX/...
    This makes handling of references to textures/models/etc. for all workers 3D application extremely easy.

    Its only an example to work with, perhaps the Fbx team members can tell you more about.
     
    Last edited: Oct 9, 2018
    amritt_unity and vkovec like this.
  7. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    even with the latest Unity beta 2018.3, I still have no joy getting the FBX pluign installed. Max 2019.2 just hnags there with the "Security Tool 1.0 loaded" in the listener window

    Can Unity please provide MANUAL installation procedures to install the 4 maxscripts to enable the FBX plugin
     
  8. JosephCoppolaFW

    JosephCoppolaFW

    Joined:
    Apr 4, 2017
    Posts:
    8
    Hello,

    My team and I have been testing out this plugin in hopes of using it in tandem with animation recording in Unity. Translation and rotation animation export into Maya perfectly, however we aren't seeing blendshape values on the skinned mesh renderer from the animation being exported correctly to the FBX when reviewing in Maya. When we open the Shape Editor in Maya, the correct number of blendshapes are there, but when you modify any of them they all use the first blendshape in the list of blendshapes from the Skinned Mesh Renderer. For example, for a rig with 135 blendshapes and the first blendshape being eyebrows down, all 135 blendshapes exported to Maya end up being eyebrows down.

    Given that there is an "Animated Skinned Mesh" option, I would assume animated blendshape values would export along with the rest of the FBX. Any idea why the blendshapes aren't exported correctly and aren't being animated in Maya 2018?

    Thanks in advance,

    Joe
     
  9. vkovec

    vkovec

    Unity Developer - FBX Exporter

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

    Thank you for providing these details. Until we find the problem, here are the manual steps for installing the 3ds Max plugin:

    1. Unzip the UnityFbxForMax.zip file that comes with the FBX exporter to a readable location
    2. Copy the UnityFbxForMaxPlugin.ms maxscript to your 3ds Max user startup scripts folder.
    By default this is: C:\Users\{user}\AppData\Local\Autodesk\3dsMax\2019 - 64bit\ENU\scripts\startup

    You can also find this location in 3ds Max from the top menu under Customize > Configure System Paths...

    upload_2018-10-10_11-41-14.png

    3. Open 3ds Max and run the following maxscript:

    Code (csharp):
    1.  
    2. global UnityProject = "path/to/UnityProject/"
    3. global UnityFbxExportSettings = "path/to/Integrations/Autodesk/max/scripts/unityFbxExportSettings.ms"
    4. global UnityFbxImportSettings = "path/to/Integrations/Autodesk/max/scripts/unityFbxImportSettings.ms"
    5.  
    6. maxIniFile = (GetMAXIniFile())
    7. unityCategory = "Unity"
    8. setINISetting maxIniFile unityCategory "UnityProject" UnityProject
    9. setINISetting maxIniFile unityCategory "UnityFbxExportSettings" UnityFbxExportSettings
    10. setINISetting maxIniFile unityCategory "UnityFbxImportSettings" UnityFbxImportSettings
    11.  
    Replace the paths with the absolute paths to your Unity project and the files from the unzipped zip file.

    This will set up max to be able to find your Unity project as well as the Unity import/export settings.

    4. After running the script you may need to restart 3ds Max (to ensure that the menu items appear and are setup properly)

    Let me know if this works for you.

    I don't recommend using Unity 2018.3 for the time being as several Linked Prefab workflows are broken in this version. We are working on a fix for this.

    Best,
    Viktoria
     
  10. vkovec

    vkovec

    Unity Developer - FBX Exporter

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

    At the moment there are no plans for adding a runtime exporter. However, the FBX SDK C# bindings that are used by the exporter can also be used at runtime.

    Version 2.0.0-preview of the exporter contains the source code for the exporter and FBX SDK bindings. Therefore, with this version you could modify the exporter so that it will work at runtime. Alternatively you could also use the FBX SDK bindings to write your own custom runtime exporter.

    Best,
    Viktoria
     
  11. vkovec

    vkovec

    Unity Developer - FBX Exporter

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

    I think the issue is that you are passing a prefab instance where instantiate prefab expects the prefab asset, which is the prefab on disk that the instances are created from.

    Try the following instead, which will first get the prefab asset from the instance, then pass it to InstantiatePrefab:
    Code (csharp):
    1.  
    2. var prefabAsset = PrefabUtility.GetCorrespondingObjectFromSource(Selection.activeObject as GameObject);
    3. GameObject clone = PrefabUtility.InstantiatePrefab(prefabAsset) as GameObject;
    4.  
    Best,
    Viktoria
     
    Quatum1000 likes this.
  12. vkovec

    vkovec

    Unity Developer - FBX Exporter

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

    Yes, as @Quatum1000 suggested you can use Dropbox or Google Drive. Alternatively, if you are on the same
    network as the artists you can create a network drive. Here are a few links about network drives for more info:

    https://en.wikipedia.org/wiki/Drive_mapping
    https://www.howtogeek.com/school/windows-network-sharing/lesson8/

    Source control such as Perforce or git could be another option, depending on your needs.

    Best,
    Viktoria
     
  13. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Hi Joe,

    The FBX exporter does not currently support export of blendshape animation. I will log a task for adding this in the future.

    If I understood correctly, in Unity you have multiple different blendshapes, but after export you are only seeing the first blendshape repeated multiple times in Maya. For example, if you have a Cube and Sphere as blendshapes, you are seeing the Cube twice in Maya instead of a Cube and a Sphere. Is this correct?

    If possible, could you please send me the fbx with the issue?

    Best,
    Viktoria
     
  14. dmlightup

    dmlightup

    Joined:
    Jun 7, 2017
    Posts:
    15
    Thanks for this asset. I've generally had a good experience with it in combo with Unity 2017-18 and Maya 2018 on Windows 10.

    Where can we see the asset roadmap for a future release?

    Some issues I've found include:
    UV coordinates appear unwelded after fbx import into Maya
    Sometimes colliders and other components get lost in the process.
    As previously reported on this forum, exporting rigged characters often fails
     
  15. JosephCoppolaFW

    JosephCoppolaFW

    Joined:
    Apr 4, 2017
    Posts:
    8
    Thanks for the quick response! The addition of blendshape support would be incredibly helpful and very useful given a lot of facial rigs these days are moving towards blendshapes.


    This is correct. The first blendshape will be repeated for x number of blendshapes in the skinned mesh renderer.

    I noticed this on several different FBXs, but was testing mainly with the "Victor Rig" FBX featured in the demo scenes in the Faceware Live Client for Unity Plugin. https://assetstore.unity.com/packages/tools/animation/faceware-live-client-for-unity-25392

    If you download that, you can use the rig in the demo scenes to reproduce the behavior easily. There are 135 blendshapes on the head geometry.

    Thanks again, I look forward to seeing blendshape support in the future!

    Joe
     
  16. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
    Thank you. The main problem is, a scene prefab can be very different from prefab that is the base prefab of the asset database. I want exactly the same prefab as in the scene. After a bit of headache I was able to write a namespace that does. If anyone has a better or easier logic, please provide.

    The source is not that short, but there is not other way to do. But for sure it can be optimized.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Reflection;
    3. using System;
    4. using UnityEngine.SceneManagement;
    5. #if UNITY_EDITOR
    6. using UnityEditor;
    7. #endif
    8.  
    9. namespace ComponentUtility {
    10.     public static class ValueTools {
    11.  
    12.         /// <summary>
    13.         /// Duplicate GameObject excepting scene Prefabs
    14.         /// </summary>
    15.         /// <param name="gobject"></param>
    16.         /// <returns></returns>
    17.         public static GameObject DuplicateGameObject(GameObject gobject) {
    18.  
    19.             // Get original Position and Rotation
    20.             var pos = gobject.transform.position;
    21.             var rot = gobject.transform.rotation;
    22.  
    23.             // Get the current Scene. Selection can be different from the active Scene
    24.             var sceneCurrent = SceneManager.GetActiveScene();
    25.  
    26.             SceneManager.SetActiveScene(gobject.scene);
    27.             GameObject goCopy = null;
    28.  
    29. #if UNITY_EDITOR
    30.  
    31.             // ? GameObject is a Prefab ?
    32.             if (PrefabUtility.GetPrefabAssetType(gobject) == PrefabAssetType.Regular) {
    33.  
    34.                 // Get the original path of the Prefab in the AssetDatabase
    35.                 var path = PrefabUtility.GetPrefabAssetPathOfNearestInstanceRoot(gobject);
    36.  
    37.                 // Create an Object out of the AssetDatabase given path
    38.                 var obj = AssetDatabase.LoadAssetAtPath(path, typeof(GameObject));
    39.  
    40.                 // Instantiate to the Scene where the otiginal GameObject was located
    41.                 goCopy = PrefabUtility.InstantiatePrefab(obj) as GameObject;
    42.  
    43.                 // The instantiated GameObject has default values are based on the original AssetDatabase Prefab
    44.                 // Use Reflection to get all the data from the scene Prefab to match
    45.                 // Parent GameObject
    46.                 var goAllComponents = gobject.GetComponents(typeof(Component));
    47.                 var goCopyAllComponents = goCopy.GetComponents(typeof(Component));
    48.  
    49.                 for (int idx = 0; idx < goAllComponents.Length; idx++) {
    50.                     if (typeof(MeshFilter) == goAllComponents[idx].GetType()) { }
    51.                     // Do nothing, otherwhise we leak Unity
    52.                     else {
    53.                         //.GetComponentValues comes from the namespace ComponentUtility.ValueTools
    54.                         // goCopyAllComponents[idx] = goCopyAllComponents[idx].GetComponentValues(goAllComponents[idx]);
    55.                         goCopyAllComponents[idx].GetComponentValues(goAllComponents[idx]);
    56.                         if (goCopyAllComponents[idx] == default) {
    57.                             Debug.LogError(".GetComponentValues(Component) does not matched!");
    58.                         }
    59.                     }
    60.                 }
    61.  
    62.                 // Child GameObjects
    63.                 Transform[] goChilds = new Transform[gobject.transform.childCount];
    64.                 Transform[] GoCopyChilds = new Transform[goCopy.transform.childCount];
    65.  
    66.                 for (int idx = 0; idx < goChilds.Length; idx++) {
    67.  
    68.                     goChilds[idx] = gobject.transform.GetChild(idx);
    69.                     GoCopyChilds[idx] = goCopy.transform.GetChild(idx);
    70.  
    71.                     goAllComponents = goChilds[idx].GetComponents(typeof(Component));
    72.                     goCopyAllComponents = GoCopyChilds[idx].GetComponents(typeof(Component));
    73.  
    74.                     for (int cidx = 0; cidx < goAllComponents.Length; cidx++) {
    75.                         if (typeof(MeshFilter) == goCopyAllComponents[cidx].GetType()) { }
    76.                         // Do nothing, otherwhise we leak Unity
    77.                         else {
    78.                             goCopyAllComponents[cidx].GetComponentValues(goAllComponents[cidx]);
    79.                             if (goCopyAllComponents[cidx] == default) {
    80.                                 Debug.LogError(".GetComponentValues(Component) does not match!");
    81.                             }
    82.                         }
    83.                     }
    84.                 }
    85.             } else goCopy = GameObject.Instantiate(gobject);
    86. #else
    87.             goCopy = GameObject.Instantiate(gobject);
    88. #endif
    89.  
    90.             if (gobject.transform.parent != null)
    91.                 goCopy.transform.parent = gobject.transform.parent;
    92.  
    93.             goCopy.transform.localPosition = pos;
    94.             goCopy.transform.localRotation = rot;
    95.  
    96.             goCopy.name = gobject.name;
    97.             goCopy.SetActive(true);
    98.  
    99.             SceneManager.SetActiveScene(sceneCurrent);
    100. #if UNITY_EDITOR
    101.             Selection.activeGameObject = goCopy;
    102. #endif
    103.             return goCopy;
    104.         }
    105.  
    106.         /// <summary>
    107.         /// Get all values of a Component by Reflection
    108.         /// </summary>
    109.         /// <typeparam name="T"></typeparam>
    110.         /// <param name="component"></param>
    111.         /// <param name="componentToGetFrom"></param>
    112.         /// <returns></returns>
    113.         public static T GetComponentValues<T>(this Component component, T componentToGetFrom) where T : Component {
    114.             Type type = component.GetType();
    115.             if (type != componentToGetFrom.GetType())
    116.                 return default;
    117.  
    118.             BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Default | BindingFlags.DeclaredOnly;
    119.             PropertyInfo[] propertyInfos = type.GetProperties(flags);
    120.             foreach (var propertyInfo in propertyInfos)
    121.                 if (propertyInfo.CanWrite)
    122.                     try { propertyInfo.SetValue(component, propertyInfo.GetValue(componentToGetFrom, default), default); } catch { }
    123.  
    124.             FieldInfo[] fieldinfos = type.GetFields(flags);
    125.             foreach (var fieldinfo in fieldinfos)
    126.                 fieldinfo.SetValue(component, fieldinfo.GetValue(componentToGetFrom));
    127.  
    128.             return component as T;
    129.         }
    130.     }
    131. }
     
    Last edited: Oct 16, 2018
    vkovec likes this.
  17. ThreeRing

    ThreeRing

    Joined:
    Aug 24, 2016
    Posts:
    15
    From what I understood from the video, a grey box is used and then transferred to Maya, where the textured object FBX finally comes in.

    My question is: is it possible to export an object from Unity to FBX (Maya) with its shaders that were created in Unity (through nodes or by coding)?
     
  18. amorinImgSpc

    amorinImgSpc

    Joined:
    Jun 11, 2018
    Posts:
    41

    Hi!

    We're ramping up to being publicly listed on the package manager and from then we'll move on to more fixes and features. Feel free to suggest improvements or report bugs! Thank you for reporting these three issues - i'll make sure to log them so they get fixed.

    Alexis
     
    dmlightup likes this.
  19. amorinImgSpc

    amorinImgSpc

    Joined:
    Jun 11, 2018
    Posts:
    41
    Hi!

    Textures (and materials, to a degree) do get exported along with the meshes. We start with a cube in the example video, but you could just as well start with a more complex mesh (i.e a rough draft of an environment with semi-complex geometry and materials) and go on from there!

    Note that we however aren't at the stage where we have 1:1 material export from Unity; exporting to Maya would give you a mesh with the correct textures but only a standard Lambert-type Maya material. We've considered adding the ability to transmute the Unity Standard Material to a Stingray PBS material, but it's proven too complex for our current scope. You can, however, apply a Stingray PBS material to your mesh in Maya, and it will carry over into Unity when you send it back.

    Hope this helps!

    Alexis
     
  20. Hertzole

    Hertzole

    Joined:
    Jul 27, 2013
    Posts:
    421
    Hello

    I encountered two problems while trying this out.

    I created a mesh at runtime that I want to export (using the editor tools, so nothing really runtime specific). The mesh is a standard plane with two bones, one at the top and one at the bottom. The exact same mesh as this example creates (but without animations).
    Now, when I try to export it using right click - Export to FBX... I encounterd one problem at line 2899 in FbxExporter. Either the variable "unityBone" is null or "unityBone.parent" is null.
    And as I'm using the code as a reference to code my own runtime exporter, as Viktoria suggested, I made a local copy and edited the code and added a null check, which kind of worked, but the resulting export was empty, which is the second problem. It exports the object locations properly, but there is no mesh data when exporting an object using a skinned mesh renderer.
     
  21. ThreeRing

    ThreeRing

    Joined:
    Aug 24, 2016
    Posts:
    15
    Hi Alexis, and thank you so much for the detailed explanation.

    I understand the situation, it sounds quite complicated :/
    Any idea when this 1:1 material export from Unity feature might come out? Is it something we can only expect in the long term?

    I had read before about the Stingray PBS material, but I wasn't sure how to use it in my case. Because if I export something from Unity, apply the Stingray PBS material in Maya, and then export it again to Unity, it will have a different appearance comparing to the first time right? Any shaders that might have been created in Unity will not be carried in this process right? Please correct me if I'm wrong! :)

    Thank you in advance for your help!
     
  22. Jimbo_Slice

    Jimbo_Slice

    Joined:
    Oct 1, 2015
    Posts:
    44
    I would also like to vote up the inclusion of blendshape animation support! I got tricked by the Animated Skin Mesh tick box :(
     
  23. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Thanks that worked great!
     
    vkovec likes this.
  24. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    What kind of materials are supported for the Max to Unity export?
     
  25. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Hi Joe,

    I checked out the Victor Rig FBX and was able to recreate the problem. I am getting the correct blendshapes in Unity after export, but as you mentioned, in Maya they all import as the first blendshape.

    I have logged this as a bug. The problem seems to be that the names of the blendshapes are not getting exported, so Maya imports them as Shape1, Shape2, Shape3, etc. and associates all of them with the same shape in the file.
    So all the blendshapes are in the exported FBX, just not getting connected properly on import into Maya.

    I will let you know when the issue is resolved.
     
  26. vkovec

    vkovec

    Unity Developer - FBX Exporter

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

    I think this problem is related to a known issue with the exporter, where all bones need to be children of the Skinned Mesh Renderer's root bone when exporting.
    There are a couple of things you could do to fix this:

    1. make sure all bones are children of the Skinned Mesh Renderer's root bone
    2. since you are already modifying the exporter, here is a quick fix to the code:

    Modify line ~1031 in the FbxExporter.cs file to this:

    Code (csharp):
    1.  
    2. var boneList = bones; // boneSet.ToArray();
    3.  
    The commented out part is what boneList was being set to before. "bones" is the list of bone transforms from the Skinned Mesh Renderer. boneSet potentially included some additional transforms to export as bones.

    This is not a 100% fix and will not work if you are exporting animation only, but it should work for most other cases.

    Let me know if this doesn't solve your issue.
     
  27. JosephCoppolaFW

    JosephCoppolaFW

    Joined:
    Apr 4, 2017
    Posts:
    8
    Thanks you so much for checking into this and getting back so quickly. I look forward to seeing this issue resolved and support for blendshape animation!

    Thanks again,

    Joe
     
  28. vkovec

    vkovec

    Unity Developer - FBX Exporter

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

    There are currently no plans for exporting the Unity Standard material as Stingray PBS.

    Yes the modified material exported from Maya will most likely differ from the original Unity material that you had exported. Unfortunately there isn't really a perfect solution for roundtripping materials at the moment.

    The most reliable way to get the same material in Maya and Unity is to modify the material in Maya and export to Unity, but not send the material from Unity back to Maya.

    As Alexis mentioned, an alternative would be to send the material from Unity to Maya and set the material up in Maya to match as close as possible with what is in Unity. Then you can choose to either use the material from Maya in Unity or keep using the original material in Unity.

    That's right, shaders from Unity will not be carried across to Maya. Materials will either be exported as Lambert or Phong if the material is specular.

    Here are the material properties that get exported:

    - Albedo color (+ texture if any)
    - Emission color (+ texture if any)
    - Normal map (+ Bump Scale)
    - Specular color (if specular shader) (+ texture if any)

    Best,
    Viktoria
     
  29. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    From the Unity documentation for 3ds Max import it says that Unity will import:
    It is also possible to send Stingray PBS materials from 3ds Max to Unity. See this page for more info on using Stingray PBS shaders in 3ds Max.
     
  30. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    That page is seriously useless. When can we see the fbx max to unity accept VRay materials, redshift materials, arnold materials? Unity is seriously behind in this front. With Unreal we have datasmith and I can export my entire scene as is with vray materials and vray lights and see it same in Unreal. When can we expect something similar in Unity?
     
  31. eric_funktroniclabs

    eric_funktroniclabs

    Joined:
    Oct 4, 2018
    Posts:
    19
    Understood. Is there a way to disable the plugin at build time? I assume it doesn't need to run in a build. I make Android IL2CPP builds from the project and it's fine, so I'd like to do the same for windows IL2CPP builds.
     
    Last edited: Oct 23, 2018
  32. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
    Linked Folders in Unity.

    Hi team,

    I case of using the FBX exporter and 3dsmax (but this happen to all applications) I have redundant problems with FBX meshes materials and textures of several projects that depends on the same game is in development.

    Normally in the game development process, we use several different projects that holds different modules instead on packing all into one mega project. This has several advantages , faster over all handling of files, starting unity and there is lot more.

    All these projects, GameEditor, GameModels, GameAIAndMenu, GameEnvironment, etc... are based on the same game and the same editor tools using the same editor textures FBX meshes and materials.

    Now when changing the editor tools in the default GameEditor project I have to copy and the textures materials and meshes to the other projects manually, because Unity does not know about "Linked Folders". It would be an extremely enhanced workflow if we have a texture, material, FBX mesh - pool at a location and unity knows about through a linked folder.

    A linked folder is currently displayed as a file in Unity.
    Untitled-1.jpg

    If a linked folder would be handled in Unity in the same way as in Windows/IOS, that would solve and optimizing a lot of work. Materials Texture and FBX Meshes can be outsourced from the project itself. It makes possible to have a direct Editor Asset pool for several projects.

    On any 3d applications, photoshop, etc.., the material lib or textures and can be at a master location and other projects can access them by a linked folder. Also the FBX exporter would be possible work through a linked folder in unity.

    Does this make sense?
     
  33. ThreeRing

    ThreeRing

    Joined:
    Aug 24, 2016
    Posts:
    15
    Hi Viktoria,

    Thank you so much for your reply, it helped me clear a lot of questions in my head, and think about the possibilities.
    I have been indeed trying to get as close as possible to Unity's material in Maya, but there are Blending Modes that Maya can't handle, so about those, either I have to avoid using them in Unity, or just ignore them.

    Anyway, thank you so much for your answers!

    All the best ;)
     
    vkovec likes this.
  34. markvi

    markvi

    Joined:
    Oct 31, 2016
    Posts:
    118
    Quatum1000 likes this.
  35. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Hi Eric,

    Yes you can disable it so it doesn't get included in the build.

    Here are the steps:

    1. In order to modify the package you will need to copy the source code from the cache into your Unity project. The easiest way to find the package source location is to navigate to the package inside Unity in the Project tab, then right click and select "Show in Explorer".

    upload_2018-10-24_11-3-33.png

    On Windows the source can be found at C:\Users\{username}\AppData\Local\Unity\cache\packages\staging-packages.unity.com\com.unity.formats.fbx

    You will also need to copy the package called com.autodesk.fbx from this location as it is used by com.unity.formats.fbx

    2. Copy the packages directly into your Unity project's Packages/ directory to make it into an embedded package, then remove the package from the list in the manifest.json

    3. Now in Unity the project should look the same, except the FBX exporter source is editable from inside Unity

    4. In the Project tab navigate to Packages/FBX SDK CSharp Bindings/com.autodesk.fbx.asmdef

    5. In the inspector under platforms uncheck all include platforms except for Editor so that the package does not get included in any builds.

    upload_2018-10-24_11-4-45.png

    Note: after copying the files they may still be read only (preventing the settings from being applied), in which case you will need to make it writeable.

    upload_2018-10-24_11-5-27.png
     
  36. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Part1 of my question:
    I don't think I'm understanding how I'm suppose to be using the tool.

    For example I start in 3dsMax with a chair model (seat and legs are attached so one object). I have a multisub material assigned so the seat is one material and the legs another. I export using the "Export to Unity" item found in the menu, and I export the fbx into my "models" folder in my unity project.

    In Unity, I accept all defaults for the fbx file. I can't now directly edit the materials or assing new materials. I then drag the entire hierarchy of the chair into the scene, then I drag that back down to my prefebs folder, and I then delete it from the scene. Now in the prefabs, I can change the materials or assign new materials. Great, so far so good.

    Now I need to make an edit in 3dsMax to the chair, for example change the shape of the seat, and re-export to my models folder. Great, all works great, the chair in my prefabs folder updates and it remembers my Unity materials I assigned.

    Cool, now back in 3dsMax I need to make another edit to the chair, things are getting complex and I detach the legs and seat from each other so I now have 2 objects (same materials still assigned from before). I re-export to my models folder, my chair in models update and I can see it is now 2 objects. However, now in my prefabs folder, the chair is broken, I can only see the seat (not the legs I detached), and the seat suddenly has the legs material assigned. What broke?

    I need a workflow where I iterate and develop the model in 3dsMax, and it auto updates in Unity, but that seems not possible, or I'm not understanding what I'm suppose to be doing???

    Part2 of my question:
    How can I update the FBX Exporter to the latest preview package? I have the one from the asset store, but I've seen in various videos there is at least a preview 1.7 suppose to be available in the package manager, however I'm not seeing anything fbx related in the package manager? What should I add in my project manifest json file to be able to see the fbx preview package?

    Part3 of my question:
    Materials. Is it possible to get substance materials used in 3dsMax, as part of the fbx export so that I dont have to recreate or re-assing the materials in Unity? Autodesk killed Stingray so I don't want to be relaying on that as a workflow. We actually use VRay in production and it would be great if there was a way to get these into Unity directly, or at least a converter to convert the VRay materials to Unity PBR materials that can be recognised by the Export to Unity Script so we dont have to recreate or reassign materials
     
    Last edited: Oct 24, 2018
  37. Visual73

    Visual73

    Joined:
    Oct 21, 2017
    Posts:
    19
    Hi guys,

    I recorded an animation clip of a moving camera with Unity recorder.
    The animation of the recorded camera should be imported into Maya.

    What is the procedure ?
    I'm using fbxexporter.
     

    Attached Files:

  38. amorinImgSpc

    amorinImgSpc

    Joined:
    Jun 11, 2018
    Posts:
    41

    Hi!

    Simply create an animator component on your camera Game Object, drop your recorded animation into it ( like you would normally do to have it play in-game) then right click your camera object in the hierarchy view and carry on with the export as you normally would!
     
  39. amorinImgSpc

    amorinImgSpc

    Joined:
    Jun 11, 2018
    Posts:
    41

    Hey!

    For your first question; there's actually a convenient solution to your issue. If you click on the .fbx model in the project view and navigate to its material import settings, you'll be able to replace the material more granularly in the "Remapped Materials" sections; normally after doing it you should be getting much more consistent results with your material assignments.



    For your second question there's also a conveniently easy answer; a few pages ago Viktoria wrote a little guide on how to migrate to the package manager version from the asset store version!

    As for your third question: While you won't be able to export Substance materials straight from 3ds Max as FBX, If you use the Substance in Unity plugin you can just stick your sbsar files inside your Unity project, use them as materials and get a 1:1 result from what you'd see in Max. Considering everything you've said, this would probably be your best bet.

    As for VRay support, Chaos Group say here that while it's not in the cards right this instant they are interested in having a Unity integration and they're doing some R&D for it.

    Hopefully this helped;

    Alexis
     
  40. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    I'm not getting any of those options. All I get is "Import Materials" and that's it. I'm on Unity 2018.2.13f1
    upload_2018-10-26_0-15-24.png
    Also, why does the legs dissappear in the prefab, but I can clearly see it in the fbx?

    As for your other points, thanks
     
  41. amorinImgSpc

    amorinImgSpc

    Joined:
    Jun 11, 2018
    Posts:
    41
    Hm, that is pretty strange. Care to send me the fbx file so that I can have a look at it? I don't think that this should be happening normally. Do you know if this is happening to all fbx meshes or just this chair?

    As for the invisible legs, that sometimes happens when the order of the materials get swapped in the fbx file, or when you do certain hierarchy-altering actions like detaching meshes. Normally if you use the remapping workflow I talked about in my previous message you wouldn't be having this issue, but considering that you can't see the remapping options at all I understand how that could be upsetting...
     
  42. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Yes how do I send it to you? I dont want to attached it here in the public forum
     
  43. vkovec

    vkovec

    Unity Developer - FBX Exporter

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

    You can email me the fbx: viktoria@imgspc.com
     
  44. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Thanks I mailed you the model
     
    vkovec likes this.
  45. ahmidou

    ahmidou

    Joined:
    Sep 17, 2012
    Posts:
    87
    Hi @vkovec,
    Are you people also the ones involved in the importer? I'm asking because I need to send vertex data from a DCC
    to Unity but it's quite hard to find the process to get the correct ordering for the extra un-shared vertices (at uv borders and hard vertex/edges ).
    I did a quick test by comparing an FBX imported to, then exported from Unity and the order is also changing.
    Would it be possible to have some pseudo code to reproduce the same results?

    Thanks!!
     
  46. vkovec

    vkovec

    Unity Developer - FBX Exporter

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

    I asked the importer team about this. Here are a few things to try in the import settings:

    - Turn off "optimize mesh" and "weld vertices"
    - Disable normals and tangents generation
    - Make sure the mesh is only made of triangles

    These should prevent the importer from merging vertices.

    Best,
    Viktoria
     
  47. ahmidou

    ahmidou

    Joined:
    Sep 17, 2012
    Posts:
    87
    Hey @vkovec, thanks for your reply.
    I've already done all that, my problem is not that the vertices are merged but quite the opposite.
    What happens is Unity is splitting the vertices. Your right about the normals but I was already skipping them (even tho I'll need them at some point) but the problem is more how the vertices are splitted on UV border.
    I could also remove the UVs but then without normals and uvs I won't go very far.

    I noticed something else by comparing the same FBX exported from Maya and the same one from the Unity Exporter,
    and the vertex order is different here too, That's not a big deal as it was just by curiosity.

    Wouldn't it be possible to generate a mapping table from the Unity Mesh to the original FBX?

    Kind regards
    -A
     
  48. vkovec

    vkovec

    Unity Developer - FBX Exporter

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

    Yes I think this could be due to a vertex order change on import or on export or a combination of both.

    If possible, could you please share the FBX causing the issues, and some more details on what you are trying to achieve?

    It could help us better understand the problem and how to resolve it.

    A suggestion from the importer team is to use vertex colors to index the vertices.

    For example, in the DCC you are using, you could assign different colors to vertices in order to identify them. Then once in Unity you can retrieve the vertex colors and use these to map the vertices in Unity with the vertices from the FBX. Even if vertices get split, both should have the same color.
     
  49. Osteel

    Osteel

    Joined:
    Jan 17, 2014
    Posts:
    59
    Hello!

    Is there a way to change the location where a linked prefab is exported that is outside the project folder? We're hoping to store assets on an internal server for our artists to then pull into Maya and vice versa.

    Thanks. :)
     
  50. SamAB

    SamAB

    Joined:
    Feb 12, 2015
    Posts:
    12
    Hi @vkovec. My work focuses on taking Revit files and bringing them into Unity.
    I tried the FBX exporter but so far it seems like a regression compared to the traditional manual workflow.

    upload_2018-11-14_14-48-13.png

    My model came into Unity all exploded. Using a traditional FBX Export from 3ds Max does not do this.
    The materials from 3ds Max (Revit import) are still not supported. I am not sure what the advantage of the plugin is supposed to be.

    Unity says it has good interoperability with Revit and 3ds Max, but I am not seeing any improvement. We still need to pay for a plugin to convert the materials and the FBX link between both software does not seem to work. There is also not a lot of attention given to Revit or 3ds Max for this plugin.

    Please let me know if I am missing something regarding the functionality of the plugin. Also, let me know if you know the solution to the exploded geometry. This works fine if I do a traditional export of the FBX in 3ds MAx and drag it into Unity.

    Thanks!
     
    nawash and AdamTegkelidis like this.
Thread Status:
Not open for further replies.