Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Blender 2.80 direct import

Discussion in 'External Tools' started by Rallix, Dec 27, 2018.

  1. Rallix

    Rallix

    Joined:
    Mar 17, 2016
    Posts:
    75
    I recently tried the new Blender 2.80 version which (apart from other things) also changes the internal file structure and the FBX export.
    Because of this, the behind-the-scenes FBX import in Unity doesn't work anymore.
    “Blender could not convert the .blend file to FBX file, […] you need to use 2.58 or later versions.”

    I didn't find any other threads mentioning this, so I'm posting this in case of other people running into the same problem. It's not really a bug since the new Blender version is still in beta (and according to estimations, won't be released until spring, so hopefully the Unity team will have enough time to provide a fix).

    The solution, for now, is to either keep using the old version 2.79 – or to export the FBX file manually.
    Files saved with version 2.80 cannot be opened in earlier versions (the only way is to export from the beta file and import in the earlier version, which causes e.g. modifiers to be lost).
     

    Attached Files:

  2. kividroid

    kividroid

    Joined:
    Jan 18, 2017
    Posts:
    3
    can you check to see if the /scripts/addons/io_scene_fbx/export_fbx.py file is missing?

    Thanks.
     
    Last edited: Jan 9, 2019
  3. Rallix

    Rallix

    Joined:
    Mar 17, 2016
    Posts:
    75
    Here are both versions 2.80 and 2.79b side-by-side.
    Blender 2.80 seems to no longer use the file anymore. However, unlike you, I'm not using an updated version from the official repo (as you mentioned in your thread), I just installed it using their Windows installer which doesn't change as often

    If I were you, I'd report it as a bug, because even though 2.80 is still in the beta phase, 2.79 is not and as such, it should be working with the latest version of Unity. Without a report, the chance of anyone looking into it anytime soon is much smaller.
    If it works when you just rename the file, I'd stick to it for the time being.
     

    Attached Files:

  4. Whippa

    Whippa

    Joined:
    Mar 23, 2018
    Posts:
    1
    OK, since 2.80 is now the official release, I figured I'd try and get this going again. This solution only works if 2.80 is the installed blender version. I tried it earlier when I had 2.79 and 2.80 just saved somewhere for testing, and of course, Unity uses all the installed blender's scripts. Not the beta's files sitting, basically unknown and unregistered with Windows.
    Go to the scripts/addons/io_scene_fbx section of blender. And make a copy of export_fbx_bin.py and rename it to export_fbx.py. Note: a better solution would be making a shortcut or link, but for some reason, I couldn't get that to function. I'm no expert on Windows symlinks though. That way the solution would stay in place across upgrades etc.
    That's it, fixed. You may need to do something to trigger a re-import in Unity.
    Caveats: I only tried this on Windows 10. I need a specific version of unity, and there's no Linux version of that version, so that's me out.
    As noted, works with a copied python file, but doesn't seem to with a link.
    Blender 2.80 has to be installed, specifically this change has to occur on the version that windows thinks opens .blend files. (see next two replies for details) (edited after following 2 replies)
    I've only tried this in one Unity version, 2017.1.3f1, but I imagine it'll work fine in all Unity versions since it started doing the blender file direct "import".
    Your io_scene_fbx folder should look like this;

    2019-08-01 07_58_39-io_scene_fbx.png

    (yes, @Blender_Bois, this works)
     
    Last edited: Aug 7, 2019
    jbb1979 likes this.
  5. Rallix

    Rallix

    Joined:
    Mar 17, 2016
    Posts:
    75
    Basically, Blender 2.8 has to be the program your blend files are associated with. It is possible to point the file association to Blender beta executable, but you have to make a change in the registry, e.g.:
    HKEY_LOCAL_MACHINE\SOFTWARE\Classes\blendfile\shell\open\command
    and change the path value to something like: "C:\path\to\blender2.8\blender.exe" "%1"

    Default.png


    This alone made the import work for me.
     
    jbb1979 and Whippa like this.
  6. Jovssen

    Jovssen

    Joined:
    Jun 3, 2016
    Posts:
    31
    I think you can open the blender install folder in command prompt (cd "C:\Program Files\Blender Foundation\Blender"), and do "blender -r"
    to register the file extension
     
    jbb1979, Whippa and Rallix like this.
  7. dhruvin084

    dhruvin084

    Joined:
    Feb 25, 2019
    Posts:
    1
    It Works thanks!
     
    jbb1979 and Whippa like this.
  8. jbb1979

    jbb1979

    Joined:
    Aug 6, 2019
    Posts:
    320
    I just installed Blender a few days ago, and I can drag and drop Models, No problem - -