Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

Import fbx multi-core performance Question

Discussion in 'Formats & External Tools' started by Skade88, Feb 23, 2021.

  1. Skade88

    Skade88

    Joined:
    Jan 2, 2017
    Posts:
    15
    Howdy y'all!

    I am working on a game project in Unity that has a Blender to Unity workflow. We make our game's level in Blender, export it from Blender as an fbx file and then import it into Unity. Imports are taking quite a while since I turned on the UV unwrap option in Unity so light maps can be baked. Every time we import the level it takes a solid 45 min to an hour. My machine has 20 cores but Unity is only making use of one of them. Unity makes use of all 20 of my cores when I bake a light map for instance, so I know it can do multi-threaded tasks on my computer. Is there an option I am missing somewhere in Unity I need to enable to make all of Unity's functionality multi-threaded or is the UV Unwrap process inherently something that Unity cannot do in a multi-core way?

    I am running Unity 2019.4.19f on Ubuntu 20.04.

    Best,
    David Brooks
     
  2. GeorgeIngDCC

    GeorgeIngDCC

    Unity Technologies

    Joined:
    Jan 14, 2020
    Posts:
    29
    So the FBX SDK - the heart of our pipeline - is single-threaded, which is sadly a limitation we're unable to get around. It's an external API.

    That said, we are both improving the performance of the FBX Import pipeline over the next couple of Unity releases, and beyond that, we are looking into how we might better leverage multi-core processors across all importers.
     
    Skade88 likes this.
  3. Skade88

    Skade88

    Joined:
    Jan 2, 2017
    Posts:
    15
    Thanks for the response!

    Are y'all using the Autodesk FBX SDK or an open source FBX SDK. If its an Open Source FBX SDK I would consider contributing to the project to see if I could help improve it so the FBX import process could get better in Unity.

    Regarding the Unity Lightmap UV Unwrap feature I mentioned in the post. We have noticed something in the workflow that is adding a lot of "Unity is Frozen" moments.

    Hypothetical workflow that we have experienced:
    1. 3D artist updates a mesh in Blender and exports to an FBX file.
    2. 3D artist imports the FBX file into Unity with the "Generate Lightmap UVs" feature turned on for the FBX file in question.
    3. Unity on the 3D Artist's machine is frozen for a solid 45 min to an hour while it generates the Lightmap UVs for the mesh.
    4. 3D Artist has Unity generate the lighting/bake the lightmaps. This uses all the cores on the machine but does not freeze Unity.
    5. 3D Artist pushes the updates to our Unity Collab Repo.
    6. Programmer pulls updates from the Unity Collab Repo.
    7. Programmer's Unity is frozen for a solid 45 min to an hour while Unity Generates the Lightmap UVs for the mesh just pulled from the Unity Collab Repo.
    We don't understand why Unity is running the Generate Lightmap UVs on the mesh in the FBX file again when it is pulled down from the Collab Repo. Shouldn't the result of the Generate Lightmap UVs process be pushed to the Unity Collab Repo so other members of the team wont have to have their local machine Generate the Lightmap UVs again?

    Currently, every time we push an update to Unity Collab containing a mesh from an FBX with the "Generate Lightmap UVs" feature turned on every member of our team will be facing a frozen Unity editor for 45 min to an hour while each of their computers regenerates the Lightmap UVs that the 3D artist's Unity had already generated when they pull that update from Unity Collab.

    If we could get it to where the Frozen Unity editor only happens once when the 3D artist imports the FBX file into the project that would be a big boost to our productivity. Any pro tips on changes we could make to our workflow... or if there is a setting in Unity or Unity Collab we are just missing... anything that can help us have less "Unity is Frozen" time would be helpful.

    If we could get rid of the "Unity is Frozen" time completely while Unity is busy importing the FBX file in the background that would be ideal. For instance our developers could be working on an animation state machine that has nothing to do with the FBX in question while the import happens or working in a scene that does not contain the FBX file in question.

    Thanks again for your time and help on this!

    Best,
    David Brooks


    Best,
    David Brooks
     
  4. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,169
    You might want to check out the unity Accelerator server.
    Unity colaborate only shares the sources assets and the meta data.
    The accelerator server can distribute already imported asset data to users.
    https://docs.unity3d.com/Manual/UnityAccelerator.html
    It is designed to integrate with colaborate.
    Its the new and improved version of the old chache server.
     
unityunity