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

Question Export from blender without extra rotation/scale

Discussion in 'Asset Importing & Exporting' started by neginfinity, Aug 1, 2021.

  1. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    I'm kinda fed up with this issue. Here's an example:
    upload_2021-8-1_22-52-0.png

    This is a set of meshes with a hierarchy. The meshes also include linked duplicates.

    However, when I import it in blender, this happens to the root model.
    upload_2021-8-1_22-53-54.png

    Rotated around x Axis by -90, and scaled by 100.

    It also makes dealing with local transforms very interesting, as they're not really following unity axis conventions.

    I also tired exporting as collada or obj, this results in a loss of hierarchy or loss of some objects (collada can't apply mirror modifier and does not handle linked duplicates well.

    This issue has always existed, as far as I know, but is there a way to fix it?

    I mean, I COULD write my own export/import chain for custom file format, but the point of using unity is supposed to be to avoid doing that.
     
  2. arfish

    arfish

    Joined:
    Jan 28, 2017
    Posts:
    782
  3. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
  4. arfish

    arfish

    Joined:
    Jan 28, 2017
    Posts:
    782
    The first link suggest "Option 2 - Counter-Rotate the Object, then Export" for those cases.
     
  5. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,616
    This is what I've been using:
    https://github.com/EdyJ/blender-to-unity-fbx-exporter

    I don't know for certain if it fixes anything other than the root node, but maybe you could use the provided script as a starting point for writing your own custom export. The whole project is basically just a single python script, from what I can tell.
     
    neginfinity likes this.
  6. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    Child nodes won't be converted to unity orientation convention.

    Oh, this is interesting. I'll check it out.

    If I decide to write my own tool I'd probably work without any boilerplate. I mean I already wrote several exporter tools in the past (for 3dsmax, for maya, and at least one for blender, except it doesn't work anymore), I'm just sort of tired of doing that.
     
  7. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    This seems to be working most of the time, but occasionally using this plugin causes a crash on blender side.

    I think I'll stick with this script for now.
     
  8. Loufouh

    Loufouh

    Joined:
    Jul 6, 2022
    Posts:
    10
    Hello,

    I know this thread is kind of old,
    The blender documentation is full of "TODOs" when it comes to the FBX page,
    but I found that the scaling will be normalized setting "Apply Scalings" to "FBX Units Scale",
    for the rotations, checking "Apply Transform" seems to work too.
    fbx_export_to_unity.png

    If you think that's a bad way to fix this, don't hesitate to send a reply!
     
  9. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    Does this work on skeletal meshes? Because one of the main issues was skeletal meshes.
     
  10. Loufouh

    Loufouh

    Joined:
    Jul 6, 2022
    Posts:
    10
    Actually I don't know, that's a solution I just came with
    By skeletal meshes do you mean with an armature?
     
  11. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    Yeees, a character with Armature exported from blender usually has an extra transform inserted after Root bone. Said transform often rotates scene on x axis, and can also scale it.

    This can result in situation where if you export a character with a cloak and hope to make the cloak cloth, the cloak mesh will be 10x, 100x or 1000x larger than needed.
     
  12. Loufouh

    Loufouh

    Joined:
    Jul 6, 2022
    Posts:
    10
    I just tried with a simple armature, and the scaling is ok, there's still a rotation applied to it though.