Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Question "Bake Axis Conversion" import setting

Discussion in '2020.1 Beta' started by Peter77, May 27, 2020.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    In the "Lean what's new in Unity 2020.1 beta" talk at around 23:45 you mention the "Bake Axis Conversion". The 2020.1 documentation unfortunately does not include an explanation for this new option yet.

    Can I use this option to fix the orientation of a FBX exported from 3dsMax, which when imported in Unity, appears rotated around the x-axis by 90 degrees?

    upload_2020-5-27_9-41-13.png
     
    konsnos and JesOb like this.
  2. Vestergaard

    Vestergaard

    Unity Technologies

    Joined:
    Oct 20, 2016
    Posts:
    31
    Yes, that is exactly what it does, no more sideways previews no weird rotations.
     
    gz7190, LeonhardP and Baste like this.
  3. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    There should be an option which axis to convert, though. I've got some fbx files which are normally on the side; with baked conversion it's on the other side.
     
  4. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,336
    Unity 2020 is apparently the year where Unity fixes all of those little things. It's greatly appreciated @Vestergaard!
     
    Vestergaard likes this.
  5. Vestergaard

    Vestergaard

    Unity Technologies

    Joined:
    Oct 20, 2016
    Posts:
    31
    Which program does the file come from, and can you share an fbx with me ?
     
  6. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    I don't know, it's from the asset store. The ones I do myself are correctly... axed.

    I can reproduce it with several models from several asset store sellers .
    This model is from Unitys own "AssetStoreOriginals" (AsiaPacific, Air_Conditioning_A, I'll send you a link)
    If I take the model without axis baking and drag it into a scene, I'll get a correctly done upright model:

    upload_2020-6-8_19-17-21.png

    If I use axis baking, I'll get the following:

    upload_2020-6-8_19-19-42.png

    Disclaimer: The camera didn't move (much), the model is rotated. And I still get the 90 degress x-axis rotation.
    Completely reset to 0,0,0, the baked axis looks like this:

    upload_2020-6-8_19-21-6.png
     
  7. Tesrym

    Tesrym

    Joined:
    Dec 2, 2012
    Posts:
    64
    I still have transforms with +90 X and up axis pointing to scene Z+.
    Seems like the only thing this checkbox does is rotate my model 180 on the Y.
    This feature is clearly not built for models with hierarchy and multiple objects.
     
  8. HikmetDuran

    HikmetDuran

    Joined:
    May 7, 2017
    Posts:
    11
    I realized that choosing forward and up axis correctly is the key when exporting the FBX (From Blender in my case)
    When I choose forward and up axis in export settings in Blender and check the Bake Axis Conversion in Unity import settings, everything looks correct with rotation of (0,0,0)

    Tried on a model with complex hierarchy and lots of children layers. It actually works!

    So for assets you already have, importing it to Blender and exporting it again with correct settings would be the solution.
     
  9. Deleted User

    Deleted User

    Guest

    Would you care to elaborate or maybe share your Blender FBX export configuration window options? I wasn't able to figure it out on my own. I always get odd (89.98) X rotations regardless of export settings.
     
  10. Kleptine

    Kleptine

    Joined:
    Dec 23, 2013
    Posts:
    282
    I have a small reproducable case for the 180 degrees flipping issue. My FBX file has the axis:
    Code (CSharp):
    1.        P: "FrontAxis", "int", "Integer", "",1
    2.        P: "FrontAxisSign", "int", "Integer", "",-1
    ie. The -Y axis should be aligned with the Unity +Z front axis.

    The rest of the file has only 3 vertices and no other transformations:
    Code (CSharp):
    1. Vertices: *9 {
    2.             a: -0.00518540572375059,2.23306512832642,0,0.256317675113678,2.23306512832642,0.494583785533905,-0.258910417556763,2.23306512832642,0.494583785533905
    3.         }
    The triangle has a positive Y coordindate, so it should show up at 2m on the -Z axis in Unity.

    But with the Bake Axis Conversion box checked, the triangle shows up exactly flipped, at 2m on the +Z axis.

    I've tried importing this file into Maya and it works as you would expect, putting the triangle on the -Z axis. It also imports correctly in Blender (when converted to binary).

    Here's the file. Should I submit a bug report?
    https://drive.google.com/file/d/1fIWzfwaNhZkB7WGuko1-nRCB7-659dHU/view?usp=sharing
     
    Last edited: Mar 25, 2021
  11. Kleptine

    Kleptine

    Joined:
    Dec 23, 2013
    Posts:
    282
    I suspect this is a weird interaction with legacy mesh fbx import code. Pre-2015, Blender exported all FBX files backwards on the Y-Axis:
    https://developer.blender.org/T43935

    The above reproduction is not Blender-specific, though, you can inspect the vertices and axis by hand.
     
  12. Fairpl3x

    Fairpl3x

    Joined:
    Feb 24, 2018
    Posts:
    14
    Hey I am really excited to see that feature added. Is there any chance to see it added to Unity 2019? if no, is there any AssetPostprocessor that gives similar results for FBX imported from Blender?
     
  13. dansav

    dansav

    Joined:
    Sep 22, 2005
    Posts:
    510
    It takes a cowboy model from the asset store built in blender and exported as fbx into a mess. Is there another solution?