Search Unity

Importing from Blender: The Y-Z mixup

Discussion in 'Asset Importing & Exporting' started by AndrewBCrisp, Nov 5, 2018.

  1. AndrewBCrisp

    AndrewBCrisp

    Joined:
    Sep 10, 2018
    Posts:
    5
    Hi all. I've just recently started to make simple models in Blender and import them into Unity, and I'm running into what I can best call a minor annoyance (at least, I think it's minor...).

    When I make a model, I export it to .fbx. Importing the .fbx to Unity is pretty straightforward, and I can drop an instance of the mesh into the scene without issues, but the thumbnail of the model in the Project window appears rotated from it's actual orientation. I suspect this is due to the fact that Blender and Unity have their vertical axes different (Y for blender, Z for Unity) and that the imported mesh reflects this difference.

    Now since the model appears in the proper orientation in the scene, I'm considering this as no more than an annoyance, but, is there a way to get the thumbnail to reflect the proper orientation, if only for my own sanity? Contraiwise, is leaving this alone perhaps masking a deeper problem with orientation that might bite me later?

    Thoughts? Opinions?
     
  2. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    I personally don't worry about that problem. There are ways to get around it, changing export settings, etc... but I haven't found it worth messing with them much. I'm one of the ones that keeps the .blend file in my asset folder(instead of worrying about exporting to fbx). My workaround in Unity is to make the model render object a child of my main object. Then the child object can be rotated and scaled as needed. There is also no issue with colliders and such because those are part of the parent object, totally separate from the model rendering child object.
     
  3. muiroc

    muiroc

    Joined:
    Jan 17, 2017
    Posts:
    2
    Disclaimer: I didn't try these in depth, just for a prototype and I'm not an rigger/animator!

    See attached image, these are the settings I'm currently using: I get no extra rotation nor scale on the MESH data.
    Still, in the model prefab, the parent of the root bone has 90 deg rotation so the animation data problably is not "neutral".

    Animations imports ok, even root motion, for humanoid I just had to select enforce T pose (since my armature isn't T pose) and select the root bone.

    In blender, units are meters/degrees, 1.0 scale

    In my rig, the root bone in blender is aligned with the world coordinante system: this had some effects on how root motion was first imported (character moved up instead of forward) so first i added an "unityroot" child bone of root, with a counter rotation and selected that as rootmotion but... this felt weird so instead i removed it and just changed the primary/secondary bone axes in the exporer, which also nicely worked for the bones used as sockets, so now for example using a parent constraint on the socket bone just works (tm), but this really depends on your rig

    The weird thing is that it works... I mean, the warning in EXPERIMENTAL is pretty clear (known broken)

    Didn't try: blend shapes, objects parented to bones.
     

    Attached Files:

  4. AndrewBCrisp

    AndrewBCrisp

    Joined:
    Sep 10, 2018
    Posts:
    5
    Thanks for the tip, muiroc. I'm nowhere near the point of making rigged models / characters so issues of animation have not come up yet. But from what kburkhart84 said, it sounds like making the adjustments may not be worth the potential hassle. So I'll leave things be until a later time, and maybe then give your tweak a try.
     
  5. Ne0mega

    Ne0mega

    Joined:
    Feb 18, 2018
    Posts:
    755
    I make my models with +Z as forward and +Y as up. Same with armatures.
    In the end, it saves a ton of headaches.
    You can also model regularly in blender, then when done, rotate object -90X, 180Z, CTRL+A and choose apply rotation.
    However, I do not recommend this route, as rotating armatures often gives me headaches I don't want.

    I use main, FBXall (not FBX unit scale), selected units only, and no experimental apply transform.