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

Internal Unity FBX importer transform wrong on single meshes.

Discussion in 'Editor Workflows' started by Quatum1000, Apr 28, 2018.

  1. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
    Hi Team,

    There is a ugly bug in Unity that transform a single mesh by x + 90°. But importing 2 or multiple meshes in one fbx works fine.

    I use 3dsmax and started with the exporter from 2011 until FBX Plug-in version: 2017.0.1 Release (241562).
    But unity fail each time if the fbx contain a single mesh resulting with a wrong rotation.

    I tried the 3dsmax fbx exporter Axis Conversion to z-up. No success.

    The solution is NOT to place a prefab into the scene and un-rotate the failed rotation. I required the pure meshes in unity from the fbx file by collecting from the Resource folder.

    Curiosity is rotating a single mesh in 3dsmax against the failed rotation, cause Unity the transform to add 180° at import, so rotation stays wrong..

    Any ideas or solutions?

    Code (CSharp):
    1. var g = Resources.Load("Editor_NodeClicker") as GameObject;
    2.             if (g) {
    3.                 var mesh = g.GetComponent<MeshFilter>();
    4.                 if (mesh.sharedMesh) {
    5.                     Debug.Log(mesh.sharedMesh.name);
    6.                     mf.sharedMesh = mesh.sharedMesh;
    7.                 }
    8.             }
    Export Single
    Untitled-1.jpg

    Auto Import Unity
    Untitled-2.jpg


    Export 2 meshes in one fbx:
    Untitled-3.jpg


    AutoImport Unity is fine.
    Untitled-4.jpg
     
    strich likes this.
  2. strich

    strich

    Joined:
    Aug 14, 2012
    Posts:
    372
    This is a massive issue for us too. I wish they'd fix it.
     
  3. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
    Seems the issue only on the preview window.