Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

Unity Fbx Exporter - Export Meshes, Skinned Meshes, Terrains and Textures

Discussion in 'Assets and Asset Store' started by UnLogick, Oct 2, 2016.

  1. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    Check your mailbox for the dirty solution, I'll release it once it's properly cleaned up and tested.
     
  2. Ko8e

    Ko8e

    Joined:
    Jan 10, 2020
    Posts:
    14
    Got the solution and it works. And it would be great if you could help me with just one more thing. I want to avoid multiple copies of the same textures that are used in multiple instances.
     
  3. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    I have a branch with those changes already, never released because "something" broke... well remember me saying this was a two for one? Pretty sure that branch can land now. But that will have to wait either for this release or the next... It's fairly trivial making a lookup similar to what I'm already doing on materials, however this goes against the code/responsibilities so a bit of refactoring was needed.
     
  4. Ko8e

    Ko8e

    Joined:
    Jan 10, 2020
    Posts:
    14
    For merging the textures and materials i named them after the texture image itself in TextureExporter.cs script and it works. But it freezes the build for a few seconds on a i7. By any chance, do you happen to have any idea about how to fix that? Also, ai wanted to embed the texture and material into the fbx itself. Would that be possible??
     
  5. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    I'm guessing that what freezes is the actual autodesk fbx sdk. I've done some benchmarks into the performance in the past and the actual sdk save is the major culprit and unfortunately a part that I have no control over.

    I've focused most on editor support where such stutters are acceptable, but for runtime I can see this is a real problem. The solution would require a significant refactoring of the cleanup part of the export method, the first part of gathering data and textures must be main thread, but the sdk save can be moved to another thread to prevent it from blocking main thread.
     
  6. Ko8e

    Ko8e

    Joined:
    Jan 10, 2020
    Posts:
    14
    Is there a way to embed the textures??
     
  7. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    I was just about to send you the default reply that embedded textures are not supported when I got curious and decided to investigate further. The truth is that I added support for it, but back then unity didn't import them. Unity still doesn't automatically import it, but now has an "Extract Textures..." button on the model importer Materials tab. This allowed me to verify my old implementation and everything worked smoothly. It will require an update to the binary dll as this functionality wasn't exposed. I'll pm you an alternate dll with this toggled always on while you wait for the next release.
     
  8. Ko8e

    Ko8e

    Joined:
    Jan 10, 2020
    Posts:
    14
    Waiting for the dll
     
  9. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    Check your mail filters, I sent it just around when I posted the message if it didn't get through I'll have to upload it somewhere.
     
  10. Ko8e

    Ko8e

    Joined:
    Jan 10, 2020
    Posts:
    14
    I did not recieve it
     
  11. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    Damn mail servers trying to protect you from the dangers of the internet. o_O I sent a download link in pm.
     
  12. argel1200

    argel1200

    Joined:
    Aug 28, 2020
    Posts:
    4
    Any more news on the next update? Thanks!
     
  13. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    I'm gonna try to wrap it tomorrow during my Tuesday support, if there is no further bug reports.
     
  14. ekalfrelyt

    ekalfrelyt

    Joined:
    Feb 3, 2018
    Posts:
    1
    Can I get a refund, I bought it 3 days ago but never used it:) Thanks
     
  15. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    Sure
     
  16. kobara-kazuki

    kobara-kazuki

    Joined:
    Apr 15, 2016
    Posts:
    8
    Hi there.
    I have purchased the FBX Exporter.
    Nice asset.

    I have a few questions that I would like to ask you to answer.

    First question.

    When I export my own model, I noticed that when I move the vertices that fall on the UV boundary, the mesh is separated.

    Also, when exporting Unity's primitive sphere
    I have found that the same problem occurs.

    How can I solve this problem?

    Second question.

    If I import the model in Maya, it will be at 1/100 scale.
    I'd like to make this to 1/1 scale, but I'd like to know if there is a way to deal with this.


    Execution environment
    Unity 2019.4.12f1
    WIndows 7

    Thank you for your help.
     

    Attached Files:

  17. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    1)
    Unity splits all vertices so they are unique sets of position, normal, uv, color, etc. This means that in Unity a UV seam will always be two vertices on top of each other, no matter how you import it or generate it.

    The FBX exporter exports the mesh exactly as Unity sees it with no additional logic. So the number of vertices reported by unity should not change when exporting and re-importing. If you have a mesh that breaks this rule please send it to me so that I can investigate.

    2)
    This has been requested several times and I would like to add this feature. However I did a quick version of this once and everything looked fine, until I started playing animations or use blendshapes. I can verify it in Unity but I need someone to volunteer to verify it in Max, Maya and Blender before I'm gonna try it again.
     
  18. kobara-kazuki

    kobara-kazuki

    Joined:
    Apr 15, 2016
    Posts:
    8
    1)
    I'm sorry, sir. I did not know that specification.
    Let me ask one more question.
    According to the spec, the vertex is supposed to be split in Unity as well, but when I moved the vertex in ProBuilder, it wasn't split here.
    What does this mean?

    I'll give you the model we used for testing, if you'd like to check it out.

    2)
    I can't use Max or Blender, but I can use a little bit of Maya.
    I can't do difficult things like creating test data, but I can help you if you want to check your data.
     

    Attached Files:

  19. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    This means that ProBuilder is a tool made for unity so it pretends it's just a single vertex when moving it around. I would expect that ProBuilder would do the same if you imported my fbx back into Unity.
     
  20. kobara-kazuki

    kobara-kazuki

    Joined:
    Apr 15, 2016
    Posts:
    8
    Thanks for the reply.

    As you pointed out, I confirmed that when I select a vertex in ProBuilder and move it, the duplicate vertex is moved with it.
     
  21. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    The way I'm sending my vertices to the fbx sdk matches unity's style, so changing it to be one vertex in Max/Maya/Blender would require some restructuring and take some time, but if this is annoying to many people I don't expect there would be much risk in changing it.
     
  22. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    Not a problem. I've contacted Unity and they have processed the refund, it usually takes a couple of days for the money to be returned.

    Thank you
     
  23. argel1200

    argel1200

    Joined:
    Aug 28, 2020
    Posts:
    4
    Any word on the next release? I'm running into that plugin issue that prevents it from loading, so eager for the next release. Thanks!
     
  24. argel1200

    argel1200

    Joined:
    Aug 28, 2020
    Posts:
    4
    Any news for the next update? Before the Nov 30th sale?
     
  25. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    I'm looking into it now, got a couple of loose fixes running around in different checkouts, they're not exactly merge friendly but "soon(tm)"
     
    argel1200 likes this.
  26. matheohager5

    matheohager5

    Joined:
    Nov 18, 2020
    Posts:
    1
    Hello i bought the asset can i have a refund my computer is not good enough for using it and finally and i didnt use it cause bad pc. Order Number : #9071334421405
     
  27. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    Refund given
     
  28. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    Unity Fbx Exporter 1.5.0 is live on the asset store.
    Asset Store: Unity Fbx Exporter

    Lot's of improvements!
    • Option to export jpeg textures
    • Option to Embed Textures (should only be used with jpeg as png seems to end up being included uncompressed!)
    • More options for Texture Color Space, however I'm still missing the "perfect" way of handling this
    • Experimental Embed Shader Property, to hook up the same shader in Unity when importing. (This is not always desirable!)
    • Improved DLL lookup
    • Texture Exporting is now a lot more robust and now correctly handles materials without textures
    • Improved terrain texture exporting to support different terrain shaders. (CTS still not supported, but I plan on giving it another go)
    • Removed dependency on the Standard Shader!
    I might have missed a few others.

    Enjoy!
     
  29. cj31387

    cj31387

    Joined:
    May 23, 2012
    Posts:
    143
  30. Pode

    Pode

    Joined:
    Nov 13, 2013
    Posts:
    134
    @UnLogick is it possible to export a FBX model that support the "Physical Material" ? This material in 3DSMax maps well to Unity Standard's and to PBR.
     
  31. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    The exporter can grab the "PBR Textures" from the deferred buffers. This means it can support tinting, custom shaders and other variants in third party tools by baking a new pbr texture set. It doesn't make distinctions on Standard Shader vs any other shader.
     
  32. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    460
    Hello @UnLogick , Couple of questions:

    Does this support multiple instanced Unity terrains?
    Does this work with URP?
     
    Last edited: Nov 30, 2020
  33. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    I'm not sure exactly how they compare feature wise.

    I guess my users are the ones who can tell exactly why they prefer this exporter. A few things from the top of my head.
    • Option to bake a set of pbr textures, lets third party tools show your objects the way you intended without writing custom shaders for those tools.
    • Terrain support
    • Option between exporting current pose and Tpose on skinned meshes
    • Runtime export out of the box
    • Allows you to export entire scenes for marketing purposes, including
      • baked cloth
      • baked blendshapes
      • current pose
     
    Pode likes this.
  34. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    Yes, each terrain will become it's own mesh inside the fbx.
     
  35. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    I'm taking care of two small kids right now, I'll be back in a few hours when they sleep to answer more questions.
     
    FlightOfOne likes this.
  36. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    460
    Great. What about URP shaders (materials)? Would those textures/materials get exported?
     
  37. tyrot

    tyrot

    Joined:
    Aug 18, 2013
    Posts:
    34
    Order #18966982964434
    Hi there ,
    2019,4,11 here .. i imported the asset but it did not show up under WINDOW... ? should i do something else?
     
  38. Pode

    Pode

    Joined:
    Nov 13, 2013
    Posts:
    134
    Thanks for the answer ! To be more precise, I wanted to know if the exported Shader in the FBX file is the "Standard" from Maya/3DSMax or the "Physical".
     
  39. Sunnyunity

    Sunnyunity

    Joined:
    Nov 24, 2017
    Posts:
    1
    hai, I would like to buy it today, before that I want to know one thing, my intention is to export high vertices and tries scene (because of high poly models used in this scene) to FBX and import to Maya. then I will make the polygon counts lower to the maximum and then am going to use this low poly FBX of the scene back to my project and replace it with the high poly scene. should this work?
     
  40. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    Obviously exporting the meshes into fbx files works just fine under URP.

    However when it comes to the custom baking of pbr textures that's another matter. I haven't tested, but since the latest URP does support deferred rendering it should be possible to support this. If you can recommend a URP demo scene for me to test with that would be awesome.
     
  41. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    I honestly have no clue. If you could export the same object from Maya/Max with both shaders I'll probably be able to support either. The FBX format is a huge sandbox of options but as soon as I have concrete examples like that I can support just about anything.
     
  42. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    Yes, with a single caveat.

    Exporting all the meshes into a single fbx -> no problem
    Simplifying everything in Maya -> no problem
    Exporting all the meshes back into a single fbx -> no problem
    Importing everything back into Unity -> no problem
    Replacing all meshes in your scene without loosing all scripts and data -> requires a bit of code
     
  43. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    That sounds strange. Are you running Windows? Do you have any compile errors?
     
  44. tyrot

    tyrot

    Joined:
    Aug 18, 2013
    Posts:
    34
    yes yes on windows... it is strange ..

    I will install it into clean project...
     

    Attached Files:

  45. tyrot

    tyrot

    Joined:
    Aug 18, 2013
    Posts:
    34
    ok clean project worked .. there was a problem with a previous project... Lets give this baby a go :)
     
  46. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    Very strange, no log errors, but those warnings shows it's there... random asset store import fluke yet again. Glad a clean project worked.
     
  47. tyrot

    tyrot

    Joined:
    Aug 18, 2013
    Posts:
    34
    Frankly i found out that there is Unity made FBX exporter but right now i exported an asset .. and IT worked so good, i am insanely happy.
    Thank you for your efforts... So much clever options there .. awesome!
     
    UnLogick likes this.
  48. vmc7

    vmc7

    Joined:
    May 5, 2018
    Posts:
    4
    Hello
    Introduced to a new project, but the menu did not appear at the bottom of the window.
    I want a refund.
     
  49. kobara-kazuki

    kobara-kazuki

    Joined:
    Apr 15, 2016
    Posts:
    8
    Hello

    When I change a BlendShape value in Unity at runtime and then output the FBX, is it possible to include the BlendShape value in the FBX as well?

    (Currently, when importing FBX into Maya, the BlendShape value is 0.)
     
  50. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    That sounds strange. @tyrot experienced the exact same problem, he fixed it by importing again into a clean project. Don't know exactly what is going on here but sounds like an asset store import issue.

    Are you on windows? What version of Unity? Do you have any console errors?
     
unityunity